window.Player=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nthis.video.videoWidth/this.video.videoHeight?u.root.style.height=this.video.videoHeight/this.video.videoWidth*e.width+"px":u.root.style.width=this.video.videoWidth/this.video.videoHeight*e.height+"px":"fixWidth"===u.config.fitVideoSize?u.root.style.height=this.video.videoHeight/this.video.videoWidth*e.width+"px":"fixHeight"===u.config.fitVideoSize&&(u.root.style.width=this.video.videoWidth/this.video.videoHeight*e.height+"px")}},u.once("loadeddata",n.getVideoSize),setTimeout(function(){n.emit("ready"),n.isReady=!0},0),n.config.keyShortcut&&"on"!==n.config.keyShortcut||["video","controls"].forEach(function(e){u[e].addEventListener("keydown",function(e){u.onKeydown(e,u)})}),n.config.videoInit&&i.default.hasClass(n.root,"xgplayer-nostart")&&n.start(),u.config.rotate&&(u.on("requestFullscreen",n.updateRotateDeg),u.on("exitFullscreen",n.updateRotateDeg)),u.once("destroy",function e(){u.root.removeEventListener("mousemove",u.mousemoveFunc),u.off("destroy",e)}),n}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,a.default),r(t,[{key:"start",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.url,r=this.root,a=this;if(n&&""!==n||this.emit("urlNull"),this.logParams.playSrc=n,this.canPlayFunc=function(){a.off("canplay",a.canPlayFunc)},"String"===i.default.typeOf(n)?n.indexOf("blob:")>-1&&n===this.video.src||(this.video.src=n):n.forEach(function(t){e.video.appendChild(i.default.createDom("source","",{src:""+t.src,type:""+(t.type||"")}))}),this.logParams.pt=(new Date).getTime(),this.logParams.vt=this.logParams.pt,this.loadeddataFunc=function(){a.logParams.vt=(new Date).getTime(),a.logParams.pt>a.logParams.vt&&(a.logParams.pt=a.logParams.vt),a.logParams.vd=a.video.duration},this.once("loadeddata",this.loadeddataFunc),this.config.autoplay){this.on("canplay",this.canPlayFunc);var o=a.video.play();void 0!==o&&o&&o.then(function(){a.emit("autoplay started")}).catch(function(){a.emit("autoplay was prevented"),t.util.addClass(a.root,"xgplayer-is-autoplay")})}this.config.disableStartLoad||this.video.load(),r.insertBefore(this.video,r.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,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=this;for(var a in clearInterval(this.bulletResizeTimer),this._interval)clearInterval(this._interval[a]),this._interval[a]=null;function i(){if(this.emit("destroy"),this.video.removeAttribute("src"),this.video.load(),n){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",i)}this.checkTimer&&clearInterval(this.checkTimer),this.waitTimer&&clearTimeout(this.waitTimer),this.ev.forEach(function(t){var n=Object.keys(t)[0],r=e[t[n]];r&&e.off(n,r)}),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){r.onKeydown(e,r)})}),this.paused?i.call(this):(this.pause(),this.once("pause",i)),function e(t,n,r){null===t&&(t=Function.prototype);var a=Object.getOwnPropertyDescriptor(t,n);if(void 0===a){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in a)return a.value;var o=a.get;return void 0!==o?o.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"replay",value:function(){var e=this,t=this._replay;if(i.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 n=this.play();void 0!==n&&n&&n.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():i.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(),i.default.removeClass(e,"xgplayer-is-cssfullscreen")}},{key:"getCssFullscreen",value:function(){this.config.fluid&&(this.root.style["padding-top"]=""),i.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+"%"),i.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,d.default)(e)}},{key:"pluginsCall",value:function(){var e=this,n=this;if(t.plugins){var r=this.config.ignores;Object.keys(t.plugins).forEach(function(a){var i=t.plugins[a];r.some(function(e){return a===e||a==="s_"+e})||(["pc","tablet","mobile"].some(function(e){return e===a})?a===l.default.device&&setTimeout(function(){i.call(n,n)},0):i.call(e,e))})}}},{key:"getPIP",value:function(){var e=i.default.createDom("xg-pip-lay","
",{},"xgplayer-pip-lay");this.root.appendChild(e);var t=i.default.createDom("xg-pip-drag",'
点击按住可拖动视频
',{tabindex:9},"xgplayer-pip-drag");this.root.appendChild(t);new u.default(".xgplayer",{handle:".drag-handle"});i.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 n=this;["click","touchend"].forEach(function(t){e.addEventListener(t,function(e){e.preventDefault(),e.stopPropagation(),n.exitPIP()})})}},{key:"exitPIP",value:function(){i.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=i.default.findDom(this.root,".xgplayer-pip-lay");e&&e.parentNode&&e.parentNode.removeChild(e);var t=i.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,n=this.video.videoWidth,r=this.video.videoHeight;!this.config.rotate.innerRotate&&this.config.rotate.controlsFix&&(this.root.style.width=t+"px",this.root.style.height=e+"px");var a=void 0;if(.25===this.rotateDeg||.75===this.rotateDeg){if(this.config.rotate.innerRotate)if(n/r>t/e){a=t/(r/n>t/e?t*n/r:e)}else{a=e/(r/n>t/e?t:e*r/n)}else a=e>=t?e/t:t/e;a=parseFloat(a.toFixed(5))}else a=1;this.config.rotate.innerRotate?(this.video.style.transformOrigin="center center",this.video.style.transform="rotate("+this.rotateDeg+"turn) scale("+a+")",this.video.style.webKitTransform="rotate("+this.rotateDeg+"turn) scale("+a+")"):this.config.rotate.controlsFix?(this.video.style.transformOrigin="center center",this.video.style.transform="rotate("+this.rotateDeg+"turn) scale("+a+")",this.video.style.webKitTransform="rotate("+this.rotateDeg+"turn) scale("+a+")"):(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>1&&void 0!==arguments[1])||arguments[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:1);this.rotateDeg||(this.rotateDeg=0);var n=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*n*t)%1,this.updateRotateDeg(),this.emit("rotate",360*this.rotateDeg)}},{key:"onFocus",value:function(){var e=this;i.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||i.default.addClass(this.root,"xgplayer-inactive")}},{key:"onPlay",value:function(){i.default.addClass(this.root,"xgplayer-isloading"),i.default.addClass(this.root,"xgplayer-playing"),i.default.removeClass(this.root,"xgplayer-pause")}},{key:"onPause",value:function(){i.default.addClass(this.root,"xgplayer-pause"),this.userTimer&&clearTimeout(this.userTimer),this.emit("focus")}},{key:"onEnded",value:function(){i.default.addClass(this.root,"xgplayer-ended"),i.default.removeClass(this.root,"xgplayer-playing")}},{key:"onSeeking",value:function(){this.isSeeking=!0,this.onWaiting()}},{key:"onTimeupdate",value:function(){this.waitTimer&&clearTimeout(this.waitTimer),i.default.removeClass(this.root,"xgplayer-isloading")}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&clearTimeout(this.waitTimer),i.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(){i.default.addClass(e.root,"xgplayer-isloading"),e.checkTimer=setInterval(function(){e.currentTime!==t&&(i.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),i.default.removeClass(this.root,"xgplayer-isloading xgplayer-nostart xgplayer-pause xgplayer-ended xgplayer-is-error xgplayer-replay"),i.default.addClass(this.root,"xgplayer-playing"))}},{key:"onKeydown",value:function(e,t){var n=e||window.event;if(!n||37!==n.keyCode&&38!==n.keyCode&&39!==n.keyCode&&40!==n.keyCode&&32!==n.keyCode||t.emit("focus"),!n||40!==n.keyCode&&38!==n.keyCode){if(n&&39===n.keyCode)t.currentTime+10<=t.duration?t.currentTime+=10:t.currentTime=t.duration-1;else if(n&&37===n.keyCode)t.currentTime-10>=0?t.currentTime-=10:t.currentTime=0;else if(n&&32===n.keyCode)if(t.paused){var r=t.play();void 0!==r&&r&&r.catch(function(e){})}else t.pause()}else{if(t.controls){var a=t.controls.querySelector(".xgplayer-slider");a&&(i.default.hasClass(a,"xgplayer-none")&&i.default.removeClass(a,"xgplayer-none"),t.sliderTimer&&clearTimeout(t.sliderTimer),t.sliderTimer=setTimeout(function(){i.default.addClass(a,"xgplayer-none")},t.config.inactive))}n&&40===n.keyCode?t.volume-.1>=0?t.volume=parseFloat((t.volume-.1).toFixed(1)):t.volume=0:n&&38===n.keyCode&&(t.volume+.1<=1?t.volume=parseFloat((t.volume+.1).toFixed(1)):t.volume=1)}}},{key:"cumulateTime",get:function(){if(this.logParams&&this.logParams.played instanceof Array){var e=i.default.computeWatchDur(this.logParams.played)||0;return Number(e.toFixed(3))}return 0}}],[{key:"install",value:function(e,n){t.plugins||(t.plugins={}),t.plugins[e]||(t.plugins[e]=n)}},{key:"use",value:function(e,n){t.plugins||(t.plugins={}),t.plugins[e]=n}}]),t}();h.util=i.default,h.sniffer=l.default,h.Errors=s.default,t.default=h,e.exports=t.default},function(e,t,n){"use strict";var r=n(23)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"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]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=document.createElement(e);return a.className=r,a.innerHTML=t,Object.keys(n).forEach(function(t){var r=t,i=n[t];"video"===e||"audio"===e?i&&a.setAttribute(r,i):a.setAttribute(r,i)}),a},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 n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}))},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],n=void 0;try{n=e.querySelector(t)}catch(r){0===t.indexOf("#")&&(n=e.getElementById(t.slice(1)))}return n},padStart:function(e,t,n){for(var r=String(n),a=t>>0,i=Math.ceil(a/r.length),o=[],l=String(e);i--;)o.push(r);return o.join("").substring(0,a-l.length)+l},format:function(e){if(window.isNaN(e))return"";var t=util.padStart(Math.floor(e/3600),2,0),n=util.padStart(Math.floor((e-3600*t)/60),2,0),r=util.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,r]:[t,n,r]).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(n){"Object"!==util.typeOf(t[n])||t[n]instanceof Node?"Array"===util.typeOf(t[n])?e[n]="Array"===util.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:e[n]?util.deepCopy(e[n],t[n]):e[n]=t[n]}),e},getBgImage:function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.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,n,r){e._interval[t]||(e._interval[t]=setInterval(n.bind(e),r))},clearInterval:function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},createImgBtn:function(e,t,n,r){var a=util.createDom("xg-"+e,"",{},"xgplayer-"+e+"-img");if(a.style.backgroundImage='url("'+t+'")',n&&r){var i=void 0,o=void 0,l=void 0;["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(e){return!(n.indexOf(e)>-1&&r.indexOf(e)>-1)||(i=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(r.slice(0,r.indexOf(e)).trim()),l=e,!1)}),a.style.width=""+i+l,a.style.height=""+o+l,a.style.backgroundSize=""+i+l+" "+o+l,a.style.margin="start"===e?"-"+o/2+l+" auto auto -"+i/2+l:"auto 5px auto 5px"}return a},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},computeWatchDur:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=0;nt[r].end)){var o=t[r].begin,l=t[r].end;t[r].begin=Math.min(a,o),t[r].end=Math.max(i,l);break}if(r>t.length-2){t.push({begin:a,end:i});break}}for(var s=0,u=0;u8&&void 0!==arguments[8]?arguments[8]:{line:"",handle:"",msg:"",version:""},p=arguments[9],f=arguments[10];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var g={};if(arguments.length>1)g.playerVersion=r.version,g.errorType=t,g.domain=document.domain,g.duration=i,g.currentTime=n,g.networkState=o,g.readyState=l,g.currentSrc=u,g.src=s,g.ended=c,g.errd=d,g.ex=(a[t]||{}).msg,g.errorCode=p,g.mediaError=f;else{var h=arguments[0];Object.keys(h).map(function(e){g[e]=h[e]}),g.ex=(h.type&&a[h.type]||{}).msg}return g},e.exports=t.default},function(e){e.exports={name:"xgplayer",version:"2.9.6",description:"video player",main:"./dist/index.js",typings:"./types/index.d.ts",bin:{xgplayer:"bin/xgplayer.js"},scripts:{prepare:"npm run build",build:"webpack --progress --display-chunks -p",watch:"webpack --progress --display-chunks -p --watch --mode development"},keywords:["video","player"],babel:{presets:["es2015"],plugins:["add-module-exports","babel-plugin-bulk-import"]},repository:{type:"git",url:"git+https://github.com/bytedance/xgplayer.git"},author:"yinguohui@bytedance.com",license:"MIT",dependencies:{chalk:"^2.3.2",commander:"^2.15.1","danmu.js":"^0.2.17",deepmerge:"^1.5.0",downloadjs:"1.4.7",draggabilly:"^2.2.0","event-emitter":"^0.3.5","fs-extra":"^5.0.0",install:"^0.13.0",pasition:"^1.0.1","request-frame":"^1.5.3"},browserslist:["> 5%","IE 9","iOS 7","Firefox > 20"],devDependencies:{"@types/events":"^3.0.0",autoprefixer:"^9.1.5","babel-core":"^6.26.3","babel-loader":"^7.1.4","babel-plugin-add-module-exports":"^0.2.1","babel-plugin-bulk-import":"^1.0.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-es2015":"^6.24.1",chai:"^4.1.2","core-js":"^2.5.4","css-loader":"^0.28.11","json-loader":"^0.5.7","node-sass":"^4.8.3","postcss-cssnext":"^3.1.0","postcss-loader":"^2.1.5","raw-loader":"^2.0.0","sass-loader":"^6.0.7","style-loader":"^0.20.3",sugarss:"^1.0.1",webpack:"^4.11.0","webpack-cli":"^3.0.2",zlib:"^1.0.5"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={get device(){return r.os.isPc?"pc":"mobile"},get browser(){var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firfox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter(function(n){return t[n].test(e)}))[0]},get os(){var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,r=/(?:Android)/.test(e),a=/(?:Firefox)/.test(e),i=/(?:iPad|PlayBook)/.test(e)||r&&!/(?:Mobile)/.test(e)||a&&/(?:Tablet)/.test(e),o=/(?:iPhone)/.test(e)&&!i;return{isTablet:i,isPhone:o,isAndroid:r,isPc:!(o||r||n||i),isSymbian:n,isWindowsPhone:t,isFireFox:a}}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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},a=Object.assign||function(e){for(var t=1;t-1){var o=r.split(".");i=o[0],r=o[1]}"os_version"===r&&(a=""+a),i?"user"===i||"header"===i?t.envInfo[i][r]=a:"headers"===i?t.envInfo.header.headers[r]=a:t.envInfo.header.headers.custom[r]=a:t.envInfo.user.hasOwnProperty(r)?["user_type","device_id","ip_addr_id"].indexOf(r)>-1?t.envInfo.user[r]=Number(a):["user_id","web_id","user_unique_id","ssid"].indexOf(r)>-1?t.envInfo.user[r]=String(a):["user_is_auth","user_is_login"].indexOf(r)>-1&&(t.envInfo.user[r]=Boolean(a)):t.envInfo.header.hasOwnProperty(r)?t.envInfo.header[r]=a:t.envInfo.header.headers.hasOwnProperty(r)?t.envInfo.header.headers[r]=a:t.envInfo.header.headers.custom[r]=a},this.get=function(){var e={user:{},header:{headers:{custom:{}}}},n=t.envInfo,r=n.user,o=Object.keys(r),l=Array.isArray(o),s=0;for(o=l?o:o[Symbol.iterator]();;){var u;if(l){if(s>=o.length)break;u=o[s++]}else{if((s=o.next()).done)break;u=s.value}var c=u;r[c]!==i&&(e.user[c]=r[c])}var d=n.header,p=Object.keys(d),f=Array.isArray(p),g=0;for(p=f?p:p[Symbol.iterator]();;){var h;if(f){if(g>=p.length)break;h=p[g++]}else{if((g=p.next()).done)break;h=g.value}var y=h;d[y]!==i&&"headers"!==y&&(e.header[y]=d[y])}var x=n.header.headers,m=Object.keys(x),v=Array.isArray(m),b=0;for(m=v?m:m[Symbol.iterator]();;){var k;if(v){if(b>=m.length)break;k=m[b++]}else{if((b=m.next()).done)break;k=b.value}var w=k;"custom"!==w&&x[w]!==i&&(e.header.headers[w]=x[w])}var _=n.header.headers.custom,C=Object.keys(_);if(C.length){var E=C,S=Array.isArray(E),T=0;for(E=S?E:E[Symbol.iterator]();;){var P;if(S){if(T>=E.length)break;P=E[T++]}else{if((T=E.next()).done)break;P=T.value}var O=P;e.header.headers.custom[O]=_[O]}}return{user:e.user,header:a({},e.header,{headers:e.header.headers})}},this.envInfo={user:{user_unique_id:i,user_type:i,user_id:i,user_is_auth:i,user_is_login:i,device_id:i,web_id:i,ip_addr_id:i,ssid:i},header:{app_id:i,app_name:i,app_install_id:i,app_package:i,app_channel:i,app_version:i,os_name:i,os_version:i,device_model:i,ab_client:i,ab_version:i,traffic_type:i,utm_source:i,utm_medium:i,utm_campaign:i,client_ip:i,device_brand:i,os_api:i,access:i,language:i,region:i,app_language:i,app_region:i,creative_id:i,ad_id:i,campaign_id:i,log_type:i,rnd:i,platform:i,sdk_version:i,province:i,city:i,timezone:i,tz_offset:i,tz_name:i,sim_region:i,carrier:i,resolution:i,browser:i,browser_version:i,referrer:i,referrer_host:i,headers:{utm_term:i,utm_content:i,custom:{}}}}},l=function(e){var t=document.createElement("a");return t.href=e,t},s=window.screen&&window.screen.width||0,u=window.screen&&window.screen.height||0,c=s+" x "+u,d=navigator.appVersion,p=navigator.userAgent,f=navigator.language,g=document.referrer,h=l(g).hostname,y=function(e){var t=l(e).search;t=t.slice(1);var n={};return t.split("&").forEach(function(e){var t=e.split("="),r=t[0],a=t[1];n[r]=decodeURIComponent(void 0===a?"":a)}),n}(location.href),x="",m="",v="",b=""+parseFloat(d),k=void 0,w=void 0;-1!==(k=p.indexOf("Opera"))&&(v="Opera",b=p.substring(k+6),-1!==(k=p.indexOf("Version"))&&(b=p.substring(k+8))),-1!==(k=p.indexOf("Edge"))?(v="Microsoft Edge",b=p.substring(k+5)):-1!==(k=p.indexOf("MSIE"))?(v="Microsoft Internet Explorer",b=p.substring(k+5)):-1!==(k=p.indexOf("Chrome"))?(v="Chrome",b=p.substring(k+7)):-1!==(k=p.indexOf("Safari"))?(v="Safari",b=p.substring(k+7),-1!==(k=p.indexOf("Version"))&&(b=p.substring(k+8))):-1!==(k=p.indexOf("Firefox"))&&(v="Firefox",b=p.substring(k+8)),-1!==(w=b.indexOf(";"))&&(b=b.substring(0,w)),-1!==(w=b.indexOf(" "))&&(b=b.substring(0,w)),-1!==(w=b.indexOf(")"))&&(b=b.substring(0,w));for(var _,C,E=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(d)?"wap":"web",S=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],T=0;T0&&void 0!==arguments[0]?arguments[0]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init=function(e){t.isLog=e},this.info=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a1?n-1:0),a=1;a1?n-1:0),a=1;a1?n-1:0),a=1;a>e/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,$)}var Q=function(){return $().replace(/-/g,"").slice(0,19)},G=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};if(n.blackUuid.some(function(t){return t===e.user_unique_id})){var t={};return n.setUserTokens(t),n.logger.warn('检测到无效的用户标识,已重置用户状态。{user_unique_id: "%s"}',e.user_unique_id),t}return e},n.getUserTokens=function(){return L.get(n.tokensCacheKey)||{}},n.setUserTokens=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return L.set(n.tokensCacheKey,e)},n.checkUserToken=function(e){var t=M+"tokens_"+e;n.tokensCacheKey=t,n.transferFromCookie();var r=n.purifyBlackUuid(n.getUserTokens());r.user_unique_id&&r.web_id?(n.envInfo.user.user_unique_id=r.user_unique_id,n.envInfo.user.web_id=r.web_id,n.envInfo.user.ssid=r.ssid||"",n.logger.info("初始化已经检测到了 webid user_unique_id,一般情况下不需要再次验证 id 了"),n.unlock()):n.requestWebId(e)},n.saveTokenToStorage=function(e){var t=e.web_id,r=e.ssid,a=e.user_unique_id;n.setUserTokens({web_id:t,ssid:r,user_unique_id:a})},n.requestWebId=function(){n.isRequestWebId=!0;var e=function(e){var t=n.envInfo.user.web_id||e.web_id,r=e.ssid;n.isRequestWebId=!1,n.envInfo.user.ssid=r,n.envInfo.user.web_id=t,n.envInfo.user.user_unique_id=t,n.saveTokenToStorage({web_id:t,ssid:r,user_unique_id:t}),n.waitForVerifyTokens?(n.lock(),n.verifyTokens(n.realUuid)):(n.unlock(),n.callback&&n.callback())};n.isWebidDisabled?e({web_id:Q(),ssid:""}):function(){var t=n.userTokensPrefix+"/v1/user/webid";U(t,{app_id:n.app_id,url:location.href,user_agent:D.userAgent,referer:D.referrer,user_unique_id:""},function(t){0!==t.e?n.logger.error("请求 webid 失败。请联系管理员。"):e(t)},function(){n.isRequestWebId=!1,n.logger.error("获取 webid 失败,数据将不会被上报")})}()},n.verifyTokens=function(e){var t=n.tokensCacheKey;if(n.waitForVerifyTokens=!1,n.realUuid=""+e,n.isRequestWebId)return n.waitForVerifyTokens=!0,n.logger.info("正在请求 webid,requestSsid 将会在前者请求完毕之后被调用"),!1;var r=n.getUserTokens();if(r.user_unique_id===n.realUuid&&r.ssid&&r.web_id)n.logger.info("传入的 user_id/user_unique_id 与 缓存中的完全一致,无需再次请求"),n.unlock();else{n.lock(),n.envInfo.user.user_unique_id=n.realUuid;var a=G({},n.getUserTokens(),{user_unique_id:n.realUuid});if(L.set(t,JSON.stringify(a)),X.isLowIE())return n.unlock(),!1;n.isSsidDisabled?(n.unlock(),n.callback&&n.callback()):n.requestSsid()}},n.requestSsid=function(){var e=n.getUserTokens(),t=n.userTokensPrefix+"/v1/user/ssid";U(t,{app_id:n.app_id,web_id:e.web_id,user_unique_id:""+e.user_unique_id},function(t){if(n.unlock(),0!==t.e)n.logger.error("请求 ssid 失败~");else{n.envInfo.user.ssid=t.ssid;var r=G({},e,{ssid:t.ssid});n.setUserTokens(r),n.logger.info("根据 user_unique_id 更新 ssid 成功!注意:在这之前不应该有数据被发出去"),n.callback&&n.callback()}},function(){n.unlock(),n.logger.error("根据 user_unique_id 获取新 ssid 失败")})},n.setEvtParams=function(e){var t=G({},e);Object.keys(t).forEach(function(e){n.evtParams[e]=t[e]})},n.mergeEnvToEvents=function(e){var t=n.mergeEnv(),r=[],a=0,i=void 0;return e.forEach(function(e){var t=!!e.params.__disable_storage__;void 0===i?i=t:(t!==i||r[a].length>=5)&&(a+=1,i=!i),r[a]=r[a]||[],r[a].push(e)}),r.map(function(e){return{events:e.map(function(e){var t=G({},n.evtParams,e.params);return delete t.__disable_storage__,G({},e,{params:JSON.stringify(t)})}),user:t.user,header:t.header,verbose:n.debugMode?1:void 0,__disable_storage__:e[0].params.__disable_storage__}})},n.mergeEnv=function(){var e=n.get(),t=K.get(),r=G({},e.user),a=G({},t.header.headers.custom,e.header.headers.custom),i=G({},t.header.headers,e.header.headers,{custom:a}),o=G({},t.header,e.header);return{user:r,header:G({},o,{headers:JSON.stringify(i)})}},n.evtParams={},n.reportUrl="",n.userTokensPrefix="",n.isSsidDisabled=!1,n.isWebidDisabled=!1,n.isSdkMonitorDisabled=!1,n.debugMode=!1,n.blackUuid=["null","undefined","0","","None"],n.logger=function(){},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":r(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),t.prototype.lock=function(){this.isUserTokensReady=!1},t.prototype.unlock=function(){this.isUserTokensReady=!0},t.prototype.enableDebugMode=function(e){this.debugMode=e},t}(o);var ne=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set=function(e,n){t.cache[e]=n},this.get=function(e){return t.cache[e]},this.clean=function(e){t.cache[e]=void 0},this.cache={}},re=new ne;var ae=function(){function e(t){var n=t.disable_storage,r=void 0!==n&&n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._isPersistent=!r,this._storage=this._isPersistent?L:new ne,this._storageKey="",this._data=void 0}return e.prototype.setStorageKey=function(e){this._storageKey=e},e.prototype.getAllEvents=function(){var e=this.getData();Object.keys(e).reduce(function(t,n){return t.concat(e[n]||[])},[])},e.prototype.getData=function(){return this._checkIsDataInit(),this._data},e.prototype.add=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._checkIsDataInit(),0!==t.length&&(this._data[e]=t,this._save())},e.prototype.delete=function(e){this._checkIsDataInit(),this._data[e]&&(delete this._data[e],this._save())},e.prototype._checkIsDataInit=function(){if(void 0===this._data)try{var e,t=this._getDataFromStorage();if(X.isArray(t))this._data=((e={})[Q()]=t,e),this._save();else this._data=t}catch(e){this._data={}}},e.prototype._checkStorageKey=function(){if(!this._storageKey)throw new Error("must call setStorageKey('xxx') first")},e.prototype._getDataFromStorage=function(){return this._checkStorageKey(),this._storage.get(this._storageKey)||{}},e.prototype._save=function(){this._checkStorageKey(),this._storage.set(this._storageKey,this._data)},e}(),ie=function(e,t){try{var n=e.split("v1")[0];t.forEach(function(e){var t=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+="&"+n+"="+encodeURIComponent(JSON.stringify(e[n])));return t="&"===t[0]?t.slice(1):t}(e),r=new Image(1,1);r.onload=function(){r=null},r.onerror=function(){r=null},r.src=n+"/v1/gif?"+t})}catch(e){}},oe=function(e,t){if(window.XDomainRequest)return ie(e,t);var n=new XMLHttpRequest;n.open("POST",e+"?rdn="+Math.random(),!0),n.onload=function(){},n.onerror=function(){n.abort()},n.send(JSON.stringify(t))},le=function e(t,n,r,a){try{var i=t.split("v1")[0];if(!i)return void a(t,n,z);n.forEach(function(e){var o=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+="&"+n+"="+encodeURIComponent(JSON.stringify(e[n])));return t="&"===t[0]?t.slice(1):t}(e),l=new Image(1,1);l.onload=function(){l=null,r()},l.onerror=function(){l=null,a(t,n,R)},l.src=i+"/v1/gif?"+o})}catch(e){a(t,n,A,e.message)}};var se=function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.send=function(e){var t=e.url,r=e.data,a=e.success,i=e.fail,o=e.eventError;if(function(e){var t=e.url,n=e.data,r=e.success,a=e.fail,i=e.notSure,o=e.isUnload,l=n;if(window.XDomainRequest)le(t,l,r,a);else{if(o)return window.navigator&&window.navigator.sendBeacon?(i(),void(window.navigator.sendBeacon(t,JSON.stringify(l))?r():a(t,n,B))):void le(t,l,r,a);var s=new XMLHttpRequest;s.open("POST",t+"?rdn="+Math.random(),!0),s.onload=function(){r(t,l,s.responseText)},s.onerror=function(){s.abort(),a(t,l,j)},s.send(JSON.stringify(l))}}({url:t,data:r,success:function(e,t,r){a();try{var i=JSON.parse(r).e;if(0!==i){var l="未知错误";-2===i&&(l="事件格式错误!请检查字段类型是否正确。"),n.logger.error("数据上报失败!","错误码:"+i+"。错误信息:"+l),o(t,i),ce(e,t,i)}}catch(n){ce(e,t,I)}},fail:function(e,t,r){n.logger.error("数据上报失败!","错误码:"+r),i(t,r),ce(e,t,r)},notSure:e.notSure,isUnload:e.isUnload}),!n.isSdkMonitorDisabled&&!n.isSdkOnLoadEventReady){n.isSdkOnLoadEventReady=!0;try{var l=r[0].header,s=r[0].user;ue(t,{app_id:l.app_id,app_name:l.app_name,sdk_version:l.sdk_version,web_id:s.web_id})}catch(e){}}},this.logger=t.logger||N,this.isSdkOnLoadEventReady=!1,this.isSdkMonitorDisabled=!1},ue=function(e,t){try{var n={events:[{event:"onload",params:JSON.stringify({app_id:t.app_id,app_name:t.app_name||"",sdk_version:t.sdk_version}),local_time_ms:Date.now()}],user:{user_unique_id:t.web_id},header:{app_id:1338}};setTimeout(function(){oe(e,[n])},16)}catch(e){}},ce=function(e,t,n){try{var r=t[0].user,a=t[0].header,i=[];t.forEach(function(e){e.events.forEach(function(e){i.push(e)})});var o={events:i.map(function(e){return{event:"on_error",params:JSON.stringify({error_code:n,app_id:a.app_id,app_name:a.app_name||"",error_event:e.event,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(a),user:JSON.stringify(r)}),local_time_ms:Date.now()}}),user:{user_unique_id:r.user_unique_id},header:{app_id:1338}};setTimeout(function(){oe(e,[o])},16)}catch(e){}};var de=function(e){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":r(t))&&"function"!=typeof t?e:t}(this,e.call(this));a.addListener=function(){window.addEventListener("unload",function(){a.report(!0)},!1),window.addEventListener("beforeunload",function(){a.report(!0)},!1),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&a.report(!0)},!1)},a.setReady=function(e){a.isReady=e,a.eventSender.isSdkMonitorDisabled=a.isSdkMonitorDisabled,a.checkAndSendCachedStorageEvents(),a.report()},a.eventReportTimer=null,a.event=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=re.get(a.evtDataCacheKey)||[],r=t?[].concat(e,n):[].concat(n,e);re.set(a.evtDataCacheKey,r),r.length>=5?a.report():(a.eventReportTimer&&clearTimeout(a.eventReportTimer),a.eventReportTimer=setTimeout(function(){a.report(),a.eventReportTimer=null},a.waitForBatchTime))},a.report=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!a.isUserTokensReady)return!1;if(!a.isReady)return!1;var t=re.get(a.evtDataCacheKey)||[];re.clean(a.evtDataCacheKey);var n=a.mergeEnvToEvents(t);a.sendData(n,e)},a.sendData=function(e,t){var n=[],r=0,i=void 0;e.forEach(function(e){var t=!!e.__disable_storage__;void 0===i?i=t:(t!==i||n[r].length>=5)&&(r+=1,i=!i),n[r]=n[r]||[],n[r].push(e)}),n.forEach(function(e){var n=Q();e[0].__disable_storage__||a.eventStorage.add(n,e),a._sendData(n,e,t)})},a.checkAndSendCachedStorageEvents=function(){var e=a.eventStorage.getData(),t=Object.keys(e);t.length>0&&t.forEach(function(t){a._sendData(t,e[t])})},a._sendData=function(e,t,n){a.isReporting=!0;var r=function(){a.isReporting=!1};a.eventSender.send({url:a.reportUrl,data:t,success:function(){r(),a.sendDataSuccess(e)},fail:function(e,t){r(),a.reportErrorCallback(e,t),setTimeout(function(){a.report()},3e3)},eventError:function(e,t){a.reportErrorCallback(e,t)},notSure:r,isUnload:n})},a.sendDataSuccess=function(e){a.eventStorage.delete(e),a.report()};var i=n.log,o=n.disable_storage,l=n.max_batch_num,s=void 0===l?5:l,u=n.batch_time,c=void 0===u?30:u;return a.init(n),a.maxBatchNum=s,a.waitForBatchTime=c,a.isReady=!1,a.addListener(),a.enableDebugMode(!!i),a.eventStorage=new ae({disable_storage:o}),a.eventStorage.setStorageKey(a.evtDataCacheKey),a.eventSender=new se({logger:a.logger}),a.reportErrorCallback=function(){},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":r(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),t}(te),pe=Object.assign||function(e){for(var t=1;t=r.length)break;o=r[i++]}else{if((i=r.next()).done)break;o=i.value}var l=o,s=e[l];switch(l){case"evtParams":n.channel.setEvtParams(s);break;case"disable_ssid":n.logger.deprecated("(disable_ssid)请通过init函数来设置。"),s&&(n.logger.info("ssid已禁用,设置user_unique_id不会请求ssid接口。"),n.channel.isSsidDisabled=s);break;case"disable_auto_pv":s&&(n.logger.info("已禁止默认上报predefine_pageview事件,需手动上报。"),n._autoSendPV=!1);break;case"_staging_flag":""+s=="1"&&n.logger.info("根据_staging_flag设置,数据将会上报到stag 表。"),n.channel.setEvtParams({_staging_flag:Number(s)});break;case"reportErrorCallback":"function"==typeof s&&(n.channel.reportErrorCallback=s);break;default:n.channel.setEnv(l,s)}}},this.send=function(){n.start()},this.start=function(){if(n.channel.isUserTokensReady){if(n._isSendFuncCalled)return;n._isSendFuncCalled=!0,n.logger.info("看到本提示,意味着用户信息已完全就绪,上报通道打开。用户标识如下:"),n.logger.logJSON(n.channel.get().user),n._autoSendPV&&n.predefinePageView(),n.channel.setReady(!0)}else n.callbackSend=!0},this.predefinePageView=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={title:document.title||location.pathname,url:location.href,url_path:location.pathname},r=pe({},t,e);n.event("predefine_pageview",r,!0)},this.event=function(){for(var e=arguments.length,t=Array(e),r=0;r-1?(a=n.colloctor)[o].apply(a,t.slice(1)):(i=n.colloctor).event.apply(i,t)},this.name=t||"Collector"+ +new Date,this.cmdQueue=[],this.colloctor=new ge(this.name),this._isQueueProcessed=!1,this._processCmdQueue(),this._exportCollect.init=this._exportCollect.bind(this,"init"),this._exportCollect.config=this._exportCollect.bind(this,"config"),this._exportCollect.send=this._exportCollect.bind(this,"send"),this._exportCollect.start=this._exportCollect.bind(this,"start"),this._exportCollect.predefinePageView=this._exportCollect.bind(this,"predefinePageView"),this._exportCollect},e.exports=t.default},function(e,t,n){e.exports=n(9)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=S(n(0)),a=S(n(38)),i=S(n(39)),o=S(n(40)),l=S(n(41)),s=S(n(42)),u=S(n(43)),c=S(n(44)),d=S(n(45)),p=S(n(46)),f=S(n(47)),g=S(n(48)),h=S(n(49)),y=S(n(50)),x=S(n(51)),m=S(n(52)),v=S(n(53)),b=S(n(54)),k=S(n(55)),w=S(n(56)),_=S(n(57)),C=S(n(58)),E=S(n(7));S(n(59));function S(e){return e&&e.__esModule?e:{default:e}}var T={};function P(e,t,n){var r=e;t.map(function(e,a){r[e]=a==t.length-1?n:r[e]||{},r=r[e]})}P(T,["controls","collect"],E.default),P(T,["controls","cssFullscreen"],C.default),P(T,["controls","danmu"],_.default),P(T,["controls","definition"],w.default),P(T,["controls","download"],k.default),P(T,["controls","errorRetry"],b.default),P(T,["controls","fullscreen"],v.default),P(T,["controls","i18n"],m.default),P(T,["controls","localPreview"],x.default),P(T,["controls","logger"],y.default),P(T,["controls","memoryPlay"],h.default),P(T,["controls","mobile"],g.default),P(T,["controls","pc"],f.default),P(T,["controls","pip"],p.default),P(T,["controls","play"],d.default),P(T,["controls","playNext"],c.default),P(T,["controls","reload"],u.default),P(T,["controls","replay"],s.default),P(T,["controls","rotate"],l.default),P(T,["controls","screenShot"],o.default),P(T,["controls","start"],i.default),P(T,["controls","volume"],a.default),t.default=r.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&!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 n+='",!0}),this.videoConfig.crossorigin="anonymous"),t.textTrackStyle){var r=document.createElement("style");this.textTrackStyle=r,document.head.appendChild(r);var o="";for(var l in t.textTrackStyle)o+=l+": "+t.textTrackStyle[l]+";";var s=t.id?"#"+t.id:t.el.id?"#"+t.el.id:"."+t.el.className;r.sheet.insertRule?r.sheet.insertRule(s+" video::cue { "+o+" }",0):r.sheet.addRule&&r.sheet.addRule(s+" video::cue",o)}(this.video=i.default.createDom(this.videoConfig.mediaType,n,this.videoConfig,""),!this.textTrackShowDefault&&n)&&(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={},n=e,r="on"+e.charAt(0).toUpperCase()+e.slice(1),n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t;var t,n,r}),(0,a.default)(this),this._interval={};var u="0,0",c=this;this.ev.forEach(function(e){c.evItem=Object.keys(e)[0];var t=Object.keys(e)[0];c.video.addEventListener(Object.keys(e)[0],function(){c.logParams&&("play"===t?c.hasStart=!0:"canplay"===t?i.default.removeClass(c.root,"xgplayer-is-enter"):"waiting"===t?(c.logParams.bc++,c.inWaitingStart=(new Date).getTime()):"playing"===t?(i.default.removeClass(c.root,"xgplayer-is-enter"),c.inWaitingStart&&(c.logParams.bu_acu_t+=(new Date).getTime()-c.inWaitingStart,c.inWaitingStart=void 0)):"loadeddata"===t?c.logParams.played.push({begin:0,end:-1}):"seeking"===t?c.logParams.played.push({begin:c.video.currentTime,end:-1}):c&&c.logParams&&c.logParams.played&&"timeupdate"===t&&(c.logParams.played.length<1&&c.logParams.played.push({begin:c.video.currentTime,end:-1}),c.logParams.played[c.logParams.played.length-1].end=c.video.currentTime),"error"===t?c._onError(t):c.emit(t,c),c.hasOwnProperty("_interval")&&(["ended","error","timeupdate"].indexOf(t)<0?(clearInterval(c._interval.bufferedChange),i.default.setInterval(c,"bufferedChange",function(){if(c.video&&c.video.buffered){for(var e=[],t=0,n=c.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=i.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 i.default.hasClass(this.root,"xgplayer-is-fullscreen")||i.default.hasClass(this.root,"xgplayer-fullscreen-active")}},{key:"bullet",get:function(){return!!i.default.findDom(this.root,"xg-danmu")&&i.default.hasClass(i.default.findDom(this.root,"xg-danmu"),"xgplayer-has-danmu")}},{key:"textTrack",get:function(){return i.default.hasClass(this.root,"xgplayer-is-textTrack")}},{key:"pip",get:function(){return i.default.hasClass(this.root,"xgplayer-pip-active")}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";var r,a,i,o,l,s,u,c="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},d=n(12),p=n(29),f=Function.prototype.apply,g=Function.prototype.call,h=Object.create,y=Object.defineProperty,x=Object.defineProperties,m=Object.prototype.hasOwnProperty,v={configurable:!0,enumerable:!1,writable:!0};a=function(e,t){var n,a;return p(t),a=this,r.call(this,e,n=function(){i.call(a,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},l={on:r=function(e,t){var n;return p(t),m.call(this,"__ee__")?n=this.__ee__:(n=v.value=h(null),y(this,"__ee__",v),v.value=null),n[e]?"object"===c(n[e])?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:a,off:i=function(e,t){var n,r,a,i;if(p(t),!m.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"===(void 0===(r=n[e])?"undefined":c(r)))for(i=0;a=r[i];++i)a!==t&&a.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:o=function(e){var t,n,r,a,i;if(m.call(this,"__ee__")&&(a=this.__ee__[e]))if("object"===(void 0===a?"undefined":c(a))){for(n=arguments.length,i=new Array(n-1),t=1;t-1}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return r(e,[{key:"openDB",value:function(e){var t=this,n=this,r=this.myDB.version||1,a=n.indexedDB.open(n.myDB.name,r);a.onerror=function(e){},a.onsuccess=function(r){t.myDB.db=r.target.result,e.call(n)},a.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction;t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.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 n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=void 0,a=0;a