mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
9 lines
88 KiB
JavaScript
9 lines
88 KiB
JavaScript
/*!
|
||
* artplayer.js v3.1.19
|
||
* Github: https://github.com/zhw2590582/ArtPlayer#readme
|
||
* (c) 2017-2019 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).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 n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),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 i=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 o=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var a=function(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?o(t):e},c=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),s=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var u=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)},l=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 i=t(n);if("boolean"===i)return"boolean";if("string"===i)return"string";if("number"===i)return"number";if("symbol"===i)return"symbol";if("function"===i)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(i=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 i.slice(8,-1).toLowerCase().replace(/\s/g,"")};function r(t){return t.constructor?t.constructor.name:null}function i(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return o(t,e,r),a(t,e,r),function(t,e,r){var c=n(e),s=n(t);if("object"===c){if("object"!==s)throw new Error("[Type Error]: '".concat(r.join("."),"' require 'object' type, but got '").concat(s,"'"));Object.keys(e).forEach((function(n){var c=t[n],s=e[n],u=r.slice();u.push(n),o(c,s,u),a(c,s,u),i(c,s,u)}))}if("array"===c){if("array"!==s)throw new Error("[Type Error]: '".concat(r.join("."),"' require 'array' type, but got '").concat(s,"'"));t.forEach((function(n,c){var s=t[c],u=e[c]||e[0],l=r.slice();l.push(c),o(s,u,l),a(s,u,l),i(s,u,l)}))}}(t,e,r),t}function o(t,e,r){if("string"===n(e)){var i=n(t);if(!(-1<e.indexOf("|")?e.split("|").map((function(t){return t.toLowerCase().trim()})).filter(Boolean).some((function(t){return i===t})):e.toLowerCase().trim()===i))throw new Error("[Type Error]: '".concat(r.join("."),"' require '").concat(e,"' type, but got '").concat(i,"'"))}}function a(t,e,r){if("function"===n(e)){var i=e(t,n(t),r);if(!0!==i){var o=n(i);throw"string"===o?new Error(i):"error"===o?i:new Error("[Validator Error]: The scheme for '".concat(r.join("."),"' validator require return true, but got '").concat(i,"'"))}}}return i.kindOf=n,i}()})),f=function(){function e(){t(this,e)}return n(e,[{key:"on",value:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this}},{key:"once",value:function(t,e,n){var r=this;function i(){r.off(t,i);for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];e.apply(n,a)}return i._=e,this.on(t,i,n)}},{key:"emit",value:function(t){for(var e=((this.e||(this.e={}))[t]||[]).slice(),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0;o<e.length;o+=1)e[o].fn.apply(e[o].ctx,r);return this}},{key:"off",value:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,a=r.length;o<a;o+=1)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}}]),e}();var p=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var d=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var h=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var y=function(t){return p(t)||d(t)||h()};var v=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},m=r((function(t){function e(n,r,i){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 i=new(Function.bind.apply(t,r));return n&&s(i,n.prototype),i}:t.exports=e=Reflect.construct,e.apply(null,arguments)}t.exports=e})),g=function(e){function n(e,r){var i;return t(this,n),i=a(this,c(n).call(this,e)),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(o(i),r||i.constructor),i.name="ArtPlayerError",i}return u(n,e),n}(r((function(t){function e(n){var r="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!v(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 m(t,arguments,c(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),s(e,t)},e(n)}t.exports=e}))(Error));function b(t,e){if(!t)throw new g(e);return t}function w(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function O(t,e,n){return Object.defineProperty(t,e,n)}function j(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.reduce((function(t,e){return Object.getOwnPropertyNames(e).forEach((function(n){b(!w(t,n),"Target attribute name is duplicated: ".concat(n)),Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}),t)}function P(){for(var t=function(t){return t&&"object"===i(t)&&!Array.isArray(t)},e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.reduce((function(e,n){return Object.keys(n).forEach((function(r){var i=e[r],o=n[r];Array.isArray(i)&&Array.isArray(o)?e[r]=i.concat.apply(i,y(o)):!t(i)||!t(o)||o instanceof Element?e[r]=o:e[r]=P(i,o)})),e}),{})}function x(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector(t)}function k(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function E(t,e){return t.classList.add(e)}function S(t,e){return t.classList.remove(e)}function $(t,e){return t.classList.contains(e)}function R(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function T(t,e,n){return t.style[e]=n,t}function D(t,e){return Object.keys(e).forEach((function(n){T(t,n,e[n])})),t}function C(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 L(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function A(t,e){L(t).forEach((function(t){return S(t,e)})),E(t,e)}function M(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)}function z(t){return"WEBVTT \r\n\r\n".concat(t.replace(/{[\s\S]*?}/g,"").replace(/\{\\([ibu])\}/g,"</$1>").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"</$1>").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 W(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 V(t){return t.includes("?")?V(t.split("?")[0]):t.includes("#")?V(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function F(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)}function H(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function B(t,e,n){var r;function i(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout((function(){r=null,t.apply(n,o)}),e)}return i.clearTimeout=function(){clearTimeout(r)},i}function N(t,e){var n,r,i=!1;return function o(){for(var a=arguments.length,c=new Array(a),s=0;s<a;s++)c[s]=arguments[s];if(i)return n=c,void(r=this);i=!0,t.apply(this,c),setTimeout((function(){i=!1,n&&(o.apply(r,n),n=null,r=null)}),e)}}function I(t,e,n){return Math.max(Math.min(t,Math.max(e,n)),Math.min(e,n))}function U(t){var e=Math.floor(t/3600),n=Math.floor((t-3600*e)/60),r=Math.floor(t-3600*e-60*n);return(e>0?[e,n,r]:[n,r]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}var _=Object.freeze({__proto__:null,query:x,queryAll:k,addClass:E,removeClass:S,hasClass:$,append:R,remove:function(t){return t.parentNode.removeChild(t)},setStyle:T,setStyles:D,getStyle:C,sublings:L,inverseClass:A,tooltip:M,addShowProperty:function(t,e,n){var r="art-".concat(n,"-show");O(t,"show",{get:function(){return $(e,r)},set:function(i){i?E(e,r):S(e,r),t.art.emit("".concat(n,":toggle"),i)}}),O(t,"toggle",{value:function(){t.show=!t.show}})},ArtPlayerError:g,errorHandle:b,srtToVtt:z,vttToBlob:q,assToVtt:W,getExt:V,downloadFile:F,hasOwnProperty:w,defineProperty:O,proxyPropertys:j,mergeDeep:P,sleep:H,debounce:B,throttle:N,clamp:I,secondToTime:U});function X(t,e,n){return b("string"===e||t instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}var Y={container:X,url:"string|function",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",fullscreen:"boolean",fullscreenWeb:"boolean",subtitleOffset:"boolean",miniProgressBar:"boolean",localVideo:"boolean",localSubtitle:"boolean",autoPip:"boolean",networkMonitor:"boolean",plugins:["function"],whitelist:["string|function|regexp"],layers:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:X,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined"}],contextmenu:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:X,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:X,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined",position:function(t,e,n){var r=["top","left","right"];return b(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"},Z={video:{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"]}},J=function e(n){var r=this;t(this,e);var i=n.constructor.kindOf,o=n.option.whitelist;this.userAgent=window.navigator.userAgent,this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent),this.state=!this.isMobile||o.some((function(t){switch(i(t)){case"string":return r.userAgent.indexOf(t)>-1;case"function":return t(r.userAgent);case"regexp":return t.test(r.userAgent);default:return!1}}))},G=function(){function e(n){var r=this;t(this,e),this.art=n,n.option.container instanceof Element?this.$container=n.option.container:(this.$container=x(n.option.container),b(this.$container,"No container element found by ".concat(n.option.container))),b(n.constructor.instances.every((function(t){return t.template.$container!==r.$container})),"Cannot mount multiple instances on the same dom element"),b(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),n.whitelist.state?this.initDesktop():this.initMobile()}return n(e,[{key:"query",value:function(t){return x(t,this.$container)}},{key:"initDesktop",value:function(){this.$container.innerHTML='\n<div class="art-video-player art-subtitle-show art-layer-show" style="--theme: '.concat(this.art.option.theme,'">\n <video class="art-video">\n <track default kind="metadata"></track>\n </video>\n <div class="art-subtitle"></div>\n <div class="art-danmuku"></div>\n <div class="art-layers"></div>\n <div class="art-mask">\n <div class="art-state"></div>\n </div>\n <div class="art-bottom">\n <div class="art-progress"></div>\n <div class="art-controls">\n <div class="art-controls-left"></div>\n <div class="art-controls-right"></div>\n </div>\n </div>\n <div class="art-loading"></div>\n <div class="art-notice">\n <div class="art-notice-inner"></div>\n </div>\n <div class="art-settings">\n <div class="art-setting-inner art-backdrop-filter">\n <div class="art-setting-body"></div>\n </div>\n </div>\n <div class="art-info art-backdrop-filter">\n <div class="art-info-panel">\n <div class="art-info-item">\n <div class="art-info-title">Player version:</div>\n <div class="art-info-content">3.1.19</div>\n </div>\n <div class="art-info-item">\n <div class="art-info-title">Video url:</div>\n <div class="art-info-content" data-video="src"></div>\n </div>\n <div class="art-info-item">\n <div class="art-info-title">Video volume:</div>\n <div class="art-info-content" data-video="volume"></div>\n </div>\n <div class="art-info-item">\n <div class="art-info-title">Video time:</div>\n <div class="art-info-content" data-video="currentTime"></div>\n </div>\n <div class="art-info-item">\n <div class="art-info-title">Video duration:</div>\n <div class="art-info-content" data-video="duration"></div>\n </div>\n <div class="art-info-item">\n <div class="art-info-title">Video resolution:</div>\n <div class="art-info-content">\n <span data-video="videoWidth"></span> x <span data-video="videoHeight"></span>\n </div>\n </div>\n </div>\n <div class="art-info-close">[x]</div>\n </div>\n <div class="art-pip-header">\n <div class="art-pip-title"></div>\n <div class="art-pip-close">×</div>\n </div>\n <div class="art-contextmenus art-backdrop-filter"></div>\n</div>\n '),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")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n<div class="art-video-player">\n <video class="art-video"></video>\n</div>\n ',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":E(this.$player,"art-destroy")}}]),e}(),Q={"About author":"关于作者","Video info":"视频统计信息",Close:"关闭","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":"迷你播放器","Does not support fullscreen":"不支持全屏","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},K={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","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":"迷你播放器","Does not support fullscreen":"不支持全屏","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},tt=function(){function e(n){t(this,e),this.art=n,this.languages={"zh-cn":Q,"zh-tw":K},this.init()}return n(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=P(this.languages,t),this.init()}}]),e}();var et=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,i=n.length,o={};r<i;r++)if((t=n[r])&&t[1]in e){for(r=0;r<t.length;r++)o[n[0][r]]=t[r];return o}return!1}(),i={change:r.fullscreenchange,error:r.fullscreenerror},o={request:function(t){return new Promise(function(n,i){var o=function(){this.off("change",o),n()}.bind(this);this.on("change",o),t=t||e.documentElement,Promise.resolve(t[r.requestFullscreen]()).catch(i)}.bind(this))},exit:function(){return new Promise(function(t,n){if(this.isFullscreen){var i=function(){this.off("change",i),t()}.bind(this);this.on("change",i),Promise.resolve(e[r.exitFullscreen]()).catch(n)}else t()}.bind(this))},toggle:function(t){return this.isFullscreen?this.exit():this.request(t)},onchange:function(t){this.on("change",t)},onerror:function(t){this.on("error",t)},on:function(t,n){var r=i[t];r&&e.addEventListener(r,n,!1)},off:function(t,n){var r=i[t];r&&e.removeEventListener(r,n,!1)},raw:r};r?(Object.defineProperties(o,{isFullscreen:{get:function(){return Boolean(e[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return e[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(e[r.fullscreenEnabled])}}}),n?t.exports=o:window.screenfull=o):n?t.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()}));et.isEnabled;function nt(t,e){var n=t.template.$video;document.pictureInPictureEnabled?function(t,e){var n=t.template.$video,r=t.events.proxy,i=t.notice;n.disablePictureInPicture=!1,Object.defineProperty(e,"pip",{get:function(){return document.pictureInPictureElement},set:function(t){t?n.requestPictureInPicture().catch((function(t){throw i.show(t),t})):document.exitPictureInPicture().catch((function(t){throw i.show(t),t}))}}),r(n,"enterpictureinpicture",(function(){t.emit("pipEnabled")})),r(n,"leavepictureinpicture",(function(){t.emit("pipExit")})),t.on("destroy",(function(){e.pip&&(e.pip=!1)}))}(t,e):n.webkitSupportsPresentationMode?function(t,e){var n=t.template.$video;n.webkitSetPresentationMode("inline"),Object.defineProperty(e,"pip",{get:function(){return"picture-in-picture"===n.webkitPresentationMode},set:function(e){e?(n.webkitSetPresentationMode("picture-in-picture"),t.emit("pipEnabled")):(n.webkitSetPresentationMode("inline"),t.emit("pipExit"))}})}(t,e):function(t,e){var n=t.option,r=t.i18n,i=t.template,o=i.$player,a=i.$pipClose,c=i.$pipTitle,s=i.$pipHeader,u=t.events.proxy,l="",f=!1,p=0,d=0,h=0,y=0;u(s,"mousedown",(function(t){f=!0,p=t.pageX,d=t.pageY,h=e.left,y=e.top})),u(s,"mousemove",(function(t){f&&(E(o,"art-is-dragging"),T(o,"left","".concat(h+t.pageX-p,"px")),T(o,"top","".concat(y+t.pageY-d,"px")))})),u(document,"mouseup",(function(){f=!1,S(o,"art-is-dragging")})),u(a,"click",(function(){e.pip=!1,f=!1,S(o,"art-is-dragging")})),R(c,n.title||r.get("Mini player"));var v={get:function(){return $(o,"art-pip")},set:function(n){if(n){e.autoSize=!1,l=o.style.cssText,E(o,"art-pip");var r=document.body;T(o,"top","".concat(r.clientHeight-e.height-50,"px")),T(o,"left","".concat(r.clientWidth-e.width-50,"px")),e.fullscreen=!1,e.fullscreenWeb=!1,e.aspectRatio=!1,e.playbackRate=!1,t.emit("pipEnabled")}else e.pip&&(o.style.cssText=l,S(o,"art-pip"),T(o,"top",null),T(o,"left",null),e.fullscreen=!1,e.fullscreenWeb=!1,e.aspectRatio=!1,e.playbackRate=!1,e.autoSize=!0,t.emit("pipExit"))}};Object.defineProperty(e,"pip",v)}(t,e),Object.defineProperty(e,"pipToggle",{set:function(t){t&&(e.pip=!e.pip)}})}var rt=function e(n){var r;t(this,e),function(t,e){var n=t.option,r=n.type,i=n.customType,o=t.template.$video;Object.defineProperty(e,"url",{get:function(){return o.src},set:function(){b(!1,"You should use this method: art.attachUrl()")}}),Object.defineProperty(e,"attachUrl",{value:function(e){return H().then((function(){function n(e){var n=r||V(e),a=i[n];return n&&a?(t.loading.show=!0,t.emit("beforeCustomType",n),a.call(t,o,e,t),t.emit("afterCustomType",n)):(t.emit("beforeAttachUrl",e),o.src=e,t.emit("afterAttachUrl",e)),Promise.resolve(e)}if("function"==typeof e){var a=e.call(t);return b("function"==typeof a.then,"If url is a function, it needs to return a promise."),a.then((function(e){return t.loading.show=!0,n(e)}))}return n(e)}))}})}(n,this),function(t,e){var n=t.option,r=t.events.proxy,i=t.template,o=i.$player,a=i.$video,c=t.i18n,s=t.notice,u=0;r(a,"click",(function(){e.toggle=!0})),Z.video.events.forEach((function(e){r(a,e,(function(e){t.emit("video:".concat(e.type),e)}))})),t.on("video:canplay",(function(){u=0,t.controls.show=!0,t.mask.show=!0,t.loading.show=!1})),t.once("video:canplay",(function(){t.emit("ready")})),t.on("video:ended",(function(){t.controls.show=!0,t.mask.show=!0,n.loop&&(e.seek=0,e.play=!0)})),t.on("video:error",(function(){u<5?H(1e3).then((function(){u+=1,e.attachUrl(n.url),s.show("".concat(c.get("Reconnect"),": ").concat(u))})):(t.loading.show=!1,t.controls.show=!1,E(o,"art-error"),H(1e3).then((function(){s.show(c.get("Video load failed"),!1),t.destroy()})))})),t.on("video:loadedmetadata",(function(){n.autoSize&&(e.autoSize=!0)})),t.on("video:loadstart",(function(){t.loading.show=!0})),t.on("video:pause",(function(){t.controls.show=!0,t.mask.show=!0})),t.on("video:play",(function(){t.mask.show=!1})),t.on("video:playing",(function(){t.mask.show=!1})),t.on("video:seeked",(function(){t.loading.show=!1})),t.on("video:seeking",(function(){t.loading.show=!0})),t.on("video:timeupdate",(function(){t.mask.show=!1})),t.on("video:waiting",(function(){t.loading.show=!0}))}(n,this),function(t,e){var n=t.option,r=t.template.$video;Object.keys(n.moreVideoAttr).forEach((function(t){r[t]=n.moreVideoAttr[t]})),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=I(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!1,e.attachUrl(n.url)}(n,this),function(t,e){var n=t.template.$video,r=t.i18n,i=t.notice,o=t.option.mutex;Object.defineProperty(e,"play",{set:function(a){if(a){var c=n.play();void 0!==c&&c.then().catch((function(t){throw i.show(t,!0,3e3),t})),o&&t.constructor.instances.filter((function(e){return e!==t})).forEach((function(t){t.player.pause=!0})),i.show(r.get("Play")),t.emit("play")}else e.pause=!0}})}(n,this),function(t,e){var n=t.template.$video,r=t.i18n,i=t.notice;Object.defineProperty(e,"pause",{get:function(){return n.paused},set:function(o){o?(n.pause(),i.show(r.get("Pause")),t.emit("pause")):e.play=!0}})}(n,this),r=this,Object.defineProperty(r,"toggle",{set:function(t){t&&(r.playing?r.pause=!0:r.play=!0)}}),function(t,e){var n=t.notice;Object.defineProperty(e,"seek",{set:function(r){e.currentTime=r,n.show("".concat(U(r)," / ").concat(U(e.duration))),t.emit("seek",r)}})}(n,this),function(t,e){var n=t.template.$video,r=t.i18n,i=t.notice,o=t.storage;Object.defineProperty(e,"volume",{get:function(){return n.volume||0},set:function(e){n.volume=I(e,0,1),i.show("".concat(r.get("Volume"),": ").concat(parseInt(100*n.volume,10))),0!==n.volume&&o.set("volume",n.volume),t.emit("volume",n.volume)}}),Object.defineProperty(e,"muted",{get:function(){return n.muted},set:function(e){n.muted=e,t.emit("volume",n.volume)}})}(n,this),function(t,e){Object.defineProperty(e,"currentTime",{get:function(){return t.template.$video.currentTime||0},set:function(n){t.template.$video.currentTime=I(n,0,e.duration)}})}(n,this),function(t,e){Object.defineProperty(e,"duration",{get:function(){return t.template.$video.duration||0}})}(n,this),function(t,e){var n=t.i18n,r=t.notice,i=t.option;Object.defineProperty(e,"switchQuality",{value:function(o){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown";if(o!==e.url){URL.revokeObjectURL(e.url);var c=e.currentTime,s=e.playing;return e.attachUrl(o).then((function(){i.url=o,e.playbackRate=!1,e.aspectRatio=!1,t.on("ready",(function(){e.currentTime=c})),s&&(e.play=!0),r.show("".concat(n.get("Switch video"),": ").concat(a)),t.emit("switch",o)}))}return null}}),Object.defineProperty(e,"switchUrl",{value:function(o){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown";if(o!==e.url){URL.revokeObjectURL(e.url);var c=e.playing;return e.attachUrl(o).then((function(){i.url=o,e.playbackRate=!1,e.aspectRatio=!1,t.on("ready",(function(){e.currentTime=0})),c&&(e.play=!0),r.show("".concat(n.get("Switch video"),": ").concat(a)),t.emit("switch",o)}))}return null}})}(n,this),function(t,e){var n=t.template,r=n.$video,i=n.$player,o=t.i18n,a=t.notice;Object.defineProperty(e,"playbackRate",{get:function(){return i.dataset.playbackRate},set:function(n){if(n){var c=[.5,.75,1,1.25,1.5,1.75,2];if(b(c.includes(n),"'playbackRate' only accept ".concat(c.toString()," as parameters")),n===i.dataset.playbackRate)return;r.playbackRate=n,i.dataset.playbackRate=n,a.show("".concat(o.get("Rate"),": ").concat(1===n?o.get("Normal"):"".concat(n,"x"))),t.emit("playbackRateChange",n)}else e.playbackRate&&(e.playbackRate=1,delete i.dataset.playbackRate,t.emit("playbackRateRemove"))}}),Object.defineProperty(e,"playbackRateReset",{set:function(n){if(n){var r=i.dataset.playbackRate;r&&(e.playbackRate=Number(r),t.emit("playbackRateReset"))}}})}(n,this),function(t,e){var n=t.template,r=n.$video,i=n.$player,o=t.i18n,a=t.notice;Object.defineProperty(e,"aspectRatio",{get:function(){return i.dataset.aspectRatio||""},set:function(n){if(n){var c=["default","4:3","16:9"];if(b(c.includes(n),"'aspectRatio' only accept ".concat(c.toString()," as parameters")),"default"===n)e.aspectRatio=!1;else{var s=n.split(":"),u=r.videoWidth,l=r.videoHeight,f=i.clientWidth,p=i.clientHeight,d=u/l,h=s[0]/s[1];if(d>h){var y=h*l/u;T(r,"width","".concat(100*y,"%")),T(r,"height","100%"),T(r,"padding","0 ".concat((f-f*y)/2,"px"))}else{var v=u/h/l;T(r,"width","100%"),T(r,"height","".concat(100*v,"%")),T(r,"padding","".concat((p-p*v)/2,"px 0"))}}i.dataset.aspectRatio=n,a.show("".concat(o.get("Aspect ratio"),": ").concat("default"===n?o.get("Default"):n)),t.emit("aspectRatioChange",n)}else e.aspectRatio&&(T(r,"width",null),T(r,"height",null),T(r,"padding",null),delete i.dataset.aspectRatio,t.emit("aspectRatioRemove"))}}),Object.defineProperty(e,"aspectRatioReset",{set:function(n){if(n&&e.aspectRatio){var r=e.aspectRatio;e.aspectRatio=r,t.emit("aspectRatioReset")}}})}(n,this),function(t,e){var n=t.option,r=t.notice,i=t.template.$video;Object.defineProperty(e,"getScreenshotDataURL",{value:function(){try{var t=document.createElement("canvas");return t.width=i.videoWidth,t.height=i.videoHeight,t.getContext("2d").drawImage(i,0,0),t.toDataURL("image/png")}catch(t){throw r.show(t),t}}}),Object.defineProperty(e,"getScreenshotBlobUrl",{value:function(){return new Promise((function(t,e){try{var n=document.createElement("canvas");n.width=i.videoWidth,n.height=i.videoHeight,n.getContext("2d").drawImage(i,0,0),n.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){r.show(t),e(t)}}))}}),Object.defineProperty(e,"screenshot",{value:function(){var r=e.getScreenshotDataURL();r&&(F(r,"".concat(n.title||"artplayer","_").concat(U(i.currentTime),".png")),t.emit("screenshot",r))}})}(n,this),function(t,e){var n=t.i18n,r=t.notice,i=t.events.destroyEvents,o=t.template.$player,a=function(){t.emit("fullscreenChange",et.isFullscreen)},c=function(){r.show(n.get("Does not support fullscreen"))};e.fullscreenIsEnabled&&(et.on("change",a),et.on("error",c),i.push((function(){et.off("change",a),et.off("error",c)}))),Object.defineProperty(e,"fullscreen",{get:function(){return et.isFullscreen},set:function(n){e.fullscreenIsEnabled?n?(e.fullscreenWeb&&(e.fullscreenWeb=!1),et.request(o).then((function(){E(o,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenEnabled")}))):(e.fullscreenWeb&&(e.fullscreenWeb=!1),et.exit().then((function(){S(o,"art-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenExit")}))):c()}}),Object.defineProperty(e,"fullscreenToggle",{set:function(t){t&&(e.fullscreen=!e.fullscreen)}}),Object.defineProperty(e,"fullscreenIsEnabled",{get:function(){return et.isEnabled}})}(n,this),function(t,e){var n=t.template.$player;Object.defineProperty(e,"fullscreenWeb",{get:function(){return $(n,"art-web-fullscreen")},set:function(r){r?(e.fullscreen&&(e.fullscreen=!1),E(n,"art-web-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenWebEnabled")):(e.fullscreen&&(e.fullscreen=!1),S(n,"art-web-fullscreen"),e.aspectRatioReset=!0,t.emit("fullscreenWebExit"))}}),Object.defineProperty(e,"fullscreenWebToggle",{set:function(t){t&&(e.fullscreenWeb=!e.fullscreenWeb)}})}(n,this),nt(n,this),function(t,e){var n=t.template.$video;Object.defineProperty(e,"loaded",{get:function(){return n.buffered.length?n.buffered.end(n.buffered.length-1)/n.duration:0}}),Object.defineProperty(e,"loadedTime",{get:function(){return n.buffered.length?n.buffered.end(n.buffered.length-1):0}})}(n,this),function(t,e){Object.defineProperty(e,"played",{get:function(){return t.template.$video.currentTime/t.template.$video.duration}})}(n,this),function(t,e){var n=t.template.$video;Object.defineProperty(e,"playing",{get:function(){return!!(n.currentTime>0&&!n.paused&&!n.ended&&n.readyState>2)}})}(n,this),function(t,e){var n=t.template,r=n.$container,i=n.$player,o=n.$video;Object.defineProperty(e,"autoSize",{get:function(){return $(r,"art-auto-size")},set:function(n){if(n){var a=o.videoWidth,c=o.videoHeight,s=r.getBoundingClientRect(),u=s.width,l=s.height,f=a/c,p=u/l;if(E(r,"art-auto-size"),p>f){T(i,"width","".concat(l*f/u*100,"%")),T(i,"height","100%")}else{var d=u/f/l*100;T(i,"width","100%"),T(i,"height","".concat(d,"%"))}t.emit("autoSizeChange",{width:e.width,height:e.height})}else S(r,"art-auto-size"),T(i,"width",null),T(i,"height",null),t.emit("autoSizeRemove")}})}(n,this),function(t,e){Object.defineProperty(e,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(t){Object.defineProperty(e,t,{get:function(){return e.rect[t]}})})),Object.defineProperty(e,"x",{get:function(){return e.left+window.pageXOffset}}),Object.defineProperty(e,"y",{get:function(){return e.top+window.pageYOffset}})}(n,this),function(t,e){Object.defineProperty(e,"flip",{get:function(){return t.template.$player.dataset.flip},set:function(e){if(e){var n=["normal","horizontal","vertical"];b(n.includes(e),"'flip' only accept ".concat(n.toString()," as parameters")),t.template.$player.dataset.flip=e,t.emit("flipChange",e)}else delete t.template.$player.dataset.flip,t.emit("flipRemove")}})}(n,this),j(n,this)};var it=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t},ot=r((function(t){function e(n,r,i){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,n){var r=it(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},e(n,r,i||n)}t.exports=e})),at=function(){function e(n){t(this,e),this.id=0,this.art=n,this.add=this.add.bind(this),this.name=this.constructor.name.toLowerCase()}return n(e,[{key:"toggle",value:function(){this.show=!this.show}},{key:"add",value:function(t,e){var n=this,r="function"==typeof t?t(this.art):t;if(!this.$parent||r.disable)return{};this.id+=1;var i=r.name||"".concat(this.name).concat(this.id);b(!w(this,i),"Cannot add a component that already has the same name: ".concat(i));var o=document.createElement("div");o.classList.value="art-".concat(this.name," art-").concat(this.name,"-").concat(i),r.html&&R(o,r.html),r.style&&D(o,r.style),r.tooltip&&M(o,r.tooltip);var a=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var c=a.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));return c?c.insertAdjacentElement("beforebegin",o):R(this.$parent,o),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(n.art,n,t)})),r.mounted&&r.mounted(o,this,this.art),e&&e(o,this,this.art),O(this,i,{value:{get $ref(){return o},set show(t){T(o,"display",t?"block":"none")}}}),this.art.emit("".concat(this.name,":add"),r),this[i]}},{key:"show",get:function(){return $(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){b(!1===t||!0===t,"The show attribute expects a boolean value");var e=this.art.template.$player,n="art-".concat(this.name,"-show");t?E(e,n):S(e,n),this.art.emit("".concat(this.name,":toggle"),t)}}]),e}();var ct=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function st(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 ut(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?st(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):st(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.i18n,o=e.player,a=R(t,r.fullscreen);M(a,i.get("Fullscreen")),n(t,"click",(function(){o.fullscreenToggle=!0})),e.on("fullscreenEnabled",(function(){T(a,"opacity","0.8"),M(a,i.get("Exit fullscreen"))})),e.on("fullscreenExit",(function(){T(a,"opacity","1"),M(a,i.get("Fullscreen"))}))}})}}function lt(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 ft(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.i18n,o=e.player,a=R(t,r.fullscreenWeb);M(a,i.get("Web fullscreen")),n(t,"click",(function(){o.fullscreenWebToggle=!0})),e.on("fullscreenWebEnabled",(function(){T(a,"opacity","0.8"),M(a,i.get("Exit web fullscreen"))})),e.on("fullscreenWebExit",(function(){T(a,"opacity","1"),M(a,i.get("Web fullscreen"))}))}})}}function pt(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 dt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.i18n,o=e.player;M(R(t,r.pip),i.get("Mini player")),n(t,"click",(function(){o.pip=!0}))}})}}function ht(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 yt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ht(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ht(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.i18n,o=e.player,a=R(t,r.play),c=R(t,r.pause);function s(){T(a,"display","flex"),T(c,"display","none")}function u(){T(a,"display","none"),T(c,"display","flex")}M(a,i.get("Play")),M(c,i.get("Pause")),n(a,"click",(function(){o.play=!0})),n(c,"click",(function(){o.pause=!0})),o.playing?u():s(),e.on("video:playing",(function(){u()})),e.on("video:pause",(function(){s()}))}})}}function vt(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 mt(t,e){var n=t.template.$progress,r=t.player,i=n.getBoundingClientRect().left,o=I(e.pageX-i,0,n.clientWidth),a=o/n.clientWidth*r.duration;return{second:a,time:U(a),width:o,percentage:I(o/n.clientWidth,0,1)}}function gt(t){return function(e){var n=e.option,r=n.highlight,i=n.theme,o=e.events.proxy,a=e.player;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:'\n <div class="art-control-progress-inner">\n <div class="art-progress-loaded"></div>\n <div class="art-progress-played" style="background: '.concat(i,'"></div>\n <div class="art-progress-highlight"></div>\n <div class="art-progress-indicator" style="background: ').concat(i,'"></div>\n <div class="art-progress-tip art-tip"></div>\n </div>\n '),mounted:function(t){var n=!1,i=x(".art-progress-loaded",t),c=x(".art-progress-played",t),s=x(".art-progress-highlight",t),u=x(".art-progress-indicator",t),l=x(".art-progress-tip",t);function f(t,e){"loaded"===t&&T(i,"width","".concat(100*e,"%")),"played"===t&&(T(c,"width","".concat(100*e,"%")),T(u,"left","calc(".concat(100*e,"% - ").concat(C(u,"width")/2,"px)")))}r.forEach((function(t){var e=I(t.time,0,a.duration)/a.duration*100;R(s,'<span data-text="'.concat(t.text,'" data-time="').concat(t.time,'" style="left: ').concat(e,'%"></span>'))})),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)})),o(t,"mousemove",(function(n){T(l,"display","block"),n.composedPath().indexOf(s)>-1?function(n){var r=mt(e,n).width,i=n.target.dataset.text;l.innerHTML=i;var o=l.clientWidth;r<=o/2?T(l,"left",0):r>t.clientWidth-o/2?T(l,"left","".concat(t.clientWidth-o,"px")):T(l,"left","".concat(r-o/2,"px"))}(n):function(n){var r=mt(e,n),i=r.width,o=r.time;l.innerHTML=o;var a=l.clientWidth;i<=a/2?T(l,"left",0):i>t.clientWidth-a/2?T(l,"left","".concat(t.clientWidth-a,"px")):T(l,"left","".concat(i-a/2,"px"))}(n)})),o(t,"mouseout",(function(){T(l,"display","none")})),o(t,"click",(function(t){if(t.target!==u){var n=mt(e,t),r=n.second;f("played",n.percentage),a.seek=r}})),o(u,"mousedown",(function(){n=!0})),o(document,"mousemove",(function(t){if(n){var r=mt(e,t),i=r.second,o=r.percentage;E(u,"art-show-indicator"),f("played",o),a.seek=i}})),o(document,"mouseup",(function(){n&&(n=!1,S(u,"art-show-indicator"))}))}})}}function bt(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 wt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?bt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.i18n,o=e.subtitle,a=R(t,r.subtitle);M(a,i.get("Hide subtitle")),n(t,"click",(function(){o.toggle()})),e.on("subtitle:toggle",(function(t){t?(T(a,"opacity","1"),M(a,i.get("Hide subtitle"))):(T(a,"opacity","0.8"),M(a,i.get("Show subtitle")))}))}})}}function Ot(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 jt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ot(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ot(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){function n(){var n="".concat(U(e.player.currentTime)," / ").concat(U(e.player.duration));n!==t.innerHTML&&(t.innerHTML=n)}n(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(t){e.on(t,n)}))}})}}function Pt(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 xt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.player,o=e.i18n,a=!1,c=R(t,r.volume),s=R(t,r.volumeClose),u=R(t,'<div class="art-volume-panel"></div>'),l=R(u,'<div class="art-volume-slider-handle"></div>');function f(t){var e=u.getBoundingClientRect(),n=e.left,r=e.width,i=l.getBoundingClientRect().width;return I(t.pageX-n-i/2,0,r-i/2)/(r-i)}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(i.muted||0===t)T(c,"display","none"),T(s,"display","flex"),T(l,"left","0");else{var e=((C(u,"width")||60)-C(l,"width"))*t;T(c,"display","flex"),T(s,"display","none"),T(l,"left","".concat(e,"px"))}}M(c,o.get("Mute")),T(s,"display","none"),p(i.volume),e.on("video:volumechange",(function(){p(i.volume)})),n(c,"click",(function(){i.muted=!0})),n(s,"click",(function(){i.muted=!1})),n(u,"click",(function(t){i.muted=!1,i.volume=f(t)})),n(l,"mousedown",(function(){a=!0})),n(document,"mousemove",(function(t){a&&(i.muted=!1,i.volume=f(t))})),n(document,"mouseup",(function(){a&&(a=!1)}))}})}}function kt(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 Et(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?kt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.i18n,o=e.setting,a=R(t,r.setting);M(a,i.get("Show setting")),n(t,"click",(function(){o.toggle()})),e.on("setting:toggle",(function(t){t?(T(a,"opacity","0.8"),M(a,i.get("Hide setting"))):(T(a,"opacity","1"),M(a,i.get("Show setting")))}))}})}}function St(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 $t(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.option.thumbnails,r=e.template.$progress,i=e.events,o=i.proxy,a=i.loadImg,c=!1,s=!1;o(r,"mousemove",(function(i){c||(c=!0,a(n.url).then((function(){s=!0}))),s&&(T(t,"display","block"),function(i){var o=mt(e,i).width,a=n.url,c=n.height,s=n.width,u=n.number,l=n.column,f=r.clientWidth/u,p=Math.floor(o/f),d=Math.ceil(p/l)-1,h=p%l||l-1;T(t,"backgroundImage","url(".concat(a,")")),T(t,"height","".concat(c,"px")),T(t,"width","".concat(s,"px")),T(t,"backgroundPosition","-".concat(h*s,"px -").concat(d*c,"px")),o<=s/2?T(t,"left",0):o>r.clientWidth-s/2?T(t,"left","".concat(r.clientWidth-s,"px")):T(t,"left","".concat(o-s/2,"px"))}(i))})),o(r,"mouseout",(function(){T(t,"display","none")}))}})}}function Rt(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 Tt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.events.proxy,r=e.icons,i=e.i18n,o=e.player,a=R(t,r.screenshot);M(a,i.get("Screenshot")),n(a,"click",(function(){o.screenshot()}))}})}}function Dt(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 Ct(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{mounted:function(t){var n=e.option.quality,r=e.events,i=r.proxy,o=r.hover,a=e.player,c=-1,s=n.find((function(t){return t.default}))||n[0];c=n.indexOf(s);var u=R(t,'<div class="art-quality-name">'.concat(s.name,"</div>")),l=n.map((function(t,e){return'<div class="art-quality-item" data-index="'.concat(e,'">').concat(t.name,"</div>")})).join(""),f=R(t,'<div class="art-qualitys">'.concat(l,"</div>"));o(t,(function(){f.style.left="-".concat(C(f,"width")/2-t.clientWidth/2,"px")})),i(f,"click",(function(t){var e=Number(t.target.dataset.index),r=n[e],i=r.url,o=r.name;i&&o&&c!==e&&(a.switchQuality(i,o),u.innerHTML=o,c=e)}))}})}}var Lt=function(e){function r(e){var n;return t(this,r),n=a(this,c(r).call(this,e)),e.on("ready",(function(){var t=e.option;n.add(gt({name:"progress",disable:t.isLive,position:"top",index:10})),n.add($t({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),n.add(yt({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(xt({name:"volume",disable:!1,position:"left",index:20})),n.add(jt({name:"time",disable:t.isLive,position:"left",index:30})),n.add(Ct({name:"quality",disable:0===t.quality.length,position:"right",index:10})),n.add(Tt({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),n.add(wt({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),n.add(Et({name:"setting",disable:!t.setting,position:"right",index:40})),n.add(dt({name:"pip",disable:!t.pip,position:"right",index:50})),n.add(ft({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),n.add(ut({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach((function(t){n.add(t)}))})),n}return u(r,e),n(r,[{key:"add",value:function(t,e){var n="function"==typeof t?t(this.art):t;b(n.position,"Controls option.position can not be empty");var i=this.art.template,o=i.$progress,a=i.$controlsLeft,s=i.$controlsRight;switch(n.position){case"top":this.$parent=o;break;case"left":this.$parent=a;break;case"right":this.$parent=s}var u=ot(c(r.prototype),"add",this).call(this,n,e);return n.disable||"top"===n.position||u.$ref.firstElementChild&&"I"===u.$ref.firstElementChild.tagName||E(u.$ref,"art-control-onlyText"),u}}]),r}(at);function At(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 Mt(t){return function(e){var n=e.i18n,r=e.player;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?At(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):At(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:"\n ".concat(n.get("Play speed"),':\n <span data-rate="0.5">0.5</span>\n <span data-rate="0.75">0.75</span>\n <span data-rate="1.0" class="art-current">').concat(n.get("Normal"),'</span>\n <span data-rate="1.25">1.25</span>\n <span data-rate="1.5">1.5</span>\n <span data-rate="2.0">2.0</span>\n '),click:function(t,e){var n=e.target.dataset.rate;n&&(r.playbackRate=Number(n),t.show=!1)},mounted:function(t){e.on("playbackRateChange",(function(e){var n=k("span",t).find((function(t){return Number(t.dataset.rate)===e}));n&&A(n,"art-current")}))}})}}function zt(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 qt(t){return function(e){var n=e.i18n,r=e.player;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:"\n ".concat(n.get("Aspect ratio"),':\n <span data-ratio="default" class="art-current">').concat(n.get("Default"),'</span>\n <span data-ratio="4:3">4:3</span>\n <span data-ratio="16:9">16:9</span>\n '),click:function(t,e){var n=e.target.dataset.ratio;n&&(r.aspectRatio=n,t.show=!1)},mounted:function(t){e.on("aspectRatioChange",(function(e){var n=k("span",t).find((function(t){return t.dataset.ratio===e}));n&&A(n,"art-current")}))}})}}function Wt(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 Vt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}function Ft(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 Ht(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ft(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ft(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:'<a href="https://artplayer.org" target="_blank">ArtPlayer 3.1.19</a>'})}function Bt(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 Nt(t){return function(e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bt(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}var It=function(e){function n(e){var r;return t(this,n),(r=a(this,c(n).call(this,e))).$parent=e.template.$contextmenu,e.on("ready",(function(){var t=e.option,n=e.template,i=n.$player,o=n.$contextmenu,a=e.events.proxy;r.add(Mt({disable:!t.playbackRate,name:"playbackRate",index:10})),r.add(qt({disable:!t.aspectRatio,name:"aspectRatio",index:20})),r.add(Vt({disable:!1,name:"info",index:30})),r.add(Ht({disable:!1,name:"version",index:40})),r.add(Nt({disable:!1,name:"close",index:50})),t.contextmenu.forEach((function(t){r.add(t)})),a(i,"contextmenu",(function(t){t.preventDefault(),r.show=!0;var e=t.clientX,n=t.clientY,a=i.getBoundingClientRect(),c=a.height,s=a.width,u=a.left,l=a.top,f=o.getBoundingClientRect(),p=f.height,d=f.width,h=e-u,y=n-l;e+d>u+s&&(h=s-d),n+p>l+c&&(y=c-p),T(o,"left","".concat(h,"px")),T(o,"top","".concat(y,"px"))})),a(i,"click",(function(t){t.composedPath().includes(o)||(r.show=!1)})),e.on("blur",(function(){r.show=!1}))})),r}return u(n,e),n}(at),Ut=function(e){function n(e){var r;t(this,n),r=a(this,c(n).call(this,e));var i=e.template,o=i.$infoPanel,s=i.$infoClose,u=i.$video;(0,e.events.proxy)(s,"click",(function(){r.show=!1}));var l=null,f=k("[data-video]",o);return e.on("destroy",(function(){clearTimeout(l)})),e.on("info:toggle",(function(t){clearTimeout(l),t&&function t(){f.forEach((function(t){var e=u[t.dataset.video];t.innerHTML="number"==typeof e?e.toFixed(2):e})),l=setTimeout((function(){t()}),1e3)}()})),r}return u(n,e),n}(at),_t=function(e){function r(e){var n;t(this,r),n=a(this,c(r).call(this,e));var i=e.events.proxy,o=e.option.subtitle,s=e.template.$subtitle;return D(s,o.style),i(n.textTrack,"cuechange",(function(){s.innerHTML="",n.activeCue&&(s.innerHTML=n.activeCue.text.split(/\r?\n/).map((function(t){return"<p>".concat(t,"</p>")})).join(""),e.emit("subtitle:update",n.activeCue.text))})),o.url&&n.init(o.url),n}return u(r,e),n(r,[{key:"switch",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown",r=this.art,i=r.i18n,o=r.notice;return this.init(t).then((function(t){return o.show("".concat(i.get("Switch subtitle"),": ").concat(n)),e.art.emit("subtitle:switch",t),t}))}},{key:"init",value:function(t){var e=this,n=this.art,r=n.notice,i=n.template,o=i.$subtitle,a=i.$track;return fetch(t).then((function(t){return t.text()})).then((function(n){switch(e.art.emit("subtitle:load",t),V(t)){case"srt":return q(z(n));case"ass":return q(W(n));case"vtt":return q(n);default:return t}})).then((function(t){return o.innerHTML="",e.url===t?t:(URL.revokeObjectURL(e.url),a.src=t,t)})).catch((function(t){throw r.show(t),e.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]}}]),r}(at);var Xt=function(){function e(n){var r=this;t(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),n.whitelist.state&&n.once("video:canplay",(function(){!function(t,e){var n=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){e.composedPath().indexOf(n)>-1?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))}))}(n,r),function(t,e){var n=t.template.$player;e.hover(n,(function(){E(n,"art-hover"),t.emit("hoverenter")}),(function(){S(n,"art-hover"),t.emit("hoverleave")}))}(n,r),function(t,e){var n=t.template,r=n.$player,i=n.$video,o=t.player,a=B((function(){E(r,"art-hide-cursor"),S(r,"art-hover"),t.controls.show=!1}),3e3);t.on("hoverleave",(function(){o.playing&&a()})),e.proxy(r,"mousemove",(function(e){a.clearTimeout(),S(r,"art-hide-cursor"),t.controls.show=!0,!t.player.pip&&o.playing&&e.target===i&&a(),t.emit("mousemove")}))}(n,r),function(t,e){var n=t.option,r=t.player,i=t.template.$player,o=document.createElement("object");o.setAttribute("aria-hidden","true"),o.setAttribute("tabindex",-1),o.type="text/html",o.data="about:blank";var a=r.width,c=r.height,s=N((function(){r.width===a&&r.height===c||(a=r.width,c=r.height,n.autoSize&&(t.player.fullscreen||t.player.fullscreenWeb||t.player.pip?t.player.autoSize=!1:t.player.autoSize=!0),t.player.aspectRatioReset=!0,t.emit("resize",{width:r.width,height:r.height}))}),500);e.proxy(o,"load",(function(){e.proxy(o.contentDocument.defaultView,"resize",s)})),i.appendChild(o)}(n,r)}))}return n(e,[{key:"proxy",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Array.isArray(e)?e.forEach((function(e){return r.proxy(t,e,n,i)})):(t.addEventListener(e,n,i),this.destroyEvents.push((function(){t.removeEventListener(e,n,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 i;if(t instanceof HTMLImageElement)i=t;else{if("string"!=typeof t)return r(t);(i=new Image).src=t}return i.complete?n(i):(e.proxy(i,"load",(function(){return n(i)})),e.proxy(i,"error",(function(){return r(i)})),t)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(t){return t()}))}}]),e}(),Yt=function(){function e(n){var r=this;t(this,e),this.art=n,this.keys={},this.art.option.hotkey&&this.art.on("ready",(function(){r.add(27,(function(){n.player.fullscreenWeb&&(n.player.fullscreenWeb=!1)})),r.add(32,(function(){n.player.toggle=!0})),r.add(37,(function(){n.player.seek=n.player.currentTime-5})),r.add(38,(function(){n.player.volume+=.1})),r.add(39,(function(){n.player.seek=n.player.currentTime+5})),r.add(40,(function(){n.player.volume-=.1})),r.init()}))}return n(e,[{key:"add",value:function(t,e){this.keys[t]?this.keys[t].push(e):this.keys[t]=[e]}},{key:"init",value:function(){var t=this;(0,this.art.events.proxy)(window,"keydown",(function(e){if(t.art.isFocus){var n=document.activeElement.tagName.toUpperCase(),r=document.activeElement.getAttribute("contenteditable");if("INPUT"!==n&&"TEXTAREA"!==n&&""!==r&&"true"!==r){var i=t.keys[e.keyCode];i&&(e.preventDefault(),i.forEach((function(t){return t()})),t.art.emit("hotkey",e))}}}))}}]),e}(),Zt=function(e){function n(e){var r;return t(this,n),(r=a(this,c(n).call(this,e))).$parent=e.template.$layer,e.on("ready",(function(){e.option.layers.forEach((function(t){r.add(t)}))})),r}return u(n,e),n}(at),Jt=function(e){function n(e){var r;return t(this,n),r=a(this,c(n).call(this,e)),R(e.template.$loading,e.icons.loading),r}return u(n,e),n}(at),Gt=function(){function e(n){t(this,e),this.art=n,this.timer=null}return n(e,[{key:"show",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=this.art.template,o=i.$player,a=i.$noticeInner;a.innerHTML=t instanceof Error?t.message.trim():t,clearTimeout(this.timer),n&&(this.timer=setTimeout((function(){e.hide()}),r)),E(o,"art-notice-show"),this.art.emit("notice:toggle",!0)}},{key:"hide",value:function(){S(this.art.template.$player,"art-notice-show"),this.art.emit("notice:toggle",!0)}}]),e}(),Qt=function(e){function n(e){var r;return t(this,n),r=a(this,c(n).call(this,e)),R(e.template.$state,e.icons.state),r}return u(n,e),n}(at),Kt=function e(n){var r=this;t(this,e);var i=Object.assign({loading:'<svg xmlns="http://www.w3.org/2000/svg" width="50px" height="50px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-default">\n <rect x="0" y="0" width="100" height="100" fill="none" class="bk"/>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(0 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-1s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(30 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(60 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(90 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.75s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(120 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(150 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(180 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(210 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(240 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(270 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.25s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(300 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(330 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"/>\n </rect>\n</svg>',state:'<svg xmlns="http://www.w3.org/2000/svg" height="60" width="60" style="filter: drop-shadow(0px 1px 1px black);" viewBox="0 0 24 24">\n <path d="M20,2H4C1.8,2,0,3.8,0,6v12c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V6C24,3.8,22.2,2,20,2z M15.6,12.8L10.5,16 C9.9,16.5,9,16,9,15.2V8.8C9,8,9.9,7.5,10.5,8l5.1,3.2C16.3,11.5,16.3,12.5,15.6,12.8z"/>\n</svg>',play:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M17.982 9.275L8.06 3.27A2.013 2.013 0 0 0 5 4.994v12.011a2.017 2.017 0 0 0 3.06 1.725l9.922-6.005a2.017 2.017 0 0 0 0-3.45z"></path>\n</svg>',pause:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M7 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2zM15 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2z"></path>\n</svg>',volume:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M10.188 4.65L6 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39V5.04a.498.498 0 0 0-.812-.39zM14.446 3.778a1 1 0 0 0-.862 1.804 6.002 6.002 0 0 1-.007 10.838 1 1 0 0 0 .86 1.806A8.001 8.001 0 0 0 19 11a8.001 8.001 0 0 0-4.554-7.222z"></path>\n <path d="M15 11a3.998 3.998 0 0 0-2-3.465v6.93A3.998 3.998 0 0 0 15 11z"></path>\n</svg>',volumeClose:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M15 11a3.998 3.998 0 0 0-2-3.465v2.636l1.865 1.865A4.02 4.02 0 0 0 15 11z"></path>\n <path d="M13.583 5.583A5.998 5.998 0 0 1 17 11a6 6 0 0 1-.585 2.587l1.477 1.477a8.001 8.001 0 0 0-3.446-11.286 1 1 0 0 0-.863 1.805zM18.778 18.778l-2.121-2.121-1.414-1.414-1.415-1.415L13 13l-2-2-3.889-3.889-3.889-3.889a.999.999 0 1 0-1.414 1.414L5.172 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39v-3.131l2.587 2.587-.01.005a1 1 0 0 0 .86 1.806c.215-.102.424-.214.627-.333l2.3 2.3a1.001 1.001 0 0 0 1.414-1.416zM11 5.04a.5.5 0 0 0-.813-.39L8.682 5.854 11 8.172V5.04z"></path>\n</svg>',subtitle:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 48 48">\n <path d="M0 0h48v48H0z" fill="none"/>\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"/>\n</svg>',screenshot:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 50 50">\n\t<path d="M 19.402344 6 C 17.019531 6 14.96875 7.679688 14.5 10.011719 L 14.097656 12 L 9 12 C 6.238281 12 4 14.238281 4 17 L 4 38 C 4 40.761719 6.238281 43 9 43 L 41 43 C 43.761719 43 46 40.761719 46 38 L 46 17 C 46 14.238281 43.761719 12 41 12 L 35.902344 12 L 35.5 10.011719 C 35.03125 7.679688 32.980469 6 30.597656 6 Z M 25 17 C 30.519531 17 35 21.480469 35 27 C 35 32.519531 30.519531 37 25 37 C 19.480469 37 15 32.519531 15 27 C 15 21.480469 19.480469 17 25 17 Z M 25 19 C 20.589844 19 17 22.589844 17 27 C 17 31.410156 20.589844 35 25 35 C 29.410156 35 33 31.410156 33 27 C 33 22.589844 29.410156 19 25 19 Z "/>\n</svg>\n',setting:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <circle cx="11" cy="11" r="2"></circle>\n <path d="M19.164 8.861L17.6 8.6a6.978 6.978 0 0 0-1.186-2.099l.574-1.533a1 1 0 0 0-.436-1.217l-1.997-1.153a1.001 1.001 0 0 0-1.272.23l-1.008 1.225a7.04 7.04 0 0 0-2.55.001L8.716 2.829a1 1 0 0 0-1.272-.23L5.447 3.751a1 1 0 0 0-.436 1.217l.574 1.533A6.997 6.997 0 0 0 4.4 8.6l-1.564.261A.999.999 0 0 0 2 9.847v2.306c0 .489.353.906.836.986l1.613.269a7 7 0 0 0 1.228 2.075l-.558 1.487a1 1 0 0 0 .436 1.217l1.997 1.153c.423.244.961.147 1.272-.23l1.04-1.263a7.089 7.089 0 0 0 2.272 0l1.04 1.263a1 1 0 0 0 1.272.23l1.997-1.153a1 1 0 0 0 .436-1.217l-.557-1.487c.521-.61.94-1.31 1.228-2.075l1.613-.269a.999.999 0 0 0 .835-.986V9.847a.999.999 0 0 0-.836-.986zM11 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"></path>\n</svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n\t<path d="m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z"></path>\n\t<path d="m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z"></path>\n\t<path d="m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z"></path>\n\t<path d="M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z"></path>\n</svg>',fullscreenWeb:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="36" width="36">\n\t<path d="m 28,11 0,14 -20,0 0,-14 z m -18,2 16,0 0,10 -16,0 0,-10 z" fill-rule="evenodd"></path>\n</svg>',pip:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="32" width="32">\n <path d="M25,17 L17,17 L17,23 L25,23 L25,17 L25,17 Z M29,25 L29,10.98 C29,9.88 28.1,9 27,9 L9,9 C7.9,9 7,9.88 7,10.98 L7,25 C7,26.1 7.9,27 9,27 L27,27 C28.1,27 29,26.1 29,25 L29,25 Z M27,25.02 L9,25.02 L9,10.97 L27,10.97 L27,25.02 L27,25.02 Z"></path>\n</svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n <path d="m 12,12 h 2 v 12 h -2 z m 3.5,6 8.5,6 V 12 z"></path>\n</svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n <path d="M 12,24 20.5,18 12,12 V 24 z M 22,12 v 12 h 2 V 12 h -2 z"></path>\n</svg>'},n.option.icons);Object.keys(i).forEach((function(t){var e=document.createElement("i");e.classList.add("art-icon"),e.classList.add("art-icon-".concat(t)),R(e,i[t]),r[t]=e}))};function te(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 ee(t){return function(e){var n=e.i18n,r=e.player;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?te(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):te(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:'\n <div class="art-setting-header">'.concat(n.get("Flip"),'</div>\n <div class="art-setting-radio">\n <div class="art-radio-item current">\n <button type="button" data-value="normal">').concat(n.get("Normal"),'</button>\n </div>\n <div class="art-radio-item">\n <button type="button" data-value="horizontal">').concat(n.get("Horizontal"),'</button>\n </div>\n <div class="art-radio-item">\n <button type="button" data-value="vertical">').concat(n.get("Vertical"),"</button>\n </div>\n </div>\n "),click:function(t,e){var n=e.target.dataset.value;n&&(r.flip=n)},mounted:function(t){e.on("flipChange",(function(e){var n=k("button",t).find((function(t){return t.dataset.value===e}));n&&A(n.parentElement,"current")}))}})}}function ne(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 re(t){return function(e){var n=e.i18n,r=e.player;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ne(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ne(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:'\n <div class="art-setting-header">'.concat(n.get("Aspect ratio"),'</div>\n <div class="art-setting-radio">\n <div class="art-radio-item current">\n <button type="button" data-value="default">').concat(n.get("Default"),'</button>\n </div>\n <div class="art-radio-item">\n <button type="button" data-value="4:3">4:3</button>\n </div>\n <div class="art-radio-item">\n <button type="button" data-value="16:9">16:9</button>\n </div>\n </div>\n '),click:function(t,e){var n=e.target.dataset.value;n&&(r.aspectRatio=n)},mounted:function(t){e.on("aspectRatioChange",(function(e){var n=k("button",t).find((function(t){return t.dataset.value===e}));n&&A(n.parentElement,"current")}))}})}}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 oe(t){return function(e){var n=e.i18n,r=e.player,i=e.events.proxy;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ie(n,!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ie(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t,{html:'\n <div class="art-setting-header">\n '.concat(n.get("Play speed"),': <span class="art-subtitle-value">1.0</span>x\n </div>\n <div class="art-setting-range">\n <input class="art-subtitle-range" value="1" type="range" min="0.5" max="2" step="0.25">\n </div>\n '),mounted:function(t){var n=x(".art-setting-range input",t),o=x(".art-subtitle-value",t);i(n,"change",(function(){var t=n.value;o.innerText=t,r.playbackRate=Number(t)})),e.on("playbackRateChange",(function(t){n.value!==t&&(n.value=t,o.innerText=t)}))}})}}var ae=function(e){function n(e){var r;t(this,n),(r=a(this,c(n).call(this,e))).$parent=e.template.$settingBody;var i=e.option,o=e.template.$setting,s=e.events.proxy;return e.option.setting&&e.on("ready",(function(){s(o,"click",(function(t){t.target===o&&(r.show=!1)})),r.add(ee({disable:!i.flip,name:"flip"})),r.add(re({disable:!i.aspectRatio,name:"aspectRatio"})),r.add(oe({disable:!i.playbackRate,name:"playbackRate"}))})),e.on("blur",(function(){r.show=!1})),r}return u(n,e),n}(at),ce=function(){function e(n){t(this,e),this.art=n,this.name="artplayer_settings";var r=n.option,i=this.get("volume");i&&(r.volume=i)}return n(e,[{key:"get",value:function(t){var e=JSON.parse(window.localStorage.getItem(this.name))||{};return t?e[t]:{}}},{key:"set",value:function(t,e){var n=Object.assign({},this.get(),ct({},t,e));window.localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(t){var e=this.get();delete e[t],window.localStorage.setItem(this.name,JSON.stringify(e))}},{key:"clean",value:function(){window.localStorage.removeItem(this.name)}}]),e}();function se(t){var e=t.i18n,n=t.subtitle,r=t.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'\n <div class="art-setting-header">\n '.concat(e.get("Subtitle offset time"),': <span class="art-subtitle-value">0</span>s\n </div>\n <div class="art-setting-range">\n <input class="art-subtitle-range" value="0" type="range" min="-5" max="5" step="0.5">\n </div>\n '),mounted:function(e){var i=x(".art-setting-range input",e),o=x(".art-subtitle-value",e);r(i,"change",(function(){var e=i.value;o.innerText=e,t.plugins.subtitleOffset.offset(Number(e))})),t.on("subtitle:switch",(function(){i.value=0,o.innerText=0})),t.on("subtitleOffset",(function(t){n.update(),i.value!==t&&(i.value=t,o.innerText=t)}))}}}function ue(t){var e=t.constructor.utils.clamp,n=t.setting,r=t.notice,i=t.template,o=t.i18n,a=t.player;n.add(se);var c=[];return t.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(n){if(i.$track&&i.$track.track){var s=Array.from(i.$track.track.cues),u=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+u,0,a.duration),t.endTime=e(c[n].endTime+u,0,a.duration)})),r.show("".concat(o.get("Subtitle offset time"),": ").concat(n,"s")),t.emit("subtitleOffset",n)}else r.show("".concat(o.get("No subtitles found"))),t.emit("subtitleOffset",0)}}}function le(t){var e=t.events.proxy,n=t.template,r=t.player,i=t.option,o=t.setting,a=t.i18n;function c(e){if(e){var o=n.$video.canPlayType(e.type);if("maybe"===o||"probably"===o){var a=URL.createObjectURL(e);i.title=e.name,r.switchUrl(a,e.name),t.emit("localVideo",e)}else b(!1,"Playback of this file format is not supported")}}function s(t){var n=R(t,'<input type="file">');T(t,"position","relative"),D(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(){o.add({title:"Local Video",name:"localVideo",index:30,html:'\n <div class="art-setting-header">\n '.concat(a.get("Local Video"),'\n </div>\n <div class="art-setting-upload">\n <div class="art-upload-btn">').concat(a.get("Open"),'</div>\n <div class="art-upload-value"></div>\n </div>\n '),mounted:function(e){var n=x(".art-upload-btn",e),r=x(".art-upload-value",e);t.on("localVideo",(function(t){r.textContent=t.name,r.title=t.name})),s(n)}})})),{name:"localVideo",attach:s}}function fe(t){var e=t.events.proxy,n=t.subtitle,r=t.setting,i=t.i18n;function o(r){var i=R(r,'<input type="file">');T(r,"position","relative"),D(i,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),e(i,"change",(function(){!function(r){if(r){var i=V(r.name);if(["ass","vtt","srt"].includes(i)){var o=new FileReader;e(o,"load",(function(e){var o=e.target.result;switch(i){case"srt":var a=q(z(o));n.switch(a,r.name);break;case"ass":var c=q(W(o));n.switch(c,r.name);break;case"vtt":var s=q(o);n.switch(s,r.name)}t.emit("localSubtitle",r)})),o.readAsText(r)}else b(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(i.files[0])}))}return t.on("ready",(function(){r.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'\n <div class="art-setting-header">\n '.concat(i.get("Local Subtitle"),'\n </div>\n <div class="art-setting-upload">\n <div class="art-upload-btn">').concat(i.get("Open"),'</div>\n <div class="art-upload-value"></div>\n </div>\n '),mounted:function(e){var n=x(".art-upload-btn",e),r=x(".art-upload-value",e);t.on("localSubtitle",(function(t){r.textContent=t.name,r.title=t.name})),o(n)}})})),{name:"localSubtitle",attach:o}}function pe(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 de(t){var e=1e4,n=0,r=0,i=0,o=null;function a(){n=0,r=0,i=0,cancelAnimationFrame(o),o=null}function c(){o||function a(){t.isDestroy||(o=requestAnimationFrame((function(){var o=Date.now();if(i){var c=o-i;r+=c,t.player.playing||(n+=c)}i=o,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}}}function he(t){var e=t.events,n=t.player,r=t.template,i=B((function(){var e=r.$player.getBoundingClientRect();e.top+e.height<=0&&!n.pip?(n.pip=!0,t.emit("autoPip",!0)):n.pip&&(n.pip=!1,t.emit("autoPip",!1))}),300);return e.proxy(window,"scroll",i),{name:"autoPip"}}var ye=function(){function e(n){var r=this;t(this,e),this.art=n,this.id=0;var i=n.option;i.subtitle.url&&i.subtitleOffset&&this.add(ue),!i.isLive&&i.miniProgressBar&&this.add(pe),i.localVideo&&this.add(le),i.localSubtitle&&this.add(fe),i.networkMonitor&&this.add(de),i.autoPip&&this.add(he),n.option.plugins.forEach((function(t){r.add(t)}))}return n(e,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),n="";return b(!w(this,n=e&&e.name?e.name:t.name?t.name:"plugin".concat(this.id)),"Cannot add a plugin that already has the same name: ".concat(n)),Object.defineProperty(this,n,{value:e}),this.art.emit("plugin:add",t),this}}]),e}(),ve=function e(n){t(this,e);var r=n.option,i=n.events.proxy,o=n.template.$video;Z.video.events.forEach((function(t){i(o,t,(function(t){n.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=I(r.volume,0,1)),r.poster&&(o.poster=r.poster),r.autoplay&&(o.autoplay=r.autoplay),o.controls=!0;var a=r.type||V(r.url),c=r.customType[a];a&&c?(n.emit("beforeCustomType",a),c(o,r.url,n),n.emit("afterCustomType",a)):(n.emit("beforeAttachUrl",r.url),o.src=r.url,n.emit("afterAttachUrl",o.src))},me=0,ge=function(e){function r(e){var n;return t(this,r),(n=a(this,c(r).call(this))).option=l(P(r.option,e),Y),n.isFocus=!1,n.isDestroy=!1,n.whitelist=new J(o(n)),n.template=new G(o(n)),n.events=new Xt(o(n)),n.whitelist.state?(n.storage=new ce(o(n)),n.icons=new Kt(o(n)),n.i18n=new tt(o(n)),n.notice=new Gt(o(n)),n.player=new rt(o(n)),n.layers=new Zt(o(n)),n.controls=new Lt(o(n)),n.contextmenu=new It(o(n)),n.subtitle=new _t(o(n)),n.info=new Ut(o(n)),n.loading=new Jt(o(n)),n.hotkey=new Yt(o(n)),n.mask=new Qt(o(n)),n.setting=new ae(o(n)),n.plugins=new ye(o(n))):n.mobile=new ve(o(n)),me+=1,n.id=me,r.instances.push(o(n)),n}return u(r,e),n(r,[{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),r.instances.splice(r.instances.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"version",get:function(){return"3.1.19"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return Z}},{key:"utils",get:function(){return _}},{key:"scheme",get:function(){return Y}},{key:"Emitter",get:function(){return f}},{key:"validator",get:function(){return l}},{key:"kindOf",get:function(){return l.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,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,autoPip:!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()}}}]),r}(f);return Object.defineProperty(ge,"instances",{value:[]}),console.log("%c ArtPlayer %c 3.1.19 %c https://artplayer.org","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),ge}));
|