mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
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 of the i18n documentation for clarity and usability.
This commit is contained in:
1 parent
40b66b4b68
commit
e8b01c357f
86 files changed
+72
-227
No files matched your search
@@ -5,5 +5,4 @@
|
||||
* (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],d=c.i||{},p=c.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,r){if(!p[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(u&&"string"==typeof t)return u(t);var n=Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}d.resolve=function(r){var a=e[t][1][r];return null!=a?a:r},d.cache={};var s=p[t]=new f.Module(t);e[t][0].call(s.exports,d,s,s.exports,l)}return p[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.require=u,this.exports={}},f.modules=e,f.cache=p,f.parent=c,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=d,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})}}({kXXX5:[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"),d=e("./config"),p=o.interopDefault(d),u=e("./contextmenu"),f=o.interopDefault(u),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),S=e("./info"),$=o.interopDefault(S),I=e("./layer"),M=o.interopDefault(I),E=e("./loading"),T=o.interopDefault(E),C=e("./mask"),F=o.interopDefault(C),A=e("./notice"),D=o.interopDefault(A),R=e("./player"),W=o.interopDefault(R),L=e("./plugins"),P=o.interopDefault(L),O=e("./scheme"),z=o.interopDefault(O),H=e("./setting"),_=o.interopDefault(H),q=e("./storage"),V=o.interopDefault(q),N=e("./subtitle"),Q=o.interopDefault(N),B=e("./template"),U=o.interopDefault(B),Y=e("./utils"),Z=e("./utils/emitter"),X=o.interopDefault(Z);let K=0,G=[];class J extends X.default{constructor(e,t){if(super(),!Y.isBrowser)throw Error("Artplayer can only be used in the browser environment");this.id=++K;let r=Y.mergeDeep(J.option,e);if(r.container=e.container,this.option=(0,l.default)(r,z.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,V.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,W.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,Q.default)(this),this.info=new(0,$.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,_.default)(this),this.plugins=new(0,P.default)(this),"function"==typeof t&&this.on("ready",()=>t.call(this,this)),J.DEBUG){let e=e=>console.log(`[ART.${this.id}] -> ${e}`);e(`Version@${J.version}`);for(let t=0;t<p.default.events.length;t++)this.on(`video:${p.default.events[t]}`,t=>e(`Event@${t.type}`))}G.push(this)}static get instances(){return G}static get version(){return c.version}static get config(){return p.default}static get utils(){return Y}static get scheme(){return z.default}static get Emitter(){return X.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){this.events.destroy(),this.template.destroy(e),G.splice(G.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}r.default=J,J.STYLE=n.default,J.DLine truncated
|
||||
//# sourceMappingURL=artplayer.mjs.map
|
||||
!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"),B=o.interopDefault(A),R=e("./plugins"),L=o.interopDefault(R),P=e("./scheme"),O=o.interopDefault(P),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),Z=e("./utils"),Y=e("./utils/emitter"),K=o.interopDefault(Y);let G=0,J=[];class Q extends K.default{constructor(e,t){if(super(),!Z.isBrowser)throw Error("Artplayer can only be used in the browser environment");this.id=++G;let r=Z.mergeDeep(Q.option,e);if(r.container=e.container,this.option=(0,l.default)(r,O.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,B.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 Z}static get scheme(){return O.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:Z.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){this.events.destroy(),this.template.destroy(e),J.splice(J.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}r.default=Q,Q.STYLE=n.default,Q.DLine truncated
|
||||
Reference in new issue
Block a user