tcplayer.js 5.3.4-beta.28 → 5.3.4-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,7 +12,7 @@ function l(t){var n=c(t,"string");return"symbol"===e(n)?n:String(n)}function c(t
|
|
|
12
12
|
;for(var r=n.length;r--;){var o=n[r];if(o){var s=o.displayState;if(e.color&&(s.firstChild.style.color=e.color),e.textOpacity&&tryUpdateStyle(s.firstChild,"color",constructColor(e.color||"#fff",e.textOpacity)),e.backgroundColor&&(s.firstChild.style.backgroundColor=e.backgroundColor),e.backgroundOpacity&&tryUpdateStyle(s.firstChild,"backgroundColor",constructColor(e.backgroundColor||"#000",e.backgroundOpacity)),e.windowColor&&(e.windowOpacity?tryUpdateStyle(s,"backgroundColor",constructColor(e.windowColor,e.windowOpacity)):s.style.backgroundColor=e.windowColor),e.edgeStyle&&("dropshadow"===e.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px "+darkGray+", 2px 2px 4px "+darkGray+", 2px 2px 5px "+darkGray:"raised"===e.edgeStyle?s.firstChild.style.textShadow="1px 1px "+darkGray+", 2px 2px "+darkGray+", 3px 3px "+darkGray:"depressed"===e.edgeStyle?s.firstChild.style.textShadow="1px 1px "+lightGray+", 0 1px "+lightGray+", -1px -1px "+darkGray+", 0 -1px "+darkGray:"uniform"===e.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px "+darkGray+", 0 0 4px "+darkGray+", 0 0 4px "+darkGray+", 0 0 4px "+darkGray)),e.fontPercent&&1!==e.fontPercent){var a=window_1.parseFloat(s.style.fontSize);s.style.fontSize=a*e.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}e.fontFamily&&"default"!==e.fontFamily&&("small-caps"===e.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=fontMap[e.fontFamily])}}}},e}(Component);Component.registerComponent("TextTrackDisplay",TextTrackDisplay);var LoadingSpinner=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"})},e}(Component);Component.registerComponent("LoadingSpinner",LoadingSpinner);var Button=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};t="button",e=assign({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},e),n=assign({type:"button","aria-live":"polite"},n);var i=Component.prototype.createEl.call(this,t,e,n);return this.createControlTextEl(i),i},e.prototype.addChild=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=this.constructor.name;return log$2.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),Component.prototype.addChild.call(this,t,e)},e.prototype.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},e.prototype.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},e.prototype.handleKeyPress=function(e){32!==e.which&&13!==e.which&&t.prototype.handleKeyPress.call(this,e)},e}(ClickableComponent);Component.registerComponent("Button",Button);var BigPlayButton=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-big-play-button"},e.prototype.handleClick=function(t){var e=this.player_.play();if(!(this.mouseused_&&t.clientX&&t.clientY)){var n=this.player_.getChild("controlBar"),i=n&&n.getChild("playToggle");if(!i)return void this.player_.focus();var r=function(){return i.focus()};isPromise(e)?e.then(r,function(){}):this.setTimeout(r,1)}},e.prototype.handleKeyPress=function(e){this.mouseused_=!1,t.prototype.handleKeyPress.call(this,e)},e.prototype.handleMouseDown=function(t){this.mouseused_=!0},e}(Button);BigPlayButton.prototype.controlText_="Play Video",Component.registerComponent("BigPlayButton",BigPlayButton);var CloseButton=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.controlText(i&&i.controlText||r.localize("Close")),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},e}(Button);Component.registerComponent("CloseButton",CloseButton);var PlayToggle=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,"play",r.handlePlay),r.on(n,"pause",r.handlePause),r.on(n,"ended",r.handleEnded),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},e.prototype.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},e.prototype.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},e.prototype.handleEnded=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},e}(Button);PlayToggle.prototype.controlText_="Play",Component.registerComponent("PlayToggle",PlayToggle);var TimeDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.throttledUpdateContent=throttle(bind(r,r.updateContent),25),r.on(n,"timeupdate",r.throttledUpdateContent),r}return inherits(e,t),e.prototype.createEl=function(e){var n=this.buildCSSClass(),i=t.prototype.createEl.call(this,"div",{className:n+" vjs-time-control vjs-control"});return this.contentEl_=createEl("div",{className:n+"-display"},{"aria-live":"off"},createEl("span",{className:"vjs-control-text",textContent:this.localize(this.controlText_)})),this.name&&"PDTDisplay"===this.name()?this.updatePDTTextNode_():this.updateTextNode_(),i.appendChild(this.contentEl_),i},e.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},e.prototype.updateTextNode_=function(t){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);var e=this.formattedTime_||"0:00";this.textNode_=document_1.createTextNode(e),this.contentEl_.appendChild(this.textNode_)}},e.prototype.updatePDTTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);var t=this.formattedPDTTime_||"";this.textNode_=document_1.createTextNode(t),this.contentEl_.appendChild(this.textNode_)}},e.prototype.formatTime_=function(t){return formatTime(t)},e.prototype.formatPDTTime_=function(t){return formatDate(t)},e.prototype.updateFormattedTime_=function(t){var e=this.formatTime_(t);e!==this.formattedTime_&&(this.formattedTime_=e,this.requestAnimationFrame(this.updateTextNode_))},e.prototype.updatePDTTime_=function(t){var e=this.formatPDTTime_(t);e!==this.formattedPDTTime_&&(this.formattedPDTTime_=e,this.requestAnimationFrame(this.updatePDTTextNode_))},e.prototype.updateContent=function(t){},e}(Component);TimeDisplay.prototype.controlText_="Time",Component.registerComponent("TimeDisplay",TimeDisplay);var CurrentTimeDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,"ended",r.handleEnded),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-current-time"},e.prototype.updateContent=function(t){if("dvrLive"===this.player_.dvrMode()){this.show();var e=this.player_.VttThumbnail().liveDuration;return this.updateFormattedTime_(e),!1}var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(n)},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},e}(TimeDisplay);CurrentTimeDisplay.prototype.controlText_="Current Time",Component.registerComponent("CurrentTimeDisplay",CurrentTimeDisplay);var DurationDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,"durationchange",r.updateContent),r.on(n,"loadedmetadata",r.throttledUpdateContent),r.on(n,"loadedmetadata",r.onLoadMetadata),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-duration"},e.prototype.updateContent=function(t){var e=this.player_.duration();e&&this.duration_!==e&&(this.duration_=e,this.updateFormattedTime_(e))},e.prototype.onLoadMetadata=function(){var t=this.player_.dvrMode();"dvrEvent"!==t&&"dvrLive"!==t||(player.controlBar.timeDivider.hide(),this.hide())},e}(TimeDisplay);DurationDisplay.prototype.controlText_="Duration Time",Component.registerComponent("DurationDisplay",DurationDisplay);var PDTDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return n.plugins&&n.plugins.pdt&&(r.on(n,"durationchange",r.throttledUpdateContent),r.initPlayingDate()),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-pdt-time"},e.prototype.updateContent=function(t){if(this.player_.duration()){if(!this.player_.plugins||!this.player_.plugins.pdt)return!1;var e=this.player_.currentPDT();e&&this.updatePDTTime_(e)}},e.prototype.initPlayingDate=function(){var t=this;this.timer&&this.clearInterval(this.timer),this.timer=this.setInterval(function(){var e=t.player_.currentPDT();e&&(t.player_.trigger({type:"firstpdt",data:e}),t.clearInterval(t.timer))},100)},e}(TimeDisplay);PDTDisplay.prototype.controlText_="PDT Time",Component.registerComponent("PDTDisplay",PDTDisplay);var TimeDivider=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},e}(Component);Component.registerComponent("TimeDivider",TimeDivider);var RemainingTimeDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,"durationchange",r.throttledUpdateContent),r.on(n,"ended",r.handleEnded),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-remaining-time"},e.prototype.formatTime_=function(e){return"-"+t.prototype.formatTime_.call(this,e)},e.prototype.updateContent=function(t){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},e.prototype.handleEnded=function(t){this.player_.duration()&&this.updateFormattedTime_(0)},e}(TimeDisplay);RemainingTimeDisplay.prototype.controlText_="Remaining Time",Component.registerComponent("RemainingTimeDisplay",RemainingTimeDisplay);var LiveDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.isLoadedMetaData=!1,r.hide(),r.on(r.player(),"durationchange",r.onDurationChange),r.on(r.player(),"loadedmetadata",r.onLoadMetadata),n.on("loadnewvideo",videojs.bind(r,r.resetStatus)),r}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=createEl("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+"</span>"+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.resetStatus=function(){this.setStatus(!1)},e.prototype.onDurationChange=function(){this.isLoadedMetaData&&this.update()},e.prototype.onLoadMetadata=function(){this.setStatus(!0),this.update()},e.prototype.setStatus=function(t){this.isLoadedMetaData=t},e.prototype.update=function(){this.player().duration()===Infinity&&"dvrLive"!==this.player().dvrMode()?this.show():this.hide()},e}(Component);Component.registerComponent("LiveDisplay",LiveDisplay);var DvrButton=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.hide(),r.mode=n.dvrMode(),r.on(r.player(),"loadedmetadata",r.onLoadMetadata),r}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-dvr-control vjs-control"},{style:"line-height: 3em; cursor: pointer"});return this.contentEl_=createEl("div",{className:"vjs-dvr-button-display",innerHTML:"dvrEvent"===this.mode?""+this.localize("返回直播"):""+this.localize("直播回看")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},e.prototype.handleClick=function(){if(this.dvrMode=this.player().dvrMode(),"dvrLive"===this.dvrMode){get_1(this,"player_.options_.plugins.Dvr.shiftURL")&&this.player_.LiveDvr().timeShift(0)}else{get_1(this,"player_.options_.plugins.Dvr.liveURL")&&this.player_.LiveDvr().timeShift(100)}},e.prototype.updateStatus=function(t){var e=document.getElementsByClassName("vjs-dvr-button-display")[0],n="dvrLive"===t?""+this.localize("直播回看"):""+this.localize("返回直播");e&&(e.innerHTML=n)},e.prototype.onLoadMetadata=function(){this.dvrMode=this.player().dvrMode(),this.updateStatus(this.dvrMode),"dvrEvent"===this.dvrMode||"dvrLive"===this.dvrMode?this.show():this.hide()},e}(Button);Component.registerComponent("DvrButton",DvrButton);var Slider=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}return inherits(e,t),e.prototype.enabled=function(){return this.enabled_},e.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},e.prototype.disable=function(){if(this.enabled()){var t=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},e.prototype.createEl=function(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return n.className=n.className+" vjs-slider",n=assign({tabIndex:0},n),i=assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),t.prototype.createEl.call(this,e,n,i)},e.prototype.handleMouseDown=function(t){var e=this.bar.el_.ownerDocument;t.preventDefault(),blockTextSelection(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(e,"mousemove",this.handleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchmove",this.handleMouseMove),this.on(e,"touchend",this.handleMouseUp),this.handleMouseMove(t)},e.prototype.handleMouseMove=function(t){},e.prototype.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;unblockTextSelection(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),this.update()},e.prototype.update=function(){if(this.el_){var t=this.getPercent(),e=this.bar;if(e){("number"!=typeof t||t!==t||t<0||t===Infinity)&&(t=0);var n=(100*t).toFixed(2)+"%",i=e.el().style;return this.vertical()?i.height=n:i.width=n,t}}},e.prototype.calculateDistance=function(t,e){var n=getPointerPosition(this.el_,t,e);return this.vertical()?n.y:n.x},e.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepBack()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepForward())},e.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},e.prototype.handleClick=function(t){t.stopImmediatePropagation(),t.preventDefault()},e.prototype.vertical=function(t){if(t===undefined)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(Component);Component.registerComponent("Slider",Slider);var LoadProgressBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.partEls_=[],r.on(n,"progress",r.update),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},e.prototype.dispose=function(){this.partEls_=null,t.prototype.dispose.call(this)},e.prototype.update=function(t){var e=this.player_.buffered(),n=this.player_.duration(),i=this.player_.bufferedEnd(),r=this.partEls_,o=function(t,e){var n=t/e||0;return 100*(n>=1?1:n)+"%"};this.el_.style.width=o(i,n);for(var s=0;s<e.length;s++){var a=e.start(s),u=e.end(s),l=r[s];l||(l=this.el_.appendChild(createEl()),r[s]=l),l.style.left=o(a,i),l.style.width=o(u-a,i)}for(var c=r.length;c>e.length;c--)this.el_.removeChild(r[c-1]);r.length=e.length},e}(Component);Component.registerComponent("LoadProgressBar",LoadProgressBar);var TimeTooltip=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},e.prototype.update=function(t,e,n,i){var r=getBoundingClientRect(this.el_),o=getBoundingClientRect(this.player_.el()),s=t.width*e;if(o&&r){var a=t.left-o.left+s,u=t.width-s+(o.right-t.right),l=r.width/2;a<l?l+=l-a:u<l&&(l=u),l<0?l=0:l>r.width&&(l=r.width),this.el_.style.right="-"+l+"px",this.player_.plugins&&this.player_.plugins.pdt||(i="");var c=i?n+'<div style="white-space: nowrap;margin-top:5px">'+i+"</div>":n;this.el_.innerHTML=c}},e}(Component);Component.registerComponent("TimeTooltip",TimeTooltip);var PlayProgressBar=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player_.scrubbing()?n.player_.getCache().currentTime:n.player_.currentTime(),r=formatDate(n.player_.currentPDT()),o=formatTime(i,n.player_.duration()),s=n.getChild("timeTooltip");s&&s.update(t,e,o,r)})},e}(Component);PlayProgressBar.prototype.options_={children:[]},IE_VERSION&&!(IE_VERSION>8)||IS_IOS||IS_ANDROID||PlayProgressBar.prototype.options_.children.push("timeTooltip"),Component.registerComponent("PlayProgressBar",PlayProgressBar);var MouseTimeDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.update=throttle(bind(r,r.update),25),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player_.duration(),r=formatTime(e*i,i),o=n.player_.scrubbing()?n.player_.getCache().currentTime:n.player_.currentTime(),s=e*i-o,a=n.player_.currentPDT(),u=a&&formatDate(a+1e3*s);n.el_.style.left=t.width*e+"px",n.getChild("timeTooltip").update(t,e,r,u)})},e}(Component);MouseTimeDisplay.prototype.options_={children:["timeTooltip"]},Component.registerComponent("MouseTimeDisplay",MouseTimeDisplay);var STEP_SECONDS=5,UPDATE_REFRESH_INTERVAL=30,SeekBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.update=throttle(bind(r,r.update),UPDATE_REFRESH_INTERVAL),r.on(n,"timeupdate",r.update),r.on(n,"ended",r.handleEnded),r.updateInterval=null,r.farthestPercent=null,r.on(n,["playing"],function(){r.clearInterval(r.updateInterval),r.updateInterval=r.setInterval(function(){r.requestAnimationFrame(function(){r.update()})},UPDATE_REFRESH_INTERVAL)}),r.on(n,["ended","pause","waiting"],function(){r.clearInterval(r.updateInterval)}),r.on(n,["timeupdate","ended"],r.update),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update_=function(t,e){var n=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[formatTime(t,n),formatTime(n,n)],"{1} of {2}")),this.bar.update(getBoundingClientRect(this.el_),e)},e.prototype.update=function(e){var n=t.prototype.update.call(this);return this.farthestPercent=this.farthestPercent>n?this.farthestPercent:n,this.update_(this.getCurrentTime_(),n),n},e.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},e.prototype.handleEnded=function(t){this.update_(this.player_.duration(),1)},e.prototype.getPercent=function(){var t=this.getCurrentTime_()/this.player_.duration();return t>=1?1:t},e.prototype.handleMouseDown=function(e){isSingleLeftClick(e)&&(this.player_.trigger("beforeseek"),this.beforeSeekTime=this.player_.currentTime(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},e.prototype.handleMouseMove=function(t){if(isSingleLeftClick(t)){var e=this.calculateDistance(t,!!this.player_.screenRotated)*this.player_.duration();if(e===this.player_.duration()&&(e-=.1),this.player_.options_.forbidFartherSeek){var n=this.farthestPercent*this.player_.duration();if(e>n)return this.player_.trigger({type:"forbidseek",farthestTime:n}),!1}this.player_.currentTime(e)}},e.prototype.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},e.prototype.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&silencePromise(this.player_.play())},e.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+STEP_SECONDS)},e.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-STEP_SECONDS)},e.prototype.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleKeyPress=function(e){32===e.which||13===e.which?(e.preventDefault(),this.handleAction(e)):t.prototype.handleKeyPress&&t.prototype.handleKeyPress.call(this,e)},e}(Slider);SeekBar.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},IE_VERSION&&!(IE_VERSION>8)||IS_IOS||IS_ANDROID||SeekBar.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),SeekBar.prototype.playerEvent="timeupdate",Component.registerComponent("SeekBar",SeekBar);var ProgressControl=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.handleMouseMove=throttle(bind(r,r.handleMouseMove),25),r.throttledHandleMouseSeek=throttle(bind(r,r.handleMouseSeek),25),r.enable(),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},e.prototype.handleMouseMove=function(t){var e=this.getChild("seekBar"),n=e.getChild("mouseTimeDisplay"),i=e.el(),r=getBoundingClientRect(i),o=getPointerPosition(i,t,!!this.player_.screenRotated).x;o>1?o=1:o<0&&(o=0),n&&n.update(r,o)},e.prototype.handleMouseSeek=function(t){this.getChild("seekBar").handleMouseMove(t)},e.prototype.enabled=function(){return this.enabled_},e.prototype.disable=function(){this.children().forEach(function(t){return t.disable&&t.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},e.prototype.enable=function(){this.children().forEach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseSeek),this.on(e,"touchmove",this.throttledHandleMouseSeek),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e}(Component);ProgressControl.prototype.options_={children:["seekBar"]},Component.registerComponent("ProgressControl",ProgressControl);var PictureInPictureToggle=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,["enterpictureinpicture","leavepictureinpicture"],r.handlePictureInPictureChange),r.on(n,["disablepictureinpicturechanged","loadedmetadata"],r.handlePictureInPictureEnabledChange),r.disable(),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-picture-in-picture-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handlePictureInPictureEnabledChange=function(){document_1.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},e.prototype.handlePictureInPictureChange=function(t){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},e.prototype.handleClick=function(t){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e}(Button);PictureInPictureToggle.prototype.controlText_="Picture-in-Picture",Component.registerComponent("PictureInPictureToggle",PictureInPictureToggle);var CssFullscreenToggle=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,"fullscreenchange",r.handleFullscreenChange),r}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"button",{className:"vjs-css-fullscreen-control "+t.prototype.buildCSSClass.call(this)});return this.contentEl_=createEl("div",{innerHTML:'<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1735540198133" style="width: 16px;height: 16px;margin-top: 2px" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3536" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M938.666667 85.333333a42.666667 42.666667 0 0 1 42.666666 42.666667v768a42.666667 42.666667 0 0 1-42.666666 42.666667H85.333333a42.666667 42.666667 0 0 1-42.666666-42.666667V128a42.666667 42.666667 0 0 1 42.666666-42.666667h853.333334z m-42.666667 85.333334H128v682.666666h768V170.666667z m-74.666667 384a10.666667 10.666667 0 0 1 10.666667 10.666666v213.333334a10.666667 10.666667 0 0 1-10.666667 10.666666h-213.333333a10.666667 10.666667 0 0 1-10.666667-10.666666v-64a10.666667 10.666667 0 0 1 10.666667-10.666667h128a10.666667 10.666667 0 0 0 10.666667-10.688V565.333333a10.666667 10.666667 0 0 1 10.666666-10.666666h64z m-405.333333-320a10.666667 10.666667 0 0 1 10.666667 10.666666v64a10.666667 10.666667 0 0 1-10.666667 10.666667h-128a10.666667 10.666667 0 0 0-10.666667 10.666667v128a10.666667 10.666667 0 0 1-10.666666 10.666666h-64a10.666667 10.666667 0 0 1-10.666667-10.666666v-213.333334a10.666667 10.666667 0 0 1 10.666667-10.666666h213.333333z" fill="#ffffff" p-id="3537"></path></svg>'}),e.appendChild(this.contentEl_),e},e.prototype.handleFullscreenChange=function(t){setTimeout(function(){this.player_.isFullscreen()?(this.controlText("Non-Fullscreen"),this.contentEl_.className="vjs-hidden"):(this.controlText("Fullscreen"),this.contentEl_.className="")},10)},e.prototype.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen(!0):this.player_.requestFullscreen(!0)},e}(Button);CssFullscreenToggle.prototype.controlText_="CssFullscreen",Component.registerComponent("CssFullscreenToggle",CssFullscreenToggle);var FullscreenToggle=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,"fullscreenchange",r.handleFullscreenChange),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},e.prototype.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(Button);FullscreenToggle.prototype.controlText_="Fullscreen",Component.registerComponent("FullscreenToggle",FullscreenToggle);var FullscreenRotate=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.screenRotated=!1,r}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,"button",{className:"vjs-rotatescreen-control vjs-control"});return this.contentEl_=createEl("div",{
|
|
13
13
|
innerHTML:'<svg style="width: 24px;height: 24px;margin-top:7px" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"></path>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"></path>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"></rect>\n </clipPath>\n </defs>\n </svg>'}),e.appendChild(this.contentEl_),e},e.prototype.handleClick=function(t){this.screenRotated?(this.player_.exitRotatescreen(),this.screenRotated=!1):(this.player_.requestRotatescreen(),this.screenRotated=!0)},e}(Button);FullscreenRotate.prototype.controlText_="Rotate",Component.registerComponent("FullscreenRotate",FullscreenRotate);var checkVolumeSupport=function(t,e){!e.tech_||e.tech_.featuresVolumeControl||e.tech_.featuresMuteControl?e.tech_&&e.tech_.featuresVolumeControl&&t.addClass("enable-volume-control"):t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresVolumeControl||e.tech_.featuresMuteControl?e.tech_.featuresVolumeControl&&(t.removeClass("vjs-hidden"),t.addClass("enable-volume-control")):t.addClass("vjs-hidden")})},VolumeLevel=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},e}(Component);Component.registerComponent("VolumeLevel",VolumeLevel);var VolumeBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on("slideractive",r.updateLastVolume_),r.on(n,"volumechange",r.updateARIAAttributes),n.ready(function(){return r.updateARIAAttributes()}),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},e.prototype.handleMouseDown=function(e){isSingleLeftClick(e)&&t.prototype.handleMouseDown.call(this,e)},e.prototype.handleMouseMove=function(t){isSingleLeftClick(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},e.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},e.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},e.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},e.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},e.prototype.updateARIAAttributes=function(t){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e),this.el_.setAttribute("aria-valuetext",e+"%")},e.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},e.prototype.updateLastVolume_=function(){var t=this,e=this.player_.volume();this.one("sliderinactive",function(){0===t.player_.volume()&&t.player_.lastVolume_(e)})},e}(Slider);VolumeBar.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},VolumeBar.prototype.playerEvent="volumechange",Component.registerComponent("VolumeBar",VolumeBar);var VolumeControl=function(t){function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,e),i.vertical=i.vertical||!1,("undefined"==typeof i.volumeBar||isPlain(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical);var r=possibleConstructorReturn(this,t.call(this,n,i));return checkVolumeSupport(r,n),r.throttledHandleMouseMove=throttle(bind(r,r.handleMouseMove),25),r.on("mousedown",r.handleMouseDown),r.on("touchstart",r.handleMouseDown),r.on(r.volumeBar,["focus","slideractive"],function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")}),r.on(r.volumeBar,["blur","sliderinactive"],function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")}),r}return inherits(e,t),e.prototype.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},e.prototype.handleMouseDown=function(t){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove),this.on(e,"touchmove",this.throttledHandleMouseMove),this.on(e,"mouseup",this.handleMouseUp),this.on(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseUp=function(t){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove),this.off(e,"touchmove",this.throttledHandleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchend",this.handleMouseUp)},e.prototype.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},e}(Component);VolumeControl.prototype.options_={children:["volumeBar"]},Component.registerComponent("VolumeControl",VolumeControl);var MuteToggle=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return checkVolumeSupport(r,n),r.on(n,["loadstart","volumechange"],r.update),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},e.prototype.handleClick=function(t){var e=this.player_.volume(),n=this.player_.lastVolume_();if(0===e){var i=n<.1?.1:n;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},e.prototype.update=function(t){this.updateIcon_(),this.updateControlText_()},e.prototype.updateIcon_=function(){var t=this.player_.volume(),e=3;0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var n=0;n<4;n++)removeClass(this.el_,"vjs-vol-"+n);addClass(this.el_,"vjs-vol-"+e)},e.prototype.updateControlText_=function(){var t=this.player_.muted()||0===this.player_.volume(),e=t?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},e}(Button);MuteToggle.prototype.controlText_="Mute",Component.registerComponent("MuteToggle",MuteToggle);var VolumePanel=function(t){function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,e),"undefined"!=typeof i.inline?i.inline=i.inline:i.inline=!0,("undefined"==typeof i.volumeControl||isPlain(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline);var r=possibleConstructorReturn(this,t.call(this,n,i));return checkVolumeSupport(r,n),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.muteToggle,"focus",r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r.on(r.muteToggle,"blur",r.sliderInactive_),r}return inherits(e,t),e.prototype.sliderActive_=function(){IS_ANDROID||IS_IOS||this.addClass("vjs-slider-active")},e.prototype.sliderInactive_=function(){IS_ANDROID||IS_IOS||this.removeClass("vjs-slider-active")},e.prototype.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},e}(Component);VolumePanel.prototype.options_={children:["muteToggle","volumeControl"]},Component.registerComponent("VolumePanel",VolumePanel);var Menu=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return i&&(r.menuButton_=i.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyPress),r}return inherits(e,t),e.prototype.addItem=function(t){this.addChild(t),t.on("click",bind(this,function(e){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus())}))},e.prototype.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=createEl(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),on(n,"click",function(t){t.preventDefault(),t.stopImmediatePropagation()}),n},e.prototype.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},e.prototype.handleKeyPress=function(t){37===t.which||40===t.which?(t.preventDefault(),this.stepForward()):38!==t.which&&39!==t.which||(t.preventDefault(),this.stepBack())},e.prototype.stepForward=function(){var t=0;this.focusedChild_!==undefined&&(t=this.focusedChild_+1),this.focus(t)},e.prototype.stepBack=function(){var t=0;this.focusedChild_!==undefined&&(t=this.focusedChild_-1),this.focus(t)},e.prototype.focus=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0,e=this.children().slice();e.length&&e[0].className&&/vjs-menu-title/.test(e[0].className)&&e.shift(),e.length>0&&(t<0?t=0:t>=e.length&&(t=e.length-1),this.focusedChild_=t,e[t].el_.focus())},e}(Component);Component.registerComponent("Menu",Menu);var MenuButton=function(t){function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));r.menuButton_=new Button(n,i),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var o=Button.prototype.buildCSSClass();return r.menuButton_.el_.className=r.buildCSSClass()+" "+o,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0,r.on(r.menuButton_,"tap",r.handleClick),r.on(r.menuButton_,"click",r.handleClick),r.on(r.menuButton_,"focus",r.handleFocus),r.on(r.menuButton_,"blur",r.handleBlur),r.on("keydown",r.handleSubmenuKeyPress),r}return inherits(e,t),e.prototype.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},e.prototype.createMenu=function(){var t=new Menu(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var e=createEl("li",{className:"vjs-menu-title",innerHTML:toTitleCase(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,t.children_.unshift(e),prependTo(e,t.contentEl())}if(this.items=this.createItems(),this.items)for(var n=0;n<this.items.length;n++)t.addItem(this.items[n]);return t},e.prototype.createItems=function(){},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},e.prototype.buildWrapperCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+Button.prototype.buildCSSClass()+" "+t.prototype.buildCSSClass.call(this)},e.prototype.buildCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+t.prototype.buildCSSClass.call(this)},e.prototype.controlText=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(t,e)},e.prototype.handleClick=function(t){this.one(this.menu.contentEl(),"mouseleave",bind(this,function(t){this.unpressButton(),this.el_.blur()})),(IS_IOS||IS_ANDROID)&&"SubsCapsButton"===this.name_&&("vjs-menu"===this.menu.el_.className?this.buttonPressed_=!1:this.buttonPressed_=!0),this.buttonPressed_?this.unpressButton():this.pressButton()},e.prototype.focus=function(){this.menuButton_.focus()},e.prototype.blur=function(){this.menuButton_.blur()},e.prototype.handleFocus=function(){on(document_1,"keydown",bind(this,this.handleKeyPress))},e.prototype.handleBlur=function(){off(document_1,"keydown",bind(this,this.handleKeyPress))},e.prototype.handleKeyPress=function(t){27===t.which||9===t.which?(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus())):38!==t.which&&40!==t.which||this.buttonPressed_||(this.pressButton(),t.preventDefault())},e.prototype.handleSubmenuKeyPress=function(t){27!==t.which&&9!==t.which||(this.buttonPressed_&&this.unpressButton(),9!==t.which&&(t.preventDefault(),this.menuButton_.el_.focus()))},e.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),IS_IOS&&isInFrame())return;this.menu.focus()}},e.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},e.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},e.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(Component);Component.registerComponent("MenuButton",MenuButton);var TrackButton=function(t){function e(n,i){classCallCheck(this,e);var r=i.tracks,o=possibleConstructorReturn(this,t.call(this,n,i));if(o.items.length<=1&&o.hide(),!r)return possibleConstructorReturn(o);var s=bind(o,o.update);return r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),o.player_.on("ready",s),o.player_.on("dispose",function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)}),o}return inherits(e,t),e}(MenuButton);Component.registerComponent("TrackButton",TrackButton);var MenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.selectable=i.selectable,r.selected(i.selected),r.selectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitem"),r}return inherits(e,t),e.prototype.createEl=function(e,n,i){return this.nonIconControl=!0,t.prototype.createEl.call(this,"li",assign({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},n),i)},e.prototype.handleClick=function(t){this.selected(!0)},e.prototype.selected=function(t){this.selectable&&(t?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected")):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText("")))},e}(ClickableComponent);Component.registerComponent("MenuItem",MenuItem);var TextTrackMenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=i.track,o=n.textTracks();i.label=r.label||r.language||"Unknown",i.selected="showing"===r.mode;var s=possibleConstructorReturn(this,t.call(this,n,i));s.track=r;var a=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];s.handleTracksChange.apply(s,e)},u=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];s.handleSelectedLanguageChange.apply(s,e)};if(n.on(["loadstart","texttrackchange"],a),o.addEventListener("change",a),o.addEventListener("selectedlanguagechange",u),s.on("dispose",function(){n.off(["loadstart","texttrackchange"],a),o.removeEventListener("change",a),o.removeEventListener("selectedlanguagechange",u)}),o.onchange===undefined){var l=void 0;s.on(["tap","click"],function(){if("object"!==_typeof(window_1.Event))try{l=new window_1.Event("change")}catch(t){}l||(l=document_1.createEvent("Event"),l.initEvent("change",!0,!0)),o.dispatchEvent(l)})}return s.handleTracksChange(),s}return inherits(e,t),e.prototype.handleClick=function(e){var n=this.track.kind,i=this.track.kinds,r=this.player_.textTracks();if(i||(i=[n]),t.prototype.handleClick.call(this,e),r)for(var o=0;o<r.length;o++){var s=r[o];s===this.track&&i.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},e.prototype.handleTracksChange=function(t){this.selected("showing"===this.track.mode)},e.prototype.handleSelectedLanguageChange=function(t){if("showing"===this.track.mode){var e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},e.prototype.dispose=function(){this.track=null,t.prototype.dispose.call(this)},e}(MenuItem);Component.registerComponent("TextTrackMenuItem",TextTrackMenuItem);var OffTextTrackMenuItem=function(t){function e(n,i){return classCallCheck(this,e),i.track={player:n,kind:i.kind,kinds:i.kinds,"default":!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),n=!0,i=0,r=e.length;i<r;i++){var o=e[i];if(this.options_.kinds.indexOf(o.kind)>-1&&"showing"===o.mode){n=!1;break}}if(this.selected(n),IS_IOS||IS_ANDROID){var s=document.getElementsByClassName("vjs-subs-caps-button"),a=get_1(s,"[0].children[1]");a&&(a.className="vjs-menu")}},e.prototype.handleSelectedLanguageChange=function(t){for(var e=this.player().textTracks(),n=!0,i=0,r=e.length;i<r;i++){var o=e[i];if(["captions","descriptions","subtitles"].indexOf(o.kind)>-1&&"showing"===o.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(TextTrackMenuItem);Component.registerComponent("OffTextTrackMenuItem",OffTextTrackMenuItem);var TextTrackButton=function(t){function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return classCallCheck(this,e),i.tracks=n.textTracks(),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.createItems=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[],e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:TextTrackMenuItem,n=void 0;this.label_&&(n=this.label_+" off"),t.push(new OffTextTrackMenuItem(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<i.length;r++){var o=i[r];if(this.kinds_.indexOf(o.kind)>-1){var s=new e(this.player_,{track:o,selectable:!0});s.addClass("vjs-"+o.kind+"-menu-item"),t.push(s)}}return t},e}(TrackButton);Component.registerComponent("TextTrackButton",TextTrackButton);var ChaptersTrackMenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=i.track,o=i.cue,s=n.currentTime();i.selectable=!0,i.label=o.text,i.selected=o.startTime<=s&&s<o.endTime;var a=possibleConstructorReturn(this,t.call(this,n,i));return a.track=r,a.cue=o,r.addEventListener("cuechange",bind(a,a.update)),a}return inherits(e,t),e.prototype.handleClick=function(e){t.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},e.prototype.update=function(t){var e=this.cue,n=this.player_.currentTime();this.selected(e.startTime<=n&&n<e.endTime)},e}(MenuItem);Component.registerComponent("ChaptersTrackMenuItem",ChaptersTrackMenuItem);var ChaptersButton=function(t){function e(n,i,r){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i,r))}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.update=function(e){this.track_&&(!e||"addtrack"!==e.type&&"removetrack"!==e.type)||this.setTrack(this.findChaptersTrack()),t.prototype.update.call(this)},e.prototype.setTrack=function(t){if(this.track_!==t){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=t,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_)}}},e.prototype.findChaptersTrack=function(){for(var t=this.player_.textTracks()||[],e=t.length-1;e>=0;e--){var n=t[e];if(n.kind===this.kind_)return n}},e.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(toTitleCase(this.kind_))},e.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},e.prototype.createItems=function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var n=0,i=e.length;n<i;n++){var r=e[n],o=new ChaptersTrackMenuItem(this.player_,{track:this.track_,cue:r});t.push(o)}return t},e}(TextTrackButton);ChaptersButton.prototype.kind_="chapters",ChaptersButton.prototype.controlText_="Chapters",Component.registerComponent("ChaptersButton",ChaptersButton);var DescriptionsButton=function(t){function e(n,i,r){classCallCheck(this,e);var o=possibleConstructorReturn(this,t.call(this,n,i,r)),s=n.textTracks(),a=bind(o,o.handleTracksChange);return s.addEventListener("change",a),o.on("dispose",function(){s.removeEventListener("change",a)}),o}return inherits(e,t),e.prototype.handleTracksChange=function(t){for(var e=this.player().textTracks(),n=!1,i=0,r=e.length;i<r;i++){var o=e[i];if(o.kind!==this.kind_&&"showing"===o.mode){n=!0;break}}n?this.disable():this.enable()},e.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(TextTrackButton);DescriptionsButton.prototype.kind_="descriptions",DescriptionsButton.prototype.controlText_="Descriptions",Component.registerComponent("DescriptionsButton",DescriptionsButton);var SubtitlesButton=function(t){function e(n,i,r){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i,r))}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(TextTrackButton);SubtitlesButton.prototype.kind_="subtitles",SubtitlesButton.prototype.controlText_="Subtitles",Component.registerComponent("SubtitlesButton",SubtitlesButton);var CaptionSettingsMenuItem=function(t){function e(n,i){classCallCheck(this,e),i.track={player:n,kind:i.kind,label:i.kind+" settings",selectable:!1,"default":!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem";var r=possibleConstructorReturn(this,t.call(this,n,i));return r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+i.kind+" settings dialog"),r}return inherits(e,t),e.prototype.handleClick=function(t){this.player().getChild("textTrackSettings").open()},e}(TextTrackMenuItem);Component.registerComponent("CaptionSettingsMenuItem",CaptionSettingsMenuItem);var CaptionsButton=function(t){function e(n,i,r){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i,r))}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-captions-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||(e.push(new CaptionSettingsMenuItem(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),t.prototype.createItems.call(this,e)},e}(TextTrackButton);CaptionsButton.prototype.kind_="captions",CaptionsButton.prototype.controlText_="Captions",Component.registerComponent("CaptionsButton",CaptionsButton);var SubsCapsMenuItem=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(e,n,i){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>",t.prototype.createEl.call(this,e,assign({innerHTML:r},n),i)},e}(TextTrackMenuItem);Component.registerComponent("SubsCapsMenuItem",SubsCapsMenuItem);var SubsCapsButton=function(t){function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(toTitleCase(r.label_)),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||IS_IOS||IS_ANDROID||(e.push(new CaptionSettingsMenuItem(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=t.prototype.createItems.call(this,e,SubsCapsMenuItem)},e}(TextTrackButton);SubsCapsButton.prototype.kinds_=["captions","subtitles"],SubsCapsButton.prototype.controlText_="Subtitles",Component.registerComponent("SubsCapsButton",SubsCapsButton);var AudioTrackMenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=i.track,o=n.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled;var s=possibleConstructorReturn(this,t.call(this,n,i));s.track=r;var a=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];s.handleTracksChange.apply(s,e)};return s.changeHandler=a,o.addEventListener("change",a),o.addEventListener("enabledchange",a),s.on("dispose",function(){o.removeEventListener("change",a),o.removeEventListener("enabledchange",a)}),s}return inherits(e,t),e.prototype.handleClick=function(e){var n=this.player_.audioTracks();t.prototype.handleClick.call(this,e),this.player_.tech_.hlsProvider.hls.audioTrack=this.track.id;for(var i=0;i<n.length;i++){var r=n[i];r.enabled=r===this.track}},e.prototype.handleTracksChange=function(t){this.selected(this.track.enabled)},e}(MenuItem);Component.registerComponent("AudioTrackMenuItem",AudioTrackMenuItem);var AudioTrackButton=function(t){function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return classCallCheck(this,e),i.tracks=n.audioTracks(),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-audio-button "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createItems=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];this.hideThreshold_=1;for(var e=this.player_.audioTracks(),n=0;n<e.length;n++){var i=e[n];t.push(new AudioTrackMenuItem(this.player_,{track:i,selectable:!0}))}return t},e}(TrackButton);AudioTrackButton.prototype.controlText_="Audio Track",Component.registerComponent("AudioTrackButton",AudioTrackButton);var PlaybackRateMenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=i.rate,o=parseFloat(r,10);i.label=r,i.selected=1===o,i.selectable=!0;var s=possibleConstructorReturn(this,t.call(this,n,i));return s.label=r,s.rate=o,s.on(n,"ratechange",s.update),s}return inherits(e,t),e.prototype.handleClick=function(e){t.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},e.prototype.update=function(t){this.selected(this.player().playbackRate()===this.rate)},e}(MenuItem);PlaybackRateMenuItem.prototype.contentElType="button",Component.registerComponent("PlaybackRateMenuItem",PlaybackRateMenuItem);var PlaybackRateMenuButton=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.updateVisibility(),r.updateLabel(),r.on(n,"loadstart",r.updateVisibility),r.on(n,"ratechange",r.updateLabel),r}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelEl_=createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_),e},e.prototype.dispose=function(){this.labelEl_=null,t.prototype.dispose.call(this)},e.prototype.buildCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildCSSClass.call(this)},e.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildWrapperCSSClass.call(this)},e.prototype.createMenu=function(){var t=new Menu(this.player()),e=this.playbackRates();if(e)for(var n=e.length-1;n>=0;n--)t.addChild(new PlaybackRateMenuItem(this.player(),{rate:e[n]+"x"}));return t},e.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},e.prototype.handleClick=function(t){for(var e=this.player().playbackRate(),n=this.playbackRates(),i=n[0],r=0;r<n.length;r++)if(n[r]>e){i=n[r];break}this.player().playbackRate(i)},e.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},e.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},e.prototype.updateVisibility=function(t){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},e.prototype.updateLabel=function(t){var e=this.player().playbackRate();if(1.1===e)return!1;this.playbackRateSupported()&&(this.labelEl_.innerHTML=e+"x")},e}(MenuButton);PlaybackRateMenuButton.prototype.controlText_="Playback Rate",Component.registerComponent("PlaybackRateMenuButton",PlaybackRateMenuButton);var Spacer=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},e}(Component);Component.registerComponent("Spacer",Spacer);var CustomControlSpacer=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},e.prototype.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML=" ",e},e}(Spacer)
|
|
14
14
|
;Component.registerComponent("CustomControlSpacer",CustomControlSpacer);var ControlBar=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"},{role:"group"})},e}(Component);ControlBar.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","PDTDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","dvrButton","playbackRateMenuButton","chaptersButton","descriptionsButton","audioTrackButton","subsCapsButton","cssFullscreenToggle","fullscreenToggle"]},"exitPictureInPicture"in document&&ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length-2,0,"pictureInPictureToggle"),Component.registerComponent("ControlBar",ControlBar);var ErrorDisplay=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on(n,"error",r.open),r}return inherits(e,t),e.prototype.buildCSSClass=function(){return"vjs-error-display "+t.prototype.buildCSSClass.call(this)},e.prototype.content=function(){var t=this.player().error();return t?this.localize(t.message):""},e}(ModalDialog);ErrorDisplay.prototype.options_=mergeOptions(ModalDialog.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Component.registerComponent("ErrorDisplay",ErrorDisplay);var LOCAL_STORAGE_KEY="vjs-text-track-settings",COLOR_BLACK=["#000","Black"],COLOR_BLUE=["#00F","Blue"],COLOR_CYAN=["#0FF","Cyan"],COLOR_GREEN=["#0F0","Green"],COLOR_MAGENTA=["#F0F","Magenta"],COLOR_RED=["#F00","Red"],COLOR_WHITE=["#FFF","White"],COLOR_YELLOW=["#FF0","Yellow"],OPACITY_OPAQUE=["1","Opaque"],OPACITY_SEMI=["0.5","Semi-Transparent"],OPACITY_TRANS=["0","Transparent"],selectConfigs={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[COLOR_BLACK,COLOR_WHITE,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[OPACITY_SEMI,OPACITY_OPAQUE,OPACITY_TRANS]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[COLOR_WHITE,COLOR_BLACK,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],"default":2,parser:function(t){return"1.00"===t?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[OPACITY_OPAQUE,OPACITY_SEMI]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[OPACITY_TRANS,OPACITY_SEMI,OPACITY_OPAQUE]}};selectConfigs.windowColor.options=selectConfigs.backgroundColor.options;var TextTrackSettings=function(t){function e(n,i){classCallCheck(this,e),i.temporary=!1;var r=possibleConstructorReturn(this,t.call(this,n,i));return r.updateDisplay=bind(r,r.updateDisplay),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=createEl("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),i.persistTextTrackSettings===undefined&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",function(){r.saveSettings(),r.close()}),r.on(r.$(".vjs-default-button"),"click",function(){r.setDefaults(),r.updateDisplay()}),each(selectConfigs,function(t){r.on(r.$(t.selector),"change",r.updateDisplay)}),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}return inherits(e,t),e.prototype.dispose=function(){this.endDialog=null,t.prototype.dispose.call(this)},e.prototype.createElSelect_=function(t){var e=this,n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"",i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"label",r=selectConfigs[t],o=r.id.replace("%s",this.id_);return["<"+i+' id="'+o+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"</"+i+">",'<select aria-labelledby="'+(""!==n?n+" ":"")+o+'">'].concat(r.options.map(function(t){var i=o+"-"+t[1];return['<option id="'+i+'" value="'+t[0]+'" ','aria-labelledby="'+(""!==n?n+" ":"")+o+" "+i+'">',e.localize(t[1]),"</option>"].join("")})).concat("</select>").join("")},e.prototype.createElFgColor_=function(){var t="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",t),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElBgColor_=function(){var t="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",t),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElWinColor_=function(){var t="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",t),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")},e.prototype.createElColors_=function(){return createEl("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},e.prototype.createElFont_=function(){return createEl("div",{className:'vjs-track-settings-font">',innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},e.prototype.createElControls_=function(){var t=this.localize("restore all settings to the default values");return createEl("div",{className:"vjs-track-settings-controls",innerHTML:['<button class="vjs-default-button" title="'+t+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+t+"</span>","</button>",'<button class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},e.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},e.prototype.label=function(){return this.localize("Caption Settings Dialog")},e.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},e.prototype.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},e.prototype.getValues=function(){var t=this;return reduce(selectConfigs,function(e,n,i){var r=getSelectedOptionValue(t.$(n.selector),n.parser);return r!==undefined&&(e[i]=r),e},{})},e.prototype.setValues=function(t){var e=this;each(selectConfigs,function(n,i){setSelectedOption(e.$(n.selector),t[i],n.parser)})},e.prototype.setDefaults=function(){var t=this;each(selectConfigs,function(e){var n=e.hasOwnProperty("default")?e["default"]:0;t.$(e.selector).selectedIndex=n})},e.prototype.restoreSettings=function(){var t=void 0;try{t=JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY))}catch(e){log$2.warn(e)}t&&this.setValues(t)},e.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var t=this.getValues();try{Object.keys(t).length?window_1.localStorage.setItem(LOCAL_STORAGE_KEY,JSON.stringify(t)):window_1.localStorage.removeItem(LOCAL_STORAGE_KEY)}catch(e){log$2.warn(e)}}},e.prototype.updateDisplay=function(){var t=this.player_.getChild("textTrackDisplay");t&&t.updateDisplay()},e.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(document_1,"keydown",this.handleKeyDown);var t=this.player_.controlBar,e=t&&t.subsCapsButton,n=t&&t.captionsButton;e?e.focus():n&&n.focus()},e}(ModalDialog);Component.registerComponent("TextTrackSettings",TextTrackSettings);var _templateObject$2=taggedTemplateLiteralLoose(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),Html5=function(t){function e(n,i,r){classCallCheck(this,e);var o=possibleConstructorReturn(this,t.call(this,n,i,r)),s=i.source,a=!1;if(s&&(o.el_.currentSrc!==s.src||i.tag&&3===i.tag.initNetworkState_)?o.setSource(s):o.handleLateInit_(o.el_),o.el_.hasChildNodes()){for(var u=o.el_.childNodes,l=u.length,c=[];l--;){var h=u[l];"track"===h.nodeName.toLowerCase()&&(o.featuresNativeTextTracks?(o.remoteTextTrackEls().addTrackElement_(h),o.remoteTextTracks().addTrack(h.track),o.textTracks().addTrack(h.track),a||o.el_.hasAttribute("crossorigin")||!isCrossOrigin(h.src)||(a=!0)):c.push(h))}for(var p=0;p<c.length;p++)o.el_.removeChild(c[p])}return o.proxyNativeTracks_(),o.featuresNativeTextTracks&&a&&log$2.warn(tsml(_templateObject$2)),o.restoreMetadataTracksInIOSNativePlayer_(),(TOUCH_ENABLED||IS_IPHONE||IS_NATIVE_ANDROID)&&!0===i.nativeControlsForTouch&&o.setControls(!0),o.proxyWebkitFullscreen_(),o.triggerReady(),o}return inherits(e,t),e.prototype.dispose=function(){e.disposeMediaElement(this.el_),this.options_=null,t.prototype.dispose.call(this)},e.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var t=this.textTracks(),e=void 0,n=function(){e=[];for(var n=0;n<t.length;n++){var i=t[n];"metadata"===i.kind&&e.push({track:i,storedMode:i.mode})}};n(),t.addEventListener("change",n),this.on("dispose",function(){return t.removeEventListener("change",n)});var i=function r(){for(var n=0;n<e.length;n++){var i=e[n];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",r)};this.on("webkitbeginfullscreen",function(){t.removeEventListener("change",n),t.removeEventListener("change",i),t.addEventListener("change",i)}),this.on("webkitendfullscreen",function(){t.removeEventListener("change",n),t.addEventListener("change",n),t.removeEventListener("change",i)})},e.prototype.proxyNativeTracks_=function(){var t=this;NORMAL.names.forEach(function(e){var n=NORMAL[e],i=t.el()[n.getterName],r=t[n.getterName]();if(t["featuresNative"+n.capitalName+"Tracks"]&&i&&i.addEventListener){var o={change:function(t){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(t){r.addTrack(t.track)},removetrack:function(t){r.removeTrack(t.track)}},s=function(){for(var t=[],e=0;e<r.length;e++){for(var n=!1,o=0;o<i.length;o++)if(i[o]===r[e]){n=!0;break}n||t.push(r[e])}for(;t.length;)r.removeTrack(t.shift())};Object.keys(o).forEach(function(e){var n=o[e];i.addEventListener(e,n),t.on("dispose",function(t){return i.removeEventListener(e,n)})}),t.on("loadstart",s),t.on("dispose",function(e){return t.off("loadstart",s)})}})},e.prototype.createEl=function(){var t=this.options_.tag;if(!t||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(t){var n=t.cloneNode(!0);t.parentNode&&t.parentNode.insertBefore(n,t),e.disposeMediaElement(t),t=n}else{t=document_1.createElement("video");var i=this.options_.tag&&getAttributes(this.options_.tag),r=mergeOptions({},i);TOUCH_ENABLED&&!0===this.options_.nativeControlsForTouch||delete r.controls,setAttributes(t,assign(r,{id:this.options_.techId,"class":"vjs-tech"}))}t.playerId=this.options_.playerId}"undefined"!=typeof this.options_.preload&&setAttribute(t,"preload",this.options_.preload);for(var o=["loop","muted","playsinline","autoplay"],s=0;s<o.length;s++){var a=o[s],u=this.options_[a];void 0!==u&&(u?setAttribute(t,a,a):removeAttribute(t,a),t[a]=u)}return t},e.prototype.handleLateInit_=function(t){if(0!==t.networkState&&3!==t.networkState){if(0===t.readyState){var e=!1,n=function(){e=!0};this.on("loadstart",n);var i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",n),this.off("loadedmetadata",i),e||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),t.readyState>=2&&r.push("loadeddata"),t.readyState>=3&&r.push("canplay"),t.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(t){this.trigger(t)},this)})}},e.prototype.setCurrentTime=function(t){try{this.el_.currentTime=t}catch(e){log$2(e,"Video is not ready. (Video.js)")}},e.prototype.duration=function(){var t=this;if(this.el_.duration===Infinity&&IS_ANDROID&&IS_CHROME&&0===this.el_.currentTime){var e=function n(){t.el_.currentTime>0&&(t.el_.duration===Infinity&&t.trigger("durationchange"),t.off("timeupdate",n))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN},e.prototype.width=function(){return this.el_.offsetWidth},e.prototype.height=function(){return this.el_.offsetHeight},e.prototype.proxyWebkitFullscreen_=function(){var t=this;if("webkitDisplayingFullscreen"in this.el_){var e=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",function(){t.off("webkitbeginfullscreen",n),t.off("webkitendfullscreen",e)})}},e.prototype.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var t=window_1.navigator&&window_1.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},e.prototype.enterFullScreen=function(){var t=this.el_;t.paused&&t.networkState<=t.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){t.pause(),t.webkitEnterFullScreen()},0)):t.webkitEnterFullScreen()},e.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},e.prototype.src=function(t){if(t===undefined)return this.el_.src;this.setSrc(t)},e.prototype.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},e.prototype.reset=function(){e.resetMediaElement(this.el_)},e.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},e.prototype.setControls=function(t){this.el_.controls=!!t},e.prototype.addTextTrack=function(e,n,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,n,i):t.prototype.addTextTrack.call(this,e,n,i)},e.prototype.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return t.prototype.createRemoteTextTrack.call(this,e);var n=document_1.createElement("track");return e.kind&&(n.kind=e.kind),e.label&&(n.label=e.label),(e.language||e.srclang)&&(n.srclang=e.language||e.srclang),e["default"]&&(n["default"]=e["default"]),e.id&&(n.id=e.id),e.src&&(n.src=e.src),n},e.prototype.addRemoteTextTrack=function(e,n){var i=t.prototype.addRemoteTextTrack.call(this,e,n);return this.featuresNativeTextTracks&&this.el().appendChild(i),i},e.prototype.removeRemoteTextTrack=function(e){if(t.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var n=this.$$("track"),i=n.length;i--;)e!==n[i]&&e!==n[i].track||this.el().removeChild(n[i])},e.prototype.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var t={};return"undefined"!=typeof this.el().webkitDroppedFrameCount&&"undefined"!=typeof this.el().webkitDecodedFrameCount&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),window_1.performance&&"function"==typeof window_1.performance.now?t.creationTime=window_1.performance.now():window_1.performance&&window_1.performance.timing&&"number"==typeof window_1.performance.timing.navigationStart&&(t.creationTime=window_1.Date.now()-window_1.performance.timing.navigationStart),t},e}(Tech);if(isReal()){Html5.TEST_VID=document_1.createElement("video");var track=document_1.createElement("track");track.kind="captions",track.srclang="en",track.label="English",Html5.TEST_VID.appendChild(track)}Html5.isSupported=function(){try{Html5.TEST_VID.volume=.5}catch(t){return!1}return!(!Html5.TEST_VID||!Html5.TEST_VID.canPlayType)},Html5.canPlayType=function(t){return Html5.TEST_VID.canPlayType(t)},Html5.canPlaySource=function(t,e){return Html5.canPlayType(t.type)},Html5.canControlVolume=function(){try{var t=Html5.TEST_VID.volume;return Html5.TEST_VID.volume=t/2+.1,t!==Html5.TEST_VID.volume}catch(e){return!1}},Html5.canControlMute=function(){try{var t=Html5.TEST_VID.muted;return Html5.TEST_VID.muted=!0,t!==Html5.TEST_VID.muted}catch(e){return!1}},Html5.canControlPlaybackRate=function(){if(IS_ANDROID&&IS_CHROME&&CHROME_VERSION<58)return!1;try{var t=Html5.TEST_VID.playbackRate;return Html5.TEST_VID.playbackRate=t/2+.1,t!==Html5.TEST_VID.playbackRate}catch(e){return!1}},Html5.supportsNativeTextTracks=function(){return IS_ANY_SAFARI},Html5.supportsNativeVideoTracks=function(){return!(!Html5.TEST_VID||!Html5.TEST_VID.videoTracks)},Html5.supportsNativeAudioTracks=function(){return!(!Html5.TEST_VID||!Html5.TEST_VID.audioTracks)},Html5.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],Html5.prototype.featuresVolumeControl=Html5.canControlVolume(),Html5.prototype.featuresMuteControl=Html5.canControlMute(),Html5.prototype.featuresPlaybackRate=Html5.canControlPlaybackRate(),Html5.prototype.movingMediaElementInDOM=!IS_IOS,Html5.prototype.featuresFullscreenResize=!0,Html5.prototype.featuresProgressEvents=!0,Html5.prototype.featuresTimeupdateEvents=!0,Html5.prototype.featuresNativeTextTracks=Html5.supportsNativeTextTracks(),Html5.prototype.featuresNativeVideoTracks=Html5.supportsNativeVideoTracks(),Html5.prototype.featuresNativeAudioTracks=Html5.supportsNativeAudioTracks();var canPlayType=Html5.TEST_VID&&Html5.TEST_VID.constructor.prototype.canPlayType,mpegurlRE=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,mp4RE=/^video\/mp4/i;Html5.patchCanPlayType=function(){ANDROID_VERSION>=4&&!IS_FIREFOX?Html5.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&mpegurlRE.test(t)?"maybe":canPlayType.call(this,t)}:IS_OLD_ANDROID&&(Html5.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&mp4RE.test(t)?"maybe":canPlayType.call(this,t)})},Html5.unpatchCanPlayType=function(){var t=Html5.TEST_VID.constructor.prototype.canPlayType;return Html5.TEST_VID.constructor.prototype.canPlayType=canPlayType,t},Html5.patchCanPlayType(),Html5.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(e){}}()}},Html5.resetMediaElement=function(t){if(t){for(var e=t.querySelectorAll("source"),n=e.length;n--;)t.removeChild(e[n]);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){Html5.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){Html5.prototype["set"+toTitleCase(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(t){Html5.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(t){Html5.prototype["set"+toTitleCase(t)]=function(e){"src"===t&&this.player_&&this.player_.trigger&&this.player_.trigger({type:"debug",data:{message:"debug === 播放地址直传 video: "+e}}),this.el_[t]=e}}),["pause","load","play"].forEach(function(t){Html5.prototype[t]=function(){return this.el_[t]()}}),Tech.withSourceHandlers(Html5),Html5.nativeSourceHandler={},Html5.nativeSourceHandler.canPlayType=function(t){setTimeout(function(){},2e3);try{return"video/m3u8"===t?"maybe":Html5.TEST_VID.canPlayType(t)}catch(e){return""}},Html5.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return Html5.nativeSourceHandler.canPlayType(t.type);if(t.src){var n=getFileExtension(t.src);return Html5.nativeSourceHandler.canPlayType("video/"+n)}return""},Html5.nativeSourceHandler.handleSource=function(t,e,n){e.setSrc(t.src)},Html5.nativeSourceHandler.dispose=function(){},Html5.registerSourceHandler(Html5.nativeSourceHandler),Tech.registerTech("Html5",Html5);var _templateObject$1=taggedTemplateLiteralLoose(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "],["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]),preventScroll=function(t){t.preventDefault()},TECH_EVENTS_RETRIGGER=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","ratechange","resize","volumechange","texttrackchange"],Player=function(t){function e(n,i,r){if(classCallCheck(this,e),n.id=n.id||"vjs_video_"+newGUID(),i=assign(e.getTagSettings(n),i),i.initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language)if("function"==typeof n.closest){var o=n.closest("[lang]");o&&o.getAttribute&&(i.language=o.getAttribute("lang"))}else for(var s=n;s&&1===s.nodeType;){if(getAttributes(s).hasOwnProperty("lang")){i.language=s.getAttribute("lang");break}s=s.parentNode}var a=possibleConstructorReturn(this,t.call(this,null,i,r));if(a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=n,a.tagAttributes=n&&getAttributes(n),a.language(a.options_.language),i.languages){var u={};Object.getOwnPropertyNames(i.languages).forEach(function(t){u[t.toLowerCase()]=i.languages[t]}),a.languages_=u}else a.languages_=e.prototype.options_.languages;a.cache_={},a.poster_=i.poster||"",a.controls_=!!i.controls,a.cache_.lastVolume=1,n.controls=!1,n.removeAttribute("controls"),i.controlBar&&i.controlBar.fullscreenRotate&&(a.conW=window_1.innerWidth||document_1.documentElement.clientWidth||document_1.body.clientWidth,a.conH=window_1.innerHeight||document_1.documentElement.clientHeight||document_1.body.clientHeight,a.currentDirection="portrait",a.lastDirection="portrait",a.recordDirection()),a.scrubbing_=!1,a.textTrackCleared_=!1,a.el_=a.createEl(),evented(a,{eventBusKey:"el_"});var l=mergeOptions(a.options_);if(i.plugins){var c=i.plugins,h=new Enc;a.enc=h,h.initPlugins(c,videojs,a)}return a.options_.playerOptions=l,a.middleware_=[],a.initChildren(),a.isAudio("audio"===n.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),IS_IOS||IS_ANDROID||a.addClass("vjs-workinghover"),e.players[a.id_]=a,a.userActive(!0),a.reportUserActivity(),a.listenForUserActivity_(),a.on("fullscreenchange",a.handleFullscreenChange_),a.on("stageclick",a.handleStageClick_),a.changingSrc_=!1,a.playWaitingForReady_=!1,a.playOnLoadstart_=null,a.forceAutoplayInChrome_(),a}return inherits(e,t),e.prototype.setLicenseConfig=function(t){this.options_.licenseConfig=t},e.prototype.recordDirection=function(){var t=this,e=this;this.currentDirection="portrait",this.lastDirection="portrait";var n="onorientationchange"in window_1?"orientationchange":"resize";window_1.addEventListener(n,function(){if("rotate"!==t.fullscreenType())return!1;0==window_1.orientation||180==window_1.orientation?(e.lastDirection=e.currentDirection.slice(),e.currentDirection="portrait"):(e.lastDirection=e.currentDirection.slice(),e.currentDirection="landscape"),t.screenRotated&&("portrait"===e.lastDirection&&"landscape"===t.currentDirection&&e.landscapeForOrientation(),"landscape"===e.lastDirection&&"portrait"===t.currentDirection&&e.portrait(!0)),t.screenRotated||("portrait"===e.lastDirection&&"landscape"===t.currentDirection&&e.landscapeForOrientation(),"landscape"===e.lastDirection&&"portrait"===t.currentDirection&&e.portrait(!0)),e.trigger("directionchanged")},!1)},e.prototype.requestRotatescreen=function(){var t=this;return t.screenRotated?(t.exitRotatescreen(),!1):(this.fullscreenType("rotate"),"landscape"!==t.currentDirection||t.screenRotated?(t.el_.style.width="100vw",t.el_.style.height="100%",t.el_.style.position="fixed",t.el_.style.zIndex="999",t.el_.style.top="0",document_1.body.style.overflowY="hidden",document_1.addEventListener("touchmove",preventScroll,{passive:!1}),void t.landscape()):(t.portrait(),!1))},e.prototype.portrait=function(){var t=this;t.screenRotated=!1,t.el_.removeAttribute("style")},e.prototype.landscapeForOrientation=function(){var t=this;t.portrait(),setTimeout(function(){var e=window_1.innerHeight||document_1.documentElement.clientHeight||document_1.body.clientHeight;t.el_.style.transform="rotate(0deg)",t.el_.style.width="100vw",t.el_.style.height=e+"px",t.el_.style["transform-origin"]="center center",t.el_.style["-webkit-transform-origin"]="center center"},150)},e.prototype.landscape=function(){var t=this;t.screenRotated=!0,t.el_.style.transform="rotate(90deg) translate("+(t.conH-t.conW)/2+"px,"+(t.conH-t.conW)/2+"px)",t.el_.style.width=t.conH+"px",t.el_.style.height=t.conW+"px",t.el_.style["transform-origin"]="center center",t.el_.style["-webkit-transform-origin"]="center center"},e.prototype.exitRotatescreen=function(){this.el_.removeAttribute("style"),document_1.removeEventListener("touchmove",preventScroll,{passive:!1}),document_1.body.style.overflowY="",this.screenRotated=!1,this.portrait(!0)},e.prototype.dispose=function(){if(!this.el_)return!1;this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&this.tech_.dispose(),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),t.prototype.dispose.call(this)},e.prototype.createEl=function(){var e=this.tag,n=void 0,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?n=this.el_=e.parentNode:r||(n=this.el_=t.prototype.createEl.call(this,"div"));var o=getAttributes(e);if(r){for(n=this.el_=e,e=this.tag=document_1.createElement("video");n.children.length;)e.appendChild(n.firstChild);hasClass(n,"video-js")||addClass(n,"video-js"),n.appendChild(e),i=this.playerElIngest_=n}if(e.setAttribute("tabindex","-1"),e.removeAttribute("width"),e.removeAttribute("height"),Object.getOwnPropertyNames(o).forEach(function(t){"class"===t?(n.className+=" "+o[t],r&&(e.className+=" "+o[t])):(n.setAttribute(t,o[t]),r&&e.setAttribute(t,o[t]))}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=n.player=this,this.addClass("vjs-paused"),!0!==window_1.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=createStyleElement("vjs-styles-dimensions");var s=$(".vjs-styles-defaults"),a=$("head");a.insertBefore(this.styleEl_,s?s.nextSibling:a.firstChild)}this.width(this.options_.width),this.height(this.options_.height),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var u=e.getElementsByTagName("a"),l=0;l<u.length;l++){var c=u.item(l);addClass(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(n,e),prependTo(e,n),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_=n,n},e.prototype.width=function(t,e){return this.dimension("width",t,e)},e.prototype.height=function(t,e){return this.dimension("height",t,e)},e.prototype.dimension=function(t,e,n){var i=t+"_";if(e===undefined)return this[i]||0;if(""===e)return this[i]=undefined,void this.updateStyleEl_();var r=parseFloat(e);if(isNaN(r))return void log$2.error('Improper value "'+e+'" supplied for for '+t);this[i]=r,this.updateStyleEl_(),this.isReady_&&!n&&this.trigger("playerresize")},e.prototype.fluid=function(t){if(t===undefined)return!!this.fluid_;this.fluid_=!!t,t?this.addClass("vjs-fluid"):this.removeClass("vjs-fluid"),this.updateStyleEl_()},e.prototype.aspectRatio=function(t){if(t===undefined)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(t))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=t,this.fluid(!0),this.updateStyleEl_()},e.prototype.updateStyleEl_=function(){if(!0===window_1.VIDEOJS_NO_DYNAMIC_STYLE){var t="number"==typeof this.width_?this.width_:this.options_.width,e="number"==typeof this.height_?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();return void(n&&(t>=0&&(n.width=t),e>=0&&(n.height=e)))}var i=void 0,r=void 0,o=void 0,s=void 0;o=this.aspectRatio_!==undefined&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var a=o.split(":"),u=a[1]/a[0];i=this.width_!==undefined?this.width_:this.height_!==undefined?this.height_/u:this.videoWidth()||300,r=this.height_!==undefined?this.height_:i*u,s=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(s),setTextContent(this.styleEl_,"\n ."+s+" {\n width: "+i+"px;\n height: "+r+"px;\n }\n\n ."+s+".vjs-fluid {\n padding-top: "+100*u+"%;\n }\n ")},e.prototype.loadTech_=function(t,e){var n=this;this.tech_&&this.unloadTech_();var i=toTitleCase(t),r=t.charAt(0).toLowerCase()+t.slice(1);"Html5"!==i&&this.tag&&(Tech.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;var o={source:e,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+i+"_api",autoplay:this.options_.autoplay,playsinline:this.options_.playsinline,preload:this.options_.preload,
|
|
15
|
-
loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],swf:this.options_.swf,hlsConfig:this.options_.hlsConfig,dashConfig:this.options_.dashConfig,flvConfig:this.options_.flvConfig,webrtcConfig:this.options_.webrtcConfig,xp2pConfig:this.options_.xp2pConfig};ALL.names.forEach(function(t){var e=ALL[t];o[e.getterName]=n[e.privateName]}),assign(o,this.options_[i]),assign(o,this.options_[r]),assign(o,this.options_[t.toLowerCase()]),this.tag&&(o.tag=this.tag),e&&e.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);var s=Tech.getTech(t);if(!s)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new s(this,o),this.tech_.ready(bind(this,this.handleTechReady_),!0),textTrackConverter.jsonToTextTracks(this.textTracksJson_||[],this.tech_),TECH_EVENTS_RETRIGGER.forEach(function(t){n.on(n.tech_,t,n["handleTech"+toTitleCase(t)+"_"])}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"canplay",this.handleTechCanPlay_),this.on(this.tech_,"canplaythrough",this.handleTechCanPlayThrough_),this.on(this.tech_,"playing",this.handleTechPlaying_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"seeked",this.handleTechSeeked_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"enterpictureinpicture",this.handleTechEnterPictureInPicture_),this.on(this.tech_,"leavepictureinpicture",this.handleTechLeavePictureInPicture_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"x5videoexitfullscreen",this.handleX5ExitFullscreen_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||prependTo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},e.prototype.unloadTech_=function(){var t=this;ALL.names.forEach(function(e){var n=ALL[e];t[n.privateName]=t[n.getterName]()}),this.textTracksJson_=textTrackConverter.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1},e.prototype.tech=function(t){return t===undefined&&log$2.warn(tsml(_templateObject$1)),this.tech_},e.prototype.addTechControlsListeners_=function(){this.tech_&&(this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_))},e.prototype.removeTechControlsListeners_=function(){this.tech_&&(this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_))},e.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(t){log$2("deleting tag.poster throws in some browsers",t)}},e.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.licenseCheckFailed||this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay"))},e.prototype.hasStarted=function(t){if(t===undefined)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},e.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},e.prototype.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return t.removeClass("vjs-waiting")})},e.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},e.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},e.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},e.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},e.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},e.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(log$2.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},e.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},e.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},e.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},e.prototype.handleTechClick_=function(t){isSingleLeftClick(t)&&this.controls_&&(this.paused()?this.play():this.pause())},e.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},e.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},e.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},e.prototype.handleTechTouchEnd_=function(t){t.preventDefault()},e.prototype.handleFullscreenChange_=function(){IS_IOS||(this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen"))},e.prototype.handleStageClick_=function(){this.reportUserActivity()},e.prototype.toggleFullscreenClass_=function(){IS_IOS||(this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen"))},e.prototype.documentFullscreenChange_=function(t){var e=FullscreenApi;this.isFullscreen(document_1[e.fullscreenElement]),!1===this.isFullscreen()&&off(document_1,e.fullscreenchange,bind(this,this.documentFullscreenChange_)),prefixedAPI||this.trigger("fullscreenchange")},e.prototype.handleTechFullscreenChange_=function(t,e){e&&this.isFullscreen(e.isFullscreen),this.trigger("fullscreenchange")},e.prototype.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},e.prototype.handleTechEnterPictureInPicture_=function(t){this.isInPictureInPicture(!0)},e.prototype.handleTechLeavePictureInPicture_=function(t){this.isInPictureInPicture(!1)},e.prototype.handleTechError_=function(){var t=this.tech_.error();this.error(t)},e.prototype.handleTechTextData_=function(){var t=null;arguments.length>1&&(t=arguments[1]),this.trigger("textdata",t)},e.prototype.handleX5ExitFullscreen_=function(){this.removeClass("vjs-fullscreen"),this.isFullscreen_=!this.isFullscreen_},e.prototype.getCache=function(){return this.cache_},e.prototype.techCall_=function(t,e){this.ready(function(){if(t in allowedSetters)return set$1(this.middleware_,this.tech_,t,e);try{this.tech_&&this.tech_[t](e)}catch(n){throw log$2(n),n}},!0)},e.prototype.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in allowedGetters)return get$3(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined)throw log$2("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw log$2("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw log$2(e),e}}},e.prototype.play=function(){var t=this;if(this.fatalError)return!1;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc())){try{if(this.tech_&&this.tech_.webrtcProvider&&this.tech_.webrtcProvider.webrtcPlayer){var e=this.tech_.webrtcProvider.webrtcPlayer;"function"==typeof e.resume&&e.resume()}}catch(n){}return this.techGet_("play")}this.playOnLoadstart_=function(){t.playOnLoadstart_=null,silencePromise(t.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready(function(){t.playWaitingForReady_=!1,silencePromise(t.play())})}},e.prototype.pause=function(){try{if(this.tech_&&this.tech_.webrtcProvider&&this.tech_.webrtcProvider.webrtcPlayer){var t=this.tech_.webrtcProvider.webrtcPlayer;"function"==typeof t.pause&&t.pause()}}catch(e){}this.techCall_("pause")},e.prototype.paused=function(){return!1!==this.techGet_("paused")},e.prototype.played=function(){return this.techGet_("played")||createTimeRanges(0,0)},e.prototype.scrubbing=function(t){if(void 0===t)return this.scrubbing_;this.scrubbing_=!!t,t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},e.prototype.currentTime=function(t){if(void 0!==t)return t<0&&(t=0),void this.techCall_("setCurrentTime",t);try{return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime}catch(e){return 0}},e.prototype.currentPDT=function(t){if(!this.plugins||!this.plugins.pdt)return"";var e=get_1(this,"tech_.hlsProvider.hls.playingDate");if(!e)return"";var n=new Date(e).getTime();if(t){var i=this.currentTime(),r=t-n;return this.currentTime(i+r/1e3),!1}return n},e.prototype.duration=function(t,e){t&&e&&(this.cache_.dvrDuration=t);var n="event"===get_1(this,"options_.plugins.Dvr.mode"),i="dvrEvent"===this.dvrMode();if(n&&i){var r=get_1(this,"tech_.hlsProvider.hls.levels[0].details.totalduration");r&&(this.cache_.duration=r),this.cache_.duration&&this.removeClass("vjs-live")}if(t===undefined)return this.cache_.duration!==undefined?this.cache_.duration:NaN;t=parseFloat(t),t<=0&&(t=Infinity),t!==this.cache_.duration&&(this.cache_.duration=t,t===Infinity?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange"))},e.prototype.dvrMode=function(){if(!this.cache_.src)return"dvrDefalt";var t=this.options_.plugins.Dvr;return t&&"event"===t.mode&&t.shiftURL&&this.cache_.src===t.shiftURL&&(this.cache_.src.indexOf("tsEventmode=on")>-1||this.cache_.src.indexOf("mode")>-1)?"dvrEvent":this.cache_.src.indexOf("delay=")>-1?"dvrDelay":t&&"event"===t.mode&&t.liveURL&&t.spriteURL&&t.startTime&&this.cache_.src===t.liveURL?"dvrLive":"dvrDefalt"},e.prototype.remainingTime=function(){return this.duration()-this.currentTime()},e.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},e.prototype.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=createTimeRanges(0,0)),t},e.prototype.bufferedPercent=function(){return bufferedPercent(this.buffered(),this.duration())},e.prototype.bufferedEnd=function(){var t=this.buffered(),e=this.duration(),n=t.end(t.length-1);return n>e&&(n=e),n},e.prototype.volume=function(t){var e=void 0;if(t!==undefined){if(e=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=e,IS_IOS){e>0?(this.muted(!1),this.lastVolume_(e)):this.muted(!0);var n=get_1(this,"tech_.webrtcProvider.webrtcPlayer");if(n)return n.setVolume(100*e),!1}return this.techCall_("setVolume",e),void(e>0?(this.muted(!1),this.lastVolume_(e)):this.muted(!0))}return e=parseFloat(this.techGet_("volume")),isNaN(e)?1:e},e.prototype.muted=function(t){return t!==undefined?void this.techCall_("setMuted",t):this.techGet_("muted")||!1},e.prototype.defaultMuted=function(t){return t!==undefined?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},e.prototype.lastVolume_=function(t){return t!==undefined&&0!==t?void(this.cache_.lastVolume=t):this.cache_.lastVolume},e.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},e.prototype.isFullscreen=function(t){return t!==undefined?(this.isFullscreen_=!!t,void this.toggleFullscreenClass_()):!!this.isFullscreen_},e.prototype.fullscreenType=function(t){return t!==undefined?void(this.fullscreenType_=t):this.fullscreenType_},e.prototype.requestFullscreen=function(t){var e=FullscreenApi;if(this.isFullscreen(!0),t||this.options_.fakeFullscreen){this.fullscreenType("css");var n=this;return(IS_IOS||IS_ANDROID)&&n.forceFixSubtitlesFont(),IS_IOS?(n.el_.style.width="100vw",n.el_.style.height="100%",n.el_.style.position="fixed",n.el_.style.zIndex="999",n.el_.style.top="0",document_1.body.style.overflowY="hidden",document_1.addEventListener("touchmove",preventScroll,{passive:!1}),this.trigger("fullscreenchange")):(this.enterFullWindow(),this.trigger("fullscreenchange")),!1}this.fullscreenType("system"),e.requestFullscreen?(on(document_1,e.fullscreenchange,bind(this,this.documentFullscreenChange_)),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},e.prototype.exitFullscreen=function(t){var e=FullscreenApi,n=this.fullscreenType();if(this.isFullscreen(!1),"css"===n||this.options_.fakeFullscreen)return(IS_IOS||IS_ANDROID)&&this.releaseSubtitlesFont(),IS_IOS?(this.el_.removeAttribute("style"),document_1.removeEventListener("touchmove",preventScroll,{passive:!1}),document_1.body.style.overflowY="",this.trigger("fullscreenchange")):(this.exitFullWindow(),this.trigger("fullscreenchange")),!1;e.requestFullscreen?document_1[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},e.prototype.forceFixSubtitlesFont=function(){loadCssText("tcp_force_fix_font","\n .vjs-text-track-display div div {\n font: "+(get_1(this.getChild("textTrackDisplay").el_,"children[0].children[0].style.font")||"10px sans-serif")+"!important;\n }\n ")},e.prototype.releaseSubtitlesFont=function(t){var e=get_1(this.getChild("textTrackDisplay").el_,"children[0].children[0]");e&&(e.style.display="none"),t&&setTimeout(function(){releaseCssText("tcp_force_fix_font")},1e3)},e.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=document_1.documentElement.style.overflow,on(document_1,"keydown",bind(this,this.fullWindowOnEscKey)),document_1.documentElement.style.overflow="hidden",addClass(document_1.body,"vjs-full-window"),this.trigger("enterFullWindow")},e.prototype.fullWindowOnEscKey=function(t){27===t.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},e.prototype.exitFullWindow=function(){this.isFullWindow=!1,off(document_1,"keydown",this.fullWindowOnEscKey),document_1.documentElement.style.overflow=this.docOrigOverflow,removeClass(document_1.body,"vjs-full-window"),this.trigger("exitFullWindow")},e.prototype.setForbidFartherSeek=function(t){if(t===undefined)return!!this.options_.forbidFartherSeek;this.options_.forbidFartherSeek=t},e.prototype.disablePictureInPicture=function(t){if(t===undefined)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",t),this.options_.disablePictureInPicture=t,this.trigger("disablepictureinpicturechanged")},e.prototype.isInPictureInPicture=function(t){return t!==undefined?(this.isInPictureInPicture_=!!t,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},e.prototype.requestPictureInPicture=function(){try{if("pictureInPictureEnabled"in document_1&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")}catch(t){}},e.prototype.exitPictureInPicture=function(){if("pictureInPictureEnabled"in document_1)return document_1.exitPictureInPicture()},e.prototype.canPlayType=function(t){for(var e=void 0,n=0,i=this.options_.techOrder;n<i.length;n++){var r=i[n],o=Tech.getTech(r);if(o||(o=Component.getComponent(r)),o){if(o.isSupported()&&(e=o.canPlayType(t)))return e}else log$2.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},e.prototype.selectSource=function(t){var e=this,n=this.options_.techOrder.map(function(t){return[t,Tech.getTech(t)]}).filter(function(t){var e=t[0],n=t[1];return n?n.isSupported():(log$2.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),i=function(t,e,n){var i=void 0;return t.some(function(t){return e.some(function(e){if(i=n(t,e))return!0})}),i},r=function(t,n){var i=t[0];if(t[1].canPlaySource(n,e.options_[i.toLowerCase()]))return{source:n,tech:i}};return(this.options_.sourceOrder?i(t,n,function(t){return function(e,n){return t(n,e)}}(r)):i(n,t,r))||!1},e.prototype.src=function(t){var e=this;if(void 0===t)return this.cache_.src||this.techGet_("src");var n=filterSource(t);if(n&&n[0]&&n[0].src&&isWebrtcUrl(n[0].src)&&!isWebRTCSupported()){if(this.options_.webrtcConfig&&this.options_.webrtcConfig.fallbackUrl)n[0].src=this.options_.webrtcConfig.fallbackUrl;else{var i=convertProtocol(n[0].src);n[0].src=i&&i[0]||n[0].src}this.setTimeout(function(){e.trigger({type:"webrtcfallback",data:{target:n[0].src}})},0)}if(!n.length)return void this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);if(this.options_&&this.options_.hlsConfig&&(this.options_.hlsConfig.disable||this.options_.hlsConfig.skipHlsJs)&&n.map(function(t){t.skipHlsJs=!0}),this.cache_.source&&isWebrtcUrl(this.cache_.source.src)&&isWebrtcUrl(n[0].src)&&this.cache_.source.src!==n[0].src){var r=this.tech_.webrtcProvider;if(r&&r.webrtcPlayer&&r.webrtcPlayer.switchStream)return this.tech_.webrtcProvider.webrtcPlayer.switchStream(n[0].src),this.cache_.sources=n,this.cache_.source=n[0],!1}this.lastSource=this.cache_.sources&&JSON.parse(JSON.stringify(this.cache_.sources)),this.cache_.sources=n,this.changingSrc_=!0,this.cache_.source=n[0],this.lastSource&&!get_1(this,"options_.fileID")&&get_1(this,"options_.plugins.ContinuePlay")&&setTimeout(function(){e.ContinuePlay().init(e.cache_.source)},0);try{this.cache_.source&&!isWebrtcUrl(this.cache_.source.src)&&this.options_.autoplay&&setTimeout(function(){var t=e.play&&e.play();isPromise(t)&&t.then()["catch"](function(){e.trigger("blocked")})},1e3)}catch(o){}setSource(this,n[0],function(t,i){if(e.middleware_=i,e.src_(t)){if(n.length>1){var r=n.slice(1),o=r[0].qualityLabelList;return o&&e.QualitySwitcher().setOptions({qualityLabelList:{video:o.slice(1)}}),e.src(r)}return e.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void e.triggerReady()}e.changingSrc_=!1,e.cache_.src=t.src,setTech(i,e.tech_)})},e.prototype.src_=function(t){var e=this.selectSource([t]);return!e||(window_1.performance&&"function"==typeof window_1.performance.mark&&window_1.performance.mark("firstFrameStart"),titleCaseEquals(e.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),"auto"===this.options_.preload&&this.load(),this.one("loadedmetadata",function(){1!==this.memoryPlaybackRate&&this.playbackRate(this.memoryPlaybackRate)})},!0),!1):(this.changingSrc_=!0,this.loadTech_(e.tech,e.source),!1))},e.prototype.load=function(){this.techCall_("load")},e.prototype.unload=function(t){if(t&&(this.fatalError=!0),!this.children_)return!1;try{this.pause(),this.tech_.hlsProvider&&this.tech_.hlsProvider.hls&&this.tech_.hlsProvider.hls.stopLoad(),this.tech_.flvProvider&&this.tech_.flvProvider.flv&&this.tech_.flvProvider.flv.unload(),this.tech_.webrtcProvider&&this.tech_.webrtcProvider.webrtcPlayer&&this.tech_.webrtcProvider.webrtcPlayer.stopPlay(),this.tech_.dashProvider&&this.tech_.dashProvider.dashPlayer&&this.tech_.dashProvider.dashPlayer.unload()}catch(e){}},e.prototype.reset=function(){this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},e.prototype.currentSources=function(){var t=this.currentSource(),e=[];return 0!==Object.keys(t).length&&e.push(t),this.cache_.sources||e},e.prototype.currentSource=function(){return this.cache_.source||{}},e.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},e.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},e.prototype.preload=function(t){return t!==undefined?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},e.prototype.autoplay=function(t){return t!==undefined?(this.techCall_("setAutoplay",t),this.options_.autoplay=t,void this.ready(this.forceAutoplayInChrome_)):this.techGet_("autoplay",t)},e.prototype.forceAutoplayInChrome_=function(){this.paused()&&(this.autoplay()||this.options_.autoplay)&&IS_CHROME&&!IS_ANDROID&&this.play()},e.prototype.playsinline=function(t){return t!==undefined?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},e.prototype.loop=function(t){return t!==undefined?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},e.prototype.poster=function(t){if(t===undefined)return this.poster_;t||(t=""),this.poster_=t,this.trigger("posterchange")},e.prototype.handleTechPosterChange_=function(){!this.poster_&&this.tech_&&this.tech_.poster&&(this.poster_=this.tech_.poster()||"",this.trigger("posterchange"))},e.prototype.controls=function(t){if(t===undefined)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},e.prototype.usingNativeControls=function(t){if(t===undefined)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},e.prototype.error=function(t){return t===undefined?this.error_||null:null===t?(this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new MediaError(t),this.addClass("vjs-error"),log$2.error("(CODE:"+this.error_.code+" "+MediaError.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger({type:"error",data:this.error_}))},e.prototype.reportUserActivity=function(t){this.userActivity_=!0},e.prototype.userActive=function(t){if(t===undefined)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},e.prototype.listenForUserActivity_=function(){var t=void 0,e=void 0,n=void 0,i=bind(this,this.reportUserActivity),r=function(t){t.screenX===e&&t.screenY===n||(e=t.screenX,n=t.screenY,i())},o=function(){i(),this.clearInterval(t),t=this.setInterval(i,250)},s=function(e){i(),this.clearInterval(t)};this.on("mousedown",o),this.on("mousemove",r),this.on("mouseup",s),this.on("keydown",i),this.on("keyup",i);var a=void 0;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var t=this.options_.inactivityTimeout;t<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},t))}},250)},e.prototype.playbackRate=function(t){return t!==undefined?(this.techCall_("setPlaybackRate",t),void(this.memoryPlaybackRate=t)):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("playbackRate"):1},e.prototype.defaultPlaybackRate=function(t){return t!==undefined?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},e.prototype.isAudio=function(t){return t!==undefined?void(this.isAudio_=!!t):!!this.isAudio_},e.prototype.addTextTrack=function(t,e,n){if(this.tech_)return this.tech_.addTextTrack(t,e,n)},e.prototype.addRemoteTextTrack=function(t,e){if(IS_IOS&&!window_1.textTrackCleared_&&(window_1.textTrackCleared_=!0),this.tech_)return this.tech_.addRemoteTextTrack(t,e)},e.prototype.removeRemoteTextTrack=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=t.track,n=e===undefined?arguments[0]:e;if(this.tech_)return this.tech_.removeRemoteTextTrack(n)},e.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},e.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},e.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},e.prototype.language=function(t){if(t===undefined)return this.language_;this.language_=String(t).toLowerCase()},e.prototype.languages=function(){return mergeOptions(e.prototype.options_.languages,this.languages_)},e.prototype.toJSON=function(){var t=mergeOptions(this.options_),e=t.tracks;t.tracks=[];for(var n=0;n<e.length;n++){var i=e[n];i=mergeOptions(i),i.player=undefined,t.tracks[n]=i}return t},e.prototype.createModal=function(t,e){var n=this;e=e||{},e.content=t||"";var i=new ModalDialog(this,e);return this.addChild(i),i.on("dispose",function(){n.removeChild(i)}),i.open(),i},e.getTagSettings=function(t){var e={sources:[],tracks:[]},n=getAttributes(t),i=n["data-setup"];if(hasClass(t,"vjs-fluid")&&(n.fluid=!0),null!==i){var r=tuple(i||"{}"),o=r[0],s=r[1];o&&log$2.error(o),assign(n,s)}if(assign(e,n),t.hasChildNodes())for(var a=t.childNodes,u=0,l=a.length;u<l;u++){var c=a[u],h=c.nodeName.toLowerCase();"source"===h?e.sources.push(getAttributes(c)):"track"===h&&e.tracks.push(getAttributes(c))}return e},e.prototype.flexNotSupported_=function(){var t=document_1.createElement("i");return!("flexBasis"in t.style||"webkitFlexBasis"in t.style||"mozFlexBasis"in t.style||"msFlexBasis"in t.style||"msFlexOrder"in t.style)},e}(Component);ALL.names.forEach(function(t){var e=ALL[t];Player.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Player.players={};var navigator$1=window_1.navigator;Player.prototype.options_={techOrder:Tech.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","mediaAsyncLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings","videoStatisticPanel"],language:navigator$1&&(navigator$1.languages&&navigator$1.languages[0]||navigator$1.userLanguage||navigator$1.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media."},["ended","seeking","seekable","networkState","readyState"].forEach(function(t){Player.prototype[t]=function(){return this.techGet_(t)}}),TECH_EVENTS_RETRIGGER.forEach(function(t){Player.prototype["handleTech"+toTitleCase(t)+"_"]=function(){return this.trigger(t)}}),Component.registerComponent("Player",Player);var BASE_PLUGIN_NAME="plugin",PLUGIN_CACHE_KEY="activePlugins_",pluginStorage={},pluginExists=function(t){return pluginStorage.hasOwnProperty(t)},getPlugin=function(t){return pluginExists(t)?pluginStorage[t]:undefined},markPluginAsActive=function(t,e){t[PLUGIN_CACHE_KEY]=t[PLUGIN_CACHE_KEY]||{},t[PLUGIN_CACHE_KEY][e]=!0},triggerSetupEvent=function(t,e,n){var i=(n?"before":"")+"pluginsetup";t.trigger(i,e),t.trigger(i+":"+e.name,e)},createBasicPlugin=function(t,e){var n=function(){triggerSetupEvent(this,{name:t,plugin:e,instance:null},!0);var n=e.apply(this,arguments);return markPluginAsActive(this,t),triggerSetupEvent(this,{name:t,plugin:e,instance:n}),n};return Object.keys(e).forEach(function(t){n[t]=e[t]}),n},createPluginFactory=function(t,e){return e.prototype.name=t,function(){triggerSetupEvent(this,{name:t,plugin:e,instance:null},!0);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=new(Function.prototype.bind.apply(e,[null].concat([this].concat(i))));return this[t]=function(){return o},triggerSetupEvent(this,o.getEventHash()),o}},Plugin=function(){function t(e){if(classCallCheck(this,t),this.constructor===t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,evented(this),delete this.trigger,stateful(this,this.constructor.defaultState),markPluginAsActive(e,this.name),this.dispose=bind(this,this.dispose),e.on("dispose",this.dispose)}return t.prototype.version=function(){return this.constructor.VERSION},t.prototype.getEventHash=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return t.name=this.name,t.plugin=this.constructor,t.instance=this,t},t.prototype.trigger=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return trigger(this.eventBusEl_,t,this.getEventHash(e))},t.prototype.handleStateChanged=function(t){},t.prototype.dispose=function(){var t=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[PLUGIN_CACHE_KEY][t]=!1,this.player=this.state=null,e[t]=createPluginFactory(t,pluginStorage[t])},t.isBasic=function(e){var n="string"==typeof e?getPlugin(e):e;return"function"==typeof n&&!t.prototype.isPrototypeOf(n.prototype)},t.registerPlugin=function(e,n){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+(void 0===e?"undefined":_typeof(e))+".");if(pluginExists(e))log$2.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(Player.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+(void 0===n?"undefined":_typeof(n))+".");return pluginStorage[e]=n,e!==BASE_PLUGIN_NAME&&(t.isBasic(n)?Player.prototype[e]=createBasicPlugin(e,n):Player.prototype[e]=createPluginFactory(e,n)),n},t.deregisterPlugin=function(t){if(t===BASE_PLUGIN_NAME)throw new Error("Cannot de-register base plugin.");pluginExists(t)&&(delete pluginStorage[t],delete Player.prototype[t])},t.getPlugins=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Object.keys(pluginStorage),e=void 0;return t.forEach(function(t){var n=getPlugin(t);n&&(e=e||{},e[t]=n)}),e},t.getPluginVersion=function(t){var e=getPlugin(t);return e&&e.VERSION||""},t}();Plugin.getPlugin=getPlugin,Plugin.BASE_PLUGIN_NAME=BASE_PLUGIN_NAME,Plugin.registerPlugin(BASE_PLUGIN_NAME,Plugin),Player.prototype.usingPlugin=function(t){return!!this[PLUGIN_CACHE_KEY]&&!0===this[PLUGIN_CACHE_KEY][t]},Player.prototype.hasPlugin=function(t){return!!pluginExists(t)};var _inherits=function(t,e){
|
|
15
|
+
loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],swf:this.options_.swf,hlsConfig:this.options_.hlsConfig,dashConfig:this.options_.dashConfig,flvConfig:this.options_.flvConfig,webrtcConfig:this.options_.webrtcConfig,xp2pConfig:this.options_.xp2pConfig};ALL.names.forEach(function(t){var e=ALL[t];o[e.getterName]=n[e.privateName]}),assign(o,this.options_[i]),assign(o,this.options_[r]),assign(o,this.options_[t.toLowerCase()]),this.tag&&(o.tag=this.tag),e&&e.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);var s=Tech.getTech(t);if(!s)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new s(this,o),this.tech_.ready(bind(this,this.handleTechReady_),!0),textTrackConverter.jsonToTextTracks(this.textTracksJson_||[],this.tech_),TECH_EVENTS_RETRIGGER.forEach(function(t){n.on(n.tech_,t,n["handleTech"+toTitleCase(t)+"_"])}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"canplay",this.handleTechCanPlay_),this.on(this.tech_,"canplaythrough",this.handleTechCanPlayThrough_),this.on(this.tech_,"playing",this.handleTechPlaying_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"seeked",this.handleTechSeeked_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"enterpictureinpicture",this.handleTechEnterPictureInPicture_),this.on(this.tech_,"leavepictureinpicture",this.handleTechLeavePictureInPicture_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"x5videoexitfullscreen",this.handleX5ExitFullscreen_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||prependTo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},e.prototype.unloadTech_=function(){var t=this;ALL.names.forEach(function(e){var n=ALL[e];t[n.privateName]=t[n.getterName]()}),this.textTracksJson_=textTrackConverter.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1},e.prototype.tech=function(t){return t===undefined&&log$2.warn(tsml(_templateObject$1)),this.tech_},e.prototype.addTechControlsListeners_=function(){this.tech_&&(this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_))},e.prototype.removeTechControlsListeners_=function(){this.tech_&&(this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_))},e.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(t){log$2("deleting tag.poster throws in some browsers",t)}},e.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.licenseCheckFailed||this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay"))},e.prototype.hasStarted=function(t){if(t===undefined)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},e.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},e.prototype.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return t.removeClass("vjs-waiting")})},e.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},e.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},e.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},e.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},e.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},e.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(log$2.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},e.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},e.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},e.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},e.prototype.handleTechClick_=function(t){isSingleLeftClick(t)&&this.controls_&&(this.paused()?this.play():this.pause())},e.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},e.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},e.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},e.prototype.handleTechTouchEnd_=function(t){t.preventDefault()},e.prototype.handleFullscreenChange_=function(){IS_IOS||(this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen"))},e.prototype.handleStageClick_=function(){this.reportUserActivity()},e.prototype.toggleFullscreenClass_=function(){IS_IOS||(this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen"))},e.prototype.documentFullscreenChange_=function(t){var e=FullscreenApi;this.isFullscreen(document_1[e.fullscreenElement]),!1===this.isFullscreen()&&off(document_1,e.fullscreenchange,bind(this,this.documentFullscreenChange_)),prefixedAPI||this.trigger("fullscreenchange")},e.prototype.handleTechFullscreenChange_=function(t,e){e&&this.isFullscreen(e.isFullscreen),this.trigger("fullscreenchange")},e.prototype.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},e.prototype.handleTechEnterPictureInPicture_=function(t){this.isInPictureInPicture(!0)},e.prototype.handleTechLeavePictureInPicture_=function(t){this.isInPictureInPicture(!1)},e.prototype.handleTechError_=function(){var t=this.tech_.error();this.error(t)},e.prototype.handleTechTextData_=function(){var t=null;arguments.length>1&&(t=arguments[1]),this.trigger("textdata",t)},e.prototype.handleX5ExitFullscreen_=function(){this.removeClass("vjs-fullscreen"),this.isFullscreen_=!this.isFullscreen_},e.prototype.getCache=function(){return this.cache_},e.prototype.techCall_=function(t,e){this.ready(function(){if(t in allowedSetters)return set$1(this.middleware_,this.tech_,t,e);try{this.tech_&&this.tech_[t](e)}catch(n){throw log$2(n),n}},!0)},e.prototype.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in allowedGetters)return get$3(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined)throw log$2("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw log$2("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw log$2(e),e}}},e.prototype.play=function(){var t=this;if(this.fatalError)return!1;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc())){try{if(this.tech_&&this.tech_.webrtcProvider&&this.tech_.webrtcProvider.webrtcPlayer){var e=this.tech_.webrtcProvider.webrtcPlayer;"function"==typeof e.resume&&e.resume()}}catch(n){}return this.techGet_("play")}this.playOnLoadstart_=function(){t.playOnLoadstart_=null,silencePromise(t.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready(function(){t.playWaitingForReady_=!1,silencePromise(t.play())})}},e.prototype.pause=function(){try{if(this.tech_&&this.tech_.webrtcProvider&&this.tech_.webrtcProvider.webrtcPlayer){var t=this.tech_.webrtcProvider.webrtcPlayer;"function"==typeof t.pause&&t.pause()}}catch(e){}this.techCall_("pause")},e.prototype.paused=function(){return!1!==this.techGet_("paused")},e.prototype.played=function(){return this.techGet_("played")||createTimeRanges(0,0)},e.prototype.scrubbing=function(t){if(void 0===t)return this.scrubbing_;this.scrubbing_=!!t,t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},e.prototype.currentTime=function(t){if(void 0!==t)return t<0&&(t=0),void this.techCall_("setCurrentTime",t);try{return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime}catch(e){return 0}},e.prototype.currentPDT=function(t){if(!this.plugins||!this.plugins.pdt)return"";var e=get_1(this,"tech_.hlsProvider.hls.playingDate");if(!e)return"";var n=new Date(e).getTime();if(t){var i=this.currentTime(),r=t-n;return this.currentTime(i+r/1e3),!1}return n},e.prototype.duration=function(t,e){t&&e&&(this.cache_.dvrDuration=t);var n="event"===get_1(this,"options_.plugins.Dvr.mode"),i="dvrEvent"===this.dvrMode();if(n&&i){var r=get_1(this,"tech_.hlsProvider.hls.levels[0].details.totalduration");r&&(this.cache_.duration=r),this.cache_.duration&&this.removeClass("vjs-live")}if(t===undefined)return this.cache_.duration!==undefined?this.cache_.duration:NaN;t=parseFloat(t),t<=0&&(t=Infinity),t!==this.cache_.duration&&(this.cache_.duration=t,t===Infinity?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange"))},e.prototype.dvrMode=function(){if(!this.cache_.src)return"dvrDefalt";var t=this.options_.plugins.Dvr;return t&&"event"===t.mode&&t.shiftURL&&this.cache_.src===t.shiftURL&&(this.cache_.src.indexOf("tsEventmode=on")>-1||this.cache_.src.indexOf("mode")>-1)?"dvrEvent":this.cache_.src.indexOf("delay=")>-1?"dvrDelay":t&&"event"===t.mode&&t.liveURL&&t.spriteURL&&t.startTime&&this.cache_.src===t.liveURL?"dvrLive":"dvrDefalt"},e.prototype.remainingTime=function(){return this.duration()-this.currentTime()},e.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},e.prototype.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=createTimeRanges(0,0)),t},e.prototype.bufferedPercent=function(){return bufferedPercent(this.buffered(),this.duration())},e.prototype.bufferedEnd=function(){var t=this.buffered(),e=this.duration(),n=t.end(t.length-1);return n>e&&(n=e),n},e.prototype.volume=function(t){var e=void 0;if(t!==undefined){if(e=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=e,IS_IOS){e>0?(this.muted(!1),this.lastVolume_(e)):this.muted(!0);var n=get_1(this,"tech_.webrtcProvider.webrtcPlayer");if(n)return n.setVolume(100*e),!1}return this.techCall_("setVolume",e),void(e>0?(this.muted(!1),this.lastVolume_(e)):this.muted(!0))}return e=parseFloat(this.techGet_("volume")),isNaN(e)?1:e},e.prototype.muted=function(t){return t!==undefined?void this.techCall_("setMuted",t):this.techGet_("muted")||!1},e.prototype.defaultMuted=function(t){return t!==undefined?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},e.prototype.lastVolume_=function(t){return t!==undefined&&0!==t?void(this.cache_.lastVolume=t):this.cache_.lastVolume},e.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},e.prototype.isFullscreen=function(t){return t!==undefined?(this.isFullscreen_=!!t,void this.toggleFullscreenClass_()):!!this.isFullscreen_},e.prototype.fullscreenType=function(t){return t!==undefined?void(this.fullscreenType_=t):this.fullscreenType_},e.prototype.requestFullscreen=function(t){var e=FullscreenApi;if(this.isFullscreen(!0),t||this.options_.fakeFullscreen){this.fullscreenType("css");var n=this;return(IS_IOS||IS_ANDROID)&&n.forceFixSubtitlesFont(),IS_IOS?(n.el_.style.width="100vw",n.el_.style.height="100%",n.el_.style.position="fixed",n.el_.style.zIndex="999",n.el_.style.top="0",document_1.body.style.overflowY="hidden",document_1.addEventListener("touchmove",preventScroll,{passive:!1}),this.trigger("fullscreenchange")):(this.enterFullWindow(),this.trigger("fullscreenchange")),!1}this.fullscreenType("system"),e.requestFullscreen?(on(document_1,e.fullscreenchange,bind(this,this.documentFullscreenChange_)),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},e.prototype.exitFullscreen=function(t){var e=FullscreenApi,n=this.fullscreenType();if(this.isFullscreen(!1),"css"===n||this.options_.fakeFullscreen)return(IS_IOS||IS_ANDROID)&&this.releaseSubtitlesFont(),IS_IOS?(this.el_.removeAttribute("style"),document_1.removeEventListener("touchmove",preventScroll,{passive:!1}),document_1.body.style.overflowY="",this.trigger("fullscreenchange")):(this.exitFullWindow(),this.trigger("fullscreenchange")),!1;e.requestFullscreen?document_1[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},e.prototype.forceFixSubtitlesFont=function(){loadCssText("tcp_force_fix_font","\n .vjs-text-track-display div div {\n font: "+(get_1(this.getChild("textTrackDisplay").el_,"children[0].children[0].style.font")||"10px sans-serif")+"!important;\n }\n ")},e.prototype.releaseSubtitlesFont=function(t){var e=get_1(this.getChild("textTrackDisplay").el_,"children[0].children[0]");e&&(e.style.display="none"),t&&setTimeout(function(){releaseCssText("tcp_force_fix_font")},1e3)},e.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=document_1.documentElement.style.overflow,on(document_1,"keydown",bind(this,this.fullWindowOnEscKey)),document_1.documentElement.style.overflow="hidden",addClass(document_1.body,"vjs-full-window"),this.trigger("enterFullWindow")},e.prototype.fullWindowOnEscKey=function(t){27===t.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},e.prototype.exitFullWindow=function(){this.isFullWindow=!1,off(document_1,"keydown",this.fullWindowOnEscKey),document_1.documentElement.style.overflow=this.docOrigOverflow,removeClass(document_1.body,"vjs-full-window"),this.trigger("exitFullWindow")},e.prototype.setForbidFartherSeek=function(t){if(t===undefined)return!!this.options_.forbidFartherSeek;this.options_.forbidFartherSeek=t},e.prototype.disablePictureInPicture=function(t){if(t===undefined)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",t),this.options_.disablePictureInPicture=t,this.trigger("disablepictureinpicturechanged")},e.prototype.isInPictureInPicture=function(t){return t!==undefined?(this.isInPictureInPicture_=!!t,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},e.prototype.requestPictureInPicture=function(){try{if("pictureInPictureEnabled"in document_1&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")}catch(t){}},e.prototype.exitPictureInPicture=function(){if("pictureInPictureEnabled"in document_1)return document_1.exitPictureInPicture()},e.prototype.canPlayType=function(t){for(var e=void 0,n=0,i=this.options_.techOrder;n<i.length;n++){var r=i[n],o=Tech.getTech(r);if(o||(o=Component.getComponent(r)),o){if(o.isSupported()&&(e=o.canPlayType(t)))return e}else log$2.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},e.prototype.selectSource=function(t){var e=this,n=this.options_.techOrder.map(function(t){return[t,Tech.getTech(t)]}).filter(function(t){var e=t[0],n=t[1];return n?n.isSupported():(log$2.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),i=function(t,e,n){var i=void 0;return t.some(function(t){return e.some(function(e){if(i=n(t,e))return!0})}),i},r=function(t,n){var i=t[0];if(t[1].canPlaySource(n,e.options_[i.toLowerCase()]))return{source:n,tech:i}};return(this.options_.sourceOrder?i(t,n,function(t){return function(e,n){return t(n,e)}}(r)):i(n,t,r))||!1},e.prototype.src=function(t){var e=this;if(void 0===t)return this.cache_.src||this.techGet_("src");var n=filterSource(t);if(n&&n[0]&&n[0].src&&isWebrtcUrl(n[0].src)&&!isWebRTCSupported()){if(this.options_.webrtcConfig&&this.options_.webrtcConfig.fallbackUrl)n[0].src=this.options_.webrtcConfig.fallbackUrl;else{var i=convertProtocol(n[0].src);n[0].src=i&&i[0]||n[0].src}this.setTimeout(function(){e.trigger({type:"webrtcfallback",data:{target:n[0].src}})},0)}if(!n.length)return void this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0);if(this.options_&&this.options_.hlsConfig&&(this.options_.hlsConfig.disable||this.options_.hlsConfig.skipHlsJs)&&n.map(function(t){t.skipHlsJs=!0}),this.cache_.source&&isWebrtcUrl(this.cache_.source.src)&&isWebrtcUrl(n[0].src)&&this.cache_.source.src!==n[0].src){var r=this.tech_.webrtcProvider;if(r&&r.webrtcPlayer&&r.webrtcPlayer.switchStream)return this.tech_.webrtcProvider.webrtcPlayer.switchStream(n[0].src),this.cache_.sources=n,this.cache_.source=n[0],!1}this.lastSource=this.cache_.sources&&JSON.parse(JSON.stringify(this.cache_.sources)),this.cache_.sources=n,this.changingSrc_=!0,this.cache_.source=n[0],this.lastSource&&!get_1(this,"options_.fileID")&&get_1(this,"options_.plugins.ContinuePlay")&&setTimeout(function(){e.ContinuePlay().init(e.cache_.source)},0);try{this.cache_.source&&!isWebrtcUrl(this.cache_.source.src)&&this.options_.autoplay&&setTimeout(function(){var t=e.play&&e.play();isPromise(t)&&t.then()["catch"](function(){e.trigger("blocked")})},1e3)}catch(o){}setSource(this,n[0],function(t,i){if(e.middleware_=i,e.src_(t)){if(n.length>1){var r=n.slice(1),o=r[0].qualityLabelList;return o&&e.QualitySwitcher().setOptions({qualityLabelList:{video:o.slice(1)}}),e.src(r)}return e.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void e.triggerReady()}e.changingSrc_=!1,e.cache_.src=t.src,setTech(i,e.tech_)})},e.prototype.src_=function(t){var e=this.selectSource([t]);return!e||(this.one("playing",function(){IS_IOS&&isWebrtcUrl(t.src)||this.trigger("audiorunning")}),window_1.performance&&"function"==typeof window_1.performance.mark&&window_1.performance.mark("firstFrameStart"),titleCaseEquals(e.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),"auto"===this.options_.preload&&this.load(),this.one("loadedmetadata",function(){1!==this.memoryPlaybackRate&&this.playbackRate(this.memoryPlaybackRate)})},!0),!1):(this.changingSrc_=!0,this.loadTech_(e.tech,e.source),!1))},e.prototype.load=function(){this.techCall_("load")},e.prototype.unload=function(t){if(t&&(this.fatalError=!0),!this.children_)return!1;try{this.pause(),this.tech_.hlsProvider&&this.tech_.hlsProvider.hls&&this.tech_.hlsProvider.hls.stopLoad(),this.tech_.flvProvider&&this.tech_.flvProvider.flv&&this.tech_.flvProvider.flv.unload(),this.tech_.webrtcProvider&&this.tech_.webrtcProvider.webrtcPlayer&&this.tech_.webrtcProvider.webrtcPlayer.stopPlay(),this.tech_.dashProvider&&this.tech_.dashProvider.dashPlayer&&this.tech_.dashProvider.dashPlayer.unload()}catch(e){}},e.prototype.reset=function(){this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},e.prototype.currentSources=function(){var t=this.currentSource(),e=[];return 0!==Object.keys(t).length&&e.push(t),this.cache_.sources||e},e.prototype.currentSource=function(){return this.cache_.source||{}},e.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},e.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},e.prototype.preload=function(t){return t!==undefined?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},e.prototype.autoplay=function(t){return t!==undefined?(this.techCall_("setAutoplay",t),this.options_.autoplay=t,void this.ready(this.forceAutoplayInChrome_)):this.techGet_("autoplay",t)},e.prototype.forceAutoplayInChrome_=function(){this.paused()&&(this.autoplay()||this.options_.autoplay)&&IS_CHROME&&!IS_ANDROID&&this.play()},e.prototype.playsinline=function(t){return t!==undefined?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},e.prototype.loop=function(t){return t!==undefined?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},e.prototype.poster=function(t){if(t===undefined)return this.poster_;t||(t=""),this.poster_=t,this.trigger("posterchange")},e.prototype.handleTechPosterChange_=function(){!this.poster_&&this.tech_&&this.tech_.poster&&(this.poster_=this.tech_.poster()||"",this.trigger("posterchange"))},e.prototype.controls=function(t){if(t===undefined)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},e.prototype.usingNativeControls=function(t){if(t===undefined)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},e.prototype.error=function(t){return t===undefined?this.error_||null:null===t?(this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new MediaError(t),this.addClass("vjs-error"),log$2.error("(CODE:"+this.error_.code+" "+MediaError.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger({type:"error",data:this.error_}))},e.prototype.reportUserActivity=function(t){this.userActivity_=!0},e.prototype.userActive=function(t){if(t===undefined)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},e.prototype.listenForUserActivity_=function(){var t=void 0,e=void 0,n=void 0,i=bind(this,this.reportUserActivity),r=function(t){t.screenX===e&&t.screenY===n||(e=t.screenX,n=t.screenY,i())},o=function(){i(),this.clearInterval(t),t=this.setInterval(i,250)},s=function(e){i(),this.clearInterval(t)};this.on("mousedown",o),this.on("mousemove",r),this.on("mouseup",s),this.on("keydown",i),this.on("keyup",i);var a=void 0;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var t=this.options_.inactivityTimeout;t<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},t))}},250)},e.prototype.playbackRate=function(t){return t!==undefined?(this.techCall_("setPlaybackRate",t),void(this.memoryPlaybackRate=t)):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("playbackRate"):1},e.prototype.defaultPlaybackRate=function(t){return t!==undefined?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},e.prototype.isAudio=function(t){return t!==undefined?void(this.isAudio_=!!t):!!this.isAudio_},e.prototype.addTextTrack=function(t,e,n){if(this.tech_)return this.tech_.addTextTrack(t,e,n)},e.prototype.addRemoteTextTrack=function(t,e){if(IS_IOS&&!window_1.textTrackCleared_&&(window_1.textTrackCleared_=!0),this.tech_)return this.tech_.addRemoteTextTrack(t,e)},e.prototype.removeRemoteTextTrack=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=t.track,n=e===undefined?arguments[0]:e;if(this.tech_)return this.tech_.removeRemoteTextTrack(n)},e.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},e.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},e.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},e.prototype.language=function(t){if(t===undefined)return this.language_;this.language_=String(t).toLowerCase()},e.prototype.languages=function(){return mergeOptions(e.prototype.options_.languages,this.languages_)},e.prototype.toJSON=function(){var t=mergeOptions(this.options_),e=t.tracks;t.tracks=[];for(var n=0;n<e.length;n++){var i=e[n];i=mergeOptions(i),i.player=undefined,t.tracks[n]=i}return t},e.prototype.createModal=function(t,e){var n=this;e=e||{},e.content=t||"";var i=new ModalDialog(this,e);return this.addChild(i),i.on("dispose",function(){n.removeChild(i)}),i.open(),i},e.getTagSettings=function(t){var e={sources:[],tracks:[]},n=getAttributes(t),i=n["data-setup"];if(hasClass(t,"vjs-fluid")&&(n.fluid=!0),null!==i){var r=tuple(i||"{}"),o=r[0],s=r[1];o&&log$2.error(o),assign(n,s)}if(assign(e,n),t.hasChildNodes())for(var a=t.childNodes,u=0,l=a.length;u<l;u++){var c=a[u],h=c.nodeName.toLowerCase();"source"===h?e.sources.push(getAttributes(c)):"track"===h&&e.tracks.push(getAttributes(c))}return e},e.prototype.flexNotSupported_=function(){var t=document_1.createElement("i");return!("flexBasis"in t.style||"webkitFlexBasis"in t.style||"mozFlexBasis"in t.style||"msFlexBasis"in t.style||"msFlexOrder"in t.style)},e}(Component);ALL.names.forEach(function(t){var e=ALL[t];Player.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Player.players={};var navigator$1=window_1.navigator;Player.prototype.options_={techOrder:Tech.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","mediaAsyncLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings","videoStatisticPanel"],language:navigator$1&&(navigator$1.languages&&navigator$1.languages[0]||navigator$1.userLanguage||navigator$1.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media."},["ended","seeking","seekable","networkState","readyState"].forEach(function(t){Player.prototype[t]=function(){return this.techGet_(t)}}),TECH_EVENTS_RETRIGGER.forEach(function(t){Player.prototype["handleTech"+toTitleCase(t)+"_"]=function(){return this.trigger(t)}}),Component.registerComponent("Player",Player);var BASE_PLUGIN_NAME="plugin",PLUGIN_CACHE_KEY="activePlugins_",pluginStorage={},pluginExists=function(t){return pluginStorage.hasOwnProperty(t)},getPlugin=function(t){return pluginExists(t)?pluginStorage[t]:undefined},markPluginAsActive=function(t,e){t[PLUGIN_CACHE_KEY]=t[PLUGIN_CACHE_KEY]||{},t[PLUGIN_CACHE_KEY][e]=!0},triggerSetupEvent=function(t,e,n){var i=(n?"before":"")+"pluginsetup";t.trigger(i,e),t.trigger(i+":"+e.name,e)},createBasicPlugin=function(t,e){var n=function(){triggerSetupEvent(this,{name:t,plugin:e,instance:null},!0);var n=e.apply(this,arguments);return markPluginAsActive(this,t),triggerSetupEvent(this,{name:t,plugin:e,instance:n}),n};return Object.keys(e).forEach(function(t){n[t]=e[t]}),n},createPluginFactory=function(t,e){return e.prototype.name=t,function(){triggerSetupEvent(this,{name:t,plugin:e,instance:null},!0);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=new(Function.prototype.bind.apply(e,[null].concat([this].concat(i))));return this[t]=function(){return o},triggerSetupEvent(this,o.getEventHash()),o}},Plugin=function(){function t(e){if(classCallCheck(this,t),this.constructor===t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,evented(this),delete this.trigger,stateful(this,this.constructor.defaultState),markPluginAsActive(e,this.name),this.dispose=bind(this,this.dispose),e.on("dispose",this.dispose)}return t.prototype.version=function(){return this.constructor.VERSION},t.prototype.getEventHash=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return t.name=this.name,t.plugin=this.constructor,t.instance=this,t},t.prototype.trigger=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return trigger(this.eventBusEl_,t,this.getEventHash(e))},t.prototype.handleStateChanged=function(t){},t.prototype.dispose=function(){var t=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[PLUGIN_CACHE_KEY][t]=!1,this.player=this.state=null,e[t]=createPluginFactory(t,pluginStorage[t])},t.isBasic=function(e){var n="string"==typeof e?getPlugin(e):e;return"function"==typeof n&&!t.prototype.isPrototypeOf(n.prototype)},t.registerPlugin=function(e,n){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+(void 0===e?"undefined":_typeof(e))+".");if(pluginExists(e))log$2.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(Player.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+(void 0===n?"undefined":_typeof(n))+".");return pluginStorage[e]=n,e!==BASE_PLUGIN_NAME&&(t.isBasic(n)?Player.prototype[e]=createBasicPlugin(e,n):Player.prototype[e]=createPluginFactory(e,n)),n},t.deregisterPlugin=function(t){if(t===BASE_PLUGIN_NAME)throw new Error("Cannot de-register base plugin.");pluginExists(t)&&(delete pluginStorage[t],delete Player.prototype[t])},t.getPlugins=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Object.keys(pluginStorage),e=void 0;return t.forEach(function(t){var n=getPlugin(t);n&&(e=e||{},e[t]=n)}),e},t.getPluginVersion=function(t){var e=getPlugin(t);return e&&e.VERSION||""},t}();Plugin.getPlugin=getPlugin,Plugin.BASE_PLUGIN_NAME=BASE_PLUGIN_NAME,Plugin.registerPlugin(BASE_PLUGIN_NAME,Plugin),Player.prototype.usingPlugin=function(t){return!!this[PLUGIN_CACHE_KEY]&&!0===this[PLUGIN_CACHE_KEY][t]},Player.prototype.hasPlugin=function(t){return!!pluginExists(t)};var _inherits=function(t,e){
|
|
16
16
|
if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.super_=e)},extendFn=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=function(){t.apply(this,arguments)},i={};"object"===(void 0===e?"undefined":_typeof(e))?(e.constructor!==Object.prototype.constructor&&(n=e.constructor),i=e):"function"==typeof e&&(n=e),_inherits(n,t);for(var r in i)i.hasOwnProperty(r)&&(n.prototype[r]=i[r]);return n};if("undefined"==typeof HTMLVideoElement&&isReal()&&(document_1.createElement("video"),document_1.createElement("audio"),document_1.createElement("track"),document_1.createElement("video-js")),videojs.hooks_={},videojs.hooks=function(t,e){return videojs.hooks_[t]=videojs.hooks_[t]||[],e&&(videojs.hooks_[t]=videojs.hooks_[t].concat(e)),videojs.hooks_[t]},videojs.hook=function(t,e){videojs.hooks(t,e)},videojs.hookOnce=function(t,e){videojs.hooks(t,[].concat(e).map(function(e){return function n(){return videojs.removeHook(t,n),e.apply(undefined,arguments)}}))},videojs.removeHook=function(t,e){var n=videojs.hooks(t).indexOf(e);return!(n<=-1)&&(videojs.hooks_[t]=videojs.hooks_[t].slice(),videojs.hooks_[t].splice(n,1),!0)},!0!==window_1.VIDEOJS_NO_DYNAMIC_STYLE&&isReal()){var style=$(".vjs-styles-defaults");if(!style){style=createStyleElement("vjs-styles-defaults");var head=$("head");head&&head.insertBefore(style,head.firstChild),setTextContent(style,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}autoSetupTimeout(1,videojs),videojs.VERSION=version,videojs.options=Player.prototype.options_,videojs.getPlayers=function(){return Player.players},videojs.players=Player.players,videojs.getComponent=Component.getComponent,videojs.registerComponent=function(t,e){Tech.isTech(e)&&log$2.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),Component.registerComponent.call(Component,t,e)},videojs.getTech=Tech.getTech,videojs.registerTech=Tech.registerTech,videojs.use=use,videojs.browser=browser,videojs.TOUCH_ENABLED=TOUCH_ENABLED,videojs.extend=extendFn,videojs.mergeOptions=mergeOptions,videojs.bind=bind,videojs.registerPlugin=Plugin.registerPlugin,videojs.plugin=function(t,e){return log$2.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Plugin.registerPlugin(t,e)},videojs.getPlugins=Plugin.getPlugins,videojs.getPlugin=Plugin.getPlugin,videojs.getPluginVersion=Plugin.getPluginVersion,videojs.addLanguage=function(t,e){var n;return t=(""+t).toLowerCase(),videojs.options.languages=mergeOptions(videojs.options.languages,(n={},n[t]=e,n)),videojs.options.languages[t]},videojs.log=log$2,videojs.createTimeRange=videojs.createTimeRanges=createTimeRanges,videojs.formatTime=formatTime,videojs.parseUrl=parseUrl,videojs.isCrossOrigin=isCrossOrigin,videojs.EventTarget=EventTarget,videojs.on=on,videojs.one=one,videojs.off=off,videojs.trigger=trigger,videojs.xhr=xhr,videojs.TextTrack=TextTrack,videojs.AudioTrack=AudioTrack,videojs.VideoTrack=VideoTrack,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(t){videojs[t]=function(){return log$2.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),Dom[t].apply(null,arguments)}}),videojs.computedStyle=computedStyle,videojs.dom=Dom,videojs.url=Url;var strictUriEncode=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})},getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty$5=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable,objectAssign=shouldUseNative()?Object.assign:function(t,e){for(var n,i,r=toObject(t),o=1;o<arguments.length;o++){n=Object(arguments[o]);for(var s in n)hasOwnProperty$5.call(n,s)&&(r[s]=n[s]);if(getOwnPropertySymbols){i=getOwnPropertySymbols(n);for(var a=0;a<i.length;a++)propIsEnumerable.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r},token="%[a-f0-9]{2}",singleMatcher=new RegExp(token,"gi"),multiMatcher=new RegExp("("+token+")+","gi"),decodeUriComponent=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return customDecodeURIComponent(t)}},extract_1=extract,parse_1=parse,stringify=function(t,e){e=objectAssign({encode:!0,strict:!0,arrayFormat:"none"},e),!1===e.sort&&(e.sort=function(){});var n=encoderForArrayFormat(e);return t?Object.keys(t).sort(e.sort).map(function(i){var r=t[i];if(r===undefined)return"";if(null===r)return encode(i,e);if(Array.isArray(r)){var o=[];return r.slice().forEach(function(t){t!==undefined&&o.push(n(i,t,o.length))}),o.join("&")}return encode(i,e)+"="+encode(r,e)}).filter(function(t){return t.length>0}).join("&"):""},parseUrl$1=function(t,e){return{url:t.split("?")[0]||"",query:parse(extract(t),e)}},queryString={extract:extract_1,parse:parse_1,stringify:stringify,parseUrl:parseUrl$1},count=0,MediaAsyncLoader=function(t){function e(n,i,r){classCallCheck(this,e),log$2("MediaAsyncLoader initializing");var o=mergeOptions({createEl:!1},i),s=possibleConstructorReturn(this,t.call(this,n,o,r));s.enModule=new Enc,n.loadVideoByID=bind(s,s.loadVideoByID);var a=o.playerOptions||o;if(!a.fileID){var u;return u=!1,possibleConstructorReturn(s,u)}return s.playCGIHosts=(a.playCGIHosts||[]).concat([SERVER_PATH,SERVER_PATH_BACKUP,"playvideo.vodplayvideo.com","playvideo.vod-common.com"]),s.playCGIIndex=0,s.playCGIMerged=!0,s.getInfo(a),s.getEscapeDomains(a),log$2("MediaAsyncLoader initialized"),s}return inherits(e,t),e.prototype.getEscapeDomains=function(t){xhr({url:"https://get-domains.vod-backup.net/getEscapeDomains?AppId="+t.appID},bind(this,this.onDomainResult))},e.prototype.onDomainResult=function(t,e,n){try{n&&(e=JSON.parse(n))}catch(s){}var i=this.player();if(!t){var r=e.Data.LicenseDomains||[],o=e.Data.PlayCGIDomains||[];this.playCGIHosts=this.playCGIHosts.concat(o),i.cache_.licenseDomains=r}},e.prototype.getInfo=function(t){t&&t.fileID&&t.appID&&(performance&&"function"==typeof performance.mark&&performance.mark("firstFrameStart"),t.playDefinition?this.getInfoV3(t):t.sign||t.ssign?this.getInfoV2(t):this.getInfoV4(t))},e.prototype.getInfoV2=function(t){var e=this.player(),n=this.assemblyPath("getplayinfo",t.appID,t.fileID),i=t.t,r=t.us,o=t.exper,s=t.sign,a={};t.ssign?a.super_sign=t.ssign:s&&(a={t:i,sign:s},(r||0==r)&&(a.us=r),(o||0==o)&&(a.exper=o,e.trigger({type:"feature",data:"exper"})),e.trigger({type:"feature",data:"key"})),t.playerID&&(a.playerid=t.playerID),this.requestTimestamp=+(new Date).getTime(),e.trigger({type:"playcgistart",data:{time:this.requestTimestamp,url:n}}),log$2("playcgi loading");var u=queryString.stringify(a);u&&(n+=(~n.indexOf("?")?"&":"?")+u,n=n.replace("?&","?")),this.getInfoRetryTimes=0,this.getInfoRequest=function(t){if(!t||!this.playCGIHosts[this.playCGIIndex+1])return!1;n=n.replace(this.playCGIHosts[this.playCGIIndex],this.playCGIHosts[this.playCGIIndex+1]),this.playCGIIndex++,IE_VERSION&&IE_VERSION<10?jsonp(n,{param:a,timeout:3e3,prefix:"TcCallBack"},bind(this,this.onResult)):xhr({url:n,timeout:3e3},bind(this,this.onResult))},this.getInfoRequest()},e.prototype.onResult=function(t,e,n){try{n?e=JSON.parse(n):t||e||(t=new Error("ServerError"))}catch(u){t=new Error("ServerError")}var i=this.player();if(t){if(log$2("playcgi loaded failure"),this.getInfoRetryTimes<3)return this.getInfoRetryTimes++,void this.getInfoRequest();if(this.getInfoRetryTimes<8)return this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0});i.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}});var r=12;switch(t.message){case"XMLHttpRequest timeout":case"Timeout":r=10;break;case"ServerError":r=11}this.player().error({code:r})}else{if(i.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}}),0!=e.code)return log$2("playcgi loaded failure"),void this.player().error({code:e.code});log$2("playcgi loaded success");var o=e.coverInfo,s=e.videoInfo,a=e.playerInfo;this.setPoster(o),this.setLogo(a),this.setSrc(e),this.setPatch(a),this.setVttThumbnail(e),this.setDots(e),this.setOriginDuration(s),this.setPlayList(a)}},e.prototype.getInfoV3=function(t){var e=this.player(),n=this.assemblyPathV3("getplayinfo",t.appID,t.fileID,t.playDefinition),i=t.t,r=t.us,o=t.rlimit,s=t.sign,a={};t.ssign?a.super_sign=t.ssign:s&&(a={t:i,sign:s},(r||0==r)&&(a.us=r),o&&(a.rlimit=o),e.trigger({type:"feature",data:"key"})),t.playerID&&(a.playerid=t.playerID),this.requestTimestamp=+(new Date).getTime(),e.trigger({type:"playcgistart",data:{time:this.requestTimestamp,url:n}}),log$2("playcgi v3 loading");var u=queryString.stringify(a);u&&(n+=(~n.indexOf("?")?"&":"?")+u,n=n.replace("?&","?")),this.getInfoRetryTimes=0,this.getInfoRequest=function(t){t&&(n=n.replace(SERVER_PATH_V3,SERVER_PATH_BACKUP)),IE_VERSION&&IE_VERSION<10?jsonp(n,{param:a,timeout:3e3,prefix:"TcCallBack"},bind(this,this.onResultV3)):xhr({url:n,timeout:3e3},bind(this,this.onResultV3))},this.getInfoRequest()},e.prototype.onResultV3=function(t,e,n){try{n?e=JSON.parse(n):t||e.body||(t=new Error("ServerError"))}catch(a){t=new Error("ServerError")}var i=this.player();if(t){if(log$2("playcgi v3 loaded failure"),this.getInfoRetryTimes<3)return this.getInfoRetryTimes++,void this.getInfoRequest();if(this.getInfoRetryTimes<8)return this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0});i.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}});var r=12;switch(t.message){case"XMLHttpRequest timeout":case"Timeout":r=10;break;case"ServerError":r=11}this.player().error({code:r})}else{if(i.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}}),0!=e.code)return log$2("playcgi v3 loaded failure"),void this.player().error({code:e.code});log$2("playcgi v3 loaded success");var o=e.mediaInfo,s=e.playerInfo;this.setPoster({coverUrl:o.basicInfo.coverUrl}),this.setLogo(s),this.setSrcV3(o),this.setPatch(s),this.setVttThumbnail(o),this.setDots(o)}},e.prototype.setSrcV3=function(t,e){var n=this,i=this.player(),r=i.options_.plugins,o=i.DRM().options||r.DRM,s=void 0,a=void 0,u=void 0,l=[],c={},h={};if(e=e||(o?o.skipPlan:""),t.previewStreamingInfo&&t.previewStreamingInfo.previewStreamingList.length>0)t.previewStreamingInfo.previewStreamingList.forEach(function(t,e){t.mineType=n.getMIMEType(t.url),c[getFileExtension(t.url)]=t});else{if(!(t.dynamicStreamingInfo.adaptiveStreamingInfoList&&t.dynamicStreamingInfo.adaptiveStreamingInfoList.length>0))return void this.player().error({code:13,message:"no video stream"});if(t.dynamicStreamingInfo.adaptiveStreamingInfoList.forEach(function(t,e){t.mineType=n.getMIMEType(t.url),h[t.drmType.toLowerCase()||getFileExtension(t.url)]=t}),o&&o.token?(s=o.token,u=o.certificateUri,e=IS_SAFARI&&!u?"fairplay":e,a=window_1.encodeURIComponent(s)):e="all",(IS_CHROME||IS_FIREFOX)&&window_1.navigator.requestMediaKeySystemAccess&&h.widevine&&"widevine"!=e&&"all"!=e?(l.push({src:unifyProtocol(h.widevine.url),type:this.getMIMEType(h.widevine.url),keySystems:{"com.widevine.alpha":{serverURL:LICENSE_PATH+"?token="+a+"&drmType="+h.widevine.drmType}}}),log$2("DRM source widevine",l)):IS_SAFARI&&!IS_MQQB&&h.fairplay&&"fairplay"!=e&&"all"!=e&&(l.push({src:unifyProtocol(h.fairplay.url),type:this.getMIMEType(h.fairplay.url),keySystems:{"com.apple.fps.1_0":{certificateUri:u,licenseUri:LICENSE_PATH+"?token="+a+"&drmType="+h.fairplay.drmType}}}),log$2("DRM source fairplay",l)),h.simpleaes&&"all"!=e){var p=h.simpleaes.url.split("/");p[p.length-1]="voddrm.token."+a+"."+p[p.length-1],l.push({src:unifyProtocol(p.join("/")),type:this.getMIMEType(h.simpleaes.url)}),log$2("DRM source simpleaes",l)}h.m3u8&&l.push({src:unifyProtocol(h.m3u8.url),type:this.getMIMEType(h.m3u8.url)}),h.mpd&&l.push({src:unifyProtocol(h.mpd.url),type:this.getMIMEType(h.mpd.url)})}if(!(l.length>0))return void this.player().error({code:4});i.src(l);var d=function(e){return log$2("DRM init Error",l),5!==e.data.code&&2!==e.data.code||!l[0].keySystems["com.widevine.alpha"]?3===e.data.code&&l[0].keySystems["com.apple.fps.1_0"]?void n.setSrcV3(t,"fairplay"):14===e.data.code||3===e.data.code?void n.setSrcV3(t,"all"):void 0:void n.setSrcV3(t,"widevine")};"all"!==e&&(window_1.setTimeout(function(){i.one("error",d)},0),i.one("playing",function(t){}))},e.prototype.getInfoV4=function(t){var e=this.player(),n=this.assemblyPathV4("getplayinfo",t.appID,t.fileID),i=e.options_,r=t.t,o=t.us,s=t.rlimit,a=t.psign,u=t.exper,l={};t.ssign?l.super_sign=t.ssign:a&&(l={t:r,psign:a},(o||0==o)&&(l.us=o),s&&(l.rlimit=s),u&&(l.exper=u)),t.playerConfig&&(l.pcfg=t.playerConfig),t.playerID&&(l.playerid=t.playerID),this.requestTimestamp=+(new Date).getTime(),e.trigger({type:"playcgistart",data:{time:this.requestTimestamp,url:n}}),log$2("playcgi v4 loading");var c=queryString.stringify(l);c?(n+=(~n.indexOf("?")?"&":"?")+c,n=n.replace("?&","?")):n+=~n.indexOf("?")?"":"?";var h=i&&i.hlsConfig&&(i.hlsConfig.disable||i.hlsConfig.skipHlsJs);n=this.enModule.generatePlayCgiUrl(n,browser,h),this.getInfoRetryTimes=0,this.getInfoRequest=function(t){t&&this.playCGIHosts[this.playCGIIndex+1]&&(n=n.replace(this.playCGIHosts[this.playCGIIndex],this.playCGIHosts[this.playCGIIndex+1]),this.playCGIIndex++),IE_VERSION&&IE_VERSION<10?jsonp(n,{param:l,timeout:3e3,prefix:"TcCallBack"},bind(this,this.onResultV4)):xhr({url:n,timeout:3e3},bind(this,this.onResultV4))},this.getInfoRequest()},e.prototype.onResultV4=function(t,e,n){var i=e,r=i.rawRequest;try{n?e=JSON.parse(n):t||e.body||(t=new Error("ServerError"))}catch(h){t=new Error("ServerError")}var o=this.player();if(!o)return!1;if(t){if(log$2("playcgi v4 loaded failure"),this.getInfoRetryTimes<8)return this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0});o.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e}});var s=12;switch(t.message){case"XMLHttpRequest timeout":case"Timeout":s=10;break;case"ServerError":s=11}this.player().error({code:s})}else{if(o.trigger({type:"playcgiend",data:{time:+(new Date).getTime(),startTime:this.requestTimestamp,error:t,result:e,rawRequest:r,overlayIv:this.enModule.overlayIv,overlayKey:this.enModule.overlayKey}}),0!=e.code)return log$2("playcgi v4 loaded failure"),e.code>=2e3&&e.code<3e3&&this.getInfoRetryTimes<8?(this.getInfoRetryTimes++,void this.getInfoRequest({isBackup:!0})):void this.player().error({code:e.code});if(log$2("playcgi v4 loaded success",e),4===e.version){var a=e.media;this.setPoster({coverUrl:a.basicInfo.coverUrl}),this.setGhostContent(a.ghostWatermarkInfo),this.setSrcV4(a),this.setVttThumbnailV4(a),this.setDots(a)}else if(2===e.version){var u=e.coverInfo,l=e.videoInfo,c=e.playerInfo;this.setPoster(u),this.setLogo(c),this.setSrc(e),this.setPatch(c),this.setVttThumbnail(e),this.setDots(e),this.setOriginDuration(l)}}},e.prototype.setSrcV4=function(t,e){var n=this,i=this.player(),r=i.options_,o=void 0,s=i.options_.plugins,a=i.DRM().options||s.DRM,u=[],l="plain";e=e||(a?a.skipPlan:"");var c=[],h=[];if("Original"===t.audioVideoType||"Transcode"===t.audioVideoType)return this.setSrc(t),!1;if(!t.streamingInfo)return void this.player().error({code:13,message:"no stream info"});if(t.streamingInfo){if(t.streamingInfo.drmOutput&&Array.isArray(t.streamingInfo.drmOutput)){for(var p=t.streamingInfo.drmOutput,d=0;d<p.length;d++)h.push(p[d].type);if(IS_ANY_SAFARI&&!IS_MQQB&&-1!==h.indexOf("FairPlay")&&"fairplay"!=e&&"all"!=e){var f=h.indexOf("FairPlay"),y=p[f].subStreams;u.push(y),c.push({src:unifyProtocol(p[f].url),type:this.getMIMEType(p[f].url),qualityLabelList:y,keySystems:{"com.apple.fps.1_0":{certificateUri:t.streamingInfo.fairPlayCertificateUrl||(a||{}).certificateUri,licenseUri:t.streamingInfo.fairplayLicenseUrl}}}),log$2("DRM source fairplay",o)}else if(window_1.navigator.requestMediaKeySystemAccess&&-1!==h.indexOf("Widevine")&&!IS_SAFARI&&"widevine"!==e&&"all"!==e){var g=h.indexOf("Widevine"),m=p[g].subStreams,v=m[m.length-1];("audio"===v.type||0===v.width&&0===v.height)&&m.pop(),u.push(m),c.push({src:unifyProtocol(p[g].url),type:this.getMIMEType(p[g].url),qualityLabelList:m,keySystems:{"com.widevine.alpha":{serverURL:t.streamingInfo.widevineLicenseUrl}}}),log$2("DRM source widevine",o)}if(-1!==h.indexOf("SimpleAES")&&"all"!=e){var _,b=h.indexOf("SimpleAES");l="SimpleAES";var S=p[b].url.split("/");S[S.length-1]="voddrm.token."+t.streamingInfo.drmToken+"."+S[S.length-1],o=S.join("/");var C=p[b].subStreams;u.push(p[b].subStreams),o&&c.push({src:unifyProtocol(o),type:EXT_MIME.m3u8,qualityLabelList:C,keySystems:(_={},_[l]={},_)})}}else if(t.streamingInfo.plainOutput){var T;o=t.streamingInfo.plainOutput.url;var E=t.streamingInfo.plainOutput.subStreams;u.push(t.streamingInfo.plainOutput.subStreams),o&&c.push({src:unifyProtocol(o),type:EXT_MIME.m3u8,qualityLabelList:E,keySystems:(T={},T[l]={},T)})}this.setHlsConfig(r,u[0],!1),c.length>0?i.src(c):0!==h.length?!e&&this.player().error({code:18}):this.player().error({code:13,message:"no stream info"}),this.setQualityLabelList(u[0])}var w=function(e){return log$2("DRM init Error",c),c[0].keySystems["com.widevine.alpha"]?void n.setSrcV4(t,"widevine"):c[0].keySystems["com.apple.fps.1_0"]?void n.setSrcV4(t,"fairplay"):3===e.data.code?void n.setSrcV4(t,"all"):void 0};"all"!==e&&window_1.setTimeout(function(){i.one("error",w)},0)},e.prototype.setHlsConfig=function(t,e,n){var i={};(!IS_ENABLED_MSE||IS_TBS||IS_MQQB||IE_VERSION&&IE_VERSION<11)&&!IS_SIMULATOR||(i={overlayKey:this.enModule&&this.enModule.overlayKey,overlayIv:this.enModule&&this.enModule.overlayIv});t.hlsConfig?(t.hlsConfig.qualityLabelList=e,t.hlsConfig.startLevel||(t.hlsConfig.startLevel=e?e.length-1:5)):t.hlsConfig={qualityLabelList:e,startLevel:e?e.length-1:5},Object.assign(t.hlsConfig,i,{forbid:n})},e.prototype.setQualityLabelList=function(t){this.player().QualitySwitcher().setOptions({qualityLabelList:{video:t}})},e.prototype.setLogo=function(t){var e=this.player();t.logoPic?(e.logoImage.update({img:{url:unifyProtocol(t.logoPic),position:t.logoLocation},link:unifyProtocol(t.logoUrl)}),e.trigger({type:"feature",data:"logo"})):e.logoImage.reset()},e.prototype.setPoster=function(t){var e=this.player();t&&t.coverUrl?e.poster(unifyProtocol(t.coverUrl)):e.options_.playerOptions.poster||e.poster("")},e.prototype.setDots=function(t){var e=this.player();if(e.options_.dots=[],t.keyFrameDescInfo&&t.keyFrameDescInfo.keyFrameDescList&&t.keyFrameDescInfo.keyFrameDescList.length>0){var n=t.keyFrameDescInfo.keyFrameDescList;e.options_.dots=n}var i=e.options_.plugins;i&&i.ProgressMarker&&i.ProgressMarker.markers&&i.ProgressMarker.markers.length>0&&(e.options_.dots=e.options_.dots.concat(i.ProgressMarker.markers)),e.ProgressMarker().init()},e.prototype.setSrc=function(t){var e=this.player(),n=t.videoInfo||{};if("Original"===t.audioVideoType&&(n.sourceVideo=t.originalInfo),"Transcode"===t.audioVideoType&&(n.sourceVideo=t.transcodeInfo),(null!=e.options_.definition||e.options_.definition!=undefined)&&n.transcodeList&&n.transcodeList.length>0){e.trigger({type:"feature",data:"definition"});var i=this.getSrcByDefinition(n,e.options_.definition);if(i)return e.src({src:unifyProtocol(i.url),type:this.getMIMEType(i.url)}),!0}if(e.MultiResolution().reset(),n.masterPlayList){e.src(this.getMasterSouces(n));var r=e.options_.hlsConfig;r?r.forbid=!0:Object.assign(e.options_,{hlsConfig:{forbid:!0}}),this.setQualityLabelList([]),e.MultiResolution().store(this.getMultiResolutionData(t))}else if(n.transcodeList&&n.transcodeList.length>0){var o=this.getMultiResolutionData(t);if(o.showOrder.length>0)e.MultiResolution().init(o);else{var s=n.transcodeList[0].url;e.src({src:unifyProtocol(s),type:this.getMIMEType(s)})}}else n.sourceVideo&&this.getMIMEType(n.sourceVideo.url)?e.src({src:unifyProtocol(n.sourceVideo.url),type:this.getMIMEType(n.sourceVideo.url)}):this.player().error({code:13})},e.prototype.setPatch=function(t){var e=this.player();t.patchInfo?e.ImagePatch().init(t.patchInfo):e.ImagePatch().reset()},e.prototype.setVttThumbnail=function(t){var e=this.player();t.imageSpriteInfo&&t.imageSpriteInfo.imageSpriteList?e.ready(bind(this,function(){e.VttThumbnail().init({vttUrl:unifyProtocol(t.imageSpriteInfo.imageSpriteList[0].webVttUrl)})})):e.VttThumbnail().reset()},e.prototype.setVttThumbnailV4=function(t){var e=this.player();t.imageSpriteInfo&&t.imageSpriteInfo.webVttUrl?e.ready(bind(this,function(){e.VttThumbnail().init({vttUrl:unifyProtocol(t.imageSpriteInfo.webVttUrl)})})):e.VttThumbnail().reset()},e.prototype.setOriginDuration=function(t){var e=this.player();if(e.options_.exper>0){var n=t.sourceVideo?t.sourceVideo.floatDuration:t.transcodeList[0].floatDuration;e.one("play",function(){e.duration(n)})}},e.prototype.setOriginDurationV4=function(t){var e=this,n=this.player();n.cache_.originDuration=t.basicInfo.duration,n.off("durationchange",this.keepOriginDuration),n.one("durationchange",function(t){(!n.duration()||n.duration()>0&&Math.floor(n.cache_.originDuration)!==Math.floor(n.duration()))&&(e.keepOriginDuration(t),n.on("durationchange",e.keepOriginDuration))})},e.prototype.setGhostContent=function(t){var e=this.player(),n=e&&e.DynamicWatermark();this.enModule.clearGhostMark(n,!0),t?(n.options.content=t.text,n.options.keep=!0,n.init()):(n.options.keep=!1,n.content?(n.options.content=n.content,n.init(),n.startAnimation()):n.options.content="")},e.prototype.keepOriginDuration=function(t){var e=this.player(),n=e.cache_.originDuration;Math.floor(n)!==Math.floor(e.duration())&&(log$2("试看视频"),e.duration(Math.round(n)))},e.prototype.getMasterSouces=function(t){var e=t.masterPlayList,n=[];return n.push({src:unifyProtocol(e.url),type:EXT_MIME.m3u8}),n},e.prototype.getMultiResolutionData=function(t){var e={sources:{},labels:{},showOrder:[],defaultRes:""},n=[],i=t.videoInfo.transcodeList,r=this;return t.playerInfo.videoClassification.forEach(function(t,o){i.length>0&&(i=i.filter(function(i){if(!(t.definitionList.indexOf(i.definition)>-1))return!0;n[t.id]||(e.showOrder.push(t.id),e.labels[t.id]=t.name,n[t.id]=[]),n[t.id].push({src:unifyProtocol(i.url),type:r.getMIMEType(i.url)})}))}),e.sources=n,e.defaultRes=t.playerInfo.defaultVideoClassification||Object.keys(n)[0],e},e.prototype.getSrcByDefinition=function(t,e){var n=t.transcodeList,i=t.sourceVideo;if(0==e)return i;for(var r=0;r<n.length;r++)if(n[r].definition==e)return n[r]},e.prototype.getMIMEType=function(t){var e=EXT_MIME[getFileExtension(t)];return e||(log$2.error("MIME type no found! Ext = "+getFileExtension(t)),"")},e.prototype.assemblyPath=function(t,e,n){var i=window_1.location.protocol;return"http:"!=i&&"https:"!=i&&(i="https:"),i+"//"+SERVER_PATH+"/"+t+"/v2/"+e+"/"+n},e.prototype.assemblyPathV3=function(t,e,n,i){var r=window_1.location.protocol;return"http:"!=r&&"https:"!=r&&(r="https:"),r+"//"+SERVER_PATH_V3+"/"+t+"/v3/"+e+"/"+n+"/"+i},e.prototype.assemblyPathV4=function(t,e,n){var i=window_1.location.protocol;return"http:"!=i&&"https:"!=i&&(i="https:"),i+"//"+this.playCGIHosts[this.playCGIIndex]+"/"+t+"/v4/"+e+"/"+n},e.prototype.customHost=function(t){var e=this.player();e.options_.customHost&&/^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$/.test(e.options_.customHost)&&(t.masterPlayList&&(t.masterPlayList.url=replaceHost(t.masterPlayList.url,e.options_.customHost)),t.sourceVideo&&(t.sourceVideo.url=replaceHost(t.sourceVideo.url,e.options_.customHost)),t.transcodeList.length>0&&t.transcodeList.forEach(function(t,n){t.url=replaceHost(t.url,e.options_.customHost)}),e.trigger({type:"feature",data:"customHost"}))},e.prototype.loadVideoByID=function(t){var e=this.player();if(e.trigger({type:"loadnewvideo"}),!this.playCGIMerged){var n=e.options_;this.playCGIHosts=(n.playCGIHosts||[]).concat([SERVER_PATH,SERVER_PATH_BACKUP]),this.playCGIIndex=0}e.hasStarted(!1),this.getInfo(t),e.duration(0),e.options_.appID=t.appID,e.options_.fileID=t.fileID,e.options_.psign=t.psign,t.definition&&(e.options_.definition=t.definition),e.bigPlayButton&&e.bigPlayButton.show(),e.tech_.clearTracks("text"),e.options_.plugins.ContinuePlay&&e.ContinuePlay().init()},e.prototype.setPlayList=function(t){this.player().options_.plugins.PlayList||t.playlist&&t.playlist.data instanceof Array&&t.playlist.data.length>0&&this.player_.PlayList(t.playlist)},e}(Component);Component.registerComponent("MediaAsyncLoader",MediaAsyncLoader);var Component$2=videojs.getComponent("Component"),ClickableComponent$2=videojs.getComponent("ClickableComponent"),positionMap=["left-top","left-bottom","right-top","right-bottom"],LogoImage=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return n.on("logochange",videojs.bind(r,function(t){this.update(t.data)})),i.img&&r.update(i),r}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-logo vjs-hidden"}),e=videojs.dom.createEl("a",{className:"tcp-logo-link",target:"_blank"}),n=videojs.dom.createEl("img",{className:"tcp-logo-img"});return this.linkEl_=e,this.imgEl_=n,e.appendChild(n),t.appendChild(e),t},e.prototype.update=function(t){var e=t.img,n=t.link;this.setImg(e),this.setHref(n),this.options_=videojs.mergeOptions(this.options_,t),this.show()},e.prototype.setImg=function(t){if(this.imgEl_){this.imgEl_.src=t.url;var e=positionMap[t.position]||t.position||"left-top";videojs.dom.addClass(this.el_,e)}},e.prototype.setHref=function(t){this.linkEl_&&t&&(this.linkEl_.href=t)},e.prototype.reset=function(){this.hide(),this.imgEl_.removeAttribute("src"),this.linkEl_.removeAttribute("href")},e}(ClickableComponent$2);videojs.registerComponent("LogoImage",LogoImage);var Component$3=videojs.getComponent("Component"),Button$2=videojs.getComponent("Button"),ContinuePlayTips=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.init(i),r}return inherits(e,t),e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-continue-play-tips"})},e.prototype.close=function(){this.hide()},e.prototype.init=function(t){var e=this.addChild("closeButton",{controlText:"Close"});this.on(e,"close",this.close),this.addChild("ContinuePlayTipsContent",t);var n=this.addChild("ContinuePlayButton",t);this.on(n,["tap","click"],this.close),this.setTimeout(function(){this.close()},3500)},e}(Component$3);videojs.registerComponent("ContinuePlayTips",ContinuePlayTips);var ContinuePlayTipsContent=function(t){function e(n,i){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("span",{className:"tcp-continue-play-tips-content"}),e=videojs.dom.createEl("span",{className:"tcp-text",textContent:this.localize(this.options_.text||"Last time play at ")}),n=videojs.dom.createEl("span",{className:"tcp-time",textContent:videojs.formatTime(this.options_.time)});return this.textEl_=e,this.timeEl_=n,t.appendChild(e),t.appendChild(n),t},e}(Component$3);videojs.registerComponent("ContinuePlayTipsContent",ContinuePlayTipsContent);var ContinuePlayButton=function(t){function e(n,i){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"button",{className:"tcp-continue-play-buttom",textContent:this.localize(this.options_.btnText||"Resume play")})},e.prototype.handleClick=function(){this.options_.resumeCallback.call()},e}(Button$2);videojs.registerComponent("ContinuePlayButton",ContinuePlayButton);var Component$4=videojs.getComponent("Component"),LevelSwitchTips=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.playing=!1,r.timeoutID=undefined,r.levelSwitch=n.options_.plugins.ContextMenu.levelSwitch,r.init(),n.on("playing",videojs.bind(r,function(){r.playing=!0})),n.on("resolutionswitching",videojs.bind(r,function(t){if(r.playing)if(t.data.label)r.switchHandler(r.createSwitching(t.data.label),2e3);else{var e=r.player().QualitySwitcher().options.qualityData;if(e){var n=e.video.filter(function(e){return t.data.newQuality===e.id})[0];r.switchHandler(r.createSwitching(n.label),2e3)}}})),n.on("resolutionswitched",videojs.bind(r,function(){r.playing&&r.switchHandler(r.createSwitched(),2e3)})),n.on("levelSwitchError",videojs.bind(r,function(){r.switchHandler(r.createSwitchError(),2e3)})),r}return inherits(e,t),e.prototype.switchHandler=function(t,e){var n=this;this.timeoutID&&clearTimeout(this.timeoutID),this.textNode.innerText=t,this.show(),this.timeoutID=setTimeout(function(){n.hide()},e)},e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-switch vjs-hidden"});return this.textNode=videojs.dom.createEl("div",{innerText:""}),t.appendChild(this.textNode),t},e.prototype.init=function(){var t=this.addChild("closeButton",{controlText:"Close"});this.on(t,"close",this.hide)},e.prototype.createSwitching=function(t){return this.levelSwitch.switchingText?this.levelSwitch.switchingText+t:"正在为您切换至"+t},e.prototype.createSwitched=function(){return this.levelSwitch.switchedText?this.levelSwitch.switchedText:"切换成功"},e.prototype.createSwitchError=function(){return this.levelSwitch.switchErrorText?this.levelSwitch.switchErrorText:"切换失败"},e.prototype.show=function(){t.prototype.show.call(this),this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.popped=!1},e}(Component$4);videojs.registerComponent("LevelSwitchTips",LevelSwitchTips);var Component$7=videojs.getComponent("Component"),mapKey={fileID:"file ID",requestID:"request ID",mediaType:"media type",mimeType:"mime type",provider:"provider",resolution:"resolution",rate:"rate",frames:"frames",buffer:"buffer",connectionSpeed:"connection speed",info:"info"},VideoTextItem=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.display=!1,r.displayData="loading",r}return inherits(e,t),e.prototype.createEl=function(){var t=videojs.dom.createEl("div",{className:"tcp-statistic-line vjs-hidden"}),e=videojs.dom.createEl("span",{className:"tcp-statistic-title",innerText:mapKey[this.options_.key]+":"}),n=videojs.dom.createEl("span",{className:"tcp-statistic-data",innerText:this.options_.data});return t.appendChild(e),t.appendChild(n),t},e.prototype.updateTextNode_=function(){for(var t=this.el_.lastChild;t.firstChild;)t.removeChild(t.firstChild);this.displayData&&this.show(),this.textNode_=document_1.createTextNode(this.displayData||""),t.appendChild(this.textNode_)},e.prototype.updateContent=function(t){t!==this.displayData&&(this.displayData=t,this.requestAnimationFrame(this.updateTextNode_))},e.prototype.isDisplay=function(){return this.display},e.prototype.show=function(){t.prototype.show.call(this),this.display=!0,this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.display=!1,this.popped=!1},e.prototype.reset=function(){t.prototype.hide.call(this),this.display=!1,this.displayData=""},e}(Component$7);videojs.registerComponent("VideoTextItem",VideoTextItem);var defaultConfig={enableRecoverMediaError:!0,recoverMediaErrorMaxRetry:5,fragLoadingMaxRetry:3,abrMaxWithRealBitrate:!0,emeEnabled:!0,maxBufferLength:10,maxBufferSize:41943040,maxMaxBufferLength:30},Html5HlsJS=function(){function t(e,n,i){var r=this;classCallCheck(this,t);var o={},s=n.player();i.hlsConfig=i.hlsConfig===undefined?{}:i.hlsConfig,
|
|
17
17
|
e.keySystems&&e.keySystems["com.widevine.alpha"]&&e.keySystems["com.widevine.alpha"].serverURL?(i.hlsConfig.widevineLicenseUrl=e.keySystems["com.widevine.alpha"].serverURL,e.keySystems["com.widevine.alpha"].serverCertificateURL&&(i.hlsConfig.serverCertificateURL=e.keySystems["com.widevine.alpha"].serverCertificateURL),i.hlsConfig.enableWorker=!0,i.hlsConfig.emeEnabled=!0,i.hlsConfig.startLevel=(i.hlsConfig.qualityLabelList||[]).length-1,o=i.hlsConfig):o=n.player_.options_.hlsConfig||i.hlsConfig||{},o.forbid&&(delete o.overlayKey,delete o.overlayIv),this.drmBackup=i.hlsConfig&&i.hlsConfig.drmBackup;var a=function(){var t=window.Hls;if(s.trigger({type:"debug",data:{message:"debug === 加载hls.js完成,进入初始化 hls 阶段"}}),(new Enc).catCheck(s))return!1;var a=new t(videojs.mergeOptions(defaultConfig,o)),u=n.el();r.Hls=t,r.tech=n,r.hls=a,r.switchStatus="",r.manifests=[],r.subtitlesLoadedCount=0,r.audioTrackLoadedCount=0,r.subtitles=[],r.audioTracks=[],r.hlsjsErrorHandler=r.errorHandlerFactory(),a.on(t.Events.ERROR,r.onError.bind(r)),a.on(t.Events.MANIFEST_PARSED,videojs.bind(r,r.onMetaData)),a.on(t.Events.MANIFEST_LOADED,r.loadSubtiles.bind(r)),a.on(t.Events.LEVEL_LOADED,r.onLevelLoaded.bind(r)),s.on("ready",r.addHlsSubtitles.bind(r)),s.on("error",r.onHandleError.bind(r));for(var l in t.Events)a.on(t.Events[l],videojs.bind(r,r.onEvent));a.attachMedia(u),a.loadSource(e.src),s.trigger({type:"hlsInstanceCreated",data:{hls:a}}),s.trigger({type:"instanceCreated",data:{instance:a,type:"hls"}}),s.trigger({type:"debug",data:{message:"debug === 初始化 hls.js 完成,已传递 hls 地址"}}),r.statsTimer=setInterval(function(){if(!s.el_)return!1;var t=a.levels[a.currentLevel]&&a.levels[a.currentLevel].realBitrate/1e3,e=s.getVideoPlaybackQuality(),n=e.droppedVideoFrames||0,i=e.totalVideoFrames||0,r="",o=s.tech_.hlsProvider.hls.abrController.bwEstimator;o&&o.getEstimate()&&(r=+(125e-6*o.getEstimate()).toFixed(0)),s.trigger({type:"playstatus",data:{type:"hls",droppedFrames:n,decodedFrames:i,bitrate:t,speed:r}})},1e3),window.Hls&&i.xp2pConfig&&i.xp2pConfig.useXP2P&&s.XP2PHlsjsPlugin&&s.XP2PHlsjsPlugin().startHLSP2P(r.hls,window.HLSP2P,function(t){})};s.trigger({type:"debug",data:{message:"debug === 开始加载hls.js"}}),Promise.all([function(){return i.xp2pConfig&&i.xp2pConfig.useXP2P&&"hls"===i.xp2pConfig.format&&!window.HLSP2P?new Promise(function(t,e){loadScript(XP2P_HLS_PATH,function(n){n?e():t()})}):Promise.resolve()}(),function(){return window.Hls?Promise.resolve():new Promise(function(t,e){loadScript(HLS_PATH,function(n){n?e():t()})})}()]).then(function(){a()})["catch"](function(t){s.error({code:30})})}return t.prototype.switchQuality=function(t){t.id!=this.hls.currentLevel&&(this.switchStatus="switching",this.switchData=t,this.tech.trigger({type:"hlsresolutionswitching",data:this.switchData}),this.hls.nextLevel=t.id,this.hls.config.abrEnabled=!1),-1===t.id&&(this.hls.config.abrEnabled=!0)},t.prototype.dispose=function(){this.statsTimer&&clearInterval(this.statsTimer),this.hls&&this.hls.destroy()},t.prototype.onHandleError=function(){this.statsTimer&&clearInterval(this.statsTimer)},t.prototype.onSubtitleLoaded=function(t,e){var n=this,i=this.tech.player(),r=this.subtitlesLoadedCount,o=this.subtitles||this.hls.subtitleTracks;this.subtitles[r].url=e.details.fragments[0].url,++this.subtitlesLoadedCount<o.length?this.hls.trigger(this.Hls.Events.SUBTITLE_TRACK_LOADING,{url:o[this.subtitlesLoadedCount].url,id:o[this.subtitlesLoadedCount].id}):i.ready(function(){n.addHlsSubtitles()})},t.prototype.onAudioTrackLoaded=function(t,e){var n=this;try{var i=this.tech.player(),r=Math.min(this.audioTracks.length-1,this.audioTrackLoadedCount),o=this.hls.audioTracks;this.audioTracks[r].url=e.details.fragments[0].url,++this.audioTrackLoadedCount<o.length?this.hls.trigger(this.Hls.Events.AUDIO_TRACK_LOADING,{url:o[this.audioTrackLoadedCount].url,id:o[this.audioTrackLoadedCount].id}):i.ready(function(){n.addAudioTracks()})}catch(s){}},t.prototype.loadAudioTracks=function(){var t=this,e=this.hls.audioTracks;if(e.length){e.forEach(function(e){t.audioTracks.push({id:e.id,name:e.name,lang:e.lang,loaded:!1,"default":e["default"]})});for(var n=void 0,i=0;i<e.length&&(!e[i].url||!(n=e[i]));i++);if(!n)return!1;this.hls.trigger(this.Hls.Events.AUDIO_TRACK_LOADING,{url:n.url,id:n.id}),this.hls.on(this.Hls.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded.bind(this))}},t.prototype.loadSubtiles=function(){var t=this,e=this.hls.subtitleTracks&&this.hls.subtitleTracks.length>0?this.hls.subtitleTracks:this.hls.subtitleTrackController.tracks;if(e.length){e.forEach(function(e){t.subtitles.push({"default":e["default"],autoselect:e.autoselect,forced:e.forced,name:e.name,lang:e.lang,loaded:!1,url:e.url,id:e.id})});var n=e[0];this.hls.on(this.Hls.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleLoaded.bind(this)),this.hls.trigger(this.Hls.Events.SUBTITLE_TRACK_LOADING,{url:n.url,id:n.id})}},t.prototype.addAudioTracks=function(){var t=this;this.audioTracks.length&&this.audioTracks.some(function(t){return!t.loaded})&&this.audioTracks.forEach(function(e){var n=t.tech.addAudioTrack({id:e.id,src:e.url,kind:"audio",srclang:e.lang,label:e.name,enabled:e["default"]},!0);e.loaded=!0,n.addEventListener("load",function(){e.loaded=!0})})},t.prototype.addHlsSubtitles=function(){var t=this;this.subtitles.length&&this.subtitles.some(function(t){return!t.loaded})&&this.subtitles.forEach(function(e){var n=t.tech.addRemoteTextTrack({src:e.url,kind:"subtitles",srclang:e.lang,label:e.name,mode:e["default"]?"showing":""},!0);n.addEventListener("load",function(){e.loaded=!0})})},t.prototype.onEvent=function(t,e){this.tech.trigger({type:t,data:e});var n=this.tech.player();switch(t){case this.Hls.Events.MANIFEST_LOADED:this.manifests.push(e.networkDetails.response||e.networkDetails.responseText);break;case this.Hls.Events.LEVEL_SWITCHING:break;case this.Hls.Events.LEVEL_SWITCHED:"switching"==this.switchStatus&&(this.switchStatus="switched",this.tech.trigger({type:"hlsresolutionswitched",data:this.switchData}),this.switchData=null);break;case this.Hls.Events.LEVEL_SWITCH_ERROR:n.trigger({type:"levelSwitchError"})}},t.prototype.onMetaData=function(t,e){var n=[],i=this.hls,r=this;if(e.levels.length>1){var o={id:-1,label:"auto",selected:-1===i.manualLevel};n.push(o),e.levels.forEach(function(t,e){var o={};o.id=e,o.selected=e===i.manualLevel,o.label=r.getLevelLabel(t),n.push(o)});var s={qualityData:{video:n},callbacks:{video:videojs.bind(this,this.switchQuality)}};this.tech.setTimeout(function(){this.trigger({type:"masterplaylistchange",data:s})},1)}},t.prototype.getLevelLabel=function(t){return t.height?t.height+"p":t.width?Math.round(9*t.width/16)+"p":t.bitrate?t.bitrate/1e3+"kbps":0},t.prototype.onLevelLoaded=function(t,e){this._duration=e.details.live?Infinity:e.details.totalduration},t.prototype.onError=function(t,e){var n=this.tech.player();if(e.fatal)switch(e.type){case this.Hls.ErrorTypes.NETWORK_ERROR:n.error({code:14,source:e});break;case this.Hls.ErrorTypes.MEDIA_ERROR:this.hls.config.enableRecoverMediaError?this.hlsjsErrorHandler(e):n.error({code:15,source:e});break;case this.Hls.ErrorTypes.MUX_ERROR:n.error({code:16,source:e});break;case this.Hls.ErrorTypes.OTHER_ERROR:default:n.error({code:17,source:e}),this.drmBackup&&"keySystemError"===e.type&&n.error(null)}else switch(e.details){case this.Hls.ErrorDetails.KEY_LOAD_ERROR:}},t.prototype.errorHandlerFactory=function(){var t=this.hls,e=this.tech.player(),n=null,i=null,r=0;return function(o){var s=Date.now();r==t.config.recoverMediaErrorMaxRetry?e.error({code:15,source:o}):(!n||s-n>2e3?(n=s,t.recoverMediaError()):(!i||s-i>2e3)&&(i=s,t.swapAudioCodec(),t.recoverMediaError()),r++)}},t.prototype.duration=function(){return this._duration},t}(),hlsTypeRE=/^application\/(x-mpegURL|vnd\.apple\.mpegURL)$/i,hlsExtRE=/.m3u8(?![^?])/i,HlsSourceHandler={name:"hlsSourceHandler",canHandleSource:function(t){return t.skipHlsJs||t.keySystems&&t.keySystems["com.apple.fps.1_0"]?"":hlsTypeRE.test(t.type)&&hlsExtRE.test(t.src)?"probably":hlsExtRE.test(t.src)?"maybe":""},handleSource:function(t,e,n){return e.hlsProvider?(e.hlsProvider.dispose(),e.hlsProvider=null):n.hlsConfig&&!1===n.hlsConfig.autoStartLoad&&e.on("play",function(){this.player().hasStarted()||this.hlsProvider.hls.startLoad()}),e.hlsProvider=new Html5HlsJS(t,e,n),e.hlsProvider},canPlayType:function(t){return hlsTypeRE.test(t)?"probably":""}};TCPlayer.mountHlsProvider=mountHlsProvider,mountHlsProvider();var Html5DashJS=function(){function t(e,n,i){var r=this;classCallCheck(this,t);var o=function(){var o=window_1.dashjs;if(r.dashjs=o,i=i||n.options_,r.player=videojs(i.playerId),r.player.dash=r.player.dash||{},r.tech_=n,r.el_=n.el(),r.elParent_=r.el_.parentNode,r.hasFiniteDuration_=!1,e.src){n.isReady_=!1,t.updateSourceData&&(videojs.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),e=t.updateSourceData(e)),t.hooks("updatesource").forEach(function(t){e=t(e)});var s=e.src;r.keySystemOptions_=t.buildDashJSProtData(e.keySystemOptions||e.keySystems),r.player.dash.mediaPlayer=o.MediaPlayer().create(),r.player.dash.mediaPlayer.updateSettings(i.dashConfig),r.player.dash.mediaPlayer.updateSettings({debug:{logLevel:5}}),r.mediaPlayer_=r.player.dash.mediaPlayer,t.useVideoJSDebug&&(videojs.log.warn('useVideoJSDebug has been deprecated. Please switch to using hook("beforeinitialize", callback).'),t.useVideoJSDebug(r.mediaPlayer_)),t.beforeInitialize&&(videojs.log.warn('beforeInitialize has been deprecated. Please switch to using hook("beforeinitialize", callback).'),t.beforeInitialize(r.player,r.mediaPlayer_)),t.hooks("beforeinitialize").forEach(function(t){t(r.player,r.mediaPlayer_)}),r.mediaPlayer_.initialize(),r.player.trigger({type:"dashInstanceCreated",data:{instance:r.mediaPlayer_}}),r.player.trigger({type:"instanceCreated",data:{instance:r.mediaPlayer_,type:"dash"}}),r.retriggerError_=function(t){if("capability"===t.error&&"mediasource"===t.event)r.player.error({code:4,message:"The media cannot be played because it requires a feature that your browser does not support."});else if("manifestError"!==t.error||"createParser"!==t.event.id&&"codec"!==t.event.id&&"nostreams"!==t.event.id&&"nostreamscomposed"!==t.event.id&&"parse"!==t.event.id&&"multiplexedrep"!==t.event.id)if("mediasource"===t.error)t.event.match("MEDIA_ERR_ABORTED")?r.player.error({code:1,message:t.event}):t.event.match("MEDIA_ERR_NETWORK")?r.player.error({code:2,message:t.event}):t.event.match("MEDIA_ERR_DECODE")?r.player.error({code:3,message:t.event}):t.event.match("MEDIA_ERR_SRC_NOT_SUPPORTED")?r.player.error({code:4,message:t.event}):t.event.match("MEDIA_ERR_ENCRYPTED")?r.player.error({code:5,message:t.event}):(t.event.match("UNKNOWN"),r.player.error({code:4,message:t.event}));else if("capability"===t.error&&"encryptedmedia"===t.event)r.player.error({code:5,message:"The media cannot be played because it requires encryption features that your browser does not support."});else if("key_session"===t.error)r.player.error({code:5,message:t.event});else if("download"===t.error)r.player.error({code:2,message:"The media playback was aborted because too many consecutive download errors occurred."});else{if("mssError"!==t.error)return;r.player.error({code:3,message:t.event})}else r.player.error({code:4,message:t.event.message});setTimeout(function(){r.mediaPlayer_.reset()},10)},r.mediaPlayer_.on(o.MediaPlayer.events.ERROR,r.retriggerError_),r.mediaPlayer_.on(o.MediaPlayer.events.STREAM_INITIALIZED,videojs.bind(r,r.onMetaData)),r.currentQuality={video:"",audio:""},Object.keys(o.MediaPlayer.events).forEach(function(t){r.mediaPlayer_.on(o.MediaPlayer.events[t],videojs.bind(r,r.onEvent))}),r.mediaPlayer_.attachView(r.el_),r.mediaPlayer_.setAutoPlay(!0),r.mediaPlayer_.setProtectionData(r.keySystemOptions_),r.mediaPlayer_.attachSource(s),r.tech_.triggerReady()}};window_1.dashjs?o():loadScript(DASH_PATH,function(){o()})}return t.buildDashJSProtData=function(t){var e={};if(!t)return null;if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n],r=videojs.mergeOptions({},i.options);r.licenseUrl&&(r.serverURL=r.licenseUrl,delete r.licenseUrl),e[i.name]=r}else e=t;return e},t.prototype.dispose=function(){var t=this;this.mediaPlayer_&&(this.mediaPlayer_.off(this.dashjs.MediaPlayer.events.ERROR,this.retriggerError_),Object.keys(this.dashjs.MediaPlayer.events).forEach(function(e){t.mediaPlayer_.off(t.dashjs.MediaPlayer.events[e],videojs.bind(t,t.onEvent))}),this.mediaPlayer_.reset()),this.player.dash&&delete this.player.dash},t.prototype.duration=function(){return this.mediaPlayer_?this.mediaPlayer_.isDynamic()&&!this.hasFiniteDuration_?Infinity:this.mediaPlayer_.duration():0},t.hooks=function(e,n){return t.hooks_[e]=t.hooks_[e]||[],n&&(t.hooks_[e]=t.hooks_[e].concat(n)),t.hooks_[e]},t.hook=function(e,n){t.hooks(e,n)},t.removeHook=function(e,n){var i=t.hooks(e).indexOf(n);return-1!==i&&(t.hooks_[e]=t.hooks_[e].slice(),t.hooks_[e].splice(i,1),!0)},t.prototype.onMetaData=function(t){var e=this,n=this.mediaPlayer_;window_1._mediaPlayer=n;var i=n.getRepresentationsByType("video"),r=n.getSettings(),o=r.streaming.abr.autoSwitchBitrate.video,s=[];if(i.length>0){s.push({id:-1,label:"auto",selected:o}),i.forEach(function(t,n){s.push({id:n,label:e.getLevelLabel(t),selected:!o&&e.currentQuality.video===n})});var a={qualityData:{video:s},callbacks:{video:videojs.bind(this,this.switchQuality)}};this.tech_.setTimeout(function(){this.trigger({type:"masterplaylistchange",data:a})},1),n.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}});var u=0;i.length>1&&(u=1);var l=i[u];n.setRepresentationForTypeById("video",l.id)}},t.prototype.switchQuality=function(t){var e=this.mediaPlayer_;if(-1===t.id)e.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}});else if(t.id!=this.currentQuality[t.trackType]){e.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}});var n=e.getRepresentationsByType("video"),i=n[t.id];e.setRepresentationForTypeById("video",i.id)}},t.prototype.getLevelLabel=function(t){return t.height?t.height+"p":t.width?Math.round(9*t.width/16)+"p":t.bitrate?t.bitrate/1e3+"kbps":0},t.prototype.onEvent=function(t){switch(this.tech_.trigger({type:"dash_"+t.type,data:t}),t.type){case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_REQUESTED:this.tech_.trigger({type:"dashqualityswitching",data:t});break;case this.dashjs.MediaPlayer.events.QUALITY_CHANGE_RENDERED:this.tech_.trigger({type:"dashqualityswitched",data:t}),this.currentQuality[t.mediaType]=t.newQuality}},t}(),Component$6=videojs.getComponent("Component"),hlsOption=["fileID","requestID","mediaType","mimeType","provider","resolution","rate","frames","buffer","connectionSpeed"],mp4Option=["fileID","requestID","mediaType","mimeType","resolution","rate","buffer"],dashOption=["fileID","requestID","mediaType","mimeType","resolution","rate","buffer","provider","connectionSpeed"],infoOption=["info"],VideoStatisticWrapper=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.nodelist={},r.status={fileID:"",requestID:"",mediaType:"",mimeType:"",provider:"",resolution:"",rate:"",frames:"",buffer:"",connectionSpeed:"",info:""},n.on("playcgiend",function(){clearTimeout(r.timeoutID),Object.keys(r.status).forEach(function(t){r.nodelist[t].reset()})}),n.on("statistic",videojs.bind(r,function(t){"open"===t.data.action?r.tick():r.clearTimeout(r.timeoutID)})),r.init(),r}return inherits(e,t),e.prototype.tick=function(){var t=this;this.timeoutID=setTimeout(videojs.bind(this,function(){t.tick()}),1e3),this.updatePanel()},e.prototype.createEl=function(){return videojs.dom.createEl("div",{className:"tcp-statistic-wrapper"})},e.prototype.init=function(){var t=this;Object.keys(this.status).forEach(function(e){var n=new VideoTextItem(t,{key:e,data:t.status[e]});t.nodelist[e]=n,t.addChild(n)})},e.prototype.updatePanel=function(){var t=this;if("Html5"===this.player().techName_)switch(this.getStatus(),this.status.mediaType){case"m3u8":hlsOption.forEach(function(e){t.nodelist[e].updateContent(t.status[e])});break;case"mp4":mp4Option.forEach(function(e){t.nodelist[e].updateContent(t.status[e])});break;case"mpd":dashOption.forEach(function(e){t.nodelist[e].updateContent(t.status[e])})}else"Flash"===this.player().techName_&&(this.getFlashStatus(),infoOption.forEach(function(e){"info"===e&&t.nodelist[e].updateContent(t.status[e])}))},e.prototype.getStatus=function(){this.getFileID(),this.getRequestID(),this.getMediaType(),this.getMIMEType(),this.getResolution(),this.getRate(),this.getProvider(),this.getBuffer(),"m3u8"===this.status.mediaType&&(this.getFrames(),this.getConnectionSpeed()),"mpd"===this.status.mediaType&&this.getConnectionSpeed()},e.prototype.getFlashStatus=function(){this.status.mediaType="flash",this.getSupport()},e.prototype.getFileID=function(){var t=this.player().options_.fileID||"";return this.status.fileID=t,t},e.prototype.getRequestID=function(){var t=this.player().PlayerMetrics().playStatus;if(t){var e=t.requestID;return this.status.requestID=e,e}},e.prototype.getMediaType=function(){this.player_.src()&&/\/(.+)\.(.+)\?|\/(.+)\.(.+)/.test(this.player_.src());var t=RegExp.$2||RegExp.$4||"";return this.status.mediaType=t,t},e.prototype.getMIMEType=function(){var t=this.player().src(),e=EXT_MIME[getFileExtension(t)]||"";return this.status.mimeType=e,e},e.prototype.getResolution=function(){var t=this.player_.tech_.el_.videoHeight||0,e=this.player_.tech_.el_.videoWidth||0,n=e+" x "+t;return this.status.resolution=n,n},e.prototype.getRate=function(){var t=this.player().playbackRate()||1;return this.status.rate=t+"x",t},e.prototype.getBuffer=function(){var t=this.player_.bufferedEnd().toFixed(1)||0,e=this.player_.duration().toFixed(1)||0,n=(t/e*100).toFixed(1)+"%",i=t+" / "+e+" ("+n+")";return this.status.buffer=i,i},e.prototype.getSupport=function(){var t=void 0;return t="m3u8"!==this.status.mediaType&&"mp4"!==this.status.mediaType&&"dash"!==this.status.mediaType?"视频统计功能不支持当前视频格式":"",this.status.info=t,t},e.prototype.getProvider=function(){var t=this.player_.tech_.sourceHandler_;return t instanceof Html5HlsJS?(this.status.provider="HlsJS","HlsJS"):t instanceof Html5DashJS?(this.status.provider="DashJS","DashJS"):""},e.prototype.getFrames=function(){var t=this.player_.getVideoPlaybackQuality(),e=(t.droppedVideoFrames||0)+" dropped of "+(t.totalVideoFrames||0);return this.status.frames=e,e},e.prototype.getConnectionSpeed=function(){var t=void 0;if("m3u8"===this.status.mediaType){var e=this.player_.tech_.hlsProvider.hls.abrController._bwEstimator;t=e&&e.getEstimate()?(125e-6*e.getEstimate()).toFixed(0)+"KB/s":"0KB/s",this.status.connectionSpeed=t}if("mpd"===this.status.mediaType){var n=this.player_.dash.mediaPlayer,i=n.getDashMetrics(),r=n.getDashAdapter(),o=n.getActiveStream().getStreamInfo(),s=o.index,a=i.getCurrentRepresentationSwitch("video").to,u=r.getBandwidthForRepresentation(a,s);t=u?(125e-6*u).toFixed(0)+"KB/s":"0KB/s",this.status.connectionSpeed=t}return t},e}(Component$6);videojs.registerComponent("VideoStatisticWrapper",VideoStatisticWrapper);var Component$5=videojs.getComponent("Component"),VideoStatisticPanel=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return n.on("statistic",videojs.bind(r,function(t){"open"===t.data.action?r.show():r.hide()})),n.on("playcgistart",function(){n.trigger({type:"statistic",data:{action:"close"}})}),r.init(),r}return inherits(e,t),e.prototype.createEl=function(){var t=this,e=videojs.dom.createEl("div",{className:"tcp-statistic vjs-hidden"}),n=videojs.dom.createEl("div",{className:"tcp-statistic-close",innerText:"[X]"});return n.addEventListener("click",function(){t.hide(),t.player().trigger({type:"statistic",data:{action:"close"}})}),e.appendChild(n),e},e.prototype.init=function(){this.addChild("VideoStatisticWrapper")},e.prototype.show=function(){t.prototype.show.call(this),this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.popped=!1},e}(Component$5);videojs.registerComponent("VideoStatisticPanel",VideoStatisticPanel);var MenuItem$3=videojs.getComponent("MenuItem"),MirrorMenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.addClass("tc-menu-list"),r.open=!1,r.hasOpen=!1,r.player=n,r.setup(),r}return inherits(e,t),e.prototype.setup=function(){var t=this;this.on(["tap","click"],function(){var e=t.player.tech().el();t.hasOpen||(window.MtaH5&&MtaH5.clickStat("mirror",{appid:t.player.options_.appID,fileid:t.player.options_.fileID}),t.player.trigger({type:"feature",data:"mirror"})),t.open?(videojs.dom.removeClass(e,"tcp-mirror"),videojs.dom.removeClass(t.el_,"tcp-menu-item-select")):(videojs.dom.addClass(e,"tcp-mirror"),videojs.dom.addClass(t.el_,"tcp-menu-item-select"),t.hasOpen=!0),t.open=!t.open})},e}(MenuItem$3);videojs.registerComponent("MirrorMenuItem",MirrorMenuItem);var MenuItem$4=videojs.getComponent("MenuItem"),PoweredByMenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.addClass("tc-menu-list"),r}return inherits(e,t),e}(MenuItem$4);videojs.registerComponent("PoweredByMenuItem",PoweredByMenuItem);var MenuItem$5=videojs.getComponent("MenuItem"),StatusMenuItem=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.addClass("tc-menu-list"),r.hasOpen=!1,r.player=n,n.on("statistic",videojs.bind(r,function(t){"close"===t.data.action&&(videojs.dom.removeClass(r.el_,"tcp-menu-item-select"),r.hasOpen=!1)})),r.setup(),r}return inherits(e,t),e.prototype.setup=function(){var t=this;this.on(["tap","click"],function(){t.hasOpen?(videojs.dom.removeClass(t.el_,"tcp-menu-item-select"),t.player.trigger({type:"statistic",data:{action:"close"}}),t.hasOpen=!1):(videojs.dom.addClass(t.el_,"tcp-menu-item-select"),t.player.trigger({type:"statistic",data:{action:"open"}}),t.hasOpen=!0,window.MtaH5&&MtaH5.clickStat("mirror",{appid:t.player.options_.appID,fileid:t.player.options_.fileID}),t.player.trigger({type:"feature",data:"statistic"}))})},e}(MenuItem$5);videojs.registerComponent("StatusMenuItem",StatusMenuItem);var Component$8=videojs.getComponent("Component"),Menu$2=videojs.getComponent("Menu"),MenuItem$2=videojs.getComponent("MenuItem"),RightClickPopupMenu=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));r.hide(),r.addChild("PoweredByMenuItem",{label:"Powered by Tencent Cloud."}),!i.statistic||IS_IOS||IS_ANDROID||r.addChild("StatusMenuItem",{label:"Video statistic"}),i.mirror&&r.addChild("MirrorMenuItem",{label:"Mirror"}),n.on("contextmenu",videojs.bind(r,r.onContextmenu)),n.on(["tap","click"],videojs.bind(r,function(t){if(this.popped)return this.hide(),t.stopPropagation(),t.preventDefault(),!1})),videojs.on(document,["tap","click"],videojs.bind(r,function(t){this.popped&&this.hide()}));var o=r;return r.children().forEach(function(t){t.on(["tap","click"],function(){o.hide()})}),r}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this);return videojs.dom.addClass(e,"tcp-right-click-popup-menu"),e},e.prototype.show=function(){t.prototype.show.call(this),this.popped=!0},e.prototype.hide=function(){t.prototype.hide.call(this),this.popped=!1},e.prototype.onContextmenu=function(t){t.preventDefault(),this.show();var e=this.el(),n=t.clientX,i=t.clientY,r=getViewportSize(),o=r.width,s=r.height,a=n+e.offsetWidth-o+5;a=Math.max(0,a);var u=i+e.offsetHeight-s+5;u=Math.max(0,u);var l=this.player().el().getBoundingClientRect();e.style.left=Math.max(0,n-l.left-a)+"px",e.style.top=Math.max(0,i-l.top-u)+"px"},e}(Menu$2);videojs.registerComponent("RightClickPopupMenu",RightClickPopupMenu);var clickableComponent=videojs.getComponent("ClickableComponent"),TimeTooltip$2=videojs.getComponent("TimeTooltip"),Component$9=videojs.getComponent("Component"),dom=videojs.dom,formatTime$2=videojs.formatTime,COMMENT_WIDTH=140,COMMENT_HEIGHT_SINGLE_LINE=23,COMMENT_SHOW_ON_THE_LEFT={POPUP_CONTAINER_OFFSET:-130,POPUP_CONTAINER_OFFSET_WITHOUTGIT:-100,TRIANGLE_OFFEST:96,TRIANGLE_OFFEST_WITHOUTGIF:95},COMMENT_SHOW_ON_THE_RIGHT={TRIANGLE_OFFEST:6,POPUP_CONTAINER_OFFSET:0},ProgressMarkerGenerator=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.duration=0,r.registerListener(),r}return inherits(e,t),e.prototype.registerListener=function(){this.player_.one("canplay",videojs.bind(this,this.resetDotsElement))},e.prototype.resetDotsElement=function(){var t=this.player_;this.duration=t.duration(),dom.emptyEl(this.el_),this.resetEl()},e.prototype.resetEl=function(){this.setUpEl()},e.prototype.dotMouseLeave=function(){var t=event.currentTarget,e=t.getAttribute("container-id");this.getChildById(e).hide()},e.prototype.dotHover=function(){var t=event.currentTarget.parentElement.offsetWidth,e=event.currentTarget.offsetLeft+COMMENT_WIDTH,n=this.getChildById(event.currentTarget.getAttribute("container-id")),i=n.getAttribute("class").search("tcp-without-gif")>=0,r=n.el_.querySelector(".tcp-triangle-both")||n.el_.querySelector(".tcp-triangle");e>t?i?(n.el_.style.left=COMMENT_SHOW_ON_THE_LEFT.POPUP_CONTAINER_OFFSET_WITHOUTGIT+"px",r.style.left=COMMENT_SHOW_ON_THE_LEFT.TRIANGLE_OFFEST_WITHOUTGIF+"%"):(n.el_.style.left=COMMENT_SHOW_ON_THE_LEFT.POPUP_CONTAINER_OFFSET+"px",r.style.left=COMMENT_SHOW_ON_THE_LEFT.TRIANGLE_OFFEST+"%"):event.currentTarget.offsetLeft<=COMMENT_WIDTH&&!i&&(n.el_.style.left=COMMENT_SHOW_ON_THE_RIGHT.POPUP_CONTAINER_OFFSET+"px",r.style.left=COMMENT_SHOW_ON_THE_RIGHT.TRIANGLE_OFFEST+"px");var o=n.getChild("DotImage");if(o){var s=o.el_.getElementsByClassName("tcp-dot-timestamp")[0],a=event.currentTarget.getAttribute("dotinsecond"),u=formatTime$2(a);s.innerHTML=u}n.show()},e.prototype.setChildInTheContainer=function(t,e){var n=t.content&&""!==t.content?decodeURIComponent(t.content.replace(/\+/g," ")):"";if(""!==n){var i=e.addChild("DotComment");i.el_.innerHTML=encodeHTML(n)}if(t.img){e.el_.querySelector(".tcp-triangle").setAttribute("class","tcp-triangle-both");var r=e.addChild("DotImage");if(r.el_.firstChild.setAttribute("src",t.img),""==n)e.addClass("tcp-only-gif"),r.el_.firstChild.className="tcp-image-in-container-only-image";else{this.countContentSize(n)<=20&&(e.addClass("tcp-single-line"),i.el_.style.height=COMMENT_HEIGHT_SINGLE_LINE+"px")}}else if(""!==n){var o=this.countContentSize(n);o<=14?e.addClass("tcp-single-line"):o<=28&&e.addClass("tcp-two-lines"),e.addClass("tcp-without-gif"),i.addClass("tcp-large-comment")}},e.prototype.markSetUp=function(t){var e=t.timeOffset>0?t.timeOffset/1e3:0,n=this.duration?this.duration:0;if(!("number"!=typeof e||e>n)){var i=document.createElement("div");i.className="tcp-dot-basic-style",i.setAttribute("dotinsecond",e.toString()),t["class"]&&(i.className+=" "+t["class"]);var r=this.addChild("PopUpContainer");return i.setAttribute("container-id",r.id_),this.setChildInTheContainer(t,r),i.appendChild(r.el_),i.style.left=e/n*100+"%",i.addEventListener("mouseover",videojs.bind(this,this.dotHover)),i.addEventListener("mouseleave",videojs.bind(this,this.dotMouseLeave)),i}},e.prototype.setUpEl=function(){var e=this,n=this.player_.options_.dots||0,i=this.el_||t.prototype.createEl.call(this);return videojs.dom.addClass(i,"tcp-dot-component"),n&&n instanceof Array&&n.length>0&&n.forEach(function(t){var n=t.content||"";if(n&&""!=n||t.img){var r=e.markSetUp(t);r&&i.appendChild(r)}}),i},e.prototype.countContentSize=function(t){for(var e=0,n=t.length,i=-1,r=0;r<n;r++)i=t.charCodeAt(r),e+=i>=0&&i<=128?1:2;return e},e.prototype.createEl=function(){return this.setUpEl()},e}(clickableComponent);videojs.registerComponent("ProgressMarkerGenerator",ProgressMarkerGenerator);var DotComment=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.addClass("tcp-dot-comment"),r}return inherits(e,t),e}(Component$9);videojs.registerComponent("DotComment",DotComment);var DotImage=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));r.addClass("tcp-dot-image");var o=r.el_||t.prototype.createEl.call(r),s=dom.createEl("img");s.className="tcp-image-in-container",o.appendChild(s);var a=dom.createEl("span");return a.className="tcp-dot-timestamp",a.innerHTML="",o.appendChild(a),r}return inherits(e,t),e}(Component$9);videojs.registerComponent("DotImage",DotImage);var PopUpContainer=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));r.addClass("tcp-popup-container");var o=dom.createEl("div");return o.setAttribute("class","tcp-triangle"),r.el_.appendChild(o),r.hide(),r}return inherits(e,t),e}(TimeTooltip$2);videojs.registerComponent("PopUpContainer",PopUpContainer);var Plugin$2=videojs.getPlugin("plugin"),SpeedUp=function(t){function e(n){classCallCheck(this,e);var i=possibleConstructorReturn(this,t.call(this,n));return i.TARGET_LANTENCY=1,i.MAX_LATENCY=3,i.RATEVALUE=1.1,n.ready(videojs.bind(i,i.init)),i}return inherits(e,t),e.prototype.checkLatency=function(){var t=this.player.bufferedEnd()-this.player.currentTime();t>this.MAX_LATENCY&&this.player.playbackRate(this.RATEVALUE),t<this.TARGET_LANTENCY&&this.player.playbackRate(1)},e.prototype.init=function(){var t=this,e=this.player,n=void 0;e.on("playing",function(){e.duration()===Infinity&&(n=setInterval(t.checkLatency.bind(t),1e3))}),e.on("waiting",function(){t.reset(n)}),e.on("pause",function(){t.reset(n)})},e.prototype.reset=function(t){this.player.playbackRate(1),clearInterval(t)},e}(Plugin$2);videojs.registerPlugin("SpeedUp",SpeedUp);var Button$3=videojs.getComponent("Button"),BigPlayButton$2=videojs.getComponent("BigPlayButton");BigPlayButton$2.prototype.createEl=function(){var t=Button$3.prototype.createEl.call(this),e=getTemplate();return(this.options_.shapeType||this.options_.styleType)&&(e=getTemplate(this.options_.shapeType,this.options_.styleType)),t.appendChild(videojs.dom.createEl("div",{className:"vjs-button-icon",innerHTML:e})),t},BigPlayButton$2.prototype.controlText_="Play";var Component$10=videojs.getComponent("Component"),VideoStatisticWrapper$1=videojs.getComponent("VideoStatisticWrapper"),LoadingSpinner$2=videojs.getComponent("LoadingSpinner");LoadingSpinner$2.prototype.createEl=function(){function t(t,e){var n=new VideoStatisticWrapper$1(t);if(n.getMediaType(),(n.getBuffer()||"").indexOf("100.0%")>-1)return e.innerText="",!1;e.innerText=n.getConnectionSpeed()}var e=this,n=Component$10.prototype.createEl.call(this,"div",{className:"tcp-loading-spinner",dir:"ltr"});if(!this.player_.options_.loadingSpeed)return n;var i=null;return this.player_.on("waiting",function(){i=setInterval(function(){t(e.player_,n)},100)}),this.player_.on("timeupdate",function(){i&&clearInterval(i)}),n};var Plugin$3=videojs.getPlugin("plugin"),log$3=videojs.log,Skin=function(t){function e(n,i){classCallCheck(this,e),log$3("Skin initializing");var r=possibleConstructorReturn(this,t.call(this,n));return r.player.addClass("tcp-skin"),log$3("Skin initialized"),r}return inherits(e,t),e}(Plugin$3);videojs.registerPlugin("Skin",Skin);var now=function(){return _root.Date.now()},now_1=now,reWhitespace=/\s/,_trimmedEndIndex=trimmedEndIndex,reTrimStart=/^\s+/,_baseTrim=baseTrim,NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,toNumber_1=toNumber,FUNC_ERROR_TEXT$2="Expected a function",nativeMax=Math.max,nativeMin=Math.min,debounce_1=debounce,FUNC_ERROR_TEXT$1="Expected a function",throttle_1=throttle$1,Component$11=videojs.getComponent("Component"),DvrProgressControl=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on("mousemove",r.handleMouseMove),r.on("mouseup",r.handleMouseUp),r}return inherits(e,t),e.prototype.createEl=function(){
|
|
18
18
|
return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control tcp-dvr-progress-control"})},e.prototype.update=function(t){this.getChild("DvrSeekBar").update(t)},e.prototype.handleMouseMove=function(t){var e=this.getChild("DvrSeekBar"),n=e.calculateDistance(t),i=e.getChild("DvrMouseTimeDisplay");i&&i.update(videojs.dom.getBoundingClientRect(e.el()),n)},e.prototype.handleMouseUp=function(t){this.getChild("DvrSeekBar").handleMouseUp(t)},e}(Component$11);DvrProgressControl.prototype.options_={children:["DvrSeekBar"]},videojs.registerComponent("DvrProgressControl",DvrProgressControl);var Slider$2=videojs.getComponent("Slider"),DvrSeekBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.percent_=1,r.update=throttle_1(videojs.bind(r,r.update),50),r.on(n,"seekToLive",videojs.bind(r,function(t){this.update(t.data)})),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update=function(t){t!=undefined&&(this.percent_=t,this.bar.update(videojs.dom.getBoundingClientRect(this.el_),t),this.updateAriaAttributes(t))},e.prototype.handleMouseDown=function(e){t.prototype.handleMouseDown.call(this,e),this.isMouseDown=!0},e.prototype.handleMouseMove=function(t){var e=this.calculateDistance(t);this.update(e)},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this);var n=this.calculateDistance(e);this.update(n),this.player().Dvr().timeShift(n)},e.prototype.stepBack=function(){},e.prototype.stepForward=function(){},e.prototype.updateAriaAttributes=function(t){this.el().setAttribute("aria-valuenow",(100*t).toFixed(2))},e.prototype.getPercent=function(){return this.percent_},e}(Slider$2);DvrSeekBar.prototype.options_={children:["DvrMouseTimeDisplay","DvrTimeShiftBar"],barName:"DvrTimeShiftBar"},videojs.registerComponent("DvrSeekBar",DvrSeekBar);var DvrTimeShiftBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.el_.style.width="100%",r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar tcp-dvr-time-shift",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 100%</span>"})},e.prototype.update=function(t,e){var n=(100*e).toFixed(2)+"%";this.el_.style.width=n},e}(Component$11);videojs.registerComponent("DvrTimeShiftBar",DvrTimeShiftBar);var MouseTimeDisplay$2=videojs.getComponent("MouseTimeDisplay"),DvrMouseTimeDisplay=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player().Dvr().dvrData.maxTimeShift,r=videojs.formatTime((1-e)*i,i);n.el_.style.left=t.width*e+"px",n.getChild("timeTooltip").update(t,e,r)})},e}(MouseTimeDisplay$2);videojs.registerComponent("DvrMouseTimeDisplay",DvrMouseTimeDisplay);var Button$4=videojs.getComponent("Button"),LiveButton=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){var t=Button$4.prototype.createEl.call(this,"button",{className:"vjs-live-control vjs-control"});return this.contentEl_=videojs.dom.createEl("div",{className:"vjs-live-display",innerHTML:this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},e.prototype.update=function(){},e.prototype.updateControlText=function(t){this.controlText(t?"直播中":"返回直播")},e.prototype.handleClick=function(t){this.player().Dvr().seekToLive()},e}(Button$4);LiveButton.prototype.controlText_="返回直播",videojs.registerComponent("LiveButton",LiveButton);var Plugin$4=videojs.getPlugin("plugin"),Dvr=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));r.isInit=!1,r.options=i;var o=r;return n.ready(function(){var t=n.tech(!0);t&&t.hlsProvider&&n.one("loadedmetadata",function(e){t.el_.setAttribute("poster",""),o.init(),o.options.liveURL&&o.seekToLive()})}),r}return inherits(e,t),e.prototype.init=function(){var t=this.player,e=t.tech(!0).hlsProvider;if(this.parseM3u8(e.manifests[0]),!this.dvrData.startTime&&!this.isInit)return void t.one("loadedmetadata",videojs.bind(this,function(t){this.init()}));this.initControl(),this.delay=getParams("delay",t.tech_.currentSource_.src)||0,this.updateControl(!this.isLive()),t.on("loadedmetadata",videojs.bind(this,function(){this.parseM3u8(e.manifests[0]),this.delay=getParams("delay",t.tech_.currentSource_.src)||0,this.updateControl()})),this.isInit=!0},e.prototype.initControl=function(){var t=this.player;t.addClass("vjs-dvr"),t.controlBar.getChild("ProgressControl").hide(),t.controlBar.getChild("LiveDisplay").hide(),t.controlBar.addChild("DvrProgressControl",{},5),t.controlBar.addChild("liveButton",{},6)},e.prototype.updateControl=function(t){var e=this.player,n=e.controlBar.getChild("ProgressControl"),i=e.controlBar.getChild("LiveDisplay"),r=e.controlBar.getChild("DvrProgressControl"),o=e.controlBar.getChild("LiveButton");e.toggleClass("vjs-dvr-live",this.isLive()),o.updateControlText(this.isLive()),t&&r.update(1-this.delay/this.dvrData.maxTimeShift),this.dvrData.startTime?(r.show(),o.show(),n.hide(),i.hide()):(r.hide(),o.hide(),n.show(),i.show())},e.prototype.seekToLive=function(){this.isLive()||(this.timeShift(1),this.player.trigger({type:"seekToLive",data:1}))},e.prototype.isLive=function(){return!(this.delay>0)},e.prototype.timeShift=function(t){var e=this.player,n=(e.getChild("ControlBar").getChild("LiveButton"),e.tech_.currentSource_),i=Math.floor(this.dvrData.maxTimeShift*(1-t));this.delay=i,0==i&&this.options.liveURL?e.src(this.options.liveURL):(n.src=(this.options.shiftURL||n.src).replace(/delay=*(\d+)/,"delay="+i),e.src(e.tech_.currentSource_.src)),e.bigPlayButton.hide(),e.posterImage.hide(),e.tech_.one("hlsManifestParsed",videojs.bind(this,function(){e.play()}))},e.prototype.parseM3u8=function(t){this.dvrData={};for(var e=new RegExp([/#EXT-TX-TS-START-TIME:*(.+)/.source,/|#EXT-TX-TS-DURATION:*(.+)/.source].join(""),"g"),n=void 0;null!==(n=e.exec(t));)n[1]?this.dvrData.startTime=n[1]:n[2]&&(this.dvrData.duration=n[2]);this.dvrData.startTime&&(this.dvrData.maxTimeShift=Math.min(Math.floor((new Date).getTime()/1e3-this.dvrData.startTime),this.dvrData.duration))},e}(Plugin$4);videojs.registerPlugin("Dvr",Dvr);var Component$12=videojs.getComponent("Component"),LiveProgressControl=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.on("mousemove",r.handleMouseMove),r.on("mouseup",r.handleMouseUp),r.on("loadedmetadata",r.handleInit),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control tcp-live-progress-control"})},e.prototype.update=function(t){this.getChild("LiveSeekBar").update(t)},e.prototype.handleInit=function(){"dvrLive"!==this.player.dvrMode()?this.hide():(this.player.removeClass("vjs-live"),this.show(),player.controlBar.currentTimeDisplay.show())},e.prototype.handleMouseMove=function(t){var e=this.getChild("LiveSeekBar"),n=e.calculateDistance(t),i=e.getChild("LiveMouseTimeDisplay");i&&i.update(videojs.dom.getBoundingClientRect(e.el()),n)},e.prototype.handleMouseUp=function(t){this.getChild("LiveSeekBar").handleMouseUp(t)},e}(Component$12);LiveProgressControl.prototype.options_={children:["LiveSeekBar"]},videojs.registerComponent("LiveProgressControl",LiveProgressControl);var Slider$3=videojs.getComponent("Slider"),LiveSeekBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.percent_=1,r.update=throttle_1(videojs.bind(r,r.update),50),r.on(n,"timeupdate",r.update),r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},e.prototype.update=function(t){t!=undefined&&(this.percent_=t,this.bar.update(videojs.dom.getBoundingClientRect(this.el_),t),this.updateAriaAttributes(t))},e.prototype.handleMouseDown=function(e){t.prototype.handleMouseDown.call(this,e),this.isMouseDown=!0},e.prototype.handleMouseMove=function(t){var e=this.calculateDistance(t);this.update(e)},e.prototype.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this);var n=this.calculateDistance(e);this.update(n),this.player().LiveDvr().timeShift(n)},e.prototype.stepBack=function(){},e.prototype.stepForward=function(){},e.prototype.updateAriaAttributes=function(t){this.el().setAttribute("aria-valuenow",(100*t).toFixed(2))},e.prototype.getPercent=function(){return this.percent_},e}(Slider$3);LiveSeekBar.prototype.options_={children:["LiveMouseTimeDisplay","LiveTimeShiftBar"],barName:"LiveTimeShiftBar"},videojs.registerComponent("LiveSeekBar",LiveSeekBar);var LiveTimeShiftBar=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n,i));return r.el_.style.width="100%",r}return inherits(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar tcp-dvr-time-shift tcp-live-time-shift",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 100%</span>"})},e.prototype.update=function(t,e){var n=(100*e).toFixed(2)+"%";this.el_.style.width=n},e}(Component$12);videojs.registerComponent("LiveTimeShiftBar",LiveTimeShiftBar);var MouseTimeDisplay$3=videojs.getComponent("MouseTimeDisplay"),LiveMouseTimeDisplay=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.update=function(t,e){var n=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var i=n.player().VttThumbnail().liveDuration,r=videojs.formatTime(e*i,i);n.el_.style.left=t.width*e+"px",n.getChild("timeTooltip").update(t,e,r)})},e}(MouseTimeDisplay$3);videojs.registerComponent("LiveMouseTimeDisplay",LiveMouseTimeDisplay);var Button$5=videojs.getComponent("Button"),LiveButton$1=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){var t=Button$5.prototype.createEl.call(this,"button",{className:"vjs-live-control vjs-control"});return this.contentEl_=videojs.dom.createEl("div",{className:"vjs-live-display",innerHTML:this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},e.prototype.update=function(){},e.prototype.updateControlText=function(t){this.controlText(t?"直播中":"返回直播")},e.prototype.handleClick=function(t){this.player().LiveDvr().seekToLive()},e}(Button$5);LiveButton$1.prototype.controlText_="返回直播",videojs.registerComponent("LiveButton",LiveButton$1);var LARGE_ARRAY_SIZE=200,defineProperty$1=function(){try{var t=_getNative(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),_defineProperty=defineProperty$1,_baseAssignValue=baseAssignValue,objectProto$5=Object.prototype,hasOwnProperty$6=objectProto$5.hasOwnProperty,_assignValue=assignValue,argsTag$1="[object Arguments]",_baseIsArguments=baseIsArguments,objectProto$7=Object.prototype,hasOwnProperty$8=objectProto$7.hasOwnProperty,propertyIsEnumerable=objectProto$7.propertyIsEnumerable,isArguments=_baseIsArguments(function(){return arguments}())?_baseIsArguments:function(t){return isObjectLike_1(t)&&hasOwnProperty$8.call(t,"callee")&&!propertyIsEnumerable.call(t,"callee")},stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule(function(t,e){var n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,r=i&&i.exports===n,o=r?_root.Buffer:undefined,s=o?o.isBuffer:undefined,a=s||stubFalse_1;t.exports=a}),MAX_SAFE_INTEGER$1=9007199254740991,isLength_1=isLength,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",funcTag$2="[object Function]",mapTag$1="[object Map]",numberTag$1="[object Number]",objectTag$1="[object Object]",regexpTag$1="[object RegExp]",setTag$1="[object Set]",stringTag$1="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag$1]=typedArrayTags[float64Tag$1]=typedArrayTags[int8Tag$1]=typedArrayTags[int16Tag$1]=typedArrayTags[int32Tag$1]=typedArrayTags[uint8Tag$1]=typedArrayTags[uint8ClampedTag$1]=typedArrayTags[uint16Tag$1]=typedArrayTags[uint32Tag$1]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$1]=typedArrayTags[boolTag$1]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag$1]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag$2]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag$1]=typedArrayTags[objectTag$1]=typedArrayTags[regexpTag$1]=typedArrayTags[setTag$1]=typedArrayTags[stringTag$1]=typedArrayTags[weakMapTag$1]=!1;var _baseIsTypedArray=baseIsTypedArray,_baseUnary=baseUnary,_nodeUtil=createCommonjsModule(function(t,e){var n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,r=i&&i.exports===n,o=r&&_freeGlobal.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(e){}}();t.exports=s}),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,_overArg=overArg,nativeKeys=_overArg(Object.keys,Object),_cloneBuffer=createCommonjsModule(function(t,e){function n(t,e){if(e)return t.slice();var n=t.length,i=a?a(n):new t.constructor(n);return t.copy(i),i}var i=e&&!e.nodeType&&e,r=i&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===i,s=o?_root.Buffer:undefined,a=s?s.allocUnsafe:undefined;t.exports=n}),getPrototype=_overArg(Object.getPrototypeOf,Object),DataView$1=_getNative(_root,"DataView"),_DataView=DataView$1,Promise$1=_getNative(_root,"Promise"),_Promise=Promise$1,Set$1=_getNative(_root,"Set"),_Set=Set$1,WeakMap=_getNative(_root,"WeakMap"),_WeakMap=WeakMap,mapTag$2="[object Map]",promiseTag="[object Promise]",setTag$2="[object Set]",weakMapTag$2="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=_toSource(_DataView),mapCtorString=_toSource(_Map),promiseCtorString=_toSource(_Promise),setCtorString=_toSource(_Set),weakMapCtorString=_toSource(_WeakMap),getTag=_baseGetTag;(_DataView&&getTag(new _DataView(new ArrayBuffer(1)))!=dataViewTag$2||_Map&&getTag(new _Map)!=mapTag$2||_Promise&&getTag(_Promise.resolve())!=promiseTag||_Set&&getTag(new _Set)!=setTag$2||_WeakMap&&getTag(new _WeakMap)!=weakMapTag$2)&&(getTag=function(t){var e=_baseGetTag(t),n="[object Object]"==e?t.constructor:undefined,i=n?_toSource(n):"";if(i)switch(i){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$2;case promiseCtorString:return promiseTag;case setCtorString:return setTag$2;case weakMapCtorString:return weakMapTag$2}return e});var _getTag=getTag,mapTag$4="[object Map]",_baseIsMap=baseIsMap,nodeIsMap=_nodeUtil&&_nodeUtil.isMap,isMap=nodeIsMap?_baseUnary(nodeIsMap):_baseIsMap,setTag$4="[object Set]",_baseIsSet=baseIsSet,nodeIsSet=_nodeUtil&&_nodeUtil.isSet,isSet=nodeIsSet?_baseUnary(nodeIsSet):_baseIsSet,Plugin$5=videojs.getPlugin("plugin"),LiveDvr=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));r.isInit=!1,r.options=i;var o=r;return n.ready(function(){var t=n.tech(!0),e=t&&t.hlsProvider,i=t&&t.webrtcProvider;(e||i)&&n.one("loadedmetadata",function(e){t.el_.setAttribute("poster",""),o.init()})}),r}return inherits(e,t),e.prototype.init=function(){var t=this,e=this.player;e.on("loadedmetadata",function(){t.durationTimer&&clearInterval(t.durationTimer);var n=e.dvrMode();"dvrLive"===n&&(e.controlBar.getChild("ProgressControl").hide(),e.controlBar.getChild("LiveProgressControl")?e.controlBar.getChild("LiveProgressControl").show():e.controlBar.addChild("LiveProgressControl",{},5),e.controlBar.PDTDisplay.hide(),e.removeClass("vjs-live"),e.addClass("vjs-live-dvr")),"dvrEvent"===n&&(e.controlBar.getChild("ProgressControl").show(),e.controlBar.getChild("LiveProgressControl",{},5).hide(),e.controlBar.PDTDisplay.show(),e.removeClass("vjs-live"),e.removeClass("vjs-live-dvr"))});var n=setInterval(function(){t.liveDuration=e.VttThumbnail().liveDuration,t.liveDuration&&(t.initControl(),t.isInit=!0,clearInterval(n))},500)},e.prototype.initControl=function(){var t=this.player;"dvrLive"===t.dvrMode()&&(t.removeClass("vjs-live"),t.addClass("vjs-live-dvr"),t.controlBar.getChild("ProgressControl").hide(),t.controlBar.getChild("LiveDisplay").hide(),t.controlBar.addChild("LiveProgressControl",{},5),t.controlBar.playbackRateMenuButton.hide(),t.controlBar.durationDisplay.hide(),t.controlBar.timeDivider.hide(),t.controlBar.currentTimeDisplay.show())},e.prototype.timeShift=function(t){var e=this.player,n=e.tech_.currentSource_;if(100===t&&this.options.liveURL){e.src(this.options.liveURL);try{e.controlBar.getChild("LiveProgressControl").LiveSeekBar.LiveTimeShiftBar.el_.style.width="100%"}catch(i){}}else n.src=this.options.shiftURL,e.src(e.tech_.currentSource_.src),e.one("loadedmetadata",function(){var n=e.duration()*t;e.currentTime(n)});e.bigPlayButton.hide(),e.posterImage.hide(),e.tech_.one("hlsManifestParsed",videojs.bind(this,function(){e.play()}))},e}(Plugin$5);videojs.registerPlugin("LiveDvr",LiveDvr);var Menu$4=videojs.getComponent("Menu"),QualitySwitcherMenu=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.addItem=function(e){t.prototype.addItem.call(this,e)},e}(Menu$4),MenuItem$6=videojs.getComponent("MenuItem"),QualitySwitcherMenuItem=function(t){function e(n,i){return classCallCheck(this,e),possibleConstructorReturn(this,t.call(this,n,i))}return inherits(e,t),e.prototype.handleClick=function(e){if(t.prototype.handleClick.call(this,e),this.updateItems(),this.options_.callback(this.options_),"video"==this.options_.trackType){var n=this.player().controlBar.getChild(this.options_.trackType+"QualitySwitcherMenuButton");n.updateLabel(this.options_),n.unpressButton()}},e.prototype.updateItems=function(){for(var t=this.player().controlBar.getChild(this.options_.trackType+"QualitySwitcherMenuButton"),e=t.getChild(this.options_.trackType+"QualitySwitcherMenu"),n=e.children(),i=0;i<n.length;i++){var r=n[i];this!==r?(r.selected(!1),r.options_.selected=!1):r.options_.selected=!0}},e}(MenuItem$6),MenuButton$2=videojs.getComponent("MenuButton"),Menu$3=videojs.getComponent("Menu"),QualitySwitcherMenuButton=function(t){function e(){return classCallCheck(this,e),possibleConstructorReturn(this,t.apply(this,arguments))}return inherits(e,t),e.prototype.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelEl_=videojs.dom.createEl("div",{className:"tcp-quality-switcher-value",innerHTML:""}),e.appendChild(this.labelEl_),e},e.prototype.createMenu=function(){for(var t=this.options_.qualityList,e=new QualitySwitcherMenu(this.player(),{name:this.options_.trackType+"QualitySwitcherMenu"}),n=void 0,i=t.length-1;i>-1;i--){var r=t[i];n=videojs.mergeOptions(r,{trackType:this.options_.trackType,callback:this.options_.callback,selectable:!0}),e.addItem(new QualitySwitcherMenuItem(this.player(),n)),r.selected&&this.updateLabel(r)}return e},e.prototype.updateLabel=function(t){this.labelEl_.innerHTML="<p>"+this.localize(t.label)+"</p>"},e}(MenuButton$2),Plugin$6=videojs.getPlugin("plugin"),TRACK_TYPES=["video","audio","subtitle"],TRACK_CLASS={video:"tcp-video-quality-switcher",audio:"tcp-audio-quality-switcher",subtitle:"tcp-subtitle-quality-switcher"},log$4=videojs.log,QualitySwitcher=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,n.on("qualitydataloaded",videojs.bind(r,r.init)),r}return inherits(e,t),e.prototype.init=function(t){log$4("QualitySwitcher initializing",t);var e=this.player,n=t.data.qualityData,i=t.data.callbacks;if(this.setOptions({qualityData:n,callbacks:i}),!e.controlBar)return void log$4("QualitySwitcher can not initialize without control bar");for(var r=0;r<TRACK_TYPES.length;r++){var o=TRACK_TYPES[r],s=o+"QualitySwitcherMenuButton",a=e.controlBar.getChild(s);n[o]&&n[o].length>0&&e.controlBar.options_.QualitySwitcherMenuButton&&(a&&a.el()&&(a.dispose(),e.controlBar.removeChild(a)),this.repleaceLabel(o,n),a=new QualitySwitcherMenuButton(e,{name:s,qualityList:n[o],callback:i[o],trackType:o}),a.addClass(TRACK_CLASS[o]),e.controlBar.addChild(a,{},10))}log$4("QualitySwitcher initialized",t,this)},e.prototype.setOptions=function(t){this.options=videojs.mergeOptions(this.options,t)},e.prototype.setVideoQuality=function(t){if(this.options.qualityData&&this.options.callbacks.video){for(var e=this.options.qualityData.video,n=0;n<e.length;n++)e[n].selected&&(e[n].selected=!1),e[n].id===t.id&&(e[n].selected=!0);this.options.callbacks.video(t)}},e.prototype.getVideoQualityData=function(){return this.options.qualityData?this.options.qualityData.video:undefined},e.prototype.repleaceLabel=function(t,e){if(this.options.qualityLabelList){var n=this.options.qualityLabelList[t],i=e[t];if(i&&i.length>0&&n&&n.length>0)for(var r=0;r<i.length;r++){var o=i[r].label;o=o.slice(0,o.length-1);for(var s=0;s<n.length;s++)if(n[s].height==o){i[r].label=n[s].resolutionName;break}}}},e.prototype.reset=function(){for(var t=this.player,e=0;e<TRACK_TYPES.length;e++){var n=TRACK_TYPES[e],i=t.controlBar&&t.controlBar.getChild(n+"QualitySwitcherMenuButton");i&&i.el()&&(i.dispose(),t.controlBar.removeChild(i))}},e}(Plugin$6);videojs.registerPlugin("QualitySwitcher",QualitySwitcher);var Plugin$7=videojs.getPlugin("plugin"),log$5=videojs.log,defaultOptions={labels:{FLU:"流畅",SD:"标清",HD:"高清",FHD:"超清"},showOrder:["FLU","SD","HD","FHD"],defaultRes:"SD"},MultiResolution=function(t){function e(n,i){classCallCheck(this,e);var r=possibleConstructorReturn(this,t.call(this,n));return r.options=i,i.useManualOption&&(r.manualOptions=extend({},i)),r.hasInit=!1,n.on("multiresolutionchange",videojs.bind(r,function(t){t.data&&this.update(data)})),n.on(["resolutionswitching","resolutionswitched"],videojs.bind(r,function(t){"resolutionswitching"==t.type?this.player.addClass("tcp-res-switching"):this.player.removeClass("tcp-res-switching")})),n.ready(videojs.bind(r,function(){var t=n.tech(!0);t&&(t.on("masterplaylistchange",videojs.bind(this,this.onMasterPlaylistChange)),t.on("hlsresolutionswitching",videojs.bind(this,this.onHlsLevelChange)),t.on("hlsresolutionswitched",videojs.bind(this,this.onHlsLevelChange)),t.on("dashqualityswitching",videojs.bind(this,this.onDashQualityChange)),t.on("dashqualityswitched",videojs.bind(this,this.onDashQualityChange))),this.hasInit=!0})),r.init(r.player.options_.multiResolution),r}return inherits(e,t),e.prototype.init=function(t){var e={};this.player.options_.label&&(e.label=this.player.options_.label),this.player.options_.labels&&(e.labels=this.player.options_.label),this.player.options_.showOrder&&(e.showOrder=this.player.options_.showOrder),this.player.options_.defaultRes&&(e.defaultRes=this.player.options_.defaultRes);var n=this.player,i=extend({},defaultOptions,t,this.manualOptions,e),r=i&&i.sources;if(this.options=i,r){log$5("MultiResolution initializing",i);var o=void 0;if(this.currentID=i.defaultRes=r[i.defaultRes]?i.defaultRes:Object.keys(r).shift(),o=r[this.currentID],"mediaLoader"!=n.options_.children[0]||this.hasInit)n.src(o);else{var s;(s=n.options_.sources).push.apply(s,o)}this.hasInit||(this.hasInit=!0),n.ready(videojs.bind(this,function(){n.trigger({type:"qualitydataloaded",data:this.initQualityData(i)}),n.one("loadedmetadata",function(){var t=this.tech(!0);"flash"!=t.name_&&t.el_.getAttribute("poster")&&(t.el_.removeAttribute("poster"),delete t.el_.poster)})})),log$5("MultiResolution initialized")}},e.prototype.reset=function(){this.player.QualitySwitcher().reset()},e.prototype.update=function(t){this.init(t)},e.prototype.store=function(t){if(!t)return this.options;this.options=videojs.mergeOptions(defaultOptions,this.options,t)},e.prototype.onMasterPlaylistChange=function(t){this.player.trigger({type:"qualitydataloaded",data:t.data})},e.prototype.onHlsLevelChange=function(t){"hlsresolutionswitching"==t.type?this.player.trigger({type:"resolutionswitching",data:t.data}):"hlsresolutionswitched"==t.type&&this.player.trigger({type:"resolutionswitched",data:t.data})},e.prototype.onDashQualityChange=function(t){"dashqualityswitching"==t.type?this.player.trigger({type:"resolutionswitching",data:t.data}):"dashqualityswitched"==t.type&&this.player.trigger({type:"resolutionswitched",data:t.data})},e.prototype.switchResolution=function(t){if(this.currentID!=t.id){var e=this.player,n=e.currentTime(),i=(e.paused(),Infinity===e.duration());if(e.trigger({type:"resolutionswitching",data:t}),i)e.bigPlayButton&&e.bigPlayButton.hide(),e.posterImage&&e.posterImage.hide(),e.one("loadstart",function(){e.play(),e.trigger({type:"resolutionswitched",data:t})});else{var r=e.ended(),o=e.playbackRate(),s=e.controlBar&&e.controlBar.progressControl&&e.controlBar.progressControl.seekBar.playProgressBar.el().style.width||0,a=videojs.browser.IS_IOS||videojs.browser.IS_ANDROID?"loadeddata":"loadedmetadata";e.one(a,function(){e.controlBar&&e.controlBar.progressControl&&(e.controlBar.progressControl.seekBar.playProgressBar.el().style.width=s),r||e.currentTime(n),"Flash"==e.techName_?(e.play(),e.tech(!0).trigger("seeked")):(e.play(),e.playbackRate()!=o&&e.playbackRate(o)),e.trigger({type:"resolutionswitched",data:t})}),e.bigPlayButton&&e.bigPlayButton.hide(),e.posterImage&&e.posterImage.hide(),"none"==e.options_.preload&&e.one("suspend",function(){e.load()})}e.src(this.options.sources[t.id]),i&&setTimeout(function(){e.play(),setTimeout(function(){e.play()},900)},100),this.currentID=t.id}},e.prototype.initQualityData=function(t){var e=[],n=(t.sources,t.labels),i=t.showOrder;return i.length>0&&i.forEach(function(i,r){var o={};o.id=i,o.selected=t.defaultRes===i,o.label=n[i]||i,e.push(o)}),{qualityData:{video:e},callbacks:{video:videojs.bind(this,this.switchResolution)}}},e.prototype.sortSourceOrder=function(t){return[]},e}(Plugin$7);videojs.registerPlugin("MultiResolution",MultiResolution);var FlashObj=videojs.getComponent("Flash"),defaultDismiss=!videojs.browser.IS_IPHONE,registerPlugin=videojs.registerPlugin||videojs.plugin,defaults$1={header:"",code:"",message:"",timeout:45e3,dismiss:defaultDismiss,progressDisabled:!1,errors:{1:{type:"MEDIA_ERR_ABORTED"},2:{type:"MEDIA_ERR_NETWORK"},3:{type:"MEDIA_ERR_DECODE"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED"},5:{type:"MEDIA_ERR_ENCRYPTED"},unknown:{type:"MEDIA_ERR_UNKNOWN"},"-1":{type:"PLAYER_ERR_NO_SRC",message:"No video has been loaded."},"-2":{type:"PLAYER_ERR_TIMEOUT",message:"Could not download the video."},10:{type:"SERVER_ERR",message:"Request timed out."},11:{type:"SERVER_ERR",message:"Server is not respond."},12:{type:"DATA_ERR",message:"Server respond error data."},13:{type:"DATA_ERR",message:"No video transcoding information found."},14:{type:"HLS_NETWORK_ERR",message:"A network error caused the media download to fail part-way."},15:{type:"HLS_MEDIA_ERR",message:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support."},16:{type:"HLS_MUX_ERR",message:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support."},17:{type:"HLS_OTHER_ERR",message:"Rise an internal exception when playing HLS."},18:{type:"DRM_ERR",message:"Current browser not support DRM."},20:{type:"PERMISSION_ERR",message:"This website needs a permission to access device motion."},21:{type:"PERMISSION_ERR",message:"This website needs a permission to access device motion."},30:{type:"FILE_NETWORK_ERR",message:"Failed to load hls.js file"},31:{type:"FILE_NETWORK_ERR",message:"Failed to load webrtc file"},32:{type:"FILE_NETWORK_ERR",message:"Failed to load flv file"},33:{type:"FILE_NETWORK_ERR",message:"Failed to load dash file"},50:{type:"LICENSE_ERR",message:"License verification failed."},51:{type:"LICENSE_ERR",message:"The license has expired."},52:{type:"LICENSE_ERR",message:"Domain verification failed."},53:{type:"LICENSE_ERR",message:"Time verification failed."},54:{type:"LICENSE_ERR",message:"License type error."},55:{type:"LICENSE_ERR",message:"Lack license url."},56:{type:"LICENSE_ERR",message:"Get license data failed."},60:{type:"SAFECHECK_ERR",message:"Elements check failed."},61:{type:"SAFECHECK_ERR",message:"API check failed."},62:{type:"SAFECHECK_ERR",message:"Environment check failed."},63:{type:"SAFECHECK_ERR",message:"Environment check failed."},403:{type:"SERVER_ERR",message:"Authentication failed."},500:{type:"SERVER_ERR",message:"Server failed."},1001:{type:"SERVER_ERR",message:"The media file does not exist. Please check if the fileID is correct."},1002:{type:"SERVER_ERR",message:"The trial duration is illegal. The trial duration must be within the video duration."},1003:{type:"SERVER_ERR",message:"Param pcfg is not unique."},1004:{type:"SERVER_ERR",message:"The license has expired. Please check whether the expiration time setting is reasonable."},1005:{type:"SERVER_ERR",message:"Did not find an adaptive stream that can be played."},1006:{type:"SERVER_ERR",message:"Invalid request format, please check the request format."},1007:{type:"SERVER_ERR",message:"AppID is not exist, Please check if the AppID is correct."},1008:{type:"SERVER_ERR",message:"Without anti-leech information."},1009:{type:"SERVER_ERR",message:"psign check failed."},1010:{type:"SERVER_ERR",message:"Other errors."},1011:{type:"SERVER_ERR",message:"Get DRM license url failed"},1012:{type:"SERVER_ERR",message:"Get DRM certificate url failed"},1013:{type:"SERVER_ERR",message:"Psign missing contentInfo error"},1014:{type:"SERVER_ERR",message:"Psign contentInfo.audioVideoType invalid"},1015:{type:"SERVER_ERR",message:"Psign missing rawAdaptiveDefinition error"},1016:{type:"SERVER_ERR",message:"Psign missing drmAdaptiveInfo error"},1017:{type:"SERVER_ERR",message:"Psign missing transcodeDefinition error"},1018:{type:"SERVER_ERR",message:"Psign contentInfo.ResolutionNames json marshal error"},1019:{type:"SERVER_ERR",message:"Get super player config error"},1020:{type:"SERVER_ERR",message:"Get play key info error"},1021:{type:"SERVER_ERR",message:"Qsign invalid"},1022:{type:"SERVER_ERR",message:"Ciphered overlay info invalid"},1023:{type:"SERVER_ERR",message:"Ghost watermark info text is too long"},2001:{type:"SERVER_ERR",message:"System error"},2002:{type:"SERVER_ERR",message:"Panic error"},19:{type:"DATA_ERR",message:"Response data verification failed."},10008:{type:"SERVER_ERR",message:"The media file does not exist. Please check if the fileID is correct."},"-2001":{type:"SERVER_ERR",message:"Current browser not support play this stream, please select another one."},"-2002":{type:"SERVER_ERR",message:"Server respond error data.(eg. stream not exist)"},"-2003":{type:"SERVER_ERR",message:"Video play failed, please refresh to start play again."},"-2004":{type:"SERVER_ERR",message:"Connection to the server has failed and the number of connection retries has exceeded the set value."},"-2005":{type:"SERVER_ERR",message:"Video decoding failure."},PLAYER_ERR_DOMAIN_RESTRICTED:{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tcplayer.js",
|
|
3
3
|
"description": "腾讯云 Web 播放器",
|
|
4
|
-
"version": "5.3.4-beta.
|
|
4
|
+
"version": "5.3.4-beta.29",
|
|
5
5
|
"main": "./dist/tcplayer.v5.3.4.min.js",
|
|
6
6
|
"style": "./dist/tcplayer.min.css",
|
|
7
7
|
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
|