From 256a8e684e37a93083395f874a3019c62cc7827b Mon Sep 17 00:00:00 2001
From: zhw2590582
Date: Fri, 7 Jan 2022 23:40:58 +0800
Subject: [PATCH] update danmuku
---
dist/artplayer-plugin-danmuku.js | 4 +-
dist/artplayer.js | 4 +-
docs/uncompiled/artplayer-plugin-danmuku.js | 74 +++++++------------
.../artplayer-plugin-danmuku.js.map | 2 +-
docs/uncompiled/artplayer.js | 10 +--
.../dist/artplayer-plugin-danmuku.js | 4 +-
.../artplayer-plugin-danmuku/package.json | 2 +-
.../artplayer-plugin-danmuku/src/danmuku.js | 20 +++--
packages/artplayer/dist/artplayer.js | 4 +-
9 files changed, 52 insertions(+), 72 deletions(-)
diff --git a/dist/artplayer-plugin-danmuku.js b/dist/artplayer-plugin-danmuku.js
index aefcf3957..740f0b4f5 100644
--- a/dist/artplayer-plugin-danmuku.js
+++ b/dist/artplayer-plugin-danmuku.js
@@ -1,8 +1,8 @@
/*!
- * artplayer-plugin-danmuku.js v4.0.0
+ * artplayer-plugin-danmuku.js v4.1.0
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2022 Harvey Zack
* Released under the MIT License.
*/
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,(function(){"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){for(var n=0;n
")})).join(""),this.art.emit("subtitleUpdate",this.activeCue.text))}},{key:"switch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.art,n=r.i18n,o=r.notice,i=r.option,a=be(be(be({},i.subtitle),e),{},{url:t});return this.init(a).then((function(t){return e.name&&(o.show="".concat(n.get("Switch subtitle"),": ").concat(e.name)),t}))}},{key:"init",value:function(t){var e=this;if(u(t,ft.subtitle),t.url){var r=this.art,n=r.notice,o=r.events.proxy,i=r.template,a=i.$subtitle,c=i.$video;if(!i.$track){var s=document.createElement("track");s.default=!0,s.kind="metadata",c.appendChild(s),this.art.template.$track=s,o(this.textTrack,"cuechange",this.update.bind(this))}return this.style(t.style),this.bilingual=t.bilingual,q(window.fetch,"fetch not support"),fetch(t.url).then((function(t){return t.arrayBuffer()})).then((function(r){q(window.TextDecoder,"TextDecoder not support");var n=new TextDecoder(t.encoding).decode(r);switch(e.art.emit("subtitleLoad",t.url),t.type||V(t.url)){case"srt":return B(F(n));case"ass":return B(I(n));case"vtt":return B(n);default:return t.url}})).then((function(t){return a.innerHTML="",e.url===t||(URL.revokeObjectURL(e.url),e.art.template.$track.src=t,e.art.emit("subtitleSwitch",t)),t})).catch((function(t){throw n.show=t,t}))}}}]),o}(St);var Oe=function(){function e(r){var n=this;t(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),r.whitelist.state&&r.once("ready",(function(){!function(t,e){var r=t.template.$player;e.proxy(document,["click","contextmenu"],(function(e){D(e,r)?(t.isFocus=!0,t.emit("focus")):(t.isFocus=!1,t.emit("blur"))}))}(r,n),function(t,e){var r=t.template.$player;e.hover(r,(function(){b(r,"art-hover"),t.emit("hover",!0)}),(function(){w(r,"art-hover"),t.emit("hover")}))}(r,n),function(t,e){var r=t.template.$player;e.proxy(r,"mousemove",(function(e){t.emit("mousemove",e)}))}(r,n),function(t,e){var r=t.option,n=J((function(){t.normalSize&&(t.autoSize=r.autoSize),t.aspectRatioReset=!0,t.emit("resize")}),500);e.proxy(window,["orientationchange","resize"],(function(){n()})),screen&&screen.orientation&&screen.orientation.onchange&&e.proxy(screen.orientation,"change",(function(){n()}))}(r,n),function(t,e){if(d&&!t.option.isLive){var r=t.notice,n=t.template.$video,o=!1,i=0,a=0;e.proxy(n,"touchstart",(function(t){1===t.touches.length&&(o=!0,i=t.touches[0].clientX)})),e.proxy(document,"touchmove",(function(e){if(1===e.touches.length&&o){var c=G((e.touches[0].clientX-i)/n.clientWidth,-1,1);a=G(t.currentTime+60*c,0,t.duration),r.show="".concat(K(a)," / ").concat(K(t.duration))}})),e.proxy(document,"touchend",(function(){o&&a&&(t.seek=a),o=!1,i=0,a=0}))}}(r,n),function(t,e){var r=t.option,n=t.template.$container,o=J((function(){t.emit("view",$(n,50))}),200);e.proxy(window,"scroll",(function(){o()})),t.on("view",(function(e){r.autoMini&&(t.mini=!e)}))}(r,n)}))}return r(e,[{key:"proxy",value:function(t,e,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(e))return e.map((function(e){return n.proxy(t,e,r,o)}));t.addEventListener(e,r,o);var i=function(){return t.removeEventListener(e,r,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}},{key:"loadImg",value:function(t){var e=this;return new Promise((function(r,n){var o;if(t instanceof HTMLImageElement)o=t;else{if("string"!=typeof t)return n(new M("Unable to get Image"));(o=new Image).src=t}if(o.complete)return r(o);e.proxy(o,"load",(function(){return r(o)})),e.proxy(o,"error",(function(){return n(new M("Failed to load Image: ".concat(o.src)))}))}))}},{key:"destroy",value:function(){for(var t=0;t',state:'',play:'',pause:'',volume:'',volumeClose:'',subtitle:'',screenshot:'',setting:'',fullscreen:'',fullscreenWeb:'',pip:''},r.option.icons);Object.keys(o).forEach((function(t){U(n,t,{get:function(){var e=document.createElement("i");return b(e,"art-icon"),b(e,"art-icon-".concat(t)),O(e,o[t]),e}})}))};function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ae(t){for(var e=1;e