!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=5)}([function(t,e,i){"use strict";var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();e.a=r},function(t,e,i){"use strict";var r=function(){return window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.clearTimeout}();e.a=r},function(t,e,i){"use strict";function r(t,e){return Object(n.a)(t)?window.getComputedStyle(t,null).getPropertyValue(e):"string"==typeof t&&document.querySelector(t)?window.getComputedStyle(document.querySelector(t),null).getPropertyValue(e):void 0}e.a=r;var n=i(7)},function(t,e,i){"use strict";function r(t){var e=document.createElement("style"),i=document.head||document.getElementsByTagName("head")[0];if(e.type="text/css",e.styleSheet){var r=function(){try{e.styleSheet.cssText=t}catch(t){console.error(t)}};e.styleSheet.disabled?setTimeout(r,10):r()}else{var n=document.createTextNode(t);e.appendChild(n)}i.appendChild(e)}e.a=r},function(t,e,i){"use strict";var r=function(){function t(t){t.target,t.data,t.speed;this.options={target:"",data:[],speed:5},this.extendOpt(arguments[0]),this.targetElement=document.querySelector(this.options.target)}return t.prototype.extendOpt=function(t){var e=this;for(var i in t)t.hasOwnProperty(i)&&(e.options[i]=t[i])},t.prototype.createElement=function(t){void 0===t&&(t="");var e=[];this.scroxtWrapper||(this.scroxtWrapper=document.createElement("div"),this.scroxtWrapper.className="scroxt-wrapper",this.targetElement=document.querySelector(this.options.target),this.targetElement.appendChild(this.scroxtWrapper));for(var i=0,r=this.options.data.length;i=n&&(this.distance=-this.divWrapElementWidth+this.targetWidth,this.createHorizontal(),this.scroxtWrapper.style.right="0px",this.scroxtWrapper.style.marginRight="0px")}this.scroxtWrapper.style.transform="translate3d("+this.distance+"px, 0px, 0px)",this.scroxtWrapper.style.webkitTransform="translate3d("+this.distance+"px, 0px, 0px)",this.distance+=.1*this.options.speed},e.prototype.stopMove=function(){Object(a.a)(this.ST),this.ST=0},e.prototype.startMove=function(){0===this.ST&&this.STRun()},e}(r.a);e.a=p},function(t,e,i){"use strict";function r(t){return!(!t||!t.nodeType)&&1===t.nodeType}e.a=r},function(t,e,i){"use strict";var r=i(4),n=i(0),a=i(1),o=i(2),s=i(3),h=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),p=function(t){function e(e){var i=t.call(this,e)||this;return i.targetHeight=0,i.divWrapElementHeight=0,i.distance=0,i.ST=0,i.targetHeight=parseFloat(Object(o.a)(i.targetElement,"height")),i.createStyle(),i.startRun(),i}return h(e,t),e.prototype.startRun=function(){if(this.divWrapElementHeight=this.createVertical(),this.targetHeight>this.divWrapElementHeight/2)return this.emptyElement(),void this.createElement("scroxt-vertical");this.STRun()},e.prototype.createStyle=function(){Object(s.a)("\n .scroxt-vertical{\n box-sizing: border-box;\n }\n ")},e.prototype.createVertical=function(){this.emptyElement();var t=this.createElement("scroxt-vertical"),e=this.createElement("scroxt-vertical");return this.computeHeight(t.concat(e))},e.prototype.computeHeight=function(t){for(var e=0,i=0,r=t.length;ithis.divWrapElementHeight/2||(this.STMove(),this.ST=Object(n.a)(function(){this.STRun()}.bind(this)))},e.prototype.STMove=function(){this.options.speed<0?this.distance<=-this.divWrapElementHeight/2&&(this.createVertical(),this.distance=0):this.distance>=this.targetHeight-this.divWrapElementHeight/2&&(this.createVertical(),this.distance=this.targetHeight-this.divWrapElementHeight),this.scroxtWrapper.style.transform="translate3d(0px, "+this.distance+"px, 0px)",this.scroxtWrapper.style.webkitTransform="translate3d(0px, "+this.distance+"px, 0px)",this.distance+=.1*this.options.speed},e.prototype.stopMove=function(){Object(a.a)(this.ST),this.ST=0},e.prototype.startMove=function(){0===this.ST&&this.STRun()},e}(r.a);e.a=p},function(t,e,i){"use strict";var r=i(0),n=i(1),a=i(2),o=i(10),s=i(3),h=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),p=function(t){function e(e){var i=e.video,r=e.dataTime,n=t.call(this)||this;return n.videoEnd=!1,n.barrageWrap=[],n.readyShowBarrage=[],n.staticBarrageST=null,n.runST=0,n.video=i,n.scroxtVideo=document.querySelector(n.video),n.dataTime=n.quickSort(r),console.log(n.dataTime),n.tempDataTime=JSON.parse(JSON.stringify(n.dataTime)),n.lineHeight=28,n.videoWidth=parseInt(Object(a.a)(n.video,"width")),n.MAX_LINE=~~(parseInt(Object(a.a)(n.video,"height"))/n.lineHeight),n.MAX_NUM=50,n.distance=-5,n.colorFont=["#ffff38","#c80115","#189add"],n.createStyle(),n.startRun(),n}return h(e,t),e.prototype.quickSort=function(t){if(t.length<=1)return t;for(var e=t.splice(Math.floor(t.length/2),1)[0],i=[],r=[],n=0,a=t.length;n-1?t:t+" scroxt-video",this.timeUpdate()},e.prototype.play=function(){this.scroxtVideo.paused&&(this.scroxtVideo.play(),this.intervalRun())},e.prototype.stop=function(){this.scroxtVideo.paused||(this.scroxtVideo.pause(),this.intervalStop())},e.prototype.restart=function(){this.readyShowBarrage=[],this.tempDataTime=JSON.parse(JSON.stringify(this.dataTime)),this.scroxtVideo.currentTime=0,this.barrageWrap.forEach(function(t,e){var i=t.element.parentNode;i&&i.removeChild(t.element)}),this.barrageWrap=[]},e.prototype.moveInterval=function(t){void 0===t&&(t=0),this.readyShowBarrage=[],this.tempDataTime=JSON.parse(JSON.stringify(this.dataTime)),this.scroxtVideo.currentTime+=t,this.barrageWrap.forEach(function(t,e){var i=t.element.parentNode;i&&i.removeChild(t.element)}),this.barrageWrap=[]},e.prototype.timeUpdate=function(){this.scroxtVideo.addEventListener("timeupdate",function(){this.distribution(this.scroxtVideo.currentTime)}.bind(this))},e.prototype.distribution=function(t){for(var e=this.tempDataTime.length;0!==e&&this.tempDataTime[0].time=t-2&&this.readyShowBarrage.push(this.tempDataTime[0].data),this.tempDataTime.shift(),e=this.tempDataTime.length},e.prototype.createBarrage=function(){var t=this.readyShowBarrage.length;if(t&&!(this.barrageWrap.length>this.MAX_NUM))for(var e=0;ethis.MAX_LINE){t>20&&!this.staticBarrageST&&this.createStaticBarrage(this.readyShowBarrage.splice(0,this.MAX_LINE));break}var i=e%this.MAX_LINE,r=document.querySelectorAll("[data-line='"+i+"']"),n=r.length,a=void 0;if(n>0){a=r[n-1];var o=+a.getAttribute("data-width"),s=+a.getAttribute("data-move");if(Math.abs(s)+o>this.videoWidth)continue}var h=this.readyShowBarrage.shift(),p=Math.floor(1e3*Math.random())+ +new Date+e,c=e%2==0?10:0,l=document.createElement("div");l.className="multi-barrage-line";var u=document.createTextNode(""+h);l.appendChild(u),this.scroxtVideo.parentNode.appendChild(l);var d=parseInt(window.getComputedStyle(l,null).getPropertyValue("width")),f=d/600>=.5?.5:d/600,m="#fff";.5===f&&(m=this.colorFont[~~(Math.random()*this.colorFont.length)]),this.barrageWrap.push({element:l,scroxt:p,line:i,move:this.videoWidth+c+10,width:d,distance:f,color:m})}},e.prototype.createStaticBarrage=function(t){for(var e=this,i=0,r=t.length;i0&&t0)i=this.selfBarrage.shift();else{if(this.strongLock&&this.sumLine>65){this.barrage=[];break}if(this.barrageWrap[r]){var n=this.barrageWrap[r].length;if(n>0){var a=this.barrageWrap[r][n-1];if(a.move+a.width>this.TARGET_WIDTH-this.lineGap)continue}}i=this.barrage.shift(),e--}this.generateBarrage(r,i)}},t.prototype.generateBarrage=function(t,e){var i=document.createElement("div");i.className="multi-barrage-line";var n=document.createTextNode(e);i.appendChild(n),i.style.opacity="0",this.targetElement.appendChild(i);var a=parseInt(Object(r.a)(i,"width")),o=a/600>=.5?.5:a/600;this.barrageWrap[t]?this.barrageWrap[t].push({element:i,line:t,move:this.TARGET_WIDTH,width:a,speed:o}):this.barrageWrap[t]=[{element:i,line:t,move:this.TARGET_WIDTH,width:a,speed:o}]},t.prototype.moveLine=function(){this.sumLine=0;for(var t in this.barrageWrap){var e=this.barrageWrap[t];this.sumLine+=e.length;for(var i=0;i