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-vtt-thumbnail.js v1.0.3
* artplayer-plugin-vtt-thumbnail.js v1.0.4
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2026 Harvey Zhao
* Released under the MIT License.
*/
!function(e,t,r,n,o){var l="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},i="function"==typeof l[n]&&l[n],u=i.i||{},a=i.cache||{},f="u">typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!a[t]){if(!e[t]){if(o[t])return o[t];var u="function"==typeof l[n]&&l[n];if(!r&&u)return u(t,!0);if(i)return i(t,!0);if(f&&"string"==typeof t)return f(t);var d=Error("Cannot find module '"+t+"'");throw d.code="MODULE_NOT_FOUND",d}p.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},p.cache={};var s=a[t]=new c.Module(t);e[t][0].call(s.exports,p,s,s.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],n=e[1],o=e[2]||e[0],l=c(n);"*"===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]}})}):"*"===o?Object.defineProperty(r,t,{enumerable:!0,value:l}):Object.defineProperty(r,t,{enumerable:!0,get:function(){return"default"===o?l.__esModule?l.default:l:l[o]}})}),r}return c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.require=f,this.exports={}},c.modules=e,c.cache=a,c.parent=i,c.distDir=void 0,c.publicUrl=void 0,c.devServer=void 0,c.i=u,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return l[n]}}),l[n]=c;for(var d=0;d<t.length;d++)c(t[d]);if(r){var s=c(r);"object"==typeof exports&&"u">typeof module?module.exports=s:"function"==typeof define&&define.amd&&define(function(){return s})}}({egVzc:[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",()=>u);var l=e("./getVttArray"),i=o.interopDefault(l);function u(e){return async t=>{let{constructor:{utils:{setStyle:r,isMobile:n,addClass:o}},template:{$progress:l}}=t,u=null,a=await (0,i.default)(e.vtt);return t.controls.add({name:"vtt-thumbnail",position:"top",index:20,style:e.style||{},mounted(e){o(e,"art-control-thumbnails"),t.on("setBar",async(o,i,f)=>{let c="played"===o&&f&&n;if("hover"===o||c){let o=l.clientWidth*i,f=i*t.duration;r(e,"display","flex");let d=a.find(e=>f>=e.start&&f<=e.end);if(!d)return r(e,"display","none");if(o>0&&o<l.clientWidth)r(e,"backgroundImage",`url(${d.url})`),r(e,"height",`${d.h}px`),r(e,"width",`${d.w}px`),r(e,"backgroundPosition",`-${d.x}px -${d.y}px`),o<=d.w/2?r(e,"left",0):o>l.clientWidth-d.w/2?r(e,"left",`${l.clientWidth-d.w}px`):r(e,"left",`${o-d.w/2}px`);else n||r(e,"display","none");c&&(clearTimeout(u),u=setTimeout(()=>{r(e,"display","none")},500))}})}}),{name:"artplayerPluginVttThumbnail"}}}"u">typeof window&&(window.artplayerPluginVttThumbnail=u)},{"./getVttArray":"i9qdo","@parcel/transformer-js/src/esmodule-helpers.js":"loqXi"}],i9qdo:[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");function l(e){var t,r,n;let o=e.split("."),l=o[0].split(":")||[],i=Number((t=o[1]||"0",r=3,n="0",t.length>r?String(t):((r-=t.length)>n.length&&(n+=n.repeat(r/n.length)),String(t)+n.slice(0,r))))/1e3;return 3600*Number(l[l.length-3]||0)+60*Number(l[l.length-2]||0)+Number(l[l.length-1]||0)+i}async function i(e=""){let t=(await (await fetch(e)).text()).split(/[\n\r]/g).filter(e=>e.trim()),r=[];for(let n=1;n<t.length;n+=2){let o=t[n],i=t[n+1];if(!i.trim())continue;let u=/((?:\d{2}:)?(?:\d{2}:)?\d{2}(?:.\d{3})?) ?-->?((?:\d{2}:)?(?:\d{2}:)?\d{2}(?:.\d{3})?)/,a=o.match(u),f=/(.*)#(\w{4})=(.*)/,c=i.match(f),d=Math.floor(l(a[1])),s=Math.floor(l(a[2])),p=c[1];if(!/^\/|(?:https?|ftp|file):\/\//i.test(p)){let t=e.split("/");t.pop(),t.push(p),p=t.join("/")}let h={start:d,end:s,url:p},y=c[2].split(""),m=c[3].split(",");for(let e=0;e<y.length;e++)h[y[e]]=m[e];r.push(h)}return r}o.defineInteropFlag(r),o.export(r,"default",()=>i)},{"@parcel/transformer-js/src/esmodule-helpers.js":"loqXi"}],loqXi:[function(e,t,r,n){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.exportAll=function(e,t){return Object.keys(e).forEach(function(r){"default"===r||"__esModule"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),t},r.export=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:r})}},{}]},["egVzc"],"egVzc","parcelRequire4dc0",{});let{default:e}=parcelRequire4dc0("egVzc");export{e as default};
function t(t){const n=t.split("."),e=n[0].split(":")||[],i=(l=n[1]||"0",o=3,r="0",l.length>o?String(l):((o-=l.length)>r.length&&(r+=r.repeat(o/r.length)),String(l)+r.slice(0,o)));var l,o,r;const s=Number(i)/1e3;return 3600*Number(e[e.length-3]||0)+60*Number(e[e.length-2]||0)+Number(e[e.length-1]||0)+s}function n(n){return async e=>{const{constructor:{utils:{setStyle:i,isMobile:l,addClass:o}},template:{$progress:r}}=e;let s=null;const a=await async function(n=""){const e=(await(await fetch(n)).text()).split(/[\n\r]/g).filter(t=>t.trim()),i=[];for(let l=1;l<e.length;l+=2){const o=e[l],r=e[l+1];if(!r.trim())continue;const s=/((?:\d{2}:)?(?:\d{2}:)?\d{2}(?:.\d{3})?) ?--> ?((?:\d{2}:)?(?:\d{2}:)?\d{2}(?:.\d{3})?)/,a=o.match(s),u=/(.*)#(\w{4})=(.*)/,c=r.match(u),d=Math.floor(t(a[1])),p=Math.floor(t(a[2]));let h=c[1];if(!/^\/|(?:https?|ftp|file):\/\//i.test(h)){const t=n.split("/");t.pop(),t.push(h),h=t.join("/")}const f={start:d,end:p,url:h},g=c[2].split(""),m=c[3].split(",");for(let t=0;t<g.length;t++)f[g[t]]=m[t];i.push(f)}return i}(n.vtt);return e.controls.add({name:"vtt-thumbnail",position:"top",index:20,style:n.style||{},mounted(t){o(t,"art-control-thumbnails"),e.on("setBar",async(n,o,u)=>{const c="played"===n&&u&&l;if("hover"===n||c){const n=r.clientWidth*o,u=o*e.duration;i(t,"display","flex");const d=a.find(t=>u>=t.start&&u<=t.end);if(!d)return i(t,"display","none");n>0&&n<r.clientWidth?function(t,n,e){i(t,"backgroundImage",`url(${n.url})`),i(t,"height",`${n.h}px`),i(t,"width",`${n.w}px`),i(t,"backgroundPosition",`-${n.x}px -${n.y}px`),e<=n.w/2?i(t,"left",0):e>r.clientWidth-n.w/2?i(t,"left",r.clientWidth-n.w+"px"):i(t,"left",e-n.w/2+"px")}(t,d,n):l||i(t,"display","none"),c&&(clearTimeout(s),s=setTimeout(()=>{i(t,"display","none")},500))}})}}),{name:"artplayerPluginVttThumbnail"}}}"undefined"!==typeof window&&(window.artplayerPluginVttThumbnail=n);export{n as default};