mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
Refactor utility functions for improved readability and consistency - Updated compatibility.js to use consistent line endings and formatting. - Refactored component.js for better readability and structure, including consistent use of arrow functions and binding. - Simplified dom.js functions with consistent formatting and improved readability. - Enhanced emitter.js with consistent formatting and arrow function usage. - Streamlined error.js for improved readability and consistency. - Refactored file.js to use consistent formatting and improved readability. - Improved format.js functions for better readability and consistency. - Updated index.js to maintain consistent export formatting. - Refactored property.js for improved readability and consistency. - Enhanced subtitle.js with consistent formatting and improved readability. - Refactored time.js for better readability and consistent formatting. fix: update lint script to target only source files for consistency Revert "fix: restore export statements for various plugins and update type definitions for better clarity" This reverts commit b5e969d81ec765cd8a34b06e6ef4f232ef25087f. fix: restore export statements for various plugins and update type definitions for better clarity Refactor type definitions to use interfaces instead of type aliases for better extensibility and clarity across i18n, icons, option, player, quality, setting, subtitle, template, and utils modules.
8 lines
5.0 KiB
JavaScript
8 lines
5.0 KiB
JavaScript
|
|
/*!
|
|
* artplayer-plugin-hls-control.js v1.0.1
|
|
* Github: https://github.com/zhw2590582/ArtPlayer
|
|
* (c) 2017-2025 Harvey Zack
|
|
* Released under the MIT License.
|
|
*/
|
|
!function(e,t,n,o,r,l,i,u){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[o]&&a[o],d=s.i||{},c=s.cache||{},f="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!c[t]){if(!e[t]){if(r[t])return r[t];var l="function"==typeof a[o]&&a[o];if(!n&&l)return l(t,!0);if(s)return s(t,!0);if(f&&"string"==typeof t)return f(t);var i=Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}d.resolve=function(n){var o=e[t][1][n];return null!=o?o:n},d.cache={};var u=c[t]=new p.Module(t);e[t][0].call(u.exports,d,u,u.exports,a)}return c[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=f,this.exports={}},p.modules=e,p.cache=c,p.parent=s,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=d,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 g=p(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=g:"function"==typeof define&&define.amd&&define(function(){return g})}}({dHVos:[function(e,t,n,o){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",()=>d);var l=e("bundle-text:./audio.svg"),i=r.interopDefault(l),u=e("bundle-text:./quality.svg"),a=r.interopDefault(u);function s(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 d(e={}){return t=>{let{$video:n}=t.template,{errorHandle:o}=t.constructor.utils;function r(){o(t.hls?.media===n,'Cannot find instance of HLS from "art.hls"'),function(n){if(!n.levels.length)return;let o=e.quality||{},r=o.auto||"Auto",l=o.title||"Quality",i=o.getName||(e=>e.name||`${e.height}P`),u=n.levels[n.currentLevel],d=u?i(u):r,c=s(n.levels.map((e,t)=>({html:i(e,t),value:t,default:n.currentLevel===t})),"html").sort((e,t)=>t.value-e.value);c.push({html:r,value:-1,default:-1===n.currentLevel});let f=e=>(n.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:d,style:{padding:"0 10px"},selector:c,onSelect:f}),o.setting&&t.setting.update({name:"hls-quality",tooltip:d,html:l,icon:a.default,width:200,selector:c,onSelect:f})}(t.hls),function(n){if(!n.audioTracks.length)return;let o=e.audio||{},r=o.auto||"Auto",l=o.title||"Audio",u=o.getName||(e=>e.name||e.lang||e.language),a=n.audioTracks[n.audioTrack],d=a?u(a):r,c=s(n.audioTracks.map((e,t)=>({html:u(e,t),value:e.id,default:n.audioTrack===e.id})),"html"),f=e=>(n.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:d,style:{padding:"0 10px"},selector:c,onSelect:f}),o.setting&&t.setting.update({name:"hls-audio",tooltip:d,html:l,icon:i.default,width:200,selector:c,onSelect:f})}(t.hls)}return t.on("ready",r),t.on("restart",r),{name:"artplayerPluginHlsControl",update:r}}}"undefined"!=typeof window&&(window.artplayerPluginHlsControl=d)},{"bundle-text:./audio.svg":"kni09","bundle-text:./quality.svg":"jbawI","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],kni09:[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>'},{}],jbawI:[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.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,n,o){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})}},{}]},["dHVos"],"dHVos","parcelRequire4dc0",{}); |