+
+
+
+
+ 00:00
+ /
+ 00:00
+
+
+
+
+ ${this.config.pressRate}X${this.i18n.FORWARD}
+
+
+ `}}],[{key:`pluginName`,get:function(){return`mobile`}},{key:`defaultConfig`,get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,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:360*1e3,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(s6);function B8(e){e.preventDefault(),e.returnValue=!1}function V8(e){var t=e.tagName;return!!(t===`INPUT`||t===`TEXTAREA`||e.isContentEditable)}var H8=function(e){I2(n,e);var t=H2(n);function n(){var e;M2(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),F2(B2(e),`onBodyKeyDown`,function(t){if(e.player){var n=t||window.event,r=n.keyCode,i=B2(e),a=i._keyState,o=i.player,s=e.config,c=s.disable,l=s.disableBodyTrigger,u=s.isIgnoreUserActive;if(c||l||!(o.isUserActive||u)||V8(n.target)||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey){a.isBodyKeyDown=!1;return}!t.repeat&&!a.isKeyDown&&((n.target===document.body||e.config.isGlobalTrigger&&!V8(n.target))&&e.checkCode(r,!0)&&(a.isBodyKeyDown=!0),document.addEventListener(`keyup`,e.onBodyKeyUp)),a.isBodyKeyDown&&e.handleKeyDown(n)}}),F2(B2(e),`onBodyKeyUp`,function(t){e.player&&(document.removeEventListener(`keyup`,e.onBodyKeyUp),e.handleKeyUp(t))}),F2(B2(e),`onKeydown`,function(t){if(e.player){var n=t||window.event,r=B2(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;n&&(n.keyCode===37||e.checkCode(n.keyCode))&&(n.target===e.player.root||n.target===e.player.video||n.target===e.player.controls.el)&&(r.isKeyDown=!0),e.player.root.addEventListener(`keyup`,e.onKeyup)}r.isKeyDown&&e.handleKeyDown(n)}}),F2(B2(e),`onKeyup`,function(t){e.player&&(e.player.root.removeEventListener(`keyup`,e.onKeyup),e.handleKeyUp(t))}),e}return P2(n,[{key:`mergekeyCodeMap`,value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map(function(n){e.keyCodeMap[n]?[`keyCode`,`action`,`disable`,`pressAction`,`disablePress`,`isBodyTarget`].map(function(r){t[n][r]&&(e.keyCodeMap[n][r]=t[n][r])}):e.keyCodeMap[n]=t[n]})}},{key:`afterCreate`,value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e=typeof this.config.seekStep==`function`?this.config.seekStep(this.player):this.config.seekStep;!e||typeof e!=`number`||(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:`playPause`,disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:`upVolume`,disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:`downVolume`,disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:`seekBack`,disablePress:!1,disable:!1},right:{keyCode:39,action:`seek`,pressAction:`changePlaybackRate`,disablePress:!1,disable:!1},esc:{keyCode:27,action:`exitFullscreen`,disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener(`keydown`,this.onKeydown),document.addEventListener(`keydown`,this.onBodyKeyDown)}},{key:`setConfig`,value:function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]})}},{key:`checkIsVisible`,value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,r=e.bottom,i=window.innerHeight;return!(n<0&&n<0-t*.9||r>0&&r-i>t*.9)}},{key:`checkCode`,value:function(e,t){var n=this,r=!1;return Object.keys(this.keyCodeMap).map(function(i){n.keyCodeMap[i]&&e===n.keyCodeMap[i].keyCode&&!n.keyCodeMap[i].disable&&(r=!t||t&&!n.keyCodeMap[i].noBodyTarget)}),r}},{key:`downVolume`,value:function(e){var t=this.player;if(!(t.volume<=0)){var n=parseFloat((t.volume-.1).toFixed(1)),r={volume:{from:t.volume,to:n}};this.emitUserAction(e,`change_volume`,{props:r}),n>=0?t.volume=n:t.volume=0}}},{key:`upVolume`,value:function(e){var t=this.player;if(!(t.volume>=1)){var n=parseFloat((t.volume+.1).toFixed(1)),r={volume:{from:t.volume,to:n}};this.emitUserAction(e,`change_volume`,{props:r}),n<=1?t.volume=n:t.volume=1}}},{key:`seek`,value:function(e){var t=this.player,n=t.currentTime,r=t.offsetCurrentTime,i=t.duration,a=t.offsetDuration,o=t.timeSegments,s=r>-1?r:n,c=a||i,l=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;s+l<=c?s+=l:s=c;var u=Q.getCurrentTimeByOffset(s,o),d={currentTime:{from:n,to:u}};this.emitUserAction(e,`seek`,{props:d}),this.player.currentTime=u}},{key:`seekBack`,value:function(e){var t=this.player,n=t.currentTime,r=t.offsetCurrentTime,i=t.timeSegments,a=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,o=(r>-1?r:n)-a;o<0&&(o=0),o=Q.getCurrentTimeByOffset(o,i);var s={currentTime:{from:n,to:o}};this.emitUserAction(e,`seek`,{props:s}),this.player.currentTime=o}},{key:`changePlaybackRate`,value:function(e){var t=this._keyState,n=this.config,r=this.player;t.playbackRate===0&&(t.playbackRate=r.playbackRate,r.playbackRate=n.playbackRate)}},{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.fullscreen,r=t.cssfullscreen;n&&(this.emitUserAction(`keyup`,`switch_fullscreen`,{prop:`fullscreen`,from:n,to:!n}),t.exitFullscreen()),r&&(this.emitUserAction(`keyup`,`switch_css_fullscreen`,{prop:`cssfullscreen`,from:r,to:!r}),t.exitCssFullscreen())}},{key:`handleKeyDown`,value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:`handleKeyUp`,value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:`handleKeyCode`,value:function(e,t,n){for(var r=Object.keys(this.keyCodeMap),i=0;i
+
+
+`,`image/svg+xml`).firstChild}var hre=function(e){I2(n,e);var t=H2(n);function n(){return M2(this,n),t.apply(this,arguments)}return P2(n,[{key:`registerIcons`,value:function(){return{loadingIcon:mre}}},{key:`afterCreate`,value:function(){this.appendChild(`xg-loading-inner`,this.icons.loadingIcon)}},{key:`render`,value:function(){return`
+
+
+ `}}],[{key:`pluginName`,get:function(){return`loading`}},{key:`defaultConfig`,get:function(){return{position:$3.ROOT}}}]),n}(s6),gre=function(e){I2(n,e);var t=H2(n);function n(){var e;M2(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),F2(B2(e),`_onDurationChange`,function(){e.updateSegments();var t=e.player,n=t.currentTime,r=t.timeSegments;if(e._checkIfEnabled(r)){var i=Q.getIndexByTime(n,r),a=Q.getOffsetCurrentTime(n,r,i);e.player.offsetCurrentTime=a,e.changeIndex(i,r)}}),F2(B2(e),`_onLoadedData`,function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var n=Q.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=n,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}}),F2(B2(e),`_onTimeupdate`,function(){var t=e.player,n=t.currentTime,r=t.timeSegments;if(e._checkIfEnabled(r)){var i=r.length;e.lastCurrentTime=n;var a=Q.getIndexByTime(n,r);a!==e.curIndex&&e.changeIndex(a,r);var o=Q.getOffsetCurrentTime(n,r,a);if(e.player.offsetCurrentTime=o,e.curPos){var s=e.curPos,c=s.start,l=s.end;nl&&a>=i-1&&e.player.pause()}}}),F2(B2(e),`_onSeeking`,function(){var t=e.player,n=t.currentTime,r=t.timeSegments;if(e._checkIfEnabled(r))if(nr[r.length-1].end)e.player.currentTime=r[r.length-1].end;else{var i=Q.getIndexByTime(n,r);if(i>=0){var a=e.getSeekTime(n,e.lastCurrentTime,i,r);a>=0&&(e.player.currentTime=a)}}}),F2(B2(e),`_onPlay`,function(){var t=e.player,n=t.currentTime,r=t.timeSegments;e._checkIfEnabled(r)&&n>=r[r.length-1].end&&(e.player.currentTime=r[0].start)}),e}return P2(n,[{key:`afterCreate`,value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(P4,this._onDurationChange),this.on(I4,this._onLoadedData),this.on(A4,this._onTimeupdate),this.on(O4,this._onSeeking),this.on(C4,this._onPlay)}},{key:`setConfig`,value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach(function(n){t.config[n]=e[n]}),this.updateSegments())}}},{key:`updateSegments`,value:function(){var e=this.config,t=e.disable,n=e.segments,r=this.player;if(t||!n||n.length===0)r.timeSegments=[],r.offsetDuration=0,r.offsetCurrentTime=-1;else{var i=this.formatTimeSegments(n,r.duration);r.timeSegments=i,r.offsetDuration=i.length>0?i[i.length-1].duration:0}}},{key:`formatTimeSegments`,value:function(e,t){var n=[];return e?(e.sort(function(e,t){return e.start-t.start}),e.forEach(function(e,r){var i={};if(i.start=e.start<0?0:e.start,i.end=t>0&&e.end>t?t:e.end,!(t>0&&i.start>t)){n.push(i);var a=i.end-i.start;if(r===0)i.offset=e.start,i.cTime=0,i.segDuration=a,i.duration=a;else{var o=n[r-1];i.offset=o.offset+(i.start-o.end),i.cTime=o.duration+o.cTime,i.segDuration=a,i.duration=o.duration+a}}}),n):[]}},{key:`getSeekTime`,value:function(e,t,n,r){var i=-1,a=r[n],o=a.start,s=a.end;if(e>=o&&e<=s)return i;var c=e-t;if(c<0&&eo?t-o:0;return i=n-1>=0?r[n-1].end+c+l:0,i}return-1}},{key:`_checkIfEnabled`,value:function(e){return!(!e||e.length<1)}},{key:`changeIndex`,value:function(e,t){this.curIndex=e,e>=0&&t.length>0?this.curPos=t[e]:this.curPos=null}}],[{key:`pluginName`,get:function(){return`TimeSegmentsControls`}},{key:`defaultConfig`,get:function(){return{disable:!0,segments:[]}}}]),n}(Y3);function _re(){return new DOMParser().parseFromString(`
+`,`image/svg+xml`).firstChild}var vre=function(e){I2(n,e);var t=H2(n);function n(e){var r;return M2(this,n),r=t.call(this,e),r.rotateDeg=r.config.rotateDeg||0,r}return P2(n,[{key:`afterCreate`,value:function(){var e=this;if(!this.config.disable){W2(L2(n.prototype),`afterCreate`,this).call(this),this.appendChild(`.xgplayer-icon`,this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(`.xgplayer-icon`,[`click`,`touchend`],this.onBtnClick),this.on(m3,function(){e.rotateDeg&&e.config.innerRotate&&Q.setTimeout(e,function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)},100)});var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:`destroy`,value:function(){W2(L2(n.prototype),`destroy`,this).call(this),this.unbind(`.xgplayer-icon`,[`click`,`touchend`],this.onBtnClick)}},{key:`onBtnClick`,value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,`rotate`),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:`updateRotateDeg`,value:function(e,t){if(e||=0,t){this.player.videoRotateDeg=e;return}var n=this.player,r=this.rootWidth,i=this.rootHeight,a=n.root,o=n.innerContainer,s=n.media,c=a.offsetWidth,l=o&&t?o.offsetHeight:a.offsetHeight,u=r,d=i,f=0,p=0;(e===.75||e===.25)&&(u=`${l}px`,d=`${c}px`,f=-(l-c)/2,p=-(c-l)/2);var m=`translate(${f}px,${p}px) rotate(${e}turn)`,h={transformOrigin:`center center`,transform:m,webKitTransform:m,height:d,width:u},g=t?s:a,_=t?n.getPlugin(`poster`):null;Object.keys(h).map(function(e){g.style[e]=h[e],_&&_.root&&(_.root.style[e]=h[e])})}},{key:`rotate`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.player;this.rotateDeg||=0;var i=e?1:-1;this.rotateDeg=(this.rotateDeg+1+i*.25*n)%1,this.updateRotateDeg(this.rotateDeg,t),r.emit(g3,this.rotateDeg*360)}},{key:`registerIcons`,value:function(){return{rotate:_re}}},{key:`render`,value:function(){if(!this.config.disable)return`
+
+
+
+ ${I6(this,`ROTATE_TIPS`,this.playerConfig.isHideTips)}
+ `}}],[{key:`pluginName`,get:function(){return`rotate`}},{key:`defaultConfig`,get:function(){return{position:$3.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(L6);function yre(){return new DOMParser().parseFromString(``,`image/svg+xml`).firstChild}function bre(){return new DOMParser().parseFromString(``,`image/svg+xml`).firstChild}var U8={PIP:`picture-in-picture`,INLINE:`inline`,FULLSCREEN:`fullscreen`},xre=function(e){I2(n,e);var t=H2(n);function n(){var e;M2(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),F2(B2(e),`switchPIP`,function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,`change_pip`,{props:`pip`,from:!0,to:!1}),e.setAttr(`data-state`,`normal`)):e.player.media.readyState===4&&(e.requestPIP(),e.emitUserAction(t,`change_pip`,{props:`pip`,from:!1,to:!0}),e.setAttr(`data-state`,`pip`))}),e}return P2(n,[{key:`beforeCreate`,value:function(e){typeof e.player.config.pip==`boolean`&&(e.config.showIcon=e.player.config.pip)}},{key:`afterCreate`,value:function(){var e=this;this.isPIPAvailable()&&(W2(L2(n.prototype),`afterCreate`,this).call(this),this.pMode=U8.INLINE,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(Q4,function(){e.config.showIcon&&(Q.removeClass(e.find(`.xgplayer-icon`),`xg-icon-disable`),e.bind(`click`,e.switchPIP))}))}},{key:`registerIcons`,value:function(){return{pipIcon:{icon:yre,class:`xg-get-pip`},pipIconExit:{icon:bre,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;Q.setTimeout(e,function(){!n&&t.mediaPlay()},0),!n&&t.mediaPlay(),e.setAttr(`data-state`,`normal`),e.pipWindow=null,t.emit(h3,!1)},this.enterPIPCallback=function(n){t.emit(h3,!0),n!=null&&n.pictureInPictureWindow&&(e.pipWindow=n.pictureInPictureWindow),e.setAttr(`data-state`,`pip`)},this.onWebkitpresentationmodechanged=function(n){var r=t.media.webkitPresentationMode;e.pMode===U8.FULLSCREEN&&r!==U8.FULLSCREEN&&t.onFullscreenChange(null,!1),e.pMode=r,r===U8.PIP?e.enterPIPCallback(n):r===U8.INLINE&&e.leavePIPCallback(n)},t.media&&(t.media.addEventListener(`enterpictureinpicture`,this.enterPIPCallback),t.media.addEventListener(`leavepictureinpicture`,this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener(`webkitpresentationmodechanged`,this.onWebkitpresentationmodechanged))}},{key:`copyStyleIntoPiPWindow`,value:function(e){var t=K2(document.styleSheets).map(function(t){try{return K2(t.cssRules).map(function(e){return e.cssText}).join(``)}catch{var n=document.createElement(`link`);n.rel=`stylesheet`,n.type=t.type,n.media=t.media,n.href=t.href,e.document.head.appendChild(n)}return``}).filter(Boolean).join(`
+`),n=document.createElement(`style`);n.textContent=t,e.document.head.appendChild(n)}},{key:`requestPIP`,value:function(){var e=this,t=this.player,r=this.playerConfig,i=this.config;if(!(!this.isPIPAvailable()||this.isPip))try{var a=r.poster;if(a&&(t.media.poster=Q.typeOf(a)===`String`?a:a.poster),i.preferDocument&&this.isDocPIPAvailable()){var o={};if(i.width&&i.height)o.width=i.width,o.height=i.height;else{var s=t.root.getBoundingClientRect();o.width=s.width,o.height=s.height}documentPictureInPicture.requestWindow(o).then(function(n){var r=i.docPiPNode,a=i.docPiPStyle;e.enterPIPCallback();var o=r||t.root,s=o.parentElement,c=o.previousSibling,l=o.nextSibling;e.copyStyleIntoPiPWindow(n);var u=document.createElement(`style`);if(u.append(`body{padding:0; margin:0;}`),a){var d=``;typeof a==`string`?d=a:typeof a==`function`&&(d=a.call(i)),d&&u.append(d)}else o===t.root&&u.append(`
+ .xgplayer{width: 100%!important; height: 100%!important;}
+ `);n.document.head.append(u),n.document.body.append(o),n.addEventListener(`pagehide`,function(t){s&&(l?s.insertBefore(o,l):c?s.insertBefore(o,c.nextSibling):s.appendChild(o)),e.leavePIPCallback()},{once:!0})})}else n.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode(`picture-in-picture`):t.media.requestPictureInPicture();return!0}catch(e){return console.error(`requestPiP`,e),!1}}},{key:`exitPIP`,value:function(){var e=this.player;try{if(this.isPIPAvailable()&&this.isPip){var t;this.isDocPIPAvailable()&&(t=documentPictureInPicture)!=null&&t.window?documentPictureInPicture.window.close():n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode(`inline`):document.exitPictureInPicture()}return!0}catch(e){return console.error(`exitPIP`,e),!1}}},{key:`isPip`,get:function(){var e,t=this.player;return!!(this.isDocPIPAvailable()&&(e=documentPictureInPicture)!=null&&e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===U8.PIP}},{key:`isPIPAvailable`,value:function(){var e=this.player.media;return(Q.typeOf(document.pictureInPictureEnabled)===`Boolean`?document.pictureInPictureEnabled:!1)&&(Q.typeOf(e.disablePictureInPicture)===`Boolean`&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&Q.typeOf(e.webkitSetPresentationMode)===`Function`)||this.isDocPIPAvailable()}},{key:`isDocPIPAvailable`,value:function(){return`documentPictureInPicture`in window&&/^(https|file)/.test(location.protocol)}},{key:`destroy`,value:function(){W2(L2(n.prototype),`destroy`,this).call(this);var e=this.player;e.media.removeEventListener(`enterpictureinpicture`,this.enterPIPCallback),e.media.removeEventListener(`leavepictureinpicture`,this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener(`webkitpresentationmodechanged`,this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind(`click`,this.btnClick)}},{key:`render`,value:function(){if(!(!this.config.showIcon||!this.isPIPAvailable()))return`
+
+
+ ${I6(this,`PIP`,this.playerConfig.isHideTips)}
+ `}}],[{key:`pluginName`,get:function(){return`pip`}},{key:`defaultConfig`,get:function(){return{position:$3.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:`checkWebkitSetPresentationMode`,value:function(e){return typeof e.webkitSetPresentationMode==`function`}}]),n}(L6);function Sre(){return new DOMParser().parseFromString(`
+`,`image/svg+xml`).firstChild}var Cre=function(e){I2(n,e);var t=H2(n);function n(e){var r;return M2(this,n),r=t.call(this,e),F2(B2(r),`playNext`,function(e){var t=B2(r).player;e.preventDefault(),e.stopPropagation(),r.idx+1
+
+
+ ${I6(this,`PLAYNEXT_TIPS`,this.playerConfig.isHideTips)}
+
+ `}}],[{key:`pluginName`,get:function(){return`playNext`}},{key:`defaultConfig`,get:function(){return{position:$3.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(s6);function wre(){return new DOMParser().parseFromString(`
+`,`image/svg+xml`).firstChild}var W8={mimeType:`application/octet-stream`,fileName:`download`,timeout:3e4},G8={supportsBlob:function(){return typeof Blob<`u`},supportsObjectURL:function(){return typeof URL<`u`&&URL.createObjectURL},isSafari:function(){return _4.browser===`safari`},isIEWithMsSaveBlob:function(){return navigator.msSaveBlob},supportsDownloadAttribute:function(){return`download`in document.createElement(`a`)}},K8={isDataURL:function(e){return/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(e)},dataURLToBlob:function(e){for(var t=e.split(/[:;,]/),n=t[1],r=(t[e.indexOf(`charset`)>0?3:2]===`base64`?atob:decodeURIComponent)(t.pop()),i=new Uint8Array(r.length),a=0;a1&&arguments[1]!==void 0?arguments[1]:{},n=new XMLHttpRequest;return t.timeout&&(n.timeout=t.timeout),typeof t.withCredentials==`boolean`&&(n.withCredentials=t.withCredentials),n},setHeaders:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Object.entries(t).forEach(function(t){var n=G2(t,2),r=n[0],i=n[1];e.setRequestHeader(r,i)})},downloadFromURL:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new Promise(function(r,i){var a=J8.createRequest(e,n);a.open(`GET`,e,!0),a.responseType=`blob`,n.headers&&J8.setHeaders(a,n.headers),n.withCredentials&&(a.withCredentials=!0),a.onload=function(e){e.target.status===200?(Y8(e.target.response,t,n.mimeType||W8.mimeType),r(e.target.response)):i(Error(`HTTP ${e.target.status}: ${e.target.statusText}`))},a.onerror=function(){i(Error(`Network error occurred`))},a.ontimeout=function(){i(Error(`Request timeout`))},n.beforeRequest&&n.beforeRequest(a),setTimeout(function(){return a.send()},0)})}};function Y8(e,t,n){var r={},i=W8.fileName,a=W8.mimeType;if(typeof t==`string`?(i=t||W8.fileName,a=n||W8.mimeType):j2(t)===`object`&&t!==null&&(r=A2(A2({},W8),t),i=r.fileName||W8.fileName,a=r.mimeType||W8.mimeType),String(this)===`true`){var o=e;e=t,t=o,a=n||W8.mimeType}if(typeof e==`string`&&!t&&!n&&e.length<2048){var s=e;i=s.split(`/`).pop().split(`?`)[0]||W8.fileName;var c=document.createElement(`a`);if(c.href=s,c.href.indexOf(s)!==-1)return J8.downloadFromURL(s,i,r)}if(K8.isDataURL(e))if(e.length>1024*1024*1.999&&G8.supportsBlob()){var l=K8.dataURLToBlob(e);return a=l.type||a,Y8(l,i,a)}else return G8.isIEWithMsSaveBlob()?navigator.msSaveBlob(K8.dataURLToBlob(e),i):q8.downloadWithAnchor(e,i);if(typeof e==`string`&&K8.hasNonASCII(e)){var u=K8.stringToUint8Array(e);e=new(window.Blob||window.MozBlob||window.WebKitBlob||function(e,t){return e})([u],{type:a})}var d=e instanceof Blob?e:new(window.Blob||window.MozBlob||window.WebKitBlob||function(e,t){return e})([e],{type:a});if(G8.isIEWithMsSaveBlob())return navigator.msSaveBlob(d,i);if(G8.supportsObjectURL()){var f=URL.createObjectURL(d);return q8.downloadWithAnchor(f,i)}if(G8.isSafari())return q8.downloadWithSafari(d,i);if(typeof d==`string`||d.constructor===String)try{var p=`data:`+a+`;base64,`+btoa(d);return q8.downloadWithAnchor(p,i)}catch{var m=`data:`+a+`,`+encodeURIComponent(d);return q8.downloadWithAnchor(m,i)}var h=new FileReader;return h.onload=function(e){q8.downloadWithAnchor(e.target.result,i)},h.readAsDataURL(d),q8.downloadWithIframe(d,i)}function Tre(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=A2(A2({},W8),t),r=n.fileName||e.split(`/`).pop().split(`?`)[0]||`download`;return J8.downloadFromURL(e,r,n)}var Ere=function(e){I2(n,e);var t=H2(n);function n(e){var r;return M2(this,n),r=t.call(this,e),F2(B2(r),`download`,function(e){if(!r.isLock){r.emitUserAction(e,`download`);var t=r.playerConfig.url,n=``;Q.typeOf(t)===`String`?n=t:Q.typeOf(t)===`Array`&&t.length>0&&(n=t[0].src),Tre(r.getAbsoluteURL(n),Object.assign({},r.config.saveAsOptions||{})),r.isLock=!0,r.timer=window.setTimeout(function(){r.isLock=!1,window.clearTimeout(r.timer),r.timer=null},300)}}),r.timer=null,r.isLock=!1,r}return P2(n,[{key:`afterCreate`,value:function(){W2(L2(n.prototype),`afterCreate`,this).call(this),!this.config.disable&&(this.appendChild(`.xgplayer-icon`,this.icons.download),this._handler=this.hook(`click`,this.download,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind([`click`,`touchend`],this._handler))}},{key:`registerIcons`,value:function(){return{download:wre}}},{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(){W2(L2(n.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`
+
+
+ ${I6(this,`DOWNLOAD_TIPS`,this.playerConfig.isHideTips)}
+ `}}],[{key:`pluginName`,get:function(){return`download`}},{key:`defaultConfig`,get:function(){return{position:$3.CONTROLS_RIGHT,index:3,disable:!0,saveAsOptions:{}}}}]),n}(L6),Dre=function(e){I2(n,e);var t=H2(n);function n(){return M2(this,n),t.apply(this,arguments)}return P2(n,[{key:`beforeCreate`,value:function(e){typeof e.player.config.screenShot==`boolean`&&(e.config.disable=!e.player.config.screenShot)}},{key:`afterCreate`,value:function(){W2(L2(n.prototype),`afterCreate`,this).call(this),this.appendChild(`.xgplayer-icon`,this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(m3,this.initSize)}},{key:`onPluginsReady`,value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind([`click`,`touchend`],this.onClickBtn)}},{key:`saveScreenShot`,value:function(e,t){var n=document.createElement(`a`);n.href=e,n.download=t;var r;try{typeof MouseEvent<`u`?r=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window}):(r=document.createEvent(`MouseEvents`),r.initMouseEvent(`click`,!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null))}catch(e){console.error(`MouseEvent unsupported`,e)}r&&n.dispatchEvent(r)}},{key:`createCanvas`,value:function(e,t){var n=document.createElement(`canvas`),r=n.getContext(`2d`);this.canvasCtx=r,this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height,r.imageSmoothingEnabled=!0,r.imageSmoothingEnabled&&(r.imageSmoothingQuality=`high`)}},{key:`onClickBtn`,value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,`shot`);var n=this.config;this.shot(n.width,n.height).then(function(e){t.emit(_3,e),n.saveImg&&t.saveScreenShot(e,n.name+n.format)})}},{key:`shot`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{quality:.92,type:`image/png`},i=this.config,a=this.player,o=r.quality||i.quality,s=r.type||i.type;return new Promise(function(r,c){var l=null,u;if(a.media.canvas)l=a.media.canvas;else{n.canvas?(n.canvas.width=e||i.width,n.canvas.height=t||i.height):n.createCanvas(e,t),l=n.canvas,u=n.canvasCtx;var d=a.media.videoWidth/a.media.videoHeight,f=l.width/l.height,p=0,m=0,h=a.media.videoWidth,g=a.media.videoHeight,_,v,y,b;d>f?(y=l.width,b=l.width/d,_=0,v=Math.round((l.height-b)/2)):d===f?(y=l.width,b=l.height,_=0,v=0):d
+
+ ${this.icons.screenshotIcon?``:`${this.i18n[t]}`}
+
+ `}}}],[{key:`pluginName`,get:function(){return`screenShot`}},{key:`defaultConfig`,get:function(){return{position:$3.CONTROLS_RIGHT,index:5,quality:.92,type:`image/png`,format:`.png`,width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:`screenshot`}}}]),n}(L6),Ore=function(){function e(t){M2(this,e),this.config=t.config,this.parent=t.root,this.root=Q.createDom(`ul`,``,{},`xg-options-list xg-list-slide-scroll ${this.config.className}`),t.root.appendChild(this.root);var n=this.config.maxHeight;n&&this.setStyle({maxHeight:n}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var r=this.config.domEventType===`touch`?`touchend`:`click`;this._delegates=s6.delegate.call(this,this.root,`li`,r,this.onItemClick)}return P2(e,[{key:`renderItemList`,value:function(e){var t=this,n=this.config,r=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map(function(e){r.style[e]=n[e]}),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML=``,e.map(function(e,n){var r=e.selected?`option-item selected`:`option-item`;e[`data-index`]=n,t.root.appendChild(Q.createDom(`li`,`${e.showText}`,e,r))})}},{key:`onItemClick`,value:function(e){e.delegateTarget||=e.target;var t=e.delegateTarget;if(t&&Q.hasClass(t,`selected`))return!1;var n=typeof this.config.onItemClick==`function`?this.config.onItemClick:null,r=this.root.querySelector(`.selected`);Q.addClass(t,`selected`),r&&Q.removeClass(r,`selected`),n(e,{from:r?this.getAttrObj(r,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 r=e.getAttribute(`data-index`);return r&&(n.index=Number(r)),n}},{key:`show`,value:function(){Q.removeClass(this.root,`hide`),Q.addClass(this.root,`active`)}},{key:`hide`,value:function(){Q.removeClass(this.root,`active`),Q.addClass(this.root,`hide`)}},{key:`setStyle`,value:function(e){var t=this;Object.keys(e).forEach(function(n){t.root.style[n]=e[n]})}},{key:`destroy`,value:function(){this._delegates&&=(this._delegates.map(function(e){e.destroy&&e.destroy()}),null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),X8={SIDE:`side`,MIDDLE:`middle`,DEFAULT:`default`},Z8={CLICK:`click`,HOVER:`hover`};function kre(e,t){return e===X8.SIDE?t===$3.CONTROLS_LEFT?`xg-side-list xg-left-side`:`xg-side-list xg-right-side`:``}var Q8=_4.device===`mobile`,$8=function(e){I2(n,e);var t=H2(n);function n(e){var r;return M2(this,n),r=t.call(this,e),F2(B2(r),`onEnter`,function(e){e.stopPropagation(),r.emit(`icon_mouseenter`,{pluginName:r.pluginName}),r.switchActiveState(e)}),F2(B2(r),`switchActiveState`,function(e){e.stopPropagation(),r.config.toggleMode===Z8.CLICK?r.toggle(!r.isActive):r.toggle(!0)}),F2(B2(r),`onLeave`,function(e){e.stopPropagation(),r.emit(`icon_mouseleave`,{pluginName:r.pluginName}),r.config.listType!==X8.SIDE&&r.isActive&&r.toggle(!1)}),F2(B2(r),`onListEnter`,function(e){r.enterType=2}),F2(B2(r),`onListLeave`,function(e){r.enterType=0,r.isActive&&r.toggle(!1)}),r.isIcons=!1,r.isActive=!1,r.curValue=null,r.curIndex=0,r}return P2(n,[{key:`updateLang`,value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:`afterCreate`,value:function(){var e=this,t=this.config;this.initIcons(),Q8||=this.domEventType===`touch`,Q8&&_4.device===`mobile`&&t.listType===X8.DEFAULT&&(t.listType=X8.SIDE),t.hidePortrait&&Q.addClass(this.root,`portrait`),this.on([m3,o3],function(){e._resizeList()}),this.once(M4,function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())}),Q8&&this.on(`focus`,function(){e.isActive&&=(e.optionsList&&e.optionsList.hide(),!1)}),Q8?(t.toggleMode=Z8.CLICK,this.activeEvent=`touchend`):this.activeEvent=t.toggleMode===Z8.CLICK?`click`:`mouseenter`,t.toggleMode===Z8.CLICK?this.bind(this.activeEvent,this.switchActiveState):(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),r=!1;n.length>0&&(n.forEach(function(n){e.appendChild(`.xgplayer-icon`,t[n]),!r&&(r=t[n])}),this.isIcons=r),!r&&(this.appendChild(`.xgplayer-icon`,Q.createDom(`span`,``,{},`icon-text`)),Q.addClass(this.find(`.xgplayer-icon`),`btn-text`))}},{key:`show`,value:function(e){!this.config.list||this.config.list.length<2||Q.addClass(this.root,`show`)}},{key:`hide`,value:function(){Q.removeClass(this.root,`show`)}},{key:`getTextByLang`,value:function(e,t,n){if(e===void 0)return``;var r=this.config.list;!n&&(n=this.player.lang),t=!t||Q.isUndefined(e[t])?`text`:t,typeof e==`number`&&(e=r[e]);try{return j2(e[t])===`object`?e[t][n]||e[t].en:e[t]}catch(e){return console.warn(e),``}}},{key:`toggle`,value:function(e){if(!(e===this.isActive||this.config.disable)){var t=this.player.controls,n=this.config.listType;e?(n===X8.SIDE?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(n===X8.SIDE?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:`onItemClick`,value:function(e,t){e.stopPropagation();var n=this.config,r=n.listType,i=n.list;this.curIndex=t.to.index,this.curItem=i[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||Q8||r===X8.SIDE)&&this.toggle(!1)}},{key:`onIconClick`,value:function(e){}},{key:`changeCurrentText`,value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex
+
+
+ `}}],[{key:`pluginName`,get:function(){return`optionsIcon`}},{key:`defaultConfig`,get:function(){return{position:$3.CONTROLS_RIGHT,index:100,list:[],listType:`default`,listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:Z8.HOVER,heightLimit:!0}}}]),n}(s6),Are=function(e){I2(n,e);var t=H2(n);function n(e){var r;return M2(this,n),r=t.call(this,e),r.curTime=0,r.isPaused=!0,r}return P2(n,[{key:`beforeCreate`,value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map(function(e){return!e.text&&e.name&&(e.text=e.name),e.text||=e.definition,e}))}},{key:`afterCreate`,value:function(){var e=this;W2(L2(n.prototype),`afterCreate`,this).call(this),this.on(`resourceReady`,function(t){e.changeDefinitionList(t)}),this.on(l3,function(t){e.renderItemList(e.config.list,t.to)}),this.player.definitionList.length<2&&this.hide()}},{key:`show`,value:function(e){!this.config.list||this.config.list.length<2||Q.addClass(this.root,`show`)}},{key:`initDefinition`,value:function(){var e=this.config,t=e.list,n=e.defaultDefinition;if(t.length>0){var r=null;t.map(function(e){e.definition===n&&(r=e)}),r||=t[0],this.changeDefinition(r)}}},{key:`renderItemList`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.list||[],r=arguments.length>1?arguments[1]:void 0,i=r&&r.definition?r.definition:this.config.defaultDefinition;r&&t.forEach(function(e){e.selected=!1});var a=0,o=t.map(function(t,n){var r=A2(A2({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==i)&&(r.selected=!0,a=n),r});W2(L2(n.prototype),`renderItemList`,this).call(this,o,a)}},{key:`changeDefinitionList`,value:function(e){Array.isArray(e)&&(this.config.list=e.map(function(e){return!e.text&&e.name&&(e.text=e.name),e.text||=e.definition,e}),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:`changeDefinition`,value:function(e,t){this.player.changeDefinition(e,t)}},{key:`onItemClick`,value:function(e,t){var r=this.player.definitionList;W2(L2(n.prototype),`onItemClick`,this).apply(this,arguments),this.emitUserAction(e,`change_definition`,{from:t.from,to:t.to});for(var i=0;i0&&arguments[0]!==void 0?arguments[0]:{},t=this.player,n=e.errorType,r=t.errorNote?this.i18n[t.errorNote]:``;if(!r)switch(n){case`decoder`:r=this.i18n.MEDIA_ERR_DECODE;break;case`network`:r=this.i18n.MEDIA_ERR_NETWORK;break;default:r=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(`.xgplayer-error-text`).innerHTML=r,this.find(`.xgplayer-error-tips`).innerHTML=`${this.i18n.REFRESH_TIPS}${this.i18n.REFRESH}`}},{key:`destroy`,value:function(){this.unbind(`.xgplayer-error-refresh`,`click`,this.clickHandler)}},{key:`render`,value:function(){return`
+
+
+
+
+ `}}],[{key:`pluginName`,get:function(){return`error`}}]),n}(s6),Nre=function(e){I2(n,e);var t=H2(n);function n(){return M2(this,n),t.apply(this,arguments)}return P2(n,[{key:`afterCreate`,value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(`.highlight`,[`click`,`touchend`],function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))}),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:`setStyle`,value:function(e){var t=this;Object.keys(e).map(function(n){t.root.style[n]=e[n]})}},{key:`showPrompt`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(e){this.customOnClick=r;var i=this.config.interval;if(this.intervalId&&=(clearTimeout(this.intervalId),null),Q.addClass(this.root,`show`),n.mode===`arrow`&&Q.addClass(this.root,`arrow`),typeof e==`string`?this.find(`.xgplayer-prompt-detail`).innerHTML=e:this.find(`.xgplayer-prompt-detail`).innerHTML=`${e.text||``}${e.highlight?`${e.highlight}`:``}`,n.style&&this.setStyle(n.style),typeof n.autoHide==`boolean`?n.autoHide:this.config.autoHide){var a=n.interval||i;this.intervalId=setTimeout(function(){t.hide()},a)}}}},{key:`hide`,value:function(){Q.removeClass(this.root,`show`),Q.removeClass(this.root,`arrow`),this.root.removeAttribute(`style`),this.customOnClick=null}},{key:`render`,value:function(){return`
+
+ `}}],[{key:`pluginName`,get:function(){return`prompt`}},{key:`defaultConfig`,get:function(){return{interval:3e3,style:{},mode:`arrow`,autoHide:!0,detail:{text:``,highlight:``},onClick:function(){}}}}]),n}(s6),e5={time:0,text:``,id:1,duration:1,color:`#fff`,style:{},width:6,height:6};function t5(e){Object.keys(e5).map(function(t){e[t]===void 0&&(e[t]=e5[t])})}var n5={_updateDotDom:function(e,t){if(t){var n=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left=`${n.left}%`,r.width=`${n.width}%`,t.setAttribute(`data-text`,e.text),t.setAttribute(`data-time`,e.time),n.isMini?Q.addClass(t,`mini`):Q.removeClass(t,`mini`),Object.keys(r).map(function(e){t.style[e]=r[e]})}},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&&arguments[1]!==void 0?arguments[1]:!0,n=this.player.plugins.progress;if(n&&(t&&(t5(e),this._ispots.push(e)),!(!this.ispotsInit&&t))){var r=this.calcuPosition(e.time,e.duration),i=e.style||{};i.left=`${r.left}%`,i.width=`${r.width}%`;var a=`xgspot_${e.id} xgplayer-spot`;r.isMini&&(a+=` mini`);var o=e.template?`${e.template}
`:``,s=Q.createDom(`xg-spot`,o,{"data-text":e.text,"data-time":e.time,"data-id":e.id},a);Object.keys(i).map(function(e){s.style[e]=i[e]}),n.outer&&n.outer.appendChild(s),this.positionDot(s,e.id)}},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&&arguments[1]!==void 0?arguments[1]:!1,n=this.player.plugins.progress;if(n){var r=this.findDot(e.id);if(r&&Object.keys(e).map(function(t){r[t]=e[t]}),this.ispotsInit){var i=n.find(`xg-spot[data-id="${e.id}"]`);i&&(this._updateDotDom(e,i),t&&this.showDot(e.id))}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var r=[],i=0;i=0;a--)if(t.splice(r[a],1),this.ispotsInit){var o=n.find(`xg-spot[data-id="${e}"]`);o&&o.parentElement.removeChild(o)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e){if(!this.ispotsInit){this._ispots=[];return}for(var t=e.root.getElementsByTagName(`xg-spot`),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}},updateAllDots:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=this.player.plugins.progress;if(n){if(!this.ispotsInit){this._ispots=t;return}this._ispots=[];var r=n.root.getElementsByTagName(`xg-spot`),i=r.length;if(i>t.length)for(var a=i-1;a>t.length-1;a--)n.outer.removeChild(r[a]);t.forEach(function(t,n){n0&&r.hide();var n=r.player.plugins.progress;n&&n.disableBlur(),r._curDot.addEventListener(`mouseleave`,r.onDotMouseLeave)}}),r._ispots=[],r.videoPreview=null,r.videothumbnail=null,r.thumbnail=null,r.timeStr=``,r._state={now:0,f:!1},r}return P2(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.seekTime&&e.player.seek(n.seekTime)}),this.transformTimeHook=this.hook(`transformTime`,function(t){e.setTimeContent(Q.format(t))}),Pre(this),this.on(P4,function(){e.show()}),this.config.disable&&this.disable(),this.extTextRoot=this.find(`.xg-spot-ext-text`)}},{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(r5).map(function(n){e[r5[n]]=e[r5[n]].bind(e),t.addCallBack(n,e[r5[n]])}),_4.device!==`mobile`)){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(r){r.stopPropagation(),n(parseInt(e._state.now*1e3,10)/1e3,r),t&&t.onMouseUp(r)},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&&Q.addClass(this.videoPreview,`show`))}},{key:`onProgressDragEnd`,value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!1,this.videoPreview&&Q.removeClass(this.videoPreview,`show`))}},{key:`onProgressClick`,value:function(e,t){this.config.disable||Q.hasClass(t.target,`xgplayer-spot`)&&(t.stopPropagation(),t.preventDefault(),[`time`,`id`,`text`].map(function(n){e[n]=t.target.getAttribute(`data-${n}`)}),e.time&&=Number(e.time),this.handlerSpotClick(t,e))}},{key:`updateLinePos`,value:function(e,t){var n=this.root,r=this.previewLine,i=this.player,a=this.config,o=i.controls.mode===`flex`,s=n.getBoundingClientRect().width;if(!(!s&&this._hasThumnail)){s=this._hasThumnail&&st-s&&!o?(l=c-(t-s),c=t-s):l=0,l!==void 0&&(r.style.transform=`translateX(${l.toFixed(2)}px)`),n.style.transform=`translateX(${c.toFixed(2)}px) translateZ(0)`}}},{key:`updateTimeText`,value:function(e){var t=this.timeText,n=this.timePoint;t.innerHTML=e,!this.thumbnail&&(n.innerHTML=e)}},{key:`updatePosition`,value:function(e,t,n,r){var i=this.root,a=this.config,o=this._state;if(i){o.now=n,this.transformTimeHook(n);var s=this.timeStr;r&&r.target&&Q.hasClass(r.target,`xgplayer-spot`)?(this.showTips(r.target.getAttribute(`data-text`),!1,s),this.focusDot(r.target),o.f=!0,a.isFocusDots&&o.f&&(o.now=parseInt(r.target.getAttribute(`data-time`),10))):a.defaultText?(o.f=!1,this.showTips(a.defaultText,!0,s)):(o.f=!1,this.hideTips(``)),this.updateTimeText(s),this.updateThumbnails(o.now),this.updateLinePos(e,t)}}},{key:`setTimeContent`,value:function(e){this.timeStr=e}},{key:`updateThumbnails`,value:function(e){var t=this.player,n=this.videoPreview,r=this.config,i=t.plugins.thumbnail;if(i&&i.usable){this.thumbnail&&i.update(this.thumbnail,e,r.width,r.height);var a=n&&n.getBoundingClientRect();this.videothumbnail&&i.update(this.videothumbnail,e,a.width,a.height)}}},{key:`registerThumbnail`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_4.device!==`mobile`){var t=this.player,n=this.config,r=t.getPlugin(`thumbnail`);if(r&&r.setConfig(e),!r||!r.usable||!n.isShowThumbnail){Q.addClass(this.root,`short-line no-thumbnail`);return}else Q.removeClass(this.root,`short-line no-thumbnail`);n.mode===`short`&&Q.addClass(this.root,`short-line`),this._hasThumnail=!0;var i=this.find(`.xg-spot-thumbnail`);this.thumbnail=r.createThumbnail(i,`progress-thumbnail`),n.isShowCoverPreview&&(this.videoPreview=Q.createDom(`xg-video-preview`,``,{},`xgvideo-preview`),t.root.appendChild(this.videoPreview),this.videothumbnail=r.createThumbnail(this.videoPreview,`xgvideo-thumbnail`)),this.updateThumbnails(0)}}},{key:`calcuPosition`,value:function(e,t){var n=this.player.plugins.progress,r=this.player,i=n.root.getBoundingClientRect().width,a=r.duration/i*6;return e+t>r.duration&&(t=r.duration-e),e/r.duration*100,t/r.duration,{left:e/r.duration*100,width:t/r.duration*100,isMini:t2&&arguments[2]!==void 0?arguments[2]:``;Q.addClass(this.root,`no-timepoint`),e&&(Q.addClass(this.find(`.xg-spot-content`),`show-text`),t&&this.config.mode===`production`?(Q.addClass(this.root,`product`),this.tipText.textContent=e):(Q.removeClass(this.root,`product`),this.tipText.textContent=this._hasThumnail?e:`${n} ${e}`))}},{key:`hideTips`,value:function(){Q.removeClass(this.root,`no-timepoint`),this.tipText.textContent=``,Q.removeClass(this.find(`.xg-spot-content`),`show-text`),Q.removeClass(this.root,`product`)}},{key:`hide`,value:function(){Q.addClass(this.root,`hide`)}},{key:`show`,value:function(e){Q.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(r5).map(function(n){t.removeCallBack(n,e[r5[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 _4.device===`mobile`||this.playerConfig.isMobileSimulateMode===`mobile`?``:``}}],[{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}(s6),Ire=function(e){I2(n,e);var t=H2(n);function n(e){var r;return M2(this,n),r=t.call(this,e),r.ratio=1,r.interval=null,r._preloadMark={},r}return P2(n,[{key:`afterCreate`,value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([P4],function(){var t=e.config,n=t.pic_num,r=t.interval;e.usable&&(e.interval=r>0?r:Math.round(e.player.duration*1e3/n)/1e3)})}},{key:`setConfig`,value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach(function(n){t.config[n]=e[n]}),this.usable&&this.initThumbnail())}}},{key:`usable`,get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:`initThumbnail`,value:function(){var e=this.config,t=e.width,n=e.height,r=e.pic_num,i=e.interval;this.ratio=t/n*100,this.interval=i||Math.round(this.player.duration/r),this._preloadMark={}}},{key:`getUrlByIndex`,value:function(e){return e>=0&&e0&&i.push(e-1),i.push(e),e>0&&e=0&&e1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=this.config,i=r.pic_num,a=r.row,o=r.col,s=r.width,c=r.height;this.interval=Math.round(this.player.duration/i);var l=Math.ceil(e/this.interval);l=l>i?i:l;var u=l0?Math.ceil(d/o)-1:0,p=d>0?d-f*o-1:0,m=0,h=0;t&&n?t/n2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:``,a=this.config,o=a.pic_num,s=a.urls;if(!(o<=0||!s||s.length===0)){var c=this.getPosition(t,n,r);this.preload(c.urlIndex),Object.keys(c.style).map(function(t){e.style[t]=c.style[t]}),Object.keys(i).map(function(t){e.style[t]=i[t]})}}},{key:`changeConfig`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.setConfig(e)}},{key:`createThumbnail`,value:function(e,t){var n=Q.createDom(`xg-thumbnail`,``,{},`thumbnail ${t}`);return e&&e.appendChild(n),n}}],[{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}(s6);function i5(e){return e?`background:${e};`:``}var Lre=function(e){I2(n,e);var t=H2(n);function n(){var e;M2(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),F2(B2(e),`onTimeupdate`,function(){var t=e.player.ended,n=B2(e).offsetDuration,r=e.currentTime;r=Q.adjustTimeByDuration(r,n,t),e.update({played:r},n)}),e}return P2(n,[{key:`offsetDuration`,get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:`currentTime`,get:function(){var e=this.player,t=e.offsetCurrentTime,n=e.currentTime;return t>=0?t:n}},{key:`afterCreate`,value:function(){var e=this;this.root&&(this.on(A4,this.onTimeupdate),this.on(V4,function(){e.reset()}))}},{key:`reset`,value:function(){this.update({played:0,cached:0},0)}},{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 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=`${e.cached/t*100}%`),e.played&&(this.find(`xg-mini-progress-played`).style.width=`${e.played/t*100}%`))}},{key:`render`,value:function(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var n=this.config,r=n.mode,i=n.height,a={cached:i5(t.cachedColor),played:i5(t.playedColor),progress:i5(t.progressColor),height:i>0&&i!==2?`height: ${i}px;`:``};return`
+
+
+ `}}}],[{key:`pluginName`,get:function(){return`MiniProgress`}},{key:`defaultConfig`,get:function(){return{mode:`auto`,height:2}}}]),n}(s6),a5={REAL_TIME:`realtime`,FIRST_FRAME:`firstframe`,FRAME_RATE:`framerate`,POSTER:`poster`};function Rre(){try{return parseInt(window.performance.now(),10)}catch{return new Date().getTime()}}function zre(){try{return!!document.createElement(`canvas`).getContext}catch{return!1}}var o5=null,Bre=function(e){I2(n,e);var t=H2(n);function n(){var e;M2(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),F2(B2(e),`onLoadedData`,function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(A4,e.renderOnTimeupdate),e.on(A4,e.renderOnTimeupdate))}),F2(B2(e),`onVisibilitychange`,function(t){document.visibilityState===`visible`?e._checkIfCanStart()&&e.start():document.visibilityState===`hidden`&&e.stop()}),F2(B2(e),`renderOnTimeupdate`,function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(A4,e.renderOnTimeupdate);var n=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,n)}}),F2(B2(e),`start`,function(t,n){var r=e.player.video,i=Rre(),a=e.checkVideoIsSupport(r);!a||!e.canvasCtx||(n||=e.interval,e.stop(),r.videoWidth&&r.videoHeight&&(e.videoPI=r.videoHeight>0?parseInt(r.videoWidth/r.videoHeight*100,10):0,(e.config.mode===a5.REAL_TIME||i-e.preTime>=n)&&(r&&r.videoWidth&&e.update(a,e.videoPI),e.preTime=i)),e.frameId=e._loopType===`timer`?Q.setTimeout(B2(e),e.start,n):Q.requestAnimationFrame(e.start))}),F2(B2(e),`stop`,function(){e.frameId&&(e._loopType===`timer`?Q.clearTimeout(B2(e),e.frameId):Q.cancelAnimationFrame(e.frameId),e.frameId=null)}),e}return P2(n,[{key:`afterCreate`,value:function(){var e=this;this.playerConfig.dynamicBg===!0&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,r=t.disable,i=t.mode,a=t.frameRate;r||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/a,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==a5.REAL_TIME&&this.interval>=1e3?`timer`:`animation`,this.once(Q4,function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())}),i!==a5.POSTER&&(i!==a5.FIRST_FRAME&&(this.on(V4,function(){e.stop()}),this.on(C4,function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)}),this.on(E4,function(){e.stop()})),this.on(I4,this.onLoadedData),this.on(B4,function(){e._isLoaded=!1,e.stop()}),document.addEventListener(`visibilitychange`,this.onVisibilitychange)))}},{key:`setConfig`,value:function(e){var t=this;Object.keys(e).forEach(function(n){n===`root`&&e[n]!==t.config[n]?t.reRender(e[n]):n===`frameRate`?t.interval=parseInt(1e3/e[n],10):n===`disable`&&e[n]&&t.stop(),t.config[n]=e[n]})}},{key:`init`,value:function(e){var t=this.player,r=this.config;this.canvasFilter=n.supportCanvasFilter();try{var i=e||r.root;i||=r.isInnerRender&&t.innerContainer||t.root,i.insertAdjacentHTML(`afterbegin`,`
`),this.root=i.children[0],this.canvas=this.find(`canvas`),this.canvasFilter||(this.canvas.style.filter=r.filter,this.canvas.style.webkitFilter=r.filter),this.mask=this.find(`xgmask`),r.addMask&&(this.mask.style.background=r.maskBg),this.canvasCtx=this.canvas.getContext(`2d`)}catch(e){o4.logError(`plugin:DynamicBg`,e)}}},{key:`reRender`,value:function(e){if(!(!this.config.disable&&!this.root)){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),!e){this.root=null;return}this.init(e),this.renderOnce();var n=this.config.startInterval;this._checkIfCanStart()&&this.start(0,n)}}},{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&&!(_4.browser===`safari`&&Q.isMSE(t)))return t;var n=t?t.tagName.toLowerCase():``;return n===`canvas`||n===`img`?t:null}},{key:`renderByPoster`,value:function(){var e=this.playerConfig.poster;if(e){var t=Q.typeOf(e)===`String`?e:Q.typeOf(e.poster)===`String`?e.poster:null;this.updateImg(t)}}},{key:`_checkIfCanStart`,value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==a5.FIRST_FRAME&&e!==a5.POSTER}},{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&&this.update(t,this.videoPI)}}},{key:`updateImg`,value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),r=n.width,i=n.height,a=new window.Image;a.onload=function(){if(!(!t.canvas||t.frameId||t.isStart)){t.canvas.height=i,t.canvas.width=r;var e=parseInt(r/i*100,10);t.update(a,e),a=null}},a.src=e}}},{key:`update`,value:function(e,t){if(!(!this.canvas||!this.canvasCtx||!t))try{var n=this._pos,r=this.config,i=this.canvas.getBoundingClientRect(),a=i.width,o=i.height;if(a!==n.width||o!==n.height||n.pi!==t){var s=parseInt(a/o*100,10);n.pi=t,n.width!==a&&(n.width=this.canvas.width=a),n.height!==o&&(n.height=this.canvas.height=o);var c=o,l=a;st&&(c=parseInt(a*100/t,10)),n.rwidth=l*r.multiple,n.rheight=c*r.multiple,n.x=(a-n.rwidth)/2,n.y=(o-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=r.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){o4.logError(`plugin:DynamicBg`,e)}}},{key:`destroy`,value:function(){this.stop(),document.removeEventListener(`visibilitychange`,this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:`render`,value:function(){return``}}],[{key:`pluginName`,get:function(){return`dynamicBg`}},{key:`defaultConfig`,get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:`framerate`,frameRate:10,filter:`blur(50px)`,startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:`rgba(0,0,0,0.7)`}}},{key:`isSupport`,get:function(){return typeof o5==`boolean`||(o5=zre()),o5}},{key:`supportCanvasFilter`,value:function(){return!(_4.browser===`safari`||_4.browser===`firefox`)}}]),n}(s6),Vre={LANG:`zh-cn`,TEXT:{ERROR_TYPES:{network:{code:1,msg:`视频下载错误`},mse:{code:2,msg:`流追加错误`},parse:{code:3,msg:`解析错误`},format:{code:4,msg:`格式错误`},decoder:{code:5,msg:`解码错误`},runtime:{code:6,msg:`语法错误`},timeout:{code:7,msg:`播放超时`},other:{code:8,msg:`其他错误`}},HAVE_NOTHING:`没有关于音频/视频是否就绪的信息`,HAVE_METADATA:`音频/视频的元数据已就绪`,HAVE_CURRENT_DATA:`关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒`,HAVE_FUTURE_DATA:`当前及至少下一帧的数据是可用的`,HAVE_ENOUGH_DATA:`可用数据足以开始播放`,NETWORK_EMPTY:`音频/视频尚未初始化`,NETWORK_IDLE:`音频/视频是活动的且已选取资源,但并未使用网络`,NETWORK_LOADING:`浏览器正在下载数据`,NETWORK_NO_SOURCE:`未找到音频/视频来源`,MEDIA_ERR_ABORTED:`取回过程被用户中止`,MEDIA_ERR_NETWORK:`网络错误`,MEDIA_ERR_DECODE:`解码错误`,MEDIA_ERR_SRC_NOT_SUPPORTED:`不支持的音频/视频格式`,REPLAY:`重播`,ERROR:`网络连接似乎出现了问题`,PLAY_TIPS:`播放`,PAUSE_TIPS:`暂停`,PLAYNEXT_TIPS:`下一集`,DOWNLOAD_TIPS:`下载`,ROTATE_TIPS:`旋转`,RELOAD_TIPS:`重新载入`,FULLSCREEN_TIPS:`进入全屏`,EXITFULLSCREEN_TIPS:`退出全屏`,CSSFULLSCREEN_TIPS:`进入样式全屏`,EXITCSSFULLSCREEN_TIPS:`退出样式全屏`,TEXTTRACK:`字幕`,TEXTTRACK_OFF:`关闭`,PIP:`画中画`,SCREENSHOT:`截图`,LIVE:`正在直播`,OFF:`关闭`,OPEN:`开启`,MINI_DRAG:`点击按住可拖动视频`,MINISCREEN:`小屏幕`,REFRESH_TIPS:`请试试`,REFRESH:`刷新`,FORWARD:`快进中`,LIVE_TIP:`直播`}},s5=`info`,c5=D3,Hre=function(e){I2(n,e);var t=H2(n);function n(){var e;M2(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),F2(B2(e),`_recordUserActions`,function(t){var n=e._getTime(),r=Object.assign({},t,{msg:t.msg||t.action});e._stats[s5].push(A2(A2({type:`userAction`},n),{},{payload:r}))}),F2(B2(e),`_onReset`,function(){e.reset()}),F2(B2(e),`_recordInfo`,function(t){e.info(t)}),F2(B2(e),`_downloadStats`,function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:`application/json`}),r=window.URL.createObjectURL(n),i=document.createElement(`a`);i.style.display=`none`,i.href=r,i.download=`player.txt`,i.disabled=!1,i.click()}),e}return P2(n,[{key:`_getTime`,value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:`afterCreate`,value:function(){this.reset(),this.on(x3,this._recordUserActions),this.on(c5.STATS_INFO,this._recordInfo),this.on(c5.STATS_DOWNLOAD,this._downloadStats),this.on(c5.STATS_RESET,this._onReset)}},{key:`destroy`,value:function(){this.offAll()}},{key:`downloadStats`,value:function(){this._downloadStats()}},{key:`info`,value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:`_info`,value:function(e){var t=this._getTime();this._stats[s5].push(A2(A2({},t),{},{payload:e}))}},{key:`_infoProfile`,value:function(e){if(e&&e.startMs){var t=A2({cat:`function`,dur:Date.now()-e.startMs,name:e.name||e.msg,ph:`X`,pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn(`infoProfile need object data, include startMs`)}},{key:`reset`,value:function(){var e;this._stats=(e={},F2(e,s5,[]),F2(e,`media`,{}),e)}},{key:`getStats`,value:function(){for(var e=this.player.media,t=[],n=0;nr.media.duration)){var d=u-c,f=d<=o;dt&&(a===0||r[a-1].end-t<=n)){i=a;break}return i}},{key:`_getBuffered`,value:function(e){if(!e)return[];for(var t=[],n=0;nt.jumpCntMax||e.timer||t.useWaitingTimeoutJump===!1||(e.timer=setTimeout(e.onJump,t.waitingTime*1e3))}),F2(B2(e),`onJump`,function(){var t=B2(e),n=t.player,r=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>r.jumpCntMax||r.useWaitingTimeoutJump===!1)&&!(n.media.paused&&n.media.currentTime!==0&&e.hasPlayed)){e.jumpSize=r.jumpSize*(e.jumpCnt+1),e.jumpCnt===r.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var i=n.currentTime+e.jumpSize;i>n.media.duration||(e.jumpCnt++,n.currentTime=i)}}),e}return P2(n,[{key:`afterCreate`,value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,r=t.jumpSize;n!==!1&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=r,this.on(j4,this.onWaiting),this.on([w4,M4],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(C4,function(){e.hasPlayed=!0}))}}],[{key:`pluginName`,get:function(){return`waitingTimeoutJump`}},{key:`defaultConfig`,get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(s6),u5=`cdn`,d5=[`cdn`],Wre=function(e){I2(n,e);var t=H2(n);function n(){var e;M2(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),F2(B2(e),`getSpeed`,function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:u5;if(!e.speedListCache||!e.speedListCache[t]||e.speedListCache[t].length<=0)return 0;var n=0;return e.speedListCache[t].map(function(e){n+=e}),Math.floor(n/e.speedListCache[t].length)}),F2(B2(e),`startTimer`,function(){Q.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))}),F2(B2(e),`initSpeedList`,function(){e.speedListCache={},d5.forEach(function(t){e.speedListCache[t]=[]})}),F2(B2(e),`_onRealSpeedChange`,function(t){t.speed&&e.appendList(t.speed,t.type||u5)}),F2(B2(e),`testSpeed`,function(){if(clearTimeout(e.timer),e.timer=null,!(!e.player||!e.config.openSpeed)){var t=e.config,n=t.url,r=t.loadSize,i=t.testCnt,a=t.testTimeStep,o=n+(n.indexOf(`?`)<0?`?testst=`:`&testst=`)+Date.now();if(!(e.cnt>=i)){e.cnt++;try{var s=new Date().getTime(),c=null,l=new XMLHttpRequest;e.xhr=l,l.open(`GET`,o);var u={},d=Math.floor(Math.random()*10);u.Range=`bytes=`+d+`-`+(r+d),u&&Object.keys(u).forEach(function(e){l.setRequestHeader(e,u[e])}),l.onreadystatechange=function(){if(l.readyState===4){e.xhr=null,c=new Date().getTime();var t=l.getResponseHeader(`Content-Length`)/1024*8,n=Math.round(t*1e3/(c-s));e.appendList(n),e.timer=setTimeout(e.testSpeed,a)}},l.send()}catch(e){console.error(e)}}}}),F2(B2(e),`appendList`,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u5;if(!(!e.speedListCache||!e.speedListCache[n])){var r=e.config.saveSpeedMax;e.speedListCache[n].length>=r&&e.speedListCache[n].shift(),e.speedListCache[n].push(t);var i=B2(e).player;i&&(n===u5?i.realTimeSpeed=t:i[e.getSpeedName(`realTime`,n)]=t),e.updateSpeed(n)}}),F2(B2(e),`updateSpeed`,function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:u5,n=e.getSpeed(t),r=B2(e).player;if(r)if(t===u5)(!r.avgSpeed||n!==r.avgSpeed)&&(r.avgSpeed=n,r.emit(n3,{speed:n,realTimeSpeed:r.realTimeSpeed}));else{var i=e.getSpeedName(`avg`,t);(!r[i]||n!==r[i])&&(r[i]=n,r.emit(n3,{speed:n,realTimeSpeed:r.realTimeSpeed}))}}),e}return P2(n,[{key:`afterCreate`,value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList;n?.length>0&&d5.push.apply(d5,K2(n)),this.initSpeedList(),this.on(`real_time_speed`,this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([I4,$4],this.startTimer)}},{key:`getSpeedName`,value:function(e,t){return e+`Speed`+t.toUpperCase()}},{key:`openSpeed`,get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer){clearTimeout(this.timer),this.timer=null;return}if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:`destroy`,value:function(){var e=this;this.off(`real_time_speed`,this._onRealSpeedChange),this.off([I4,$4],this.startTimer),d5.forEach(function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])}),this.speedListCache&&={},clearTimeout(this.timer),this.timer=null,this.xhr&&this.xhr.readyState!==4&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:`pluginName`,get:function(){return`testspeed`}},{key:`defaultConfig`,get:function(){return{openSpeed:!1,testCnt:3,loadSize:200*1024,testTimeStep:3e3,url:``,saveSpeedMax:5,addSpeedTypeList:[]}}}]),n}(s6),Gre=function(e){I2(n,e);var t=H2(n);function n(){return M2(this,n),t.apply(this,arguments)}return P2(n,[{key:`afterCreate`,value:function(){var e=this,t=this.player,n=this.config,r=t.media||t.video;this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],!n.disabled&&r.getVideoPlaybackQuality&&(this.on(C4,function(){e._startTick()}),this.on(E4,function(){e._stopTick()}),this.on(T4,function(){e._stopTick()}),this.on(V4,function(){e._stopTick()}))}},{key:`_startTick`,value:function(){var e=this;this._stopTick(),this._timer=setTimeout(function(){e._checkDecodeFPS(),e._startTick()},this.config.tick)}},{key:`_stopTick`,value:function(){clearTimeout(this._timer),this._timer=null}},{key:`_checkBuffer`,value:function(e,t){for(var n=!1,r=[],i=0;i=this.config.stuckCount&&(this.emit(O3,this._payload),this._reset())):this._reset())}}},{key:`_reset`,value:function(){this._payload=[],this._currentStuckCount=0}},{key:`_checkDecodeFPS`,value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),n=t.totalVideoFrames,r=t.droppedVideoFrames,i=performance.now();if(n&&this._lastCheckPoint){var a=n-this._lastDecodedFrames,o=i-this._lastCheckPoint;this._checkStuck(a,n,r,o)}this._lastDecodedFrames=n,this._lastCheckPoint=i}}},{key:`destroy`,value:function(){this._stopTick()}}],[{key:`pluginName`,get:function(){return`FpsDetect`}},{key:`defaultConfig`,get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(s6);w6.use(Vre);var Kre=P2(function e(t,n){var r,i,a;M2(this,e);var o=n&&n.isMobileSimulateMode===`mobile`,s=n.isLive?[]:[gre,Q6,Lre,Fre,$6],c=[].concat(s,[J6,G6,vre,Cre,Are,jre,Ere,Dre,r8,xre]),l=[c8,l8,p8,hre,m8,Mre,Nre,Ire,E8];this.plugins=[Hre,o8].concat(K2(c),l,[l5,Ure]);var u=o?`mobile`:_4.device;switch(u){case`pc`:(r=this.plugins).push.apply(r,[H8,k8,B6,Wre,Gre]);break;case`mobile`:(i=this.plugins).push.apply(i,[z8]);break;default:(a=this.plugins).push.apply(a,[H8,k8,B6])}(_4.os.isIpad||u===`pc`)&&this.plugins.push(Bre),_4.os.isIpad&&this.plugins.push(k8),this.ignores=[],this.i18n=[]}),f5=function(e){I2(n,e);var t=H2(n);function n(){return M2(this,n),t.apply(this,arguments)}return P2(n)}(F6);F2(f5,`defaultPreset`,Kre),F2(f5,`Util`,Q),F2(f5,`Sniffer`,_4),F2(f5,`Errors`,x4),F2(f5,`Events`,S4),F2(f5,`Plugin`,s6),F2(f5,`BasePlugin`,Y3),F2(f5,`I18N`,w6),F2(f5,`STATE_CLASS`,p6),F2(f5,`InstManager`,k6),F2(f5,`PlayIcon`,J6),F2(f5,`TimeIcon`,$6),F2(f5,`Progress`,Q6),F2(f5,`FullscreenIcon`,G6),F2(f5,`CssFullscreenIcon`,B6),F2(f5,`VolumeIcon`,r8);function qre(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function p5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m5(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],o=a.completion;if(a.tryLoc===`root`)return r(`end`);if(a.tryLoc<=this.prev){var s=n.call(a,`catchLoc`),c=n.call(a,`finallyLoc`);if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,`finallyLoc`)&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;w(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},this.method===`next`&&(this.arg=void 0),d}},e}function g5(e){"@babel/helpers - typeof";return g5=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},g5(e)}function _5(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function v5(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){_5(a,r,i,o,s,`next`,e)}function s(e){_5(a,r,i,o,s,`throw`,e)}o(void 0)})}}function y5(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function b5(e,t){for(var n=0;n`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yre(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a=0)&&(n[i]=e[i]);return n}function T5(e,t){if(e==null)return{};var n=Yre(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function E5(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Xre(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return E5(e)}function D5(e){var t=Jre();return function(){var n=C5(e),r;if(t){var i=C5(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Xre(this,r)}}function O5(e,t){return $re(e)||qre(e,t)||k5(e,t)||nie()}function Zre(e){return Qre(e)||eie(e)||k5(e)||tie()}function Qre(e){if(Array.isArray(e))return A5(e)}function $re(e){if(Array.isArray(e))return e}function eie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function k5(e,t){if(e){if(typeof e==`string`)return A5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A5(e,t)}}function A5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0;--i){var a=this.tryEntries[i],o=a.completion;if(a.tryLoc===`root`)return r(`end`);if(a.tryLoc<=this.prev){var s=n.call(a,`catchLoc`),c=n.call(a,`finallyLoc`);if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,`finallyLoc`)&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;w(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},this.method===`next`&&(this.arg=void 0),d}},e}function F5(e){"@babel/helpers - typeof";return F5=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},F5(e)}function I5(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function L5(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){I5(a,r,i,o,s,`next`,e)}function s(e){I5(a,r,i,o,s,`throw`,e)}o(void 0)})}}function R5(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function z5(e,t){for(var n=0;n