mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin, detailing its usage and providing code examples. - Added a comprehensive guide for language settings (i18n), including instructions for importing languages, setting default languages, and modifying language options. - Included code snippets for initializing the Artplayer with different languages and examples for adding new languages.
This commit is contained in:
1 parent
c1fe0e2b03
commit
5337f9b075
181 files changed
+1680
-1659
No files matched your search
@@ -5,4 +5,4 @@
|
||||
* (c) 2017-2025 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,n,o,i,c,a){var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof s[n]&&s[n],l=u.i||{},f=u.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof s[n]&&s[n];if(!r&&i)return i(t,!0);if(u)return u(t,!0);if(p&&"string"==typeof t)return p(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}l.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},l.cache={};var a=f[t]=new d.Module(t);e[t][0].call(a.exports,l,a,a.exports,s)}return f[t].exports;function l(e){var t=l.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=u,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=l,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return s[n]}}),s[n]=d;for(var _=0;_<t.length;_++)d(t[_]);if(r){var y=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=y:"function"==typeof define&&define.amd&&define(function(){return y})}}({"1xnGs":[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return a});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),c=e("@swc/helpers/cjs/_ts_generator.cjs");function a(e){var t,r=!1,n=null,o=null,a=function(t,r){var n=e.url||t.option.url,o=new window.chrome.cast.media.MediaInfo(n,e.mimeType||({mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mp3:"audio/mp3",wav:"audio/wav",flv:"video/x-flv",mov:"video/quicktime",avi:"video/x-msvideo",wmv:"video/x-ms-wmv",mpd:"application/dash+xml",m3u8:"application/x-mpegURL"})[n.split("?")[0].split("#")[0].split(".").pop().toLowerCase()]||"application/octet-stream"),i=new window.chrome.cast.media.LoadRequest(o);r.loadMedia(i).then(function(){var r;t.notice.show="Casting started",null==(r=e.onCastStart)||r.call(e)}).catch(function(r){var n;throw t.notice.show="Error casting media",null==(n=e.onError)||n.call(e,r),r})},s=function(e){var t=document.querySelector(".art-icon-cast");if(t)switch(e){case"connected":t.style.color="red";break;case"connecting":case"disconnecting":t.style.color="orange";break;default:t.style.color="white"}};return t=(0,i._)(function(t){return(0,c._)(this,function(u){return t.controls.add({name:"chromecast",position:"right",tooltip:"Chromecast",html:'<i class="art-icon art-icon-cast">'.concat(e.icon||'<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M512 96H64v99c-13-2-26.4-3-40-3H0V96C0 60.7 28.7 32 64 32H512c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H288V456c0-13.6-1-27-3-40H512V96zM24 224c128.1 0 232 103.9 232 232c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM0 344c0-13.3 10.7-24 24-24c75.1 0 136 60.9 136 136c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88c-13.3 0-24-10.7-24-24z"/></svg>',"</i>"),click:(0,i._)(function(){var i,u,l,f,p;return(0,c._)(this,function(c){switch(c.label){case 0:if(r)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,new Promise(function(t,i){var c;window.__onGCastApiAvailable=function(c){if(c){var a=window.cast.framework.CastContext.getInstance();a.setOptions({receiverApplicationId:window.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:window.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),a.addEventListener(window.cast.framework.CastContextEventType.SESSION_STATE_CHANGED,function(t){var r,i,c,a,u,l=window.cast.framework.SessionState;switch(o=t.sessionState,n=t.session,t.sessionState){case l.NO_SESSION:null==(r=e.onStateChange)||r.call(e,"disconnected"),s("disconnected");break;case l.SESSION_STARTING:null==(i=e.onStateChange)||i.call(e,"connecting"),s("connecting");break;case l.SESSION_STARTED:null==(c=e.onStateChange)||c.call(e,"connected"),s("connected");break;case l.SESSION_ENDING:null==(a=e.onStateChange)||a.call(e,"disconnecting"),s("disconnecting");break;case l.SESSION_RESUMED:null==(u=e.onStateChange)||u.call(e,"connected"),s("connected")}}),a.addEventListener(window.cast.framework.CastContextEventType.CAST_STATE_CHANGED,function(t){var r,n,o,i=window.cast.framework.CastState;switch(t.castState){case i.NO_DEVICES_AVAILABLE:null==(r=e.onCastAvailable)||r.call(e,!1);break;case i.NOT_CONNECTED:null==(n=e.onCastAvailable)||n.call(e,!0);break;case i.CONNECTING:case i.CONNECTED:null==(o=e.onCastAvailable)||o.call(e,!0)}}),r=!0,t()}else i(Error("Cast API is not available"))},window.chrome&&window.chrome.cast||(c=e.sdk||"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",new Promise(function(e,t){var r=document.createElement("script");r.src=c,r.onloadLine truncated
|
||||
!function(e,t,r,n,o,i,a,c){var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof s[n]&&s[n],l=u.i||{},f=u.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,r){if(!f[t]){if(!e[t]){if(o[t])return o[t];var i="function"==typeof s[n]&&s[n];if(!r&&i)return i(t,!0);if(u)return u(t,!0);if(p&&"string"==typeof t)return p(t);var a=Error("Cannot find module '"+t+"'");throw a.code="MODULE_NOT_FOUND",a}l.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},l.cache={};var c=f[t]=new d.Module(t);e[t][0].call(c.exports,l,c,c.exports,s)}return f[t].exports;function l(e){var t=l.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.require=p,this.exports={}},d.modules=e,d.cache=f,d.parent=u,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=l,d.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(d,"root",{get:function(){return s[n]}}),s[n]=d;for(var _=0;_<t.length;_++)d(t[_]);if(r){var y=d(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=y:"function"==typeof define&&define.amd&&define(function(){return y})}}({bzF6W:[function(e,t,r,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return c});var i=e("@swc/helpers/cjs/_async_to_generator.cjs"),a=e("@swc/helpers/cjs/_ts_generator.cjs");function c(e){var t,r=!1,n=null,o=null,c=function(t,r){var n=e.url||t.option.url,o=new window.chrome.cast.media.MediaInfo(n,e.mimeType||({mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mp3:"audio/mp3",wav:"audio/wav",flv:"video/x-flv",mov:"video/quicktime",avi:"video/x-msvideo",wmv:"video/x-ms-wmv",mpd:"application/dash+xml",m3u8:"application/x-mpegURL"})[n.split("?")[0].split("#")[0].split(".").pop().toLowerCase()]||"application/octet-stream"),i=new window.chrome.cast.media.LoadRequest(o);r.loadMedia(i).then(function(){var r;t.notice.show="Casting started",null==(r=e.onCastStart)||r.call(e)}).catch(function(r){var n;throw t.notice.show="Error casting media",null==(n=e.onError)||n.call(e,r),r})},s=function(e){var t=document.querySelector(".art-icon-cast");if(t)switch(e){case"connected":t.style.color="red";break;case"connecting":case"disconnecting":t.style.color="orange";break;default:t.style.color="white"}};return t=(0,i._)(function(t){return(0,a._)(this,function(u){return t.controls.add({name:"chromecast",position:"right",tooltip:"Chromecast",html:'<i class="art-icon art-icon-cast">'.concat(e.icon||'<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M512 96H64v99c-13-2-26.4-3-40-3H0V96C0 60.7 28.7 32 64 32H512c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H288V456c0-13.6-1-27-3-40H512V96zM24 224c128.1 0 232 103.9 232 232c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM0 344c0-13.3 10.7-24 24-24c75.1 0 136 60.9 136 136c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88c-13.3 0-24-10.7-24-24z"/></svg>',"</i>"),click:(0,i._)(function(){var i,u,l,f,p;return(0,a._)(this,function(a){switch(a.label){case 0:if(r)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise(function(t,i){var a;window.__onGCastApiAvailable=function(a){if(a){var c=window.cast.framework.CastContext.getInstance();c.setOptions({receiverApplicationId:window.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:window.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),c.addEventListener(window.cast.framework.CastContextEventType.SESSION_STATE_CHANGED,function(t){var r,i,a,c,u,l=window.cast.framework.SessionState;switch(o=t.sessionState,n=t.session,t.sessionState){case l.NO_SESSION:null==(r=e.onStateChange)||r.call(e,"disconnected"),s("disconnected");break;case l.SESSION_STARTING:null==(i=e.onStateChange)||i.call(e,"connecting"),s("connecting");break;case l.SESSION_STARTED:null==(a=e.onStateChange)||a.call(e,"connected"),s("connected");break;case l.SESSION_ENDING:null==(c=e.onStateChange)||c.call(e,"disconnecting"),s("disconnecting");break;case l.SESSION_RESUMED:null==(u=e.onStateChange)||u.call(e,"connected"),s("connected")}}),c.addEventListener(window.cast.framework.CastContextEventType.CAST_STATE_CHANGED,function(t){var r,n,o,i=window.cast.framework.CastState;switch(t.castState){case i.NO_DEVICES_AVAILABLE:null==(r=e.onCastAvailable)||r.call(e,!1);break;case i.NOT_CONNECTED:null==(n=e.onCastAvailable)||n.call(e,!0);break;case i.CONNECTING:case i.CONNECTED:null==(o=e.onCastAvailable)||o.call(e,!0)}}),r=!0,t()}else i(Error("Cast API is not available"))},window.chrome&&window.chrome.cast||(a=e.sdk||"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",new Promise(function(e,t){var r=document.createElement("script");r.src=a,r.onload=eLine truncated
|
||||
Reference in new issue
Block a user