|
在DEMO上稍为修改 同时播放三路及以上视频 IE浏览器崩溃了
我在webbvcu_demo.html 的打开视频处同时打开了三路视频 浏览器就崩溃了 代码如下:
<input type="button" value="打开视频" />
<script type="text/javascript">
function openvide() {
for (var i = 0; i < 6; i++) {
if (i == 0) { bv_open_video("PU_4C1F",1); }
if (i == 1) { bv_open_video("PU_21025151",0); }
if (i == 2) { bv_open_video("PU_21121131",2); }
}
}
</script>
//以下JS方法基本没动, 只是传入了我需要打开的设备
var play_panel_index = 0;
function bv_open_video(puid, channel) {
/**创建播放div*/
var div = document.createElement("div");
div.id = div.name = "div_play_panel" + play_panel_index;
document.body.appendChild(div); /**添加到body中*/
/**创建播放object*/
var obj = document.createElement('object');
obj.id = ("WebPlayPanelWnd" + play_panel_index); /**播放窗口,注意*/
obj.classid = "clsid:CDE6C639-4BA8-4A09-81EB-DCE76A61FE98";
obj.width = '400px';
obj.height = '300px';
div.appendChild(obj);/**添加到div中*/
setTimeout('_bv_open_video(' + play_panel_index + ',"' + puid + '",' + channel + ')', 1000); /**obj添加后无法立即立即使用*/
play_panel_index++;
}
function _bv_open_video(playid, puidvalue, channel) {
var obj = document.getElementById("WebPlayPanelWnd" + playid);
if (obj) {
var hwnd = obj.GetWMHwnd();/**窗口句柄*/
var puid = document.getElementById('id_puid').value;
var chanel_id = document.getElementById('id_chanel_id').value;
var hdialog = WebBVCU.OpenDialog(puidvalue, channel, 10, hwnd, 50, 50);
appendHtml('OpenDialog: ' + hdialog);
/**记录打开数据*/
var data = new dialog_data();
data.hdialog = hdialog;
data.puid = puid;
data.chanelid = 0;
data.playwindowid = playid;
open_dialog_data.push(data);
}
}
|
|