!function(A){var t={};function e(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return A[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=A,e.c=t,e.d=function(A,t,n){e.o(A,t)||Object.defineProperty(A,t,{enumerable:!0,get:n})},e.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},e.t=function(A,t){if(1&t&&(A=e(A)),8&t)return A;if(4&t&&"object"==typeof A&&A&&A.__esModule)return A;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:A}),2&t&&"string"!=typeof A)for(var i in A)e.d(n,i,function(t){return A[t]}.bind(null,i));return n},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,t){return Object.prototype.hasOwnProperty.call(A,t)},e.p="",e(e.s=28)}([function(A,t){A.exports=function(A){var t=[];return t.toString=function(){return this.map(function(t){var e=function(A,t){var e,n=A[1]||"",i=A[3];if(!i)return n;if(t&&"function"==typeof btoa){var o=(e=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"),r=i.sources.map(function(A){return"/*# sourceURL="+i.sourceRoot+A+" */"});return[n].concat(r).concat([o]).join("\n")}return[n].join("\n")}(t,A);return t[2]?"@media "+t[2]+"{"+e+"}":e}).join("")},t.i=function(A,e){"string"==typeof A&&(A=[[null,A,""]]);for(var n={},i=0;i=0&&c.splice(t,1)}function m(A){var t=document.createElement("style");return void 0===A.attrs.type&&(A.attrs.type="text/css"),g(t,A.attrs),h(A,t),t}function g(A,t){Object.keys(t).forEach(function(e){A.setAttribute(e,t[e])})}function f(A,t){var e,n,i,o;if(t.transform&&A.css){if(!(o=t.transform(A.css)))return function(){};A.css=o}if(t.singleton){var r=s++;e=l||(l=m(t)),n=x.bind(null,e,r,!1),i=x.bind(null,e,r,!0)}else A.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=function(A){var t=document.createElement("link");return void 0===A.attrs.type&&(A.attrs.type="text/css"),A.attrs.rel="stylesheet",g(t,A.attrs),h(A,t),t}(t),n=function(A,t,e){var n=e.css,i=e.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(n=d(n)),i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var r=new Blob([n],{type:"text/css"}),a=A.href;A.href=URL.createObjectURL(r),a&&URL.revokeObjectURL(a)}.bind(null,e,t),i=function(){y(e),e.href&&URL.revokeObjectURL(e.href)}):(e=m(t),n=function(A,t){var e=t.css,n=t.media;if(n&&A.setAttribute("media",n),A.styleSheet)A.styleSheet.cssText=e;else{for(;A.firstChild;)A.removeChild(A.firstChild);A.appendChild(document.createTextNode(e))}}.bind(null,e),i=function(){y(e)});return n(A),function(t){if(t){if(t.css===A.css&&t.media===A.media&&t.sourceMap===A.sourceMap)return;n(A=t)}else i()}}A.exports=function(A,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=r()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var e=p(A,t);return u(e,t),function(A){for(var n=[],i=0;i=0)return A.length;for(var n=0,i=0,o=0,r=A.length-1;n<=r;){if(o++,e(t,A[(i=Math.floor((r+n+1)/2))-1])>=0&&e(t,A[i])<0)return i;e(t,A[i-1])<0?r=i-1:e(t,A[i])>=0?n=i:console.error("Program Error"),o>1500&&console.error("Too many run cycles.")}return-1},binsert:function(t,e,n){var i=A.bsearch(t,e,n);return t.splice(i,0,e),i}};return A}()),c=function(A,t){for(var e in t)t.hasOwnProperty(e)&&(A[e]=t[e]);function n(){this.constructor=A}A.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},d=function(){function A(A,t){void 0===A&&(A=0),void 0===t&&(t=0),this._pools=[[]],this.avoid=1,this._width=A,this._height=t}return A.prototype.willCollide=function(A,t){return A.stime+A.ttl>=t.stime+t.ttl/2},A.prototype.pathCheck=function(A,t,e){for(var n=A+t.height,i=t.right,o=0;on||e[o].bottomi))return!1;if(this.willCollide(e[o],t))return!1}return!0},A.prototype.assign=function(A,t){for(;this._pools.length<=t;)this._pools.push([]);var e=this._pools[t];if(0===e.length)return A.cindex=t,0;if(this.pathCheck(0,A,e))return A.cindex=t,0;for(var n=0,i=0;ithis._height);i++)if(this.pathCheck(n,A,e))return A.cindex=t,n;return this.assign(A,t+1)},A.prototype.add=function(A){A.height>this._height?(A.cindex=-2,A.y=0):(A.y=this.assign(A,0),s.binsert(this._pools[A.cindex],A,function(A,t){return A.bottomt.bottom?1:0}))},A.prototype.remove=function(A){if(!(A.cindex<0)){if(A.cindex>=this._pools.length)throw new Error("cindex out of bounds");var t=this._pools[A.cindex].indexOf(A);t<0||this._pools[A.cindex].splice(t,1)}},A.prototype.setBounds=function(A,t){this._width=A,this._height=t},A}(),u=function(A){function t(){A.apply(this,arguments)}return c(t,A),t.prototype.add=function(t){A.prototype.add.call(this,t),t.x=(this._width-t.width)/2},t.prototype.willCollide=function(A,t){return!0},t.prototype.pathCheck=function(A,t,e){for(var n=A+t.height,i=0;in||e[i].bottom0&&this.animate()},Object.defineProperty(A.prototype,"x",{get:function(){return null!==this._x&&void 0!==this._x||(this.align%2==0?this._x=this.dom.offsetLeft:this._x=this.parent.width-this.dom.offsetLeft-this.width),this.absolute?this._x:this._x/this.parent.width},set:function(A){this._x=A,this.absolute||(this._x*=this.parent.width),this.align%2==0?this.dom.style.left=this._x+"px":this.dom.style.right=this._x+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"y",{get:function(){return null!==this._y&&void 0!==this._y||(this.align<2?this._y=this.dom.offsetTop:this._y=this.parent.height-this.dom.offsetTop-this.height),this.absolute?this._y:this._y/this.parent.height},set:function(A){this._y=A,this.absolute||(this._y*=this.parent.height),this.align<2?this.dom.style.top=this._y+"px":this.dom.style.bottom=this._y+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"width",{get:function(){return null!==this._width&&void 0!==this._width||(this._width=this.dom.offsetWidth),this._width},set:function(A){this._width=A,this.dom.style.width=this._width+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"height",{get:function(){return null!==this._height&&void 0!==this._height||(this._height=this.dom.offsetHeight),this._height},set:function(A){this._height=A,this.dom.style.height=this._height+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"size",{get:function(){return this._size},set:function(A){this._size=A,this.dom.style.fontSize=this._size+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"color",{get:function(){return this._color},set:function(A){this._color=A;var t=A.toString(16);t=t.length>=6?t:new Array(6-t.length+1).join("0")+t,this.dom.style.color="#"+t,0===this._color&&(this.dom.className=this.parent.options.global.className+" rshadow")},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"alpha",{get:function(){return this._alpha},set:function(A){this._alpha=A,this.dom.style.opacity=Math.min(this._alpha,this.parent.options.global.opacity)+""},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"border",{get:function(){return this._border},set:function(A){this._border=A,this._border?this.dom.style.border="1px solid #00ffff":this.dom.style.border="none"},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"shadow",{get:function(){return this._shadow},set:function(A){this._shadow=A,this._shadow||(this.dom.className=this.parent.options.global.className+" noshadow")},enumerable:!0,configurable:!0}),Object.defineProperty(A.prototype,"font",{get:function(){return this._font},set:function(A){this._font=A,this._font.length>0?this.dom.style.fontFamily=this._font:this.dom.style.fontFamily=""},enumerable:!0,configurable:!0}),A.prototype.time=function(A){this.ttl-=A,this.ttl<0&&(this.ttl=0),this.movable&&this.update(),this.ttl<=0&&this.finish()},A.prototype.update=function(){this.animate()},A.prototype.invalidate=function(){this._x=null,this._y=null,this._width=null,this._height=null},A.prototype._execMotion=function(A,t){for(var e in A)if(A.hasOwnProperty(e)){var n=A[e];this[e]=n.easing(Math.min(Math.max(t-n.delay,0),n.dur),n.from,n.to-n.from,n.dur)}},A.prototype.animate=function(){if(this._alphaMotion&&(this.alpha=(this.dur-this.ttl)*(this._alphaMotion.to-this._alphaMotion.from)/this.dur+this._alphaMotion.from),0!==this.motion.length){var A=Math.max(this.ttl,0),t=this.dur-A-this._motionStart[this._curMotion];return this._execMotion(this.motion[this._curMotion],t),this.dur-A>this._motionEnd[this._curMotion]?(this._curMotion++,void(this._curMotion>=this.motion.length&&(this._curMotion=this.motion.length-1))):void 0}},A.prototype.finish=function(){this.parent.finish(this)},A.prototype.toString=function(){return["[",this.stime,"|",this.ttl,"/",this.dur,"]","(",this.mode,")",this.text].join("")},A.LINEAR=function(A,t,e,n){return A*e/n+t},A}()),h=function(A){function t(t,e){A.call(this,t,e),this.dur*=this.parent.options.scroll.scale,this.ttl*=this.parent.options.scroll.scale}return c(t,A),Object.defineProperty(t.prototype,"alpha",{set:function(A){this._alpha=A,this.dom.style.opacity=Math.min(Math.min(this._alpha,this.parent.options.global.opacity),this.parent.options.scroll.opacity)+""},enumerable:!0,configurable:!0}),t.prototype.init=function(t){void 0===t&&(t=null),A.prototype.init.call(this,t),this.x=this.parent.width,this.parent.options.scroll.opacity<1&&(this.alpha=this._alpha),this.absolute=!0},t.prototype.update=function(){this.x=this.ttl/this.dur*(this.parent.width+this.width)-this.width},t}(p),y=function(){var A=function(A,t){for(var e=Math.PI/180,n=A*e,i=t*e,o=Math.cos,r=Math.sin,a=[o(n)*o(i),o(n)*r(i),r(n),0,-r(i),o(i),0,0,-r(n)*o(i),-r(n)*r(i),o(n),0,0,0,0,1],l=0;l0)){var A=(new Date).getTime(),e=this;t=window.setInterval(function(){var t=(new Date).getTime()-A;A=(new Date).getTime(),e.onTimerEvent(t,e)},10)}},this.stopTimer=function(){window.clearInterval(t),t=0}}return t.prototype.stop=function(){this.stopTimer()},t.prototype.start=function(){this.startTimer()},t.prototype.seek=function(A){this.position=s.bsearch(this.timeline,A,function(A,t){return At.stime?1:0})},t.prototype.validate=function(A){return null!=A&&this.filter.doValidate(A)},t.prototype.load=function(A){this.timeline=A,this.timeline.sort(function(A,t){return A.stime>t.stime?2:A.stimet.date?1:A.datet.dbid?1:A.dbidt.stime?2:A.stimet.date?1:A.datet.dbid?1:A.dbid0;)this.runline[0].finish();this.dispatchEvent("clear")},t.prototype.setBounds=function(){for(var A in this.width=this.stage.offsetWidth,this.height=this.stage.offsetHeight,this.dispatchEvent("resize"),this.csa)this.csa[A].setBounds(this.width,this.height);this.stage.style.perspective=this.width*Math.tan(40*Math.PI/180)/2+"px",this.stage.style.webkitPerspective=this.width*Math.tan(40*Math.PI/180)/2+"px"},t.prototype.init=function(){this.setBounds(),null==this.filter&&(this.filter=new /** * Comment Filters Module Simplified (only supports modifiers & types) * @license MIT * @author Jim Chen */ function(){this.modifiers=[],this.runtime=null,this.allowTypes={1:!0,4:!0,5:!0,6:!0,7:!0,8:!0,17:!0},this.doModify=function(A){for(var t=0;t=this.timeline.length||Math.abs(this._lastPosition-A)>=2e3){if(this.seek(A),this._lastPosition=A,this.timeline.length<=this.position)return}else this._lastPosition=A;for(;this.position0&&this.runline.length>this.limiter||this.validate(this.timeline[this.position])&&this.send(this.timeline[this.position])},t.prototype.rescale=function(){},t.prototype.send=function(t){if(8!==t.mode){if(null==this.filter||null!=(t=this.filter.doModify(t))){if(1===t.mode||2===t.mode||6===t.mode)var e=new h(this,t);else e=new p(this,t);switch(e.mode){case 1:e.align=0;break;case 2:case 4:e.align=2;break;case 5:e.align=0;break;case 6:e.align=1}switch(e.init(),this.stage.appendChild(e.dom),e.mode){default:case 1:this.csa.scroll.add(e);break;case 2:this.csa.scrollbtm.add(e);break;case 4:this.csa.bottom.add(e);break;case 5:this.csa.top.add(e);break;case 6:this.csa.reverse.add(e);break;case 17:case 7:0===t.rY&&0===t.rZ||(e.dom.style.transform=A(t.rY,t.rZ),e.dom.style.webkitTransform=A(t.rY,t.rZ),e.dom.style.OTransform=A(t.rY,t.rZ),e.dom.style.MozTransform=A(t.rY,t.rZ),e.dom.style.MSTransform=A(t.rY,t.rZ))}e.y=e.y,this.dispatchEvent("enterComment",e),this.runline.push(e)}}else this.scripting&&this.scripting.eval(t.code)},t.prototype.sendComment=function(A){this.send(A)},t.prototype.finish=function(A){this.dispatchEvent("exitComment",A),this.stage.removeChild(A.dom);var t=this.runline.indexOf(A);switch(t>=0&&this.runline.splice(t,1),A.mode){default:case 1:this.csa.scroll.remove(A);break;case 2:this.csa.scrollbtm.remove(A);break;case 4:this.csa.bottom.remove(A);break;case 5:this.csa.top.remove(A);break;case 6:this.csa.reverse.remove(A);break;case 7:}},t.prototype.addEventListener=function(A,t){void 0!==this._listeners[A]?this._listeners[A].push(t):this._listeners[A]=[t]},t.prototype.dispatchEvent=function(A,t){if(void 0!==this._listeners[A])for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"controlbar";!function(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),this.sendEl=e,this.danmukuList=t,this.html=m(i.a),this.danmuControlHtml=m(r.a),this.sendEl=e,this.danmuInput=null===e?null:m(l.a),this.CM=null,this.userDanmuOpen=!0}return f(A,[{key:"createEl",value:function(A,t){var e=this,n=t._options&&t._options.language;if(this.isEn=n&&"en-us"===n,null!==this.danmuInput&&(this.danmuInput.querySelector(".danmu-input-enter").innerText=this.isEn?"Enter":"发送",this.danmuInput.querySelector("input").setAttribute("placeholder",this.isEn?"Input danmu":"输入弹幕")),this.danmuControlHtml.querySelector(".player-tooltip.close").innerText=this.isEn?"Close Bullect":"关闭弹幕",this.danmuControlHtml.querySelector(".player-tooltip.open").innerText=this.isEn?"Open Bullect":"打开弹幕","controlbar"===this.sendEl){var i=this.danmuControlHtml.querySelector(".ali-danmu-input-wrap");i.style.display="inline-block",i.appendChild(this.danmuInput)}else if(null!==this.sendEl)if(g(this.sendEl))this.sendEl.appendChild(this.danmuInput);else{if("string"!=typeof this.sendEl)throw new Error("sendEl must be an element or selector string");var o=document.querySelector(this.sendEl);if(!g(o))throw new Error("sendEl must be an element or selector string");o.appendChild(this.danmuInput)}A.querySelector(".prism-controlbar").appendChild(this.danmuControlHtml);var r=A.querySelector("video").nextElementSibling;r?A.insertBefore(this.html,r):A.appendChild(this.html),this.CM=new y(this.html.querySelector(".danmu")),this.CM.init(),this.CM.load(this.danmukuList),A.querySelector("video").ontimeupdate=function(){null!==A.querySelector("video")&&e.CM.time(1e3*A.querySelector("video").currentTime)};var a=this.danmuControlHtml.querySelector(".icon-danmu-close"),l=this.danmuControlHtml.querySelector(".icon-danmu-open");if(a.onclick=function(){e.userDanmuOpen=!1,a.style.display="none",l.style.display="inline-block",e.CM.clear(),e.CM.stop()},l.onclick=function(){l.style.display="none",a.style.display="inline-block",e.userDanmuOpen=!0,e.CM.start()},null!==this.danmuInput){var s=this.danmuInput.querySelector(".ali-danmu-input input");this.danmuInput.querySelector(".danmu-input-enter").onclick=this.sendDanmuHandle.bind(this),s.onkeydown=function(A){13===A.keyCode&&e.sendDanmuHandle.call(e)}}}},{key:"sendDanmuHandle",value:function(){var A=this.danmuInput.querySelector(".ali-danmu-input input"),t=A.value;""!==t&&(this.send({mode:1,text:t,stime:1e3,size:[16,18,25,36,45][this.randomIndex(5)],color:[16777215,255,13369344,16738047,16777011][this.randomIndex(5)]}),A.value="",A.focus())}},{key:"randomIndex",value:function(A){return Math.floor(Math.random()*A)}},{key:"play",value:function(A,t){this.userDanmuOpen&&this.CM.start()}},{key:"pause",value:function(A,t){this.userDanmuOpen&&this.CM.stop()}},{key:"send",value:function(A){this.CM.send(A)}},{key:"insert",value:function(A){this.CM&&this.CM.insert(A)}},{key:"dispose",value:function(){null!==this.danmuInput&&this.danmuInput.parentNode&&this.danmuInput.parentNode.removeChild(this.danmuInput)}}]),A}(),M=e(8),x=e.n(M),b=(e(34),function(){function A(A,t){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:"random";!function(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),this.text=t,this.style=e||{fontSize:"14px",color:"#fff"},this.html=m(x.a),this.bulletPosition=n}return b(A,[{key:"createEl",value:function(A,t){this.html.innerText=this.text,A.appendChild(this.html)}},{key:"ready",value:function(A,t){var e=this;A.getOptions(),!1===A.getOptions().autoplay&&(this.html.style.animationPlayState="paused"),Object.keys(this.style).forEach(function(A){return e.html.style[A]=e.style[A]});var n=this.html.offsetHeight,i=parseInt(A.getOptions().height.replace("px",""))-n;if("bottom"===this.bulletPosition)this.html.style.bottom=0;else{var o="top"===this.bulletPosition?0:this.randomTop(i);this.html.style.top=o}"random"===this.bulletPosition&&this.html.addEventListener("animationiteration",function(){e.html.style.top=e.randomTop(i)})}},{key:"playing",value:function(A,t){this.html.style.animationPlayState="running"}},{key:"timeupdate",value:function(A,t){var e=A.el(),n=e.querySelector(".bullet-screen");if(n){"bullet-screen"!==n.className&&(n.className="bullet-screen");var i=getComputedStyle(n),o=i.getPropertyValue("display"),r=i.getPropertyValue("opacity"),a=i.getPropertyValue("visibility"),l=this.text,s=n.innerText;"none"===o&&n.style.setProperty("display","block"),"1"!==r&&n.style.setProperty("opacity","1"),"hidden"===a&&n.style.setProperty("visibility","visible"),l!=s&&(n.innerText=l)}else e.appendChild(this.html)}},{key:"pause",value:function(A,t){this.html.style.animationPlayState="paused"}},{key:"randomTop",value:function(A){return Math.floor(Math.random()*A)+"px"}}]),A}(),w=e(9),I=e.n(w),T=(e(36),function(){function A(A,t){for(var e=0;e0&&void 0!==arguments[0]&&arguments[0],e=arguments[1],n=arguments[2];!function(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),this.html=m(I.a),this.autoPlay=t,this.getTime=e||this._getTime,this.saveTimeFunction=n||this._saveTime,this.hasMemoryDisplay=!1}return T(A,[{key:"createEl",value:function(A){A.appendChild(this.html)}},{key:"ready",value:function(A,t){var e=this,n=A.getOptions(),i=n.vid||n.source.replace(/\?.*$/,""),o=this.getTime(i);if(null!==(o=o?parseInt(o):0)&&0!==o&&!this.hasMemoryDisplay)if(this.hasMemoryDisplay=!0,this.autoPlay)A.seek(o),"playing"!==A.getStatus()&&A.play();else{var r=this.getVideoTime(o);if(o!==parseInt(A._duration)){var a='
\n \n 上次看到\n '+r+'\n 跳转播放\n
';this.html.innerHTML=a;var l=setTimeout(function(){e.html.innerHTML=""},15e3);this.html.querySelector(".icon-close").onclick=function(){e.html.innerHTML="",clearTimeout(l)},this.html.querySelector(".play-jump").onclick=function(){A.seek(o),"playing"!==A.getStatus()&&A.play(),e.html.innerHTML="",clearTimeout(l)}}}document.onvisibilitychange=function(){"hidden"===document.visibilityState&&0!==A.getCurrentTime()&&(this.saveTimeFunction(i,A.getCurrentTime()),play)},window.onbeforeunload=function(){0!==A.getCurrentTime()&&this.saveTimeFunction(i,A.getCurrentTime())}}},{key:"error",value:function(A,t){this.setMemory(A)}},{key:"dispose",value:function(A,t){this.setMemory(A)}},{key:"setMemory",value:function(A){var t=A.getOptions(),e=t.vid||t.source.replace(/\?.*$/,"");this.saveTimeFunction(e,A.getCurrentTime())}},{key:"getVideoTime",value:function(A){var t=Math.round(A),e=Math.floor(t/3600),n=Math.floor((t-3600*e)/60),i=t-3600*e-60*n;return n<10&&(n="0"+n),i<10&&(i="0"+i),0===e?n+":"+i:e+":"+n+":"+i}},{key:"_getTime",value:function(A){return localStorage.getItem(A)}},{key:"_saveTime",value:function(A,t){localStorage.setItem(A,t)}}]),A}(),E=e(10),Q=e.n(E),B=(e(38),function(){function A(A,t){for(var e=0;e-1?a:0,this.playingVideoIndex=a>-1?a:0),this.listHtml.querySelector(".list").childNodes[0].className="video-item active",A.appendChild(this.listHtml)}},{key:"ready",value:function(A,t){var e=this;this.controlHtml.querySelector(".icon-skip-previous").onclick=function(){0!==e.playingVideoIndex?e.playVideo(A,e.playingVideoIndex-1):e.playlistTip(e.isEn?"Already the first one~":"已经是第一个了~",A._el)},this.controlHtml.querySelector(".icon-skipnext").onclick=function(){e.playingVideoIndex!==e.playlist.length-1?e.playVideo(A,e.playingVideoIndex+1):e.playlistTip(e.isEn?"Already the last one~":"已经是最后一个了~",A._el)},this.listHtml.querySelector(".list").onclick=function(t){var n=t.target;if("video-item"===n.className){var i=parseInt(n.getAttribute("data-index"));e.playVideo(A,i)}}}},{key:"clearHideListTimeout",value:function(){null!==this.listHideTimeout&&(clearTimeout(this.listHideTimeout),this.listHideTimeout=null)}},{key:"playVideo",value:function(A,t){this.playingVideoIndex!==t&&(this.playingVideoIndex=parseInt(t),A.loadByUrl(this.playlist[t].source),this.listHtml.querySelector(".video-item.active").className="video-item",this.listHtml.querySelector(".list").childNodes[t].className="video-item active")}},{key:"tooglePlaylist",value:function(){var A=this;this.clearHideListTimeout(),"30%"===this.listHtml.style.width?this.listHtml.style.width=0:(this.listHtml.style.width="30%",this.listHideTimeout=setTimeout(function(){A.listHtml.style.width=0},5e3))}},{key:"playlistTip",value:function(A,t){var e=document.createElement("div");e.className="playlist-skip-tip",e.innerText=A,t.appendChild(e),setTimeout(function(){t.removeChild(e)},3e3)}},{key:"computedListDom",value:function(A){return A.map(function(A,t){return'
'+A.name+"
"}).join("")}}]),A}(),Y=e(13),U=e.n(Y),G=(e(42),function(){function A(A,t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),this.previewDuration=t,this.html=m(U.a),null!==e&&this.insertHTtml(e,"previewEndHtml"),null!==n&&this.insertHTtml(n,"previewBarHtml")}return G(A,[{key:"play",value:function(A){this.previewEnd&&(A._el.querySelector(".center").classList.remove("preview-hide"),A.seek(0),this.previewEnd=!1)}},{key:"insertHTtml",value:function(A,t){var e="previewEndHtml"===t?".preview-custom":".preview-custom-bar",n=this.html.querySelector(e);if("string"==typeof A)if("#"===A[0]){var i=document.querySelector(A);i?n.innerHTML=i.innerHTML:console.warn("[aliplayer components warn]: Invalid parameter "+t+", can't find element by this id")}else n.innerHTML=A;else console.warn("[aliplayer components warn]: Invalid parameter "+t+", "+t+" must be a string type")}},{key:"ready",value:function(A){var t=parseInt(A.getDuration());this.videoDuration=t,!this.invalidPreview&&this.previewDuration>=t&&(this.invalidPreview=!0,console.warn("[aliplayer components warn]: Invalid parameter previewDuration, previewDuration must be less than the video duration!")),0!==this.previewDuration&&this.previewDuration1?" "+o+(this.isEn?" senconds":" 秒"):" "+r+(this.isEn?" minutes":" 分钟"),o<60&&(r=" "+o+(this.isEn?" senconds":" 秒")),this.html.querySelector(".preview-time").innerText=r;var l=A.querySelector("video").nextElementSibling;l?A.insertBefore(this.html,l):A.appendChild(this.html),this.html.querySelector(".preview-vod-close").addEventListener("click",function(){e.html.querySelector(".preview-component-tip").style.display="none"}),t.setPreviewTime(Number(this.previewDuration))}},{key:"closePreviewLayer",value:function(){this.previewEnd=!1,this.html.querySelector(".preview-component-layer").style.display="none"}},{key:"timeupdate",value:function(A){if(!this.previewEnd&&0!==this.previewDuration&&this.previewDuratione?(n=e-330+"px",this.html.querySelector(".icon-arrowdown").style.left=e*t.left-e+317+"px"):this.html.querySelector(".icon-arrowdown").style.left="-2px";var i=t.progressMarker,o=i.coverUrl,r=i.title,a=i.describe,l=i.offset;this.currentOffset=l,this.html.style.left=n,this.imgEle.src=o,this.timeEle.innerText=r,this.describeEle.innerText=a,this.html.style.display="block"}},{key:"markerDotOut",value:function(A,t){var e=this;this.timer=setTimeout(function(){e.html.style.display="none"},100)}}]),A}(),P=e(15),R=e.n(P),J=e(16),W=e.n(J),K=(e(49),function(){function A(A,t){for(var e=0;e'+A.desc+""});this.html.querySelector(".quality-list").innerHTML=i.join(""),this.definition,0==this.hasCreated&&this.definition&&(n.querySelector('li[data-def="'+this.definition+'"]').className="current"),this.hasCreated=!0;var o=null;e.onclick=function(){n.style.display="block"},e.onmouseleave=function(){o=setTimeout(function(){n.style.display="none"},100)},n.onmouseenter=function(){clearTimeout(o)},n.onmouseleave=function(){n.style.display="none"},n.onclick=function(e){var n=e.target,i=n.dataset.def,o=n.innerText;if(i&&"current"!==n.className){var r=t._urls.find(function(A){return A.definition===i});A.loadByUrl(r.Url,A.getCurrentTime(),!0,!0),t.setCurrentQuality(r.desc,r.definition),t.modalHtml.style.display="block",t.modalHtml.querySelector("span.current-quality-tag").innerText=r.desc}t.getQuality(i,o)}}},{key:"ready",value:function(A){this.modalHtml.style.display="none";var t=document.querySelector(".prism-setting-item.prism-setting-quality");t&&t.classList.add("player-hidden")}}]),A}(),_=e(17),$=e.n(_),AA=(e(51),function(){function A(A,t){for(var e=0;e=i)&&t.play()}},1e3)}}},{key:"removeComponent",value:function(){this.html.parentNode.removeChild(this.html),this.html=null}},{key:"ready",value:function(A){null!==this.html&&A.pause()}}]),A}(),cA=e(20),dA=e.n(cA),uA=(e(57),e(21)),pA=e.n(uA),hA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},yA="function"==typeof Symbol&&"symbol"===hA(Symbol.iterator)?function(A){return void 0===A?"undefined":hA(A)}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":void 0===A?"undefined":hA(A)},mA=window.device,gA={},fA=[];window.device=gA;var vA=window.document.documentElement,MA=window.navigator.userAgent.toLowerCase(),xA=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","roku","pov_tv","hbbtv","ce-html"];function bA(A){return-1!==MA.indexOf(A)}function NA(A){return vA.className.match(new RegExp(A,"i"))}function wA(A){var t=null;NA(A)||(t=vA.className.replace(/^\s+|\s+$/g,""),vA.className=t+" "+A)}function IA(A){NA(A)&&(vA.className=vA.className.replace(" "+A,""))}function TA(){gA.landscape()?(IA("portrait"),wA("landscape"),DA("landscape")):(IA("landscape"),wA("portrait"),DA("portrait")),BA()}function DA(A){for(var t in fA)fA[t](A)}gA.macos=function(){return bA("mac")},gA.ios=function(){return gA.iphone()||gA.ipod()||gA.ipad()},gA.iphone=function(){return!gA.windows()&&bA("iphone")},gA.ipod=function(){return bA("ipod")},gA.ipad=function(){return bA("ipad")},gA.android=function(){return!gA.windows()&&bA("android")},gA.androidPhone=function(){return gA.android()&&bA("mobile")},gA.androidTablet=function(){return gA.android()&&!bA("mobile")},gA.blackberry=function(){return bA("blackberry")||bA("bb10")||bA("rim")},gA.blackberryPhone=function(){return gA.blackberry()&&!bA("tablet")},gA.blackberryTablet=function(){return gA.blackberry()&&bA("tablet")},gA.windows=function(){return bA("windows")},gA.windowsPhone=function(){return gA.windows()&&bA("phone")},gA.windowsTablet=function(){return gA.windows()&&bA("touch")&&!gA.windowsPhone()},gA.fxos=function(){return(bA("(mobile")||bA("(tablet"))&&bA(" rv:")},gA.fxosPhone=function(){return gA.fxos()&&bA("mobile")},gA.fxosTablet=function(){return gA.fxos()&&bA("tablet")},gA.meego=function(){return bA("meego")},gA.cordova=function(){return window.cordova&&"file:"===location.protocol},gA.nodeWebkit=function(){return"object"===yA(window.process)},gA.mobile=function(){return gA.androidPhone()||gA.iphone()||gA.ipod()||gA.windowsPhone()||gA.blackberryPhone()||gA.fxosPhone()||gA.meego()},gA.tablet=function(){return gA.ipad()||gA.androidTablet()||gA.blackberryTablet()||gA.windowsTablet()||gA.fxosTablet()},gA.desktop=function(){return!gA.tablet()&&!gA.mobile()},gA.television=function(){for(var A=0;A1},gA.landscape=function(){return screen.orientation&&Object.prototype.hasOwnProperty.call(window,"onorientationchange")?screen.orientation.type.includes("landscape"):window.innerHeight/window.innerWidth<1},gA.noConflict=function(){return window.device=mA,this},gA.ios()?gA.ipad()?wA("ios ipad tablet"):gA.iphone()?wA("ios iphone mobile"):gA.ipod()&&wA("ios ipod mobile"):gA.macos()?wA("macos desktop"):gA.android()?gA.androidTablet()?wA("android tablet"):wA("android mobile"):gA.blackberry()?gA.blackberryTablet()?wA("blackberry tablet"):wA("blackberry mobile"):gA.windows()?gA.windowsTablet()?wA("windows tablet"):gA.windowsPhone()?wA("windows mobile"):wA("windows desktop"):gA.fxos()?gA.fxosTablet()?wA("fxos tablet"):wA("fxos mobile"):gA.meego()?wA("meego mobile"):gA.nodeWebkit()?wA("node-webkit"):gA.television()?wA("television"):gA.desktop()&&wA("desktop"),gA.cordova()&&wA("cordova"),gA.onChangeOrientation=function(A){"function"==typeof A&&fA.push(A)};var EA="resize";function QA(A){for(var t=0;t3&&void 0!==arguments[3]?arguments[3]:"关闭广告";jA(this,A),this.adVideoSource=t,this.adLink=e,this.html=m(dA.a),this.adInterval=null,this.adCloseFunction=n,this.html.querySelector(".video-ad-close-text").innerText=i,this.adDuration=null,this.player=null}return kA(A,[{key:"createEl",value:function(A,t){var e=this,n=t._options&&t._options.language;this.isEn=n&&"en-us"===n,this.html.querySelector(".video-ad-detail").innerText=this.isEn?"For more information":"查看广告详情",this.html.querySelector(".limit").innerText=this.isEn?"Your browser limits autoplay":"您的浏览器限制",this.html.querySelector(".manual").innerText=this.isEn?"Please Click":"自动播放请点击";var i=this.html.querySelector("#video-ad-content");i.setAttribute("src",this.adVideoSource);var o=this;this.html.querySelector(".icon-player-play").onclick=function(){e.playVideoAd(),e.html.querySelector(".autoplay-video-ad").style.display="none"},i.addEventListener("canplay",function A(){i.removeEventListener("canplay",A),document.getElementById("loadflag").style.display="none",o.adDuration=Math.ceil(i.duration),o.html.querySelector("#video-ad-duration").innerText=o.adDuration,i.play().then(function(){o.setAdInterval()}).catch(function(A){o.html.querySelector(".autoplay-video-ad").style.display="block"})});var r=this.html.querySelector(".video-ad-link"),a=this.html.querySelector(".video-ad-detail");r.setAttribute("href",this.adLink),a.setAttribute("href",this.adLink),A.appendChild(this.html)}},{key:"ready",value:function(A,t){var e=this;null!==this.html&&(A.pause(),this.player=A,this.html.querySelector(".video-ad-close label").onclick=function(){"function"==typeof e.adCloseFunction?e.adCloseFunction(e):e.closeVideoAd(),document.getElementById("player-con").getElementsByTagName("video")[0].play()})}},{key:"pauseVideoAd",value:function(){this.clearAdInterval(),this.html.querySelector("#video-ad-content").pause()}},{key:"playVideoAd",value:function(){this.setAdInterval(),this.html.querySelector("#video-ad-content").play()}},{key:"clearAdInterval",value:function(){null!==this.adInterval&&clearInterval(this.adInterval),this.adInterval=null}},{key:"setAdInterval",value:function(){var A=this,t=this.html.querySelector("#video-ad-duration");this.adInterval=setInterval(function(){A.adDuration-=1,A.adDuration<=0?(A.closeVideoAd(),document.getElementById("player-con").getElementsByTagName("video")[0].play()):t.innerText=A.adDuration},1e3)}},{key:"closeVideoAd",value:function(){this.clearAdInterval(),this.html.parentNode.removeChild(this.html),this.html=null,this.player.getOptions().autoplay&&this.player.play()}}]),A}(),SA=function(){function A(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"关闭广告";jA(this,A),this.adVideoSource=t,this.adLink=e,this.html=m(pA.a),this.adInterval=null,this.adCloseFunction=n,this.html.querySelector(".video-ad-close-text").innerText=i,this.html.querySelector(".video-ad-link").setAttribute("href",this.adLink),this.html.querySelector(".video-ad-detail").setAttribute("href",this.adLink),this.adDuration=null}return kA(A,[{key:"createEl",value:function(A,t){var e=t._options&&t._options.language;this.isEn=e&&"en-us"===e,this.html.querySelector(".video-ad-detail").innerText=this.isEn?"For more information":"查看广告详情",this.html.querySelector(".limit").innerText=this.isEn?"Your browser limits autoplay":"您的浏览器限制",this.html.querySelector(".manual").innerText=this.isEn?"Please Click":"自动播放请点击",A.appendChild(this.html),A.querySelector("video"),A.querySelector("video").setAttribute("preload","load");var n=A.querySelector(".prism-controlbar");n.className=n.className+" controlbar-element-hidden";var i=A.querySelector(".prism-big-play-btn");i.className=i.className+" controlbar-element-hidden"}},{key:"created",value:function(A){var t=this;if(this.player=A,this.vdSource=A.getOptions().source,A.loadByUrl(this.adVideoSource),this.html.querySelector(".autoplay-video-ad").onclick=function(){null!==t.adDuration&&(A.loadByUrl(t.adVideoSource),t.html.parentNode.querySelector(".prism-big-play-btn").click())},null===this.adDuration){this.adDuration=void 0;var e=this.html.parentNode.querySelector("video"),n=this;e.addEventListener("timeupdate",function t(){var i=e.duration;isNaN(i)||0===i||(e.removeEventListener("timeupdate",t),n.adDuration=Math.ceil(e.duration),"none"!==n.html.querySelector(".autoplay-video-ad").style.display&&(n.html.querySelector(".autoplay-video-ad").style.display="none",A.play()),n.html.querySelector("#video-ad-duration").innerText=n.adDuration,n.setAdInterval())})}}},{key:"ready",value:function(A){var t=this;this.html.querySelector(".video-ad-close label").onclick=function(){"function"==typeof t.adCloseFunction?t.adCloseFunction(t):t.closeVideoAd(),document.getElementById("player-con").getElementsByTagName("video")[0].play()}}},{key:"setAdInterval",value:function(){var A=this,t=this.html.querySelector("#video-ad-duration");this.adInterval=setInterval(function(){A.adDuration-=1,A.adDuration<=0?(A.closeVideoAd(),document.getElementById("player-con").getElementsByTagName("video")[0].play()):t.innerText=A.adDuration},1e3)}},{key:"closeVideoAd",value:function(){this.clearAdInterval(),this.player.loadByUrl(this.vdSource);var A=this.html.parentNode.querySelector(".prism-controlbar");A.className=A.className.replace(" controlbar-element-hidden","");var t=this.html.parentNode.querySelector(".prism-big-play-btn");t.className=t.className.replace(" controlbar-element-hidden",""),this.player.getOptions().autoplay&&this.player.play(),this.html.parentNode.removeChild(this.html)}},{key:"clearAdInterval",value:function(){null!==this.adInterval&&clearInterval(this.adInterval),this.adInterval=null}},{key:"playVideoAd",value:function(){this.setAdInterval(),this.player.play()}},{key:"pauseVideoAd",value:function(){this.clearAdInterval(),this.player.pause()}}]),A}(),zA=LA;CA.mobile()&&(zA=SA);var OA=zA,YA=e(22),UA=e.n(YA),GA=e(23),FA=e.n(GA),HA=(e(59),function(){function A(A,t){for(var e=0;e'+A.text+""});e.html.querySelector(".caption-list").innerHTML='
  • 字幕
  • '+n.join("")});var i=this.html.querySelector(".current-caption"),o=this.html.querySelector(".caption-list");0==this.hasCreated&&this.definition&&(o.querySelector('li[data-def="'+this.definition+'"]').className="current"),this.hasCreated=!0;var r=null;i.onclick=function(){o.style.display="block"},i.onmouseleave=function(){r=setTimeout(function(){o.style.display="none"},100)},o.onmouseenter=function(){clearTimeout(r)},o.onmouseleave=function(){o.style.display="none",e.modalHtml.style.display="none"},o.onclick=function(A){var n=A.target,i=n.dataset.def;if(i&&"current"!==n.className){var o=e.captionList.find(function(A){return A.value===i});t._ccService.switch(o.value),e.setCurrentCaption(o.text,o.value),e.modalHtml.style.display="block",e.modalHtml.querySelector(".switchimg").style.display="block",e.modalHtml.querySelector("span.current-caption-tag").innerText=o.text}}}},{key:"setCurrentCaption",value:function(A,t){var e=this.html.querySelector(".current-caption");e.innerText=A,e.dataset.def=t,this.definition=t;var n=this.html.querySelector(".caption-list"),i=n.querySelector(".current");i&&(i.className="");var o=n.querySelectorAll("li");o.forEach(function(t){t.innerText===A&&(t.className="current")}),o&&(o.className="current")}},{key:"created",value:function(A){}},{key:"ready",value:function(A){this.modalHtml.style.display="none";var t=document.querySelector(".prism-setting-item.prism-setting-cc");t&&t.classList.add("player-hidden")}}]),A}(),VA=e(24),qA=e.n(VA),PA=e(25),RA=e.n(PA),JA=(e(61),function(){function A(A,t){for(var e=0;e'+A.text+""});e.html.querySelector(".track-list").innerHTML='
  • 音轨
  • '+n.join("")});var i=this.html.querySelector(".current-track"),o=this.html.querySelector(".track-list");0==this.hasCreated&&this.definition&&(o.querySelector('li[data-def="'+this.definition+'"]').className="current"),this.hasCreated=!0;var r=null;i.onclick=function(){o.style.display="block"},i.onmouseleave=function(){r=setTimeout(function(){o.style.display="none"},100)},o.onmouseenter=function(){clearTimeout(r)},o.onmouseleave=function(){o.style.display="none",e.modalHtml.style.display="none"},o.onclick=function(A){var n=A.target,i=n.dataset.def;if(i&&"current"!==n.className){var o=e.trackList.find(function(A){return A.value.toString()===i});t._audioTrackService.switch(o.value),e.setCurrentTrack(o.text,o.value),e.modalHtml.style.display="block",e.modalHtml.querySelector(".switchimg").style.display="block",e.modalHtml.querySelector("span.current-track-tag").innerText=o.text}}}},{key:"setCurrentTrack",value:function(A,t){var e=this.html.querySelector(".current-track");e.innerText=A,e.dataset.def=t,this.definition=t;var n=this.html.querySelector(".track-list"),i=n.querySelector(".current");i&&(i.className="");var o=n.querySelectorAll("li");o.forEach(function(t){t.innerText===A&&(t.className="current")}),o&&(o.className="current")}},{key:"created",value:function(A){}},{key:"ready",value:function(A){this.modalHtml.style.display="none";var t=document.querySelector(".prism-setting-item.prism-setting-audio");t&&t.classList.add("player-hidden")}}]),A}(),KA=e(26),XA=e.n(KA),_A=(e(63),e(27)),$A=e.n(_A),At=function(){function A(A,t){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:"关闭广告";tt(this,A),this.adVideoSource=t,this.html=m(XA.a),this.adInterval=null,this.adCloseFunction=e,this.html.querySelector(".many-video-ad-close-text").innerText=n,this.adDuration=null,this.player=null,this.indexVideo=1}return At(A,[{key:"createEl",value:function(A,t){var e=t._options&&t._options.language;this.isEn=e&&"en-us"===e,this.html.querySelector(".many-video-ad-detail").innerText=this.isEn?"For more information":"查看广告详情",this.html.querySelector(".limit").innerText=this.isEn?"Your browser limits autoplay":"您的浏览器限制",this.html.querySelector(".manual").innerText=this.isEn?"Please Click":"自动播放请点击",A.appendChild(this.html)}},{key:"created",value:function(A){var t=this.adVideoSource.map(function(A,t){return''});this.html.querySelector(".videos").innerHTML=t.join(" "),this.indexVideo=Number(this.indexVideo);var e=this.indexVideo,n=this.adVideoSource,i=this.html.querySelector("#many-video-ad-content"+this.indexVideo),o=this.html.querySelector(".many-video-ad-detail"),r=this.html.querySelector("#many-video-ad-duration"),a=this,l=i.play();void 0!==l&&l.then(function(){i.play()}).catch(function(A){document.querySelector(".autoplay-many-video-ad").style.display="block",i.oncanplay=function(){var A=Math.ceil(i.duration);document.querySelector("#many-video-ad-duration").innerText=A}}),i.addEventListener("canplay",function A(){i.removeEventListener("canplay",A),o.href=n[e-1].adVideoLink,i.play().then(function(){var A=Math.ceil(i.duration);r.innerText=A,a.setAdInterval()}).catch(function(A){a.html.querySelector(".autoplay-many-video-ad").style.display="block",a.html.querySelector(".icon-player-play").onclick=function(){a.playManyVideoAd(),a.html.querySelector(".autoplay-many-video-ad").style.display="none"}})})}},{key:"ready",value:function(A,t){var e=this;this.indexVideo=Number(this.indexVideo);var n=this;this.html.querySelector("#many-video-ad-content"+this.indexVideo).addEventListener("ended",function(t){"-1"==n.playNext(n)&&A.play()}),this.html.querySelector(".many-video-ad-close label").onclick=function(){"function"==typeof e.adCloseFunction?e.adCloseFunction(e):e.closeManyVideoAd()}}},{key:"setAdInterval",value:function(A){var t=this,e=this.html.querySelector("#many-video-ad-duration"),n=this.html.querySelector("#many-video-ad-content"+this.indexVideo);this.adInterval=setInterval(function(){var A=Math.ceil(n.duration)-Math.ceil(n.currentTime);e.innerText=A,1==A&&clearInterval(t.adInterval)},1e3)}},{key:"pauseManyVideoAd",value:function(){this.clearAdInterval(),this.html.querySelector("#many-video-ad-content"+this.indexVideo).pause()}},{key:"playManyVideoAd",value:function(){this.setAdInterval(),this.html.querySelector("#many-video-ad-content"+this.indexVideo).play()}},{key:"clearAdInterval",value:function(){null!==this.adInterval&&clearInterval(this.adInterval),this.adInterval=null}},{key:"playNext",value:function(A){if(A.indexVideo>=A.adVideoSource.length)return A.html.parentNode.removeChild(A.html),-1;this.indexVideo=Number(this.indexVideo),null!=document.getElementById("many-video-ad-content"+this.indexVideo)&&document.getElementById("many-video-ad-content"+this.indexVideo).remove();var t=this.indexVideo+1;A.html.querySelector(".many-video-ad-detail").href=A.adVideoSource[A.indexVideo].adVideoLink;var e=this.html.querySelector("#many-video-ad-content"+t),n=this.html.querySelector("#many-video-ad-duration");e.style.display="block",this.adVideoSource.length>=this.indexVideo&&(this.indexVideo=this.indexVideo+1);var i=Math.ceil(e.duration);n.innerText=i,A.setAdInterval(),e.play(),e.addEventListener("ended",function(t){"-1"==A.playNext(A)&&document.getElementById("player-con").getElementsByTagName("video")[0].play()})}},{key:"closeManyVideoAd",value:function(){this.clearAdInterval(),this.html.parentNode.removeChild(this.html),this.html=null,document.getElementById("player-con").getElementsByTagName("video")[0].play()}}]),A}(),nt=function(){function A(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"关闭广告";tt(this,A),this.adVideoSource=t,this.html=m($A.a),this.adInterval=null,this.adCloseFunction=e,this.html.querySelector(".many-video-ad-close-text").innerText=n,this.adDuration=null,this.player=null,this.indexVideo=1}return At(A,[{key:"createEl",value:function(A,t){var e=this,n=t._options&&t._options.language;this.isEn=n&&"en-us"===n,this.html.querySelector(".many-video-ad-detail").innerText=this.isEn?"For more information":"查看广告详情",this.html.querySelector(".limit").innerText=this.isEn?"Your browser limits autoplay":"您的浏览器限制",this.html.querySelector(".manual").innerText=this.isEn?"Please Click":"自动播放请点击",A.appendChild(this.html),A.querySelector(".videosmb"),A.querySelector(".videosmb").setAttribute("preload","load");var i=A.querySelector(".prism-controlbar");i.className=i.className+" controlbar-element-hidden",this.html.querySelector(".icon-player-play").onclick=function(){e.playManyVideoAd(),e.html.querySelector(".autoplay-many-video-ad").style.display="none"}}},{key:"created",value:function(A){var t=this.adVideoSource.map(function(A,t){return''});this.html.querySelector(".videosmb").innerHTML=t.join(" "),this.indexVideo=Number(this.indexVideo);var e=this.indexVideo,n=this.adVideoSource,i=this.html.querySelector("#many-video-ad-content"+this.indexVideo),o=this.html.querySelector(".many-video-ad-detail"),r=this;i.addEventListener("canplay",function A(){i.removeEventListener("canplay",A),o.href=n[e-1].adVideoLink,r.html.querySelector("#many-video-ad-duration").innerText=Math.ceil(i.duration)})}},{key:"ready",value:function(A){var t=this;this.indexVideo=Number(this.indexVideo);var e=this;this.html.querySelector("#many-video-ad-content"+this.indexVideo).addEventListener("ended",function(t){if("-1"==e.playNext(e)){A.play();var n=document.querySelector(".prism-controlbar");n.className=n.className.replace(" controlbar-element-hidden","")}}),this.html.querySelector(".many-video-ad-close label").onclick=function(){"function"==typeof t.adCloseFunction?t.adCloseFunction(t):t.closeManyVideoAd()}}},{key:"setAdInterval",value:function(){var A=this,t=this.html.querySelector("#many-video-ad-duration"),e=this.html.querySelector("#many-video-ad-content"+this.indexVideo);this.adInterval=setInterval(function(){var n=Math.ceil(e.duration)-Math.ceil(e.currentTime);t.innerText=n,1==n&&clearInterval(A.adInterval)},1e3)}},{key:"closeManyVideoAd",value:function(){this.clearAdInterval();var A=this.html.parentNode.querySelector(".prism-controlbar");A.className=A.className.replace(" controlbar-element-hidden",""),this.html.parentNode.removeChild(this.html),this.html=null,document.getElementById("player-con").getElementsByTagName("video")[0].play()}},{key:"clearAdInterval",value:function(){null!==this.adInterval&&clearInterval(this.adInterval),this.adInterval=null}},{key:"playManyVideoAd",value:function(){this.setAdInterval(),this.html.querySelector("#many-video-ad-content"+this.indexVideo).play()}},{key:"pauseManyVideoAd",value:function(){this.clearAdInterval(),this.html.querySelector("#many-video-ad-content"+this.indexVideo).pause()}},{key:"playNext",value:function(A){if(A.indexVideo>=A.adVideoSource.length)return A.html.parentNode.removeChild(A.html),-1;this.indexVideo=Number(this.indexVideo),null!=document.getElementById("many-video-ad-content"+this.indexVideo)&&document.getElementById("many-video-ad-content"+this.indexVideo).remove();var t=this.indexVideo+1;A.html.querySelector(".many-video-ad-detail").href=A.adVideoSource[A.indexVideo].adVideoLink;var e=this.html.querySelector("#many-video-ad-content"+t),n=this.html.querySelector("#many-video-ad-duration");e.style.display="block",this.adVideoSource.length>=this.indexVideo&&(this.indexVideo=this.indexVideo+1);var i=Math.ceil(e.duration);n.innerText=i,A.setAdInterval(),e.play(),e.addEventListener("ended",function(t){if("-1"==A.playNext(A)){document.getElementById("player-con").getElementsByTagName("video")[0].play();var e=document.querySelector(".prism-controlbar");e.className=e.className.replace(" controlbar-element-hidden","")}})}}]),A}(),it=et;CA.mobile()&&(it=nt);var ot=it;window.AliPlayerComponent={AliplayerDanmuComponent:v,BulletScreenComponent:N,MemoryPlayComponent:D,PauseADComponent:C,PlaylistComponent:O,PreviewVodComponent:F,RotateMirrorComponent:oA,StartADComponent:sA,VideoADComponent:OA,RateComponent:tA,QualityComponent:X,ProgressComponent:q,CaptionComponent:ZA,TrackComponent:WA,ManyVideoADComponent:ot}}]);