From 699ffece964336967bed02a374f1bf35ed2c2007 Mon Sep 17 00:00:00 2001 From: zhw2590582 Date: Sun, 18 Oct 2020 14:27:11 +0800 Subject: [PATCH] build all packages --- .size-snapshot.json | 18 ++++++------- dist/artplayer-react.js | 2 +- dist/artplayer-vue.js | 2 +- dist/artplayer.js | 2 +- .../artplayer-react/dist/artplayer-react.js | 2 +- packages/artplayer-vue/dist/artplayer-vue.js | 2 +- packages/artplayer/dist/artplayer.js | 2 +- packages/artplayer/src/style/subtitle.scss | 2 +- packages/artplayer/src/subtitle.js | 27 ++++++++++++++++++- 9 files changed, 42 insertions(+), 17 deletions(-) diff --git a/.size-snapshot.json b/.size-snapshot.json index a50238938..355f35fec 100644 --- a/.size-snapshot.json +++ b/.size-snapshot.json @@ -45,9 +45,9 @@ "gzipped": 969 }, "artplayer.js": { - "bundled": 205341, - "minified": 118362, - "gzipped": 27435 + "bundled": 205757, + "minified": 118547, + "gzipped": 27470 }, "artplayer-plugin-danmuku.js": { "bundled": 25068, @@ -60,9 +60,9 @@ "gzipped": 10430 }, "artplayer-react.js": { - "bundled": 289624, - "minified": 148231, - "gzipped": 36606 + "bundled": 291488, + "minified": 148982, + "gzipped": 36750 }, "artplayer-tool-github.js": { "bundled": 12711, @@ -75,8 +75,8 @@ "gzipped": 2938 }, "artplayer-vue.js": { - "bundled": 206921, - "minified": 119298, - "gzipped": 27603 + "bundled": 207337, + "minified": 119483, + "gzipped": 27639 } } diff --git a/dist/artplayer-react.js b/dist/artplayer-react.js index fe4c50f49..59aac3169 100644 --- a/dist/artplayer-react.js +++ b/dist/artplayer-react.js @@ -5,4 +5,4 @@ * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ArtplayerReact=e()}(this,(function(){"use strict";var t=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o};var e=function(e,r){if(null==e)return{};var n,o,i=t(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i};var r=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var r=0;rU.length&&U.push(t)}function X(t,e,r,n){var o=typeof t;"undefined"!==o&&"boolean"!==o||(t=null);var i=!1;if(null===t)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case g:case w:i=!0}}if(i)return r(n,t,""===e?"."+Z(t,0):e),1;if(i=0,e=""===e?".":e+":",Array.isArray(t))for(var a=0;a1?e-1:0),n=1;n2?r-2:0),o=2;o2?r-2:0),o=2;o8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!t){if("undefined"!=typeof console){var i=n.map((function(t){return""+t}));i.unshift("Warning: "+e),Function.prototype.apply.call(console.error,console,i)}try{var a=0,c="Warning: "+e.replace(/%s/g,(function(){return n[a++]}));throw new Error(c)}catch(t){}}},S={};function R(t,e){var r=t.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+e;S[o]||(P(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",e,n),S[o]=!0)}var E={isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,r){R(t,"forceUpdate")},enqueueReplaceState:function(t,e,r,n){R(t,"replaceState")},enqueueSetState:function(t,e,r,n){R(t,"setState")}},$={};function C(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}Object.freeze($),C.prototype.isReactComponent={},C.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},C.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var D={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},T=function(t,e){Object.defineProperty(C.prototype,t,{get:function(){j(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})};for(var A in D)D.hasOwnProperty(A)&&T(A,D[A]);function z(){}function _(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}z.prototype=C.prototype;var L=_.prototype=new z;L.constructor=_,e(L,C.prototype),L.isPureReactComponent=!0;var M={current:null},q={current:null},I=/^(.*)[\\\/]/;function F(t){if(null==t)return null;if("number"==typeof t.tag&&P(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case a:return"Fragment";case i:return"Portal";case l:return"Profiler";case c:return"StrictMode";case d:return"Suspense";case y:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case u:return"Context.Consumer";case s:return"Context.Provider";case p:return n=t,o=t.render,f="ForwardRef",m=o.displayName||o.name||"",n.displayName||(""!==m?f+"("+m+")":f);case h:return F(t.type);case v:var e=1===(r=t)._status?r._result:null;if(e)return F(e)}var r,n,o,f,m;return null}var N={},W=null;function V(t){W=t}N.getCurrentStack=null,N.getStackAddendum=function(){var t="";if(W){var e=F(W.type),r=W._owner;t+=function(t,e,r){var n="";if(e){var o=e.fileName,i=o.replace(I,"");if(/^index\./.test(i)){var a=o.match(I);if(a){var c=a[1];c&&(i=c.replace(I,"")+"/"+i)}}n=" (at "+i+":"+e.lineNumber+")"}else r&&(n=" (created by "+r+")");return"\n in "+(t||"Unknown")+n}(e,W._source,r&&F(r.type))}var n=N.getCurrentStack;return n&&(t+=n()||""),t};var H={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:q,IsSomeRendererActing:{current:!1},assign:e};e(H,{ReactDebugCurrentFrame:N,ReactComponentTreeHook:{}});var U,B,Y=function(t,e){if(!t){for(var r=H.ReactDebugCurrentFrame,n=r.getStackAddendum(),o=arguments.length,i=new Array(o>2?o-2:0),a=2;a1){for(var u=Array(s),f=0;f1){for(var d=Array(p),y=0;y.")}return e}(e);if(!Ot[r]){Ot[r]=!0;var n="";t&&t._owner&&t._owner!==q.current&&(n=" It was passed a child from "+F(t._owner.type)+"."),V(t),Y(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,n),V(null)}}}function jt(t,e){if("object"==typeof t)if(Array.isArray(t))for(var r=0;r",i=" Did you accidentally export a JSX literal instead of a component?"):c=typeof t,Y(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,i)}var s=et.apply(this,arguments);if(null==s)return s;if(n)for(var u=2;u is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Provider},set:function(t){r.Provider=t}},_currentValue:{get:function(){return r._currentValue},set:function(t){r._currentValue=t}},_currentValue2:{get:function(){return r._currentValue2},set:function(t){r._currentValue2=t}},_threadCount:{get:function(){return r._threadCount},set:function(t){r._threadCount=t}},Consumer:{get:function(){return n||(n=!0,Y(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Consumer}}}),r.Consumer=i,r._currentRenderer=null,r._currentRenderer2=null,r},forwardRef:function(t){return null!=t&&t.$$typeof===h?P(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof t?P(!1,"forwardRef requires a render function but was given %s.",null===t?"null":typeof t):0!==t.length&&2!==t.length&&P(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===t.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=t&&(null!=t.defaultProps||null!=t.propTypes)&&P(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:p,render:t}},lazy:function(t){var e,r,n={$$typeof:v,_ctor:t,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return e},set:function(t){Y(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),e=t,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(t){Y(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=t,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},memo:function(t,e){return bt(t)||P(!1,"memo: The first argument must be a component. Instead received: %s",null===t?"null":typeof t),{$$typeof:h,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return gt().useCallback(t,e)},useContext:function(t,e){var r=gt();if(void 0!==e&&Y(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",e,"number"==typeof e&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==t._context){var n=t._context;n.Consumer===t?Y(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===t&&Y(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(t,e)},useEffect:function(t,e){return gt().useEffect(t,e)},useImperativeHandle:function(t,e,r){return gt().useImperativeHandle(t,e,r)},useDebugValue:function(t,e){return gt().useDebugValue(t,e)},useLayoutEffect:function(t,e){return gt().useLayoutEffect(t,e)},useMemo:function(t,e){return gt().useMemo(t,e)},useReducer:function(t,e,r){return gt().useReducer(t,e,r)},useRef:function(t){return gt().useRef(t)},useState:function(t){return gt().useState(t)},Fragment:a,Profiler:l,StrictMode:c,Suspense:d,createElement:Rt,cloneElement:function(t,e,r){for(var n=rt.apply(this,arguments),o=2;o1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function wt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function xt(t,e){return t.classList.add(e)}function Ot(t,e){return t.classList.remove(e)}function kt(t,e){return t.classList.contains(e)}function jt(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function Pt(t,e,r){return t.style[e]=r,t}function St(t,e){return Object.keys(e).forEach((function(r){Pt(t,r,e[r])})),t}function Rt(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function Et(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function $t(t,e){Et(t).forEach((function(t){return Ot(t,e)})),xt(t,e)}function Ct(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";vt||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function Dt(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function Tt(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var At=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var zt=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},_t=n((function(t){function e(r,n,o){return zt()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&l(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function Lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Mt=function(t){s(r,t);var e=Lt(r);function r(t,n){var o;return i(this,r),o=e.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(o),n||o.constructor),o.name="ArtPlayerError",o}return r}(n((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!At(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return _t(t,arguments,p(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)},e(r)}t.exports=e}))(Error));function qt(t,e){if(!t)throw new Mt(e);return t}function It(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function Ft(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function Nt(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function Wt(t){return t.includes("?")?Wt(t.split("?")[0]):t.includes("#")?Wt(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function Vt(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Ht=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function re(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ae(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var ce=Object.freeze({__proto__:null,query:gt,queryAll:wt,addClass:xt,removeClass:Ot,hasClass:kt,append:jt,remove:function(t){return t.parentNode.removeChild(t)},setStyle:Pt,setStyles:St,getStyle:Rt,sublings:Et,inverseClass:$t,tooltip:Ct,isInViewport:Dt,includeFromEvent:Tt,ArtPlayerError:Mt,errorHandle:qt,srtToVtt:It,vttToBlob:Ft,assToVtt:Nt,getExt:Wt,download:Vt,def:Zt,has:Gt,proxyPropertys:Kt,mergeDeep:te,sleep:ee,debounce:re,throttle:ne,clamp:oe,secondToTime:ie,escape:ae,userAgent:ht,isMobile:vt,isSafari:mt,isWechat:bt});function le(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function se(t){for(var e=1;e-1;case"function":return t(e.userAgent);case"regexp":return t.test(e.userAgent);default:return!1}}))},we=function(){function t(e){var r=this;i(this,t),this.art=e,e.option.container instanceof Element?this.$container=e.option.container:(this.$container=gt(e.option.container),qt(this.$container,"No container element found by ".concat(e.option.container))),qt(e.constructor.instances.every((function(t){return t.template.$container!==r.$container})),"Cannot mount multiple instances on the same dom element"),qt(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),e.whitelist.state?this.desktop():this.mobile()}return c(t,[{key:"query",value:function(t){return gt(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(xt(this.$settingInner,"art-backdrop-filter"),xt(this.$info,"art-backdrop-filter"),xt(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&xt(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":xt(this.$player,"art-destroy")}}]),t}(),xe={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},Oe={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},ke=function(){function t(e){i(this,t),this.art=e,this.languages={"zh-cn":xe,"zh-tw":Oe},this.init()}return c(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=te(this.languages,t),this.init()}}]),t}();var je=n((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var y=d*s/l;Pt(n,"width","".concat(100*y,"%")),Pt(n,"height","100%"),Pt(n,"padding","0 ".concat((u-u*y)/2,"px"))}else{var h=l/d/s;Pt(n,"width","100%"),Pt(n,"height","".concat(100*h,"%")),Pt(n,"padding","".concat((f-f*h)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Zt(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(e,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Zt(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Zt(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Zt(e,"screenshot",{value:function(){e.getDataURL().then((function(e){Vt(e,"".concat(r.title||"artplayer","_").concat(ie(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(e,this),function(t,e){var r=t.template.$player;Zt(e,"fullscreen",{get:function(){return je.isFullscreen},set:function(n){n?je.request(r).then((function(){xt(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):je.exit().then((function(){Ot(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Zt(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(e,this),function(t,e){var r=t.template.$player;Zt(e,"fullscreenWeb",{get:function(){return kt(r,"art-fullscreen-web")},set:function(n){n?(xt(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(Ot(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Zt(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Zt(e,"fullscreenRotate",{get:function(){return kt(n,"art-fullscreen-rotate")},set:function(r){if(r){xt(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Zt(e,"autoSize",{get:function(){return kt(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,f=a/c,p=s/u;if(xt(n,"art-auto-size"),p>f)Pt(o,"width","".concat(u*f/s*100,"%")),Pt(o,"height","100%");else{var d=s/f/u*100;Pt(o,"width","100%"),Pt(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else Ot(n,"art-auto-size"),Pt(o,"width",null),Pt(o,"height",null),t.emit("autoSize")}})}(e,this),function(t,e){Zt(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Zt(e,t,{get:function(){return e.rect[t]}})})),Zt(e,"x",{get:function(){return e.left+window.pageXOffset}}),Zt(e,"y",{get:function(){return e.top+window.pageYOffset}})}(e,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Zt(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];qt(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Zt(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(e,this),function(t,e){var r=t.template.$undercover;Zt(e,"light",{get:function(){return"none"!==Rt(r,"display",!1)},set:function(e){Pt(r,"display",e?"block":"none"),t.emit("light",e)}})}(e,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,f="",p=!1,d=0,y=0,h=0,v=0;i(u,"mousedown",(function(t){p=!0,d=t.pageX,y=t.pageY,h=e.left,v=e.top})),i(document,"mousemove",(function(t){if(p){xt(c,"art-is-dragging");var e=v+t.pageY-y,r=h+t.pageX-d;Pt(c,"top","".concat(e,"px")),Pt(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){p=!1,Ot(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,p=!1,Ot(c,"art-is-dragging")})),jt(s,n.title||r.get("Mini player")),Zt(e,"mini",{get:function(){return kt(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,f=c.style.cssText,xt(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)Pt(c,"top","".concat(i,"px")),Pt(c,"left","".concat(a,"px")),Dt(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,p=l.clientWidth-e.width-50;o.set("top",s),o.set("left",p),Pt(c,"top","".concat(s,"px")),Pt(c,"left","".concat(p,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=f,Ot(c,"art-mini"),Pt(c,"top",null),Pt(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Zt(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(e,this),function(t,e){var r=[];Zt(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=oe(n[0],0,Math.min(n[1],e.duration)),i=oe(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(e,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Zt(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(qt(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,Pt(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}Pt(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Zt(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(e,this),Kt(e,this)};var Re=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t},Ee=n((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Re(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),$e=function(){function t(e){i(this,t),this.id=0,this.art=e,this.add=this.add.bind(this)}return c(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);qt(!Gt(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");xt(o,"art-".concat(this.name)),xt(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):jt(this.$parent,o),r.html&&jt(o,r.html),r.style&&St(o,r.style),r.tooltip&&Ct(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&xt(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;xt(e,"art-control-selector");var a=document.createElement("div");xt(a,"art-selector-value"),jt(a,t.html),e.innerText="",jt(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");xt(l,"art-selector-list"),jt(l,c),jt(e,l);var s=function(){l.style.left="-".concat(Rt(l,"width")/2-Rt(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(kt(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return kt(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?xt(e,r):Ot(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function De(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=gt(".art-progress-loaded",t),c=gt(".art-progress-played",t),l=gt(".art-progress-highlight",t),s=gt(".art-progress-indicator",t),u=gt(".art-progress-tip",t);function f(t,e){"loaded"===t&&Pt(o,"width","".concat(100*e,"%")),"played"===t&&(Pt(c,"width","".concat(100*e,"%")),Pt(s,"left","calc(".concat(100*e,"% - ").concat(Rt(s,"width")/2,"px)")))}n.forEach((function(t){var e=oe(t.time,0,a.duration)/a.duration*100;jt(l,''))})),f("loaded",a.loaded),e.on("video:progress",(function(){f("loaded",a.loaded)})),e.on("video:timeupdate",(function(){f("played",a.played)})),e.on("video:ended",(function(){f("played",1)})),i(t,"mousemove",(function(r){Pt(u,"display","block"),Tt(r,l)?function(r){var n=Fe(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?Pt(u,"left",0):n>t.clientWidth-i/2?Pt(u,"left","".concat(t.clientWidth-i,"px")):Pt(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Fe(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?Pt(u,"left",0):o>t.clientWidth-a/2?Pt(u,"left","".concat(t.clientWidth-a,"px")):Pt(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){Pt(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Fe(e,t),n=r.second;f("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Fe(e,t),o=n.second,i=n.percentage;xt(s,"art-show-indicator"),f("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,Ot(s,"art-show-indicator"))}))}})}}function We(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ve(t){for(var e=1;en.clientWidth-l/2?Pt(t,"left","".concat(n.clientWidth-l,"px")):Pt(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){Pt(t,"display","none")}))}})}}function Ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tr(t){for(var e=1;e'),o=jt(t,'');e.on("loop",(function(e){e?(Pt(t,"display","block"),Pt(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),Pt(o,"left","".concat(e[1]/r.duration*100,"%"))):Pt(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return Me(Me({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=jt(t,n.play),c=jt(t,n.pause);function l(){Pt(a,"display","flex"),Pt(c,"display","none")}function s(){Pt(a,"display","none"),Pt(c,"display","flex")}Ct(a,o.get("Play")),Ct(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Ye(Ye({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=jt(t,n.volume),l=jt(t,n.volumeClose),s=jt(t,'
'),u=jt(s,'
');function f(t){var e=s.getBoundingClientRect().left;return oe(t.pageX-e-6,0,54)/48}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)Pt(c,"display","none"),Pt(l,"display","flex"),Pt(u,"left","0");else{var e=48*t;Pt(c,"display","flex"),Pt(l,"display","none"),Pt(u,"left","".concat(e,"px"))}}Ct(c,i.get("Mute")),Pt(l,"display","none"),e.isMobile&&Pt(s,"display","none"),p(o.volume),e.on("video:volumechange",(function(){p(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=f(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=f(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Ue(Ue({},t),{},{mounted:function(t){function r(){var r="".concat(ie(e.player.currentTime)," / ").concat(ie(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:o.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return rr(rr({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===o.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return tr(tr({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;jt(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!o.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return Ve(Ve({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;jt(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){Ct(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!o.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Je(Je({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;jt(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){Ct(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!o.setting,position:"right",index:40})),n.add(function(t){return function(e){return _e(_e({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;jt(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){Ct(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!o.pip,position:"right",index:50})),n.add(function(t){return function(e){return Ae(Ae({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;jt(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){Ct(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!o.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return De(De({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;jt(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){Ct(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!o.fullscreen,position:"right",index:70})),o.controls.forEach((function(t){n.add(t)}))})),n}return c(r,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,n=this.art.template,o=n.$progress,i=n.$controlsLeft,a=n.$controlsRight;switch(e.position){case"top":this.$parent=o;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:qt(!1,"Control option.position must one of 'top', 'left', 'right'")}Ee(p(r.prototype),"add",this).call(this,e)}}]),r}($e);function cr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lr(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=wt("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&$t(r,"art-current")}))}})}}({disable:!o.playbackRate,name:"playbackRate",index:10})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return ur(ur({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=wt("span",t).find((function(t){return t.dataset.ratio===e}));r&&$t(r,"art-current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio",index:20})),n.add(function(t){return function(e){return pr(pr({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),n.add(function(t){return yr(yr({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return vr(vr({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!o.light,name:"light",index:50})),n.add(function(t){return function(e){return br(br({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),o.contextmenu.forEach((function(t){n.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),n.show=!0;var e=t.clientX,r=t.clientY,o=c.getBoundingClientRect(),i=o.height,a=o.width,s=o.left,u=o.top,f=l.getBoundingClientRect(),p=f.height,d=f.width,y=e-s,h=r-u;e+d>s+a&&(y=a-d),r+p>u+i&&(h=i-p),St(l,{top:"".concat(h,"px"),left:"".concat(y,"px")})})),s(c,"click",(function(t){Tt(t,l)||(n.show=!1)})),t.on("blur",(function(){n.show=!1}))})),n}return r}($e);function xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Or=function(t){s(r,t);var e=xr(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="info";var o=t.template,a=o.$infoPanel,c=o.$infoClose,l=o.$video;(0,t.events.proxy)(c,"click",(function(){n.show=!1}));var s=null,u=wt("[data-video]",a);function f(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){f()}),1e3)}return t.on("destroy",(function(){clearTimeout(s)})),t.on("info",(function(t){clearTimeout(s),t&&f()})),n}return r}($e);function kr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var jr=function(t){s(r,t);var e=kr(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="subtitle";var o=t.option.subtitle,a=t.template.$subtitle;return St(a,o.style),o.url&&n.init(o.url),o.bilingual&&xt(a,"art-bilingual"),n}return c(r,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===o(t)?St(r,t):Pt(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ae(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var f=document.createElement("track");f.default=!0,f.kind="metadata",s.appendChild(f),this.art.template.$track=f,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||Wt(t)){case"srt":return Ft(It(o));case"ass":return Ft(Nt(o));case"vtt":return Ft(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}}]),r}($e);var Pr=function(){function t(e){var r=this;i(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){Tt(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(e,r),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){xt(n,"art-hover"),t.emit("hover",!0)}),(function(){Ot(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(e,r),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),Ot(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(e,r),function(t,e){var r=t.option,n=t.player,o=ne((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(e,r),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=oe((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=oe(r.currentTime+60*e,0,r.duration),n.show="".concat(ie(c)," / ").concat(ie(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(e,r),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=re((function(){t.emit("view",Dt(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(e,r)}))}return c(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),Sr=function(){function t(e){var r=this;i(this,t),this.keys={};var n=e.option,o=e.player,a=e.events.proxy;n.hotkey&&e.once("ready",(function(){r.add(27,(function(){o.fullscreenWeb&&(o.fullscreenWeb=!1)})),r.add(32,(function(){o.toggle=!0})),r.add(37,(function(){o.backward=5})),r.add(38,(function(){o.volume+=.1})),r.add(39,(function(){o.forward=5})),r.add(40,(function(){o.volume-=.1})),a(window,"keydown",(function(t){if(e.isFocus){var n=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==n&&"TEXTAREA"!==n&&""!==o&&"true"!==o){var i=r.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(e)})),e.emit("hotkey",t))}}}))}))}return c(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Rr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Er=function(t){s(r,t);var e=Rr(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="layer",n.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){n.add(t)}))})),n}return r}($e);function $r(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Cr=function(t){s(r,t);var e=$r(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="loading",jt(t.template.$loading,t.icons.loading),n}return r}($e),Dr=function(){function t(e){i(this,t),this.art=e,this.time=2e3,this.timer=null}return c(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,xt(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",Ot(r,"art-notice-show")}),this.time)}}]),t}();function Tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Ar=function(t){s(r,t);var e=Tr(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="mask",jt(t.template.$state,t.icons.state),n}return r}($e);function zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var _r=function t(e){var n=this;i(this,t);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},e.option.icons);Object.keys(o).forEach((function(t){Zt(n,t,{get:function(){var e=document.createElement("i");return xt(e,"art-icon"),xt(e,"art-icon-".concat(t)),jt(e,o[t]),e}})}))};function Lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mr(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=wt("button",t).find((function(t){return t.dataset.value===e}));r&&$t(r.parentElement,"current")}))}})}}({disable:!o.flip,name:"flip"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Ir(Ir({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=gt(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!o.rotate,name:"rotate"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Nr(Nr({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=wt("button",t).find((function(t){return t.dataset.value===e}));r&&$t(r.parentElement,"current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Vr(Vr({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=gt(".art-setting-range input",t),i=gt(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!o.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){n.show=!1}))),n}return r}($e),Br=function(){function t(){i(this,t),this.name="artplayer_settings"}return c(t,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var n=Object.assign({},this.get(),r({},t,e));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),t}();function Yr(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=gt(".art-setting-range input",e),i=gt(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function Xr(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Yr);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Jr(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else qt(!1,"Playback of this file format is not supported")}}function l(t){var r=jt(t,'');Pt(t,"position","relative"),St(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=gt(".art-upload-btn",e),n=gt(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Zr(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=jt(n,'');Pt(n,"position","relative"),St(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=Wt(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):qt(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=gt(".art-upload-btn",e),n=gt(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Qr(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Gr(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Kr=function(){function t(e){var r=this;i(this,t),this.art=e,this.id=0;var n=e.option;n.subtitle.url&&n.subtitleOffset&&this.add(Xr),!n.isLive&&n.miniProgressBar&&this.add(Qr),n.localVideo&&this.add(Jr),n.localSubtitle&&this.add(Zr),n.networkMonitor&&this.add(Gr),e.option.plugins.forEach((function(t){r.add(t)}))}return c(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return qt(!Gt(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Zt(this,r,{value:e}),this}}]),t}(),tn=function t(e){i(this,t);var r=e.option,n=e.events.proxy,o=e.template.$video;be.events.forEach((function(t){n(o,t,(function(t){e.emit("video:".concat(t.type),t)}))})),Object.keys(r.moreVideoAttr).forEach((function(t){o[t]=r.moreVideoAttr[t]})),r.muted&&(o.muted=r.muted),r.volume&&(o.volume=oe(r.volume,0,1)),r.poster&&(o.poster=r.poster),r.autoplay&&(o.autoplay=r.autoplay),o.controls=!0;var a=r.type||Wt(r.url),c=r.customType[a];a&&c?(c(o,r.url,e),e.emit("customType",a)):(o.src=r.url,e.emit("url",o.src))};function en(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var rn=0,nn=[],on=function(t){s(r,t);var e=en(r);function r(t){var n;return i(this,r),(n=e.call(this)).option=dt(te(r.option,t),me),n.isFocus=!1,n.isDestroy=!1,n.userAgent=ht,n.isMobile=vt,n.isWechat=bt,n.whitelist=new ge(u(n)),n.template=new we(u(n)),n.events=new Pr(u(n)),n.whitelist.state?(n.storage=new Br(u(n)),n.icons=new _r(u(n)),n.i18n=new ke(u(n)),n.notice=new Dr(u(n)),n.player=new Se(u(n)),n.layers=new Er(u(n)),n.controls=new ar(u(n)),n.contextmenu=new wr(u(n)),n.subtitle=new jr(u(n)),n.info=new Or(u(n)),n.loading=new Cr(u(n)),n.hotkey=new Sr(u(n)),n.mask=new Ar(u(n)),n.setting=new Ur(u(n)),n.plugins=new Kr(u(n))):n.mobile=new tn(u(n)),rn+=1,n.id=rn,nn.push(u(n)),n}return c(r,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),nn.splice(nn.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return nn}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return be}},{key:"utils",get:function(){return ce}},{key:"scheme",get:function(){return me}},{key:"Emitter",get:function(){return yt}},{key:"validator",get:function(){return dt}},{key:"kindOf",get:function(){return dt.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:mt?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),r}(yt);function an(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function cn(t){for(var e=1;e=0||(o[r]=t[r]);return o};var e=function(e,r){if(null==e)return{};var n,o,i=t(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i};var r=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var r=0;rY.length&&Y.push(t)}function Z(t,e,r){return null==t?0:function t(e,r,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case g:case w:a=!0}}if(a)return n(o,e,""===r?"."+Q(e,0):r),1;if(a=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c1?e-1:0),n=1;n2?r-2:0),o=2;o2?r-2:0),o=2;o8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!t){if("undefined"!=typeof console){var i=n.map((function(t){return""+t}));i.unshift("Warning: "+e),Function.prototype.apply.call(console.error,console,i)}try{var a=0,c="Warning: "+e.replace(/%s/g,(function(){return n[a++]}));throw new Error(c)}catch(t){}}},S={};function R(t,e){var r=t.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+e;S[o]||(P(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",e,n),S[o]=!0)}var E={isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,r){R(t,"forceUpdate")},enqueueReplaceState:function(t,e,r,n){R(t,"replaceState")},enqueueSetState:function(t,e,r,n){R(t,"setState")}},$={};function C(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}Object.freeze($),C.prototype.isReactComponent={},C.prototype.setState=function(t,e){!function(){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw O(Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."))}(),this.updater.enqueueSetState(this,t,e,"setState")},C.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var D={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},T=function(t,e){Object.defineProperty(C.prototype,t,{get:function(){j(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})};for(var A in D)D.hasOwnProperty(A)&&T(A,D[A]);function z(){}function _(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}z.prototype=C.prototype;var L=_.prototype=new z;L.constructor=_,e(L,C.prototype),L.isPureReactComponent=!0;var M={current:null},q={suspense:null},I={current:null},F=/^(.*)[\\\/]/;function N(t){if(null==t)return null;if("number"==typeof t.tag&&P(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case a:return"Fragment";case i:return"Portal";case l:return"Profiler";case c:return"StrictMode";case d:return"Suspense";case y:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case u:return"Context.Consumer";case s:return"Context.Provider";case p:return n=t,o=t.render,f="ForwardRef",m=o.displayName||o.name||"",n.displayName||(""!==m?f+"("+m+")":f);case h:return N(t.type);case v:var e=1===(r=t)._status?r._result:null;if(e)return N(e)}var r,n,o,f,m;return null}var W={},V=null;function H(t){V=t}W.getCurrentStack=null,W.getStackAddendum=function(){var t="";if(V){var e=N(V.type),r=V._owner;t+=function(t,e,r){var n="";if(e){var o=e.fileName,i=o.replace(F,"");if(/^index\./.test(i)){var a=o.match(F);if(a){var c=a[1];c&&(i=c.replace(F,"")+"/"+i)}}n=" (at "+i+":"+e.lineNumber+")"}else r&&(n=" (created by "+r+")");return"\n in "+(t||"Unknown")+n}(e,V._source,r&&N(r.type))}var n=W.getCurrentStack;return n&&(t+=n()||""),t};var U={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:q,ReactCurrentOwner:I,IsSomeRendererActing:{current:!1},assign:e};e(U,{ReactDebugCurrentFrame:W,ReactComponentTreeHook:{}});var B=function(t,e){if(!t){for(var r=U.ReactDebugCurrentFrame,n=r.getStackAddendum(),o=arguments.length,i=Array(o>2?o-2:0),a=2;a1){for(var u=Array(s),f=0;f1){for(var d=Array(p),y=0;y.")}return e}(e);if(!Ot[r]){Ot[r]=!0;var n="";t&&t._owner&&t._owner!==I.current&&(n=" It was passed a child from "+N(t._owner.type)+"."),H(t),B(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,n),H(null)}}}function jt(t,e){if("object"==typeof t)if(Array.isArray(t))for(var r=0;r",i=" Did you accidentally export a JSX literal instead of a component?"):l=typeof t,B(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,i)}var s=rt.apply(this,arguments);if(null==s)return s;if(n)for(var u=2;u is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Provider},set:function(t){r.Provider=t}},_currentValue:{get:function(){return r._currentValue},set:function(t){r._currentValue=t}},_currentValue2:{get:function(){return r._currentValue2},set:function(t){r._currentValue2=t}},_threadCount:{get:function(){return r._threadCount},set:function(t){r._threadCount=t}},Consumer:{get:function(){return n||(n=!0,B(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Consumer}}}),r.Consumer=i,r._currentRenderer=null,r._currentRenderer2=null,r},forwardRef:function(t){return null!=t&&t.$$typeof===h?P(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof t?P(!1,"forwardRef requires a render function but was given %s.",null===t?"null":typeof t):0!==t.length&&2!==t.length&&P(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===t.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=t&&(null!=t.defaultProps||null!=t.propTypes)&&P(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:p,render:t}},lazy:function(t){var e={$$typeof:v,_ctor:t,_status:-1,_result:null},r=void 0,n=void 0;return Object.defineProperties(e,{defaultProps:{configurable:!0,get:function(){return r},set:function(t){B(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=t,Object.defineProperty(e,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(t){B(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=t,Object.defineProperty(e,"propTypes",{enumerable:!0})}}}),e},memo:function(t,e){return mt(t)||P(!1,"memo: The first argument must be a component. Instead received: %s",null===t?"null":typeof t),{$$typeof:h,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return bt().useCallback(t,e)},useContext:function(t,e){var r=bt();if(void 0!==e&&B(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",e,"number"==typeof e&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==t._context){var n=t._context;n.Consumer===t?B(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===t&&B(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(t,e)},useEffect:function(t,e){return bt().useEffect(t,e)},useImperativeHandle:function(t,e,r){return bt().useImperativeHandle(t,e,r)},useDebugValue:function(t,e){return bt().useDebugValue(t,e)},useLayoutEffect:function(t,e){return bt().useLayoutEffect(t,e)},useMemo:function(t,e){return bt().useMemo(t,e)},useReducer:function(t,e,r){return bt().useReducer(t,e,r)},useRef:function(t){return bt().useRef(t)},useState:function(t){return bt().useState(t)},Fragment:a,Profiler:l,StrictMode:c,Suspense:d,unstable_SuspenseList:y,createElement:Rt,cloneElement:function(t,e,r){for(var n=nt.apply(this,arguments),o=2;o1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function xt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function Ot(t,e){return t.classList.add(e)}function kt(t,e){return t.classList.remove(e)}function jt(t,e){return t.classList.contains(e)}function Pt(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function St(t,e,r){return t.style[e]=r,t}function Rt(t,e){return Object.keys(e).forEach((function(r){St(t,r,e[r])})),t}function Et(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function $t(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function Ct(t,e){$t(t).forEach((function(t){return kt(t,e)})),Ot(t,e)}function Dt(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";mt||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function Tt(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function At(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var zt=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var _t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},Lt=n((function(t){function e(r,n,o){return _t()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&l(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function Mt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var qt=function(t){s(r,t);var e=Mt(r);function r(t,n){var o;return i(this,r),o=e.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(o),n||o.constructor),o.name="ArtPlayerError",o}return r}(n((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!zt(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return Lt(t,arguments,p(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)},e(r)}t.exports=e}))(Error));function It(t,e){if(!t)throw new qt(e);return t}function Ft(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function Nt(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function Wt(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function Vt(t){return t.includes("?")?Vt(t.split("?")[0]):t.includes("#")?Vt(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function Ht(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Ut=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function ne(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ce(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var le=Object.freeze({__proto__:null,query:wt,queryAll:xt,addClass:Ot,removeClass:kt,hasClass:jt,append:Pt,remove:function(t){return t.parentNode.removeChild(t)},setStyle:St,setStyles:Rt,getStyle:Et,sublings:$t,inverseClass:Ct,tooltip:Dt,isInViewport:Tt,includeFromEvent:At,ArtPlayerError:qt,errorHandle:It,srtToVtt:Ft,vttToBlob:Nt,assToVtt:Wt,getExt:Vt,download:Ht,def:Qt,has:Kt,proxyPropertys:te,mergeDeep:ee,sleep:re,debounce:ne,throttle:oe,clamp:ie,secondToTime:ae,escape:ce,userAgent:vt,isMobile:mt,isSafari:bt,isWechat:gt});function se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ue(t){for(var e=1;e-1;case"function":return t(e.userAgent);case"regexp":return t.test(e.userAgent);default:return!1}}))},xe=function(){function t(e){var r=this;i(this,t),this.art=e,e.option.container instanceof Element?this.$container=e.option.container:(this.$container=wt(e.option.container),It(this.$container,"No container element found by ".concat(e.option.container))),It(e.constructor.instances.every((function(t){return t.template.$container!==r.$container})),"Cannot mount multiple instances on the same dom element"),It(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),e.whitelist.state?this.desktop():this.mobile()}return c(t,[{key:"query",value:function(t){return wt(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(Ot(this.$settingInner,"art-backdrop-filter"),Ot(this.$info,"art-backdrop-filter"),Ot(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&Ot(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":Ot(this.$player,"art-destroy")}}]),t}(),Oe={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},ke={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},je=function(){function t(e){i(this,t),this.art=e,this.languages={"zh-cn":Oe,"zh-tw":ke},this.init()}return c(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=ee(this.languages,t),this.init()}}]),t}();var Pe=n((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var y=d*s/l;St(n,"width","".concat(100*y,"%")),St(n,"height","100%"),St(n,"padding","0 ".concat((u-u*y)/2,"px"))}else{var h=l/d/s;St(n,"width","100%"),St(n,"height","".concat(100*h,"%")),St(n,"padding","".concat((f-f*h)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Qt(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(e,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Qt(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Qt(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Qt(e,"screenshot",{value:function(){e.getDataURL().then((function(e){Ht(e,"".concat(r.title||"artplayer","_").concat(ae(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(e,this),function(t,e){var r=t.template.$player;Qt(e,"fullscreen",{get:function(){return Pe.isFullscreen},set:function(n){n?Pe.request(r).then((function(){Ot(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Pe.exit().then((function(){kt(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Qt(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(e,this),function(t,e){var r=t.template.$player;Qt(e,"fullscreenWeb",{get:function(){return jt(r,"art-fullscreen-web")},set:function(n){n?(Ot(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(kt(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Qt(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Qt(e,"fullscreenRotate",{get:function(){return jt(n,"art-fullscreen-rotate")},set:function(r){if(r){Ot(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Qt(e,"autoSize",{get:function(){return jt(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,f=a/c,p=s/u;if(Ot(n,"art-auto-size"),p>f)St(o,"width","".concat(u*f/s*100,"%")),St(o,"height","100%");else{var d=s/f/u*100;St(o,"width","100%"),St(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else kt(n,"art-auto-size"),St(o,"width",null),St(o,"height",null),t.emit("autoSize")}})}(e,this),function(t,e){Qt(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Qt(e,t,{get:function(){return e.rect[t]}})})),Qt(e,"x",{get:function(){return e.left+window.pageXOffset}}),Qt(e,"y",{get:function(){return e.top+window.pageYOffset}})}(e,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Qt(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];It(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Qt(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(e,this),function(t,e){var r=t.template.$undercover;Qt(e,"light",{get:function(){return"none"!==Et(r,"display",!1)},set:function(e){St(r,"display",e?"block":"none"),t.emit("light",e)}})}(e,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,f="",p=!1,d=0,y=0,h=0,v=0;i(u,"mousedown",(function(t){p=!0,d=t.pageX,y=t.pageY,h=e.left,v=e.top})),i(document,"mousemove",(function(t){if(p){Ot(c,"art-is-dragging");var e=v+t.pageY-y,r=h+t.pageX-d;St(c,"top","".concat(e,"px")),St(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){p=!1,kt(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,p=!1,kt(c,"art-is-dragging")})),Pt(s,n.title||r.get("Mini player")),Qt(e,"mini",{get:function(){return jt(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,f=c.style.cssText,Ot(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)St(c,"top","".concat(i,"px")),St(c,"left","".concat(a,"px")),Tt(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,p=l.clientWidth-e.width-50;o.set("top",s),o.set("left",p),St(c,"top","".concat(s,"px")),St(c,"left","".concat(p,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=f,kt(c,"art-mini"),St(c,"top",null),St(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Qt(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(e,this),function(t,e){var r=[];Qt(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=ie(n[0],0,Math.min(n[1],e.duration)),i=ie(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(e,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Qt(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(It(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,St(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}St(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Qt(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(e,this),te(e,this)};var Ee=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t},$e=n((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Ee(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Ce=function(){function t(e){i(this,t),this.id=0,this.art=e,this.add=this.add.bind(this)}return c(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);It(!Kt(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");Ot(o,"art-".concat(this.name)),Ot(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):Pt(this.$parent,o),r.html&&Pt(o,r.html),r.style&&Rt(o,r.style),r.tooltip&&Dt(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&Ot(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;Ot(e,"art-control-selector");var a=document.createElement("div");Ot(a,"art-selector-value"),Pt(a,t.html),e.innerText="",Pt(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");Ot(l,"art-selector-list"),Pt(l,c),Pt(e,l);var s=function(){l.style.left="-".concat(Et(l,"width")/2-Et(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(jt(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return jt(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?Ot(e,r):kt(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function De(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Te(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=wt(".art-progress-loaded",t),c=wt(".art-progress-played",t),l=wt(".art-progress-highlight",t),s=wt(".art-progress-indicator",t),u=wt(".art-progress-tip",t);function f(t,e){"loaded"===t&&St(o,"width","".concat(100*e,"%")),"played"===t&&(St(c,"width","".concat(100*e,"%")),St(s,"left","calc(".concat(100*e,"% - ").concat(Et(s,"width")/2,"px)")))}n.forEach((function(t){var e=ie(t.time,0,a.duration)/a.duration*100;Pt(l,''))})),f("loaded",a.loaded),e.on("video:progress",(function(){f("loaded",a.loaded)})),e.on("video:timeupdate",(function(){f("played",a.played)})),e.on("video:ended",(function(){f("played",1)})),i(t,"mousemove",(function(r){St(u,"display","block"),At(r,l)?function(r){var n=Ne(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?St(u,"left",0):n>t.clientWidth-i/2?St(u,"left","".concat(t.clientWidth-i,"px")):St(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ne(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?St(u,"left",0):o>t.clientWidth-a/2?St(u,"left","".concat(t.clientWidth-a,"px")):St(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){St(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Ne(e,t),n=r.second;f("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ne(e,t),o=n.second,i=n.percentage;Ot(s,"art-show-indicator"),f("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,kt(s,"art-show-indicator"))}))}})}}function Ve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function He(t){for(var e=1;en.clientWidth-l/2?St(t,"left","".concat(n.clientWidth-l,"px")):St(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){St(t,"display","none")}))}})}}function tr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function er(t){for(var e=1;e'),o=Pt(t,'');e.on("loop",(function(e){e?(St(t,"display","block"),St(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),St(o,"left","".concat(e[1]/r.duration*100,"%"))):St(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return qe(qe({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=Pt(t,n.play),c=Pt(t,n.pause);function l(){St(a,"display","flex"),St(c,"display","none")}function s(){St(a,"display","none"),St(c,"display","flex")}Dt(a,o.get("Play")),Dt(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Xe(Xe({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=Pt(t,n.volume),l=Pt(t,n.volumeClose),s=Pt(t,'
'),u=Pt(s,'
');function f(t){var e=s.getBoundingClientRect().left;return ie(t.pageX-e-6,0,54)/48}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)St(c,"display","none"),St(l,"display","flex"),St(u,"left","0");else{var e=48*t;St(c,"display","flex"),St(l,"display","none"),St(u,"left","".concat(e,"px"))}}Dt(c,i.get("Mute")),St(l,"display","none"),e.isMobile&&St(s,"display","none"),p(o.volume),e.on("video:volumechange",(function(){p(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=f(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=f(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Be(Be({},t),{},{mounted:function(t){function r(){var r="".concat(ae(e.player.currentTime)," / ").concat(ae(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:o.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return nr(nr({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===o.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return er(er({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;Pt(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!o.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return He(He({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;Pt(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){Dt(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!o.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Ze(Ze({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;Pt(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){Dt(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!o.setting,position:"right",index:40})),n.add(function(t){return function(e){return Le(Le({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;Pt(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){Dt(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!o.pip,position:"right",index:50})),n.add(function(t){return function(e){return ze(ze({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;Pt(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){Dt(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!o.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return Te(Te({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;Pt(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){Dt(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!o.fullscreen,position:"right",index:70})),o.controls.forEach((function(t){n.add(t)}))})),n}return c(r,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,n=this.art.template,o=n.$progress,i=n.$controlsLeft,a=n.$controlsRight;switch(e.position){case"top":this.$parent=o;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:It(!1,"Control option.position must one of 'top', 'left', 'right'")}$e(p(r.prototype),"add",this).call(this,e)}}]),r}(Ce);function lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function sr(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=xt("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&Ct(r,"art-current")}))}})}}({disable:!o.playbackRate,name:"playbackRate",index:10})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return fr(fr({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=xt("span",t).find((function(t){return t.dataset.ratio===e}));r&&Ct(r,"art-current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio",index:20})),n.add(function(t){return function(e){return dr(dr({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),n.add(function(t){return hr(hr({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return mr(mr({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!o.light,name:"light",index:50})),n.add(function(t){return function(e){return gr(gr({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),o.contextmenu.forEach((function(t){n.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),n.show=!0;var e=t.clientX,r=t.clientY,o=c.getBoundingClientRect(),i=o.height,a=o.width,s=o.left,u=o.top,f=l.getBoundingClientRect(),p=f.height,d=f.width,y=e-s,h=r-u;e+d>s+a&&(y=a-d),r+p>u+i&&(h=i-p),Rt(l,{top:"".concat(h,"px"),left:"".concat(y,"px")})})),s(c,"click",(function(t){At(t,l)||(n.show=!1)})),t.on("blur",(function(){n.show=!1}))})),n}return r}(Ce);function Or(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var kr=function(t){s(r,t);var e=Or(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="info";var o=t.template,a=o.$infoPanel,c=o.$infoClose,l=o.$video;(0,t.events.proxy)(c,"click",(function(){n.show=!1}));var s=null,u=xt("[data-video]",a);return t.on("destroy",(function(){clearTimeout(s)})),t.on("info",(function(t){clearTimeout(s),t&&function t(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){t()}),1e3)}()})),n}return r}(Ce);function jr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Pr=function(t){s(r,t);var e=jr(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="subtitle";var o=t.option.subtitle,a=t.template.$subtitle;return Rt(a,o.style),o.url&&n.init(o.url),o.bilingual&&Ot(a,"art-bilingual"),n}return c(r,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===o(t)?Rt(r,t):St(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ce(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var f=document.createElement("track");f.default=!0,f.kind="metadata",s.appendChild(f),this.art.template.$track=f,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||Vt(t)){case"srt":return Nt(Ft(o));case"ass":return Nt(Wt(o));case"vtt":return Nt(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"bilingual",get:function(){return jt(this.art.template.$subtitle,"art-bilingual")},set:function(t){var e=this.art.template.$subtitle;t?Ot(e,"art-bilingual"):kt(e,"art-bilingual")}}]),r}(Ce);var Sr=function(){function t(e){var r=this;i(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){At(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(e,r),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){Ot(n,"art-hover"),t.emit("hover",!0)}),(function(){kt(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(e,r),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),kt(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(e,r),function(t,e){var r=t.option,n=t.player,o=oe((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(e,r),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=ie((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=ie(r.currentTime+60*e,0,r.duration),n.show="".concat(ae(c)," / ").concat(ae(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(e,r),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=ne((function(){t.emit("view",Tt(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(e,r)}))}return c(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),Rr=function(){function t(e){var r=this;i(this,t),this.keys={};var n=e.option,o=e.player,a=e.events.proxy;n.hotkey&&e.once("ready",(function(){r.add(27,(function(){o.fullscreenWeb&&(o.fullscreenWeb=!1)})),r.add(32,(function(){o.toggle=!0})),r.add(37,(function(){o.backward=5})),r.add(38,(function(){o.volume+=.1})),r.add(39,(function(){o.forward=5})),r.add(40,(function(){o.volume-=.1})),a(window,"keydown",(function(t){if(e.isFocus){var n=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==n&&"TEXTAREA"!==n&&""!==o&&"true"!==o){var i=r.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(e)})),e.emit("hotkey",t))}}}))}))}return c(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Er(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var $r=function(t){s(r,t);var e=Er(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="layer",n.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){n.add(t)}))})),n}return r}(Ce);function Cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Dr=function(t){s(r,t);var e=Cr(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="loading",Pt(t.template.$loading,t.icons.loading),n}return r}(Ce),Tr=function(){function t(e){i(this,t),this.art=e,this.time=2e3,this.timer=null}return c(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,Ot(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",kt(r,"art-notice-show")}),this.time)}}]),t}();function Ar(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var zr=function(t){s(r,t);var e=Ar(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="mask",Pt(t.template.$state,t.icons.state),n}return r}(Ce);function _r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Lr=function t(e){var n=this;i(this,t);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},e.option.icons);Object.keys(o).forEach((function(t){Qt(n,t,{get:function(){var e=document.createElement("i");return Ot(e,"art-icon"),Ot(e,"art-icon-".concat(t)),Pt(e,o[t]),e}})}))};function Mr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qr(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=xt("button",t).find((function(t){return t.dataset.value===e}));r&&Ct(r.parentElement,"current")}))}})}}({disable:!o.flip,name:"flip"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Fr(Fr({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=wt(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!o.rotate,name:"rotate"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Wr(Wr({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=xt("button",t).find((function(t){return t.dataset.value===e}));r&&Ct(r.parentElement,"current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Hr(Hr({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=wt(".art-setting-range input",t),i=wt(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!o.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){n.show=!1}))),n}return r}(Ce),Yr=function(){function t(){i(this,t),this.name="artplayer_settings"}return c(t,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var n=Object.assign({},this.get(),r({},t,e));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),t}();function Xr(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=wt(".art-setting-range input",e),i=wt(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function Jr(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Xr);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Zr(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else It(!1,"Playback of this file format is not supported")}}function l(t){var r=Pt(t,'');St(t,"position","relative"),Rt(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=wt(".art-upload-btn",e),n=wt(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Qr(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=Pt(n,'');St(n,"position","relative"),Rt(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=Vt(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):It(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=wt(".art-upload-btn",e),n=wt(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Gr(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Kr(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var tn=function(){function t(e){var r=this;i(this,t),this.art=e,this.id=0;var n=e.option;n.subtitle.url&&n.subtitleOffset&&this.add(Jr),!n.isLive&&n.miniProgressBar&&this.add(Gr),n.localVideo&&this.add(Zr),n.localSubtitle&&this.add(Qr),n.networkMonitor&&this.add(Kr),e.option.plugins.forEach((function(t){r.add(t)}))}return c(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return It(!Kt(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Qt(this,r,{value:e}),this}}]),t}(),en=function t(e){i(this,t);var r=e.option,n=e.events.proxy,o=e.template.$video;ge.events.forEach((function(t){n(o,t,(function(t){e.emit("video:".concat(t.type),t)}))})),Object.keys(r.moreVideoAttr).forEach((function(t){o[t]=r.moreVideoAttr[t]})),r.muted&&(o.muted=r.muted),r.volume&&(o.volume=ie(r.volume,0,1)),r.poster&&(o.poster=r.poster),r.autoplay&&(o.autoplay=r.autoplay),o.controls=!0;var a=r.type||Vt(r.url),c=r.customType[a];a&&c?(c(o,r.url,e),e.emit("customType",a)):(o.src=r.url,e.emit("url",o.src))};function rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var nn=0,on=[],an=function(t){s(r,t);var e=rn(r);function r(t){var n;return i(this,r),(n=e.call(this)).option=yt(ee(r.option,t),be),n.isFocus=!1,n.isDestroy=!1,n.userAgent=vt,n.isMobile=mt,n.isWechat=gt,n.whitelist=new we(u(n)),n.template=new xe(u(n)),n.events=new Sr(u(n)),n.whitelist.state?(n.storage=new Yr(u(n)),n.icons=new Lr(u(n)),n.i18n=new je(u(n)),n.notice=new Tr(u(n)),n.player=new Re(u(n)),n.layers=new $r(u(n)),n.controls=new cr(u(n)),n.contextmenu=new xr(u(n)),n.subtitle=new Pr(u(n)),n.info=new kr(u(n)),n.loading=new Dr(u(n)),n.hotkey=new Rr(u(n)),n.mask=new zr(u(n)),n.setting=new Br(u(n)),n.plugins=new tn(u(n))):n.mobile=new en(u(n)),nn+=1,n.id=nn,on.push(u(n)),n}return c(r,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),on.splice(on.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return on}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return ge}},{key:"utils",get:function(){return le}},{key:"scheme",get:function(){return be}},{key:"Emitter",get:function(){return ht}},{key:"validator",get:function(){return yt}},{key:"kindOf",get:function(){return yt.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:bt?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),r}(ht);function cn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ln(t){for(var e=1;e1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function m(t,e){return t.classList.add(e)}function w(t,e){return t.classList.remove(e)}function x(t,e){return t.classList.contains(e)}function O(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function k(t,e,r){return t.style[e]=r,t}function j(t,e){return Object.keys(e).forEach((function(r){k(t,r,e[r])})),t}function P(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function S(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function R(t,e){S(t).forEach((function(t){return w(t,e)})),m(t,e)}function E(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";h||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function D(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function $(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var T=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var z=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},A=i((function(t){function e(r,n,o){return z()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&a(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var L=function(t){c(n,t);var r=C(n);function n(t,i){var a;return e(this,n),a=r.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o(a),i||a.constructor),a.name="ArtPlayerError",a}return n}(i((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!T(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return A(t,arguments,u(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),a(e,t)},e(r)}t.exports=e}))(Error));function M(t,e){if(!t)throw new L(e);return t}function q(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function F(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function I(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var V=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function tt(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ot(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var it=Object.freeze({__proto__:null,query:v,queryAll:g,addClass:m,removeClass:w,hasClass:x,append:O,remove:function(t){return t.parentNode.removeChild(t)},setStyle:k,setStyles:j,getStyle:P,sublings:S,inverseClass:R,tooltip:E,isInViewport:D,includeFromEvent:$,ArtPlayerError:L,errorHandle:M,srtToVtt:q,vttToBlob:F,assToVtt:H,getExt:W,download:I,def:Y,has:J,proxyPropertys:Q,mergeDeep:G,sleep:K,debounce:tt,throttle:et,clamp:rt,secondToTime:nt,escape:ot,userAgent:d,isMobile:h,isSafari:y,isWechat:b});function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(e){for(var r=1;r-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function t(r){var n=this;e(this,t),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=v(r.option.container),M(this.$container,"No container element found by ".concat(r.option.container))),M(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),M(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return n(t,[{key:"query",value:function(t){return v(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(m(this.$settingInner,"art-backdrop-filter"),m(this.$info,"art-backdrop-filter"),m(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&m(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":m(this.$player,"art-destroy")}}]),t}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function t(r){e(this,t),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return n(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=G(this.languages,t),this.init()}}]),t}();var Ot=i((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*l/s;k(n,"width","".concat(100*h,"%")),k(n,"height","100%"),k(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=s/d/l;k(n,"width","100%"),k(n,"height","".concat(100*y,"%")),k(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Y(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Y(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Y(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Y(e,"screenshot",{value:function(){e.getDataURL().then((function(e){I(e,"".concat(r.title||"artplayer","_").concat(nt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){w(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Y(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreenWeb",{get:function(){return x(r,"art-fullscreen-web")},set:function(n){n?(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(w(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Y(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Y(e,"fullscreenRotate",{get:function(){return x(n,"art-fullscreen-rotate")},set:function(r){if(r){m(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,s=o.clientHeight,l=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Y(e,"autoSize",{get:function(){return x(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,s=n.getBoundingClientRect(),l=s.width,u=s.height,p=a/c,f=l/u;if(m(n,"art-auto-size"),f>p)k(o,"width","".concat(u*p/l*100,"%")),k(o,"height","100%");else{var d=l/p/u*100;k(o,"width","100%"),k(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else w(n,"art-auto-size"),k(o,"width",null),k(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){Y(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Y(e,t,{get:function(){return e.rect[t]}})})),Y(e,"x",{get:function(){return e.left+window.pageXOffset}}),Y(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Y(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];M(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Y(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;Y(e,"light",{get:function(){return"none"!==P(r,"display",!1)},set:function(e){k(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,s=a.$miniClose,l=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){m(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;k(c,"top","".concat(e,"px")),k(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,w(c,"art-is-dragging")})),i(s,"click",(function(){e.mini=!1,f=!1,w(c,"art-is-dragging")})),O(l,n.title||r.get("Mini player")),Y(e,"mini",{get:function(){return x(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,m(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)k(c,"top","".concat(i,"px")),k(c,"left","".concat(a,"px")),D(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var s=document.body,l=s.clientHeight-e.height-50,f=s.clientWidth-e.width-50;o.set("top",l),o.set("left",f),k(c,"top","".concat(l,"px")),k(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,w(c,"art-mini"),k(c,"top",null),k(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Y(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];Y(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=rt(n[0],0,Math.min(n[1],e.duration)),i=rt(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Y(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(M(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,k(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var s=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},l=0,u=1;switch(r){case-270:l=90,u=s();break;case-180:l=180;break;case-90:l=270,u=s();break;case 90:l=90,u=s();break;case 180:l=180;break;case 270:l=270,u=s()}k(n,"transform","rotate(".concat(l,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Y(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),Q(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t},St=i((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function t(r){e(this,t),this.id=0,this.art=r,this.add=this.add.bind(this)}return n(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);M(!J(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");m(o,"art-".concat(this.name)),m(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):O(this.$parent,o),r.html&&O(o,r.html),r.style&&j(o,r.style),r.tooltip&&E(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&m(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;m(e,"art-control-selector");var a=document.createElement("div");m(a,"art-selector-value"),O(a,t.html),e.innerText="",O(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),s=document.createElement("div");m(s,"art-selector-list"),O(s,c),O(e,s);var l=function(){s.style.left="-".concat(P(s,"width")/2-P(e,"width")/2,"px")};o(e,l),i(e,"click",(function(e){if(x(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,l(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return x(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?m(e,r):w(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var r=1;r
'),mounted:function(t){var r=!1,o=v(".art-progress-loaded",t),c=v(".art-progress-played",t),s=v(".art-progress-highlight",t),l=v(".art-progress-indicator",t),u=v(".art-progress-tip",t);function p(t,e){"loaded"===t&&k(o,"width","".concat(100*e,"%")),"played"===t&&(k(c,"width","".concat(100*e,"%")),k(l,"left","calc(".concat(100*e,"% - ").concat(P(l,"width")/2,"px)")))}n.forEach((function(t){var e=rt(t.time,0,a.duration)/a.duration*100;O(s,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){k(u,"display","block"),$(r,s)?function(r){var n=Ft(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?k(u,"left",0):n>t.clientWidth-i/2?k(u,"left","".concat(t.clientWidth-i,"px")):k(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ft(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?k(u,"left",0):o>t.clientWidth-a/2?k(u,"left","".concat(t.clientWidth-a,"px")):k(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){k(u,"display","none")})),i(t,"click",(function(t){if(t.target!==l){var r=Ft(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(l,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ft(e,t),o=n.second,i=n.percentage;m(l,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,w(l,"art-show-indicator"))}))}})}}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(e){for(var r=1;rn.clientWidth-s/2?k(t,"left","".concat(n.clientWidth-s,"px")):k(t,"left","".concat(i-s/2,"px"))}(o))})),i(n,"mouseout",(function(){k(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(e){for(var r=1;r'),o=O(t,'');e.on("loop",(function(e){e?(k(t,"display","block"),k(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),k(o,"left","".concat(e[1]/r.duration*100,"%"))):k(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=O(t,n.play),c=O(t,n.pause);function s(){k(a,"display","flex"),k(c,"display","none")}function l(){k(a,"display","none"),k(c,"display","flex")}E(a,o.get("Play")),E(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?l():s(),e.on("video:playing",(function(){l()})),e.on("video:pause",(function(){s()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=O(t,n.volume),s=O(t,n.volumeClose),l=O(t,'
'),u=O(l,'
');function p(t){var e=l.getBoundingClientRect().left;return rt(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)k(c,"display","none"),k(s,"display","flex"),k(u,"left","0");else{var e=48*t;k(c,"display","flex"),k(s,"display","none"),k(u,"left","".concat(e,"px"))}}E(c,i.get("Mute")),k(s,"display","none"),e.isMobile&&k(l,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(s,"click",(function(){o.muted=!1})),r(l,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(nt(e.player.currentTime)," / ").concat(nt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;O(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;O(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){E(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;O(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){E(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),n.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){E(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),n.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){E(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){E(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){n.add(t)}))})),n}return n(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:M(!1,"Control option.position must one of 'top', 'left', 'right'")}St(u(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var r=1;r0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=g("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&R(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return se(se({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("span",t).find((function(t){return t.dataset.ratio===e}));r&&R(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),l(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,l=n.left,u=n.top,p=s.getBoundingClientRect(),f=p.height,d=p.width,h=e-l,y=r-u;e+d>l+a&&(h=a-d),r+f>u+i&&(y=i-f),j(s,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),l(c,"click",(function(t){$(t,s)||(o.show=!1)})),t.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(t){c(n,t);var r=me(n);function n(t){var o;e(this,n),(o=r.call(this,t)).name="info";var i=t.template,a=i.$infoPanel,c=i.$infoClose,s=i.$video;(0,t.events.proxy)(c,"click",(function(){o.show=!1}));var l=null,u=g("[data-video]",a);function p(){u.forEach((function(t){var e=s[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),l=setTimeout((function(){p()}),1e3)}return t.on("destroy",(function(){clearTimeout(l)})),t.on("info",(function(t){clearTimeout(l),t&&p()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(t){c(o,t);var r=xe(o);function o(t){var n;e(this,o),(n=r.call(this,t)).name="subtitle";var i=t.option.subtitle,a=t.template.$subtitle;return j(a,i.style),i.url&&n.init(i.url),i.bilingual&&m(a,"art-bilingual"),n}return n(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===s(t)?j(r,t):k(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ot(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,s=c.$subtitle,l=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",l.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return F(q(o));case"ass":return F(H(o));case"vtt":return F(o);default:return t}})).then((function(t){return s.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}}]),o}(Rt);var ke=function(){function t(r){var n=this;e(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){$(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){m(n,"art-hover"),t.emit("hover",!0)}),(function(){w(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),w(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=et((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=rt((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=rt(r.currentTime+60*e,0,r.duration),n.show="".concat(nt(c)," / ").concat(nt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=tt((function(){t.emit("view",D(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return n(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),je=function(){function t(r){var n=this;e(this,t),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return n(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(t){c(n,t);var r=Pe(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="layer",o.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(t){c(n,t);var r=Re(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="loading",O(t.template.$loading,t.icons.loading),o}return n}(Rt),De=function(){function t(r){e(this,t),this.art=r,this.time=2e3,this.timer=null}return n(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,m(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",w(r,"art-notice-show")}),this.time)}}]),t}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(t){c(n,t);var r=$e(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="mask",O(t.template.$state,t.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function r(n){var o=this;e(this,r);var i=function(e){for(var r=1;r',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},n.option.icons);Object.keys(i).forEach((function(t){Y(o,t,{get:function(){var e=document.createElement("i");return m(e,"art-icon"),m(e,"art-icon-".concat(t)),O(e,i[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var r=1;r'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=v(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return He(He({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=v(".art-setting-range input",t),i=v(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function r(){e(this,r),this.name="artplayer_settings"}return n(r,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(e,r){var n=Object.assign({},this.get(),t({},e,r));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),r}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=v(".art-setting-range input",e),i=v(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var s=Array.from(o.$track.track.cues),l=e(r,-5,5);s.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+l,0,a.duration),t.endTime=e(c[r].endTime+l,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else M(!1,"Playback of this file format is not supported")}}function s(t){var r=O(t,'');k(t,"position","relative"),j(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),s(r)}})})),{name:"localVideo",attach:s}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=O(n,'');k(n,"position","relative"),j(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):M(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function t(r){var n=this;e(this,t),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return n(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return M(!J(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Y(this,r,{value:e}),this}}]),t}(),Ge=function t(r){e(this,t);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=rt(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(t){c(i,t);var r=Ke(i);function i(t){var n;return e(this,i),(n=r.call(this)).option=p(G(i.option,t),yt),n.isFocus=!1,n.isDestroy=!1,n.userAgent=d,n.isMobile=h,n.isWechat=b,n.whitelist=new vt(o(n)),n.template=new gt(o(n)),n.events=new ke(o(n)),n.whitelist.state?(n.storage=new Ne(o(n)),n.icons=new Ae(o(n)),n.i18n=new xt(o(n)),n.notice=new De(o(n)),n.player=new jt(o(n)),n.layers=new Se(o(n)),n.controls=new oe(o(n)),n.contextmenu=new ge(o(n)),n.subtitle=new Oe(o(n)),n.info=new we(o(n)),n.loading=new Ee(o(n)),n.hotkey=new je(o(n)),n.mask=new Te(o(n)),n.setting=new Be(o(n)),n.plugins=new Qe(o(n))):n.mobile=new Ge(o(n)),tr+=1,n.id=tr,er.push(o(n)),n}return n(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return it}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return f}},{key:"validator",get:function(){return p}},{key:"kindOf",get:function(){return p.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:y?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(f);function nr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function or(e){for(var r=1;r1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function m(t,e){return t.classList.add(e)}function w(t,e){return t.classList.remove(e)}function x(t,e){return t.classList.contains(e)}function O(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function k(t,e,r){return t.style[e]=r,t}function j(t,e){return Object.keys(e).forEach((function(r){k(t,r,e[r])})),t}function P(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function S(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function R(t,e){S(t).forEach((function(t){return w(t,e)})),m(t,e)}function E(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";h||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function D(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function $(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var T=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var z=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},A=i((function(t){function e(r,n,o){return z()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&a(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var L=function(t){c(n,t);var r=C(n);function n(t,i){var a;return e(this,n),a=r.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o(a),i||a.constructor),a.name="ArtPlayerError",a}return n}(i((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!T(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return A(t,arguments,u(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),a(e,t)},e(r)}t.exports=e}))(Error));function M(t,e){if(!t)throw new L(e);return t}function q(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function F(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function I(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var V=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function tt(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ot(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var it=Object.freeze({__proto__:null,query:v,queryAll:g,addClass:m,removeClass:w,hasClass:x,append:O,remove:function(t){return t.parentNode.removeChild(t)},setStyle:k,setStyles:j,getStyle:P,sublings:S,inverseClass:R,tooltip:E,isInViewport:D,includeFromEvent:$,ArtPlayerError:L,errorHandle:M,srtToVtt:q,vttToBlob:F,assToVtt:H,getExt:W,download:I,def:Y,has:J,proxyPropertys:Q,mergeDeep:G,sleep:K,debounce:tt,throttle:et,clamp:rt,secondToTime:nt,escape:ot,userAgent:d,isMobile:h,isSafari:y,isWechat:b});function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(e){for(var r=1;r-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function t(r){var n=this;e(this,t),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=v(r.option.container),M(this.$container,"No container element found by ".concat(r.option.container))),M(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),M(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return n(t,[{key:"query",value:function(t){return v(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(m(this.$settingInner,"art-backdrop-filter"),m(this.$info,"art-backdrop-filter"),m(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&m(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":m(this.$player,"art-destroy")}}]),t}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function t(r){e(this,t),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return n(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=G(this.languages,t),this.init()}}]),t}();var Ot=i((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*l/s;k(n,"width","".concat(100*h,"%")),k(n,"height","100%"),k(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=s/d/l;k(n,"width","100%"),k(n,"height","".concat(100*y,"%")),k(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Y(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Y(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Y(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Y(e,"screenshot",{value:function(){e.getDataURL().then((function(e){I(e,"".concat(r.title||"artplayer","_").concat(nt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){w(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Y(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreenWeb",{get:function(){return x(r,"art-fullscreen-web")},set:function(n){n?(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(w(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Y(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Y(e,"fullscreenRotate",{get:function(){return x(n,"art-fullscreen-rotate")},set:function(r){if(r){m(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,s=o.clientHeight,l=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Y(e,"autoSize",{get:function(){return x(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,s=n.getBoundingClientRect(),l=s.width,u=s.height,p=a/c,f=l/u;if(m(n,"art-auto-size"),f>p)k(o,"width","".concat(u*p/l*100,"%")),k(o,"height","100%");else{var d=l/p/u*100;k(o,"width","100%"),k(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else w(n,"art-auto-size"),k(o,"width",null),k(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){Y(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Y(e,t,{get:function(){return e.rect[t]}})})),Y(e,"x",{get:function(){return e.left+window.pageXOffset}}),Y(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Y(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];M(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Y(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;Y(e,"light",{get:function(){return"none"!==P(r,"display",!1)},set:function(e){k(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,s=a.$miniClose,l=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){m(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;k(c,"top","".concat(e,"px")),k(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,w(c,"art-is-dragging")})),i(s,"click",(function(){e.mini=!1,f=!1,w(c,"art-is-dragging")})),O(l,n.title||r.get("Mini player")),Y(e,"mini",{get:function(){return x(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,m(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)k(c,"top","".concat(i,"px")),k(c,"left","".concat(a,"px")),D(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var s=document.body,l=s.clientHeight-e.height-50,f=s.clientWidth-e.width-50;o.set("top",l),o.set("left",f),k(c,"top","".concat(l,"px")),k(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,w(c,"art-mini"),k(c,"top",null),k(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Y(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];Y(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=rt(n[0],0,Math.min(n[1],e.duration)),i=rt(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Y(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(M(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,k(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var s=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},l=0,u=1;switch(r){case-270:l=90,u=s();break;case-180:l=180;break;case-90:l=270,u=s();break;case 90:l=90,u=s();break;case 180:l=180;break;case 270:l=270,u=s()}k(n,"transform","rotate(".concat(l,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Y(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),Q(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t},St=i((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function t(r){e(this,t),this.id=0,this.art=r,this.add=this.add.bind(this)}return n(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);M(!J(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");m(o,"art-".concat(this.name)),m(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):O(this.$parent,o),r.html&&O(o,r.html),r.style&&j(o,r.style),r.tooltip&&E(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&m(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;m(e,"art-control-selector");var a=document.createElement("div");m(a,"art-selector-value"),O(a,t.html),e.innerText="",O(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),s=document.createElement("div");m(s,"art-selector-list"),O(s,c),O(e,s);var l=function(){s.style.left="-".concat(P(s,"width")/2-P(e,"width")/2,"px")};o(e,l),i(e,"click",(function(e){if(x(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,l(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return x(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?m(e,r):w(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var r=1;r
'),mounted:function(t){var r=!1,o=v(".art-progress-loaded",t),c=v(".art-progress-played",t),s=v(".art-progress-highlight",t),l=v(".art-progress-indicator",t),u=v(".art-progress-tip",t);function p(t,e){"loaded"===t&&k(o,"width","".concat(100*e,"%")),"played"===t&&(k(c,"width","".concat(100*e,"%")),k(l,"left","calc(".concat(100*e,"% - ").concat(P(l,"width")/2,"px)")))}n.forEach((function(t){var e=rt(t.time,0,a.duration)/a.duration*100;O(s,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){k(u,"display","block"),$(r,s)?function(r){var n=Ft(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?k(u,"left",0):n>t.clientWidth-i/2?k(u,"left","".concat(t.clientWidth-i,"px")):k(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ft(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?k(u,"left",0):o>t.clientWidth-a/2?k(u,"left","".concat(t.clientWidth-a,"px")):k(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){k(u,"display","none")})),i(t,"click",(function(t){if(t.target!==l){var r=Ft(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(l,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ft(e,t),o=n.second,i=n.percentage;m(l,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,w(l,"art-show-indicator"))}))}})}}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(e){for(var r=1;rn.clientWidth-s/2?k(t,"left","".concat(n.clientWidth-s,"px")):k(t,"left","".concat(i-s/2,"px"))}(o))})),i(n,"mouseout",(function(){k(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(e){for(var r=1;r'),o=O(t,'');e.on("loop",(function(e){e?(k(t,"display","block"),k(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),k(o,"left","".concat(e[1]/r.duration*100,"%"))):k(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=O(t,n.play),c=O(t,n.pause);function s(){k(a,"display","flex"),k(c,"display","none")}function l(){k(a,"display","none"),k(c,"display","flex")}E(a,o.get("Play")),E(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?l():s(),e.on("video:playing",(function(){l()})),e.on("video:pause",(function(){s()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=O(t,n.volume),s=O(t,n.volumeClose),l=O(t,'
'),u=O(l,'
');function p(t){var e=l.getBoundingClientRect().left;return rt(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)k(c,"display","none"),k(s,"display","flex"),k(u,"left","0");else{var e=48*t;k(c,"display","flex"),k(s,"display","none"),k(u,"left","".concat(e,"px"))}}E(c,i.get("Mute")),k(s,"display","none"),e.isMobile&&k(l,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(s,"click",(function(){o.muted=!1})),r(l,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(nt(e.player.currentTime)," / ").concat(nt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;O(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;O(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){E(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;O(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){E(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),n.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){E(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),n.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){E(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){E(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){n.add(t)}))})),n}return n(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:M(!1,"Control option.position must one of 'top', 'left', 'right'")}St(u(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var r=1;r0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=g("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&R(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return se(se({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("span",t).find((function(t){return t.dataset.ratio===e}));r&&R(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),l(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,l=n.left,u=n.top,p=s.getBoundingClientRect(),f=p.height,d=p.width,h=e-l,y=r-u;e+d>l+a&&(h=a-d),r+f>u+i&&(y=i-f),j(s,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),l(c,"click",(function(t){$(t,s)||(o.show=!1)})),t.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(t){c(n,t);var r=me(n);function n(t){var o;e(this,n),(o=r.call(this,t)).name="info";var i=t.template,a=i.$infoPanel,c=i.$infoClose,s=i.$video;(0,t.events.proxy)(c,"click",(function(){o.show=!1}));var l=null,u=g("[data-video]",a);return t.on("destroy",(function(){clearTimeout(l)})),t.on("info",(function(t){clearTimeout(l),t&&function t(){u.forEach((function(t){var e=s[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),l=setTimeout((function(){t()}),1e3)}()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(t){c(o,t);var r=xe(o);function o(t){var n;e(this,o),(n=r.call(this,t)).name="subtitle";var i=t.option.subtitle,a=t.template.$subtitle;return j(a,i.style),i.url&&n.init(i.url),i.bilingual&&m(a,"art-bilingual"),n}return n(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===s(t)?j(r,t):k(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ot(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,s=c.$subtitle,l=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",l.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return F(q(o));case"ass":return F(H(o));case"vtt":return F(o);default:return t}})).then((function(t){return s.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"bilingual",get:function(){return x(this.art.template.$subtitle,"art-bilingual")},set:function(t){var e=this.art.template.$subtitle;t?m(e,"art-bilingual"):w(e,"art-bilingual")}}]),o}(Rt);var ke=function(){function t(r){var n=this;e(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){$(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){m(n,"art-hover"),t.emit("hover",!0)}),(function(){w(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),w(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=et((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=rt((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=rt(r.currentTime+60*e,0,r.duration),n.show="".concat(nt(c)," / ").concat(nt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=tt((function(){t.emit("view",D(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return n(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),je=function(){function t(r){var n=this;e(this,t),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return n(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(t){c(n,t);var r=Pe(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="layer",o.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(t){c(n,t);var r=Re(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="loading",O(t.template.$loading,t.icons.loading),o}return n}(Rt),De=function(){function t(r){e(this,t),this.art=r,this.time=2e3,this.timer=null}return n(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,m(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",w(r,"art-notice-show")}),this.time)}}]),t}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(t){c(n,t);var r=$e(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="mask",O(t.template.$state,t.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function r(n){var o=this;e(this,r);var i=function(e){for(var r=1;r',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},n.option.icons);Object.keys(i).forEach((function(t){Y(o,t,{get:function(){var e=document.createElement("i");return m(e,"art-icon"),m(e,"art-icon-".concat(t)),O(e,i[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var r=1;r'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=v(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return He(He({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=v(".art-setting-range input",t),i=v(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function r(){e(this,r),this.name="artplayer_settings"}return n(r,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(e,r){var n=Object.assign({},this.get(),t({},e,r));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),r}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=v(".art-setting-range input",e),i=v(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var s=Array.from(o.$track.track.cues),l=e(r,-5,5);s.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+l,0,a.duration),t.endTime=e(c[r].endTime+l,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else M(!1,"Playback of this file format is not supported")}}function s(t){var r=O(t,'');k(t,"position","relative"),j(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),s(r)}})})),{name:"localVideo",attach:s}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=O(n,'');k(n,"position","relative"),j(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):M(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function t(r){var n=this;e(this,t),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return n(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return M(!J(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Y(this,r,{value:e}),this}}]),t}(),Ge=function t(r){e(this,t);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=rt(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(t){c(i,t);var r=Ke(i);function i(t){var n;return e(this,i),(n=r.call(this)).option=p(G(i.option,t),yt),n.isFocus=!1,n.isDestroy=!1,n.userAgent=d,n.isMobile=h,n.isWechat=b,n.whitelist=new vt(o(n)),n.template=new gt(o(n)),n.events=new ke(o(n)),n.whitelist.state?(n.storage=new Ne(o(n)),n.icons=new Ae(o(n)),n.i18n=new xt(o(n)),n.notice=new De(o(n)),n.player=new jt(o(n)),n.layers=new Se(o(n)),n.controls=new oe(o(n)),n.contextmenu=new ge(o(n)),n.subtitle=new Oe(o(n)),n.info=new we(o(n)),n.loading=new Ee(o(n)),n.hotkey=new je(o(n)),n.mask=new Te(o(n)),n.setting=new Be(o(n)),n.plugins=new Qe(o(n))):n.mobile=new Ge(o(n)),tr+=1,n.id=tr,er.push(o(n)),n}return n(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return it}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return f}},{key:"validator",get:function(){return p}},{key:"kindOf",get:function(){return p.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:y?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(f);function nr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function or(e){for(var r=1;r1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function g(t,e){return t.classList.add(e)}function m(t,e){return t.classList.remove(e)}function w(t,e){return t.classList.contains(e)}function x(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function O(t,e,r){return t.style[e]=r,t}function k(t,e){return Object.keys(e).forEach((function(r){O(t,r,e[r])})),t}function j(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function P(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function S(t,e){P(t).forEach((function(t){return m(t,e)})),g(t,e)}function R(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";d||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function E(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function D(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var $=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var T=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},z=o((function(t){function e(r,n,o){return T()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&i(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var C=function(e){a(o,e);var r=A(o);function o(e,i){var a;return t(this,o),a=r.call(this,e),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(n(a),i||a.constructor),a.name="ArtPlayerError",a}return o}(o((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!$(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return z(t,arguments,s(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},e(r)}t.exports=e}))(Error));function L(t,e){if(!t)throw new C(e);return t}function M(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function q(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function F(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var I=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function K(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function nt(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var ot=Object.freeze({__proto__:null,query:b,queryAll:v,addClass:g,removeClass:m,hasClass:w,append:x,remove:function(t){return t.parentNode.removeChild(t)},setStyle:O,setStyles:k,getStyle:j,sublings:P,inverseClass:S,tooltip:R,isInViewport:E,includeFromEvent:D,ArtPlayerError:C,errorHandle:L,srtToVtt:M,vttToBlob:q,assToVtt:H,getExt:W,download:F,def:X,has:Z,proxyPropertys:J,mergeDeep:Q,sleep:G,debounce:K,throttle:tt,clamp:et,secondToTime:rt,escape:nt,userAgent:f,isMobile:d,isSafari:h,isWechat:y});var it=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function e(r){var n=this;t(this,e),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=b(r.option.container),L(this.$container,"No container element found by ".concat(r.option.container))),L(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),L(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return r(e,[{key:"query",value:function(t){return b(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(g(this.$settingInner,"art-backdrop-filter"),g(this.$info,"art-backdrop-filter"),g(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&g(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":g(this.$player,"art-destroy")}}]),e}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function e(r){t(this,e),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=Q(this.languages,t),this.init()}}]),e}();var Ot=o((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*s/l;O(n,"width","".concat(100*h,"%")),O(n,"height","100%"),O(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=l/d/s;O(n,"width","100%"),O(n,"height","".concat(100*y,"%")),O(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),X(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");X(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),X(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),X(e,"screenshot",{value:function(){e.getDataURL().then((function(e){F(e,"".concat(r.title||"artplayer","_").concat(rt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){g(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),X(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreenWeb",{get:function(){return w(r,"art-fullscreen-web")},set:function(n){n?(g(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),X(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;X(e,"fullscreenRotate",{get:function(){return w(n,"art-fullscreen-rotate")},set:function(r){if(r){g(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;X(e,"autoSize",{get:function(){return w(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,p=a/c,f=s/u;if(g(n,"art-auto-size"),f>p)O(o,"width","".concat(u*p/s*100,"%")),O(o,"height","100%");else{var d=s/p/u*100;O(o,"width","100%"),O(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else m(n,"art-auto-size"),O(o,"width",null),O(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){X(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){X(e,t,{get:function(){return e.rect[t]}})})),X(e,"x",{get:function(){return e.left+window.pageXOffset}}),X(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;X(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];L(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),X(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;X(e,"light",{get:function(){return"none"!==j(r,"display",!1)},set:function(e){O(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){g(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;O(c,"top","".concat(e,"px")),O(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,m(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,f=!1,m(c,"art-is-dragging")})),x(s,n.title||r.get("Mini player")),X(e,"mini",{get:function(){return w(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,g(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)O(c,"top","".concat(i,"px")),O(c,"left","".concat(a,"px")),E(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,f=l.clientWidth-e.width-50;o.set("top",s),o.set("left",f),O(c,"top","".concat(s,"px")),O(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,m(c,"art-mini"),O(c,"top",null),O(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),X(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];X(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=et(n[0],0,Math.min(n[1],e.duration)),i=et(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;X(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(L(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,O(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}O(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),X(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),J(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t},St=o((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function e(r){t(this,e),this.id=0,this.art=r,this.add=this.add.bind(this)}return r(e,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);L(!Z(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");g(o,"art-".concat(this.name)),g(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):x(this.$parent,o),r.html&&x(o,r.html),r.style&&k(o,r.style),r.tooltip&&R(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&g(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;g(e,"art-control-selector");var a=document.createElement("div");g(a,"art-selector-value"),x(a,t.html),e.innerText="",x(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");g(l,"art-selector-list"),x(l,c),x(e,l);var s=function(){l.style.left="-".concat(j(l,"width")/2-j(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(w(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return w(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?g(e,r):m(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),e}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=b(".art-progress-loaded",t),c=b(".art-progress-played",t),l=b(".art-progress-highlight",t),s=b(".art-progress-indicator",t),u=b(".art-progress-tip",t);function p(t,e){"loaded"===t&&O(o,"width","".concat(100*e,"%")),"played"===t&&(O(c,"width","".concat(100*e,"%")),O(s,"left","calc(".concat(100*e,"% - ").concat(j(s,"width")/2,"px)")))}n.forEach((function(t){var e=et(t.time,0,a.duration)/a.duration*100;x(l,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){O(u,"display","block"),D(r,l)?function(r){var n=Ht(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?O(u,"left",0):n>t.clientWidth-i/2?O(u,"left","".concat(t.clientWidth-i,"px")):O(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ht(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?O(u,"left",0):o>t.clientWidth-a/2?O(u,"left","".concat(t.clientWidth-a,"px")):O(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){O(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Ht(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ht(e,t),o=n.second,i=n.percentage;g(s,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,m(s,"art-show-indicator"))}))}})}}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;en.clientWidth-l/2?O(t,"left","".concat(n.clientWidth-l,"px")):O(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){O(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(t){for(var e=1;e'),o=x(t,'');e.on("loop",(function(e){e?(O(t,"display","block"),O(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),O(o,"left","".concat(e[1]/r.duration*100,"%"))):O(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),r.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=x(t,n.play),c=x(t,n.pause);function l(){O(a,"display","flex"),O(c,"display","none")}function s(){O(a,"display","none"),O(c,"display","flex")}R(a,o.get("Play")),R(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),r.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=x(t,n.volume),l=x(t,n.volumeClose),s=x(t,'
'),u=x(s,'
');function p(t){var e=s.getBoundingClientRect().left;return et(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)O(c,"display","none"),O(l,"display","flex"),O(u,"left","0");else{var e=48*t;O(c,"display","flex"),O(l,"display","none"),O(u,"left","".concat(e,"px"))}}R(c,i.get("Mute")),O(l,"display","none"),e.isMobile&&O(s,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),r.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(rt(e.player.currentTime)," / ").concat(rt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),r.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),r.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;x(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),r.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;x(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){R(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),r.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;x(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){R(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),r.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){R(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),r.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){R(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),r.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){R(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){r.add(t)}))})),r}return r(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:L(!1,"Control option.position must one of 'top', 'left', 'right'")}St(s(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=v("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&S(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return le(le({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("span",t).find((function(t){return t.dataset.ratio===e}));r&&S(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,s=n.left,u=n.top,p=l.getBoundingClientRect(),f=p.height,d=p.width,h=e-s,y=r-u;e+d>s+a&&(h=a-d),r+f>u+i&&(y=i-f),k(l,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),s(c,"click",(function(t){D(t,l)||(o.show=!1)})),e.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(e){a(n,e);var r=me(n);function n(e){var o;t(this,n),(o=r.call(this,e)).name="info";var i=e.template,a=i.$infoPanel,c=i.$infoClose,l=i.$video;(0,e.events.proxy)(c,"click",(function(){o.show=!1}));var s=null,u=v("[data-video]",a);function p(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){p()}),1e3)}return e.on("destroy",(function(){clearTimeout(s)})),e.on("info",(function(t){clearTimeout(s),t&&p()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(e){a(o,e);var n=xe(o);function o(e){var r;t(this,o),(r=n.call(this,e)).name="subtitle";var i=e.option.subtitle,a=e.template.$subtitle;return k(a,i.style),i.url&&r.init(i.url),i.bilingual&&g(a,"art-bilingual"),r}return r(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===c(t)?k(r,t):O(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(nt(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",s.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return q(M(o));case"ass":return q(H(o));case"vtt":return q(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}}]),o}(Rt);var ke=function(){function e(r){var n=this;t(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){D(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){g(n,"art-hover"),t.emit("hover",!0)}),(function(){m(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),m(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=tt((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=et((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=et(r.currentTime+60*e,0,r.duration),n.show="".concat(rt(c)," / ").concat(rt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=K((function(){t.emit("view",E(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return r(e,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),e}(),je=function(){function e(r){var n=this;t(this,e),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return r(e,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),e}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(e){a(n,e);var r=Pe(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="layer",o.$parent=e.template.$layer,e.once("ready",(function(){e.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(e){a(n,e);var r=Re(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="loading",x(e.template.$loading,e.icons.loading),o}return n}(Rt),De=function(){function e(r){t(this,e),this.art=r,this.time=2e3,this.timer=null}return r(e,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,g(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",m(r,"art-notice-show")}),this.time)}}]),e}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(e){a(n,e);var r=$e(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="mask",x(e.template.$state,e.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function e(r){var n=this;t(this,e);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},r.option.icons);Object.keys(o).forEach((function(t){X(n,t,{get:function(){var e=document.createElement("i");return g(e,"art-icon"),g(e,"art-icon-".concat(t)),x(e,o[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=b(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return We(We({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=b(".art-setting-range input",t),i=b(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),e.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function e(){t(this,e),this.name="artplayer_settings"}return r(e,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var r=Object.assign({},this.get(),it({},t,e));localStorage.setItem(this.name,JSON.stringify(r))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),e}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=b(".art-setting-range input",e),i=b(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else L(!1,"Playback of this file format is not supported")}}function l(t){var r=x(t,'');O(t,"position","relative"),k(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=x(n,'');O(n,"position","relative"),k(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):L(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function e(r){var n=this;t(this,e),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return r(e,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return L(!Z(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),X(this,r,{value:e}),this}}]),e}(),Ge=function e(r){t(this,e);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=et(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(e){a(i,e);var o=Ke(i);function i(e){var r;return t(this,i),(r=o.call(this)).option=u(Q(i.option,e),yt),r.isFocus=!1,r.isDestroy=!1,r.userAgent=f,r.isMobile=d,r.isWechat=y,r.whitelist=new vt(n(r)),r.template=new gt(n(r)),r.events=new ke(n(r)),r.whitelist.state?(r.storage=new Ne(n(r)),r.icons=new Ae(n(r)),r.i18n=new xt(n(r)),r.notice=new De(n(r)),r.player=new jt(n(r)),r.layers=new Se(n(r)),r.controls=new oe(n(r)),r.contextmenu=new ge(n(r)),r.subtitle=new Oe(n(r)),r.info=new we(n(r)),r.loading=new Ee(n(r)),r.hotkey=new je(n(r)),r.mask=new Te(n(r)),r.setting=new Be(n(r)),r.plugins=new Qe(n(r))):r.mobile=new Ge(n(r)),tr+=1,r.id=tr,er.push(n(r)),r}return r(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return ot}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return p}},{key:"validator",get:function(){return u}},{key:"kindOf",get:function(){return u.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:h?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(p);return console.log("%c ArtPlayer %c 3.5.15 %c https://artplayer.org","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),rr})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Artplayer=e()}(this,(function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function e(t,e){for(var r=0;r1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function g(t,e){return t.classList.add(e)}function m(t,e){return t.classList.remove(e)}function w(t,e){return t.classList.contains(e)}function x(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function O(t,e,r){return t.style[e]=r,t}function k(t,e){return Object.keys(e).forEach((function(r){O(t,r,e[r])})),t}function j(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function P(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function S(t,e){P(t).forEach((function(t){return m(t,e)})),g(t,e)}function R(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";d||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function E(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function D(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var $=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var T=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},z=o((function(t){function e(r,n,o){return T()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&i(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var C=function(e){a(o,e);var r=A(o);function o(e,i){var a;return t(this,o),a=r.call(this,e),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(n(a),i||a.constructor),a.name="ArtPlayerError",a}return o}(o((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!$(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return z(t,arguments,s(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},e(r)}t.exports=e}))(Error));function L(t,e){if(!t)throw new C(e);return t}function M(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function q(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function F(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var I=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function K(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function nt(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var ot=Object.freeze({__proto__:null,query:b,queryAll:v,addClass:g,removeClass:m,hasClass:w,append:x,remove:function(t){return t.parentNode.removeChild(t)},setStyle:O,setStyles:k,getStyle:j,sublings:P,inverseClass:S,tooltip:R,isInViewport:E,includeFromEvent:D,ArtPlayerError:C,errorHandle:L,srtToVtt:M,vttToBlob:q,assToVtt:H,getExt:W,download:F,def:X,has:Z,proxyPropertys:J,mergeDeep:Q,sleep:G,debounce:K,throttle:tt,clamp:et,secondToTime:rt,escape:nt,userAgent:f,isMobile:d,isSafari:h,isWechat:y});var it=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function e(r){var n=this;t(this,e),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=b(r.option.container),L(this.$container,"No container element found by ".concat(r.option.container))),L(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),L(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return r(e,[{key:"query",value:function(t){return b(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(g(this.$settingInner,"art-backdrop-filter"),g(this.$info,"art-backdrop-filter"),g(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&g(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":g(this.$player,"art-destroy")}}]),e}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function e(r){t(this,e),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=Q(this.languages,t),this.init()}}]),e}();var Ot=o((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*s/l;O(n,"width","".concat(100*h,"%")),O(n,"height","100%"),O(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=l/d/s;O(n,"width","100%"),O(n,"height","".concat(100*y,"%")),O(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),X(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");X(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),X(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),X(e,"screenshot",{value:function(){e.getDataURL().then((function(e){F(e,"".concat(r.title||"artplayer","_").concat(rt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){g(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),X(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreenWeb",{get:function(){return w(r,"art-fullscreen-web")},set:function(n){n?(g(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),X(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;X(e,"fullscreenRotate",{get:function(){return w(n,"art-fullscreen-rotate")},set:function(r){if(r){g(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;X(e,"autoSize",{get:function(){return w(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,p=a/c,f=s/u;if(g(n,"art-auto-size"),f>p)O(o,"width","".concat(u*p/s*100,"%")),O(o,"height","100%");else{var d=s/p/u*100;O(o,"width","100%"),O(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else m(n,"art-auto-size"),O(o,"width",null),O(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){X(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){X(e,t,{get:function(){return e.rect[t]}})})),X(e,"x",{get:function(){return e.left+window.pageXOffset}}),X(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;X(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];L(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),X(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;X(e,"light",{get:function(){return"none"!==j(r,"display",!1)},set:function(e){O(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){g(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;O(c,"top","".concat(e,"px")),O(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,m(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,f=!1,m(c,"art-is-dragging")})),x(s,n.title||r.get("Mini player")),X(e,"mini",{get:function(){return w(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,g(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)O(c,"top","".concat(i,"px")),O(c,"left","".concat(a,"px")),E(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,f=l.clientWidth-e.width-50;o.set("top",s),o.set("left",f),O(c,"top","".concat(s,"px")),O(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,m(c,"art-mini"),O(c,"top",null),O(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),X(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];X(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=et(n[0],0,Math.min(n[1],e.duration)),i=et(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;X(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(L(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,O(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}O(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),X(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),J(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t},St=o((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function e(r){t(this,e),this.id=0,this.art=r,this.add=this.add.bind(this)}return r(e,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);L(!Z(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");g(o,"art-".concat(this.name)),g(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):x(this.$parent,o),r.html&&x(o,r.html),r.style&&k(o,r.style),r.tooltip&&R(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&g(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;g(e,"art-control-selector");var a=document.createElement("div");g(a,"art-selector-value"),x(a,t.html),e.innerText="",x(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");g(l,"art-selector-list"),x(l,c),x(e,l);var s=function(){l.style.left="-".concat(j(l,"width")/2-j(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(w(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return w(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?g(e,r):m(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),e}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=b(".art-progress-loaded",t),c=b(".art-progress-played",t),l=b(".art-progress-highlight",t),s=b(".art-progress-indicator",t),u=b(".art-progress-tip",t);function p(t,e){"loaded"===t&&O(o,"width","".concat(100*e,"%")),"played"===t&&(O(c,"width","".concat(100*e,"%")),O(s,"left","calc(".concat(100*e,"% - ").concat(j(s,"width")/2,"px)")))}n.forEach((function(t){var e=et(t.time,0,a.duration)/a.duration*100;x(l,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){O(u,"display","block"),D(r,l)?function(r){var n=Ht(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?O(u,"left",0):n>t.clientWidth-i/2?O(u,"left","".concat(t.clientWidth-i,"px")):O(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ht(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?O(u,"left",0):o>t.clientWidth-a/2?O(u,"left","".concat(t.clientWidth-a,"px")):O(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){O(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Ht(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ht(e,t),o=n.second,i=n.percentage;g(s,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,m(s,"art-show-indicator"))}))}})}}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;en.clientWidth-l/2?O(t,"left","".concat(n.clientWidth-l,"px")):O(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){O(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(t){for(var e=1;e'),o=x(t,'');e.on("loop",(function(e){e?(O(t,"display","block"),O(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),O(o,"left","".concat(e[1]/r.duration*100,"%"))):O(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),r.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=x(t,n.play),c=x(t,n.pause);function l(){O(a,"display","flex"),O(c,"display","none")}function s(){O(a,"display","none"),O(c,"display","flex")}R(a,o.get("Play")),R(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),r.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=x(t,n.volume),l=x(t,n.volumeClose),s=x(t,'
'),u=x(s,'
');function p(t){var e=s.getBoundingClientRect().left;return et(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)O(c,"display","none"),O(l,"display","flex"),O(u,"left","0");else{var e=48*t;O(c,"display","flex"),O(l,"display","none"),O(u,"left","".concat(e,"px"))}}R(c,i.get("Mute")),O(l,"display","none"),e.isMobile&&O(s,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),r.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(rt(e.player.currentTime)," / ").concat(rt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),r.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),r.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;x(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),r.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;x(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){R(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),r.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;x(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){R(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),r.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){R(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),r.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){R(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),r.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){R(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){r.add(t)}))})),r}return r(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:L(!1,"Control option.position must one of 'top', 'left', 'right'")}St(s(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=v("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&S(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return le(le({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("span",t).find((function(t){return t.dataset.ratio===e}));r&&S(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,s=n.left,u=n.top,p=l.getBoundingClientRect(),f=p.height,d=p.width,h=e-s,y=r-u;e+d>s+a&&(h=a-d),r+f>u+i&&(y=i-f),k(l,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),s(c,"click",(function(t){D(t,l)||(o.show=!1)})),e.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(e){a(n,e);var r=me(n);function n(e){var o;t(this,n),(o=r.call(this,e)).name="info";var i=e.template,a=i.$infoPanel,c=i.$infoClose,l=i.$video;(0,e.events.proxy)(c,"click",(function(){o.show=!1}));var s=null,u=v("[data-video]",a);return e.on("destroy",(function(){clearTimeout(s)})),e.on("info",(function(t){clearTimeout(s),t&&function t(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){t()}),1e3)}()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(e){a(o,e);var n=xe(o);function o(e){var r;t(this,o),(r=n.call(this,e)).name="subtitle";var i=e.option.subtitle,a=e.template.$subtitle;return k(a,i.style),i.url&&r.init(i.url),i.bilingual&&g(a,"art-bilingual"),r}return r(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===c(t)?k(r,t):O(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(nt(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",s.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return q(M(o));case"ass":return q(H(o));case"vtt":return q(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"bilingual",get:function(){return w(this.art.template.$subtitle,"art-bilingual")},set:function(t){var e=this.art.template.$subtitle;t?g(e,"art-bilingual"):m(e,"art-bilingual")}}]),o}(Rt);var ke=function(){function e(r){var n=this;t(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){D(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){g(n,"art-hover"),t.emit("hover",!0)}),(function(){m(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),m(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=tt((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=et((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=et(r.currentTime+60*e,0,r.duration),n.show="".concat(rt(c)," / ").concat(rt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=K((function(){t.emit("view",E(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return r(e,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),e}(),je=function(){function e(r){var n=this;t(this,e),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return r(e,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),e}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(e){a(n,e);var r=Pe(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="layer",o.$parent=e.template.$layer,e.once("ready",(function(){e.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(e){a(n,e);var r=Re(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="loading",x(e.template.$loading,e.icons.loading),o}return n}(Rt),De=function(){function e(r){t(this,e),this.art=r,this.time=2e3,this.timer=null}return r(e,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,g(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",m(r,"art-notice-show")}),this.time)}}]),e}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(e){a(n,e);var r=$e(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="mask",x(e.template.$state,e.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function e(r){var n=this;t(this,e);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},r.option.icons);Object.keys(o).forEach((function(t){X(n,t,{get:function(){var e=document.createElement("i");return g(e,"art-icon"),g(e,"art-icon-".concat(t)),x(e,o[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=b(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return We(We({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=b(".art-setting-range input",t),i=b(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),e.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function e(){t(this,e),this.name="artplayer_settings"}return r(e,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var r=Object.assign({},this.get(),it({},t,e));localStorage.setItem(this.name,JSON.stringify(r))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),e}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=b(".art-setting-range input",e),i=b(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else L(!1,"Playback of this file format is not supported")}}function l(t){var r=x(t,'');O(t,"position","relative"),k(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=x(n,'');O(n,"position","relative"),k(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):L(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function e(r){var n=this;t(this,e),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return r(e,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return L(!Z(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),X(this,r,{value:e}),this}}]),e}(),Ge=function e(r){t(this,e);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=et(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(e){a(i,e);var o=Ke(i);function i(e){var r;return t(this,i),(r=o.call(this)).option=u(Q(i.option,e),yt),r.isFocus=!1,r.isDestroy=!1,r.userAgent=f,r.isMobile=d,r.isWechat=y,r.whitelist=new vt(n(r)),r.template=new gt(n(r)),r.events=new ke(n(r)),r.whitelist.state?(r.storage=new Ne(n(r)),r.icons=new Ae(n(r)),r.i18n=new xt(n(r)),r.notice=new De(n(r)),r.player=new jt(n(r)),r.layers=new Se(n(r)),r.controls=new oe(n(r)),r.contextmenu=new ge(n(r)),r.subtitle=new Oe(n(r)),r.info=new we(n(r)),r.loading=new Ee(n(r)),r.hotkey=new je(n(r)),r.mask=new Te(n(r)),r.setting=new Be(n(r)),r.plugins=new Qe(n(r))):r.mobile=new Ge(n(r)),tr+=1,r.id=tr,er.push(n(r)),r}return r(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return ot}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return p}},{key:"validator",get:function(){return u}},{key:"kindOf",get:function(){return u.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:h?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(p);return console.log("%c ArtPlayer %c 3.5.15 %c https://artplayer.org","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),rr})); diff --git a/packages/artplayer-react/dist/artplayer-react.js b/packages/artplayer-react/dist/artplayer-react.js index fe4c50f49..59aac3169 100644 --- a/packages/artplayer-react/dist/artplayer-react.js +++ b/packages/artplayer-react/dist/artplayer-react.js @@ -5,4 +5,4 @@ * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ArtplayerReact=e()}(this,(function(){"use strict";var t=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o};var e=function(e,r){if(null==e)return{};var n,o,i=t(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i};var r=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var r=0;rU.length&&U.push(t)}function X(t,e,r,n){var o=typeof t;"undefined"!==o&&"boolean"!==o||(t=null);var i=!1;if(null===t)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case g:case w:i=!0}}if(i)return r(n,t,""===e?"."+Z(t,0):e),1;if(i=0,e=""===e?".":e+":",Array.isArray(t))for(var a=0;a1?e-1:0),n=1;n2?r-2:0),o=2;o2?r-2:0),o=2;o8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!t){if("undefined"!=typeof console){var i=n.map((function(t){return""+t}));i.unshift("Warning: "+e),Function.prototype.apply.call(console.error,console,i)}try{var a=0,c="Warning: "+e.replace(/%s/g,(function(){return n[a++]}));throw new Error(c)}catch(t){}}},S={};function R(t,e){var r=t.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+e;S[o]||(P(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",e,n),S[o]=!0)}var E={isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,r){R(t,"forceUpdate")},enqueueReplaceState:function(t,e,r,n){R(t,"replaceState")},enqueueSetState:function(t,e,r,n){R(t,"setState")}},$={};function C(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}Object.freeze($),C.prototype.isReactComponent={},C.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},C.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var D={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},T=function(t,e){Object.defineProperty(C.prototype,t,{get:function(){j(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})};for(var A in D)D.hasOwnProperty(A)&&T(A,D[A]);function z(){}function _(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}z.prototype=C.prototype;var L=_.prototype=new z;L.constructor=_,e(L,C.prototype),L.isPureReactComponent=!0;var M={current:null},q={current:null},I=/^(.*)[\\\/]/;function F(t){if(null==t)return null;if("number"==typeof t.tag&&P(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case a:return"Fragment";case i:return"Portal";case l:return"Profiler";case c:return"StrictMode";case d:return"Suspense";case y:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case u:return"Context.Consumer";case s:return"Context.Provider";case p:return n=t,o=t.render,f="ForwardRef",m=o.displayName||o.name||"",n.displayName||(""!==m?f+"("+m+")":f);case h:return F(t.type);case v:var e=1===(r=t)._status?r._result:null;if(e)return F(e)}var r,n,o,f,m;return null}var N={},W=null;function V(t){W=t}N.getCurrentStack=null,N.getStackAddendum=function(){var t="";if(W){var e=F(W.type),r=W._owner;t+=function(t,e,r){var n="";if(e){var o=e.fileName,i=o.replace(I,"");if(/^index\./.test(i)){var a=o.match(I);if(a){var c=a[1];c&&(i=c.replace(I,"")+"/"+i)}}n=" (at "+i+":"+e.lineNumber+")"}else r&&(n=" (created by "+r+")");return"\n in "+(t||"Unknown")+n}(e,W._source,r&&F(r.type))}var n=N.getCurrentStack;return n&&(t+=n()||""),t};var H={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:q,IsSomeRendererActing:{current:!1},assign:e};e(H,{ReactDebugCurrentFrame:N,ReactComponentTreeHook:{}});var U,B,Y=function(t,e){if(!t){for(var r=H.ReactDebugCurrentFrame,n=r.getStackAddendum(),o=arguments.length,i=new Array(o>2?o-2:0),a=2;a1){for(var u=Array(s),f=0;f1){for(var d=Array(p),y=0;y.")}return e}(e);if(!Ot[r]){Ot[r]=!0;var n="";t&&t._owner&&t._owner!==q.current&&(n=" It was passed a child from "+F(t._owner.type)+"."),V(t),Y(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,n),V(null)}}}function jt(t,e){if("object"==typeof t)if(Array.isArray(t))for(var r=0;r",i=" Did you accidentally export a JSX literal instead of a component?"):c=typeof t,Y(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,i)}var s=et.apply(this,arguments);if(null==s)return s;if(n)for(var u=2;u is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Provider},set:function(t){r.Provider=t}},_currentValue:{get:function(){return r._currentValue},set:function(t){r._currentValue=t}},_currentValue2:{get:function(){return r._currentValue2},set:function(t){r._currentValue2=t}},_threadCount:{get:function(){return r._threadCount},set:function(t){r._threadCount=t}},Consumer:{get:function(){return n||(n=!0,Y(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Consumer}}}),r.Consumer=i,r._currentRenderer=null,r._currentRenderer2=null,r},forwardRef:function(t){return null!=t&&t.$$typeof===h?P(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof t?P(!1,"forwardRef requires a render function but was given %s.",null===t?"null":typeof t):0!==t.length&&2!==t.length&&P(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===t.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=t&&(null!=t.defaultProps||null!=t.propTypes)&&P(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:p,render:t}},lazy:function(t){var e,r,n={$$typeof:v,_ctor:t,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return e},set:function(t){Y(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),e=t,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(t){Y(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=t,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},memo:function(t,e){return bt(t)||P(!1,"memo: The first argument must be a component. Instead received: %s",null===t?"null":typeof t),{$$typeof:h,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return gt().useCallback(t,e)},useContext:function(t,e){var r=gt();if(void 0!==e&&Y(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",e,"number"==typeof e&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==t._context){var n=t._context;n.Consumer===t?Y(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===t&&Y(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(t,e)},useEffect:function(t,e){return gt().useEffect(t,e)},useImperativeHandle:function(t,e,r){return gt().useImperativeHandle(t,e,r)},useDebugValue:function(t,e){return gt().useDebugValue(t,e)},useLayoutEffect:function(t,e){return gt().useLayoutEffect(t,e)},useMemo:function(t,e){return gt().useMemo(t,e)},useReducer:function(t,e,r){return gt().useReducer(t,e,r)},useRef:function(t){return gt().useRef(t)},useState:function(t){return gt().useState(t)},Fragment:a,Profiler:l,StrictMode:c,Suspense:d,createElement:Rt,cloneElement:function(t,e,r){for(var n=rt.apply(this,arguments),o=2;o1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function wt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function xt(t,e){return t.classList.add(e)}function Ot(t,e){return t.classList.remove(e)}function kt(t,e){return t.classList.contains(e)}function jt(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function Pt(t,e,r){return t.style[e]=r,t}function St(t,e){return Object.keys(e).forEach((function(r){Pt(t,r,e[r])})),t}function Rt(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function Et(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function $t(t,e){Et(t).forEach((function(t){return Ot(t,e)})),xt(t,e)}function Ct(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";vt||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function Dt(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function Tt(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var At=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var zt=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},_t=n((function(t){function e(r,n,o){return zt()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&l(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function Lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Mt=function(t){s(r,t);var e=Lt(r);function r(t,n){var o;return i(this,r),o=e.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(o),n||o.constructor),o.name="ArtPlayerError",o}return r}(n((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!At(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return _t(t,arguments,p(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)},e(r)}t.exports=e}))(Error));function qt(t,e){if(!t)throw new Mt(e);return t}function It(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function Ft(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function Nt(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function Wt(t){return t.includes("?")?Wt(t.split("?")[0]):t.includes("#")?Wt(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function Vt(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Ht=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function re(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ae(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var ce=Object.freeze({__proto__:null,query:gt,queryAll:wt,addClass:xt,removeClass:Ot,hasClass:kt,append:jt,remove:function(t){return t.parentNode.removeChild(t)},setStyle:Pt,setStyles:St,getStyle:Rt,sublings:Et,inverseClass:$t,tooltip:Ct,isInViewport:Dt,includeFromEvent:Tt,ArtPlayerError:Mt,errorHandle:qt,srtToVtt:It,vttToBlob:Ft,assToVtt:Nt,getExt:Wt,download:Vt,def:Zt,has:Gt,proxyPropertys:Kt,mergeDeep:te,sleep:ee,debounce:re,throttle:ne,clamp:oe,secondToTime:ie,escape:ae,userAgent:ht,isMobile:vt,isSafari:mt,isWechat:bt});function le(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function se(t){for(var e=1;e-1;case"function":return t(e.userAgent);case"regexp":return t.test(e.userAgent);default:return!1}}))},we=function(){function t(e){var r=this;i(this,t),this.art=e,e.option.container instanceof Element?this.$container=e.option.container:(this.$container=gt(e.option.container),qt(this.$container,"No container element found by ".concat(e.option.container))),qt(e.constructor.instances.every((function(t){return t.template.$container!==r.$container})),"Cannot mount multiple instances on the same dom element"),qt(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),e.whitelist.state?this.desktop():this.mobile()}return c(t,[{key:"query",value:function(t){return gt(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(xt(this.$settingInner,"art-backdrop-filter"),xt(this.$info,"art-backdrop-filter"),xt(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&xt(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":xt(this.$player,"art-destroy")}}]),t}(),xe={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},Oe={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},ke=function(){function t(e){i(this,t),this.art=e,this.languages={"zh-cn":xe,"zh-tw":Oe},this.init()}return c(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=te(this.languages,t),this.init()}}]),t}();var je=n((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var y=d*s/l;Pt(n,"width","".concat(100*y,"%")),Pt(n,"height","100%"),Pt(n,"padding","0 ".concat((u-u*y)/2,"px"))}else{var h=l/d/s;Pt(n,"width","100%"),Pt(n,"height","".concat(100*h,"%")),Pt(n,"padding","".concat((f-f*h)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Zt(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(e,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Zt(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Zt(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Zt(e,"screenshot",{value:function(){e.getDataURL().then((function(e){Vt(e,"".concat(r.title||"artplayer","_").concat(ie(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(e,this),function(t,e){var r=t.template.$player;Zt(e,"fullscreen",{get:function(){return je.isFullscreen},set:function(n){n?je.request(r).then((function(){xt(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):je.exit().then((function(){Ot(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Zt(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(e,this),function(t,e){var r=t.template.$player;Zt(e,"fullscreenWeb",{get:function(){return kt(r,"art-fullscreen-web")},set:function(n){n?(xt(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(Ot(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Zt(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Zt(e,"fullscreenRotate",{get:function(){return kt(n,"art-fullscreen-rotate")},set:function(r){if(r){xt(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Zt(e,"autoSize",{get:function(){return kt(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,f=a/c,p=s/u;if(xt(n,"art-auto-size"),p>f)Pt(o,"width","".concat(u*f/s*100,"%")),Pt(o,"height","100%");else{var d=s/f/u*100;Pt(o,"width","100%"),Pt(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else Ot(n,"art-auto-size"),Pt(o,"width",null),Pt(o,"height",null),t.emit("autoSize")}})}(e,this),function(t,e){Zt(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Zt(e,t,{get:function(){return e.rect[t]}})})),Zt(e,"x",{get:function(){return e.left+window.pageXOffset}}),Zt(e,"y",{get:function(){return e.top+window.pageYOffset}})}(e,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Zt(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];qt(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Zt(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(e,this),function(t,e){var r=t.template.$undercover;Zt(e,"light",{get:function(){return"none"!==Rt(r,"display",!1)},set:function(e){Pt(r,"display",e?"block":"none"),t.emit("light",e)}})}(e,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,f="",p=!1,d=0,y=0,h=0,v=0;i(u,"mousedown",(function(t){p=!0,d=t.pageX,y=t.pageY,h=e.left,v=e.top})),i(document,"mousemove",(function(t){if(p){xt(c,"art-is-dragging");var e=v+t.pageY-y,r=h+t.pageX-d;Pt(c,"top","".concat(e,"px")),Pt(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){p=!1,Ot(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,p=!1,Ot(c,"art-is-dragging")})),jt(s,n.title||r.get("Mini player")),Zt(e,"mini",{get:function(){return kt(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,f=c.style.cssText,xt(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)Pt(c,"top","".concat(i,"px")),Pt(c,"left","".concat(a,"px")),Dt(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,p=l.clientWidth-e.width-50;o.set("top",s),o.set("left",p),Pt(c,"top","".concat(s,"px")),Pt(c,"left","".concat(p,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=f,Ot(c,"art-mini"),Pt(c,"top",null),Pt(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Zt(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(e,this),function(t,e){var r=[];Zt(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=oe(n[0],0,Math.min(n[1],e.duration)),i=oe(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(e,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Zt(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(qt(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,Pt(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}Pt(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Zt(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(e,this),Kt(e,this)};var Re=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t},Ee=n((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Re(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),$e=function(){function t(e){i(this,t),this.id=0,this.art=e,this.add=this.add.bind(this)}return c(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);qt(!Gt(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");xt(o,"art-".concat(this.name)),xt(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):jt(this.$parent,o),r.html&&jt(o,r.html),r.style&&St(o,r.style),r.tooltip&&Ct(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&xt(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;xt(e,"art-control-selector");var a=document.createElement("div");xt(a,"art-selector-value"),jt(a,t.html),e.innerText="",jt(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");xt(l,"art-selector-list"),jt(l,c),jt(e,l);var s=function(){l.style.left="-".concat(Rt(l,"width")/2-Rt(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(kt(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return kt(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?xt(e,r):Ot(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function De(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=gt(".art-progress-loaded",t),c=gt(".art-progress-played",t),l=gt(".art-progress-highlight",t),s=gt(".art-progress-indicator",t),u=gt(".art-progress-tip",t);function f(t,e){"loaded"===t&&Pt(o,"width","".concat(100*e,"%")),"played"===t&&(Pt(c,"width","".concat(100*e,"%")),Pt(s,"left","calc(".concat(100*e,"% - ").concat(Rt(s,"width")/2,"px)")))}n.forEach((function(t){var e=oe(t.time,0,a.duration)/a.duration*100;jt(l,''))})),f("loaded",a.loaded),e.on("video:progress",(function(){f("loaded",a.loaded)})),e.on("video:timeupdate",(function(){f("played",a.played)})),e.on("video:ended",(function(){f("played",1)})),i(t,"mousemove",(function(r){Pt(u,"display","block"),Tt(r,l)?function(r){var n=Fe(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?Pt(u,"left",0):n>t.clientWidth-i/2?Pt(u,"left","".concat(t.clientWidth-i,"px")):Pt(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Fe(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?Pt(u,"left",0):o>t.clientWidth-a/2?Pt(u,"left","".concat(t.clientWidth-a,"px")):Pt(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){Pt(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Fe(e,t),n=r.second;f("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Fe(e,t),o=n.second,i=n.percentage;xt(s,"art-show-indicator"),f("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,Ot(s,"art-show-indicator"))}))}})}}function We(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ve(t){for(var e=1;en.clientWidth-l/2?Pt(t,"left","".concat(n.clientWidth-l,"px")):Pt(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){Pt(t,"display","none")}))}})}}function Ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function tr(t){for(var e=1;e'),o=jt(t,'');e.on("loop",(function(e){e?(Pt(t,"display","block"),Pt(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),Pt(o,"left","".concat(e[1]/r.duration*100,"%"))):Pt(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return Me(Me({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=jt(t,n.play),c=jt(t,n.pause);function l(){Pt(a,"display","flex"),Pt(c,"display","none")}function s(){Pt(a,"display","none"),Pt(c,"display","flex")}Ct(a,o.get("Play")),Ct(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Ye(Ye({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=jt(t,n.volume),l=jt(t,n.volumeClose),s=jt(t,'
'),u=jt(s,'
');function f(t){var e=s.getBoundingClientRect().left;return oe(t.pageX-e-6,0,54)/48}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)Pt(c,"display","none"),Pt(l,"display","flex"),Pt(u,"left","0");else{var e=48*t;Pt(c,"display","flex"),Pt(l,"display","none"),Pt(u,"left","".concat(e,"px"))}}Ct(c,i.get("Mute")),Pt(l,"display","none"),e.isMobile&&Pt(s,"display","none"),p(o.volume),e.on("video:volumechange",(function(){p(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=f(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=f(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Ue(Ue({},t),{},{mounted:function(t){function r(){var r="".concat(ie(e.player.currentTime)," / ").concat(ie(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:o.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return rr(rr({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===o.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return tr(tr({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;jt(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!o.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return Ve(Ve({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;jt(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){Ct(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!o.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Je(Je({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;jt(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){Ct(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!o.setting,position:"right",index:40})),n.add(function(t){return function(e){return _e(_e({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;jt(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){Ct(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!o.pip,position:"right",index:50})),n.add(function(t){return function(e){return Ae(Ae({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;jt(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){Ct(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!o.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return De(De({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;jt(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){Ct(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!o.fullscreen,position:"right",index:70})),o.controls.forEach((function(t){n.add(t)}))})),n}return c(r,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,n=this.art.template,o=n.$progress,i=n.$controlsLeft,a=n.$controlsRight;switch(e.position){case"top":this.$parent=o;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:qt(!1,"Control option.position must one of 'top', 'left', 'right'")}Ee(p(r.prototype),"add",this).call(this,e)}}]),r}($e);function cr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lr(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=wt("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&$t(r,"art-current")}))}})}}({disable:!o.playbackRate,name:"playbackRate",index:10})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return ur(ur({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=wt("span",t).find((function(t){return t.dataset.ratio===e}));r&&$t(r,"art-current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio",index:20})),n.add(function(t){return function(e){return pr(pr({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),n.add(function(t){return yr(yr({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return vr(vr({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!o.light,name:"light",index:50})),n.add(function(t){return function(e){return br(br({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),o.contextmenu.forEach((function(t){n.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),n.show=!0;var e=t.clientX,r=t.clientY,o=c.getBoundingClientRect(),i=o.height,a=o.width,s=o.left,u=o.top,f=l.getBoundingClientRect(),p=f.height,d=f.width,y=e-s,h=r-u;e+d>s+a&&(y=a-d),r+p>u+i&&(h=i-p),St(l,{top:"".concat(h,"px"),left:"".concat(y,"px")})})),s(c,"click",(function(t){Tt(t,l)||(n.show=!1)})),t.on("blur",(function(){n.show=!1}))})),n}return r}($e);function xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Or=function(t){s(r,t);var e=xr(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="info";var o=t.template,a=o.$infoPanel,c=o.$infoClose,l=o.$video;(0,t.events.proxy)(c,"click",(function(){n.show=!1}));var s=null,u=wt("[data-video]",a);function f(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){f()}),1e3)}return t.on("destroy",(function(){clearTimeout(s)})),t.on("info",(function(t){clearTimeout(s),t&&f()})),n}return r}($e);function kr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var jr=function(t){s(r,t);var e=kr(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="subtitle";var o=t.option.subtitle,a=t.template.$subtitle;return St(a,o.style),o.url&&n.init(o.url),o.bilingual&&xt(a,"art-bilingual"),n}return c(r,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===o(t)?St(r,t):Pt(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ae(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var f=document.createElement("track");f.default=!0,f.kind="metadata",s.appendChild(f),this.art.template.$track=f,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||Wt(t)){case"srt":return Ft(It(o));case"ass":return Ft(Nt(o));case"vtt":return Ft(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}}]),r}($e);var Pr=function(){function t(e){var r=this;i(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){Tt(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(e,r),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){xt(n,"art-hover"),t.emit("hover",!0)}),(function(){Ot(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(e,r),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),Ot(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(e,r),function(t,e){var r=t.option,n=t.player,o=ne((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(e,r),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=oe((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=oe(r.currentTime+60*e,0,r.duration),n.show="".concat(ie(c)," / ").concat(ie(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(e,r),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=re((function(){t.emit("view",Dt(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(e,r)}))}return c(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),Sr=function(){function t(e){var r=this;i(this,t),this.keys={};var n=e.option,o=e.player,a=e.events.proxy;n.hotkey&&e.once("ready",(function(){r.add(27,(function(){o.fullscreenWeb&&(o.fullscreenWeb=!1)})),r.add(32,(function(){o.toggle=!0})),r.add(37,(function(){o.backward=5})),r.add(38,(function(){o.volume+=.1})),r.add(39,(function(){o.forward=5})),r.add(40,(function(){o.volume-=.1})),a(window,"keydown",(function(t){if(e.isFocus){var n=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==n&&"TEXTAREA"!==n&&""!==o&&"true"!==o){var i=r.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(e)})),e.emit("hotkey",t))}}}))}))}return c(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Rr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Er=function(t){s(r,t);var e=Rr(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="layer",n.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){n.add(t)}))})),n}return r}($e);function $r(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Cr=function(t){s(r,t);var e=$r(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="loading",jt(t.template.$loading,t.icons.loading),n}return r}($e),Dr=function(){function t(e){i(this,t),this.art=e,this.time=2e3,this.timer=null}return c(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,xt(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",Ot(r,"art-notice-show")}),this.time)}}]),t}();function Tr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Ar=function(t){s(r,t);var e=Tr(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="mask",jt(t.template.$state,t.icons.state),n}return r}($e);function zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var _r=function t(e){var n=this;i(this,t);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},e.option.icons);Object.keys(o).forEach((function(t){Zt(n,t,{get:function(){var e=document.createElement("i");return xt(e,"art-icon"),xt(e,"art-icon-".concat(t)),jt(e,o[t]),e}})}))};function Lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Mr(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=wt("button",t).find((function(t){return t.dataset.value===e}));r&&$t(r.parentElement,"current")}))}})}}({disable:!o.flip,name:"flip"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Ir(Ir({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=gt(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!o.rotate,name:"rotate"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Nr(Nr({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=wt("button",t).find((function(t){return t.dataset.value===e}));r&&$t(r.parentElement,"current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Vr(Vr({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=gt(".art-setting-range input",t),i=gt(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!o.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){n.show=!1}))),n}return r}($e),Br=function(){function t(){i(this,t),this.name="artplayer_settings"}return c(t,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var n=Object.assign({},this.get(),r({},t,e));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),t}();function Yr(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=gt(".art-setting-range input",e),i=gt(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function Xr(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Yr);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Jr(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else qt(!1,"Playback of this file format is not supported")}}function l(t){var r=jt(t,'');Pt(t,"position","relative"),St(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=gt(".art-upload-btn",e),n=gt(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Zr(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=jt(n,'');Pt(n,"position","relative"),St(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=Wt(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):qt(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=gt(".art-upload-btn",e),n=gt(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Qr(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Gr(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Kr=function(){function t(e){var r=this;i(this,t),this.art=e,this.id=0;var n=e.option;n.subtitle.url&&n.subtitleOffset&&this.add(Xr),!n.isLive&&n.miniProgressBar&&this.add(Qr),n.localVideo&&this.add(Jr),n.localSubtitle&&this.add(Zr),n.networkMonitor&&this.add(Gr),e.option.plugins.forEach((function(t){r.add(t)}))}return c(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return qt(!Gt(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Zt(this,r,{value:e}),this}}]),t}(),tn=function t(e){i(this,t);var r=e.option,n=e.events.proxy,o=e.template.$video;be.events.forEach((function(t){n(o,t,(function(t){e.emit("video:".concat(t.type),t)}))})),Object.keys(r.moreVideoAttr).forEach((function(t){o[t]=r.moreVideoAttr[t]})),r.muted&&(o.muted=r.muted),r.volume&&(o.volume=oe(r.volume,0,1)),r.poster&&(o.poster=r.poster),r.autoplay&&(o.autoplay=r.autoplay),o.controls=!0;var a=r.type||Wt(r.url),c=r.customType[a];a&&c?(c(o,r.url,e),e.emit("customType",a)):(o.src=r.url,e.emit("url",o.src))};function en(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var rn=0,nn=[],on=function(t){s(r,t);var e=en(r);function r(t){var n;return i(this,r),(n=e.call(this)).option=dt(te(r.option,t),me),n.isFocus=!1,n.isDestroy=!1,n.userAgent=ht,n.isMobile=vt,n.isWechat=bt,n.whitelist=new ge(u(n)),n.template=new we(u(n)),n.events=new Pr(u(n)),n.whitelist.state?(n.storage=new Br(u(n)),n.icons=new _r(u(n)),n.i18n=new ke(u(n)),n.notice=new Dr(u(n)),n.player=new Se(u(n)),n.layers=new Er(u(n)),n.controls=new ar(u(n)),n.contextmenu=new wr(u(n)),n.subtitle=new jr(u(n)),n.info=new Or(u(n)),n.loading=new Cr(u(n)),n.hotkey=new Sr(u(n)),n.mask=new Ar(u(n)),n.setting=new Ur(u(n)),n.plugins=new Kr(u(n))):n.mobile=new tn(u(n)),rn+=1,n.id=rn,nn.push(u(n)),n}return c(r,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),nn.splice(nn.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return nn}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return be}},{key:"utils",get:function(){return ce}},{key:"scheme",get:function(){return me}},{key:"Emitter",get:function(){return yt}},{key:"validator",get:function(){return dt}},{key:"kindOf",get:function(){return dt.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:mt?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),r}(yt);function an(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function cn(t){for(var e=1;e=0||(o[r]=t[r]);return o};var e=function(e,r){if(null==e)return{};var n,o,i=t(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i};var r=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var r=0;rY.length&&Y.push(t)}function Z(t,e,r){return null==t?0:function t(e,r,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case g:case w:a=!0}}if(a)return n(o,e,""===r?"."+Q(e,0):r),1;if(a=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c1?e-1:0),n=1;n2?r-2:0),o=2;o2?r-2:0),o=2;o8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!t){if("undefined"!=typeof console){var i=n.map((function(t){return""+t}));i.unshift("Warning: "+e),Function.prototype.apply.call(console.error,console,i)}try{var a=0,c="Warning: "+e.replace(/%s/g,(function(){return n[a++]}));throw new Error(c)}catch(t){}}},S={};function R(t,e){var r=t.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+e;S[o]||(P(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",e,n),S[o]=!0)}var E={isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,r){R(t,"forceUpdate")},enqueueReplaceState:function(t,e,r,n){R(t,"replaceState")},enqueueSetState:function(t,e,r,n){R(t,"setState")}},$={};function C(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}Object.freeze($),C.prototype.isReactComponent={},C.prototype.setState=function(t,e){!function(){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw O(Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."))}(),this.updater.enqueueSetState(this,t,e,"setState")},C.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var D={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},T=function(t,e){Object.defineProperty(C.prototype,t,{get:function(){j(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})};for(var A in D)D.hasOwnProperty(A)&&T(A,D[A]);function z(){}function _(t,e,r){this.props=t,this.context=e,this.refs=$,this.updater=r||E}z.prototype=C.prototype;var L=_.prototype=new z;L.constructor=_,e(L,C.prototype),L.isPureReactComponent=!0;var M={current:null},q={suspense:null},I={current:null},F=/^(.*)[\\\/]/;function N(t){if(null==t)return null;if("number"==typeof t.tag&&P(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case a:return"Fragment";case i:return"Portal";case l:return"Profiler";case c:return"StrictMode";case d:return"Suspense";case y:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case u:return"Context.Consumer";case s:return"Context.Provider";case p:return n=t,o=t.render,f="ForwardRef",m=o.displayName||o.name||"",n.displayName||(""!==m?f+"("+m+")":f);case h:return N(t.type);case v:var e=1===(r=t)._status?r._result:null;if(e)return N(e)}var r,n,o,f,m;return null}var W={},V=null;function H(t){V=t}W.getCurrentStack=null,W.getStackAddendum=function(){var t="";if(V){var e=N(V.type),r=V._owner;t+=function(t,e,r){var n="";if(e){var o=e.fileName,i=o.replace(F,"");if(/^index\./.test(i)){var a=o.match(F);if(a){var c=a[1];c&&(i=c.replace(F,"")+"/"+i)}}n=" (at "+i+":"+e.lineNumber+")"}else r&&(n=" (created by "+r+")");return"\n in "+(t||"Unknown")+n}(e,V._source,r&&N(r.type))}var n=W.getCurrentStack;return n&&(t+=n()||""),t};var U={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:q,ReactCurrentOwner:I,IsSomeRendererActing:{current:!1},assign:e};e(U,{ReactDebugCurrentFrame:W,ReactComponentTreeHook:{}});var B=function(t,e){if(!t){for(var r=U.ReactDebugCurrentFrame,n=r.getStackAddendum(),o=arguments.length,i=Array(o>2?o-2:0),a=2;a1){for(var u=Array(s),f=0;f1){for(var d=Array(p),y=0;y.")}return e}(e);if(!Ot[r]){Ot[r]=!0;var n="";t&&t._owner&&t._owner!==I.current&&(n=" It was passed a child from "+N(t._owner.type)+"."),H(t),B(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,n),H(null)}}}function jt(t,e){if("object"==typeof t)if(Array.isArray(t))for(var r=0;r",i=" Did you accidentally export a JSX literal instead of a component?"):l=typeof t,B(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,i)}var s=rt.apply(this,arguments);if(null==s)return s;if(n)for(var u=2;u is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Provider},set:function(t){r.Provider=t}},_currentValue:{get:function(){return r._currentValue},set:function(t){r._currentValue=t}},_currentValue2:{get:function(){return r._currentValue2},set:function(t){r._currentValue2=t}},_threadCount:{get:function(){return r._threadCount},set:function(t){r._threadCount=t}},Consumer:{get:function(){return n||(n=!0,B(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),r.Consumer}}}),r.Consumer=i,r._currentRenderer=null,r._currentRenderer2=null,r},forwardRef:function(t){return null!=t&&t.$$typeof===h?P(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof t?P(!1,"forwardRef requires a render function but was given %s.",null===t?"null":typeof t):0!==t.length&&2!==t.length&&P(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===t.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=t&&(null!=t.defaultProps||null!=t.propTypes)&&P(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:p,render:t}},lazy:function(t){var e={$$typeof:v,_ctor:t,_status:-1,_result:null},r=void 0,n=void 0;return Object.defineProperties(e,{defaultProps:{configurable:!0,get:function(){return r},set:function(t){B(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=t,Object.defineProperty(e,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(t){B(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=t,Object.defineProperty(e,"propTypes",{enumerable:!0})}}}),e},memo:function(t,e){return mt(t)||P(!1,"memo: The first argument must be a component. Instead received: %s",null===t?"null":typeof t),{$$typeof:h,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return bt().useCallback(t,e)},useContext:function(t,e){var r=bt();if(void 0!==e&&B(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",e,"number"==typeof e&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==t._context){var n=t._context;n.Consumer===t?B(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===t&&B(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(t,e)},useEffect:function(t,e){return bt().useEffect(t,e)},useImperativeHandle:function(t,e,r){return bt().useImperativeHandle(t,e,r)},useDebugValue:function(t,e){return bt().useDebugValue(t,e)},useLayoutEffect:function(t,e){return bt().useLayoutEffect(t,e)},useMemo:function(t,e){return bt().useMemo(t,e)},useReducer:function(t,e,r){return bt().useReducer(t,e,r)},useRef:function(t){return bt().useRef(t)},useState:function(t){return bt().useState(t)},Fragment:a,Profiler:l,StrictMode:c,Suspense:d,unstable_SuspenseList:y,createElement:Rt,cloneElement:function(t,e,r){for(var n=nt.apply(this,arguments),o=2;o1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function xt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function Ot(t,e){return t.classList.add(e)}function kt(t,e){return t.classList.remove(e)}function jt(t,e){return t.classList.contains(e)}function Pt(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function St(t,e,r){return t.style[e]=r,t}function Rt(t,e){return Object.keys(e).forEach((function(r){St(t,r,e[r])})),t}function Et(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function $t(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function Ct(t,e){$t(t).forEach((function(t){return kt(t,e)})),Ot(t,e)}function Dt(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";mt||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function Tt(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function At(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var zt=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var _t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},Lt=n((function(t){function e(r,n,o){return _t()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&l(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function Mt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var qt=function(t){s(r,t);var e=Mt(r);function r(t,n){var o;return i(this,r),o=e.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(o),n||o.constructor),o.name="ArtPlayerError",o}return r}(n((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!zt(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return Lt(t,arguments,p(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)},e(r)}t.exports=e}))(Error));function It(t,e){if(!t)throw new qt(e);return t}function Ft(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function Nt(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function Wt(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function Vt(t){return t.includes("?")?Vt(t.split("?")[0]):t.includes("#")?Vt(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function Ht(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Ut=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function ne(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ce(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var le=Object.freeze({__proto__:null,query:wt,queryAll:xt,addClass:Ot,removeClass:kt,hasClass:jt,append:Pt,remove:function(t){return t.parentNode.removeChild(t)},setStyle:St,setStyles:Rt,getStyle:Et,sublings:$t,inverseClass:Ct,tooltip:Dt,isInViewport:Tt,includeFromEvent:At,ArtPlayerError:qt,errorHandle:It,srtToVtt:Ft,vttToBlob:Nt,assToVtt:Wt,getExt:Vt,download:Ht,def:Qt,has:Kt,proxyPropertys:te,mergeDeep:ee,sleep:re,debounce:ne,throttle:oe,clamp:ie,secondToTime:ae,escape:ce,userAgent:vt,isMobile:mt,isSafari:bt,isWechat:gt});function se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ue(t){for(var e=1;e-1;case"function":return t(e.userAgent);case"regexp":return t.test(e.userAgent);default:return!1}}))},xe=function(){function t(e){var r=this;i(this,t),this.art=e,e.option.container instanceof Element?this.$container=e.option.container:(this.$container=wt(e.option.container),It(this.$container,"No container element found by ".concat(e.option.container))),It(e.constructor.instances.every((function(t){return t.template.$container!==r.$container})),"Cannot mount multiple instances on the same dom element"),It(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),e.whitelist.state?this.desktop():this.mobile()}return c(t,[{key:"query",value:function(t){return wt(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(Ot(this.$settingInner,"art-backdrop-filter"),Ot(this.$info,"art-backdrop-filter"),Ot(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&Ot(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":Ot(this.$player,"art-destroy")}}]),t}(),Oe={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},ke={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},je=function(){function t(e){i(this,t),this.art=e,this.languages={"zh-cn":Oe,"zh-tw":ke},this.init()}return c(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=ee(this.languages,t),this.init()}}]),t}();var Pe=n((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var y=d*s/l;St(n,"width","".concat(100*y,"%")),St(n,"height","100%"),St(n,"padding","0 ".concat((u-u*y)/2,"px"))}else{var h=l/d/s;St(n,"width","100%"),St(n,"height","".concat(100*h,"%")),St(n,"padding","".concat((f-f*h)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Qt(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(e,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Qt(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Qt(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Qt(e,"screenshot",{value:function(){e.getDataURL().then((function(e){Ht(e,"".concat(r.title||"artplayer","_").concat(ae(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(e,this),function(t,e){var r=t.template.$player;Qt(e,"fullscreen",{get:function(){return Pe.isFullscreen},set:function(n){n?Pe.request(r).then((function(){Ot(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Pe.exit().then((function(){kt(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Qt(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(e,this),function(t,e){var r=t.template.$player;Qt(e,"fullscreenWeb",{get:function(){return jt(r,"art-fullscreen-web")},set:function(n){n?(Ot(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(kt(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Qt(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Qt(e,"fullscreenRotate",{get:function(){return jt(n,"art-fullscreen-rotate")},set:function(r){if(r){Ot(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(e,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Qt(e,"autoSize",{get:function(){return jt(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,f=a/c,p=s/u;if(Ot(n,"art-auto-size"),p>f)St(o,"width","".concat(u*f/s*100,"%")),St(o,"height","100%");else{var d=s/f/u*100;St(o,"width","100%"),St(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else kt(n,"art-auto-size"),St(o,"width",null),St(o,"height",null),t.emit("autoSize")}})}(e,this),function(t,e){Qt(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Qt(e,t,{get:function(){return e.rect[t]}})})),Qt(e,"x",{get:function(){return e.left+window.pageXOffset}}),Qt(e,"y",{get:function(){return e.top+window.pageYOffset}})}(e,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Qt(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];It(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Qt(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(e,this),function(t,e){var r=t.template.$undercover;Qt(e,"light",{get:function(){return"none"!==Et(r,"display",!1)},set:function(e){St(r,"display",e?"block":"none"),t.emit("light",e)}})}(e,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,f="",p=!1,d=0,y=0,h=0,v=0;i(u,"mousedown",(function(t){p=!0,d=t.pageX,y=t.pageY,h=e.left,v=e.top})),i(document,"mousemove",(function(t){if(p){Ot(c,"art-is-dragging");var e=v+t.pageY-y,r=h+t.pageX-d;St(c,"top","".concat(e,"px")),St(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){p=!1,kt(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,p=!1,kt(c,"art-is-dragging")})),Pt(s,n.title||r.get("Mini player")),Qt(e,"mini",{get:function(){return jt(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,f=c.style.cssText,Ot(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)St(c,"top","".concat(i,"px")),St(c,"left","".concat(a,"px")),Tt(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,p=l.clientWidth-e.width-50;o.set("top",s),o.set("left",p),St(c,"top","".concat(s,"px")),St(c,"left","".concat(p,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=f,kt(c,"art-mini"),St(c,"top",null),St(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Qt(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(e,this),function(t,e){var r=[];Qt(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=ie(n[0],0,Math.min(n[1],e.duration)),i=ie(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(e,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Qt(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(It(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,St(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}St(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Qt(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(e,this),te(e,this)};var Ee=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t},$e=n((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Ee(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Ce=function(){function t(e){i(this,t),this.id=0,this.art=e,this.add=this.add.bind(this)}return c(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);It(!Kt(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");Ot(o,"art-".concat(this.name)),Ot(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):Pt(this.$parent,o),r.html&&Pt(o,r.html),r.style&&Rt(o,r.style),r.tooltip&&Dt(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&Ot(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;Ot(e,"art-control-selector");var a=document.createElement("div");Ot(a,"art-selector-value"),Pt(a,t.html),e.innerText="",Pt(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");Ot(l,"art-selector-list"),Pt(l,c),Pt(e,l);var s=function(){l.style.left="-".concat(Et(l,"width")/2-Et(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(jt(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return jt(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?Ot(e,r):kt(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function De(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Te(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=wt(".art-progress-loaded",t),c=wt(".art-progress-played",t),l=wt(".art-progress-highlight",t),s=wt(".art-progress-indicator",t),u=wt(".art-progress-tip",t);function f(t,e){"loaded"===t&&St(o,"width","".concat(100*e,"%")),"played"===t&&(St(c,"width","".concat(100*e,"%")),St(s,"left","calc(".concat(100*e,"% - ").concat(Et(s,"width")/2,"px)")))}n.forEach((function(t){var e=ie(t.time,0,a.duration)/a.duration*100;Pt(l,''))})),f("loaded",a.loaded),e.on("video:progress",(function(){f("loaded",a.loaded)})),e.on("video:timeupdate",(function(){f("played",a.played)})),e.on("video:ended",(function(){f("played",1)})),i(t,"mousemove",(function(r){St(u,"display","block"),At(r,l)?function(r){var n=Ne(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?St(u,"left",0):n>t.clientWidth-i/2?St(u,"left","".concat(t.clientWidth-i,"px")):St(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ne(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?St(u,"left",0):o>t.clientWidth-a/2?St(u,"left","".concat(t.clientWidth-a,"px")):St(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){St(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Ne(e,t),n=r.second;f("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ne(e,t),o=n.second,i=n.percentage;Ot(s,"art-show-indicator"),f("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,kt(s,"art-show-indicator"))}))}})}}function Ve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function He(t){for(var e=1;en.clientWidth-l/2?St(t,"left","".concat(n.clientWidth-l,"px")):St(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){St(t,"display","none")}))}})}}function tr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function er(t){for(var e=1;e'),o=Pt(t,'');e.on("loop",(function(e){e?(St(t,"display","block"),St(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),St(o,"left","".concat(e[1]/r.duration*100,"%"))):St(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return qe(qe({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=Pt(t,n.play),c=Pt(t,n.pause);function l(){St(a,"display","flex"),St(c,"display","none")}function s(){St(a,"display","none"),St(c,"display","flex")}Dt(a,o.get("Play")),Dt(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Xe(Xe({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=Pt(t,n.volume),l=Pt(t,n.volumeClose),s=Pt(t,'
'),u=Pt(s,'
');function f(t){var e=s.getBoundingClientRect().left;return ie(t.pageX-e-6,0,54)/48}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)St(c,"display","none"),St(l,"display","flex"),St(u,"left","0");else{var e=48*t;St(c,"display","flex"),St(l,"display","none"),St(u,"left","".concat(e,"px"))}}Dt(c,i.get("Mute")),St(l,"display","none"),e.isMobile&&St(s,"display","none"),p(o.volume),e.on("video:volumechange",(function(){p(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=f(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=f(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Be(Be({},t),{},{mounted:function(t){function r(){var r="".concat(ae(e.player.currentTime)," / ").concat(ae(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:o.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return nr(nr({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===o.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return er(er({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;Pt(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!o.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return He(He({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;Pt(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){Dt(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!o.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Ze(Ze({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;Pt(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){Dt(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!o.setting,position:"right",index:40})),n.add(function(t){return function(e){return Le(Le({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;Pt(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){Dt(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!o.pip,position:"right",index:50})),n.add(function(t){return function(e){return ze(ze({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;Pt(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){Dt(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!o.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return Te(Te({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;Pt(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){Dt(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!o.fullscreen,position:"right",index:70})),o.controls.forEach((function(t){n.add(t)}))})),n}return c(r,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,n=this.art.template,o=n.$progress,i=n.$controlsLeft,a=n.$controlsRight;switch(e.position){case"top":this.$parent=o;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:It(!1,"Control option.position must one of 'top', 'left', 'right'")}$e(p(r.prototype),"add",this).call(this,e)}}]),r}(Ce);function lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function sr(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=xt("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&Ct(r,"art-current")}))}})}}({disable:!o.playbackRate,name:"playbackRate",index:10})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return fr(fr({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=xt("span",t).find((function(t){return t.dataset.ratio===e}));r&&Ct(r,"art-current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio",index:20})),n.add(function(t){return function(e){return dr(dr({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),n.add(function(t){return hr(hr({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return mr(mr({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!o.light,name:"light",index:50})),n.add(function(t){return function(e){return gr(gr({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),o.contextmenu.forEach((function(t){n.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),n.show=!0;var e=t.clientX,r=t.clientY,o=c.getBoundingClientRect(),i=o.height,a=o.width,s=o.left,u=o.top,f=l.getBoundingClientRect(),p=f.height,d=f.width,y=e-s,h=r-u;e+d>s+a&&(y=a-d),r+p>u+i&&(h=i-p),Rt(l,{top:"".concat(h,"px"),left:"".concat(y,"px")})})),s(c,"click",(function(t){At(t,l)||(n.show=!1)})),t.on("blur",(function(){n.show=!1}))})),n}return r}(Ce);function Or(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var kr=function(t){s(r,t);var e=Or(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="info";var o=t.template,a=o.$infoPanel,c=o.$infoClose,l=o.$video;(0,t.events.proxy)(c,"click",(function(){n.show=!1}));var s=null,u=xt("[data-video]",a);return t.on("destroy",(function(){clearTimeout(s)})),t.on("info",(function(t){clearTimeout(s),t&&function t(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){t()}),1e3)}()})),n}return r}(Ce);function jr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Pr=function(t){s(r,t);var e=jr(r);function r(t){var n;i(this,r),(n=e.call(this,t)).name="subtitle";var o=t.option.subtitle,a=t.template.$subtitle;return Rt(a,o.style),o.url&&n.init(o.url),o.bilingual&&Ot(a,"art-bilingual"),n}return c(r,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===o(t)?Rt(r,t):St(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ce(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var f=document.createElement("track");f.default=!0,f.kind="metadata",s.appendChild(f),this.art.template.$track=f,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||Vt(t)){case"srt":return Nt(Ft(o));case"ass":return Nt(Wt(o));case"vtt":return Nt(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"bilingual",get:function(){return jt(this.art.template.$subtitle,"art-bilingual")},set:function(t){var e=this.art.template.$subtitle;t?Ot(e,"art-bilingual"):kt(e,"art-bilingual")}}]),r}(Ce);var Sr=function(){function t(e){var r=this;i(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){At(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(e,r),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){Ot(n,"art-hover"),t.emit("hover",!0)}),(function(){kt(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(e,r),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),kt(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(e,r),function(t,e){var r=t.option,n=t.player,o=oe((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(e,r),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=ie((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=ie(r.currentTime+60*e,0,r.duration),n.show="".concat(ae(c)," / ").concat(ae(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(e,r),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=ne((function(){t.emit("view",Tt(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(e,r)}))}return c(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),Rr=function(){function t(e){var r=this;i(this,t),this.keys={};var n=e.option,o=e.player,a=e.events.proxy;n.hotkey&&e.once("ready",(function(){r.add(27,(function(){o.fullscreenWeb&&(o.fullscreenWeb=!1)})),r.add(32,(function(){o.toggle=!0})),r.add(37,(function(){o.backward=5})),r.add(38,(function(){o.volume+=.1})),r.add(39,(function(){o.forward=5})),r.add(40,(function(){o.volume-=.1})),a(window,"keydown",(function(t){if(e.isFocus){var n=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==n&&"TEXTAREA"!==n&&""!==o&&"true"!==o){var i=r.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(e)})),e.emit("hotkey",t))}}}))}))}return c(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Er(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var $r=function(t){s(r,t);var e=Er(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="layer",n.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){n.add(t)}))})),n}return r}(Ce);function Cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var Dr=function(t){s(r,t);var e=Cr(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="loading",Pt(t.template.$loading,t.icons.loading),n}return r}(Ce),Tr=function(){function t(e){i(this,t),this.art=e,this.time=2e3,this.timer=null}return c(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,Ot(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",kt(r,"art-notice-show")}),this.time)}}]),t}();function Ar(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var zr=function(t){s(r,t);var e=Ar(r);function r(t){var n;return i(this,r),(n=e.call(this,t)).name="mask",Pt(t.template.$state,t.icons.state),n}return r}(Ce);function _r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Lr=function t(e){var n=this;i(this,t);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},e.option.icons);Object.keys(o).forEach((function(t){Qt(n,t,{get:function(){var e=document.createElement("i");return Ot(e,"art-icon"),Ot(e,"art-icon-".concat(t)),Pt(e,o[t]),e}})}))};function Mr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qr(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=xt("button",t).find((function(t){return t.dataset.value===e}));r&&Ct(r.parentElement,"current")}))}})}}({disable:!o.flip,name:"flip"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Fr(Fr({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=wt(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!o.rotate,name:"rotate"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player;return Wr(Wr({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=xt("button",t).find((function(t){return t.dataset.value===e}));r&&Ct(r.parentElement,"current")}))}})}}({disable:!o.aspectRatio,name:"aspectRatio"})),n.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Hr(Hr({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=wt(".art-setting-range input",t),i=wt(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!o.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){n.show=!1}))),n}return r}(Ce),Yr=function(){function t(){i(this,t),this.name="artplayer_settings"}return c(t,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var n=Object.assign({},this.get(),r({},t,e));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),t}();function Xr(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=wt(".art-setting-range input",e),i=wt(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function Jr(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Xr);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Zr(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else It(!1,"Playback of this file format is not supported")}}function l(t){var r=Pt(t,'');St(t,"position","relative"),Rt(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=wt(".art-upload-btn",e),n=wt(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Qr(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=Pt(n,'');St(n,"position","relative"),Rt(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=Vt(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):It(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=wt(".art-upload-btn",e),n=wt(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Gr(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Kr(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var tn=function(){function t(e){var r=this;i(this,t),this.art=e,this.id=0;var n=e.option;n.subtitle.url&&n.subtitleOffset&&this.add(Jr),!n.isLive&&n.miniProgressBar&&this.add(Gr),n.localVideo&&this.add(Zr),n.localSubtitle&&this.add(Qr),n.networkMonitor&&this.add(Kr),e.option.plugins.forEach((function(t){r.add(t)}))}return c(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return It(!Kt(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Qt(this,r,{value:e}),this}}]),t}(),en=function t(e){i(this,t);var r=e.option,n=e.events.proxy,o=e.template.$video;ge.events.forEach((function(t){n(o,t,(function(t){e.emit("video:".concat(t.type),t)}))})),Object.keys(r.moreVideoAttr).forEach((function(t){o[t]=r.moreVideoAttr[t]})),r.muted&&(o.muted=r.muted),r.volume&&(o.volume=ie(r.volume,0,1)),r.poster&&(o.poster=r.poster),r.autoplay&&(o.autoplay=r.autoplay),o.controls=!0;var a=r.type||Vt(r.url),c=r.customType[a];a&&c?(c(o,r.url,e),e.emit("customType",a)):(o.src=r.url,e.emit("url",o.src))};function rn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f(this,r)}}var nn=0,on=[],an=function(t){s(r,t);var e=rn(r);function r(t){var n;return i(this,r),(n=e.call(this)).option=yt(ee(r.option,t),be),n.isFocus=!1,n.isDestroy=!1,n.userAgent=vt,n.isMobile=mt,n.isWechat=gt,n.whitelist=new we(u(n)),n.template=new xe(u(n)),n.events=new Sr(u(n)),n.whitelist.state?(n.storage=new Yr(u(n)),n.icons=new Lr(u(n)),n.i18n=new je(u(n)),n.notice=new Tr(u(n)),n.player=new Re(u(n)),n.layers=new $r(u(n)),n.controls=new cr(u(n)),n.contextmenu=new xr(u(n)),n.subtitle=new Pr(u(n)),n.info=new kr(u(n)),n.loading=new Dr(u(n)),n.hotkey=new Rr(u(n)),n.mask=new zr(u(n)),n.setting=new Br(u(n)),n.plugins=new tn(u(n))):n.mobile=new en(u(n)),nn+=1,n.id=nn,on.push(u(n)),n}return c(r,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),on.splice(on.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return on}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return ge}},{key:"utils",get:function(){return le}},{key:"scheme",get:function(){return be}},{key:"Emitter",get:function(){return ht}},{key:"validator",get:function(){return yt}},{key:"kindOf",get:function(){return yt.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:bt?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),r}(ht);function cn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ln(t){for(var e=1;e1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function m(t,e){return t.classList.add(e)}function w(t,e){return t.classList.remove(e)}function x(t,e){return t.classList.contains(e)}function O(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function k(t,e,r){return t.style[e]=r,t}function j(t,e){return Object.keys(e).forEach((function(r){k(t,r,e[r])})),t}function P(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function S(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function R(t,e){S(t).forEach((function(t){return w(t,e)})),m(t,e)}function E(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";h||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function D(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function $(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var T=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var z=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},A=i((function(t){function e(r,n,o){return z()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&a(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var L=function(t){c(n,t);var r=C(n);function n(t,i){var a;return e(this,n),a=r.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o(a),i||a.constructor),a.name="ArtPlayerError",a}return n}(i((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!T(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return A(t,arguments,u(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),a(e,t)},e(r)}t.exports=e}))(Error));function M(t,e){if(!t)throw new L(e);return t}function q(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function F(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function I(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var V=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function tt(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ot(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var it=Object.freeze({__proto__:null,query:v,queryAll:g,addClass:m,removeClass:w,hasClass:x,append:O,remove:function(t){return t.parentNode.removeChild(t)},setStyle:k,setStyles:j,getStyle:P,sublings:S,inverseClass:R,tooltip:E,isInViewport:D,includeFromEvent:$,ArtPlayerError:L,errorHandle:M,srtToVtt:q,vttToBlob:F,assToVtt:H,getExt:W,download:I,def:Y,has:J,proxyPropertys:Q,mergeDeep:G,sleep:K,debounce:tt,throttle:et,clamp:rt,secondToTime:nt,escape:ot,userAgent:d,isMobile:h,isSafari:y,isWechat:b});function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(e){for(var r=1;r-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function t(r){var n=this;e(this,t),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=v(r.option.container),M(this.$container,"No container element found by ".concat(r.option.container))),M(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),M(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return n(t,[{key:"query",value:function(t){return v(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(m(this.$settingInner,"art-backdrop-filter"),m(this.$info,"art-backdrop-filter"),m(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&m(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":m(this.$player,"art-destroy")}}]),t}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function t(r){e(this,t),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return n(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=G(this.languages,t),this.init()}}]),t}();var Ot=i((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*l/s;k(n,"width","".concat(100*h,"%")),k(n,"height","100%"),k(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=s/d/l;k(n,"width","100%"),k(n,"height","".concat(100*y,"%")),k(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Y(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Y(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Y(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Y(e,"screenshot",{value:function(){e.getDataURL().then((function(e){I(e,"".concat(r.title||"artplayer","_").concat(nt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){w(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Y(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreenWeb",{get:function(){return x(r,"art-fullscreen-web")},set:function(n){n?(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(w(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Y(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Y(e,"fullscreenRotate",{get:function(){return x(n,"art-fullscreen-rotate")},set:function(r){if(r){m(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,s=o.clientHeight,l=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Y(e,"autoSize",{get:function(){return x(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,s=n.getBoundingClientRect(),l=s.width,u=s.height,p=a/c,f=l/u;if(m(n,"art-auto-size"),f>p)k(o,"width","".concat(u*p/l*100,"%")),k(o,"height","100%");else{var d=l/p/u*100;k(o,"width","100%"),k(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else w(n,"art-auto-size"),k(o,"width",null),k(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){Y(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Y(e,t,{get:function(){return e.rect[t]}})})),Y(e,"x",{get:function(){return e.left+window.pageXOffset}}),Y(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Y(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];M(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Y(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;Y(e,"light",{get:function(){return"none"!==P(r,"display",!1)},set:function(e){k(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,s=a.$miniClose,l=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){m(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;k(c,"top","".concat(e,"px")),k(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,w(c,"art-is-dragging")})),i(s,"click",(function(){e.mini=!1,f=!1,w(c,"art-is-dragging")})),O(l,n.title||r.get("Mini player")),Y(e,"mini",{get:function(){return x(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,m(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)k(c,"top","".concat(i,"px")),k(c,"left","".concat(a,"px")),D(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var s=document.body,l=s.clientHeight-e.height-50,f=s.clientWidth-e.width-50;o.set("top",l),o.set("left",f),k(c,"top","".concat(l,"px")),k(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,w(c,"art-mini"),k(c,"top",null),k(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Y(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];Y(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=rt(n[0],0,Math.min(n[1],e.duration)),i=rt(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Y(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(M(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,k(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var s=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},l=0,u=1;switch(r){case-270:l=90,u=s();break;case-180:l=180;break;case-90:l=270,u=s();break;case 90:l=90,u=s();break;case 180:l=180;break;case 270:l=270,u=s()}k(n,"transform","rotate(".concat(l,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Y(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),Q(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t},St=i((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function t(r){e(this,t),this.id=0,this.art=r,this.add=this.add.bind(this)}return n(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);M(!J(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");m(o,"art-".concat(this.name)),m(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):O(this.$parent,o),r.html&&O(o,r.html),r.style&&j(o,r.style),r.tooltip&&E(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&m(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;m(e,"art-control-selector");var a=document.createElement("div");m(a,"art-selector-value"),O(a,t.html),e.innerText="",O(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),s=document.createElement("div");m(s,"art-selector-list"),O(s,c),O(e,s);var l=function(){s.style.left="-".concat(P(s,"width")/2-P(e,"width")/2,"px")};o(e,l),i(e,"click",(function(e){if(x(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,l(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return x(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?m(e,r):w(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var r=1;r
'),mounted:function(t){var r=!1,o=v(".art-progress-loaded",t),c=v(".art-progress-played",t),s=v(".art-progress-highlight",t),l=v(".art-progress-indicator",t),u=v(".art-progress-tip",t);function p(t,e){"loaded"===t&&k(o,"width","".concat(100*e,"%")),"played"===t&&(k(c,"width","".concat(100*e,"%")),k(l,"left","calc(".concat(100*e,"% - ").concat(P(l,"width")/2,"px)")))}n.forEach((function(t){var e=rt(t.time,0,a.duration)/a.duration*100;O(s,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){k(u,"display","block"),$(r,s)?function(r){var n=Ft(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?k(u,"left",0):n>t.clientWidth-i/2?k(u,"left","".concat(t.clientWidth-i,"px")):k(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ft(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?k(u,"left",0):o>t.clientWidth-a/2?k(u,"left","".concat(t.clientWidth-a,"px")):k(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){k(u,"display","none")})),i(t,"click",(function(t){if(t.target!==l){var r=Ft(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(l,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ft(e,t),o=n.second,i=n.percentage;m(l,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,w(l,"art-show-indicator"))}))}})}}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(e){for(var r=1;rn.clientWidth-s/2?k(t,"left","".concat(n.clientWidth-s,"px")):k(t,"left","".concat(i-s/2,"px"))}(o))})),i(n,"mouseout",(function(){k(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(e){for(var r=1;r'),o=O(t,'');e.on("loop",(function(e){e?(k(t,"display","block"),k(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),k(o,"left","".concat(e[1]/r.duration*100,"%"))):k(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=O(t,n.play),c=O(t,n.pause);function s(){k(a,"display","flex"),k(c,"display","none")}function l(){k(a,"display","none"),k(c,"display","flex")}E(a,o.get("Play")),E(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?l():s(),e.on("video:playing",(function(){l()})),e.on("video:pause",(function(){s()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=O(t,n.volume),s=O(t,n.volumeClose),l=O(t,'
'),u=O(l,'
');function p(t){var e=l.getBoundingClientRect().left;return rt(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)k(c,"display","none"),k(s,"display","flex"),k(u,"left","0");else{var e=48*t;k(c,"display","flex"),k(s,"display","none"),k(u,"left","".concat(e,"px"))}}E(c,i.get("Mute")),k(s,"display","none"),e.isMobile&&k(l,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(s,"click",(function(){o.muted=!1})),r(l,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(nt(e.player.currentTime)," / ").concat(nt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;O(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;O(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){E(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;O(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){E(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),n.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){E(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),n.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){E(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){E(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){n.add(t)}))})),n}return n(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:M(!1,"Control option.position must one of 'top', 'left', 'right'")}St(u(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var r=1;r0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=g("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&R(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return se(se({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("span",t).find((function(t){return t.dataset.ratio===e}));r&&R(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),l(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,l=n.left,u=n.top,p=s.getBoundingClientRect(),f=p.height,d=p.width,h=e-l,y=r-u;e+d>l+a&&(h=a-d),r+f>u+i&&(y=i-f),j(s,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),l(c,"click",(function(t){$(t,s)||(o.show=!1)})),t.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(t){c(n,t);var r=me(n);function n(t){var o;e(this,n),(o=r.call(this,t)).name="info";var i=t.template,a=i.$infoPanel,c=i.$infoClose,s=i.$video;(0,t.events.proxy)(c,"click",(function(){o.show=!1}));var l=null,u=g("[data-video]",a);function p(){u.forEach((function(t){var e=s[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),l=setTimeout((function(){p()}),1e3)}return t.on("destroy",(function(){clearTimeout(l)})),t.on("info",(function(t){clearTimeout(l),t&&p()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(t){c(o,t);var r=xe(o);function o(t){var n;e(this,o),(n=r.call(this,t)).name="subtitle";var i=t.option.subtitle,a=t.template.$subtitle;return j(a,i.style),i.url&&n.init(i.url),i.bilingual&&m(a,"art-bilingual"),n}return n(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===s(t)?j(r,t):k(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ot(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,s=c.$subtitle,l=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",l.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return F(q(o));case"ass":return F(H(o));case"vtt":return F(o);default:return t}})).then((function(t){return s.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}}]),o}(Rt);var ke=function(){function t(r){var n=this;e(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){$(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){m(n,"art-hover"),t.emit("hover",!0)}),(function(){w(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),w(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=et((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=rt((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=rt(r.currentTime+60*e,0,r.duration),n.show="".concat(nt(c)," / ").concat(nt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=tt((function(){t.emit("view",D(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return n(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),je=function(){function t(r){var n=this;e(this,t),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return n(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(t){c(n,t);var r=Pe(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="layer",o.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(t){c(n,t);var r=Re(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="loading",O(t.template.$loading,t.icons.loading),o}return n}(Rt),De=function(){function t(r){e(this,t),this.art=r,this.time=2e3,this.timer=null}return n(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,m(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",w(r,"art-notice-show")}),this.time)}}]),t}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(t){c(n,t);var r=$e(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="mask",O(t.template.$state,t.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function r(n){var o=this;e(this,r);var i=function(e){for(var r=1;r',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},n.option.icons);Object.keys(i).forEach((function(t){Y(o,t,{get:function(){var e=document.createElement("i");return m(e,"art-icon"),m(e,"art-icon-".concat(t)),O(e,i[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var r=1;r'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=v(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return He(He({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=v(".art-setting-range input",t),i=v(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function r(){e(this,r),this.name="artplayer_settings"}return n(r,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(e,r){var n=Object.assign({},this.get(),t({},e,r));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),r}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=v(".art-setting-range input",e),i=v(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var s=Array.from(o.$track.track.cues),l=e(r,-5,5);s.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+l,0,a.duration),t.endTime=e(c[r].endTime+l,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else M(!1,"Playback of this file format is not supported")}}function s(t){var r=O(t,'');k(t,"position","relative"),j(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),s(r)}})})),{name:"localVideo",attach:s}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=O(n,'');k(n,"position","relative"),j(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):M(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function t(r){var n=this;e(this,t),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return n(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return M(!J(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Y(this,r,{value:e}),this}}]),t}(),Ge=function t(r){e(this,t);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=rt(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(t){c(i,t);var r=Ke(i);function i(t){var n;return e(this,i),(n=r.call(this)).option=p(G(i.option,t),yt),n.isFocus=!1,n.isDestroy=!1,n.userAgent=d,n.isMobile=h,n.isWechat=b,n.whitelist=new vt(o(n)),n.template=new gt(o(n)),n.events=new ke(o(n)),n.whitelist.state?(n.storage=new Ne(o(n)),n.icons=new Ae(o(n)),n.i18n=new xt(o(n)),n.notice=new De(o(n)),n.player=new jt(o(n)),n.layers=new Se(o(n)),n.controls=new oe(o(n)),n.contextmenu=new ge(o(n)),n.subtitle=new Oe(o(n)),n.info=new we(o(n)),n.loading=new Ee(o(n)),n.hotkey=new je(o(n)),n.mask=new Te(o(n)),n.setting=new Be(o(n)),n.plugins=new Qe(o(n))):n.mobile=new Ge(o(n)),tr+=1,n.id=tr,er.push(o(n)),n}return n(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return it}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return f}},{key:"validator",get:function(){return p}},{key:"kindOf",get:function(){return p.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:y?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(f);function nr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function or(e){for(var r=1;r1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function m(t,e){return t.classList.add(e)}function w(t,e){return t.classList.remove(e)}function x(t,e){return t.classList.contains(e)}function O(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function k(t,e,r){return t.style[e]=r,t}function j(t,e){return Object.keys(e).forEach((function(r){k(t,r,e[r])})),t}function P(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function S(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function R(t,e){S(t).forEach((function(t){return w(t,e)})),m(t,e)}function E(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";h||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function D(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function $(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var T=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var z=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},A=i((function(t){function e(r,n,o){return z()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&a(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var L=function(t){c(n,t);var r=C(n);function n(t,i){var a;return e(this,n),a=r.call(this,t),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o(a),i||a.constructor),a.name="ArtPlayerError",a}return n}(i((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!T(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return A(t,arguments,u(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),a(e,t)},e(r)}t.exports=e}))(Error));function M(t,e){if(!t)throw new L(e);return t}function q(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function F(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function I(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var V=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function tt(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function ot(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var it=Object.freeze({__proto__:null,query:v,queryAll:g,addClass:m,removeClass:w,hasClass:x,append:O,remove:function(t){return t.parentNode.removeChild(t)},setStyle:k,setStyles:j,getStyle:P,sublings:S,inverseClass:R,tooltip:E,isInViewport:D,includeFromEvent:$,ArtPlayerError:L,errorHandle:M,srtToVtt:q,vttToBlob:F,assToVtt:H,getExt:W,download:I,def:Y,has:J,proxyPropertys:Q,mergeDeep:G,sleep:K,debounce:tt,throttle:et,clamp:rt,secondToTime:nt,escape:ot,userAgent:d,isMobile:h,isSafari:y,isWechat:b});function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(e){for(var r=1;r-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function t(r){var n=this;e(this,t),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=v(r.option.container),M(this.$container,"No container element found by ".concat(r.option.container))),M(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),M(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return n(t,[{key:"query",value:function(t){return v(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(m(this.$settingInner,"art-backdrop-filter"),m(this.$info,"art-backdrop-filter"),m(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&m(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":m(this.$player,"art-destroy")}}]),t}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function t(r){e(this,t),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return n(t,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=G(this.languages,t),this.init()}}]),t}();var Ot=i((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*l/s;k(n,"width","".concat(100*h,"%")),k(n,"height","100%"),k(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=s/d/l;k(n,"width","100%"),k(n,"height","".concat(100*y,"%")),k(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),Y(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");Y(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),Y(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),Y(e,"screenshot",{value:function(){e.getDataURL().then((function(e){I(e,"".concat(r.title||"artplayer","_").concat(nt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){w(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),Y(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;Y(e,"fullscreenWeb",{get:function(){return x(r,"art-fullscreen-web")},set:function(n){n?(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(w(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),Y(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;Y(e,"fullscreenRotate",{get:function(){return x(n,"art-fullscreen-rotate")},set:function(r){if(r){m(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,s=o.clientHeight,l=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;Y(e,"autoSize",{get:function(){return x(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,s=n.getBoundingClientRect(),l=s.width,u=s.height,p=a/c,f=l/u;if(m(n,"art-auto-size"),f>p)k(o,"width","".concat(u*p/l*100,"%")),k(o,"height","100%");else{var d=l/p/u*100;k(o,"width","100%"),k(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else w(n,"art-auto-size"),k(o,"width",null),k(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){Y(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Y(e,t,{get:function(){return e.rect[t]}})})),Y(e,"x",{get:function(){return e.left+window.pageXOffset}}),Y(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;Y(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];M(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),Y(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;Y(e,"light",{get:function(){return"none"!==P(r,"display",!1)},set:function(e){k(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,s=a.$miniClose,l=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){m(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;k(c,"top","".concat(e,"px")),k(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,w(c,"art-is-dragging")})),i(s,"click",(function(){e.mini=!1,f=!1,w(c,"art-is-dragging")})),O(l,n.title||r.get("Mini player")),Y(e,"mini",{get:function(){return x(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,m(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)k(c,"top","".concat(i,"px")),k(c,"left","".concat(a,"px")),D(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var s=document.body,l=s.clientHeight-e.height-50,f=s.clientWidth-e.width-50;o.set("top",l),o.set("left",f),k(c,"top","".concat(l,"px")),k(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,w(c,"art-mini"),k(c,"top",null),k(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),Y(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];Y(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=rt(n[0],0,Math.min(n[1],e.duration)),i=rt(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;Y(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(M(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,k(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var s=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},l=0,u=1;switch(r){case-270:l=90,u=s();break;case-180:l=180;break;case-90:l=270,u=s();break;case 90:l=90,u=s();break;case 180:l=180;break;case 270:l=270,u=s()}k(n,"transform","rotate(".concat(l,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),Y(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),Q(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t},St=i((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function t(r){e(this,t),this.id=0,this.art=r,this.add=this.add.bind(this)}return n(t,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);M(!J(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");m(o,"art-".concat(this.name)),m(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):O(this.$parent,o),r.html&&O(o,r.html),r.style&&j(o,r.style),r.tooltip&&E(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&m(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;m(e,"art-control-selector");var a=document.createElement("div");m(a,"art-selector-value"),O(a,t.html),e.innerText="",O(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),s=document.createElement("div");m(s,"art-selector-list"),O(s,c),O(e,s);var l=function(){s.style.left="-".concat(P(s,"width")/2-P(e,"width")/2,"px")};o(e,l),i(e,"click",(function(e){if(x(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,l(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return x(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?m(e,r):w(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var r=1;r
'),mounted:function(t){var r=!1,o=v(".art-progress-loaded",t),c=v(".art-progress-played",t),s=v(".art-progress-highlight",t),l=v(".art-progress-indicator",t),u=v(".art-progress-tip",t);function p(t,e){"loaded"===t&&k(o,"width","".concat(100*e,"%")),"played"===t&&(k(c,"width","".concat(100*e,"%")),k(l,"left","calc(".concat(100*e,"% - ").concat(P(l,"width")/2,"px)")))}n.forEach((function(t){var e=rt(t.time,0,a.duration)/a.duration*100;O(s,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){k(u,"display","block"),$(r,s)?function(r){var n=Ft(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?k(u,"left",0):n>t.clientWidth-i/2?k(u,"left","".concat(t.clientWidth-i,"px")):k(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ft(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?k(u,"left",0):o>t.clientWidth-a/2?k(u,"left","".concat(t.clientWidth-a,"px")):k(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){k(u,"display","none")})),i(t,"click",(function(t){if(t.target!==l){var r=Ft(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(l,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ft(e,t),o=n.second,i=n.percentage;m(l,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,w(l,"art-show-indicator"))}))}})}}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(e){for(var r=1;rn.clientWidth-s/2?k(t,"left","".concat(n.clientWidth-s,"px")):k(t,"left","".concat(i-s/2,"px"))}(o))})),i(n,"mouseout",(function(){k(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(e){for(var r=1;r'),o=O(t,'');e.on("loop",(function(e){e?(k(t,"display","block"),k(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),k(o,"left","".concat(e[1]/r.duration*100,"%"))):k(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),n.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=O(t,n.play),c=O(t,n.pause);function s(){k(a,"display","flex"),k(c,"display","none")}function l(){k(a,"display","none"),k(c,"display","flex")}E(a,o.get("Play")),E(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?l():s(),e.on("video:playing",(function(){l()})),e.on("video:pause",(function(){s()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=O(t,n.volume),s=O(t,n.volumeClose),l=O(t,'
'),u=O(l,'
');function p(t){var e=l.getBoundingClientRect().left;return rt(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)k(c,"display","none"),k(s,"display","flex"),k(u,"left","0");else{var e=48*t;k(c,"display","flex"),k(s,"display","none"),k(u,"left","".concat(e,"px"))}}E(c,i.get("Mute")),k(s,"display","none"),e.isMobile&&k(l,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(s,"click",(function(){o.muted=!1})),r(l,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),n.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(nt(e.player.currentTime)," / ").concat(nt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),n.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),n.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;O(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),n.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;O(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){E(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),n.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;O(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){E(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),n.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){E(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),n.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){E(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),n.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;O(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){E(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){n.add(t)}))})),n}return n(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:M(!1,"Control option.position must one of 'top', 'left', 'right'")}St(u(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var r=1;r0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=g("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&R(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return se(se({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("span",t).find((function(t){return t.dataset.ratio===e}));r&&R(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),l(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,l=n.left,u=n.top,p=s.getBoundingClientRect(),f=p.height,d=p.width,h=e-l,y=r-u;e+d>l+a&&(h=a-d),r+f>u+i&&(y=i-f),j(s,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),l(c,"click",(function(t){$(t,s)||(o.show=!1)})),t.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(t){c(n,t);var r=me(n);function n(t){var o;e(this,n),(o=r.call(this,t)).name="info";var i=t.template,a=i.$infoPanel,c=i.$infoClose,s=i.$video;(0,t.events.proxy)(c,"click",(function(){o.show=!1}));var l=null,u=g("[data-video]",a);return t.on("destroy",(function(){clearTimeout(l)})),t.on("info",(function(t){clearTimeout(l),t&&function t(){u.forEach((function(t){var e=s[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),l=setTimeout((function(){t()}),1e3)}()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(t){c(o,t);var r=xe(o);function o(t){var n;e(this,o),(n=r.call(this,t)).name="subtitle";var i=t.option.subtitle,a=t.template.$subtitle;return j(a,i.style),i.url&&n.init(i.url),i.bilingual&&m(a,"art-bilingual"),n}return n(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===s(t)?j(r,t):k(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(ot(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,s=c.$subtitle,l=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",l.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return F(q(o));case"ass":return F(H(o));case"vtt":return F(o);default:return t}})).then((function(t){return s.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"bilingual",get:function(){return x(this.art.template.$subtitle,"art-bilingual")},set:function(t){var e=this.art.template.$subtitle;t?m(e,"art-bilingual"):w(e,"art-bilingual")}}]),o}(Rt);var ke=function(){function t(r){var n=this;e(this,t),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){$(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){m(n,"art-hover"),t.emit("hover",!0)}),(function(){w(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),w(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=et((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=rt((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=rt(r.currentTime+60*e,0,r.duration),n.show="".concat(nt(c)," / ").concat(nt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=tt((function(){t.emit("view",D(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return n(t,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),je=function(){function t(r){var n=this;e(this,t),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return n(t,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),t}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(t){c(n,t);var r=Pe(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="layer",o.$parent=t.template.$layer,t.once("ready",(function(){t.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(t){c(n,t);var r=Re(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="loading",O(t.template.$loading,t.icons.loading),o}return n}(Rt),De=function(){function t(r){e(this,t),this.art=r,this.time=2e3,this.timer=null}return n(t,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,m(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",w(r,"art-notice-show")}),this.time)}}]),t}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(t){c(n,t);var r=$e(n);function n(t){var o;return e(this,n),(o=r.call(this,t)).name="mask",O(t.template.$state,t.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function r(n){var o=this;e(this,r);var i=function(e){for(var r=1;r',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},n.option.icons);Object.keys(i).forEach((function(t){Y(o,t,{get:function(){var e=document.createElement("i");return m(e,"art-icon"),m(e,"art-icon-".concat(t)),O(e,i[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var r=1;r'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=v(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return He(He({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("button",t).find((function(t){return t.dataset.value===e}));r&&R(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=v(".art-setting-range input",t),i=v(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function r(){e(this,r),this.name="artplayer_settings"}return n(r,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(e,r){var n=Object.assign({},this.get(),t({},e,r));localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),r}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=v(".art-setting-range input",e),i=v(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var s=Array.from(o.$track.track.cues),l=e(r,-5,5);s.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+l,0,a.duration),t.endTime=e(c[r].endTime+l,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else M(!1,"Playback of this file format is not supported")}}function s(t){var r=O(t,'');k(t,"position","relative"),j(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),s(r)}})})),{name:"localVideo",attach:s}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=O(n,'');k(n,"position","relative"),j(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):M(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=v(".art-upload-btn",e),n=v(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function t(r){var n=this;e(this,t),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return n(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return M(!J(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),Y(this,r,{value:e}),this}}]),t}(),Ge=function t(r){e(this,t);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=rt(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(t){c(i,t);var r=Ke(i);function i(t){var n;return e(this,i),(n=r.call(this)).option=p(G(i.option,t),yt),n.isFocus=!1,n.isDestroy=!1,n.userAgent=d,n.isMobile=h,n.isWechat=b,n.whitelist=new vt(o(n)),n.template=new gt(o(n)),n.events=new ke(o(n)),n.whitelist.state?(n.storage=new Ne(o(n)),n.icons=new Ae(o(n)),n.i18n=new xt(o(n)),n.notice=new De(o(n)),n.player=new jt(o(n)),n.layers=new Se(o(n)),n.controls=new oe(o(n)),n.contextmenu=new ge(o(n)),n.subtitle=new Oe(o(n)),n.info=new we(o(n)),n.loading=new Ee(o(n)),n.hotkey=new je(o(n)),n.mask=new Te(o(n)),n.setting=new Be(o(n)),n.plugins=new Qe(o(n))):n.mobile=new Ge(o(n)),tr+=1,n.id=tr,er.push(o(n)),n}return n(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return it}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return f}},{key:"validator",get:function(){return p}},{key:"kindOf",get:function(){return p.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:y?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(f);function nr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function or(e){for(var r=1;r1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function g(t,e){return t.classList.add(e)}function m(t,e){return t.classList.remove(e)}function w(t,e){return t.classList.contains(e)}function x(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function O(t,e,r){return t.style[e]=r,t}function k(t,e){return Object.keys(e).forEach((function(r){O(t,r,e[r])})),t}function j(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function P(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function S(t,e){P(t).forEach((function(t){return m(t,e)})),g(t,e)}function R(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";d||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function E(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function D(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var $=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var T=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},z=o((function(t){function e(r,n,o){return T()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&i(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var C=function(e){a(o,e);var r=A(o);function o(e,i){var a;return t(this,o),a=r.call(this,e),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(n(a),i||a.constructor),a.name="ArtPlayerError",a}return o}(o((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!$(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return z(t,arguments,s(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},e(r)}t.exports=e}))(Error));function L(t,e){if(!t)throw new C(e);return t}function M(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function q(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function F(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var I=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function K(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function nt(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var ot=Object.freeze({__proto__:null,query:b,queryAll:v,addClass:g,removeClass:m,hasClass:w,append:x,remove:function(t){return t.parentNode.removeChild(t)},setStyle:O,setStyles:k,getStyle:j,sublings:P,inverseClass:S,tooltip:R,isInViewport:E,includeFromEvent:D,ArtPlayerError:C,errorHandle:L,srtToVtt:M,vttToBlob:q,assToVtt:H,getExt:W,download:F,def:X,has:Z,proxyPropertys:J,mergeDeep:Q,sleep:G,debounce:K,throttle:tt,clamp:et,secondToTime:rt,escape:nt,userAgent:f,isMobile:d,isSafari:h,isWechat:y});var it=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function e(r){var n=this;t(this,e),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=b(r.option.container),L(this.$container,"No container element found by ".concat(r.option.container))),L(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),L(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return r(e,[{key:"query",value:function(t){return b(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(g(this.$settingInner,"art-backdrop-filter"),g(this.$info,"art-backdrop-filter"),g(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&g(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":g(this.$player,"art-destroy")}}]),e}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function e(r){t(this,e),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=Q(this.languages,t),this.init()}}]),e}();var Ot=o((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*s/l;O(n,"width","".concat(100*h,"%")),O(n,"height","100%"),O(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=l/d/s;O(n,"width","100%"),O(n,"height","".concat(100*y,"%")),O(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),X(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");X(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),X(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),X(e,"screenshot",{value:function(){e.getDataURL().then((function(e){F(e,"".concat(r.title||"artplayer","_").concat(rt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){g(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),X(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreenWeb",{get:function(){return w(r,"art-fullscreen-web")},set:function(n){n?(g(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),X(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;X(e,"fullscreenRotate",{get:function(){return w(n,"art-fullscreen-rotate")},set:function(r){if(r){g(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;X(e,"autoSize",{get:function(){return w(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,p=a/c,f=s/u;if(g(n,"art-auto-size"),f>p)O(o,"width","".concat(u*p/s*100,"%")),O(o,"height","100%");else{var d=s/p/u*100;O(o,"width","100%"),O(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else m(n,"art-auto-size"),O(o,"width",null),O(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){X(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){X(e,t,{get:function(){return e.rect[t]}})})),X(e,"x",{get:function(){return e.left+window.pageXOffset}}),X(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;X(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];L(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),X(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;X(e,"light",{get:function(){return"none"!==j(r,"display",!1)},set:function(e){O(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){g(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;O(c,"top","".concat(e,"px")),O(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,m(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,f=!1,m(c,"art-is-dragging")})),x(s,n.title||r.get("Mini player")),X(e,"mini",{get:function(){return w(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,g(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)O(c,"top","".concat(i,"px")),O(c,"left","".concat(a,"px")),E(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,f=l.clientWidth-e.width-50;o.set("top",s),o.set("left",f),O(c,"top","".concat(s,"px")),O(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,m(c,"art-mini"),O(c,"top",null),O(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),X(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];X(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=et(n[0],0,Math.min(n[1],e.duration)),i=et(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;X(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(L(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,O(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}O(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),X(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),J(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t},St=o((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function e(r){t(this,e),this.id=0,this.art=r,this.add=this.add.bind(this)}return r(e,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);L(!Z(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");g(o,"art-".concat(this.name)),g(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):x(this.$parent,o),r.html&&x(o,r.html),r.style&&k(o,r.style),r.tooltip&&R(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&g(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;g(e,"art-control-selector");var a=document.createElement("div");g(a,"art-selector-value"),x(a,t.html),e.innerText="",x(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");g(l,"art-selector-list"),x(l,c),x(e,l);var s=function(){l.style.left="-".concat(j(l,"width")/2-j(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(w(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return w(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?g(e,r):m(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),e}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=b(".art-progress-loaded",t),c=b(".art-progress-played",t),l=b(".art-progress-highlight",t),s=b(".art-progress-indicator",t),u=b(".art-progress-tip",t);function p(t,e){"loaded"===t&&O(o,"width","".concat(100*e,"%")),"played"===t&&(O(c,"width","".concat(100*e,"%")),O(s,"left","calc(".concat(100*e,"% - ").concat(j(s,"width")/2,"px)")))}n.forEach((function(t){var e=et(t.time,0,a.duration)/a.duration*100;x(l,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){O(u,"display","block"),D(r,l)?function(r){var n=Ht(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?O(u,"left",0):n>t.clientWidth-i/2?O(u,"left","".concat(t.clientWidth-i,"px")):O(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ht(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?O(u,"left",0):o>t.clientWidth-a/2?O(u,"left","".concat(t.clientWidth-a,"px")):O(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){O(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Ht(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ht(e,t),o=n.second,i=n.percentage;g(s,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,m(s,"art-show-indicator"))}))}})}}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;en.clientWidth-l/2?O(t,"left","".concat(n.clientWidth-l,"px")):O(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){O(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(t){for(var e=1;e'),o=x(t,'');e.on("loop",(function(e){e?(O(t,"display","block"),O(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),O(o,"left","".concat(e[1]/r.duration*100,"%"))):O(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),r.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=x(t,n.play),c=x(t,n.pause);function l(){O(a,"display","flex"),O(c,"display","none")}function s(){O(a,"display","none"),O(c,"display","flex")}R(a,o.get("Play")),R(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),r.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=x(t,n.volume),l=x(t,n.volumeClose),s=x(t,'
'),u=x(s,'
');function p(t){var e=s.getBoundingClientRect().left;return et(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)O(c,"display","none"),O(l,"display","flex"),O(u,"left","0");else{var e=48*t;O(c,"display","flex"),O(l,"display","none"),O(u,"left","".concat(e,"px"))}}R(c,i.get("Mute")),O(l,"display","none"),e.isMobile&&O(s,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),r.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(rt(e.player.currentTime)," / ").concat(rt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),r.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),r.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;x(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),r.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;x(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){R(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),r.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;x(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){R(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),r.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){R(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),r.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){R(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),r.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){R(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){r.add(t)}))})),r}return r(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:L(!1,"Control option.position must one of 'top', 'left', 'right'")}St(s(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=v("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&S(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return le(le({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("span",t).find((function(t){return t.dataset.ratio===e}));r&&S(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,s=n.left,u=n.top,p=l.getBoundingClientRect(),f=p.height,d=p.width,h=e-s,y=r-u;e+d>s+a&&(h=a-d),r+f>u+i&&(y=i-f),k(l,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),s(c,"click",(function(t){D(t,l)||(o.show=!1)})),e.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(e){a(n,e);var r=me(n);function n(e){var o;t(this,n),(o=r.call(this,e)).name="info";var i=e.template,a=i.$infoPanel,c=i.$infoClose,l=i.$video;(0,e.events.proxy)(c,"click",(function(){o.show=!1}));var s=null,u=v("[data-video]",a);function p(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){p()}),1e3)}return e.on("destroy",(function(){clearTimeout(s)})),e.on("info",(function(t){clearTimeout(s),t&&p()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(e){a(o,e);var n=xe(o);function o(e){var r;t(this,o),(r=n.call(this,e)).name="subtitle";var i=e.option.subtitle,a=e.template.$subtitle;return k(a,i.style),i.url&&r.init(i.url),i.bilingual&&g(a,"art-bilingual"),r}return r(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===c(t)?k(r,t):O(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(nt(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",s.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return q(M(o));case"ass":return q(H(o));case"vtt":return q(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}}]),o}(Rt);var ke=function(){function e(r){var n=this;t(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){D(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){g(n,"art-hover"),t.emit("hover",!0)}),(function(){m(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),m(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=tt((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=et((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=et(r.currentTime+60*e,0,r.duration),n.show="".concat(rt(c)," / ").concat(rt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=K((function(){t.emit("view",E(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return r(e,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),e}(),je=function(){function e(r){var n=this;t(this,e),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return r(e,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),e}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(e){a(n,e);var r=Pe(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="layer",o.$parent=e.template.$layer,e.once("ready",(function(){e.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(e){a(n,e);var r=Re(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="loading",x(e.template.$loading,e.icons.loading),o}return n}(Rt),De=function(){function e(r){t(this,e),this.art=r,this.time=2e3,this.timer=null}return r(e,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,g(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",m(r,"art-notice-show")}),this.time)}}]),e}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(e){a(n,e);var r=$e(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="mask",x(e.template.$state,e.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function e(r){var n=this;t(this,e);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},r.option.icons);Object.keys(o).forEach((function(t){X(n,t,{get:function(){var e=document.createElement("i");return g(e,"art-icon"),g(e,"art-icon-".concat(t)),x(e,o[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=b(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return We(We({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=b(".art-setting-range input",t),i=b(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),e.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function e(){t(this,e),this.name="artplayer_settings"}return r(e,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var r=Object.assign({},this.get(),it({},t,e));localStorage.setItem(this.name,JSON.stringify(r))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),e}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=b(".art-setting-range input",e),i=b(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else L(!1,"Playback of this file format is not supported")}}function l(t){var r=x(t,'');O(t,"position","relative"),k(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=x(n,'');O(n,"position","relative"),k(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):L(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function e(r){var n=this;t(this,e),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return r(e,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return L(!Z(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),X(this,r,{value:e}),this}}]),e}(),Ge=function e(r){t(this,e);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=et(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(e){a(i,e);var o=Ke(i);function i(e){var r;return t(this,i),(r=o.call(this)).option=u(Q(i.option,e),yt),r.isFocus=!1,r.isDestroy=!1,r.userAgent=f,r.isMobile=d,r.isWechat=y,r.whitelist=new vt(n(r)),r.template=new gt(n(r)),r.events=new ke(n(r)),r.whitelist.state?(r.storage=new Ne(n(r)),r.icons=new Ae(n(r)),r.i18n=new xt(n(r)),r.notice=new De(n(r)),r.player=new jt(n(r)),r.layers=new Se(n(r)),r.controls=new oe(n(r)),r.contextmenu=new ge(n(r)),r.subtitle=new Oe(n(r)),r.info=new we(n(r)),r.loading=new Ee(n(r)),r.hotkey=new je(n(r)),r.mask=new Te(n(r)),r.setting=new Be(n(r)),r.plugins=new Qe(n(r))):r.mobile=new Ge(n(r)),tr+=1,r.id=tr,er.push(n(r)),r}return r(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return ot}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return p}},{key:"validator",get:function(){return u}},{key:"kindOf",get:function(){return u.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:h?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(p);return console.log("%c ArtPlayer %c 3.5.15 %c https://artplayer.org","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),rr})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Artplayer=e()}(this,(function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function e(t,e){for(var r=0;r1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function g(t,e){return t.classList.add(e)}function m(t,e){return t.classList.remove(e)}function w(t,e){return t.classList.contains(e)}function x(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function O(t,e,r){return t.style[e]=r,t}function k(t,e){return Object.keys(e).forEach((function(r){O(t,r,e[r])})),t}function j(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function P(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function S(t,e){P(t).forEach((function(t){return m(t,e)})),g(t,e)}function R(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";d||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function E(t){var e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,o=e.top<=r&&e.top+e.height>=0,i=e.left<=n&&e.left+e.width>=0;return o&&i}function D(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}var $=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")};var T=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}},z=o((function(t){function e(r,n,o){return T()?t.exports=e=Reflect.construct:t.exports=e=function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&i(o,r.prototype),o},e.apply(null,arguments)}t.exports=e}));function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var C=function(e){a(o,e);var r=A(o);function o(e,i){var a;return t(this,o),a=r.call(this,e),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(n(a),i||a.constructor),a.name="ArtPlayerError",a}return o}(o((function(t){function e(r){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!$(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return z(t,arguments,s(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},e(r)}t.exports=e}))(Error));function L(t,e){if(!t)throw new C(e);return t}function M(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function q(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function W(t){return t.includes("?")?W(t.split("?")[0]):t.includes("#")?W(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function F(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var I=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function K(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function nt(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var ot=Object.freeze({__proto__:null,query:b,queryAll:v,addClass:g,removeClass:m,hasClass:w,append:x,remove:function(t){return t.parentNode.removeChild(t)},setStyle:O,setStyles:k,getStyle:j,sublings:P,inverseClass:S,tooltip:R,isInViewport:E,includeFromEvent:D,ArtPlayerError:C,errorHandle:L,srtToVtt:M,vttToBlob:q,assToVtt:H,getExt:W,download:F,def:X,has:Z,proxyPropertys:J,mergeDeep:Q,sleep:G,debounce:K,throttle:tt,clamp:et,secondToTime:rt,escape:nt,userAgent:f,isMobile:d,isSafari:h,isWechat:y});var it=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t};function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},gt=function(){function e(r){var n=this;t(this,e),this.art=r,r.option.container instanceof Element?this.$container=r.option.container:(this.$container=b(r.option.container),L(this.$container,"No container element found by ".concat(r.option.container))),L(r.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),L(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),r.whitelist.state?this.desktop():this.mobile()}return r(e,[{key:"query",value:function(t){return b(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,r=t.backdrop;this.$container.innerHTML='
Player version:
3.5.15
Video url:
Video volume:
Video time:
Video duration:
Video resolution:
x
[x]
xD7
'),this.$undercover=this.query(".art-undercover"),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),r&&(g(this.$settingInner,"art-backdrop-filter"),g(this.$info,"art-backdrop-filter"),g(this.$contextmenu,"art-backdrop-filter")),this.art.isMobile&&g(this.$container,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='
',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":g(this.$player,"art-destroy")}}]),e}(),mt={"Video info":"统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"翻转",Rotate:"旋转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","PIP mode":"画中画模式","Exit PIP mode":"退出画中画模式","PIP not supported":"不支持画中画模式","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},wt={"Video info":"統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"翻轉",Rotate:"旋轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕","Show setting":"顯示设置","Hide setting":"隱藏设置",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","PIP mode":"畫中畫模式","Exit PIP mode":"退出畫中畫模式","PIP not supported":"不支持畫中畫模式","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},xt=function(){function e(r){t(this,e),this.art=r,this.languages={"zh-cn":mt,"zh-tw":wt},this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=Q(this.languages,t),this.init()}}]),e}();var Ot=o((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*s/l;O(n,"width","".concat(100*h,"%")),O(n,"height","100%"),O(n,"padding","0 ".concat((u-u*h)/2,"px"))}else{var y=l/d/s;O(n,"width","100%"),O(n,"height","".concat(100*y,"%")),O(n,"padding","".concat((p-p*y)/2,"px 0"))}o.dataset.aspectRatio=e}a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===e?i.get("Default"):e),t.emit("aspectRatio",e)}}),X(e,"aspectRatioReset",{set:function(t){if(t&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r}}})}(r,this),function(t,e){var r=t.option,n=t.notice,o=t.template.$video,i=document.createElement("canvas");X(e,"getDataURL",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),t(i.toDataURL("image/png"))}catch(t){n.show=t,e(t)}}))}}),X(e,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0),i.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){n.show=t,e(t)}}))}}),X(e,"screenshot",{value:function(){e.getDataURL().then((function(e){F(e,"".concat(r.title||"artplayer","_").concat(rt(o.currentTime),".png")),t.emit("screenshot",e)}))}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreen",{get:function(){return Ot.isFullscreen},set:function(n){n?Ot.request(r).then((function(){g(r,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreen",!0)})):Ot.exit().then((function(){m(r,"art-fullscreen"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreen")}))}}),X(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(r,this),function(t,e){var r=t.template.$player;X(e,"fullscreenWeb",{get:function(){return w(r,"art-fullscreen-web")},set:function(n){n?(g(r,"art-fullscreen-web"),e.aspectRatioReset=!0,t.emit("resize"),t.emit("fullscreenWeb",!0)):(m(r,"art-fullscreen-web"),e.aspectRatioReset=!0,e.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"))}}),X(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player;X(e,"fullscreenRotate",{get:function(){return w(n,"art-fullscreen-rotate")},set:function(r){if(r){g(n,"art-fullscreen-rotate"),e.autoSize=!0;var i=document.body,a=i.clientHeight,c=i.clientWidth,l=o.clientHeight,s=o.clientWidth;if(c/a0&&!r.paused&&!r.ended&&r.readyState>2)}})}(r,this),function(t,e){var r=t.template,n=r.$container,o=r.$player,i=r.$video;X(e,"autoSize",{get:function(){return w(n,"art-auto-size")},set:function(r){if(r){var a=i.videoWidth,c=i.videoHeight,l=n.getBoundingClientRect(),s=l.width,u=l.height,p=a/c,f=s/u;if(g(n,"art-auto-size"),f>p)O(o,"width","".concat(u*p/s*100,"%")),O(o,"height","100%");else{var d=s/p/u*100;O(o,"width","100%"),O(o,"height","".concat(d,"%"))}t.emit("autoSize",{width:e.width,height:e.height})}else m(n,"art-auto-size"),O(o,"width",null),O(o,"height",null),t.emit("autoSize")}})}(r,this),function(t,e){X(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){X(e,t,{get:function(){return e.rect[t]}})})),X(e,"x",{get:function(){return e.left+window.pageXOffset}}),X(e,"y",{get:function(){return e.top+window.pageYOffset}})}(r,this),function(t,e){var r=t.template.$player,n=t.i18n,o=t.notice;X(e,"flip",{get:function(){return r.dataset.flip},set:function(i){i||(i="normal");var a=["normal","horizontal","vertical"];L(a.includes(i),"'flip' only accept ".concat(a.toString()," as parameters")),"normal"===i?delete r.dataset.flip:(e.rotate=!1,r.dataset.flip=i);var c=i.replace(i[0],i[0].toUpperCase());o.show="".concat(n.get("Flip"),": ").concat(n.get(c)),t.emit("flip",i)}}),X(e,"flipReset",{set:function(t){if(t&&e.flip){var r=e.flip;e.flip=r}}})}(r,this),function(t,e){var r=t.template.$undercover;X(e,"light",{get:function(){return"none"!==j(r,"display",!1)},set:function(e){O(r,"display",e?"block":"none"),t.emit("light",e)}})}(r,this),function(t,e){var r=t.i18n,n=t.option,o=t.storage,i=t.events.proxy,a=t.template,c=a.$player,l=a.$miniClose,s=a.$miniTitle,u=a.$miniHeader,p="",f=!1,d=0,h=0,y=0,b=0;i(u,"mousedown",(function(t){f=!0,d=t.pageX,h=t.pageY,y=e.left,b=e.top})),i(document,"mousemove",(function(t){if(f){g(c,"art-is-dragging");var e=b+t.pageY-h,r=y+t.pageX-d;O(c,"top","".concat(e,"px")),O(c,"left","".concat(r,"px")),o.set("top",e),o.set("left",r)}})),i(document,"mouseup",(function(){f=!1,m(c,"art-is-dragging")})),i(l,"click",(function(){e.mini=!1,f=!1,m(c,"art-is-dragging")})),x(s,n.title||r.get("Mini player")),X(e,"mini",{get:function(){return w(c,"art-mini")},set:function(r){if(r){e.autoSize=!1,p=c.style.cssText,g(c,"art-mini");var i=o.get("top"),a=o.get("left");if(i&&a)O(c,"top","".concat(i,"px")),O(c,"left","".concat(a,"px")),E(u)||(o.del("top"),o.del("left"),e.mini=!0);else{var l=document.body,s=l.clientHeight-e.height-50,f=l.clientWidth-e.width-50;o.set("top",s),o.set("left",f),O(c,"top","".concat(s,"px")),O(c,"left","".concat(f,"px"))}e.aspectRatio=!1,e.playbackRate=!1,t.emit("mini",!0)}else c.style.cssText=p,m(c,"art-mini"),O(c,"top",null),O(c,"left",null),e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=n.autoSize,t.emit("mini")}}),X(e,"miniToggle",{set:function(t){t&&(e.mini=!e.mini)}})}(r,this),function(t,e){var r=[];X(e,"loop",{get:function(){return r},set:function(n){if(Array.isArray(n)&&"number"==typeof n[0]&&"number"==typeof n[1]){var o=et(n[0],0,Math.min(n[1],e.duration)),i=et(n[1],o,e.duration);i-o>=1?(r=[o,i],t.emit("loop",r)):(r=[],t.emit("loop"))}else r=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){r.length&&(e.currentTimer[1])&&(e.seek=r[0])}))}(r,this),function(t,e){var r=t.template,n=r.$video,o=r.$player,i=t.i18n,a=t.notice;X(e,"rotate",{get:function(){return Number(o.dataset.rotate)||0},set:function(r){r||(r=0);var c=[-270,-180,-90,0,90,180,270];if(L(c.includes(r),"'rotate' only accept ".concat(c.toString()," as parameters")),0===r)delete o.dataset.rotate,O(n,"transform",null);else{e.flip=!1,o.dataset.rotate=r;var l=function(){var t=n.clientWidth,e=n.clientHeight,r=o.clientWidth,i=o.clientHeight;return r/i>t/e?r/e:i/t},s=0,u=1;switch(r){case-270:s=90,u=l();break;case-180:s=180;break;case-90:s=270,u=l();break;case 90:s=90,u=l();break;case 180:s=180;break;case 270:s=270,u=l()}O(n,"transform","rotate(".concat(s,"deg) scale(").concat(u,")"))}a.show="".concat(i.get("Rotate"),": ").concat(r,"°"),t.emit("rotate",r)}}),X(e,"rotateReset",{set:function(t){if(t&&e.rotate){var r=e.rotate;e.rotate=r}}})}(r,this),J(r,this)};var Pt=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t},St=o((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=Pt(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),Rt=function(){function e(r){t(this,e),this.id=0,this.art=r,this.add=this.add.bind(this)}return r(e,[{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);L(!Z(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");g(o,"art-".concat(this.name)),g(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));a?a.insertAdjacentElement("beforebegin",o):x(this.$parent,o),r.html&&x(o,r.html),r.style&&k(o,r.style),r.tooltip&&R(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&g(o,"art-control-onlyText")}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;g(e,"art-control-selector");var a=document.createElement("div");g(a,"art-selector-value"),x(a,t.html),e.innerText="",x(e,a);var c=t.selector.map((function(t){return'
'.concat(t.name,"
")})).join(""),l=document.createElement("div");g(l,"art-selector-list"),x(l,c),x(e,l);var s=function(){l.style.left="-".concat(j(l,"width")/2-j(e,"width")/2,"px")};o(e,s),i(e,"click",(function(e){if(w(e.target,"art-selector-item")){var n=e.target.innerText;if(a.innerText===n)return;var o=t.selector.find((function(t){return t.name===n}));a.innerText=n,s(),o&&(t.onSelect&&t.onSelect.call(r.art,o),r.art.emit("selector",o))}}))}},{key:"show",get:function(){return w(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?g(e,r):m(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),e}();function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e
'),mounted:function(t){var r=!1,o=b(".art-progress-loaded",t),c=b(".art-progress-played",t),l=b(".art-progress-highlight",t),s=b(".art-progress-indicator",t),u=b(".art-progress-tip",t);function p(t,e){"loaded"===t&&O(o,"width","".concat(100*e,"%")),"played"===t&&(O(c,"width","".concat(100*e,"%")),O(s,"left","calc(".concat(100*e,"% - ").concat(j(s,"width")/2,"px)")))}n.forEach((function(t){var e=et(t.time,0,a.duration)/a.duration*100;x(l,''))})),p("loaded",a.loaded),e.on("video:progress",(function(){p("loaded",a.loaded)})),e.on("video:timeupdate",(function(){p("played",a.played)})),e.on("video:ended",(function(){p("played",1)})),i(t,"mousemove",(function(r){O(u,"display","block"),D(r,l)?function(r){var n=Ht(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?O(u,"left",0):n>t.clientWidth-i/2?O(u,"left","".concat(t.clientWidth-i,"px")):O(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ht(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?O(u,"left",0):o>t.clientWidth-a/2?O(u,"left","".concat(t.clientWidth-a,"px")):O(u,"left","".concat(o-a/2,"px"))}(r)})),i(t,"mouseout",(function(){O(u,"display","none")})),i(t,"click",(function(t){if(t.target!==s){var r=Ht(e,t),n=r.second;p("played",r.percentage),a.seek=n}})),i(s,"mousedown",(function(){r=!0})),i(document,"mousemove",(function(t){if(r){var n=Ht(e,t),o=n.second,i=n.percentage;g(s,"art-show-indicator"),p("played",i),a.seek=o}})),i(document,"mouseup",(function(){r&&(r=!1,m(s,"art-show-indicator"))}))}})}}function Ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;en.clientWidth-l/2?O(t,"left","".concat(n.clientWidth-l,"px")):O(t,"left","".concat(i-l/2,"px"))}(o))})),i(n,"mouseout",(function(){O(t,"display","none")}))}})}}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Gt(t){for(var e=1;e'),o=x(t,'');e.on("loop",(function(e){e?(O(t,"display","block"),O(n,"left","calc(".concat(e[0]/r.duration*100,"% - ").concat(n.clientWidth,"px)")),O(o,"left","".concat(e[1]/r.duration*100,"%"))):O(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),r.add(function(t){return function(e){return Lt(Lt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player,a=x(t,n.play),c=x(t,n.pause);function l(){O(a,"display","flex"),O(c,"display","none")}function s(){O(a,"display","none"),O(c,"display","flex")}R(a,o.get("Play")),R(c,o.get("Pause")),r(a,"click",(function(){i.play=!0})),r(c,"click",(function(){i.pause=!0})),i.playing?s():l(),e.on("video:playing",(function(){s()})),e.on("video:pause",(function(){l()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),r.add(function(t){return function(e){return Ut(Ut({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player,i=e.i18n,a=!1,c=x(t,n.volume),l=x(t,n.volumeClose),s=x(t,'
'),u=x(s,'
');function p(t){var e=s.getBoundingClientRect().left;return et(t.pageX-e-6,0,54)/48}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)O(c,"display","none"),O(l,"display","flex"),O(u,"left","0");else{var e=48*t;O(c,"display","flex"),O(l,"display","none"),O(u,"left","".concat(e,"px"))}}R(c,i.get("Mute")),O(l,"display","none"),e.isMobile&&O(s,"display","none"),f(o.volume),e.on("video:volumechange",(function(){f(o.volume)})),r(c,"click",(function(){o.muted=!0})),r(l,"click",(function(){o.muted=!1})),r(s,"click",(function(t){o.muted=!1,o.volume=p(t)})),r(u,"mousedown",(function(){a=!0})),r(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=p(t))})),r(document,"mouseup",(function(){a&&(a=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),r.add(function(t){return function(e){return Bt(Bt({},t),{},{mounted:function(t){function r(){var r="".concat(rt(e.player.currentTime)," / ").concat(rt(e.player.duration));r!==t.innerText&&(t.innerText=r)}r(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,r)}))}})}}({name:"time",disable:i.isLive,position:"left",index:30})),r.add(function(t){return function(e){var r=e.option.quality,n=r.find((function(t){return t.default}))||r[0];return te(te({},t),{},{html:n?n.name:"",selector:r,onSelect:function(t){e.player.switchQuality(t.url,t.name)}})}}({name:"quality",disable:0===i.quality.length,position:"right",index:10})),r.add(function(t){return function(e){return Gt(Gt({},t),{},{tooltip:e.i18n.get("Screenshot"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.player;x(t,n.screenshot),r(t,"click",(function(){o.screenshot()}))}})}}({name:"screenshot",disable:!i.screenshot,position:"right",index:20})),r.add(function(t){return function(e){return It(It({},t),{},{tooltip:e.i18n.get("Hide subtitle"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.subtitle;x(t,n.subtitle),r(t,"click",(function(){i.toggle=!0})),e.on("subtitle",(function(e){R(t,o.get(e?"Hide subtitle":"Show subtitle"))}))}})}}({name:"subtitle",disable:!i.subtitle.url,position:"right",index:30})),r.add(function(t){return function(e){return Xt(Xt({},t),{},{tooltip:e.i18n.get("Show setting"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.setting;x(t,n.setting),r(t,"click",(function(){i.toggle=!0})),e.on("setting",(function(e){R(t,o.get(e?"Hide setting":"Show setting"))}))}})}}({name:"setting",disable:!i.setting,position:"right",index:40})),r.add(function(t){return function(e){return At(At({},t),{},{tooltip:e.i18n.get("PIP mode"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.pip),r(t,"click",(function(){i.pipToggle=!0})),e.on("pip",(function(e){R(t,o.get(e?"Exit PIP mode":"PIP mode"))}))}})}}({name:"pip",disable:!i.pip,position:"right",index:50})),r.add(function(t){return function(e){return Tt(Tt({},t),{},{tooltip:e.i18n.get("Web fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreenWeb),r(t,"click",(function(){i.fullscreenWebToggle=!0})),e.on("fullscreenWeb",(function(e){R(t,o.get(e?"Exit web fullscreen":"Web fullscreen"))}))}})}}({name:"fullscreenWeb",disable:!i.fullscreenWeb,position:"right",index:60})),r.add(function(t){return function(e){return Dt(Dt({},t),{},{tooltip:e.i18n.get("Fullscreen"),mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=e.player;x(t,n.fullscreen),r(t,"click",(function(){i.fullscreenToggle=!0})),e.on("fullscreen",(function(e){R(t,o.get(e?"Exit fullscreen":"Fullscreen"))}))}})}}({name:"fullscreen",disable:!i.fullscreen,position:"right",index:70})),i.controls.forEach((function(t){r.add(t)}))})),r}return r(o,[{key:"add",value:function(t){var e="function"==typeof t?t(this.art):t,r=this.art.template,n=r.$progress,i=r.$controlsLeft,a=r.$controlsRight;switch(e.position){case"top":this.$parent=n;break;case"left":this.$parent=i;break;case"right":this.$parent=a;break;default:L(!1,"Control option.position must one of 'top', 'left', 'right'")}St(s(o.prototype),"add",this).call(this,e)}}]),o}(Rt);function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ae(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var r=e.target.dataset.rate;r&&(n.playbackRate=Number(r),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=v("span",t).find((function(t){return Number(t.dataset.rate)===e}));r&&S(r,"art-current")}))}})}}({disable:!i.playbackRate,name:"playbackRate",index:10})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return le(le({},t),{},{html:"".concat(r.get("Aspect ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,e){var r=e.target.dataset.ratio;r&&(n.aspectRatio=r,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("span",t).find((function(t){return t.dataset.ratio===e}));r&&S(r,"art-current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio",index:20})),o.add(function(t){return function(e){return ue(ue({},t),{},{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),o.add(function(t){return fe(fe({},t),{},{html:'ArtPlayer 3.5.15'})}({disable:!1,name:"version",index:40})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return he(he({},t),{},{html:r.get("Light Off"),click:function(t){n.light=!n.light,t.show=!1},mounted:function(t){e.on("light",(function(e){t.innerText=r.get(e?"Light On":"Light Off")}))}})}}({disable:!i.light,name:"light",index:50})),o.add(function(t){return function(e){return be(be({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60})),i.contextmenu.forEach((function(t){o.add(t)})),s(c,"contextmenu",(function(t){t.preventDefault(),o.show=!0;var e=t.clientX,r=t.clientY,n=c.getBoundingClientRect(),i=n.height,a=n.width,s=n.left,u=n.top,p=l.getBoundingClientRect(),f=p.height,d=p.width,h=e-s,y=r-u;e+d>s+a&&(h=a-d),r+f>u+i&&(y=i-f),k(l,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),s(c,"click",(function(t){D(t,l)||(o.show=!1)})),e.on("blur",(function(){o.show=!1}))})),o}return n}(Rt);function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var we=function(e){a(n,e);var r=me(n);function n(e){var o;t(this,n),(o=r.call(this,e)).name="info";var i=e.template,a=i.$infoPanel,c=i.$infoClose,l=i.$video;(0,e.events.proxy)(c,"click",(function(){o.show=!1}));var s=null,u=v("[data-video]",a);return e.on("destroy",(function(){clearTimeout(s)})),e.on("info",(function(t){clearTimeout(s),t&&function t(){u.forEach((function(t){var e=l[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){t()}),1e3)}()})),o}return n}(Rt);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Oe=function(e){a(o,e);var n=xe(o);function o(e){var r;t(this,o),(r=n.call(this,e)).name="subtitle";var i=e.option.subtitle,a=e.template.$subtitle;return k(a,i.style),i.url&&r.init(i.url),i.bilingual&&g(a,"art-bilingual"),r}return r(o,[{key:"style",value:function(t,e){var r=this.art.template.$subtitle;return"object"===c(t)?k(r,t):O(r,t,e)}},{key:"update",value:function(){var t=this.art.template.$subtitle;t.innerHTML="",this.activeCue&&(t.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(t){return"

".concat(nt(t),"

")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.i18n,i=n.notice;return this.init(t,r).then((function(t){return r.name&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(r.name)),e.art.emit("subtitleSwitch",t),t}))}},{key:"init",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.art,o=n.notice,i=n.events.proxy,a=n.option.subtitle,c=n.template,l=c.$subtitle,s=c.$video,u=c.$track;if(!u){var p=document.createElement("track");p.default=!0,p.kind="metadata",s.appendChild(p),this.art.template.$track=p,i(this.textTrack,"cuechange",this.update.bind(this))}return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(n){var o=new TextDecoder(r.encoding||a.encoding).decode(n);switch(e.art.emit("subtitleLoad",t),r.ext||W(t)){case"srt":return q(M(o));case"ass":return q(H(o));case"vtt":return q(o);default:return t}})).then((function(t){return l.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t),t})).catch((function(t){throw o.show=t,t}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"bilingual",get:function(){return w(this.art.template.$subtitle,"art-bilingual")},set:function(t){var e=this.art.template.$subtitle;t?g(e,"art-bilingual"):m(e,"art-bilingual")}}]),o}(Rt);var ke=function(){function e(r){var n=this;t(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.controls,n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){D(e,n)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))})),t.on("blur",(function(){r.delayHide()}))}(r,n),function(t,e){var r=t.controls,n=t.template.$player;e.hover(n,(function(){g(n,"art-hover"),t.emit("hover",!0)}),(function(){m(n,"art-hover"),t.emit("hover")})),t.on("hover",(function(t){t||r.delayHide()}))}(r,n),function(t,e){var r=t.template,n=r.$player,o=r.$video,i=t.player,a=t.controls;e.proxy(n,"mousemove",(function(e){t.emit("mousemove",e)})),t.on("mousemove",(function(t){a.cancelDelayHide(),m(n,"art-hide-cursor"),a.show=!0,i.pip||t.target!==o||a.delayHide()}))}(r,n),function(t,e){var r=t.option,n=t.player,o=tt((function(){n.normalSize&&(n.autoSize=r.autoSize),n.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){o()}))}(r,n),function(t,e){if(t.isMobile&&!t.option.isLive){var r=t.player,n=t.notice,o=t.template.$video,i=!1,a=0,c=0;e.proxy(o,"touchstart",(function(t){1===t.touches.length&&(i=!0,a=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(t){if(1===t.touches.length&&i){var e=et((t.touches[0].clientX-a)/o.clientWidth,-1,1);c=et(r.currentTime+60*e,0,r.duration),n.show="".concat(rt(c)," / ").concat(rt(r.duration))}})),e.proxy(document,"touchend",(function(){i&&c&&(r.seek=c),i=!1,a=0,c=0}))}}(r,n),function(t,e){var r=t.player,n=t.option.autoMini,o=t.template.$container,i=K((function(){t.emit("view",E(o))}),200);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(t){n&&(r.mini=!t)}))}(r,n)}))}return r(e,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(t);(o=new Image).src=t}return o.complete?r(o):(e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),e}(),je=function(){function e(r){var n=this;t(this,e),this.keys={};var o=r.option,i=r.player,a=r.events.proxy;o.hotkey&&r.once("ready",(function(){n.add(27,(function(){i.fullscreenWeb&&(i.fullscreenWeb=!1)})),n.add(32,(function(){i.toggle=!0})),n.add(37,(function(){i.backward=5})),n.add(38,(function(){i.volume+=.1})),n.add(39,(function(){i.forward=5})),n.add(40,(function(){i.volume-=.1})),a(window,"keydown",(function(t){if(r.isFocus){var e=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t.call(r)})),r.emit("hotkey",t))}}}))}))}return r(e,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}}]),e}();function Pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Se=function(e){a(n,e);var r=Pe(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="layer",o.$parent=e.template.$layer,e.once("ready",(function(){e.option.layers.forEach((function(t){o.add(t)}))})),o}return n}(Rt);function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Ee=function(e){a(n,e);var r=Re(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="loading",x(e.template.$loading,e.icons.loading),o}return n}(Rt),De=function(){function e(r){t(this,e),this.art=r,this.time=2e3,this.timer=null}return r(e,[{key:"show",set:function(t){var e=this.art.template,r=e.$player,n=e.$noticeInner;n.innerText=t instanceof Error?t.message.trim():t,g(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){n.innerText="",m(r,"art-notice-show")}),this.time)}}]),e}();function $e(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var Te=function(e){a(n,e);var r=$e(n);function n(e){var o;return t(this,n),(o=r.call(this,e)).name="mask",x(e.template.$state,e.icons.state),o}return n}(Rt);function ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Ae=function e(r){var n=this;t(this,e);var o=function(t){for(var e=1;e',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\t',setting:'',fullscreen:'\t\t\t\t',fullscreenWeb:'\t',pip:''},r.option.icons);Object.keys(o).forEach((function(t){X(n,t,{get:function(){var e=document.createElement("i");return g(e,"art-icon"),g(e,"art-icon-".concat(t)),x(e,o[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var r=e.target.dataset.value;r&&(n.flip=r)},mounted:function(t){e.on("flip",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.flip,name:"flip"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return qe(qe({},t),{},{html:'
'.concat(r.get("Rotate"),': 0°
'),click:function(t,e){var r=e.target.dataset.value;if(r){var o=n.rotate+Number(r);n.rotate=360===o||-360===o?0:o}else n.rotate=0},mounted:function(t){var r=b(".art-rotate-value",t);e.on("rotate",(function(t){r.innerText="".concat(t||0,"°")}))}})}}({disable:!i.rotate,name:"rotate"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player;return We(We({},t),{},{html:'
'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var r=e.target.dataset.value;r&&(n.aspectRatio=r)},mounted:function(t){e.on("aspectRatio",(function(e){var r=v("button",t).find((function(t){return t.dataset.value===e}));r&&S(r.parentElement,"current")}))}})}}({disable:!i.aspectRatio,name:"aspectRatio"})),o.add(function(t){return function(e){var r=e.i18n,n=e.player,o=e.events.proxy;return Ie(Ie({},t),{},{html:'
'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var r=b(".art-setting-range input",t),i=b(".art-subtitle-value",t);o(r,"change",(function(){var t=r.value;i.innerText=t,n.playbackRate=Number(t)})),e.on("playbackRate",(function(t){t&&r.value!==t&&(r.value=t,i.innerText=t)}))}})}}({disable:!i.playbackRate,name:"playbackRate"}))})),e.on("blur",(function(){o.show=!1}))),o}return n}(Rt),Ne=function(){function e(){t(this,e),this.name="artplayer_settings"}return r(e,[{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.name))||{};return t?e[t]:e}},{key:"set",value:function(t,e){var r=Object.assign({},this.get(),it({},t,e));localStorage.setItem(this.name,JSON.stringify(r))}},{key:"del",value:function(t){var e=this.get();delete e[t],localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),e}();function Ue(t){var e=t.i18n,r=t.subtitle,n=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=b(".art-setting-range input",e),i=b(".art-subtitle-value",e);n(o,"change",(function(){var e=o.value;i.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),t.on("subtitleOffset",(function(t){r.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function _e(t){var e=t.constructor.utils.clamp,r=t.setting,n=t.notice,o=t.template,i=t.i18n,a=t.player;r.add(Ue);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(r){if(o.$track&&o.$track.track){var l=Array.from(o.$track.track.cues),s=e(r,-5,5);l.forEach((function(t,r){c[r]||(c[r]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[r].startTime+s,0,a.duration),t.endTime=e(c[r].endTime+s,0,a.duration)})),n.show="".concat(i.get("Subtitle offset time"),": ").concat(r,"s"),t.emit("subtitleOffset",r)}else n.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function Xe(t){var e=t.events.proxy,r=t.template,n=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=r.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,n.switchUrl(a,e.name),t.emit("localVideo",e)}else L(!1,"Playback of this file format is not supported")}}function l(t){var r=x(t,'');O(t,"position","relative"),k(r,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(r,"change",(function(){c(r.files[0])}))}return e(r.$player,"dragover",(function(t){t.preventDefault()})),e(r.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.once("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'
'.concat(a.get("Local Video"),'
').concat(a.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localVideo",(function(t){n.textContent=t.name,n.title=t.name})),l(r)}})})),{name:"localVideo",attach:l}}function Ye(t){var e=t.events.proxy,r=t.subtitle,n=t.setting,o=t.i18n;function i(n){var o=x(n,'');O(n,"position","relative"),k(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var n=W(e.name);["ass","vtt","srt"].includes(n)?(r.switch(URL.createObjectURL(e),{name:e.name,ext:n}),t.emit("localSubtitle",e)):L(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.once("ready",(function(){n.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var r=b(".art-upload-btn",e),n=b(".art-upload-value",e);t.on("localSubtitle",(function(t){n.textContent=t.name,n.title=t.name})),i(r)}})})),{name:"localSubtitle",attach:i}}function Ze(t){var e=t.layers,r=t.player,n=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:n},mounted:function(e){t.on("control",(function(t){e.style.display=t?"none":"block"})),t.on("destroy",(function(){e.style.display="none"})),t.on("video:timeupdate",(function(){e.style.width="".concat(100*r.played,"%")}))}}),{name:"miniProgressBar"}}function Je(t){var e=1e4,r=0,n=0,o=0,i=null;function a(){r=0,n=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){t.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;n+=c,t.player.playing||(r+=c)}o=i,t.emit("networkMonitor",r/n),n>=e&&(r=0,n=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var Qe=function(){function e(r){var n=this;t(this,e),this.art=r,this.id=0;var o=r.option;o.subtitle.url&&o.subtitleOffset&&this.add(_e),!o.isLive&&o.miniProgressBar&&this.add(Ze),o.localVideo&&this.add(Xe),o.localSubtitle&&this.add(Ye),o.networkMonitor&&this.add(Je),r.option.plugins.forEach((function(t){n.add(t)}))}return r(e,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),r=e&&e.name||t.name||"plugin".concat(this.id);return L(!Z(this,r),"Cannot add a plugin that already has the same name: ".concat(r)),X(this,r,{value:e}),this}}]),e}(),Ge=function e(r){t(this,e);var n=r.option,o=r.events.proxy,i=r.template.$video;bt.events.forEach((function(t){o(i,t,(function(t){r.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){i[t]=n.moreVideoAttr[t]})),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=et(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var a=n.type||W(n.url),c=n.customType[a];a&&c?(c(i,n.url,r),r.emit("customType",a)):(i.src=n.url,r.emit("url",i.src))};function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l(this,r)}}var tr=0,er=[],rr=function(e){a(i,e);var o=Ke(i);function i(e){var r;return t(this,i),(r=o.call(this)).option=u(Q(i.option,e),yt),r.isFocus=!1,r.isDestroy=!1,r.userAgent=f,r.isMobile=d,r.isWechat=y,r.whitelist=new vt(n(r)),r.template=new gt(n(r)),r.events=new ke(n(r)),r.whitelist.state?(r.storage=new Ne(n(r)),r.icons=new Ae(n(r)),r.i18n=new xt(n(r)),r.notice=new De(n(r)),r.player=new jt(n(r)),r.layers=new Se(n(r)),r.controls=new oe(n(r)),r.contextmenu=new ge(n(r)),r.subtitle=new Oe(n(r)),r.info=new we(n(r)),r.loading=new Ee(n(r)),r.hotkey=new je(n(r)),r.mask=new Te(n(r)),r.setting=new Be(n(r)),r.plugins=new Qe(n(r))):r.mobile=new Ge(n(r)),tr+=1,r.id=tr,er.push(n(r)),r}return r(i,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),er.splice(er.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return er}},{key:"version",get:function(){return"3.5.15"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return bt}},{key:"utils",get:function(){return ot}},{key:"scheme",get:function(){return yt}},{key:"Emitter",get:function(){return p}},{key:"validator",get:function(){return u}},{key:"kindOf",get:function(){return u.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,rotate:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,light:!1,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,networkMonitor:!1,layers:[],contextmenu:[],controls:[],quality:[],highlight:[],plugins:[],whitelist:[],switcher:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{},encoding:"utf-8",bilingual:!1},moreVideoAttr:{controls:!1,preload:h?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),i}(p);return console.log("%c ArtPlayer %c 3.5.15 %c https://artplayer.org","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),rr})); diff --git a/packages/artplayer/src/style/subtitle.scss b/packages/artplayer/src/style/subtitle.scss index 2f4abf6d9..b67506dd1 100644 --- a/packages/artplayer/src/style/subtitle.scss +++ b/packages/artplayer/src/style/subtitle.scss @@ -21,7 +21,7 @@ } .art-bilingual { - p:nth-child(2) { + p:nth-child(n+2) { font-size: 0.6em; } } diff --git a/packages/artplayer/src/subtitle.js b/packages/artplayer/src/subtitle.js index e6225ab33..75ec13fb5 100644 --- a/packages/artplayer/src/subtitle.js +++ b/packages/artplayer/src/subtitle.js @@ -1,4 +1,15 @@ -import { setStyle, setStyles, srtToVtt, vttToBlob, getExt, assToVtt, addClass, escape } from './utils'; +import { + setStyle, + setStyles, + srtToVtt, + vttToBlob, + getExt, + assToVtt, + addClass, + escape, + removeClass, + hasClass, +} from './utils'; import Component from './utils/component'; export default class Subtitle extends Component { @@ -35,6 +46,20 @@ export default class Subtitle extends Component { return this.textTrack.activeCues[0]; } + get bilingual() { + const { $subtitle } = this.art.template; + return hasClass($subtitle, 'art-bilingual'); + } + + set bilingual(val) { + const { $subtitle } = this.art.template; + if (val) { + addClass($subtitle, 'art-bilingual'); + } else { + removeClass($subtitle, 'art-bilingual'); + } + } + style(key, value) { const { $subtitle } = this.art.template; if (typeof key === 'object') {