mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
chore: Update build.js to return compressedHtmlString instead of compressedCssString
This commit is contained in:
1 parent
774ca866d2
commit
c1457dd9ae
9 files changed
+10
-40
No files matched your search
@@ -4,19 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,i,a,n){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof o[a]&&o[a],l=s.cache||{},r="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,i){if(!l[t]){if(!e[t]){var n="function"==typeof o[a]&&o[a];if(!i&&n)return n(t,!0);if(s)return s(t,!0);if(r&&"string"==typeof t)return r(t);var p=Error("Cannot find module '"+t+"'");throw p.code="MODULE_NOT_FOUND",p}h.resolve=function(i){var a=e[t][1][i];return null!=a?a:i},h.cache={};var u=l[t]=new d.Module(t);e[t][0].call(u.exports,h,u,u.exports,this)}return l[t].exports;function h(e){var t=h.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.exports={}},d.modules=e,d.cache=l,d.parent=s,d.register=function(t,i){e[t]=[function(e,t){t.exports=i},{}]},Object.defineProperty(d,"root",{get:function(){return o[a]}}),o[a]=d;for(var p=0;p<t.length;p++)d(t[p]);if(i){var u=d(i);"object"==typeof exports&&"undefined"!=typeof module?module.exports=u:"function"==typeof define&&define.amd&&define(function(){return u})}}({bgm6t:[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i),a.export(i,"default",()=>p);var n=e("./danmuku"),o=a.interopDefault(n),s=e("./setting"),l=a.interopDefault(s),r=e("./heatmap"),d=a.interopDefault(r);function p(e){return t=>{let i=new o.default(t,e),a=new l.default(t,i);return i.option.heatmap&&(0,d.default)(t,i,i.option.heatmap),{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:a.mount.bind(a),get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}p.icons=l.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=p)},{"./danmuku":"4ns48","./setting":"lO8OT","./heatmap":"8AxLD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ns48":[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i);var n=e("./bilibili"),o=e("bundle-text:./worker"),s=a.interopDefault(o);class l{constructor(e,t){let{constructor:i,template:a}=e;this.utils=i.utils,this.validator=i.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=e,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(t),this.worker=new Worker(URL.createObjectURL(new Blob([s.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),e.on("video:play",this.start),e.on("video:playing",this.start),e.on("video:pause",this.stop),e.on("video:waiting",this.stop),e.on("destroy",this.destroy),e.on("resize",this.reset),this.load()}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,maxLength:200,lockTime:5,theme:"dark"}}static get scheme(){return{danmuku:"array|function|string",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement",heatmap:"object|boolean",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",maxLength:"number",lockTime:"number",theme:"string"}}static get cssText(){return`
|
||||
user-select: none;
|
||||
position: absolute;
|
||||
white-space: pre;
|
||||
pointer-events: none;
|
||||
perspective: 500px;
|
||||
display: inline-block;
|
||||
will-change: transform;
|
||||
font-weight: normal;
|
||||
line-height: 1.125;
|
||||
visibility: hidden;
|
||||
font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;
|
||||
text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;
|
||||
`}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){let{clamp:e}=this.utils,t=this.option.margin[0],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[0]}get marginBottom(){let{clamp:e}=this.utils,t=this.option.margin[1],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[1]}async load(){let{errorHandle:e}=this.utils;try{"function"==typeof this.option.danmuku?this.danmus=await this.option.danmuku():"function"==typeof this.option.danmuku.then?this.danmus=await this.option.danmuku:"string"==typeof this.option.danmuku?this.danmus=await (0,n.bilibiliDanmuParseFromUrl)(this.option.danmuku):this.danmus=this.option.danmuku,e(Array.isArray(this.danmus),"Danmuku need return an array as result"),this.queue=[],this.$danmuku.innerText="",this.danmus.forEach(e=>this.emit(e)),this.art.emit("artplayerPluginDanmuku:loaded",this.queue)}catch(e){throw this.art.emit("artplayerPluginDanmuku:error",e),e}return this}emit(e){let{clamp:t}=this.utils;return this.validator(e,{text:"string",mode:"?number",color:"?string",time:"?number",border:"?boolean",style:"?object",escape:"?boolean"}),e.text.trim()&&(e.time?e.time=t(e.time,0,1/0):e.time=this.art.currentTime+.5,void 0===e.mode&&(e.mode=this.option.mode),void 0===e.style&&(e.style={}),void 0===e.escape&&(e.escape=!0),void 0===e.color&&(e.color=this.option.color),[0,1,2].includes(e.mode)&&this.option.filter(e)&&this.queue.push({...e,$state:"wait",$ref:null,$restTime:0,$lastStartTime:0})),this}config(e){let{clamp:t}=this.utils,{$controlsCenter:i}=this.art.template;if(this.option=Object.assign({},l.option,this.option,e),this.validator(this.option,l.scheme),this.option.mode=t(this.option.mode,0,2),this.option.speed=t(this.option.speed,1,10),this.option.opacity=t(this.option.opacity,0,1),this.option.lockTime=t(this.option.lockTime,1,60),this.option.maxLength=t(this.option.maxLength,1,1e3),this.option.mount=this.option.mount||i,e.fontSize){let e=this.getFontSize(this.option.fontSize);e!==this.option.fontSize&&(this.option.fontSize=e,this.reset())}return this.option.visible?this.show():this.hide(),this.art.emit("artplayerPluginDanmuku:config",this.option),this}getLeft(e){let t=e.getBoundingClientRect();return this.isRotate?t.top:t.left}getRef(){let e=this.$refs.pop()||document.createElement("div");return e.style.cssText=l.cssText,e.dataset.mode="",e}getFontSize(e){let{clamp:t}=this.utils,{clientHeight:i}=this.$player;return"number"==typeof e?t(e,12,i):"string"==typeof e&&e.endsWith("%")?t(i*(parseFloat(e)/100),12,i):l.option.fontSize}postMessage(e={}){return new Promise(t=>{e.id=Date.now(),this.worker.postMessage(e),this.worker.onmessage=i=>{let{data:a}=i;a.id===e.id&&t(a)}})}filter(e,t){return this.queue.filter(t=>t.$state===e).map(t)}getReady(){let{currentTime:e}=this.art;return this.queue.filter(t=>"ready"===t.$state||"wait"===t.$state&&e+.1>=t.time&&t.time>=e-.1)}getEmits(){let e=[],{clientWidth:t}=this.$player,i=this.getLeft(this.$player);return this.filter("emit",a=>{let n=a.$ref.offsetTop,o=this.getLeft(a.$ref)-i,s=a.$ref.clientHeight,l=a.$ref.clientWidth,r=o+l,d=r/a.$restTime,p={};p.top=n,p.left=o,p.height=s,p.width=l,p.right=t-r,p.speed=d,p.distance=r,p.time=a.$restTime,p.mode=a.mode,e.push(p)}),e}makeWait(e){e.$state="wait",e.$ref&&(e.$ref.style.cssText=l.cssText,this.$refs.push(e.$ref),e.$ref=null)}update(){let{setStyles:e}=this.utils;return this.timer=window.requestAnimationFrame(async()=>{if(this.art.playing&&!this.isHide){this.filter("emit",e=>{let t=(Date.now()-e.$lastStartTime)/1e3;e.$restTime-=t,e.$lastStartTime=Date.now(),e.$restTime<=0&&this.makeWait(e)});let t=this.getReady();for(let i=0;i<t.length;i++){let a=t[i];if(await this.option.beforeVisible(a)){let{clientWidth:t,clientHeight:i}=this.$player;a.$ref=this.getRef(),a.escape?a.$ref.innerText=a.text:a.$ref.innerHTML=a.text,this.$danmuku.appendChild(a.$ref),a.$ref.style.left=`${t}px`,a.$ref.style.opacity=this.option.opacity,a.$ref.style.fontSize=`${this.option.fontSize}px`,a.$ref.style.color=a.color,a.$ref.style.border=a.border?`1px solid ${a.color}`:null,a.$ref.style.backgroundColor=a.border?"rgb(0 0 0 / 50%)":null,a.$ref.style.marginLeft="0px",e(a.$ref,a.style),a.$lastStartTime=Date.now(),a.$restTime=this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed;let{top:n}=await this.postMessage({target:{mode:a.mode,height:a.$ref.clientHeight,speed:(t+a.$ref.clientWidth)/a.$restTime},emits:this.getEmits(),antiOverlap:this.option.antiOverlap,clientWidth:t,clientHeight:i,marginBottom:this.marginBottom,marginTop:this.marginTop});if(a.$ref){if(this.isStop||void 0===n)a.$state="ready",this.$refs.push(a.$ref),a.$ref=null;else switch(a.$state="emit",a.$ref.style.visibility="visible",a.$ref.dataset.mode=a.mode,this.art.emit("artplayerPluginDanmuk
Line truncated
|
||||
\u{9632}\u{6B62}\u{5F39}\u{5E55}\u{91CD}\u{53E0}</div><div class="apd-other apd-sync-video">${D.default}${S.default}
|
||||
\u{540C}\u{6B65}\u{89C6}\u{9891}\u{901F}\u{5EA6}</div></div><div class="apd-config-slider apd-config-opacity">\u{4E0D}\u{900F}\u{660E}\u{5EA6}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div><div class="apd-config-slider apd-config-margin">\u{663E}\u{793A}\u{533A}\u{57DF}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div><div class="apd-config-slider apd-config-fontSize">\u{5F39}\u{5E55}\u{5B57}\u{53F7}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div><div class="apd-config-slider apd-config-speed">\u{5F39}\u{5E55}\u{901F}\u{5EA6}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div></div></div></div><div class="apd-emitter"><div class="apd-style">${m.default}<div class="apd-style-panel"><div class="apd-style-panel-inner"><div class="apd-style-mode">\u{6A21}\u{5F0F}<div class="apd-modes"><div data-mode="0" class="apd-mode">${v.default}<div>\u{6EDA}\u{52A8}</div></div><div data-mode="1" class="apd-mode">${b.default}<div>\u{9876}\u{90E8}</div></div><div data-mode="2" class="apd-mode">${E.default}<div>\u{5E95}\u{90E8}</div></div></div></div><div class="apd-style-color">\u{989C}\u{8272}<div class="apd-colors">${this.COLOR.map(e=>`<div data-color="${e}" class="apd-color" style="background-color: ${e}"></div>`).join("")}</div></div></div></div></div><input class="apd-input" placeholder="\u{53D1}\u{4E2A}\u{53CB}\u{5584}\u{7684}\u{5F39}\u{5E55}\u{89C1}\u{8BC1}\u{5F53}\u{4E0B}" autocomplete="off" maxLength="${e.maxLength}" /><div class="apd-send">\u{53D1}\u{9001}</div></div>`}get MARGIN(){return this.option.MARGIN||[{name:"1/4",value:[10,"75%"]},{name:"半屏",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"满屏",value:[10,10]}]}get SPEED(){return this.option.SPEED||[{name:"极慢",value:10},{name:"较慢",value:7.5,hide:!0},{name:"适中",value:5},{name:"较快",value:2.5,hide:!0},{name:"极快",value:1}]}get COLOR(){return this.option.COLOR||["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(e){let{query:t}=this.utils,{$danmuku:i}=this.template;return t(e,i)}setData(e,t){let{$player:i}=this.art.template,{$mount:a}=this.template;i.dataset[e]=t,this.outside&&(a.dataset[e]=t)}createTemplate(){let{createElement:e,tooltip:t}=this.utils,i=e("div");i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$danmuku=i,this.template.$toggle=this.query(".apd-toggle"),t(this.template.$toggle,"弹幕开关"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send")}createEvents(){let{$toggle:e,$configModes:t,$styleModes:i,$colors:a,$antiOverlap:n,$syncVideo:o,$send:s,$input:l}=this.template;this.art.proxy(e,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.art.proxy(t,"click",e=>{let t=e.target.closest(".apd-mode");if(!t)return;let i=Number(t.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(e=>e!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.art.proxy(n,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.art.proxy(o,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.art.proxy(i,"click",e=>{let t=e.target.closest(".apd-mode");if(!t)return;let i=Number(t.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.art.proxy(a,"click",e=>{let t=e.target.closest(".apd-color");t&&(this.danmuku.config({color:t.dataset.color}),this.reset())}),this.art.proxy(s,"click",()=>this.emit()),this.art.proxy(l,"keypress",e=>{"Enter"===e.key&&(e.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider({min:0,max:100,steps:[],container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:e=>{let{$opacityValue:t}=this.template;t.textContent=`${e}%`;let i=e/100;i!==this.option.opacity&&this.danmuku.cLine truncated
|
||||
!function(e,t,i,a,n){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof o[a]&&o[a],l=s.cache||{},r="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,i){if(!l[t]){if(!e[t]){var n="function"==typeof o[a]&&o[a];if(!i&&n)return n(t,!0);if(s)return s(t,!0);if(r&&"string"==typeof t)return r(t);var p=Error("Cannot find module '"+t+"'");throw p.code="MODULE_NOT_FOUND",p}h.resolve=function(i){var a=e[t][1][i];return null!=a?a:i},h.cache={};var u=l[t]=new d.Module(t);e[t][0].call(u.exports,h,u,u.exports,this)}return l[t].exports;function h(e){var t=h.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.exports={}},d.modules=e,d.cache=l,d.parent=s,d.register=function(t,i){e[t]=[function(e,t){t.exports=i},{}]},Object.defineProperty(d,"root",{get:function(){return o[a]}}),o[a]=d;for(var p=0;p<t.length;p++)d(t[p]);if(i){var u=d(i);"object"==typeof exports&&"undefined"!=typeof module?module.exports=u:"function"==typeof define&&define.amd&&define(function(){return u})}}({bgm6t:[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i),a.export(i,"default",()=>p);var n=e("./danmuku"),o=a.interopDefault(n),s=e("./setting"),l=a.interopDefault(s),r=e("./heatmap"),d=a.interopDefault(r);function p(e){return t=>{let i=new o.default(t,e),a=new l.default(t,i);return i.option.heatmap&&(0,d.default)(t,i,i.option.heatmap),{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:a.mount.bind(a),get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}p.icons=l.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=p)},{"./danmuku":"4ns48","./setting":"lO8OT","./heatmap":"8AxLD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ns48":[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i);var n=e("./bilibili"),o=e("bundle-text:./worker"),s=a.interopDefault(o);class l{constructor(e,t){let{constructor:i,template:a}=e;this.utils=i.utils,this.validator=i.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=e,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(t),this.worker=new Worker(URL.createObjectURL(new Blob([s.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),e.on("video:play",this.start),e.on("video:playing",this.start),e.on("video:pause",this.stop),e.on("video:waiting",this.stop),e.on("destroy",this.destroy),e.on("resize",this.reset),this.load()}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,maxLength:200,lockTime:5,theme:"dark"}}static get scheme(){return{danmuku:"array|function|string",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement",heatmap:"object|boolean",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",maxLength:"number",lockTime:"number",theme:"string"}}static get cssText(){return` user-select: none; position: absolute; white-space: pre; pointer-events: none; perspective: 500px; display: inline-block; will-change: transform; font-weight: normal; line-height: 1.125; visibility: hidden; font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif; text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px; `}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){let{clamp:e}=this.utils,t=this.option.margin[0],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[0]}get marginBottom(){let{clamp:e}=this.utils,t=this.option.margin[1],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[1]}async load(){let{errorHandle:e}=this.utils;try{"function"==typeof this.option.danmuku?this.danmus=await this.option.danmuku():"function"==typeof this.option.danmuku.then?this.danmus=await this.option.danmuku:"string"==typeof this.option.danmuku?this.danmus=await (0,n.bilibiliDanmuParseFromUrl)(this.option.danmuku):this.danmus=this.option.danmuku,e(Array.isArray(this.danmus),"Danmuku need return an array as result"),this.queue=[],this.$danmukuLine truncated
|
||||
@@ -4,4 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,n,a){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof o[n]&&o[n],s=i.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,r){if(!s[t]){if(!e[t]){var a="function"==typeof o[n]&&o[n];if(!r&&a)return a(t,!0);if(i)return i(t,!0);if(l&&"string"==typeof t)return l(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},d.cache={};var p=s[t]=new u.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[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=s,u.parent=i,u.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return o[n]}}),o[n]=u;for(var c=0;c<t.length;c++)u(t[c]);if(r){var p=u(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"40mNk":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return c});var a=e("./danmuku"),o=n.interopDefault(a),i=e("./setting"),s=n.interopDefault(i),l=e("./heatmap"),u=n.interopDefault(l);function c(e){return function(t){var r=new o.default(t,e),n=new s.default(t,r);return r.option.heatmap&&(0,u.default)(t,r,r.option.heatmap),{name:"artplayerPluginDanmuku",emit:r.emit.bind(r),load:r.load.bind(r),config:r.config.bind(r),hide:r.hide.bind(r),show:r.show.bind(r),reset:r.reset.bind(r),mount:n.mount.bind(n),get option(){return r.option},get isHide(){return r.isHide},get isStop(){return r.isStop}}}}c.icons=s.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=c)},{"./danmuku":"jgffw","./setting":"d3V7t","./heatmap":"dXFn2","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],jgffw:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return f});var a=e("@swc/helpers/_/_async_to_generator"),o=e("@swc/helpers/_/_class_call_check"),i=e("@swc/helpers/_/_create_class"),s=e("@swc/helpers/_/_object_spread"),l=e("@swc/helpers/_/_object_spread_props"),u=e("@swc/helpers/_/_ts_generator"),c=e("./bilibili"),p=e("bundle-text:./worker"),d=n.interopDefault(p),f=function(){function e(t,r){(0,o._)(this,e);var n=t.constructor,a=t.template;this.utils=n.utils,this.validator=n.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=t,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(r),this.worker=new Worker(URL.createObjectURL(new Blob([d.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("destroy",this.destroy),t.on("resize",this.reset),this.load()}return(0,i._)(e,[{key:"isRotate",get:function(){var e,t;return null===(t=this.art.plugins)||void 0===t?void 0:null===(e=t.autoOrientation)||void 0===e?void 0:e.state}},{key:"marginTop",get:function(){var t=this.utils.clamp,r=this.option.margin[0],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[0]}},{key:"marginBottom",get:function(){var t=this.utils.clamp,r=this.option.margin[1],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[1]}},{key:"load",value:function(){var e=this;return(0,a._)(function(){var t,r;return(0,u._)(this,function(n){switch(n.label){case 0:t=e.utils.errorHandle,n.label=1;case 1:if(n.trys.push([1,9,,10]),"function"!=typeof e.option.danmuku)return[3,3];return[4,e.option.danmuku()];case 2:case 4:case 6:return e.danmus=n.sent(),[3,8];case 3:if("function"!=typeof e.option.danmuku.then)return[3,5];return[4,e.option.danmuku];case 5:if("string"!=typeof e.option.danmuku)return[3,7];return[4,(0,c.bilibiliDanmuParseFromUrl)(e.option.danmuku)];case 7:e.danmus=e.option.danmuku,n.label=8;case 8:return t(Array.isArray(e.danmus),"Danmuku need return an array as result"),e.queue=[],e.$danmuku.innerText="",e.danmus.forEach(function(t){return e.emit(t)}),e.art.emit("artplayerPluginDanmuku:loaded",e.queue),[3,10];case 9:throw r=n.sent(),e.art.emit("artplayerPluginDanmuku:error",r),r;case 10:return[2,e]}})})()}},{key:"emit",value:function(e){var t=this.utils.clamp;return this.validator(e,{text:"string",mode:"?number",color:"?string",time:"?number",border:"?boolean",style:"?object",escape:"?boolean"}),e.text.trim()&&(e.time?e.time=t(e.time,0,1/0):e.time=this.Line truncated
|
||||
!function(e,t,r,n,a){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof o[n]&&o[n],s=i.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,r){if(!s[t]){if(!e[t]){var a="function"==typeof o[n]&&o[n];if(!r&&a)return a(t,!0);if(i)return i(t,!0);if(l&&"string"==typeof t)return l(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},d.cache={};var p=s[t]=new u.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[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=s,u.parent=i,u.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return o[n]}}),o[n]=u;for(var c=0;c<t.length;c++)u(t[c]);if(r){var p=u(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"40mNk":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return c});var a=e("./danmuku"),o=n.interopDefault(a),i=e("./setting"),s=n.interopDefault(i),l=e("./heatmap"),u=n.interopDefault(l);function c(e){return function(t){var r=new o.default(t,e),n=new s.default(t,r);return r.option.heatmap&&(0,u.default)(t,r,r.option.heatmap),{name:"artplayerPluginDanmuku",emit:r.emit.bind(r),load:r.load.bind(r),config:r.config.bind(r),hide:r.hide.bind(r),show:r.show.bind(r),reset:r.reset.bind(r),mount:n.mount.bind(n),get option(){return r.option},get isHide(){return r.isHide},get isStop(){return r.isStop}}}}c.icons=s.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=c)},{"./danmuku":"jgffw","./setting":"d3V7t","./heatmap":"dXFn2","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],jgffw:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return f});var a=e("@swc/helpers/_/_async_to_generator"),o=e("@swc/helpers/_/_class_call_check"),i=e("@swc/helpers/_/_create_class"),s=e("@swc/helpers/_/_object_spread"),l=e("@swc/helpers/_/_object_spread_props"),u=e("@swc/helpers/_/_ts_generator"),c=e("./bilibili"),p=e("bundle-text:./worker"),d=n.interopDefault(p),f=function(){function e(t,r){(0,o._)(this,e);var n=t.constructor,a=t.template;this.utils=n.utils,this.validator=n.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=t,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(r),this.worker=new Worker(URL.createObjectURL(new Blob([d.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("destroy",this.destroy),t.on("resize",this.reset),this.load()}return(0,i._)(e,[{key:"isRotate",get:function(){var e,t;return null===(t=this.art.plugins)||void 0===t?void 0:null===(e=t.autoOrientation)||void 0===e?void 0:e.state}},{key:"marginTop",get:function(){var t=this.utils.clamp,r=this.option.margin[0],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[0]}},{key:"marginBottom",get:function(){var t=this.utils.clamp,r=this.option.margin[1],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[1]}},{key:"load",value:function(){var e=this;return(0,a._)(function(){var t,r;return(0,u._)(this,function(n){switch(n.label){case 0:t=e.utils.errorHandle,n.label=1;case 1:if(n.trys.push([1,9,,10]),"function"!=typeof e.option.danmuku)return[3,3];return[4,e.option.danmuku()];case 2:case 4:case 6:return e.danmus=n.sent(),[3,8];case 3:if("function"!=typeof e.option.danmuku.then)return[3,5];return[4,e.option.danmuku];case 5:if("string"!=typeof e.option.danmuku)return[3,7];return[4,(0,c.bilibiliDanmuParseFromUrl)(e.option.danmuku)];case 7:e.danmus=e.option.danmuku,n.label=8;case 8:return t(Array.isArray(e.danmus),"Danmuku need return an array as result"),e.queue=[],e.$danmuku.innerText="",e.danmus.forEach(function(t){return e.emit(t)}),e.art.emit("artplayerPluginDanmuku:loaded",e.queue),[3,10];case 9:throw r=n.sent(),e.art.emit("artplayerPluginDanmuku:error",r),r;case 10:return[2,e]}})})()}},{key:"emit",value:function(e){var t=this.utils.clamp;return this.validator(e,{text:"string",mode:"?number",color:"?string",time:"?number",border:"?boolean",style:"?object",escape:"?boolean"}),e.text.trim()&&(e.time?e.time=t(e.time,0,1/0):e.time=this.Line truncated
|
||||
@@ -4,4 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,a,i){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n="function"==typeof o[a]&&o[a],s=n.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!s[t]){if(!e[t]){var i="function"==typeof o[a]&&o[a];if(!r&&i)return i(t,!0);if(n)return n(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}d.resolve=function(r){var a=e[t][1][r];return null!=a?a:r},d.cache={};var p=s[t]=new c.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=s,c.parent=n,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return o[a]}}),o[a]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({abjMI:[function(e,t,r){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r);var i=e("bundle-text:./style/index.less"),o=a.interopDefault(i),n=e("option-validator"),s=a.interopDefault(n),l=e("./utils/emitter"),c=a.interopDefault(l),u=e("./utils"),p=e("./scheme"),d=a.interopDefault(p),f=e("./config"),h=a.interopDefault(f),m=e("./template"),g=a.interopDefault(m),v=e("./i18n"),y=a.interopDefault(v),b=e("./player"),x=a.interopDefault(b),w=e("./control"),j=a.interopDefault(w),k=e("./contextmenu"),S=a.interopDefault(k),I=e("./info"),T=a.interopDefault(I),O=e("./subtitle"),E=a.interopDefault(O),M=e("./events"),$=a.interopDefault(M),F=e("./hotkey"),C=a.interopDefault(F),H=e("./layer"),D=a.interopDefault(H),B=e("./loading"),z=a.interopDefault(B),A=e("./notice"),R=a.interopDefault(A),L=e("./mask"),P=a.interopDefault(L),N=e("./icons"),Z=a.interopDefault(N),_=e("./setting"),q=a.interopDefault(_),V=e("./storage"),W=a.interopDefault(V),U=e("./plugins"),Y=a.interopDefault(U);let K=0,X=[];class G extends c.default{constructor(e,t){super(),this.id=++K;let r=u.mergeDeep(G.option,e);if(r.container=e.container,this.option=(0,s.default)(r,d.default),this.isLock=!1,this.isReady=!1,this.isFocus=!1,this.isInput=!1,this.isRotate=!1,this.isDestroy=!1,this.template=new g.default(this),this.events=new $.default(this),this.storage=new W.default(this),this.icons=new Z.default(this),this.i18n=new y.default(this),this.notice=new R.default(this),this.player=new x.default(this),this.layers=new D.default(this),this.controls=new j.default(this),this.contextmenu=new S.default(this),this.subtitle=new E.default(this),this.info=new T.default(this),this.loading=new z.default(this),this.hotkey=new C.default(this),this.mask=new P.default(this),this.setting=new q.default(this),this.plugins=new Y.default(this),"function"==typeof t&&this.on("ready",()=>t.call(this,this)),G.DEBUG){let e=e=>console.log(`[ART.${this.id}] -> ${e}`);e("Version@"+G.version),e("Env@"+G.env),e("Build@"+G.build);for(let t=0;t<h.default.events.length;t++)this.on("video:"+h.default.events[t],t=>e("Event@"+t.type))}X.push(this)}static get instances(){return X}static get version(){return"5.1.2"}static get env(){return"production"}static get build(){return"2024-05-27 09:59:56"}static get config(){return h.default}static get utils(){return u}static get scheme(){return d.default}static get Emitter(){return c.default}static get validator(){return s.default}static get kindOf(){return s.default.kindOf}static get html(){return g.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,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:e=>e},moreVideoAttr:{controls:!1,preload:u.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),X.splice(X.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}r.default=G,G.DEBUG=!1,G.CONTEXTMENU=!0,G.NOTICE_TIME=2e3,G.SETTING_WIDTH=250,G.SETTING_ITEM_WIDTH=200,G.SETTING_ITEM_HEIGHT=35,G.RESIZE_TIME=200,G.SCROLL_TIME=200,G.SCROLL_GAP=50,G.AUTO_PLAYBACK_MAX=10,G.AUTO_PLAYBACK_MIN=5,GLine truncated
|
||||
!function(e,t,r,a,i){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n="function"==typeof o[a]&&o[a],s=n.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!s[t]){if(!e[t]){var i="function"==typeof o[a]&&o[a];if(!r&&i)return i(t,!0);if(n)return n(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}d.resolve=function(r){var a=e[t][1][r];return null!=a?a:r},d.cache={};var p=s[t]=new c.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=s,c.parent=n,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return o[a]}}),o[a]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({abjMI:[function(e,t,r){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r);var i=e("bundle-text:./style/index.less"),o=a.interopDefault(i),n=e("option-validator"),s=a.interopDefault(n),l=e("./utils/emitter"),c=a.interopDefault(l),u=e("./utils"),p=e("./scheme"),d=a.interopDefault(p),f=e("./config"),h=a.interopDefault(f),m=e("./template"),g=a.interopDefault(m),v=e("./i18n"),y=a.interopDefault(v),b=e("./player"),x=a.interopDefault(b),w=e("./control"),j=a.interopDefault(w),k=e("./contextmenu"),S=a.interopDefault(k),I=e("./info"),T=a.interopDefault(I),O=e("./subtitle"),E=a.interopDefault(O),M=e("./events"),$=a.interopDefault(M),F=e("./hotkey"),C=a.interopDefault(F),H=e("./layer"),D=a.interopDefault(H),B=e("./loading"),z=a.interopDefault(B),A=e("./notice"),R=a.interopDefault(A),L=e("./mask"),P=a.interopDefault(L),N=e("./icons"),Z=a.interopDefault(N),_=e("./setting"),q=a.interopDefault(_),V=e("./storage"),W=a.interopDefault(V),U=e("./plugins"),Y=a.interopDefault(U);let K=0,X=[];class G extends c.default{constructor(e,t){super(),this.id=++K;let r=u.mergeDeep(G.option,e);if(r.container=e.container,this.option=(0,s.default)(r,d.default),this.isLock=!1,this.isReady=!1,this.isFocus=!1,this.isInput=!1,this.isRotate=!1,this.isDestroy=!1,this.template=new g.default(this),this.events=new $.default(this),this.storage=new W.default(this),this.icons=new Z.default(this),this.i18n=new y.default(this),this.notice=new R.default(this),this.player=new x.default(this),this.layers=new D.default(this),this.controls=new j.default(this),this.contextmenu=new S.default(this),this.subtitle=new E.default(this),this.info=new T.default(this),this.loading=new z.default(this),this.hotkey=new C.default(this),this.mask=new P.default(this),this.setting=new q.default(this),this.plugins=new Y.default(this),"function"==typeof t&&this.on("ready",()=>t.call(this,this)),G.DEBUG){let e=e=>console.log(`[ART.${this.id}] -> ${e}`);e("Version@"+G.version),e("Env@"+G.env),e("Build@"+G.build);for(let t=0;t<h.default.events.length;t++)this.on("video:"+h.default.events[t],t=>e("Event@"+t.type))}X.push(this)}static get instances(){return X}static get version(){return"5.1.2"}static get env(){return"production"}static get build(){return"2024-05-27 12:43:07"}static get config(){return h.default}static get utils(){return u}static get scheme(){return d.default}static get Emitter(){return c.default}static get validator(){return s.default}static get kindOf(){return s.default.kindOf}static get html(){return g.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,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:e=>e},moreVideoAttr:{controls:!1,preload:u.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),X.splice(X.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}r.default=G,G.DEBUG=!1,G.CONTEXTMENU=!0,G.NOTICE_TIME=2e3,G.SETTING_WIDTH=250,G.SETTING_ITEM_WIDTH=200,G.SETTING_ITEM_HEIGHT=35,G.RESIZE_TIME=200,G.SCROLL_TIME=200,G.SCROLL_GAP=50,G.AUTO_PLAYBACK_MAX=10,G.AUTO_PLAYBACK_MIN=5,GLine truncated
|
||||
@@ -4,4 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,n,o){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[n]&&a[n],i=s.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!i[t]){if(!e[t]){var o="function"==typeof a[n]&&a[n];if(!r&&o)return o(t,!0);if(s)return s(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}f.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},f.cache={};var p=i[t]=new c.Module(t);e[t][0].call(p.exports,f,p,p.exports,this)}return i[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=i,c.parent=s,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return a[n]}}),a[n]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"7Csdv":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return er});var o=e("@swc/helpers/_/_assert_this_initialized"),a=e("@swc/helpers/_/_class_call_check"),s=e("@swc/helpers/_/_create_class"),i=e("@swc/helpers/_/_inherits"),l=e("@swc/helpers/_/_create_super"),c=e("bundle-text:./style/index.less"),u=n.interopDefault(c),p=e("option-validator"),f=n.interopDefault(p),d=e("./utils/emitter"),h=n.interopDefault(d),m=e("./utils"),v=e("./scheme"),g=n.interopDefault(v),_=e("./config"),y=n.interopDefault(_),b=e("./template"),w=n.interopDefault(b),x=e("./i18n"),j=n.interopDefault(x),k=e("./player"),T=n.interopDefault(k),S=e("./control"),M=n.interopDefault(S),I=e("./contextmenu"),E=n.interopDefault(I),F=e("./info"),C=n.interopDefault(F),O=e("./subtitle"),R=n.interopDefault(O),D=e("./events"),P=n.interopDefault(D),A=e("./hotkey"),z=n.interopDefault(A),V=e("./layer"),$=n.interopDefault(V),L=e("./loading"),q=n.interopDefault(L),H=e("./notice"),N=n.interopDefault(H),W=e("./mask"),B=n.interopDefault(W),U=e("./icons"),Y=n.interopDefault(U),K=e("./setting"),X=n.interopDefault(K),G=e("./storage"),J=n.interopDefault(G),Z=e("./plugins"),Q=n.interopDefault(Z),ee=0,et=[],er=function(e){(0,i._)(r,e);var t=(0,l._)(r);function r(e,n){(0,a._)(this,r),(s=t.call(this)).id=++ee;var s,i=m.mergeDeep(r.option,e);if(i.container=e.container,s.option=(0,f.default)(i,g.default),s.isLock=!1,s.isReady=!1,s.isFocus=!1,s.isInput=!1,s.isRotate=!1,s.isDestroy=!1,s.template=new w.default((0,o._)(s)),s.events=new P.default((0,o._)(s)),s.storage=new J.default((0,o._)(s)),s.icons=new Y.default((0,o._)(s)),s.i18n=new j.default((0,o._)(s)),s.notice=new N.default((0,o._)(s)),s.player=new T.default((0,o._)(s)),s.layers=new $.default((0,o._)(s)),s.controls=new M.default((0,o._)(s)),s.contextmenu=new E.default((0,o._)(s)),s.subtitle=new R.default((0,o._)(s)),s.info=new C.default((0,o._)(s)),s.loading=new q.default((0,o._)(s)),s.hotkey=new z.default((0,o._)(s)),s.mask=new B.default((0,o._)(s)),s.setting=new X.default((0,o._)(s)),s.plugins=new Q.default((0,o._)(s)),"function"==typeof n&&s.on("ready",function(){return n.call((0,o._)(s),(0,o._)(s))}),r.DEBUG){var l=function(e){return console.log("[ART.".concat(s.id,"] ->").concat(e))};l("Version@"+r.version),l("Env@"+r.env),l("Build@"+r.build);for(var c=0;c<y.default.events.length;c++)s.on("video:"+y.default.events[c],function(e){return l("Event@"+e.type)})}return et.push((0,o._)(s)),s}return(0,s._)(r,[{key:"proxy",get:function(){return this.events.proxy}},{key:"query",get:function(){return this.template.query}},{key:"video",get:function(){return this.template.$video}},{key:"destroy",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.events.destroy(),this.template.destroy(e),et.splice(et.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return et}},{key:"version",get:function(){return"5.1.2"}},{key:"env",get:function(){return"production"}},{key:"build",get:function(){return"2024-05-27 09:59:57"}},{key:"config",get:function(){return y.default}},{key:"utils",get:function(){return m}},{key:"scheme",get:function(){return g.default}},{key:"Emitter",get:function(){return h.default}},{key:"validator",get:function(){return f.default}},{key:"kindOf",get:function(){return f.default.kindOf}},{key:"html",get:function(){return w.default.html}},{key:"option",get:function(){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,plaLine truncated
|
||||
!function(e,t,r,n,o){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[n]&&a[n],i=s.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!i[t]){if(!e[t]){var o="function"==typeof a[n]&&a[n];if(!r&&o)return o(t,!0);if(s)return s(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}f.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},f.cache={};var p=i[t]=new c.Module(t);e[t][0].call(p.exports,f,p,p.exports,this)}return i[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=i,c.parent=s,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return a[n]}}),a[n]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"7Csdv":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return er});var o=e("@swc/helpers/_/_assert_this_initialized"),a=e("@swc/helpers/_/_class_call_check"),s=e("@swc/helpers/_/_create_class"),i=e("@swc/helpers/_/_inherits"),l=e("@swc/helpers/_/_create_super"),c=e("bundle-text:./style/index.less"),u=n.interopDefault(c),p=e("option-validator"),f=n.interopDefault(p),d=e("./utils/emitter"),h=n.interopDefault(d),m=e("./utils"),v=e("./scheme"),g=n.interopDefault(v),_=e("./config"),y=n.interopDefault(_),b=e("./template"),w=n.interopDefault(b),x=e("./i18n"),j=n.interopDefault(x),k=e("./player"),T=n.interopDefault(k),S=e("./control"),M=n.interopDefault(S),I=e("./contextmenu"),E=n.interopDefault(I),F=e("./info"),C=n.interopDefault(F),O=e("./subtitle"),R=n.interopDefault(O),D=e("./events"),P=n.interopDefault(D),A=e("./hotkey"),z=n.interopDefault(A),V=e("./layer"),$=n.interopDefault(V),L=e("./loading"),q=n.interopDefault(L),H=e("./notice"),N=n.interopDefault(H),W=e("./mask"),B=n.interopDefault(W),U=e("./icons"),Y=n.interopDefault(U),K=e("./setting"),X=n.interopDefault(K),G=e("./storage"),J=n.interopDefault(G),Z=e("./plugins"),Q=n.interopDefault(Z),ee=0,et=[],er=function(e){(0,i._)(r,e);var t=(0,l._)(r);function r(e,n){(0,a._)(this,r),(s=t.call(this)).id=++ee;var s,i=m.mergeDeep(r.option,e);if(i.container=e.container,s.option=(0,f.default)(i,g.default),s.isLock=!1,s.isReady=!1,s.isFocus=!1,s.isInput=!1,s.isRotate=!1,s.isDestroy=!1,s.template=new w.default((0,o._)(s)),s.events=new P.default((0,o._)(s)),s.storage=new J.default((0,o._)(s)),s.icons=new Y.default((0,o._)(s)),s.i18n=new j.default((0,o._)(s)),s.notice=new N.default((0,o._)(s)),s.player=new T.default((0,o._)(s)),s.layers=new $.default((0,o._)(s)),s.controls=new M.default((0,o._)(s)),s.contextmenu=new E.default((0,o._)(s)),s.subtitle=new R.default((0,o._)(s)),s.info=new C.default((0,o._)(s)),s.loading=new q.default((0,o._)(s)),s.hotkey=new z.default((0,o._)(s)),s.mask=new B.default((0,o._)(s)),s.setting=new X.default((0,o._)(s)),s.plugins=new Q.default((0,o._)(s)),"function"==typeof n&&s.on("ready",function(){return n.call((0,o._)(s),(0,o._)(s))}),r.DEBUG){var l=function(e){return console.log("[ART.".concat(s.id,"] ->").concat(e))};l("Version@"+r.version),l("Env@"+r.env),l("Build@"+r.build);for(var c=0;c<y.default.events.length;c++)s.on("video:"+y.default.events[c],function(e){return l("Event@"+e.type)})}return et.push((0,o._)(s)),s}return(0,s._)(r,[{key:"proxy",get:function(){return this.events.proxy}},{key:"query",get:function(){return this.template.query}},{key:"video",get:function(){return this.template.$video}},{key:"destroy",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.events.destroy(),this.template.destroy(e),et.splice(et.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return et}},{key:"version",get:function(){return"5.1.2"}},{key:"env",get:function(){return"production"}},{key:"build",get:function(){return"2024-05-27 12:43:08"}},{key:"config",get:function(){return y.default}},{key:"utils",get:function(){return m}},{key:"scheme",get:function(){return g.default}},{key:"Emitter",get:function(){return h.default}},{key:"validator",get:function(){return f.default}},{key:"kindOf",get:function(){return f.default.kindOf}},{key:"html",get:function(){return w.default.html}},{key:"option",get:function(){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,plaLine truncated
|
||||
@@ -4,19 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,i,a,n){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof o[a]&&o[a],l=s.cache||{},r="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,i){if(!l[t]){if(!e[t]){var n="function"==typeof o[a]&&o[a];if(!i&&n)return n(t,!0);if(s)return s(t,!0);if(r&&"string"==typeof t)return r(t);var p=Error("Cannot find module '"+t+"'");throw p.code="MODULE_NOT_FOUND",p}h.resolve=function(i){var a=e[t][1][i];return null!=a?a:i},h.cache={};var u=l[t]=new d.Module(t);e[t][0].call(u.exports,h,u,u.exports,this)}return l[t].exports;function h(e){var t=h.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.exports={}},d.modules=e,d.cache=l,d.parent=s,d.register=function(t,i){e[t]=[function(e,t){t.exports=i},{}]},Object.defineProperty(d,"root",{get:function(){return o[a]}}),o[a]=d;for(var p=0;p<t.length;p++)d(t[p]);if(i){var u=d(i);"object"==typeof exports&&"undefined"!=typeof module?module.exports=u:"function"==typeof define&&define.amd&&define(function(){return u})}}({bgm6t:[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i),a.export(i,"default",()=>p);var n=e("./danmuku"),o=a.interopDefault(n),s=e("./setting"),l=a.interopDefault(s),r=e("./heatmap"),d=a.interopDefault(r);function p(e){return t=>{let i=new o.default(t,e),a=new l.default(t,i);return i.option.heatmap&&(0,d.default)(t,i,i.option.heatmap),{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:a.mount.bind(a),get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}p.icons=l.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=p)},{"./danmuku":"4ns48","./setting":"lO8OT","./heatmap":"8AxLD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ns48":[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i);var n=e("./bilibili"),o=e("bundle-text:./worker"),s=a.interopDefault(o);class l{constructor(e,t){let{constructor:i,template:a}=e;this.utils=i.utils,this.validator=i.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=e,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(t),this.worker=new Worker(URL.createObjectURL(new Blob([s.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),e.on("video:play",this.start),e.on("video:playing",this.start),e.on("video:pause",this.stop),e.on("video:waiting",this.stop),e.on("destroy",this.destroy),e.on("resize",this.reset),this.load()}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,maxLength:200,lockTime:5,theme:"dark"}}static get scheme(){return{danmuku:"array|function|string",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement",heatmap:"object|boolean",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",maxLength:"number",lockTime:"number",theme:"string"}}static get cssText(){return`
|
||||
user-select: none;
|
||||
position: absolute;
|
||||
white-space: pre;
|
||||
pointer-events: none;
|
||||
perspective: 500px;
|
||||
display: inline-block;
|
||||
will-change: transform;
|
||||
font-weight: normal;
|
||||
line-height: 1.125;
|
||||
visibility: hidden;
|
||||
font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;
|
||||
text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;
|
||||
`}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){let{clamp:e}=this.utils,t=this.option.margin[0],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[0]}get marginBottom(){let{clamp:e}=this.utils,t=this.option.margin[1],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[1]}async load(){let{errorHandle:e}=this.utils;try{"function"==typeof this.option.danmuku?this.danmus=await this.option.danmuku():"function"==typeof this.option.danmuku.then?this.danmus=await this.option.danmuku:"string"==typeof this.option.danmuku?this.danmus=await (0,n.bilibiliDanmuParseFromUrl)(this.option.danmuku):this.danmus=this.option.danmuku,e(Array.isArray(this.danmus),"Danmuku need return an array as result"),this.queue=[],this.$danmuku.innerText="",this.danmus.forEach(e=>this.emit(e)),this.art.emit("artplayerPluginDanmuku:loaded",this.queue)}catch(e){throw this.art.emit("artplayerPluginDanmuku:error",e),e}return this}emit(e){let{clamp:t}=this.utils;return this.validator(e,{text:"string",mode:"?number",color:"?string",time:"?number",border:"?boolean",style:"?object",escape:"?boolean"}),e.text.trim()&&(e.time?e.time=t(e.time,0,1/0):e.time=this.art.currentTime+.5,void 0===e.mode&&(e.mode=this.option.mode),void 0===e.style&&(e.style={}),void 0===e.escape&&(e.escape=!0),void 0===e.color&&(e.color=this.option.color),[0,1,2].includes(e.mode)&&this.option.filter(e)&&this.queue.push({...e,$state:"wait",$ref:null,$restTime:0,$lastStartTime:0})),this}config(e){let{clamp:t}=this.utils,{$controlsCenter:i}=this.art.template;if(this.option=Object.assign({},l.option,this.option,e),this.validator(this.option,l.scheme),this.option.mode=t(this.option.mode,0,2),this.option.speed=t(this.option.speed,1,10),this.option.opacity=t(this.option.opacity,0,1),this.option.lockTime=t(this.option.lockTime,1,60),this.option.maxLength=t(this.option.maxLength,1,1e3),this.option.mount=this.option.mount||i,e.fontSize){let e=this.getFontSize(this.option.fontSize);e!==this.option.fontSize&&(this.option.fontSize=e,this.reset())}return this.option.visible?this.show():this.hide(),this.art.emit("artplayerPluginDanmuku:config",this.option),this}getLeft(e){let t=e.getBoundingClientRect();return this.isRotate?t.top:t.left}getRef(){let e=this.$refs.pop()||document.createElement("div");return e.style.cssText=l.cssText,e.dataset.mode="",e}getFontSize(e){let{clamp:t}=this.utils,{clientHeight:i}=this.$player;return"number"==typeof e?t(e,12,i):"string"==typeof e&&e.endsWith("%")?t(i*(parseFloat(e)/100),12,i):l.option.fontSize}postMessage(e={}){return new Promise(t=>{e.id=Date.now(),this.worker.postMessage(e),this.worker.onmessage=i=>{let{data:a}=i;a.id===e.id&&t(a)}})}filter(e,t){return this.queue.filter(t=>t.$state===e).map(t)}getReady(){let{currentTime:e}=this.art;return this.queue.filter(t=>"ready"===t.$state||"wait"===t.$state&&e+.1>=t.time&&t.time>=e-.1)}getEmits(){let e=[],{clientWidth:t}=this.$player,i=this.getLeft(this.$player);return this.filter("emit",a=>{let n=a.$ref.offsetTop,o=this.getLeft(a.$ref)-i,s=a.$ref.clientHeight,l=a.$ref.clientWidth,r=o+l,d=r/a.$restTime,p={};p.top=n,p.left=o,p.height=s,p.width=l,p.right=t-r,p.speed=d,p.distance=r,p.time=a.$restTime,p.mode=a.mode,e.push(p)}),e}makeWait(e){e.$state="wait",e.$ref&&(e.$ref.style.cssText=l.cssText,this.$refs.push(e.$ref),e.$ref=null)}update(){let{setStyles:e}=this.utils;return this.timer=window.requestAnimationFrame(async()=>{if(this.art.playing&&!this.isHide){this.filter("emit",e=>{let t=(Date.now()-e.$lastStartTime)/1e3;e.$restTime-=t,e.$lastStartTime=Date.now(),e.$restTime<=0&&this.makeWait(e)});let t=this.getReady();for(let i=0;i<t.length;i++){let a=t[i];if(await this.option.beforeVisible(a)){let{clientWidth:t,clientHeight:i}=this.$player;a.$ref=this.getRef(),a.escape?a.$ref.innerText=a.text:a.$ref.innerHTML=a.text,this.$danmuku.appendChild(a.$ref),a.$ref.style.left=`${t}px`,a.$ref.style.opacity=this.option.opacity,a.$ref.style.fontSize=`${this.option.fontSize}px`,a.$ref.style.color=a.color,a.$ref.style.border=a.border?`1px solid ${a.color}`:null,a.$ref.style.backgroundColor=a.border?"rgb(0 0 0 / 50%)":null,a.$ref.style.marginLeft="0px",e(a.$ref,a.style),a.$lastStartTime=Date.now(),a.$restTime=this.option.synchronousPlayback&&this.art.playbackRate?this.option.speed/Number(this.art.playbackRate):this.option.speed;let{top:n}=await this.postMessage({target:{mode:a.mode,height:a.$ref.clientHeight,speed:(t+a.$ref.clientWidth)/a.$restTime},emits:this.getEmits(),antiOverlap:this.option.antiOverlap,clientWidth:t,clientHeight:i,marginBottom:this.marginBottom,marginTop:this.marginTop});if(a.$ref){if(this.isStop||void 0===n)a.$state="ready",this.$refs.push(a.$ref),a.$ref=null;else switch(a.$state="emit",a.$ref.style.visibility="visible",a.$ref.dataset.mode=a.mode,this.art.emit("artplayerPluginDanmuk
Line truncated
|
||||
\u{9632}\u{6B62}\u{5F39}\u{5E55}\u{91CD}\u{53E0}</div><div class="apd-other apd-sync-video">${D.default}${S.default}
|
||||
\u{540C}\u{6B65}\u{89C6}\u{9891}\u{901F}\u{5EA6}</div></div><div class="apd-config-slider apd-config-opacity">\u{4E0D}\u{900F}\u{660E}\u{5EA6}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div><div class="apd-config-slider apd-config-margin">\u{663E}\u{793A}\u{533A}\u{57DF}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div><div class="apd-config-slider apd-config-fontSize">\u{5F39}\u{5E55}\u{5B57}\u{53F7}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div><div class="apd-config-slider apd-config-speed">\u{5F39}\u{5E55}\u{901F}\u{5EA6}<div class="apd-slider"></div><div class="apd-value">\u{672A}\u{77E5}</div></div></div></div></div><div class="apd-emitter"><div class="apd-style">${m.default}<div class="apd-style-panel"><div class="apd-style-panel-inner"><div class="apd-style-mode">\u{6A21}\u{5F0F}<div class="apd-modes"><div data-mode="0" class="apd-mode">${v.default}<div>\u{6EDA}\u{52A8}</div></div><div data-mode="1" class="apd-mode">${b.default}<div>\u{9876}\u{90E8}</div></div><div data-mode="2" class="apd-mode">${E.default}<div>\u{5E95}\u{90E8}</div></div></div></div><div class="apd-style-color">\u{989C}\u{8272}<div class="apd-colors">${this.COLOR.map(e=>`<div data-color="${e}" class="apd-color" style="background-color: ${e}"></div>`).join("")}</div></div></div></div></div><input class="apd-input" placeholder="\u{53D1}\u{4E2A}\u{53CB}\u{5584}\u{7684}\u{5F39}\u{5E55}\u{89C1}\u{8BC1}\u{5F53}\u{4E0B}" autocomplete="off" maxLength="${e.maxLength}" /><div class="apd-send">\u{53D1}\u{9001}</div></div>`}get MARGIN(){return this.option.MARGIN||[{name:"1/4",value:[10,"75%"]},{name:"半屏",value:[10,"50%"]},{name:"3/4",value:[10,"25%"]},{name:"满屏",value:[10,10]}]}get SPEED(){return this.option.SPEED||[{name:"极慢",value:10},{name:"较慢",value:7.5,hide:!0},{name:"适中",value:5},{name:"较快",value:2.5,hide:!0},{name:"极快",value:1}]}get COLOR(){return this.option.COLOR||["#FE0302","#FF7204","#FFAA02","#FFD302","#FFFF00","#A0EE00","#00CD00","#019899","#4266BE","#89D5FF","#CC0273","#222222","#9B9B9B","#FFFFFF"]}query(e){let{query:t}=this.utils,{$danmuku:i}=this.template;return t(e,i)}setData(e,t){let{$player:i}=this.art.template,{$mount:a}=this.template;i.dataset[e]=t,this.outside&&(a.dataset[e]=t)}createTemplate(){let{createElement:e,tooltip:t}=this.utils,i=e("div");i.className="artplayer-plugin-danmuku",i.innerHTML=this.TEMPLATE,this.template.$danmuku=i,this.template.$toggle=this.query(".apd-toggle"),t(this.template.$toggle,"弹幕开关"),this.template.$configModes=this.query(".apd-config-mode .apd-modes"),this.template.$styleModes=this.query(".apd-style-mode .apd-modes"),this.template.$colors=this.query(".apd-colors"),this.template.$antiOverlap=this.query(".apd-anti-overlap"),this.template.$syncVideo=this.query(".apd-sync-video"),this.template.$opacitySlider=this.query(".apd-config-opacity .apd-slider"),this.template.$opacityValue=this.query(".apd-config-opacity .apd-value"),this.template.$marginSlider=this.query(".apd-config-margin .apd-slider"),this.template.$marginValue=this.query(".apd-config-margin .apd-value"),this.template.$fontSizeSlider=this.query(".apd-config-fontSize .apd-slider"),this.template.$fontSizeValue=this.query(".apd-config-fontSize .apd-value"),this.template.$speedSlider=this.query(".apd-config-speed .apd-slider"),this.template.$speedValue=this.query(".apd-config-speed .apd-value"),this.template.$input=this.query(".apd-input"),this.template.$send=this.query(".apd-send")}createEvents(){let{$toggle:e,$configModes:t,$styleModes:i,$colors:a,$antiOverlap:n,$syncVideo:o,$send:s,$input:l}=this.template;this.art.proxy(e,"click",()=>{this.danmuku.config({visible:!this.option.visible}),this.reset()}),this.art.proxy(t,"click",e=>{let t=e.target.closest(".apd-mode");if(!t)return;let i=Number(t.dataset.mode);this.option.modes.includes(i)?this.danmuku.config({modes:this.option.modes.filter(e=>e!==i)}):this.danmuku.config({modes:[...this.option.modes,i]}),this.reset()}),this.art.proxy(n,"click",()=>{this.danmuku.config({antiOverlap:!this.option.antiOverlap}),this.reset()}),this.art.proxy(o,"click",()=>{this.danmuku.config({synchronousPlayback:!this.option.synchronousPlayback}),this.reset()}),this.art.proxy(i,"click",e=>{let t=e.target.closest(".apd-mode");if(!t)return;let i=Number(t.dataset.mode);this.danmuku.config({mode:i}),this.reset()}),this.art.proxy(a,"click",e=>{let t=e.target.closest(".apd-color");t&&(this.danmuku.config({color:t.dataset.color}),this.reset())}),this.art.proxy(s,"click",()=>this.emit()),this.art.proxy(l,"keypress",e=>{"Enter"===e.key&&(e.preventDefault(),this.emit())})}createSliders(){this.slider.opacity=this.createSlider({min:0,max:100,steps:[],container:this.template.$opacitySlider,findIndex:()=>Math.round(100*this.option.opacity),onChange:e=>{let{$opacityValue:t}=this.template;t.textContent=`${e}%`;let i=e/100;i!==this.option.opacity&&this.danmuku.cLine truncated
|
||||
!function(e,t,i,a,n){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof o[a]&&o[a],l=s.cache||{},r="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(t,i){if(!l[t]){if(!e[t]){var n="function"==typeof o[a]&&o[a];if(!i&&n)return n(t,!0);if(s)return s(t,!0);if(r&&"string"==typeof t)return r(t);var p=Error("Cannot find module '"+t+"'");throw p.code="MODULE_NOT_FOUND",p}h.resolve=function(i){var a=e[t][1][i];return null!=a?a:i},h.cache={};var u=l[t]=new d.Module(t);e[t][0].call(u.exports,h,u,u.exports,this)}return l[t].exports;function h(e){var t=h.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.exports={}},d.modules=e,d.cache=l,d.parent=s,d.register=function(t,i){e[t]=[function(e,t){t.exports=i},{}]},Object.defineProperty(d,"root",{get:function(){return o[a]}}),o[a]=d;for(var p=0;p<t.length;p++)d(t[p]);if(i){var u=d(i);"object"==typeof exports&&"undefined"!=typeof module?module.exports=u:"function"==typeof define&&define.amd&&define(function(){return u})}}({bgm6t:[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i),a.export(i,"default",()=>p);var n=e("./danmuku"),o=a.interopDefault(n),s=e("./setting"),l=a.interopDefault(s),r=e("./heatmap"),d=a.interopDefault(r);function p(e){return t=>{let i=new o.default(t,e),a=new l.default(t,i);return i.option.heatmap&&(0,d.default)(t,i,i.option.heatmap),{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),load:i.load.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),reset:i.reset.bind(i),mount:a.mount.bind(a),get option(){return i.option},get isHide(){return i.isHide},get isStop(){return i.isStop}}}}p.icons=l.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=p)},{"./danmuku":"4ns48","./setting":"lO8OT","./heatmap":"8AxLD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ns48":[function(e,t,i){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(i);var n=e("./bilibili"),o=e("bundle-text:./worker"),s=a.interopDefault(o);class l{constructor(e,t){let{constructor:i,template:a}=e;this.utils=i.utils,this.validator=i.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=e,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(t),this.worker=new Worker(URL.createObjectURL(new Blob([s.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),e.on("video:play",this.start),e.on("video:playing",this.start),e.on("video:pause",this.stop),e.on("video:waiting",this.stop),e.on("destroy",this.destroy),e.on("resize",this.reset),this.load()}static get option(){return{danmuku:[],speed:5,margin:[10,"25%"],opacity:1,color:"#FFFFFF",mode:0,modes:[0,1,2],fontSize:25,antiOverlap:!0,synchronousPlayback:!1,mount:void 0,heatmap:!1,points:[],filter:()=>!0,beforeEmit:()=>!0,beforeVisible:()=>!0,visible:!0,maxLength:200,lockTime:5,theme:"dark"}}static get scheme(){return{danmuku:"array|function|string",speed:"number",margin:"array",opacity:"number",color:"string",mode:"number",modes:"array",fontSize:"number|string",antiOverlap:"boolean",synchronousPlayback:"boolean",mount:"?htmldivelement",heatmap:"object|boolean",points:"array",filter:"function",beforeEmit:"function",beforeVisible:"function",visible:"boolean",maxLength:"number",lockTime:"number",theme:"string"}}static get cssText(){return` user-select: none; position: absolute; white-space: pre; pointer-events: none; perspective: 500px; display: inline-block; will-change: transform; font-weight: normal; line-height: 1.125; visibility: hidden; font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif; text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px; `}get isRotate(){return this.art.plugins?.autoOrientation?.state}get marginTop(){let{clamp:e}=this.utils,t=this.option.margin[0],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[0]}get marginBottom(){let{clamp:e}=this.utils,t=this.option.margin[1],{clientHeight:i}=this.$player;return"number"==typeof t?e(t,0,i):"string"==typeof t&&t.endsWith("%")?e(i*(parseFloat(t)/100),0,i):l.option.margin[1]}async load(){let{errorHandle:e}=this.utils;try{"function"==typeof this.option.danmuku?this.danmus=await this.option.danmuku():"function"==typeof this.option.danmuku.then?this.danmus=await this.option.danmuku:"string"==typeof this.option.danmuku?this.danmus=await (0,n.bilibiliDanmuParseFromUrl)(this.option.danmuku):this.danmus=this.option.danmuku,e(Array.isArray(this.danmus),"Danmuku need return an array as result"),this.queue=[],this.$danmukuLine truncated
|
||||
@@ -4,4 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,n,a){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof o[n]&&o[n],s=i.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,r){if(!s[t]){if(!e[t]){var a="function"==typeof o[n]&&o[n];if(!r&&a)return a(t,!0);if(i)return i(t,!0);if(l&&"string"==typeof t)return l(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},d.cache={};var p=s[t]=new u.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[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=s,u.parent=i,u.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return o[n]}}),o[n]=u;for(var c=0;c<t.length;c++)u(t[c]);if(r){var p=u(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"40mNk":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return c});var a=e("./danmuku"),o=n.interopDefault(a),i=e("./setting"),s=n.interopDefault(i),l=e("./heatmap"),u=n.interopDefault(l);function c(e){return function(t){var r=new o.default(t,e),n=new s.default(t,r);return r.option.heatmap&&(0,u.default)(t,r,r.option.heatmap),{name:"artplayerPluginDanmuku",emit:r.emit.bind(r),load:r.load.bind(r),config:r.config.bind(r),hide:r.hide.bind(r),show:r.show.bind(r),reset:r.reset.bind(r),mount:n.mount.bind(n),get option(){return r.option},get isHide(){return r.isHide},get isStop(){return r.isStop}}}}c.icons=s.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=c)},{"./danmuku":"jgffw","./setting":"d3V7t","./heatmap":"dXFn2","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],jgffw:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return f});var a=e("@swc/helpers/_/_async_to_generator"),o=e("@swc/helpers/_/_class_call_check"),i=e("@swc/helpers/_/_create_class"),s=e("@swc/helpers/_/_object_spread"),l=e("@swc/helpers/_/_object_spread_props"),u=e("@swc/helpers/_/_ts_generator"),c=e("./bilibili"),p=e("bundle-text:./worker"),d=n.interopDefault(p),f=function(){function e(t,r){(0,o._)(this,e);var n=t.constructor,a=t.template;this.utils=n.utils,this.validator=n.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=t,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(r),this.worker=new Worker(URL.createObjectURL(new Blob([d.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("destroy",this.destroy),t.on("resize",this.reset),this.load()}return(0,i._)(e,[{key:"isRotate",get:function(){var e,t;return null===(t=this.art.plugins)||void 0===t?void 0:null===(e=t.autoOrientation)||void 0===e?void 0:e.state}},{key:"marginTop",get:function(){var t=this.utils.clamp,r=this.option.margin[0],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[0]}},{key:"marginBottom",get:function(){var t=this.utils.clamp,r=this.option.margin[1],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[1]}},{key:"load",value:function(){var e=this;return(0,a._)(function(){var t,r;return(0,u._)(this,function(n){switch(n.label){case 0:t=e.utils.errorHandle,n.label=1;case 1:if(n.trys.push([1,9,,10]),"function"!=typeof e.option.danmuku)return[3,3];return[4,e.option.danmuku()];case 2:case 4:case 6:return e.danmus=n.sent(),[3,8];case 3:if("function"!=typeof e.option.danmuku.then)return[3,5];return[4,e.option.danmuku];case 5:if("string"!=typeof e.option.danmuku)return[3,7];return[4,(0,c.bilibiliDanmuParseFromUrl)(e.option.danmuku)];case 7:e.danmus=e.option.danmuku,n.label=8;case 8:return t(Array.isArray(e.danmus),"Danmuku need return an array as result"),e.queue=[],e.$danmuku.innerText="",e.danmus.forEach(function(t){return e.emit(t)}),e.art.emit("artplayerPluginDanmuku:loaded",e.queue),[3,10];case 9:throw r=n.sent(),e.art.emit("artplayerPluginDanmuku:error",r),r;case 10:return[2,e]}})})()}},{key:"emit",value:function(e){var t=this.utils.clamp;return this.validator(e,{text:"string",mode:"?number",color:"?string",time:"?number",border:"?boolean",style:"?object",escape:"?boolean"}),e.text.trim()&&(e.time?e.time=t(e.time,0,1/0):e.time=this.Line truncated
|
||||
!function(e,t,r,n,a){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof o[n]&&o[n],s=i.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,r){if(!s[t]){if(!e[t]){var a="function"==typeof o[n]&&o[n];if(!r&&a)return a(t,!0);if(i)return i(t,!0);if(l&&"string"==typeof t)return l(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}d.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},d.cache={};var p=s[t]=new u.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[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=s,u.parent=i,u.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return o[n]}}),o[n]=u;for(var c=0;c<t.length;c++)u(t[c]);if(r){var p=u(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"40mNk":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return c});var a=e("./danmuku"),o=n.interopDefault(a),i=e("./setting"),s=n.interopDefault(i),l=e("./heatmap"),u=n.interopDefault(l);function c(e){return function(t){var r=new o.default(t,e),n=new s.default(t,r);return r.option.heatmap&&(0,u.default)(t,r,r.option.heatmap),{name:"artplayerPluginDanmuku",emit:r.emit.bind(r),load:r.load.bind(r),config:r.config.bind(r),hide:r.hide.bind(r),show:r.show.bind(r),reset:r.reset.bind(r),mount:n.mount.bind(n),get option(){return r.option},get isHide(){return r.isHide},get isStop(){return r.isStop}}}}c.icons=s.default.icons,"undefined"!=typeof window&&(window.artplayerPluginDanmuku=c)},{"./danmuku":"jgffw","./setting":"d3V7t","./heatmap":"dXFn2","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],jgffw:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return f});var a=e("@swc/helpers/_/_async_to_generator"),o=e("@swc/helpers/_/_class_call_check"),i=e("@swc/helpers/_/_create_class"),s=e("@swc/helpers/_/_object_spread"),l=e("@swc/helpers/_/_object_spread_props"),u=e("@swc/helpers/_/_ts_generator"),c=e("./bilibili"),p=e("bundle-text:./worker"),d=n.interopDefault(p),f=function(){function e(t,r){(0,o._)(this,e);var n=t.constructor,a=t.template;this.utils=n.utils,this.validator=n.validator,this.$danmuku=a.$danmuku,this.$player=a.$player,this.art=t,this.danmus=[],this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(r),this.worker=new Worker(URL.createObjectURL(new Blob([d.default]))),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),t.on("video:play",this.start),t.on("video:playing",this.start),t.on("video:pause",this.stop),t.on("video:waiting",this.stop),t.on("destroy",this.destroy),t.on("resize",this.reset),this.load()}return(0,i._)(e,[{key:"isRotate",get:function(){var e,t;return null===(t=this.art.plugins)||void 0===t?void 0:null===(e=t.autoOrientation)||void 0===e?void 0:e.state}},{key:"marginTop",get:function(){var t=this.utils.clamp,r=this.option.margin[0],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[0]}},{key:"marginBottom",get:function(){var t=this.utils.clamp,r=this.option.margin[1],n=this.$player.clientHeight;return"number"==typeof r?t(r,0,n):"string"==typeof r&&r.endsWith("%")?t(n*(parseFloat(r)/100),0,n):e.option.margin[1]}},{key:"load",value:function(){var e=this;return(0,a._)(function(){var t,r;return(0,u._)(this,function(n){switch(n.label){case 0:t=e.utils.errorHandle,n.label=1;case 1:if(n.trys.push([1,9,,10]),"function"!=typeof e.option.danmuku)return[3,3];return[4,e.option.danmuku()];case 2:case 4:case 6:return e.danmus=n.sent(),[3,8];case 3:if("function"!=typeof e.option.danmuku.then)return[3,5];return[4,e.option.danmuku];case 5:if("string"!=typeof e.option.danmuku)return[3,7];return[4,(0,c.bilibiliDanmuParseFromUrl)(e.option.danmuku)];case 7:e.danmus=e.option.danmuku,n.label=8;case 8:return t(Array.isArray(e.danmus),"Danmuku need return an array as result"),e.queue=[],e.$danmuku.innerText="",e.danmus.forEach(function(t){return e.emit(t)}),e.art.emit("artplayerPluginDanmuku:loaded",e.queue),[3,10];case 9:throw r=n.sent(),e.art.emit("artplayerPluginDanmuku:error",r),r;case 10:return[2,e]}})})()}},{key:"emit",value:function(e){var t=this.utils.clamp;return this.validator(e,{text:"string",mode:"?number",color:"?string",time:"?number",border:"?boolean",style:"?object",escape:"?boolean"}),e.text.trim()&&(e.time?e.time=t(e.time,0,1/0):e.time=this.Line truncated
|
||||
Vendored
+1
-1
@@ -4,4 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,a,i){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n="function"==typeof o[a]&&o[a],s=n.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!s[t]){if(!e[t]){var i="function"==typeof o[a]&&o[a];if(!r&&i)return i(t,!0);if(n)return n(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}d.resolve=function(r){var a=e[t][1][r];return null!=a?a:r},d.cache={};var p=s[t]=new c.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=s,c.parent=n,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return o[a]}}),o[a]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({abjMI:[function(e,t,r){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r);var i=e("bundle-text:./style/index.less"),o=a.interopDefault(i),n=e("option-validator"),s=a.interopDefault(n),l=e("./utils/emitter"),c=a.interopDefault(l),u=e("./utils"),p=e("./scheme"),d=a.interopDefault(p),f=e("./config"),h=a.interopDefault(f),m=e("./template"),g=a.interopDefault(m),v=e("./i18n"),y=a.interopDefault(v),b=e("./player"),x=a.interopDefault(b),w=e("./control"),j=a.interopDefault(w),k=e("./contextmenu"),S=a.interopDefault(k),I=e("./info"),T=a.interopDefault(I),O=e("./subtitle"),E=a.interopDefault(O),M=e("./events"),$=a.interopDefault(M),F=e("./hotkey"),C=a.interopDefault(F),H=e("./layer"),D=a.interopDefault(H),B=e("./loading"),z=a.interopDefault(B),A=e("./notice"),R=a.interopDefault(A),L=e("./mask"),P=a.interopDefault(L),N=e("./icons"),Z=a.interopDefault(N),_=e("./setting"),q=a.interopDefault(_),V=e("./storage"),W=a.interopDefault(V),U=e("./plugins"),Y=a.interopDefault(U);let K=0,X=[];class G extends c.default{constructor(e,t){super(),this.id=++K;let r=u.mergeDeep(G.option,e);if(r.container=e.container,this.option=(0,s.default)(r,d.default),this.isLock=!1,this.isReady=!1,this.isFocus=!1,this.isInput=!1,this.isRotate=!1,this.isDestroy=!1,this.template=new g.default(this),this.events=new $.default(this),this.storage=new W.default(this),this.icons=new Z.default(this),this.i18n=new y.default(this),this.notice=new R.default(this),this.player=new x.default(this),this.layers=new D.default(this),this.controls=new j.default(this),this.contextmenu=new S.default(this),this.subtitle=new E.default(this),this.info=new T.default(this),this.loading=new z.default(this),this.hotkey=new C.default(this),this.mask=new P.default(this),this.setting=new q.default(this),this.plugins=new Y.default(this),"function"==typeof t&&this.on("ready",()=>t.call(this,this)),G.DEBUG){let e=e=>console.log(`[ART.${this.id}] -> ${e}`);e("Version@"+G.version),e("Env@"+G.env),e("Build@"+G.build);for(let t=0;t<h.default.events.length;t++)this.on("video:"+h.default.events[t],t=>e("Event@"+t.type))}X.push(this)}static get instances(){return X}static get version(){return"5.1.2"}static get env(){return"production"}static get build(){return"2024-05-27 09:59:56"}static get config(){return h.default}static get utils(){return u}static get scheme(){return d.default}static get Emitter(){return c.default}static get validator(){return s.default}static get kindOf(){return s.default.kindOf}static get html(){return g.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,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:e=>e},moreVideoAttr:{controls:!1,preload:u.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),X.splice(X.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}r.default=G,G.DEBUG=!1,G.CONTEXTMENU=!0,G.NOTICE_TIME=2e3,G.SETTING_WIDTH=250,G.SETTING_ITEM_WIDTH=200,G.SETTING_ITEM_HEIGHT=35,G.RESIZE_TIME=200,G.SCROLL_TIME=200,G.SCROLL_GAP=50,G.AUTO_PLAYBACK_MAX=10,G.AUTO_PLAYBACK_MIN=5,GLine truncated
|
||||
!function(e,t,r,a,i){var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n="function"==typeof o[a]&&o[a],s=n.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!s[t]){if(!e[t]){var i="function"==typeof o[a]&&o[a];if(!r&&i)return i(t,!0);if(n)return n(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}d.resolve=function(r){var a=e[t][1][r];return null!=a?a:r},d.cache={};var p=s[t]=new c.Module(t);e[t][0].call(p.exports,d,p,p.exports,this)}return s[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=s,c.parent=n,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return o[a]}}),o[a]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({abjMI:[function(e,t,r){var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r);var i=e("bundle-text:./style/index.less"),o=a.interopDefault(i),n=e("option-validator"),s=a.interopDefault(n),l=e("./utils/emitter"),c=a.interopDefault(l),u=e("./utils"),p=e("./scheme"),d=a.interopDefault(p),f=e("./config"),h=a.interopDefault(f),m=e("./template"),g=a.interopDefault(m),v=e("./i18n"),y=a.interopDefault(v),b=e("./player"),x=a.interopDefault(b),w=e("./control"),j=a.interopDefault(w),k=e("./contextmenu"),S=a.interopDefault(k),I=e("./info"),T=a.interopDefault(I),O=e("./subtitle"),E=a.interopDefault(O),M=e("./events"),$=a.interopDefault(M),F=e("./hotkey"),C=a.interopDefault(F),H=e("./layer"),D=a.interopDefault(H),B=e("./loading"),z=a.interopDefault(B),A=e("./notice"),R=a.interopDefault(A),L=e("./mask"),P=a.interopDefault(L),N=e("./icons"),Z=a.interopDefault(N),_=e("./setting"),q=a.interopDefault(_),V=e("./storage"),W=a.interopDefault(V),U=e("./plugins"),Y=a.interopDefault(U);let K=0,X=[];class G extends c.default{constructor(e,t){super(),this.id=++K;let r=u.mergeDeep(G.option,e);if(r.container=e.container,this.option=(0,s.default)(r,d.default),this.isLock=!1,this.isReady=!1,this.isFocus=!1,this.isInput=!1,this.isRotate=!1,this.isDestroy=!1,this.template=new g.default(this),this.events=new $.default(this),this.storage=new W.default(this),this.icons=new Z.default(this),this.i18n=new y.default(this),this.notice=new R.default(this),this.player=new x.default(this),this.layers=new D.default(this),this.controls=new j.default(this),this.contextmenu=new S.default(this),this.subtitle=new E.default(this),this.info=new T.default(this),this.loading=new z.default(this),this.hotkey=new C.default(this),this.mask=new P.default(this),this.setting=new q.default(this),this.plugins=new Y.default(this),"function"==typeof t&&this.on("ready",()=>t.call(this,this)),G.DEBUG){let e=e=>console.log(`[ART.${this.id}] -> ${e}`);e("Version@"+G.version),e("Env@"+G.env),e("Build@"+G.build);for(let t=0;t<h.default.events.length;t++)this.on("video:"+h.default.events[t],t=>e("Event@"+t.type))}X.push(this)}static get instances(){return X}static get version(){return"5.1.2"}static get env(){return"production"}static get build(){return"2024-05-27 12:43:07"}static get config(){return h.default}static get utils(){return u}static get scheme(){return d.default}static get Emitter(){return c.default}static get validator(){return s.default}static get kindOf(){return s.default.kindOf}static get html(){return g.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,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:e=>e},moreVideoAttr:{controls:!1,preload:u.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),X.splice(X.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}r.default=G,G.DEBUG=!1,G.CONTEXTMENU=!0,G.NOTICE_TIME=2e3,G.SETTING_WIDTH=250,G.SETTING_ITEM_WIDTH=200,G.SETTING_ITEM_HEIGHT=35,G.RESIZE_TIME=200,G.SCROLL_TIME=200,G.SCROLL_GAP=50,G.AUTO_PLAYBACK_MAX=10,G.AUTO_PLAYBACK_MIN=5,GLine truncated
|
||||
+1
-1
@@ -4,4 +4,4 @@
|
||||
* (c) 2017-2024 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!function(e,t,r,n,o){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[n]&&a[n],i=s.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!i[t]){if(!e[t]){var o="function"==typeof a[n]&&a[n];if(!r&&o)return o(t,!0);if(s)return s(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}f.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},f.cache={};var p=i[t]=new c.Module(t);e[t][0].call(p.exports,f,p,p.exports,this)}return i[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=i,c.parent=s,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return a[n]}}),a[n]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"7Csdv":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return er});var o=e("@swc/helpers/_/_assert_this_initialized"),a=e("@swc/helpers/_/_class_call_check"),s=e("@swc/helpers/_/_create_class"),i=e("@swc/helpers/_/_inherits"),l=e("@swc/helpers/_/_create_super"),c=e("bundle-text:./style/index.less"),u=n.interopDefault(c),p=e("option-validator"),f=n.interopDefault(p),d=e("./utils/emitter"),h=n.interopDefault(d),m=e("./utils"),v=e("./scheme"),g=n.interopDefault(v),_=e("./config"),y=n.interopDefault(_),b=e("./template"),w=n.interopDefault(b),x=e("./i18n"),j=n.interopDefault(x),k=e("./player"),T=n.interopDefault(k),S=e("./control"),M=n.interopDefault(S),I=e("./contextmenu"),E=n.interopDefault(I),F=e("./info"),C=n.interopDefault(F),O=e("./subtitle"),R=n.interopDefault(O),D=e("./events"),P=n.interopDefault(D),A=e("./hotkey"),z=n.interopDefault(A),V=e("./layer"),$=n.interopDefault(V),L=e("./loading"),q=n.interopDefault(L),H=e("./notice"),N=n.interopDefault(H),W=e("./mask"),B=n.interopDefault(W),U=e("./icons"),Y=n.interopDefault(U),K=e("./setting"),X=n.interopDefault(K),G=e("./storage"),J=n.interopDefault(G),Z=e("./plugins"),Q=n.interopDefault(Z),ee=0,et=[],er=function(e){(0,i._)(r,e);var t=(0,l._)(r);function r(e,n){(0,a._)(this,r),(s=t.call(this)).id=++ee;var s,i=m.mergeDeep(r.option,e);if(i.container=e.container,s.option=(0,f.default)(i,g.default),s.isLock=!1,s.isReady=!1,s.isFocus=!1,s.isInput=!1,s.isRotate=!1,s.isDestroy=!1,s.template=new w.default((0,o._)(s)),s.events=new P.default((0,o._)(s)),s.storage=new J.default((0,o._)(s)),s.icons=new Y.default((0,o._)(s)),s.i18n=new j.default((0,o._)(s)),s.notice=new N.default((0,o._)(s)),s.player=new T.default((0,o._)(s)),s.layers=new $.default((0,o._)(s)),s.controls=new M.default((0,o._)(s)),s.contextmenu=new E.default((0,o._)(s)),s.subtitle=new R.default((0,o._)(s)),s.info=new C.default((0,o._)(s)),s.loading=new q.default((0,o._)(s)),s.hotkey=new z.default((0,o._)(s)),s.mask=new B.default((0,o._)(s)),s.setting=new X.default((0,o._)(s)),s.plugins=new Q.default((0,o._)(s)),"function"==typeof n&&s.on("ready",function(){return n.call((0,o._)(s),(0,o._)(s))}),r.DEBUG){var l=function(e){return console.log("[ART.".concat(s.id,"] ->").concat(e))};l("Version@"+r.version),l("Env@"+r.env),l("Build@"+r.build);for(var c=0;c<y.default.events.length;c++)s.on("video:"+y.default.events[c],function(e){return l("Event@"+e.type)})}return et.push((0,o._)(s)),s}return(0,s._)(r,[{key:"proxy",get:function(){return this.events.proxy}},{key:"query",get:function(){return this.template.query}},{key:"video",get:function(){return this.template.$video}},{key:"destroy",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.events.destroy(),this.template.destroy(e),et.splice(et.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return et}},{key:"version",get:function(){return"5.1.2"}},{key:"env",get:function(){return"production"}},{key:"build",get:function(){return"2024-05-27 09:59:57"}},{key:"config",get:function(){return y.default}},{key:"utils",get:function(){return m}},{key:"scheme",get:function(){return g.default}},{key:"Emitter",get:function(){return h.default}},{key:"validator",get:function(){return f.default}},{key:"kindOf",get:function(){return f.default.kindOf}},{key:"html",get:function(){return w.default.html}},{key:"option",get:function(){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,plaLine truncated
|
||||
!function(e,t,r,n,o){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[n]&&a[n],i=s.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!i[t]){if(!e[t]){var o="function"==typeof a[n]&&a[n];if(!r&&o)return o(t,!0);if(s)return s(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}f.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},f.cache={};var p=i[t]=new c.Module(t);e[t][0].call(p.exports,f,p,p.exports,this)}return i[t].exports;function f(e){var t=f.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=i,c.parent=s,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return a[n]}}),a[n]=c;for(var u=0;u<t.length;u++)c(t[u]);if(r){var p=c(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define(function(){return p})}}({"7Csdv":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return er});var o=e("@swc/helpers/_/_assert_this_initialized"),a=e("@swc/helpers/_/_class_call_check"),s=e("@swc/helpers/_/_create_class"),i=e("@swc/helpers/_/_inherits"),l=e("@swc/helpers/_/_create_super"),c=e("bundle-text:./style/index.less"),u=n.interopDefault(c),p=e("option-validator"),f=n.interopDefault(p),d=e("./utils/emitter"),h=n.interopDefault(d),m=e("./utils"),v=e("./scheme"),g=n.interopDefault(v),_=e("./config"),y=n.interopDefault(_),b=e("./template"),w=n.interopDefault(b),x=e("./i18n"),j=n.interopDefault(x),k=e("./player"),T=n.interopDefault(k),S=e("./control"),M=n.interopDefault(S),I=e("./contextmenu"),E=n.interopDefault(I),F=e("./info"),C=n.interopDefault(F),O=e("./subtitle"),R=n.interopDefault(O),D=e("./events"),P=n.interopDefault(D),A=e("./hotkey"),z=n.interopDefault(A),V=e("./layer"),$=n.interopDefault(V),L=e("./loading"),q=n.interopDefault(L),H=e("./notice"),N=n.interopDefault(H),W=e("./mask"),B=n.interopDefault(W),U=e("./icons"),Y=n.interopDefault(U),K=e("./setting"),X=n.interopDefault(K),G=e("./storage"),J=n.interopDefault(G),Z=e("./plugins"),Q=n.interopDefault(Z),ee=0,et=[],er=function(e){(0,i._)(r,e);var t=(0,l._)(r);function r(e,n){(0,a._)(this,r),(s=t.call(this)).id=++ee;var s,i=m.mergeDeep(r.option,e);if(i.container=e.container,s.option=(0,f.default)(i,g.default),s.isLock=!1,s.isReady=!1,s.isFocus=!1,s.isInput=!1,s.isRotate=!1,s.isDestroy=!1,s.template=new w.default((0,o._)(s)),s.events=new P.default((0,o._)(s)),s.storage=new J.default((0,o._)(s)),s.icons=new Y.default((0,o._)(s)),s.i18n=new j.default((0,o._)(s)),s.notice=new N.default((0,o._)(s)),s.player=new T.default((0,o._)(s)),s.layers=new $.default((0,o._)(s)),s.controls=new M.default((0,o._)(s)),s.contextmenu=new E.default((0,o._)(s)),s.subtitle=new R.default((0,o._)(s)),s.info=new C.default((0,o._)(s)),s.loading=new q.default((0,o._)(s)),s.hotkey=new z.default((0,o._)(s)),s.mask=new B.default((0,o._)(s)),s.setting=new X.default((0,o._)(s)),s.plugins=new Q.default((0,o._)(s)),"function"==typeof n&&s.on("ready",function(){return n.call((0,o._)(s),(0,o._)(s))}),r.DEBUG){var l=function(e){return console.log("[ART.".concat(s.id,"] ->").concat(e))};l("Version@"+r.version),l("Env@"+r.env),l("Build@"+r.build);for(var c=0;c<y.default.events.length;c++)s.on("video:"+y.default.events[c],function(e){return l("Event@"+e.type)})}return et.push((0,o._)(s)),s}return(0,s._)(r,[{key:"proxy",get:function(){return this.events.proxy}},{key:"query",get:function(){return this.template.query}},{key:"video",get:function(){return this.template.$video}},{key:"destroy",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.events.destroy(),this.template.destroy(e),et.splice(et.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"instances",get:function(){return et}},{key:"version",get:function(){return"5.1.2"}},{key:"env",get:function(){return"production"}},{key:"build",get:function(){return"2024-05-27 12:43:08"}},{key:"config",get:function(){return y.default}},{key:"utils",get:function(){return m}},{key:"scheme",get:function(){return g.default}},{key:"Emitter",get:function(){return h.default}},{key:"validator",get:function(){return f.default}},{key:"kindOf",get:function(){return f.default.kindOf}},{key:"html",get:function(){return w.default.html}},{key:"option",get:function(){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,plaLine truncated
|
||||
+2
-2
@@ -11,10 +11,10 @@ const compiledPath = path.resolve(`docs/compiled`);
|
||||
function compressString(input) {
|
||||
const compressedHtmlString = input.replace(/\s*(<[^>]+>)\s*/g, '$1');
|
||||
const compressedCssString = compressedHtmlString
|
||||
.replace(/\s*([:;,])\s*/g, '$1')
|
||||
.replace(/(\r\n|\n|\r)/gm, ' ')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
return compressedHtmlString;
|
||||
return compressedCssString;
|
||||
}
|
||||
|
||||
async function build(name, targetName) {
|
||||
|
||||
Reference in new issue
Block a user