mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41: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
Vendored
+1
-1
@@ -5,5 +5,5 @@
|
||||
* (c) 2017-2025 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,i,r,a,o,s){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof l[i]&&l[i],f=u.i||{},d=u.cache||{},c="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!d[t]){if(!e[t]){if(r[t])return r[t];var a="function"==typeof l[i]&&l[i];if(!n&&a)return a(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}f.resolve=function(n){var i=e[t][1][n];return null!=i?i:n},f.cache={};var s=d[t]=new p.Module(t);e[t][0].call(s.exports,f,s,s.exports,l)}return d[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=c,this.exports={}},p.modules=e,p.cache=d,p.parent=u,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=f,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return l[i]}}),l[i]=p;for(var m=0;m<t.length;m++)p(t[m]);if(n){var g=p(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=g:"function"==typeof define&&define.amd&&define(function(){return g})}}({"3MgS1":[function(e,t,n,i){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",()=>s);var a=e("./parser");async function o(e,{getExt:t,srtToVtt:n,assToVtt:i}){let r=await fetch(e.url),a=await r.arrayBuffer(),o=new TextDecoder(e.encoding||"utf-8").decode(a);switch(e.type||t(e.url)){case"srt":return n(o);case"ass":return i(o);case"vtt":return o;default:return""}}function s({subtitles:e=[]}){return async t=>{let{unescape:n,getExt:i,srtToVtt:r,assToVtt:s}=t.constructor.utils,l=new(0,a.WebVTTParser),u=new(0,a.WebVTTSerializer),f=(await Promise.all(e.map(e=>o(e,{getExt:i,srtToVtt:r,assToVtt:s})))).map((t,n)=>{let i=l.parse(t,"metadata");return i.url=e[n].url,i.name=e[n].name,i}),d="";function c(e=[]){let i=function(e){let t=new(0,a.WebVTTParser)().parse("","metadata");for(let n=0;n<e.length;n++){let i=e[n];if(!i.updated){i.updated=!0;for(let e=0;e<i.cues.length;e++){let t=i.cues[e];for(let e=0;e<t.tree.children.length;e++){let n=t.tree.children[e];n.value=`<div class="art-subtitle-${i.name}">${n.value}</div>`}}}t.cues.push(...i.cues)}return t}(e),r=u.serialize(i.cues);URL.revokeObjectURL(d);let o=URL.createObjectURL(new Blob([r],{type:"text/vtt"}));d=o,t.option.subtitle.escape=!1,t.subtitle.init({...t.option.subtitle,url:o,type:"vtt",onVttLoad:n})}return c(f),{name:"multipleSubtitles",tracks:(e=[])=>c(e.map(e=>f.find(t=>t.name===e))),reset:()=>c(f)}}}"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=s)},{"./parser":"01rPS","@parcel/transformer-js/src/esmodule-helpers.js":"5lQoW"}],"01rPS":[function(e,t,n,i){!function(){var e={direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center"},t=function(t){t||(t={"&":"&","<":"<",">":">","&lrm":"","&rlm":""," ":" "}),this.entities=t,this.parse=function(n,a){n=n.replace(/\0/g,"�");var o=Date.now(),s=0,l=n.split(/\r\n|\r|\n/),u=!1,f=[],d=[],c=[];function p(e,t){c.push({message:e,line:s+1,col:t})}var m=l[s],g=m.length,v="WEBVTT",h=0,b=v.length;for("\uFEFF"===m[0]&&(h=1,b+=1),(g<b||m.indexOf(v)!==0+h||g>b&&" "!==m[b]&&" "!==m[b])&&p('No valid signature. (File needs to start with "WEBVTT".)'),s++;""!=l[s]&&void 0!=l[s];){if(p("No blank line after the signature."),-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}for(;void 0!=l[s];){for(;!u&&""==l[s];)s++;if(!u&&void 0==l[s])break;var T=Object.assign({},e,{id:"",startTime:0,endTime:0,pauseOnExit:!1,direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center",text:"",tree:null}),x=!0;if(-1==l[s].indexOf("--\x3e")){if(T.id=l[s],/^NOTE($|[ \t])/.test(T.id)){for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&p("Cannot have timestamp in a comment."),s++;continue}if(/^STYLE($|[ \t])/.test(T.id)){var y=[],w=!1;for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&(p("Cannot have timestamp in a style block."),w=!0),y.push(l[s]),s++;if(d.length){p("Style blocks cannot appear after the first cue.");continue}w||f.push(y.join("\n"));continue}if(""==l[++s]||void 0==l[s]){p("Cue identifier cannot be standalone.");continue}if(-1==l[s].indexOf("--\x3e")){x=!1,p("Cue identifier needs to be followed by timestamp.");continue}}u=!1;var O=new i(l[s],p),S=0;if(d.length>0&&(S=d[d.length-1].startTime),x&&!O.parse(T,S)){for(T=null,s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}continue}for(s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){p("Blank line missing before cue."),u=!0;break}""!=T.text&&(T.text+="\n"),T.text+=l[s],s++}var P=new r(T.text,p,a,t);T.tree=P.parse(T.startLine truncated
|
||||
!function(e,t,n,i,r,a,o,s){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof l[i]&&l[i],f=u.i||{},d=u.cache||{},c="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!d[t]){if(!e[t]){if(r[t])return r[t];var a="function"==typeof l[i]&&l[i];if(!n&&a)return a(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}f.resolve=function(n){var i=e[t][1][n];return null!=i?i:n},f.cache={};var s=d[t]=new p.Module(t);e[t][0].call(s.exports,f,s,s.exports,l)}return d[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=c,this.exports={}},p.modules=e,p.cache=d,p.parent=u,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=f,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return l[i]}}),l[i]=p;for(var m=0;m<t.length;m++)p(t[m]);if(n){var g=p(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=g:"function"==typeof define&&define.amd&&define(function(){return g})}}({"4omrA":[function(e,t,n,i){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",()=>s);var a=e("./parser");async function o(e,{getExt:t,srtToVtt:n,assToVtt:i}){let r=await fetch(e.url),a=await r.arrayBuffer(),o=new TextDecoder(e.encoding||"utf-8").decode(a);switch(e.type||t(e.url)){case"srt":return n(o);case"ass":return i(o);case"vtt":return o;default:return""}}function s({subtitles:e=[]}){return async t=>{let{unescape:n,getExt:i,srtToVtt:r,assToVtt:s}=t.constructor.utils,l=new(0,a.WebVTTParser),u=new(0,a.WebVTTSerializer),f=(await Promise.all(e.map(e=>o(e,{getExt:i,srtToVtt:r,assToVtt:s})))).map((t,n)=>{let i=l.parse(t,"metadata");return i.url=e[n].url,i.name=e[n].name,i}),d="";function c(e=[]){let i=function(e){let t=new(0,a.WebVTTParser)().parse("","metadata");for(let n=0;n<e.length;n++){let i=e[n];if(!i.updated){i.updated=!0;for(let e=0;e<i.cues.length;e++){let t=i.cues[e];for(let e=0;e<t.tree.children.length;e++){let n=t.tree.children[e];n.value=`<div class="art-subtitle-${i.name}">${n.value}</div>`}}}t.cues.push(...i.cues)}return t}(e),r=u.serialize(i.cues);URL.revokeObjectURL(d);let o=URL.createObjectURL(new Blob([r],{type:"text/vtt"}));d=o,t.option.subtitle.escape=!1,t.subtitle.init({...t.option.subtitle,url:o,type:"vtt",onVttLoad:n})}return c(f),{name:"multipleSubtitles",tracks:(e=[])=>c(e.map(e=>f.find(t=>t.name===e))),reset:()=>c(f)}}}"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=s)},{"./parser":"7NrDJ","@parcel/transformer-js/src/esmodule-helpers.js":"w4pLy"}],"7NrDJ":[function(e,t,n,i){!function(){var e={direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center"},t=function(t){t||(t={"&":"&","<":"<",">":">","&lrm":"","&rlm":""," ":" "}),this.entities=t,this.parse=function(n,a){n=n.replace(/\0/g,"�");var o=Date.now(),s=0,l=n.split(/\r\n|\r|\n/),u=!1,f=[],d=[],c=[];function p(e,t){c.push({message:e,line:s+1,col:t})}var m=l[s],g=m.length,v="WEBVTT",h=0,b=v.length;for("\uFEFF"===m[0]&&(h=1,b+=1),(g<b||m.indexOf(v)!==0+h||g>b&&" "!==m[b]&&" "!==m[b])&&p('No valid signature. (File needs to start with "WEBVTT".)'),s++;""!=l[s]&&void 0!=l[s];){if(p("No blank line after the signature."),-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}for(;void 0!=l[s];){for(;!u&&""==l[s];)s++;if(!u&&void 0==l[s])break;var T=Object.assign({},e,{id:"",startTime:0,endTime:0,pauseOnExit:!1,direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center",text:"",tree:null}),y=!0;if(-1==l[s].indexOf("--\x3e")){if(T.id=l[s],/^NOTE($|[ \t])/.test(T.id)){for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&p("Cannot have timestamp in a comment."),s++;continue}if(/^STYLE($|[ \t])/.test(T.id)){var x=[],w=!1;for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&(p("Cannot have timestamp in a style block."),w=!0),x.push(l[s]),s++;if(d.length){p("Style blocks cannot appear after the first cue.");continue}w||f.push(x.join("\n"));continue}if(""==l[++s]||void 0==l[s]){p("Cue identifier cannot be standalone.");continue}if(-1==l[s].indexOf("--\x3e")){y=!1,p("Cue identifier needs to be followed by timestamp.");continue}}u=!1;var O=new i(l[s],p),P=0;if(d.length>0&&(P=d[d.length-1].startTime),y&&!O.parse(T,P)){for(T=null,s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}continue}for(s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){p("Blank line missing before cue."),u=!0;break}""!=T.text&&(T.text+="\n"),T.text+=l[s],s++}var A=new r(T.text,p,a,t);T.tree=A.parse(T.startLine truncated
|
||||
//# sourceMappingURL=artplayer-plugin-multiple-subtitles.esm.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"mappings":"C,A,S,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,E,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,A,Y,O,C,C,E,E,C,C,E,C,E,E,C,E,C,E,E,E,K,E,C,E,E,A,a,O,Q,A,Y,O,O,O,E,O,O,C,I,C,Q,S,E,C,C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CAAK,CAAC,EAAQ,CAMnB,iBAAiB,IAAI,CAAC,EAAI,EAAE,EAAG,CAG/B,IADA,IACO,AAAkB,IAAlB,CAAK,CAAC,EAAQ,EAAU,AAAkB,KAAA,GAAlB,CAAK,CAAC,EAAQ,EACrC,AAAiC,IAAjC,CAAK,CAAC,EAAQ,CAAC,OAAO,CAAC,WAAc,EAAI,uCAC7C,IAEJ,QACJ,CAGA,GAAI,kBAAkB,IAAI,CAAC,EAAI,EAAE,EAAG,CAChC,IAAI,EAAQ,EAAE,CACV,EAAU,CAAA,EAEd,IADA,IACO,AAAkB,IAAlB,CAAK,CAAC,EAAQ,EAAU,AAAkB,KAAA,GAAlB,CAAK,CAAC,EAAQ,EACJ,IAAjC,CAAK,CAAC,EAAQ,CAAC,OAAO,CAAC,YACvB,EAAI,2CACJ,EAAU,CAAA,GAEd,EAAM,IAAI,CAAC,CAAK,CAAC,EAAQ,EACzB,IAEJ,GAAI,EAAK,MAALine truncated
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
* (c) 2017-2025 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,i,r,a,o,s){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof l[i]&&l[i],f=u.i||{},d=u.cache||{},c="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!d[t]){if(!e[t]){if(r[t])return r[t];var a="function"==typeof l[i]&&l[i];if(!n&&a)return a(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}f.resolve=function(n){var i=e[t][1][n];return null!=i?i:n},f.cache={};var s=d[t]=new p.Module(t);e[t][0].call(s.exports,f,s,s.exports,l)}return d[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=c,this.exports={}},p.modules=e,p.cache=d,p.parent=u,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=f,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return l[i]}}),l[i]=p;for(var m=0;m<t.length;m++)p(t[m]);if(n){var g=p(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=g:"function"==typeof define&&define.amd&&define(function(){return g})}}({bY7Hk:[function(e,t,n,i){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",()=>s);var a=e("./parser");async function o(e,{getExt:t,srtToVtt:n,assToVtt:i}){let r=await fetch(e.url),a=await r.arrayBuffer(),o=new TextDecoder(e.encoding||"utf-8").decode(a);switch(e.type||t(e.url)){case"srt":return n(o);case"ass":return i(o);case"vtt":return o;default:return""}}function s({subtitles:e=[]}){return async t=>{let{unescape:n,getExt:i,srtToVtt:r,assToVtt:s}=t.constructor.utils,l=new(0,a.WebVTTParser),u=new(0,a.WebVTTSerializer),f=(await Promise.all(e.map(e=>o(e,{getExt:i,srtToVtt:r,assToVtt:s})))).map((t,n)=>{let i=l.parse(t,"metadata");return i.url=e[n].url,i.name=e[n].name,i}),d="";function c(e=[]){let i=function(e){let t=new(0,a.WebVTTParser)().parse("","metadata");for(let n=0;n<e.length;n++){let i=e[n];if(!i.updated){i.updated=!0;for(let e=0;e<i.cues.length;e++){let t=i.cues[e];for(let e=0;e<t.tree.children.length;e++){let n=t.tree.children[e];n.value=`<div class="art-subtitle-${i.name}">${n.value}</div>`}}}t.cues.push(...i.cues)}return t}(e),r=u.serialize(i.cues);URL.revokeObjectURL(d);let o=URL.createObjectURL(new Blob([r],{type:"text/vtt"}));d=o,t.option.subtitle.escape=!1,t.subtitle.init({...t.option.subtitle,url:o,type:"vtt",onVttLoad:n})}return c(f),{name:"multipleSubtitles",tracks:(e=[])=>c(e.map(e=>f.find(t=>t.name===e))),reset:()=>c(f)}}}"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=s)},{"./parser":"je6kr","@parcel/transformer-js/src/esmodule-helpers.js":"6ykb1"}],je6kr:[function(e,t,n,i){!function(){var e={direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center"},t=function(t){t||(t={"&":"&","<":"<",">":">","&lrm":"","&rlm":""," ":" "}),this.entities=t,this.parse=function(n,a){n=n.replace(/\0/g,"�");var o=Date.now(),s=0,l=n.split(/\r\n|\r|\n/),u=!1,f=[],d=[],c=[];function p(e,t){c.push({message:e,line:s+1,col:t})}var m=l[s],g=m.length,v="WEBVTT",h=0,b=v.length;for("\uFEFF"===m[0]&&(h=1,b+=1),(g<b||m.indexOf(v)!==0+h||g>b&&" "!==m[b]&&" "!==m[b])&&p('No valid signature. (File needs to start with "WEBVTT".)'),s++;""!=l[s]&&void 0!=l[s];){if(p("No blank line after the signature."),-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}for(;void 0!=l[s];){for(;!u&&""==l[s];)s++;if(!u&&void 0==l[s])break;var T=Object.assign({},e,{id:"",startTime:0,endTime:0,pauseOnExit:!1,direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center",text:"",tree:null}),y=!0;if(-1==l[s].indexOf("--\x3e")){if(T.id=l[s],/^NOTE($|[ \t])/.test(T.id)){for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&p("Cannot have timestamp in a comment."),s++;continue}if(/^STYLE($|[ \t])/.test(T.id)){var x=[],w=!1;for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&(p("Cannot have timestamp in a style block."),w=!0),x.push(l[s]),s++;if(d.length){p("Style blocks cannot appear after the first cue.");continue}w||f.push(x.join("\n"));continue}if(""==l[++s]||void 0==l[s]){p("Cue identifier cannot be standalone.");continue}if(-1==l[s].indexOf("--\x3e")){y=!1,p("Cue identifier needs to be followed by timestamp.");continue}}u=!1;var O=new i(l[s],p),P=0;if(d.length>0&&(P=d[d.length-1].startTime),y&&!O.parse(T,P)){for(T=null,s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}continue}for(s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){p("Blank line missing before cue."),u=!0;break}""!=T.text&&(T.text+="\n"),T.text+=l[s],s++}var j=new r(T.text,p,a,t);T.tree=j.parse(T.startTimeLine truncated
|
||||
!function(e,t,n,i,r,a,o,s){var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof l[i]&&l[i],f=u.i||{},d=u.cache||{},c="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,n){if(!d[t]){if(!e[t]){if(r[t])return r[t];var a="function"==typeof l[i]&&l[i];if(!n&&a)return a(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}f.resolve=function(n){var i=e[t][1][n];return null!=i?i:n},f.cache={};var s=d[t]=new p.Module(t);e[t][0].call(s.exports,f,s,s.exports,l)}return d[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.require=c,this.exports={}},p.modules=e,p.cache=d,p.parent=u,p.distDir=void 0,p.publicUrl=void 0,p.devServer=void 0,p.i=f,p.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(p,"root",{get:function(){return l[i]}}),l[i]=p;for(var m=0;m<t.length;m++)p(t[m]);if(n){var g=p(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=g:"function"==typeof define&&define.amd&&define(function(){return g})}}({jz4E5:[function(e,t,n,i){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n),r.export(n,"default",()=>s);var a=e("./parser");async function o(e,{getExt:t,srtToVtt:n,assToVtt:i}){let r=await fetch(e.url),a=await r.arrayBuffer(),o=new TextDecoder(e.encoding||"utf-8").decode(a);switch(e.type||t(e.url)){case"srt":return n(o);case"ass":return i(o);case"vtt":return o;default:return""}}function s({subtitles:e=[]}){return async t=>{let{unescape:n,getExt:i,srtToVtt:r,assToVtt:s}=t.constructor.utils,l=new(0,a.WebVTTParser),u=new(0,a.WebVTTSerializer),f=(await Promise.all(e.map(e=>o(e,{getExt:i,srtToVtt:r,assToVtt:s})))).map((t,n)=>{let i=l.parse(t,"metadata");return i.url=e[n].url,i.name=e[n].name,i}),d="";function c(e=[]){let i=function(e){let t=new(0,a.WebVTTParser)().parse("","metadata");for(let n=0;n<e.length;n++){let i=e[n];if(!i.updated){i.updated=!0;for(let e=0;e<i.cues.length;e++){let t=i.cues[e];for(let e=0;e<t.tree.children.length;e++){let n=t.tree.children[e];n.value=`<div class="art-subtitle-${i.name}">${n.value}</div>`}}}t.cues.push(...i.cues)}return t}(e),r=u.serialize(i.cues);URL.revokeObjectURL(d);let o=URL.createObjectURL(new Blob([r],{type:"text/vtt"}));d=o,t.option.subtitle.escape=!1,t.subtitle.init({...t.option.subtitle,url:o,type:"vtt",onVttLoad:n})}return c(f),{name:"multipleSubtitles",tracks:(e=[])=>c(e.map(e=>f.find(t=>t.name===e))),reset:()=>c(f)}}}"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=s)},{"./parser":"avlNp","@parcel/transformer-js/src/esmodule-helpers.js":"7o2zS"}],avlNp:[function(e,t,n,i){!function(){var e={direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center"},t=function(t){t||(t={"&":"&","<":"<",">":">","&lrm":"","&rlm":""," ":" "}),this.entities=t,this.parse=function(n,a){n=n.replace(/\0/g,"�");var o=Date.now(),s=0,l=n.split(/\r\n|\r|\n/),u=!1,f=[],d=[],c=[];function p(e,t){c.push({message:e,line:s+1,col:t})}var m=l[s],g=m.length,v="WEBVTT",h=0,b=v.length;for("\uFEFF"===m[0]&&(h=1,b+=1),(g<b||m.indexOf(v)!==0+h||g>b&&" "!==m[b]&&" "!==m[b])&&p('No valid signature. (File needs to start with "WEBVTT".)'),s++;""!=l[s]&&void 0!=l[s];){if(p("No blank line after the signature."),-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}for(;void 0!=l[s];){for(;!u&&""==l[s];)s++;if(!u&&void 0==l[s])break;var T=Object.assign({},e,{id:"",startTime:0,endTime:0,pauseOnExit:!1,direction:"horizontal",snapToLines:!0,linePosition:"auto",lineAlign:"start",textPosition:"auto",positionAlign:"auto",size:100,alignment:"center",text:"",tree:null}),y=!0;if(-1==l[s].indexOf("--\x3e")){if(T.id=l[s],/^NOTE($|[ \t])/.test(T.id)){for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&p("Cannot have timestamp in a comment."),s++;continue}if(/^STYLE($|[ \t])/.test(T.id)){var x=[],w=!1;for(s++;""!=l[s]&&void 0!=l[s];)-1!=l[s].indexOf("--\x3e")&&(p("Cannot have timestamp in a style block."),w=!0),x.push(l[s]),s++;if(d.length){p("Style blocks cannot appear after the first cue.");continue}w||f.push(x.join("\n"));continue}if(""==l[++s]||void 0==l[s]){p("Cue identifier cannot be standalone.");continue}if(-1==l[s].indexOf("--\x3e")){y=!1,p("Cue identifier needs to be followed by timestamp.");continue}}u=!1;var O=new i(l[s],p),j=0;if(d.length>0&&(j=d[d.length-1].startTime),y&&!O.parse(T,j)){for(T=null,s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){u=!0;break}s++}continue}for(s++;""!=l[s]&&void 0!=l[s];){if(-1!=l[s].indexOf("--\x3e")){p("Blank line missing before cue."),u=!0;break}""!=T.text&&(T.text+="\n"),T.text+=l[s],s++}var z=new r(T.text,p,a,t);T.tree=z.parse(T.startTimeLine truncated
|
||||
Vendored
+1
-1
@@ -5,4 +5,4 @@
|
||||
* (c) 2017-2025 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,r,i,o,a,s){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof c[r]&&c[r],f=u.i||{},l=u.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,n){if(!l[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof c[r]&&c[r];if(!n&&o)return o(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}f.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},f.cache={};var s=l[t]=new d.Module(t);e[t][0].call(s.exports,f,s,s.exports,c)}return l[t].exports;function f(e){var t=f.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=l,d.parent=u,d.distDir=void 0,d.publicUrl=void 0,d.devServer=void 0,d.i=f,d.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(d,"root",{get:function(){return c[r]}}),c[r]=d;for(var v=0;v<t.length;v++)d(t[v]);if(n){var h=d(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({bNEbP:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(n),i.export(n,"default",function(){return p});var o=e("@swc/helpers/cjs/_async_to_generator.cjs"),a=e("@swc/helpers/cjs/_object_spread.cjs"),s=e("@swc/helpers/cjs/_object_spread_props.cjs"),c=e("@swc/helpers/cjs/_to_consumable_array.cjs"),u=e("@swc/helpers/cjs/_ts_generator.cjs"),f=e("./parser");function l(){return(l=(0,o._)(function(e,t){var n,r,i,o,a;return(0,u._)(this,function(s){switch(s.label){case 0:return n=t.getExt,r=t.srtToVtt,i=t.assToVtt,[4,fetch(e.url)];case 1:return[4,s.sent().arrayBuffer()];case 2:switch(o=s.sent(),a=new TextDecoder(e.encoding||"utf-8").decode(o),e.type||n(e.url)){case"srt":return[2,r(a)];case"ass":return[2,i(a)];case"vtt":return[2,a];default:return[2,""]}}})})).apply(this,arguments)}function p(e){var t,n=e.subtitles,r=void 0===n?[]:n;return t=(0,o._)(function(e){var t,n,i,o,p,d,v,h,m;function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=function(e){for(var t=new(0,f.WebVTTParser)().parse("","metadata"),n=0;n<e.length;n++){var r,i=e[n];if(!i.updated){i.updated=!0;for(var o=0;o<i.cues.length;o++)for(var a=i.cues[o],s=0;s<a.tree.children.length;s++){var u=a.tree.children[s];u.value='<div class="art-subtitle-'.concat(i.name,'">').concat(u.value,"</div>")}}(r=t.cues).push.apply(r,(0,c._)(i.cues))}return t}(t),i=v.serialize(r.cues);URL.revokeObjectURL(m);var o=URL.createObjectURL(new Blob([i],{type:"text/vtt"}));m=o,e.option.subtitle.escape=!1,e.subtitle.init((0,s._)((0,a._)({},e.option.subtitle),{url:o,type:"vtt",onVttLoad:n}))}return(0,u._)(this,function(a){switch(a.label){case 0:return n=(t=e.constructor.utils).unescape,i=t.getExt,o=t.srtToVtt,p=t.assToVtt,d=new(0,f.WebVTTParser),v=new(0,f.WebVTTSerializer),[4,Promise.all(r.map(function(e){return function(e,t){return l.apply(this,arguments)}(e,{getExt:i,srtToVtt:o,assToVtt:p})}))];case 1:return h=a.sent().map(function(e,t){var n=d.parse(e,"metadata");return n.url=r[t].url,n.name=r[t].name,n}),m="",y(h),[2,{name:"multipleSubtitles",tracks:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return y(e.map(function(e){return h.find(function(t){return t.name===e})}))},reset:function(){return y(h)}}]}})}),function(e){return t.apply(this,arguments)}}"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=p)},{"@swc/helpers/cjs/_async_to_generator.cjs":"cZn0e","@swc/helpers/cjs/_object_spread.cjs":"kyoEj","@swc/helpers/cjs/_object_spread_props.cjs":"3G1wX","@swc/helpers/cjs/_to_consumable_array.cjs":"i81N6","@swc/helpers/cjs/_ts_generator.cjs":"eltGh","./parser":"hxyrW","@parcel/transformer-js/src/esmodule-helpers.js":"qpMMf"}],cZn0e:[function(e,t,n,r){"use strict";function i(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}n._=function(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,c,"next",e)}function c(e){i(a,r,o,s,c,"throw",e)}s(void 0)})}}},{}],kyoEj:[function(e,t,n,r){"use strict";var i=e("9f9b8a24218ee51e");n._=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i._(e,t,n[t])})}return e}},{"9f9b8a24218ee51e":"ltU3W"}],ltU3W:[function(e,t,n,r){"use strict";n._=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{}],"3G1wX":[function(e,t,n,r){"use strict";Line truncated
|
||||
!function(e,t,n,r,i,o,a,s){var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},u="function"==typeof c[r]&&c[r],l=u.i||{},f=u.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,n){if(!f[t]){if(!e[t]){if(i[t])return i[t];var o="function"==typeof c[r]&&c[r];if(!n&&o)return o(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(n){var r=e[t][1][n];return null!=r?r:n},l.cache={};var s=f[t]=new d.Module(t);e[t][0].call(s.exports,l,s,s.exports,c)}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,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(d,"root",{get:function(){return c[r]}}),c[r]=d;for(var v=0;v<t.length;v++)d(t[v]);if(n){var h=d(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=h:"function"==typeof define&&define.amd&&define(function(){return h})}}({bzF6W:[function(e,t,n,r){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(n),i.export(n,"default",function(){return p});var o=e("@swc/helpers/cjs/_async_to_generator.cjs"),a=e("@swc/helpers/cjs/_object_spread.cjs"),s=e("@swc/helpers/cjs/_object_spread_props.cjs"),c=e("@swc/helpers/cjs/_to_consumable_array.cjs"),u=e("@swc/helpers/cjs/_ts_generator.cjs"),l=e("./parser");function f(){return(f=(0,o._)(function(e,t){var n,r,i,o,a;return(0,u._)(this,function(s){switch(s.label){case 0:return n=t.getExt,r=t.srtToVtt,i=t.assToVtt,[4,fetch(e.url)];case 1:return[4,s.sent().arrayBuffer()];case 2:switch(o=s.sent(),a=new TextDecoder(e.encoding||"utf-8").decode(o),e.type||n(e.url)){case"srt":return[2,r(a)];case"ass":return[2,i(a)];case"vtt":return[2,a];default:return[2,""]}}})})).apply(this,arguments)}function p(e){var t,n=e.subtitles,r=void 0===n?[]:n;return t=(0,o._)(function(e){var t,n,i,o,p,d,v,h,m;function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=function(e){for(var t=new(0,l.WebVTTParser)().parse("","metadata"),n=0;n<e.length;n++){var r,i=e[n];if(!i.updated){i.updated=!0;for(var o=0;o<i.cues.length;o++)for(var a=i.cues[o],s=0;s<a.tree.children.length;s++){var u=a.tree.children[s];u.value='<div class="art-subtitle-'.concat(i.name,'">').concat(u.value,"</div>")}}(r=t.cues).push.apply(r,(0,c._)(i.cues))}return t}(t),i=v.serialize(r.cues);URL.revokeObjectURL(m);var o=URL.createObjectURL(new Blob([i],{type:"text/vtt"}));m=o,e.option.subtitle.escape=!1,e.subtitle.init((0,s._)((0,a._)({},e.option.subtitle),{url:o,type:"vtt",onVttLoad:n}))}return(0,u._)(this,function(a){switch(a.label){case 0:return n=(t=e.constructor.utils).unescape,i=t.getExt,o=t.srtToVtt,p=t.assToVtt,d=new(0,l.WebVTTParser),v=new(0,l.WebVTTSerializer),[4,Promise.all(r.map(function(e){return function(e,t){return f.apply(this,arguments)}(e,{getExt:i,srtToVtt:o,assToVtt:p})}))];case 1:return h=a.sent().map(function(e,t){var n=d.parse(e,"metadata");return n.url=r[t].url,n.name=r[t].name,n}),m="",b(h),[2,{name:"multipleSubtitles",tracks:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return b(e.map(function(e){return h.find(function(t){return t.name===e})}))},reset:function(){return b(h)}}]}})}),function(e){return t.apply(this,arguments)}}"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=p)},{"@swc/helpers/cjs/_async_to_generator.cjs":"4ElRo","@swc/helpers/cjs/_object_spread.cjs":"7vaqr","@swc/helpers/cjs/_object_spread_props.cjs":"iJXke","@swc/helpers/cjs/_to_consumable_array.cjs":"1LaMX","@swc/helpers/cjs/_ts_generator.cjs":"a4h1C","./parser":"2xVZx","@parcel/transformer-js/src/esmodule-helpers.js":"ihnSZ"}],"4ElRo":[function(e,t,n,r){"use strict";function i(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}n._=function(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,c,"next",e)}function c(e){i(a,r,o,s,c,"throw",e)}s(void 0)})}}},{}],"7vaqr":[function(e,t,n,r){"use strict";var i=e("b3d0f206b721b857");n._=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i._(e,t,n[t])})}return e}},{b3d0f206b721b857:"dgB2K"}],dgB2K:[function(e,t,n,r){"use strict";n._=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},{}],iJXke:[function(e,t,n,r){"use strict";Line truncated
|
||||
Reference in new issue
Block a user