Refactor code structure for improved readability and maintainability

Remove debugging border from the websr plugin's styling

Enhance canvas sizing logic in artplayer-plugin-websr

- Updated canvas positioning to center it within the player.
- Introduced a new function to calculate canvas size based on the video aspect ratio.
- Adjusted canvas dimensions during initialization and on resize events to maintain aspect ratio.
- Ensured canvas styles are updated to reflect the calculated dimensions.

feat: add comparison mode to artplayer-plugin-websr

- Updated README.md to reflect new comparison feature and simplified content.
- Modified package.json to remove unnecessary keywords.
- Enhanced index.js to implement comparison functionality, allowing users to compare original and upscaled video.
- Added new methods for enabling, disabling, and toggling comparison mode, as well as setting and getting the comparison position.
- Updated TypeScript definitions to include new comparison options and methods.
This commit is contained in:
Harvey Zhao committed 2026-02-10 23:02:31 +08:00
1 parent 07a5b0c0f0
commit 7dffd99cfd
308 files changed
+3175 -852

No files matched your search

@@ -5,4 +5,4 @@
* (c) 2017-2026 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,o,n,r,l,u,i){var a="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},c="function"==typeof a[n]&&a[n],s=c.i||{},f=c.cache||{},d="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,o){if(!f[t]){if(!e[t]){if(r[t])return r[t];var l="function"==typeof a[n]&&a[n];if(!o&&l)return l(t,!0);if(c)return c(t,!0);if(d&&"string"==typeof t)return d(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}s.resolve=function(o){var n=e[t][1][o];return null!=n?n:o},s.cache={};var i=f[t]=new p.Module(t);e[t][0].call(i.exports,s,i,i.exports,a)}return f[t].exports;function s(e){var t=s.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var o={__esModule:!0};return t.forEach(function(e){var t=e[0],n=e[1],r=e[2]||e[0],l=p(n);"*"===t?Object.keys(l).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(o,e)||Object.defineProperty(o,e,{enumerable:!0,get:function(){return l[e]}})}):"*"===r?Object.defineProperty(o,t,{enumerable:!0,value:l}):Object.defineProperty(o,t,{enumerable:!0,get:function(){return"default"===r?l.__esModule?l.default:l:l[r]}})}),o}return p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=d,this.exports={}},p.modules=e,p.cache=f,p.parent=c,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=s,p.register=function(t,o){e[t]=[function(e,t){t.exports=o},{}]},Object.defineProperty(p,"root",{get:function(){return a[n]}}),a[n]=p;for(var h=0;h<t.length;h++)p(t[h]);if(o){var v=p(o);"object"==typeof exports&&"u">typeof module?module.exports=v:"function"==typeof define&&define.amd&&define(function(){return v})}}({dHVos:[function(e,t,o,n){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(o),r.export(o,"default",()=>s);var l=e("bundle-text:./audio.svg"),u=r.interopDefault(l),i=e("bundle-text:./quality.svg"),a=r.interopDefault(i);function c(e,t){let o=new Map;return e.filter(e=>{let n=e[t];return void 0===n||!o.has(n)&&o.set(n,1)})}function s(e={}){return t=>{let{$video:o}=t.template,{errorHandle:n}=t.constructor.utils;function r(){n(t.hls?.media===o,'Cannot find instance of HLS from "art.hls"'),function(o){if(!o.levels.length)return;let n=e.quality||{},r=n.auto||"Auto",l=n.title||"Quality",u=n.getName||(e=>e.name||`${e.height}P`),i=o.levels[o.currentLevel],s=i?u(i):r,f=c(o.levels.map((e,t)=>({html:u(e,t),value:t,default:o.currentLevel===t})),"html").sort((e,t)=>t.value-e.value);f.push({html:r,value:-1,default:-1===o.currentLevel});let d=e=>(o.currentLevel=e.value,t.notice.show=`${l}: ${e.html}`,n.control&&t.controls.check(e),n.setting&&t.setting.check(e),e.html);n.control&&t.controls.update({name:"hls-quality",position:"right",html:s,style:{padding:"0 10px"},selector:f,onSelect:d}),n.setting&&t.setting.update({name:"hls-quality",tooltip:s,html:l,icon:a.default,width:200,selector:f,onSelect:d})}(t.hls),function(o){if(!o.audioTracks.length)return;let n=e.audio||{},r=n.auto||"Auto",l=n.title||"Audio",i=n.getName||(e=>e.name||e.lang||e.language),a=o.audioTracks[o.audioTrack],s=a?i(a):r,f=c(o.audioTracks.map((e,t)=>({html:i(e,t),value:e.id,default:o.audioTrack===e.id})),"html"),d=e=>(o.audioTrack=e.value,t.notice.show=`${l}: ${e.html}`,n.control&&t.controls.check(e),n.setting&&t.setting.check(e),e.html);n.control&&t.controls.update({name:"hls-audio",position:"right",html:s,style:{padding:"0 10px"},selector:f,onSelect:d}),n.setting&&t.setting.update({name:"hls-audio",tooltip:s,html:l,icon:u.default,width:200,selector:f,onSelect:d})}(t.hls)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginHlsControl",update:r}}}"u">typeof window&&(window.artplayerPluginHlsControl=s)},{"bundle-text:./audio.svg":"fVNuY","bundle-text:./quality.svg":"5ZFEa","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],fVNuY:[function(e,t,o,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6 26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48 10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80"/></svg>'},{}],"5ZFEa":[function(e,t,o,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M0 96c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64Zm323.8 106.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6-26.5-33.1c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S78.8 416 88 416h336c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7ZM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96"/></svg>'},{}],"6ykb1":[function(e,t,o,n){o.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},o.defineInteropFlag=function(e){Object.defineProperty(e,"__esModulLine truncated
!function(e,t,o,n,r){var l="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},u="function"==typeof l[n]&&l[n],i=u.i||{},a=u.cache||{},c="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,o){if(!a[t]){if(!e[t]){if(r[t])return r[t];var i="function"==typeof l[n]&&l[n];if(!o&&i)return i(t,!0);if(u)return u(t,!0);if(c&&"string"==typeof t)return c(t);var f=Error("Cannot find module '"+t+"'");throw f.code="MODULE_NOT_FOUND",f}p.resolve=function(o){var n=e[t][1][o];return null!=n?n:o},p.cache={};var d=a[t]=new s.Module(t);e[t][0].call(d.exports,p,d,d.exports,l)}return a[t].exports;function p(e){var t=p.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var o={__esModule:!0};return t.forEach(function(e){var t=e[0],n=e[1],r=e[2]||e[0],l=s(n);"*"===t?Object.keys(l).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(o,e)||Object.defineProperty(o,e,{enumerable:!0,get:function(){return l[e]}})}):"*"===r?Object.defineProperty(o,t,{enumerable:!0,value:l}):Object.defineProperty(o,t,{enumerable:!0,get:function(){return"default"===r?l.__esModule?l.default:l:l[r]}})}),o}return s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.require=c,this.exports={}},s.modules=e,s.cache=a,s.parent=u,s.distDir=void 0,s.publicUrl=void 0,s.devServer=void 0,s.i=i,s.register=function(t,o){e[t]=[function(e,t){t.exports=o},{}]},Object.defineProperty(s,"root",{get:function(){return l[n]}}),l[n]=s;for(var f=0;f<t.length;f++)s(t[f]);if(o){var d=s(o);"object"==typeof exports&&"u">typeof module?module.exports=d:"function"==typeof define&&define.amd&&define(function(){return d})}}({dHVos:[function(e,t,o,n){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(o),r.export(o,"default",()=>s);var l=e("bundle-text:./audio.svg"),u=r.interopDefault(l),i=e("bundle-text:./quality.svg"),a=r.interopDefault(i);function c(e,t){let o=new Map;return e.filter(e=>{let n=e[t];return void 0===n||!o.has(n)&&o.set(n,1)})}function s(e={}){return t=>{let{$video:o}=t.template,{errorHandle:n}=t.constructor.utils;function r(){n(t.hls?.media===o,'Cannot find instance of HLS from "art.hls"'),function(o){if(!o.levels.length)return;let n=e.quality||{},r=n.auto||"Auto",l=n.title||"Quality",u=n.getName||(e=>e.name||`${e.height}P`),i=o.levels[o.currentLevel],s=i?u(i):r,f=c(o.levels.map((e,t)=>({html:u(e,t),value:t,default:o.currentLevel===t})),"html").sort((e,t)=>t.value-e.value);f.push({html:r,value:-1,default:-1===o.currentLevel});let d=e=>(o.currentLevel=e.value,t.notice.show=`${l}: ${e.html}`,n.control&&t.controls.check(e),n.setting&&t.setting.check(e),e.html);n.control&&t.controls.update({name:"hls-quality",position:"right",html:s,style:{padding:"0 10px"},selector:f,onSelect:d}),n.setting&&t.setting.update({name:"hls-quality",tooltip:s,html:l,icon:a.default,width:200,selector:f,onSelect:d})}(t.hls),function(o){if(!o.audioTracks.length)return;let n=e.audio||{},r=n.auto||"Auto",l=n.title||"Audio",i=n.getName||(e=>e.name||e.lang||e.language),a=o.audioTracks[o.audioTrack],s=a?i(a):r,f=c(o.audioTracks.map((e,t)=>({html:i(e,t),value:e.id,default:o.audioTrack===e.id})),"html"),d=e=>(o.audioTrack=e.value,t.notice.show=`${l}: ${e.html}`,n.control&&t.controls.check(e),n.setting&&t.setting.check(e),e.html);n.control&&t.controls.update({name:"hls-audio",position:"right",html:s,style:{padding:"0 10px"},selector:f,onSelect:d}),n.setting&&t.setting.update({name:"hls-audio",tooltip:s,html:l,icon:u.default,width:200,selector:f,onSelect:d})}(t.hls)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginHlsControl",update:r}}}"u">typeof window&&(window.artplayerPluginHlsControl=s)},{"bundle-text:./audio.svg":"fVNuY","bundle-text:./quality.svg":"5ZFEa","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],fVNuY:[function(e,t,o,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6 26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48 10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80"/></svg>'},{}],"5ZFEa":[function(e,t,o,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M0 96c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64Zm323.8 106.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6-26.5-33.1c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S78.8 416 88 416h336c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7ZM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96"/></svg>'},{}],"6ykb1":[function(e,t,o,n){o.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},o.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{vaLine truncated
@@ -5,4 +5,4 @@
* (c) 2017-2026 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,n,o,r,u,l,i){var a="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},c="function"==typeof a[o]&&a[o],f=c.i||{},s=c.cache||{},d="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!s[t]){if(!e[t]){if(r[t])return r[t];var u="function"==typeof a[o]&&a[o];if(!n&&u)return u(t,!0);if(c)return c(t,!0);if(d&&"string"==typeof t)return d(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}f.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},f.cache={};var i=s[t]=new p.Module(t);e[t][0].call(i.exports,f,i,i.exports,a)}return s[t].exports;function f(e){var t=f.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var n={__esModule:!0};return t.forEach(function(e){var t=e[0],o=e[1],r=e[2]||e[0],u=p(o);"*"===t?Object.keys(u).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:function(){return u[e]}})}):"*"===r?Object.defineProperty(n,t,{enumerable:!0,value:u}):Object.defineProperty(n,t,{enumerable:!0,get:function(){return"default"===r?u.__esModule?u.default:u:u[r]}})}),n}return p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=d,this.exports={}},p.modules=e,p.cache=s,p.parent=c,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=f,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return a[o]}}),a[o]=p;for(var h=0;h<t.length;h++)p(t[h]);if(n){var v=p(n);"object"==typeof exports&&"u">typeof module?module.exports=v:"function"==typeof define&&define.amd&&define(function(){return v})}}({do1Zn:[function(e,t,n,o){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",function(){return f});var u=e("bundle-text:./audio.svg"),l=r.interopDefault(u),i=e("bundle-text:./quality.svg"),a=r.interopDefault(i);function c(e,t){var n=new Map;return e.filter(function(e){var o=e[t];return void 0===o||!n.has(o)&&n.set(o,1)})}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.template.$video,o=t.constructor.utils.errorHandle;function r(){var r;o((null==(r=t.hls)?void 0:r.media)===n,'Cannot find instance of HLS from "art.hls"'),function(n){if(n.levels.length){var o=e.quality||{},r=o.auto||"Auto",u=o.title||"Quality",l=o.getName||function(e){return e.name||"".concat(e.height,"P")},i=n.levels[n.currentLevel],f=i?l(i):r,s=c(n.levels.map(function(e,t){return{html:l(e,t),value:t,default:n.currentLevel===t}}),"html").sort(function(e,t){return t.value-e.value});s.push({html:r,value:-1,default:-1===n.currentLevel});var d=function(e){return n.currentLevel=e.value,t.notice.show="".concat(u,": ").concat(e.html),o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html};o.control&&t.controls.update({name:"hls-quality",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-quality",tooltip:f,html:u,icon:a.default,width:200,selector:s,onSelect:d})}}(t.hls),function(n){if(n.audioTracks.length){var o=e.audio||{},r=o.auto||"Auto",u=o.title||"Audio",i=o.getName||function(e){return e.name||e.lang||e.language},a=n.audioTracks[n.audioTrack],f=a?i(a):r,s=c(n.audioTracks.map(function(e,t){return{html:i(e,t),value:e.id,default:n.audioTrack===e.id}}),"html"),d=function(e){return n.audioTrack=e.value,t.notice.show="".concat(u,": ").concat(e.html),o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html};o.control&&t.controls.update({name:"hls-audio",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-audio",tooltip:f,html:u,icon:l.default,width:200,selector:s,onSelect:d})}}(t.hls)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginHlsControl",update:r}}}"u">typeof window&&(window.artplayerPluginHlsControl=f)},{"bundle-text:./audio.svg":"3PyT9","bundle-text:./quality.svg":"6NhUQ","@parcel/transformer-js/src/esmodule-helpers.js":"qpMMf"}],"3PyT9":[function(e,t,n,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6 26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48 10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80"/></svg>'},{}],"6NhUQ":[function(e,t,n,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M0 96c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64Zm323.8 106.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6-26.5-33.1c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S78.8 416 88 416h336c8.9 0 17.1-4.9 21.2Line truncated
!function(e,t,n,o,r){var u="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},l="function"==typeof u[o]&&u[o],i=l.i||{},a=l.cache||{},c="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,n){if(!a[t]){if(!e[t]){if(r[t])return r[t];var i="function"==typeof u[o]&&u[o];if(!n&&i)return i(t,!0);if(l)return l(t,!0);if(c&&"string"==typeof t)return c(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}p.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},p.cache={};var d=a[t]=new f.Module(t);e[t][0].call(d.exports,p,d,d.exports,u)}return a[t].exports;function p(e){var t=p.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var n={__esModule:!0};return t.forEach(function(e){var t=e[0],o=e[1],r=e[2]||e[0],u=f(o);"*"===t?Object.keys(u).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:function(){return u[e]}})}):"*"===r?Object.defineProperty(n,t,{enumerable:!0,value:u}):Object.defineProperty(n,t,{enumerable:!0,get:function(){return"default"===r?u.__esModule?u.default:u:u[r]}})}),n}return f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=c,this.exports={}},f.modules=e,f.cache=a,f.parent=l,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=i,f.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return u[o]}}),u[o]=f;for(var s=0;s<t.length;s++)f(t[s]);if(n){var d=f(n);"object"==typeof exports&&"u">typeof module?module.exports=d:"function"==typeof define&&define.amd&&define(function(){return d})}}({do1Zn:[function(e,t,n,o){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",function(){return f});var u=e("bundle-text:./audio.svg"),l=r.interopDefault(u),i=e("bundle-text:./quality.svg"),a=r.interopDefault(i);function c(e,t){var n=new Map;return e.filter(function(e){var o=e[t];return void 0===o||!n.has(o)&&n.set(o,1)})}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.template.$video,o=t.constructor.utils.errorHandle;function r(){var r;o((null==(r=t.hls)?void 0:r.media)===n,'Cannot find instance of HLS from "art.hls"'),function(n){if(n.levels.length){var o=e.quality||{},r=o.auto||"Auto",u=o.title||"Quality",l=o.getName||function(e){return e.name||"".concat(e.height,"P")},i=n.levels[n.currentLevel],f=i?l(i):r,s=c(n.levels.map(function(e,t){return{html:l(e,t),value:t,default:n.currentLevel===t}}),"html").sort(function(e,t){return t.value-e.value});s.push({html:r,value:-1,default:-1===n.currentLevel});var d=function(e){return n.currentLevel=e.value,t.notice.show="".concat(u,": ").concat(e.html),o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html};o.control&&t.controls.update({name:"hls-quality",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-quality",tooltip:f,html:u,icon:a.default,width:200,selector:s,onSelect:d})}}(t.hls),function(n){if(n.audioTracks.length){var o=e.audio||{},r=o.auto||"Auto",u=o.title||"Audio",i=o.getName||function(e){return e.name||e.lang||e.language},a=n.audioTracks[n.audioTrack],f=a?i(a):r,s=c(n.audioTracks.map(function(e,t){return{html:i(e,t),value:e.id,default:n.audioTrack===e.id}}),"html"),d=function(e){return n.audioTrack=e.value,t.notice.show="".concat(u,": ").concat(e.html),o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html};o.control&&t.controls.update({name:"hls-audio",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-audio",tooltip:f,html:u,icon:l.default,width:200,selector:s,onSelect:d})}}(t.hls)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginHlsControl",update:r}}}"u">typeof window&&(window.artplayerPluginHlsControl=f)},{"bundle-text:./audio.svg":"3PyT9","bundle-text:./quality.svg":"6NhUQ","@parcel/transformer-js/src/esmodule-helpers.js":"qpMMf"}],"3PyT9":[function(e,t,n,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6 26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48 10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80"/></svg>'},{}],"6NhUQ":[function(e,t,n,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M0 96c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64Zm323.8 106.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6-26.5-33.1c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S78.8 416 88 416h336c8.9 0 17.1-4.9 21.2-12.8sLine truncated
@@ -5,4 +5,4 @@
* (c) 2017-2026 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,o,n,l,u,i){var a="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},c="function"==typeof a[o]&&a[o],f=c.i||{},s=c.cache||{},d="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,r){if(!s[t]){if(!e[t]){if(n[t])return n[t];var l="function"==typeof a[o]&&a[o];if(!r&&l)return l(t,!0);if(c)return c(t,!0);if(d&&"string"==typeof t)return d(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}f.resolve=function(r){var o=e[t][1][r];return null!=o?o:r},f.cache={};var i=s[t]=new p.Module(t);e[t][0].call(i.exports,f,i,i.exports,a)}return s[t].exports;function f(e){var t=f.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],o=e[1],n=e[2]||e[0],l=p(o);"*"===t?Object.keys(l).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return l[e]}})}):"*"===n?Object.defineProperty(r,t,{enumerable:!0,value:l}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===n?l.__esModule?l.default:l:l[n]}})}),r}return p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=d,this.exports={}},p.modules=e,p.cache=s,p.parent=c,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=f,p.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(p,"root",{get:function(){return a[o]}}),a[o]=p;for(var h=0;h<t.length;h++)p(t[h]);if(r){var v=p(r);"object"==typeof exports&&"u">typeof module?module.exports=v:"function"==typeof define&&define.amd&&define(function(){return v})}}({"7qxYx":[function(e,t,r,o){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",()=>f);var l=e("bundle-text:./audio.svg"),u=n.interopDefault(l),i=e("bundle-text:./quality.svg"),a=n.interopDefault(i);function c(e,t){let r=new Map;return e.filter(e=>{let o=e[t];return void 0===o||!r.has(o)&&r.set(o,1)})}function f(e={}){return t=>{let{$video:r}=t.template,{errorHandle:o}=t.constructor.utils;function n(){o(t.hls?.media===r,'Cannot find instance of HLS from "art.hls"'),function(r){if(!r.levels.length)return;let o=e.quality||{},n=o.auto||"Auto",l=o.title||"Quality",u=o.getName||(e=>e.name||`${e.height}P`),i=r.levels[r.currentLevel],f=i?u(i):n,s=c(r.levels.map((e,t)=>({html:u(e,t),value:t,default:r.currentLevel===t})),"html").sort((e,t)=>t.value-e.value);s.push({html:n,value:-1,default:-1===r.currentLevel});let d=e=>(r.currentLevel=e.value,t.notice.show=`${l}: ${e.html}`,o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html);o.control&&t.controls.update({name:"hls-quality",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-quality",tooltip:f,html:l,icon:a.default,width:200,selector:s,onSelect:d})}(t.hls),function(r){if(!r.audioTracks.length)return;let o=e.audio||{},n=o.auto||"Auto",l=o.title||"Audio",i=o.getName||(e=>e.name||e.lang||e.language),a=r.audioTracks[r.audioTrack],f=a?i(a):n,s=c(r.audioTracks.map((e,t)=>({html:i(e,t),value:e.id,default:r.audioTrack===e.id})),"html"),d=e=>(r.audioTrack=e.value,t.notice.show=`${l}: ${e.html}`,o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html);o.control&&t.controls.update({name:"hls-audio",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-audio",tooltip:f,html:l,icon:u.default,width:200,selector:s,onSelect:d})}(t.hls)}return t.on("ready",n),t.on("restart",n),{name:"artplayerPluginHlsControl",update:n}}}"u">typeof window&&(window.artplayerPluginHlsControl=f)},{"bundle-text:./audio.svg":"jEE7y","bundle-text:./quality.svg":"8KB1y","@parcel/transformer-js/src/esmodule-helpers.js":"loqXi"}],jEE7y:[function(e,t,r,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6 26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48 10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80"/></svg>'},{}],"8KB1y":[function(e,t,r,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M0 96c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64Zm323.8 106.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6-26.5-33.1c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S78.8 416 88 416h336c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7ZM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96"/></svg>'},{}],loqXi:[function(e,t,r,o){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModulLine truncated
!function(e,t,r,o,n){var l="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},u="function"==typeof l[o]&&l[o],i=u.i||{},a=u.cache||{},c="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!a[t]){if(!e[t]){if(n[t])return n[t];var i="function"==typeof l[o]&&l[o];if(!r&&i)return i(t,!0);if(u)return u(t,!0);if(c&&"string"==typeof t)return c(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}p.resolve=function(r){var o=e[t][1][r];return null!=o?o:r},p.cache={};var d=a[t]=new f.Module(t);e[t][0].call(d.exports,p,d,d.exports,l)}return a[t].exports;function p(e){var t=p.resolve(e);if(!1===t)return{};if(Array.isArray(t)){var r={__esModule:!0};return t.forEach(function(e){var t=e[0],o=e[1],n=e[2]||e[0],l=f(o);"*"===t?Object.keys(l).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return l[e]}})}):"*"===n?Object.defineProperty(r,t,{enumerable:!0,value:l}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===n?l.__esModule?l.default:l:l[n]}})}),r}return f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=c,this.exports={}},f.modules=e,f.cache=a,f.parent=u,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=i,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return l[o]}}),l[o]=f;for(var s=0;s<t.length;s++)f(t[s]);if(r){var d=f(r);"object"==typeof exports&&"u">typeof module?module.exports=d:"function"==typeof define&&define.amd&&define(function(){return d})}}({"7qxYx":[function(e,t,r,o){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",()=>f);var l=e("bundle-text:./audio.svg"),u=n.interopDefault(l),i=e("bundle-text:./quality.svg"),a=n.interopDefault(i);function c(e,t){let r=new Map;return e.filter(e=>{let o=e[t];return void 0===o||!r.has(o)&&r.set(o,1)})}function f(e={}){return t=>{let{$video:r}=t.template,{errorHandle:o}=t.constructor.utils;function n(){o(t.hls?.media===r,'Cannot find instance of HLS from "art.hls"'),function(r){if(!r.levels.length)return;let o=e.quality||{},n=o.auto||"Auto",l=o.title||"Quality",u=o.getName||(e=>e.name||`${e.height}P`),i=r.levels[r.currentLevel],f=i?u(i):n,s=c(r.levels.map((e,t)=>({html:u(e,t),value:t,default:r.currentLevel===t})),"html").sort((e,t)=>t.value-e.value);s.push({html:n,value:-1,default:-1===r.currentLevel});let d=e=>(r.currentLevel=e.value,t.notice.show=`${l}: ${e.html}`,o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html);o.control&&t.controls.update({name:"hls-quality",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-quality",tooltip:f,html:l,icon:a.default,width:200,selector:s,onSelect:d})}(t.hls),function(r){if(!r.audioTracks.length)return;let o=e.audio||{},n=o.auto||"Auto",l=o.title||"Audio",i=o.getName||(e=>e.name||e.lang||e.language),a=r.audioTracks[r.audioTrack],f=a?i(a):n,s=c(r.audioTracks.map((e,t)=>({html:i(e,t),value:e.id,default:r.audioTrack===e.id})),"html"),d=e=>(r.audioTrack=e.value,t.notice.show=`${l}: ${e.html}`,o.control&&t.controls.check(e),o.setting&&t.setting.check(e),e.html);o.control&&t.controls.update({name:"hls-audio",position:"right",html:f,style:{padding:"0 10px"},selector:s,onSelect:d}),o.setting&&t.setting.update({name:"hls-audio",tooltip:f,html:l,icon:u.default,width:200,selector:s,onSelect:d})}(t.hls)}return t.on("ready",n),t.on("restart",n),{name:"artplayerPluginHlsControl",update:n}}}"u">typeof window&&(window.artplayerPluginHlsControl=f)},{"bundle-text:./audio.svg":"jEE7y","bundle-text:./quality.svg":"8KB1y","@parcel/transformer-js/src/esmodule-helpers.js":"loqXi"}],jEE7y:[function(e,t,r,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6 26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48 10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80"/></svg>'},{}],"8KB1y":[function(e,t,r,o){t.exports='<svg xmlns="http://www.w3.org/2000/svg" height="18" viewBox="0 0 512 512"><path fill="#fff" d="M0 96c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64Zm323.8 106.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6-26.5-33.1c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S78.8 416 88 416h336c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7ZM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96"/></svg>'},{}],loqXi:[function(e,t,r,o){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{vaLine truncated