feat: update changelog with Parcel to Vite refactor

feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin with code examples.
- Added a comprehensive guide for language settings (i18n) including default languages, importing languages, adding new languages, and modifying existing languages.
- Included code snippets for initializing the Artplayer with different language settings.

Add internationalization support for multiple languages in Artplayer

- Introduced Arabic (ar), Czech (cs), Spanish (es), Persian (fa), French (fr), Indonesian (id), Polish (pl), Russian (ru), Turkish (tr), Vietnamese (vi), and Traditional Chinese (zh-tw) translations.
- Created corresponding JavaScript and ES module files for each language containing translated strings for player controls and settings.
- Added a new documentation file for language settings in the project.

feat: add initial implementation of start option page with interactive code execution buttons

feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin, providing code examples for usage.
- Added a comprehensive guide for language settings, including default languages, importing languages, adding new languages, and modifying existing languages.
- Included code snippets for initializing the Artplayer with different language settings and importing language files.

refactor: update danmuku worker implementation and remove unused i18n files

- Changed the way the Danmuku class creates a Web Worker by using a worker loader instead of creating a blob.
- Removed Arabic, Czech, Spanish, Persian, French, Indonesian, Polish, Russian, Turkish, Vietnamese, and Traditional Chinese i18n files as they are no longer needed.
- Updated the Vite build configuration to disable banners for inline workers and added a plugin to remove worker banners from generated code.

feat: add danmuku plugin and i18n setup documentation

- Created a new documentation file for the danmuku plugin, providing code examples for usage.
- Added a new documentation file for language settings (i18n), detailing how to set default languages, import languages, and add new languages.
- Included code snippets for initializing the Artplayer with different language settings and examples for modifying existing languages.

feat: add danmuku plugin and i18n setup documentation

- Created a new documentation file for the danmuku plugin with code examples.
- Added a new documentation file for language settings (i18n) including import instructions and examples for setting default and custom languages.
- Updated the i18n documentation to include details on adding and modifying languages.

feat: add danmuku plugin and i18n setup documentation

- Created a new JavaScript file for the danmuku plugin documentation with multiple code execution buttons.
- Added a new JavaScript file for i18n (internationalization) setup documentation, including instructions for language settings, importing languages, and modifying language options.
- Included examples for setting default languages and adding new languages in the i18n documentation.

Refactor code structure for improved readability and maintainability
This commit is contained in:
Harvey Zhao committed 2026-03-07 15:21:34 +08:00
1 parent ddb78cf850
commit 699bf09577
397 files changed
+99776 -8638

No files matched your search

@@ -1,8 +1,7 @@
/*!
* artplayer-plugin-hls-control.js v1.0.1
* artplayer-plugin-hls-control.js v1.0.2
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2026 Harvey Zhao
* Released under the MIT License.
*/
!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
!function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.ArtplayerPluginHlsControl=e(),define(function(){return t.ArtplayerPluginHlsControl})):(t="undefined"!==typeof globalThis?globalThis:t||self).ArtplayerPluginHlsControl=e()}(this,function(){"use strict";function t(t,e){const l=new Map;return t.filter(t=>{const n=t[e];return void 0===n||!l.has(n)&&l.set(n,1)})}function e(e={}){return l=>{const{$video:n}=l.template,{errorHandle:o}=l.constructor.utils;function i(){o(l.hls?.media===n,'Cannot find instance of HLS from "art.hls"'),function(n){if(!n.levels.length)return;const o=e.quality||{},i=o.auto||"Auto",s=o.title||"Quality",a=o.getName||(t=>t.name||`${t.height}P`),c=n.levels[n.currentLevel],r=c?a(c):i,u=t(n.levels.map((t,e)=>({html:a(t,e),value:e,default:n.currentLevel===e})),"html").sort((t,e)=>e.value-t.value);u.push({html:i,value:-1,default:-1===n.currentLevel});const d=t=>(n.currentLevel=t.value,l.notice.show=`${s}: ${t.html}`,o.control&&l.controls.check(t),o.setting&&l.setting.check(t),t.html);o.control&&l.controls.update({name:"hls-quality",position:"right",html:r,style:{padding:"0 10px"},selector:u,onSelect:d}),o.setting&&l.setting.update({name:"hls-quality",tooltip:r,html:s,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="18"><path fill="#fff" d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-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.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.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>',width:200,selector:u,onSelect:d})}(l.hls),function(n){if(!n.audioTracks.length)return;const o=e.audio||{},i=o.auto||"Auto",s=o.title||"Audio",a=o.getName||(t=>t.name||t.lang||t.language),c=n.audioTracks[n.audioTrack],r=c?a(c):i,u=t(n.audioTracks.map((t,e)=>({html:a(t,e),value:t.id,default:n.audioTrack===t.id})),"html"),d=t=>(n.audioTrack=t.value,l.notice.show=`${s}: ${t.html}`,o.control&&l.controls.check(t),o.setting&&l.setting.check(t),t.html);o.control&&l.controls.update({name:"hls-audio",position:"right",html:r,style:{padding:"0 10px"},selector:u,onSelect:d}),o.setting&&l.setting.update({name:"hls-audio",tooltip:r,html:s,icon:'<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-6c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48c-44.2 0-80-35.8-80-80l0-16 0-48 0-48C0 146.6 114.6 32 256 32s256 114.6 256 256l0 48 0 48 0 16c0 44.2-35.8 80-80 80c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48c10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80z"/></svg>',width:200,selector:u,onSelect:d})}(l.hls)}return l.on("ready",i),l.on("restart",i),{name:"artplayerPluginHlsControl",update:i}}}return"undefined"!==typeof window&&(window.artplayerPluginHlsControl=e),e});