/*! * artplayer-react.js v3.5.1 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2020 Harvey Zack * 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=t||self).ArtplayerReact=e()}(this,(function(){"use strict";var t=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r=0||(o[n]=t[n]);return o};var e=function(e,n){if(null==e)return{};var r,o,i=t(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i};var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(r){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=n=function(t){return e(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},n(r)}t.exports=n}));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 n=0;nY.length&&Y.push(t)}function Z(t,e,n){return null==t?0:function t(e,n,r,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 r(o,e,""===n?"."+Q(e,0):n),1;if(a=0,n=""===n?".":n+":",Array.isArray(e))for(var c=0;c1?e-1:0),r=1;r2?n-2:0),o=2;o2?n-2:0),o=2;o8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!t){if("undefined"!=typeof console){var i=r.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 r[a++]}));throw new Error(c)}catch(t){}}},E={};function C(t,e){var n=t.constructor,r=n&&(n.displayName||n.name)||"ReactClass",o=r+"."+e;E[o]||(S(!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,r),E[o]=!0)}var R={isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,n){C(t,"forceUpdate")},enqueueReplaceState:function(t,e,n,r){C(t,"replaceState")},enqueueSetState:function(t,e,n,r){C(t,"setState")}},$={};function D(t,e,n){this.props=t,this.context=e,this.refs=$,this.updater=n||R}Object.freeze($),D.prototype.isReactComponent={},D.prototype.setState=function(t,e){!function(){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw k(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")},D.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var T={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)."]},A=function(t,e){Object.defineProperty(D.prototype,t,{get:function(){P(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})};for(var _ in T)T.hasOwnProperty(_)&&A(_,T[_]);function z(){}function L(t,e,n){this.props=t,this.context=e,this.refs=$,this.updater=n||R}z.prototype=D.prototype;var q=L.prototype=new z;q.constructor=L,e(q,D.prototype),q.isPureReactComponent=!0;var M={current:null},F={suspense:null},I={current:null},N=/^(.*)[\\\/]/,V=1;function W(t){if(null==t)return null;if("number"==typeof t.tag&&S(!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 s:return"Profiler";case c:return"StrictMode";case d:return"Suspense";case h:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case u:return"Context.Consumer";case l:return"Context.Provider";case f:return r=t,o=t.render,p="ForwardRef",b=o.displayName||o.name||"",r.displayName||(""!==b?p+"("+b+")":p);case y:return W(t.type);case v:var e=(n=t)._status===V?n._result:null;if(e)return W(e)}var n,r,o,p,b;return null}var B={},U=null;function H(t){U=t}B.getCurrentStack=null,B.getStackAddendum=function(){var t="";if(U){var e=W(U.type),n=U._owner;t+=function(t,e,n){var r="";if(e){var o=e.fileName,i=o.replace(N,"");if(/^index\./.test(i)){var a=o.match(N);if(a){var c=a[1];if(c)i=c.replace(N,"")+"/"+i}}r=" (at "+i+":"+e.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(t||"Unknown")+r}(e,U._source,n&&W(n.type))}var r=B.getCurrentStack;return r&&(t+=r()||""),t};var Y={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:F,ReactCurrentOwner:I,IsSomeRendererActing:{current:!1},assign:e};e(Y,{ReactDebugCurrentFrame:B,ReactComponentTreeHook:{}});var J=function(t,e){if(!t){for(var n=Y.ReactDebugCurrentFrame,r=n.getStackAddendum(),o=arguments.length,i=Array(o>2?o-2:0),a=2;a1){for(var u=Array(l),p=0;p1){for(var d=Array(f),h=0;h.")}return e}(e);if(!jt[n]){jt[n]=!0;var r="";t&&t._owner&&t._owner!==I.current&&(r=" It was passed a child from "+W(t._owner.type)+"."),H(t),J(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),H(null)}}}function St(t,e){if("object"==typeof t)if(Array.isArray(t))for(var n=0;n",s=" Did you accidentally export a JSX literal instead of a component?"):u=typeof t,J(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,s)}var p=nt.apply(this,arguments);if(null==p)return p;if(c)for(var f=2;f is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(t){n.Provider=t}},_currentValue:{get:function(){return n._currentValue},set:function(t){n._currentValue=t}},_currentValue2:{get:function(){return n._currentValue2},set:function(t){n._currentValue2=t}},_threadCount:{get:function(){return n._threadCount},set:function(t){n._threadCount=t}},Consumer:{get:function(){return r||(r=!0,J(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=i,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(t){return null!=t&&t.$$typeof===y?S(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof t?S(!1,"forwardRef requires a render function but was given %s.",null===t?"null":typeof t):0!==t.length&&2!==t.length&&S(!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)&&S(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:f,render:t}},lazy:function(t){var e={$$typeof:v,_ctor:t,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(e,{defaultProps:{configurable:!0,get:function(){return n},set:function(t){J(!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."),n=t,Object.defineProperty(e,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(t){J(!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(e,"propTypes",{enumerable:!0})}}}),e},memo:function(t,e){return wt(t)||S(!1,"memo: The first argument must be a component. Instead received: %s",null===t?"null":typeof t),{$$typeof:y,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return xt().useCallback(t,e)},useContext:function(t,e){var n=xt();if(void 0!==e&&J(!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 r=t._context;r.Consumer===t?J(!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?"):r.Provider===t&&J(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(t,e)},useEffect:function(t,e){return xt().useEffect(t,e)},useImperativeHandle:function(t,e,n){return xt().useImperativeHandle(t,e,n)},useDebugValue:function(t,e){return xt().useDebugValue(t,e)},useLayoutEffect:function(t,e){return xt().useLayoutEffect(t,e)},useMemo:function(t,e){return xt().useMemo(t,e)},useReducer:function(t,e,n){return xt().useReducer(t,e,n)},useRef:function(t){return xt().useRef(t)},useState:function(t){return xt().useState(t)},Fragment:a,Profiler:s,StrictMode:c,Suspense:d,unstable_SuspenseList:h,createElement:Ct,cloneElement:function(t,e,n){for(var r=rt.apply(this,arguments),o=2;oobject{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");ht(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");ht(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");ht(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");ht(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");ht(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute}.art-video-player .art-mask .art-state{right:30px;bottom:55px;width:60px;height:60px;opacity:.6}.art-video-player.art-mask-show .art-mask,.art-video-player .art-mask .art-state{display:-webkit-box;display:-ms-flexbox;display:flex}");ht(".art-video-player .art-loading{display:none;position:absolute;z-index:70;left:0;top:0;right:0;bottom:0;width:100%;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;pointer-events:none}.art-video-player.art-loading-show .art-loading{display:-webkit-box;display:-ms-flexbox;display:flex}");ht('.art-video-player .art-bottom{position:absolute;z-index:60;left:0;right:0;bottom:0;height:100px;padding:55px 10px 0;opacity:0;visibility:hidden;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;pointer-events:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.art-video-player .art-bottom .art-progress{position:relative;pointer-events:auto}.art-video-player .art-bottom .art-progress .art-control-progress{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:4px;cursor:pointer}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner{position:relative;height:50%;width:100%;background:hsla(0,0%,100%,.2)}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-loaded{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:0;background:hsla(0,0%,100%,.4)}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-played{position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;height:100%;width:0}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-highlight{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;height:100%;pointer-events:none}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-highlight span{display:inline-block;position:absolute;left:0;top:0;width:7px;height:100%;background:#fff;pointer-events:auto}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{display:none;position:absolute;z-index:40;top:-5px;left:-6.5px;width:13px;height:13px;border-radius:50%}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-indicator.art-show-indicator{display:block}.art-video-player .art-bottom .art-progress .art-control-progress .art-control-progress-inner .art-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700;white-space:nowrap}.art-video-player .art-bottom .art-progress .art-control-progress:hover .art-control-progress-inner{height:100%}.art-video-player .art-bottom .art-progress .art-control-progress:hover .art-control-progress-inner .art-progress-indicator,.art-video-player .art-bottom .art-progress .art-control-progress:hover .art-control-progress-inner .art-progress-tip{display:block}.art-video-player .art-bottom .art-progress .art-control-thumbnails{display:none;position:absolute;bottom:8px;left:0;pointer-events:none;background-color:rgba(0,0,0,.7)}.art-video-player .art-bottom .art-controls{position:relative;pointer-events:auto;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:40px;padding:5px 0}.art-video-player .art-bottom .art-controls,.art-video-player .art-bottom .art-controls .art-controls-left,.art-video-player .art-bottom .art-controls .art-controls-right{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-bottom .art-controls .art-control{opacity:.9;font-size:12px;height:36px;min-width:36px;line-height:36px;text-align:center;cursor:pointer}.art-video-player .art-bottom .art-controls .art-control .art-icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;float:left;height:36px;width:36px}.art-video-player .art-bottom .art-controls .art-control:hover{opacity:1}.art-video-player .art-bottom .art-controls .art-control-onlyText{padding:0 10px}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel{position:relative;float:left;width:0;height:100%;-webkit-transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);overflow:hidden}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle{position:absolute;top:50%;left:0;width:12px;height:12px;border-radius:12px;margin-top:-6px;background:#fff}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{left:-54px;background:#fff}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after{left:6px;background:hsla(0,0%,100%,.2)}.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after,.art-video-player .art-bottom .art-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{content:"";position:absolute;display:block;top:50%;height:3px;margin-top:-2px;width:60px}.art-video-player .art-bottom .art-controls .art-control-volume:hover .art-volume-panel{width:60px}.art-video-player .art-bottom .art-controls .art-control-quality{position:relative;z-index:30}.art-video-player .art-bottom .art-controls .art-control-quality .art-qualitys{display:none;position:absolute;bottom:35px;width:100px;padding:5px 0;text-align:center;color:#fff;background:rgba(0,0,0,.8);border-radius:3px}.art-video-player .art-bottom .art-controls .art-control-quality .art-qualitys .art-quality-item{height:30px;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5)}.art-video-player .art-bottom .art-controls .art-control-quality .art-qualitys .art-quality-item:hover{background-color:hsla(0,0%,100%,.1)}.art-video-player .art-bottom .art-controls .art-control-quality:hover .art-qualitys{display:block}.art-video-player.art-control-show .art-bottom,.art-video-player.art-hover .art-bottom{opacity:1;visibility:visible}.art-video-player.art-destroy .art-progress-indicator,.art-video-player.art-destroy .art-progress-tip,.art-video-player.art-error .art-progress-indicator,.art-video-player.art-error .art-progress-tip{display:none!important}');ht(".art-video-player .art-notice{display:none;font-size:14px;position:absolute;z-index:80;left:0;top:0;padding:10px;width:100%;pointer-events:none}.art-video-player .art-notice .art-notice-inner{display:inline-block;padding:5px 10px;color:#fff;background:rgba(0,0,0,.6);border-radius:3px}.art-video-player.art-notice-show .art-notice{display:-webkit-box;display:-ms-flexbox;display:flex}");ht(".art-video-player .art-contextmenus{display:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;z-index:120;left:0;top:0;min-width:200px;padding:5px 0;background:rgba(0,0,0,.9);border-radius:3px}.art-video-player .art-contextmenus .art-contextmenu{cursor:pointer;font-size:12px;display:block;color:#fff;padding:10px 15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu a{color:#fff;text-decoration:none}.art-video-player .art-contextmenus .art-contextmenu span{display:inline-block;padding:0 7px}.art-video-player .art-contextmenus .art-contextmenu span.art-current,.art-video-player .art-contextmenus .art-contextmenu span:hover{color:#00c9ff}.art-video-player .art-contextmenus .art-contextmenu:hover{background-color:hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu:last-child{border-bottom:none}.art-video-player.art-contextmenu-show .art-contextmenus{display:-webkit-box;display:-ms-flexbox;display:flex}");ht(".art-video-player .art-settings{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;z-index:90;left:0;top:0;height:100%;width:100%;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden}.art-video-player .art-settings .art-setting-inner{position:absolute;top:0;right:-300px;bottom:0;width:300px;height:100%;font-size:12px;background:rgba(0,0,0,.9);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;overflow:auto}.art-video-player .art-settings .art-setting-inner .art-setting-body{overflow-y:auto;width:100%;height:100%}.art-video-player .art-settings .art-setting-inner .art-setting-body .art-setting{border-bottom:1px solid hsla(0,0%,100%,.1);padding:10px 15px}.art-video-player .art-settings .art-setting-inner .art-setting-body .art-setting .art-setting-header{margin-bottom:5px}.art-video-player .art-settings .art-setting-radio{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-settings .art-setting-radio .art-radio-item{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 2px}.art-video-player .art-settings .art-setting-radio .art-radio-item button{height:22px;width:100%;border:none;outline:none;color:#fff;background:hsla(0,0%,100%,.2);border-radius:2px}.art-video-player .art-settings .art-setting-radio .art-radio-item.current button{background-color:#00a1d6}.art-video-player .art-settings .art-setting-range input{width:100%;height:3px;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:hsla(0,0%,100%,.5)}.art-video-player .art-settings .art-setting-checkbox input{height:14px;width:14px;margin-right:5px}.art-video-player .art-settings .art-setting-upload{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-settings .art-setting-upload .art-upload-btn{width:80px;height:22px;line-height:22px;border:none;outline:none;color:#fff;background:hsla(0,0%,100%,.2);border-radius:2px;text-align:center}.art-video-player .art-settings .art-setting-upload .art-upload-value{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:22px;line-height:22px;padding-left:10px}.art-video-player.art-setting-show .art-settings{opacity:1;visibility:visible;pointer-events:auto}.art-video-player.art-setting-show .art-settings .art-setting-inner{right:0}");ht(".art-video-player .art-info{display:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;left:10px;top:10px;z-index:100;width:350px;min-height:150px;padding:10px;color:#fff;font-size:12px;font-family:Noto Sans CJK SC DemiLight,Roboto,Segoe UI,Tahoma,Arial,Helvetica,sans-serif;-webkit-font-smoothing:antialiased;background:rgba(0,0,0,.9)}.art-video-player .art-info .art-info-item{display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:5px}.art-video-player .art-info .art-info-item .art-info-title{width:100px;text-align:right}.art-video-player .art-info .art-info-item .art-info-content{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:5px}.art-video-player .art-info .art-info-close{position:absolute;top:5px;right:5px;cursor:pointer}.art-video-player.art-info-show .art-info{display:-webkit-box;display:-ms-flexbox;display:flex}");ht(".art-video-player.art-hide-cursor *{cursor:none!important}");ht(".art-video-player[data-aspect-ratio] video{-webkit-box-sizing:content-box;box-sizing:content-box;-o-object-fit:fill;object-fit:fill}");ht(".art-video-player.art-web-fullscreen{position:fixed;z-index:9999;width:100%;height:100%;left:0;top:0;right:0;bottom:0}");ht(".art-video-player .art-pip-header{display:none;position:absolute;z-index:110;left:0;top:0;right:0;height:35px;line-height:35px;color:#fff;background:rgba(0,0,0,.5);-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;opacity:0;visibility:hidden;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.art-video-player .art-pip-header .art-pip-title{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:move}.art-video-player .art-pip-header .art-pip-close{width:35px;text-align:center;font-size:22px;cursor:pointer}.art-video-player.art-is-dragging{opacity:.7}.art-video-player.art-pip{position:fixed;z-index:9999;width:400px;height:225px;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.2);box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.2)}.art-video-player.art-pip .art-pip-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.art-video-player.art-pip.art-hover .art-pip-header{opacity:1;visibility:visible}.art-video-player.art-pip .art-mask .art-state{position:static}.art-video-player.art-pip .art-bottom,.art-video-player.art-pip .art-contextmenu,.art-video-player.art-pip .art-danmu,.art-video-player.art-pip .art-info,.art-video-player.art-pip .art-layers,.art-video-player.art-pip .art-notice,.art-video-player.art-pip .art-setting,.art-video-player.art-pip .art-subtitle{display:none!important}");ht(".art-auto-size{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}");ht(".art-video-player[data-flip=horizontal] .art-video{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.art-video-player[data-flip=vertical] .art-video{-webkit-transform:scaleY(-1);transform:scaleY(-1)}");ht(':root{--balloon-color:rgba(16,16,16,0.95);--balloon-font-size:12px;--balloon-move:4px}button[aria-label][data-balloon-pos]{overflow:visible}[aria-label][data-balloon-pos]{position:relative;cursor:pointer}[aria-label][data-balloon-pos]:after{text-indent:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-weight:400;font-style:normal;text-shadow:none;font-size:var(--balloon-font-size);background:var(--balloon-color);border-radius:2px;color:#fff;content:attr(aria-label);padding:.5em 1em;white-space:nowrap;line-height:1.2}[aria-label][data-balloon-pos]:after,[aria-label][data-balloon-pos]:before{opacity:0;pointer-events:none;-webkit-transition:all .18s ease-out .18s;transition:all .18s ease-out .18s;position:absolute;z-index:10}[aria-label][data-balloon-pos]:before{width:0;height:0;border:5px solid transparent;border-top:5px solid var(--balloon-color);content:""}[aria-label][data-balloon-pos]:hover:after,[aria-label][data-balloon-pos]:hover:before{opacity:1;pointer-events:none}[aria-label][data-balloon-pos][data-balloon-pos=up]:after{margin-bottom:10px}[aria-label][data-balloon-pos][data-balloon-pos=up]:after,[aria-label][data-balloon-pos][data-balloon-pos=up]:before{bottom:100%;left:50%;-webkit-transform:translate(-50%,var(--balloon-move));transform:translate(-50%,var(--balloon-move));-webkit-transform-origin:top;transform-origin:top}[aria-label][data-balloon-pos][data-balloon-pos=up]:hover:after,[aria-label][data-balloon-pos][data-balloon-pos=up]:hover:before{-webkit-transform:translate(-50%);transform:translate(-50%)}');var yt=r((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,n=function(n){if(void 0===n)return"undefined";if(null===n)return"null";var o=t(n);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return function(t){return"GeneratorFunction"===r(t)}(n)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(n))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(n))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(t){if(-1!==t.message.indexOf("callee"))return!0}return!1}(n))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(n))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(n))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(n))return"regexp";switch(r(n)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(n))return"generator";switch(o=e.call(n)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function r(t){return t.constructor?t.constructor.name:null}function o(t,e){var r=21?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document).querySelector(t)}function mt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function gt(t,e){return t.classList.add(e)}function wt(t,e){return t.classList.remove(e)}function xt(t,e){return t.classList.contains(e)}function Ot(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function kt(t,e,n){return t.style[e]=n,t}function jt(t,e){return Object.keys(e).forEach((function(n){kt(t,n,e[n])})),t}function Pt(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=window.getComputedStyle(t,null).getPropertyValue(e);return n?parseFloat(r):r}function St(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function Et(t,e){St(t).forEach((function(t){return wt(t,e)})),gt(t,e)}function Ct(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",n)}var Rt=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},$t=r((function(t){function e(n,r,o){return!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.exports=e=function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&p(o,n.prototype),o}:t.exports=e=Reflect.construct,e.apply(null,arguments)}t.exports=e})),Dt=function(t){function e(t,n){var r;return i(this,e),r=l(this,u(e).call(this,t)),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(r),n||r.constructor),r.name="ArtPlayerError",r}return f(e,t),e}(r((function(t){function e(n){var r="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!Rt(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return $t(t,arguments,u(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),p(e,t)},e(n)}t.exports=e}))(Error));function Tt(t,e){if(!t)throw new Dt(e);return t}function At(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 _t(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function zt(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 n(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/[:.]/).map((function(t,e,n){if(e===n.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===n.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var r=t.match(e);return r?{start:n(r[1].trim()),end:n(r[2].trim()),text:r[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 Lt(t){return t.includes("?")?Lt(t.split("?")[0]):t.includes("#")?Lt(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function qt(t,e){var n=document.createElement("a");n.style.display="none",n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var Mt=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1?e-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function Jt(t,e,n){var r;function o(){for(var o=arguments.length,i=new Array(o),a=0;a0?[e,n,r]:[n,r]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function Gt(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var Kt=Object.freeze({__proto__:null,query:bt,queryAll:mt,addClass:gt,removeClass:wt,hasClass:xt,append:Ot,remove:function(t){return t.parentNode.removeChild(t)},setStyle:kt,setStyles:jt,getStyle:Pt,sublings:St,inverseClass:Et,tooltip:Ct,ArtPlayerError:Dt,errorHandle:Tt,srtToVtt:At,vttToBlob:_t,assToVtt:zt,getExt:Lt,downloadFile:qt,def:Vt,has:Bt,proxyPropertys:Ut,mergeDeep:Ht,sleep:Yt,debounce:Jt,throttle:Xt,clamp:Zt,secondToTime:Qt,escape:Gt});function te(t,e,n){return Tt("string"===e||t instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}var ee={container:te,url:"string",poster:"string",title:"string",theme:"string",lang:"string",volume:"number",isLive:"boolean",muted:"boolean",autoplay:"boolean",autoSize:"boolean",loop:"boolean",flip:"boolean",playbackRate:"boolean",aspectRatio:"boolean",screenshot:"boolean",setting:"boolean",hotkey:"boolean",pip:"boolean",mutex:"boolean",light:"boolean",backdrop:"boolean",fullscreen:"boolean",fullscreenWeb:"boolean",subtitleOffset:"boolean",miniProgressBar:"boolean",localVideo:"boolean",localSubtitle:"boolean",networkMonitor:"boolean",plugins:["function"],whitelist:["string|function|regexp"],layers:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:te,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined"}],contextmenu:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:te,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined"}],quality:[{default:"boolean|undefined",name:"string",url:"string"}],controls:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:te,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined",position:function(t,e,n){var r=["top","left","right"];return Tt(r.includes(t),"".concat(n.join(".")," only accept ").concat(r.toString()," as parameters"))}}],highlight:[{time:"number",text:"string"}],thumbnails:{url:"string",number:"number",width:"number",height:"number",column:"number"},subtitle:{url:"string",style:"object"},moreVideoAttr:"object",icons:"object",customType:"object"},ne={propertys:["audioTracks","autoplay","buffered","controller","controls","crossOrigin","currentSrc","currentTime","defaultMuted","defaultPlaybackRate","duration","ended","error","loop","mediaGroup","muted","networkState","paused","playbackRate","played","preload","readyState","seekable","seeking","src","startDate","textTracks","videoTracks","volume"],methods:["addTextTrack","canPlayType","load","play","pause"],events:["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"]},re=function t(e){var n=this;i(this,t);var r=e.constructor.kindOf,o=e.option.whitelist;this.ua=navigator.userAgent,this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.ua),this.state=!this.isMobile||o.some((function(t){switch(r(t)){case"string":return n.ua.indexOf(t)>-1;case"function":return t(n.ua);case"regexp":return t.test(n.ua);default:return!1}}))},oe=function(){function t(e){var n=this;i(this,t),this.art=e,e.option.container instanceof Element?this.$container=e.option.container:(this.$container=bt(e.option.container),Tt(this.$container,"No container element found by ".concat(e.option.container))),Tt(e.constructor.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),Tt(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 bt(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option,e=t.theme,n=t.backdrop;this.$container.innerHTML='
Player version:
3.5.1
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.$track=this.query(".art-video track"),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.$pipHeader=this.query(".art-pip-header"),this.$pipTitle=this.query(".art-pip-title"),this.$pipClose=this.query(".art-pip-close"),this.$contextmenu=this.query(".art-contextmenus"),n&&(gt(this.$settingInner,"art-backdrop-filter"),gt(this.$info,"art-backdrop-filter"),gt(this.$contextmenu,"art-backdrop-filter"))}},{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="":gt(this.$player,"art-destroy")}}]),t}(),ie={"Video info":"视频统计信息",Close:"关闭","Light Off":"关灯","Light On":"开灯","Video load failed":"视频加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"视频翻转",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":"迷你播放器","Exit mini player":"退出迷你播放器","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},ae={"Video info":"影片統計訊息",Close:"關閉","Light Off":"關燈","Light On":"開燈","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",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":"迷你播放器","Exit mini player":"退出迷你播放器","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},ce=function(){function t(e){i(this,t),this.art=e,this.languages={"zh-cn":ie,"zh-tw":ae},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=Ht(this.languages,t),this.init()}}]),t}();var se=r((function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},n=t.exports,r=function(){for(var t,n=[["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"]],r=0,o=n.length,i={};rh){var y=h*u/l;kt(r,"width","".concat(100*y,"%")),kt(r,"height","100%"),kt(r,"padding","0 ".concat((p-p*y)/2,"px"))}else{var v=l/h/u;kt(r,"width","100%"),kt(r,"height","".concat(100*v,"%")),kt(r,"padding","".concat((f-f*v)/2,"px 0"))}}o.dataset.aspectRatio=n,a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===n?i.get("Default"):n),t.emit("aspectRatioChange",n)}else e.aspectRatio&&(kt(r,"width",null),kt(r,"height",null),kt(r,"padding",null),delete o.dataset.aspectRatio,t.emit("aspectRatioRemove"))}}),Vt(e,"aspectRatioReset",{set:function(n){if(n&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r,t.emit("aspectRatioReset")}}})}(e,this),function(t,e){var n=t.option,r=t.notice,o=t.template.$video;Vt(e,"getScreenshotDataURL",{value:function(){try{var t=document.createElement("canvas");return t.width=o.videoWidth,t.height=o.videoHeight,t.getContext("2d").drawImage(o,0,0),t.toDataURL("image/png")}catch(t){throw r.show=t,t}}}),Vt(e,"getScreenshotBlobUrl",{value:function(){return new Promise((function(t,e){try{var n=document.createElement("canvas");n.width=o.videoWidth,n.height=o.videoHeight,n.getContext("2d").drawImage(o,0,0),n.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){r.show=t,e(t)}}))}}),Vt(e,"screenshot",{value:function(){var r=e.getScreenshotDataURL();r&&(qt(r,"".concat(n.title||"artplayer","_").concat(Qt(o.currentTime),".png")),t.emit("screenshot",r))}})}(e,this),function(t,e){var n=t.template.$player;Vt(e,"fullscreen",{get:function(){return se.isFullscreen},set:function(r){e.fullscreenWeb&&(e.fullscreenWeb=!1),r?se.request(n).then((function(){gt(n,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenChange",!0)})):se.exit().then((function(){wt(n,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenChange",!1)}))}}),Vt(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}})}(e,this),function(t,e){var n=t.template.$player;Vt(e,"fullscreenWeb",{get:function(){return xt(n,"art-web-fullscreen")},set:function(r){e.fullscreen&&(e.fullscreen=!1),r?(gt(n,"art-web-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenWebChange",!0)):(wt(n,"art-web-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenWebChange",!1))}}),Vt(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(e,this),le(e,this),function(t,e){var n=t.template.$video;Vt(e,"loaded",{get:function(){return e.loadedTime/n.duration}}),Vt(e,"loadedTime",{get:function(){return n.buffered.length?n.buffered.end(n.buffered.length-1):0}})}(e,this),function(t,e){Vt(e,"played",{get:function(){return e.currentTime/e.duration}})}(0,this),function(t,e){var n=t.template.$video;Vt(e,"playing",{get:function(){return!!(n.currentTime>0&&!n.paused&&!n.ended&&n.readyState>2)}})}(e,this),function(t,e){var n=t.template,r=n.$container,o=n.$player,i=n.$video;Vt(e,"autoSize",{get:function(){return xt(r,"art-auto-size")},set:function(n){if(n){var a=i.videoWidth,c=i.videoHeight,s=r.getBoundingClientRect(),l=s.width,u=s.height,p=a/c,f=l/u;if(gt(r,"art-auto-size"),f>p){kt(o,"width","".concat(u*p/l*100,"%")),kt(o,"height","100%")}else{var d=l/p/u*100;kt(o,"width","100%"),kt(o,"height","".concat(d,"%"))}t.emit("autoSizeChange",{width:e.width,height:e.height})}else wt(r,"art-auto-size"),kt(o,"width",null),kt(o,"height",null),t.emit("autoSizeRemove")}})}(e,this),function(t,e){Vt(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Vt(e,t,{get:function(){return e.rect[t]}})})),Vt(e,"x",{get:function(){return e.left+window.pageXOffset}}),Vt(e,"y",{get:function(){return e.top+window.pageYOffset}})}(e,this),function(t,e){var n=t.template.$player;Vt(e,"flip",{get:function(){return n.dataset.flip},set:function(e){if(e){var r=["normal","horizontal","vertical"];Tt(r.includes(e),"'flip' only accept ".concat(r.toString()," as parameters")),n.dataset.flip=e,t.emit("flipChange",e)}else delete n.dataset.flip,t.emit("flipRemove")}})}(e,this),function(t,e){var n=t.template.$undercover;Vt(e,"light",{get:function(){return"none"!==Pt(n,"display",!1)},set:function(e){kt(n,"display",e?"block":"none"),t.emit("light",e)}})}(e,this),Ut(e,this)};var pe=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t},fe=r((function(t){function e(n,r,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,n){var r=pe(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}},e(n,r,o||n)}t.exports=e})),de=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,e){var n=this,r="function"==typeof t?t(this.art):t;if(this.$parent&&this.name&&!r.disable){this.id+=1;var o=r.name||"".concat(this.name).concat(this.id);Tt(!Bt(this,o),"Cannot add an existing name [".concat(o,"] to the [").concat(this.name,"]"));var i=document.createElement("div");i.classList.value="art-".concat(this.name," art-").concat(this.name,"-").concat(o),r.html&&Ot(i,r.html),r.style&&jt(i,r.style),r.tooltip&&Ct(i,r.tooltip);var a=Array.from(this.$parent.children);i.dataset.index=r.index||this.id;var c=a.find((function(t){return Number(t.dataset.index)>=Number(i.dataset.index)}));c?c.insertAdjacentElement("beforebegin",i):Ot(this.$parent,i),r.click&&this.art.events.proxy(i,"click",(function(t){t.preventDefault(),r.click.call(n.art,n,t)})),r.mounted&&r.mounted(i,this,this.art),e&&e(i,this,this.art),this.art.emit("".concat(this.name,":add"),r),Vt(this,o,{get:function(){return r}})}}},{key:"show",get:function(){return xt(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,n="art-".concat(this.name,"-show");t?gt(e,n):wt(e,n),this.art.emit("".concat(this.name,":toggle"),t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}}]),t}();function he(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ye(t){return function(e){return function(t){for(var e=1;e
'),mounted:function(t){var n=!1,r=bt(".art-progress-loaded",t),i=bt(".art-progress-played",t),s=bt(".art-progress-highlight",t),l=bt(".art-progress-indicator",t),u=bt(".art-progress-tip",t);function p(t,e){"loaded"===t&&kt(r,"width","".concat(100*e,"%")),"played"===t&&(kt(i,"width","".concat(100*e,"%")),kt(l,"left","calc(".concat(100*e,"% - ").concat(Pt(l,"width")/2,"px)")))}o.forEach((function(t){var e=Zt(t.time,0,c.duration)/c.duration*100;Ot(s,''))})),p("loaded",c.loaded),e.on("video:progress",(function(){p("loaded",c.loaded)})),e.on("video:timeupdate",(function(){p("played",c.played)})),e.on("video:ended",(function(){p("played",1)})),a(t,"mousemove",(function(n){kt(u,"display","block"),n.composedPath().indexOf(s)>-1?function(n){var r=ke(e,n).width,o=n.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;r<=i/2?kt(u,"left",0):r>t.clientWidth-i/2?kt(u,"left","".concat(t.clientWidth-i,"px")):kt(u,"left","".concat(r-i/2,"px"))}(n):function(n){var r=ke(e,n),o=r.width,i=r.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?kt(u,"left",0):o>t.clientWidth-a/2?kt(u,"left","".concat(t.clientWidth-a,"px")):kt(u,"left","".concat(o-a/2,"px"))}(n)})),a(t,"mouseout",(function(){kt(u,"display","none")})),a(t,"click",(function(t){if(t.target!==l){var n=ke(e,t),r=n.second;p("played",n.percentage),c.seek=r}})),a(l,"mousedown",(function(){n=!0})),a(document,"mousemove",(function(t){if(n){var r=ke(e,t),o=r.second,i=r.percentage;gt(l,"art-show-indicator"),p("played",i),c.seek=o}})),a(document,"mouseup",(function(){n&&(n=!1,wt(l,"art-show-indicator"))}))}})}}function Pe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Se(t){return function(e){return function(t){for(var e=1;e'),f=Ot(p,'
');function d(t){var e=p.getBoundingClientRect().left;return Zt(t.pageX-e-s/2,0,c-s/2)/(c-s)}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===t)kt(l,"display","none"),kt(u,"display","flex"),kt(f,"left","0");else{var e=(c-s)*t;kt(l,"display","flex"),kt(u,"display","none"),kt(f,"left","".concat(e,"px"))}}Ct(l,i.get("Mute")),kt(u,"display","none"),h(o.volume),e.on("video:volumechange",(function(){h(o.volume)})),n(l,"click",(function(){o.muted=!0})),n(u,"click",(function(){o.muted=!1})),n(p,"click",(function(t){o.muted=!1,o.volume=d(t)})),n(f,"mousedown",(function(){a=!0})),n(t,"mousemove",(function(t){a&&(o.muted=!1,o.volume=d(t))})),n(document,"mouseup",(function(){a&&(a=!1)}))}})}}function De(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Te(t){return function(e){return function(t){for(var e=1;er.clientWidth-s/2?kt(t,"left","".concat(r.clientWidth-s,"px")):kt(t,"left","".concat(i-s/2,"px"))}(o))})),i(r,"mouseout",(function(){kt(t,"display","none")}))}})}}function ze(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Le(t){return function(e){return function(t){for(var e=1;e'.concat(s.name,"")),u=n.map((function(t,e){return'
').concat(t.name,"
")})).join(""),p=Ot(t,'
'.concat(u,"
"));i(t,(function(){p.style.left="-".concat(Pt(p,"width")/2-t.clientWidth/2,"px")})),o(p,"click",(function(t){var e=Number(t.target.dataset.index),r=n[e],o=r.url,i=r.name;o&&i&&c!==e&&(a.switchQuality(o,i),l.innerText=i,c=e)}))}})}}var Fe=function(t){function e(t){var n;i(this,e),(n=l(this,u(e).call(this,t))).name="control";var r=t.option;return t.on("ready",(function(){n.add(je({name:"progress",disable:r.isLive,position:"top",index:10})),n.add(_e({name:"thumbnails",disable:!r.thumbnails.url||r.isLive,position:"top",index:20})),n.add(xe({name:"playAndPause",disable:!1,position:"left",index:10})),n.add($e({name:"volume",disable:!1,position:"left",index:20})),n.add(Ce({name:"time",disable:r.isLive,position:"left",index:30})),n.add(Me({name:"quality",disable:0===r.quality.length,position:"right",index:10})),n.add(Le({name:"screenshot",disable:!r.screenshot,position:"right",index:20})),n.add(Se({name:"subtitle",disable:!r.subtitle.url,position:"right",index:30})),n.add(Te({name:"setting",disable:!r.setting,position:"right",index:40})),n.add(ge({name:"pip",disable:!r.pip,position:"right",index:50})),n.add(be({name:"fullscreenWeb",disable:!r.fullscreenWeb,position:"right",index:60})),n.add(ye({name:"fullscreen",disable:!r.fullscreen,position:"right",index:70})),r.controls.forEach((function(t){n.add(t)}))})),n}return f(e,t),c(e,[{key:"add",value:function(t,n){var r=this,o="function"==typeof t?t(this.art):t;Tt(["top","left","right"].includes(o.position),"Control option.position must one of 'top', 'left', 'right'");var i=this.art.template,a=i.$progress,c=i.$controlsLeft,s=i.$controlsRight;switch(o.position){case"top":this.$parent=a;break;case"left":this.$parent=c;break;case"right":this.$parent=s}fe(u(e.prototype),"add",this).call(this,o,(function(t){o.disable||"top"===o.position||t.firstElementChild&&"I"===t.firstElementChild.tagName||gt(t,"art-control-onlyText"),n&&n(t,r,r.art)}))}}]),e}(de);function Ie(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ne(t){return function(e){var r=e.i18n,o=e.player;return function(t){for(var e=1;e0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,e){var n=e.target.dataset.rate;n&&(o.playbackRate=Number(n),t.show=!1)},mounted:function(t){e.on("playbackRateChange",(function(e){var n=mt("span",t).find((function(t){return Number(t.dataset.rate)===e}));n&&Et(n,"art-current")}))}})}}function Ve(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function We(t){return function(e){var r=e.i18n,o=e.player;return function(t){for(var e=1;e').concat(r.get("Default"),'4:316:9'),click:function(t,e){var n=e.target.dataset.ratio;n&&(o.aspectRatio=n,t.show=!1)},mounted:function(t){e.on("aspectRatioChange",(function(e){var n=mt("span",t).find((function(t){return t.dataset.ratio===e}));n&&Et(n,"art-current")}))}})}}function Be(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ue(t){return function(e){return function(t){for(var e=1;eArtPlayer 3.5.1'})}function Je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xe(t){return function(e){var r=e.i18n,o=e.player;return function(t){for(var e=1;el+s&&(h=s-d),r+f>u+i&&(y=i-f),jt(c,{top:"".concat(y,"px"),left:"".concat(h,"px")})})),s(a,"click",(function(t){t.composedPath().includes(c)||(n.show=!1)})),t.on("blur",(function(){n.show=!1}))})),n}return f(e,t),e}(de),Ke=function(t){function e(t){var n;i(this,e),(n=l(this,u(e).call(this,t))).name="info";var r=t.template,o=r.$infoPanel,a=r.$infoClose,c=r.$video;(0,t.events.proxy)(a,"click",(function(){n.show=!1}));var s=null,p=mt("[data-video]",o);return t.on("destroy",(function(){clearTimeout(s)})),t.on("info:toggle",(function(t){clearTimeout(s),t&&function t(){p.forEach((function(t){var e=c[t.dataset.video];t.innerText="number"==typeof e?e.toFixed(2):e})),s=setTimeout((function(){t()}),1e3)}()})),n}return f(e,t),e}(de),tn=function(t){function e(t){var n;i(this,e),(n=l(this,u(e).call(this,t))).name="subtitle";var r=t.events.proxy,o=t.option.subtitle;return jt(t.template.$subtitle,o.style),r(n.textTrack,"cuechange",n.update.bind(s(n))),o.url&&n.init(o.url),n}return f(e,t),c(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(Gt(t),"

")})).join(""),this.art.emit("subtitle:update",this.activeCue.text))}},{key:"switch",value:function(t,e,n){var r=this,o=this.art,i=o.i18n,a=o.notice;return this.init(t,n).then((function(t){return e&&(a.show="".concat(i.get("Switch subtitle"),": ").concat(e)),r.art.emit("subtitle:switch",t),t}))}},{key:"init",value:function(t,e){var n=this,r=this.art,o=r.notice,i=r.template,a=i.$subtitle,c=i.$track;return fetch(t).then((function(t){return t.text()})).then((function(r){switch(n.art.emit("subtitle:load",t),e||Lt(t)){case"srt":return _t(At(r));case"ass":return _t(zt(r));case"vtt":return _t(r);default:return t}})).then((function(t){return a.innerHTML="",n.url===t?t:(URL.revokeObjectURL(n.url),c.src=t,t)})).catch((function(t){throw o.show=t,n.art.emit("subtitle:err",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]}}]),e}(de);var en=function(){function t(e){var n=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.on("ready",(function(){!function(t,e){var n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){e.composedPath&&e.composedPath().indexOf(n)>-1?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))}))}(e,n),function(t,e){var n=t.template.$player;e.hover(n,(function(){gt(n,"art-hover"),t.emit("hoverenter")}),(function(){wt(n,"art-hover"),t.emit("hoverleave")}))}(e,n),function(t,e){var n=t.template,r=n.$player,o=n.$video,i=t.player,a=t.controls,c=Jt((function(){gt(r,"art-hide-cursor"),wt(r,"art-hover"),a.show=!1}),3e3);t.on("hoverleave",(function(){i.playing&&c()})),e.proxy(r,"mousemove",(function(e){c.clearTimeout(),wt(r,"art-hide-cursor"),a.show=!0,!i.pip&&i.playing&&e.target===o&&c(),t.emit("mousemove")}))}(e,n),function(t,e){var n=t.option,r=t.player,o=t.template.$player,i=document.createElement("object");i.setAttribute("aria-hidden","true"),i.setAttribute("tabindex",-1),i.type="text/html",i.data="about:blank";var a=r.width,c=r.height,s=Xt((function(){r.width===a&&r.height===c||(a=r.width,c=r.height,n.autoSize&&(r.fullscreen||r.fullscreenWeb||r.pip?r.autoSize=!1:r.autoSize=!0),r.aspectRatioReset=!0,t.emit("resize",{width:r.width,height:r.height}))}),500);e.proxy(i,"load",(function(){e.proxy(i.contentDocument.defaultView,"resize",s)})),o.appendChild(i)}(e,n)}))}return c(t,[{key:"proxy",value:function(t,e,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return r.proxy(t,e,n,o)}));t.addEventListener(e,n,o);var i=function(){return t.removeEventListener(e,n,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,n){e&&this.proxy(t,"mouseenter",e),n&&this.proxy(t,"mouseleave",n)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(n,r){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return r(t);(o=new Image).src=t}return o.complete?n(o):(e.proxy(o,"load",(function(){return n(o)})),e.proxy(o,"error",(function(){return r(o)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),t}(),nn=function(){function t(e){var n=this;i(this,t),this.keys={};var r=e.option,o=e.player,a=e.events.proxy;r.hotkey&&e.on("ready",(function(){n.add(27,(function(){o.fullscreenWeb&&(o.fullscreenWeb=!1)})),n.add(32,(function(){o.toggle=!0})),n.add(37,(function(){o.seek=o.currentTime-5})),n.add(38,(function(){o.volume+=.1})),n.add(39,(function(){o.seek=o.currentTime+5})),n.add(40,(function(){o.volume-=.1})),a(window,"keydown",(function(t){if(e.isFocus){var r=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==r&&"TEXTAREA"!==r&&""!==o&&"true"!==o){var i=n.keys[t.keyCode];i&&(t.preventDefault(),i.forEach((function(t){return t()})),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}(),rn=function(t){function e(t){var n;return i(this,e),(n=l(this,u(e).call(this,t))).name="layer",n.$parent=t.template.$layer,t.on("ready",(function(){t.option.layers.forEach((function(t){n.add(t)}))})),n}return f(e,t),e}(de),on=function(t){function e(t){var n;return i(this,e),(n=l(this,u(e).call(this,t))).name="loading",Ot(t.template.$loading,t.icons.loading),n}return f(e,t),e}(de),an=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,n=e.$player,r=e.$noticeInner;r.innerText=t instanceof Error?t.message.trim():t,gt(n,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){r.innerText="",wt(n,"art-notice-show")}),this.time)}}]),t}(),cn=function(t){function e(t){var n;return i(this,e),(n=l(this,u(e).call(this,t))).name="mask",Ot(t.template.$state,t.icons.state),n}return f(e,t),e}(de);function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var ln=function t(e){var r=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){var e=document.createElement("i");e.classList.add("art-icon"),e.classList.add("art-icon-".concat(t)),Ot(e,o[t]),r[t]=e}))};function un(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pn(t){return function(e){var r=e.i18n,o=e.player;return function(t){for(var e=1;e'.concat(r.get("Flip"),'
"),click:function(t,e){var n=e.target.dataset.value;n&&(o.flip=n)},mounted:function(t){e.on("flipChange",(function(e){var n=mt("button",t).find((function(t){return t.dataset.value===e}));n&&Et(n.parentElement,"current")}))}})}}function fn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dn(t){return function(e){var r=e.i18n,o=e.player;return function(t){for(var e=1;e'.concat(r.get("Aspect ratio"),'
'),click:function(t,e){var n=e.target.dataset.value;n&&(o.aspectRatio=n)},mounted:function(t){e.on("aspectRatioChange",(function(e){var n=mt("button",t).find((function(t){return t.dataset.value===e}));n&&Et(n.parentElement,"current")}))}})}}function hn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yn(t){return function(e){var r=e.i18n,o=e.player,i=e.events.proxy;return function(t){for(var e=1;e'.concat(r.get("Play speed"),': 1.0x
'),mounted:function(t){var n=bt(".art-setting-range input",t),r=bt(".art-subtitle-value",t);i(n,"change",(function(){var t=n.value;r.innerText=t,o.playbackRate=Number(t)})),e.on("playbackRateChange",(function(t){n.value!==t&&(n.value=t,r.innerText=t)}))}})}}var vn=function(t){function e(t){var n;i(this,e),(n=l(this,u(e).call(this,t))).name="setting";var r=t.option,o=t.template,a=o.$setting,c=o.$settingBody,s=t.events.proxy;return n.$parent=c,r.setting&&(t.on("ready",(function(){s(a,"click",(function(t){t.target===a&&(n.show=!1)})),n.add(pn({disable:!r.flip,name:"flip"})),n.add(dn({disable:!r.aspectRatio,name:"aspectRatio"})),n.add(yn({disable:!r.playbackRate,name:"playbackRate"}))})),t.on("blur",(function(){n.show=!1}))),n}return f(e,t),e}(de),bn=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]:{}}},{key:"set",value:function(t,e){var r=Object.assign({},this.get(),n({},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)}}]),t}();function mn(t){var e=t.i18n,n=t.subtitle,r=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'
'.concat(e.get("Subtitle offset time"),': 0s
'),mounted:function(e){var o=bt(".art-setting-range input",e),i=bt(".art-subtitle-value",e);r(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){n.update(),o.value!==t&&(o.value=t,i.innerText=t)}))}}}function gn(t){var e=t.constructor.utils.clamp,n=t.setting,r=t.notice,o=t.template,i=t.i18n,a=t.player;n.add(mn);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(n){if(o.$track&&o.$track.track){var s=Array.from(o.$track.track.cues),l=e(n,-5,5);s.forEach((function(t,n){c[n]||(c[n]={startTime:t.startTime,endTime:t.endTime}),t.startTime=e(c[n].startTime+l,0,a.duration),t.endTime=e(c[n].endTime+l,0,a.duration)})),r.show="".concat(i.get("Subtitle offset time"),": ").concat(n,"s"),t.emit("subtitleOffset",n)}else r.show="".concat(i.get("No subtitles found")),t.emit("subtitleOffset",0)}}}function wn(t){var e=t.events.proxy,n=t.template,r=t.player,o=t.option,i=t.setting,a=t.i18n;function c(e){if(e){var i=n.$video.canPlayType(e.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(e);o.title=e.name,r.switchUrl(a,e.name),t.emit("localVideo",e)}else Tt(!1,"Playback of this file format is not supported")}}function s(t){var n=Ot(t,'');kt(t,"position","relative"),jt(n,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(n,"change",(function(){c(n.files[0])}))}return e(n.$player,"dragover",(function(t){t.preventDefault()})),e(n.$player,"drop",(function(t){t.preventDefault(),c(t.dataTransfer.files[0])})),t.on("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 n=bt(".art-upload-btn",e),r=bt(".art-upload-value",e);t.on("localVideo",(function(t){r.textContent=t.name,r.title=t.name})),s(n)}})})),{name:"localVideo",attach:s}}function xn(t){var e=t.events.proxy,n=t.subtitle,r=t.setting,o=t.i18n;function i(r){var o=Ot(r,'');kt(r,"position","relative"),jt(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(o,"change",(function(){!function(e){if(e){var r=Lt(e.name);if(["ass","vtt","srt"].includes(r)){var o=URL.createObjectURL(e);n.switch(o,e.name,r),t.emit("localSubtitle",e)}else Tt(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return t.on("ready",(function(){r.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'
'.concat(o.get("Local Subtitle"),'
').concat(o.get("Open"),'
'),mounted:function(e){var n=bt(".art-upload-btn",e),r=bt(".art-upload-value",e);t.on("localSubtitle",(function(t){r.textContent=t.name,r.title=t.name})),i(n)}})})),{name:"localSubtitle",attach:i}}function On(t){var e=t.layers,n=t.player,r=t.option.theme;return e.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:r},mounted:function(e){t.on("control:toggle",(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*n.played,"%")}))}}),{name:"miniProgressBar"}}function kn(t){var e=1e4,n=0,r=0,o=0,i=null;function a(){n=0,r=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;r+=c,t.player.playing||(n+=c)}o=i,t.emit("networkMonitor",n/r),r>=e&&(n=0,r=0),a()})))}()}return t.on("play",c),t.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(t){e=t}}}var jn=function(){function t(e){var n=this;i(this,t),this.art=e,this.id=0;var r=e.option;r.subtitle.url&&r.subtitleOffset&&this.add(gn),!r.isLive&&r.miniProgressBar&&this.add(On),r.localVideo&&this.add(wn),r.localSubtitle&&this.add(xn),r.networkMonitor&&this.add(kn),e.option.plugins.forEach((function(t){n.add(t)}))}return c(t,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),n=e&&e.name||t.name||"plugin".concat(this.id);return Tt(!Bt(this,n),"Cannot add a plugin that already has the same name: ".concat(n)),Vt(this,n,{value:e}),this.art.emit("plugin:add",t),this}}]),t}(),Pn=function t(e){i(this,t);var n=e.option,r=e.events.proxy,o=e.template.$video;ne.events.forEach((function(t){r(o,t,(function(t){e.emit("video:".concat(t.type),t)}))})),Object.keys(n.moreVideoAttr).forEach((function(t){o[t]=n.moreVideoAttr[t]})),n.muted&&(o.muted=n.muted),n.volume&&(o.volume=Zt(n.volume,0,1)),n.poster&&(o.poster=n.poster),n.autoplay&&(o.autoplay=n.autoplay),o.controls=!0;var a=n.type||Lt(n.url),c=n.customType[a];a&&c?(c(o,n.url,e),e.emit("customType",a)):(o.src=n.url,e.emit("urlChange",o.src))},Sn=0,En=function(t){function e(t){var n;return i(this,e),(n=l(this,u(e).call(this))).option=yt(Ht(e.option,t),ee),n.isFocus=!1,n.isDestroy=!1,n.whitelist=new re(s(n)),n.template=new oe(s(n)),n.events=new en(s(n)),n.whitelist.state?(n.storage=new bn(s(n)),n.icons=new ln(s(n)),n.i18n=new ce(s(n)),n.notice=new an(s(n)),n.player=new ue(s(n)),n.layers=new rn(s(n)),n.controls=new Fe(s(n)),n.contextmenu=new Ge(s(n)),n.subtitle=new tn(s(n)),n.info=new Ke(s(n)),n.loading=new on(s(n)),n.hotkey=new nn(s(n)),n.mask=new cn(s(n)),n.setting=new vn(s(n)),n.plugins=new jn(s(n))):n.mobile=new Pn(s(n)),Sn+=1,n.id=Sn,e.instances.push(s(n)),n}return f(e,t),c(e,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),e.instances.splice(e.instances.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"version",get:function(){return"3.5.1"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return ne}},{key:"utils",get:function(){return Kt}},{key:"scheme",get:function(){return ee}},{key:"Emitter",get:function(){return vt}},{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,loop:!1,flip:!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:[],quality:[],controls:[],highlight:[],plugins:[],whitelist:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{}},moreVideoAttr:{controls:!1,preload:"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),e}(vt);function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rn(t){for(var e=1;e