mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
feat: update package version to 1.0.0 and remove deprecated HLS quality files
This commit is contained in:
1 parent
6b93dc95b0
commit
3d33458efc
9 files changed
+33
-257
No files matched your search
@@ -0,0 +1,8 @@
|
||||
|
||||
/*!
|
||||
* artplayer-plugin-hls-control.js v1.0.0
|
||||
* Github: https://github.com/zhw2590582/ArtPlayer
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,o,l){var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof r[o]&&r[o],u=i.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!u[t]){if(!e[t]){var l="function"==typeof r[o]&&r[o];if(!n&&l)return l(t,!0);if(i)return i(t,!0);if(a&&"string"==typeof t)return a(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},d.cache={};var f=u[t]=new s.Module(t);e[t][0].call(f.exports,d,f,f.exports,this)}return u[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=u,s.parent=i,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return r[o]}}),r[o]=s;for(var c=0;c<t.length;c++)s(t[c]);if(n){var f=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=f:"function"==typeof define&&define.amd&&define(function(){return f})}}({haa6A:[function(e,t,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(n),o.export(n,"default",()=>s);var l=e("bundle-text:./quality.svg"),r=o.interopDefault(l),i=e("bundle-text:./audio.svg"),u=o.interopDefault(i);function a(e,t){let n=new Map;return e.filter(e=>{let o=e[t];return void 0===o||!n.has(o)&&n.set(o,1)})}function s(e={}){return t=>{let{$video:n}=t.template,{errorHandle:o}=t.constructor.utils;function l(){o(t.hls?.media===n,'Cannot find instance of HLS from "art.hls"'),function(n){if(!n.levels.length)return;let o=e.quality||{},l=o.auto||"Auto",i=o.title||"Quality",u=o.getName||(e=>e.name||e.height+"P"),s=n.levels[n.currentLevel],c=s?u(s):l,f=a(n.levels.map((e,t)=>({html:u(e,t),value:t,default:n.currentLevel===t})),"html").sort((e,t)=>t.value-e.value);f.push({html:l,value:-1,default:-1===n.currentLevel});let d=e=>(n.currentLevel=e.value,t.loading.show=!0,t.notice.show=`${i}: ${e.html}`,e.html);o.control&&t.controls.update({name:"hls-quality",position:"right",html:c,style:{padding:"0 10px"},selector:f,onSelect:d}),o.setting&&t.setting.update({name:"hls-quality",tooltip:c,html:i,icon:r.default,width:200,selector:f,onSelect:d})}(t.hls),function(n){if(!n.audioTracks.length)return;let o=e.audio||{},l=o.auto||"Auto",r=o.title||"Audio",i=o.getName||(e=>e.name||e.lang||e.language),s=n.audioTracks[n.audioTrack],c=s?i(s):l,f=a(n.audioTracks.map((e,t)=>({html:i(e,t),value:e.id,default:n.audioTrack===e.id})),"html"),d=e=>(n.audioTrack=e.value,t.loading.show=!0,t.notice.show=`${r}: ${e.html}`,e.html);o.control&&t.controls.update({name:"hls-audio",position:"right",html:c,style:{padding:"0 10px"},selector:f,onSelect:d}),o.setting&&t.setting.update({name:"hls-audio",tooltip:c,html:r,icon:u.default,width:200,selector:f,onSelect:d})}(t.hls)}return t.on("ready",l),t.on("restart",l),{name:"artplayerPluginHlsControl",update:l}}}"undefined"!=typeof window&&(window.artplayerPluginHlsControl=s)},{"bundle-text:./quality.svg":"5aI3W","bundle-text:./audio.svg":"kbgg8","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5aI3W":[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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-64V96zm323.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.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'},{}],kbgg8:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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 80z"/></svg>'},{}],"9pCYc":[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["haa6A"],"haa6A","parcelRequire4dc0");
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
/*!
|
||||
* artplayer-plugin-hls-control.js v1.0.0
|
||||
* Github: https://github.com/zhw2590582/ArtPlayer
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,o,r){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof l[o]&&l[o],i=u.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,n){if(!i[t]){if(!e[t]){var r="function"==typeof l[o]&&l[o];if(!n&&r)return r(t,!0);if(u)return u(t,!0);if(a&&"string"==typeof t)return a(t);var f=Error("Cannot find module '"+t+"'");throw f.code="MODULE_NOT_FOUND",f}s.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},s.cache={};var d=i[t]=new c.Module(t);e[t][0].call(d.exports,s,d,d.exports,this)}return i[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=i,c.parent=u,c.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(c,"root",{get:function(){return l[o]}}),l[o]=c;for(var f=0;f<t.length;f++)c(t[f]);if(n){var d=c(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define&&define.amd&&define(function(){return d})}}({"6nh0Z":[function(e,t,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(n),o.export(n,"default",function(){return c});var r=e("bundle-text:./quality.svg"),l=o.interopDefault(r),u=e("bundle-text:./audio.svg"),i=o.interopDefault(u);function a(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 c(){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?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",i=o.getName||function(e){return e.name||e.height+"P"},c=n.levels[n.currentLevel],f=c?i(c):r,d=a(n.levels.map(function(e,t){return{html:i(e,t),value:t,default:n.currentLevel===t}}),"html").sort(function(e,t){return t.value-e.value});d.push({html:r,value:-1,default:-1===n.currentLevel});var s=function(e){return n.currentLevel=e.value,t.loading.show=!0,t.notice.show="".concat(u,": ").concat(e.html),e.html};o.control&&t.controls.update({name:"hls-quality",position:"right",html:f,style:{padding:"0 10px"},selector:d,onSelect:s}),o.setting&&t.setting.update({name:"hls-quality",tooltip:f,html:u,icon:l.default,width:200,selector:d,onSelect:s})}}(t.hls),function(n){if(n.audioTracks.length){var o=e.audio||{},r=o.auto||"Auto",l=o.title||"Audio",u=o.getName||function(e){return e.name||e.lang||e.language},c=n.audioTracks[n.audioTrack],f=c?u(c):r,d=a(n.audioTracks.map(function(e,t){return{html:u(e,t),value:e.id,default:n.audioTrack===e.id}}),"html"),s=function(e){return n.audioTrack=e.value,t.loading.show=!0,t.notice.show="".concat(l,": ").concat(e.html),e.html};o.control&&t.controls.update({name:"hls-audio",position:"right",html:f,style:{padding:"0 10px"},selector:d,onSelect:s}),o.setting&&t.setting.update({name:"hls-audio",tooltip:f,html:l,icon:i.default,width:200,selector:d,onSelect:s})}}(t.hls)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginHlsControl",update:r}}}"undefined"!=typeof window&&(window.artplayerPluginHlsControl=c)},{"bundle-text:./quality.svg":"ghIYQ","bundle-text:./audio.svg":"cPSEW","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],ghIYQ:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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-64V96zm323.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.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'},{}],cPSEW:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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 80z"/></svg>'},{}],iWrD0:[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["6nh0Z"],"6nh0Z","parcelRequire4dc0");
|
||||
@@ -1 +0,0 @@
|
||||
/*! * artplayer-plugin-hls-quality.js v2.0.0 * Github:https://github.com/zhw2590582/ArtPlayer * (c) 2017-2024 Harvey Zack * Released under the MIT License. */ !function(e,t,n,o,l){var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof r[o]&&r[o],u=i.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,n){if(!u[t]){if(!e[t]){var l="function"==typeof r[o]&&r[o];if(!n&&l)return l(t,!0);if(i)return i(t,!0);if(a&&"string"==typeof t)return a(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}d.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},d.cache={};var c=u[t]=new f.Module(t);e[t][0].call(c.exports,d,c,c.exports,this)}return u[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=u,f.parent=i,f.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return r[o]}}),r[o]=f;for(var s=0;s<t.length;s++)f(t[s]);if(n){var c=f(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd&&define(function(){return c})}}({eEHR6:[function(e,t,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(n),o.export(n,"default",()=>i);var l=e("bundle-text:./image.svg"),r=o.interopDefault(l);function i(e){return t=>{!function(e){let{version:t,utils:{errorHandle:n}}=e.constructor,o=t.split(".").map(Number);n(o[0]+o[1]/100>=5,`Artplayer.js@${t}is not compatible the artplayerPluginHlsQuality@${i.version}. Please update it to version Artplayer.js@5.x.x`)}(t);let{$video:n}=t.template,{errorHandle:o}=t.constructor.utils;function l(){let l=t.hls||window.hls;o(l&&l.media===n,'Cannot find instance of HLS from "art.hls" or "window.hls"');let i=e.auto||"Auto",u=e.title||"Quality",a=e.getResolution||(e=>(e.height||"Unknown ")+"P"),f=l.levels[l.currentLevel],s=f?a(f):i;e.control&&t.controls.update({name:"hls-quality",position:"right",html:s,style:{padding:"0 10px"},selector:l.levels.map((e,t)=>({html:a(e),level:e.level||t,default:f===e})),onSelect:e=>(l.currentLevel=e.level,t.loading.show=!0,e.html)}),e.setting&&t.setting.update({name:"hls-quality",tooltip:s,html:u,icon:r.default,width:200,selector:l.levels.map((e,t)=>({html:a(e),level:e.level||t,default:f===e})),onSelect:function(e){return l.currentLevel=e.level,t.loading.show=!0,e.html}})}return t.on("ready",l),t.on("restart",l),{name:"artplayerPluginHlsQuality"}}}"undefined"!=typeof window&&(window.artplayerPluginHlsQuality=i)},{"bundle-text:./image.svg":"5VXix","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5VXix":[function(e,t,n){t.exports='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M870.4 176H153.6c-49.472 0-89.6 40.128-89.6 89.6v492.736c0 49.472 40.128 89.6 89.6 89.6h716.8c49.472 0 89.6-40.128 89.6-89.6V265.6c0-49.472-40.128-89.6-89.6-89.6zm0 492.8h-44.8s-29.696-65.792-89.6-89.6-134.4 89.6-134.4 89.6-66.56-71.808-134.4-224S153.6 624 153.6 624V265.6h716.8v403.2zM668.8 489.6c37.056 0 67.2-30.144 67.2-67.264 0-37.056-30.144-67.2-67.2-67.2-37.12.064-67.2 30.208-67.2 67.264 0 37.12 30.08 67.2 67.2 67.2z" fill="#fff"/></svg>'},{}],"9pCYc":[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["eEHR6"],"eEHR6","parcelRequire4dc0");
|
||||
@@ -1 +0,0 @@
|
||||
/*! * artplayer-plugin-hls-quality.js v2.0.0 * Github:https://github.com/zhw2590582/ArtPlayer * (c) 2017-2024 Harvey Zack * Released under the MIT License. */ !function(e,t,n,r,o){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof l[r]&&l[r],u=i.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,n){if(!u[t]){if(!e[t]){var o="function"==typeof l[r]&&l[r];if(!n&&o)return o(t,!0);if(i)return i(t,!0);if(a&&"string"==typeof t)return a(t);var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}d.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},d.cache={};var c=u[t]=new f.Module(t);e[t][0].call(c.exports,d,c,c.exports,this)}return u[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=u,f.parent=i,f.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(f,"root",{get:function(){return l[r]}}),l[r]=f;for(var s=0;s<t.length;s++)f(t[s]);if(n){var c=f(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd&&define(function(){return c})}}({"34JKw":[function(e,t,n){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",function(){return i});var o=e("bundle-text:./image.svg"),l=r.interopDefault(o);function i(e){return function(t){r=(n=t.constructor).version,(0,n.utils.errorHandle)((o=r.split(".").map(Number))[0]+o[1]/100>=5,"Artplayer.js@".concat(r," is not compatible the artplayerPluginHlsQuality@").concat(i.version,". Please update it to version Artplayer.js@5.x.x"));var n,r,o,u=t.template.$video,a=t.constructor.utils.errorHandle;function f(){var n=t.hls||window.hls;a(n&&n.media===u,'Cannot find instance of HLS from "art.hls" or "window.hls"');var r=e.auto||"Auto",o=e.title||"Quality",i=e.getResolution||function(e){return(e.height||"Unknown ")+"P"},f=n.levels[n.currentLevel],s=f?i(f):r;e.control&&t.controls.update({name:"hls-quality",position:"right",html:s,style:{padding:"0 10px"},selector:n.levels.map(function(e,t){return{html:i(e),level:e.level||t,default:f===e}}),onSelect:function(e){return n.currentLevel=e.level,t.loading.show=!0,e.html}}),e.setting&&t.setting.update({name:"hls-quality",tooltip:s,html:o,icon:l.default,width:200,selector:n.levels.map(function(e,t){return{html:i(e),level:e.level||t,default:f===e}}),onSelect:function(e){return n.currentLevel=e.level,t.loading.show=!0,e.html}})}return t.on("ready",f),t.on("restart",f),{name:"artplayerPluginHlsQuality"}}}"undefined"!=typeof window&&(window.artplayerPluginHlsQuality=i)},{"bundle-text:./image.svg":"jPEUe","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],jPEUe:[function(e,t,n){t.exports='<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M870.4 176H153.6c-49.472 0-89.6 40.128-89.6 89.6v492.736c0 49.472 40.128 89.6 89.6 89.6h716.8c49.472 0 89.6-40.128 89.6-89.6V265.6c0-49.472-40.128-89.6-89.6-89.6zm0 492.8h-44.8s-29.696-65.792-89.6-89.6-134.4 89.6-134.4 89.6-66.56-71.808-134.4-224S153.6 624 153.6 624V265.6h716.8v403.2zM668.8 489.6c37.056 0 67.2-30.144 67.2-67.264 0-37.056-30.144-67.2-67.2-67.2-37.12.064-67.2 30.208-67.2 67.264 0 37.12 30.08 67.2 67.2 67.2z" fill="#fff"/></svg>'},{}],iWrD0:[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["34JKw"],"34JKw","parcelRequire4dc0");
|
||||
@@ -1,253 +0,0 @@
|
||||
// modules are defined as an array
|
||||
// [ module function, map of requires ]
|
||||
//
|
||||
// map of requires is short require name -> numeric require
|
||||
//
|
||||
// anything defined in a previous bundle is accessed via the
|
||||
// orig method which is the require for previous bundles
|
||||
|
||||
(function (modules, entry, mainEntry, parcelRequireName, globalName) {
|
||||
/* eslint-disable no-undef */
|
||||
var globalObject =
|
||||
typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: typeof self !== 'undefined'
|
||||
? self
|
||||
: typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof global !== 'undefined'
|
||||
? global
|
||||
: {};
|
||||
/* eslint-enable no-undef */
|
||||
|
||||
// Save the require from previous bundle to this closure if any
|
||||
var previousRequire =
|
||||
typeof globalObject[parcelRequireName] === 'function' &&
|
||||
globalObject[parcelRequireName];
|
||||
|
||||
var cache = previousRequire.cache || {};
|
||||
// Do not use `require` to prevent Webpack from trying to bundle this call
|
||||
var nodeRequire =
|
||||
typeof module !== 'undefined' &&
|
||||
typeof module.require === 'function' &&
|
||||
module.require.bind(module);
|
||||
|
||||
function newRequire(name, jumped) {
|
||||
if (!cache[name]) {
|
||||
if (!modules[name]) {
|
||||
// if we cannot find the module within our internal map or
|
||||
// cache jump to the current global require ie. the last bundle
|
||||
// that was added to the page.
|
||||
var currentRequire =
|
||||
typeof globalObject[parcelRequireName] === 'function' &&
|
||||
globalObject[parcelRequireName];
|
||||
if (!jumped && currentRequire) {
|
||||
return currentRequire(name, true);
|
||||
}
|
||||
|
||||
// If there are other bundles on this page the require from the
|
||||
// previous one is saved to 'previousRequire'. Repeat this as
|
||||
// many times as there are bundles until the module is found or
|
||||
// we exhaust the require chain.
|
||||
if (previousRequire) {
|
||||
return previousRequire(name, true);
|
||||
}
|
||||
|
||||
// Try the node require function if it exists.
|
||||
if (nodeRequire && typeof name === 'string') {
|
||||
return nodeRequire(name);
|
||||
}
|
||||
|
||||
var err = new Error("Cannot find module '" + name + "'");
|
||||
err.code = 'MODULE_NOT_FOUND';
|
||||
throw err;
|
||||
}
|
||||
|
||||
localRequire.resolve = resolve;
|
||||
localRequire.cache = {};
|
||||
|
||||
var module = (cache[name] = new newRequire.Module(name));
|
||||
|
||||
modules[name][0].call(
|
||||
module.exports,
|
||||
localRequire,
|
||||
module,
|
||||
module.exports,
|
||||
this
|
||||
);
|
||||
}
|
||||
|
||||
return cache[name].exports;
|
||||
|
||||
function localRequire(x) {
|
||||
var res = localRequire.resolve(x);
|
||||
return res === false ? {} : newRequire(res);
|
||||
}
|
||||
|
||||
function resolve(x) {
|
||||
var id = modules[name][1][x];
|
||||
return id != null ? id : x;
|
||||
}
|
||||
}
|
||||
|
||||
function Module(moduleName) {
|
||||
this.id = moduleName;
|
||||
this.bundle = newRequire;
|
||||
this.exports = {};
|
||||
}
|
||||
|
||||
newRequire.isParcelRequire = true;
|
||||
newRequire.Module = Module;
|
||||
newRequire.modules = modules;
|
||||
newRequire.cache = cache;
|
||||
newRequire.parent = previousRequire;
|
||||
newRequire.register = function (id, exports) {
|
||||
modules[id] = [
|
||||
function (require, module) {
|
||||
module.exports = exports;
|
||||
},
|
||||
{},
|
||||
];
|
||||
};
|
||||
|
||||
Object.defineProperty(newRequire, 'root', {
|
||||
get: function () {
|
||||
return globalObject[parcelRequireName];
|
||||
},
|
||||
});
|
||||
|
||||
globalObject[parcelRequireName] = newRequire;
|
||||
|
||||
for (var i = 0; i < entry.length; i++) {
|
||||
newRequire(entry[i]);
|
||||
}
|
||||
|
||||
if (mainEntry) {
|
||||
// Expose entry point to Node, AMD or browser globals
|
||||
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
|
||||
var mainExports = newRequire(mainEntry);
|
||||
|
||||
// CommonJS
|
||||
if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
module.exports = mainExports;
|
||||
|
||||
// RequireJS
|
||||
} else if (typeof define === 'function' && define.amd) {
|
||||
define(function () {
|
||||
return mainExports;
|
||||
});
|
||||
|
||||
// <script>
|
||||
} else if (globalName) {
|
||||
this[globalName] = mainExports;
|
||||
}
|
||||
}
|
||||
})({"hMiLQ":[function(require,module,exports) {
|
||||
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
||||
parcelHelpers.defineInteropFlag(exports);
|
||||
parcelHelpers.export(exports, "default", ()=>artplayerPluginHlsQuality);
|
||||
var _qualitySvg = require("bundle-text:./quality.svg");
|
||||
var _qualitySvgDefault = parcelHelpers.interopDefault(_qualitySvg);
|
||||
function artplayerPluginHlsQuality(option) {
|
||||
return (art)=>{
|
||||
const { $video } = art.template;
|
||||
const { errorHandle } = art.constructor.utils;
|
||||
function updateQuality(hls) {
|
||||
const auto = option.auto || "Auto";
|
||||
const title = option.title || "Quality";
|
||||
const getResolution = option.getResolution || ((level)=>(level.height || "Unknown ") + "P");
|
||||
const defaultLevel = hls.levels[hls.currentLevel];
|
||||
const defaultHtml = defaultLevel ? getResolution(defaultLevel) : auto;
|
||||
const selector = hls.levels.map((item, index)=>{
|
||||
return {
|
||||
html: getResolution(item),
|
||||
level: item.level || index,
|
||||
default: defaultLevel === item
|
||||
};
|
||||
}).sort((a, b)=>b.level - a.level);
|
||||
selector.push({
|
||||
html: auto,
|
||||
level: -1,
|
||||
default: defaultLevel === -1
|
||||
});
|
||||
const onSelect = (item)=>{
|
||||
hls.currentLevel = item.level;
|
||||
art.loading.show = true;
|
||||
art.notice.show = `${title}: ${item.html}`;
|
||||
return item.html;
|
||||
};
|
||||
if (option.control) art.controls.update({
|
||||
name: "hls-quality",
|
||||
position: "right",
|
||||
html: defaultHtml,
|
||||
style: {
|
||||
padding: "0 10px"
|
||||
},
|
||||
selector: selector,
|
||||
onSelect: onSelect
|
||||
});
|
||||
if (option.setting) art.setting.update({
|
||||
name: "hls-quality",
|
||||
tooltip: defaultHtml,
|
||||
html: title,
|
||||
icon: (0, _qualitySvgDefault.default),
|
||||
width: 200,
|
||||
selector: selector,
|
||||
onSelect: onSelect
|
||||
});
|
||||
}
|
||||
function updateAudio(hls) {
|
||||
//
|
||||
}
|
||||
function update() {
|
||||
const hls = art.hls || window.hls;
|
||||
errorHandle(hls && hls.media === $video, 'Cannot find instance of HLS from "art.hls" or "window.hls"');
|
||||
updateQuality(hls);
|
||||
updateAudio(hls);
|
||||
}
|
||||
art.on("ready", update);
|
||||
art.on("restart", update);
|
||||
return {
|
||||
name: "artplayerPluginHlsQuality",
|
||||
update
|
||||
};
|
||||
};
|
||||
}
|
||||
if (typeof window !== "undefined") window["artplayerPluginHlsQuality"] = artplayerPluginHlsQuality;
|
||||
|
||||
},{"@parcel/transformer-js/src/esmodule-helpers.js":"5dUr6","bundle-text:./quality.svg":"b53kH"}],"5dUr6":[function(require,module,exports) {
|
||||
exports.interopDefault = function(a) {
|
||||
return a && a.__esModule ? a : {
|
||||
default: a
|
||||
};
|
||||
};
|
||||
exports.defineInteropFlag = function(a) {
|
||||
Object.defineProperty(a, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
};
|
||||
exports.exportAll = function(source, dest) {
|
||||
Object.keys(source).forEach(function(key) {
|
||||
if (key === "default" || key === "__esModule" || Object.prototype.hasOwnProperty.call(dest, key)) return;
|
||||
Object.defineProperty(dest, key, {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return source[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
return dest;
|
||||
};
|
||||
exports.export = function(dest, destName, get) {
|
||||
Object.defineProperty(dest, destName, {
|
||||
enumerable: true,
|
||||
get: get
|
||||
});
|
||||
};
|
||||
|
||||
},{}],"b53kH":[function(require,module,exports) {
|
||||
module.exports = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg t=\"1666857514489\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2580\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24\" height=\"24\"><path d=\"M870.4 176 153.6 176C104.128 176 64 216.128 64 265.6l0 492.736c0 49.472 40.128 89.6 89.6 89.6L870.4 847.936c49.472 0 89.6-40.128 89.6-89.6L960 265.6C960 216.128 919.872 176 870.4 176zM870.4 668.8 825.6 668.8c0 0-29.696-65.792-89.6-89.6s-134.4 89.6-134.4 89.6S535.04 596.992 467.2 444.8C399.36 292.608 153.6 624 153.6 624l0-358.4L870.4 265.6 870.4 668.8zM668.8 489.6c37.056 0 67.2-30.144 67.2-67.264 0-37.056-30.144-67.2-67.2-67.2C631.68 355.2 601.6 385.344 601.6 422.4 601.6 459.52 631.68 489.6 668.8 489.6z\" p-id=\"2581\" fill=\"#ffffff\"></path>\n</svg>";
|
||||
|
||||
},{}]},["hMiLQ"], "hMiLQ", "parcelRequire4dc0")
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAEwB;AAFxB;;AAEe,SAAS,0BAA0B,MAAM;IACpD,OAAO,CAAC;QACJ,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,QAAQ;QAC/B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,WAAW,CAAC,KAAK;QAE7C,SAAS,cAAc,GAAG;YACtB,MAAM,OAAO,OAAO,IAAI,IAAI;YAC5B,MAAM,QAAQ,OAAO,KAAK,IAAI;YAE9B,MAAM,gBAAgB,OAAO,aAAa,IAAK,CAAA,CAAC,QAAU,AAAC,CAAA,MAAM,MAAM,IAAI,UAAS,IAAK,GAAE;YAC3F,MAAM,eAAe,IAAI,MAAM,CAAC,IAAI,YAAY,CAAC;YACjD,MAAM,cAAc,eAAe,cAAc,gBAAgB;YAEjE,MAAM,WAAW,IAAI,MAAM,CACtB,GAAG,CAAC,CAAC,MAAM;gBACR,OAAO;oBACH,MAAM,cAAc;oBACpB,OAAO,KAAK,KAAK,IAAI;oBACrB,SAAS,iBAAiB;gBAC9B;YACJ,GACC,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,KAAK,GAAG,EAAE,KAAK;YAErC,SAAS,IAAI,CAAC;gBACV,MAAM;gBACN,OAAO;gBACP,SAAS,iBAAiB;YAC9B;YAEA,MAAM,WAAW,CAAC;gBACd,IAAI,YAAY,GAAG,KAAK,KAAK;gBAC7B,IAAI,OAAO,CAAC,IAAI,GAAG;gBACnB,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC;gBAC1C,OAAO,KAAK,IAAI;YACpB;YAEA,IAAI,OAAO,OAAO,EACd,IAAI,QAAQ,CAAC,MAAM,CAAC;gBAChB,MAAM;gBACN,UAAU;gBACV,MAAM;gBACN,OAAO;oBAAE,SAAS;gBAAS;gBAC3B,UAAU;gBACV,UAAU;YACd;YAGJ,IAAI,OAAO,OAAO,EACd,IAAI,OAAO,CAAC,MAAM,CAAC;gBACf,MAAM;gBACN,SAAS;gBACT,MAAM;gBACN,MAAM,CAAA,GAAA,0BAAQ,AAAD;gBACb,OAAO;gBACP,UAAU;gBACV,UAAU;YACd;QAER;QAEA,SAAS,YAAY,GAAG;QACpB,EAAE;QACN;QAEA,SAAS;YACL,MAAM,MAAM,IAAI,GAAG,IAAI,OAAO,GAAG;YACjC,YAAY,OAAO,IAAI,KAAK,KAAK,QAAQ;YACzC,cAAc;YACd,YAAY;QAChB;QAEA,IAAI,EAAE,CAAC,SAAS;QAChB,IAAI,EAAE,CAAC,WAAW;QAElB,OAAO;YACH,MAAM;YACN;QACJ;IACJ;AACJ;AAEA,IAAI,OAAO,WAAW,aAClB,MAAM,CAAC,4BAA4B,GAAG;;;ACpF1C,QAAQ,cAAc,GAAG,SAAU,CAAC;IAClC,OAAO,KAAK,EAAE,UAAU,GAAG,IAAI;QAAC,SAAS;IAAC;AAC5C;AAEA,QAAQ,iBAAiB,GAAG,SAAU,CAAC;IACrC,OAAO,cAAc,CAAC,GAAG,cAAc;QAAC,OAAO;IAAI;AACrD;AAEA,QAAQ,SAAS,GAAG,SAAU,MAAM,EAAE,IAAI;IACxC,OAAO,IAAI,CAAC,QAAQ,OAAO,CAAC,SAAU,GAAG;QACvC,IACE,QAAQ,aACR,QAAQ,gBACR,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,MAE3C;QAGF,OAAO,cAAc,CAAC,MAAM,KAAK;YAC/B,YAAY;YACZ,KAAK;gBACH,OAAO,MAAM,CAAC,IAAI;YACpB;QACF;IACF;IAEA,OAAO;AACT;AAEA,QAAQ,MAAM,GAAG,SAAU,IAAI,EAAE,QAAQ,EAAE,GAAG;IAC5C,OAAO,cAAc,CAAC,MAAM,UAAU;QACpC,YAAY;QACZ,KAAK;IACP;AACF;;;AClCA,OAAO,OAAO,GAAG","sources":["packages/artplayer-plugin-hls-quality/src/index.js","node_modules/@parcel/transformer-js/src/esmodule-helpers.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-5cc0713c043de59f.js"],"sourcesContent":["import $quality from 'bundle-text:./quality.svg';\n\nexport default function artplayerPluginHlsQuality(option) {\n return (art) => {\n const { $video } = art.template;\n const { errorHandle } = art.constructor.utils;\n\n function updateQuality(hls) {\n const auto = option.auto || 'Auto';\n const title = option.title || 'Quality';\n\n const getResolution = option.getResolution || ((level) => (level.height || 'Unknown ') + 'P');\n const defaultLevel = hls.levels[hls.currentLevel];\n const defaultHtml = defaultLevel ? getResolution(defaultLevel) : auto;\n\n const selector = hls.levels\n .map((item, index) => {\n return {\n html: getResolution(item),\n level: item.level || index,\n default: defaultLevel === item,\n };\n })\n .sort((a, b) => b.level - a.level);\n\n selector.push({\n html: auto,\n level: -1,\n default: defaultLevel === -1,\n });\n\n const onSelect = (item) => {\n hls.currentLevel = item.level;\n art.loading.show = true;\n art.notice.show = `${title}: ${item.html}`;\n return item.html;\n };\n\n if (option.control) {\n art.controls.update({\n name: 'hls-quality',\n position: 'right',\n html: defaultHtml,\n style: { padding: '0 10px' },\n selector: selector,\n onSelect: onSelect,\n });\n }\n\n if (option.setting) {\n art.setting.update({\n name: 'hls-quality',\n tooltip: defaultHtml,\n html: title,\n icon: $quality,\n width: 200,\n selector: selector,\n onSelect: onSelect,\n });\n }\n }\n\n function updateAudio(hls) {\n //\n }\n\n function update() {\n const hls = art.hls || window.hls;\n errorHandle(hls && hls.media === $video, 'Cannot find instance of HLS from \"art.hls\" or \"window.hls\"');\n updateQuality(hls);\n updateAudio(hls);\n }\n\n art.on('ready', update);\n art.on('restart', update);\n\n return {\n Line truncated
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
/*!
|
||||
* artplayer-plugin-hls-control.js v1.0.0
|
||||
* Github: https://github.com/zhw2590582/ArtPlayer
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,o,l){var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof r[o]&&r[o],u=i.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,n){if(!u[t]){if(!e[t]){var l="function"==typeof r[o]&&r[o];if(!n&&l)return l(t,!0);if(i)return i(t,!0);if(a&&"string"==typeof t)return a(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},d.cache={};var f=u[t]=new s.Module(t);e[t][0].call(f.exports,d,f,f.exports,this)}return u[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=u,s.parent=i,s.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(s,"root",{get:function(){return r[o]}}),r[o]=s;for(var c=0;c<t.length;c++)s(t[c]);if(n){var f=s(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=f:"function"==typeof define&&define.amd&&define(function(){return f})}}({haa6A:[function(e,t,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(n),o.export(n,"default",()=>s);var l=e("bundle-text:./quality.svg"),r=o.interopDefault(l),i=e("bundle-text:./audio.svg"),u=o.interopDefault(i);function a(e,t){let n=new Map;return e.filter(e=>{let o=e[t];return void 0===o||!n.has(o)&&n.set(o,1)})}function s(e={}){return t=>{let{$video:n}=t.template,{errorHandle:o}=t.constructor.utils;function l(){o(t.hls?.media===n,'Cannot find instance of HLS from "art.hls"'),function(n){if(!n.levels.length)return;let o=e.quality||{},l=o.auto||"Auto",i=o.title||"Quality",u=o.getName||(e=>e.name||e.height+"P"),s=n.levels[n.currentLevel],c=s?u(s):l,f=a(n.levels.map((e,t)=>({html:u(e,t),value:t,default:n.currentLevel===t})),"html").sort((e,t)=>t.value-e.value);f.push({html:l,value:-1,default:-1===n.currentLevel});let d=e=>(n.currentLevel=e.value,t.loading.show=!0,t.notice.show=`${i}: ${e.html}`,e.html);o.control&&t.controls.update({name:"hls-quality",position:"right",html:c,style:{padding:"0 10px"},selector:f,onSelect:d}),o.setting&&t.setting.update({name:"hls-quality",tooltip:c,html:i,icon:r.default,width:200,selector:f,onSelect:d})}(t.hls),function(n){if(!n.audioTracks.length)return;let o=e.audio||{},l=o.auto||"Auto",r=o.title||"Audio",i=o.getName||(e=>e.name||e.lang||e.language),s=n.audioTracks[n.audioTrack],c=s?i(s):l,f=a(n.audioTracks.map((e,t)=>({html:i(e,t),value:e.id,default:n.audioTrack===e.id})),"html"),d=e=>(n.audioTrack=e.value,t.loading.show=!0,t.notice.show=`${r}: ${e.html}`,e.html);o.control&&t.controls.update({name:"hls-audio",position:"right",html:c,style:{padding:"0 10px"},selector:f,onSelect:d}),o.setting&&t.setting.update({name:"hls-audio",tooltip:c,html:r,icon:u.default,width:200,selector:f,onSelect:d})}(t.hls)}return t.on("ready",l),t.on("restart",l),{name:"artplayerPluginHlsControl",update:l}}}"undefined"!=typeof window&&(window.artplayerPluginHlsControl=s)},{"bundle-text:./quality.svg":"5aI3W","bundle-text:./audio.svg":"kbgg8","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5aI3W":[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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-64V96zm323.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.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'},{}],kbgg8:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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 80z"/></svg>'},{}],"9pCYc":[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["haa6A"],"haa6A","parcelRequire4dc0");
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
/*!
|
||||
* artplayer-plugin-hls-control.js v1.0.0
|
||||
* Github: https://github.com/zhw2590582/ArtPlayer
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,o,r){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof l[o]&&l[o],i=u.cache||{},a="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,n){if(!i[t]){if(!e[t]){var r="function"==typeof l[o]&&l[o];if(!n&&r)return r(t,!0);if(u)return u(t,!0);if(a&&"string"==typeof t)return a(t);var f=Error("Cannot find module '"+t+"'");throw f.code="MODULE_NOT_FOUND",f}s.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},s.cache={};var d=i[t]=new c.Module(t);e[t][0].call(d.exports,s,d,d.exports,this)}return i[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=i,c.parent=u,c.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(c,"root",{get:function(){return l[o]}}),l[o]=c;for(var f=0;f<t.length;f++)c(t[f]);if(n){var d=c(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define&&define.amd&&define(function(){return d})}}({"6nh0Z":[function(e,t,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(n),o.export(n,"default",function(){return c});var r=e("bundle-text:./quality.svg"),l=o.interopDefault(r),u=e("bundle-text:./audio.svg"),i=o.interopDefault(u);function a(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 c(){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?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",i=o.getName||function(e){return e.name||e.height+"P"},c=n.levels[n.currentLevel],f=c?i(c):r,d=a(n.levels.map(function(e,t){return{html:i(e,t),value:t,default:n.currentLevel===t}}),"html").sort(function(e,t){return t.value-e.value});d.push({html:r,value:-1,default:-1===n.currentLevel});var s=function(e){return n.currentLevel=e.value,t.loading.show=!0,t.notice.show="".concat(u,": ").concat(e.html),e.html};o.control&&t.controls.update({name:"hls-quality",position:"right",html:f,style:{padding:"0 10px"},selector:d,onSelect:s}),o.setting&&t.setting.update({name:"hls-quality",tooltip:f,html:u,icon:l.default,width:200,selector:d,onSelect:s})}}(t.hls),function(n){if(n.audioTracks.length){var o=e.audio||{},r=o.auto||"Auto",l=o.title||"Audio",u=o.getName||function(e){return e.name||e.lang||e.language},c=n.audioTracks[n.audioTrack],f=c?u(c):r,d=a(n.audioTracks.map(function(e,t){return{html:u(e,t),value:e.id,default:n.audioTrack===e.id}}),"html"),s=function(e){return n.audioTrack=e.value,t.loading.show=!0,t.notice.show="".concat(l,": ").concat(e.html),e.html};o.control&&t.controls.update({name:"hls-audio",position:"right",html:f,style:{padding:"0 10px"},selector:d,onSelect:s}),o.setting&&t.setting.update({name:"hls-audio",tooltip:f,html:l,icon:i.default,width:200,selector:d,onSelect:s})}}(t.hls)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginHlsControl",update:r}}}"undefined"!=typeof window&&(window.artplayerPluginHlsControl=c)},{"bundle-text:./quality.svg":"ghIYQ","bundle-text:./audio.svg":"cPSEW","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],ghIYQ:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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-64V96zm323.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.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'},{}],cPSEW:[function(e,t,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><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 80z"/></svg>'},{}],iWrD0:[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["6nh0Z"],"6nh0Z","parcelRequire4dc0");
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"license": "MIT",
|
||||
"version": "3.0.0",
|
||||
"version": "1.0.0",
|
||||
"name": "artplayer-plugin-hls-control",
|
||||
"types": "types/artplayer-plugin-hls-control.d.ts",
|
||||
"description": "Iframe plugin for ArtPlayer",
|
||||
|
||||
Reference in new issue
Block a user