on(){this.off(L,"visibilitychange",this.handleVisibilityChange_) this.stopTracking() e.prototype.dispose.call(this)} return t}(Bs) Bs.registerComponent("LiveTracker",gl) var vl,yl=function(e){var t=e.el() if(t.hasAttribute("src")){e.triggerSourceset(t.src) return!0}var i=e.$$("source"),n=[],r="" if(!i.length)return!1 for(var a=0;a=2&&t.push("loadeddata") e.readyState>=3&&t.push("canplay") e.readyState>=4&&t.push("canplaythrough") this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}else{var i=!1,n=function(){i=!0} this.on("loadstart",n) var r=function(){i||this.trigger("loadstart")} this.on("loadedmetadata",r) this.ready((function(){this.off("loadstart",n) this.off("loadedmetadata",r) i||this.trigger("loadstart")}))}} i.setScrubbing=function(e){this.isScrubbing_=e} i.scrubbing=function(){return this.isScrubbing_} i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&ha?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Ur(e,"Video is not ready. (Video.js)")}} i.duration=function(){var e=this if(this.el_.duration===1/0&&Jr&&na&&0===this.el_.currentTime){this.on("timeupdate",(function t(){if(e.el_.currentTime>0){e.el_.duration===1/0&&e.trigger("durationchange") e.off("timeupdate",t)}})) return NaN}return this.el_.duration||NaN} i.width=function(){return this.el_.offsetWidth} i.height=function(){return this.el_.offsetHeight} i.proxyWebkitFullscreen_=function(){var e=this if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}) this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){if("webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode){this.one("webkitendfullscreen",t) this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0})}} this.on("webkitbeginfullscreen",i) this.on("dispose",(function(){e.off("webkitbeginfullscreen",i) e.off("webkitendfullscreen",t)}))}} i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=x.navigator&&x.navigator.userAgent||"" if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1} i.enterFullScreen=function(){var e=this.el_ if(e.paused&&e.networkState<=e.HAVE_METADATA){zs(this.el_.play()) this.setTimeout((function(){e.pause() try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0)}else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}} i.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))} i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()} i.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)} i.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)} i.src=function(e){if(void 0===e)return this.el_.src this.setSrc(e)} i.reset=function(){t.resetMediaElement(this.el_)} i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc} i.setControls=function(e){this.el_.controls=!!e} i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)} i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t) var i=L.createElement("track") t.kind&&(i.kind=t.kind) t.label&&(i.label=t.label);(t.language||t.srclang)&&(i.srclang=t.language||t.srclang) t.default&&(i.default=t.default) t.id&&(i.id=t.id) t.src&&(i.src=t.src) return i} i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i) this.featuresNativeTextTracks&&this.el().appendChild(n) return n} i.removeRemoteTextTrack=function(t){e.prototype.removeRemoteTextTrack.call(this,t) if(this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])} i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality() var e={} if(void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount){e.droppedVideoFrames=this.el().webkitDroppedFrameCount e.totalVideoFrames=this.el().webkitDecodedFrameCount}x.performance&&"function"==typeof x.performance.now?e.creationTime=x.performance.now():x.performance&&x.performance.timing&&"number"==typeof x.performance.timing.navigationStart&&(e.creationTime=x.Date.now()-x.performance.timing.navigationStart) return e} return t}(Io) El(Cl,"TEST_VID",(function(){if(ga()){var e=L.createElement("video"),t=L.createElement("track") t.kind="captions" t.srclang="en" t.label="English" e.appendChild(t) return e}})) Cl.isSupported=function(){try{Cl.TEST_VID.volume=.5}catch(e){return!1}return!(!Cl.TEST_VID||!Cl.TEST_VID.canPlayType)} Cl.canPlayType=function(e){return Cl.TEST_VID.canPlayType(e)} Cl.canPlaySource=function(e,t){return Cl.canPlayType(e.type)} Cl.canControlVolume=function(){try{var e=Cl.TEST_VID.volume Cl.TEST_VID.volume=e/2+.1 var t=e!==Cl.TEST_VID.volume if(t&&da){x.setTimeout((function(){Cl&&Cl.prototype&&(Cl.prototype.featuresVolumeControl=e!==Cl.TEST_VID.volume)})) return!1}return t}catch(e){return!1}} Cl.canMuteVolume=function(){try{var e=Cl.TEST_VID.muted Cl.TEST_VID.muted=!e Cl.TEST_VID.muted?Aa(Cl.TEST_VID,"muted","muted"):Oa(Cl.TEST_VID,"muted") return e!==Cl.TEST_VID.muted}catch(e){return!1}} Cl.canControlPlaybackRate=function(){if(Jr&&na&&ra<58)return!1 try{var e=Cl.TEST_VID.playbackRate Cl.TEST_VID.playbackRate=e/2+.1 return e!==Cl.TEST_VID.playbackRate}catch(e){return!1}} Cl.canOverrideAttributes=function(){try{var e=function(){} Object.defineProperty(L.createElement("video"),"src",{get:e,set:e}) Object.defineProperty(L.createElement("audio"),"src",{get:e,set:e}) Object.defineProperty(L.createElement("video"),"innerHTML",{get:e,set:e}) Object.defineProperty(L.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0} Cl.supportsNativeTextTracks=function(){return ha||da&&na} Cl.supportsNativeVideoTracks=function(){return!(!Cl.TEST_VID||!Cl.TEST_VID.videoTracks)} Cl.supportsNativeAudioTracks=function(){return!(!Cl.TEST_VID||!Cl.TEST_VID.audioTracks)} Cl.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],i=e[1] El(Cl.prototype,t,(function(){return Cl[i]()}),!0)})) Cl.prototype.featuresVolumeControl=Cl.canControlVolume() Cl.prototype.movingMediaElementInDOM=!da Cl.prototype.featuresFullscreenResize=!0 Cl.prototype.featuresProgressEvents=!0 Cl.prototype.featuresTimeupdateEvents=!0 Cl.prototype.featuresVideoFrameCallback=!(!Cl.TEST_VID||!Cl.TEST_VID.requestVideoFrameCallback) Cl.patchCanPlayType=function(){if(Zr>=4&&!ta&&!na){vl=Cl.TEST_VID&&Cl.TEST_VID.constructor.prototype.canPlayType Cl.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":vl.call(this,e)}}} Cl.unpatchCanPlayType=function(){var e=Cl.TEST_VID.constructor.prototype.canPlayType vl&&(Cl.TEST_VID.constructor.prototype.canPlayType=vl) return e} Cl.patchCanPlayType() Cl.disposeMediaElement=function(e){if(e){e.parentNode&&e.parentNode.removeChild(e) for(;e.hasChildNodes();)e.removeChild(e.firstChild) e.removeAttribute("src") "function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}} Cl.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]) e.removeAttribute("src") "function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Cl.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}));["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Cl.prototype["set"+Ls(e)]=function(t){this.el_[e]=t t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}));["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){Cl.prototype[e]=function(){return this.el_[e]}}));["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){Cl.prototype["set"+Ls(e)]=function(t){this.el_[e]=t}}));["pause","load","play"].forEach((function(e){Cl.prototype[e]=function(){return this.el_[e]()}})) Io.withSourceHandlers(Cl) Cl.nativeSourceHandler={} Cl.nativeSourceHandler.canPlayType=function(e){try{return Cl.TEST_VID.canPlayType(e)}catch(e){return""}} Cl.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Cl.nativeSourceHandler.canPlayType(e.type) if(e.src){var i=mo(e.src) return Cl.nativeSourceHandler.canPlayType("video/"+i)}return""} Cl.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)} Cl.nativeSourceHandler.dispose=function(){} Cl.registerSourceHandler(Cl.nativeSourceHandler) Io.registerTech("Html5",Cl) var wl=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Il={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Pl=["tiny","xsmall","small","medium","large","xlarge","huge"],xl={} Pl.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e xl[e]="vjs-layout-"+t})) var Al={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ol=function(e){B(t,e) function t(i,n,r){var a i.id=i.id||n.id||"vjs_video_"+ts();(n=Hr(t.getTagSettings(i),n)).initChildren=!1 n.createEl=!1 n.evented=!1 n.reportTouchActivity=!1 if(!n.language)if("function"==typeof i.closest){var s=i.closest("[lang]") s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else for(var o=i;o&&1===o.nodeType;){if(Pa(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang") break}o=o.parentNode}(a=e.call(this,null,n,r)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e)} a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e)} a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e)} a.boundApplyInitTime_=function(e){return a.applyInitTime_(e)} a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e)} a.boundHandleTechClick_=function(e){return a.handleTechClick_(e)} a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e)} a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e)} a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e)} a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e)} a.boundHandleTechTap_=function(e){return a.handleTechTap_(e)} a.isFullscreen_=!1 a.log=Br(a.id_) a.fsApi_=Or a.isPosterFromTech_=!1 a.queuedCallbacks_=[] a.isReady_=!1 a.hasStarted_=!1 a.userActive_=!1 a.debugEnabled_=!1 a.audioOnlyMode_=!1 a.audioPosterMode_=!1 a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]} if(!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?") a.tag=i a.tagAttributes=i&&Pa(i) a.language(a.options_.language) if(n.languages){var u={} Object.getOwnPropertyNames(n.languages).forEach((function(e){u[e.toLowerCase()]=n.languages[e]})) a.languages_=u}else a.languages_=t.prototype.options_.languages a.resetCache_() a.poster_=n.poster||"" a.controls_=!!n.controls i.controls=!1 i.removeAttribute("controls") a.changingSrc_=!1 a.playCallbacks_=[] a.playTerminatedQueue_=[] i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay) n.plugins&&Object.keys(n.plugins).forEach((function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist')})) a.scrubbing_=!1 a.el_=a.createEl() Ps(N(a),{eventBusKey:"el_"}) if(a.fsApi_.requestFullscreen){us(L,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_) a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)}a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_) var l=Ds(a.options_) n.plugins&&Object.keys(n.plugins).forEach((function(e){a[e](n.plugins[e])})) n.debug&&a.debug(!0) a.options_.playerOptions=l a.middleware_=[] a.playbackRates(n.playbackRates) a.initChildren() a.isAudio("audio"===i.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") ua&&a.addClass("vjs-touch-enabled") da||a.addClass("vjs-workinghover") t.players[a.id_]=N(a) var c=Ir.split(".")[0] a.addClass("vjs-v"+c) a.userActive(!0) a.reportUserActivity() a.one("play",(function(e){return a.listenForUserActivity_(e)})) a.on("stageclick",(function(e){return a.handleStageClick_(e)})) a.on("keydown",(function(e){return a.handleKeyDown(e)})) a.on("languagechange",(function(e){return a.handleLanguagechange(e)})) a.breakpoints(a.options_.breakpoints) a.responsive(a.options_.responsive) a.on("ready",(function(){a.audioPosterMode(a.options_.audioPosterMode) a.audioOnlyMode(a.options_.audioOnlyMode)})) return a}var i=t.prototype i.dispose=function(){var i=this this.trigger("dispose") this.off("dispose") ls(L,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_) ls(L,"keydown",this.boundFullWindowOnEscKey_) if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_) this.styleEl_=null}t.players[this.id_]=null this.tag&&this.tag.player&&(this.tag.player=null) this.el_&&this.el_.player&&(this.el_.player=null) if(this.tech_){this.tech_.dispose() this.isPosterFromTech_=!1 this.poster_=""}this.playerElIngest_&&(this.playerElIngest_=null) this.tag&&(this.tag=null) xo[this.id()]=null wo.names.forEach((function(e){var t=wo[e],n=i[t.getterName]() n&&n.off&&n.off()})) e.prototype.dispose.call(this)} i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase() n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div")) var a=Pa(i) if(r){t=this.el_=i i=this.tag=L.createElement("video") for(;t.children.length;)i.appendChild(t.firstChild) Sa(t,"video-js")||Ea(t,"video-js") t.appendChild(i) n=this.playerElIngest_=t Object.keys(t).forEach((function(e){try{i[e]=t[e]}catch(e){}}))}i.setAttribute("tabindex","-1") a.tabindex="-1" if(aa||na&&oa){i.setAttribute("role","application") a.role="application"}i.removeAttribute("width") i.removeAttribute("height") "width"in a&&delete a.width "height"in a&&delete a.height Object.getOwnPropertyNames(a).forEach((function(e){r&&"class"===e||t.setAttribute(e,a[e]) r&&i.setAttribute(e,a[e])})) i.playerId=i.id i.id+="_html5_api" i.className="vjs-tech" i.player=t.player=this this.addClass("vjs-paused") if(!0!==x.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ja("vjs-styles-dimensions") var s=Wa(".vjs-styles-defaults"),o=Wa("head") o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1 this.fluid_=!1 this.width(this.options_.width) this.height(this.options_.height) this.fill(this.options_.fill) this.fluid(this.options_.fluid) this.aspectRatio(this.options_.aspectRatio) this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin) for(var u=i.getElementsByTagName("a"),l=0;l0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0] e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300 t=void 0!==this.height_?this.height_:e*r i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions" this.addClass(i) Za(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid {\n padding-top: "+100*r+"%;\n }\n ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el() if(o){a>=0&&(o.width=a) s>=0&&(o.height=s)}}} i.loadTech_=function(e,t){var i=this this.tech_&&this.unloadTech_() var n=Ls(e),r=e.charAt(0).toLowerCase()+e.slice(1) if("Html5"!==n&&this.tag){Io.getTech("Html5").disposeMediaElement(this.tag) this.tag.player=null this.tag=null}this.techName_=n this.isReady_=!1 var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1) var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,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"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise} wo.names.forEach((function(e){var t=wo[e] s[t.getterName]=i[t.privateName]})) Hr(s,this.options_[n]) Hr(s,this.options_[r]) Hr(s,this.options_[e.toLowerCase()]) this.tag&&(s.tag=this.tag) t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime) var o=Io.getTech(e) if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'") this.tech_=new o(s) this.tech_.ready(gs(this,this.handleTechReady_),!0) Ys(this.textTracksJson_||[],this.tech_) wl.forEach((function(e){i.on(i.tech_,e,(function(t){return i["handleTech"+Ls(e)+"_"](t)}))})) Object.keys(Il).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Il[e]+"_"].bind(i),event:t}):i["handleTech"+Il[e]+"_"](t)}))})) this.on(this.tech_,"loadstart",(function(e){return i.handleTechLoadStart_(e)})) this.on(this.tech_,"sourceset",(function(e){return i.handleTechSourceset_(e)})) this.on(this.tech_,"waiting",(function(e){return i.handleTechWaiting_(e)})) this.on(this.tech_,"ended",(function(e){return i.handleTechEnded_(e)})) this.on(this.tech_,"seeking",(function(e){return i.handleTechSeeking_(e)})) this.on(this.tech_,"play",(function(e){return i.handleTechPlay_(e)})) this.on(this.tech_,"firstplay",(function(e){return i.handleTechFirstPlay_(e)})) this.on(this.tech_,"pause",(function(e){return i.handleTechPause_(e)})) this.on(this.tech_,"durationchange",(function(e){return i.handleTechDurationChange_(e)})) this.on(this.tech_,"fullscreenchange",(function(e,t){return i.handleTechFullscreenChange_(e,t)})) this.on(this.tech_,"fullscreenerror",(function(e,t){return i.handleTechFullscreenError_(e,t)})) this.on(this.tech_,"enterpictureinpicture",(function(e){return i.handleTechEnterPictureInPicture_(e)})) this.on(this.tech_,"leavepictureinpicture",(function(e){return i.handleTechLeavePictureInPicture_(e)})) this.on(this.tech_,"error",(function(e){return i.handleTechError_(e)})) this.on(this.tech_,"posterchange",(function(e){return i.handleTechPosterChange_(e)})) this.on(this.tech_,"textdata",(function(e){return i.handleTechTextData_(e)})) this.on(this.tech_,"ratechange",(function(e){return i.handleTechRateChange_(e)})) this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_) this.usingNativeControls(this.techGet_("controls")) this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_() this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||ka(this.tech_.el(),this.el()) if(this.tag){this.tag.player=null this.tag=null}} i.unloadTech_=function(){var e=this wo.names.forEach((function(t){var i=wo[t] e[i.privateName]=e[i.getterName]()})) this.textTracksJson_=Xs(this.tech_) this.isReady_=!1 this.tech_.dispose() this.tech_=!1 if(this.isPosterFromTech_){this.poster_="" this.trigger("posterchange")}this.isPosterFromTech_=!1} i.tech=function(e){void 0===e&&Ur.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n") return this.tech_} i.addTechControlsListeners_=function(){this.removeTechControlsListeners_() this.on(this.tech_,"click",this.boundHandleTechClick_) this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_) this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_) this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_) this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_) this.on(this.tech_,"tap",this.boundHandleTechTap_)} i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_) this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_) this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_) this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_) this.off(this.tech_,"click",this.boundHandleTechClick_) this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)} i.handleTechReady_=function(){this.triggerReady() this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume) this.handleTechPosterChange_() this.handleTechDurationChange_()} i.handleTechLoadStart_=function(){this.removeClass("vjs-ended") this.removeClass("vjs-seeking") this.error(null) this.handleTechDurationChange_() if(this.paused()){this.hasStarted(!1) this.trigger("loadstart")}else{this.trigger("loadstart") this.trigger("firstplay")}this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())} i.manualAutoplay_=function(e){var t=this if(this.tech_&&"string"==typeof e){var i,n=function(){var e=t.muted() t.muted(!0) var i=function(){t.muted(e)} t.playTerminatedQueue_.push(i) var n=t.play() if(Gs(n))return n.catch((function(e){i() throw new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))} "any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():n():Gs(i=this.play())&&(i=i.catch(n)) if(Gs(i))return i.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}} i.updateSourceCaches_=function(e){void 0===e&&(e="") var t=e,i="" if("string"!=typeof t){t=e.src i=e.type}this.cache_.source=this.cache_.source||{} this.cache_.sources=this.cache_.sources||[] t&&!i&&(i=function(e,t){if(!t)return"" if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type var i=e.cache_.sources.filter((function(e){return e.src===t})) if(i.length)return i[0].type for(var n=e.$$("source"),r=0;r0&&0===this.cache_.lastPlaybackRate){this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})) this.queuedCallbacks_=[]}this.cache_.lastPlaybackRate=this.tech_.playbackRate() this.trigger("ratechange")} i.handleTechWaiting_=function(){var e=this this.addClass("vjs-waiting") this.trigger("waiting") var t=this.currentTime() this.on("timeupdate",(function i(){if(t!==e.currentTime()){e.removeClass("vjs-waiting") e.off("timeupdate",i)}}))} i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting") this.trigger("canplay")} i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting") this.trigger("canplaythrough")} i.handleTechPlaying_=function(){this.removeClass("vjs-waiting") this.trigger("playing")} i.handleTechSeeking_=function(){this.addClass("vjs-seeking") this.trigger("seeking")} i.handleTechSeeked_=function(){this.removeClass("vjs-seeking") this.removeClass("vjs-ended") this.trigger("seeked")} i.handleTechFirstPlay_=function(){if(this.options_.starttime){Ur.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")} i.handleTechPause_=function(){this.removeClass("vjs-playing") this.addClass("vjs-paused") this.trigger("pause")} i.handleTechEnded_=function(){this.addClass("vjs-ended") this.removeClass("vjs-waiting") if(this.options_.loop){this.currentTime(0) this.play()}else this.paused()||this.pause() this.trigger("ended")} i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))} i.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?zs(this.play()):this.pause()))} i.handleTechDoubleClick_=function(e){if(this.controls_){Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}} i.handleTechTap_=function(){this.userActive(!this.userActive())} i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()} i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()} i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()} i.handleStageClick_=function(){this.reportUserActivity()} i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")} i.documentFullscreenChange_=function(e){var t=e.target.player if(!t||t===this){var i=this.el(),n=L[this.fsApi_.fullscreenElement]===i !n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)) this.isFullscreen(n)}} i.handleTechFullscreenChange_=function(e,t){var i=this if(t){if(t.nativeIOSFullscreen){this.addClass("vjs-ios-native-fs") this.tech_.one("webkitendfullscreen",(function(){i.removeClass("vjs-ios-native-fs")}))}this.isFullscreen(t.isFullscreen)}} i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)} i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")} i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)} i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)} i.handleTechError_=function(){var e=this.tech_.error() this.error(e)} i.handleTechTextData_=function(){var e=null arguments.length>1&&(e=arguments[1]) this.trigger("textdata",e)} i.getCache=function(){return this.cache_} i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}} i.techCall_=function(e,t){this.ready((function(){if(e in Ro)return function(e,t,i,n){return t[i](e.reduce(No(i),n))}(this.middleware_,this.tech_,e,t) if(e in Mo)return Lo(this.middleware_,this.tech_,e,t) try{this.tech_&&this.tech_[e](t)}catch(e){Ur(e) throw e}}),!0)} i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Do)return function(e,t,i){return e.reduceRight(No(i),t[i]())}(this.middleware_,this.tech_,e) if(e in Mo)return Lo(this.middleware_,this.tech_,e) try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e]){Ur("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t) throw t}if("TypeError"===t.name){Ur("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t) this.tech_.isReady_=!1 throw t}Ur(t) throw t}}} i.play=function(){var e=this,t=this.options_.Promise||x.Promise return t?new t((function(t){e.play_(t)})):this.play_()} i.play_=function(e){var t=this void 0===e&&(e=zs) this.playCallbacks_.push(e) var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())) if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_) this.waitToPlay_=null}if(this.isReady_&&i){var n=this.techGet_("play") null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)}else{this.waitToPlay_=function(e){t.play_()} this.one(["ready","loadstart"],this.waitToPlay_) i||!ha&&!da||this.load()}} i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0) this.playTerminatedQueue_=[] e.forEach((function(e){e()}))} i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0) this.playCallbacks_=[] this.playTerminatedQueue_=[] t.forEach((function(t){t(e)}))} i.pause=function(){this.techCall_("pause")} i.paused=function(){return!1!==this.techGet_("paused")} i.played=function(){return this.techGet_("played")||Vs(0,0)} i.scrubbing=function(e){if(void 0===e)return this.scrubbing_ this.scrubbing_=!!e this.techCall_("setScrubbing",this.scrubbing_) e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")} i.currentTime=function(e){if(void 0===e){this.cache_.currentTime=this.techGet_("currentTime")||0 return this.cache_.currentTime}e<0&&(e=0) if(this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_){this.techCall_("setCurrentTime",e) this.cache_.initTime=0}else{this.cache_.initTime=e this.off("canplay",this.boundApplyInitTime_) this.one("canplay",this.boundApplyInitTime_)}} i.applyInitTime_=function(){this.currentTime(this.cache_.initTime)} i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0) if(e!==this.cache_.duration){this.cache_.duration=e e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live") isNaN(e)||this.trigger("durationchange")}} i.remainingTime=function(){return this.duration()-this.currentTime()} i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())} i.buffered=function(){var e=this.techGet_("buffered") e&&e.length||(e=Vs(0,0)) return e} i.bufferedPercent=function(){return Hs(this.buffered(),this.duration())} i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1) i>t&&(i=t) return i} i.volume=function(e){var t if(void 0===e){t=parseFloat(this.techGet_("volume")) return isNaN(t)?1:t}t=Math.max(0,Math.min(1,parseFloat(e))) this.cache_.volume=t this.techCall_("setVolume",t) t>0&&this.lastVolume_(t)} i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1 this.techCall_("setMuted",e)} i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1} i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume this.cache_.lastVolume=e} i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1} i.isFullscreen=function(e){if(void 0===e)return this.isFullscreen_ var t=this.isFullscreen_ this.isFullscreen_=Boolean(e) this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange") this.toggleFullscreenClass_()} i.requestFullscreen=function(e){var t=this.options_.Promise||x.Promise if(t){var i=this return new t((function(t,n){function r(){i.off("fullscreenerror",s) i.off("fullscreenchange",a)}function a(){r() t()}function s(e,t){r() n(t)}i.one("fullscreenchange",a) i.one("fullscreenerror",s) var o=i.requestFullscreenHelper_(e) if(o){o.then(r,r) o.then(t,n)}}))}return this.requestFullscreenHelper_()} i.requestFullscreenHelper_=function(e){var t,i=this if(!this.fsApi_.prefixed){t=this.options_.fullscreen&&this.options_.fullscreen.options||{} void 0!==e&&(t=e)}if(this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t) n&&n.then((function(){return i.isFullscreen(!0)}),(function(){return i.isFullscreen(!1)})) return n}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()} i.exitFullscreen=function(){var e=this.options_.Promise||x.Promise if(e){var t=this return new e((function(e,i){function n(){t.off("fullscreenerror",a) t.off("fullscreenchange",r)}function r(){n() e()}function a(e,t){n() i(t)}t.one("fullscreenchange",r) t.one("fullscreenerror",a) var s=t.exitFullscreenHelper_() if(s){s.then(n,n) s.then(e,i)}}))}return this.exitFullscreenHelper_()} i.exitFullscreenHelper_=function(){var e=this if(this.fsApi_.requestFullscreen){var t=L[this.fsApi_.exitFullscreen]() t&&zs(t.then((function(){return e.isFullscreen(!1)}))) return t}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()} i.enterFullWindow=function(){this.isFullscreen(!0) this.isFullWindow=!0 this.docOrigOverflow=L.documentElement.style.overflow us(L,"keydown",this.boundFullWindowOnEscKey_) L.documentElement.style.overflow="hidden" Ea(L.body,"vjs-full-window") this.trigger("enterFullWindow")} i.fullWindowOnEscKey=function(e){M.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())} i.exitFullWindow=function(){this.isFullscreen(!1) this.isFullWindow=!1 ls(L,"keydown",this.boundFullWindowOnEscKey_) L.documentElement.style.overflow=this.docOrigOverflow Ca(L.body,"vjs-full-window") this.trigger("exitFullWindow")} i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture") this.techCall_("setDisablePictureInPicture",e) this.options_.disablePictureInPicture=e this.trigger("disablepictureinpicturechanged")} i.isInPictureInPicture=function(e){if(void 0===e)return!!this.isInPictureInPicture_ this.isInPictureInPicture_=!!e this.togglePictureInPictureClass_()} i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in L&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")} i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in L)return L.exitPictureInPicture()} i.handleKeyDown=function(e){var t=this.options_.userActions if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase() if(e.isContentEditable)return!0 if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type) return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}} i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return M.isEventKey(e,"f")}:i,r=t.muteKey,a=void 0===r?function(e){return M.isEventKey(e,"m")}:r,s=t.playPauseKey,o=void 0===s?function(e){return M.isEventKey(e,"k")||M.isEventKey(e,"Space")}:s if(n.call(this,e)){e.preventDefault() e.stopPropagation() var u=Bs.getComponent("FullscreenToggle") !1!==L[this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e)}else if(a.call(this,e)){e.preventDefault() e.stopPropagation() Bs.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(o.call(this,e)){e.preventDefault() e.stopPropagation() Bs.getComponent("PlayToggle").prototype.handleClick.call(this,e)}} i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1)return i.handleSrc_(n.slice(1)) i.changingSrc_=!1 i.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0) i.triggerReady()}else{a=r,s=i.tech_,a.forEach((function(e){return e.setTech&&e.setTech(s)})) var a,s}})) if(this.options_.retryOnError&&n.length>1){var r=function(){i.error(null) i.handleSrc_(n.slice(1),!0)},a=function(){i.off("error",r)} this.one("error",r) this.one("playing",a) this.resetRetryOnError_=function(){i.off("error",r) i.off("playing",a)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)} i.src=function(e){return this.handleSrc_(e,!1)} i.src_=function(e){var t,i,n=this,r=this.selectSource([e]) if(!r)return!0 if(!(t=r.tech,i=this.techName_,Ls(t)===Ls(i))){this.changingSrc_=!0 this.loadTech_(r.tech,r.source) this.tech_.ready((function(){n.changingSrc_=!1})) return!1}this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src) this.changingSrc_=!1}),!0) return!1} i.load=function(){this.techCall_("load")} i.reset=function(){var e=this,t=this.options_.Promise||x.Promise if(this.paused()||!t)this.doReset_() else{zs(this.play().then((function(){return e.doReset_()})))}} i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text") this.resetCache_() this.poster("") this.loadTech_(this.options_.techOrder[0],null) this.techCall_("reset") this.resetControlBarUI_() bs(this)&&this.trigger("playerreset")} i.resetControlBarUI_=function(){this.resetProgressBar_() this.resetPlaybackRate_() this.resetVolumeBar_()} i.resetProgressBar_=function(){this.currentTime(0) var e=this.controlBar,t=e.durationDisplay,i=e.remainingTimeDisplay t&&t.updateContent() i&&i.updateContent()} i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()) this.handleTechRateChange_()} i.resetVolumeBar_=function(){this.volume(1) this.trigger("volumechange")} i.currentSources=function(){var e=this.currentSource(),t=[] 0!==Object.keys(e).length&&t.push(e) return this.cache_.sources||t} i.currentSource=function(){return this.cache_.source||{}} i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""} i.currentType=function(){return this.currentSource()&&this.currentSource().type||""} i.preload=function(e){if(void 0===e)return this.techGet_("preload") this.techCall_("setPreload",e) this.options_.preload=e} i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1 var t if("string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay){this.options_.autoplay=e this.manualAutoplay_("string"==typeof e?e:"play") t=!1}else this.options_.autoplay=!!e t=void 0===t?this.options_.autoplay:t this.tech_&&this.techCall_("setAutoplay",t)} i.playsinline=function(e){if(void 0!==e){this.techCall_("setPlaysinline",e) this.options_.playsinline=e return this}return this.techGet_("playsinline")} i.loop=function(e){if(void 0===e)return this.techGet_("loop") this.techCall_("setLoop",e) this.options_.loop=e} i.poster=function(e){if(void 0===e)return this.poster_ e||(e="") if(e!==this.poster_){this.poster_=e this.techCall_("setPoster",e) this.isPosterFromTech_=!1 this.trigger("posterchange")}} i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"" if(e!==this.poster_){this.poster_=e this.isPosterFromTech_=!0 this.trigger("posterchange")}}} i.controls=function(e){if(void 0===e)return!!this.controls_ e=!!e if(this.controls_!==e){this.controls_=e this.usingNativeControls()&&this.techCall_("setControls",e) if(this.controls_){this.removeClass("vjs-controls-disabled") this.addClass("vjs-controls-enabled") this.trigger("controlsenabled") this.usingNativeControls()||this.addTechControlsListeners_()}else{this.removeClass("vjs-controls-enabled") this.addClass("vjs-controls-disabled") this.trigger("controlsdisabled") this.usingNativeControls()||this.removeTechControlsListeners_()}}} i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_ e=!!e if(this.usingNativeControls_!==e){this.usingNativeControls_=e if(this.usingNativeControls_){this.addClass("vjs-using-native-controls") this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls") this.trigger("usingcustomcontrols")}}} i.error=function(e){var t=this if(void 0===e)return this.error_||null xr("beforeerror").forEach((function(i){var n=i(t,e) qr(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:t.log.error("please return a value that MediaError expects in beforeerror hooks")})) if(this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function(){this.error(e)} this.options_.suppressNotSupportedError=!1 this.any(["click","touchstart"],i) this.one("loadstart",(function(){this.off(["click","touchstart"],i)}))}else if(null!==e){this.error_=new qs(e) this.addClass("vjs-error") Ur.error("(CODE:"+this.error_.code+" "+qs.errorTypes[this.error_.code]+")",this.error_.message,this.error_) this.trigger("error") xr("error").forEach((function(e){return e(t,t.error_)}))}else{this.error_=e this.removeClass("vjs-error") this.errorDisplay&&this.errorDisplay.close()}} i.reportUserActivity=function(e){this.userActivity_=!0} i.userActive=function(e){if(void 0===e)return this.userActive_ if((e=!!e)!==this.userActive_){this.userActive_=e if(this.userActive_){this.userActivity_=!0 this.removeClass("vjs-user-inactive") this.addClass("vjs-user-active") this.trigger("useractive")}else{this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation() e.preventDefault()})) this.userActivity_=!1 this.removeClass("vjs-user-active") this.addClass("vjs-user-inactive") this.trigger("userinactive")}}} i.listenForUserActivity_=function(){var e,t,i,n=gs(this,this.reportUserActivity),r=function(t){n() this.clearInterval(e)} this.on("mousedown",(function(){n() this.clearInterval(e) e=this.setInterval(n,250)})) this.on("mousemove",(function(e){if(e.screenX!==t||e.screenY!==i){t=e.screenX i=e.screenY n()}})) this.on("mouseup",r) this.on("mouseleave",r) var a,s=this.getChild("controlBar") if(s&&!da&&!Jr){s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout) this.player().options_.inactivityTimeout=0})) s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))}this.on("keydown",n) this.on("keyup",n) this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1 this.userActive(!0) this.clearTimeout(a) var e=this.options_.inactivityTimeout e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)} i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1 this.techCall_("setPlaybackRate",e)} i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1} i.isAudio=function(e){if(void 0===e)return!!this.isAudio_ this.isAudio_=!!e} i.enableAudioOnlyUI_=function(){var e=this this.addClass("vjs-audio-only-mode") var t=this.children(),i=this.getChild("ControlBar"),n=i&&i.currentHeight() t.forEach((function(t){if(t!==i&&t.el_&&!t.hasClass("vjs-hidden")){t.hide() e.audioOnlyCache_.hiddenChildren.push(t)}})) this.audioOnlyCache_.playerHeight=this.currentHeight() this.height(n) this.trigger("audioonlymodechange")} i.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode") this.audioOnlyCache_.hiddenChildren.forEach((function(e){return e.show()})) this.height(this.audioOnlyCache_.playerHeight) this.trigger("audioonlymodechange")} i.audioOnlyMode=function(e){var t=this if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_ this.audioOnlyMode_=e var i=this.options_.Promise||x.Promise if(i){if(e){var n=[] this.isInPictureInPicture()&&n.push(this.exitPictureInPicture()) this.isFullscreen()&&n.push(this.exitFullscreen()) this.audioPosterMode()&&n.push(this.audioPosterMode(!1)) return i.all(n).then((function(){return t.enableAudioOnlyUI_()}))}return i.resolve().then((function(){return t.disableAudioOnlyUI_()}))}if(e){this.isInPictureInPicture()&&this.exitPictureInPicture() this.isFullscreen()&&this.exitFullscreen() this.enableAudioOnlyUI_()}else this.disableAudioOnlyUI_()} i.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide() this.addClass("vjs-audio-poster-mode") this.trigger("audiopostermodechange")} i.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show() this.removeClass("vjs-audio-poster-mode") this.trigger("audiopostermodechange")} i.audioPosterMode=function(e){var t=this if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_ this.audioPosterMode_=e var i=this.options_.Promise||x.Promise if(i){if(e){if(this.audioOnlyMode()){return this.audioOnlyMode(!1).then((function(){t.enablePosterModeUI_()}))}return i.resolve().then((function(){t.enablePosterModeUI_()}))}return i.resolve().then((function(){t.disablePosterModeUI_()}))}if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1) this.enablePosterModeUI_()}else this.disablePosterModeUI_()} i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)} i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)} i.removeRemoteTextTrack=function(e){void 0===e&&(e={}) var t=e.track t||(t=e) if(this.tech_)return this.tech_.removeRemoteTextTrack(t)} i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")} i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0} i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0} i.language=function(e){if(void 0===e)return this.language_ if(this.language_!==String(e).toLowerCase()){this.language_=String(e).toLowerCase() bs(this)&&this.trigger("languagechange")}} i.languages=function(){return Ds(t.prototype.options_.languages,this.languages_)} i.toJSON=function(){var e=Ds(this.options_),t=e.tracks e.tracks=[] for(var i=0;i