text: window.FlvPlayer=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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=9)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=o(n(20)),a=o(n(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.buffer=t||new Uint8Array(0)}return i(e,[{key:"write",value:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];n.forEach(function(t){t?e.buffer=(0,r.default)(Uint8Array,e.buffer,t):a.default.error(t)})}}],[{key:"writeUint32",value:function(e){return new Uint8Array([e>>24,e>>16&255,e>>8&255,255&e])}},{key:"readAsInt",value:function(e){var t="";return e.forEach(function(e){t+=e.toString(16).padStart(2,"0")}),parseInt(t,16)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=o(n(12)),a=o(n(13));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return e.fetch?a.default:r.default}(window),u=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.range=n,this.id=n.join("-"),this.on=!1,this.loader=new s(t,n,i),this.isCanceled=!1,e.queue.push(this),e.update()}return i(e,[{key:"cancel",value:function(){this.isCanceled=!0,this.loader.cancel()}},{key:"run",value:function(){1===this.loader.readyState?(this.on=!0,this.loader.run()):e.remove()}},{key:"promise",get:function(){return this.loader.promise}},{key:"timeStamp",get:function(){return this.loader.timeStamp}}],[{key:"remove",value:function(t){e.queue.filter(function(n,i){return n.url===t.url&&n.id===t.id&&(e.queue.splice(i,1),!0)}),e.update()}},{key:"update",value:function(){var t=e.queue,n=t.filter(function(e){return e.on}),i=t.filter(function(e){return!e.on}),r=e.limit-n.length;i.forEach(function(e,t){t<r&&e.run()})}},{key:"clear",value:function(){e.queue.forEach(function(e){e.loader.complete||e.cancel()}),e.queue.length=0}}]),e}();u.queue=[],u.limit=2,window.VodTask=u,t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"log",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];window.console.log.apply(window,t)}},{key:"info",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];window.console.info.apply(window,t)}},{key:"error",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];window.console.error.apply(window,t)}},{key:"warn",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];window.console.warn.apply(window,t)}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=o(n(2)),a=o(n(5));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}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),i(t,[{key:"dispatch",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this._observer).emit.apply(t,["demuxer_"+e].concat(i))}},{key:"error",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Demuxer":t;r.default.error("["+n+" error] ",e)}},{key:"info",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Demuxer":t;r.default.info("["+n+" info] ",e)}},{key:"log",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Demuxer":t;r.default.log("["+n+" log] ",e)}},{key:"warn",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Demuxer":t;r.default.warn("["+n+" warn] ",e)}}]),t}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=(i=new ArrayBuffer(2),new DataView(i).setInt16(0,256,!0),256===new Int16Array(i)[0]),a={get device(){var e=a.os;return e.isPc?"pc":e.isTablet?"tablet":"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,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),a=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),o=/(?:iPhone)/.test(e)&&!a;return{isTablet:a,isPhone:o,isAndroid:i,isPc:!o&&!i&&!n,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get isLe(){return r}};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=o(n(25)),a=o(n(26));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this._store=t),this._observer=r.default,this.on=r.default.on.bind(r.default),this.emit=r.default.emit.bind(r.default),this.off=r.default.off.bind(r.default),this.flush=r.default.flush.bind(r.default),this.once=r.default.once.bind(r.default)}return i(e,[{key:"emitError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{line:"",handle:"",msg:"",version:""},n=this._store,i=n.player,r=n.state;if(i){var o=new a.default(e,i.currentTime,r.duration,"",!0,i.config.url,i.config.url,i.ended,t);i.emit("error",o)}}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MetaTypes={NUMBER:0,BOOLEAN:1,STRING:2,OBJECT:3,MIX_ARRAY:8,OBJECT_END:9,STRICT_ARRAY:10,DATE:11,LONE_STRING:12},t.EventTypes={DATA_READY:"data_ready",META_DATA_READY:"meta_data_ready",TRACK_META_READY:"track_meta_ready",MEDIA_INFO_READY:"media_info_ready",META_END_POSITION:"meta_end_position",ERROR:"error"},t.soundRateTypes=[5500,11e3,22e3,44e3],t.AudioObjectTypes={0:"Null",1:"AAC Main",2:"AAC LC",3:"AAC SSR(Scalable Sample Rate)",4:"AAC LTP(Long Term Prediction)",5:"HE-AAC / SBR(Spectral Band Replication)",6:"AAC Scalable"},t.samplingFrequencyTypes=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3],t.browserTypes={IE:"ie",FIRE_FOX:"firefox",CHROME:"chrome",OPERA:"opera",SAFARI:"safari"},t.mp3Versions={V25:0,RESERVED:1,V20:2,V10:3},t.audioSampleRate={V10:[44100,48e3,32e3,0],V20:[22050,24e3,16e3,0],V25:[11025,12e3,8e3,0]},t.mp3BitRate={Layer1:[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],Layer2:[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],Layer3:[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1]}},function(e,t,n){"use strict";var i=n(50)();e.exports=function(e){return e!==i&&null!==e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._dv=new DataView(t),this._context=n,this.initProxy()}return i(e,[{key:"initProxy",value:function(){var t=this,n=[8,16,32],i=this,r=this._context._store;n.forEach(function(e){t["getUint"+e]=function(t){return t||(t=i._context.readOffset),t===i._context.readOffset&&(i._context.readOffset+=e/8),i._dv["getUint"+e](t,!r.isLe)}}),this.getUint24=function(e){var t=this.getUint(24,e,!1);return i._context.readOffset-=1,t},this.getUint=function(t,a){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t>32)throw"not supported read size";var s=32;if(this["getUint"+t])return i["getUint"+s](a,!r.isLe);for(var u=0,f=n.length;u<f;u++)if(t<n[u]){s=n[u];break}var l=o?e.getAndNum(0,t-1,s):e.getAndNum(s-t,s-1,s);return i["getUint"+s](a,!r.isLe)&l}}}],[{key:"getAndNum",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=0,r=--n;r>0;)r>t||r<e?r--:(i+=Math.pow(2,n-r),r--);return i}}]),e}();t.default=r},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n(11)),a=s(n(1)),o=s(n(14));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._options=e,n.__flv__=null,n.init(e),Object.defineProperty(n,"src",{set:function(e){"string"==typeof e&&e.startsWith("blob:")||(n._options.url=e,n.__flv__.destroy(),n.__flv__=new o.default(n._options,n),n.__flv__.load(),n.video.src=n.__flv__.mse.url,n.currentTime=0,setTimeout(function(){n.play()},0))},get:function(){return n._options.url},configurable:!0}),e.autoplay&&n.start(),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,r.default),i(t,[{key:"init",value:function(e){var t=this,n=e.isLive;t.__flv__=new o.default(e,t),t.once("complete",function(){t.createInstance(t.__flv__)}),t.on("pause",function(){!n&&a.default.clear()}),this.once("destroy",function(){a.default.clear(),t.__flv__.destroy(),t.__flv__.mse=null,t.video.src="",t.__flv__=null})}},{key:"createInstance",value:function(e){if(this._options.isLive){r.default.util.addClass(this.root,"xgplayer-is-live");var t=r.default.util.createDom("xg-live","正在直播",{},"xgplayer-live");this.controls.appendChild(t)}e.load()}},{key:"start",value:function(){if(this.inited){var e=this.__flv__;return function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(i):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"start",this).call(this,e.mse.url),this.src=e.mse.url,!0}}},{key:"inited",get:function(){return void 0!==this.__flv__}}]),t}();e.exports=u},function(e,t){e.exports=window.Player},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(1),o=(i=a)&&i.__esModule?i:{default:i};var s=function(){function e(t,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t;var r=new XMLHttpRequest;r.open("get",t),r.responseType="arraybuffer",r.setRequestHeader("Range","bytes="+n[0]+"-"+n[1]),r.onabort=function(){o.default.remove(i)},this._promise=new Promise(function(e,t){r.onload=function(){200!==r.status&&206!==r.status||e(r.response),o.default.remove(this)},r.onerror=function(e){t(e),o.default.remove(i)}}),this._xhr=r}return r(e,[{key:"run",value:function(){this._xhr.send()}},{key:"cancel",value:function(){this._xhr.abort()}},{key:"promise",get:function(){return this._promise}},{key:"readyState",get:function(){return this._xhr.readyState}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(1),o=(i=a)&&i.__esModule?i:{default:i};var s=function(){function e(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.on=!1,this.complete=!1,this.isStopped=!1,this.timeStamp=Date.now();var a={headers:{Range:"bytes="+n[0]+"-"+n[1]},method:"GET",cache:"default",mode:"cors"};this.request=function(){return i.on=!0,window.fetch(t,Object.assign({},a,r)).then(function(e){return e.status>299||e.status<200||!e.ok?(i.complete=!0,o.default.remove(i),Promise.reject(new Error("url "+e.status+" "+e.statusText))):Promise.resolve(e)}).then(function(e){return e.arrayBuffer()}).then(function(e){return i.complete=!0,i.byteLength=e.byteLength,o.default.remove(i),i.isStopped?{}:{buffer:e,timeStamp:i.timeStamp}})}}return r(e,[{key:"run",value:function(){this._promise=this.request()}},{key:"cancel",value:function(){this.isStopped=!0}},{key:"readyState",get:function(){return 1}},{key:"promise",get:function(){return this.on?this._promise:this.request()}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=u(n(15)),a=u(n(41)),o=u(n(1)),s=u(n(58));function u(e){return e&&e.__esModule?e:{default:e}}var f=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._player=n,this._options=Object.assign({},(0,s.default)(),t),this.flvPlayer=new r.default(this._options,n),this.mse=new a.default(n.video),this.isSeeking=!1,this.isDataLoading=!1,this.tempCurrentTime=0,this.tempFlvPlayer=null,this.isChangingSrc=!1,this.initPlayerEvents(n,this._options),this.initFlvPlayerEvents(this.flvPlayer,this.mse),this.initMseEvents(this.mse,this.flvPlayer)}return i(e,[{key:"load",value:function(){this.flvPlayer.startLoadData()}},{key:"initPlayerEvents",value:function(e,t){var n=this,i=this.mse;e.mse=i,this.handleSeeking=function(){if(n.isChangingSrc)n.isChangingSrc=!1;else{var t=e.buffered,i=e.currentTime,r=!1;if(t.length)for(var a=0,s=t.length;a<s;a++)if(i>t.start(a)&&i<t.end(a)){r=!0;break}r||(o.default.clear(),n.isSeekable?(n.flvPlayer.seek(e.currentTime),n.isSeeking=!0):n._player.currentTime=n.tempCurrentTime)}},t.isLive||e.on("seeking",function(){n.handleSeeking()}),this.handleTimeUpdate=function(){n.tempCurrentTime=e.currentTime,n.isSeeking||!n.flvPlayer.isMediaInfoReady||n.tempFlvPlayer||n.progressChecker(e),n._options.isLive||n.isEnded(e,n.flvPlayer)},e.on("timeupdate",function(){n.handleTimeUpdate()}),e._replay=function(){e.mse.destroy(),o.default.clear();new a.default(e.video);return n.flvPlayer.replay(),i.on("sourceopen",function(){n.flvPlayer.isSourceOpen=!0,i.appendBuffer(n.flvPlayer.ftyp_moov.buffer),setTimeout(function(){e.play()},0),i.on("updateend",function(){var t=n.flvPlayer,r=t.pendingFragments,a=t.hasPendingFragments;if(n.isSeeking=!1,a){var o=r.shift();i.appendBuffer(o.data)?e.emit("cacheupdate",e):r.unshift(o)}})}),i.on("error",function(t){e.emit("error",t)}),e.mse=i,e.video.src=n.mse.url,!0},e.switchURL=function(t){if(n._options.url=t,!e.config.isLive){o.default.clear();var a=n.tempFlvPlayer=new r.default(n._options,e);a.isSourceOpen=!0,a.isTempPlayer=!0,n.initFlvPlayerEvents(a,i),a.handleMediaFragment=function(){return n.isSeeking=!1,n.unbindFlvPlayerEvents(n.flvPlayer),n.flvPlayer.destroy(),n.flvPlayer=a,n.tempFlvPlayer=null,i.appendBuffer(a.ftyp_moov),a.handleMediaFragment=function(e){return i.appendBuffer(e.data)},!1},a.startLoadData()}}}},{key:"unbindFlvPlayerEvents",value:function(e){e.handleSeekEnd=function(){return null},e.handleError=function(){return null},e.handleMediaFragment=function(){return null}}},{key:"initFlvPlayerEvents",value:function(e,t){var n=this;e.once("ready",function(i){e.isSourceOpen&&!n.tempFlvPlayer?t.appendBuffer(i.buffer):n.isChangingSrc||n._options.isLive||(n.isSeeking=!0,e.seek(n._player.currentTime))}),e.handleSeekEnd=function(){n.isSeeking=!1},e.handleError=function(e){this._player.emit("error",e)},this.tempFlvPlayer||(e.handleMediaFragment=function(e){return!n.tempFlvPlayer&&t.appendBuffer(e.data)})}},{key:"initMseEvents",value:function(e){var t=this;e.on("error",function(e){t._player.emit("error",e)});e.on("sourceopen",function(){t.flvPlayer.isSourceOpen=!0,null!==t.flvPlayer.ftyp_moov&&e.appendBuffer(t.flvPlayer.ftyp_moov.buffer),e.on("updateend",function(){var n=t.flvPlayer,i=n.pendingFragments;if(n.hasPendingFragments){var r=i.shift();e.appendBuffer(r.data)?t._player.emit("cacheupdate",t._player):i.unshift(r)}})})}},{key:"loadData",value:function(e){return this.flvPlayer.loadSegments(!0,e,this._options.preloadTime)}},{key:"progressChecker",value:function(e){var t=this,n=this._options,i=n.minCachedTime,r=n.preloadTime,a=e.getBufferedRange();this.flvPlayer.videoDuration-a[1]*this.flvPlayer.videoTimeScale<.1*this.flvPlayer.videoTimeScale||a[1]-e.currentTime<i&&!this.isDataLoading&&(this.isDataLoading=!0,this.flvPlayer.loadSegments(!0,e.currentTime,r).then(function(){t.isDataLoading=!1}))}},{key:"clearPlayerCache",value:function(){this._player.getBufferedRange().length}},{key:"isEnded",value:function(e,t){if(t.videoDuration-e.currentTime*t.videoTimeScale<2*t.videoTimeScale){var n=e.getBufferedRange();e.currentTime-n[1]<.1&&this.mse.endOfStream()}}},{key:"destroy",value:function(){o.default.clear(),this._options={},this.mse=null,this.isSeeking=!1,this.isDataLoading=!1,this.tempCurrentTime=0,this.tempFlvPlayer=null,this.isChangingSrc=!1,this.handleTimeUpdate=function(){},this.handleSeeking=function(){},this.flvPlayer.destroy(),this._player.pause()}},{key:"isSeekable",get:function(){return this.flvPlayer.isSeekable}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=d(n(16)),a=d(n(28)),o=d(n(30)),s=d(n(38)),u=d(n(1)),f=d(n(40)),l=d(n(0)),c=d(n(5));function d(e){return e&&e.__esModule?e:{default:e}}var h=function(){},p=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.CLASS_NAME=i.constructor.name,i._config=e,i._player=n,i._tempBaseTime=0,i.firstFlag=!0,i._store=new s.default,i._store.isLive=e.isLive||!1,i._store.player=n,i.flvParser=new a.default(i._store),i.tagDemuxer=new o.default(i._store),i.mp4remuxer=new r.default(i._store),i.buffer=new l.default,i.bufferKeyframes=new Set,i.META_CHUNK_SIZE=Math.pow(10,6),i.CHUNK_SIZE=Math.pow(10,6),i.ftyp_moov=null,i.isSourceOpen=!1,i._isNewSegmentsArrival=!1,i.isSeeking=!1,i.loadTask=null,i.range={start:-1,end:-1},i._pendingFragments=[],i._pendingRemoveRange=[],i.err_cnt=0,i.requestConfig={mode:i._config.cors?"cors":"same-origin"},i.initEventBind(),i}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,c.default),i(t,[{key:"startLoadData",value:function(){this._config.isLive?this.initLiveStream():this.initMeta()}},{key:"initLiveStream",value:function(){this.loadTask=new f.default(this._config.url,this.requestConfig).run(this.loadLiveData.bind(this))}},{key:"loadLiveData",value:function(e){void 0===e&&(this.emit("live-end"),this._player.mse.endOfStream(),this.destroy());try{this.buffer.write(new Uint8Array(e));var t=this.setFlv(this.buffer.buffer);this.buffer.buffer=this.buffer.buffer.slice(t)}catch(e){console.log(e.message)}}},{key:"initMeta",value:function(){var e=this,t=this,n=function(e){var n=e.timeStamp,i=e.buffer;if(n===t.loadTask.timeStamp){t.err_cnt=0,t.buffer.write(new Uint8Array(i));var r=t.setFlv(t.buffer.buffer);t.buffer.buffer=t.buffer.buffer.slice(r),t.isMediaInfoReady||t.initMeta()}};this.range={start:this.range.end+1,end:this.range.end+this.META_CHUNK_SIZE};return function t(){return e.loadMetaData(e.range.start,e.range.end).then(n).catch(function(n){if(console.log(n),e.err_cnt>=3)return e._player.emit("error",n),void e.destroy();e.err_cnt+=1,t()})}()}},{key:"loadSegments",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments[2];this._isNewSegmentsArrival=!1;var r=function(e){var n=e.timeStamp,i=e.buffer;if(t.isTempPlayer&&(t.isTempPlayer=!1),n===t.loadTask.timeStamp){t.err_cnt=0,t.buffer.write(new Uint8Array(i)),t.isSeeking&&(t._pendingFragments=[]);var r=t.setFlv(t.buffer.buffer);t.buffer.buffer=t.buffer.buffer.slice(r),t._isNewSegmentsArrival?t.isSeeking=!1:t.loadSegments(!0)}};if(e){var a=this.range;if(this.getNextRangeEnd(n,i)<=a.end)return Promise.resolve();if(this.range={start:this.range.end+1,end:void 0===n?this.range.end+this.CHUNK_SIZE-1:this.getNextRangeEnd(n,i)-1},this.range.start>=this.range.end||!this.range.end)return this.range=a,Promise.resolve()}return function e(){if(!t.stop)return t._loadSegmentsData(t.range.start,t.range.end).then(r).catch(function(n){if(t.err_cnt>=3)return t._player.emit("error","加载视频失败"),void t.destroy();t.err_cnt+=1,e()})}()}},{key:"getNextRangeEnd",value:function(e,t){var n=this._store,i=n.keyframes,r=i.times,a=i.filePositions,o=n.videoTimeScale;if(!r||!a)return this.range.end+this.CHUNK_SIZE;var s=(e*=o)+t*o;if(s>r[r.length-1])return a[a.length-1];for(var u=0,f=r.length-1,l=void 0;u<=f;){var c=Math.floor((f+u)/2);if(r[c]<=s&&s<=r[c+1]){l=c+1;break}if(u===f){l=c;break}s<r[c]?f=c-1:u=c+1}return l?a[l]:void 0}},{key:"_loadSegmentsData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e+this.CHUNK_SIZE;return this.loadTask=new u.default(this._config.url,[e,t],this.requestConfig),this.loadTask.promise}},{key:"loadMetaData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e+this.META_CHUNK_SIZE;return this.loadTask=new u.default(this._config.url,[e,t],this.requestConfig),this.loadTask.promise}},{key:"setFlvFirst",value:function(e,t){var n=this.flvParser.setFlv(new Uint8Array(e)),i=this._store.state.tags;if(i.length){if(18!==i[0].tagType)throw new Error("flv file without metadata tag");0!==this._tempBaseTime&&this._tempBaseTime===i[0].getTime()&&(this._store.state._timestampBase=0),this.tagDemuxer.resolveTags(i)}return this.firstFlag=!1,n}},{key:"setFlvUsually",value:function(e,t){this.isParsing=!0;var n=this.flvParser.setFlv(new Uint8Array(e)),i=this._store.state.tags;return i.length&&this.tagDemuxer.resolveTags(i),n}},{key:"handleDataReady",value:function(e,t){this.mp4remuxer.remux(e,t)}},{key:"handleMetaDataReady",value:function(e,t){this.mp4remuxer.onMetaDataReady(e,t)}},{key:"handleError",value:function(e){this.error(e)}},{key:"handleNewMediaFragment",value:function(e){var t=this;this._isNewSegmentsArrival=!0,this._pendingFragments.push(e);var n=e.fragment.randomAccessPoints;if(n&&n.length&&n.forEach(function(e){t.bufferKeyframes.add(e.dts)}),this.isSourceOpen&&this._pendingFragments.length){var i=this._pendingFragments.shift();this.handleMediaFragment(i)?(this.handleSeekEnd(),this._player.emit("cacheupdate",this._player)):this._pendingFragments.unshift(i)}}},{key:"handleMediaInfoReady",value:function(e){var t=this.mp4remuxer.onMediaInfoReady(e);this.ftyp_moov||(this.ftyp_moov=t,this.emit("ready",t))}},{key:"initEventBind",value:function(){this.tagDemuxer.handleDataReady=this.handleDataReady.bind(this),this.tagDemuxer.handleMediaInfoReady=this.handleMediaInfoReady.bind(this),this.tagDemuxer.handleMetaDataReady=this.handleMetaDataReady.bind(this),this.tagDemuxer.setEventBind(),this.mp4remuxer.handleMediaFragment=this.handleNewMediaFragment.bind(this)}},{key:"replay",value:function(){this.isSourceOpen=!1,this.range={start:this._store.metaEndPosition,end:this.getNextRangeEnd(0,this._config.preloadTime)-1},this.mp4remuxer.seek(),this.flvParser.seek(),this.clearBuffer(),this.loadSegments(!1)}},{key:"clearBuffer",value:function(){this._pendingFragments=[],this._pendingRemoveRange=[]}},{key:"unbindEvents",value:function(){this.tagDemuxer.handleDataReady=h,this.tagDemuxer.handleMediaInfoReady=h,this.tagDemuxer.handleMetaDataReady=h,this.tagDemuxer.setEventBind(),this.mp4remuxer.handleMediaFragment=h}},{key:"destroy",value:function(){this.mp4remuxer.destroy(),this.flvParser.destroy(),this.tagDemuxer.destroy(),this.mp4remuxer=null,this.flvParser=null,this.tagDemuxer=null,this.loadSegments=function(){return null},this._store=null,this.clearBuffer(),this.stop=!0,this.loadTask&&this.loadTask.cancel()}},{key:"seek",value:function(e){this.loadTask.cancel();var t=this._store,n=t.keyframes,i=void 0===n?{}:n,r=t.videoTimeScale,a=e*r,o=void 0,s=void 0,f=Math.min(i.filePositions.length,i.times.length),c=this._config.preloadTime;function d(e,t){return t===i.times.length?(s=t,!1):!(e<=c&&c<=i.times[t+1])||(s=t,!1)}for(var h=0,p=f-2;h<=p;){var v=Math.floor((h+p)/2),y=i.times[v],m=i.times[v+1]?i.times[v+1]:Number.MAX_SAFE_INTEGER;if(y<=a&&a<=m||h===p){for(;i.times[v]>=a;)v-=1;o=v-1,c=c*r+a,i.times.every(d);break}a<y?p=v-1:h=v+1}this.isSeeking?this._store.clearTags():this.isSeeking=!0,this._pendingFragments=[],this.mp4remuxer.seek(),this.flvParser.seek(),u.default.clear();var g=this.range;i.filePositions[o]<g.end&&(o+=1,s+=1),this.range={start:i.filePositions[o],end:i.filePositions[s]-1||""},this.buffer=new l.default,this.loadSegments(!1)}},{key:"setFlv",get:function(){return this.firstFlag?this.setFlvFirst:this.setFlvUsually}},{key:"isMediaInfoReady",get:function(){return this._store.mediaInfo.isComplete}},{key:"videoDuration",get:function(){return this._store.mediaInfo.duration}},{key:"hasPendingFragments",get:function(){return!!this._pendingFragments.length}},{key:"pendingFragments",get:function(){return this._pendingFragments}},{key:"videoTimeScale",get:function(){return this._store.videoTimeScale}},{key:"hasPendingRemoveRanges",get:function(){return this._pendingRemoveRange.length}},{key:"pendingRemoveRanges",get:function(){return this._pendingRemoveRange}},{key:"isSeekable",get:function(){return this._store.isSeekable}}]),t}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=c(n(17)),a=c(n(18)),o=c(n(19)),s=c(n(4)),u=c(n(0)),f=c(n(22)),l=c(n(24));function c(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n._dtsBase=0,n._isDtsBaseInited=!1,n._videoMeta=null,n._audioMeta=null,n._audioNextDts=null,n._videoNextDts=null,n._videoSegmentList=new r.default("video"),n._audioSegmentList=new r.default("audio");var i=s.default.browser;return n._fillSilenceFrame="ie"===i,n.handleMediaFragment=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 "+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,l.default),i(t,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._videoNextDts=null,this._audioNextDts=null,this._videoSegmentList.clear(),this._audioSegmentList.clear(),this._videoSegmentList=null,this._audioSegmentList=null}},{key:"remux",value:function(e,t){!this._isDtsBaseInited&&this.calcDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}},{key:"seek",value:function(){this._videoNextDts=null,this._audioNextDts=null,this._videoSegmentList.clear(),this._audioSegmentList.clear()}},{key:"onMetaDataReady",value:function(e,t){this["_"+e+"Meta"]=t}},{key:"onMediaInfoReady",value:function(e){var t=new u.default,n=f.default.ftyp(),i=f.default.moov(e);return t.write(n,i),t.buffer}},{key:"calcDtsBase",value:function(e,t){var n=1/0,i=1/0;e.samples&&e.samples.length&&(n=e.samples[0].dts),t.samples&&t.samples.length&&(i=t.samples[0].dts),this._dtsBase=Math.min(n,i),this._isDtsBaseInited=!0}},{key:"_remuxVideo",value:function(e){if(this._videoMeta){var t=e;if(e.samples&&e.samples.length){for(var n,i,r=t.samples,s=void 0,l=-1,c=-1,d=[],h={samples:[]},p=new a.default;r.length;){var v=r.shift(),y=v.isKeyframe,m=v.cps,g=v.dts-this._dtsBase;if(void 0===s)if(this._videoNextDts)s=g-this._videoNextDts>=1e3?0:g-this._videoNextDts;else if(this._videoSegmentList.isEmpty())s=0;else{var _=this._videoSegmentList.getLastSegmentBefore(g);if(_){var b=_.lastDts,w=_.gap;s=g-(b+(g-(b+w)>3?g-(b+w):0))}else s=0}var k=g,S=(g-=s)+m;-1===l&&(l=g,c=S);for(var O=[];v.units.length;){var A={buffer:[],size:0},D=v.units.shift();O.push(D),A.buffer.push(D),A.size+=D.data.byteLength,h.samples.push(A)}var T=0;if(r.length>=1)T=r[0].dts-this._dtsBase-s-g;else T=d.length>=1?d[d.length-1].duration:this._videoMeta.refSampleDuration;if(y){var x=new o.default({dts:g,pts:S,duration:T,originDts:v.dts,position:v.position,isRAP:!0});p.addRAP(x)}d.push({dts:g,cps:m,pts:S,units:O,size:v.length,isKeyframe:y,duration:T,originDts:k})}var P=d[0],E=d[d.length-1];n=E.dts+E.duration,i=E.pts+E.duration,this._videoNextDts=n,p.startDts=l,p.endDts=n,p.startPts=c,p.endPts=i,p.originStartDts=P.originDts,p.originEndDts=E.originDts+E.duration,p.gap=s;var M=new o.default({dts:P.dts,pts:P.pts,duration:P.duration,isKeyframe:P.isKeyframe,originDts:P.originDts}),C=new o.default({dts:E.dts,pts:E.pts,duration:E.duration,isKeyframe:E.isKeyframe,originDts:E.originDts});p.firstSample=M,p.lastSample=C;var L=new u.default;t.samples=d,t.time=l;var R=f.default.moof(t),j=f.default.mdat(h);L.write(R,j),this._store.isLive||this._videoSegmentList.append(p),t.samples=[],t.length=0,this.handleMediaFragment({type:"video",data:L.buffer.buffer,sampleCount:d.length,fragment:p})}}}},{key:"_remuxAudio",value:function(e){if(this._audioMeta){var t,n=e.samples,i=void 0,r=-1,s=void 0,l=[],c={samples:[]};if(n&&n.length){for(var d=!1;n.length;){var h=n.shift(),p=h.unit,v=h.dts-this._dtsBase,y=!1;if(void 0===i)if(this._audioNextDts)i=v-this._audioNextDts>=1e3?0:v-this._audioNextDts;else if(this._audioSegmentList.isEmpty())i=0;else{var m=this._audioSegmentList.getLastSegmentBefore(v);if(m){var g=m.lastDts,_=m.gap;i=v-(g+(v-(g+_)>3?v-(g+_):0))}else y=this._fillSilenceFrame&&!this._videoSegmentList.isEmpty(),i=0}var b=v;if(v-=i,y){var w=this._videoSegmentList.getLastSampleBefore(b);w&&w.startDts<v?(s=v-w.startDts,v=w.startDts):y=!1}if(d||(r=v,d=!0),y){n.unshift(h);var k=this.initSilentAudio(v,s);l.push(k);var S={buffer:[],size:0};S.buffer.push({data:k.unit}),S.size+=k.unit.byteLength,c.samples.push(S)}else{var O=0;if(n.length>=1)O=n[0].dts-this._dtsBase-i-v;else O=l.length>=1?l[l.length-1].duration:this._audioMeta.refSampleDuration;var A={dts:v,pts:v,cts:0,size:p.byteLength,duration:O,originDts:b},D={buffer:[],size:0};D.buffer.push({data:p}),D.size+=p.byteLength,c.samples.push(D),l.push(A)}}var T=l[l.length-1];t=T.dts+T.duration,this._audioNextDts=t;var x=new a.default;x.startDts=r,x.endDts=t,x.startPts=r,x.endPts=t,x.originStartDts=l[0].originDts,x.originEndDts=T.originDts+T.duration,x.gap=i,x.firstSample=new o.default({dts:l[0].dts,pts:l[0].pts,duration:l[0].duration,originDts:l[0].originDts}),x.lastSample=new o.default({dts:T.dts,pts:T.pts,duration:T.duration,originDts:T.originDts}),e.samples=l;var P=new u.default;e.time=r;var E=f.default.moof(e,r),M=f.default.mdat(c);P.write(E,M),this._store.isLive||this._audioSegmentList.append(x),e.samples=[],e.length=0,this.handleMediaFragment({type:"audio",data:P.buffer.buffer,sampleCount:l.length,fragment:x})}}}},{key:"initSilentAudio",value:function(e,n){var i=t.getSilentFrame(this._audioMeta.channelCount);return{dts:e,pts:e,cps:0,duration:n,unit:i,size:i.byteLength,originDts:e}}}],[{key:"getSilentFrame",value:function(e){return 1===e?new Uint8Array([0,200,0,128,35,128]):2===e?new Uint8Array([33,0,73,144,2,25,0,35,128]):3===e?new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]):4===e?new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]):5===e?new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]):6===e?new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]):null}}]),t}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._type=t,this._list=[],this._lastAppendLocation=-1}return i(e,[{key:"isEmpty",value:function(){return 0===this._list.length}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(e){var t=this._list;if(0===t.length)return-2;var n=t.length-1,i=0,r=0,a=n,o=0;if(e<t[0].originDts)return o=-1;for(;r<=a;){if((i=r+Math.floor((a-r)/2))===n||e>t[i].lastSample.originDts&&e<t[i+1].originDts){o=i;break}t[i].originDts<e?r=i+1:a=i-1}return o}},{key:"_searchNearestSegmentAfter",value:function(e){return this._searchNearestSegmentBefore(e)+1}},{key:"append",value:function(e){var t=this._list,n=this._lastAppendLocation,i=0;-1!==n&&n<t.length&&e.originStartDts>=t[n].lastSample.originDts&&(n===t.length-1||n<t.length-1&&e.originStartDts<t[n+1].originStartDts)?i=n+1:t.length>0&&(i=this._searchNearestSegmentBefore(e.originStartDts)+1),this._lastAppendLocation=i,this._list.splice(i,0,e)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!==t?t.lastSample:null}},{key:"getLastRAPBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].randomAccessPoints;0===n.length&&t>0;)t--,n=this._list[t].randomAccessPoints;return n.length>0?n[n.length-1]:null}},{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.startDts=-1,this.endDts=-1,this.startPts=-1,this.endPts=-1,this.originStartDts=-1,this.originEndDts=-1,this.randomAccessPoints=[],this.firstSample=null,this.lastSample=null}return i(e,[{key:"addRAP",value:function(e){e.isRAP=!0,this.randomAccessPoints.push(e)}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var a=function(){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);var r=e.getDefaultInf();if(!t||"[object Object]"!==Object.prototype.toString.call(t))return r;var a=Object.assign({},r,t);Object.entries(a).forEach(function(e){var t=i(e,2),r=t[0],a=t[1];n[r]=a})}return r(e,null,[{key:"getDefaultInf",value:function(){return{dts:null,pts:null,duration:null,position:null,isRAP:!1,originDts:null}}}]),e}();t.default=a},function(e,t,n){"use strict";var i,r=n(21),a=(i=r)&&i.__esModule?i:{default:i};e.exports=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=0,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a=!0,o=!1,s=void 0;try{for(var u,f=i[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){t+=u.value.length}}catch(e){o=!0,s=e}finally{try{!a&&f.return&&f.return()}finally{if(o)throw s}}var l=new e(t),c=0,d=!0,h=!1,p=void 0;try{for(var v,y=i[Symbol.iterator]();!(d=(v=y.next()).done);d=!0){var m=v.value;l.set(m,c),c+=m.length}}catch(e){h=!0,p=e}finally{try{!d&&y.return&&y.return()}finally{if(h)throw p}}return l}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(0),o=(i=a)&&i.__esModule?i:{default:i},s=n(23);var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"size",value:function(e){return o.default.writeUint32(e)}},{key:"initBox",value:function(t,n){for(var i=new o.default,r=arguments.length,a=Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s];return i.write.apply(i,[e.size(t),e.type(n)].concat(a)),i.buffer}},{key:"extension",value:function(e,t){return new Uint8Array([e,t>>16&255,t>>8&255,255&t])}},{key:"ftyp",value:function(){return e.initBox(24,"ftyp",new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))}},{key:"moov",value:function(t){var n=8,i=e.mvhd(t.duration,t.timescale),r=e.videoTrak(t),a=e.audioTrak(t),o=e.mvex(t.duration,t.timescale);return[i,r,a,o].forEach(function(e){n+=e.byteLength}),e.initBox(n,"moov",i,r,a,o)}},{key:"mvhd",value:function(t,n){var i=n||1e3,r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.initBox(8+r.length,"mvhd",new Uint8Array(r))}},{key:"videoTrak",value:function(t){var n=8,i=e.tkhd({id:1,duration:t.duration,timescale:t.timescale,width:t.width,height:t.height,type:"video"}),r=e.mdia({type:"video",timescale:t.timescale,duration:t.duration,sps:t.sps,pps:t.pps,pixelRatio:t.pixelRatio,width:t.width,height:t.height});return[i,r].forEach(function(e){n+=e.byteLength}),e.initBox(n,"trak",i,r)}},{key:"audioTrak",value:function(t){var n=8,i=e.tkhd({id:2,duration:t.duration,timescale:t.timescale,width:0,height:0,type:"audio"}),r=e.mdia({type:"audio",timescale:t.timescale,duration:t.duration,channelCount:t.audioChannelCount,samplerate:t.audioSampleRate,config:t.audioConfig});return[i,r].forEach(function(e){n+=e.byteLength}),e.initBox(n,"trak",i,r)}},{key:"tkhd",value:function(t){var n=t.id,i=t.duration,r=t.width,a=t.height,o=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>>8&255,255&r,0,0,a>>>8&255,255&a,0,0]);return e.initBox(8+o.byteLength,"tkhd",o)}},{key:"edts",value:function(t){var n=new o.default,i=t.duration,r=t.mediaTime;return n.write(e.size(36),e.type("edts")),n.write(e.size(28),e.type("elst")),n.write(new Uint8Array([0,0,0,1,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,1])),n.buffer}},{key:"mdia",value:function(t){var n=8,i=e.mdhd(t.timescale,t.duration),r=e.hdlr(t.type),a=e.minf(t);return[i,r,a].forEach(function(e){n+=e.byteLength}),e.initBox(n,"mdia",i,r,a)}},{key:"mdhd",value:function(t,n){var i=new Uint8Array([0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]);return e.initBox(12+i.byteLength,"mdhd",e.extension(0,0),i)}},{key:"hdlr",value:function(t){var n=[0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0];return"audio"===t&&(n.splice.apply(n,[8,4].concat([115,111,117,110])),n.splice.apply(n,[24,13].concat([83,111,117,110,100,72,97,110,100,108,101,114,0]))),e.initBox(8+n.length,"hdlr",new Uint8Array(n))}},{key:"minf",value:function(t){var n=8,i="video"===t.type?e.vmhd():e.smhd(),r=e.dinf(),a=e.stbl(t);return[i,r,a].forEach(function(e){n+=e.byteLength}),e.initBox(n,"minf",i,r,a)}},{key:"vmhd",value:function(){return e.initBox(20,"vmhd",new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))}},{key:"smhd",value:function(){return e.initBox(16,"smhd",new Uint8Array([0,0,0,0,0,0,0,0]))}},{key:"dinf",value:function(){var t=new o.default;return t.write(e.size(36),e.type("dinf"),e.size(28),e.type("dref"),new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])),t.buffer}},{key:"stbl",value:function(t){var n=8,i=e.stsd(t),r=e.stts(),a=e.stsc(),o=e.stsz(),s=e.stco();return[i,r,a,o,s].forEach(function(e){n+=e.byteLength}),e.initBox(n,"stbl",i,r,a,o,s)}},{key:"stsd",value:function(t){var n=void 0;return n="audio"===t.type?e.mp4a(t):e.avc1(t),e.initBox(16+n.byteLength,"stsd",e.extension(0,0),new Uint8Array([0,0,0,1]),n)}},{key:"mp4a",value:function(t){var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.samplerate>>8&255,255&t.samplerate,0,0]),i=e.esds(t.config);return e.initBox(8+n.byteLength+i.byteLength,"mp4a",n,i)}},{key:"esds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[43,146,8,0],n=t.length,i=new o.default,r=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(t).concat([6,1,2]));return i.write(e.size(8+r.byteLength),e.type("esds"),r),i.buffer}},{key:"avc1",value:function(t){var n=new o.default,i=t.sps,r=t.pps,a=t.width,s=t.height,u=t.pixelRatio[0],f=t.pixelRatio[1],l=new o.default;l.write(new Uint8Array([1,i[1],i[2],i[3],255,225].concat([i.length>>>8&255,255&i.length]))),l.write(i,new Uint8Array([1,r.length>>>8&255,255&r.length]),r);var c=l.buffer,d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,255&a,s>>8&255,255&s,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h=new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]),p=new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,f>>24,f>>16&255,f>>8&255,255&f]);return n.write(e.size(40+d.byteLength+c.byteLength+h.byteLength),e.type("avc1"),d,e.size(8+c.byteLength),e.type("avcC"),c,e.size(20),e.type("btrt"),h,e.size(16),e.type("pasp"),p),n.buffer}},{key:"stts",value:function(){var t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.initBox(16,"stts",t)}},{key:"stsc",value:function(){var t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.initBox(16,"stsc",t)}},{key:"stco",value:function(){var t=new Uint8Array([0,0,0,0,0,0,0,0]);return e.initBox(16,"stco",t)}},{key:"stsz",value:function(){var t=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);return e.initBox(20,"stsz",t)}},{key:"mvex",value:function(t){var n=new o.default,i=o.default.writeUint32(t);return n.write(e.size(88),e.type("mvex"),e.size(16),e.type("mehd"),e.extension(0,0),i,e.trex(1),e.trex(2)),n.buffer}},{key:"trex",value:function(t){var n=new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.initBox(8+n.byteLength,"trex",n)}},{key:"moof",value:function(t){var n=8,i=e.mfhd(),r=e.traf(t);return[i,r].forEach(function(e){n+=e.byteLength}),e.initBox(n,"moof",i,r)}},{key:"mfhd",value:function(){var t=o.default.writeUint32(e.sequence);return e.sequence+=1,e.initBox(16,"mfhd",e.extension(0,0),t)}},{key:"traf",value:function(t){var n=8,i=e.tfhd(t.id),r=e.tfdt(t.time),a=e.sdtp(t),o=e.trun(t,a.byteLength);return[i,r,a,o].forEach(function(e){n+=e.byteLength}),e.initBox(n,"traf",i,r,a,o)}},{key:"tfhd",value:function(t){var n=o.default.writeUint32(t);return e.initBox(16,"tfhd",e.extension(0,0),n)}},{key:"tfdt",value:function(t){return e.initBox(16,"tfdt",e.extension(0,0),o.default.writeUint32(t))}},{key:"trun",value:function(t,n){var i=new o.default,r=o.default.writeUint32(t.samples.length),a=o.default.writeUint32(92+16*t.samples.length+n);i.write(e.size(20+16*t.samples.length),e.type("trun"),new Uint8Array([0,0,15,1]),r,a);var s=i.buffer.byteLength,u=0;t.samples.forEach(function(){s+=16});var f=new Uint8Array(s);return f.set(i.buffer,0),u+=i.buffer.byteLength,t.samples.forEach(function(e){f.set(o.default.writeUint32(e.duration),u),u+=4,f.set(o.default.writeUint32(e.size),u),u+=4,1===t.id?(f.set(o.default.writeUint32(e.isKeyframe?33554432:16842752),u),u+=4,f.set(o.default.writeUint32(e.cps),u),u+=4):(f.set(o.default.writeUint32(16777216),u),u+=4,f.set(o.default.writeUint32(0),u),u+=4)}),f}},{key:"sdtp",value:function(t){var n=new o.default;return n.write(e.size(12+t.samples.length),e.type("sdtp"),e.extension(0,0)),t.samples.forEach(function(e){n.write(new Uint8Array(1===t.id?[e.key?32:16]:[16]))}),n.buffer}},{key:"mdat",value:function(t){var n=new o.default,i=8;t.samples.forEach(function(e){i+=e.size}),n.write(e.size(i),e.type("mdat"));var r=new Uint8Array(i),a=0;return r.set(n.buffer,a),a+=8,t.samples.forEach(function(e){e.buffer.forEach(function(e){r.set(e.data,a),a+=e.data.byteLength})}),r}}]),e}();u.type=(0,s.cacheWrapper)(function(e){return new Uint8Array([e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)])}),u.sequence=1,t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=function(e,t,n){var i,r,a=function(a){if(i&&clearTimeout(i),n){var o=!i;i=setTimeout(e,t),o&&(r=e())}else i=setTimeout(e,t);return r};return a.cancel=function(){clearTimeout(i),i=null},a};t.cacheWrapper=function(e){var t={};return function(){for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var a=i.reduce(function(e,t){return e+"_"+t},""),o=e.apply(void 0,i);return void 0!==t[a]?t[a]:(t[a]=o,o)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=o(n(2)),a=o(n(5));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}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),i(t,[{key:"dispatch",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this._observer).emit.apply(t,["remuxer_"+e].concat(i))}},{key:"error",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Remuxer":t;r.default.error("["+n+" error] ",e)}},{key:"info",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Remuxer":t;r.default.info("["+n+" info] ",e)}},{key:"log",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Remuxer":t;r.default.log("["+n+" log] ",e)}},{key:"warn",value:function(e){var t=this.CLASS_NAME,n=void 0===t?"Remuxer":t;r.default.warn("["+n+" warn] ",e)}}]),t}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=Array.prototype.slice,a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fnId=1,this._listenerIdMap={},this._listeners={}}return i(e,[{key:"on",value:function(e,t){var n=this.fnId++,i=this._getListenersByKey(e);return this._listenerIdMap[n]=t,i?(i.unshift(n),n):(this._listeners[e]=[n],n)}},{key:"emit",value:function(e){for(var t=r.call(arguments,1),n=this._getListenersByKey(e)||[],i=0,a=n.length;i<a;i++){var o=this._getListenerById(n[i]);o&&o.apply(null,t)}}},{key:"once",value:function(e,t){var n=this.fnId++,i=this._getListenersByKey(e),a=this;return this._listenerIdMap[n]=function(){var i=r.call(arguments);t.apply(null,i),a.off(e,n)},i?(i.unshift(n),n):(this._listeners[e]=[n],n)}},{key:"off",value:function(e,t){var n=this._getListenersByKey(e);!this._getListenerById(t)||!n||n.indexOf(t)<0||(delete this._listenerIdMap[t],1===n.length?delete this._listeners[e]:n[n.indexOf(t)]=void 0)}},{key:"_getListenersByKey",value:function(e){return this._listeners[e]}},{key:"_getListenerById",value:function(e){return this._listenerIdMap[e]}},{key:"flush",value:function(e){var t=this,n=this._getListenersByKey(e);n&&(n.forEach(function(e){delete t._listenerIdMap[e]}),delete this._listeners[e])}},{key:"destroy",value:function(){this._listeners=null,this._listenerIdMap=null}}]),e}();t.default=new a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(27);var r={network:{code:1,msg:"视频下载错误",remark:"只要视频下载错误就使用此类型，无论是video本身的超时还是xhr的分段请求超时或者资源不存在"},mse:{code:2,msg:"流追加错误",remark:"追加流的时候如果类型不对、无法被正确解码则会触发此类错误"},parse:{code:3,msg:"解析错误",remark:"mp4、hls、flv我们都是使用js进行格式解析，如果解析失败则会触发此类错误"},format:{code:4,msg:"格式错误",remark:"如果浏览器不支持的格式导致播放错误"},decoder:{code:5,msg:"解码错误",remark:"浏览器解码异常会抛出此类型错误"},runtime:{code:6,msg:"语法错误",remark:"播放器语法错误"},timeout:{code:7,msg:"播放超时",remark:"播放过程中无法正常请求下一个分段导致播放中断"},other:{code:8,msg:"其他错误",remark:"不可知的错误或被忽略的错误类型"}};t.default=function e(t,n,a,o,s,u,f,l){var c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:{line:"",handle:"",msg:"",version:""};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var d={};return d.playerVersion=i.version,d.errorType=t,d.domain=document.domain,d.duration=a,d.currentTime=n,d.networkState=o,d.readyState=s,d.currentSrc=f,d.src=u,d.ended=l,d.errd=c,d.ex=(r[t]||{}).msg,d}},function(e){e.exports={name:"xgplayer-flv",version:"1.1.5",description:"flv demuxer for xgplayer",main:"./dist/index.js",scripts:{test:'echo "Error: no test specified" && exit 1',prepare:"npm run build",dev:"webpack --progress --display-chunks --watch --config ./webpack.config.dev.js",build:"webpack --progress --display-chunks -p",watch:"webpack --progress --display-chunks -p --watch"},repository:{type:"git",url:"git+https://github.com/bytedance/xgplayer.git"},keywords:[],author:"leo",license:"MIT",devDependencies:{babel:"^6.23.0","babel-env":"^2.4.1","babel-eslint":"^8.2.2","babel-loader":"^7.1.2","babel-plugin-transform-class-properties":"^6.24.1","babel-plugin-transform-decorators":"^6.24.1","babel-plugin-transform-react-constant-elements":"^6.23.0","babel-plugin-transform-react-inline-elements":"^6.22.0","babel-preset-es2015":"^6.24.1","clean-webpack-plugin":"^0.1.17","css-loader":"^0.28.10","extract-text-webpack-plugin":"^3.0.2","html-loader":"^0.5.5","html-webpack-plugin":"^2.30.1","style-loader":"^0.20.2",webpack:"^4.12.0","webpack-cli":"^3.1.2","webpack-dev-server":"^2.11.1"},peerDependency:{xgplayer:"^0.1.0"},dependencies:{"concat-typed-array":"^1.0.2","event-emitter":"^0.3.5"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n(3)),a=s(n(0)),o=s(n(29));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.CLASS_NAME=n.constructor.name,n.temp_u8a=null,n.dataLen=0,n.stop=!1,n.index=0,n.offset=0,n.filePosition=0,n.firstFlag=!0,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,r.default),i(t,[{key:"seek",value:function(){this.offset=0}},{key:"destroy",value:function(){this.temp_u8a=null,this.dataLen=0,this.stop=!1,this.index=0,this.offset=0,this.filePosition=0}},{key:"setFlv",value:function(e){this.stop=!1,this.index=0,this.offset=0;var n=this.temp_u8a=e;return this.dataLen=this.temp_u8a.length,this.firstFlag?n.length>13&&t.isFlvHead(n)?(this.parseHead(),this.readData(9),this.readData(4),this.parseData(),this.firstFlag=!1,this.filePosition+=this.offset,this.offset):this.offset:this.parseData()}},{key:"parseData",value:function(){for(var e=this.temp_u8a.length;this.index<e&&!this.stop;){this.offset=this.index;var t=new o.default;if(this.unreadLength>=11)if(t.position=this.filePosition+this.offset,t.tagType=this.readData(1)[0],t.bodySize=this.readData(3),t.Timestamp=this.readData(4),t.StramId=this.readData(3),this.unreadLength>=this.getBodySize(t.bodySize)+4){t.body=this.readData(this.getBodySize(t.bodySize)),t.tagSize=this.readData(4);var n=this._store.state,i=n.tags,r=n._hasVideo,a=n._hasAudio;switch(t.tagType){case 9:r&&i.push(t);break;case 8:a&&i.push(t);break;case 18:i.push(t)}this.offset=this.index}else this.stop=!0;else this.stop=!0}return this.filePosition+=this.offset,this.temp_u8a=null,this.offset}},{key:"getBodySize",value:function(e){return a.default.readAsInt(e)}},{key:"parseHead",value:function(){var e=this.temp_u8a,t=this._store,n={match:!1};if(1!==e[3])return n;var i=e[4],r=(4&i)>>>2!=0,a=0!=(1&i);if(!r&&!a)return n;t.hasAudio=r,t.hasVideo=a}},{key:"readData",value:function(e){var t=this.index;return this.index+=e,this.temp_u8a.slice(t,t+e)}},{key:"unreadLength",get:function(){return this.dataLen-this.index}}],[{key:"isFlvHead",value:function(e){var t=[e[0],e[1],e[2]];return"FLV"===String.fromCharCode.apply(String,t)}}]),t}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tagType=-1,this.bodySize=-1,this.tagSize=-1,this.position=-1,this.Timestamp=-1,this.StreamID=-1,this.body=-1,this.time=-1,this.arr=[]}return i(e,[{key:"getTime",value:function(){this.arr=[];for(var e=0;e<this.Timestamp.length;e++)this.arr.push(1===this.Timestamp[e].toString(16).length?"0"+this.Timestamp[e].toString(16):this.Timestamp[e].toString(16));this.arr.pop();var t=this.arr.join("");return this.time=parseInt(t,16),parseInt(t,16)}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n(3)),a=l(n(31)),o=l(n(33)),s=l(n(36)),u=l(n(2)),f=l(n(37));function l(e){return e&&e.__esModule?e:{default:e}}var c=Object.prototype.hasOwnProperty,d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.CLASS_NAME=n.constructor.name,n._metaDemuxer=new a.default(e),n._videoDemuxer=new o.default(e),n._audioDemuxer=new s.default(e),n._firstParse=!0,n._dataOffset=0,n.handleMediaInfoReady=function(){},n.handleDataReady=function(){},n.handleMetaDataReady=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 "+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,r.default),i(t,[{key:"setEventBind",value:function(){this._videoDemuxer.handleDataReady=this.handleDataReady,this._videoDemuxer.handleMetaDataReady=this.handleMetaDataReady,this._videoDemuxer.handleMediaInfoReady=this.handleMediaInfoReady,this._audioDemuxer.handleDataReady=this.handleDataReady,this._audioDemuxer.handleMetaDataReady=this.handleMetaDataReady,this._audioDemuxer.handleMediaInfoReady=this.handleMediaInfoReady}},{key:"destroy",value:function(){this._metaDemuxer=null,this._videoDemuxer=null,this._audioDemuxer=null}},{key:"resolveTags",value:function(){var e=this,t=this._store.state.tags,n=this._store,i=n.videoTrack,r=n.audioTrack;t.forEach(function(t){e.resolveTag(t)}),this._store.hasInitialMetaDispatched&&(i.length||r.length)&&this.handleDataReady(r,i),this._store.state.tags=[]}},{key:"resolveTag",value:function(e){switch(String(e.tagType)){case"8":this._resolveAudioTag(e);break;case"9":this._resolveVideoTag(e);break;case"18":this._resolveMetaTag(e)}}},{key:"_resolveAudioTag",value:function(e){e.bodySize<=1&&this.warn("Not enough data for audio tag body"),this._audioDemuxer.resolve(e)}},{key:"_resolveVideoTag",value:function(e){if(e.bodySize<=1)this.error("Not enough data for video tag body");else{var t=this._hasVideo;this.hasVideoFlagOverrided&&!t||this._videoDemuxer.resolve(e)}}},{key:"_initMetaData",value:function(e){var t=this,n=this._store;if(c.call(e,"onMetaData")){n.hasMetaData&&u.default.log("["+this.CLASS_NAME+"]","found another meta tag"),n.metaData=e;var i=e.onMetaData;f.default.forEach(function(e){var r=e.name,a=e.type,o=e.parser,s=e.onTypeErr;Object(i[r])instanceof a?o.call(t,n,i):s&&s instanceof Function&&s(n,i)}),this._store.mediaInfo._metaData=e,this._store.mediaInfo.isComplete&&this.handleMediaInfoReady(this._store.mediaInfo)}}},{key:"_resolveMetaTag",value:function(e){var t=e.body,n=this._metaDemuxer.resolve(t,t.length);this._initMetaData(n)}},{key:"_parseKeyframes",value:function(e){for(var t=[],n=[],i=this._store,r=i.videoTimeScale,a=i.state,o=1;o<e.times.length;o++)t[t.length]=a.timeStampBase+Math.floor(e.times[o]*r),n[n.length]=e.filepositions[o];return{times:t,filePositions:n}}}]),t}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(6),a=s(n(32)),o=s(n(3));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.offset=0,n.readOffset=n.offset,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,o.default),i(t,[{key:"resolve",value:function(e,t){if(t<3)throw"not enough data for metainfo";var n={},i=this.parseValue(e),r=this.parseValue(e,t-i.bodySize);return n[i.data]=r.data,this.resetStatus(),n}},{key:"resetStatus",value:function(){this.offset=0,this.readOffset=this.offset}},{key:"parseString",value:function(e){var t=new DataView(e,this.readOffset).getUint16(0,!this.isLe),n="";n=t>0?a.default.decode(new Uint8Array(e,this.readOffset+2,t)):"";var i=t+2;return this.readOffset+=i,{data:n,bodySize:t+2}}},{key:"parseDate",value:function(e,t){var n=this.isLe,i=new DataView(e,this.readOffset,t),r=i.getFloat64(0,!n);return r+=60*i.getInt16(8,!n)*1e3,this.readOffset+=10,{data:new Date(r),bodySize:10}}},{key:"parseObject",value:function(e,t){var n=this.parseString(e,t),i=this.parseValue(e,t-n.bodySize);return{data:{name:n.data,value:i.data},bodySize:n.bodySize+i.bodySize,isObjEnd:i.isObjEnd}}},{key:"parseLongString",value:function(e){var t=new DataView(e,this.readOffset).getUint32(0,!this.isLe),n="";return n=t>0?a.default.decode(new Uint8Array(e,this.readOffset+2,t)):"",this.readOffset+=t+4,{data:n,bodySize:t+4}}},{key:"parseValue",value:function(e,t){var n=new ArrayBuffer;n=e instanceof ArrayBuffer?e:e.buffer;var i=this.isLe,a=r.MetaTypes.NUMBER,o=r.MetaTypes.BOOLEAN,s=r.MetaTypes.STRING,u=r.MetaTypes.OBJECT,f=r.MetaTypes.MIX_ARRAY,l=r.MetaTypes.OBJECT_END,c=r.MetaTypes.STRICT_ARRAY,d=r.MetaTypes.DATE,h=r.MetaTypes.LONE_STRING,p=new DataView(n,this.readOffset,t),v=!1,y=p.getUint8(0),m=1;this.readOffset+=1;var g=null;switch(y){case a:g=p.getFloat64(1,!i),this.readOffset+=8,m+=8;break;case o:g=!!p.getUint8(1),this.readOffset+=1,m+=1;break;case s:var _=this.parseString(n);g=_.data,m+=_.bodySize;break;case u:g={};var b=0;for(16777215&p.getUint32(t-4,!i)&&(b=3);m<t-4;){var w=this.parseObject(n,t-m-b);if(w.isObjectEnd)break;g[w.data.name]=w.data.value,m+=w.bodySize}if(m<=t-3)9===(16777215&p.getUint32(m-1,!i))&&(this.readOffset+=3,m+=3);break;case f:g={},m+=4,this.readOffset+=4;var k=0;for(9==(16777215&p.getUint32(t-4,!i))&&(k=3);m<t-8;){var S=this.parseObject(n,t-m-k);if(S.isObjectEnd)break;g[S.data.name]=S.data.value,m+=S.bodySize}if(m<=t-3)9===(16777215&p.getUint32(m-1,!i))&&(m+=3,this.readOffset+=3);break;case l:g=null,v=!0;break;case c:g=[];var O=p.getUint32(1,!i);m+=4,this.readOffset+=4;for(var A=0;A<O;A++){var D=this.parseValue(n,t-m);g.push(D.data),m+=D.bodySize}break;case d:var T=this.parseDate(n,t-1);g=T.data,m+=T.bodySize;break;case h:var x=this.parseLongString(n,t-1);g=x.data,m+=x.bodySize;break;default:m=t}return{data:g,bodySize:m,isObjEnd:v}}},{key:"isLe",get:function(){return this._store.isLe}}]),t}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"decode",value:function(t){for(var n=[],i=t,r=0,a=t.length;r<a;)if(i[r]<128)n.push(String.fromCharCode(i[r])),++r;else{if(i[r]<192);else if(i[r]<224){if(e._checkContinuation(i,r,1)){var o=(31&i[r])<<6|63&i[r+1];if(o>=128){n.push(String.fromCharCode(65535&o)),r+=2;continue}}}else if(i[r]<240){if(e._checkContinuation(i,r,2)){var s=(15&i[r])<<12|(63&i[r+1])<<6|63&i[r+2];if(s>=2048&&55296!=(63488&s)){n.push(String.fromCharCode(65535&s)),r+=3;continue}}}else if(i[r]<248&&e._checkContinuation(i,r,3)){var u=(7&i[r])<<18|(63&i[r+1])<<12|(63&i[r+2])<<6|63&i[r+3];if(u>65536&&u<1114112){u-=65536,n.push(String.fromCharCode(u>>>10|55296)),n.push(String.fromCharCode(1023&u|56320)),r+=4;continue}}n.push(String.fromCharCode(65533)),++r}return n.join("")}},{key:"_checkContinuation",value:function(e,t,n){var i=e;if(t+n<i.length){for(;n--;)if(128!=(192&i[++t]))return!1;return!0}return!1}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=f(n(3)),a=f(n(34)),o=f(n(8)),s=n(6),u=f(n(0));function f(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.CLASS_NAME=n.constructor.name,n.readOffset=0,n.data=new Uint8Array(0),n.currentTag=null,n._store.videoMetaData=null,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,r.default),i(t,[{key:"resetStatus",value:function(){this.readOffset=0,this.data=new Uint8Array(0),this.currentTag=null}},{key:"resolve",value:function(e){this.data=e.body,this.currentTag=e;var t=this.readData(1)[0],n=(240&t)>>>4,i=15&t;7===i?(this._parseAVCPacket(n),this.resetStatus()):this.error("unsupported codecId: "+i)}},{key:"_parseAVCPacket",value:function(e){this.unreadLength<4&&this.error("Invalid Avc Tag");var t=this._store.isLe,n=this.data.buffer,i=new DataView(n,this.readOffset,this.unreadLength),r=i.getUint8(0),a=16777215&i.getUint32(0,!t);switch(a=a<<8>>8,this.readOffset+=4,r){case 0:var o=this.currentTag,s=o.position,f=o.tagSize;this._store.metaEndPosition=s+u.default.readAsInt(f)+4,this._parseAVCDecoderConfigurationRecord();break;case 1:this._parseAVCVideoData(e,a)}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(){if(this.unreadLength<7)this.error("Invalid AVCDecoderConfigurationRecord, lack of data!");else{var e=this._store.mediaInfo,t=this._store,n=this._store.videoMetaData,i=this._store.videoTrack,r=new o.default(this.data.buffer,this);n?void 0!==n.avcc&&this.error("found another AVCDecoderConfigurationRecord!"):(t.state._hasVideo||t.state.hasVideoFlagOverrided||(t.state._hasVideo=!0,t._mediaInfo.hasVideo=!0),(n=t.videoMetaData={}).type="video",n.id=i.id,n.timeScale=t.videoTimeScale,n.duration=t.state.duration,e.timescale=t.videoTimeScale);var u=r.getUint8(),f=r.getUint8();if(r.getUint8(),r.getUint8(),1===u&&0!==f){var l=t.state.naluLengthSize=r.getUint(2,this.readOffset,!1)+1;if(3===l||4===l){var c=r.getUint(5,null,!1);if(0!==c){c>1&&(this.emitError("decoder",{line:132,handler:"_parseAVCDecoderConfigurationRecord",msg:"spsLength > 1"}),this.warn("AVCDecoderConfigurationRecord: spsLength > 1"));for(var d=void 0,h=0;h<c;h++){var p=r.getUint16();if(0!==p){d=new Uint8Array(this.data.buffer,this.readOffset,p),this.readOffset+=p;var v=a.default.parseSPS(d);if(0===h){var y=v.codecSize,m=v.presentSize,g=v.profileString,_=v.levelString,b=v.chromaFormat,w=v.pixelRatio,k=v.frameRate,S=v.refFrames,O=v.bitDepth;n.width=y.width,n.height=y.height,n.presentWidth=m.width,n.presentHeight=m.height,n.profile=g,n.level=_,n.bitDepth=O,n.chromaFormat=b,n.pixelRatio=w,n.frameRate=k,k.fixed&&0!==k.fpsNum&&0!==k.fpsDen||(n.frameRate=t.referFrameRate);var A=n.frameRate,D=A.fpsDen,T=A.fpsNum;n.refSampleDuration=n.timeScale*(D/T);for(var x=d.subarray(1,4),P="avc1.",E=0;E<3;E++){var M=x[E].toString(16);P+=M=M.padStart(2,"0")}n.codec=P;var C=this._store.mediaInfo;C.width=n.width,C.height=n.height,C.fps=n.frameRate.fps,C.profile=n.profile,C.level=n.level,C.refFrames=S,C.pixelRatio=w,C.videoCodec=P,C.chromaFormat=b,C.hasAudio?C.audioCodec&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"',C.codec=C.mimeType.replace("x-flv","mp4")):(C.mimeType='video/x-flv; codecs="'+C.videoCodec+'"',C.codec=C.mimeType.replace("x-flv","mp4"))}}}var L=void 0,R=r.getUint8();if(!R)return this.emitError("decoder",{line:227,handler:"_parseAVCDecoderConfigurationRecord",msg:"no pps in this video"}),void this.dispatch(s.EventTypes.ERROR,"no pps in this video");R>1&&this.warn("AVCDecoderConfigurationRecord has ppsCount: "+R);for(var j=0;j<R;j++){var I=r.getUint16();I&&(L=new Uint8Array(this.data.buffer,this.readOffset,I),this.readOffset+=I)}e.sps=n.sps=d,e.pps=n.pps=L,e.isComplete&&this.handleMediaInfoReady(e),t.hasInitialMetaDispatched?(t.videoTrack.length||t.audioTrack.length)&&this.handleDataReady(t.videoTrack,t.audioTrack):t.state._videoInitialMetadataDispatched=!0,this.handleMetaDataReady("video",n)}else this.emitError("decoder",{line:128,handler:"_parseAVCDecoderConfigurationRecord",msg:"no sps in this video"})}}}}},{key:"_parseAVCVideoData",value:function(e,t){for(var n=new o.default(this.data.buffer,this),i=[],r=0,a=this._store.state.naluLengthSize,s=this._store.state.timeStampBase+this.currentTag.getTime(),u=1===e;this.unreadLength>0;){if(this.unreadLength<4){this.warn("not enough data for parsing AVC");break}var f=this.readOffset,l=4===a?n.getUint32():n.getUint24();if(l>this.unreadLength)return;var c=n.getUint(5,this.readOffset,!1);5===c&&(u=!0);var d=new Uint8Array(this.data.buffer,f,a+l);this.readOffset=f+a+l;var h={type:c,data:d};i.push(h),r+=d.byteLength}if(n=null,i.length){var p=this._store.videoTrack,v={units:i,length:r,dts:s,cps:t,pts:s+t,isKeyframe:u,position:u?this.currentTag.position:void 0};p.samples.push(v),p.length+=r}}},{key:"readData",value:function(e){var t=this.data,n=this.readOffset;return this.dataSize>n+e?(this.readOffset+=e,t.slice(n,e)):[]}},{key:"dataSize",get:function(){return this.data.length}},{key:"unreadLength",get:function(){return this.dataSize-this.readOffset}}]),t}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(35),o=(i=a)&&i.__esModule?i:{default:i};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"getProfileStr",value:function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelStr",value:function(e){return(e/10).toFixed(1)}},{key:"getChromaFormatStr",value:function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}},{key:"parseSPS",value:function(t){var n=e._ebsp2rbsp(t),i=new o.default(n).readSPS(),r=i.chromaFormat,a=i.levelIdc,s=i.profileIdc;return i.profileString=e.getProfileStr(s),i.levelString=e.getLevelStr(a),i.chromaFormatString=e.getChromaFormatStr(r),i}},{key:"_ebsp2rbsp",value:function(e){for(var t=e.byteLength,n=new Uint8Array(e.byteLength),i=0,r=0,a=t;r<a;r++)r>2&&3===e[r]&&0===e[r-1]&&0===e[r-2]||(n[i++]=e[r]);return new Uint8Array(n.buffer,0,i)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(2),o=(i=a)&&i.__esModule?i:{default:i};var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return r(e,[{key:"loadWord",value:function(){var e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(0===r)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r}},{key:"skipBits",value:function(e){var t;return this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e),t}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),n=this.word>>>32-t;return e>32&&o.default.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?n<<t|this.readBits(t):n}},{key:"skipLZ",value:function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t,n=8,i=8;for(t=0;t<e;t++)0!==i&&(i=(n+this.readEG()+256)%256),n=0===i?n:i}},{key:"readSPS",value:function(){var e,t,n,i,r,a,o,s,u,f,l,c=0,d=0,h=0,p=0,v=this.readUByte.bind(this),y=this.readBits.bind(this),m=this.readUEG.bind(this),g=this.readBoolean.bind(this),_=this.skipBits.bind(this),b=this.skipEG.bind(this),w=this.skipUEG.bind(this),k=this.skipScalingList.bind(this);v(),e=v(),y(5),_(3),t=v(),w();var S=1,O=420,A=8;if([100,110,122,244,44,83,86,118,128].includes(e)&&(3===(S=m())&&_(1),S<=3&&(O=[0,420,422,444][S]),A=m()+8,w(),_(1),g()))for(f=3!==S?8:12,l=0;l<f;l++)g()&&k(l<6?16:64);w();var D=m();if(0===D)m();else if(1===D)for(_(1),b(),b(),a=m(),l=0;l<a;l++)b();var T=m();_(1),o=m(),s=m(),0===(u=y(1))&&_(1),_(1),g()&&(c=m(),d=m(),h=m(),p=m());var x={fps:0,fpsFixed:!0,fpsNum:0,fpsDen:0},P=[1,1];if(g()){if(g())switch(v()){case 1:P=[1,1];break;case 2:P=[12,11];break;case 3:P=[10,11];break;case 4:P=[16,11];break;case 5:P=[40,33];break;case 6:P=[24,11];break;case 7:P=[20,11];break;case 8:P=[32,11];break;case 9:P=[80,33];break;case 10:P=[18,11];break;case 11:P=[15,11];break;case 12:P=[64,33];break;case 13:P=[160,99];break;case 14:P=[4,3];break;case 15:P=[3,2];break;case 16:P=[2,1];break;case 255:P=[v()<<8|v(),v()<<8|v()]}if(g()&&g(),g()&&(y(4),g()&&y(24)),g()&&(m(),m()),g()){var E=y(32);x.fpsNum=y(32),x.fixed=this.readBoolean(),x.fpsDen=2*E,x.fps=x.fpsNum/x.fpsDen}var M=0,C=0;if(0===S)M=1,M=2-u;else M=3===S?1:2,C=(1===S?2:1)*(2-u);n=16*(o+1),i=16*(s+1)*(2-u),n-=(c+d)*M,i-=(h+p)*C,r=(1===P[0]||1===P[1]?1:P[0]/P[1])*n}return{profileIdc:e,levelIdc:t,refFrames:T,chromaFormat:O,bitDepth:A,frameRate:x,codecSize:{width:n,height:i},presentSize:{width:r,height:i},width:Math.ceil(16*(o+1)-2*c-2*d),height:(2-u)*(s+1)*16-(u?2:4)*(h+p),pixelRatio:P}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=f(n(3)),a=f(n(8)),o=n(6),s=f(n(4)),u=f(n(0));function f(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.CLASS_NAME=n.constructor.name,n.currentTag=null,n.data=new Uint8Array(0),n.readOffset=0,n._store.audioMetaData=null,n.handleDataReady=function(){},n.handleMetaDataReady=function(){},n.handleMediaInfoReady=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 "+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,r.default),i(t,[{key:"resolve",value:function(e){this.readOffset=0;var t=this._store,n=t.audioTrack;this.currentTag=e,this.data=e.body;var i=t.audioMetaData;i||(i=t.audioMetaData={},t.audioMetaData=this.initAudioMeta(i));var r=new a.default(e.body.buffer,this).getUint8(),s=r>>>4,u=(12&r)>>>2,f=r%1;if(i.audioSampleRate=o.soundRateTypes[u],i.channelCount=0===f?1:2,10===s||2===s){if(10===s){var l=this._parseAACAudio();if(!l)return;var c=l.data,d=l.data.sampleFreq;if(0===l.packetType){i.sampleRate=d,i.channelCount=c.channelCount,i.codec=c.codec,i.manifestCodec=c.manifestCodec,i.config=c.config,i.refSampleDuration=1024/d*i.timeScale,t.hasInitialMetaDispatched?(t.videoTrack.length||t.audioTrack.length)&&this.handleDataReady(t.videoTrack,t.audioTrack):t.state._audioInitialMetadataDispatched=!0,this.handleMetaDataReady("audio",i);var h=t.mediaInfo;h.audioCodec=i.codec,h.audioSampleRate=i.sampleRate,h.audioChannelCount=i.channelCount,h.audioConfig=i.config,h.hasVideo?h.videoCodec&&(h.mimeType='video/x-flv; codecs="'+h.videoCodec+","+h.audioCodec+'"',h.codec=h.mimeType.replace("x-flv","mp4")):(h.mimeType='video/x-flv; codecs="'+h.audioCodec+'"',h.codec=h.mimeType.replace("x-flv","mp4")),h.isComplete&&this.handleMediaInfoReady(h)}else if(1===l.packetType){var p=t.state.timeStampBase+this.currentTag.getTime(),v={unit:l.data,length:l.data.byteLength,dts:p,pts:p};n.samples.push(v),n.length+=l.data.length}}this.resetStatus()}else this.error("only support AAC Audio format so far")}},{key:"_parseAACAudio",value:function(){if(!(this.unreadLength<=1)){var e={},t=new Uint8Array(this.data.buffer,this.readOffset,this.unreadLength),n=t[0];if(this.readOffset+=1,e.packetType=n,n)e.data=t.slice(1);else{var i=this.currentTag,r=i.position,a=i.tagSize;this._store.metaEndPosition=r+u.default.readAsInt(a)+4,e.data=this._parseAACAudioSpecificConfig()}return e}}},{key:"_parseAACAudioSpecificConfig",value:function(){var e,t=new a.default(this.data.buffer,this),n=a.default.getAndNum,i={samplingFrequency:null,extAudioObjectType:null,extAudioSamplingIdx:null},r={},u=t.getUint8(),f=t.getUint8(),l=e=u>>>3,c=(u&n(5,7))<<1|f>>>7;if(c<0||c>o.samplingFrequencyTypes.length)return this.emitError("decoder",{line:"141",handle:"_parseAACAudioSpecificConfig",msg:"invalid samplingFrequencyIndex "+c}),void this.dispatch(o.EventTypes.ERROR,"error samplingFrequencyIndex: "+c);i.samplingFrequency=o.samplingFrequencyTypes[c];var d=i.channelCount=(f&n(1,4))>>>3;if(d<0||d>7)return this.emitError("decoder",{line:"154",handle:"_parseAACAudioSpecificConfig",msg:"invalid Audio Channel Count: "+d}),void this.dispatch(o.EventTypes.ERROR,"error Audio Channel Count: "+d);if(5===l){var h=t.getUint8();i.extAudioSamplingIdx=(f&n(5,7))<<1|h>>>7,i.extAudioObjectType=(h&n(1,5))>>>2}return s.default.browser===o.browserTypes.FIRE_FOX?c>=6?(l=5,r=new Array(4),i.extAudioSamplingIdx=c-3):(l=2,r=new Array(2),i.extAudioSamplingIdx=c):s.default.os.isAndroid?(l=2,r=new Array(2),i.extAudioSamplingIdx=c):(l=5,i.extensionSamplingIndex=c,r=new Array(4),c>=6?i.extensionSamplingIdx=c-3:1===d&&(l=2,r=new Array(2),i.extensionSamplingIndex=c)),r[0]=l<<3,r[0]|=(14&c)>>1,r[1]|=(1&c)<<7,r[1]|=d<<3,5===l&&(r[1]|=(14&i.extAudioSamplingIdx)>>1,r[2]=(1&i.extensionSamplingIdx)<<7,r[2]|=8,r[3]=0),{config:r,sampleFreq:i.samplingFrequency,channelCount:d,codec:"mp4a.40."+l,manifestCodec:"mp4a.40."+e}}},{key:"initAudioMeta",value:function(e){var t=this._store,n=t.state,i=t.audioTrack;return e.duration=n.duration,e.timeScale=n.timeScale,e.type="audio",e.id=i.id,e}},{key:"resetStatus",value:function(){this.currentTag=null,this.data=new Uint8Array(0),this.readOffset=0}},{key:"dataSize",get:function(){return this.data.length}},{key:"unreadLength",get:function(){return this.dataSize-this.readOffset}}]),t}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=[{name:"duration",type:Boolean,parser:function(e,t){e.mediaInfo.duration=t.duration}},{name:"hasAudio",type:Boolean,parser:function(e,t){e.mediaInfo.hasAudio=t.hasAudio}},{name:"hasVideo",type:Boolean,parser:function(e,t){e.mediaInfo.hasVideo=t.hasVideo}},{name:"audiodatarate",type:Number,parser:function(e,t){e.mediaInfo.audioDataRate=t.audiodatarate}},{name:"videodatarate",type:Number,parser:function(e,t){e.mediaInfo.videoDataRate=t.videodatarate}},{name:"width",type:Number,parser:function(e,t){e.mediaInfo.width=t.width}},{name:"height",type:Number,parser:function(e,t){e.mediaInfo.height=t.height}},{name:"duration",type:Number,parser:function(e,t){if(!e.state.duration){var n=Math.floor(t.duration*e.state.timeScale);e.state.duration=e.mediaInfo.duration=n}},onTypeErr:function(e){e.mediaInfo.duration=0}},{name:"framerate",type:Number,parser:function(e,t){var n=Math.floor(1e3*t.framerate);if(n>0){var i=n/1e3,r=e.referFrameRate,a=e.mediaInfo;r.fixed=!0,r.fps=i,r.fpsNum=n,r.fpsDen=1e3,a.fps=i}}},{name:"keyframes",type:Object,parser:function(e,t){var n=t.keyframes;e.mediaInfo.hasKeyframes=!!n,n&&(e.mediaInfo.keyframes=this._parseKeyframes(n)),t.keyframes=null},onTypeErr:function(e){e.mediaInfo.hasKeyframes=!1}}];t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=o(n(39)),a=o(n(4));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.state={isLe:a.default.isLe,_hasAudio:!1,_hasVideo:!1,_mediaInfo:new r.default,_metaData:null,_videoTrack:{type:"video",id:1,samples:[],length:0},_audioTrack:{type:"audio",id:2,samples:[],length:0},_videoMetaData:null,_audioMetaData:null,_audioInitialMetadataDispatched:!1,_videoInitialMetadataDispatched:!1,tags:[],timeStampBase:0,hasVideoFlagOverrided:!1,hasAudioFlagOverrided:!1,timeScale:1e3,duration:0,isLive:!1,durationOverrided:!1,naluLengthSize:4,_referFrameRate:{fixed:!0,fps:23.976,fpsNum:23976,fpsDen:1e3},metaEndPosition:-1},this.methods={_isInitialMetadataDispatched:function(){var e=this.state,t=e._hasAudio,n=e._hasVideo,i=e._audioInitialMetadataDispatched,r=e._videoInitialMetadataDispatched;return t&&n?i&&r:t&&!n?this._audioInitialMetadataDispatched:!(t||!n)&&r}.bind(this)}}return i(e,[{key:"clearTags",value:function(){this.state.tags=[]}},{key:"referFrameRate",get:function(){return this.state._referFrameRate},set:function(e){this.state._referFrameRate=e}},{key:"mediaInfo",set:function(e){this.state._mediaInfo=e},get:function(){return this.state._mediaInfo}},{key:"metaData",get:function(){return this.state._metaData},set:function(e){this.state._metaData=e}},{key:"hasMetaData",get:function(){return null!==this.state._metaData}},{key:"audioTrack",set:function(e){this.state._audioTrack=e},get:function(){return this.state._audioTrack}},{key:"videoTrack",set:function(e){this.state._videoTrack=e},get:function(){return this.state._videoTrack}},{key:"hasAudio",set:function(e){this.state._hasAudio=e,this.state._mediaInfo.hasAudio=e},get:function(){return this.state._hasAudio}},{key:"hasVideo",set:function(e){this.state._hasVideo=e,this.state._mediaInfo.hasVideo=e},get:function(){return this.state._hasVideo}},{key:"videoMetaData",set:function(e){this.state._videoMetaData=e},get:function(){return this.state._videoMetaData}},{key:"audioMetaData",set:function(e){this.state._audioMetaData=e},get:function(){return this.state._audioMetaData}},{key:"keyframes",get:function(){return this.state._mediaInfo.keyframes}},{key:"isSeekable",get:function(){return this.state._mediaInfo.hasKeyframes}},{key:"isLe",get:function(){return this.state.isLe}},{key:"hasInitialMetaDispatched",get:function(){var e=this.state,t=e._hasAudio,n=e._hasVideo,i=e._audioInitialMetadataDispatched,r=e._videoInitialMetadataDispatched;return t&&n?i&&r:t&&!n?this._audioInitialMetadataDispatched:!(t||!n)&&r}},{key:"videoTimeScale",get:function(){return this.state.timeScale}},{key:"metaEndPosition",get:function(){return this.state.metaEndPosition},set:function(e){this.state.metaEndPosition=e}},{key:"isLive",get:function(){return this.state.isLive},set:function(e){this.state.isLive=e}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var a=function(){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);var r=Object.assign({},{mimeType:null,codec:"",duration:null,hasAudio:!1,hasVideo:!1,audioCodec:null,videoCodec:null,videoDataRate:null,audioDataRate:null,audioSampleRate:null,audioChannelCount:null,audioConfig:null,width:null,height:null,fps:null,profile:null,level:null,chromaFormat:null,pixelRatio:[],_metaData:null,segments:[],hasKeyframes:null,keyframes:[]},t);Object.entries(r).forEach(function(e){var t=i(e,2),r=t[0],a=t[1];n[r]=a})}return r(e,[{key:"isComplete",get:function(){var e=this.mimeType,t=this.duration,n=this.hasKeyframes;return null!==e&&null!==t&&null!==n&&this.isVideoInfoFilled&&this.isAudioInfoFilled}},{key:"isAudioInfoFilled",get:function(){var e=this.hasAudio,t=this.audioCodec,n=this.audioSampleRate,i=this.audioChannelCount;return!(e&&!(e&&t&&n&&i))}},{key:"isVideoInfoFilled",get:function(){for(var e=["videoCodec","width","height","fps","profile","level","chromaFormat"],t=0,n=e.length;t<n;t++)if(null===this[e[t]])return!1;return this.hasVideo}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=new window.Headers,r={headers:Object.assign({},i),method:"GET",cache:"default",mode:"cors"};this._stop=!1,this.request=new Request(t,Object.assign({},r,n))}return i(e,[{key:"run",value:function(e){var t=this,n=this;return new Promise(function(e,n){var i=!0;fetch(t.request).then(function(t){i=!1,e(t)}),setTimeout(function(){i&&n()},5e3)}).then(function(t){!function t(i){i.read().then(function(r){n._stop?i.cancel():(e(r.done?void 0:r.value),t(i))})}(t.body.getReader())}).catch(function(t){e()}),this}},{key:"cancel",value:function(){this._stop=!0}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(42),o=(i=a)&&i.__esModule?i:{default:i};var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.codecs='video/mp4; codecs="avc1.64001E, mp4a.40.5"';var n=this;(0,o.default)(this),this.mediaSource=new window.MediaSource,t.src=window.URL.createObjectURL(this.mediaSource),this.url=t.src,this.handleSourceOpen=this.onSourceOpen.bind(this),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen),this.mediaSource.addEventListener("sourceclose",function(){n.emit("sourceclose")})}return r(e,[{key:"onSourceOpen",value:function(){var e=this;e.sourceBuffer=e.mediaSource.addSourceBuffer(e.codecs),e.sourceBuffer.addEventListener("error",function(t){e.emit("error",{type:"sourceBuffer",error:t})}),e.sourceBuffer.addEventListener("updateend",function(t){e.emit("updateend")}),e.emit("sourceopen"),e.sourceBuffer.addEventListener("error",function(t){e.emit("error",{type:"mediaSource",error:t})})}},{key:"appendBuffer",value:function(e){var t=this.sourceBuffer;if(!1===t.updating&&"open"===this.state)return t.appendBuffer(e),!0;if("closed"===this.state)this.emit("error",{type:"sourceBuffer",error:new Error("mediaSource is not attached to video or mediaSource is closed")});else{if("ended"!==this.state)return!0===t.updating&&this.emit("warn",{type:"sourceBuffer",error:new Error("mediaSource is busy")}),!1;this.emit("error",{type:"sourceBuffer",error:new Error("mediaSource is closed")})}}},{key:"destroy",value:function(){this.__ee__={}}},{key:"removeBuffer",value:function(e,t){this.sourceBuffer.remove(e,t)}},{key:"endOfStream",value:function(){"open"===this.mediaSource.readyState&&this.mediaSource.endOfStream()}},{key:"state",get:function(){return this.mediaSource.readyState}},{key:"duration",get:function(){return this.mediaSource.duration},set:function(e){this.mediaSource.duration=e}}],[{key:"isSupported",value:function(e){return window.MediaSource&&window.MediaSource.isTypeSupported(e)}}]),e}();t.default=s},function(e,t,n){"use strict";var i,r,a,o,s,u,f,l="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=n(43),d=n(57),h=Function.prototype.apply,p=Function.prototype.call,v=Object.create,y=Object.defineProperty,m=Object.defineProperties,g=Object.prototype.hasOwnProperty,_={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var n,r;return d(t),r=this,i.call(this,e,n=function(){a.call(r,e,n),h.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:i=function(e,t){var n;return d(t),g.call(this,"__ee__")?n=this.__ee__:(n=_.value=v(null),y(this,"__ee__",_),_.value=null),n[e]?"object"===l(n[e])?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:r,off:a=function(e,t){var n,i,r,a;if(d(t),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"===(void 0===(i=n[e])?"undefined":l(i)))for(a=0;r=i[a];++a)r!==t&&r.__eeOnceListener__!==t||(2===i.length?n[e]=i[a?0:1]:i.splice(a,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},emit:o=function(e){var t,n,i,r,a;if(g.call(this,"__ee__")&&(r=this.__ee__[e]))if("object"===(void 0===r?"undefined":l(r))){for(n=arguments.length,a=new Array(n-1),t=1;t<n;++t)a[t-1]=arguments[t];for(r=r.slice(),t=0;i=r[t];++t)h.call(i,this,a)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,a=new Array(n-1),t=1;t<n;++t)a[t-1]=arguments[t];h.call(r,this,a)}}},u={on:c(i),once:c(r),off:c(a),emit:c(o)},f=m({},u),e.exports=t=function(e){return null==e?v(f):m(Object(e),u)},t.methods=s},function(e,t,n){"use strict";var i=n(44),r=n(52),a=n(53),o=n(54);(e.exports=function(e,t){var n,a,s,u,f;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=s=!0,a=!1):(n=o.call(e,"c"),a=o.call(e,"e"),s=o.call(e,"w")),f={value:t,configurable:n,enumerable:a,writable:s},u?i(r(u),f):f}).gs=function(e,t,n){var s,u,f,l;return"string"!=typeof e?(f=n,n=t,t=e,e=null):f=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(f=n,n=void 0):(f=t,t=n=void 0),null==e?(s=!0,u=!1):(s=o.call(e,"c"),u=o.call(e,"e")),l={get:t,set:n,configurable:s,enumerable:u},f?i(r(f),l):l}},function(e,t,n){"use strict";e.exports=n(45)()?Object.assign:n(46)},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var i=n(47),r=n(51),a=Math.max;e.exports=function(e,t){var n,o,s,u=a(arguments.length,2);for(e=Object(r(e)),s=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},o=1;o<u;++o)t=arguments[o],i(t).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(48)()?Object.keys:n(49)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(7),r=Object.keys;e.exports=function(e){return r(i(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var i=n(7);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var i=n(7),r=Array.prototype.forEach,a=Object.create;e.exports=function(e){var t=a(null);return r.call(arguments,function(e){i(e)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(e),t)}),t}},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(55)()?String.prototype.contains:n(56)},function(e,t,n){"use strict";var i="razdwatrzy";e.exports=function(){return"function"==typeof i.contains&&(!0===i.contains("dwa")&&!1===i.contains("foo"))}},function(e,t,n){"use strict";var i=String.prototype.indexOf;e.exports=function(e){return i.call(this,e,arguments[1])>-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});t.default=function(){return{preloadTime:30,minCachedTime:5,autoCleanSourceBuffer:!0,autoCleanMaxBackTime:30,isLive:!1,cors:!0}}}]);