EXTJS 3.x 播放视频 完美解决 。

直接上代码,跟同事研究半天。

查看图片已经写了,再写一篇视频的。

思路:新建一个window,再pannel中 直接放html,html标签中可以是任何格式的媒体,视频,图片,mp3,input,div,li等等。然后再刷新里面的html,达到查看列表记录中图片或者视频的目的。

var showPig = {
			text: '查看工单视频',
			width: 85,
			disabled: false,
			iconCls: 'download',
			handler:function() {
				var	selectedRecord = grid.getSelectionModel().getSelected();
	            if(selectedRecord == null)
	            {
	                showAlertMsg("没有选择记录",grid);
	                return;
	            }
	            var imgPath = selectedRecord.data.imgPath;
	            html = '<div style="width:100%;height:100%;"><video id="videoSource" style="width:100%;height:100%;" src="'+Ext.contextPath+imgPath+'" controls="controls">您的浏览器不支持 video 标签。</video><div>';//
	            songPlayer.show();
	            Ext.getCmp("playerPanel").body.update(html); 
	          //Ext.getCmp('imgsrc').initialConfig.autoEl.src = Ext.contextPath+imgPath;
		}
	};
	menuArr.push(showPig);
	menuArr.push('-');
 var playerForm=new Ext.Panel({  
        xtype : 'panel',  
        id : 'playerPanel',  
        width:600,  
        height:600, 
        html:""
    })
    var songPlayer = new Ext.Window({  
        layout : 'fit',  
        width:600,  
        height:600,  
        modal : true,  
        frame: true,
        closable : false, 
        items : [playerForm]  ,
    	buttons: [{
			id : 'ensure2',
			text: '确定',
			handler: function() {
				songPlayer.hide();
				Ext.getCmp("playerPanel").body.update("");  
			}
		},{
			text: '关闭',
			handler: function() {
				songPlayer.hide();
				Ext.getCmp("playerPanel").body.update("");  
//				var oVideo = document.getElementById('videoSource');
//				oVideo.pause();
//				  Ext.getCmp('playerPanel').html ="";
			}
		}]
    }); 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

somdip

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值