feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin with code examples.
- Added comprehensive i18n setup instructions, including default language settings, language imports, and examples for adding and modifying languages.
- Updated the structure and content of the i18n documentation to enhance clarity and usability.
This commit is contained in:
Harvey Zack committed 2025-09-06 13:48:25 +08:00
1 parent 18475f08fd
commit 5b1cebb334
82 files changed
+268 -174

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer.js v5.3.0-beta.3
* artplayer.js v5.3.0-beta.5
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,a,o,i,n,s){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof l[a]&&l[a],p=c.i||{},u=c.cache||{},d="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!u[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof l[a]&&l[a];if(!r&&i)return i(t,!0);if(c)return c(t,!0);if(d&&"string"==typeof t)return d(t);var n=Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}p.resolve=function(r){var a=e[t][1][r];return null!=a?a:r},p.cache={};var s=u[t]=new f.Module(t);e[t][0].call(s.exports,p,s,s.exports,l)}return u[t].exports;function p(e){var t=p.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=d,this.exports={}},f.modules=e,f.cache=u,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=p,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return l[a]}}),l[a]=f;for(var h=0;h<t.length;h++)f(t[h]);if(r){var m=f(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({esqvp:[function(e,t,r,a){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r);var i=e("bundle-text:./style/index.less"),n=o.interopDefault(i),s=e("option-validator"),l=o.interopDefault(s),c=e("../package.json"),p=e("./config"),u=o.interopDefault(p),d=e("./contextmenu"),f=o.interopDefault(d),h=e("./control"),m=o.interopDefault(h),g=e("./events"),v=o.interopDefault(g),y=e("./hotkey"),b=o.interopDefault(y),x=e("./i18n"),w=o.interopDefault(x),j=e("./icons"),k=o.interopDefault(j),E=e("./info"),S=o.interopDefault(E),$=e("./layer"),M=o.interopDefault($),I=e("./loading"),T=o.interopDefault(I),C=e("./mask"),F=o.interopDefault(C),q=e("./notice"),D=o.interopDefault(q),A=e("./player"),R=o.interopDefault(A),B=e("./plugins"),L=o.interopDefault(B),O=e("./scheme"),P=o.interopDefault(O),z=e("./setting"),X=o.interopDefault(z),V=e("./storage"),_=o.interopDefault(V),H=e("./subtitle"),N=o.interopDefault(H),W=e("./template"),U=o.interopDefault(W),Y=e("./utils"),Z=e("./utils/emitter"),K=o.interopDefault(Z);let G=0,J=[];class Q extends K.default{constructor(e,t){if(super(),!Y.isBrowser)throw Error("Artplayer can only be used in the browser environment");this.id=++G;let r=Y.mergeDeep(Q.option,e);if(r.container=e.container,this.option=(0,l.default)(r,P.default),this.isLock=!1,this.isReady=!1,this.isFocus=!1,this.isInput=!1,this.isRotate=!1,this.isDestroy=!1,this.template=new(0,U.default)(this),this.events=new(0,v.default)(this),this.storage=new(0,_.default)(this),this.icons=new(0,k.default)(this),this.i18n=new(0,w.default)(this),this.notice=new(0,D.default)(this),this.player=new(0,R.default)(this),this.layers=new(0,M.default)(this),this.controls=new(0,m.default)(this),this.contextmenu=new(0,f.default)(this),this.subtitle=new(0,N.default)(this),this.info=new(0,S.default)(this),this.loading=new(0,T.default)(this),this.hotkey=new(0,b.default)(this),this.mask=new(0,F.default)(this),this.setting=new(0,X.default)(this),this.plugins=new(0,L.default)(this),"function"==typeof t&&this.on("ready",()=>t.call(this,this)),Q.DEBUG){let e=e=>console.log(`[ART.${this.id}] -> ${e}`);e(`Version@${Q.version}`);for(let t=0;t<u.default.events.length;t++)this.on(`video:${u.default.events[t]}`,t=>e(`Event@${t.type}`))}J.push(this)}static get instances(){return J}static get version(){return c.version}static get config(){return u.default}static get utils(){return Y}static get scheme(){return P.default}static get Emitter(){return K.default}static get validator(){return l.default}static get kindOf(){return l.default.kindOf}static get html(){return U.default.html}static get option(){return{id:"",container:"#artplayer",url:"",poster:"",type:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,useSSR:!1,playsInline:!0,lock:!1,gesture:!0,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,proxy:void 0,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0,scale:1},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:e=>e},moreVideoAttr:{controls:!1,preload:Y.isSafari?"auto":"metadata"},i18n:{},icons:{},cssVar:{},customType:{},lang:navigator?.language.toLowerCase()}}get proxy(){return this.events.proxy}get query(){return this.template.query}get video(){return this.template.$video}destroy(e=!0){Q.REMOVE_SRC_WHEN_DESTROY&&this.video.removeAttribute("src"),this.events.destroy(),this.template.destroy(e),J.splice(J.indexOf(this),1),this.isDestrLine truncated
!function(e,t,r,a,o,i,n,s){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},c="function"==typeof l[a]&&l[a],p=c.i||{},u=c.cache||{},d="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!u[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof l[a]&&l[a];if(!r&&i)return i(t,!0);if(c)return c(t,!0);if(d&&"string"==typeof t)return d(t);var n=Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}p.resolve=function(r){var a=e[t][1][r];return null!=a?a:r},p.cache={};var s=u[t]=new f.Module(t);e[t][0].call(s.exports,p,s,s.exports,l)}return u[t].exports;function p(e){var t=p.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=d,this.exports={}},f.modules=e,f.cache=u,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=p,f.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(f,"root",{get:function(){return l[a]}}),l[a]=f;for(var h=0;h<t.length;h++)f(t[h]);if(r){var m=f(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m})}}({esqvp:[function(e,t,r,a){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r);var i=e("bundle-text:./style/index.less"),n=o.interopDefault(i),s=e("option-validator"),l=o.interopDefault(s),c=e("../package.json"),p=e("./config"),u=o.interopDefault(p),d=e("./contextmenu"),f=o.interopDefault(d),h=e("./control"),m=o.interopDefault(h),g=e("./events"),v=o.interopDefault(g),y=e("./hotkey"),b=o.interopDefault(y),x=e("./i18n"),w=o.interopDefault(x),j=e("./icons"),k=o.interopDefault(j),E=e("./info"),S=o.interopDefault(E),$=e("./layer"),M=o.interopDefault($),I=e("./loading"),T=o.interopDefault(I),C=e("./mask"),F=o.interopDefault(C),q=e("./notice"),D=o.interopDefault(q),A=e("./player"),R=o.interopDefault(A),B=e("./plugins"),L=o.interopDefault(B),O=e("./scheme"),P=o.interopDefault(O),z=e("./setting"),X=o.interopDefault(z),V=e("./storage"),_=o.interopDefault(V),H=e("./subtitle"),N=o.interopDefault(H),W=e("./template"),U=o.interopDefault(W),Y=e("./utils"),Z=e("./utils/emitter"),K=o.interopDefault(Z);let G=0,J=[];class Q extends K.default{constructor(e,t){if(super(),!Y.isBrowser)throw Error("Artplayer can only be used in the browser environment");this.id=++G;let r=Y.mergeDeep(Q.option,e);if(r.container=e.container,this.option=(0,l.default)(r,P.default),this.isLock=!1,this.isReady=!1,this.isFocus=!1,this.isInput=!1,this.isRotate=!1,this.isDestroy=!1,this.template=new(0,U.default)(this),this.events=new(0,v.default)(this),this.storage=new(0,_.default)(this),this.icons=new(0,k.default)(this),this.i18n=new(0,w.default)(this),this.notice=new(0,D.default)(this),this.player=new(0,R.default)(this),this.layers=new(0,M.default)(this),this.controls=new(0,m.default)(this),this.contextmenu=new(0,f.default)(this),this.subtitle=new(0,N.default)(this),this.info=new(0,S.default)(this),this.loading=new(0,T.default)(this),this.hotkey=new(0,b.default)(this),this.mask=new(0,F.default)(this),this.setting=new(0,X.default)(this),this.plugins=new(0,L.default)(this),"function"==typeof t&&this.on("ready",()=>t.call(this,this)),Q.DEBUG){let e=e=>console.log(`[ART.${this.id}] -> ${e}`);e(`Version@${Q.version}`);for(let t=0;t<u.default.events.length;t++)this.on(`video:${u.default.events[t]}`,t=>e(`Event@${t.type}`))}J.push(this)}static get instances(){return J}static get version(){return c.version}static get config(){return u.default}static get utils(){return Y}static get scheme(){return P.default}static get Emitter(){return K.default}static get validator(){return l.default}static get kindOf(){return l.default.kindOf}static get html(){return U.default.html}static get option(){return{id:"",container:"#artplayer",url:"",poster:"",type:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,useSSR:!1,playsInline:!0,lock:!1,gesture:!0,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,proxy:void 0,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0,scale:1},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:e=>e},moreVideoAttr:{controls:!1,preload:Y.isSafari?"auto":"metadata"},i18n:{},icons:{},cssVar:{},customType:{},lang:navigator?.language.toLowerCase()}}get proxy(){return this.events.proxy}get query(){return this.template.query}get video(){return this.template.$video}destroy(e=!0){Q.REMOVE_SRC_WHEN_DESTROY&&this.video.removeAttribute("src"),this.events.destroy(),this.template.destroy(e),J.splice(J.indexOf(this),1),this.isDestrLine truncated