"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[895],{98390:(e,t,n)=>{n.d(t,{Ay:()=>K});var i=n(77116),o=n(85821),r=n(65907),a=n(60877),s=n(96865),u=n(57759),c=n(25202),l=n(93425),f=n(87429),h=n(4682),p=n(16216),d=n(55384),y=n(43507);function g(e,t){for(var n=0;nt){n=o;break}}if(!(n<0)){i._seiQueue.splice(0,n);for(var s=i._seiQueue[0];s;){var u,c;if(!s)break;var l=(null===(u=s)||void 0===u?void 0:u.time)-t;if(l>=.05&&l<100)break;i._seiQueue.shift(),null===(c=i._player)||void 0===c||c.emit(_,s.data),s=i._seiQueue[0]}}}}else clearInterval(i._timer)})),this._player=t,this._loudnessParserOn=n}var t,n;return t=e,(n=[{key:"updateBaseDts",value:function(e){this._baseDts=e||1/0,this._bootCheckEmitSEI()}},{key:"streamBreaked",value:function(e){this._jumpGap=e}},{key:"append",value:function(e){this._baseDts!==1/0&&0!==this._baseDts||(this._baseDts=e.dts);var t,n=this._baseDts===1/0?0:(e.dts+this._jumpGap-this._baseDts)/1e3;if(n<2)return null===(t=this._player)||void 0===t||t.emit(_,e),void(this._loudnessParserOn&&this._textDecoder&&this._parseLoudness(e));this._seiQueue.push({time:n,data:e})}},{key:"_bootCheckEmitSEI",value:function(){this._timer&&clearInterval(this._timer),this._timer=setInterval(this._checkEmitSEI,25)}},{key:"_parseLoudness",value:function(e){if(101===e.code)try{var t,n=this._textDecoder.decode(e.content),i=JSON.parse(n).loudness;if(!i)return;i.sourcePeak=Number(i.sourcePeak),i.sourceLuft=Number(i.sourceLuft),i.sourceIntegrated=Number(i.sourceIntegrated),i.sourceShorterm=Number(i.sourceShorterm),i.sourceMomentary=Number(i.sourceMomentary),null===(t=this._player)||void 0===t||t.emit("SEI_LOUDNESS",i)}catch(e){}}},{key:"destroy",value:function(){clearInterval(this._timer),this._player=null,this._textDecoder=null,this._seiQueue=[]}}])&&w(t.prototype,n),e}();function O(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0;this._ttfb=e}},{key:"addDemuxStart",value:function(){this._demuxQueue.push(Date.now()),this._demuxEndQueue.pop()}},{key:"addDemuxEnd",value:function(){this._demuxEndQueue.push(Date.now())}},{key:"addBufferAppendStart",value:function(){this._bufferAppendQueue.push(Date.now())}},{key:"accumulateDemuxCost",value:function(){var e=this._demuxQueue.pop();e&&(this._demuxCost+=Date.now()-e)}},{key:"accumulateRemuxCost",value:function(){var e=this._demuxEndQueue.pop();e&&(this._remuxCost+=Date.now()-e)}},{key:"accumulateBufferAppendCost",value:function(){var e=this._bufferAppendQueue.shift();e&&(this._appendBufferCost+=Date.now()-e,this._bufferAppendQueue=[])}},{key:"getStats",value:function(){return{ttfbCost:this._ttfb,demuxCost:this._demuxCost,remuxCost:this._remuxCost,appendCost:this._appendBufferCost}}}],n&&O(t.prototype,n),e}();function C(e,t){for(var n=0;n1e3&&(n._renderFps=n._getVideoRenderFps(),n._lastTimeupdate=e)})),this._core=t,this._bindEvents()}var t,n;return t=e,(n=[{key:"fps",get:function(){var e,t,n,i=null===(e=this._core)||void 0===e||null===(t=e.videoMeta)||void 0===t?void 0:t.frameRate;if(!i)return 0;if(i.fps<100)return i.fps;var o=null===(n=this._core)||void 0===n?void 0:n.videoMeta.refSampleDuration;return Math.round(1e3/o)}},{key:"getStats",value:function(){return{waitingCount:this._waitingCount,stallTime:this._stallTime,renderFps:this._renderFps,fps:this.fps}}},{key:"_bindEvents",value:function(){var e,t,n,i,o,r,a,s;null===(e=this._core)||void 0===e||null===(t=e._player)||void 0===t||t.on("waiting",this._onWaiting),null===(n=this._core)||void 0===n||null===(i=n._player)||void 0===i||i.on("playing",this._onPlaying),null===(o=this._core)||void 0===o||null===(r=o._player)||void 0===r||r.on("pause",this._onPause),null===(a=this._core)||void 0===a||null===(s=a._player)||void 0===s||s.on("timeupdate",this._onTimeupdate)}},{key:"_getVideoRenderFps",value:function(){var e,t,n=null===(e=this._core)||void 0===e||null===(t=e._player)||void 0===t?void 0:t.video;if(!n||!n.getVideoPlaybackQuality)return 0;if(4!==n.readyState||n.paused)return 0;var i=n.getVideoPlaybackQuality(),o=i.creationTime,r=i.totalVideoFrames,a=Math.round((r-this._totalFrame)/(o-this._lastCreationTime)*1e3);return this._totalFrame=r,this._lastCreationTime=o,a}},{key:"destroy",value:function(){var e,t,n,i,o,r,a,s;null===(e=this._core)||void 0===e||null===(t=e._player)||void 0===t||t.off("waiting",this._onWaiting),null===(n=this._core)||void 0===n||null===(i=n._player)||void 0===i||i.off("pause",this._onPause),null===(o=this._core)||void 0===o||null===(r=o._player)||void 0===r||r.off("playing",this._onPlaying),null===(a=this._core)||void 0===a||null===(s=a._player)||void 0===s||s.off("timeupdate",this._onTimeupdate),this._core=null,this._waitingCount=0,this._stallTime=0}}])&&C(t.prototype,n),e}();function R(e,t){for(var n=0;n6)return void this.pause();(null===(s=this.preSourceBufer)||void 0===s||null===(u=s.video)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.length)>100&&this.pause()}catch(e){}}},{key:"_handleTTFB",value:function(e){var t,n,i,o;this._ttfbEmit=!0,this._playStartTime=(null===(t=this._player)||void 0===t||null===(n=t.video)||void 0===n?void 0:n.currentTime)||0,null===(i=this._transCostAnalyse)||void 0===i||i.addTTFB(null==e?void 0:e.elapsed),null===(o=this._player)||void 0===o||o.emit(m,e)}},{key:"_handleLoaderDataLoaded",value:function(){var e;if(!this._ttfbEmit){this._ttfbEmit=!0;var t,n,i=this.loader,o=i&&i.ttfbInfo;o&&(null===(t=this._transCostAnalyse)||void 0===t||t.addTTFB(o.elapsed),null===(n=this._player)||void 0===n||n.emit(m,o))}null===(e=this._transCostAnalyse)||void 0===e||e.addDemuxStart(),this.emitTo("FLV_DEMUXER",D.DEMUX_START)}},{key:"_handleLoadComplete",value:function(e){var t,n,i,o=this,r=this._player;if(r){this._endedStatus={status:e,readyStateWhenComplete:null===(t=r.video)||void 0===t?void 0:t.readyState,endOfStream:(null===(n=r.video)||void 0===n?void 0:n.readyState)>2},this.pause(),(null===(i=r.video)||void 0===i?void 0:i.readyState)>2&&this._endOfStream();var a=0;!function e(){if(r&&r.video&&!r.ended){if(r.currentTime===a)return o._updateEndedStauts(r),r.pause(),r.emit("ended"),r.constructor.STATE_CLASS&&(r.removeClass(r.constructor.STATE_CLASS.ENTER),r.removeClass(r.constructor.STATE_CLASS.LOADING)),void(r=null);a=r.currentTime,setTimeout(e,500)}}()}}},{key:"_updateEndedStauts",value:function(e){this._endedStatus.mock=!0,this._endedStatus.currentTime=e.video.currentTime;var t=e.video.buffered.length;if(t)try{this._endedStatus.bufferEnd=e.video.buffered.end(t-1)}catch(e){}}},{key:"_handleMetadataParsed",value:function(e){var t,n=this.tracks["".concat(e,"Track")].meta,i=!1;if("video"===e)try{i=this._checkChangeCodec(null==n?void 0:n.codec)}catch(e){return this.emit(N.MSE_CHANGE_CODEC_ERROR,e||new Error("change video codec error")),void(this._mseInChangeCodecError=!0)}this.emit(L.REMUX_METADATA,e,i),null===(t=this._player)||void 0===t||t.emit(b,e,n)}},{key:"_checkChangeCodec",value:function(e){var t,n=(null===(t=this.mse)||void 0===t?void 0:t.videoCodec)&&this.mse.videoCodec.split(".")[0],i=e&&e.split(".")[0];return!(!n||!i||n===i||(this.mse.changeVideoCodecType(e),s.A.warn("changeVideoCodecType!! ".concat(n," -> ").concat(i)),0))}},{key:"_handleSEIParsed",value:function(e){var t,n;this._pluginConfig.seiOnDemand?null===(n=this._seiOnDemand)||void 0===n||n.append(e):null===(t=this._player)||void 0===t||t.emit(_,e)}},{key:"_handleDemuxComplete",value:function(){var e,t;this._mseInChangeCodecError||(null===(e=this._transCostAnalyse)||void 0===e||e.addDemuxEnd(),null===(t=this._transCostAnalyse)||void 0===t||t.accumulateDemuxCost(),this.emit(L.REMUX_MEDIA))}},{key:"_handleAppendInitSegment",value:function(){var e;this.state.initSegmentArrived=!0,null===(e=this._transCostAnalyse)||void 0===e||e.addBufferAppendStart(),this.mse.addSourceBuffers()}},{key:"_handleMediaSegment",value:function(e){var t,n;"audio"===e&&(null===(t=this._transCostAnalyse)||void 0===t||t.accumulateRemuxCost(),null===(n=this._transCostAnalyse)||void 0===n||n.addBufferAppendStart()),this.mse.addSourceBuffers(),this.mse.doAppend()}},{key:"_handleSourceUpdateEnd",value:function(){var e;null===(e=this._transCostAnalyse)||void 0===e||e.accumulateBufferAppendCost();var t=this._player.currentTime,n=this._player.video,i=this._player.config.preloadTime||this._pluginConfig.preloadTime,o=n.buffered.length;if(0!==o){try{var r=n.buffered.end(o-1),a=n.buffered.start(o-1);o>1&&r-a>1&&a>this._player.currentTime&&(this._player.currentTime=a+.1),t-this._playStartTime>this._pluginConfig.chaseFrameStart&&r-t>2*i&&!this._player.paused&&(this._player.currentTime=r-i,this._player.emit("chaseframe",{bufferEnd:r,preloadTime:i}))}catch(e){}this.mse.doAppend(),(this._player.paused||this.urlSwitching)&&(this.urlSwitching=!1,this._handleTimeUpdate())}}},{key:"_handleTimeUpdate",value:function(){var e=this;if(this._player&&this._player.video){var t=this._player.currentTime,n=this._player.video,i=n.buffered;if(i&&i.length){var o=[0,0],r=n.currentTime;if(i)for(var a=0,s=i.length;a10||i.length>1){if(this.bufferClearTimer||!this.state.randomAccessPoints.length)return;for(var l=1/0,f=0;ft-10)break;l=h}this.mse.remove(Math.max(Math.min(l,t-10,c-10),.1),0),this.bufferClearTimer=setTimeout((function(){e.bufferClearTimer=null}),5e3)}}}}},{key:"_handleNetworkError",value:function(e,t){var n;this._inSwitching||(null===(n=this._player)||void 0===n||n.emit("error",{code:t.code,errorType:"network",type:"network",ex:"[".concat(e,"]: ").concat(t.message),errd:{}}),this._onError(j.LOADER_ERROR,e,t,!0))}},{key:"_handleFetchRetry",value:function(e,t){var n;null===(n=this._player)||void 0===n||n.emit("retry",Object.assign({tag:e},t))}},{key:"_detectLargeGap",value:function(e,t){var n,i;s.A.warn("detectLargeGap",e,t),"video"===e&&(null===(i=this._seiOnDemand)||void 0===i||i.streamBreaked(t)),null===(n=this._player)||void 0===n||n.emit("streamdiscontinue",e,t)}},{key:"_handleDemuxError",value:function(e,t,n){var i;void 0===n&&(n=!1),this.pause(),null===(i=this._player)||void 0===i||i.emit("error",{code:"31",errorType:"parse",type:"parse",ex:"[".concat(e,"]: ").concat(t?t.message:""),errd:{}}),this._onError(D.DEMUX_ERROR,e,t,n)}},{key:"_handleRemuxError",value:function(e,t){var n;this.pause(),null===(n=this._player)||void 0===n||n.emit("error",{code:"31",errorType:"parse",type:"parse",ex:"[".concat(e,"]: ").concat(t?t.message:""),errd:{}}),this._onError(L.Remuxer,e,t)}},{key:"_handleMseError",value:function(e,t,n){var i;void 0===n&&(n=!1),null===(i=this._player)||void 0===i||i.emit("error",{code:"31",errorType:"parse",type:"parse",ex:"[".concat(e,"]: ").concat(t?t.message:""),errd:{}}),this.pause(),this._onError(N.MSE_ERROR,e,t,n)}},{key:"_handleAddRAP",value:function(e){this.state.randomAccessPoints&&this.state.randomAccessPoints.push(e)}},{key:"_onError",value:function(e,t,n,i){var o,r={code:n.code,errorType:e,type:e,errorDetails:"[".concat(t,"]: ").concat(n?n.message:""),errorFatal:i||!1};null===(o=this._player)||void 0===o||o.emit("FLV_ERROR",r)}},{key:"_endOfStream",value:function(){var e;null===(e=this.mse)||void 0===e||e.endOfStream()}},{key:"load",value:function(){this.state.initSegmentArrived||this.loadData()}},{key:"onceKeyFrame",value:function(e){this.once(D.ISKEYFRAME,e)}},{key:"loadData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._player.config.url;this._player.preProcessUrl&&(e=this._player.preProcessUrl(e).url),this.loader&&(this.loader.finnalUrl=e);var t=this._player.config.retry||{},n=t.count,i=t.delay,o=void 0===n?this._pluginConfig.retryCount:n,r=void 0===i?this._pluginConfig.retryDelay:i;this.emit(j.LADER_START,e,{},{retryCount:o,retryDelay:r,loadTimeout:this._pluginConfig.loadTimeout,maxReaderInterval:this._pluginConfig.maxReaderInterval})}},{key:"pause",value:function(){var e,t=this.loader;t&&t.cancel(),null===(e=this._seiOnDemand)||void 0===e||e.destroy(),this._seiOnDemand=null}},{key:"setInSwitching",value:function(e){this._inSwitching=e}},{key:"destroyServices",value:function(){var e,t;null===(e=this._seiOnDemand)||void 0===e||e.destroy(),null===(t=this._stableStats)||void 0===t||t.destroy()}},{key:"destroy",value:function(){var e,t,n;null===(e=this._player)||void 0===e||e.off("timeupdate",this._handleTimeUpdate),this.mse=null,null===(t=this._seiOnDemand)||void 0===t||t.destroy(),null===(n=this._stableStats)||void 0===n||n.destroy(),this._seiOnDemand=null,this._stableStats=null,this.state.randomAccessPoints=[]}}],n&&R(t.prototype,n),e}();function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function U(e,t){for(var n=0;n1?e.pause():Promise.resolve(),t._destroyInternal().then((function(){t._bindPlayerEvents(),t.player&&(t.player.hasStart=!1)}))])})),W(G(t),"_pauseHandler",(function(){var e;null===(e=t.flv)||void 0===e||e.pause()})),W(G(t),"_definitionChangeHandler",(function(e){var n=e.to;t._switchURLInternal(n)})),W(G(t),"_switchURLHandler",(function(e,n){t._switchURLInternal(e,n)})),W(G(t),"_destroyHandler",(function(){return t._destroyInternal()})),W(G(t),"switchCancel",(function(){t.tmpContext&&(t.tmpContext.destroy(),t.tmpContext=null)})),t._bindPlayerEvents(),t.player.config.videoInit&&t._stopStreamWhenNotAutoPlay(),t}return t=f,n=[{key:"version",get:function(){return"3.0.0-alphatt.142-2"}},{key:"beforePlayerInit",value:function(){var e=this;this._initFlvCtr(),this.player.switchURL=this._switchURLHandler,this.player.switchCancel=this.switchCancel;try{i.Ay.defineGetterOrSetter(this.player,{__url:{get:function(){return e.mse.url},configurable:!0}})}catch(e){}}},{key:"_stopStreamWhenNotAutoPlay",value:function(){var e=this;this.playerConfig.url&&(this._stopFlv=function(){var t,n,i;null!==(t=e.playerConfig)&&void 0!==t&&t.autoplay||null===(n=e.player)||void 0===n||null===(i=n.video)||void 0===i||!i.paused||e._pauseHandler()},this.once(o.CANPLAY,this._stopFlv))}},{key:"_initFlvCtr",value:function(){var e;null===(e=this.context)||void 0===e||e.destroy();var t,n=this.config.preloader;this.config.preloader=null,n&&(t=n.resetContext(this.player,this.config)),t||(n=null,t=new a.A(this.player,this.config,Y));var i=t.registry("FLV_CONTROLLER",M)();this.flv=i,t.init(),this._bindFlvEvents(i),this.context=t,this.mse=i.mse,n||this._loadData(),this.emit("core_inited",i)}},{key:"_bindFlvEvents",value:function(){var e=this,t=this.flv;t.on(r.A.REMUX_EVENTS.DETECT_CHANGE_STREAM_DISCONTINUE,(function(t,n){var i;null===(i=e.player)||void 0===i||i.emit(r.A.REMUX_EVENTS.DETECT_CHANGE_STREAM_DISCONTINUE,t,n)})),t.on(r.A.MSE_EVENTS.MSE_WRONG_TRACK_ADD,this._onMseWrongTrackAddHandler)}},{key:"_bindPlayerEvents",value:function(){var e,t;null===(e=this.player)||void 0===e||e.useHooks("play",this._playHandler),null===(t=this.player)||void 0===t||t.useHooks("pause",this._pauseHandler),this._stopFlv&&(this.off(o.CANPLAY,this._stopFlv),this._stopFlv=null),this.on(o.DESTROY,this._destroyHandler),this.on(o.URL_CHANGE,this._switchURLHandler),this.on(o.DEFINITION_CHANGE,this._definitionChangeHandler)}},{key:"_loadData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.player.currentTime;this.player&&this.core&&this.core.load(e)}},{key:"_reloadStream",value:function(){var e=this;if(!this.player||!this.player.video)return Promise.resolve();this._destroyInternal().then((function(){e._bindPlayerEvents(),e.player&&(e.player.hasStart=!1,e.player.videoPlay())}))}},{key:"_reloadStreamSeamless",value:function(e,t,n){var i=this;if(this.context){var o=this.player.ended;this.switchCancel();var r=new a.A(this.player,this.config,Y);this.tmpContext=r;var s=this.context.getInstance("MP4_REMUXER").remuxer,u=s._dtsBase,c=s._videoDtsBase,l=s._audioDtsBase,f=s._isDtsBaseInited,h=r.registry("FLV_CONTROLLER",M)(this.mse,{remux:{_dtsBase:u,_videoDtsBase:c,_audioDtsBase:l,_isDtsBaseInited:f}});return r.init(),n&&(h.setInSwitching(!0),this.emit("switch_start",{url:e})),this._waitStreamReady(h,e,t,n).then((function(){var e;i.flv=h,i.mse.resetContext(r,!0),i.context.destroy(),i.context=r,i.tmpContext=null,null===(e=i.player)||void 0===e||e.emit("loadstart"),i._bindFlvEvents()})).catch((function(){var e,n;null==h||h.pause(),i.tmpContext=null,null!==(e=i.player)&&void 0!==e&&null!==(n=e.config)&&void 0!==n&&n.url&&(i.player.config.url=t)})),h.onceKeyFrame((function(){setTimeout((function(){null!=i&&i.player&&(i.player.currentTime+=0)}),150)})),h.loadData(e),o&&this.player.once("progress",(function(){return i.player.video.play().catch((function(){}))})),h}}},{key:"_waitStreamReady",value:function(e,t,n,i){var o=this;return new Promise((function(a,s){var u=3;e.once(r.A.LOADER_EVENTS.LOADER_TTFB,(function(t){var n;t.ok&&(e.setInSwitching(!1),null===(n=o.flv)||void 0===n||n.pause())})),e.once(r.A.LOADER_EVENTS.LOADER_ERROR,(function(n,r){e.setInSwitching(!1);var a={code:r.code,errorType:"network",type:"network",ex:"[".concat(n,"]: ").concat(r.message),errd:{},url:t};i&&o.emit("switch_error",a),s()})),e.once(r.A.MSE_EVENTS.MSE_CHANGE_CODEC_ERROR,(function(){e.setInSwitching(!1),i&&o.emit("switch_error",{url:t}),s(),o._switchURLHandler(n)})),e.off(r.A.DEMUX_EVENTS.ISKEYFRAME,e._handleKeyFrame),e.on(r.A.REMUX_EVENTS.MEDIA_SEGMENT,(function n(){0==(u-=1)&&o.player&&(e.setInSwitching(!1),o.player.config.url=t,i&&o.emit("switch_completed",{url:t}),e.on(r.A.DEMUX_EVENTS.ISKEYFRAME,e._handleKeyFrame),e.off(r.A.REMUX_EVENTS.MEDIA_SEGMENT,n),a(),e.urlSwitching=!0),o.player||s()}))}))}},{key:"_switchURLInternal",value:function(e,t){if(this.player){if(!(t=t&&!!this.context.getInstance("MP4_REMUXER")))return this.player.config.url=e,this.player.currentTime=0,this.tmpContext&&(this.tmpContext.destroy(),this.tmpContext=null,this.emit("switch_error")),void this._reloadStream();var n=this._reloadStreamSeamless(e,this.player.config.url,!0);n&&this.emit("core_inited",n)}}},{key:"_destroyInternal",value:function(){var e,t=this;if(null!==(e=this.config)&&void 0!==e&&e.preloader&&this.config.preloader.destroy(),!this.context)return Promise.resolve();if(this.flv&&this.context){var n=this.context.getInstance("FETCH_LOADER");n&&n.destroy(),this.flv.destroyServices()}var i=function(){t.context&&(t.context.destroy(),t.flv=null,t.context=null,H(V(f.prototype),"offAll",t).call(t))};return this.flv&&this.flv.mse?this.flv.mse.destroy().then(i):Promise.resolve(i())}},{key:"switchURL",value:function(e,t){this._switchURLHandler(e,t)}},{key:"destroy",value:function(){return this._destroyInternal()}},{key:"getStats",value:function(){var e,t,n,i,o,r=null===(e=this._context)||void 0===e?void 0:e.getInstance("TRACKS"),a=null==r||null===(t=r.videoTrack)||void 0===t?void 0:t.meta,s=null==r||null===(n=r.audioTrack)||void 0===n?void 0:n.meta,u=0;return a&&a.frameRate&&(u=a.frameRate&&a.frameRate.fps<100?a.frameRate.fps:Math.round(1e3/a.refSampleDuration)),{codec:null==a?void 0:a.codec,audioCodec:null==s?void 0:s.codec,width:(null==a?void 0:a.presentWidth)||0,height:(null==a?void 0:a.presentHeight)||0,frameRate:u,sampleRate:(null==s?void 0:s.sampleRate)||0,currentSpeed:(null===(i=this.loader)||void 0===i?void 0:i.currentSpeed)||0,totalByteSize:(null===(o=this.loader)||void 0===o?void 0:o.totalByteSize)||0}}},{key:"core",get:function(){return this.flv}},{key:"loader",get:function(){var e;return null===(e=this._context)||void 0===e?void 0:e.getInstance("FETCH_LOADER")}},{key:"context",get:function(){return this._context},set:function(e){this._context=e}},{key:"endedStatus",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.endedStatus}},{key:"transferCost",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.transferCost}},{key:"stableStats",get:function(){var e;return null===(e=this.flv)||void 0===e?void 0:e.stableStats}}],s=[{key:"pluginName",get:function(){return"flvLive"}},{key:"defaultConfig",get:function(){return Object.assign({},k,{loadTimeout:1e4,maxReaderInterval:5e3,seiOnDemand:!1,seamlesslyReload:!1,preloader:null,chaseFrameStart:0,preloadTime:5,retryCount:3,retryDelay:1e3,onlyVideo:!1,onlyAudio:!1,Decryptor:null,loudnessParserOn:!0})}},{key:"isSupported",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}}],n&&U(t.prototype,n),s&&U(t,s),f}(i.Ay);const K=z},53836:(e,t,n)=>{n.d(t,{Ay:()=>a,L8:()=>r});var i=n(60490),o=n(46885),r={1:"network",2:"network",3:"decoder",4:"format"},a=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.video){var a=n.mediaError?n.mediaError:t.video.error||{},s=t.duration,u=t.currentTime,c=t.ended,l=t.src,f=t.currentSrc,h=t.video,p=h.readyState,d=h.networkState,y={playerVersion:i.A,domain:document.domain,currentTime:u,duration:s,ended:c,readyState:p,networkState:d,src:n.src||l||f,errorType:n.errorType,errorCode:n.errorCode||a.code,message:n.errorMessage||a.message,mediaError:a,originError:n.originError?n.originError.stack:"",host:o.Ay.getHostFromUrl(l||f)};return n.ext&&Object.keys(n.ext).map((function(e){y[e]=n.ext[e]})),y}if(arguments.length>1){for(var g={playerVersion:i.A,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],m=0;m{n.r(t),n.d(t,{ABORT:()=>E,AFTER_DEFINITION_CHANGE:()=>B,AUTOPLAY_PREVENTED:()=>x,AUTOPLAY_STARTED:()=>P,BEFORE_DEFINITION_CHANGE:()=>H,BUFFER_CHANGE:()=>A,CANPLAY:()=>h,CANPLAY_THROUGH:()=>p,COMPLETE:()=>R,CSS_FULLSCREEN_CHANGE:()=>M,DEFINITION_CHANGE:()=>U,DESTROY:()=>L,DOWNLOAD_SPEED_CHANGE:()=>j,DURATION_CHANGE:()=>d,EMPTIED:()=>_,ENDED:()=>r,ERROR:()=>s,FULLSCREEN_CHANGE:()=>N,LOADED_DATA:()=>g,LOAD_START:()=>b,MINI_STATE_CHANGE:()=>F,PAUSE:()=>a,PIP_CHANGE:()=>Y,PLAY:()=>i,PLAYER_BLUR:()=>S,PLAYER_FOCUS:()=>O,PLAYING:()=>o,PLAYNEXT:()=>X,PROGRESS:()=>m,RATE_CHANGE:()=>v,READY:()=>T,REPLAY:()=>I,RESET:()=>J,RETRY:()=>V,ROTATE:()=>z,SCREEN_SHOT:()=>K,SEEKED:()=>c,SEEKING:()=>u,SEI_PARSED:()=>G,SHORTCUT:()=>q,SOURCE_ERROR:()=>Z,SOURCE_SUCCESS:()=>ee,STALLED:()=>k,STATS_EVENTS:()=>te,SUSPEND:()=>w,TIME_UPDATE:()=>l,URL_CHANGE:()=>D,URL_NULL:()=>C,USER_ACTION:()=>$,VIDEO_RESIZE:()=>W,VOLUME_CHANGE:()=>y,WAITING:()=>f,XGLOG:()=>Q});var i="play",o="playing",r="ended",a="pause",s="error",u="seeking",c="seeked",l="timeupdate",f="waiting",h="canplay",p="canplaythrough",d="durationchange",y="volumechange",g="loadeddata",v="ratechange",m="progress",b="loadstart",_="emptied",k="stalled",w="suspend",E="abort",A="bufferedChange",O="focus",S="blur",T="ready",C="urlNull",P="autoplay_started",x="autoplay_was_prevented",R="complete",I="replay",L="destroy",D="urlchange",j="download_speed_change",N="fullscreen_change",M="cssFullscreen_change",F="mini_state_change",U="definition_change",H="before_definition_change",B="after_definition_change",G="SEI_PARSED",V="retry",W="video_resize",Y="pip_change",z="rotate",K="screenShot",X="playnext",q="shortcut",Q="xglog",$="user_action",J="reset",Z="source_error",ee="source_success",te={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"}},25134:(e,t,n)=>{n.r(t),n.d(t,{BasePlugin:()=>r.Ay,Errors:()=>c.Ay,Events:()=>a,I18N:()=>u.A,Plugin:()=>o.Ay,STATE_CLASS:()=>s.A,SimplePlayer:()=>i.Ay,Sniffer:()=>l.A,Util:()=>f.Ay,default:()=>Vo});var i=n(91029),o=n(2057),r=n(77116),a=n(85821),s=n(32593),u=n(64972),c=n(53836),l=n(42779),f=n(46885),h=n(44727);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function y(e,t){for(var n=0;n0&&n&&!i&&(h.A.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog("firstFrame",{fvt:this.fvt,costTime:this.fvt,vt:this.vt}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&f.Ay.clearTimeout(this,this._waittTimer),this._waittTimer=f.Ay.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),f.Ay.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=_(),n=t-this.seekingStart;this.seekingStart=0,this.emitLog("seekEnd",{end:t,costTime:n,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(f.Ay.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(f.Ay.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=_(),n=t-this.waitingStart,i=t-this.fixedWaitingStart;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog("waitingEnd",{fixedCostTime:i,costTime:n,type:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var n=this.player;this.emit(a.XGLOG,function(e){for(var t=1;t'}}},{key:"afterCreate",value:function(){var e=this;o.Ay.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(a.ENDED,(function(){if(e.playerConfig.loop||f.Ay.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(a.PLAY,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),f.Ay.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'\n ').concat(this.i18n.REPLAY,"\n ")}}])&&A(t.prototype,n),i&&A(t,i),c}(o.Ay);function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function P(e,t){for(var n=0;n\n ')}}],i=[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}],n&&P(t.prototype,n),i&&P(t,i),u}(o.Ay);const L=I;function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function j(e,t){for(var n=0;n',class:"xg-icon-play"},startPause:{icon:'',class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){f.Ay.addClass(this.root,"hide")}},{key:"show",value:function(){f.Ay.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){f.Ay.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){f.Ay.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};U[e]&&window.clearTimeout(U[e].id),U[e]={},n.start&&n.start(),U[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(U[e].id),delete U[e]}),t)}("pauseplay",400,{start:function(){f.Ay.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){f.Ay.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(U).map((function(e){window.clearTimeout(U[e].id),delete U[e]}))}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n \n \n ')}}],i=[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}],n&&j(t.prototype,n),i&&j(t,i),u}(o.Ay);const B=H;function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}function V(e,t){for(var n=0;n');t.innerHTML='
'.concat(n,"
")}return t}}])&&V(t.prototype,n),i&&V(t,i),s}(o.Ay);function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}function X(e,t){for(var n=0;n\n
').concat(this.i18n[e],"
\n ")}}])&&X(t.prototype,n),i&&X(t,i),u}(o.Ay);var J=n(42990);function Z(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=r.call(this)).isEnabled=!0,t.isDragging=!1,t.isDown=!1,t.position={},t.downPoint={},t.dragPoint={x:0,y:0},t.startPos={x:0,y:0},t._root=e instanceof Element?e:document.querySelector(e),t._handlerDom=n.handle instanceof Element?n.handle:document.querySelector(n.handle),t._root&&t._handlerDom?(t._bindStartEvent(),t):te(t)}return t=a,n=[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),ce[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var n=ce[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=ue(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=ue(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=ue(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=se(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit("dragStart",this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit("dragEnded")),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,o=n.y,r=this._dragPointerMove(e,t),a=r.x,s=r.y;a=this.checkContain("x",a,i),s=this.checkContain("y",s,o),this.position.x=i+a,this.position.y=o+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit("dragMove",this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,o=parseInt(n[i],10),r=parseInt(n[i+1],10);this.position.x+=o,this.position.y+=r}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=se(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}],n&&Z(t.prototype,n),a}(n.n(J)());function fe(e){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(e)}function he(e,t){for(var n=0;nn+5?!t.isMini&&!t.isClose&&t.getMini():window.scrollY<=n&&(t.isMini&&t.exitMini(),t.isClose=!1)}})),t.isMini=!1,t.isClose=!1;var n=de(t).config;return t.pos={left:n.left<0?window.innerWidth-n.width-20:n.left,top:n.top<0?window.innerHeight-n.height-20:n.top,height:t.config.height,width:t.config.width,scrollY:window.scrollY||0},t.lastStyle=null,t}return t=u,n=[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(a.PAUSE,(function(){e.setAttr("data-state","pause")})),this.on(a.PLAY,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin($,n,$.pluginName)}var i=f.Ay.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new le(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:'',class:"xg-icon-play"},pause:{icon:'',class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},f.Ay.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(a.MINI_STATE_CHANGE,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;f.Ay.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(a.MINI_STATE_CHANGE,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=f.Ay.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n \n \n
').concat(this.i18n.MINI_DRAG,'
\n
\n
\n \n \n \n
\n
\n
\n
')}}],i=[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}],n&&he(t.prototype,n),i&&he(t,i),u}(o.Ay),me=n(61865);function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}function _e(e,t){for(var n=0;n0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(Oe).map((function(t){i.removeEventListener(t,e[Oe[t]],!1)}))}}],i=[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}],n&&_e(t.prototype,n),i&&_e(t,i),s}(r.Ay);function Ce(e,t){for(var n=0;n0?e[e.length-1]:null}function Le(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var De=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?Re:xe,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}var t,n;return t=e,n=[{key:"_initEvent",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger("press",e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger("doubleclick",e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger("click",e)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var n=this.__handlers[e],i=-1,o=0;o=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"onTouchStart",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&Le(e);var i=Ie(e.touches);t.x=i?parseInt(i.pageX,10):e.pageX,t.y=i?parseInt(i.pageX,10):e.pageX,t.start=!0,this.__setPress(e),n.addEventListener(this.events.end,this.onTouchEnd),n.addEventListener(this.events.cancel,this.onTouchCancel),n.addEventListener(this.events.move,this.onTouchMove),this.trigger("touchstart",e)}},{key:"onTouchCancel",value:function(e){this.onTouchEnd(e)}},{key:"onTouchEnd",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&Le(e),this.__clearPress(),n.removeEventListener(this.events.cancel,this.onTouchCancel),n.removeEventListener(this.events.end,this.onTouchEnd),n.removeEventListener(this.events.move,this.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&this.trigger(Pe,e),this.trigger("touchend",e),!t.press&&!t.moving&&this.__setDb(e),t.press=!1,t.start=!1,t.moving=!1}},{key:"onTouchMove",value:function(e){var t=this._pos,n=this.config,i=Ie(e.touches),o=i?parseInt(i.pageX,10):e.pageX,r=i?parseInt(i.pageY,10):e.pageX,a=o-t.x,s=r-t.y;Math.abs(s)0&&!i.ended){r.isStart=!0,f.Ay.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),t.find(".xg-dur").innerHTML=f.Ay.format(t.duration);var u=t.root.getBoundingClientRect();90===i.rotateDeg?(r.top=u.left,r.left=u.top,r.width=u.height,r.height=u.width):(r.top=u.top,r.left=u.left,r.width=u.width,r.height=u.height);var c=parseInt(s.pageX-r.left,10),l=parseInt(s.pageY-r.top,10);r.x=90===i.rotateDeg?l:c,r.y=90===i.rotateDeg?c:l,r.scopeL=o.scopeL*r.width,r.scopeR=(1-o.scopeR)*r.width,r.scopeM1=r.width*(1-o.scopeM)/2,r.scopeM2=r.width-r.scopeM1}})),Be(Ue(t),"onTouchMove",(function(e){var n=t.getTouche(e),i=Ue(t),o=i.pos,r=i.config,a=i.player;if(n&&!r.disableGesture&&t.duration&&o.isStart){var s=r.miniMoveStep,u=r.hideControlsActive,c=parseInt(n.pageX-o.left,10),l=parseInt(n.pageY-o.top,10),f=90===a.rotateDeg?l:c,h=90===a.rotateDeg?c:l;if(Math.abs(f-o.x)>s||Math.abs(h-o.y)>s){var p=f-o.x,d=h-o.y,y=o.scope;if(-1===y&&(0===(y=t.checkScope(f,h,p,d,o))&&(u?a.blur():a.focus({autoHide:!1}),!o.time&&(o.time=parseInt(1e3*a.currentTime,10)+1e3*t.timeOffset)),o.scope=y),-1===y||y>0&&!r.gestureY||0===y&&!r.gestureX)return;e.cancelable&&e.preventDefault(),t.executeMove(p,d,y,o.width,o.height),o.x=f,o.y=h}}})),Be(Ue(t),"onTouchEnd",(function(e){var n=Ue(t),i=n.player,o=n.pos,r=n.playerConfig;o.isStart&&(o.scope>-1&&e.cancelable&&e.preventDefault(),t.endLastMove(o.scope),setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),o.scope=-1,t.resetPos(),f.Ay.checkIsFunction(r.enableSwipeHandler)&&r.enableSwipeHandler(),t.changeAction(Ge))})),Be(Ue(t),"onRootTouchMove",(function(e){!t.config.disableGesture&&t.config.gestureX&&t.checkIsRootTarget(e)&&(e.stopPropagation(),t.pos.isStart?t.onTouchMove(e):t.onTouchStart(e))})),Be(Ue(t),"onRootTouchEnd",(function(e){if(t.pos.isStart&&t.checkIsRootTarget(e)){e.stopPropagation(),t.onTouchEnd(e);var n=t.player.controls;n&&n.recoverAutoHide()}})),t.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},t.timer=null,t}return t=u,n=[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:'',class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;Ve.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),f.Ay.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=f.Ay.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var o="mouse"===this.domEventType?"mouse":"touch";this.touch=new je(this.root,{eventType:o,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(a.DURATION_CHANGE,(function(){var t=e.player,n=e.config;1e3*t.duration0&&(e.pos.time=0)}));var r={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(r).map((function(t){e.touch.on(t,(function(n){e[r[t]](n)}))})),!n.disableActive){var s=i.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),s.addCallBack("dragend",(function(){e.changeAction(Ge)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&f.Ay.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var n=t.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,n,i,o){var r=o.width,a=-1;if(e<0||e>r)return a;var s=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&s>=1.73&&e>o.scopeM1&&eo.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,n,i,o){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/o);break;case 2:l.A.os.isIos||this.updateVolume(t/o)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,o=this.config,r=(n.time-this.timeOffset)/1e3;0===e&&(i.seek(Number(r).toFixed(1)),o.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500)),this.changeAction(Ge)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),t.focus()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;(0,me.Eu)(this,Ve[0],(function(e,n){t.clickHandler(n.e)}),{e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;(0,me.Eu)(this,Ve[1],(function(e,n){t.dbClickHandler(n.e)}),{e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction("playbackrate"))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(Ge))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var o=parseInt(e*n.moveDuration,10)+this.timeOffset;o=(o+=this.pos.time)<0?0:o>1e3*i?1e3*i-200:o,t.getPlugin("time")&&t.getPlugin("time").updateTime(o/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(o/1e3/this.duration,!0),this.activeSeekNote(o/1e3,e>0),n.isTouchingSeek&&t.seek(Number((o-this.timeOffset)/1e3).toFixed(1)),this.pos.time=o}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,o=t.light+.8*e;o=o>n.maxDarkness?n.maxDarkness:o<0?0:o,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(o,")")),t.light=o}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,o=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!o&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction("seeking");var r=n.plugins.start;r&&r.focusHide(),this.find(".xg-dur").innerHTML=f.Ay.format(this.duration),this.find(".xg-cur").innerHTML=f.Ay.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?f.Ay.removeClass(this.find(".xg-seek-show"),"xg-back"):f.Ay.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(!e.hasStart)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n \n
\n
\n
\n \n 00:00\n /\n 00:00\n
\n
\n
\n
\n
\n
\n ').concat(this.config.pressRate,"X").concat(this.i18n.FORWARD,"\n
\n
\n ")}}],i=[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}],n&&Me(t.prototype,n),i&&Me(t,i),u}(o.Ay);const Ye=We;function ze(e){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(e)}function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Xe(e,t){for(var n=0;n0&&i-o>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(o){n.keyCodeMap[o]&&e===n.keyCodeMap[o].keyCode&&!n.keyCodeMap[o].disable&&(i=!t||t&&!n.keyCodeMap[o].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player,n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}},{key:"upVolume",value:function(e){var t=this.player,n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}},{key:"seek",value:function(e){var t,n=this.player,i=n.currentTime,o=n.duration,r={currentTime:{from:i,to:t=i+this.seekStep<=o?i+this.seekStep:o-1}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=t}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=0;t-this.seekStep>=0&&(n=t-this.seekStep);var i={currentTime:{from:t,to:n}};this.emitUserAction(e,"seek",{props:i}),this.player.currentTime=n}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,n=t.isCssfullScreen,i=t.fullscreen;i&&(t.exitFullscreen(),this.emitUserAction("keyup","switch_fullscreen",{fullscreen:i})),n&&(t.exitCssFullscreen(),this.emitUserAction("keyup","switch_css_fullscreen",{cssfullscreen:n}))}},{key:"handleKeyCode",value:function(e,t){var n=this;Object.keys(this.keyCodeMap).map((function(i){var o=n.keyCodeMap[i],r=o.action,s=o.keyCode,u=o.disable;s!==e||u||("function"==typeof r?r(t,n.player):"string"==typeof r&&"function"==typeof n[r]&&n[r](t,n.player),n.emit(a.SHORTCUT,function(e){for(var t=1;t'}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n \n \n '}}])&&it(t.prototype,n),i&&it(t,i),u}(o.Ay);function st(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments,o=t.newIndex,r=t.curIndex,a=t.millisecond;o!==r&&n.map((function(t,n){no&&(t[e].style.width=0)}));var s=i[o],u=0===a?0:(a-s.start)/s.duration;n[o][e].style.width=u<0?0:"".concat(100*u,"%")}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(t)}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==f.Ay.typeOf(e.played)){var o=this.findIndex(1e3*e.played,n);this.updateProgress("played",{newIndex:o,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=o}if("Undefined"!==f.Ay.typeOf(e.cached)){var r=this.findIndex(1e3*e.cached,i);this.updateProgress("cached",{newIndex:r,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=r}}},{key:"findIndex",value:function(e,t){var n=this.fragments;return 1===n.length?0:(e>n[t].start&&en.start&&e<=n.end&&(t=i)})),t)}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"createInner",value:function(){var e=this;this.innerList=new ct({fragments:this.config.fragments,style:this.playerConfig.commonStyle||{}}),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)}))}},{key:"afterCreate",value:function(){var e=this;this.config.disable||this.playerConfig.isLive||(this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer"),this.createInner(),"mobile"===l.A.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(a.DURATION_CHANGE,(function(){e.onMouseLeave()})),this.on(a.TIME_UPDATE,(function(){e.onTimeupdate()})),this.on(a.SEEKED,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(a.PROGRESS,(function(){e.onCacheUpdate()})),this.on(a.ENDED,(function(){e.onCacheUpdate(),e._state.now=0})),this.on(a.EMPTIED,(function(){e.onReset()})),this.on(a.VIDEO_RESIZE,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle())}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===lt(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),e)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var n=this.__dragCallBacks,i=-1;n.map((function(n,o){n&&n.type===e&&n.handler===t&&(i=o)})),i>-1&&n.splice(i,1)}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",f.Ay.stopPropagation),t.center&&t.center.addEventListener("touchend",f.Ay.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),f.Ay.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),f.Ay.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,o=this.player;if(!i.isCloseClickSeek||0!==n){var r=e>=o.duration?o.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==o.videoConfig.mediaType)&&(this._state.now=r,this._state.direc=r>o.currentTime?0:1,o.seek(r))}}},{key:"computeTime",value:function(e,t){var n,i,o=this.player,r=this.root.getBoundingClientRect(),a=r.width,s=r.height,u=r.top,c=r.left,l=t;90===o.rotateDeg?(n=s,i=u):(n=a,i=c);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(){var e=this.player,t=this._state,n=this.duration;if(!e.isSeeking&&!this.isProgressMoving&&e.hasStart){if(t.now>-1){var i=parseInt(1e3*t.now,10)-parseInt(1e3*e.currentTime,10);if(0===t.direc&&i>300||1===t.direc&&i>-300)return void(t.now=-1);t.now=-1}var o=this.timeOffset+e.currentTime;this.innerList.update({played:o},n),this.progressBtn.style.left="".concat(o/n*100,"%");var r=this.player.plugins.miniprogress;r&&r.update({played:o},n)}}},{key:"onCacheUpdate",value:function(){var e=this.player,t=this.duration,n=e.bufferedPoint;this.innerList.update({cached:n.end},t);var i=this.player.plugins.miniprogress;i&&i.update({cached:n.end},t)}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",f.Ay.stopPropagation),t.center&&t.center.removeEventListener("touchend",f.Ay.stopPropagation))),"mouse"!==n&&"compatible"!==n||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!1))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n \n \n \n \n \n ')}}}],i=[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}}],n&&ft(t.prototype,n),i&&ft(t,i),c}(o.Ay);const vt=gt;function mt(e){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mt(e)}function bt(e,t){for(var n=0;n',class:"xg-icon-play"},pause:{icon:'',class:"xg-icon-pause"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player;return this.emitUserAction(e,"switch_play_pause"),t.ended?t.replay():t.paused?(t.play(),this.animate(!1)):(t.pause(),this.animate(!0)),!1}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){var t=this.i18nKeys;e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),t.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),t.PAUSE_TIPS))}},{key:"destroy",value:function(){Tt(Pt(c.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'\n
\n
\n
').concat(this.i18n.PLAY_TIPS,"
\n
")}}],i=[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_LEFT,index:0,disable:!1}}}],n&&St(t.prototype,n),i&&St(t,i),c}(At);const Rt=xt;function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}function Lt(e,t){for(var n=0;n',class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){f.Ay.addClass(this.root,"show")}},{key:"hide",value:function(){f.Ay.removeClass(this.root,"show")}},{key:"render",value:function(){return'\n '}}])&&Lt(t.prototype,n),i&&Lt(t,i),u}(o.Ay);function Mt(e){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(e)}function Ft(e,t){for(var n=0;n',class:"xg-get-fullscreen"},exitFullscreen:{icon:'',class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){Ut(Gt(h.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===l.A.device?"touchend":"click",this.handleFullscreen),"mobile"===l.A.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?s.A.INNER_FULLSCREEN:s.A.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,s.A.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(a.FULLSCREEN_CHANGE,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?s.A.INNER_FULLSCREEN:s.A.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,s.A.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(a.FULLSCREEN_CHANGE,!1)}},{key:"changeFullScreen",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player,n=this.config,i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(a.FULLSCREEN_CHANGE,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(a.FULLSCREEN_CHANGE,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen()}}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){Ut(Gt(h.prototype),"show",this).call(this)}},{key:"hide",value:function(){Ut(Gt(h.prototype),"hide",this).call(this)}},{key:"render",value:function(){if(!this.config.disable){var e="FULLSCREEN_TIPS";return'\n
\n
\n
').concat(this.i18n[e],"
\n
")}}}],i=[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}],n&&Ft(t.prototype,n),i&&Ft(t,i),h}(At);function Wt(e){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(e)}function Yt(e,t){for(var n=0;n0&&(this.centerDurDom.innerHTML=f.Ay.format(this.duration))):(this.timeDom.innerHTML=f.Ay.format(t),this.duration!==1/0&&this.duration>0&&(this.durationDom.innerHTML=f.Ay.format(this.duration)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=f.Ay.format(0),this.centerDurDom.innerHTML=f.Ay.format(0)):(this.timeDom.innerHTML=f.Ay.format(0),this.durationDom.innerHTML=f.Ay.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=f.Ay.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=f.Ay.createDom("xg-icon","00:00",{},"xgplayer-time right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(f.Ay.hide(this.durationDom),f.Ay.hide(this.timeDom),f.Ay.hide(this.find(".time-separator")),f.Ay.show(this.find(".time-live-tag"))):f.Ay.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(f.Ay.hide(this.durationDom),f.Ay.hide(this.timeDom),f.Ay.hide(this.find(".time-separator")),f.Ay.show(this.find(".time-live-tag"))):(f.Ay.hide(this.find(".time-live-tag")),f.Ay.show(this.find(".time-separator")),f.Ay.show(this.durationDom),f.Ay.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=f.Ay.format(e):this.centerCurDom.innerHTML=f.Ay.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(a.SEEKED,n),t.isSeeking?this.once(a.SEEKED,n):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'\n 00:00\n /\n 00:00\n '.concat(this.i18n.LIVE_TIP,"\n ")}}],i=[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_LEFT,index:2,disable:!1}}}],n&&Yt(t.prototype,n),i&&Yt(t,i),c}(o.Ay);const Qt=qt;function $t(e){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$t(e)}function Jt(e,t){for(var n=0;no.barH||e.updateVolumePos(s,t)}})),nn(en(e),"onBarMouseUp",(function(t){f.Ay.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=en(e)._d;n.isStart=!1,n.isMoving=!1})),nn(en(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),nn(en(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),nn(en(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,o=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===o?"4px":"".concat(100*o,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,o)}})),e}return t=c,n=[{key:"registerIcons",value:function(){return{volumeSmall:{icon:'',class:"xg-volume-small"},volumeLarge:{icon:'',class:"xg-volume"},volumeMuted:{icon:'',class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("muted_change",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==l.A.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(a.VOLUME_CHANGE,this.onVolumeChange),this.once(a.LOADED_DATA,this.onVolumeChange),"Number"!==f.Ay.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),o=this.find(".xgplayer-bar");if(o&&i){var r=parseInt(e/o.getBoundingClientRect().height*1e3,10);i.style.height="".concat(e,"px");var a=Math.max(Math.min(r/1e3,1),0),s={volume:{from:n.volume,to:a}};n.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:s}),n.volume=Math.max(Math.min(r/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),o=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.ceil(100*o)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(f.Ay.clearTimeout(this,this._timerId),this._timerId=null),f.Ay.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,o=this._d,r=this.player;o.isActive||(this._timerId&&(f.Ay.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=f.Ay.setTimeout(this,(function(){o.isActive||(n?r.blur():r.focus(),f.Ay.removeClass(e.root,"slide-show"),o.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(f.Ay.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===l.A.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n \n
\n
\n \n '.concat(t?'
'.concat(100*e,"
"):"",'\n
\n \n
\n
\n
')}}}],i=[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}],n&&Jt(t.prototype,n),i&&Jt(t,i),c}(o.Ay);const rn=on;function an(e){return an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},an(e)}function sn(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var o=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*o*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(a.ROTATE,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:''}}},{key:"render",value:function(){if(!this.config.disable)return'\n \n
\n
\n
\n ').concat(this.i18n.ROTATE_TIPS,"\n
\n
")}}],i=[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}],n&&sn(t.prototype,n),i&&sn(t,i),c}(At);function hn(e){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hn(e)}function pn(e,t){for(var n=0;n',class:"xg-get-pip"},pipIconExit:{icon:'',class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var n=t.paused;f.Ay.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),t.emit(a.PIP_CHANGE,!1)},this.enterPIPCallback=function(n){t.emit(a.PIP_CHANGE,!0),e.pipWindow=n.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===_n&&i!==_n&&t.onFullscreenChange(null,!1),e.pMode=i,i===mn?e.enterPIPCallback(n):i===bn&&e.leavePIPCallback(n)},t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),c.checkWebkitSetPresentationMode(t.video)&&t.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(){var e=this.player,t=this.playerConfig;if(this.isPIPAvailable()&&!this.isPip)try{var n=t.poster;return n&&(e.video.poster="String"===f.Ay.typeOf(n)?n:n.poster),c.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("picture-in-picture"):e.video.requestPictureInPicture(),!0}catch(e){return console.error("requestPiP",e),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(c.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return console.error("exitPIP",e),!1}}},{key:"isPip",get:function(){var e=this.player;return document.pictureInPictureElement&&document.pictureInPictureElement===e.video||e.video.webkitPresentationMode===mn}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==f.Ay.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===f.Ay.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===f.Ay.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){dn(vn(c.prototype),"destroy",this).call(this);var e=this.player;e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),c.checkWebkitSetPresentationMode(e.video)&&e.video.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'\n
\n
\n
').concat(this.i18n.PIP,"
\n
")}}],i=[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}],n&&pn(t.prototype,n),i&&pn(t,i),c}(At);const wn=kn;function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function An(e,t){for(var n=0;n'}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===l.A.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.autoplay=!0,t.src=e)}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n \n
\n
\n
'.concat(this.i18n.PLAYNEXT_TIPS,"
\n
\n ")}}],i=[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}],n&&An(t.prototype,n),i&&An(t,i),c}(o.Ay),Pn=n(62261),xn=n.n(Pn);function Rn(e){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rn(e)}function In(e,t){for(var n=0;n'}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='x'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){Ln(Nn(u.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'\n
\n
\n
').concat(this.i18n.DOWNLOAD_TIPS,"
\n
")}}])&&In(t.prototype,n),i&&In(t,i),u}(At);function Fn(e){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fn(e)}function Un(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},o=this.config,r=this.player,a=i.quality||o.quality,s=i.type||o.type;return new Promise((function(i,u){n.canvas?(n.canvas.width=e||o.width,n.canvas.height=t||o.height):n.createCanvans(e,t),n.canvasCtx.drawImage(r.video,0,0,e||o.width,t||o.height);var c=n.canvas.toDataURL(s,a).replace(s,"image/octet-stream");i(c=c.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){Hn(Gn(c.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(a.VIDEO_RESIZE,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n \n
\n ').concat(this.icons.screenshotIcon?"":'').concat(this.i18n[t],"")," \n
\n
")}}}],i=[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}],n&&Un(t.prototype,n),i&&Un(t,i),c}(At);function Wn(e,t){for(var n=0;n0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(f.Ay.createDom("li","".concat(e.showText,""),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&f.Ay.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");f.Ay.addClass(t,"selected"),i&&f.Ay.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){f.Ay.removeClass(this.root,"hide"),f.Ay.addClass(this.root,"active")}},{key:"hide",value:function(){f.Ay.removeClass(this.root,"active"),f.Ay.addClass(this.root,"hide")}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}])&&Wn(t.prototype,n),e}();function zn(e){return zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zn(e)}function Kn(e,t){for(var n=0;n0&&(e.renderItemList(t.list),e.show())})),Jn&&this.on(a.PLAYER_FOCUS,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=Jn?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",f.Ay.createDom("span","",{},"icon-text")),f.Ay.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||f.Ay.addClass(this.root,"show")}},{key:"hide",value:function(){f.Ay.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||f.Ay.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===zn(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(e!==this.isActive){var t=this.player.controls,n=this.config.listType;e?("rightSide"===n?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?t.focus():t.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var n=this.config,i=n.listType,o=n.list;(Jn||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=o[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex\n
\n
\n ')}}],i=[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:o.lP.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}],n&&Kn(t.prototype,n),i&&Kn(t,i),c}(o.Ay);function ei(e){return ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ei(e)}function ti(e,t){for(var n=0;n0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;ni(oi(c.prototype),"afterCreate",this).call(this);var t=this.config,n=t.list,i=t.defaultDefinition,o=this.playerConfig.defaultConfig;n.forEach((function(e){e.definition!==i&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(a.DEFINITION_CHANGE,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition,i=this.playerConfig.defaultConfig;if(t.length>0){var o=null;t.map((function(e){e.definition!==n&&e.definition!==i||(o=e,e.selected=!0)})),o||(o=t[0]),this.changeDefinition(o)}}},{key:"renderItemList",value:function(e,t){var n=this,i=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,r=e.map((function(e,t){var r={url:e.url,definition:e.definition||"",showText:n.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!f.Ay.isUndefined(e.definition)&&e.definition===i)&&(r.selected=!0,o=t),r}));ni(oi(c.prototype),"renderItemList",this).call(this,r,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,o=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==o&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var n=this.player.definitionList;ni(oi(c.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var i=0;i',class:"xg-get-cssfull"},exitCssFullscreen:{icon:'',class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){di(gi(c.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'\n
\n
\n
').concat(this.i18n.CSSFULLSCREEN_TIPS,"
\n
")}}])&&pi(t.prototype,n),i&&pi(t,i),c}(At);function mi(e){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mi(e)}function bi(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,n=e.errorType,i=t.error;if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'').concat(this.i18n.REFRESH,"")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'\n
\n \n \n
\n
'}}],i=[{key:"pluginName",get:function(){return"error"}}],n&&bi(t.prototype,n),i&&bi(t,i),u}(o.Ay);function Ei(e){return Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ei(e)}function Ai(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var o=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),f.Ay.addClass(this.root,"show"),"arrow"===n.mode&&f.Ay.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?''.concat(e.highlight,""):""),n.style&&this.setStyle(n.style),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var r=n.interval||o;this.intervalId=setTimeout((function(){t.hide()}),r)}}}},{key:"hide",value:function(){f.Ay.removeClass(this.root,"show"),f.Ay.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'\n \n ')}}],i=[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}],n&&Ai(t.prototype,n),i&&Ai(t,i),u}(o.Ay);var Ci={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Pi(e){Object.keys(Ci).map((function(t){void 0===e[t]&&(e[t]=Ci[t])}))}var xi={initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this._ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player.plugins.progress;if(n&&(t&&(Pi(e),this._ispots.push(e)),this._ispotsInit||!t)){var i=this.calcuPosition(e.time,e.duration),o=e.style||{};o.left="".concat(i.left,"%"),o.width="".concat(i.width,"%");var r="xgspot_".concat(e.id," xgplayer-spot");i.isMini&&(r+=" mini");var a=f.Ay.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},r);Object.keys(o).map((function(e){a.style[e]=o[e]})),n.outer&&n.outer.appendChild(a)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this._ispotsInit){var o=n.find('xg-spot[data-id="'.concat(e.id,'"]'));if(o){var r=this.calcuPosition(e.time,e.duration),a=e.style||{};a.left="".concat(r.left,"%"),a.width="".concat(r.width,"%"),o.setAttribute("data-text",e.text),o.setAttribute("data-time",e.time),r.isMini?f.Ay.addClass(o,"mini"):f.Ay.removeClass(o,"mini"),Object.keys(a).map((function(e){o.style[e]=a[e]})),t&&this.showDot(e.id)}}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],o=0;o=0;r--)if(t.splice(i[r],1),this._ispotsInit){var a=n.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this._ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this._ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),o=i.length;if(o>t.length)for(var r=o-1;r>t.length-1;r--)n.outer.removeChild(i[r]);t.map((function(t,n){n0&&t.hide();var i=t.player.plugins.progress;i&&i.disableBlur(),t._curDot.addEventListener("mouseleave",t.onDotMouseLeave)}})),t._ispots=[],t.videoPreview=null,t.videothumbnail=null,t.thumbnail=null,t._state={now:0,f:!1},t}return t=u,n=[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,n){n.time&&e.player.seek(n.time)})),function(e){var t=e.config,n=e.player;Object.keys(xi).map((function(t){e[t]=xi[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return Pi(e),e})),e._ispotsInit=!1,n.once(a.DURATION_CHANGE,(function(){e.initDots()}))}(this),this.config.disable&&this.disable()}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(Mi).map((function(n){e[Mi[n]]=e[Mi[n]].bind(e),t.addCallBack(n,e[Mi[n]])})),"mobile"!==l.A.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&f.Ay.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&f.Ay.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&f.Ay.hasClass(t.target,"xgplayer-spot")){t.stopPropagation(),t.preventDefault();var n={};["time","id","text"].map((function(e){n[e]=t.target.getAttribute("data-".concat(e))})),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(t,n)}}},{key:"updateLinePos",value:function(e,t){var n,i,o=this.root,r=this.previewLine,a=this.timePoint,s=this.player,u=this.config,c="flex"===s.controls.mode,l=o.getBoundingClientRect().width,f=a.getBoundingClientRect().width,h=e-(l=this._hasThumnail&&lt-l&&!c?(n=h-(t-l),!this.thumbnail&&(i=h-(t-l)-f/2),h=t-l):(n=0,!this.thumbnail&&(i=-f/2)),void 0!==n&&(r.style.transform="translateX(".concat(n.toFixed(2),"px)")),void 0!==i&&(a.style.transform="translateX(".concat(i.toFixed(2),"px)")),o.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var o=this.root,r=this.config,a=this._state;if(o){this.updateLinePos(e,t),a.now=n;var s=f.Ay.format(n);i&&i.target&&f.Ay.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,s),this.focusDot(i.target),a.f=!0,r.isFocusDots&&a.f&&(a.now=parseInt(i.target.getAttribute("data-time"),10))):r.defaultText?(a.f=!1,this.showTips(r.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now)}}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,o=t.plugins.thumbnail;if(o&&o.usable){this.thumbnail&&o.update(this.thumbnail,e,i.width,i.height);var r=n&&n.getBoundingClientRect();this.videothumbnail&&o.update(this.videothumbnail,e,r.width,r.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==l.A.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){f.Ay.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&f.Ay.addClass(this.root,"short-line"),this._hasThumnail=!0;var o=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(o,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=f.Ay.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else f.Ay.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player,o=n.root.getBoundingClientRect().width,r=i.duration/o*6,a={};return e+t>i.duration&&(t=i.duration-e),a.left=e/i.duration*100,a.width=t/i.duration,a.isMini=r>t,{left:e/i.duration*100,width:t/i.duration*100,isMini:t2&&void 0!==arguments[2]?arguments[2]:"";f.Ay.addClass(this.root,"no-timepoint"),e&&(f.Ay.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(f.Ay.addClass(this.root,"product"),this.tipText.textContent=e):(f.Ay.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){f.Ay.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",f.Ay.removeClass(this.find(".xg-spot-content"),"show-text"),f.Ay.removeClass(this.root,"product")}},{key:"hide",value:function(){f.Ay.addClass(this.root,"hide")}},{key:"show",value:function(){f.Ay.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(Mi).map((function(n){t.removeCallBack(n,e[Mi[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===l.A.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'
\n
\n
\n \n
\n
\n
\n
00:00
\n
\n
')}}],i=[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}],n&&Ii(t.prototype,n),i&&Ii(t,i),u}(o.Ay);function Ui(e){return Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ui(e)}function Hi(e,t){for(var n=0;n0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,o=e.interval;this.ratio=t/n*100,this.interval=o||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e0&&o.push(e-1),o.push(e),e>0&&e=0&&e1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,o=i.pic_num,r=i.row,a=i.col,s=i.width,u=i.height;this.interval=Math.round(this.player.duration/o);var c=Math.ceil(e/this.interval),l=(c=c>o?o:c)0?Math.ceil(f/a)-1:0,p=f>0?f-h*a-1:0,d=0,y=0;t&&n?t/n2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=this.config,a=r.pic_num,s=r.urls;if(!(a<=0)&&s&&0!==s.length){var u=this.getPosition(t,n,i);this.preload(u.urlIndex),Object.keys(u.style).map((function(t){e.style[t]=u.style[t]})),Object.keys(o).map((function(t){e.style[t]=o[t]}))}}},{key:"createThumbnail",value:function(e,t){var n=f.Ay.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],i=[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}],n&&Hi(t.prototype,n),i&&Hi(t,i),s}(o.Ay);function Wi(e){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wi(e)}function Yi(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'\n \n \n '}}],i=[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}],n&&Yi(t.prototype,n),i&&Yi(t,i),s}(o.Ay);function qi(e){return qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(e)}function Qi(e,t){for(var n=0;n0?parseInt(t.videoWidth/t.videoHeight*100,10):0,("realtime"===e.config.mode||n-e.preTime>=e.interval)&&(t&&t.videoWidth&&e.update(i,e.videoPI),e.preTime=n)),e.frameId=f.Ay.requestAnimationFrame(e.start))})),eo(Ji(e),"stop",(function(){e.frameId&&(f.Ay.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return t=u,n=[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),u.isSupport||(this.config.disable=!0);var t=this.config,n=t.disable,i=t.mode;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/this.config.frameRate,10),this.canvas=null,this.canvasCtx=null,this.once(a.COMPLETE,(function(){e.player&&(e.init(),e.player.paused||e.start())})),"poster"!==i&&(i!==to&&(this.on(a.EMPTIED,(function(){e.stop()})),this.on(a.PLAY,(function(){e.start()})),this.on(a.PAUSE,(function(){e.stop()}))),i===to&&this.once(a.TIME_UPDATE,(function(){e.renderOnce()}))))}},{key:"init",value:function(){var e=this.player,t=this.config;this.canvasFilter=u.supportCanvasFilter();try{var n=this.config.isInnerRender&&e.innerContainer||e.root;n.insertAdjacentHTML("afterbegin",'
\n
'),this.root=n.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(e){h.A.logError("plugin:DynamicBg",e)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==l.A.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===f.Ay.typeOf(e)?e:"String"===f.Ay.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,o=n.height,r=new window.Image;r.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=o,t.canvas.width=i;var e=parseInt(i/o*100,10);t.update(r,e),r=null}},r.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,o=this.canvas.getBoundingClientRect(),r=o.width,a=o.height;if(r!==n.width||a!==n.height||n.pi!==t){var s=parseInt(r/a*100,10);n.pi=t,n.width=this.canvas.width=r,n.height=this.canvas.height=a;var u=a,c=r;st&&(u=parseInt(100*r/t,10)),n.rwidth=c*i.multiple,n.rheight=u*i.multiple,n.x=(r-n.rwidth)/2,n.y=(a-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){h.A.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],i=[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,mode:"framerate",frameRate:10,filter:"blur(50px)",addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof no?no:no=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===l.A.browser||"firefox"===l.A.browser)}}],n&&Qi(t.prototype,n),i&&Qi(t,i),u}(o.Ay);const oo=io;function ro(e){return ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ro(e)}function ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function so(e){for(var t=1;tn.video.duration)){var f=l-s,h=f<=r;ft&&(0===r||i[r-1].end-t<=n)){o=r;break}return o}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;nt.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Co(So(e),"onJump",(function(){var t=So(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var o=n.currentTime+e.jumpSize;o>n.video.duration||(console.log("waitintTimeout, currentTime:",n.currentTime,", jumpTo:",o),e.jumpCnt++,n.currentTime=o)}})),e}return t=u,i=[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}],(n=[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(a.WAITING,this.onWaiting),this.on([a.PLAYING,a.CANPLAY],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(a.PLAY,(function(){e.hasPlayed=!0})))}}])&&Ao(t.prototype,n),i&&Ao(t,i),u}(o.Ay);function xo(e){return xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xo(e)}function Ro(e,t){for(var n=0;n=o)){e.cnt++;try{var s=(new Date).getTime(),u=null,c=new XMLHttpRequest;e.xhr=c,c.open("GET",a);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){c.setRequestHeader(e,l[e])})),c.onreadystatechange=function(){if(4===c.readyState){e.xhr=null,u=(new Date).getTime();var t=c.getResponseHeader("Content-Length")/1024*8,n=Math.round(1e3*t/(u-s));e.appendList(n),e.timer=setTimeout(e.testSpeed,r)}},c.send()}catch(e){console.error(e)}}}})),jo(Lo(e),"appendList",(function(t){var n=e.config.saveSpeedMax;e.speedListCache.length>=n&&e.speedListCache.shift(),e.speedListCache.push(t),e.player&&(e.player.realTimeSpeed=t),e.updateSpeed()})),jo(Lo(e),"updateSpeed",(function(){var t=e.getSpeed(),n=Lo(e).player;!n||n.avgSpeed&&t===n.avgSpeed||(n.avgSpeed=t,n.emit(a.DOWNLOAD_SPEED_CHANGE,{speed:t,realTimeSpeed:n.realTimeSpeed}))})),e}return t=u,i=[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5}}}],(n=[{key:"afterCreate",value:function(){var e=this;this.speedListCache=[];var t=this.config,n=t.openSpeed,i=t.testTimeStep;this.timer=null,this.cnt=0,this.xhr=null,n&&(this.on("real_time_speed",this._onRealSpeedChange),this.on([a.LOADED_DATA,a.REPLAY],(function(){f.Ay.isMSE(e.player.video)||(e.speedListCache=[],e.cnt=0,e.timer=setTimeout(e.testSpeed,i))})))}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel(),this.xhr=null)}}])&&Ro(t.prototype,n),i&&Ro(t,i),u}(o.Ay);function Mo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n{n.d(t,{A:()=>l});var i=n(46885);function o(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n{n.d(t,{Ay:()=>re});var i=n(42990),o=n.n(i),r=n(46885),a=n(42779),s=n(53836),u=n(85821);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){for(var n=0;n0;)e.removeChild(t[0])}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?s.L8[n.code]:"other";n.message,this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new s.Ay(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(e){return!!this.video&&this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.video)return t;e||(e=this.video.buffered);var n=this.video.currentTime;if(e)for(var i=0,o=e.length;i=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){return this.video&&this.video.error?["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]:null}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(e){if(this.video&&this.video.muted!==e){this._lastMuted=this.video.muted;try{this.video.muted=e}catch(e){}}}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){this.video&&e!==1/0&&(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video&&(this.emit(u.URL_CHANGE,e),this.emit(u.WAITING),this._currentTime=0,this._duration=0,/^blob/.test(this.video.currentSrc)||/^blob/.test(this.video.src)?this.onWaiting():(this._detachSourceEvents(this.video),"Array"===r.Ay.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(e){if(e!==1/0&&this.video)try{this.video.volume=e}catch(e){}}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var n,i=arguments.length,o=new Array(i>2?i-2:0),r=2;r2?i-2:0),r=2;r2?i-2:0),r=2;r2?i-2:0),r=2;r0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}var t,n;return t=e,n=[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,o=n.indexedDB.open(n.myDB.name,i);o.onerror=function(e){},o.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},o.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),o=0;o-1?this.__handlers[o].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var o=this.pluginGroup[i]._plugins,a=this.pluginGroup[i]._originalOptions;n.player=this.pluginGroup[i]._player;var s=n.pluginName||t.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var u=Object.keys(a),c=0;c0&&this.setCurrentUserActive(u[u.length-1],!0)}}}};var x=n(32593);function R(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:(0,r.Xo)(),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}}}function I(e){return function(e){if(Array.isArray(e))return L(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.root){var i=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:i.position){case A.lP.CONTROLS_LEFT:t.root=this.left;break;case A.lP.CONTROLS_RIGHT:t.root=this.right;break;case A.lP.CONTROLS_CENTER:t.root=this.center;break;case A.lP.CONTROLS:t.root=this.root;break;default:t.root=this.left}return M(H(l.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==a.A.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var o=r.Ay.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'\n \n \n \n \n \n \n \n ')}}}],i=[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}],n&&N(t.prototype,n),i&&N(t,i),l}(A.Ay);var V=n(44727),W=n(64972),Y=n(60490);function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function X(e){for(var t=1;tt.duration?t.duration:i,t.config.startTime=0),t.playbackRate=o,n&&t.videoPlay(),t.off(u.CANPLAY,t.canPlayFunc),t.removeClass(x.A.ENTER)}})),te(Z(t),"onFullscreenChange",(function(e,n){var i=function(){r.Ay.setTimeout(Z(t),(function(){t.getVideoSize()}),100)},o=r.Ay.getFullScreenEl();t._fullActionFrom?t._fullActionFrom="":t.emit(u.USER_ACTION,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:t.currentTime,duration:t.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var a=(0,r.Dq)(o,t.playerId,E);if(n||o&&(o===t._fullscreenEl||a))i(),!t.config.closeFocusVideoFocus&&t.video.focus(),t.fullscreen=!0,t.changeFullStyle(t.root,o,x.A.FULLSCREEN),t.emit(u.FULLSCREEN_CHANGE,!0,t._fullScreenOffset),t.cssfullscreen&&t.exitCssFullscreen();else if(t.fullscreen){i();var s=Z(t),c=s._fullScreenOffset;s.config.needFullscreenScroll?(window.scrollTo(c.left,c.top),r.Ay.setTimeout(Z(t),(function(){t.fullscreen=!1,t._fullScreenOffset=null}),100)):(!t.config.closeFocusVideoFocus&&t.video.focus(),t.fullscreen=!1,t._fullScreenOffset=null),t.cssfullscreen?t.removeClass(x.A.FULLSCREEN):t.recoverFullStyle(t.root,t._fullscreenEl,x.A.FULLSCREEN),t._fullscreenEl=null,t.emit(u.FULLSCREEN_CHANGE,!1)}})),te(Z(t),"_onWebkitbeginfullscreen",(function(e){t._fullscreenEl=t.video,t.onFullscreenChange(e,!0)})),te(Z(t),"_onWebkitendfullscreen",(function(e){t.onFullscreenChange(e,!1)})),(0,D.Ay)(Z(t),ne),t.config=n,t._pluginInfoId=r.Ay.generateSessionId(),(0,V.P)(Z(t));var i=t.constructor.defaultPreset;if(t.config.presets.length){var o=t.config.presets.indexOf("default");o>=0&&i&&(t.config.presets[o]=i)}else i&&t.config.presets.push(i);return t.userTimer=null,t.waitTimer=null,t.isReady=!1,t.isPlaying=!1,t.isError=!1,t.isSeeking=!1,t.isCanplay=!1,t._runPending=!1,t.rotateDeg=0,t.isActive=!1,t.isCssfullScreen=!1,t.fullscreen=!1,t._fullscreenEl=null,t._cssfullscreenEl=null,t.curDefinition=null,t._orgCss="",t._fullScreenOffset=null,t._videoHeight=0,t._videoWidth=0,t._accPlayed={t:0,acc:0,loopAcc:0},t.innerContainer=null,t.controls=null,t.topBar=null,t.topBar=null,t.root=null,t.__i18n=W.A.init(),a.A.os.isAndroid&&a.A.osVersion>0&&a.A.osVersion<6&&(t.config.autoplay=!1),t.database=new b,t.isUserActive=!1,t._initDOM()?(t._bindEvents(),t._registerPresets(),t._registerPlugins(),P.onPluginsReady(Z(t)),r.Ay.setTimeout(Z(t),(function(){t.emit(u.READY),t.onReady&&t.onReady(),t.isReady=!0}),0),t.getInitDefinition(),(t.config.videoInit||t.config.autoplay)&&(t.hasStart||t.start()),t):(console.error(new Error("can't find the dom which id is ".concat(t.config.id," or this.config.el does not exist"))),J(t))}return t=f,n=[{key:"_initDOM",value:function(){var e=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var t=this.config.el;if(!t||1!==t.nodeType)return this.emit(u.ERROR,new s.Ay("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=t}var n=P.checkPlayerRoot(this.root);n&&(V.A.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(E,this.playerId),P.init(this),this._initBaseDoms();var i=this.constructor.XgVideoProxy;if(i&&this.videoConfig.mediaType===i.mediaType){var o=this.innerContainer||this.root;this.detachVideoEvents(this.video);var r=new i(o,this.config,this.videoConfig);this.attachVideoEvents(r),this.video=r}if(this.video.setAttribute(E,this.playerId),this.config.controls){var c=P.register(this,G);this.controls=c}var l="mobile"===this.config.isMobileSimulateMode?"mobile":a.A.device;if(this.addClass("".concat(x.A.DEFAULT," ").concat(x.A.ACTIVE," xgplayer-").concat(l," ").concat(this.config.controls?"":x.A.NO_CONTROLS)),this.config.autoplay?this.addClass(x.A.ENTER):this.addClass(x.A.NO_START),this.config.fluid){var f={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(f).map((function(t){e.root.style[t]=f[t]}))}else["width","height"].map((function(t){e.config[t]&&("number"!=typeof e.config[t]?e.root.style[t]=e.config[t]:e.root.style[t]="".concat(e.config[t],"px"))}));return!0}},{key:"_initBaseDoms",value:function(){this.topBar=r.Ay.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=r.Ay.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=r.Ay.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=r.Ay.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),_.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),a.A.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),_.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==r.Ay.typeOf(e)||0!==e.length)||(e="",this.emit(u.URL_NULL),V.A.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===r.Ay.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===r.Ay.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root,i="bound HTMLVideoElement"===this.video.constructor.name;this.video instanceof window.Element&&!n.contains(i?this.video.media:this.video)&&n.insertBefore(i?this.video.media:this.video,n.firstChild);var o=this.video.readyState;V.A.logInfo("_startInit readyState",o),this.config.autoplay&&(!/^blob/.test(this.video.currentSrc)&&!/^blob/.test(this.video.src)&&this.load(),(a.A.os.isIpad||a.A.os.isPhone)&&this.videoPlay()),o>=2?this.canPlayFunc():this.once(u.CANPLAY,this.canPlayFunc),r.Ay.setTimeout(this,(function(){t.emit(u.COMPLETE)}),1),this.hasStart||P.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],o=this.config.i18n||[];t&&W.A.extend(o,this.__i18n);var r=n.join("||").toLowerCase().split("||"),a=this.plugins;i.map((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(i&&r.indexOf(i.toLowerCase())>-1)return null;if(!t&&a[i.toLowerCase()])return;if(n.lazy&&n.loader){var o=P.lazyRegister(e,n);return void(n.forceBeforeInit&&(o.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(o),1)})).catch((function(t){V.A.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(o),1)})),e._loadingPlugins.push(o)))}return e.registerPlugin(n)}catch(e){return V.A.logError("_registerPlugins:",e),null}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,o=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),r=o.plugins,a=void 0===r?[]:r,s=o.ignores,u=void 0===s?[]:s,c=o.icons,l=void 0===c?{}:c,f=o.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,I(a)),(i=e.config.ignores).push.apply(i,I(u)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var p=e.config.i18n||[];h.push.apply(h,I(p)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case A.lP.ROOT_RIGHT:t=this.rightBar;break;case A.lP.ROOT_LEFT:t=this.leftBar;break;case A.lP.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=P.formatPluginInfo(e,t),i=n.PLUFGIN,o=n.options,r=this.config.plugins;!P.checkPluginIfExits(i.pluginName,r)&&r.push(i);var a=P.getRootByConfig(i.pluginName,this.config);a.root&&(o.root=a.root),a.position&&(o.position=a.position);var s=o.position?o.position:o.config&&o.config.position||i.defaultConfig&&i.defaultConfig.position;return!o.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,o,i.pluginName):(o.root||(o.root=this._getRootByPosition(s)),P.register(this,i,o))}},{key:"deregister",value:function(e){"string"==typeof e?P.unRegister(this,e):e instanceof O.Ay&&P.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof O.Ay&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--)if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}},{key:"plugins",get:function(){return P.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=P.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(r.Ay.hasClass(this.root,e)||r.Ay.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&r.Ay.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return r.Ay.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!this.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),P.beforeInit(this).then((function(){if(t.config)return e||(e=t.url||t.config.url),t._startInit(e)})).catch((function(e){throw e.fileName="player",e.lineNumber="236",V.A.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===r.Ay.typeOf(e)&&(n=e.url);var i=this.currentTime,o=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,o&&t.once("canplay",(function(){t.pause()})),e()};a.A.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(x.A.NO_START),!this.isCanplay&&this.addClass(x.A.ENTER));var t=Q(ee(f.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(x.A.NOT_ALLOW_AUTOPLAY),e.addClass(x.A.PLAYING),e.isPlaying||(V.A.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(u.AUTOPLAY_STARTED))})).catch((function(t){if(V.A.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(x.A.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=r.Ay.setTimeout(e,(function(){e._errorTimer=null,e.emit(u.AUTOPLAY_PREVENTED),e.addClass(x.A.NOT_ALLOW_AUTOPLAY),e.removeClass(x.A.ENTER),e.pause()}),0))})):(V.A.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(x.A.NOT_ALLOW_AUTOPLAY),this.removeClass(x.A.NO_START),this.removeClass(x.A.ENTER),this.addClass(x.A.PLAYING),this.emit(u.AUTOPLAY_STARTED))),t}this.removeClass(x.A.NO_START),this.addClass(x.A.ENTER);var n=this.start();n&&n.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){Q(ee(f.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(x.A.PAUSED),(0,D.Eu)(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(){var e=this;(0,D.Eu)(this,"pause",(function(){Q(ee(f.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,o=i.isSeekedPlay,r=i.seekedStatus,a=t||(o?"play":r);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,this.once(u.CANPLAY,(function(){switch(n.removeClass(x.A.ENTER),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:!n.paused&&n.play()}})),this.isPlaying?this.currentTime=e:(this.removeClass(x.A.NO_START),this.addClass(x.A.ENTER),this.currentTime=e,"play"===a&&this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this;if(this.emit(u.DEFINITION_CHANGE,{from:t,to:e}),this.curDefinition=e.definition,this.hasStart){var i=this.switchURL(e.url);i&&i.then?i.then((function(){n.emit(u.AFTER_DEFINITION_CHANGE,{from:t,to:e})})):this.emit(u.AFTER_DEFINITION_CHANGE,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[x.A.NOT_ALLOW_AUTOPLAY,x.A.PLAYING,x.A.NO_START,x.A.PAUSED,x.A.REPLAY,x.A.ENTER,x.A.ENDED,x.A.ERROR,x.A.LOADING];this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(x.A.ENTER),this.emit(u.RESET)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),n)){var i=R();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=i[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,n=this.root;if(n&&this.video){var i=this.video.media||this.video;if(n.removeAttribute(E),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),r.Ay.clearAllTimers(this),this.emit(u.DESTROY),P.destroy(this),(0,D.Vj)(this),Q(ee(f.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(t)for(var o=t.children,a=0;a0?n.className=s.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):n.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(t){e[t]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(x.A.ENDED),this.currentTime=0,this.isSeeking=!1,(0,D.Eu)(this,"replay",(function(){e.once(u.CANPLAY,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(u.REPLAY),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(x.A.ERROR),this.addClass(x.A.LOADING),(0,D.Eu)(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(u.CANPLAY,(function(){e.videoPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=x.A.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=r.Ay.filterStyleFromText(e)),r.Ay.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=r.Ay.filterStyleFromText(t),r.Ay.addClass(t,i),t.setAttribute(E,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=x.A.PARENT_FULLSCREEN),this._orgCss&&(r.Ay.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),r.Ay.removeClass(e,n),t&&t!==e&&this._orgPCss&&(r.Ay.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",r.Ay.removeClass(t,i),t.removeAttribute(E))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.video;if(e||(e=t),this._fullScreenOffset={top:r.Ay.scrollTop(),left:r.Ay.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",r.Ay.getFullScreenEl()!==this._fullscreenEl)try{for(var i=0;i>>>key",o,window.Element.ALLOW_KEYBOARD_INPUT);var a="webkitRequestFullscreen"===o?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[o]();return a&&a.then?a:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(e)}else this.onFullscreenChange()}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||r.Ay.getFullScreenEl()){var t=this.root,n=this.video;e&&(e=t),this._fullActionFrom="exit";for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?x.A.INNER_FULLSCREEN:x.A.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(u.CSS_FULLSCREEN_CHANGE,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?x.A.INNER_FULLSCREEN:x.A.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(u.CSS_FULLSCREEN_CHANGE,!1)}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(u.PLAYER_FOCUS,X({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(u.PLAYER_BLUR,X({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3};if(this.isActive=!0,this.removeClass(x.A.ACTIVE),this.userTimer&&(r.Ay.clearTimeout(this,this.userTimer),this.userTimer=null),!1!==t.autoHide){var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=r.Ay.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}else this.userTimer&&(r.Ay.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(x.A.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(x.A.ENTER),this.removeClass(x.A.LOADING),this.isCanplay=!0,this.waitTimer&&r.Ay.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(x.A.PAUSED),this.ended&&this.removeClass(x.A.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(x.A.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(r.Ay.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(x.A.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(x.A.NOT_ALLOW_AUTOPLAY),this.removeClass(x.A.NO_START),this.removeClass(x.A.ENTER),this.removeClass(x.A.LOADING),this.addClass(x.A.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(x.A.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&r.Ay.clearTimeout(this,this.waitTimer),this.removeClass(x.A.LOADING),this.removeClass(x.A.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&r.Ay.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=r.Ay.setTimeout(this,(function(){e.addClass(x.A.LOADING),r.Ay.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[x.A.NO_START,x.A.PAUSED,x.A.ENDED,x.A.ERROR,x.A.REPLAY,x.A.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(x.A.LOADING))&&this.video.readyState>2&&(this.removeClass(x.A.LOADING),r.Ay.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(u.AUTOPLAY_STARTED)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===r.Ay.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===r.Ay.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===r.Ay.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(u.USER_ACTION,X({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.video.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,o=0;on)return!0;return!1}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.video&&e&&e.h){var t=1/e.h,n=1!==t?"scale(".concat(t,")"):"",i=0,o=0;e.y&&(o=(100-100*e.h)/2-100*e.y),e.w&&e.x&&(i=(100-100*e.w)/2-100*e.x),n+=" translate(".concat(i,"%, ").concat(o,"%)"),this.video.style.transform=n,this.video.style.webkitTransform=n}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===r.Ay.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),(0,D.Eu)(this,"playnext",(function(){t.play(),t.emit(u.PLAYNEXT,e)}))}},{key:"getVideoSize",value:function(){var e=this;if(this.video){var t=this.video,n=t.videoWidth,i=t.videoHeight,o=this.config,r=o.fitVideoSize,a=o.videoFillMode;if("fill"!==a&&"cover"!==a||this.setAttribute("data-xgfill",a),i&&n){this._videoHeight=i,this._videoWidth=n;var s=this.root.getBoundingClientRect(),c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,l=s.width,f=s.height-c,h=parseInt(n/i*1e3,10),p=parseInt(l/f*1e3,10),d=l,y=f,g={};"auto"===r&&p>h||"fixWidth"===r?(y=l/h*1e3,this.config.fluid?g.paddingTop="".concat(100*y/d,"%"):g.height="".concat(y+c,"px")):("auto"===r&&ph)&&this.setAttribute("data-xgfill","cover");var v={videoScale:h,vWidth:d,vHeight:y,cWidth:d,cHeight:y+c};this.emit(u.VIDEO_RESIZE,v)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition;n.list=e,this.emit("resourceReady",e);var i=null,o=null;e.map((function(e){t.curDefinition===e.definition&&(i=e),n.defaultDefinition===e.definition&&(o=e)})),!o&&e.length>0&&(o=e[0]),i?this.changeDefinition(i):o&&this.changeDefinition(o)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==W.A.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,P.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(W.A.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Y.A}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){var e=Q(ee(f.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=Q(ee(f.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=Q(ee(f.prototype),"networkState",this);return this.i18n[e]||e}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"avgSpeed",get:function(){return oe},set:function(e){oe=e}},{key:"realTimeSpeed",get:function(){return ie},set:function(e){ie=e}},{key:"hook",value:function(e,t){return D.A_.call.apply(D.A_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return D.uQ.call.apply(D.uQ,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return D.j.call.apply(D.j,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,o=new Array(i>3?i-3:0),r=3;r3?i-3:0),r=3;r{n.d(t,{Ay:()=>f});var i=n(46885),o=n(44727),r=n(61865);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=s(s({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return r.A_.call.apply(r.A_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o2?n-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),i.Ay.clearAllTimers(this),i.Ay.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),(0,r.Vj)(this)}}],o=[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}],n&&c(t.prototype,n),o&&c(t,o),e}()},61865:(e,t,n)=>{function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n3?i-3:0),r=3;r2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var r=arguments,a=this;if(n.pre)try{var s;(s=n.pre).call.apply(s,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var u,c=(u=this.__hooks[e]).call.apply(u,[this,this].concat(Array.prototype.slice.call(arguments)));c?c.then?c.then((function(e){var s;!1!==e&&o.apply(void 0,[a,t,n.next].concat(function(e){if(Array.isArray(e))return i(e)}(s=r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))})).catch((function(e){throw e})):o.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===c&&o.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else o.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function a(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function s(e,t){var n=this.__hooks;n&&delete n[e]}function u(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function f(e){e.__hooks=null}function h(e,t,n){for(var i=arguments.length,o=new Array(i>3?i-3:0),r=3;rr,Ay:()=>l,Eu:()=>h,Vj:()=>f,j:()=>s,oq:()=>c,tC:()=>u,uQ:()=>a})},2057:(e,t,n)=>{n.d(t,{Ay:()=>v,lP:()=>d});var i=n(46885),o=n(44727),r=n(77116),a=n(36922),s=n.n(a);function u(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=null;if(e instanceof window.Element)return i.Ay.addClass(e,n),Object.keys(r).map((function(t){e.setAttribute(t,r[t])})),e;if(y(e)||y(e.url))return r.src=y(e)?e:e.url||"",s=i.Ay.createDom(e.tag||"img","",r,"xg-img ".concat(n));if("function"==typeof e)try{return(s=e())instanceof window.Element?(i.Ay.addClass(s,n),Object.keys(r).map((function(e){s.setAttribute(e,r[e])})),s):(o.A.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(a,"] is a function mast return an Element Object")),null)}catch(e){return o.A.logError("Plugin named [".concat(a,"]:createIcon"),e),null}return"string"==typeof e?i.Ay.createDomFromHtml(e,r,n):(o.A.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(a,"] is invalid")),null)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(m,e);var t,n,r,a,y,v=(a=m,y=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(a);if(y){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function m(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),(e=v.call(this,t)).__delegates=[],e}return t=m,n=[{key:"__init",value:function(e){if(c(f(m.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,function(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var o=e[i],r=o&&o.class?o.class:"",a=o&&o.attr?o.attr:{},s=null;n&&n[i]&&(r=function(e,t){return"object"===h(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],r),a=function(e,t){return"object"===h(e)&&e.attr&&"object"===h(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],a),s=g(n[i],i,r,a,t.pluginName)),!s&&o&&(s=g(o.icon?o.icon:o,a,r,{},t.pluginName)),t.icons[i]=s}))}(this.registerIcons()||{},this),this.langText={};var r,a,s=this.registerLanguageTexts()||{};r=s,a=this,Object.keys(r).map((function(e){Object.defineProperty(a.langText,e,{get:function(){var t=a.lang,n=a.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var u="";try{u=this.render()}catch(e){throw o.A.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(u)(n=m.insert(u,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=i.Ay.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,this.parent=t;var l=this.config.attr||{},p=this.config.style||{};this.setAttr(l),this.setStyle(p),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===h(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var o,r,a=n,s=t[a],u={root:e.root};"function"==typeof s?(o=e.config[a]||{},r=s):"object"===h(s)&&"function"==typeof s.plugin&&(o=s.options?i.Ay.deepCopy(e.config[a]||{},s.options):e.config[a]||{},r=s.plugin),u.config=o,void 0!==o.index&&(u.index=o.index),o.root&&(u.root=o.root),e.registerPlugin(r,u,a)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var o=t.getAttribute&&t.getAttribute("lang-key");if(o){var r=n[o.toUpperCase()]||i[o];r&&(t.innerHTML="function"==typeof r?r(e):r)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var o=n[t]||i[t]||"";o&&(e.innerHTML=o)}},{key:"plugins",value:function(){return this._children}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var i=c(f(m.prototype),"registerPlugin",this).call(this,e,t,n);return this._children.push(i),i}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,n){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.bindEL(e,t)})):this.bindEL(e,t);else{var o=m.delegate.call(this,this.root,e,t,n);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),o=0;o2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,n)}},{key:"unbindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,n)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return o.A.logError("Plugin:appendChild",e),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),c(f(m.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],r=[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,o=Number(n),r=e instanceof window.Node;if(i){for(var a=0,s=null,u="";a=o){u="beforebegin";break}c4&&void 0!==arguments[4]&&arguments[4],r=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var a=s()(e,t,n,i,o);a.key="".concat(t,"_").concat(n),r.push(a)}));else{var a=s()(e,t,n,i,o);a.key="".concat(t,"_").concat(n),r.push(a)}return r}},{key:"ROOT_TYPES",get:function(){return p}},{key:"POSITIONS",get:function(){return d}}],n&&u(t.prototype,n),r&&u(t,r),m}(r.Ay)},32593:(e,t,n)=>{n.d(t,{A:()=>i});const i={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"}},44727:(e,t,n)=>{n.d(t,{A:()=>a,P:()=>s});var i="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,o={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},r="%c[xgplayer]",a={config:{debug:i?3:1},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a=3&&(t=console).log.apply(t,[r,o.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a=1&&(t=console).warn.apply(t,[r,o.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,a=new Array(i>1?i-1:0),s=1;s{n.d(t,{A:()=>s});var i=/(Android)\s([\d.]+)/,o=/(Version)\/([\d.]+)/,r=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],a={get device(){return a.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),o=/(?:Firefox)/.test(e),r=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||o&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!r,s=!(a||i||n||r),u=/(?:iPad|PlayBook)/.test(e);return{isTablet:r,isPhone:a,isIpad:u,isIos:a||u,isAndroid:i,isPc:s,isSymbian:n,isWindowsPhone:t,isFireFox:o}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?o:i)?t.exec(e):[];if(n&&n.length>=3){var r=n[2].split(".");return r.length>0?parseInt(r[0]):0}return 0},get isWeixin(){return"undefined"!=typeof navigator&&!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&r.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var o=MediaSource.isTypeSupported(n.contentType),r=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:o&&r,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}};const s=a},46885:(e,t,n)=>{n.d(t,{Dq:()=>h,Ay:()=>u,Xo:()=>f,nF:()=>l});var i=n(44727);function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=t||n<0||h&&e-l>=r}function m(){var e=Date.now();if(v(e))return b(e);s=g(m,function(e){var n=e-l,i=t-(e-u);return h?Math.min(i,r-n):i}(e))}function b(e){return s=void 0,p&&i?y(e):(i=o=void 0,a)}function _(){for(var e=Date.now(),n=v(e),r=arguments.length,c=new Array(r),p=0;p0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=document.createElement(e);return o.className=i,o.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,r=n[t];"video"===e||"audio"===e||"live-video"===e?r&&o.setAttribute(i,r):o.setAttribute(i,r)})),o},u.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var o=document.createElement("div");o.innerHTML=e;var r=o.children;return o=null,r.length>0?(r=r[0],n&&u.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return i.A.logError("util.createDomFromHtml",e),null}},u.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===s(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},u.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){u.hasClass(e,t)||(e.className&&"object"===s(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},u.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){u.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===s(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},u.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){u.hasClass(e,t)?u.removeClass(e,t):u.addClass(e,t)}))},u.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===u.typeOf(e[n])?t.push(e[n]):"Object"===u.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(o){i.A.logError("util.findDom",o),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},u.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},u.padStart=function(e,t,n){for(var i=String(n),o=0|t,r=Math.ceil(o/i.length),a=[],s=String(e);r--;)a.push(i);return a.join("").substring(0,o-s.length)+s},u.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=u.padStart(Math.floor(e/3600),2,0),n=u.padStart(Math.floor((e-3600*t)/60),2,0),i=u.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},u.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},u.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},u.deepCopy=function(e,t){if("Object"===u.typeOf(t)&&"Object"===u.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==u.typeOf(t[n])||t[n]instanceof Node?"Array"===u.typeOf(t[n])?e[n]="Array"===u.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:u.deepCopy(e[n],t[n])})),e},u.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i,o;"Array"===u.typeOf(t[n])&&"Array"===u.typeOf(e[n])?"Array"===u.typeOf(e[n])&&(i=e[n]).push.apply(i,function(e){if(Array.isArray(e))return a(e)}(o=t[n])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):u.typeOf(e[n])!==u.typeOf(t[n])||null===e[n]||"Object"!==u.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):u.deepMerge(e[n],t[n])})),e},u.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},u.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},u.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},u.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},u.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),u.clearTimeout(e,i)}),n);return e._timers.push(i),i},u.clearTimeout=function(e,t){var n=e._timers;if("Array"===u.typeOf(n)){for(var i=0;i-1&&i.indexOf(e)>-1&&(o=parseFloat(n.slice(0,n.indexOf(e)).trim()),r=parseFloat(i.slice(0,i.indexOf(e)).trim()),a=e,1))})),s.style.width="".concat(o).concat(a),s.style.height="".concat(r).concat(a),s.style.backgroundSize="".concat(o).concat(a," ").concat(r).concat(a),s.style.margin="start"===e?"-".concat(r/2).concat(a," auto auto -").concat(o/2).concat(a):"auto 5px auto 5px"),s},u.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},u.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},u.checkIsFunction=function(e){return e&&"function"==typeof e},u.checkIsObject=function(e){return null!==e&&"object"===s(e)},u.hide=function(e){e.style.display="none"},u.show=function(e,t){e.style.display=t||"block"},u.isUndefined=function(e){if(null==e)return!0},u.setStyleFromCsstext=function(e,t){t&&("String"===u.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},u.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),o={},r={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(function(e,t){for(var n=0,i=t.length;n-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(r).map((function(t){e.style[t]=r[t]})),o},u.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},u.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},u.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},u.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},u.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},u.checkTouchSupport=function(){return"ontouchstart"in window},u.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;iu&&(o[s-1].end=n[a].end):o.push(n[a])}else o.push(n[a])}else o=n;return new r(o)},u.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},u.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},u.getHostFromUrl=function(e){if("String"!==u.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},u.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},u.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},u.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))}},60490:(e,t,n)=>{n.d(t,{A:()=>i});const i=JSON.parse('"3.0.0-alpha.110-01"')},14957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PLATER_ID=t.EXIT_FULLSCREEN_API=t.GET_FULLSCREEN_API=t.FULLSCREEN_EVENTS=void 0,t.FULLSCREEN_EVENTS=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],t.GET_FULLSCREEN_API=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],t.EXIT_FULLSCREEN_API=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],t.PLATER_ID="data-xgplayerid"},85907:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_TYPE_MAP=t.ErrorTypes=t.default=void 0;var i=r(n(39374)),o=r(n(73291));function r(e){return e&&e.__esModule?e:{default:e}}t.ERROR_TYPE_MAP={1:"network",2:"network",3:"decoder",4:"format"},t.ErrorTypes={network:{code:1},mse:{code:2},parse:{code:3},format:{code:4},decoder:{code:5},runtime:{code:6},timeout:{code:7},other:{code:8}},t.default=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.video){var a=n.mediaError?n.mediaError:t.video.error||{},s=t.duration,u=t.currentTime,c=t.ended,l=t.src,f=t.currentSrc,h=t.video,p=h.readyState,d=h.networkState,y={playerVersion:i.default,domain:document.domain,currentTime:u,duration:s,ended:c,readyState:p,networkState:d,src:n.src||l||f,errorType:n.errorType,errorCode:n.errorCode||a.code,message:n.errorMessage||a.message,mediaError:a,originError:n.originError?n.originError.stack:"",host:o.default.getHostFromUrl(l||f)};return n.ext&&Object.keys(n.ext).map((function(e){y[e]=n.ext[e]})),y}if(arguments.length>1){for(var g={playerVersion:i.default,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],m=0;m{Object.defineProperty(t,"__esModule",{value:!0}),t.STATS_EVENTS=t.SOURCE_SUCCESS=t.SOURCE_ERROR=t.RESET=t.USER_ACTION=t.XGLOG=t.SHORTCUT=t.PLAYNEXT=t.SCREEN_SHOT=t.ROTATE=t.PIP_CHANGE=t.VIDEO_RESIZE=t.RETRY=t.SEI_PARSED=t.AFTER_DEFINITION_CHANGE=t.BEFORE_DEFINITION_CHANGE=t.DEFINITION_CHANGE=t.MINI_STATE_CHANGE=t.CSS_FULLSCREEN_CHANGE=t.FULLSCREEN_CHANGE=t.DOWNLOAD_SPEED_CHANGE=t.URL_CHANGE=t.DESTROY=t.REPLAY=t.COMPLETE=t.AUTOPLAY_PREVENTED=t.AUTOPLAY_STARTED=t.URL_NULL=t.READY=t.PLAYER_BLUR=t.PLAYER_FOCUS=t.BUFFER_CHANGE=t.ABORT=t.SUSPEND=t.STALLED=t.EMPTIED=t.LOAD_START=t.PROGRESS=t.RATE_CHANGE=t.LOADED_DATA=t.VOLUME_CHANGE=t.DURATION_CHANGE=t.CANPLAY_THROUGH=t.CANPLAY=t.WAITING=t.TIME_UPDATE=t.SEEKED=t.SEEKING=t.ERROR=t.PAUSE=t.ENDED=t.PLAYING=t.PLAY=void 0,t.PLAY="play",t.PLAYING="playing",t.ENDED="ended",t.PAUSE="pause",t.ERROR="error",t.SEEKING="seeking",t.SEEKED="seeked",t.TIME_UPDATE="timeupdate",t.WAITING="waiting",t.CANPLAY="canplay",t.CANPLAY_THROUGH="canplaythrough",t.DURATION_CHANGE="durationchange",t.VOLUME_CHANGE="volumechange",t.LOADED_DATA="loadeddata",t.RATE_CHANGE="ratechange",t.PROGRESS="progress",t.LOAD_START="loadstart",t.EMPTIED="emptied",t.STALLED="stalled",t.SUSPEND="suspend",t.ABORT="abort",t.BUFFER_CHANGE="bufferedChange",t.PLAYER_FOCUS="focus",t.PLAYER_BLUR="blur",t.READY="ready",t.URL_NULL="urlNull",t.AUTOPLAY_STARTED="autoplay_started",t.AUTOPLAY_PREVENTED="autoplay_was_prevented",t.COMPLETE="complete",t.REPLAY="replay",t.DESTROY="destroy",t.URL_CHANGE="urlchange",t.DOWNLOAD_SPEED_CHANGE="download_speed_change",t.FULLSCREEN_CHANGE="fullscreen_change",t.CSS_FULLSCREEN_CHANGE="cssFullscreen_change",t.MINI_STATE_CHANGE="mini_state_change",t.DEFINITION_CHANGE="definition_change",t.BEFORE_DEFINITION_CHANGE="before_definition_change",t.AFTER_DEFINITION_CHANGE="after_definition_change",t.SEI_PARSED="SEI_PARSED",t.RETRY="retry",t.VIDEO_RESIZE="video_resize",t.PIP_CHANGE="pip_change",t.ROTATE="rotate",t.SCREEN_SHOT="screenShot",t.PLAYNEXT="playnext",t.SHORTCUT="shortcut",t.XGLOG="xglog",t.USER_ACTION="user_action",t.RESET="reset",t.SOURCE_ERROR="source_error",t.SOURCE_SUCCESS="source_success",t.STATS_EVENTS={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"}},97143:(e,t,n)=>{function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"Sniffer",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"Errors",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"XG_DEBUG",{enumerable:!0,get:function(){return u.default}}),t.Events=t.default=void 0;var o=h(n(73291)),r=h(n(64604)),a=h(n(85907)),s=f(n(61964));t.Events=s;var u=h(n(78428)),c=f(n(48216));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}function h(e){return e&&e.__esModule?e:{default:e}}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function d(e){for(var t=1;t1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=d(d({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return c.hook.call.apply(c.hook,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o2?n-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),o.default.clearAllTimers(this),o.default.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),(0,c.delHooksDescriptor)(this)}}],i=[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}],n&&g(t.prototype,n),i&&g(t,i),e}();t.default=m},48216:(e,t)=>{function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n3?i-3:0),r=3;r1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})},t.hook=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var r=arguments,a=this;if(o.pre)try{var s;(s=o.pre).call.apply(s,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var u,c=(u=this.__hooks[e]).call.apply(u,[this,this].concat(Array.prototype.slice.call(arguments)));c?c.then?c.then((function(e){var s;!1!==e&&i.apply(void 0,[a,t,o.next].concat(function(e){if(Array.isArray(e))return n(e)}(s=r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))})).catch((function(e){throw e})):i.apply(void 0,[this,t,o.next].concat(Array.prototype.slice.call(arguments))):void 0===c&&i.apply(void 0,[this,t,o.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else i.apply(void 0,[this,t,o.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)},t.useHooks=function(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)},t.usePluginHooks=function(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o3?i-3:0),r=3;r{function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"Sniffer",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"Errors",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"BasePlugin",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"ROOT_TYPES",{enumerable:!0,get:function(){return c.ROOT_TYPES}}),Object.defineProperty(t,"POSITIONS",{enumerable:!0,get:function(){return c.POSITIONS}}),Object.defineProperty(t,"pluginsManager",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"hooksDescriptor",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"STATE_CLASS",{enumerable:!0,get:function(){return h.default}}),t.Events=void 0;var o=y(n(73291)),r=y(n(64604)),a=y(n(85907)),s=d(n(61964));t.Events=s;var u=y(n(97143)),c=d(n(14986)),l=y(n(29622)),f=y(n(48216)),h=y(n(56406));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}function y(e){return e&&e.__esModule?e:{default:e}}},14986:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.POSITIONS=t.ROOT_TYPES=t.default=void 0;var i,o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==f(e)&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var s=o?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=e[r]}return i.default=e,n&&n.set(e,i),i}(n(97143)),r=(i=n(36922))&&i.__esModule?i:{default:i};function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=null;if(e instanceof window.Element)return o.Util.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(d(e)||d(e.url))return i.src=d(e)?e:e.url||"",a=o.Util.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(a=e())instanceof window.Element?(o.Util.addClass(a,n),Object.keys(i).map((function(e){a.setAttribute(e,i[e])})),a):(o.XG_DEBUG.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return o.XG_DEBUG.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?o.Util.createDomFromHtml(e,i,n):(o.XG_DEBUG.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}t.POSITIONS=p;var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(v,e);var t,n,i,a,d,g=(a=v,d=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(a);if(d){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function v(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),(e=g.call(this,t)).__delegates=[],e}return t=v,n=[{key:"__init",value:function(e){if(u(l(v.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,function(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var o=e[i],r=o&&o.class?o.class:"",a=o&&o.attr?o.attr:{},s=null;n&&n[i]&&(r=function(e,t){return"object"===f(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],r),a=function(e,t){return"object"===f(e)&&e.attr&&"object"===f(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],a),s=y(n[i],i,r,a,t.pluginName)),!s&&o&&(s=y(o.icon?o.icon:o,a,r,{},t.pluginName)),t.icons[i]=s}))}(this.registerIcons()||{},this),this.langText={};var i,r,a=this.registerLanguageTexts()||{};i=a,r=this,Object.keys(i).map((function(e){Object.defineProperty(r.langText,e,{get:function(){var t=r.lang,n=r.i18n;return n[e]?n[e]:i[e]&&i[e][t]||""}})}));var s="";try{s=this.render()}catch(e){throw o.XG_DEBUG.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(s)(n=v.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=o.Util.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,this.parent=t;var c=this.config.attr||{},h=this.config.style||{};this.setAttr(c),this.setStyle(h),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===f(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,a=n,s=t[a],u={root:e.root};"function"==typeof s?(i=e.config[a]||{},r=s):"object"===f(s)&&"function"==typeof s.plugin&&(i=s.options?o.Util.deepCopy(e.config[a]||{},s.options):e.config[a]||{},r=s.plugin),u.config=i,void 0!==i.index&&(u.index=i.index),i.root&&(u.root=i.root),e.registerPlugin(r,u,a)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var o=t.getAttribute&&t.getAttribute("lang-key");if(o){var r=n[o.toUpperCase()]||i[o];r&&(t.innerHTML="function"==typeof r?r(e):r)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var o=n[t]||i[t]||"";o&&(e.innerHTML=o)}},{key:"plugins",value:function(){return this._children}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var i=u(l(v.prototype),"registerPlugin",this).call(this,e,t,n);return this._children.push(i),i}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,n){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.bindEL(e,t)})):this.bindEL(e,t);else{var o=v.delegate.call(this,this.root,e,t,n);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),o=0;o2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,n)}},{key:"unbindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,n)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return o.XG_DEBUG.logError("Plugin:appendChild",e),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),u(l(v.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],i=[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,o=Number(n),r=e instanceof window.Node;if(i){for(var a=0,s=null,u="";a=o){u="beforebegin";break}c4&&void 0!==arguments[4]&&arguments[4],a=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var s=(0,r.default)(e,t,n,i,o);s.key="".concat(t,"_").concat(n),a.push(s)}));else{var s=(0,r.default)(e,t,n,i,o);s.key="".concat(t,"_").concat(n),a.push(s)}return a}},{key:"ROOT_TYPES",get:function(){return h}},{key:"POSITIONS",get:function(){return p}}],n&&s(t.prototype,n),i&&s(t,i),v}(o.default);t.default=g},29622:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,o=n(16323),r=(i=n(73291))&&i.__esModule?i:{default:i},a={pluginGroup:{},init:function(e){var t=e._pluginInfoId;t||(t=(new Date).getTime(),e._pluginInfoId=t),!e.config.closeResizeObserver&&(0,o.addObserver)(e.root,(function(){e.getVideoSize()})),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[t]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var o=this.pluginGroup[i]._plugins,a=this.pluginGroup[i]._originalOptions;n.player=this.pluginGroup[i]._player;var s=n.pluginName||t.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var u=Object.keys(a),c=0;c0&&this.setCurrentUserActive(u[u.length-1],!0)}}}};t.default=a},16323:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addObserver=function(e,t){return s||(s=new a),s.addObserver(e,t),s},t.unObserver=function(e,t){s.unObserver(e,t)},t.destroyObserver=function(e,t){s.destroyObserver(e,t)};var i=n(73291),o=n(14957);function r(e,t){for(var n=0;n-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n{function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var u=r?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(o,a,u):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}(n(27437)),a=(o=n(78428))&&o.__esModule?o:{default:o};function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function u(e,t){for(var n=0;n0?parseInt(t.videoWidth/t.videoHeight*100,10):0,("realtime"===e.config.mode||n-e.preTime>=e.interval)&&(t&&t.videoWidth&&e.update(i,e.videoPI),e.preTime=n)),e.frameId=r.Util.requestAnimationFrame(e.start))})),h(l(e),"stop",(function(){e.frameId&&(r.Util.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return t=v,o=[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,mode:"framerate",frameRate:10,filter:"blur(50px)",addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof d?d:d=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===r.Sniffer.browser||"firefox"===r.Sniffer.browser)}}],(n=[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),v.isSupport||(this.config.disable=!0);var t=this.config,n=t.disable,i=t.mode;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/this.config.frameRate,10),this.canvas=null,this.canvasCtx=null,this.once(r.Events.COMPLETE,(function(){e.player&&(e.init(),e.player.paused||e.start())})),"poster"!==i&&(i!==p&&(this.on(r.Events.EMPTIED,(function(){e.stop()})),this.on(r.Events.PLAY,(function(){e.start()})),this.on(r.Events.PAUSE,(function(){e.stop()}))),i===p&&this.once(r.Events.TIME_UPDATE,(function(){e.renderOnce()}))))}},{key:"init",value:function(){var e=this.player,t=this.config;this.canvasFilter=v.supportCanvasFilter();try{var n=this.config.isInnerRender&&e.innerContainer||e.root;n.insertAdjacentHTML("afterbegin",'
\n
'),this.root=n.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(e){a.default.logError("plugin:DynamicBg",e)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==r.Sniffer.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===r.Util.typeOf(e)?e:"String"===r.Util.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,o=n.height,r=new window.Image;r.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=o,t.canvas.width=i;var e=parseInt(i/o*100,10);t.update(r,e),r=null}},r.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,o=this.canvas.getBoundingClientRect(),r=o.width,s=o.height;if(r!==n.width||s!==n.height||n.pi!==t){var u=parseInt(r/s*100,10);n.pi=t,n.width=this.canvas.width=r,n.height=this.canvas.height=s;var c=s,l=r;ut&&(c=parseInt(100*r/t,10)),n.rwidth=l*i.multiple,n.rheight=c*i.multiple,n.x=(r-n.rwidth)/2,n.y=(s-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){a.default.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}])&&u(t.prototype,n),o&&u(t,o),v}(r.default);t.default=y},56406:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"}},78428:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bindDebug=function(e){e.logInfo=r.logInfo.bind(e),e.logWarn=r.logWarn.bind(e),e.logError=r.logError.bind(e)},t.default=void 0;var n="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,i={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},o="%c[xgplayer]",r={config:{debug:n?3:1},logInfo:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a=3&&(t=console).log.apply(t,[o,i.info,e].concat(r))},logWarn:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a=1&&(t=console).warn.apply(t,[o,i.warn,e].concat(r))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",r=arguments.length,a=new Array(r>1?r-1:0),s=1;s{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=/(Android)\s([\d.]+)/,i=/(Version)\/([\d.]+)/,o=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],r={get device(){return r.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),o=/(?:Firefox)/.test(e),r=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||o&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!r,s=!(a||i||n||r),u=/(?:iPad|PlayBook)/.test(e);return{isTablet:r,isPhone:a,isIpad:u,isIos:a||u,isAndroid:i,isPc:s,isSymbian:n,isWindowsPhone:t,isFireFox:o}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",o=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?i:n)?t.exec(e):[];if(o&&o.length>=3){var r=o[2].split(".");return r.length>0?parseInt(r[0]):0}return 0},get isWeixin(){return"undefined"!=typeof navigator&&!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&o.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var o=MediaSource.isTypeSupported(n.contentType),r=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:o&&r,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}},a=r;t.default=a},73291:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=l,t.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return c(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),l(e,t,{leading:i,trailing:o,maxWait:t})},t.getLang=function(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"===e&&(e="zh"),e},t.checkIsCurrentVideo=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}},t.default=void 0;var i=r(n(78428)),o=r(n(38729));function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=t||n<0||h&&e-l>=r}function m(){var e=Date.now();if(v(e))return b(e);s=g(m,function(e){var n=e-l,i=t-(e-u);return h?Math.min(i,r-n):i}(e))}function b(e){return s=void 0,p&&i?y(e):(i=o=void 0,a)}function _(){for(var e=Date.now(),n=v(e),r=arguments.length,c=new Array(r),p=0;p0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=document.createElement(e);return o.className=i,o.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,r=n[t];"video"===e||"audio"===e||"live-video"===e?r&&o.setAttribute(i,r):o.setAttribute(i,r)})),o},u.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var o=document.createElement("div");o.innerHTML=e;var r=o.children;return o=null,r.length>0?(r=r[0],n&&u.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return i.default.logError("util.createDomFromHtml",e),null}},u.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===s(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},u.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){u.hasClass(e,t)||(e.className&&"object"===s(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},u.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){u.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===s(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},u.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){u.hasClass(e,t)?u.removeClass(e,t):u.addClass(e,t)}))},u.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===u.typeOf(e[n])?t.push(e[n]):"Object"===u.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(o){i.default.logError("util.findDom",o),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},u.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},u.padStart=function(e,t,n){for(var i=String(n),o=0|t,r=Math.ceil(o/i.length),a=[],s=String(e);r--;)a.push(i);return a.join("").substring(0,o-s.length)+s},u.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=u.padStart(Math.floor(e/3600),2,0),n=u.padStart(Math.floor((e-3600*t)/60),2,0),i=u.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},u.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},u.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},u.deepCopy=function(e,t){if("Object"===u.typeOf(t)&&"Object"===u.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==u.typeOf(t[n])||t[n]instanceof Node?"Array"===u.typeOf(t[n])?e[n]="Array"===u.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:u.deepCopy(e[n],t[n])})),e},u.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i,o;"Array"===u.typeOf(t[n])&&"Array"===u.typeOf(e[n])?"Array"===u.typeOf(e[n])&&(i=e[n]).push.apply(i,function(e){if(Array.isArray(e))return a(e)}(o=t[n])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):u.typeOf(e[n])!==u.typeOf(t[n])||null===e[n]||"Object"!==u.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):u.deepMerge(e[n],t[n])})),e},u.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},u.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},u.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},u.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},u.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),u.clearTimeout(e,i)}),n);return e._timers.push(i),i},u.clearTimeout=function(e,t){var n=e._timers;if("Array"===u.typeOf(n)){for(var i=0;i-1&&i.indexOf(e)>-1&&(o=parseFloat(n.slice(0,n.indexOf(e)).trim()),r=parseFloat(i.slice(0,i.indexOf(e)).trim()),a=e,1))})),s.style.width="".concat(o).concat(a),s.style.height="".concat(r).concat(a),s.style.backgroundSize="".concat(o).concat(a," ").concat(r).concat(a),s.style.margin="start"===e?"-".concat(r/2).concat(a," auto auto -").concat(o/2).concat(a):"auto 5px auto 5px"),s},u.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},u.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},u.checkIsFunction=function(e){return e&&"function"==typeof e},u.checkIsObject=function(e){return null!==e&&"object"===s(e)},u.hide=function(e){e.style.display="none"},u.show=function(e,t){e.style.display=t||"block"},u.isUndefined=function(e){if(null==e)return!0},u.setStyleFromCsstext=function(e,t){t&&("String"===u.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},u.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),o={},r={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(function(e,t){for(var n=0,i=t.length;n-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(r).map((function(t){e.style[t]=r[t]})),o},u.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},u.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},u.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},u.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},u.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},u.checkTouchSupport=function(){return"ontouchstart"in window},u.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;iu&&(r[s-1].end=n[a].end):r.push(n[a])}else r.push(n[a])}else r=n;return new o.default(r)},u.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},u.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},u.getHostFromUrl=function(e){if("String"!==u.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},u.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},u.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},u.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))}},38729:(e,t)=>{function n(e,t){for(var n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=JSON.parse('"3.0.0-alpha.110-01"');t.default=n}}]);