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, including default languages, importing languages, adding new languages, and modifying existing languages.
- Updated the i18n documentation to reflect changes in language handling and provide code snippets for implementation.
This commit is contained in:
Harvey Zack committed 2025-08-31 12:11:13 +08:00
1 parent ddbcdbd459
commit 06c00906c2
58 files changed
+857 -857

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
/*!
* artplayer-plugin-vast.js v1.0.2
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,i,n,r,s,o,a){var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof d[n]&&d[n],h=u.i||{},l=u.cache||{},c="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function f(t,i){if(!l[t]){if(!e[t]){if(r[t])return r[t];var s="function"==typeof d[n]&&d[n];if(!i&&s)return s(t,!0);if(u)return u(t,!0);if(c&&"string"==typeof t)return c(t);var o=Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}h.resolve=function(i){var n=e[t][1][i];return null!=n?n:i},h.cache={};var a=l[t]=new f.Module(t);e[t][0].call(a.exports,h,a,a.exports,d)}return l[t].exports;function h(e){var t=h.resolve(e);return!1===t?{}:f(t)}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.require=c,this.exports={}},f.modules=e,f.cache=l,f.parent=u,f.distDir=void 0,f.publicUrl=void 0,f.devServer=void 0,f.i=h,f.register=function(t,i){e[t]=[function(e,t){t.exports=i},{}]},Object.defineProperty(f,"root",{get:function(){return d[n]}}),d[n]=f;for(var p=0;p<t.length;p++)f(t[p]);if(i){var v=f(i);"object"==typeof exports&&"undefined"!=typeof module?module.exports=v:"function"==typeof define&&define.amd&&define(function(){return v})}}({dwHLV:[function(e,t,i,n){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(i),r.export(i,"default",()=>o);var s=e("@glomex/vast-ima-player");function o(e){return async t=>{let{template:i,constructor:n}=t,{createElement:r,setStyles:o}=n.utils,{$video:a,$player:d}=i;await (0,s.loadImaSdk)();let u=window.google.ima,h=new u.AdsRenderingSettings;h.restoreCustomPlaybackStateOnAdBreakComplete=!0,h.enablePreloading=!0;let l=new(0,s.PlayerOptions),c=!1,f=null,p=null;function v(){return f||(p=function(){let e=r("div");return e.id=`art-vast-${Date.now()}`,o(e,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"150",backgroundColor:"black",display:"none",pointerEvents:"auto"}),e}(),d.appendChild(p),(f=new(0,s.Player)(u,a,p,h,l)).addEventListener("AdStarted",()=>{c=!0,p.style.display="block"}),f.addEventListener("AdComplete",()=>{c=!1,p.style.display="none"}),f.addEventListener("AdError",e=>{console.error("VAST Ad Error:",e.detail),c=!1,p.style.display="none"})),f}return"function"==typeof e&&await e({art:t,playUrl:function(e){if(c)return;f||v();let t=new u.AdsRequest;t.adTagUrl=e,f.playAds(t)},playRes:function(e){if(c)return;f||v();let t=new u.AdsRequest;t.adsResponse=e,f.playAds(t)},ima:u,imaPlayer:f,get container(){return p}}),{name:"artplayerPluginVast",destroy:function(){f?.destroy&&f.destroy(),p?.parentNode&&p.parentNode.removeChild(p),p=null,f=null}}}}"undefined"!=typeof window&&(window.artplayerPluginVast=o)},{"@glomex/vast-ima-player":"edhqb","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],edhqb:[function(e,t,i,n){var r,s,o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(i),o.export(i,"Player",()=>eu),o.export(i,"PlayerError",()=>j),o.export(i,"PlayerEvent",()=>L),o.export(i,"PlayerOptions",()=>M),o.export(i,"loadImaSdk",()=>u);var a=null,d=function(){a=null},u=function(){var e=window;return e.google&&e.google.ima?Promise.resolve(e.google.ima):a||((a=new Promise(function(e,t){var i=document.createElement("script");i.async=!0,i.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",i.onload=e,i.onerror=t,document.body.appendChild(i)}).then(function(){return e.google.ima})).then(d).catch(d),a)};function h(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,i){return t&&h(e.prototype,t),i&&h(e,i),e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function f(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,v(e,t)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t,i){return(y=!function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&v(r,i.prototype),r}:Reflect.construct).apply(null,arguments)}function E(e){var t="function"==typeof Map?new Map:void 0;return(E=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return y(eLine truncated