(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["zx-player"]=t():e["zx-player"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fae3")}({"06cf":function(e,t,r){var n=r("83ab"),i=r("d1e7"),a=r("5c6c"),o=r("fc6a"),s=r("c04e"),l=r("5135"),u=r("0cfb"),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=o(e),t=s(t,!0),u)try{return d(e,t)}catch(r){}if(l(e,t))return a(!i.f.call(e,t),e[t])}},"0cfb":function(e,t,r){var n=r("83ab"),i=r("d039"),a=r("cc12");e.exports=!n&&!i((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},"1d80":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"23cb":function(e,t,r){var n=r("a691"),i=Math.max,a=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):a(r,t)}},"23e7":function(e,t,r){var n=r("da84"),i=r("06cf").f,a=r("9112"),o=r("6eeb"),s=r("ce4e"),l=r("e893"),u=r("94ca");e.exports=function(e,t){var r,d,c,f,h,p,g=e.target,y=e.global,v=e.stat;if(d=y?n:v?n[g]||s(g,{}):(n[g]||{}).prototype,d)for(c in t){if(h=t[c],e.noTargetGet?(p=i(d,c),f=p&&p.value):f=d[c],r=u(y?c:g+(v?".":"#")+c,e.forced),!r&&void 0!==f){if(typeof h===typeof f)continue;l(h,f)}(e.sham||f&&f.sham)&&a(h,"sham",!0),o(d,c,h,e)}}},"241c":function(e,t,r){var n=r("ca84"),i=r("7839"),a=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,a)}},"428f":function(e,t,r){var n=r("da84");e.exports=n},"44ad":function(e,t,r){var n=r("d039"),i=r("c6b6"),a="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?a.call(e,""):Object(e)}:Object},"4d64":function(e,t,r){var n=r("fc6a"),i=r("50c4"),a=r("23cb"),o=function(e){return function(t,r,o){var s,l=n(t),u=i(l.length),d=a(o,u);if(e&&r!=r){while(u>d)if(s=l[d++],s!=s)return!0}else for(;u>d;d++)if((e||d in l)&&l[d]===r)return e||d||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},"50c4":function(e,t,r){var n=r("a691"),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},5135:function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},5392:function(module,exports,__webpack_require__){!function(e,t){module.exports=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;rthis.video.videoWidth/this.video.videoHeight?a.root.style.height=this.video.videoHeight/this.video.videoWidth*e.width+"px":a.root.style.width=this.video.videoWidth/this.video.videoHeight*e.height+"px":"fixWidth"===a.config.fitVideoSize?a.root.style.height=this.video.videoHeight/this.video.videoWidth*e.width+"px":"fixHeight"===a.config.fitVideoSize&&(a.root.style.width=this.video.videoWidth/this.video.videoHeight*e.height+"px")}},a.once("loadeddata",r.getVideoSize),setTimeout((function(){r.emit("ready"),r.isReady=!0}),0),r.config.keyShortcut&&"on"!==r.config.keyShortcut||["video","controls"].forEach((function(e){a[e].addEventListener("keydown",(function(e){a.onKeydown(e,a)}))})),r.config.videoInit&&o.default.hasClass(r.root,"xgplayer-nostart")&&r.start(),a.config.rotate&&(a.on("requestFullscreen",r.updateRotateDeg),a.on("exitFullscreen",r.updateRotateDeg)),a.once("destroy",(function e(){a.root.removeEventListener("mousemove",a.mousemoveFunc),a.off("destroy",e)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"start",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.url,n=this.root,i=this;r&&""!==r||this.emit("urlNull"),this.logParams.playSrc=r,this.canPlayFunc=function(){i.off("canplay",i.canPlayFunc);var e=i.video.play();void 0!==e&&e&&e.then((function(){i.emit("autoplay started")})).catch((function(){i.emit("autoplay was prevented"),t.util.addClass(i.root,"xgplayer-is-autoplay")}))},"String"===o.default.typeOf(r)?r.indexOf("blob:")>-1&&r===this.video.src||(this.video.src=r):r.forEach((function(t){e.video.appendChild(o.default.createDom("source","",{src:""+t.src,type:""+(t.type||"")}))})),this.logParams.pt=(new Date).getTime(),this.logParams.vt=this.logParams.pt,this.loadeddataFunc=function(){i.logParams.vt=(new Date).getTime(),i.logParams.pt>i.logParams.vt&&(i.logParams.pt=i.logParams.vt),i.logParams.vd=i.video.duration},this.once("loadeddata",this.loadeddataFunc),this.config.autoplay&&(l.default.os.isPhone?this.canPlayFunc():this.on("canplay",this.canPlayFunc)),this.config.disableStartLoad||this.video.load(),n.insertBefore(this.video,n.firstChild),setTimeout((function(){e.emit("complete"),e.danmu&&"function"==typeof e.danmu.resize&&e.danmu.resize()}),1)}},{key:"reload",value:function(){this.video.load(),this.reloadFunc=function(){var e=this.play();void 0!==e&&e&&e.catch((function(e){}))},this.once("loadeddata",this.reloadFunc)}},{key:"destroy",value:function(){var e=this,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this;for(var a in clearInterval(this.bulletResizeTimer),this._interval)clearInterval(this._interval[a]),this._interval[a]=null;function o(){if(this.emit("destroy"),this.video.removeAttribute("src"),this.video.load(),r){this.root.innerHTML="";var e=this.root.className.split(" ");e.length>0?this.root.className=e.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):this.root.className=""}for(var t in this)delete this[t];this.off("pause",o)}this.checkTimer&&clearInterval(this.checkTimer),this.waitTimer&&clearTimeout(this.waitTimer),this.ev.forEach((function(t){var r=Object.keys(t)[0],n=e[t[r]];n&&e.off(r,n)})),this.loadeddataFunc&&this.off("loadeddata",this.loadeddataFunc),this.reloadFunc&&this.off("loadeddata",this.reloadFunc),this.replayFunc&&this.off("play",this.replayFunc),this.playFunc&&this.off("play",this.playFunc),this.getVideoSize&&this.off("loadeddata",this.getVideoSize),["focus","blur"].forEach((function(t){e.off(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),this.config.keyShortcut&&"on"!==this.config.keyShortcut||["video","controls"].forEach((function(t){e[t]&&e[t].removeEventListener("keydown",(function(e){n.onKeydown(e,n)}))})),this.paused?o.call(this):(this.pause(),this.once("pause",o)),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"replay",value:function(){var e=this,t=this._replay;if(o.default.removeClass(this.root,"xgplayer-ended"),this.logParams={bc:0,bu_acu_t:0,played:[],pt:(new Date).getTime(),vt:(new Date).getTime(),vd:0},this.logParams.pt=(new Date).getTime(),this.logParams.vt=this.logParams.pt,this.replayFunc=function(){e.logParams.vt=(new Date).getTime(),e.logParams.pt>e.logParams.vt&&(e.logParams.pt=e.logParams.vt),e.logParams.vd=e.video.duration},this.once("play",this.replayFunc),this.logParams.playSrc=this.video.currentSrc,t&&t instanceof Function)t();else{this.currentTime=0;var r=this.play();void 0!==r&&r&&r.catch((function(e){}))}}},{key:"getFullscreen",value:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):this.video.webkitSupportsFullscreen?this.video.webkitEnterFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():o.default.addClass(e,"xgplayer-is-cssfullscreen")}},{key:"exitFullscreen",value:function(e){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),o.default.removeClass(e,"xgplayer-is-cssfullscreen")}},{key:"getCssFullscreen",value:function(){this.config.fluid&&(this.root.style["padding-top"]=""),o.default.addClass(this.root,"xgplayer-is-cssfullscreen"),this.emit("requestCssFullscreen")}},{key:"exitCssFullscreen",value:function(){this.config.fluid&&(this.root.style.width="100%",this.root.style.height="0",this.root.style["padding-top"]=100*this.config.height/this.config.width+"%"),o.default.removeClass(this.root,"xgplayer-is-cssfullscreen"),this.emit("exitCssFullscreen")}},{key:"getRotateFullscreen",value:function(){document.documentElement.style.width="100%",document.documentElement.style.height="100%",this.root&&!t.util.hasClass(this.root,"xgplayer-rotate-fullscreen")&&t.util.addClass(this.root,"xgplayer-rotate-fullscreen"),this.emit("getRotateFullscreen")}},{key:"exitRotateFullscreen",value:function(){document.documentElement.style.width="unset",document.documentElement.style.height="unset",this.root&&t.util.hasClass(this.root,"xgplayer-rotate-fullscreen")&&t.util.removeClass(this.root,"xgplayer-rotate-fullscreen"),this.emit("exitRotateFullscreen")}},{key:"download",value:function(){var e=(0,c.getAbsoluteURL)(this.config.url);(0,f.default)(e)}},{key:"pluginsCall",value:function(){var e=this,r=this;if(t.plugins){var n=this.config.ignores;Object.keys(t.plugins).forEach((function(i){var a=t.plugins[i];n.some((function(e){return i===e||i==="s_"+e}))||(["pc","tablet","mobile"].some((function(e){return e===i}))?i===l.default.device&&setTimeout((function(){a.call(r,r)}),0):a.call(e,e))}))}}},{key:"getPIP",value:function(){var e=o.default.createDom("xg-pip-lay","
",{},"xgplayer-pip-lay");this.root.appendChild(e);var t=o.default.createDom("xg-pip-drag",'
'+this.lang.PIP_DRAG+"
",{tabindex:9},"xgplayer-pip-drag");this.root.appendChild(t),new d.default(".xgplayer",{handle:".drag-handle"}),o.default.addClass(this.root,"xgplayer-pip-active"),this.root.style.right=0,this.root.style.bottom="200px",this.root.style.top="",this.root.style.left="",this.root.style.width="320px",this.root.style.height="180px",this.config.pipConfig&&(void 0!==this.config.pipConfig.top&&(this.root.style.top=this.config.pipConfig.top+"px",this.root.style.bottom=""),void 0!==this.config.pipConfig.bottom&&(this.root.style.bottom=this.config.pipConfig.bottom+"px"),void 0!==this.config.pipConfig.left&&(this.root.style.left=this.config.pipConfig.left+"px",this.root.style.right=""),void 0!==this.config.pipConfig.right&&(this.root.style.right=this.config.pipConfig.right+"px"),void 0!==this.config.pipConfig.width&&(this.root.style.width=this.config.pipConfig.width+"px"),void 0!==this.config.pipConfig.height&&(this.root.style.height=this.config.pipConfig.height+"px")),this.config.fluid&&(this.root.style["padding-top"]="");var r=this;["click","touchend"].forEach((function(t){e.addEventListener(t,(function(e){e.preventDefault(),e.stopPropagation(),r.exitPIP()}))}))}},{key:"exitPIP",value:function(){o.default.removeClass(this.root,"xgplayer-pip-active"),this.root.style.right="",this.root.style.bottom="",this.root.style.top="",this.root.style.left="",this.config.fluid?(this.root.style.width="100%",this.root.style.height="0",this.root.style["padding-top"]=100*this.config.height/this.config.width+"%"):(this.config.width&&("number"!=typeof this.config.width?this.root.style.width=this.config.width:this.root.style.width=this.config.width+"px"),this.config.height&&("number"!=typeof this.config.height?this.root.style.height=this.config.height:this.root.style.height=this.config.height+"px"));var e=o.default.findDom(this.root,".xgplayer-pip-lay");e&&e.parentNode&&e.parentNode.removeChild(e);var t=o.default.findDom(this.root,".xgplayer-pip-drag");t&&t.parentNode&&t.parentNode.removeChild(t)}},{key:"updateRotateDeg",value:function(){this.rotateDeg||(this.rotateDeg=0);var e=this.root.offsetWidth,t=this.root.offsetHeight,r=this.video.videoWidth,n=this.video.videoHeight;!this.config.rotate.innerRotate&&this.config.rotate.controlsFix&&(this.root.style.width=t+"px",this.root.style.height=e+"px");var i=void 0;.25===this.rotateDeg||.75===this.rotateDeg?(i=this.config.rotate.innerRotate?r/n>t/e?t/(n/r>t/e?t*r/n:e):e/(n/r>t/e?t:e*n/r):e>=t?e/t:t/e,i=Number(i.toFixed(5))):i=1,this.config.rotate.innerRotate||this.config.rotate.controlsFix?(this.video.style.transformOrigin="center center",this.video.style.transform="rotate("+this.rotateDeg+"turn) scale("+i+")",this.video.style.webKitTransform="rotate("+this.rotateDeg+"turn) scale("+i+")"):(this.root.style.transformOrigin="center center",this.root.style.transform="rotate("+this.rotateDeg+"turn) scale(1)",this.root.style.webKitTransform="rotate("+this.rotateDeg+"turn) scale(1)")}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this;r.rotateDeg||(r.rotateDeg=0);var n=e?1:-1;r.rotateDeg=(r.rotateDeg+1+.25*n*t)%1,this.updateRotateDeg(),r.emit("rotate",360*r.rotateDeg)}},{key:"onFocus",value:function(){var e=this;o.default.removeClass(this.root,"xgplayer-inactive"),e.userTimer&&clearTimeout(e.userTimer),e.userTimer=setTimeout((function(){e.emit("blur")}),e.config.inactive)}},{key:"onBlur",value:function(){!this.config.enablePausedInactive&&this.paused||this.ended||this.config.closeInactive||o.default.addClass(this.root,"xgplayer-inactive")}},{key:"onPlay",value:function(){o.default.addClass(this.root,"xgplayer-isloading"),o.default.addClass(this.root,"xgplayer-playing"),o.default.removeClass(this.root,"xgplayer-pause")}},{key:"onPause",value:function(){o.default.addClass(this.root,"xgplayer-pause"),this.userTimer&&clearTimeout(this.userTimer),this.emit("focus")}},{key:"onEnded",value:function(){o.default.addClass(this.root,"xgplayer-ended"),o.default.removeClass(this.root,"xgplayer-playing")}},{key:"onSeeking",value:function(){this.isSeeking=!0,this.onWaiting()}},{key:"onTimeupdate",value:function(){this.waitTimer&&clearTimeout(this.waitTimer),o.default.removeClass(this.root,"xgplayer-isloading")}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&clearTimeout(this.waitTimer),o.default.removeClass(this.root,"xgplayer-isloading")}},{key:"onWaiting",value:function(){var e=this;e.waitTimer&&clearTimeout(e.waitTimer),e.checkTimer&&(clearInterval(e.checkTimer),e.checkTimer=null);var t=e.currentTime;e.waitTimer=setTimeout((function(){o.default.addClass(e.root,"xgplayer-isloading"),e.checkTimer=setInterval((function(){e.currentTime!==t&&(o.default.removeClass(this.root,"xgplayer-isloading"),clearInterval(e.checkTimer),e.checkTimer=null)}),1e3)}),500)}},{key:"onPlaying",value:function(){this.paused||(this.isSeeking=!1,this.waitTimer&&clearTimeout(this.waitTimer),o.default.removeClass(this.root,"xgplayer-isloading xgplayer-nostart xgplayer-pause xgplayer-ended xgplayer-is-error xgplayer-replay"),o.default.addClass(this.root,"xgplayer-playing"))}},{key:"onKeydown",value:function(e,t){var r=e||window.event;if(!r||37!==r.keyCode&&38!==r.keyCode&&39!==r.keyCode&&40!==r.keyCode&&32!==r.keyCode||t.emit("focus"),!r||40!==r.keyCode&&38!==r.keyCode){if(r&&39===r.keyCode)t.currentTime+10<=t.duration?t.currentTime+=10:t.currentTime=t.duration-1;else if(r&&37===r.keyCode)t.currentTime-10>=0?t.currentTime-=10:t.currentTime=0;else if(r&&32===r.keyCode)if(t.paused){var n=t.play();void 0!==n&&n&&n.catch((function(e){}))}else t.pause()}else{if(t.controls){var i=t.controls.querySelector(".xgplayer-slider");i&&(o.default.hasClass(i,"xgplayer-none")&&o.default.removeClass(i,"xgplayer-none"),t.sliderTimer&&clearTimeout(t.sliderTimer),t.sliderTimer=setTimeout((function(){o.default.addClass(i,"xgplayer-none")}),t.config.inactive))}r&&40===r.keyCode?t.volume-.1>=0?t.volume=Number((t.volume-.1).toFixed(1)):t.volume=0:r&&38===r.keyCode&&(t.volume+.1<=1?t.volume=Number((t.volume+.1).toFixed(1)):t.volume=1)}}},{key:"cumulateTime",get:function(){if(this.logParams&&this.logParams.played instanceof Array){var e=o.default.computeWatchDur(this.logParams.played)||0;return Number(e.toFixed(3))}return 0}}],[{key:"install",value:function(e,r){t.plugins||(t.plugins={}),t.plugins[e]||(t.plugins[e]=r)}},{key:"use",value:function(e,r){t.plugins||(t.plugins={}),t.plugins[e]=r}}]),t}(a.default);y.util=o.default,y.sniffer=l.default,y.Errors=u.default,t.default=y,e.exports=t.default},function(e,t,r){"use strict";var n=r(21)();e.exports=function(e){return e!==n&&null!==e}},function(e,t,r){"use strict";e.exports=function(e){return null!=e}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var util={createDom:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=document.createElement(e);return i.className=n,i.innerHTML=t,Object.keys(r).forEach((function(t){var n=t,a=r[t];"video"===e||"audio"===e?a&&i.setAttribute(n,a):i.setAttribute(n,a)})),i},hasClass:function(e,t){return!!e&&(e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)")))},addClass:function(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):util.hasClass(e,t)||(e.className+=" "+t))},removeClass:function(e,t){e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):util.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(r," ")})))},toggleClass:function(e,t){e&&t.split(/\s+/g).forEach((function(t){util.hasClass(e,t)?util.removeClass(e,t):util.addClass(e,t)}))},findDom:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],r=void 0;try{r=e.querySelector(t)}catch(n){0===t.indexOf("#")&&(r=e.getElementById(t.slice(1)))}return r},padStart:function(e,t,r){for(var n=String(r),i=t>>0,a=Math.ceil(i/n.length),o=[],s=String(e);a--;)o.push(n);return o.join("").substring(0,i-s.length)+s},format:function(e){if(window.isNaN(e))return"";var t=util.padStart(Math.floor(e/3600),2,0),r=util.padStart(Math.floor((e-3600*t)/60),2,0),n=util.padStart(Math.floor(e-3600*t-60*r),2,0);return("00"===t?[r,n]:[t,r,n]).join(":")},event:function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},typeOf:function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},deepCopy:function(e,t){if("Object"===util.typeOf(t)&&"Object"===util.typeOf(e))return Object.keys(t).forEach((function(r){"Object"!==util.typeOf(t[r])||t[r]instanceof Node?"Array"===util.typeOf(t[r])?e[r]="Array"===util.typeOf(e[r])?e[r].concat(t[r]):t[r]:e[r]=t[r]:e[r]?util.deepCopy(e[r],t[r]):e[r]=t[r]})),e},getBgImage:function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var r=document.createElement("a");return r.href=t.replace(/url\("|"\)/g,""),r.href},copyDom:function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},setInterval:function(e,t,r,n){e._interval[t]||(e._interval[t]=setInterval(r.bind(e),n))},clearInterval:function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},createImgBtn:function(e,t,r,n){var i=util.createDom("xg-"+e,"",{},"xgplayer-"+e+"-img");if(i.style.backgroundImage='url("'+t+'")',r&&n){var a=void 0,o=void 0,s=void 0;["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(r.indexOf(e)>-1&&n.indexOf(e)>-1)||(a=Number(r.slice(0,r.indexOf(e)).trim()),o=Number(n.slice(0,n.indexOf(e)).trim()),s=e,!1)})),i.style.width=""+a+s,i.style.height=""+o+s,i.style.backgroundSize=""+a+s+" "+o+s,i.style.margin="start"===e?"-"+o/2+s+" auto auto -"+a/2+s:"auto 5px auto 5px"}return i},Hex2RGBA:function(hex,alpha){var rgb=[];if(/^\#[0-9A-F]{3}$/i.test(hex)){var sixHex="#";hex.replace(/[0-9A-F]/gi,(function(e){sixHex+=e+e})),hex=sixHex}return/^#[0-9A-F]{6}$/i.test(hex)?(hex.replace(/[0-9A-F]{2}/gi,(function(kw){rgb.push(eval("0x"+kw))})),"rgba("+rgb.join(",")+", "+alpha+")"):"rgba(255, 255, 255, 0.1)"},isWeiXin:function(){return window.navigator.userAgent.toLowerCase().indexOf("micromessenger")>-1},isUc:function(){return window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")>-1},computeWatchDur:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;rt[n].end)){var o=t[n].begin,s=t[n].end;t[n].begin=Math.min(i,o),t[n].end=Math.max(a,s);break}if(n>t.length-2){t.push({begin:i,end:a});break}}for(var l=0,u=0;u8&&void 0!==arguments[8]?arguments[8]:{line:"",handle:"",msg:"",version:""},h=arguments[9],p=arguments[10];i(this,e);var g={};if(arguments.length>1)g.playerVersion=n.version,g.errorType=t,g.domain=document.domain,g.duration=o,g.currentTime=r,g.networkState=s,g.readyState=l,g.currentSrc=d,g.src=u,g.ended=c,g.errd=f,g.ex=(a[t]||{}).msg,g.errorCode=h,g.mediaError=p;else{var y=arguments[0];Object.keys(y).map((function(e){g[e]=y[e]})),g.ex=(y.type&&a[y.type]||{}).msg}return g},e.exports=t.default},function(e){e.exports=JSON.parse('{"version":"2.10.2"}')},function(e,t,r){e.exports=r(7)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=w(r(0)),i=w(r(37)),a=w(r(38)),o=w(r(39)),s=w(r(40)),l=w(r(41)),u=w(r(42)),d=w(r(43)),c=w(r(44)),f=w(r(45)),h=w(r(46)),p=w(r(47)),g=w(r(48)),y=w(r(49)),v=w(r(50)),m=w(r(51)),_=w(r(52)),b=w(r(53)),x=w(r(54)),k=w(r(55)),E=w(r(56));function w(e){return e&&e.__esModule?e:{default:e}}w(r(57));var S={};function T(e,t,r){var n=e;t.map((function(e,i){n[e]=i==t.length-1?r:n[e]||{},n=n[e]}))}T(S,["controls","cssFullscreen"],E.default),T(S,["controls","danmu"],k.default),T(S,["controls","definition"],x.default),T(S,["controls","download"],b.default),T(S,["controls","errorRetry"],_.default),T(S,["controls","fullscreen"],m.default),T(S,["controls","i18n"],v.default),T(S,["controls","localPreview"],y.default),T(S,["controls","memoryPlay"],g.default),T(S,["controls","mobile"],p.default),T(S,["controls","pc"],h.default),T(S,["controls","pip"],f.default),T(S,["controls","play"],c.default),T(S,["controls","playNext"],d.default),T(S,["controls","reload"],u.default),T(S,["controls","replay"],l.default),T(S,["controls","rotate"],s.default),T(S,["controls","screenShot"],o.default),T(S,["controls","start"],a.default),T(S,["controls","volume"],i.default),t.default=n.default,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&!t.textTrack.some((function(e){return e.default}))&&(t.textTrack[0].default=!0,this.textTrackShowDefault=!1),t.textTrack.some((function(e){if(e.src&&e.label&&e.default)return r+='",!0})),this.videoConfig.crossorigin="anonymous"),t.textTrackStyle){var n=document.createElement("style");this.textTrackStyle=n,document.head.appendChild(n);var o="";for(var s in t.textTrackStyle)o+=s+": "+t.textTrackStyle[s]+";";var l=t.id?"#"+t.id:t.el.id?"#"+t.el.id:"."+t.el.className;n.sheet.insertRule?n.sheet.insertRule(l+" video::cue { "+o+" }",0):n.sheet.addRule&&n.sheet.addRule(l+" video::cue",o)}this.video=a.default.createDom(this.videoConfig.mediaType,r,this.videoConfig,""),!this.textTrackShowDefault&&r&&(this.video.getElementsByTagName("Track")[0].track.mode="hidden"),t.autoplay&&(this.video.autoplay=!0,t.autoplayMuted&&(this.video.muted=!0)),this.ev=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadstart"].map((function(e){return t={},r=e,n="on"+e.charAt(0).toUpperCase()+e.slice(1),r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t;var t,r,n})),(0,i.default)(this),this._interval={};var u="0,0",d=this;this.ev.forEach((function(e){d.evItem=Object.keys(e)[0];var t=Object.keys(e)[0];d.video.addEventListener(Object.keys(e)[0],(function(){d&&d.logParams&&("play"===t?d.hasStart=!0:"canplay"===t?a.default.removeClass(d.root,"xgplayer-is-enter"):"waiting"===t?(d.logParams.bc++,d.inWaitingStart=(new Date).getTime()):"playing"===t?(a.default.removeClass(d.root,"xgplayer-is-enter"),d.inWaitingStart&&(d.logParams.bu_acu_t+=(new Date).getTime()-d.inWaitingStart,d.inWaitingStart=void 0)):"loadeddata"===t?d.logParams.played.push({begin:0,end:-1}):"seeking"===t?d.logParams.played.push({begin:d.video.currentTime,end:-1}):d&&d.logParams&&d.logParams.played&&"timeupdate"===t&&(d.logParams.played.length<1&&d.logParams.played.push({begin:d.video.currentTime,end:-1}),d.logParams.played[d.logParams.played.length-1].end=d.video.currentTime),"error"===t?d._onError(t):d.emit(t,d),d.hasOwnProperty("_interval")&&(["ended","error","timeupdate"].indexOf(t)<0?(clearInterval(d._interval.bufferedChange),a.default.setInterval(d,"bufferedChange",(function(){if(d.video&&d.video.buffered){for(var e=[],t=0,r=d.video.buffered.length;tt.logParams.vt&&(t.logParams.pt=t.logParams.vt),t.logParams.vd=t.video.duration,t.off("loadeddata",e)}))}},{key:"poster",set:function(e){var t=a.default.findDom(this.root,".xgplayer-poster");t&&(t.style.backgroundImage="url("+e+")")}},{key:"volume",get:function(){return this.video.volume},set:function(e){this.video.volume=e}},{key:"fullscreen",get:function(){return a.default.hasClass(this.root,"xgplayer-is-fullscreen")||a.default.hasClass(this.root,"xgplayer-fullscreen-active")}},{key:"bullet",get:function(){return!!a.default.findDom(this.root,"xg-danmu")&&a.default.hasClass(a.default.findDom(this.root,"xg-danmu"),"xgplayer-has-danmu")}},{key:"textTrack",get:function(){return a.default.hasClass(this.root,"xgplayer-is-textTrack")}},{key:"pip",get:function(){return a.default.hasClass(this.root,"xgplayer-pip-active")}}]),e}();t.default=l,e.exports=t.default},function(e,t,r){"use strict";var n,i,a,o,s,l,u,d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=r(10),f=r(27),h=Function.prototype.apply,p=Function.prototype.call,g=Object.create,y=Object.defineProperty,v=Object.defineProperties,m=Object.prototype.hasOwnProperty,_={configurable:!0,enumerable:!1,writable:!0};i=function(e,t){var r,i;return f(t),i=this,n.call(this,e,r=function(){a.call(i,e,r),h.call(t,this,arguments)}),r.__eeOnceListener__=t,this},s={on:n=function(e,t){var r;return f(t),m.call(this,"__ee__")?r=this.__ee__:(r=_.value=g(null),y(this,"__ee__",_),_.value=null),r[e]?"object"===d(r[e])?r[e].push(t):r[e]=[r[e],t]:r[e]=t,this},once:i,off:a=function(e,t){var r,n,i,a;if(f(t),!m.call(this,"__ee__"))return this;if(!(r=this.__ee__)[e])return this;if("object"===(void 0===(n=r[e])?"undefined":d(n)))for(a=0;i=n[a];++a)i!==t&&i.__eeOnceListener__!==t||(2===n.length?r[e]=n[a?0:1]:n.splice(a,1));else n!==t&&n.__eeOnceListener__!==t||delete r[e];return this},emit:o=function(e){var t,r,n,i,a;if(m.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"===(void 0===i?"undefined":d(i))){for(r=arguments.length,a=new Array(r-1),t=1;t-1}},function(e,t,r){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};i(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return n(e,[{key:"openDB",value:function(e){var t=this,r=this,n=this.myDB.version||1,i=r.indexedDB.open(r.myDB.name,n);i.onerror=function(e){},i.onsuccess=function(n){t.myDB.db=n.target.result,e.call(r)},i.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(r.myDB.ojstore.name)||t.createObjectStore(r.myDB.ojstore.name,{keyPath:r.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var r=this.myDB.db.transaction(e,"readwrite").objectStore(e),n=void 0,i=0;i