mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
Danmuku (#759)
* chore: Bump artplayer-plugin-danmuku version to 5.1.0 * chore: Update danmuku plugin with new mount option * chore: Update danmuku plugin with new mount option * chore: Update danmuku plugin with new mount option * chore: Update danmuku plugin with new mount option * chore: Update danmuku plugin with new mount option * chore: Update danmuku plugin with new mount option * chore: Refactor getDanmuTop function to handle additional cases * chore: Refactor getDanmuTop function to handle additional cases * chore: Update danmuku plugin with new mount option * chore: Update danmuku plugin with new mount option * chore: Refactor danmuku plugin to always create a new Setting instance * Refactor danmuku plugin to always create a new Setting instance * Refactor danmuku plugin to always create a new Setting instance * Update danmuku.js * Update danmuku.js * Refactor danmuku plugin to include a new Setting instance * Refactor danmuku plugin to include a new Setting instance * Refactor danmuku plugin styles for better alignment and spacing * Refactor danmuku plugin styles for better alignment and spacing * Refactor danmuku plugin styles for better alignment and spacing * Refactor danmuku plugin styles for better alignment and spacing * Refactor danmuku plugin styles for better alignment and spacing * chore: Update package.json files * Refactor danmuku plugin to remove unnecessary whitespace in the setting template * chore: Remove ESLint configuration files and update npm dependencies * chore: Update ESLint configuration to disable console warnings and fix unused variable warnings * chore: Update ESLint configuration to fix quotes rule * Update package.json * Update package.json * Update setting.js * chore: Compress CSS code in build script * chore: Update build script to compress JavaScript code * chore: Update build script to compress JavaScript code * chore: Refactor setting.js to improve code organization and remove unused variables * chore: Add isHover flag to Control component for better control hiding behavior * chore: Update Control component to use $bottom instead of $controls for better control hiding behavior * Update package.json * Update package.json * Update package.json * chore: Update lerna.json to use independent versioning and yarn as npm client * refactor: Update Danmuku class to support configurable modes and visibility * refactor: Update Danmuku styles for better visibility and configurability * feat: Update font weight in Danmuku styles for better readability * refactor: Update Danmuku class to support configurable modes and visibility * refactor: Add opacity, area, font, and speed sliders to Danmuku settings * refactor: Initialize sliders for opacity, area, font, and speed in Danmuku settings * feat: Add slider UI for opacity, area, and speed in Danmuku settings * feat: Update slider styles in Danmuku settings for better visibility and configurability * refactor: Improve Danmuku settings UI for better visibility and configurability * refactor: Improve Danmuku settings UI for better visibility and configurability * refactor: Update slider styles in Danmuku settings for better visibility and configurability * refactor: Update margin slider initialization in Danmuku settings * refactor: Update slider styles and initialization in Danmuku settings * refactor: Update Danmuku class to support configurable visibility * refactor: Update Danmuku class to support configurable visibility * refactor: Update Danmuku class to support configurable visibility * refactor: Update Danmuku class to support configurable visibility * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Improve Danmuku settings UI for better visibility and configurability * add lock * refactor: Add lock and unlock methods to Danmuku settings * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * Update artplayer-plugin-danmuku.d.ts * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings event listeners * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability * refactor: Update Danmuku settings UI for better visibility and configurability
This commit is contained in:
1 parent
dfd1cf968d
commit
699135afcf
402 files changed
+20804
-17005
No files matched your search
@@ -4,4 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,n,i,r){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[i]&&a[i],o=s.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,n){if(!o[t]){if(!e[t]){var r="function"==typeof a[i]&&a[i];if(!n&&r)return r(t,!0);if(s)return s(t,!0);if(l&&"string"==typeof t)return l(t);var f=new Error("Cannot find module '"+t+"'");throw f.code="MODULE_NOT_FOUND",f}d.resolve=function(n){var i=e[t][1][n];return null!=i?i:n},d.cache={};var c=o[t]=new u.Module(t);e[t][0].call(c.exports,d,c,c.exports,this)}return o[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:u(t)}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=o,u.parent=s,u.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(u,"root",{get:function(){return a[i]}}),a[i]=u;for(var f=0;f<t.length;f++)u(t[f]);if(n){var c=u(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd&&define((function(){return c}))}}({"4Kbf6":[function(e,t,n){e("@parcel/transformer-js/src/esmodule-helpers.js").defineInteropFlag(n);var i=e("./parser");function r({subtitles:e=[]}){return async t=>{const{unescape:n,getExt:r,srtToVtt:a,assToVtt:s}=t.constructor.utils,o=new(0,i.WebVTTParser),l=new(0,i.WebVTTSerializer),u=await Promise.all(e.map((e=>async function(e,{getExt:t,srtToVtt:n,assToVtt:i}){const r=await fetch(e.url),a=await r.arrayBuffer(),s=new TextDecoder(e.encoding||"utf-8").decode(a);switch(e.type||t(e.url)){case"srt":return n(s);case"ass":return i(s);case"vtt":return s;default:return""}}(e,{getExt:r,srtToVtt:a,assToVtt:s})))),f=u.map(((t,n)=>{const i=o.parse(t,"metadata");return i.url=e[n].url,i.name=e[n].name,i}));let c="";function d(e=[]){const r=function(e){const t=(new(0,i.WebVTTParser)).parse("","metadata");for(let n=0;n<e.length;n++){const i=e[n];if(!i.updated){i.updated=!0;for(let e=0;e<i.cues.length;e++){const t=i.cues[e];for(let e=0;e<t.tree.children.length;e++){const n=t.tree.children[e];n.value=`<div class="art-subtitle-${i.name}">${n.value}</div>`}}}if(0===t.cues.length)t.cues=[...i.cues];else for(let e=0;e<t.cues.length;e++){const n=t.cues[e].tree.children,r=i.cues[e]?.tree?.children;t.cues[e]={...t.cues[e],tree:{children:[...n,...r]}}}}return t}(e),a=l.serialize(r.cues);URL.revokeObjectURL(c);const s=URL.createObjectURL(new Blob([a],{type:"text/vtt"}));c=s,t.option.subtitle.escape=!1,t.subtitle.init({...t.option.subtitle,url:s,type:"vtt",onVttLoad:n})}return d(f),{name:"multipleSubtitles",tracks:(e=[])=>d(e.map((e=>f.find((t=>t.name===e))))),reset:()=>d(f)}}}n.default=r,"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=r)},{"./parser":"cU78l","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cU78l:[function(e,t,n){!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 s=Date.now(),o=0,l=n.split(/\r\n|\r|\n/),u=!1,f=[],c=[],d=[];function p(e,t){d.push({message:e,line:o+1,col:t})}var m=l[o],g=m.length,h="WEBVTT",v=0,b=h.length;for("\ufeff"===m[0]&&(v=1,b+=1),(g<b||m.indexOf(h)!==0+v||g>b&&" "!==m[b]&&"\t"!==m[b])&&p('No valid signature. (File needs to start with "WEBVTT".)'),o++;""!=l[o]&&null!=l[o];){if(p("No blank line after the signature."),-1!=l[o].indexOf("--\x3e")){u=!0;break}o++}for(;null!=l[o];){for(var T;!u&&""==l[o];)o++;if(!u&&null==l[o])break;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});var x=!0;if(-1==l[o].indexOf("--\x3e")){if(T.id=l[o],/^NOTE($|[ \t])/.test(T.id)){for(o++;""!=l[o]&&null!=l[o];)-1!=l[o].indexOf("--\x3e")&&p("Cannot have timestamp in a comment."),o++;continue}if(/^STYLE($|[ \t])/.test(T.id)){var y=[],w=!1;for(o++;""!=l[o]&&null!=l[o];)-1!=l[o].indexOf("--\x3e")&&(p("Cannot have timestamp in a style block."),w=!0),y.push(l[o]),o++;if(c.length){p("Style blocks cannot appear after the first cue.");continue}w||f.push(y.join("\n"));continue}if(""==l[++o]||null==l[o]){p("Cue identifier cannot be standalone.");continue}if(-1==l[o].indexOf("--\x3e")){x=!1,p("Cue identifier needs to be followed by timestamp.");continue}}u=!1;var O=new i(l[o],p),P=0;if(c.length>0&&(P=c[c.length-1].startTime),!x||O.parse(T,P)){for(o++;""!=l[o]&&null!=l[o];){if(-1!=l[o].indexOf("--\x3e")){p("Blank line missing before cue."),u=!0;break}""!=T.text&&(T.text+="\n"),T.text+=l[o],o++}var j=new r(T.text,p,a,t);T.tree=j.parse(T.startTime,T.endTime),c.push(T)}else for(T=Line truncated
|
||||
!function(e,t,n,i,r){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[i]&&a[i],o=s.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,n){if(!o[t]){if(!e[t]){var r="function"==typeof a[i]&&a[i];if(!n&&r)return r(t,!0);if(s)return s(t,!0);if(l&&"string"==typeof t)return l(t);var f=Error("Cannot find module '"+t+"'");throw f.code="MODULE_NOT_FOUND",f}d.resolve=function(n){var i=e[t][1][n];return null!=i?i:n},d.cache={};var c=o[t]=new u.Module(t);e[t][0].call(c.exports,d,c,c.exports,this)}return o[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:u(t)}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=o,u.parent=s,u.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(u,"root",{get:function(){return a[i]}}),a[i]=u;for(var f=0;f<t.length;f++)u(t[f]);if(n){var c=u(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd&&define(function(){return c})}}({bt91X:[function(e,t,n){var i=e("@parcel/transformer-js/src/esmodule-helpers.js");i.defineInteropFlag(n),i.export(n,"default",()=>s);var r=e("./parser");async function a(e,{getExt:t,srtToVtt:n,assToVtt:i}){let r=await fetch(e.url),a=await r.arrayBuffer(),s=new TextDecoder(e.encoding||"utf-8").decode(a);switch(e.type||t(e.url)){case"srt":return n(s);case"ass":return i(s);case"vtt":return s;default:return""}}function s({subtitles:e=[]}){return async t=>{let{unescape:n,getExt:i,srtToVtt:s,assToVtt:o}=t.constructor.utils,l=new r.WebVTTParser,u=new r.WebVTTSerializer,f=(await Promise.all(e.map(e=>a(e,{getExt:i,srtToVtt:s,assToVtt:o})))).map((t,n)=>{let i=l.parse(t,"metadata");return i.url=e[n].url,i.name=e[n].name,i}),c="";function d(e=[]){let i=function(e){let t=new r.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>`}}}if(0===t.cues.length)t.cues=[...i.cues];else for(let e=0;e<t.cues.length;e++){let n=t.cues[e].tree.children,r=i.cues[e]?.tree?.children;t.cues[e]={...t.cues[e],tree:{children:[...n,...r]}}}}return t}(e),a=u.serialize(i.cues);URL.revokeObjectURL(c);let s=URL.createObjectURL(new Blob([a],{type:"text/vtt"}));c=s,t.option.subtitle.escape=!1,t.subtitle.init({...t.option.subtitle,url:s,type:"vtt",onVttLoad:n})}return d(f),{name:"multipleSubtitles",tracks:(e=[])=>d(e.map(e=>f.find(t=>t.name===e))),reset:()=>d(f)}}}"undefined"!=typeof window&&(window.artplayerPluginMultipleSubtitles=s)},{"./parser":"e4aAa","@parcel/transformer-js/src/esmodule-helpers.js":"hqP7A"}],e4aAa:[function(e,t,n){!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 s=Date.now(),o=0,l=n.split(/\r\n|\r|\n/),u=!1,f=[],c=[],d=[];function p(e,t){d.push({message:e,line:o+1,col:t})}var m=l[o],g=m.length,h="WEBVTT",v=0,b=h.length;for("\uFEFF"===m[0]&&(v=1,b+=1),(g<b||m.indexOf(h)!==0+v||g>b&&" "!==m[b]&&" "!==m[b])&&p('No valid signature. (File needs to start with "WEBVTT".)'),o++;""!=l[o]&&void 0!=l[o];){if(p("No blank line after the signature."),-1!=l[o].indexOf("-->")){u=!0;break}o++}for(;void 0!=l[o];){for(;!u&&""==l[o];)o++;if(!u&&void 0==l[o])break;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});var T,y=!0;if(-1==l[o].indexOf("-->")){if(T.id=l[o],/^NOTE($|[ \t])/.test(T.id)){for(o++;""!=l[o]&&void 0!=l[o];)-1!=l[o].indexOf("-->")&&p("Cannot have timestamp in a comment."),o++;continue}if(/^STYLE($|[ \t])/.test(T.id)){var x=[],w=!1;for(o++;""!=l[o]&&void 0!=l[o];)-1!=l[o].indexOf("-->")&&(p("Cannot have timestamp in a style block."),w=!0),x.push(l[o]),o++;if(c.length){p("Style blocks cannot appear after the first cue.");continue}w||f.push(x.join("\n"));continue}if(""==l[++o]||void 0==l[o]){p("Cue identifier cannot be standalone.");continue}if(-1==l[o].indexOf("-->")){y=!1,p("Cue identifier needs to be followed by timestamp.");continue}}u=!1;var O=new i(l[o],p),P=0;if(c.length>0&&(P=c[c.length-1].startTime),y&&!O.parse(T,P)){for(T=null,o++;""!=l[o]&&void 0!=l[o];){if(-1!=l[o].indexOf("-->")){u=!0;break}o++}continue}for(o++;""!=l[o]&&void 0!=l[o];){if(-1!=l[o].indexOf("-->")){p("Blank line missing before cue."),u=!0;break}""!=T.text&&(T.text+="\n"),T.text+=l[o],o++}var A=new r(T.text,p,a,t);Line truncated
|
||||
Reference in new issue
Block a user