(function(){"use strict";var VideoX=window&&window.VideoX&&window.VideoX["default"];var supportVedioTag=checkSupportVedioTag();var supportFlash=checkSupportFlash();var replaced=0;var played=false;var videoHost=["vodcdn.alicdn.com","v.biz.ku6.com","player.pps.tv","t.focosee.com"];var option={trun:false,msg:'警告:浏览器不支持视频,请使用新浏览器。去下载'};function readyHandle(trun,msg){if(trun){option.trun=trun}if(msg){option.msg=msg}var embedDomList=document.getElementsByTagName("embed");var arr=[];for(var i=0;i0){return true}}return false}function replaceDom(embed){var parentNode=embed.parentNode||embed.parentElement;var id="J_replace_vedio_"+ ++replaced;var p=document.createElement("div");p.setAttribute("id",id);p.style.display="inline-block";var height=embed.getAttribute("height");var width=embed.getAttribute("width");if(height){p.style.height=+height?+height+"px":height.replace(";","")}else{p.style.height=embed.style.height}if(width){p.style.width=+width?+width+"px":width.replace(";","")}else{p.style.width=embed.style.width}parentNode.insertBefore(p,embed);return p}function replaceYouku(embed,youkuSrc){var parentNode=embed.parentNode||embed.parentElement;var id="J_replace_vedio_"+ ++replaced;var iframe=document.createElement("iframe");iframe.setAttribute("id",id);iframe.setAttribute("src",youkuSrc);iframe.setAttribute("scrolling","no");iframe.setAttribute("frameborder","0");iframe.setAttribute("allowfullscreen","true");iframe.style.display="inline-block";iframe.style.display="inline-block";var height=embed.getAttribute("height");var height=embed.getAttribute("height");var width=embed.getAttribute("width");if(height){iframe.style.height=+height?+height+"px":height.replace(";","")}else{iframe.style.height=embed.style.height}if(width){iframe.style.width=+width?+width+"px":width.replace(";","")}else{iframe.style.width=embed.style.width}parentNode.insertBefore(iframe,embed);return iframe}function parseFlashVars(str){var opts={};if(!str)return opts;var flashVars=str.split("&");for(var i=0;i0){swf=swf.replace(".swf",".mp4");swf=swf.replace("/e/1/","/e/6/");result=swf}return result}function checkSupportFlash(){var hasFlash=false;try{var fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(fo)hasFlash=true}catch(e){if(navigator.mimeTypes["application/x-shockwave-flash"]!=undefined)hasFlash=true}return hasFlash}function checkSupportVedioTag(){if(!!document.createElement("video").canPlayType){var vidTest=document.createElement("video");var oggTest=vidTest.canPlayType('video/ogg; codecs="theora, vorbis"');if(!oggTest){var h264Test=vidTest.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');if(!h264Test){return false}else{if(h264Test=="probably"){return true}else{return false}}}else{if(oggTest=="probably"){return true}else{return false}}}else{return false}}window.embedReplace=window.embedReplace||{};window.embedReplace.supportFlash=supportFlash;window.embedReplace.supportVedioTag=supportVedioTag;window.embedReplace.checkSupportVedioTag=checkSupportVedioTag;window.embedReplace.checkSupportFlash=checkSupportFlash;window.embedReplace.replaceEmbed=replaceEmbed;window.embedReplace.replaceAll=readyHandle})();