/** * myVideo.js */ var maxHeight = 10000; var maxWidth = 10000; var basePath, videoId; var body_resize = function(){ maxHeight = document.documentElement.clientHeight; maxWidth = document.documentElement.clientWidth; $("#my-video").css('height',maxHeight+'px'); $("#my-video").css('width',maxWidth+'px'); } var myload = function(){ var hasFlash = 0; //是否安装了flash var flashVersion = 0; //flash版本 var isIE = /*@cc_on!@*/0; //是否IE浏览器 if (isIE) { var swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); if (swf) { hasFlash = 1; VSwf = swf.GetVariable("$version"); flashVersion = parseInt(VSwf.split(" ")[1].split(",")[0]); } } else { if (navigator.plugins && navigator.plugins.length > 0) { var swf = navigator.plugins["Shockwave Flash"]; if (swf) { hasFlash = 1; var words = swf.description.split(" "); for (var i = 0; i < words.length; ++i) { if (isNaN(parseInt(words[i]))) continue; flashVersion = parseInt(words[i]); } } } } basePath = document.getElementById('basePath').value; videoId = document.getElementById('videoId').value; $("#openFlash").css('display','none'); var my_video = document.getElementById('my-video'); var source = document.createElement('source'); source.setAttribute('src','rtmp://47.103.74.123:1935/live/'+videoId); source.setAttribute('type','rtmp/flv'); my_video.appendChild(source); $(window).resize(function(){ body_resize(); }); body_resize(); if(hasFlash){ videojs('my-video').play(); } $(".openFlashTips").css('display','none'); }