diff --git a/.size-snapshot.json b/.size-snapshot.json
new file mode 100644
index 000000000..43ef02fa9
--- /dev/null
+++ b/.size-snapshot.json
@@ -0,0 +1,47 @@
+{
+ "packages/artplayer/dist/artplayer.js": {
+ "bundled": 167524,
+ "minified": 91369,
+ "gzipped": 21798
+ },
+ "packages/artplayer-plugin-backlight/dist/artplayer-plugin-backlight.js": {
+ "bundled": 4642,
+ "minified": 1999,
+ "gzipped": 961
+ },
+ "packages/artplayer-tool-github/dist/artplayer-tool-github.js": {
+ "bundled": 12660,
+ "minified": 12307,
+ "gzipped": 4310
+ },
+ "packages/artplayer-plugin-gif/dist/artplayer-plugin-gif.js": {
+ "bundled": 98443,
+ "minified": 28826,
+ "gzipped": 10440
+ },
+ "packages/artplayer-plugin-playlist/dist/artplayer-plugin-playlist.js": {
+ "bundled": 4331,
+ "minified": 2031,
+ "gzipped": 857
+ },
+ "packages/artplayer-tool-thumbnail/dist/artplayer-tool-thumbnail.js": {
+ "bundled": 16311,
+ "minified": 7927,
+ "gzipped": 2827
+ },
+ "packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js": {
+ "bundled": 23907,
+ "minified": 12909,
+ "gzipped": 4096
+ },
+ "packages/artplayer-vue/dist/artplayer-vue.js": {
+ "bundled": 169067,
+ "minified": 92280,
+ "gzipped": 21954
+ },
+ "packages/artplayer-react/dist/artplayer-react.js": {
+ "bundled": 252440,
+ "minified": 121369,
+ "gzipped": 31023
+ }
+}
diff --git a/dist/artplayer-plugin-backlight.js b/dist/artplayer-plugin-backlight.js
index 1d3b992a3..765df117b 100644
--- a/dist/artplayer-plugin-backlight.js
+++ b/dist/artplayer-plugin-backlight.js
@@ -5,4 +5,4 @@
* Released under the MIT License.
*/
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).artplayerPluginBacklight=e()}(this,function(){"use strict";function l(t){for(var e=[],n=0;n<10;n+=1)for(var o=0;o<5;o+=1)0!==n&&9!==n&&0!==o&&4!==o||e.push(t(n,o,10,5));return e}return function(o){var t=o.constructor.utils.setStyles,e=o.template,n=e.$player,a=e.$video,r=o.player,i=document.createElement("div");i.classList.add("artplayer-backlight"),t(i,{position:"absolute",zIndex:9,left:0,top:0,right:0,bottom:0,width:"100%",height:"100%"});var h=function(r){return l(function(t,e,n,o){var a=document.createElement("div");return a.style.position="absolute",a.style.left="".concat(100*t/n,"%"),a.style.top="".concat(100*e/o,"%"),a.style.width="".concat(100/n,"%"),a.style.height="".concat(100/o,"%"),a.style.webkitBorderRadius="50%",a.style.borderRadius="50%",a.style.webkitTransition="all .2s ease",a.style.transition="all .2s ease",r.appendChild(a),{$box:a,left:0===t,right:t===n-1,top:0===e,bottom:e===o-1}})}(i),c=document.createElement("canvas");return n.insertBefore(i,a),function n(){window.requestAnimationFrame(function(){if(r.playing){var t=a.clientWidth,e=a.clientHeight;(function(t,e,p,g){var y=t.getContext("2d");return t.width=p,t.height=g,y.drawImage(e,0,0),l(function(t,e,n,o){for(var a=p/n,r=g/o,i=t*a,c=e*r,l=y.getImageData(i,c,a,r).data,s=0,u=0,d=0,f=0,h=l.length;f .")}return t}(t);if(!Pe[n]){Pe[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+V(e._owner.type)+"."),B(e),X(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),B(null)}}}function Se(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n ".concat(e,"1){for(var d=Array(p),y=0;y
".concat(t,"
")})).join("")),this.art.emit("subtitle:update",t)}},{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(e){switch(C(t)){case"srt":return D(R(e));case"ass":return D(T(e));case"vtt":return D(e);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),t}))}},{key:"toggle",value:function(){this.show=!this.state}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,v(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,y(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),t}();var Nt=function(){function t(n){var r=this;e(this,t),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(){y(n,"artplayer-hover"),t.emit("hoverenter")}),(function(){v(n,"artplayer-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(){y(r,"artplayer-hide-cursor"),v(r,"artplayer-hover"),t.controls.show=!1}),3e3);t.on("hoverleave",(function(){o.playing&&a()})),e.proxy(r,"mousemove",(function(e){a.clearTimeout(),v(r,"artplayer-hide-cursor"),t.controls.show=!0,!t.player.pip&&o.playing&&e.target===i&&a()}))}(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=I((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 r(t,[{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()}))}}]),t}(),Ut=function(){function t(n){var r=this;e(this,t),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 r(t,[{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))}}}))}}]),t}(),_t=function(){function t(n){var r=this;e(this,t),this.id=0,this.art=n,this.add=this.add.bind(this),this.art.on("ready",(function(){r.art.option.layers.forEach((function(t){r.add(t)}))}))}return r(t,[{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$layers;return it(this.art,this,n,t,e,"layer")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,v(e,"artplayer-layers-hide"),this.art.emit("layers:show")):(this.state=!1,y(e,"artplayer-layers-hide"),this.art.emit("layers:hide"))}}]),t}(),Xt=function(){function t(n){e(this,t),this.art=n,g(n.template.$loading,n.icons.loading)}return r(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-loading-show"),this.art.emit("loading:show")):(this.state=!1,v(e,"artplayer-loading-show"),this.art.emit("loading:hide"))}}]),t}(),Yt=function(){function t(n){e(this,t),this.art=n,this.timer=null}return r(t,[{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;this.state=!0,y(o,"artplayer-notice-show"),a.innerHTML=t instanceof Error?t.message.trim():t,clearTimeout(this.timer),n&&(this.timer=setTimeout((function(){e.hide()}),r)),this.art.emit("notice:show")}},{key:"hide",value:function(){var t=this.art.template.$player;this.state=!1,v(t,"artplayer-notice-show"),this.art.emit("notice:hide")}}]),t}(),Zt=function(){function t(n){e(this,t),this.art=n,g(n.template.$state,n.icons.state)}return r(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,v(e,"artplayer-mask-show"),this.art.emit("mask:hide"))}}]),t}(),Jt=function t(n){var r=this;e(this,t);var i=Object.assign({loading:'',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\n',setting:'',fullscreen:'',fullscreenWeb:'',pip:'',prev:'',next:''},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)),g(e,i[t]),r[t]=e}))};function Gt(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(e){return function(n){var r=n.i18n,i=n.player;return function(e){for(var n=1;n".concat(t,"
")})).join("")),this.art.emit("subtitle:update",t)}},{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(e){switch(D(t)){case"srt":return R($(e));case"ass":return R(T(e));case"vtt":return R(e);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),t}))}},{key:"toggle",value:function(){this.show=!this.state}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,h(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),e}();var Nt=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(){h(n,"artplayer-hover"),t.emit("hoverenter")}),(function(){y(n,"artplayer-hover"),t.emit("hoverleave")}))}(n,r),function(t,e){var n=t.template,r=n.$player,i=n.$video,o=t.player,a=V((function(){h(r,"artplayer-hide-cursor"),y(r,"artplayer-hover"),t.controls.show=!1}),3e3);t.on("hoverleave",(function(){o.playing&&a()})),e.proxy(r,"mousemove",(function(e){a.clearTimeout(),y(r,"artplayer-hide-cursor"),t.controls.show=!0,!t.player.pip&&o.playing&&e.target===i&&a()}))}(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=B((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}(),Ut=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}(),_t=function(){function e(n){var r=this;t(this,e),this.id=0,this.art=n,this.add=this.add.bind(this),this.art.on("ready",(function(){r.art.option.layers.forEach((function(t){r.add(t)}))}))}return n(e,[{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$layers;return rt(this.art,this,n,t,e,"layer")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-layers-hide"),this.art.emit("layers:show")):(this.state=!1,h(e,"artplayer-layers-hide"),this.art.emit("layers:hide"))}}]),e}(),Xt=function(){function e(n){t(this,e),this.art=n,m(n.template.$loading,n.icons.loading)}return n(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,h(e,"artplayer-loading-show"),this.art.emit("loading:show")):(this.state=!1,y(e,"artplayer-loading-show"),this.art.emit("loading:hide"))}}]),e}(),Yt=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;this.state=!0,h(o,"artplayer-notice-show"),a.innerHTML=t instanceof Error?t.message.trim():t,clearTimeout(this.timer),n&&(this.timer=setTimeout((function(){e.hide()}),r)),this.art.emit("notice:show")}},{key:"hide",value:function(){var t=this.art.template.$player;this.state=!1,y(t,"artplayer-notice-show"),this.art.emit("notice:hide")}}]),e}(),Zt=function(){function e(n){t(this,e),this.art=n,m(n.template.$state,n.icons.state)}return n(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,h(e,"artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,y(e,"artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}(),Jt=function e(n){var r=this;t(this,e);var i=Object.assign({loading:'',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\n',setting:'',fullscreen:'',fullscreenWeb:'',pip:'',prev:'',next:''},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)),m(e,i[t]),r[t]=e}))};function Gt(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.")}return t}(t);if(!Pe[n]){Pe[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+V(e._owner.type)+"."),B(e),X(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),B(null)}}}function Se(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n
".concat(e,"
")})).join("")),this.art.emit("subtitle:update",e)}},{key:"switch",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unknown",r=this.art,o=r.i18n,i=r.notice;return this.init(e).then((function(e){return i.show("".concat(o.get("Switch subtitle"),": ").concat(n)),t.art.emit("subtitle:switch",e),e}))}},{key:"init",value:function(e){var t=this,n=this.art,r=n.notice,o=n.template,i=o.$subtitle,a=o.$track;return fetch(e).then((function(e){return e.text()})).then((function(t){switch(Le(e)){case"srt":return _e(Te(t));case"ass":return _e(Ae(t));case"vtt":return _e(t);default:return e}})).then((function(e){return i.innerHTML="",t.url===e?e:(URL.revokeObjectURL(t.url),a.src=e,e)})).catch((function(e){throw r.show(e),e}))}},{key:"toggle",value:function(){this.show=!this.state}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,be(t,"artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,ge(t,"artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),e}();var Yt=function(){function e(t){var n=this;i(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),t.whitelist.state&&t.once("video:canplay",(function(){!function(e,t){var n=e.template.$player;t.proxy(document,["click","contextmenu"],(function(t){t.composedPath().indexOf(n)>-1?(e.isFocus=!0,e.emit("focus")):(e.isFocus=!1,e.emit("blur"))}))}(t,n),function(e,t){var n=e.template.$player;t.hover(n,(function(){ge(n,"artplayer-hover"),e.emit("hoverenter")}),(function(){be(n,"artplayer-hover"),e.emit("hoverleave")}))}(t,n),function(e,t){var n=e.template,r=n.$player,o=n.$video,i=e.player,a=He((function(){ge(r,"artplayer-hide-cursor"),be(r,"artplayer-hover"),e.controls.show=!1}),3e3);e.on("hoverleave",(function(){i.playing&&a()})),t.proxy(r,"mousemove",(function(t){a.clearTimeout(),be(r,"artplayer-hide-cursor"),e.controls.show=!0,!e.player.pip&&i.playing&&t.target===o&&a()}))}(t,n),function(e,t){var n=e.option,r=e.player,o=e.template.$player,i=document.createElement("object");i.setAttribute("aria-hidden","true"),i.setAttribute("tabindex",-1),i.type="text/html",i.data="about:blank";var a=r.width,c=r.height,u=Be((function(){r.width===a&&r.height===c||(a=r.width,c=r.height,n.autoSize&&(e.player.fullscreen||e.player.fullscreenWeb||e.player.pip?e.player.autoSize=!1:e.player.autoSize=!0),e.player.aspectRatioReset=!0,e.emit("resize",{width:r.width,height:r.height}))}),500);t.proxy(i,"load",(function(){t.proxy(i.contentDocument.defaultView,"resize",u)})),o.appendChild(i)}(t,n)}))}return c(e,[{key:"proxy",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Array.isArray(t)?t.forEach((function(t){return r.proxy(e,t,n,o)})):(e.addEventListener(t,n,o),this.destroyEvents.push((function(){e.removeEventListener(t,n,o)})))}},{key:"hover",value:function(e,t,n){t&&this.proxy(e,"mouseenter",t),n&&this.proxy(e,"mouseleave",n)}},{key:"loadImg",value:function(e){var t=this;return new Promise((function(n,r){var o;if(e instanceof HTMLImageElement)o=e;else{if("string"!=typeof e)return r(e);(o=new Image).src=e}return o.complete?n(o):(t.proxy(o,"load",(function(){return n(o)})),t.proxy(o,"error",(function(){return r(o)})),e)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(e){return e()}))}}]),e}(),Xt=function(){function e(t){var n=this;i(this,e),this.art=t,this.keys={},this.art.option.hotkey&&this.art.on("ready",(function(){n.add(27,(function(){t.player.fullscreenWeb&&(t.player.fullscreenWeb=!1)})),n.add(32,(function(){t.player.toggle=!0})),n.add(37,(function(){t.player.seek=t.player.currentTime-5})),n.add(38,(function(){t.player.volume+=.1})),n.add(39,(function(){t.player.seek=t.player.currentTime+5})),n.add(40,(function(){t.player.volume-=.1})),n.init()}))}return c(e,[{key:"add",value:function(e,t){this.keys[e]?this.keys[e].push(t):this.keys[e]=[t]}},{key:"init",value:function(){var e=this;(0,this.art.events.proxy)(window,"keydown",(function(t){if(e.art.isFocus){var n=document.activeElement.tagName.toUpperCase(),r=document.activeElement.getAttribute("contenteditable");if("INPUT"!==n&&"TEXTAREA"!==n&&""!==r&&"true"!==r){var o=e.keys[t.keyCode];o&&(t.preventDefault(),o.forEach((function(e){return e()})),e.art.emit("hotkey",t))}}}))}}]),e}(),Zt=function(){function e(t){var n=this;i(this,e),this.id=0,this.art=t,this.add=this.add.bind(this),this.art.on("ready",(function(){n.art.option.layers.forEach((function(e){n.add(e)}))}))}return c(e,[{key:"add",value:function(e,t){this.id+=1;var n=this.art.template.$layers;return ct(this.art,this,n,e,t,"layer")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,be(t,"artplayer-layers-hide"),this.art.emit("layers:show")):(this.state=!1,ge(t,"artplayer-layers-hide"),this.art.emit("layers:hide"))}}]),e}(),Jt=function(){function e(t){i(this,e),this.art=t,Oe(t.template.$loading,t.icons.loading)}return c(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,ge(t,"artplayer-loading-show"),this.art.emit("loading:show")):(this.state=!1,be(t,"artplayer-loading-show"),this.art.emit("loading:hide"))}}]),e}(),Gt=function(){function e(t){i(this,e),this.art=t,this.timer=null}return c(e,[{key:"show",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,o=this.art.template,i=o.$player,a=o.$noticeInner;this.state=!0,ge(i,"artplayer-notice-show"),a.innerHTML=e instanceof Error?e.message.trim():e,clearTimeout(this.timer),n&&(this.timer=setTimeout((function(){t.hide()}),r)),this.art.emit("notice:show")}},{key:"hide",value:function(){var e=this.art.template.$player;this.state=!1,be(e,"artplayer-notice-show"),this.art.emit("notice:hide")}}]),e}(),Qt=function(){function e(t){i(this,e),this.art=t,Oe(t.template.$state,t.icons.state)}return c(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,ge(t,"artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,be(t,"artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}(),Kt=function e(t){var n=this;i(this,e);var r=Object.assign({loading:'',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\n',setting:'',fullscreen:'',fullscreenWeb:'',pip:'',prev:'',next:''},t.option.icons);Object.keys(r).forEach((function(e){var t=document.createElement("i");t.classList.add("art-icon"),t.classList.add("art-icon-".concat(e)),Oe(t,r[e]),n[e]=t}))};function en(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tn(e){return function(t){var r=t.i18n,o=t.player;return function(e){for(var t=1;t".concat(t,"
")})).join("")),this.art.emit("subtitle:update",t)}},{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(e){switch(C(t)){case"srt":return D(R(e));case"ass":return D(T(e));case"vtt":return D(e);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),t}))}},{key:"toggle",value:function(){this.show=!this.state}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,v(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,y(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),t}();var Nt=function(){function t(n){var r=this;e(this,t),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(){y(n,"artplayer-hover"),t.emit("hoverenter")}),(function(){v(n,"artplayer-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(){y(r,"artplayer-hide-cursor"),v(r,"artplayer-hover"),t.controls.show=!1}),3e3);t.on("hoverleave",(function(){o.playing&&a()})),e.proxy(r,"mousemove",(function(e){a.clearTimeout(),v(r,"artplayer-hide-cursor"),t.controls.show=!0,!t.player.pip&&o.playing&&e.target===i&&a()}))}(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=I((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 r(t,[{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()}))}}]),t}(),Ut=function(){function t(n){var r=this;e(this,t),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 r(t,[{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))}}}))}}]),t}(),_t=function(){function t(n){var r=this;e(this,t),this.id=0,this.art=n,this.add=this.add.bind(this),this.art.on("ready",(function(){r.art.option.layers.forEach((function(t){r.add(t)}))}))}return r(t,[{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$layers;return it(this.art,this,n,t,e,"layer")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,v(e,"artplayer-layers-hide"),this.art.emit("layers:show")):(this.state=!1,y(e,"artplayer-layers-hide"),this.art.emit("layers:hide"))}}]),t}(),Xt=function(){function t(n){e(this,t),this.art=n,g(n.template.$loading,n.icons.loading)}return r(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-loading-show"),this.art.emit("loading:show")):(this.state=!1,v(e,"artplayer-loading-show"),this.art.emit("loading:hide"))}}]),t}(),Yt=function(){function t(n){e(this,t),this.art=n,this.timer=null}return r(t,[{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;this.state=!0,y(o,"artplayer-notice-show"),a.innerHTML=t instanceof Error?t.message.trim():t,clearTimeout(this.timer),n&&(this.timer=setTimeout((function(){e.hide()}),r)),this.art.emit("notice:show")}},{key:"hide",value:function(){var t=this.art.template.$player;this.state=!1,v(t,"artplayer-notice-show"),this.art.emit("notice:hide")}}]),t}(),Zt=function(){function t(n){e(this,t),this.art=n,g(n.template.$state,n.icons.state)}return r(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,v(e,"artplayer-mask-show"),this.art.emit("mask:hide"))}}]),t}(),Jt=function t(n){var r=this;e(this,t);var i=Object.assign({loading:'',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\n',setting:'',fullscreen:'',fullscreenWeb:'',pip:'',prev:'',next:''},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)),g(e,i[t]),r[t]=e}))};function Gt(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(e){return function(n){var r=n.i18n,i=n.player;return function(e){for(var n=1;n".concat(t,"
")})).join("")),this.art.emit("subtitle:update",t)}},{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(e){switch(D(t)){case"srt":return R($(e));case"ass":return R(T(e));case"vtt":return R(e);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),t}))}},{key:"toggle",value:function(){this.show=!this.state}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,h(e,"artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),e}();var Nt=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(){h(n,"artplayer-hover"),t.emit("hoverenter")}),(function(){y(n,"artplayer-hover"),t.emit("hoverleave")}))}(n,r),function(t,e){var n=t.template,r=n.$player,i=n.$video,o=t.player,a=V((function(){h(r,"artplayer-hide-cursor"),y(r,"artplayer-hover"),t.controls.show=!1}),3e3);t.on("hoverleave",(function(){o.playing&&a()})),e.proxy(r,"mousemove",(function(e){a.clearTimeout(),y(r,"artplayer-hide-cursor"),t.controls.show=!0,!t.player.pip&&o.playing&&e.target===i&&a()}))}(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=B((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}(),Ut=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}(),_t=function(){function e(n){var r=this;t(this,e),this.id=0,this.art=n,this.add=this.add.bind(this),this.art.on("ready",(function(){r.art.option.layers.forEach((function(t){r.add(t)}))}))}return n(e,[{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$layers;return rt(this.art,this,n,t,e,"layer")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,y(e,"artplayer-layers-hide"),this.art.emit("layers:show")):(this.state=!1,h(e,"artplayer-layers-hide"),this.art.emit("layers:hide"))}}]),e}(),Xt=function(){function e(n){t(this,e),this.art=n,m(n.template.$loading,n.icons.loading)}return n(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,h(e,"artplayer-loading-show"),this.art.emit("loading:show")):(this.state=!1,y(e,"artplayer-loading-show"),this.art.emit("loading:hide"))}}]),e}(),Yt=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;this.state=!0,h(o,"artplayer-notice-show"),a.innerHTML=t instanceof Error?t.message.trim():t,clearTimeout(this.timer),n&&(this.timer=setTimeout((function(){e.hide()}),r)),this.art.emit("notice:show")}},{key:"hide",value:function(){var t=this.art.template.$player;this.state=!1,y(t,"artplayer-notice-show"),this.art.emit("notice:hide")}}]),e}(),Zt=function(){function e(n){t(this,e),this.art=n,m(n.template.$state,n.icons.state)}return n(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,h(e,"artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,y(e,"artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}(),Jt=function e(n){var r=this;t(this,e);var i=Object.assign({loading:'',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'\n',setting:'',fullscreen:'',fullscreenWeb:'',pip:'',prev:'',next:''},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)),m(e,i[t]),r[t]=e}))};function Gt(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