From 8b16c0fc29eb0de7aecc7d2be8b9c7bb86aab77e Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Fri, 19 Jul 2019 17:55:10 +0800 Subject: [PATCH] build all packages --- dist/artplayer-plugin-backlight.js | 2 +- dist/artplayer-plugin-blur.js | 2 +- dist/artplayer-plugin-danmuku.js | 2 +- dist/artplayer-plugin-gif.js | 2 +- dist/artplayer-plugin-playlist.js | 2 +- dist/artplayer-react.css | 5 +++-- dist/artplayer-react.js | 4 ++-- dist/artplayer-tool-github.js | 2 +- dist/artplayer-tool-thumbnail.js | 2 +- dist/artplayer-vue.css | 5 +++-- dist/artplayer-vue.js | 4 ++-- dist/artplayer.css | 2 +- dist/artplayer.js | 4 ++-- .../dist/artplayer-plugin-backlight.js | 2 +- packages/artplayer-plugin-blur/dist/artplayer-plugin-blur.js | 2 +- .../dist/artplayer-plugin-danmuku.js | 2 +- packages/artplayer-plugin-gif/dist/artplayer-plugin-gif.js | 2 +- .../dist/artplayer-plugin-playlist.js | 2 +- packages/artplayer-react/dist/artplayer-react.css | 5 +++-- packages/artplayer-react/dist/artplayer-react.js | 4 ++-- packages/artplayer-tool-github/dist/artplayer-tool-github.js | 2 +- .../dist/artplayer-tool-thumbnail.js | 2 +- packages/artplayer-vue/dist/artplayer-vue.css | 5 +++-- packages/artplayer-vue/dist/artplayer-vue.js | 4 ++-- packages/artplayer/dist/artplayer.css | 2 +- packages/artplayer/dist/artplayer.js | 4 ++-- 26 files changed, 40 insertions(+), 36 deletions(-) diff --git a/dist/artplayer-plugin-backlight.js b/dist/artplayer-plugin-backlight.js index 7a6b9cb7c..2e41c0151 100644 --- a/dist/artplayer-plugin-backlight.js +++ b/dist/artplayer-plugin-backlight.js @@ -1,5 +1,5 @@ /*! - * artplayer-plugin-backlight.js v3.1.9 + * artplayer-plugin-backlight.js v3.1.10 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2019 Harvey Zack * Released under the MIT License. diff --git a/dist/artplayer-plugin-blur.js b/dist/artplayer-plugin-blur.js index bf929c1d5..9a7b5187d 100644 --- a/dist/artplayer-plugin-blur.js +++ b/dist/artplayer-plugin-blur.js @@ -1,5 +1,5 @@ /*! - * artplayer-plugin-blur.js v3.1.9 + * artplayer-plugin-blur.js v3.1.10 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2019 Harvey Zack * Released under the MIT License. diff --git a/dist/artplayer-plugin-danmuku.js b/dist/artplayer-plugin-danmuku.js index 4becaaac4..452133ccd 100644 --- a/dist/artplayer-plugin-danmuku.js +++ b/dist/artplayer-plugin-danmuku.js @@ -1,5 +1,5 @@ /*! - * artplayer-plugin-danmuku.js v3.1.9 + * artplayer-plugin-danmuku.js v3.1.10 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2019 Harvey Zack * Released under the MIT License. diff --git a/dist/artplayer-plugin-gif.js b/dist/artplayer-plugin-gif.js index 744aebb8f..c8794a731 100644 --- a/dist/artplayer-plugin-gif.js +++ b/dist/artplayer-plugin-gif.js @@ -1,5 +1,5 @@ /*! - * artplayer-plugin-gif.js v3.1.9 + * artplayer-plugin-gif.js v3.1.10 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2019 Harvey Zack * Released under the MIT License. diff --git a/dist/artplayer-plugin-playlist.js b/dist/artplayer-plugin-playlist.js index 78b0e1a48..b3cf898b9 100644 --- a/dist/artplayer-plugin-playlist.js +++ b/dist/artplayer-plugin-playlist.js @@ -1,5 +1,5 @@ /*! - * artplayer-plugin-playlist.js v3.1.9 + * artplayer-plugin-playlist.js v3.1.10 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2019 Harvey Zack * Released under the MIT License. diff --git a/dist/artplayer-react.css b/dist/artplayer-react.css index 3ce1ace4f..f54692190 100644 --- a/dist/artplayer-react.css +++ b/dist/artplayer-react.css @@ -5,7 +5,7 @@ .artplayer-video-player .artplayer-layers{position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.artplayer-video-player .artplayer-layers .art-layer{pointer-events:auto}.artplayer-video-player.artplayer-layers-hide .artplayer-layers{display:none} .artplayer-video-player .artplayer-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.artplayer-video-player .artplayer-mask,.artplayer-video-player .artplayer-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute}.artplayer-video-player .artplayer-mask .art-state{right:30px;bottom:55px;width:60px;height:60px;opacity:.6}.artplayer-video-player.artplayer-mask-show .artplayer-mask,.artplayer-video-player .artplayer-mask .art-state{display:-webkit-box;display:-ms-flexbox;display:flex} .artplayer-video-player .artplayer-loading{display:none;position:absolute;z-index:70;left:0;top:0;right:0;bottom:0;width:100%;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;pointer-events:none}.artplayer-video-player.artplayer-loading-show .artplayer-loading{display:-webkit-box;display:-ms-flexbox;display:flex} -.artplayer-video-player .artplayer-bottom{position:absolute;z-index:60;left:0;right:0;bottom:0;height:100px;padding:60px 10px 0;opacity:0;visibility:hidden;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;pointer-events:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.artplayer-video-player .artplayer-bottom .artplayer-progress{position:relative;pointer-events:auto}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress{position:relative;height:5px;padding:1px 0;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner{position:relative;height:100%;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-loaded{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:0;background:hsla(0,0%,100%,.4)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-played{position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;height:100%;width:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;height:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight span{display:inline-block;position:absolute;left:0;top:0;width:7px;height:3px;background:#fff;border-radius:3px}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{display:none;position:absolute;z-index:40;top:-5px;left:-6.5px;width:13px;height:13px;border-radius:50%}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator.art-show-indicator{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700;white-space:nowrap}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-indicator,.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-tip{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-thumbnails{display:none;position:absolute;bottom:8px;left:0;pointer-events:none;background-color:rgba(0,0,0,.7)}.artplayer-video-player .artplayer-bottom .artplayer-controls{position:relative;pointer-events:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:36px}.artplayer-video-player .artplayer-bottom .artplayer-controls .artplayer-controls-left,.artplayer-video-player .artplayer-bottom .artplayer-controls .artplayer-controls-right{display:-webkit-box;display:-ms-flexbox;display:flex}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control{opacity:.9;font-size:12px;height:36px;min-width:36px;line-height:36px;text-align:center;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control .art-icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;float:left;height:36px;width:36px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control:hover{opacity:1}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel{position:relative;float:left;width:0;height:100%;-webkit-transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);overflow:hidden}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle{position:absolute;top:50%;left:0;width:12px;height:12px;border-radius:12px;margin-top:-6px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{left:-54px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after{left:6px;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after,.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{content:"";position:absolute;display:block;top:50%;height:3px;margin-top:-2px;width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume:hover .art-volume-panel{width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-time{padding:0 10px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality{position:relative;z-index:30;padding:0 10px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality .art-qualitys{display:none;position:absolute;left:-15px;bottom:35px;width:100px;padding:5px 0;text-align:center;color:#fff;background:rgba(0,0,0,.7);border-radius:3px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality .art-qualitys .art-quality-item{height:30px;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality .art-qualitys .art-quality-item:hover{background-color:hsla(0,0%,100%,.1)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality:hover .art-qualitys{display:block}.artplayer-video-player.artplayer-controls-show .artplayer-bottom,.artplayer-video-player.artplayer-hover .artplayer-bottom{opacity:1;visibility:visible}.artplayer-video-player.artplayer-destroy .art-progress-indicator,.artplayer-video-player.artplayer-destroy .art-progress-tip,.artplayer-video-player.artplayer-error .art-progress-indicator,.artplayer-video-player.artplayer-error .art-progress-tip{display:none!important} +.artplayer-video-player .artplayer-bottom{position:absolute;z-index:60;left:0;right:0;bottom:0;height:100px;padding:60px 10px 0;opacity:0;visibility:hidden;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;pointer-events:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.artplayer-video-player .artplayer-bottom .artplayer-progress{position:relative;pointer-events:auto}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress{position:relative;height:5px;padding:1px 0;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner{position:relative;height:100%;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-loaded{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:0;background:hsla(0,0%,100%,.4)}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-played{position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;height:100%;width:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;height:0}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-highlight span{display:inline-block;position:absolute;left:0;top:0;width:7px;height:3px;background:#fff;border-radius:3px}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator{display:none;position:absolute;z-index:40;top:-5px;left:-6.5px;width:13px;height:13px;border-radius:50%}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-indicator.art-show-indicator{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress .art-control-progress-inner .art-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700;white-space:nowrap}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-indicator,.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-progress:hover .art-progress-tip{display:block}.artplayer-video-player .artplayer-bottom .artplayer-progress .art-control-thumbnails{display:none;position:absolute;bottom:8px;left:0;pointer-events:none;background-color:rgba(0,0,0,.7)}.artplayer-video-player .artplayer-bottom .artplayer-controls{position:relative;pointer-events:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:36px}.artplayer-video-player .artplayer-bottom .artplayer-controls .artplayer-controls-left,.artplayer-video-player .artplayer-bottom .artplayer-controls .artplayer-controls-right{display:-webkit-box;display:-ms-flexbox;display:flex}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control{opacity:.9;font-size:12px;height:36px;min-width:36px;line-height:36px;text-align:center;cursor:pointer}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control .art-icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;float:left;height:36px;width:36px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control:hover{opacity:1}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-onlyText{padding:0 10px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel{position:relative;float:left;width:0;height:100%;-webkit-transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);transition:margin .2s cubic-bezier(.4,0,1,1),width .2s cubic-bezier(.4,0,1,1);overflow:hidden}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle{position:absolute;top:50%;left:0;width:12px;height:12px;border-radius:12px;margin-top:-6px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{left:-54px;background:#fff}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after{left:6px;background:hsla(0,0%,100%,.2)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:after,.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume .art-volume-panel .art-volume-slider-handle:before{content:"";position:absolute;display:block;top:50%;height:3px;margin-top:-2px;width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-volume:hover .art-volume-panel{width:60px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality{position:relative;z-index:30}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality .art-qualitys{display:none;position:absolute;bottom:35px;width:100px;padding:5px 0;text-align:center;color:#fff;background:rgba(0,0,0,.7);border-radius:3px}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality .art-qualitys .art-quality-item{height:30px;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality .art-qualitys .art-quality-item:hover{background-color:hsla(0,0%,100%,.1)}.artplayer-video-player .artplayer-bottom .artplayer-controls .art-control-quality:hover .art-qualitys{display:block}.artplayer-video-player.artplayer-controls-show .artplayer-bottom,.artplayer-video-player.artplayer-hover .artplayer-bottom{opacity:1;visibility:visible}.artplayer-video-player.artplayer-destroy .art-progress-indicator,.artplayer-video-player.artplayer-destroy .art-progress-tip,.artplayer-video-player.artplayer-error .art-progress-indicator,.artplayer-video-player.artplayer-error .art-progress-tip{display:none!important} .artplayer-video-player .artplayer-notice{display:none;font-size:14px;position:absolute;z-index:80;left:0;top:0;padding:10px;width:100%;pointer-events:none}.artplayer-video-player .artplayer-notice .artplayer-notice-inner{display:inline-block;padding:5px 10px;color:#fff;background:rgba(0,0,0,.6);border-radius:3px}.artplayer-video-player.artplayer-notice-show .artplayer-notice{display:-webkit-box;display:-ms-flexbox;display:flex} .artplayer-video-player .artplayer-contextmenu{display:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;z-index:120;left:0;top:0;min-width:200px;padding:5px 0;background:rgba(0,0,0,.8);border-radius:3px}.artplayer-video-player .artplayer-contextmenu .art-contextmenu{cursor:pointer;font-size:13px;display:block;color:#fff;padding:7px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.artplayer-video-player .artplayer-contextmenu .art-contextmenu a{color:#fff;text-decoration:none}.artplayer-video-player .artplayer-contextmenu .art-contextmenu span{display:inline-block;padding:0 7px}.artplayer-video-player .artplayer-contextmenu .art-contextmenu span.current,.artplayer-video-player .artplayer-contextmenu .art-contextmenu span:hover{color:#00c9ff}.artplayer-video-player .artplayer-contextmenu .art-contextmenu:hover{background-color:hsla(0,0%,100%,.1)}.artplayer-video-player .artplayer-contextmenu .art-contextmenu:last-child{border-bottom:none}.artplayer-video-player.artplayer-contextmenu-show .artplayer-contextmenu{display:-webkit-box;display:-ms-flexbox;display:flex} .artplayer-video-player .artplayer-setting{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;z-index:90;left:0;top:0;height:100%;width:100%;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden}.artplayer-video-player .artplayer-setting .artplayer-setting-inner{position:absolute;top:0;right:-300px;bottom:0;width:300px;height:100%;font-size:12px;background:rgba(0,0,0,.8);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;overflow:auto}.artplayer-video-player .artplayer-setting .artplayer-setting-inner .artplayer-setting-body{overflow-y:auto;width:100%;height:100%}.artplayer-video-player .artplayer-setting .artplayer-setting-inner .artplayer-setting-body .art-setting{border-bottom:1px solid hsla(0,0%,100%,.1);padding:10px 15px}.artplayer-video-player .artplayer-setting .artplayer-setting-inner .artplayer-setting-body .art-setting .art-setting-header{margin-bottom:5px}.artplayer-video-player .artplayer-setting .art-setting-radio{display:-webkit-box;display:-ms-flexbox;display:flex}.artplayer-video-player .artplayer-setting .art-setting-radio .art-radio-item{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 2px}.artplayer-video-player .artplayer-setting .art-setting-radio .art-radio-item button{height:22px;width:100%;border:none;outline:none;color:#fff;background:hsla(0,0%,100%,.2);border-radius:2px}.artplayer-video-player .artplayer-setting .art-setting-radio .art-radio-item.current button{background-color:#00a1d6}.artplayer-video-player .artplayer-setting .art-setting-range input{width:100%;height:3px;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:hsla(0,0%,100%,.5)}.artplayer-video-player .artplayer-setting .art-setting-checkbox input{height:14px;width:14px;margin-right:5px}.artplayer-video-player.artplayer-setting-show .artplayer-setting{opacity:1;visibility:visible;pointer-events:auto}.artplayer-video-player.artplayer-setting-show .artplayer-setting .artplayer-setting-inner{right:0} @@ -15,4 +15,5 @@ .artplayer-video-player.artplayer-web-fullscreen{position:fixed;z-index:9999;width:100%;height:100%;left:0;top:0;right:0;bottom:0} .artplayer-video-player .artplayer-pip-header{display:none;position:absolute;z-index:110;left:0;top:0;right:0;height:35px;line-height:35px;color:#fff;background:rgba(0,0,0,.5);-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;opacity:0;visibility:hidden;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.artplayer-video-player .artplayer-pip-header .artplayer-pip-title{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:move}.artplayer-video-player .artplayer-pip-header .artplayer-pip-close{width:35px;text-align:center;font-size:22px;cursor:pointer}.artplayer-video-player.is-dragging{opacity:.7}.artplayer-video-player.artplayer-pip{position:fixed;z-index:9999;width:400px;height:225px;-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.2);box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.2)}.artplayer-video-player.artplayer-pip .artplayer-pip-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.artplayer-video-player.artplayer-pip.artplayer-hover .artplayer-pip-header{opacity:1;visibility:visible}.artplayer-video-player.artplayer-pip .artplayer-mask .art-state{position:static}.artplayer-video-player.artplayer-pip .artplayer-bottom,.artplayer-video-player.artplayer-pip .artplayer-contextmenu,.artplayer-video-player.artplayer-pip .artplayer-danmu,.artplayer-video-player.artplayer-pip .artplayer-info,.artplayer-video-player.artplayer-pip .artplayer-layers,.artplayer-video-player.artplayer-pip .artplayer-notice,.artplayer-video-player.artplayer-pip .artplayer-setting,.artplayer-video-player.artplayer-pip .artplayer-subtitle{display:none!important} .artplayer-auto-size{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center} -.artplayer-video-player[data-flip=horizontal] .artplayer-video{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.artplayer-video-player[data-flip=vertical] .artplayer-video{-webkit-transform:scaleY(-1);transform:scaleY(-1)} \ No newline at end of file +.artplayer-video-player[data-flip=horizontal] .artplayer-video{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.artplayer-video-player[data-flip=vertical] .artplayer-video{-webkit-transform:scaleY(-1);transform:scaleY(-1)} +button[data-balloon]{overflow:visible}[data-balloon]{position:relative;cursor:pointer}[data-balloon]:after{font-family:sans-serif!important;font-weight:400!important;font-style:normal!important;text-shadow:none!important;font-size:12px!important;background:rgba(17,17,17,.9);border-radius:4px;color:#fff;content:attr(data-balloon);padding:.5em 1em;white-space:nowrap}[data-balloon]:after,[data-balloon]:before{filter:alpha(opactiy=0);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";-moz-opacity:0;-khtml-opacity:0;opacity:0;pointer-events:none;-webkit-transition:all .18s ease-out .18s;transition:all .18s ease-out .18s;position:absolute;z-index:10}[data-balloon]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;content:""}[data-balloon]:hover:after,[data-balloon]:hover:before,[data-balloon][data-balloon-visible]:after,[data-balloon][data-balloon-visible]:before{filter:alpha(opactiy=100);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";-moz-opacity:1;-khtml-opacity:1;opacity:1;pointer-events:auto}[data-balloon].font-awesome:after{font-family:FontAwesome}[data-balloon][data-balloon-break]:after{white-space:pre}[data-balloon][data-balloon-blunt]:after,[data-balloon][data-balloon-blunt]:before{-webkit-transition:none;transition:none}[data-balloon][data-balloon-pos=up]:after{margin-bottom:11px}[data-balloon][data-balloon-pos=up]:after,[data-balloon][data-balloon-pos=up]:before{bottom:100%;left:50%;-webkit-transform:translate(-50%,10px);transform:translate(-50%,10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up]:before{margin-bottom:5px}[data-balloon][data-balloon-pos=up]:hover:after,[data-balloon][data-balloon-pos=up]:hover:before,[data-balloon][data-balloon-pos=up][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up][data-balloon-visible]:before{-webkit-transform:translate(-50%);transform:translate(-50%)}[data-balloon][data-balloon-pos=up-left]:after{left:0;margin-bottom:11px}[data-balloon][data-balloon-pos=up-left]:after,[data-balloon][data-balloon-pos=up-left]:before{bottom:100%;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up-left]:before{left:5px;margin-bottom:5px}[data-balloon][data-balloon-pos=up-left]:hover:after,[data-balloon][data-balloon-pos=up-left]:hover:before,[data-balloon][data-balloon-pos=up-left][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up-left][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=up-right]:after{right:0;margin-bottom:11px}[data-balloon][data-balloon-pos=up-right]:after,[data-balloon][data-balloon-pos=up-right]:before{bottom:100%;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-transform-origin:top;transform-origin:top}[data-balloon][data-balloon-pos=up-right]:before{right:5px;margin-bottom:5px}[data-balloon][data-balloon-pos=up-right]:hover:after,[data-balloon][data-balloon-pos=up-right]:hover:before,[data-balloon][data-balloon-pos=up-right][data-balloon-visible]:after,[data-balloon][data-balloon-pos=up-right][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=down]:after{margin-top:11px}[data-balloon][data-balloon-pos=down]:after,[data-balloon][data-balloon-pos=down]:before{left:50%;top:100%;-webkit-transform:translate(-50%,-10px);transform:translate(-50%,-10px)}[data-balloon][data-balloon-pos=down]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;margin-top:5px}[data-balloon][data-balloon-pos=down]:hover:after,[data-balloon][data-balloon-pos=down]:hover:before,[data-balloon][data-balloon-pos=down][data-balloon-visible]:after,[data-balloon][data-balloon-pos=down][data-balloon-visible]:before{-webkit-transform:translate(-50%);transform:translate(-50%)}[data-balloon][data-balloon-pos=down-left]:after{left:0;margin-top:11px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-left]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;left:5px;margin-top:5px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-left]:hover:after,[data-balloon][data-balloon-pos=down-left]:hover:before,[data-balloon][data-balloon-pos=down-left][data-balloon-visible]:after,[data-balloon][data-balloon-pos=down-left][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=down-right]:after{right:0;margin-top:11px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-right]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E");background-size:100% auto;width:18px;height:6px;right:5px;margin-top:5px;top:100%;-webkit-transform:translateY(-10px);transform:translateY(-10px)}[data-balloon][data-balloon-pos=down-right]:hover:after,[data-balloon][data-balloon-pos=down-right]:hover:before,[data-balloon][data-balloon-pos=down-right][data-balloon-visible]:after,[data-balloon][data-balloon-pos=down-right][data-balloon-visible]:before{-webkit-transform:translate(0);transform:translate(0)}[data-balloon][data-balloon-pos=left]:after{margin-right:11px;right:100%;top:50%;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%)}[data-balloon][data-balloon-pos=left]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E");background-size:100% auto;width:6px;height:18px;margin-right:5px;right:100%;top:50%;-webkit-transform:translate(10px,-50%);transform:translate(10px,-50%)}[data-balloon][data-balloon-pos=left]:hover:after,[data-balloon][data-balloon-pos=left]:hover:before,[data-balloon][data-balloon-pos=left][data-balloon-visible]:after,[data-balloon][data-balloon-pos=left][data-balloon-visible]:before{-webkit-transform:translateY(-50%);transform:translateY(-50%)}[data-balloon][data-balloon-pos=right]:after{left:100%;margin-left:11px;top:50%;-webkit-transform:translate(-10px,-50%);transform:translate(-10px,-50%)}[data-balloon][data-balloon-pos=right]:before{background:no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17,17,17,0.9)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E");background-size:100% auto;width:6px;height:18px;left:100%;margin-left:5px;top:50%;-webkit-transform:translate(-10px,-50%);transform:translate(-10px,-50%)}[data-balloon][data-balloon-pos=right]:hover:after,[data-balloon][data-balloon-pos=right]:hover:before,[data-balloon][data-balloon-pos=right][data-balloon-visible]:after,[data-balloon][data-balloon-pos=right][data-balloon-visible]:before{-webkit-transform:translateY(-50%);transform:translateY(-50%)}[data-balloon][data-balloon-length=small]:after{white-space:normal;width:80px}[data-balloon][data-balloon-length=medium]:after{white-space:normal;width:150px}[data-balloon][data-balloon-length=large]:after{white-space:normal;width:260px}[data-balloon][data-balloon-length=xlarge]:after{white-space:normal;width:380px}@media screen and (max-width:768px){[data-balloon][data-balloon-length=xlarge]:after{white-space:normal;width:90vw}}[data-balloon][data-balloon-length=fit]:after{white-space:normal;width:100%} \ No newline at end of file diff --git a/dist/artplayer-react.js b/dist/artplayer-react.js index 4af829927..1a953c7d3 100644 --- a/dist/artplayer-react.js +++ b/dist/artplayer-react.js @@ -1,8 +1,8 @@ /*! - * artplayer-react.js v3.1.9 + * artplayer-react.js v3.1.10 * Github: https://github.com/zhw2590582/ArtPlayer#readme * (c) 2017-2019 Harvey Zack * Released under the MIT License. */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).ArtplayerReact=t()}(this,function(){"use strict";var a=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r.")}return t}(t);if(!me[n]){me[n]=!0;var r="";e&&e._owner&&e._owner!==A.current&&(r=" It was passed a child from "+z(e._owner.type)+"."),W(e),N(!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),W(null)}}}function ge(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",o=" Did you accidentally export a JSX literal instead of a component?"):a=typeof e,N(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,o)}var c=J.apply(this,arguments);if(null==c)return c;if(r)for(var s=2;s is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||N(!(r=!0),"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Consumer}}}),n.Consumer=i,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===f?x(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?x(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&x(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null==e||null==e.defaultProps&&null==e.propTypes||x(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:s,render:e}},lazy:function(e){var t={$$typeof:p,_ctor:e,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(t,{defaultProps:{configurable:!0,get:function(){return n},set:function(e){N(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(t,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){N(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(t,"propTypes",{enumerable:!0})}}}),t},memo:function(e,t){return pe(e)||x(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:f,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return de().useCallback(e,t)},useContext:function(e,t){var n=de();if(void 0!==t&&N(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?N(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&N(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return de().useEffect(e,t)},useImperativeHandle:function(e,t,n){return de().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return de().useDebugValue(e,t)},useLayoutEffect:function(e,t){return de().useLayoutEffect(e,t)},useMemo:function(e,t){return de().useMemo(e,t)},useReducer:function(e,t,n){return de().useReducer(e,t,n)},useRef:function(e){return de().useRef(e)},useState:function(e){return de().useState(e)},Fragment:u,StrictMode:n,Suspense:l,createElement:we,cloneElement:function(e,t,n){for(var r=function(e,t,n){null==e&&w(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var r=void 0,o=h({},e.props),i=e.key,a=e.ref,c=e._self,s=e._source,u=e._owner;if(null!=t){Y(t)&&(a=t.ref,u=A.current),X(t)&&(i=""+t.key);var l=void 0;for(r in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)V.call(t,r)&&!H.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==l?o[r]=l[r]:o[r]=t[r])}var f=arguments.length-2;if(1==f)o.children=n;else if(1").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function x(e){return URL.createObjectURL(new Blob([e],{type:"text/vtt"}))}function S(e,t){var n=document.createElement("a");g(n,"display","none"),n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function $(e,t,n){return v("string"===n||t instanceof Element,"".concat(e.join(".")," require 'string' or 'Element' type"))}function O(e){var t=this;M(this,O);var n=e.constructor.kindOf,r=e.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||r.some(function(e){switch(n(e)){case"string":return-1 ").concat(c));var s=document.createElement("div");s.classList.value="art-".concat(i," art-").concat(i,"-").concat(c),a.html&&m(s,a.html),a.style&&y(s,a.style);var u=Array.from(e.children);s.dataset.index=a.index||n.id;var l=u.find(function(e){return Number(e.dataset.index)>=Number(s.dataset.index)});return l?l.insertAdjacentElement("beforebegin",s):m(e,s),a.click&&t.events.proxy(s,"click",function(e){e.preventDefault(),a.click.call(n,e,t),t.emit("".concat(i,":click"),s)}),a.mounted&&a.mounted(s,n,t),o&&o(s,n,t),Object.defineProperty(n,c,{value:{get id(){return n.id},get $ref(){return s},set show(e){e?(g(s,"display","block"),t.emit("".concat(i,":show"),s)):(g(s,"display","none"),t.emit("".concat(i,":hide"),s))},set remove(e){e&&(h(s),t.emit("".concat(i,":remove"),s))}}}),t.emit("".concat(i,":add"),a),n[c]}function j(e,t){var n=e.template.$progress,r=e.player,o=n.getBoundingClientRect().left,i=d(t.pageX-o,0,n.clientWidth),a=i/n.clientWidth*r.duration;return{second:a,time:s(a),width:i,percentage:d(i/n.clientWidth,0,1)}}function C(e){var n=this;M(this,C);var r=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},e.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)),m(t,r[e]),n[e]=t})}function E(r){var e=r.i18n,o=r.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(e.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");o(t,"change",function(){var e=t.value;n.innerText=e,r.plugins.subtitle.offset(Number(e))}),r.on("subtitle:switch",function(){t.value=0,n.innerText=0}),r.on("artplayerPluginSubtitle:set",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}}}function _(r){var o=r.constructor.utils.clamp,e=r.setting,i=r.notice,a=r.template,c=r.i18n,s=r.player;c.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),e.add(E);var u=[];return r.on("subtitle:switch",function(){u=[]}),{name:"subtitle",offset:function(e){if(a.$track&&a.$track.track){var t=Array.from(a.$track.track.cues),n=o(e,-5,5);t.forEach(function(e,t){u[t]||(u[t]={startTime:e.startTime,endTime:e.endTime}),e.startTime=o(u[t].startTime+n,0,s.duration),e.endTime=o(u[t].endTime+n,0,s.duration)}),i.show("".concat(c.get("Subtitle offset time"),": ").concat(e,"s")),r.emit("artplayerPluginSubtitle:set",e)}else i.show("".concat(c.get("No subtitles found"))),r.emit("artplayerPluginSubtitle:set",0)}}}function T(o){var e=o.constructor.utils,n=e.append,r=e.setStyle,i=e.setStyles,a=e.sleep,c=o.events.proxy,s=o.option,u=o.notice,l=o.i18n,f=o.template,p=o.player;function d(e){if(e){var t=f.$video.canPlayType(e.type);if("maybe"===t||"probably"===t){var n=URL.createObjectURL(e);p.playbackRate=!1,p.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){p.currentTime=0}),s.url=n,o.emit("switch",n),u.show(l.get("Load local video successfully"))}else{var r="".concat(l.get("Playback of this file format is not supported"),": ").concat(e.type);u.show(r,!0,3e3),console.warn(r)}}}return l.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),c(f.$player,"dragover",function(e){e.preventDefault(),u.show(l.get("Load local video successfully"))}),c(f.$player,"drop",function(e){e.preventDefault(),d(e.dataTransfer.files[0])}),{name:"localPreview",attach:function(e){var t=n(e,'');r(e,"position","relative"),i(t,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),c(t,"change",function(){d(t.files[0])})}}}function L(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:"3px",background:r},mounted:function(e){t.on("controls:show",function(){e.style.display="none"}),t.on("controls:hide",function(){e.style.display="block"}),t.on("video:timeupdate",function(){e.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function A(t){M(this,A);var n=t.option,r=t.events.proxy,o=t.template.$video;J.video.events.forEach(function(e){r(o,e,function(e){t.emit("video:".concat(e.type),e)})}),Object.keys(n.moreVideoAttr).forEach(function(e){o[e]=n.moreVideoAttr[e]}),n.muted&&(o.muted=n.muted),n.volume&&(o.volume=d(n.volume,0,1)),n.poster&&(o.poster=n.poster),n.autoplay&&(o.autoplay=n.autoplay),o.controls=!0;var e=n.type||c(n.url),i=n.customType[e];e&&i?(t.emit("beforeCustomType",e),i(o,n.url,t),t.emit("afterCustomType",e)):(t.emit("beforeAttachUrl",n.url),o.src=n.url,t.emit("afterAttachUrl",o.src))}var M,q,z,I,F,W,D,N,V,H,U,B,Y,X,Z,J,G,K,Q,ee,te,ne,re,oe,ie,ae,ce,se,ue,le,fe,pe,de,he,ye,me,ve,ge,be;e.exports=(M=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},q=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},z=n(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==we(Symbol.iterator)?function(e){return we(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":we(e)})(e)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(e){return n(e)}:t.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(e)}t.exports=r}),I=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},F=function(e,t){return!t||"object"!==z(t)&&"function"!=typeof t?I(e):t},W=n(function(t){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}t.exports=n}),D=n(function(n){function r(e,t){return n.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.exports=r}),N=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)},V=n(function(e,t){function c(e){return(c="function"==typeof Symbol&&"symbol"==we(Symbol.iterator)?function(e){return we(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":we(e)})(e)}function s(e){return e.constructor?e.constructor.name:null}function i(e,t){var n=2\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(e){e?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Q={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},ee=function(){function t(e){M(this,t),this.art=e,this.languages={"zh-cn":K,"zh-tw":Q},this.init()}return q(t,[{key:"init",value:function(){var e=this.art.option.lang.toLowerCase();this.language=this.languages[e]||{}}},{key:"get",value:function(e){return this.language[e]||e}},{key:"update",value:function(e){this.languages=a(this.languages,e),this.init()}}]),t}(),te=n(function(e){var i,t,o,a,r,n;i="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=e.exports,o="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var e,t=[["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,r=t.length,o={};n\n
\n
\n
\n
\n
\n \n '),mounted:function(i){var o=!1,n=i.querySelector(".art-progress-loaded"),r=i.querySelector(".art-progress-played"),a=i.querySelector(".art-progress-highlight"),c=i.querySelector(".art-progress-indicator"),s=i.querySelector(".art-progress-tip");function u(e,t){"loaded"===e&&g(n,"width","".concat(100*t,"%")),"played"===e&&(g(r,"width","".concat(100*t,"%")),g(c,"left","calc(".concat(100*t,"% - ").concat(b(c,"width")/2,"px)")))}t.forEach(function(e){var t=d(e.time,0,p.duration)/p.duration*100;m(a,''))}),u("loaded",p.loaded),l.on("video:progress",function(){u("loaded",p.loaded)}),l.on("video:timeupdate",function(){u("played",p.played)}),l.on("video:ended",function(){u("played",1)}),f(i,"mousemove",function(e){g(s,"display","block"),-1i.clientWidth-r/2?g(s,"left","".concat(i.clientWidth-r,"px")):g(s,"left","".concat(t-r/2,"px"))}(e):function(e){var t=j(l,e),n=t.width,r=t.time;s.innerHTML=r;var o=s.clientWidth;n<=o/2?g(s,"left",0):n>i.clientWidth-o/2?g(s,"left","".concat(i.clientWidth-o,"px")):g(s,"left","".concat(n-o/2,"px"))}(e)}),f(i,"mouseout",function(){g(s,"display","none")}),f(i,"click",function(e){if(e.target!==c){var t=j(l,e),n=t.second;u("played",t.percentage),p.seek=n}}),f(c,"mousedown",function(){o=!0}),f(document,"mousemove",function(e){if(o){var t=j(l,e),n=t.second,r=t.percentage;c.classList.add("art-show-indicator"),u("played",r),p.seek=n}}),f(document,"mouseup",function(){o&&(o=!1,c.classList.remove("art-show-indicator"))})}})}}({name:"progress",disable:e.isLive,position:"top",index:10})),this.add(function(e){return function(h){return re({},e,{mounted:function(p){var d=h.template.$progress,e=h.events,t=e.proxy,n=e.loadImg,r=!1,o=!1;t(d,"mousemove",function(e){r||(r=!0,n(h.option.thumbnails.url).then(function(){o=!0})),o&&(g(p,"display","block"),function(e){var t=j(h,e).width,n=h.option.thumbnails,r=n.url,o=n.height,i=n.width,a=n.number,c=n.column,s=d.clientWidth/a,u=Math.floor(t/s),l=Math.ceil(u/c)-1,f=u%c||c-1;g(p,"backgroundImage","url(".concat(r,")")),g(p,"height","".concat(o,"px")),g(p,"width","".concat(i,"px")),g(p,"backgroundPosition","-".concat(f*i,"px -").concat(l*o,"px")),t<=i/2?g(p,"left",0):t>d.clientWidth-i/2?g(p,"left","".concat(d.clientWidth-i,"px")):g(p,"left","".concat(t-i/2,"px"))}(e))}),t(d,"mouseout",function(){g(p,"display","none")})}})}}({name:"thumbnails",disable:!e.thumbnails.url||e.isLive,position:"top",index:20})),this.add(function(e){return function(u){return re({},e,{mounted:function(e){var t=u.events.proxy,n=u.icons,r=u.i18n,o=u.player,i=m(e,n.play),a=m(e,n.pause);function c(){g(i,"display","flex"),g(a,"display","none")}function s(){g(i,"display","none"),g(a,"display","flex")}k(i,r.get("Play")),k(a,r.get("Pause")),t(i,"click",function(){o.play=!0}),t(a,"click",function(){o.pause=!0}),o.playing?s():c(),u.on("video:playing",function(){s()}),u.on("video:pause",function(){c()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(e){return function(p){return re({},e,{mounted:function(e){var t=p.events.proxy,n=p.icons,r=p.player,o=p.i18n,i=!1,a=m(e,n.volume),c=m(e,n.volumeClose),s=m(e,'
'),u=m(s,'
');function l(e){var t=s.getBoundingClientRect(),n=t.left,r=t.width,o=u.getBoundingClientRect().width;return d(e.pageX-n-o/2,0,r-o/2)/(r-o)}function f(){var e=0'.concat(n.name,"")),r=i.quality.map(function(e,t){return'
').concat(e.name,"
")}).join("");t(m(e,'
'.concat(r,"
")),"click",function(e){var t=Number(e.target.dataset.index),n=i.quality[t],r=n.url,o=n.name;r&&o&&c!==t&&(a.switchQuality(r,o),s.innerHTML=o,c=t)})}})}}({name:"quality",disable:0===e.quality.length,position:"right",index:10})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.player,i=m(e,n.screenshot);k(i,r.get("Screenshot")),t(i,"click",function(){o.screenshot()})}})}}({name:"screenshot",disable:!e.screenshot,position:"right",index:20})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.subtitle,i=m(e,n.subtitle);k(i,r.get("Hide subtitle")),t(e,"click",function(){o.toggle()}),a.on("subtitle:show",function(){g(i,"opacity","1"),k(i,r.get("Hide subtitle"))}),a.on("subtitle:hide",function(){g(i,"opacity","0.8"),k(i,r.get("Show subtitle"))})}})}}({name:"subtitle",disable:!e.subtitle.url,position:"right",index:30})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.setting,i=m(e,n.setting);k(i,r.get("Show setting")),t(e,"click",function(){o.toggle()}),a.on("setting:show",function(){g(i,"opacity","0.8"),k(i,r.get("Hide setting"))}),a.on("setting:hide",function(){g(i,"opacity","1"),k(i,r.get("Show setting"))})}})}}({name:"setting",disable:!e.setting,position:"right",index:40})),this.add(function(e){return function(i){return re({},e,{mounted:function(e){var t=i.events.proxy,n=i.icons,r=i.i18n,o=i.player;k(m(e,n.pip),r.get("Mini player")),t(e,"click",function(){o.pip=!0})}})}}({name:"pip",disable:!e.pip,position:"right",index:50})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.player,i=m(e,n.fullscreenWeb);k(i,r.get("Web fullscreen")),t(e,"click",function(){o.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){g(i,"opacity","0.8"),k(i,r.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){g(i,"opacity","1"),k(i,r.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!e.fullscreenWeb,position:"right",index:60})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.player,i=m(e,n.fullscreen);k(i,r.get("Fullscreen")),t(e,"click",function(){o.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){g(i,"opacity","0.8"),k(i,r.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){g(i,"opacity","1"),k(i,r.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!e.fullscreen,position:"right",index:70})),e.controls.forEach(function(e){t.add(e)})}},{key:"add",value:function(e,t){var n,r="function"==typeof e?e(this.art):e,o=this.art.template,i=o.$progress,a=o.$controlsLeft,c=o.$controlsRight;switch(r.position){case"top":n=i;break;case"left":n=a;break;case"right":n=c}return v(n,"Controls option.position can not be empty"),this.id+=1,R(this.art,this,n,r,t,"control")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,t.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}(),ie=function(){function n(e){var t=this;M(this,n),this.id=0,this.art=e,this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1})}return q(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template,o=r.$player,i=r.$contextmenu,a=e.events.proxy;this.add(function(t){return function(r){var e=r.i18n,n=r.player;return re({},t,{html:"\n ".concat(e.get("Play speed"),':\n 0.5\n 0.75\n ').concat(e.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(e){var t=e.target.dataset.rate;t&&(n.playbackRate=Number(t),r.contextmenu.show=!1)},mounted:function(n){r.on("playbackRateChange",function(t){var e=Array.from(n.querySelectorAll("span")).find(function(e){return Number(e.dataset.rate)===t});e&&w(e,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(t){return function(n){var e=n.i18n,r=n.player;return re({},t,{html:"\n ".concat(e.get("Aspect ratio"),':\n ').concat(e.get("Default"),'\n 4:3\n 16:9\n '),click:function(e){var t=e.target.dataset.ratio;t&&(r.aspectRatio=t,n.contextmenu.show=!1)},mounted:function(e){n.on("aspectRatioChange",function(t){w(Array.from(e.querySelectorAll("span")).find(function(e){return e.dataset.ratio===t}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(t){return function(e){return re({},t,{html:e.i18n.get("Video info"),click:function(){e.info.show=!0,e.contextmenu.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(re({},{disable:!1,name:"version",index:40},{html:'ArtPlayer 3.1.9'})),this.add(function(t){return function(e){return re({},t,{html:e.i18n.get("Close"),click:function(){e.contextmenu.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(e){t.add(e)}),a(o,"contextmenu",function(e){e.preventDefault(),t.show=!0,t.setPos(e)}),a(o,"click",function(e){e.composedPath().includes(i)||(t.show=!1)})}},{key:"add",value:function(e,t){var n=this.art.template.$contextmenu;return this.id+=1,R(this.art,this,n,e,t,"contextmenu")}},{key:"setPos",value:function(e){var t=this.art.template,n=t.$player,r=t.$contextmenu,o=e.clientX,i=e.clientY,a=n.getBoundingClientRect(),c=a.height,s=a.width,u=a.left,l=a.top,f=r.getBoundingClientRect(),p=f.height,d=f.width,h=o-u,y=i-l;u+s\n
Player version:
\n
3.1.9
\n \n '),e.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),e.push('\n
\n
Video volume:
\n
\n
\n '),e.push('\n
\n
Video time:
\n
\n
\n '),e.push('\n
\n
Video duration:
\n
\n
\n '),e.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),e.join("")}},{key:"readInfo",value:function(){var e=this.art.template,t=e.$infoPanel,n=e.$video;Array.from(t.querySelectorAll("[data-video]")).forEach(function(e){var t=n[e.dataset.video];e.innerHTML=void 0!==t?"number"==typeof t?t.toFixed(2):t:"unknown"})}},{key:"loop",value:function(){var e=this;this.readInfo(),this.timer=setTimeout(function(){e.readInfo(),e.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template,n=t.$player,r=t.$infoPanel;e?(this.state=!0,n.classList.add("artplayer-info-show"),r.innerHTML||m(r,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),t}(),ce=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()},se=function(){function n(e){M(this,n),this.art=e,this.state=!0;var t=this.art.option.subtitle.url;t&&this.init(t)}return q(n,[{key:"init",value:function(e){var r=this,t=this.art,o=t.events.proxy,n=t.option.subtitle,i=t.template,a=i.$video,c=i.$subtitle,s=i.$track;if(y(c,n.style||{}),!s){var u=document.createElement("track");u.default=!0,u.kind="metadata",a.appendChild(u),this.art.template.$track=u}this.load(e).then(function(e){if(r.art.template.$track.src=e,r.art.emit("subtitle:load",e),a.textTracks&&a.textTracks[0]){var n=ce(a.textTracks,1)[0];o(n,"cuechange",function(){var e=ce(n.activeCues,1)[0];if(c.innerHTML="",e){var t=document.createElement("div");t.appendChild(e.getCueAsHTML()),c.innerHTML=t.innerHTML.split(/\r?\n/).map(function(e){return"

".concat(e,"

")}).join("")}r.art.emit("subtitle:update",c)})}})}},{key:"load",value:function(t){var n,r=this.art.notice;return fetch(t).then(function(e){return n=e.headers.get("Content-Type"),e.text()}).then(function(e){return/x-subrip/gi.test(n)?x(i(e)):t}).catch(function(e){r.show(e),console.warn(e)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,t.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}(),ue=function(){function n(e){var t=this;M(this,n),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("video:canplay",function(){!function(t,e){var n=t.template.$player;e.proxy(document,["click","contextmenu"],function(e){-1'),e.icons.state)}return q(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,t.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),t}(),ye=function(){function n(e){var t=this;M(this,n),this.id=0,this.art=e,this.state=!1,e.option.setting&&(this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1}))}return q(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template.$setting;(0,e.events.proxy)(r,"click",function(e){e.target===r&&(t.show=!1)}),this.add(function(r){return function(t){var e=t.i18n,n=t.player;return re({},r,{html:'\n
'.concat(e.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(e){var t=e.target.dataset.value;t&&(n.flip=t)},mounted:function(e){t.on("flipChange",function(t){w(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(r){return function(t){var e=t.i18n,n=t.player;return re({},r,{html:'\n
'.concat(e.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(e){var t=e.target.dataset.value;t&&(n.aspectRatio=t)},mounted:function(e){t.on("aspectRatioChange",function(t){w(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(t){return function(r){var e=r.i18n,o=r.player,i=r.events.proxy;return re({},t,{html:'\n
\n '.concat(e.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");i(t,"change",function(){var e=t.value;n.innerText=e,o.playbackRate=Number(e)}),r.on("playbackRateChange",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(e,t){this.id+=1;var n=this.art.template.$settingBody;return R(this.art,this,n,e,t,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,t.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),me=function(){function t(e){M(this,t),this.art=e,this.name="artplayer_settings",this.init()}return q(t,[{key:"init",value:function(){var e=this.art.option,t=this.get("volume");t&&(e.volume=t)}},{key:"get",value:function(e){var t=JSON.parse(window.localStorage.getItem(this.name))||{};return e?t[e]:{}}},{key:"set",value:function(e,t){var n=Object.assign({},this.get(),ne({},e,t));window.localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(e){var t=this.get();delete t[e],window.localStorage.setItem(this.name,JSON.stringify(t))}},{key:"clean",value:function(){window.localStorage.removeItem(this.name)}}]),t}(),ve=function(){function n(e){var t=this;M(this,n),this.art=e,this.id=0,e.option.subtitle.url&&this.add(_),e.option.isLive||this.add(L),this.add(T),e.option.plugins.forEach(function(e){t.add(e)})}return q(n,[{key:"add",value:function(e){this.id+=1;var t=e.call(this,this.art);return this[t&&t.name?t.name:e.name?e.name:"plugin".concat(this.id)]=t,this.art.emit("plugin:add",e),this}}]),n}(),ge=0,be=function(e){function n(e){var t;return M(this,n),t=F(this,W(n).call(this)),v("function"==typeof window.Promise,"Unsupported 'Promise' method"),t.option=a(n.DEFAULTS,e),V(t.option,Z),t.init(),t}return N(n,H),q(n,[{key:"init",value:function(){this.whitelist=new O(this),this.template=new G(this),this.events=new ue(this),this.whitelist.state?(this.isFocus=!1,this.isDestroy=!1,this.storage=new me(this),this.icons=new C(this),this.i18n=new ee(this),this.notice=new de(this),this.player=new P(this),this.layers=new fe(this),this.controls=new oe(this),this.contextmenu=new ie(this),this.subtitle=new se(this),this.info=new ae(this),this.loading=new pe(this),this.hotkey=new le(this),this.mask=new he(this),this.setting=new ye(this),this.plugins=new ve(this)):this.mobile=new A(this),ge+=1,this.id=ge,n.instances.push(this)}},{key:"destroy",value:function(){var e=0.")}return t}(t);if(!ve[n]){ve[n]=!0;var r="";e&&e._owner&&e._owner!==A.current&&(r=" It was passed a child from "+z(e._owner.type)+"."),F(e),D(!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),F(null)}}}function ge(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",i=" Did you accidentally export a JSX literal instead of a component?"):a=typeof e,D(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,i)}var s=J.apply(this,arguments);if(null==s)return s;if(r)for(var c=2;c is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||D(!(r=!0),"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Consumer}}}),n.Consumer=o,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===f?x(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?x(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&x(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null==e||null==e.defaultProps&&null==e.propTypes||x(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:c,render:e}},lazy:function(e){var t={$$typeof:p,_ctor:e,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(t,{defaultProps:{configurable:!0,get:function(){return n},set:function(e){D(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(t,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){D(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(t,"propTypes",{enumerable:!0})}}}),t},memo:function(e,t){return pe(e)||x(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:f,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return de().useCallback(e,t)},useContext:function(e,t){var n=de();if(void 0!==t&&D(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?D(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&D(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return de().useEffect(e,t)},useImperativeHandle:function(e,t,n){return de().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return de().useDebugValue(e,t)},useLayoutEffect:function(e,t){return de().useLayoutEffect(e,t)},useMemo:function(e,t){return de().useMemo(e,t)},useReducer:function(e,t,n){return de().useReducer(e,t,n)},useRef:function(e){return de().useRef(e)},useState:function(e){return de().useState(e)},Fragment:u,StrictMode:n,Suspense:l,createElement:we,cloneElement:function(e,t,n){for(var r=function(e,t,n){null==e&&w(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var r=void 0,i=h({},e.props),o=e.key,a=e.ref,s=e._self,c=e._source,u=e._owner;if(null!=t){Y(t)&&(a=t.ref,u=A.current),X(t)&&(o=""+t.key);var l=void 0;for(r in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)V.call(t,r)&&!H.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==l?i[r]=l[r]:i[r]=t[r])}var f=arguments.length-2;if(1==f)i.children=n;else if(1").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function Ie(e){return URL.createObjectURL(new Blob([e],{type:"text/vtt"}))}function We(e,t){var n=document.createElement("a");_e(n,"display","none"),n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var Fe=Object.freeze({errorHandle:ge,hasOwnProperty:be,clamp:we,getExt:ke,secondToTime:xe,sleep:Se,debounce:$e,throttle:Re,mergeDeep:Oe,append:je,remove:Ee,setStyle:_e,setStyles:Te,getStyle:Le,sublings:Ae,inverseClass:Me,tooltip:qe,srtToVtt:ze,vttToBlob:Ie,downloadFile:We});function Ne(e,t,n){return ge("string"===t||e instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}function De(e){var t=this;u(this,De);var n=e.constructor.kindOf,r=e.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||r.some(function(e){switch(n(e)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(e){e?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),Be={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Ye={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Xe=function(){function t(e){u(this,t),this.art=e,this.languages={"zh-cn":Be,"zh-tw":Ye},this.init()}return l(t,[{key:"init",value:function(){var e=this.art.option.lang.toLowerCase();this.language=this.languages[e]||{}}},{key:"get",value:function(e){return this.language[e]||e}},{key:"update",value:function(e){this.languages=Oe(this.languages,e),this.init()}}]),t}();var Ze=e(function(e){var o,t,i,a,r,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=e.exports,i="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var e,t=[["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,r=t.length,i={};n ").concat(c));var u=document.createElement("div");u.classList.value="art-".concat(o," art-").concat(o,"-").concat(c),a.html&&je(u,a.html),a.style&&Te(u,a.style);var l=Array.from(e.children);u.dataset.index=a.index||s;var f=l.find(function(e){return Number(e.dataset.index)>=Number(u.dataset.index)});return f?f.insertAdjacentElement("beforebegin",u):je(e,u),a.click&&t.events.proxy(u,"click",function(e){e.preventDefault(),a.click.call(t,n,e),t.emit("".concat(o,":click"),u)}),a.mounted&&a.mounted(u,n,t),i&&i(u,n,t),Object.defineProperty(n,c,{value:{get id(){return s},get $ref(){return u},set show(e){e?(_e(u,"display","block"),t.emit("".concat(o,":show"),u)):(_e(u,"display","none"),t.emit("".concat(o,":hide"),u))},set remove(e){e&&(Ee(u),t.emit("".concat(o,":remove"),u))}}}),t.emit("".concat(o,":add"),a),n[c]}function Qe(e,t){var n=e.template.$progress,r=e.player,i=n.getBoundingClientRect().left,o=we(t.pageX-i,0,n.clientWidth),a=o/n.clientWidth*r.duration;return{second:a,time:xe(a),width:o,percentage:we(o/n.clientWidth,0,1)}}function et(r){return function(l){var e=l.option,t=e.highlight,n=e.theme,f=l.events.proxy,p=l.player;return s({},r,{html:'\n
\n
\n
\n
\n
\n
\n
\n '),mounted:function(o){var i=!1,n=o.querySelector(".art-progress-loaded"),r=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function u(e,t){"loaded"===e&&_e(n,"width","".concat(100*t,"%")),"played"===e&&(_e(r,"width","".concat(100*t,"%")),_e(s,"left","calc(".concat(100*t,"% - ").concat(Le(s,"width")/2,"px)")))}t.forEach(function(e){var t=we(e.time,0,p.duration)/p.duration*100;je(a,''))}),u("loaded",p.loaded),l.on("video:progress",function(){u("loaded",p.loaded)}),l.on("video:timeupdate",function(){u("played",p.played)}),l.on("video:ended",function(){u("played",1)}),f(o,"mousemove",function(e){_e(c,"display","block"),-1o.clientWidth-r/2?_e(c,"left","".concat(o.clientWidth-r,"px")):_e(c,"left","".concat(t-r/2,"px"))}(e):function(e){var t=Qe(l,e),n=t.width,r=t.time;c.innerHTML=r;var i=c.clientWidth;n<=i/2?_e(c,"left",0):n>o.clientWidth-i/2?_e(c,"left","".concat(o.clientWidth-i,"px")):_e(c,"left","".concat(n-i/2,"px"))}(e)}),f(o,"mouseout",function(){_e(c,"display","none")}),f(o,"click",function(e){if(e.target!==s){var t=Qe(l,e),n=t.second;u("played",t.percentage),p.seek=n}}),f(s,"mousedown",function(){i=!0}),f(document,"mousemove",function(e){if(i){var t=Qe(l,e),n=t.second,r=t.percentage;s.classList.add("art-show-indicator"),u("played",r),p.seek=n}}),f(document,"mouseup",function(){i&&(i=!1,s.classList.remove("art-show-indicator"))})}})}}function tt(e){return function(h){return s({},e,{mounted:function(p){var d=h.template.$progress,e=h.events,t=e.proxy,n=e.loadImg,r=!1,i=!1;t(d,"mousemove",function(e){r||(r=!0,n(h.option.thumbnails.url).then(function(){i=!0})),i&&(_e(p,"display","block"),function(e){var t=Qe(h,e).width,n=h.option.thumbnails,r=n.url,i=n.height,o=n.width,a=n.number,s=n.column,c=d.clientWidth/a,u=Math.floor(t/c),l=Math.ceil(u/s)-1,f=u%s||s-1;_e(p,"backgroundImage","url(".concat(r,")")),_e(p,"height","".concat(i,"px")),_e(p,"width","".concat(o,"px")),_e(p,"backgroundPosition","-".concat(f*o,"px -").concat(l*i,"px")),t<=o/2?_e(p,"left",0):t>d.clientWidth-o/2?_e(p,"left","".concat(d.clientWidth-o,"px")):_e(p,"left","".concat(t-o/2,"px"))}(e))}),t(d,"mouseout",function(){_e(p,"display","none")})}})}}var nt=function(){function n(e){var t=this;u(this,n),this.id=0,this.art=e,this.art.once("video:canplay",function(){t.init()})}return l(n,[{key:"init",value:function(){var t=this,e=this.art.option;this.add(et({name:"progress",disable:e.isLive,position:"top",index:10})),this.add(tt({name:"thumbnails",disable:!e.thumbnails.url||e.isLive,position:"top",index:20})),this.add(function(e){return function(u){return s({},e,{mounted:function(e){var t=u.events.proxy,n=u.icons,r=u.i18n,i=u.player,o=je(e,n.play),a=je(e,n.pause);function s(){_e(o,"display","flex"),_e(a,"display","none")}function c(){_e(o,"display","none"),_e(a,"display","flex")}qe(o,r.get("Play")),qe(a,r.get("Pause")),t(o,"click",function(){i.play=!0}),t(a,"click",function(){i.pause=!0}),i.playing?c():s(),u.on("video:playing",function(){c()}),u.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(e){return function(p){return s({},e,{mounted:function(e){var t=p.events.proxy,n=p.icons,r=p.player,i=p.i18n,o=!1,a=je(e,n.volume),s=je(e,n.volumeClose),c=je(e,'
'),u=je(c,'
');function l(e){var t=c.getBoundingClientRect(),n=t.left,r=t.width,i=u.getBoundingClientRect().width;return we(e.pageX-n-i/2,0,r-i/2)/(r-i)}function f(){var e=0'.concat(i.name,"")),u=o.quality.map(function(e,t){return'
').concat(e.name,"
")}).join(""),l=je(e,'
'.concat(u,"
"));r(e,function(){l.style.left="-".concat(Le(l,"width")/2-e.clientWidth/2,"px")}),n(l,"click",function(e){var t=Number(e.target.dataset.index),n=o.quality[t],r=n.url,i=n.name;r&&i&&s!==t&&(a.switchQuality(r,i),c.innerHTML=i,s=t)})}})}}({name:"quality",disable:0===e.quality.length,position:"right",index:10})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.player,o=je(e,n.screenshot);qe(o,r.get("Screenshot")),t(o,"click",function(){i.screenshot()})}})}}({name:"screenshot",disable:!e.screenshot,position:"right",index:20})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.subtitle,o=je(e,n.subtitle);qe(o,r.get("Hide subtitle")),t(e,"click",function(){i.toggle()}),a.on("subtitle:show",function(){_e(o,"opacity","1"),qe(o,r.get("Hide subtitle"))}),a.on("subtitle:hide",function(){_e(o,"opacity","0.8"),qe(o,r.get("Show subtitle"))})}})}}({name:"subtitle",disable:!e.subtitle.url,position:"right",index:30})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.setting,o=je(e,n.setting);qe(o,r.get("Show setting")),t(e,"click",function(){i.toggle()}),a.on("setting:show",function(){_e(o,"opacity","0.8"),qe(o,r.get("Hide setting"))}),a.on("setting:hide",function(){_e(o,"opacity","1"),qe(o,r.get("Show setting"))})}})}}({name:"setting",disable:!e.setting,position:"right",index:40})),this.add(function(e){return function(o){return s({},e,{mounted:function(e){var t=o.events.proxy,n=o.icons,r=o.i18n,i=o.player;qe(je(e,n.pip),r.get("Mini player")),t(e,"click",function(){i.pip=!0})}})}}({name:"pip",disable:!e.pip,position:"right",index:50})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.player,o=je(e,n.fullscreenWeb);qe(o,r.get("Web fullscreen")),t(e,"click",function(){i.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){_e(o,"opacity","0.8"),qe(o,r.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){_e(o,"opacity","1"),qe(o,r.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!e.fullscreenWeb,position:"right",index:60})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.player,o=je(e,n.fullscreen);qe(o,r.get("Fullscreen")),t(e,"click",function(){i.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){_e(o,"opacity","0.8"),qe(o,r.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){_e(o,"opacity","1"),qe(o,r.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!e.fullscreen,position:"right",index:70})),e.controls.forEach(function(e){t.add(e)})}},{key:"add",value:function(e,t){var n,r="function"==typeof e?e(this.art):e,i=this.art.template,o=i.$progress,a=i.$controlsLeft,s=i.$controlsRight;switch(r.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}ge(n,"Controls option.position can not be empty"),this.id+=1;var c=Ke(this.art,this,n,r,t,"control");return c.$ref.firstElementChild&&"I"===c.$ref.firstElementChild.tagName||c.$ref.classList.add("art-control-onlyText"),c}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,t.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(e){var t=this;u(this,n),this.id=0,this.art=e,this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1})}return l(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template,i=r.$player,o=r.$contextmenu,a=e.events.proxy;this.add(function(n){return function(e){var t=e.i18n,r=e.player;return s({},n,{html:"\n ".concat(t.get("Play speed"),':\n 0.5\n 0.75\n ').concat(t.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(e,t){var n=t.target.dataset.rate;n&&(r.playbackRate=Number(n),e.show=!1)},mounted:function(n){e.on("playbackRateChange",function(t){var e=Array.from(n.querySelectorAll("span")).find(function(e){return Number(e.dataset.rate)===t});e&&Me(e,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(n){return function(t){var e=t.i18n,r=t.player;return s({},n,{html:"\n ".concat(e.get("Aspect ratio"),':\n ').concat(e.get("Default"),'\n 4:3\n 16:9\n '),click:function(e,t){var n=t.target.dataset.ratio;n&&(r.aspectRatio=n,e.show=!1)},mounted:function(e){t.on("aspectRatioChange",function(t){Me(Array.from(e.querySelectorAll("span")).find(function(e){return e.dataset.ratio===t}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(e){return function(t){return s({},e,{html:t.i18n.get("Video info"),click:function(e){t.info.show=!0,e.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(e){return s({},e,{html:'ArtPlayer 3.1.10'})}({disable:!1,name:"version",index:40})),this.add(function(t){return function(e){return s({},t,{html:e.i18n.get("Close"),click:function(e){e.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(e){t.add(e)}),a(i,"contextmenu",function(e){e.preventDefault(),t.show=!0,t.setPos(e)}),a(i,"click",function(e){e.composedPath().includes(o)||(t.show=!1)})}},{key:"add",value:function(e,t){var n=this.art.template.$contextmenu;return this.id+=1,Ke(this.art,this,n,e,t,"contextmenu")}},{key:"setPos",value:function(e){var t=this.art.template,n=t.$player,r=t.$contextmenu,i=e.clientX,o=e.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,u=a.left,l=a.top,f=r.getBoundingClientRect(),p=f.height,d=f.width,h=i-u,y=o-l;u+c\n
Player version:
\n
3.1.10
\n \n '),e.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),e.push('\n
\n
Video volume:
\n
\n
\n '),e.push('\n
\n
Video time:
\n
\n
\n '),e.push('\n
\n
Video duration:
\n
\n
\n '),e.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),e.join("")}},{key:"readInfo",value:function(){var e=this.art.template,t=e.$infoPanel,n=e.$video;Array.from(t.querySelectorAll("[data-video]")).forEach(function(e){var t=n[e.dataset.video];e.innerHTML=void 0!==t?"number"==typeof t?t.toFixed(2):t:"unknown"})}},{key:"loop",value:function(){var e=this;this.readInfo(),this.timer=setTimeout(function(){e.readInfo(),e.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template,n=t.$player,r=t.$infoPanel;e?(this.state=!0,n.classList.add("artplayer-info-show"),r.innerHTML||je(r,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),t}();var ot=function(e){if(Array.isArray(e))return e};var at=function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n};var st=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var ct=function(e,t){return ot(e)||at(e,t)||st()},ut=function(){function n(e){u(this,n),this.art=e,this.state=!0;var t=this.art.option.subtitle.url;t&&this.init(t)}return l(n,[{key:"init",value:function(e){var r=this,t=this.art,i=t.events.proxy,n=t.option.subtitle,o=t.template,a=o.$video,s=o.$subtitle,c=o.$track;if(Te(s,n.style||{}),!c){var u=document.createElement("track");u.default=!0,u.kind="metadata",a.appendChild(u),this.art.template.$track=u}this.load(e).then(function(e){if(r.art.template.$track.src=e,r.art.emit("subtitle:load",e),a.textTracks&&a.textTracks[0]){var n=ct(a.textTracks,1)[0];i(n,"cuechange",function(){var e=ct(n.activeCues,1)[0];if(s.innerHTML="",e){var t=document.createElement("div");t.appendChild(e.getCueAsHTML()),s.innerHTML=t.innerHTML.split(/\r?\n/).map(function(e){return"

".concat(e,"

")}).join("")}r.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(t){var n,r=this.art.notice;return fetch(t).then(function(e){return n=e.headers.get("Content-Type"),e.text()}).then(function(e){return/x-subrip/gi.test(n)?Ie(ze(e)):t}).catch(function(e){r.show(e),console.warn(e)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,t.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function lt(e){var n=this;u(this,lt);var r=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},e.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)),je(t,r[e]),n[e]=t})}var ft=function(){function n(e){var t=this;u(this,n),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("video:canplay",function(){!function(t,e){var n=t.template.$player;e.proxy(document,["click","contextmenu"],function(e){-1'),e.icons.state)}return l(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,t.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),t}();var mt=function(){function n(e){var t=this;u(this,n),this.id=0,this.art=e,this.state=!1,e.option.setting&&(this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1}))}return l(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template.$setting;(0,e.events.proxy)(r,"click",function(e){e.target===r&&(t.show=!1)}),this.add(function(n){return function(t){var e=t.i18n,r=t.player;return s({},n,{html:'\n
'.concat(e.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(e,t){var n=t.target.dataset.value;n&&(r.flip=n)},mounted:function(e){t.on("flipChange",function(t){Me(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(n){return function(t){var e=t.i18n,r=t.player;return s({},n,{html:'\n
'.concat(e.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(e,t){var n=t.target.dataset.value;n&&(r.aspectRatio=n)},mounted:function(e){t.on("aspectRatioChange",function(t){Me(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(t){return function(r){var e=r.i18n,i=r.player,o=r.events.proxy;return s({},t,{html:'\n
\n '.concat(e.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");o(t,"change",function(){var e=t.value;n.innerText=e,i.playbackRate=Number(e)}),r.on("playbackRateChange",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(e,t){this.id+=1;var n=this.art.template.$settingBody;return Ke(this.art,this,n,e,t,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,t.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),gt=function(){function t(e){u(this,t),this.art=e,this.name="artplayer_settings",this.init()}return l(t,[{key:"init",value:function(){var e=this.art.option,t=this.get("volume");t&&(e.volume=t)}},{key:"get",value:function(e){var t=JSON.parse(window.localStorage.getItem(this.name))||{};return e?t[e]:{}}},{key:"set",value:function(e,t){var n=Object.assign({},this.get(),i({},e,t));window.localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(e){var t=this.get();delete t[e],window.localStorage.setItem(this.name,JSON.stringify(t))}},{key:"clean",value:function(){window.localStorage.removeItem(this.name)}}]),t}();function bt(r){var e=r.i18n,i=r.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(e.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");i(t,"change",function(){var e=t.value;n.innerText=e,r.plugins.subtitle.offset(Number(e))}),r.on("subtitle:switch",function(){t.value=0,n.innerText=0}),r.on("artplayerPluginSubtitle:set",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}}}function wt(r){var i=r.constructor.utils.clamp,e=r.setting,o=r.notice,a=r.template,s=r.i18n,c=r.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),e.add(bt);var u=[];return r.on("subtitle:switch",function(){u=[]}),{name:"subtitle",offset:function(e){if(a.$track&&a.$track.track){var t=Array.from(a.$track.track.cues),n=i(e,-5,5);t.forEach(function(e,t){u[t]||(u[t]={startTime:e.startTime,endTime:e.endTime}),e.startTime=i(u[t].startTime+n,0,c.duration),e.endTime=i(u[t].endTime+n,0,c.duration)}),o.show("".concat(s.get("Subtitle offset time"),": ").concat(e,"s")),r.emit("artplayerPluginSubtitle:set",e)}else o.show("".concat(s.get("No subtitles found"))),r.emit("artplayerPluginSubtitle:set",0)}}}function kt(i){var e=i.constructor.utils,n=e.append,r=e.setStyle,o=e.setStyles,a=e.sleep,s=i.events.proxy,c=i.option,u=i.notice,l=i.i18n,f=i.template,p=i.player;function d(e){if(e){var t=f.$video.canPlayType(e.type);if("maybe"===t||"probably"===t){var n=URL.createObjectURL(e);p.playbackRate=!1,p.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){p.currentTime=0}),c.url=n,i.emit("switch",n),u.show(l.get("Load local video successfully"))}else{var r="".concat(l.get("Playback of this file format is not supported"),": ").concat(e.type);u.show(r,!0,3e3),console.warn(r)}}}return l.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(e){e.preventDefault(),u.show(l.get("Load local video successfully"))}),s(f.$player,"drop",function(e){e.preventDefault(),d(e.dataTransfer.files[0])}),{name:"localPreview",attach:function(e){var t=n(e,'');r(e,"position","relative"),o(t,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(t,"change",function(){d(t.files[0])})}}}function xt(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:"3px",background:r},mounted:function(e){t.on("controls:show",function(){e.style.display="none"}),t.on("controls:hide",function(){e.style.display="block"}),t.on("video:timeupdate",function(){e.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function St(t){u(this,St);var n=t.option,r=t.events.proxy,i=t.template.$video;He.video.events.forEach(function(e){r(i,e,function(e){t.emit("video:".concat(e.type),e)})}),Object.keys(n.moreVideoAttr).forEach(function(e){i[e]=n.moreVideoAttr[e]}),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=we(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var e=n.type||ke(n.url),o=n.customType[e];e&&o?(t.emit("beforeCustomType",e),o(i,n.url,t),t.emit("afterCustomType",e)):(t.emit("beforeAttachUrl",n.url),i.src=n.url,t.emit("afterAttachUrl",i.src))}var $t=function(){function n(e){var t=this;u(this,n),this.art=e,this.id=0,e.option.subtitle.url&&this.add(wt),e.option.isLive||this.add(xt),this.add(kt),e.option.plugins.forEach(function(e){t.add(e)})}return l(n,[{key:"add",value:function(e){this.id+=1;var t=e.call(this,this.art),n="";return ge(!be(this,n=t&&t.name?t.name:e.name?e.name:"plugin".concat(this.id)),"Cannot add a plugin that already has the same name: ".concat(n)),Object.defineProperty(this,n,{value:t}),this.art.emit("plugin:add",e),this}}]),n}(),Rt=0,Pt=function(e){function n(e){var t;return u(this,n),t=p(this,d(n).call(this)),ge("function"==typeof window.Promise,"Unsupported 'Promise' method"),t.option=Oe(n.DEFAULTS,e),ue(t.option,Ve),t.init(),t}return t(n,le),l(n,[{key:"init",value:function(){this.isFocus=!1,this.isDestroy=!1,this.whitelist=new De(this),this.template=new Ue(this),this.events=new ft(this),this.whitelist.state?(this.storage=new gt(this),this.icons=new lt(this),this.i18n=new Xe(this),this.notice=new yt(this),this.player=new Ge(this),this.layers=new dt(this),this.controls=new nt(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new it(this),this.loading=new ht(this),this.hotkey=new pt(this),this.mask=new vt(this),this.setting=new mt(this),this.plugins=new $t(this)):this.mobile=new St(this),Rt+=1,this.id=Rt,n.instances.push(this)}},{key:"destroy",value:function(){var e=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function k(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function S(t,e){var n=document.createElement("a");g(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function $(t,e,n){return v("string"===n||e instanceof Element,"".concat(t.join(".")," require 'string' or 'Element' type"))}function L(t){var e=this;q(this,L);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1 ").concat(s));var c=document.createElement("div");c.classList.value="art-".concat(o," art-").concat(o,"-").concat(s),a.html&&m(c,a.html),a.style&&y(c,a.style);var l=Array.from(t.children);c.dataset.index=a.index||n.id;var u=l.find(function(t){return Number(t.dataset.index)>=Number(c.dataset.index)});return u?u.insertAdjacentElement("beforebegin",c):m(t,c),a.click&&e.events.proxy(c,"click",function(t){t.preventDefault(),a.click.call(n,t,e),e.emit("".concat(o,":click"),c)}),a.mounted&&a.mounted(c,n,e),r&&r(c,n,e),Object.defineProperty(n,s,{value:{get id(){return n.id},get $ref(){return c},set show(t){t?(g(c,"display","block"),e.emit("".concat(o,":show"),c)):(g(c,"display","none"),e.emit("".concat(o,":hide"),c))},set remove(t){t&&(h(c),e.emit("".concat(o,":remove"),c))}}}),e.emit("".concat(o,":add"),a),n[s]}function T(t,e){var n=t.template.$progress,i=t.player,r=n.getBoundingClientRect().left,o=p(e.pageX-r,0,n.clientWidth),a=o/n.clientWidth*i.duration;return{second:a,time:c(a),width:o,percentage:p(o/n.clientWidth,0,1)}}function E(t){var n=this;q(this,E);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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]),n[t]=e})}function O(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function j(i){var r=i.constructor.utils.clamp,t=i.setting,o=i.notice,a=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(O);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(a.$track&&a.$track.track){var e=Array.from(a.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),o.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else o.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function A(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,o=t.setStyles,a=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),o(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function C(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function M(e){q(this,M);var n=e.option,i=e.events.proxy,r=e.template.$video;J.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=p(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||s(n.url),o=n.customType[t];t&&o?(e.emit("beforeCustomType",t),o(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var q,z,W,_,F,H,B,I,V,N,D,U,X,Y,Z,J,G,K,Q,tt,et,nt,it,rt,ot,at,st,ct,lt,ut,ft,dt,pt,ht,yt,mt,vt,gt,bt;t.exports=(q=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},z=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t},W=n(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==wt(Symbol.iterator)?function(t){return wt(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":wt(t)})(t)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(t){return n(t)}:e.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},i(t)}e.exports=i}),_=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},F=function(t,e){return!e||"object"!==W(e)&&"function"!=typeof e?_(t):e},H=n(function(e){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n}),B=n(function(n){function i(t,e){return n.exports=i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}n.exports=i}),I=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&&B(t,e)},V=n(function(t,e){function s(t){return(s="function"==typeof Symbol&&"symbol"==wt(Symbol.iterator)?function(t){return wt(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":wt(t)})(t)}function c(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Q={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},tt=function(){function e(t){q(this,e),this.art=t,this.languages={"zh-cn":K,"zh-tw":Q},this.init()}return z(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=a(this.languages,t),this.init()}}]),e}(),et=n(function(t){var o,e,r,a,i,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var t,e=[["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,i=e.length,r={};n\n
\n
\n
\n
\n
\n \n '),mounted:function(o){var r=!1,n=o.querySelector(".art-progress-loaded"),i=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&g(n,"width","".concat(100*e,"%")),"played"===t&&(g(i,"width","".concat(100*e,"%")),g(s,"left","calc(".concat(100*e,"% - ").concat(b(s,"width")/2,"px)")))}e.forEach(function(t){var e=p(t.time,0,d.duration)/d.duration*100;m(a,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(o,"mousemove",function(t){g(c,"display","block"),-1o.clientWidth-i/2?g(c,"left","".concat(o.clientWidth-i,"px")):g(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=T(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?g(c,"left",0):n>o.clientWidth-r/2?g(c,"left","".concat(o.clientWidth-r,"px")):g(c,"left","".concat(n-r/2,"px"))}(t)}),f(o,"mouseout",function(){g(c,"display","none")}),f(o,"click",function(t){if(t.target!==s){var e=T(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=T(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(function(t){return function(h){return it({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(g(d,"display","block"),function(t){var e=T(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,o=n.width,a=n.number,s=n.column,c=p.clientWidth/a,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;g(d,"backgroundImage","url(".concat(i,")")),g(d,"height","".concat(r,"px")),g(d,"width","".concat(o,"px")),g(d,"backgroundPosition","-".concat(f*o,"px -").concat(u*r,"px")),e<=o/2?g(d,"left",0):e>p.clientWidth-o/2?g(d,"left","".concat(p.clientWidth-o,"px")):g(d,"left","".concat(e-o/2,"px"))}(t))}),e(p,"mouseout",function(){g(d,"display","none")})}})}}({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return it({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,o=m(t,n.play),a=m(t,n.pause);function s(){g(o,"display","flex"),g(a,"display","none")}function c(){g(o,"display","none"),g(a,"display","flex")}x(o,i.get("Play")),x(a,i.get("Pause")),e(o,"click",function(){r.play=!0}),e(a,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return it({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,o=!1,a=m(t,n.volume),s=m(t,n.volumeClose),c=m(t,'
'),l=m(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return p(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(n.name,"")),i=o.quality.map(function(t,e){return'
').concat(t.name,"
")}).join("");e(m(t,'
'.concat(i,"
")),"click",function(t){var e=Number(t.target.dataset.index),n=o.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(a.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=m(t,n.screenshot);x(o,i.get("Screenshot")),e(o,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.subtitle,o=m(t,n.subtitle);x(o,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),a.on("subtitle:show",function(){g(o,"opacity","1"),x(o,i.get("Hide subtitle"))}),a.on("subtitle:hide",function(){g(o,"opacity","0.8"),x(o,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.setting,o=m(t,n.setting);x(o,i.get("Show setting")),e(t,"click",function(){r.toggle()}),a.on("setting:show",function(){g(o,"opacity","0.8"),x(o,i.get("Hide setting"))}),a.on("setting:hide",function(){g(o,"opacity","1"),x(o,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(o){return it({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player;x(m(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=m(t,n.fullscreenWeb);x(o,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){g(o,"opacity","0.8"),x(o,i.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){g(o,"opacity","1"),x(o,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=m(t,n.fullscreen);x(o,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){g(o,"opacity","0.8"),x(o,i.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){g(o,"opacity","1"),x(o,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,o=r.$progress,a=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}return v(n,"Controls option.position can not be empty"),this.id+=1,R(this.art,this,n,i,e,"control")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}(),ot=function(){function n(t){var e=this;q(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return z(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,o=i.$contextmenu,a=t.events.proxy;this.add(function(e){return function(i){var t=i.i18n,n=i.player;return it({},e,{html:"\n ".concat(t.get("Play speed"),':\n 0.5\n 0.75\n ').concat(t.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t){var e=t.target.dataset.rate;e&&(n.playbackRate=Number(e),i.contextmenu.show=!1)},mounted:function(n){i.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&w(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(e){return function(n){var t=n.i18n,i=n.player;return it({},e,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t){var e=t.target.dataset.ratio;e&&(i.aspectRatio=e,n.contextmenu.show=!1)},mounted:function(t){n.on("aspectRatioChange",function(e){w(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(e){return function(t){return it({},e,{html:t.i18n.get("Video info"),click:function(){t.info.show=!0,t.contextmenu.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(it({},{disable:!1,name:"version",index:40},{html:'ArtPlayer 3.1.9'})),this.add(function(e){return function(t){return it({},e,{html:t.i18n.get("Close"),click:function(){t.contextmenu.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),a(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),a(r,"click",function(t){t.composedPath().includes(o)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,R(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,o=t.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,l=a.left,u=a.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=o-u;l+c\n
Player version:
\n
3.1.9
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||m(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}(),st=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()},ct=function(){function n(t){q(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return z(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,o=e.template,a=o.$video,s=o.$subtitle,c=o.$track;if(y(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",a.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),a.textTracks&&a.textTracks[0]){var n=st(a.textTracks,1)[0];r(n,"cuechange",function(){var t=st(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?k(o(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}(),lt=function(){function n(t){var e=this;q(this,n),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){-1'),t.icons.state)}return z(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}(),yt=function(){function n(t){var e=this;q(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return z(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return it({},i,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t){var e=t.target.dataset.value;e&&(n.flip=e)},mounted:function(t){e.on("flipChange",function(e){w(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return it({},i,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t){var e=t.target.dataset.value;e&&(n.aspectRatio=e)},mounted:function(t){e.on("aspectRatioChange",function(e){w(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,o=i.events.proxy;return it({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");o(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return R(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),mt=function(){function e(t){q(this,e),this.art=t,this.name="artplayer_settings",this.init()}return z(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),nt({},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}(),vt=function(){function n(t){var e=this;q(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(j),t.option.isLive||this.add(C),this.add(A),t.option.plugins.forEach(function(t){e.add(t)})}return z(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art);return this[e&&e.name?e.name:t.name?t.name:"plugin".concat(this.id)]=e,this.art.emit("plugin:add",t),this}}]),n}(),gt=0,bt=function(t){function n(t){var e;return q(this,n),e=F(this,H(n).call(this)),v("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=a(n.DEFAULTS,t),V(e.option,Z),e.init(),e}return I(n,N),z(n,[{key:"init",value:function(){this.whitelist=new L(this),this.template=new G(this),this.events=new lt(this),this.whitelist.state?(this.isFocus=!1,this.isDestroy=!1,this.storage=new mt(this),this.icons=new E(this),this.i18n=new tt(this),this.notice=new pt(this),this.player=new P(this),this.layers=new ft(this),this.controls=new rt(this),this.contextmenu=new ot(this),this.subtitle=new ct(this),this.info=new at(this),this.loading=new dt(this),this.hotkey=new ut(this),this.mask=new ht(this),this.setting=new yt(this),this.plugins=new vt(this)):this.mobile=new M(this),gt+=1,this.id=gt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function F(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t,e){var n=document.createElement("a");C(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var B=Object.freeze({errorHandle:x,hasOwnProperty:k,clamp:S,getExt:$,secondToTime:L,sleep:R,debounce:T,throttle:P,mergeDeep:E,append:j,remove:O,setStyle:C,setStyles:A,getStyle:M,sublings:q,inverseClass:z,tooltip:W,srtToVtt:_,vttToBlob:F,downloadFile:H});function I(t,e,n){return x("string"===e||t instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}function V(t){var e=this;o(this,V);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),X={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Y={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Z=function(){function e(t){o(this,e),this.art=t,this.languages={"zh-cn":X,"zh-tw":Y},this.init()}return a(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=E(this.languages,t),this.init()}}]),e}();var J=t(function(t){var a,e,r,o,i,n;a="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,o=function(){for(var t,e=[["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,i=e.length,r={};n ").concat(c));var l=document.createElement("div");l.classList.value="art-".concat(a," art-").concat(a,"-").concat(c),o.html&&j(l,o.html),o.style&&A(l,o.style);var u=Array.from(t.children);l.dataset.index=o.index||s;var f=u.find(function(t){return Number(t.dataset.index)>=Number(l.dataset.index)});return f?f.insertAdjacentElement("beforebegin",l):j(t,l),o.click&&e.events.proxy(l,"click",function(t){t.preventDefault(),o.click.call(e,n,t),e.emit("".concat(a,":click"),l)}),o.mounted&&o.mounted(l,n,e),r&&r(l,n,e),Object.defineProperty(n,c,{value:{get id(){return s},get $ref(){return l},set show(t){t?(C(l,"display","block"),e.emit("".concat(a,":show"),l)):(C(l,"display","none"),e.emit("".concat(a,":hide"),l))},set remove(t){t&&(O(l),e.emit("".concat(a,":remove"),l))}}}),e.emit("".concat(a,":add"),o),n[c]}function tt(t,e){var n=t.template.$progress,i=t.player,r=n.getBoundingClientRect().left,a=S(e.pageX-r,0,n.clientWidth),o=a/n.clientWidth*i.duration;return{second:o,time:L(o),width:a,percentage:S(a/n.clientWidth,0,1)}}function et(i){return function(u){var t=u.option,e=t.highlight,n=t.theme,f=u.events.proxy,d=u.player;return s({},i,{html:'\n
\n
\n
\n
\n
\n
\n
\n '),mounted:function(a){var r=!1,n=a.querySelector(".art-progress-loaded"),i=a.querySelector(".art-progress-played"),o=a.querySelector(".art-progress-highlight"),s=a.querySelector(".art-progress-indicator"),c=a.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&C(n,"width","".concat(100*e,"%")),"played"===t&&(C(i,"width","".concat(100*e,"%")),C(s,"left","calc(".concat(100*e,"% - ").concat(M(s,"width")/2,"px)")))}e.forEach(function(t){var e=S(t.time,0,d.duration)/d.duration*100;j(o,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(a,"mousemove",function(t){C(c,"display","block"),-1a.clientWidth-i/2?C(c,"left","".concat(a.clientWidth-i,"px")):C(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=tt(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?C(c,"left",0):n>a.clientWidth-r/2?C(c,"left","".concat(a.clientWidth-r,"px")):C(c,"left","".concat(n-r/2,"px"))}(t)}),f(a,"mouseout",function(){C(c,"display","none")}),f(a,"click",function(t){if(t.target!==s){var e=tt(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=tt(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}function nt(t){return function(h){return s({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(C(d,"display","block"),function(t){var e=tt(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,a=n.width,o=n.number,s=n.column,c=p.clientWidth/o,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;C(d,"backgroundImage","url(".concat(i,")")),C(d,"height","".concat(r,"px")),C(d,"width","".concat(a,"px")),C(d,"backgroundPosition","-".concat(f*a,"px -").concat(u*r,"px")),e<=a/2?C(d,"left",0):e>p.clientWidth-a/2?C(d,"left","".concat(p.clientWidth-a,"px")):C(d,"left","".concat(e-a/2,"px"))}(t))}),e(p,"mouseout",function(){C(d,"display","none")})}})}}var it=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()})}return a(n,[{key:"init",value:function(){var e=this,t=this.art.option;this.add(et({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(nt({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return s({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,a=j(t,n.play),o=j(t,n.pause);function s(){C(a,"display","flex"),C(o,"display","none")}function c(){C(a,"display","none"),C(o,"display","flex")}W(a,i.get("Play")),W(o,i.get("Pause")),e(a,"click",function(){r.play=!0}),e(o,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return s({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,a=!1,o=j(t,n.volume),s=j(t,n.volumeClose),c=j(t,'
'),l=j(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return S(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(r.name,"")),l=a.quality.map(function(t,e){return'
').concat(t.name,"
")}).join(""),u=j(t,'
'.concat(l,"
"));i(t,function(){u.style.left="-".concat(M(u,"width")/2-t.clientWidth/2,"px")}),n(u,"click",function(t){var e=Number(t.target.dataset.index),n=a.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(o.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=j(t,n.screenshot);W(a,i.get("Screenshot")),e(a,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.subtitle,a=j(t,n.subtitle);W(a,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),o.on("subtitle:show",function(){C(a,"opacity","1"),W(a,i.get("Hide subtitle"))}),o.on("subtitle:hide",function(){C(a,"opacity","0.8"),W(a,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.setting,a=j(t,n.setting);W(a,i.get("Show setting")),e(t,"click",function(){r.toggle()}),o.on("setting:show",function(){C(a,"opacity","0.8"),W(a,i.get("Hide setting"))}),o.on("setting:hide",function(){C(a,"opacity","1"),W(a,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(a){return s({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player;W(j(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=j(t,n.fullscreenWeb);W(a,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),o.on("fullscreenWeb:enabled",function(){C(a,"opacity","0.8"),W(a,i.get("Exit web fullscreen"))}),o.on("fullscreenWeb:exit",function(){C(a,"opacity","1"),W(a,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=j(t,n.fullscreen);W(a,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),o.on("fullscreen:enabled",function(){C(a,"opacity","0.8"),W(a,i.get("Exit fullscreen"))}),o.on("fullscreen:exit",function(){C(a,"opacity","1"),W(a,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,a=r.$progress,o=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=a;break;case"left":n=o;break;case"right":n=s}x(n,"Controls option.position can not be empty"),this.id+=1;var c=Q(this.art,this,n,i,e,"control");return c.$ref.firstElementChild&&"I"===c.$ref.firstElementChild.tagName||c.$ref.classList.add("art-control-onlyText"),c}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return a(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,a=i.$contextmenu,o=t.events.proxy;this.add(function(n){return function(t){var e=t.i18n,i=t.player;return s({},n,{html:"\n ".concat(e.get("Play speed"),':\n 0.5\n 0.75\n ').concat(e.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t,e){var n=e.target.dataset.rate;n&&(i.playbackRate=Number(n),t.show=!1)},mounted:function(n){t.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&z(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return s({},n,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t,e){var n=e.target.dataset.ratio;n&&(i.aspectRatio=n,t.show=!1)},mounted:function(t){e.on("aspectRatioChange",function(e){z(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(t){return function(e){return s({},t,{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(t){return s({},t,{html:'ArtPlayer 3.1.10'})}({disable:!1,name:"version",index:40})),this.add(function(e){return function(t){return s({},e,{html:t.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),o(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),o(r,"click",function(t){t.composedPath().includes(a)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,Q(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,a=t.clientY,o=n.getBoundingClientRect(),s=o.height,c=o.width,l=o.left,u=o.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=a-u;l+c\n
Player version:
\n
3.1.10
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||j(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}();var ot=function(t){if(Array.isArray(t))return t};var st=function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n};var ct=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var lt=function(t,e){return ot(t)||st(t,e)||ct()},ut=function(){function n(t){o(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return a(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,a=e.template,o=a.$video,s=a.$subtitle,c=a.$track;if(A(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",o.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),o.textTracks&&o.textTracks[0]){var n=lt(o.textTracks,1)[0];r(n,"cuechange",function(){var t=lt(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?F(_(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function ft(t){var n=this;o(this,ft);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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)),j(e,i[t]),n[t]=e})}var dt=function(){function n(t){var e=this;o(this,n),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){-1'),t.icons.state)}return a(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}();var gt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return a(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return s({},n,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t,e){var n=e.target.dataset.value;n&&(i.flip=n)},mounted:function(t){e.on("flipChange",function(e){z(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return s({},n,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t,e){var n=e.target.dataset.value;n&&(i.aspectRatio=n)},mounted:function(t){e.on("aspectRatioChange",function(e){z(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,a=i.events.proxy;return s({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");a(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return Q(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),bt=function(){function e(t){o(this,e),this.art=t,this.name="artplayer_settings",this.init()}return a(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),r({},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 wt(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function xt(i){var r=i.constructor.utils.clamp,t=i.setting,a=i.notice,o=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(wt);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(o.$track&&o.$track.track){var e=Array.from(o.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),a.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else a.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function kt(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,a=t.setStyles,o=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,o(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),a(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function St(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function $t(e){o(this,$t);var n=e.option,i=e.events.proxy,r=e.template.$video;D.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=S(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||$(n.url),a=n.customType[t];t&&a?(e.emit("beforeCustomType",t),a(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var Lt=function(){function n(t){var e=this;o(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(xt),t.option.isLive||this.add(St),this.add(kt),t.option.plugins.forEach(function(t){e.add(t)})}return a(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),n="";return x(!k(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}}]),n}(),Rt=0,Tt=function(t){function n(t){var e;return o(this,n),e=u(this,f(n).call(this)),x("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=E(n.DEFAULTS,t),p(e.option,N),e.init(),e}return e(n,h),a(n,[{key:"init",value:function(){this.isFocus=!1,this.isDestroy=!1,this.whitelist=new V(this),this.template=new U(this),this.events=new dt(this),this.whitelist.state?(this.storage=new bt(this),this.icons=new ft(this),this.i18n=new Z(this),this.notice=new vt(this),this.player=new K(this),this.layers=new ht(this),this.controls=new it(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new at(this),this.loading=new yt(this),this.hotkey=new pt(this),this.mask=new mt(this),this.setting=new gt(this),this.plugins=new Lt(this)):this.mobile=new $t(this),Rt+=1,this.id=Rt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function W(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function _(t,e){var n=document.createElement("a");j(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var F=Object.freeze({errorHandle:b,hasOwnProperty:w,clamp:x,getExt:k,secondToTime:S,sleep:$,debounce:L,throttle:T,mergeDeep:R,append:P,remove:E,setStyle:j,setStyles:O,getStyle:A,sublings:C,inverseClass:M,tooltip:q,srtToVtt:z,vttToBlob:W,downloadFile:_});function H(t,e,n){return b("string"===n||e instanceof Element,"".concat(t.join(".")," require 'string' or 'Element' type"))}function B(t){var e=this;a(this,B);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),D={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},U={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},X=function(){function e(t){a(this,e),this.art=t,this.languages={"zh-cn":D,"zh-tw":U},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=R(this.languages,t),this.init()}}]),e}();var Y=t(function(t){var o,e,r,a,i,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var t,e=[["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,i=e.length,r={};n ").concat(s));var c=document.createElement("div");c.classList.value="art-".concat(o," art-").concat(o,"-").concat(s),a.html&&P(c,a.html),a.style&&O(c,a.style);var l=Array.from(t.children);c.dataset.index=a.index||n.id;var u=l.find(function(t){return Number(t.dataset.index)>=Number(c.dataset.index)});return u?u.insertAdjacentElement("beforebegin",c):P(t,c),a.click&&e.events.proxy(c,"click",function(t){t.preventDefault(),a.click.call(n,t,e),e.emit("".concat(o,":click"),c)}),a.mounted&&a.mounted(c,n,e),r&&r(c,n,e),Object.defineProperty(n,s,{value:{get id(){return n.id},get $ref(){return c},set show(t){t?(j(c,"display","block"),e.emit("".concat(o,":show"),c)):(j(c,"display","none"),e.emit("".concat(o,":hide"),c))},set remove(t){t&&(E(c),e.emit("".concat(o,":remove"),c))}}}),e.emit("".concat(o,":add"),a),n[s]}var K=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var Q=function(e){for(var t=1;t\n
\n
\n
\n
\n
\n \n '),mounted:function(o){var r=!1,n=o.querySelector(".art-progress-loaded"),i=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&j(n,"width","".concat(100*e,"%")),"played"===t&&(j(i,"width","".concat(100*e,"%")),j(s,"left","calc(".concat(100*e,"% - ").concat(A(s,"width")/2,"px)")))}e.forEach(function(t){var e=x(t.time,0,d.duration)/d.duration*100;P(a,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(o,"mousemove",function(t){j(c,"display","block"),-1o.clientWidth-i/2?j(c,"left","".concat(o.clientWidth-i,"px")):j(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=tt(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?j(c,"left",0):n>o.clientWidth-r/2?j(c,"left","".concat(o.clientWidth-r,"px")):j(c,"left","".concat(n-r/2,"px"))}(t)}),f(o,"mouseout",function(){j(c,"display","none")}),f(o,"click",function(t){if(t.target!==s){var e=tt(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=tt(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}function nt(t){return function(h){return Q({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(j(d,"display","block"),function(t){var e=tt(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,o=n.width,a=n.number,s=n.column,c=p.clientWidth/a,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;j(d,"backgroundImage","url(".concat(i,")")),j(d,"height","".concat(r,"px")),j(d,"width","".concat(o,"px")),j(d,"backgroundPosition","-".concat(f*o,"px -").concat(u*r,"px")),e<=o/2?j(d,"left",0):e>p.clientWidth-o/2?j(d,"left","".concat(p.clientWidth-o,"px")):j(d,"left","".concat(e-o/2,"px"))}(t))}),e(p,"mouseout",function(){j(d,"display","none")})}})}}var it=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var e=this,t=this.art.option;this.add(et({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(nt({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return Q({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,o=P(t,n.play),a=P(t,n.pause);function s(){j(o,"display","flex"),j(a,"display","none")}function c(){j(o,"display","none"),j(a,"display","flex")}q(o,i.get("Play")),q(a,i.get("Pause")),e(o,"click",function(){r.play=!0}),e(a,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return Q({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,o=!1,a=P(t,n.volume),s=P(t,n.volumeClose),c=P(t,'
'),l=P(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return x(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(n.name,"")),i=o.quality.map(function(t,e){return'
').concat(t.name,"
")}).join("");e(P(t,'
'.concat(i,"
")),"click",function(t){var e=Number(t.target.dataset.index),n=o.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(a.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=P(t,n.screenshot);q(o,i.get("Screenshot")),e(o,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.subtitle,o=P(t,n.subtitle);q(o,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),a.on("subtitle:show",function(){j(o,"opacity","1"),q(o,i.get("Hide subtitle"))}),a.on("subtitle:hide",function(){j(o,"opacity","0.8"),q(o,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.setting,o=P(t,n.setting);q(o,i.get("Show setting")),e(t,"click",function(){r.toggle()}),a.on("setting:show",function(){j(o,"opacity","0.8"),q(o,i.get("Hide setting"))}),a.on("setting:hide",function(){j(o,"opacity","1"),q(o,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player;q(P(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=P(t,n.fullscreenWeb);q(o,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){j(o,"opacity","0.8"),q(o,i.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){j(o,"opacity","1"),q(o,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=P(t,n.fullscreen);q(o,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){j(o,"opacity","0.8"),q(o,i.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){j(o,"opacity","1"),q(o,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,o=r.$progress,a=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}return b(n,"Controls option.position can not be empty"),this.id+=1,G(this.art,this,n,i,e,"control")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,o=i.$contextmenu,a=t.events.proxy;this.add(function(e){return function(i){var t=i.i18n,n=i.player;return Q({},e,{html:"\n ".concat(t.get("Play speed"),':\n 0.5\n 0.75\n ').concat(t.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t){var e=t.target.dataset.rate;e&&(n.playbackRate=Number(e),i.contextmenu.show=!1)},mounted:function(n){i.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&M(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(e){return function(n){var t=n.i18n,i=n.player;return Q({},e,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t){var e=t.target.dataset.ratio;e&&(i.aspectRatio=e,n.contextmenu.show=!1)},mounted:function(t){n.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(e){return function(t){return Q({},e,{html:t.i18n.get("Video info"),click:function(){t.info.show=!0,t.contextmenu.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(t){return Q({},t,{html:'ArtPlayer 3.1.9'})}({disable:!1,name:"version",index:40})),this.add(function(e){return function(t){return Q({},e,{html:t.i18n.get("Close"),click:function(){t.contextmenu.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),a(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),a(r,"click",function(t){t.composedPath().includes(o)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,G(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,o=t.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,l=a.left,u=a.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=o-u;l+c\n
Player version:
\n
3.1.9
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||P(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}();var at=function(t){if(Array.isArray(t))return t};var st=function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n};var ct=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var lt=function(t,e){return at(t)||st(t,e)||ct()},ut=function(){function n(t){a(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return r(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,o=e.template,a=o.$video,s=o.$subtitle,c=o.$track;if(O(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",a.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),a.textTracks&&a.textTracks[0]){var n=lt(a.textTracks,1)[0];r(n,"cuechange",function(){var t=lt(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(z(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function ft(t){var n=this;a(this,ft);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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)),P(e,i[t]),n[t]=e})}var dt=function(){function n(t){var e=this;a(this,n),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){-1'),t.icons.state)}return r(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}();var gt=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return Q({},i,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t){var e=t.target.dataset.value;e&&(n.flip=e)},mounted:function(t){e.on("flipChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return Q({},i,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t){var e=t.target.dataset.value;e&&(n.aspectRatio=e)},mounted:function(t){e.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,o=i.events.proxy;return Q({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");o(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return G(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),bt=function(){function e(t){a(this,e),this.art=t,this.name="artplayer_settings",this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),K({},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 wt(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function xt(i){var r=i.constructor.utils.clamp,t=i.setting,o=i.notice,a=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(wt);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(a.$track&&a.$track.track){var e=Array.from(a.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),o.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else o.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function kt(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,o=t.setStyles,a=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),o(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function St(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function $t(e){a(this,$t);var n=e.option,i=e.events.proxy,r=e.template.$video;V.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=x(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||k(n.url),o=n.customType[t];t&&o?(e.emit("beforeCustomType",t),o(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var Lt=function(){function n(t){var e=this;a(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(xt),t.option.isLive||this.add(St),this.add(kt),t.option.plugins.forEach(function(t){e.add(t)})}return r(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art);return this[e&&e.name?e.name:t.name?t.name:"plugin".concat(this.id)]=e,this.art.emit("plugin:add",t),this}}]),n}(),Tt=0,Rt=function(t){function n(t){var e;return a(this,n),e=c(this,l(n).call(this)),b("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=R(n.DEFAULTS,t),f(e.option,I),e.init(),e}return e(n,d),r(n,[{key:"init",value:function(){this.whitelist=new B(this),this.template=new N(this),this.events=new dt(this),this.whitelist.state?(this.isFocus=!1,this.isDestroy=!1,this.storage=new bt(this),this.icons=new ft(this),this.i18n=new X(this),this.notice=new vt(this),this.player=new J(this),this.layers=new ht(this),this.controls=new it(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new ot(this),this.loading=new yt(this),this.hotkey=new pt(this),this.mask=new mt(this),this.setting=new gt(this),this.plugins=new Lt(this)):this.mobile=new $t(this),Tt+=1,this.id=Tt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function W(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function _(t,e){var n=document.createElement("a");j(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var F=Object.freeze({errorHandle:b,hasOwnProperty:w,clamp:x,getExt:k,secondToTime:S,sleep:$,debounce:L,throttle:T,mergeDeep:P,append:R,remove:E,setStyle:j,setStyles:O,getStyle:C,sublings:A,inverseClass:M,tooltip:q,srtToVtt:z,vttToBlob:W,downloadFile:_});function H(t,e,n){return b("string"===e||t instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}function B(t){var e=this;o(this,B);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),D={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},U={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},X=function(){function e(t){o(this,e),this.art=t,this.languages={"zh-cn":D,"zh-tw":U},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=P(this.languages,t),this.init()}}]),e}();var Y=t(function(t){var a,e,r,o,i,n;a="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,o=function(){for(var t,e=[["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,i=e.length,r={};n ").concat(c));var l=document.createElement("div");l.classList.value="art-".concat(a," art-").concat(a,"-").concat(c),o.html&&R(l,o.html),o.style&&O(l,o.style);var u=Array.from(t.children);l.dataset.index=o.index||s;var f=u.find(function(t){return Number(t.dataset.index)>=Number(l.dataset.index)});return f?f.insertAdjacentElement("beforebegin",l):R(t,l),o.click&&e.events.proxy(l,"click",function(t){t.preventDefault(),o.click.call(e,n,t),e.emit("".concat(a,":click"),l)}),o.mounted&&o.mounted(l,n,e),r&&r(l,n,e),Object.defineProperty(n,c,{value:{get id(){return s},get $ref(){return l},set show(t){t?(j(l,"display","block"),e.emit("".concat(a,":show"),l)):(j(l,"display","none"),e.emit("".concat(a,":hide"),l))},set remove(t){t&&(E(l),e.emit("".concat(a,":remove"),l))}}}),e.emit("".concat(a,":add"),o),n[c]}var K=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var Q=function(e){for(var t=1;t\n
\n
\n
\n
\n
\n \n '),mounted:function(a){var r=!1,n=a.querySelector(".art-progress-loaded"),i=a.querySelector(".art-progress-played"),o=a.querySelector(".art-progress-highlight"),s=a.querySelector(".art-progress-indicator"),c=a.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&j(n,"width","".concat(100*e,"%")),"played"===t&&(j(i,"width","".concat(100*e,"%")),j(s,"left","calc(".concat(100*e,"% - ").concat(C(s,"width")/2,"px)")))}e.forEach(function(t){var e=x(t.time,0,d.duration)/d.duration*100;R(o,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(a,"mousemove",function(t){j(c,"display","block"),-1a.clientWidth-i/2?j(c,"left","".concat(a.clientWidth-i,"px")):j(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=tt(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?j(c,"left",0):n>a.clientWidth-r/2?j(c,"left","".concat(a.clientWidth-r,"px")):j(c,"left","".concat(n-r/2,"px"))}(t)}),f(a,"mouseout",function(){j(c,"display","none")}),f(a,"click",function(t){if(t.target!==s){var e=tt(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=tt(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}function nt(t){return function(h){return Q({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(j(d,"display","block"),function(t){var e=tt(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,a=n.width,o=n.number,s=n.column,c=p.clientWidth/o,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;j(d,"backgroundImage","url(".concat(i,")")),j(d,"height","".concat(r,"px")),j(d,"width","".concat(a,"px")),j(d,"backgroundPosition","-".concat(f*a,"px -").concat(u*r,"px")),e<=a/2?j(d,"left",0):e>p.clientWidth-a/2?j(d,"left","".concat(p.clientWidth-a,"px")):j(d,"left","".concat(e-a/2,"px"))}(t))}),e(p,"mouseout",function(){j(d,"display","none")})}})}}var it=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var e=this,t=this.art.option;this.add(et({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(nt({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return Q({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,a=R(t,n.play),o=R(t,n.pause);function s(){j(a,"display","flex"),j(o,"display","none")}function c(){j(a,"display","none"),j(o,"display","flex")}q(a,i.get("Play")),q(o,i.get("Pause")),e(a,"click",function(){r.play=!0}),e(o,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return Q({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,a=!1,o=R(t,n.volume),s=R(t,n.volumeClose),c=R(t,'
'),l=R(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return x(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(r.name,"")),l=a.quality.map(function(t,e){return'
').concat(t.name,"
")}).join(""),u=R(t,'
'.concat(l,"
"));i(t,function(){u.style.left="-".concat(C(u,"width")/2-t.clientWidth/2,"px")}),n(u,"click",function(t){var e=Number(t.target.dataset.index),n=a.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(o.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=R(t,n.screenshot);q(a,i.get("Screenshot")),e(a,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.subtitle,a=R(t,n.subtitle);q(a,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),o.on("subtitle:show",function(){j(a,"opacity","1"),q(a,i.get("Hide subtitle"))}),o.on("subtitle:hide",function(){j(a,"opacity","0.8"),q(a,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.setting,a=R(t,n.setting);q(a,i.get("Show setting")),e(t,"click",function(){r.toggle()}),o.on("setting:show",function(){j(a,"opacity","0.8"),q(a,i.get("Hide setting"))}),o.on("setting:hide",function(){j(a,"opacity","1"),q(a,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player;q(R(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=R(t,n.fullscreenWeb);q(a,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),o.on("fullscreenWeb:enabled",function(){j(a,"opacity","0.8"),q(a,i.get("Exit web fullscreen"))}),o.on("fullscreenWeb:exit",function(){j(a,"opacity","1"),q(a,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=R(t,n.fullscreen);q(a,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),o.on("fullscreen:enabled",function(){j(a,"opacity","0.8"),q(a,i.get("Exit fullscreen"))}),o.on("fullscreen:exit",function(){j(a,"opacity","1"),q(a,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,a=r.$progress,o=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=a;break;case"left":n=o;break;case"right":n=s}b(n,"Controls option.position can not be empty"),this.id+=1;var c=G(this.art,this,n,i,e,"control");return c.$ref.firstElementChild&&"I"===c.$ref.firstElementChild.tagName||c.$ref.classList.add("art-control-onlyText"),c}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,a=i.$contextmenu,o=t.events.proxy;this.add(function(n){return function(t){var e=t.i18n,i=t.player;return Q({},n,{html:"\n ".concat(e.get("Play speed"),':\n 0.5\n 0.75\n ').concat(e.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t,e){var n=e.target.dataset.rate;n&&(i.playbackRate=Number(n),t.show=!1)},mounted:function(n){t.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&M(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return Q({},n,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t,e){var n=e.target.dataset.ratio;n&&(i.aspectRatio=n,t.show=!1)},mounted:function(t){e.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(t){return function(e){return Q({},t,{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(t){return Q({},t,{html:'ArtPlayer 3.1.10'})}({disable:!1,name:"version",index:40})),this.add(function(e){return function(t){return Q({},e,{html:t.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),o(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),o(r,"click",function(t){t.composedPath().includes(a)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,G(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,a=t.clientY,o=n.getBoundingClientRect(),s=o.height,c=o.width,l=o.left,u=o.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=a-u;l+c\n
Player version:
\n
3.1.10
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||R(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}();var ot=function(t){if(Array.isArray(t))return t};var st=function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n};var ct=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var lt=function(t,e){return ot(t)||st(t,e)||ct()},ut=function(){function n(t){o(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return r(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,a=e.template,o=a.$video,s=a.$subtitle,c=a.$track;if(O(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",o.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),o.textTracks&&o.textTracks[0]){var n=lt(o.textTracks,1)[0];r(n,"cuechange",function(){var t=lt(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(z(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function ft(t){var n=this;o(this,ft);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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]),n[t]=e})}var dt=function(){function n(t){var e=this;o(this,n),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){-1'),t.icons.state)}return r(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}();var gt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return Q({},n,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t,e){var n=e.target.dataset.value;n&&(i.flip=n)},mounted:function(t){e.on("flipChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return Q({},n,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t,e){var n=e.target.dataset.value;n&&(i.aspectRatio=n)},mounted:function(t){e.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,a=i.events.proxy;return Q({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");a(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return G(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),bt=function(){function e(t){o(this,e),this.art=t,this.name="artplayer_settings",this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),K({},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 wt(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function xt(i){var r=i.constructor.utils.clamp,t=i.setting,a=i.notice,o=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(wt);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(o.$track&&o.$track.track){var e=Array.from(o.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),a.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else a.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function kt(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,a=t.setStyles,o=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,o(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),a(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function St(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function $t(e){o(this,$t);var n=e.option,i=e.events.proxy,r=e.template.$video;V.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=x(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||k(n.url),a=n.customType[t];t&&a?(e.emit("beforeCustomType",t),a(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var Lt=function(){function n(t){var e=this;o(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(xt),t.option.isLive||this.add(St),this.add(kt),t.option.plugins.forEach(function(t){e.add(t)})}return r(n,[{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}}]),n}(),Tt=0,Pt=function(t){function n(t){var e;return o(this,n),e=c(this,l(n).call(this)),b("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=P(n.DEFAULTS,t),f(e.option,I),e.init(),e}return e(n,d),r(n,[{key:"init",value:function(){this.isFocus=!1,this.isDestroy=!1,this.whitelist=new B(this),this.template=new N(this),this.events=new dt(this),this.whitelist.state?(this.storage=new bt(this),this.icons=new ft(this),this.i18n=new X(this),this.notice=new vt(this),this.player=new J(this),this.layers=new ht(this),this.controls=new it(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new at(this),this.loading=new yt(this),this.hotkey=new pt(this),this.mask=new mt(this),this.setting=new gt(this),this.plugins=new Lt(this)):this.mobile=new $t(this),Tt+=1,this.id=Tt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0.")}return t}(t);if(!me[n]){me[n]=!0;var r="";e&&e._owner&&e._owner!==A.current&&(r=" It was passed a child from "+z(e._owner.type)+"."),W(e),N(!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),W(null)}}}function ge(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",o=" Did you accidentally export a JSX literal instead of a component?"):a=typeof e,N(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,o)}var c=J.apply(this,arguments);if(null==c)return c;if(r)for(var s=2;s is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||N(!(r=!0),"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Consumer}}}),n.Consumer=i,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===f?x(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?x(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&x(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null==e||null==e.defaultProps&&null==e.propTypes||x(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:s,render:e}},lazy:function(e){var t={$$typeof:p,_ctor:e,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(t,{defaultProps:{configurable:!0,get:function(){return n},set:function(e){N(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(t,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){N(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(t,"propTypes",{enumerable:!0})}}}),t},memo:function(e,t){return pe(e)||x(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:f,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return de().useCallback(e,t)},useContext:function(e,t){var n=de();if(void 0!==t&&N(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?N(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&N(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return de().useEffect(e,t)},useImperativeHandle:function(e,t,n){return de().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return de().useDebugValue(e,t)},useLayoutEffect:function(e,t){return de().useLayoutEffect(e,t)},useMemo:function(e,t){return de().useMemo(e,t)},useReducer:function(e,t,n){return de().useReducer(e,t,n)},useRef:function(e){return de().useRef(e)},useState:function(e){return de().useState(e)},Fragment:u,StrictMode:n,Suspense:l,createElement:we,cloneElement:function(e,t,n){for(var r=function(e,t,n){null==e&&w(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var r=void 0,o=h({},e.props),i=e.key,a=e.ref,c=e._self,s=e._source,u=e._owner;if(null!=t){Y(t)&&(a=t.ref,u=A.current),X(t)&&(i=""+t.key);var l=void 0;for(r in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)V.call(t,r)&&!H.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==l?o[r]=l[r]:o[r]=t[r])}var f=arguments.length-2;if(1==f)o.children=n;else if(1").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function x(e){return URL.createObjectURL(new Blob([e],{type:"text/vtt"}))}function S(e,t){var n=document.createElement("a");g(n,"display","none"),n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function $(e,t,n){return v("string"===n||t instanceof Element,"".concat(e.join(".")," require 'string' or 'Element' type"))}function O(e){var t=this;M(this,O);var n=e.constructor.kindOf,r=e.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||r.some(function(e){switch(n(e)){case"string":return-1 ").concat(c));var s=document.createElement("div");s.classList.value="art-".concat(i," art-").concat(i,"-").concat(c),a.html&&m(s,a.html),a.style&&y(s,a.style);var u=Array.from(e.children);s.dataset.index=a.index||n.id;var l=u.find(function(e){return Number(e.dataset.index)>=Number(s.dataset.index)});return l?l.insertAdjacentElement("beforebegin",s):m(e,s),a.click&&t.events.proxy(s,"click",function(e){e.preventDefault(),a.click.call(n,e,t),t.emit("".concat(i,":click"),s)}),a.mounted&&a.mounted(s,n,t),o&&o(s,n,t),Object.defineProperty(n,c,{value:{get id(){return n.id},get $ref(){return s},set show(e){e?(g(s,"display","block"),t.emit("".concat(i,":show"),s)):(g(s,"display","none"),t.emit("".concat(i,":hide"),s))},set remove(e){e&&(h(s),t.emit("".concat(i,":remove"),s))}}}),t.emit("".concat(i,":add"),a),n[c]}function j(e,t){var n=e.template.$progress,r=e.player,o=n.getBoundingClientRect().left,i=d(t.pageX-o,0,n.clientWidth),a=i/n.clientWidth*r.duration;return{second:a,time:s(a),width:i,percentage:d(i/n.clientWidth,0,1)}}function C(e){var n=this;M(this,C);var r=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},e.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)),m(t,r[e]),n[e]=t})}function E(r){var e=r.i18n,o=r.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(e.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");o(t,"change",function(){var e=t.value;n.innerText=e,r.plugins.subtitle.offset(Number(e))}),r.on("subtitle:switch",function(){t.value=0,n.innerText=0}),r.on("artplayerPluginSubtitle:set",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}}}function _(r){var o=r.constructor.utils.clamp,e=r.setting,i=r.notice,a=r.template,c=r.i18n,s=r.player;c.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),e.add(E);var u=[];return r.on("subtitle:switch",function(){u=[]}),{name:"subtitle",offset:function(e){if(a.$track&&a.$track.track){var t=Array.from(a.$track.track.cues),n=o(e,-5,5);t.forEach(function(e,t){u[t]||(u[t]={startTime:e.startTime,endTime:e.endTime}),e.startTime=o(u[t].startTime+n,0,s.duration),e.endTime=o(u[t].endTime+n,0,s.duration)}),i.show("".concat(c.get("Subtitle offset time"),": ").concat(e,"s")),r.emit("artplayerPluginSubtitle:set",e)}else i.show("".concat(c.get("No subtitles found"))),r.emit("artplayerPluginSubtitle:set",0)}}}function T(o){var e=o.constructor.utils,n=e.append,r=e.setStyle,i=e.setStyles,a=e.sleep,c=o.events.proxy,s=o.option,u=o.notice,l=o.i18n,f=o.template,p=o.player;function d(e){if(e){var t=f.$video.canPlayType(e.type);if("maybe"===t||"probably"===t){var n=URL.createObjectURL(e);p.playbackRate=!1,p.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){p.currentTime=0}),s.url=n,o.emit("switch",n),u.show(l.get("Load local video successfully"))}else{var r="".concat(l.get("Playback of this file format is not supported"),": ").concat(e.type);u.show(r,!0,3e3),console.warn(r)}}}return l.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),c(f.$player,"dragover",function(e){e.preventDefault(),u.show(l.get("Load local video successfully"))}),c(f.$player,"drop",function(e){e.preventDefault(),d(e.dataTransfer.files[0])}),{name:"localPreview",attach:function(e){var t=n(e,'');r(e,"position","relative"),i(t,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),c(t,"change",function(){d(t.files[0])})}}}function L(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:"3px",background:r},mounted:function(e){t.on("controls:show",function(){e.style.display="none"}),t.on("controls:hide",function(){e.style.display="block"}),t.on("video:timeupdate",function(){e.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function A(t){M(this,A);var n=t.option,r=t.events.proxy,o=t.template.$video;J.video.events.forEach(function(e){r(o,e,function(e){t.emit("video:".concat(e.type),e)})}),Object.keys(n.moreVideoAttr).forEach(function(e){o[e]=n.moreVideoAttr[e]}),n.muted&&(o.muted=n.muted),n.volume&&(o.volume=d(n.volume,0,1)),n.poster&&(o.poster=n.poster),n.autoplay&&(o.autoplay=n.autoplay),o.controls=!0;var e=n.type||c(n.url),i=n.customType[e];e&&i?(t.emit("beforeCustomType",e),i(o,n.url,t),t.emit("afterCustomType",e)):(t.emit("beforeAttachUrl",n.url),o.src=n.url,t.emit("afterAttachUrl",o.src))}var M,q,z,I,F,W,D,N,V,H,U,B,Y,X,Z,J,G,K,Q,ee,te,ne,re,oe,ie,ae,ce,se,ue,le,fe,pe,de,he,ye,me,ve,ge,be;e.exports=(M=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},q=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},z=n(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==we(Symbol.iterator)?function(e){return we(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":we(e)})(e)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(e){return n(e)}:t.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(e)}t.exports=r}),I=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},F=function(e,t){return!t||"object"!==z(t)&&"function"!=typeof t?I(e):t},W=n(function(t){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}t.exports=n}),D=n(function(n){function r(e,t){return n.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.exports=r}),N=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)},V=n(function(e,t){function c(e){return(c="function"==typeof Symbol&&"symbol"==we(Symbol.iterator)?function(e){return we(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":we(e)})(e)}function s(e){return e.constructor?e.constructor.name:null}function i(e,t){var n=2\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(e){e?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Q={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},ee=function(){function t(e){M(this,t),this.art=e,this.languages={"zh-cn":K,"zh-tw":Q},this.init()}return q(t,[{key:"init",value:function(){var e=this.art.option.lang.toLowerCase();this.language=this.languages[e]||{}}},{key:"get",value:function(e){return this.language[e]||e}},{key:"update",value:function(e){this.languages=a(this.languages,e),this.init()}}]),t}(),te=n(function(e){var i,t,o,a,r,n;i="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=e.exports,o="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var e,t=[["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,r=t.length,o={};n\n
\n
\n
\n
\n
\n \n '),mounted:function(i){var o=!1,n=i.querySelector(".art-progress-loaded"),r=i.querySelector(".art-progress-played"),a=i.querySelector(".art-progress-highlight"),c=i.querySelector(".art-progress-indicator"),s=i.querySelector(".art-progress-tip");function u(e,t){"loaded"===e&&g(n,"width","".concat(100*t,"%")),"played"===e&&(g(r,"width","".concat(100*t,"%")),g(c,"left","calc(".concat(100*t,"% - ").concat(b(c,"width")/2,"px)")))}t.forEach(function(e){var t=d(e.time,0,p.duration)/p.duration*100;m(a,''))}),u("loaded",p.loaded),l.on("video:progress",function(){u("loaded",p.loaded)}),l.on("video:timeupdate",function(){u("played",p.played)}),l.on("video:ended",function(){u("played",1)}),f(i,"mousemove",function(e){g(s,"display","block"),-1i.clientWidth-r/2?g(s,"left","".concat(i.clientWidth-r,"px")):g(s,"left","".concat(t-r/2,"px"))}(e):function(e){var t=j(l,e),n=t.width,r=t.time;s.innerHTML=r;var o=s.clientWidth;n<=o/2?g(s,"left",0):n>i.clientWidth-o/2?g(s,"left","".concat(i.clientWidth-o,"px")):g(s,"left","".concat(n-o/2,"px"))}(e)}),f(i,"mouseout",function(){g(s,"display","none")}),f(i,"click",function(e){if(e.target!==c){var t=j(l,e),n=t.second;u("played",t.percentage),p.seek=n}}),f(c,"mousedown",function(){o=!0}),f(document,"mousemove",function(e){if(o){var t=j(l,e),n=t.second,r=t.percentage;c.classList.add("art-show-indicator"),u("played",r),p.seek=n}}),f(document,"mouseup",function(){o&&(o=!1,c.classList.remove("art-show-indicator"))})}})}}({name:"progress",disable:e.isLive,position:"top",index:10})),this.add(function(e){return function(h){return re({},e,{mounted:function(p){var d=h.template.$progress,e=h.events,t=e.proxy,n=e.loadImg,r=!1,o=!1;t(d,"mousemove",function(e){r||(r=!0,n(h.option.thumbnails.url).then(function(){o=!0})),o&&(g(p,"display","block"),function(e){var t=j(h,e).width,n=h.option.thumbnails,r=n.url,o=n.height,i=n.width,a=n.number,c=n.column,s=d.clientWidth/a,u=Math.floor(t/s),l=Math.ceil(u/c)-1,f=u%c||c-1;g(p,"backgroundImage","url(".concat(r,")")),g(p,"height","".concat(o,"px")),g(p,"width","".concat(i,"px")),g(p,"backgroundPosition","-".concat(f*i,"px -").concat(l*o,"px")),t<=i/2?g(p,"left",0):t>d.clientWidth-i/2?g(p,"left","".concat(d.clientWidth-i,"px")):g(p,"left","".concat(t-i/2,"px"))}(e))}),t(d,"mouseout",function(){g(p,"display","none")})}})}}({name:"thumbnails",disable:!e.thumbnails.url||e.isLive,position:"top",index:20})),this.add(function(e){return function(u){return re({},e,{mounted:function(e){var t=u.events.proxy,n=u.icons,r=u.i18n,o=u.player,i=m(e,n.play),a=m(e,n.pause);function c(){g(i,"display","flex"),g(a,"display","none")}function s(){g(i,"display","none"),g(a,"display","flex")}k(i,r.get("Play")),k(a,r.get("Pause")),t(i,"click",function(){o.play=!0}),t(a,"click",function(){o.pause=!0}),o.playing?s():c(),u.on("video:playing",function(){s()}),u.on("video:pause",function(){c()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(e){return function(p){return re({},e,{mounted:function(e){var t=p.events.proxy,n=p.icons,r=p.player,o=p.i18n,i=!1,a=m(e,n.volume),c=m(e,n.volumeClose),s=m(e,'
'),u=m(s,'
');function l(e){var t=s.getBoundingClientRect(),n=t.left,r=t.width,o=u.getBoundingClientRect().width;return d(e.pageX-n-o/2,0,r-o/2)/(r-o)}function f(){var e=0'.concat(n.name,"")),r=i.quality.map(function(e,t){return'
').concat(e.name,"
")}).join("");t(m(e,'
'.concat(r,"
")),"click",function(e){var t=Number(e.target.dataset.index),n=i.quality[t],r=n.url,o=n.name;r&&o&&c!==t&&(a.switchQuality(r,o),s.innerHTML=o,c=t)})}})}}({name:"quality",disable:0===e.quality.length,position:"right",index:10})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.player,i=m(e,n.screenshot);k(i,r.get("Screenshot")),t(i,"click",function(){o.screenshot()})}})}}({name:"screenshot",disable:!e.screenshot,position:"right",index:20})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.subtitle,i=m(e,n.subtitle);k(i,r.get("Hide subtitle")),t(e,"click",function(){o.toggle()}),a.on("subtitle:show",function(){g(i,"opacity","1"),k(i,r.get("Hide subtitle"))}),a.on("subtitle:hide",function(){g(i,"opacity","0.8"),k(i,r.get("Show subtitle"))})}})}}({name:"subtitle",disable:!e.subtitle.url,position:"right",index:30})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.setting,i=m(e,n.setting);k(i,r.get("Show setting")),t(e,"click",function(){o.toggle()}),a.on("setting:show",function(){g(i,"opacity","0.8"),k(i,r.get("Hide setting"))}),a.on("setting:hide",function(){g(i,"opacity","1"),k(i,r.get("Show setting"))})}})}}({name:"setting",disable:!e.setting,position:"right",index:40})),this.add(function(e){return function(i){return re({},e,{mounted:function(e){var t=i.events.proxy,n=i.icons,r=i.i18n,o=i.player;k(m(e,n.pip),r.get("Mini player")),t(e,"click",function(){o.pip=!0})}})}}({name:"pip",disable:!e.pip,position:"right",index:50})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.player,i=m(e,n.fullscreenWeb);k(i,r.get("Web fullscreen")),t(e,"click",function(){o.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){g(i,"opacity","0.8"),k(i,r.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){g(i,"opacity","1"),k(i,r.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!e.fullscreenWeb,position:"right",index:60})),this.add(function(e){return function(a){return re({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,o=a.player,i=m(e,n.fullscreen);k(i,r.get("Fullscreen")),t(e,"click",function(){o.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){g(i,"opacity","0.8"),k(i,r.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){g(i,"opacity","1"),k(i,r.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!e.fullscreen,position:"right",index:70})),e.controls.forEach(function(e){t.add(e)})}},{key:"add",value:function(e,t){var n,r="function"==typeof e?e(this.art):e,o=this.art.template,i=o.$progress,a=o.$controlsLeft,c=o.$controlsRight;switch(r.position){case"top":n=i;break;case"left":n=a;break;case"right":n=c}return v(n,"Controls option.position can not be empty"),this.id+=1,R(this.art,this,n,r,t,"control")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,t.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}(),ie=function(){function n(e){var t=this;M(this,n),this.id=0,this.art=e,this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1})}return q(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template,o=r.$player,i=r.$contextmenu,a=e.events.proxy;this.add(function(t){return function(r){var e=r.i18n,n=r.player;return re({},t,{html:"\n ".concat(e.get("Play speed"),':\n 0.5\n 0.75\n ').concat(e.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(e){var t=e.target.dataset.rate;t&&(n.playbackRate=Number(t),r.contextmenu.show=!1)},mounted:function(n){r.on("playbackRateChange",function(t){var e=Array.from(n.querySelectorAll("span")).find(function(e){return Number(e.dataset.rate)===t});e&&w(e,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(t){return function(n){var e=n.i18n,r=n.player;return re({},t,{html:"\n ".concat(e.get("Aspect ratio"),':\n ').concat(e.get("Default"),'\n 4:3\n 16:9\n '),click:function(e){var t=e.target.dataset.ratio;t&&(r.aspectRatio=t,n.contextmenu.show=!1)},mounted:function(e){n.on("aspectRatioChange",function(t){w(Array.from(e.querySelectorAll("span")).find(function(e){return e.dataset.ratio===t}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(t){return function(e){return re({},t,{html:e.i18n.get("Video info"),click:function(){e.info.show=!0,e.contextmenu.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(re({},{disable:!1,name:"version",index:40},{html:'ArtPlayer 3.1.9'})),this.add(function(t){return function(e){return re({},t,{html:e.i18n.get("Close"),click:function(){e.contextmenu.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(e){t.add(e)}),a(o,"contextmenu",function(e){e.preventDefault(),t.show=!0,t.setPos(e)}),a(o,"click",function(e){e.composedPath().includes(i)||(t.show=!1)})}},{key:"add",value:function(e,t){var n=this.art.template.$contextmenu;return this.id+=1,R(this.art,this,n,e,t,"contextmenu")}},{key:"setPos",value:function(e){var t=this.art.template,n=t.$player,r=t.$contextmenu,o=e.clientX,i=e.clientY,a=n.getBoundingClientRect(),c=a.height,s=a.width,u=a.left,l=a.top,f=r.getBoundingClientRect(),p=f.height,d=f.width,h=o-u,y=i-l;u+s\n
Player version:
\n
3.1.9
\n \n '),e.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),e.push('\n
\n
Video volume:
\n
\n
\n '),e.push('\n
\n
Video time:
\n
\n
\n '),e.push('\n
\n
Video duration:
\n
\n
\n '),e.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),e.join("")}},{key:"readInfo",value:function(){var e=this.art.template,t=e.$infoPanel,n=e.$video;Array.from(t.querySelectorAll("[data-video]")).forEach(function(e){var t=n[e.dataset.video];e.innerHTML=void 0!==t?"number"==typeof t?t.toFixed(2):t:"unknown"})}},{key:"loop",value:function(){var e=this;this.readInfo(),this.timer=setTimeout(function(){e.readInfo(),e.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template,n=t.$player,r=t.$infoPanel;e?(this.state=!0,n.classList.add("artplayer-info-show"),r.innerHTML||m(r,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),t}(),ce=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()},se=function(){function n(e){M(this,n),this.art=e,this.state=!0;var t=this.art.option.subtitle.url;t&&this.init(t)}return q(n,[{key:"init",value:function(e){var r=this,t=this.art,o=t.events.proxy,n=t.option.subtitle,i=t.template,a=i.$video,c=i.$subtitle,s=i.$track;if(y(c,n.style||{}),!s){var u=document.createElement("track");u.default=!0,u.kind="metadata",a.appendChild(u),this.art.template.$track=u}this.load(e).then(function(e){if(r.art.template.$track.src=e,r.art.emit("subtitle:load",e),a.textTracks&&a.textTracks[0]){var n=ce(a.textTracks,1)[0];o(n,"cuechange",function(){var e=ce(n.activeCues,1)[0];if(c.innerHTML="",e){var t=document.createElement("div");t.appendChild(e.getCueAsHTML()),c.innerHTML=t.innerHTML.split(/\r?\n/).map(function(e){return"

".concat(e,"

")}).join("")}r.art.emit("subtitle:update",c)})}})}},{key:"load",value:function(t){var n,r=this.art.notice;return fetch(t).then(function(e){return n=e.headers.get("Content-Type"),e.text()}).then(function(e){return/x-subrip/gi.test(n)?x(i(e)):t}).catch(function(e){r.show(e),console.warn(e)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,t.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}(),ue=function(){function n(e){var t=this;M(this,n),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("video:canplay",function(){!function(t,e){var n=t.template.$player;e.proxy(document,["click","contextmenu"],function(e){-1'),e.icons.state)}return q(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,t.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),t}(),ye=function(){function n(e){var t=this;M(this,n),this.id=0,this.art=e,this.state=!1,e.option.setting&&(this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1}))}return q(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template.$setting;(0,e.events.proxy)(r,"click",function(e){e.target===r&&(t.show=!1)}),this.add(function(r){return function(t){var e=t.i18n,n=t.player;return re({},r,{html:'\n
'.concat(e.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(e){var t=e.target.dataset.value;t&&(n.flip=t)},mounted:function(e){t.on("flipChange",function(t){w(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(r){return function(t){var e=t.i18n,n=t.player;return re({},r,{html:'\n
'.concat(e.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(e){var t=e.target.dataset.value;t&&(n.aspectRatio=t)},mounted:function(e){t.on("aspectRatioChange",function(t){w(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(t){return function(r){var e=r.i18n,o=r.player,i=r.events.proxy;return re({},t,{html:'\n
\n '.concat(e.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");i(t,"change",function(){var e=t.value;n.innerText=e,o.playbackRate=Number(e)}),r.on("playbackRateChange",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(e,t){this.id+=1;var n=this.art.template.$settingBody;return R(this.art,this,n,e,t,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,t.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),me=function(){function t(e){M(this,t),this.art=e,this.name="artplayer_settings",this.init()}return q(t,[{key:"init",value:function(){var e=this.art.option,t=this.get("volume");t&&(e.volume=t)}},{key:"get",value:function(e){var t=JSON.parse(window.localStorage.getItem(this.name))||{};return e?t[e]:{}}},{key:"set",value:function(e,t){var n=Object.assign({},this.get(),ne({},e,t));window.localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(e){var t=this.get();delete t[e],window.localStorage.setItem(this.name,JSON.stringify(t))}},{key:"clean",value:function(){window.localStorage.removeItem(this.name)}}]),t}(),ve=function(){function n(e){var t=this;M(this,n),this.art=e,this.id=0,e.option.subtitle.url&&this.add(_),e.option.isLive||this.add(L),this.add(T),e.option.plugins.forEach(function(e){t.add(e)})}return q(n,[{key:"add",value:function(e){this.id+=1;var t=e.call(this,this.art);return this[t&&t.name?t.name:e.name?e.name:"plugin".concat(this.id)]=t,this.art.emit("plugin:add",e),this}}]),n}(),ge=0,be=function(e){function n(e){var t;return M(this,n),t=F(this,W(n).call(this)),v("function"==typeof window.Promise,"Unsupported 'Promise' method"),t.option=a(n.DEFAULTS,e),V(t.option,Z),t.init(),t}return N(n,H),q(n,[{key:"init",value:function(){this.whitelist=new O(this),this.template=new G(this),this.events=new ue(this),this.whitelist.state?(this.isFocus=!1,this.isDestroy=!1,this.storage=new me(this),this.icons=new C(this),this.i18n=new ee(this),this.notice=new de(this),this.player=new P(this),this.layers=new fe(this),this.controls=new oe(this),this.contextmenu=new ie(this),this.subtitle=new se(this),this.info=new ae(this),this.loading=new pe(this),this.hotkey=new le(this),this.mask=new he(this),this.setting=new ye(this),this.plugins=new ve(this)):this.mobile=new A(this),ge+=1,this.id=ge,n.instances.push(this)}},{key:"destroy",value:function(){var e=0.")}return t}(t);if(!ve[n]){ve[n]=!0;var r="";e&&e._owner&&e._owner!==A.current&&(r=" It was passed a child from "+z(e._owner.type)+"."),F(e),D(!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),F(null)}}}function ge(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",i=" Did you accidentally export a JSX literal instead of a component?"):a=typeof e,D(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,i)}var s=J.apply(this,arguments);if(null==s)return s;if(r)for(var c=2;c is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||D(!(r=!0),"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Consumer}}}),n.Consumer=o,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===f?x(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?x(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&x(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null==e||null==e.defaultProps&&null==e.propTypes||x(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:c,render:e}},lazy:function(e){var t={$$typeof:p,_ctor:e,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(t,{defaultProps:{configurable:!0,get:function(){return n},set:function(e){D(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(t,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){D(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(t,"propTypes",{enumerable:!0})}}}),t},memo:function(e,t){return pe(e)||x(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:f,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return de().useCallback(e,t)},useContext:function(e,t){var n=de();if(void 0!==t&&D(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?D(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&D(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return de().useEffect(e,t)},useImperativeHandle:function(e,t,n){return de().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return de().useDebugValue(e,t)},useLayoutEffect:function(e,t){return de().useLayoutEffect(e,t)},useMemo:function(e,t){return de().useMemo(e,t)},useReducer:function(e,t,n){return de().useReducer(e,t,n)},useRef:function(e){return de().useRef(e)},useState:function(e){return de().useState(e)},Fragment:u,StrictMode:n,Suspense:l,createElement:we,cloneElement:function(e,t,n){for(var r=function(e,t,n){null==e&&w(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var r=void 0,i=h({},e.props),o=e.key,a=e.ref,s=e._self,c=e._source,u=e._owner;if(null!=t){Y(t)&&(a=t.ref,u=A.current),X(t)&&(o=""+t.key);var l=void 0;for(r in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)V.call(t,r)&&!H.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==l?i[r]=l[r]:i[r]=t[r])}var f=arguments.length-2;if(1==f)i.children=n;else if(1").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function Ie(e){return URL.createObjectURL(new Blob([e],{type:"text/vtt"}))}function We(e,t){var n=document.createElement("a");_e(n,"display","none"),n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var Fe=Object.freeze({errorHandle:ge,hasOwnProperty:be,clamp:we,getExt:ke,secondToTime:xe,sleep:Se,debounce:$e,throttle:Re,mergeDeep:Oe,append:je,remove:Ee,setStyle:_e,setStyles:Te,getStyle:Le,sublings:Ae,inverseClass:Me,tooltip:qe,srtToVtt:ze,vttToBlob:Ie,downloadFile:We});function Ne(e,t,n){return ge("string"===t||e instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}function De(e){var t=this;u(this,De);var n=e.constructor.kindOf,r=e.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||r.some(function(e){switch(n(e)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(e){e?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),Be={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Ye={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Xe=function(){function t(e){u(this,t),this.art=e,this.languages={"zh-cn":Be,"zh-tw":Ye},this.init()}return l(t,[{key:"init",value:function(){var e=this.art.option.lang.toLowerCase();this.language=this.languages[e]||{}}},{key:"get",value:function(e){return this.language[e]||e}},{key:"update",value:function(e){this.languages=Oe(this.languages,e),this.init()}}]),t}();var Ze=e(function(e){var o,t,i,a,r,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=e.exports,i="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var e,t=[["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,r=t.length,i={};n ").concat(c));var u=document.createElement("div");u.classList.value="art-".concat(o," art-").concat(o,"-").concat(c),a.html&&je(u,a.html),a.style&&Te(u,a.style);var l=Array.from(e.children);u.dataset.index=a.index||s;var f=l.find(function(e){return Number(e.dataset.index)>=Number(u.dataset.index)});return f?f.insertAdjacentElement("beforebegin",u):je(e,u),a.click&&t.events.proxy(u,"click",function(e){e.preventDefault(),a.click.call(t,n,e),t.emit("".concat(o,":click"),u)}),a.mounted&&a.mounted(u,n,t),i&&i(u,n,t),Object.defineProperty(n,c,{value:{get id(){return s},get $ref(){return u},set show(e){e?(_e(u,"display","block"),t.emit("".concat(o,":show"),u)):(_e(u,"display","none"),t.emit("".concat(o,":hide"),u))},set remove(e){e&&(Ee(u),t.emit("".concat(o,":remove"),u))}}}),t.emit("".concat(o,":add"),a),n[c]}function Qe(e,t){var n=e.template.$progress,r=e.player,i=n.getBoundingClientRect().left,o=we(t.pageX-i,0,n.clientWidth),a=o/n.clientWidth*r.duration;return{second:a,time:xe(a),width:o,percentage:we(o/n.clientWidth,0,1)}}function et(r){return function(l){var e=l.option,t=e.highlight,n=e.theme,f=l.events.proxy,p=l.player;return s({},r,{html:'\n
\n
\n
\n
\n
\n
\n
\n '),mounted:function(o){var i=!1,n=o.querySelector(".art-progress-loaded"),r=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function u(e,t){"loaded"===e&&_e(n,"width","".concat(100*t,"%")),"played"===e&&(_e(r,"width","".concat(100*t,"%")),_e(s,"left","calc(".concat(100*t,"% - ").concat(Le(s,"width")/2,"px)")))}t.forEach(function(e){var t=we(e.time,0,p.duration)/p.duration*100;je(a,''))}),u("loaded",p.loaded),l.on("video:progress",function(){u("loaded",p.loaded)}),l.on("video:timeupdate",function(){u("played",p.played)}),l.on("video:ended",function(){u("played",1)}),f(o,"mousemove",function(e){_e(c,"display","block"),-1o.clientWidth-r/2?_e(c,"left","".concat(o.clientWidth-r,"px")):_e(c,"left","".concat(t-r/2,"px"))}(e):function(e){var t=Qe(l,e),n=t.width,r=t.time;c.innerHTML=r;var i=c.clientWidth;n<=i/2?_e(c,"left",0):n>o.clientWidth-i/2?_e(c,"left","".concat(o.clientWidth-i,"px")):_e(c,"left","".concat(n-i/2,"px"))}(e)}),f(o,"mouseout",function(){_e(c,"display","none")}),f(o,"click",function(e){if(e.target!==s){var t=Qe(l,e),n=t.second;u("played",t.percentage),p.seek=n}}),f(s,"mousedown",function(){i=!0}),f(document,"mousemove",function(e){if(i){var t=Qe(l,e),n=t.second,r=t.percentage;s.classList.add("art-show-indicator"),u("played",r),p.seek=n}}),f(document,"mouseup",function(){i&&(i=!1,s.classList.remove("art-show-indicator"))})}})}}function tt(e){return function(h){return s({},e,{mounted:function(p){var d=h.template.$progress,e=h.events,t=e.proxy,n=e.loadImg,r=!1,i=!1;t(d,"mousemove",function(e){r||(r=!0,n(h.option.thumbnails.url).then(function(){i=!0})),i&&(_e(p,"display","block"),function(e){var t=Qe(h,e).width,n=h.option.thumbnails,r=n.url,i=n.height,o=n.width,a=n.number,s=n.column,c=d.clientWidth/a,u=Math.floor(t/c),l=Math.ceil(u/s)-1,f=u%s||s-1;_e(p,"backgroundImage","url(".concat(r,")")),_e(p,"height","".concat(i,"px")),_e(p,"width","".concat(o,"px")),_e(p,"backgroundPosition","-".concat(f*o,"px -").concat(l*i,"px")),t<=o/2?_e(p,"left",0):t>d.clientWidth-o/2?_e(p,"left","".concat(d.clientWidth-o,"px")):_e(p,"left","".concat(t-o/2,"px"))}(e))}),t(d,"mouseout",function(){_e(p,"display","none")})}})}}var nt=function(){function n(e){var t=this;u(this,n),this.id=0,this.art=e,this.art.once("video:canplay",function(){t.init()})}return l(n,[{key:"init",value:function(){var t=this,e=this.art.option;this.add(et({name:"progress",disable:e.isLive,position:"top",index:10})),this.add(tt({name:"thumbnails",disable:!e.thumbnails.url||e.isLive,position:"top",index:20})),this.add(function(e){return function(u){return s({},e,{mounted:function(e){var t=u.events.proxy,n=u.icons,r=u.i18n,i=u.player,o=je(e,n.play),a=je(e,n.pause);function s(){_e(o,"display","flex"),_e(a,"display","none")}function c(){_e(o,"display","none"),_e(a,"display","flex")}qe(o,r.get("Play")),qe(a,r.get("Pause")),t(o,"click",function(){i.play=!0}),t(a,"click",function(){i.pause=!0}),i.playing?c():s(),u.on("video:playing",function(){c()}),u.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(e){return function(p){return s({},e,{mounted:function(e){var t=p.events.proxy,n=p.icons,r=p.player,i=p.i18n,o=!1,a=je(e,n.volume),s=je(e,n.volumeClose),c=je(e,'
'),u=je(c,'
');function l(e){var t=c.getBoundingClientRect(),n=t.left,r=t.width,i=u.getBoundingClientRect().width;return we(e.pageX-n-i/2,0,r-i/2)/(r-i)}function f(){var e=0'.concat(i.name,"")),u=o.quality.map(function(e,t){return'
').concat(e.name,"
")}).join(""),l=je(e,'
'.concat(u,"
"));r(e,function(){l.style.left="-".concat(Le(l,"width")/2-e.clientWidth/2,"px")}),n(l,"click",function(e){var t=Number(e.target.dataset.index),n=o.quality[t],r=n.url,i=n.name;r&&i&&s!==t&&(a.switchQuality(r,i),c.innerHTML=i,s=t)})}})}}({name:"quality",disable:0===e.quality.length,position:"right",index:10})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.player,o=je(e,n.screenshot);qe(o,r.get("Screenshot")),t(o,"click",function(){i.screenshot()})}})}}({name:"screenshot",disable:!e.screenshot,position:"right",index:20})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.subtitle,o=je(e,n.subtitle);qe(o,r.get("Hide subtitle")),t(e,"click",function(){i.toggle()}),a.on("subtitle:show",function(){_e(o,"opacity","1"),qe(o,r.get("Hide subtitle"))}),a.on("subtitle:hide",function(){_e(o,"opacity","0.8"),qe(o,r.get("Show subtitle"))})}})}}({name:"subtitle",disable:!e.subtitle.url,position:"right",index:30})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.setting,o=je(e,n.setting);qe(o,r.get("Show setting")),t(e,"click",function(){i.toggle()}),a.on("setting:show",function(){_e(o,"opacity","0.8"),qe(o,r.get("Hide setting"))}),a.on("setting:hide",function(){_e(o,"opacity","1"),qe(o,r.get("Show setting"))})}})}}({name:"setting",disable:!e.setting,position:"right",index:40})),this.add(function(e){return function(o){return s({},e,{mounted:function(e){var t=o.events.proxy,n=o.icons,r=o.i18n,i=o.player;qe(je(e,n.pip),r.get("Mini player")),t(e,"click",function(){i.pip=!0})}})}}({name:"pip",disable:!e.pip,position:"right",index:50})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.player,o=je(e,n.fullscreenWeb);qe(o,r.get("Web fullscreen")),t(e,"click",function(){i.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){_e(o,"opacity","0.8"),qe(o,r.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){_e(o,"opacity","1"),qe(o,r.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!e.fullscreenWeb,position:"right",index:60})),this.add(function(e){return function(a){return s({},e,{mounted:function(e){var t=a.events.proxy,n=a.icons,r=a.i18n,i=a.player,o=je(e,n.fullscreen);qe(o,r.get("Fullscreen")),t(e,"click",function(){i.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){_e(o,"opacity","0.8"),qe(o,r.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){_e(o,"opacity","1"),qe(o,r.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!e.fullscreen,position:"right",index:70})),e.controls.forEach(function(e){t.add(e)})}},{key:"add",value:function(e,t){var n,r="function"==typeof e?e(this.art):e,i=this.art.template,o=i.$progress,a=i.$controlsLeft,s=i.$controlsRight;switch(r.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}ge(n,"Controls option.position can not be empty"),this.id+=1;var c=Ke(this.art,this,n,r,t,"control");return c.$ref.firstElementChild&&"I"===c.$ref.firstElementChild.tagName||c.$ref.classList.add("art-control-onlyText"),c}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,t.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(e){var t=this;u(this,n),this.id=0,this.art=e,this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1})}return l(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template,i=r.$player,o=r.$contextmenu,a=e.events.proxy;this.add(function(n){return function(e){var t=e.i18n,r=e.player;return s({},n,{html:"\n ".concat(t.get("Play speed"),':\n 0.5\n 0.75\n ').concat(t.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(e,t){var n=t.target.dataset.rate;n&&(r.playbackRate=Number(n),e.show=!1)},mounted:function(n){e.on("playbackRateChange",function(t){var e=Array.from(n.querySelectorAll("span")).find(function(e){return Number(e.dataset.rate)===t});e&&Me(e,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(n){return function(t){var e=t.i18n,r=t.player;return s({},n,{html:"\n ".concat(e.get("Aspect ratio"),':\n ').concat(e.get("Default"),'\n 4:3\n 16:9\n '),click:function(e,t){var n=t.target.dataset.ratio;n&&(r.aspectRatio=n,e.show=!1)},mounted:function(e){t.on("aspectRatioChange",function(t){Me(Array.from(e.querySelectorAll("span")).find(function(e){return e.dataset.ratio===t}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(e){return function(t){return s({},e,{html:t.i18n.get("Video info"),click:function(e){t.info.show=!0,e.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(e){return s({},e,{html:'ArtPlayer 3.1.10'})}({disable:!1,name:"version",index:40})),this.add(function(t){return function(e){return s({},t,{html:e.i18n.get("Close"),click:function(e){e.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(e){t.add(e)}),a(i,"contextmenu",function(e){e.preventDefault(),t.show=!0,t.setPos(e)}),a(i,"click",function(e){e.composedPath().includes(o)||(t.show=!1)})}},{key:"add",value:function(e,t){var n=this.art.template.$contextmenu;return this.id+=1,Ke(this.art,this,n,e,t,"contextmenu")}},{key:"setPos",value:function(e){var t=this.art.template,n=t.$player,r=t.$contextmenu,i=e.clientX,o=e.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,u=a.left,l=a.top,f=r.getBoundingClientRect(),p=f.height,d=f.width,h=i-u,y=o-l;u+c\n
Player version:
\n
3.1.10
\n \n '),e.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),e.push('\n
\n
Video volume:
\n
\n
\n '),e.push('\n
\n
Video time:
\n
\n
\n '),e.push('\n
\n
Video duration:
\n
\n
\n '),e.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),e.join("")}},{key:"readInfo",value:function(){var e=this.art.template,t=e.$infoPanel,n=e.$video;Array.from(t.querySelectorAll("[data-video]")).forEach(function(e){var t=n[e.dataset.video];e.innerHTML=void 0!==t?"number"==typeof t?t.toFixed(2):t:"unknown"})}},{key:"loop",value:function(){var e=this;this.readInfo(),this.timer=setTimeout(function(){e.readInfo(),e.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template,n=t.$player,r=t.$infoPanel;e?(this.state=!0,n.classList.add("artplayer-info-show"),r.innerHTML||je(r,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),t}();var ot=function(e){if(Array.isArray(e))return e};var at=function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n};var st=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var ct=function(e,t){return ot(e)||at(e,t)||st()},ut=function(){function n(e){u(this,n),this.art=e,this.state=!0;var t=this.art.option.subtitle.url;t&&this.init(t)}return l(n,[{key:"init",value:function(e){var r=this,t=this.art,i=t.events.proxy,n=t.option.subtitle,o=t.template,a=o.$video,s=o.$subtitle,c=o.$track;if(Te(s,n.style||{}),!c){var u=document.createElement("track");u.default=!0,u.kind="metadata",a.appendChild(u),this.art.template.$track=u}this.load(e).then(function(e){if(r.art.template.$track.src=e,r.art.emit("subtitle:load",e),a.textTracks&&a.textTracks[0]){var n=ct(a.textTracks,1)[0];i(n,"cuechange",function(){var e=ct(n.activeCues,1)[0];if(s.innerHTML="",e){var t=document.createElement("div");t.appendChild(e.getCueAsHTML()),s.innerHTML=t.innerHTML.split(/\r?\n/).map(function(e){return"

".concat(e,"

")}).join("")}r.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(t){var n,r=this.art.notice;return fetch(t).then(function(e){return n=e.headers.get("Content-Type"),e.text()}).then(function(e){return/x-subrip/gi.test(n)?Ie(ze(e)):t}).catch(function(e){r.show(e),console.warn(e)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,t.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function lt(e){var n=this;u(this,lt);var r=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},e.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)),je(t,r[e]),n[e]=t})}var ft=function(){function n(e){var t=this;u(this,n),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),e.whitelist.state&&e.once("video:canplay",function(){!function(t,e){var n=t.template.$player;e.proxy(document,["click","contextmenu"],function(e){-1'),e.icons.state)}return l(t,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,t.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),t}();var mt=function(){function n(e){var t=this;u(this,n),this.id=0,this.art=e,this.state=!1,e.option.setting&&(this.art.once("video:canplay",function(){t.init()}),this.art.on("blur",function(){t.show=!1}))}return l(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.option,r=e.template.$setting;(0,e.events.proxy)(r,"click",function(e){e.target===r&&(t.show=!1)}),this.add(function(n){return function(t){var e=t.i18n,r=t.player;return s({},n,{html:'\n
'.concat(e.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(e,t){var n=t.target.dataset.value;n&&(r.flip=n)},mounted:function(e){t.on("flipChange",function(t){Me(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(n){return function(t){var e=t.i18n,r=t.player;return s({},n,{html:'\n
'.concat(e.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(e,t){var n=t.target.dataset.value;n&&(r.aspectRatio=n)},mounted:function(e){t.on("aspectRatioChange",function(t){Me(Array.from(e.querySelectorAll("button")).find(function(e){return e.dataset.value===t}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(t){return function(r){var e=r.i18n,i=r.player,o=r.events.proxy;return s({},t,{html:'\n
\n '.concat(e.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");o(t,"change",function(){var e=t.value;n.innerText=e,i.playbackRate=Number(e)}),r.on("playbackRateChange",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(e,t){this.id+=1;var n=this.art.template.$settingBody;return Ke(this.art,this,n,e,t,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(e){var t=this.art.template.$player;e?(this.state=!0,t.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,t.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),gt=function(){function t(e){u(this,t),this.art=e,this.name="artplayer_settings",this.init()}return l(t,[{key:"init",value:function(){var e=this.art.option,t=this.get("volume");t&&(e.volume=t)}},{key:"get",value:function(e){var t=JSON.parse(window.localStorage.getItem(this.name))||{};return e?t[e]:{}}},{key:"set",value:function(e,t){var n=Object.assign({},this.get(),i({},e,t));window.localStorage.setItem(this.name,JSON.stringify(n))}},{key:"del",value:function(e){var t=this.get();delete t[e],window.localStorage.setItem(this.name,JSON.stringify(t))}},{key:"clean",value:function(){window.localStorage.removeItem(this.name)}}]),t}();function bt(r){var e=r.i18n,i=r.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(e.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(e){var t=e.querySelector(".art-setting-range input"),n=e.querySelector(".art-subtitle-value");i(t,"change",function(){var e=t.value;n.innerText=e,r.plugins.subtitle.offset(Number(e))}),r.on("subtitle:switch",function(){t.value=0,n.innerText=0}),r.on("artplayerPluginSubtitle:set",function(e){t.value!==e&&(t.value=e,n.innerText=e)})}}}function wt(r){var i=r.constructor.utils.clamp,e=r.setting,o=r.notice,a=r.template,s=r.i18n,c=r.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),e.add(bt);var u=[];return r.on("subtitle:switch",function(){u=[]}),{name:"subtitle",offset:function(e){if(a.$track&&a.$track.track){var t=Array.from(a.$track.track.cues),n=i(e,-5,5);t.forEach(function(e,t){u[t]||(u[t]={startTime:e.startTime,endTime:e.endTime}),e.startTime=i(u[t].startTime+n,0,c.duration),e.endTime=i(u[t].endTime+n,0,c.duration)}),o.show("".concat(s.get("Subtitle offset time"),": ").concat(e,"s")),r.emit("artplayerPluginSubtitle:set",e)}else o.show("".concat(s.get("No subtitles found"))),r.emit("artplayerPluginSubtitle:set",0)}}}function kt(i){var e=i.constructor.utils,n=e.append,r=e.setStyle,o=e.setStyles,a=e.sleep,s=i.events.proxy,c=i.option,u=i.notice,l=i.i18n,f=i.template,p=i.player;function d(e){if(e){var t=f.$video.canPlayType(e.type);if("maybe"===t||"probably"===t){var n=URL.createObjectURL(e);p.playbackRate=!1,p.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){p.currentTime=0}),c.url=n,i.emit("switch",n),u.show(l.get("Load local video successfully"))}else{var r="".concat(l.get("Playback of this file format is not supported"),": ").concat(e.type);u.show(r,!0,3e3),console.warn(r)}}}return l.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(e){e.preventDefault(),u.show(l.get("Load local video successfully"))}),s(f.$player,"drop",function(e){e.preventDefault(),d(e.dataTransfer.files[0])}),{name:"localPreview",attach:function(e){var t=n(e,'');r(e,"position","relative"),o(t,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(t,"change",function(){d(t.files[0])})}}}function xt(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:"3px",background:r},mounted:function(e){t.on("controls:show",function(){e.style.display="none"}),t.on("controls:hide",function(){e.style.display="block"}),t.on("video:timeupdate",function(){e.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function St(t){u(this,St);var n=t.option,r=t.events.proxy,i=t.template.$video;He.video.events.forEach(function(e){r(i,e,function(e){t.emit("video:".concat(e.type),e)})}),Object.keys(n.moreVideoAttr).forEach(function(e){i[e]=n.moreVideoAttr[e]}),n.muted&&(i.muted=n.muted),n.volume&&(i.volume=we(n.volume,0,1)),n.poster&&(i.poster=n.poster),n.autoplay&&(i.autoplay=n.autoplay),i.controls=!0;var e=n.type||ke(n.url),o=n.customType[e];e&&o?(t.emit("beforeCustomType",e),o(i,n.url,t),t.emit("afterCustomType",e)):(t.emit("beforeAttachUrl",n.url),i.src=n.url,t.emit("afterAttachUrl",i.src))}var $t=function(){function n(e){var t=this;u(this,n),this.art=e,this.id=0,e.option.subtitle.url&&this.add(wt),e.option.isLive||this.add(xt),this.add(kt),e.option.plugins.forEach(function(e){t.add(e)})}return l(n,[{key:"add",value:function(e){this.id+=1;var t=e.call(this,this.art),n="";return ge(!be(this,n=t&&t.name?t.name:e.name?e.name:"plugin".concat(this.id)),"Cannot add a plugin that already has the same name: ".concat(n)),Object.defineProperty(this,n,{value:t}),this.art.emit("plugin:add",e),this}}]),n}(),Rt=0,Pt=function(e){function n(e){var t;return u(this,n),t=p(this,d(n).call(this)),ge("function"==typeof window.Promise,"Unsupported 'Promise' method"),t.option=Oe(n.DEFAULTS,e),ue(t.option,Ve),t.init(),t}return t(n,le),l(n,[{key:"init",value:function(){this.isFocus=!1,this.isDestroy=!1,this.whitelist=new De(this),this.template=new Ue(this),this.events=new ft(this),this.whitelist.state?(this.storage=new gt(this),this.icons=new lt(this),this.i18n=new Xe(this),this.notice=new yt(this),this.player=new Ge(this),this.layers=new dt(this),this.controls=new nt(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new it(this),this.loading=new ht(this),this.hotkey=new pt(this),this.mask=new vt(this),this.setting=new mt(this),this.plugins=new $t(this)):this.mobile=new St(this),Rt+=1,this.id=Rt,n.instances.push(this)}},{key:"destroy",value:function(){var e=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function k(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function S(t,e){var n=document.createElement("a");g(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function $(t,e,n){return v("string"===n||e instanceof Element,"".concat(t.join(".")," require 'string' or 'Element' type"))}function L(t){var e=this;q(this,L);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1 ").concat(s));var c=document.createElement("div");c.classList.value="art-".concat(o," art-").concat(o,"-").concat(s),a.html&&m(c,a.html),a.style&&y(c,a.style);var l=Array.from(t.children);c.dataset.index=a.index||n.id;var u=l.find(function(t){return Number(t.dataset.index)>=Number(c.dataset.index)});return u?u.insertAdjacentElement("beforebegin",c):m(t,c),a.click&&e.events.proxy(c,"click",function(t){t.preventDefault(),a.click.call(n,t,e),e.emit("".concat(o,":click"),c)}),a.mounted&&a.mounted(c,n,e),r&&r(c,n,e),Object.defineProperty(n,s,{value:{get id(){return n.id},get $ref(){return c},set show(t){t?(g(c,"display","block"),e.emit("".concat(o,":show"),c)):(g(c,"display","none"),e.emit("".concat(o,":hide"),c))},set remove(t){t&&(h(c),e.emit("".concat(o,":remove"),c))}}}),e.emit("".concat(o,":add"),a),n[s]}function T(t,e){var n=t.template.$progress,i=t.player,r=n.getBoundingClientRect().left,o=p(e.pageX-r,0,n.clientWidth),a=o/n.clientWidth*i.duration;return{second:a,time:c(a),width:o,percentage:p(o/n.clientWidth,0,1)}}function E(t){var n=this;q(this,E);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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]),n[t]=e})}function O(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function j(i){var r=i.constructor.utils.clamp,t=i.setting,o=i.notice,a=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(O);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(a.$track&&a.$track.track){var e=Array.from(a.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),o.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else o.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function A(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,o=t.setStyles,a=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),o(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function C(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function M(e){q(this,M);var n=e.option,i=e.events.proxy,r=e.template.$video;J.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=p(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||s(n.url),o=n.customType[t];t&&o?(e.emit("beforeCustomType",t),o(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var q,z,W,_,F,H,B,I,V,N,D,U,X,Y,Z,J,G,K,Q,tt,et,nt,it,rt,ot,at,st,ct,lt,ut,ft,dt,pt,ht,yt,mt,vt,gt,bt;t.exports=(q=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},z=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t},W=n(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==wt(Symbol.iterator)?function(t){return wt(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":wt(t)})(t)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(t){return n(t)}:e.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},i(t)}e.exports=i}),_=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},F=function(t,e){return!e||"object"!==W(e)&&"function"!=typeof e?_(t):e},H=n(function(e){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n}),B=n(function(n){function i(t,e){return n.exports=i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}n.exports=i}),I=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&&B(t,e)},V=n(function(t,e){function s(t){return(s="function"==typeof Symbol&&"symbol"==wt(Symbol.iterator)?function(t){return wt(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":wt(t)})(t)}function c(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Q={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},tt=function(){function e(t){q(this,e),this.art=t,this.languages={"zh-cn":K,"zh-tw":Q},this.init()}return z(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=a(this.languages,t),this.init()}}]),e}(),et=n(function(t){var o,e,r,a,i,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var t,e=[["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,i=e.length,r={};n\n
\n
\n
\n
\n
\n \n '),mounted:function(o){var r=!1,n=o.querySelector(".art-progress-loaded"),i=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&g(n,"width","".concat(100*e,"%")),"played"===t&&(g(i,"width","".concat(100*e,"%")),g(s,"left","calc(".concat(100*e,"% - ").concat(b(s,"width")/2,"px)")))}e.forEach(function(t){var e=p(t.time,0,d.duration)/d.duration*100;m(a,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(o,"mousemove",function(t){g(c,"display","block"),-1o.clientWidth-i/2?g(c,"left","".concat(o.clientWidth-i,"px")):g(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=T(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?g(c,"left",0):n>o.clientWidth-r/2?g(c,"left","".concat(o.clientWidth-r,"px")):g(c,"left","".concat(n-r/2,"px"))}(t)}),f(o,"mouseout",function(){g(c,"display","none")}),f(o,"click",function(t){if(t.target!==s){var e=T(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=T(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(function(t){return function(h){return it({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(g(d,"display","block"),function(t){var e=T(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,o=n.width,a=n.number,s=n.column,c=p.clientWidth/a,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;g(d,"backgroundImage","url(".concat(i,")")),g(d,"height","".concat(r,"px")),g(d,"width","".concat(o,"px")),g(d,"backgroundPosition","-".concat(f*o,"px -").concat(u*r,"px")),e<=o/2?g(d,"left",0):e>p.clientWidth-o/2?g(d,"left","".concat(p.clientWidth-o,"px")):g(d,"left","".concat(e-o/2,"px"))}(t))}),e(p,"mouseout",function(){g(d,"display","none")})}})}}({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return it({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,o=m(t,n.play),a=m(t,n.pause);function s(){g(o,"display","flex"),g(a,"display","none")}function c(){g(o,"display","none"),g(a,"display","flex")}x(o,i.get("Play")),x(a,i.get("Pause")),e(o,"click",function(){r.play=!0}),e(a,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return it({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,o=!1,a=m(t,n.volume),s=m(t,n.volumeClose),c=m(t,'
'),l=m(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return p(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(n.name,"")),i=o.quality.map(function(t,e){return'
').concat(t.name,"
")}).join("");e(m(t,'
'.concat(i,"
")),"click",function(t){var e=Number(t.target.dataset.index),n=o.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(a.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=m(t,n.screenshot);x(o,i.get("Screenshot")),e(o,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.subtitle,o=m(t,n.subtitle);x(o,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),a.on("subtitle:show",function(){g(o,"opacity","1"),x(o,i.get("Hide subtitle"))}),a.on("subtitle:hide",function(){g(o,"opacity","0.8"),x(o,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.setting,o=m(t,n.setting);x(o,i.get("Show setting")),e(t,"click",function(){r.toggle()}),a.on("setting:show",function(){g(o,"opacity","0.8"),x(o,i.get("Hide setting"))}),a.on("setting:hide",function(){g(o,"opacity","1"),x(o,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(o){return it({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player;x(m(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=m(t,n.fullscreenWeb);x(o,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){g(o,"opacity","0.8"),x(o,i.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){g(o,"opacity","1"),x(o,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(a){return it({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=m(t,n.fullscreen);x(o,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){g(o,"opacity","0.8"),x(o,i.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){g(o,"opacity","1"),x(o,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,o=r.$progress,a=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}return v(n,"Controls option.position can not be empty"),this.id+=1,R(this.art,this,n,i,e,"control")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}(),ot=function(){function n(t){var e=this;q(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return z(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,o=i.$contextmenu,a=t.events.proxy;this.add(function(e){return function(i){var t=i.i18n,n=i.player;return it({},e,{html:"\n ".concat(t.get("Play speed"),':\n 0.5\n 0.75\n ').concat(t.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t){var e=t.target.dataset.rate;e&&(n.playbackRate=Number(e),i.contextmenu.show=!1)},mounted:function(n){i.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&w(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(e){return function(n){var t=n.i18n,i=n.player;return it({},e,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t){var e=t.target.dataset.ratio;e&&(i.aspectRatio=e,n.contextmenu.show=!1)},mounted:function(t){n.on("aspectRatioChange",function(e){w(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(e){return function(t){return it({},e,{html:t.i18n.get("Video info"),click:function(){t.info.show=!0,t.contextmenu.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(it({},{disable:!1,name:"version",index:40},{html:'ArtPlayer 3.1.9'})),this.add(function(e){return function(t){return it({},e,{html:t.i18n.get("Close"),click:function(){t.contextmenu.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),a(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),a(r,"click",function(t){t.composedPath().includes(o)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,R(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,o=t.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,l=a.left,u=a.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=o-u;l+c\n
Player version:
\n
3.1.9
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||m(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}(),st=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()},ct=function(){function n(t){q(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return z(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,o=e.template,a=o.$video,s=o.$subtitle,c=o.$track;if(y(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",a.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),a.textTracks&&a.textTracks[0]){var n=st(a.textTracks,1)[0];r(n,"cuechange",function(){var t=st(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?k(o(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}(),lt=function(){function n(t){var e=this;q(this,n),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){-1'),t.icons.state)}return z(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}(),yt=function(){function n(t){var e=this;q(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return z(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return it({},i,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t){var e=t.target.dataset.value;e&&(n.flip=e)},mounted:function(t){e.on("flipChange",function(e){w(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return it({},i,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t){var e=t.target.dataset.value;e&&(n.aspectRatio=e)},mounted:function(t){e.on("aspectRatioChange",function(e){w(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,o=i.events.proxy;return it({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");o(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return R(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),mt=function(){function e(t){q(this,e),this.art=t,this.name="artplayer_settings",this.init()}return z(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),nt({},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}(),vt=function(){function n(t){var e=this;q(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(j),t.option.isLive||this.add(C),this.add(A),t.option.plugins.forEach(function(t){e.add(t)})}return z(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art);return this[e&&e.name?e.name:t.name?t.name:"plugin".concat(this.id)]=e,this.art.emit("plugin:add",t),this}}]),n}(),gt=0,bt=function(t){function n(t){var e;return q(this,n),e=F(this,H(n).call(this)),v("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=a(n.DEFAULTS,t),V(e.option,Z),e.init(),e}return I(n,N),z(n,[{key:"init",value:function(){this.whitelist=new L(this),this.template=new G(this),this.events=new lt(this),this.whitelist.state?(this.isFocus=!1,this.isDestroy=!1,this.storage=new mt(this),this.icons=new E(this),this.i18n=new tt(this),this.notice=new pt(this),this.player=new P(this),this.layers=new ft(this),this.controls=new rt(this),this.contextmenu=new ot(this),this.subtitle=new ct(this),this.info=new at(this),this.loading=new dt(this),this.hotkey=new ut(this),this.mask=new ht(this),this.setting=new yt(this),this.plugins=new vt(this)):this.mobile=new M(this),gt+=1,this.id=gt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function F(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function H(t,e){var n=document.createElement("a");C(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var B=Object.freeze({errorHandle:x,hasOwnProperty:k,clamp:S,getExt:$,secondToTime:L,sleep:R,debounce:T,throttle:P,mergeDeep:E,append:j,remove:O,setStyle:C,setStyles:A,getStyle:M,sublings:q,inverseClass:z,tooltip:W,srtToVtt:_,vttToBlob:F,downloadFile:H});function I(t,e,n){return x("string"===e||t instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}function V(t){var e=this;o(this,V);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),X={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Y={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},Z=function(){function e(t){o(this,e),this.art=t,this.languages={"zh-cn":X,"zh-tw":Y},this.init()}return a(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=E(this.languages,t),this.init()}}]),e}();var J=t(function(t){var a,e,r,o,i,n;a="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,o=function(){for(var t,e=[["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,i=e.length,r={};n ").concat(c));var l=document.createElement("div");l.classList.value="art-".concat(a," art-").concat(a,"-").concat(c),o.html&&j(l,o.html),o.style&&A(l,o.style);var u=Array.from(t.children);l.dataset.index=o.index||s;var f=u.find(function(t){return Number(t.dataset.index)>=Number(l.dataset.index)});return f?f.insertAdjacentElement("beforebegin",l):j(t,l),o.click&&e.events.proxy(l,"click",function(t){t.preventDefault(),o.click.call(e,n,t),e.emit("".concat(a,":click"),l)}),o.mounted&&o.mounted(l,n,e),r&&r(l,n,e),Object.defineProperty(n,c,{value:{get id(){return s},get $ref(){return l},set show(t){t?(C(l,"display","block"),e.emit("".concat(a,":show"),l)):(C(l,"display","none"),e.emit("".concat(a,":hide"),l))},set remove(t){t&&(O(l),e.emit("".concat(a,":remove"),l))}}}),e.emit("".concat(a,":add"),o),n[c]}function tt(t,e){var n=t.template.$progress,i=t.player,r=n.getBoundingClientRect().left,a=S(e.pageX-r,0,n.clientWidth),o=a/n.clientWidth*i.duration;return{second:o,time:L(o),width:a,percentage:S(a/n.clientWidth,0,1)}}function et(i){return function(u){var t=u.option,e=t.highlight,n=t.theme,f=u.events.proxy,d=u.player;return s({},i,{html:'\n
\n
\n
\n
\n
\n
\n
\n '),mounted:function(a){var r=!1,n=a.querySelector(".art-progress-loaded"),i=a.querySelector(".art-progress-played"),o=a.querySelector(".art-progress-highlight"),s=a.querySelector(".art-progress-indicator"),c=a.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&C(n,"width","".concat(100*e,"%")),"played"===t&&(C(i,"width","".concat(100*e,"%")),C(s,"left","calc(".concat(100*e,"% - ").concat(M(s,"width")/2,"px)")))}e.forEach(function(t){var e=S(t.time,0,d.duration)/d.duration*100;j(o,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(a,"mousemove",function(t){C(c,"display","block"),-1a.clientWidth-i/2?C(c,"left","".concat(a.clientWidth-i,"px")):C(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=tt(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?C(c,"left",0):n>a.clientWidth-r/2?C(c,"left","".concat(a.clientWidth-r,"px")):C(c,"left","".concat(n-r/2,"px"))}(t)}),f(a,"mouseout",function(){C(c,"display","none")}),f(a,"click",function(t){if(t.target!==s){var e=tt(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=tt(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}function nt(t){return function(h){return s({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(C(d,"display","block"),function(t){var e=tt(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,a=n.width,o=n.number,s=n.column,c=p.clientWidth/o,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;C(d,"backgroundImage","url(".concat(i,")")),C(d,"height","".concat(r,"px")),C(d,"width","".concat(a,"px")),C(d,"backgroundPosition","-".concat(f*a,"px -").concat(u*r,"px")),e<=a/2?C(d,"left",0):e>p.clientWidth-a/2?C(d,"left","".concat(p.clientWidth-a,"px")):C(d,"left","".concat(e-a/2,"px"))}(t))}),e(p,"mouseout",function(){C(d,"display","none")})}})}}var it=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()})}return a(n,[{key:"init",value:function(){var e=this,t=this.art.option;this.add(et({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(nt({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return s({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,a=j(t,n.play),o=j(t,n.pause);function s(){C(a,"display","flex"),C(o,"display","none")}function c(){C(a,"display","none"),C(o,"display","flex")}W(a,i.get("Play")),W(o,i.get("Pause")),e(a,"click",function(){r.play=!0}),e(o,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return s({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,a=!1,o=j(t,n.volume),s=j(t,n.volumeClose),c=j(t,'
'),l=j(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return S(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(r.name,"")),l=a.quality.map(function(t,e){return'
').concat(t.name,"
")}).join(""),u=j(t,'
'.concat(l,"
"));i(t,function(){u.style.left="-".concat(M(u,"width")/2-t.clientWidth/2,"px")}),n(u,"click",function(t){var e=Number(t.target.dataset.index),n=a.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(o.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=j(t,n.screenshot);W(a,i.get("Screenshot")),e(a,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.subtitle,a=j(t,n.subtitle);W(a,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),o.on("subtitle:show",function(){C(a,"opacity","1"),W(a,i.get("Hide subtitle"))}),o.on("subtitle:hide",function(){C(a,"opacity","0.8"),W(a,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.setting,a=j(t,n.setting);W(a,i.get("Show setting")),e(t,"click",function(){r.toggle()}),o.on("setting:show",function(){C(a,"opacity","0.8"),W(a,i.get("Hide setting"))}),o.on("setting:hide",function(){C(a,"opacity","1"),W(a,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(a){return s({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player;W(j(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=j(t,n.fullscreenWeb);W(a,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),o.on("fullscreenWeb:enabled",function(){C(a,"opacity","0.8"),W(a,i.get("Exit web fullscreen"))}),o.on("fullscreenWeb:exit",function(){C(a,"opacity","1"),W(a,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(o){return s({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=j(t,n.fullscreen);W(a,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),o.on("fullscreen:enabled",function(){C(a,"opacity","0.8"),W(a,i.get("Exit fullscreen"))}),o.on("fullscreen:exit",function(){C(a,"opacity","1"),W(a,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,a=r.$progress,o=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=a;break;case"left":n=o;break;case"right":n=s}x(n,"Controls option.position can not be empty"),this.id+=1;var c=Q(this.art,this,n,i,e,"control");return c.$ref.firstElementChild&&"I"===c.$ref.firstElementChild.tagName||c.$ref.classList.add("art-control-onlyText"),c}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return a(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,a=i.$contextmenu,o=t.events.proxy;this.add(function(n){return function(t){var e=t.i18n,i=t.player;return s({},n,{html:"\n ".concat(e.get("Play speed"),':\n 0.5\n 0.75\n ').concat(e.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t,e){var n=e.target.dataset.rate;n&&(i.playbackRate=Number(n),t.show=!1)},mounted:function(n){t.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&z(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return s({},n,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t,e){var n=e.target.dataset.ratio;n&&(i.aspectRatio=n,t.show=!1)},mounted:function(t){e.on("aspectRatioChange",function(e){z(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(t){return function(e){return s({},t,{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(t){return s({},t,{html:'ArtPlayer 3.1.10'})}({disable:!1,name:"version",index:40})),this.add(function(e){return function(t){return s({},e,{html:t.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),o(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),o(r,"click",function(t){t.composedPath().includes(a)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,Q(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,a=t.clientY,o=n.getBoundingClientRect(),s=o.height,c=o.width,l=o.left,u=o.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=a-u;l+c\n
Player version:
\n
3.1.10
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||j(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}();var ot=function(t){if(Array.isArray(t))return t};var st=function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n};var ct=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var lt=function(t,e){return ot(t)||st(t,e)||ct()},ut=function(){function n(t){o(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return a(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,a=e.template,o=a.$video,s=a.$subtitle,c=a.$track;if(A(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",o.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),o.textTracks&&o.textTracks[0]){var n=lt(o.textTracks,1)[0];r(n,"cuechange",function(){var t=lt(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?F(_(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function ft(t){var n=this;o(this,ft);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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)),j(e,i[t]),n[t]=e})}var dt=function(){function n(t){var e=this;o(this,n),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){-1'),t.icons.state)}return a(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}();var gt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return a(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return s({},n,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t,e){var n=e.target.dataset.value;n&&(i.flip=n)},mounted:function(t){e.on("flipChange",function(e){z(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return s({},n,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t,e){var n=e.target.dataset.value;n&&(i.aspectRatio=n)},mounted:function(t){e.on("aspectRatioChange",function(e){z(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,a=i.events.proxy;return s({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");a(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return Q(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),bt=function(){function e(t){o(this,e),this.art=t,this.name="artplayer_settings",this.init()}return a(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),r({},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 wt(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function xt(i){var r=i.constructor.utils.clamp,t=i.setting,a=i.notice,o=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(wt);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(o.$track&&o.$track.track){var e=Array.from(o.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),a.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else a.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function kt(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,a=t.setStyles,o=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,o(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),a(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function St(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function $t(e){o(this,$t);var n=e.option,i=e.events.proxy,r=e.template.$video;D.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=S(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||$(n.url),a=n.customType[t];t&&a?(e.emit("beforeCustomType",t),a(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var Lt=function(){function n(t){var e=this;o(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(xt),t.option.isLive||this.add(St),this.add(kt),t.option.plugins.forEach(function(t){e.add(t)})}return a(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art),n="";return x(!k(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}}]),n}(),Rt=0,Tt=function(t){function n(t){var e;return o(this,n),e=u(this,f(n).call(this)),x("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=E(n.DEFAULTS,t),p(e.option,N),e.init(),e}return e(n,h),a(n,[{key:"init",value:function(){this.isFocus=!1,this.isDestroy=!1,this.whitelist=new V(this),this.template=new U(this),this.events=new dt(this),this.whitelist.state?(this.storage=new bt(this),this.icons=new ft(this),this.i18n=new Z(this),this.notice=new vt(this),this.player=new K(this),this.layers=new ht(this),this.controls=new it(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new at(this),this.loading=new yt(this),this.hotkey=new pt(this),this.mask=new mt(this),this.setting=new gt(this),this.plugins=new Lt(this)):this.mobile=new $t(this),Rt+=1,this.id=Rt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function W(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function _(t,e){var n=document.createElement("a");j(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var F=Object.freeze({errorHandle:b,hasOwnProperty:w,clamp:x,getExt:k,secondToTime:S,sleep:$,debounce:L,throttle:T,mergeDeep:R,append:P,remove:E,setStyle:j,setStyles:O,getStyle:A,sublings:C,inverseClass:M,tooltip:q,srtToVtt:z,vttToBlob:W,downloadFile:_});function H(t,e,n){return b("string"===n||e instanceof Element,"".concat(t.join(".")," require 'string' or 'Element' type"))}function B(t){var e=this;a(this,B);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),D={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},U={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},X=function(){function e(t){a(this,e),this.art=t,this.languages={"zh-cn":D,"zh-tw":U},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=R(this.languages,t),this.init()}}]),e}();var Y=t(function(t){var o,e,r,a,i,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var t,e=[["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,i=e.length,r={};n ").concat(s));var c=document.createElement("div");c.classList.value="art-".concat(o," art-").concat(o,"-").concat(s),a.html&&P(c,a.html),a.style&&O(c,a.style);var l=Array.from(t.children);c.dataset.index=a.index||n.id;var u=l.find(function(t){return Number(t.dataset.index)>=Number(c.dataset.index)});return u?u.insertAdjacentElement("beforebegin",c):P(t,c),a.click&&e.events.proxy(c,"click",function(t){t.preventDefault(),a.click.call(n,t,e),e.emit("".concat(o,":click"),c)}),a.mounted&&a.mounted(c,n,e),r&&r(c,n,e),Object.defineProperty(n,s,{value:{get id(){return n.id},get $ref(){return c},set show(t){t?(j(c,"display","block"),e.emit("".concat(o,":show"),c)):(j(c,"display","none"),e.emit("".concat(o,":hide"),c))},set remove(t){t&&(E(c),e.emit("".concat(o,":remove"),c))}}}),e.emit("".concat(o,":add"),a),n[s]}var K=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var Q=function(e){for(var t=1;t\n
\n
\n
\n
\n
\n \n '),mounted:function(o){var r=!1,n=o.querySelector(".art-progress-loaded"),i=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&j(n,"width","".concat(100*e,"%")),"played"===t&&(j(i,"width","".concat(100*e,"%")),j(s,"left","calc(".concat(100*e,"% - ").concat(A(s,"width")/2,"px)")))}e.forEach(function(t){var e=x(t.time,0,d.duration)/d.duration*100;P(a,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(o,"mousemove",function(t){j(c,"display","block"),-1o.clientWidth-i/2?j(c,"left","".concat(o.clientWidth-i,"px")):j(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=tt(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?j(c,"left",0):n>o.clientWidth-r/2?j(c,"left","".concat(o.clientWidth-r,"px")):j(c,"left","".concat(n-r/2,"px"))}(t)}),f(o,"mouseout",function(){j(c,"display","none")}),f(o,"click",function(t){if(t.target!==s){var e=tt(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=tt(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}function nt(t){return function(h){return Q({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(j(d,"display","block"),function(t){var e=tt(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,o=n.width,a=n.number,s=n.column,c=p.clientWidth/a,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;j(d,"backgroundImage","url(".concat(i,")")),j(d,"height","".concat(r,"px")),j(d,"width","".concat(o,"px")),j(d,"backgroundPosition","-".concat(f*o,"px -").concat(u*r,"px")),e<=o/2?j(d,"left",0):e>p.clientWidth-o/2?j(d,"left","".concat(p.clientWidth-o,"px")):j(d,"left","".concat(e-o/2,"px"))}(t))}),e(p,"mouseout",function(){j(d,"display","none")})}})}}var it=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var e=this,t=this.art.option;this.add(et({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(nt({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return Q({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,o=P(t,n.play),a=P(t,n.pause);function s(){j(o,"display","flex"),j(a,"display","none")}function c(){j(o,"display","none"),j(a,"display","flex")}q(o,i.get("Play")),q(a,i.get("Pause")),e(o,"click",function(){r.play=!0}),e(a,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return Q({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,o=!1,a=P(t,n.volume),s=P(t,n.volumeClose),c=P(t,'
'),l=P(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return x(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(n.name,"")),i=o.quality.map(function(t,e){return'
').concat(t.name,"
")}).join("");e(P(t,'
'.concat(i,"
")),"click",function(t){var e=Number(t.target.dataset.index),n=o.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(a.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=P(t,n.screenshot);q(o,i.get("Screenshot")),e(o,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.subtitle,o=P(t,n.subtitle);q(o,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),a.on("subtitle:show",function(){j(o,"opacity","1"),q(o,i.get("Hide subtitle"))}),a.on("subtitle:hide",function(){j(o,"opacity","0.8"),q(o,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.setting,o=P(t,n.setting);q(o,i.get("Show setting")),e(t,"click",function(){r.toggle()}),a.on("setting:show",function(){j(o,"opacity","0.8"),q(o,i.get("Hide setting"))}),a.on("setting:hide",function(){j(o,"opacity","1"),q(o,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player;q(P(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=P(t,n.fullscreenWeb);q(o,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),a.on("fullscreenWeb:enabled",function(){j(o,"opacity","0.8"),q(o,i.get("Exit web fullscreen"))}),a.on("fullscreenWeb:exit",function(){j(o,"opacity","1"),q(o,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player,o=P(t,n.fullscreen);q(o,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),a.on("fullscreen:enabled",function(){j(o,"opacity","0.8"),q(o,i.get("Exit fullscreen"))}),a.on("fullscreen:exit",function(){j(o,"opacity","1"),q(o,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,o=r.$progress,a=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}return b(n,"Controls option.position can not be empty"),this.id+=1,G(this.art,this,n,i,e,"control")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,o=i.$contextmenu,a=t.events.proxy;this.add(function(e){return function(i){var t=i.i18n,n=i.player;return Q({},e,{html:"\n ".concat(t.get("Play speed"),':\n 0.5\n 0.75\n ').concat(t.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t){var e=t.target.dataset.rate;e&&(n.playbackRate=Number(e),i.contextmenu.show=!1)},mounted:function(n){i.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&M(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(e){return function(n){var t=n.i18n,i=n.player;return Q({},e,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t){var e=t.target.dataset.ratio;e&&(i.aspectRatio=e,n.contextmenu.show=!1)},mounted:function(t){n.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(e){return function(t){return Q({},e,{html:t.i18n.get("Video info"),click:function(){t.info.show=!0,t.contextmenu.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(t){return Q({},t,{html:'ArtPlayer 3.1.9'})}({disable:!1,name:"version",index:40})),this.add(function(e){return function(t){return Q({},e,{html:t.i18n.get("Close"),click:function(){t.contextmenu.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),a(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),a(r,"click",function(t){t.composedPath().includes(o)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,G(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,o=t.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,l=a.left,u=a.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=o-u;l+c\n
Player version:
\n
3.1.9
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||P(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}();var at=function(t){if(Array.isArray(t))return t};var st=function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n};var ct=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var lt=function(t,e){return at(t)||st(t,e)||ct()},ut=function(){function n(t){a(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return r(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,o=e.template,a=o.$video,s=o.$subtitle,c=o.$track;if(O(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",a.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),a.textTracks&&a.textTracks[0]){var n=lt(a.textTracks,1)[0];r(n,"cuechange",function(){var t=lt(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(z(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function ft(t){var n=this;a(this,ft);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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)),P(e,i[t]),n[t]=e})}var dt=function(){function n(t){var e=this;a(this,n),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){-1'),t.icons.state)}return r(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}();var gt=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return Q({},i,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t){var e=t.target.dataset.value;e&&(n.flip=e)},mounted:function(t){e.on("flipChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(i){return function(e){var t=e.i18n,n=e.player;return Q({},i,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t){var e=t.target.dataset.value;e&&(n.aspectRatio=e)},mounted:function(t){e.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,o=i.events.proxy;return Q({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");o(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return G(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),bt=function(){function e(t){a(this,e),this.art=t,this.name="artplayer_settings",this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),K({},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 wt(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function xt(i){var r=i.constructor.utils.clamp,t=i.setting,o=i.notice,a=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(wt);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(a.$track&&a.$track.track){var e=Array.from(a.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),o.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else o.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function kt(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,o=t.setStyles,a=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,a(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),o(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function St(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function $t(e){a(this,$t);var n=e.option,i=e.events.proxy,r=e.template.$video;V.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=x(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||k(n.url),o=n.customType[t];t&&o?(e.emit("beforeCustomType",t),o(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var Lt=function(){function n(t){var e=this;a(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(xt),t.option.isLive||this.add(St),this.add(kt),t.option.plugins.forEach(function(t){e.add(t)})}return r(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art);return this[e&&e.name?e.name:t.name?t.name:"plugin".concat(this.id)]=e,this.art.emit("plugin:add",t),this}}]),n}(),Tt=0,Rt=function(t){function n(t){var e;return a(this,n),e=c(this,l(n).call(this)),b("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=R(n.DEFAULTS,t),f(e.option,I),e.init(),e}return e(n,d),r(n,[{key:"init",value:function(){this.whitelist=new B(this),this.template=new N(this),this.events=new dt(this),this.whitelist.state?(this.isFocus=!1,this.isDestroy=!1,this.storage=new bt(this),this.icons=new ft(this),this.i18n=new X(this),this.notice=new vt(this),this.player=new J(this),this.layers=new ht(this),this.controls=new it(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new ot(this),this.loading=new yt(this),this.hotkey=new pt(this),this.mask=new mt(this),this.setting=new gt(this),this.plugins=new Lt(this)):this.mobile=new $t(this),Tt+=1,this.id=Tt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function W(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function _(t,e){var n=document.createElement("a");j(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var F=Object.freeze({errorHandle:b,hasOwnProperty:w,clamp:x,getExt:k,secondToTime:S,sleep:$,debounce:L,throttle:T,mergeDeep:P,append:R,remove:E,setStyle:j,setStyles:O,getStyle:C,sublings:A,inverseClass:M,tooltip:q,srtToVtt:z,vttToBlob:W,downloadFile:_});function H(t,e,n){return b("string"===e||t instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}function B(t){var e=this;o(this,B);var n=t.constructor.kindOf,i=t.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||i.some(function(t){switch(n(t)){case"string":return-1\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[x]
\n
\n
\n
\n
×
\n
\n
\n \n '),this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$danmuku=this.$container.querySelector(".artplayer-danmuku"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n
\n \n
\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),D={"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:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},U={"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","This does not seem to support full screen functionality":"似乎不支持全屏功能"},X=function(){function e(t){o(this,e),this.art=t,this.languages={"zh-cn":D,"zh-tw":U},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=P(this.languages,t),this.init()}}]),e}();var Y=t(function(t){var a,e,r,o,i,n;a="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,o=function(){for(var t,e=[["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,i=e.length,r={};n ").concat(c));var l=document.createElement("div");l.classList.value="art-".concat(a," art-").concat(a,"-").concat(c),o.html&&R(l,o.html),o.style&&O(l,o.style);var u=Array.from(t.children);l.dataset.index=o.index||s;var f=u.find(function(t){return Number(t.dataset.index)>=Number(l.dataset.index)});return f?f.insertAdjacentElement("beforebegin",l):R(t,l),o.click&&e.events.proxy(l,"click",function(t){t.preventDefault(),o.click.call(e,n,t),e.emit("".concat(a,":click"),l)}),o.mounted&&o.mounted(l,n,e),r&&r(l,n,e),Object.defineProperty(n,c,{value:{get id(){return s},get $ref(){return l},set show(t){t?(j(l,"display","block"),e.emit("".concat(a,":show"),l)):(j(l,"display","none"),e.emit("".concat(a,":hide"),l))},set remove(t){t&&(E(l),e.emit("".concat(a,":remove"),l))}}}),e.emit("".concat(a,":add"),o),n[c]}var K=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var Q=function(e){for(var t=1;t\n
\n
\n
\n
\n
\n \n '),mounted:function(a){var r=!1,n=a.querySelector(".art-progress-loaded"),i=a.querySelector(".art-progress-played"),o=a.querySelector(".art-progress-highlight"),s=a.querySelector(".art-progress-indicator"),c=a.querySelector(".art-progress-tip");function l(t,e){"loaded"===t&&j(n,"width","".concat(100*e,"%")),"played"===t&&(j(i,"width","".concat(100*e,"%")),j(s,"left","calc(".concat(100*e,"% - ").concat(C(s,"width")/2,"px)")))}e.forEach(function(t){var e=x(t.time,0,d.duration)/d.duration*100;R(o,''))}),l("loaded",d.loaded),u.on("video:progress",function(){l("loaded",d.loaded)}),u.on("video:timeupdate",function(){l("played",d.played)}),u.on("video:ended",function(){l("played",1)}),f(a,"mousemove",function(t){j(c,"display","block"),-1a.clientWidth-i/2?j(c,"left","".concat(a.clientWidth-i,"px")):j(c,"left","".concat(e-i/2,"px"))}(t):function(t){var e=tt(u,t),n=e.width,i=e.time;c.innerHTML=i;var r=c.clientWidth;n<=r/2?j(c,"left",0):n>a.clientWidth-r/2?j(c,"left","".concat(a.clientWidth-r,"px")):j(c,"left","".concat(n-r/2,"px"))}(t)}),f(a,"mouseout",function(){j(c,"display","none")}),f(a,"click",function(t){if(t.target!==s){var e=tt(u,t),n=e.second;l("played",e.percentage),d.seek=n}}),f(s,"mousedown",function(){r=!0}),f(document,"mousemove",function(t){if(r){var e=tt(u,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),l("played",i),d.seek=n}}),f(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}function nt(t){return function(h){return Q({},t,{mounted:function(d){var p=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,i=!1,r=!1;e(p,"mousemove",function(t){i||(i=!0,n(h.option.thumbnails.url).then(function(){r=!0})),r&&(j(d,"display","block"),function(t){var e=tt(h,t).width,n=h.option.thumbnails,i=n.url,r=n.height,a=n.width,o=n.number,s=n.column,c=p.clientWidth/o,l=Math.floor(e/c),u=Math.ceil(l/s)-1,f=l%s||s-1;j(d,"backgroundImage","url(".concat(i,")")),j(d,"height","".concat(r,"px")),j(d,"width","".concat(a,"px")),j(d,"backgroundPosition","-".concat(f*a,"px -").concat(u*r,"px")),e<=a/2?j(d,"left",0):e>p.clientWidth-a/2?j(d,"left","".concat(p.clientWidth-a,"px")):j(d,"left","".concat(e-a/2,"px"))}(t))}),e(p,"mouseout",function(){j(d,"display","none")})}})}}var it=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var e=this,t=this.art.option;this.add(et({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(nt({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(l){return Q({},t,{mounted:function(t){var e=l.events.proxy,n=l.icons,i=l.i18n,r=l.player,a=R(t,n.play),o=R(t,n.pause);function s(){j(a,"display","flex"),j(o,"display","none")}function c(){j(a,"display","none"),j(o,"display","flex")}q(a,i.get("Play")),q(o,i.get("Pause")),e(a,"click",function(){r.play=!0}),e(o,"click",function(){r.pause=!0}),r.playing?c():s(),l.on("video:playing",function(){c()}),l.on("video:pause",function(){s()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(d){return Q({},t,{mounted:function(t){var e=d.events.proxy,n=d.icons,i=d.player,r=d.i18n,a=!1,o=R(t,n.volume),s=R(t,n.volumeClose),c=R(t,'
'),l=R(c,'
');function u(t){var e=c.getBoundingClientRect(),n=e.left,i=e.width,r=l.getBoundingClientRect().width;return x(t.pageX-n-r/2,0,i-r/2)/(i-r)}function f(){var t=0'.concat(r.name,"")),l=a.quality.map(function(t,e){return'
').concat(t.name,"
")}).join(""),u=R(t,'
'.concat(l,"
"));i(t,function(){u.style.left="-".concat(C(u,"width")/2-t.clientWidth/2,"px")}),n(u,"click",function(t){var e=Number(t.target.dataset.index),n=a.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(o.switchQuality(i,r),c.innerHTML=r,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=R(t,n.screenshot);q(a,i.get("Screenshot")),e(a,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.subtitle,a=R(t,n.subtitle);q(a,i.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),o.on("subtitle:show",function(){j(a,"opacity","1"),q(a,i.get("Hide subtitle"))}),o.on("subtitle:hide",function(){j(a,"opacity","0.8"),q(a,i.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.setting,a=R(t,n.setting);q(a,i.get("Show setting")),e(t,"click",function(){r.toggle()}),o.on("setting:show",function(){j(a,"opacity","0.8"),q(a,i.get("Hide setting"))}),o.on("setting:hide",function(){j(a,"opacity","1"),q(a,i.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(a){return Q({},t,{mounted:function(t){var e=a.events.proxy,n=a.icons,i=a.i18n,r=a.player;q(R(t,n.pip),i.get("Mini player")),e(t,"click",function(){r.pip=!0})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=R(t,n.fullscreenWeb);q(a,i.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle=!0}),o.on("fullscreenWeb:enabled",function(){j(a,"opacity","0.8"),q(a,i.get("Exit web fullscreen"))}),o.on("fullscreenWeb:exit",function(){j(a,"opacity","1"),q(a,i.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(o){return Q({},t,{mounted:function(t){var e=o.events.proxy,n=o.icons,i=o.i18n,r=o.player,a=R(t,n.fullscreen);q(a,i.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle=!0}),o.on("fullscreen:enabled",function(){j(a,"opacity","0.8"),q(a,i.get("Exit fullscreen"))}),o.on("fullscreen:exit",function(){j(a,"opacity","1"),q(a,i.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.template,a=r.$progress,o=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=a;break;case"left":n=o;break;case"right":n=s}b(n,"Controls option.position can not be empty"),this.id+=1;var c=G(this.art,this,n,i,e,"control");return c.$ref.firstElementChild&&"I"===c.$ref.firstElementChild.tagName||c.$ref.classList.add("art-control-onlyText"),c}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-controls-show"),this.art.emit("controls:show")):(this.state=!1,e.classList.remove("artplayer-controls-show"),this.art.emit("controls:hide"))}}]),n}();var rt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1})}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template,r=i.$player,a=i.$contextmenu,o=t.events.proxy;this.add(function(n){return function(t){var e=t.i18n,i=t.player;return Q({},n,{html:"\n ".concat(e.get("Play speed"),':\n 0.5\n 0.75\n ').concat(e.get("Normal"),'\n 1.25\n 1.5\n 2.0\n '),click:function(t,e){var n=e.target.dataset.rate;n&&(i.playbackRate=Number(n),t.show=!1)},mounted:function(n){t.on("playbackRateChange",function(e){var t=Array.from(n.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e});t&&M(t,"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return Q({},n,{html:"\n ".concat(t.get("Aspect ratio"),':\n ').concat(t.get("Default"),'\n 4:3\n 16:9\n '),click:function(t,e){var n=e.target.dataset.ratio;n&&(i.aspectRatio=n,t.show=!1)},mounted:function(t){e.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(t){return function(e){return Q({},t,{html:e.i18n.get("Video info"),click:function(t){e.info.show=!0,t.show=!1}})}}({disable:!1,name:"info",index:30})),this.add(function(t){return Q({},t,{html:'ArtPlayer 3.1.10'})}({disable:!1,name:"version",index:40})),this.add(function(e){return function(t){return Q({},e,{html:t.i18n.get("Close"),click:function(t){t.show=!1}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),o(r,"contextmenu",function(t){t.preventDefault(),e.show=!0,e.setPos(t)}),o(r,"click",function(t){t.composedPath().includes(a)||(e.show=!1)})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;return this.id+=1,G(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,i=e.$contextmenu,r=t.clientX,a=t.clientY,o=n.getBoundingClientRect(),s=o.height,c=o.width,l=o.left,u=o.top,f=i.getBoundingClientRect(),d=f.height,p=f.width,h=r-l,y=a-u;l+c\n
Player version:
\n
3.1.10
\n \n '),t.push('\n
\n
Video url:
\n
'.concat(this.art.option.url,"
\n
\n ")),t.push('\n
\n
Video volume:
\n
\n
\n '),t.push('\n
\n
Video time:
\n
\n
\n '),t.push('\n
\n
Video duration:
\n
\n
\n '),t.push('\n
\n
Video resolution:
\n
\n x \n
\n
\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?"number"==typeof e?e.toFixed(2):e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template,n=e.$player,i=e.$infoPanel;t?(this.state=!0,n.classList.add("artplayer-info-show"),i.innerHTML||R(i,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show")):(this.state=!1,n.classList.remove("artplayer-info-show"),clearTimeout(this.timer),this.art.emit("info:hide"))}}]),e}();var ot=function(t){if(Array.isArray(t))return t};var st=function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n};var ct=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var lt=function(t,e){return ot(t)||st(t,e)||ct()},ut=function(){function n(t){o(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return r(n,[{key:"init",value:function(t){var i=this,e=this.art,r=e.events.proxy,n=e.option.subtitle,a=e.template,o=a.$video,s=a.$subtitle,c=a.$track;if(O(s,n.style||{}),!c){var l=document.createElement("track");l.default=!0,l.kind="metadata",o.appendChild(l),this.art.template.$track=l}this.load(t).then(function(t){if(i.art.template.$track.src=t,i.art.emit("subtitle:load",t),o.textTracks&&o.textTracks[0]){var n=lt(o.textTracks,1)[0];r(n,"cuechange",function(){var t=lt(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"

".concat(t,"

")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(z(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.remove("artplayer-subtitle-hide"),this.art.emit("subtitle:show")):(this.state=!1,e.classList.add("artplayer-subtitle-hide"),this.art.emit("subtitle:hide"))}}]),n}();function ft(t){var n=this;o(this,ft);var i=Object.assign({loading:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',state:'\n \n',play:'\n \n',pause:'\n \n',volume:'\n \n \n',volumeClose:'\n \n \n',subtitle:'\n \n \n',screenshot:'\n\t\n\n',setting:'\n \n \n',fullscreen:'\n\t\n\t\n\t\n\t\n',fullscreenWeb:'\n\t\n',pip:'\n \n',prev:'\n \n',next:'\n \n'},t.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]),n[t]=e})}var dt=function(){function n(t){var e=this;o(this,n),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){-1'),t.icons.state)}return r(e,[{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-mask-show"),this.art.emit("mask:show")):(this.state=!1,e.classList.remove("artplayer-mask-show"),this.art.emit("mask:hide"))}}]),e}();var gt=function(){function n(t){var e=this;o(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&(this.art.once("video:canplay",function(){e.init()}),this.art.on("blur",function(){e.show=!1}))}return r(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,i=t.template.$setting;(0,t.events.proxy)(i,"click",function(t){t.target===i&&(e.show=!1)}),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return Q({},n,{html:'\n
'.concat(t.get("Flip"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n "),click:function(t,e){var n=e.target.dataset.value;n&&(i.flip=n)},mounted:function(t){e.on("flipChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.flip,name:"flip"})),this.add(function(n){return function(e){var t=e.i18n,i=e.player;return Q({},n,{html:'\n
'.concat(t.get("Aspect ratio"),'
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n '),click:function(t,e){var n=e.target.dataset.value;n&&(i.aspectRatio=n)},mounted:function(t){e.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("button")).find(function(t){return t.dataset.value===e}).parentElement,"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio"})),this.add(function(e){return function(i){var t=i.i18n,r=i.player,a=i.events.proxy;return Q({},e,{html:'\n
\n '.concat(t.get("Play speed"),': 1.0x\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");a(e,"change",function(){var t=e.value;n.innerText=t,r.playbackRate=Number(t)}),i.on("playbackRateChange",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}})}}({disable:!n.playbackRate,name:"playbackRate"}))}},{key:"add",value:function(t,e){this.id+=1;var n=this.art.template.$settingBody;return G(this.art,this,n,t,e,"setting")}},{key:"toggle",value:function(){this.show=!this.state}},{key:"show",set:function(t){var e=this.art.template.$player;t?(this.state=!0,e.classList.add("artplayer-setting-show"),this.art.emit("setting:show")):(this.state=!1,e.classList.remove("artplayer-setting-show"),this.art.emit("setting:hide"))}}]),n}(),bt=function(){function e(t){o(this,e),this.art=t,this.name="artplayer_settings",this.init()}return r(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=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(),K({},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 wt(i){var t=i.i18n,r=i.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n
\n '.concat(t.get("Subtitle offset time"),': 0s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector(".art-setting-range input"),n=t.querySelector(".art-subtitle-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.subtitle.offset(Number(t))}),i.on("subtitle:switch",function(){e.value=0,n.innerText=0}),i.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function xt(i){var r=i.constructor.utils.clamp,t=i.setting,a=i.notice,o=i.template,s=i.i18n,c=i.player;s.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}}),t.add(wt);var l=[];return i.on("subtitle:switch",function(){l=[]}),{name:"subtitle",offset:function(t){if(o.$track&&o.$track.track){var e=Array.from(o.$track.track.cues),n=r(t,-5,5);e.forEach(function(t,e){l[e]||(l[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=r(l[e].startTime+n,0,c.duration),t.endTime=r(l[e].endTime+n,0,c.duration)}),a.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),i.emit("artplayerPluginSubtitle:set",t)}else a.show("".concat(s.get("No subtitles found"))),i.emit("artplayerPluginSubtitle:set",0)}}}function kt(r){var t=r.constructor.utils,n=t.append,i=t.setStyle,a=t.setStyles,o=t.sleep,s=r.events.proxy,c=r.option,l=r.notice,u=r.i18n,f=r.template,d=r.player;function p(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);d.playbackRate=!1,d.aspectRatio=!1,f.$video.src=n,o(1e3).then(function(){d.currentTime=0}),c.url=n,r.emit("switch",n),l.show(u.get("Load local video successfully"))}else{var i="".concat(u.get("Playback of this file format is not supported"),": ").concat(t.type);l.show(i,!0,3e3),console.warn(i)}}}return u.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}}),s(f.$player,"dragover",function(t){t.preventDefault(),l.show(u.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),p(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'');i(t,"position","relative"),a(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){p(e.files[0])})}}}function St(e){var t=e.layers,n=e.player,i=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"3px",background:i},mounted:function(t){e.on("controls:show",function(){t.style.display="none"}),e.on("controls:hide",function(){t.style.display="block"}),e.on("video:timeupdate",function(){t.style.width="".concat(100*n.played,"%")})}}),{name:"miniProgressBar"}}function $t(e){o(this,$t);var n=e.option,i=e.events.proxy,r=e.template.$video;V.video.events.forEach(function(t){i(r,t,function(t){e.emit("video:".concat(t.type),t)})}),Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=x(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var t=n.type||k(n.url),a=n.customType[t];t&&a?(e.emit("beforeCustomType",t),a(r,n.url,e),e.emit("afterCustomType",t)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))}var Lt=function(){function n(t){var e=this;o(this,n),this.art=t,this.id=0,t.option.subtitle.url&&this.add(xt),t.option.isLive||this.add(St),this.add(kt),t.option.plugins.forEach(function(t){e.add(t)})}return r(n,[{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}}]),n}(),Tt=0,Pt=function(t){function n(t){var e;return o(this,n),e=c(this,l(n).call(this)),b("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=P(n.DEFAULTS,t),f(e.option,I),e.init(),e}return e(n,d),r(n,[{key:"init",value:function(){this.isFocus=!1,this.isDestroy=!1,this.whitelist=new B(this),this.template=new N(this),this.events=new dt(this),this.whitelist.state?(this.storage=new bt(this),this.icons=new ft(this),this.i18n=new X(this),this.notice=new vt(this),this.player=new J(this),this.layers=new ht(this),this.controls=new it(this),this.contextmenu=new rt(this),this.subtitle=new ut(this),this.info=new at(this),this.loading=new yt(this),this.hotkey=new pt(this),this.mask=new mt(this),this.setting=new gt(this),this.plugins=new Lt(this)):this.mobile=new $t(this),Tt+=1,this.id=Tt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0