(function(){const L="?v20201212";let g=0,f=!1,b=0,k=new Date().getTime(),p=0,y={types:{},event:function(h){var t=this.types[h];if(t)for(var e=0;es){const l=(s/t*100).toFixed(0);e.css("height",`${l}%`).attr("class","pic_default")}else{const l=(t/s*100).toFixed(0);e.css("width",`${l}%`).attr("class","pic_default")}}createVideo(t,e,s,l,r,n,c,x){this.id=t,this.url=s,this.domId=e,this.autoplay=l,this.showControls=n,this.thumbUrl=c,this.isLive=r;var w="",j=1;this.seek=x;var T,i,a,o,d,v=0;const u=`
`;if($("#"+e).length===0?this.publish("video_create_error","\u672A\u627E\u5230\u5BB9\u5668\uFF0C\u64AD\u653E\u5668\u521B\u5EFA\u5931\u8D25"):($("#"+this.domId).html(u),this.publish("video_create_complate",{videoId:this.id,documentId:this.domId})),g=$("#wjplayer").width(),this.getVideoSize(),typeof s=="string"){var S=this.getVideoType(s);S==="flv"?this.createFlv():S==="m3u8"?this.createHLS():this.createSwf()}else this.flashChecker().f!=0?(this.playerUrl=s.rtmpUrl,this.createSwf()):flvjs.isSupported()?(this.playerUrl=s.flvUrl,this.createFlv()):(this.playerUrl=s.HLSUrl,this.createHLS());window.location.href.indexOf("lookcourse.html")>-1&&$(".courseWare_content_box").height($("#live_content").height())}checkStram(){}createControls(){let t=`
00:50
2.0\u500D 1.5\u500D 1.25\u500D 1.0\u500D 0.75\u500D
\u753B\u9762\u6BD4\u4F8B: \u9ED8\u8BA4 16:9 4:3
\u753B\u9762\u65CB\u8F6C: \u5DE6\u8F6C \u53F3\u8F6C
\u4E0A\u6B21\u89C2\u770B\u81F3
00:00
\u5904\uFF0C\u5DF2\u4E3A\u60A8\u81EA\u52A8\u64AD\u653E
\u4ECE\u5934\u5F00\u59CB
100%
--:--:--/--:--:--
\u500D\u901F
;`;$(`#${this.domId}`).append(t),this.seek>0?($("#seektime").html(this.s_to_hs(this.seek)),this.player.currentTime(this.seek),setTimeout(function(){$(".seekDiv").hide()},4e3)):$(".seekDiv").hide(),$(".seeklabel1").click(function(){e.player.currentTime(0),$(".seekDiv").hide()});const e=this;function s(){const i=e.player.currentTime(),a=e.player.duration();let o=(i/a*$("#"+e.domId).width()).toFixed(2);const d=`${e.s_to_hs(i)} / ${e.s_to_hs(a)}`;$(".time").html(d),$(".progressing").width(o);let v=$(".vjs-control-text-loaded-percentage").html();v=v.replace("%",""),$(".loading").width(Number(v)/100*$("#"+e.domId).width()),o>$("#"+e.domId).width()-5&&(o=$("#"+e.domId).width()-5),o<0&&(o=0),$(".thumb").css("left",o+"px")}function l(){$("#bar1")[0].style.height=0+"px",$("#box")[0].style.top=100+"px",$("#volumeTitle").text(0+"%"),$(".volume").attr("src","/design/designstatic/chatroom/video/img/novolume.png"),$(".volume").attr("title","\u9759\u97F3"),e.player.volume(0)}function r(){$(".volume").attr("src","/design/designstatic/chatroom/video/img/volume.png?v=22222"),$(".volume").attr("title","\u97F3\u91CF"),$("#bar1")[0].style.height=100+"px",$("#box")[0].style.top=0+"px",$("#volumeTitle").text(100+"%"),e.player.volume(1)}window.WJPlayerUpdateProgress=s,this.player.on("timeupdate",function(){e.player.muted()&&!b&&(l(),layer&&layer.msg("\u6CA1\u6709\u58F0\u97F3\uFF0C\u8BF7\u6253\u5F00\u53F3\u4E0B\u89D2\u97F3\u91CF","",3),b=1),!e.thumbStartDrag&&s()}),this.player.on("playing",function(){$(".playbtn").attr("src","/design/designstatic/chatroom/video/img/pause.png"),$(".playbtn").attr("title","\u6682\u505C")}),this.player.on("pause",function(){$(".playbtn").attr("src","/design/designstatic/chatroom/video/img/play.png"),$(".playbtn").attr("title","\u64AD\u653E")}),this.player.on("ended",function(){$(".playbtn").attr("src","/design/designstatic/chatroom/video/img/replay.png"),$(".playbtn").attr("title","\u91CD\u64AD"),e.exitFullscreen()});let n=this.player.volume();n=n-1,$("#bar1")[0].style.height=104-n*100+"px",$("#box")[0].style.top=n*100+"px",$("#volumeTitle").text(this.player.volume()*100+"%"),$(".speed").mouseover(function(i){i.stopPropagation(),$(".speeddiv").show(),$(".volumeDiv").hide(),$(".settingdiv").hide()}),$(".volume").mouseover(function(i){i.stopPropagation(),$(".volumeDiv").show(),$(".settingdiv").hide(),$(".speeddiv").hide()}),$(".setting").mouseover(function(i){i.stopPropagation(),$(".settingdiv").show(),$(".volumeDiv").hide(),$(".speeddiv").hide()}),$(".settingdiv").mouseout(function(i){const a=window.event||i;var o=a.toElement||a.relatedTarget,d=this;if(d.contains(o))return!1;$(".settingdiv").hide()}),$(".full").mouseover(function(i){i.stopPropagation(),$(".settingdiv").hide(),$(".volumeDiv").hide(),$(".speeddiv").hide()}),$(".volume").mouseout(function(i){setTimeout(function(){c===0&&$(".volumeDiv").hide()},1e3)});var c=0;$(".volumeDiv").mouseover(function(i){c=1}),$(".volume").click(function(i){$("video").length&&$("video")[0].muted&&($("video")[0].muted=!1),e.player.volume()>0?l():r()}),$(".speeddiv").mouseout(function(i){const a=window.event||i;var o=a.toElement||a.relatedTarget,d=this;if(d.contains(o))return!1;$(".speeddiv").hide()}),$(".volumeDiv").mouseout(function(i){const a=window.event||i;var o=a.toElement||a.relatedTarget,d=this;if(d.contains(o))return!1;$(".volumeDiv").hide(),c=0});var x=new Date().getTime(),w=new Date().getTime(),j=3e3;const T=setInterval(function(){let i=new Date().getTime();const a=$(".playbtn").attr("src").search("play")>-1;i-w>j&&!a&&$(".controls").hide()},3e3);$("#"+this.domId).mouseout(function(i){const a=window.event||i;var o=a.toElement||a.relatedTarget,d=this;if(d.contains(o))return!1;$(".controls").hide()}),$("#"+this.domId).mousemove(function(i){w=new Date().getTime(),$(".controls").show()}),$(".js-video-ratio").click(function(i){const a=$(this),o=a.data("type"),d=$("#wjplayer video");$(".js-video-ratio").removeClass("current"),a.addClass("current");const v="vjs-tech";let u="";switch(d.attr("style",""),o){case"default":{u="pic_default",e.getVideoStyle(e.videoRatio);break}case"16_9":{u="pic_169";break}case"4_3":{u="pic_43";break}case"spread":{u="pic_full";break}default:break}d.attr("class",`${v} ${u}`)}),$(".js-spin").click(function(i){switch($(this).data("type")){case"left":{p-=90;break}case"right":{p+=90;break}default:break}p=Math.abs(p)===360?0:p,$("#wjplayer").css("transform",`rotate(${p}deg)`)}),$(".speedtitle").click(function(i){switch($(".speedtitle").removeClass("selectspeed"),$(this).addClass("selectspeed"),i.target.innerHTML){case"2.0\u500D":e.speed=2;break;case"1.5\u500D":e.speed=1.5;break;case"1.25\u500D":e.speed=1.25;break;case"1.0\u500D":e.speed=1;break;case"0.75\u500D":e.speed=.75;break}e.player.playbackRate(e.speed),e.publish("speedUpdate",e.speed)}),$(".thumb").mousedown(function(i){k=new Date().getTime(),e.thumbStartDrag=!0}),$(".thumb").mouseover(function(i){$(".tooltips").hide()}),$(window).mousemove(function(i){if(e.thumbStartDrag){const a=$(".progress").offset().left;e.newX=i.clientX-a,e.newX<20&&(e.newX=20),e.newX>$("#"+e.domId).width()-10&&(e.newX=$("#"+e.domId).width()-10),$(".thumb").css("left",e.newX),$(".progressing").width(e.newX),$(".tooltips").show(),$(".selecttime").html(e.s_to_hs(e.newX/$("#"+e.domId).width()*e.player.duration())),$(".tooltips").css("left",e.newX-20)}e.index===1&&(e.moveL=i.clientY-e.mouseY,e.newL=e.boxL+e.moveL,e.newL<0&&(e.newL=0),e.newL>100&&(e.newL=100),$("#bar1")[0].style.height=104-e.newL+"px",$("#box")[0].style.top=e.newL+"px",e.player.volume(1-e.newL/100),$("#volumeTitle").text(100-e.newL+"%"))}),$(".progress").mousemove(function(i){if(i.target.classList[0]==="thumb"){$(".tooltips").hide();return}$(".tooltips").show(),$(".selecttime").html(e.s_to_hs(i.offsetX/$("#"+e.domId).width()*e.player.duration())),$(".tooltips").css("left",i.offsetX-20)}),$(".progress").mouseout(function(i){$(".tooltips").hide()}),$(document).on("touchstart","#wjplayer video",function(){$(".controls").show()}),setTimeout(()=>{$(".playbtn").attr("src").search("play")>-1&&$(".controls").show()},1e3),setTimeout(()=>{$(".playbtn").attr("src").search("play")>-1&&$(".controls").show()},5e3),$(window).resize(function(i){var a=$("#wjplayer").width();a!==g&&(g=a,s())}),$(".progress").click(function(i){i.target.classList[0]!=="thumb"&&(e.thumbStartDrag||e.player.currentTime(i.offsetX/$("#"+e.domId).width()*e.player.duration()))}),$(".playbtn").click(function(i){$(".playbtn").attr("src").search("play")>-1?e.player.play():e.player.pause()}),$("#box").mousedown(function(i){e.index=1,e.boxL=$("#box")[0].offsetTop,e.mouseY=i.clientY-$("#bar")[0].offsetTop}),$(window).mouseup(function(i){if(i.stopPropagation(),i.preventDefault(),!_()&&(e.index=0,e.thumbStartDrag)){var a=e.newX/$("#"+e.domId).width()*e.player.duration();e.player.currentTime(a)}setTimeout(function(){e.thumbStartDrag=!1},50)}),$(".full").click(function(){f?(e.exitFullscreen(),$(".full").attr("src","/design/designstatic/chatroom/video/img/full.png"),$(".full").attr("title","\u5168\u5C4F"),f=!1):(e.fullScreen(),$(".full").attr("src","/design/designstatic/chatroom/video/img/exfulls.png"),$(".full").attr("title","\u9000\u51FA\u5168\u5C4F"),f=!0)})}s_to_hs(t){let e=Math.floor(t/60);e=e<10?`0${e}`:e;let s=Math.floor(t%60);return s=s<10?`0${s}`:s,`${e}:${s}`}resize(){}fullScreen(){const t=$("#"+this.domId)[0];t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}exitFullscreen(){try{if(!f)return;document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}catch(t){console.log("\u9000\u51FA\u5168\u5C4F:",t)}}createSwf(){videojs.options.flash.swf="/design/designstatic/chatroom/video/VideoJS.swf",document.getElementById(this.id).className="video-js vjs-default-skin vjs-big-play-centered vjs-fluid";const t=this;this.player=videojs(t.id,{techOrder:["flash"],sources:[this.playerUrl],autoplay:this.autoplay},function(){var e=document.getElementById(t.id+"_flash_api");console.log("videojs\u64AD\u653E\u5668\u521D\u59CB\u5316\u6210\u529F",e),e.getFunctionName(t.id),y.addEventListener(t.id+"_noliveStream",function(s){t.publish("noLive")}),y.addEventListener(t.id+"_liveStream",function(s){t.publish("aLive")})})}createFlv(){const t=this;this.player=flvjs.createPlayer({type:"flv",url:t.playerUrl,isLive:!0},{fixAudioTimestampGap:!1}),document.getElementById(this.id).className="centeredVideo flvVideo vjs-full",this.player.attachMediaElement(document.getElementById(this.id)),this.player.load(),this.player.play(),this.player.on("alive",function(){t.publish("aLive","\u672A\u627E\u5230\u5BB9\u5668\uFF0C\u64AD\u653E\u5668\u521B\u5EFA\u5931\u8D25")}),this.player._msectl.on("update_end",function(e){t.player._msectl._mediaSource.readyState==="ended"}),this.player.on("error",function(e){console.log("online","error"),t.publish("noLive"),t.player.unload(),t.player.load(),t.player.play()}),this.player.on("noLiveStream",function(){console.log("online","noLiveStream"),t.publish("noLive")})}createHLS(){this.player=videojs(this.id,{techOrder:["html5","flash"],controls:!1,bigPlayButton:!1,autoplay:this.autoplay,fluid:!0,hasAudio:!1,hasVideo:!0,errorDisplay:!1,poster:this.thumbUrl,language:"zh-CN"}),this.showControls&&this.createControls(),this.player.src({src:this.url,type:"application/x-mpegURL"})}flashChecker(){let t=0,e=0;if(document.all){let n=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");n&&(t=1,VSwf=n.GetVariable("$version"),e=parseInt(VSwf.split(" ")[1].split(",")[0])),console.log(n)}else{if(navigator.plugins&&navigator.plugins.length>0){var s=navigator.plugins["Shockwave Flash"];if(s){t=1;for(var l=s.description.split(" "),r=0;r