diff --git a/dist/artplayer-plugin-danmu.css b/dist/artplayer-plugin-danmu.css deleted file mode 100644 index d3bbf749c..000000000 --- a/dist/artplayer-plugin-danmu.css +++ /dev/null @@ -1 +0,0 @@ -.artplayerPluginDanmu{display:-webkit-box;display:-ms-flexbox;display:flex} \ No newline at end of file diff --git a/dist/artplayer-plugin-danmu.js b/dist/artplayer-plugin-danmu.js deleted file mode 100644 index da822fca7..000000000 --- a/dist/artplayer-plugin-danmu.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * artplayer-plugin-danmu.js v3.1.7 - * Github: https://github.com/zhw2590582/ArtPlayer#readme - * (c) 2017-2019 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=t||self)["artplayer-plugin-danmu"]=e()}(this,function(){"use strict";var n=function(t){if(Array.isArray(t))return t};var i=function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n};var r=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var p=function(t,e){return n(t)||i(t,e)||r()};function e(t){if("string"!=typeof t)return[];var e=t.match(/[\S ]*?)<\/d>/gi);return e.length?e.map(function(t){var e=t.match(/(.+)<\/d>/),n=p(e,3),i=n[1],r=n[2],o=i.split(",");return 8===o.length&&r.trim()?{text:r,time:Number(o[0]),mode:Number(o[1]),size:Number(o[2]),color:"#".concat(Number(o[3]).toString(16)),timestamp:Number(o[4]),pool:Number(o[5]),userID:o[6],rowID:Number(o[7])}:null}):[]}function o(t){return fetch(t).then(function(t){return t.text()}).then(function(t){return e(t)})}var a=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var s=function(e){for(var t=1;tthis.option.maxlength?n("The length of the danmu does not exceed ".concat(this.option.maxlength)):("number"!=typeof t.time&&(t.time=i.currentTime),this.queue.push(s({},t,{$state:"wait",$ref:null,$restTime:0}))):n("Danmu text cannot be empty")}},{key:"getDanmuRef",value:function(){var t=this.art.template.$player,e=this.art.constructor.utils,n=e.setStyles,i=e.append,r=h.getRect(t,"left"),o=this.queue.find(function(t){if(t.$ref){var e=h.getRect(t.$ref),n=e.left,i=e.width;return"emit"===t.$state&&n+i=t.time&&t.time>=n.currentTime-.25&&"wait"===t.$state}).forEach(function(t){e.emit(t)}),e.isStop||e.update()})}},{key:"stop",value:function(){var e=this;this.isStop=!0,this.queue.filter(function(t){return"emit"===t.$state}).forEach(function(t){e.suspend(t)}),window.cancelAnimationFrame(this.animationFrameTimer),this.art.emit("artplayerPluginDanmu:stop")}},{key:"start",value:function(){this.isStop=!1,this.queue.filter(function(t){return"stop"===t.$state}).forEach(function(t){h.continue(t)}),this.update(),this.art.emit("artplayerPluginDanmu:start")}},{key:"show",value:function(){this.layer.$ref.style="none",this.art.emit("artplayerPluginDanmu:show")}},{key:"hide",value:function(){this.layer.$ref.style="block",this.art.emit("artplayerPluginDanmu:hide")}}],[{key:"getRect",value:function(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}},{key:"continue",value:function(t){t.$lastStartTime=Date.now(),t.$ref.style.transform="translateX(".concat(-t.$restWidth,"px) translateY(0px) translateZ(0px)"),t.$ref.style.transition="-webkit-transform ".concat(t.$restTime,"s linear 0s"),t.$state="emit"}},{key:"option",get:function(){return{danmus:[],speed:5,opacity:1,color:"#fff",size:25,maxlength:50,margin:[10,20]}}},{key:"scheme",get:function(){return{danmus:"array|function|string",speed:"number",opacity:"number",color:"string",size:"number",maxlength:"number",margin:"array"}}}]),h}();function f(n){return function(t){var e=new h(t,n);return{name:"artplayerPluginDanmu",emit:e.addToQueue.bind(e),config:e.config.bind(e),start:e.start.bind(e),stop:e.stop.bind(e),hide:e.hide.bind(e),show:e.show.bind(e)}}}return f.bilibiliDanmuParseFromXml=e,f.bilibiliDanmuParseFromAv=function(t){var e="https://cors-anywhere.herokuapp.com/";return fetch("".concat(e,"https://api.bilibili.com/x/web-interface/view?aid=").concat(t)).then(function(t){return t.json()}).then(function(t){if(0===t.code&&t.data&&t.data.cid)return o("".concat(e,"https://api.bilibili.com/x/v1/dm/list.so?oid=").concat(t.data.cid));throw new Error("Unable to get data: ".concat(JSON.stringify(t)))})},f.bilibiliDanmuParseFromUrl=o,window.artplayerPluginDanmu=f}); diff --git a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmu.css b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmu.css deleted file mode 100644 index d3bbf749c..000000000 --- a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmu.css +++ /dev/null @@ -1 +0,0 @@ -.artplayerPluginDanmu{display:-webkit-box;display:-ms-flexbox;display:flex} \ No newline at end of file diff --git a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmu.js b/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmu.js deleted file mode 100644 index da822fca7..000000000 --- a/packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmu.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * artplayer-plugin-danmu.js v3.1.7 - * Github: https://github.com/zhw2590582/ArtPlayer#readme - * (c) 2017-2019 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=t||self)["artplayer-plugin-danmu"]=e()}(this,function(){"use strict";var n=function(t){if(Array.isArray(t))return t};var i=function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n};var r=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var p=function(t,e){return n(t)||i(t,e)||r()};function e(t){if("string"!=typeof t)return[];var e=t.match(/[\S ]*?)<\/d>/gi);return e.length?e.map(function(t){var e=t.match(/(.+)<\/d>/),n=p(e,3),i=n[1],r=n[2],o=i.split(",");return 8===o.length&&r.trim()?{text:r,time:Number(o[0]),mode:Number(o[1]),size:Number(o[2]),color:"#".concat(Number(o[3]).toString(16)),timestamp:Number(o[4]),pool:Number(o[5]),userID:o[6],rowID:Number(o[7])}:null}):[]}function o(t){return fetch(t).then(function(t){return t.text()}).then(function(t){return e(t)})}var a=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var s=function(e){for(var t=1;tthis.option.maxlength?n("The length of the danmu does not exceed ".concat(this.option.maxlength)):("number"!=typeof t.time&&(t.time=i.currentTime),this.queue.push(s({},t,{$state:"wait",$ref:null,$restTime:0}))):n("Danmu text cannot be empty")}},{key:"getDanmuRef",value:function(){var t=this.art.template.$player,e=this.art.constructor.utils,n=e.setStyles,i=e.append,r=h.getRect(t,"left"),o=this.queue.find(function(t){if(t.$ref){var e=h.getRect(t.$ref),n=e.left,i=e.width;return"emit"===t.$state&&n+i=t.time&&t.time>=n.currentTime-.25&&"wait"===t.$state}).forEach(function(t){e.emit(t)}),e.isStop||e.update()})}},{key:"stop",value:function(){var e=this;this.isStop=!0,this.queue.filter(function(t){return"emit"===t.$state}).forEach(function(t){e.suspend(t)}),window.cancelAnimationFrame(this.animationFrameTimer),this.art.emit("artplayerPluginDanmu:stop")}},{key:"start",value:function(){this.isStop=!1,this.queue.filter(function(t){return"stop"===t.$state}).forEach(function(t){h.continue(t)}),this.update(),this.art.emit("artplayerPluginDanmu:start")}},{key:"show",value:function(){this.layer.$ref.style="none",this.art.emit("artplayerPluginDanmu:show")}},{key:"hide",value:function(){this.layer.$ref.style="block",this.art.emit("artplayerPluginDanmu:hide")}}],[{key:"getRect",value:function(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}},{key:"continue",value:function(t){t.$lastStartTime=Date.now(),t.$ref.style.transform="translateX(".concat(-t.$restWidth,"px) translateY(0px) translateZ(0px)"),t.$ref.style.transition="-webkit-transform ".concat(t.$restTime,"s linear 0s"),t.$state="emit"}},{key:"option",get:function(){return{danmus:[],speed:5,opacity:1,color:"#fff",size:25,maxlength:50,margin:[10,20]}}},{key:"scheme",get:function(){return{danmus:"array|function|string",speed:"number",opacity:"number",color:"string",size:"number",maxlength:"number",margin:"array"}}}]),h}();function f(n){return function(t){var e=new h(t,n);return{name:"artplayerPluginDanmu",emit:e.addToQueue.bind(e),config:e.config.bind(e),start:e.start.bind(e),stop:e.stop.bind(e),hide:e.hide.bind(e),show:e.show.bind(e)}}}return f.bilibiliDanmuParseFromXml=e,f.bilibiliDanmuParseFromAv=function(t){var e="https://cors-anywhere.herokuapp.com/";return fetch("".concat(e,"https://api.bilibili.com/x/web-interface/view?aid=").concat(t)).then(function(t){return t.json()}).then(function(t){if(0===t.code&&t.data&&t.data.cid)return o("".concat(e,"https://api.bilibili.com/x/v1/dm/list.so?oid=").concat(t.data.cid));throw new Error("Unable to get data: ".concat(JSON.stringify(t)))})},f.bilibiliDanmuParseFromUrl=o,window.artplayerPluginDanmu=f});