From 3fc4b998411614bbba2049e17bdceb155778f6a9 Mon Sep 17 00:00:00 2001
From: Harvey
Date: Thu, 28 Apr 2022 10:37:12 +0800
Subject: [PATCH] update
---
dist/artplayer-plugin-danmuku.js | 8 -
dist/artplayer-tool-thumbnail.js | 8 -
dist/artplayer.js | 8 -
docs/mobile.html | 2 +-
docs/uncompiled/artplayer-plugin-danmuku.js | 640 --
.../artplayer-plugin-danmuku.js.map | 1 -
docs/uncompiled/artplayer-tool-thumbnail.js | 471 --
.../artplayer-tool-thumbnail.js.map | 1 -
docs/uncompiled/artplayer.js | 6271 -----------------
docs/uncompiled/artplayer.js.map | 1 -
package.json | 1 +
packages/artplayer/src/icons/index.js | 40 +-
packages/artplayer/src/index.js | 6 +-
scripts/dev.js | 6 +-
scripts/projects.js | 13 +-
15 files changed, 39 insertions(+), 7438 deletions(-)
delete mode 100644 dist/artplayer-plugin-danmuku.js
delete mode 100644 dist/artplayer-tool-thumbnail.js
delete mode 100644 dist/artplayer.js
delete mode 100644 docs/uncompiled/artplayer-plugin-danmuku.js
delete mode 100644 docs/uncompiled/artplayer-plugin-danmuku.js.map
delete mode 100644 docs/uncompiled/artplayer-tool-thumbnail.js
delete mode 100644 docs/uncompiled/artplayer-tool-thumbnail.js.map
delete mode 100644 docs/uncompiled/artplayer.js
delete mode 100644 docs/uncompiled/artplayer.js.map
diff --git a/dist/artplayer-plugin-danmuku.js b/dist/artplayer-plugin-danmuku.js
deleted file mode 100644
index 7f1826fd9..000000000
--- a/dist/artplayer-plugin-danmuku.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * artplayer-plugin-danmuku.js v4.3.0
- * Github: https://github.com/zhw2590582/ArtPlayer#readme
- * (c) 2017-2022 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="undefined"!=typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,(function(){"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n[\S ]*?)<\/d>/gi);return e&&e.length?e.map((function(t){var e=a(t.match(/(.+)<\/d>/),3),n=e[1],r=e[2],i=n.split(",");return 8===i.length&&r.trim()?{text:r,time:Number(i[0]),mode:s(Number(i[1])),fontSize:Number(i[2]),color:"#".concat(Number(i[3]).toString(16)),timestamp:Number(i[4]),pool:Number(i[5]),userID:i[6],rowID:Number(i[7])}:null})):[]}(t)}))}function l(t,e){var n=a(t.option.margin,2),r=n[0],o=n[1],s=i(t.art.template.$player),u=t.queue.filter((function(t){return t.mode===e.mode&&"emit"===t.$state&&t.$ref&&t.$ref.style.fontSize===e.$ref.style.fontSize&&parseFloat(t.$ref.style.top)<=s.height-o})).map((function(t){var e=i(t.$ref),n=e.width,r=e.height,o=e.top-s.top,a=e.left-s.left;return{top:o,left:a,height:r,width:n,right:s.width-a-n}})).sort((function(t,e){return t.top-e.top}));return 0===u.length?r:(u.unshift({top:0,left:0,right:0,height:r,width:s.width}),u.push({top:s.height-o,left:0,right:0,height:o,width:s.width}),function(t){for(var e=0,n={},r=0;rs&&(e=c,s=p)}if(0===e)for(var h=0,m=0;mh&&(h=d,e=a(g,1)[0].top)}if(0===e){var v=o.filter((function(t,e){return 0!==e&&e!==o.length-1})).sort((function(t,e){return n[t].length-n[e].length}));e=a(v,1)[0]}return e}(u))}function f(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 c(e){for(var n=1;n=e.time&&e.time>=t.art.currentTime-.1&&"wait"===e.$state})).forEach((function(e){e.$ref=function(t){var e=t.find((function(t){return t.$ref&&"wait"===t.$state}));if(e){var n=e.$ref;return e.$ref=null,n}var r=document.createElement("div");return r.style.cssText='\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n font-weight: normal;\n line-height: 1.125;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n ',r}(t.queue),t.$danmuku.appendChild(e.$ref),e.$ref.style.opacity=t.option.opacity,e.$ref.style.fontSize="".concat(t.option.fontSize,"px"),e.$ref.innerText=e.text,e.$ref.style.color=e.color||"#fff",e.$ref.style.border=e.border?"1px solid ".concat(e.color||"#fff"):"none",e.$restTime=t.option.synchronousPlayback&&t.art.playbackRate?t.option.speed/Number(t.art.playbackRate):t.option.speed,e.$lastStartTime=Date.now();var r=i(e.$ref,"width"),o=l(t,e);switch(e.$state="emit",e.mode){case 0:e.$restWidth=n+r+5,e.$ref.style.left="".concat(n,"px"),e.$ref.style.top="".concat(o,"px"),e.$ref.style.transform="translateX(".concat(-e.$restWidth,"px) translateY(0px) translateZ(0px)"),e.$ref.style.transition="transform ".concat(e.$restTime,"s linear 0s");break;case 1:e.$ref.style.top="".concat(o,"px"),e.$ref.style.left="50%",e.$ref.style.marginLeft="-".concat(r/2,"px")}}))}t.isStop||t.update()})),this}},{key:"stop",value:function(){return this.isStop=!0,this.suspend(),window.cancelAnimationFrame(this.animationFrameTimer),this.art.emit("artplayerPluginDanmuku:stop"),this}},{key:"start",value:function(){return this.isStop=!1,this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start"),this}},{key:"show",value:function(){return this.isHide=!1,this.$danmuku.style.display="block",this.art.emit("artplayerPluginDanmuku:show"),this}},{key:"hide",value:function(){return this.isHide=!0,this.$danmuku.style.display="none",this.art.emit("artplayerPluginDanmuku:hide"),this}},{key:"emit",value:function(t){var e=this.art,n=e.notice,r=e.i18n,i=this.art.constructor,o=i.utils.clamp;return(0,i.validator)(t,{text:"string",mode:"number|undefined",color:"string|undefined",time:"number|undefined",border:"boolean|undefined"}),t.text.trim()?t.text.length>this.option.maxlength?(n.show="".concat(r.get("The length of the danmu does not exceed")," ").concat(this.option.maxlength),this):(t.time?t.time=o(t.time,0,1/0):t.time=this.art.currentTime+.5,this.queue.push(c(c({mode:0},t),{},{$state:"wait",$ref:null,$restTime:0,$lastStartTime:0,$restWidth:0})),this):(n.show=r.get("Danmu text cannot be empty"),this)}}],s=[{key:"option",get:function(){return{danmuku:[],speed:5,maxlength:50,margin:[10,100],opacity:1,fontSize:25,synchronousPlayback:!1}}},{key:"scheme",get:function(){return{danmuku:"array|function|string",speed:"number",maxlength:"number",margin:"array",opacity:"number",fontSize:"number",synchronousPlayback:"boolean"}}}],a&&e(o.prototype,a),s&&e(o,s),Object.defineProperty(o,"prototype",{writable:!1}),t}();return function(t){return function(e){var n=new p(e,t);return{name:"artplayerPluginDanmuku",emit:n.emit.bind(n),config:n.config.bind(n),hide:n.hide.bind(n),show:n.show.bind(n),get isHide(){return n.isHide}}}}}));
diff --git a/dist/artplayer-tool-thumbnail.js b/dist/artplayer-tool-thumbnail.js
deleted file mode 100644
index f5e0aa5a8..000000000
--- a/dist/artplayer-tool-thumbnail.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * artplayer-tool-thumbnail.js v4.0.0
- * Github: https://github.com/zhw2590582/ArtPlayer#readme
- * (c) 2017-2022 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="undefined"!=typeof globalThis?globalThis:t||self).ArtplayerToolThumbnail=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return t(this,h),(e=u.call(this)).processing=!1,e.option={},e.setup(Object.assign({},h.DEFAULTS,i)),e.video=h.creatVideo(),e.duration=0,e.inputChange=e.inputChange.bind(n(e)),e.ondrop=e.ondrop.bind(n(e)),e.option.fileInput.addEventListener("change",e.inputChange),e.option.fileInput.addEventListener("dragover",h.ondragover),e.option.fileInput.addEventListener("drop",h.ondrop),e}return r=h,a=[{key:"ondrop",value:function(t){t.preventDefault();var e=t.dataTransfer.files[0];this.loadVideo(e)}},{key:"setup",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.option=Object.assign({},this.option,e);var n=this.option,i=n.fileInput,o=n.number,r=n.width,a=n.column;if(this.errorHandle(i instanceof Element,"The 'fileInput' is not a Element"),"INPUT"!==i.tagName||"file"!==i.type){i.style.position="relative";var s=document.createElement("input");s.type="file",s.style.position="absolute",s.style.width="100%",s.style.height="100%",s.style.left="0",s.style.top="0",s.style.right="0",s.style.bottom="0",s.style.opacity="0",i.appendChild(s),this.option.fileInput=s}return["number","width","column","begin","end"].forEach((function(e){t.errorHandle("number"==typeof t.option[e],"The '".concat(e,"' is not a number"))})),this.option.number=l(o,10,1e3),this.option.width=l(r,10,1e3),this.option.column=l(a,1,1e3),this}},{key:"inputChange",value:function(t){var e=this.option.fileInput.files[0];this.loadVideo(e),t.target.value=""}},{key:"loadVideo",value:function(t){if(t){var e=this.video.canPlayType(t.type);this.errorHandle("maybe"===e||"probably"===e,"Playback of this file format is not supported: ".concat(t.type));var n=URL.createObjectURL(t);this.videoUrl=n,this.file=t,this.emit("file",this.file),this.video.src=n,this.emit("video",this.video)}}},{key:"start",value:function(){var t,e=this;if(!this.video.duration)return(t=1e3,new Promise((function(e){return setTimeout(e,t)}))).then((function(){return e.start()}));var n=this.option,i=n.width,o=n.number,r=n.begin,a=n.end,s=this.video.videoHeight/this.video.videoWidth*i;this.option.height=s,this.option.begin=l(r,0,this.video.duration),this.option.end=l(a||this.video.duration,r,this.video.duration),this.errorHandle(this.option.end>this.option.begin,"End time must be greater than the start time"),this.duration=this.option.end-this.option.begin,this.density=o/this.duration,this.errorHandle(this.file&&this.video,"Please select the video file first"),this.errorHandle(!this.processing,"There is currently a task in progress, please wait a moment..."),this.errorHandle(this.density<=1,"The preview density cannot be greater than 1, but got ".concat(this.density));var u=this.creatScreenshotDate(),c=this.creatCanvas(),h=c.getContext("2d");this.emit("canvas",c);var f,p=u.map((function(t,n){return function(){return new Promise((function(r){e.video.oncanplay=function(){h.drawImage(e.video,t.x,t.y,i,s),c.toBlob((function(t){e.thumbnailUrl&&URL.revokeObjectURL(e.thumbnailUrl),e.thumbnailUrl=URL.createObjectURL(t),e.emit("update",e.thumbnailUrl,(n+1)/o),e.video.oncanplay=null,r()}))},e.video.currentTime=t.time}))}}));return this.processing=!0,(f=p,f.reduce((function(t,e){return t.then(e)}),Promise.resolve())).then((function(){e.processing=!1,e.emit("done")})).catch((function(t){throw e.processing=!1,e.emit("error",t.message),t}))}},{key:"creatScreenshotDate",value:function(){for(var t=this.option,e=t.number,n=t.width,i=t.height,o=t.column,r=t.begin,a=this.duration/e,s=[r+a];s.length1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector(t)}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(e.querySelectorAll(t))}function b(t,e){return t.classList.add(e)}function w(t,e){return t.classList.remove(e)}function x(t,e){return t.classList.contains(e)}function O(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function k(t,e,r){return t.style[e]=r,t}function j(t,e){return Object.keys(e).forEach((function(r){k(t,r,e[r])})),t}function P(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=window.getComputedStyle(t,null).getPropertyValue(e);return r?parseFloat(n):n}function E(t){return Array.from(t.parentElement.children).filter((function(e){return e!==t}))}function S(t,e){E(t).forEach((function(t){return w(t,e)})),b(t,e)}function T(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";d||(t.setAttribute("aria-label",e),t.setAttribute("data-balloon-pos",r))}function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,o=window.innerWidth||document.documentElement.clientWidth,i=r.top-e<=n&&r.top+r.height+e>=0,a=r.left-e<=o+e&&r.left+r.width+e>=0;return i&&a}function C(t,e){return t.composedPath&&t.composedPath().indexOf(e)>-1}function I(t,e){return e.parentNode.replaceChild(t,e),t}function L(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function $(t,e,r){return $=L()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&o(i,r.prototype),i},$.apply(null,arguments)}function A(t){var e="function"==typeof Map?new Map:void 0;return A=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return $(t,arguments,l(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,t)},A(t)}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l(t);if(e){var o=l(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}var _=function(e){i(a,e);var o=D(a);function a(e,r){var i;return t(this,a),i=o.call(this,e),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(n(i),r||i.constructor),i.name="ArtPlayerError",i}return r(a)}(A(Error));function M(t,e){if(!t)throw new _(e);return t}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 N(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function F(t){var e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/[:.]/).map((function(t,e,r){if(e===r.length-1){if(1===t.length)return".".concat(t,"00");if(2===t.length)return".".concat(t,"0")}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?".".concat(t):":".concat(t)})).join("")}return"WEBVTT\n\n".concat(t.split(/\r?\n/).map((function(t){var n=t.match(e);return n?{start:r(n[1].trim()),end:r(n[2].trim()),text:n[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(t){return t.trim()})).join("\n")}:null})).filter((function(t){return t})).map((function(t,e){return t?"".concat(e+1,"\n").concat(t.start," --\x3e ").concat(t.end,"\n").concat(t.text):""})).filter((function(t){return t.trim()})).join("\n\n"))}function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#000",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return[[e,0],[0,e],[-e,0],[0,-e],[e,e],[-e,-e],[e,-e],[-e,e]].map((function(e){return"".concat(t," ").concat(e[0],"px ").concat(e[1],"px ").concat(r,"px")})).join(",")}function H(t){return t.includes("?")?H(t.split("?")[0]):t.includes("#")?H(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function V(t,e){var r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(e){return setTimeout(e,t)}))}function J(t,e){var r,n,o=!1;return function i(){for(var a=arguments.length,c=new Array(a),l=0;l0?[e,r,n]:[r,n]).map((function(t){return t<10?"0".concat(t):String(t)})).join(":")}function et(t){return t.replace(/[&<>'"]/g,(function(t){return{"&":"&","<":"<",">":">","'":"'",'"':"""}[t]||t}))}var rt=Object.freeze({__proto__:null,query:m,queryAll:g,addClass:b,removeClass:w,hasClass:x,append:O,remove:function(t){return t.parentNode.removeChild(t)},setStyle:k,setStyles:j,getStyle:P,sublings:E,inverseClass:S,tooltip:T,isInViewport:R,includeFromEvent:C,replaceElement:I,ArtPlayerError:_,errorHandle:M,srtToVtt:z,vttToBlob:N,assToVtt:F,outline:B,getExt:H,download:V,def:U,has:Y,get:Z,mergeDeep:X,sleep:Q,debounce:function(t,e,r){var n;function o(){for(var o=arguments.length,i=new Array(o),a=0;a-1;case"function":return t(f);case"regexp":return t.test(f);default:return!1}}))}}]),e}(),yt=function(){function e(r){var n=this;t(this,e),this.art=r;var o=r.option,i=r.constructor,a=r.whitelist;o.container instanceof Element?this.$container=o.container:(this.$container=m(o.container),M(this.$container,"No container element found by ".concat(o.container)));var c=this.$container.tagName.toLowerCase();M("div"===c,"Unsupported container element type, only support 'div' but got '".concat(c,"'")),M(i.instances.every((function(t){return t.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),this.query=this.query.bind(this),this.$container.dataset.artId=r.id,this.$original=this.$container.cloneNode(!0),a.state?this.desktop():this.mobile()}return r(e,[{key:"query",value:function(t){return m(t,this.$container)}},{key:"desktop",value:function(){var t=this.art.option;t.useSSR||(this.$container.innerHTML=e.html),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$poster=this.query(".art-poster"),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.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$miniHeader=this.query(".art-mini-header"),this.$miniTitle=this.query(".art-mini-title"),this.$miniClose=this.query(".art-mini-close"),this.$contextmenu=this.query(".art-contextmenus"),t.backdrop&&(b(this.$setting,"art-backdrop-filter"),b(this.$contextmenu,"art-backdrop-filter"),b(this.$info,"art-backdrop-filter")),d&&b(this.$player,"art-mobile")}},{key:"mobile",value:function(){this.$container.innerHTML='',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(t){t?I(this.$original,this.$container):b(this.$player,"art-destroy")}}],[{key:"html",get:function(){return''}}]),e}(),mt={"Video Info":"统计信息",Close:"关闭","Video Load Failed":"加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音","Video Flip":"画面翻转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide Subtitle":"隐藏字幕","Show Subtitle":"显示字幕","Show Setting":"显示设置","Hide Setting":"隐藏设置",Screenshot:"截图","Play Speed":"播放速度","Aspect Ratio":"画面比例",Default:"默认",Normal:"正常",Open:"打开","Switch Video":"切换","Switch Subtitle":"切换字幕",Fullscreen:"全屏","Exit Fullscreen":"退出全屏","Web Fullscreen":"网页全屏","Exit Web Fullscreen":"退出网页全屏","Mini Player":"迷你播放器","PIP Mode":"画中画模式","Exit PIP Mode":"退出画中画模式","PIP Not Supported":"不支持画中画模式","Fullscreen Not Supported":"不支持全屏模式","Subtitle Offset":"字幕偏移","Auto playback at":"已为您定位至"},gt={"Video Info":"統計訊息",Close:"關閉","Video Load Failed":"載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音","Video Flip":"畫面翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide Subtitle":"隱藏字幕","Show Subtitle":"顯示字幕","Show Setting":"顯示设置","Hide Setting":"隱藏设置",Screenshot:"截圖","Play Speed":"播放速度","Aspect Ratio":"畫面比例",Default:"默認",Normal:"正常",Open:"打開","Switch Video":"切換","Switch Subtitle":"切換字幕",Fullscreen:"全屏","Exit Fullscreen":"退出全屏","Web Fullscreen":"網頁全屏","Exit Web Fullscreen":"退出網頁全屏","Mini Player":"迷你播放器","PIP Mode":"畫中畫模式","Exit PIP Mode":"退出畫中畫模式","PIP Not Supported":"不支持畫中畫模式","Fullscreen Not Supported":"不支持全屏模式","Subtitle Offset":"字幕偏移","Auto playback at":"已為您定位至"},bt=function(){function e(r){t(this,e),this.art=r,this.languages={"zh-cn":mt,"zh-tw":gt},this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option.lang.toLowerCase();this.language=this.languages[t]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){this.languages=X(this.languages,t),this.init()}}]),e}();var wt={exports:{}};!function(t){!function(){var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},r=t.exports,n=function(){for(var t,r=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,o=r.length,i={};nd){var h=d*s/l;k(r,"width","".concat(100*h,"%")),k(r,"height","100%"),k(r,"padding","0 ".concat((u-u*h)/2,"px"))}else{var v=l/d/s;k(r,"width","100%"),k(r,"height","".concat(100*v,"%")),k(r,"padding","".concat((p-p*v)/2,"px 0"))}n.dataset.aspectRatio=e}i.show="".concat(o.get("Aspect Ratio"),": ").concat("default"===e?o.get("Default"):e),t.emit("aspectRatio",e)}}),U(t,"aspectRatioReset",{set:function(e){if(e){var r=t.aspectRatio;t.aspectRatio=r}}})}(r),function(t){var e=t.option,r=t.notice,n=t.template.$video,o=document.createElement("canvas");U(t,"getDataURL",{value:function(){return new Promise((function(t,e){try{o.width=n.videoWidth,o.height=n.videoHeight,o.getContext("2d").drawImage(n,0,0),t(o.toDataURL("image/png"))}catch(t){r.show=t,e(t)}}))}}),U(t,"getBlobUrl",{value:function(){return new Promise((function(t,e){try{o.width=n.videoWidth,o.height=n.videoHeight,o.getContext("2d").drawImage(n,0,0),o.toBlob((function(e){t(URL.createObjectURL(e))}))}catch(t){r.show=t,e(t)}}))}}),U(t,"screenshot",{value:function(){return t.getDataURL().then((function(r){return V(r,"".concat(e.title||"artplayer","_").concat(tt(n.currentTime),".png")),t.emit("screenshot",r),r}))}})}(r),Ot(r),function(t){var e=t.notice,r=t.template.$player;U(t,"fullscreenWeb",{get:function(){return x(r,"art-fullscreen-web")},set:function(n){n?(b(r,"art-fullscreen-web"),t.aspectRatioReset=!0,t.autoSize=!1,t.emit("resize"),t.emit("fullscreenWeb",!0),e.show=""):(w(r,"art-fullscreen-web"),t.aspectRatioReset=!0,t.autoSize=t.option.autoSize,t.emit("resize"),t.emit("fullscreenWeb"),e.show="")}})}(r),kt(r),function(t){var e=t.template.$video;U(t,"loaded",{get:function(){return t.loadedTime/e.duration}}),U(t,"loadedTime",{get:function(){return e.buffered.length?e.buffered.end(e.buffered.length-1):0}})}(r),function(t){U(t,"played",{get:function(){return t.currentTime/t.duration}})}(r),function(t){var e=t.template.$video;U(t,"playing",{get:function(){return!!(e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2)}})}(r),function(t){var e=t.template,r=e.$container,n=e.$player,o=e.$video;U(t,"autoSize",{get:function(){return x(r,"art-auto-size")},set:function(e){if(e){var i=o.videoWidth,a=o.videoHeight,c=r.getBoundingClientRect(),l=c.width,s=c.height,u=i/a,p=l/s;if(b(r,"art-auto-size"),p>u)k(n,"width","".concat(s*u/l*100,"%")),k(n,"height","100%");else{var f=l/u/s*100;k(n,"width","100%"),k(n,"height","".concat(f,"%"))}t.emit("autoSize",{width:t.width,height:t.height})}else w(r,"art-auto-size"),k(n,"width",null),k(n,"height",null),t.emit("autoSize")}})}(r),function(t){U(t,"rect",{get:function(){return t.template.$player.getBoundingClientRect()}});for(var e=["bottom","height","left","right","top","width"],r=function(r){var n=e[r];U(t,n,{get:function(){return t.rect[n]}})},n=0;n=1?(e=[n,o],t.emit("loop",e)):(e=[],t.emit("loop"))}else e=[],t.emit("loop")}}),t.on("video:timeupdate",(function(){e.length&&(t.currentTimee[1])&&(t.seek=e[0])}))}(r),function(t){var e=t.option,r=t.template.$poster;U(t,"poster",{get:function(){return e.poster},set:function(t){e.poster=t,k(r,"backgroundImage","url(".concat(t,")"))}})}(r),function(t){var e=t.option,r=t.template,n=r.$container,o=r.$video,i=n.style.height;U(t,"autoHeight",{get:function(){return x(n,"art-auto-height")},set:function(r){if(r){var a=n.clientWidth,c=o.videoHeight*(a/o.videoWidth);k(n,"height",c+"px"),b(n,"art-auto-height"),t.autoSize=e.autoSize,t.emit("autoHeight",c)}else k(n,"height",i),w(n,"art-auto-height"),t.autoSize=e.autoSize,t.emit("autoHeight")}})}(r),function(t){var e=t.option,r=t.template.$player;U(t,"theme",{get:function(){return getComputedStyle(r).getPropertyValue("--theme")},set:function(t){e.theme=t,r.style.setProperty("--theme",t)}})}(r),function(t){U(t,"title",{get:function(){return t.option.title},set:function(e){t.option.title=e}})}(r),function(t){var e=["mini","pip","fullscreen","fullscreenWeb"];!function(e){for(var r=function(r){var n=e[r];t.on(n,(function(){t[n]&&e.filter((function(t){return t!==n})).forEach((function(e){t[e]&&(t[e]=!1)}))}))},n=0;n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(l&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(Rt);var Ct=Rt.exports,It=function(){function e(r){t(this,e),this.id=0,this.art=r,this.add=this.add.bind(this)}return r(e,[{key:"show",get:function(){return x(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(t){var e=this.art.template.$player,r="art-".concat(this.name,"-show");t?b(e,r):w(e,r),this.art.emit(this.name,t)}},{key:"toggle",set:function(t){t&&(this.show=!this.show)}},{key:"add",value:function(t){var e=this,r="function"==typeof t?t(this.art):t;if(r.html=r.html||"",u(r,ft),this.$parent&&this.name&&!r.disable){var n=r.name||"".concat(this.name).concat(this.id);M(!Y(this,n),"Cannot add an existing name [".concat(n,"] to the [").concat(this.name,"]")),this.id+=1;var o=document.createElement("div");b(o,"art-".concat(this.name)),b(o,"art-".concat(this.name,"-").concat(n));var i=Array.from(this.$parent.children);o.dataset.index=r.index||this.id;var a=i.find((function(t){return Number(t.dataset.index)>=Number(o.dataset.index)}));return a?a.insertAdjacentElement("beforebegin",o):O(this.$parent,o),r.html&&O(o,r.html),r.style&&j(o,r.style),r.tooltip&&T(o,r.tooltip),r.click&&this.art.events.proxy(o,"click",(function(t){t.preventDefault(),r.click.call(e.art,e,t)})),r.selector&&["left","right"].includes(r.position)&&this.selector(r,o),r.mounted&&r.mounted.call(this.art,o),1===o.childNodes.length&&3===o.childNodes[0].nodeType&&b(o,"art-control-onlyText"),U(this,n,{value:o}),o}}},{key:"selector",value:function(t,e){var r=this,n=this.art.events,o=n.hover,i=n.proxy;b(e,"art-control-selector");var a=document.createElement("div");b(a,"art-selector-value"),O(a,t.html),e.innerText="",O(e,a);var c=t.selector.map((function(t,e){return'').concat(t.html,"
")})).join(""),l=document.createElement("div");b(l,"art-selector-list"),O(l,c),O(e,l);var s=function(){var t=P(e,"width")/2-P(l,"width")/2;l.style.left="".concat(t,"px")};o(e,s),i(l,"click",function(){var e=Tt(Ct.mark((function e(n){var o,i,c,l,u;return Ct.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.composedPath()||[],i=o.find((function(t){return x(t,"art-selector-item")}))){e.next=4;break}return e.abrupt("return");case 4:if(S(i,"art-current"),c=Number(i.dataset.index),l=t.selector[c]||{},a.innerText=i.innerText,!t.onSelect){e.next=13;break}return e.next=11,t.onSelect.call(r.art,l,i,n);case 11:"string"!=typeof(u=e.sent)&&"number"!=typeof u||(a.innerHTML=u);case 13:s(),r.art.emit("selector",l,i);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}}]),e}();function Lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $t(t){for(var e=1;e',mounted:function(t){var i=!1,a=m(".art-progress-loaded",t),c=m(".art-progress-played",t),l=m(".art-progress-highlight",t),s=m(".art-progress-indicator",t),u=m(".art-progress-tip",t);k(c,"backgroundColor","var(--theme)");var p=e.constructor.INDICATOR_SIZE;function f(t,e){"loaded"===t&&k(a,"width","".concat(100*e,"%")),"played"===t&&(k(c,"width","".concat(100*e,"%")),k(s,"left","calc(".concat(100*e,"% - ").concat(p/2,"px)")))}r.indicator?(p=e.constructor.INDICATOR_SIZE_ICON,O(s,r.indicator)):j(s,{backgroundColor:"var(--theme)"}),d&&(p=e.constructor.INDICATOR_SIZE_MOBILE,r.indicator&&(p=e.constructor.INDICATOR_SIZE_MOBILE_ICON)),j(s,{left:"-".concat(p/2,"px"),width:"".concat(p,"px"),height:"".concat(p,"px")});for(var h=0;h'))}f("loaded",e.loaded),e.on("setBar",(function(t,e){f(t,e)})),e.on("video:progress",(function(){f("loaded",e.loaded)})),e.on("video:timeupdate",(function(){f("played",e.played)})),e.on("video:ended",(function(){f("played",1)})),d||(o(t,"click",(function(t){if(t.target!==s){var r=Ht(e,t),n=r.second;f("played",r.percentage),e.seek=n}})),o(t,"mousemove",(function(r){k(u,"display","block"),C(r,l)?function(r){var n=Ht(e,r).width,o=r.target.dataset.text;u.innerHTML=o;var i=u.clientWidth;n<=i/2?k(u,"left",0):n>t.clientWidth-i/2?k(u,"left","".concat(t.clientWidth-i,"px")):k(u,"left","".concat(n-i/2,"px"))}(r):function(r){var n=Ht(e,r),o=n.width,i=n.time;u.innerHTML=i;var a=u.clientWidth;o<=a/2?k(u,"left",0):o>t.clientWidth-a/2?k(u,"left","".concat(t.clientWidth-a,"px")):k(u,"left","".concat(o-a/2,"px"))}(r)})),o(t,"mouseout",(function(){k(u,"display","none")})),o(s,"mousedown",(function(){i=!0})),o(document,"mousemove",(function(t){if(i){var r=Ht(e,t),n=r.second;f("played",r.percentage),e.seek=n}})),o(document,"mouseup",(function(){i&&(i=!1)})))}})}}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qt(t){for(var e=1;eo.clientWidth-f/2?k(t,"left","".concat(o.clientWidth-f,"px")):k(t,"left","".concat(a-f/2,"px"))}(n))})),c(o,"mouseout",(function(){k(t,"display","none")}))}})}}function ee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function re(t){for(var e=1;e=a.CONTROL_HIDE_TIME&&(r.show=!1,b(l,"art-hide-cursor"),w(l,"art-hover"))})),e.once("video:loadedmetadata",(function(){r.add(Vt({name:"progress",disable:i.isLive,position:"top",index:10})),r.add(te({name:"thumbnails",disable:!i.thumbnails.url||i.isLive||d,position:"top",index:20})),r.add(function(t){return function(e){return ae(ae({},t),{},{mounted:function(t){var r=O(t,''),n=O(t,'');e.on("loop",(function(o){o?(k(t,"display","block"),k(r,"left","calc(".concat(o[0]/e.duration*100,"% - ").concat(r.clientWidth,"px)")),k(n,"left","".concat(o[1]/e.duration*100,"%"))):k(t,"display","none")}))}})}}({name:"loop",disable:!1,position:"top",index:30})),r.add(function(t){return function(e){return Nt(Nt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=O(t,n.play),a=O(t,n.pause);function c(){k(i,"display","flex"),k(a,"display","none")}function l(){k(i,"display","none"),k(a,"display","flex")}T(i,o.get("Play")),T(a,o.get("Pause")),r(i,"click",(function(){e.play()})),r(a,"click",(function(){e.pause()})),e.playing?l():c(),e.on("video:playing",(function(){l()})),e.on("video:pause",(function(){c()}))}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),r.add(function(t){return function(e){return Zt(Zt({},t),{},{mounted:function(t){var r=e.events.proxy,n=e.icons,o=e.i18n,i=!1,a=e.constructor.VOLUME_PANEL_WIDTH,c=e.constructor.VOLUME_HANDLE_WIDTH,l=O(t,n.volume),s=O(t,n.volumeClose),u=O(t,''),p=O(u,'');function f(t){var e=u.getBoundingClientRect().left;return K(t.pageX-e-c/2,0,a-c/2)/(a-c)}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(e.muted||0===t)k(l,"display","none"),k(s,"display","flex"),k(p,"left","0");else{var r=(a-c)*t;k(l,"display","flex"),k(s,"display","none"),k(p,"left","".concat(r,"px"))}}T(l,o.get("Mute")),k(s,"display","none"),d&&k(u,"display","none"),h(e.volume),e.on("video:volumechange",(function(){h(e.volume)})),r(l,"click",(function(){e.muted=!0})),r(s,"click",(function(){e.muted=!1})),r(u,"click",(function(t){e.muted=!1,e.volume=f(t)})),r(p,"mousedown",(function(){i=!0})),r(t,"mousemove",(function(t){i&&(e.muted=!1,e.volume=f(t))})),r(document,"mouseup",(function(){i&&(i=!1)}))}})}}({name:"volume",disable:!1,position:"left",index:20})),r.add(function(t){return function(e){return Gt(Gt({},t),{},{mounted:function(t){function r(){var r="".concat(tt(e.currentTime)," / ").concat(tt(e.duration));r!==t.innerText&&(t.innerText=r)}r();for(var n=["video:loadedmetadata","video:timeupdate","video:progress"],o=0;o0.50.75').concat(r.get("Normal"),'1.251.52.0'),click:function(t,r){var n=r.target.dataset.value;n&&(e.playbackRate=Number(n),t.show=!1)},mounted:function(t){e.on("playbackRate",(function(e){var r=g("span",t).find((function(t){return Number(t.dataset.value)===e}));r&&S(r,"art-current")}))}})}}({disable:!r.playbackRate,name:"playbackRate",index:10})),this.add(function(t){return function(e){var r=e.i18n;return fe(fe({},t),{},{html:"".concat(r.get("Aspect Ratio"),':').concat(r.get("Default"),'4:316:9'),click:function(t,r){var n=r.target.dataset.value;n&&(e.aspectRatio=n,t.show=!1)},mounted:function(t){e.on("aspectRatio",(function(e){var r=g("span",t).find((function(t){return t.dataset.value===e}));r&&S(r,"art-current")}))}})}}({disable:!r.aspectRatio,name:"aspectRatio",index:20})),this.add(function(t){return function(e){var r=e.i18n;return he(he({},t),{},{html:"".concat(r.get("Video Flip"),':').concat(r.get("Normal"),'').concat(r.get("Horizontal"),'').concat(r.get("Vertical"),""),click:function(t,r){var n=r.target.dataset.value;n&&(e.flip=n,t.show=!1)},mounted:function(t){e.on("flip",(function(e){var r=g("span",t).find((function(t){return t.dataset.value===e}));r&&S(r,"art-current")}))}})}}({disable:!r.flip,name:"flip",index:30})),this.add(function(t){return function(e){return ye(ye({},t),{},{html:e.i18n.get("Video Info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:40})),this.add(function(t){return ge(ge({},t),{},{html:'ArtPlayer 4.3.11'})}({disable:!1,name:"version",index:50})),this.add(function(t){return function(e){return we(we({},t),{},{html:e.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:60}));for(var c=0;cs+l&&(h=l-d),n+f>u+c&&(v=c-f),j(i,{top:"".concat(v,"px"),left:"".concat(h,"px")})})),a(o,"click",(function(e){C(e,i)||(t.show=!1)})),this.art.on("blur",(function(){t.show=!1}))}}]),o}(It);function ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l(t);if(e){var o=l(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}var je=function(e){i(o,e);var n=ke(o);function o(e){var r;return t(this,o),(r=n.call(this,e)).name="info",e.once("video:loadedmetadata",(function(){d||r.init()})),r}return r(o,[{key:"init",value:function(){var t=this,e=this.art,r=e.constructor,n=e.events.proxy,o=e.template,i=o.$infoPanel,a=o.$infoClose,c=o.$video;n(a,"click",(function(){t.show=!1}));var l=null,s=g("[data-video]",i)||[];this.art.on("destroy",(function(){clearTimeout(l)})),function t(){for(var e=0;e".concat(et(t),"
")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.art,n=r.i18n,o=r.notice,i=r.option,a=Ee(Ee(Ee({},i.subtitle),e),{},{url:t});return this.init(a).then((function(t){return e.name&&(o.show="".concat(n.get("Switch Subtitle"),": ").concat(e.name)),t}))}},{key:"init",value:function(t){var e=this;if(u(t,dt.subtitle),t.url){var r=this.art,n=r.notice,o=r.events.proxy,i=r.template,a=i.$subtitle,c=i.$video;if(!i.$track){var l=document.createElement("track");l.default=!0,l.kind="metadata",c.appendChild(l),this.art.template.$track=l,o(this.textTrack,"cuechange",this.update.bind(this))}return this.style(Ee({"text-shadow":B()},t.style)),M(window.fetch,"fetch not support"),fetch(t.url).then((function(t){return t.arrayBuffer()})).then((function(r){M(window.TextDecoder,"TextDecoder not support");var n=new TextDecoder(t.encoding).decode(r);switch(e.art.emit("subtitleLoad",t.url),t.type||H(t.url)){case"srt":return N(z(n));case"ass":return N(F(n));case"vtt":return N(n);default:return t.url}})).then((function(t){return a.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t,e.art.emit("subtitleSwitch",t)),t})).catch((function(t){throw n.show=t,t}))}}}]),o}(It);var Re=function(){function e(r){var n=this;t(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("video:loadedmetadata",(function(){!function(t,e){var r=t.constructor,n=t.template,o=n.$player,i=n.$video;e.proxy(document,["click","contextmenu"],(function(e){C(e,o)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))}));var a=0;e.proxy(i,"click",(function(){var e=Date.now();e-a<=r.DB_CLICE_TIME?(t.emit("dblclick"),d?t.toggle():t.fullscreen=!t.fullscreen):(t.emit("click"),d||t.toggle()),a=e}))}(r,n),function(t,e){var r=t.template.$player;e.hover(r,(function(){b(r,"art-hover"),t.emit("hover",!0)}),(function(){w(r,"art-hover"),t.emit("hover")}))}(r,n),function(t,e){var r=t.template.$player;e.proxy(r,"mousemove",(function(e){t.emit("mousemove",e)}))}(r,n),function(t,e){var r=t.notice,n=t.option,o=J((function(){t.normalSize&&(t.autoSize=n.autoSize),t.aspectRatioReset=!0,r.show="",t.emit("resize")}),t.constructor.RESIZE_TIME);e.proxy(window,["orientationchange","resize"],(function(){o()})),screen&&screen.orientation&&screen.orientation.onchange&&e.proxy(screen.orientation,"change",(function(){o()}))}(r,n),function(t,e){if(d&&!t.option.isLive){var r=t.notice,n=t.plugins,o=t.template,i=o.$video,a=o.$bottom,c=o.$controls,l=!1,s=0,u=0,p=0,f=function(e){if(1===e.touches.length){l=!0;var r=e.touches[0],n=r.clientX,o=r.clientY;s=n,u=o,p=t.currentTime}},h=function(e){if(1===e.touches.length&&l&&t.duration){var o=n.autoOrientation&&n.autoOrientation.state,i=e.touches[0],a=i.clientX,c=i.clientY,f=K((a-s)/t.width,-1,1),d=K((c-u)/t.height,-1,1),h=o?d:f,v=K(p+t.duration*h,0,t.duration);t.seek=v,t.emit("setBar","played",K(v/t.duration,0,1)),r.show="".concat(tt(v)," / ").concat(tt(t.duration))}};e.proxy(a,"touchstart",(function(t){C(t,c)||f(t)})),e.proxy(a,"touchmove",h),e.proxy(i,"touchstart",f),e.proxy(i,"touchmove",h),e.proxy(document,"touchend",(function(){l&&(s=0,u=0,p=0,l=!1)}))}}(r,n),function(t,e){var r=t.option,n=t.constructor,o=t.template.$container,i=J((function(){t.emit("view",R(o,n.SCROLL_GAP))}),n.SCROLL_TIME);e.proxy(window,"scroll",(function(){i()})),t.on("view",(function(e){r.autoMini&&(t.mini=!e)}))}(r,n)}))}return r(e,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(new _("Unable to get Image"));(o=new Image).src=t}if(o.complete)return r(o);e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(new _("Failed to load Image: ".concat(o.src)))}))}))}},{key:"destroy",value:function(){for(var t=0;t',state:'',play:'',pause:'',check:'',volume:'',volumeClose:'',subtitle:'',screenshot:'',setting:'',fullscreen:'',fullscreenWeb:'',pip:'',arrowLeft:'',arrowRight:'',playbackRate:'',aspectRatio:'',config:'',lock:'',unlock:''},r.option.icons);Object.keys(o).forEach((function(t){U(n,t,{get:function(){var e=document.createElement("i");return b(e,"art-icon"),b(e,"art-icon-".concat(t)),O(e,o[t]),e}})}))}));function Fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l(t);if(e){var o=l(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}function Be(t,e,r){for(var n=0;n'),c=document.createElement("div");b(c,"art-setting-item-left-icon"),O(c,n.arrowLeft),O(a,c),O(a,t._parentItem.html);var l=o(i,"click",(function(){e.init(t._parentList)}));return this.events.push(l),i}},{key:"creatItem",value:function(t){var e=this,r=this.art,n=r.icons,o=r.events.proxy,i=t.selector&&t.selector.length,a=document.createElement("div");b(a,"art-setting-item"),t.default&&b(a,"art-current");var c=O(a,''),l=O(a,''),s=document.createElement("div");b(s,"art-setting-item-left-icon"),O(s,i?t.icon||n.config:n.check),O(c,s),t._$icon=s,U(t,"icon",{get:function(){return s.innerHTML},set:function(t){"string"!=typeof t&&"number"!=typeof t||(s.innerHTML=t)}});var u=document.createElement("div");if(b(u,"art-setting-item-left-text"),O(u,t.html||""),O(c,u),t._$html=u,U(t,"html",{get:function(){return u.innerHTML},set:function(t){"string"!=typeof t&&"number"!=typeof t||(u.innerHTML=t)}}),i){var p=document.createElement("div");b(p,"art-setting-item-right-tooltip"),O(p,t.tooltip||""),O(l,p),t._$tooltip=p,U(t,"tooltip",{get:function(){return p.innerHTML},set:function(t){"string"!=typeof t&&"number"!=typeof t||(p.innerHTML=t)}});var f=document.createElement("div");b(f,"art-setting-item-right-icon"),O(f,n.arrowRight),O(l,f)}var d=o(a,"click",function(){var r=Tt(Ct.mark((function r(n){var o;return Ct.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!i){r.next=4;break}e.init(t.selector,t.width),r.next=11;break;case 4:if(S(a,"art-current"),t._parentList&&e.init(t._parentList),!t._parentItem||!t._parentItem.onSelect){r.next=11;break}return r.next=9,t._parentItem.onSelect.call(e.art,t,a,n);case 9:o=r.sent,t._parentItem._$tooltip&&("string"!=typeof o&&"number"!=typeof o||(t._parentItem._$tooltip.innerHTML=o));case 11:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}());return this.events.push(d),a}},{key:"init",value:function(t,e){if(this.cache.has(t)){var r=this.cache.get(t);S(r,"art-current"),k(this.$parent,"width","".concat(r.dataset.width,"px"))}else{var n=document.createElement("div");b(n,"art-setting-panel"),t[0]&&t[0]._parentItem&&O(n,this.creatHeader(t[0]));for(var o=0;oc&&su)&&setTimeout((function(){k(o,"width","".concat(u,"px")),k(o,"height","".concat(s,"px")),k(o,"transform-origin","0 0"),k(o,"transform","rotate(90deg) translate(0, -".concat(s,"px)")),b(o,"art-auto-orientation")}),r.MOBILE_AUTO_ORIENTATION_TIME)}else x(o,"art-auto-orientation")&&(k(o,"width",null),k(o,"height",null),k(o,"transform",null),k(o,"transform-origin",null),w(o,"art-auto-orientation"),t.aspectRatioReset=!0,t.autoSize=e.autoSize,t.notice.show="")})),{name:"autoOrientation",get state(){return x(o,"art-auto-orientation")}}}function Ue(t){var e=t.i18n,r=t.storage,n=t.constructor,o=t.template.$poster;return t.on("video:timeupdate",(function(){var e=r.get("times")||{},o=Object.keys(e);o.length>n.AUTO_PLAYBACK_MAX&&delete e[o[0]],e[t.option.url]=t.currentTime,r.set("times",e)})),t.on("ready",(function(){var n=(r.get("times")||{})[t.option.url];n&&(t.seek=n,k(o,"display","none"),t.notice.show="".concat(e.get("Auto playback at")," ").concat(tt(n)))})),{name:"autoPlayback",get times(){return r.get("times")||{}},clear:function(){return r.del("times")}}}function Ge(t){var e=t.constructor,r=t.events.proxy,n=t.template,o=n.$player,i=n.$video,a=null,c=!1,l=function(){clearTimeout(a),c&&(c=!1,t.playbackRate=1,w(o,"art-fast-forward"))};return r(i,"touchstart",(function(r){1===r.touches.length&&t.playing&&(a=setTimeout((function(){c=!0,t.playbackRate=e.FAST_FORWARD_VALUE,b(o,"art-fast-forward")}),e.FAST_FORWARD_TIME))})),r(document,"touchmove",l),r(document,"touchend",l),{name:"fastForward",get state(){return x(o,"art-fast-forward")}}}function Ye(t){var e=t.layers,r=t.icons,n=t.template.$player;return e.add({name:"lock",mounted:function(e){var n=O(e,r.lock),o=O(e,r.unlock);k(n,"display","none"),t.on("lock",(function(t){t?(k(n,"display","inline-flex"),k(o,"display","none")):(k(n,"display","none"),k(o,"display","inline-flex"))}))},click:function(){x(n,"art-lock")?(w(n,"art-lock"),t.emit("lock",!1)):(b(n,"art-lock"),t.emit("lock",!0))}}),{name:"lock",get state(){return x(n,"art-lock")}}}var Ze=function(){function e(r){t(this,e),this.art=r,this.id=0;var n=r.option;n.miniProgressBar&&!n.isLive&&this.add(We),n.lock&&d&&this.add(Ye),n.autoPlayback&&this.add(Ue),n.autoOrientation&&d&&this.add(qe),n.fastForward&&d&&!n.isLive&&this.add(Ge);for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};this.isEnd||(this.art.switchUrl(e.url),this.art.once("video:timeupdate",(function(){t.art.emit("ads:start",e)})),this.art.once("video:ended",(function(){var e=t.next;e?(t.index+=1,t.play(e)):t.end()})))}},{key:"end",value:function(){this.isEnd||(this.isEnd=!0,this.playing=!1,this.art.option.url=this.urlCache,this.art.switchUrl(this.urlCache),this.art.emit("ads:end"))}}]),e}(),Qe=r((function e(r){t(this,e);for(var n=r.option,o=r.events.proxy,i=r.template.$video,a=0;a0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(t),tr.splice(tr.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return tr}},{key:"version",get:function(){return"4.3.11"}},{key:"env",get:function(){return"production"}},{key:"build",get:function(){return"1651045366298"}},{key:"config",get:function(){return ht}},{key:"utils",get:function(){return rt}},{key:"scheme",get:function(){return dt}},{key:"Emitter",get:function(){return p}},{key:"validator",get:function(){return u}},{key:"kindOf",get:function(){return u.kindOf}},{key:"html",get:function(){return yt.html}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",type:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,useSSR:!1,playsInline:!0,lock:!1,fastForward:!1,autoPlayback:!1,autoOrientation:!1,ads:[],layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],whitelist:[],thumbnails:{url:"",number:60,column:10},subtitle:{url:"",type:"",style:{},encoding:"utf-8"},moreVideoAttr:{controls:!1,preload:h?"auto":"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),a}(p);return er.NOTICE_TIME=2e3,er.SETTING_WIDTH=250,er.SETTING_ITEM_WIDTH=200,er.INDICATOR_SIZE=14,er.INDICATOR_SIZE_ICON=16,er.INDICATOR_SIZE_MOBILE=18,er.INDICATOR_SIZE_MOBILE_ICON=20,er.VOLUME_PANEL_WIDTH=60,er.VOLUME_HANDLE_WIDTH=12,er.RESIZE_TIME=500,er.SCROLL_TIME=200,er.SCROLL_GAP=50,er.AUTO_PLAYBACK_MAX=10,er.RECONNECT_TIME_MAX=5,er.RECONNECT_SLEEP_TIME=1e3,er.CONTROL_HIDE_TIME=3e3,er.DB_CLICE_TIME=300,er.MOBILE_AUTO_PLAYBACKRATE=3,er.MOBILE_AUTO_PLAYBACKRATE_TIME=1e3,er.MOBILE_AUTO_ORIENTATION_TIME=100,er.INFO_LOOP_TIME=1e3,er.FAST_FORWARD_VALUE=3,er.FAST_FORWARD_TIME=1e3,console.log("%c ArtPlayer %c 4.3.11 %c https://artplayer.org","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),er}));
diff --git a/docs/mobile.html b/docs/mobile.html
index 2b0b1f1de..15ebb7812 100644
--- a/docs/mobile.html
+++ b/docs/mobile.html
@@ -41,7 +41,7 @@
-
+