add flip icon

This commit is contained in:
Harvey Zack committed 2022-05-13 20:44:56 +08:00
1 parent 642a2ac1a9
commit 887792c853
15 files changed
+179 -149

No files matched your search

+1 -1
View File
@@ -4,4 +4,4 @@
* (c) 2017-2022 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,n,r,o){var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof s.parcelRequire93cf&&s.parcelRequire93cf,a=i.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,n){if(!a[t]){if(!e[t]){var r="function"==typeof s.parcelRequire93cf&&s.parcelRequire93cf;if(!n&&r)return r(t,!0);if(i)return i(t,!0);if(l&&"string"==typeof t)return l(t);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}p.resolve=function(n){var r=e[t][1][n];return null!=r?r:n},p.cache={};var u=a[t]=new c.Module(t);e[t][0].call(u.exports,p,u,u.exports,this)}return a[t].exports;function p(e){var t=p.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=a,c.parent=i,c.register=function(t,n){e[t]=[function(e,t){t.exports=n},{}]},Object.defineProperty(c,"root",{get:function(){return s.parcelRequire93cf}}),s.parcelRequire93cf=c;for(var u=0;u<t.length;u++)c(t[u]);var p=c(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=p:"function"==typeof define&&define.amd&&define((function(){return p}))}({E13ST:[function(e,t,n){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n);var o=e("./danmuku"),s=r.interopDefault(o),i=e("./control"),a=r.interopDefault(i);function l(e){return t=>{const n=new s.default(t,e),r=new a.default(t,n);return e.el&&r.mount(e.el),{name:"artplayerPluginDanmuku",emit:n.emit.bind(n),config:n.config.bind(n),hide:n.hide.bind(n),show:n.show.bind(n),mount:r.mount.bind(r),unmount:r.unmount.bind(r),get isHide(){return n.isHide},get isStop(){return n.isStop}}}}n.default=l,window.artplayerPluginDanmuku=l},{"./danmuku":"8Gtnh","./control":"3qXcr","@parcel/transformer-js/src/esmodule-helpers.js":"9v6Cv"}],"8Gtnh":[function(e,t,n){var r=e("@parcel/transformer-js/src/esmodule-helpers.js");r.defineInteropFlag(n);var o=e("./bilibili"),s=e("./getDanmuTop"),i=r.interopDefault(s);class a{constructor(t,n){const{constructor:r,template:o}=t;if(this.utils=r.utils,this.validator=r.validator,this.$danmuku=o.$danmuku,this.$player=o.$player,this.art=t,this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(n),this.option.useWorker)try{this.worker=new Worker(e("27c3930ee158179a"))}catch(e){}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("fullscreen",this.reset),t.on("fullscreenWeb",this.reset),t.on("destroy",this.destroy),this.load()}static get option(){return{danmuku:[],speed:5,margin:[10,100],opacity:1,fontSize:25,filter:()=>!0,antiOverlap:!0,useWorker:!0,synchronousPlayback:!1}}static get scheme(){return{danmuku:"array|function|string",speed:"number",margin:"array",opacity:"number",fontSize:"number",filter:"function",antiOverlap:"boolean",useWorker:"boolean",synchronousPlayback:"boolean"}}get isRotate(){return this.art.plugins.autoOrientation&&this.art.plugins.autoOrientation.state}get marginTop(){const{clamp:e}=this.utils,t=this.option.margin[0],{clientHeight:n}=this.$player;if("number"==typeof t)return e(t,0,n);if("string"==typeof t&&t.endsWith("%")){return e(n*(parseFloat(t)/100),0,n)}return a.option.margin[0]}get marginBottom(){const{clamp:e}=this.utils,t=this.option.margin[1],{clientHeight:n}=this.$player;if("number"==typeof t)return e(t,0,n);if("string"==typeof t&&t.endsWith("%")){return e(n*(parseFloat(t)/100),0,n)}return a.option.margin[1]}filter(e,t){return this.queue.filter((t=>t.$state===e)).map(t)}getLeft(e){const t=e.getBoundingClientRect();return this.isRotate?t.top:t.left}getRef(){const e=this.$refs.pop();if(e)return e;const t=document.createElement("div");return t.style.cssText='\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n 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;\n ',t}getReady(){const{currentTime:e}=this.art;return this.queue.filter((t=>"ready"===t.$state||"wait"===t.$state&&e+.1>=t.time&&t.time>=e-.1))}getEmits(){const e=[],{clientWidth:t}=this.$player,n=this.getLeft(this.$player);return this.filter("emit",(r=>{const o=r.$ref.offsetTop,s=this.getLeft(r.$ref)-n,i=r.$ref.clientHeight,a=r.$ref.clientWidth,l=s+a,c=t-l,u=l/r.$restTime,p={};p.top=o,p.left=s,p.height=i,p.width=a,p.riLine truncated
!function(t,e,i,n,s){var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},o="function"==typeof r.parcelRequire93cf&&r.parcelRequire93cf,a=o.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function h(e,i){if(!a[e]){if(!t[e]){var n="function"==typeof r.parcelRequire93cf&&r.parcelRequire93cf;if(!i&&n)return n(e,!0);if(o)return o(e,!0);if(l&&"string"==typeof e)return l(e);var s=new Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}u.resolve=function(i){var n=t[e][1][i];return null!=n?n:i},u.cache={};var c=a[e]=new h.Module(e);t[e][0].call(c.exports,u,c,c.exports,this)}return a[e].exports;function u(t){var e=u.resolve(t);return!1===e?{}:h(e)}}h.isParcelRequire=!0,h.Module=function(t){this.id=t,this.bundle=h,this.exports={}},h.modules=t,h.cache=a,h.parent=o,h.register=function(e,i){t[e]=[function(t,e){e.exports=i},{}]},Object.defineProperty(h,"root",{get:function(){return r.parcelRequire93cf}}),r.parcelRequire93cf=h;for(var c=0;c<e.length;c++)h(e[c]);var u=h(i);"object"==typeof exports&&"undefined"!=typeof module?module.exports=u:"function"==typeof define&&define.amd&&define((function(){return u}))}({E13ST:[function(t,e,i){var n=t("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(i);var s=t("./danmuku"),r=n.interopDefault(s),o=t("./setting"),a=n.interopDefault(o);function l(t){return e=>{const i=new r.default(e,t);return a.default(e,i),{name:"artplayerPluginDanmuku",emit:i.emit.bind(i),config:i.config.bind(i),hide:i.hide.bind(i),show:i.show.bind(i),get isHide(){return i.isHide},get isStop(){return i.isStop}}}}i.default=l,window.artplayerPluginDanmuku=l},{"./danmuku":"8Gtnh","@parcel/transformer-js/src/esmodule-helpers.js":"b7MJY","./setting":"jAkJm"}],"8Gtnh":[function(t,e,i){var n=t("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(i);var s=t("./bilibili"),r=t("./getDanmuTop"),o=n.interopDefault(r);class a{constructor(e,i){const{constructor:n,template:s}=e;if(this.utils=n.utils,this.validator=n.validator,this.$danmuku=s.$danmuku,this.$player=s.$player,this.art=e,this.queue=[],this.option={},this.$refs=[],this.isStop=!1,this.isHide=!1,this.timer=null,this.config(i),this.option.useWorker)try{this.worker=new Worker(t("85d40535eae5f839"))}catch(t){}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("fullscreen",this.reset),e.on("fullscreenWeb",this.reset),e.on("destroy",this.destroy),this.load()}static get option(){return{danmuku:[],speed:5,margin:["2%","25%"],opacity:1,fontSize:25,filter:()=>!0,antiOverlap:!0,useWorker:!0,synchronousPlayback:!1}}static get scheme(){return{danmuku:"array|function|string",speed:"number",margin:"array",opacity:"number",fontSize:"number|string",filter:"function",antiOverlap:"boolean",useWorker:"boolean",synchronousPlayback:"boolean"}}get isRotate(){return this.art.plugins.autoOrientation&&this.art.plugins.autoOrientation.state}get marginTop(){const{clamp:t}=this.utils,e=this.option.margin[0],{clientHeight:i}=this.$player;if("number"==typeof e)return t(e,0,i);if("string"==typeof e&&e.endsWith("%")){return t(i*(parseFloat(e)/100),0,i)}return a.option.margin[0]}get marginBottom(){const{clamp:t}=this.utils,e=this.option.margin[1],{clientHeight:i}=this.$player;if("number"==typeof e)return t(e,0,i);if("string"==typeof e&&e.endsWith("%")){return t(i*(parseFloat(e)/100),0,i)}return a.option.margin[1]}filter(t,e){return this.queue.filter((e=>e.$state===t)).map(e)}getLeft(t){const e=t.getBoundingClientRect();return this.isRotate?e.top:e.left}getRef(){const t=this.$refs.pop();if(t)return t;const e=document.createElement("div");return e.style.cssText='\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-weight: normal;\n line-height: 1.125;\n visibility: hidden;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n 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;\n ',e}getReady(){const{currentTime:t}=this.art;return this.queue.filter((e=>"ready"===e.$state||"wait"===e.$state&&t+.1>=e.time&&e.time>=t-.1))}getEmits(){const t=[],{clientWidth:e}=this.$player,i=this.getLeft(this.$player);return this.filter("emit",(n=>{const s=n.$ref.offsetTop,r=this.getLeft(n.$ref)-i,o=n.$ref.clientHeight,a=n.$ref.clientWidth,l=r+a,h=e-l,c=l/n.$restTime,u={};u.top=s,u.left=r,u.height=o,u.width=a,u.right=h,u.speed=c,u.distance=l,u.time=n.$restTime,u.mode=n.mode,tLine truncated