webpackJsonpcyberplayer([1],[,,,,,function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=i(17),o=n(s),a=function(){function e(){r(this,e)}return e.e=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",n),e.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&(console.info?console.info(n):console.log(n))},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&(console.warn?console.warn(n):console.log(n))},e.d=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",n),e.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},e.v=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",n),e.ENABLE_VERBOSE&&console.log(n)},e}();a.GLOBAL_TAG="flv.js",a.FORCE_GLOBAL_TAG=!1,a.ENABLE_ERROR=!1,a.ENABLE_INFO=!1,a.ENABLE_WARN=!1,a.ENABLE_DEBUG=!1,a.ENABLE_VERBOSE=!1,a.ENABLE_CALLBACK=!1,a.emitter=new o["default"],t["default"]=a,e.exports=t["default"]},function(e,t){"use strict";function i(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}function n(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)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=function(){function e(e,t){for(var i=0;i0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var r=!1;return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var i,r,o,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=this._events[e],o=i.length,r=-1,i===t||n(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(i)){for(a=o;a-- >0;)if(i[a]===t||i[a].listener&&i[a].listener===t){r=a;break}if(r<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[e],n(i))this.removeListener(e,i);else if(i)for(;i.length;)this.removeListener(e,i[i.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t){"use strict";function i(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},s={};if(r.browser){s[r.browser]=!0;var o=r.majorVersion.split(".");s.version={major:parseInt(r.majorVersion,10),string:r.version},o.length>1&&(s.version.minor=parseInt(o[1],10)),o.length>2&&(s.version.build=parseInt(o[2],10))}if(r.platform&&(s[r.platform]=!0),(s.chrome||s.opr||s.safari)&&(s.webkit=!0),s.rv||s.iemobile){s.rv&&delete s.rv;var a="msie";r.browser=a,s[a]=!0}if(s.edge){delete s.edge;var u="msedge";r.browser=u,s[u]=!0}if(s.opr){var d="opera";r.browser=d,s[d]=!0}if(s.safari&&s.android){var h="android";r.browser=h,s[h]=!0}s.name=r.browser,s.platform=r.platform;for(var l in n)n.hasOwnProperty(l)&&delete n[l];Object.assign(n,s)}t.__esModule=!0;var n={};i(),t["default"]=n,e.exports=t["default"]},,,,,,function(e,t){"use strict";t.__esModule=!0;var i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};t["default"]=i,e.exports=t["default"]},,,,,,function(e,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var n=function(){function e(){i(this,e),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){var e=this.hasAudio===!1||this.hasAudio===!0&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=this.hasVideo===!1||this.hasVideo===!0&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t},e.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}},e.prototype._search=function(e,t){var i=0,n=e.length-1,r=0,s=0,o=n;for(t=e[r]&&t0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){d["default"].emitter.addListener("log",t),d["default"].emitter.listenerCount("log")>0&&(d["default"].ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){d["default"].emitter.removeListener("log",t),0===d["default"].emitter.listenerCount("log")&&(d["default"].ENABLE_CALLBACK=!1,e._notifyChange())},s(e,null,[{key:"forceGlobalTag",get:function(){return d["default"].FORCE_GLOBAL_TAG},set:function(t){d["default"].FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return d["default"].GLOBAL_TAG},set:function(t){d["default"].GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return d["default"].ENABLE_VERBOSE&&d["default"].ENABLE_DEBUG&&d["default"].ENABLE_INFO&&d["default"].ENABLE_WARN&&d["default"].ENABLE_ERROR},set:function(t){d["default"].ENABLE_VERBOSE=t,d["default"].ENABLE_DEBUG=t,d["default"].ENABLE_INFO=t,d["default"].ENABLE_WARN=t,d["default"].ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return d["default"].ENABLE_DEBUG},set:function(t){d["default"].ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return d["default"].ENABLE_VERBOSE},set:function(t){d["default"].ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return d["default"].ENABLE_INFO},set:function(t){d["default"].ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return d["default"].ENABLE_WARN},set:function(t){d["default"].ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return d["default"].ENABLE_ERROR},set:function(t){d["default"].ENABLE_ERROR=t,e._notifyChange()}}]),e}();h.emitter=new a["default"],t["default"]=h,e.exports=t["default"]},,,,,,,,,,,,,,function(e,t){"use strict";function i(){return Object.assign({},n)}t.__esModule=!0,t.createDefaultConfig=i;var n=t.defaultConfig={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,customLoader:void 0}},function(e,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var n=function(){function e(e,t){for(var i=0;i0&&e[0].originalDts=t[r].dts&&et[n].lastSample.originalDts&&e=t[n].lastSample.originalDts&&(n===t.length-1||n0&&(r=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,i)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},n(e,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}}]),e}()},function(e,t){"use strict";t.__esModule=!0;var i={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};t["default"]=i,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=i(17),o=n(s),a=i(5),u=n(a),d=i(18),h=n(d),l=i(30),f=n(l),c=i(93),_=n(c),p=i(106),m=n(p),g=i(31),v=n(g),y=i(51),E=n(y),S=i(24),b=n(S),L=(i(12),function(){function e(t,i){r(this,e),this.TAG="TransmuxingController",this._emitter=new o["default"],this._config=i,t.segments||(t.segments=[{duration:t.duration,filesize:t.filesize,url:t.url}]),"boolean"!=typeof t.cors&&(t.cors=!0),"boolean"!=typeof t.withCredentials&&(t.withCredentials=!1),this._mediaDataSource=t,this._currentSegmentIndex=0;var n=0;this._mediaDataSource.segments.forEach(function(e){e.timestampBase=n,n+=e.duration,e.cors=t.cors,e.withCredentials=t.withCredentials,i.referrerPolicy&&(e.referrerPolicy=i.referrerPolicy)}),isNaN(n)||this._mediaDataSource.duration===n||(this._mediaDataSource.duration=n),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){this._currentSegmentIndex=e;var i=this._mediaDataSource.segments[e],n=this._ioctl=new E["default"](i,this._config,e);n.onError=this._onIOException.bind(this),n.onSeeked=this._onIOSeeked.bind(this),n.onComplete=this._onIOComplete.bind(this),n.onRedirect=this._onIORedirect.bind(this),n.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):n.onDataArrival=this._onInitChunkArrival.bind(this),n.open(t)},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var i=this._mediaInfo.segments[t];if(void 0==i)this._pendingSeekTime=e;else{var n=i.getNearestKeyframe(e);this._remuxer.seek(n.milliseconds),this._ioctl.seek(n.fileposition),this._pendingResolveSeekPoint=n.milliseconds}}else{var r=this._mediaInfo.segments[t];if(void 0==r)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{var s=r.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,s.fileposition),this._pendingResolveSeekPoint=s.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){for(var t=this._mediaDataSource.segments,i=t.length-1,n=0;n0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((n=_["default"].probe(e)).match){this._demuxer=new _["default"](n,this._config),this._remuxer||(this._remuxer=new m["default"](this._config));var s=this._mediaDataSource;void 0==s.duration||isNaN(s.duration)||(this._demuxer.overridedDuration=s.duration),"boolean"==typeof s.hasAudio&&(this._demuxer.overridedHasAudio=s.hasAudio),"boolean"==typeof s.hasVideo&&(this._demuxer.overridedHasVideo=s.hasVideo),this._demuxer.timestampBase=s.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),r=this._demuxer.parseChunks(e,t)}else n=null,u["default"].e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){i._internalAbort()}),this._emitter.emit(b["default"].DEMUX_ERROR,v["default"].FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r},e.prototype._onMediaInfo=function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,f["default"].prototype));var i=Object.assign({},e);Object.setPrototypeOf(i,f["default"].prototype),this._mediaInfo.segments[this._currentSegmentIndex]=i,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then(function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)})},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(b["default"].METADATA_ARRIVED,e)},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e,i=t+1;i0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(b["default"].RECOMMEND_SEEKPOINT,n)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t=this._mediaInfo.segments[e],i=Object.assign({},t);i.duration=this._mediaInfo.duration,i.segmentCount=this._mediaInfo.segmentCount,delete i.segments,delete i.keyframesIndex,this._emitter.emit(b["default"].MEDIA_INFO,i)},e.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(b["default"].STATISTICS_INFO,e)},e}());t["default"]=L,e.exports=t["default"]},function(e,t,i){"use strict";e.exports=i(95)["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=function(){function e(e,t){for(var i=0;i0&&(this._stashInitialSize=i.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,i.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new d["default"],this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},e.prototype.isPaused=function(){return this._paused},e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new S["default"](this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new L["default"](t,i)}else{if("custom"!==e.seekType)throw new R.InvalidArgumentException("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new R.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=y["default"];else if(f["default"].isSupported())this._loaderClass=f["default"];else if(_["default"].isSupported())this._loaderClass=_["default"];else{if(!g["default"].isSupported())throw new R.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=g["default"]}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this), this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},e.prototype.open=function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var i={from:e,to:-1};this._currentRange={from:i.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,i),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new R.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+10485760){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed),r=new Uint8Array(i,0,t);r.set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,r=0,s=i;if(e=t[n]&&e=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize0){var a=this._stashBuffer.slice(0,this._stashUsed),u=this._dispatchChunks(a,this._stashByteStart);if(u0){var d=new Uint8Array(a,u);o.set(d,0),this._stashUsed=d.byteLength,this._stashByteStart+=u}}else this._stashUsed=0,this._stashByteStart+=u;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),o=new Uint8Array(this._stashBuffer,0,this._bufferSize)),o.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var h=this._dispatchChunks(e,t);if(hthis._bufferSize&&(this._expandBuffer(l),o=new Uint8Array(this._stashBuffer,0,this._bufferSize)),o.set(new Uint8Array(e,h),0),this._stashUsed+=l,this._stashByteStart=t+h}}}else if(0===this._stashUsed){var f=this._dispatchChunks(e,t);if(fthis._bufferSize&&this._expandBuffer(c);var _=new Uint8Array(this._stashBuffer,0,this._bufferSize);_.set(new Uint8Array(e,f),0),this._stashUsed+=c,this._stashByteStart=t+f}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var p=new Uint8Array(this._stashBuffer,0,this._bufferSize);p.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var m=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(m0){var g=new Uint8Array(this._stashBuffer,m);p.set(g,0)}this._stashUsed-=m,this._stashByteStart+=m}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-i;if(i0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),s=new Uint8Array(t,i);r.set(s,0),this._stashUsed=s.byteLength,this._stashByteStart+=i}return 0}a["default"].w(this.TAG,n+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,n}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(a["default"].e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=h.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case h.LoaderErrors.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var i=this._currentRange.to+1;return void(i=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}();t["default"]=r,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0,t.ErrorDetails=t.ErrorTypes=void 0;var r=i(12),s=i(31),o=n(s);t.ErrorTypes={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},t.ErrorDetails={NETWORK_EXCEPTION:r.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:r.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:r.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:r.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:o["default"].FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:o["default"].FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:o["default"].CODEC_UNSUPPORTED}},function(e,t){"use strict";t.__esModule=!0;var i={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",STATISTICS_INFO:"statistics_info"};t["default"]=i,e.exports=t["default"]},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i0&&(n+=";codecs="+i.codec);var r=!1;if(u["default"].v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])u["default"].v(this.TAG,"Notice: "+i.type+" mimeType changed, origin: "+this._mimeTypes[i.type]+", target: "+n);else{r=!0;try{var s=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);s.addEventListener("error",this.e.onSourceBufferError),s.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(o){return u["default"].e(this.TAG,o.message),void this._emitter.emit(f["default"].ERROR,{code:o.code,msg:o.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),r||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),h["default"].safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var i=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{i.abort()}catch(n){u["default"].e(this.TAG,n.message)}this._idrList.clear();var r=this._pendingSegments[t];if(r.splice(0,r.length),"closed"!==this._mediaSource.readyState){for(var s=0;s=1&&e-n.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var i=this._sourceBuffers[t];if(i){for(var n=i.buffered,r=!1,s=0;s=this._config.autoCleanupMaxBackwardDuration){r=!0;var u=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:o,end:u})}}else a0&&(isNaN(t)||i>t)&&(u["default"].v(this.TAG,"Update MediaSource duration from "+t+" to "+i),this._mediaSource.duration=i),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];i.length&&!t.updating;){var n=i.shift();t.remove(n.start,n.end)}},e.prototype._doAppendSegments=function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var i=e[t].shift();if(i.timestampOffset){var n=this._sourceBuffers[t].timestampOffset,r=i.timestampOffset/1e3,s=Math.abs(n-r);s>.1&&(u["default"].v(this.TAG,"Update MPEG audio timestampOffset from "+n+" to "+r),this._sourceBuffers[t].timestampOffset=r),delete i.timestampOffset}if(!i.data||0===i.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(i.data),this._isBufferFull=!1,"video"===t&&i.hasOwnProperty("info")&&this._idrList.appendArray(i.info.syncPoints)}catch(o){this._pendingSegments[t].unshift(i),22===o.code?(this._isBufferFull||this._emitter.emit(f["default"].BUFFER_FULL),this._isBufferFull=!0):(u["default"].e(this.TAG,o.message),this._emitter.emit(f["default"].ERROR,{code:o.code,msg:o.message}))}}},e.prototype._onSourceOpen=function(){if(u["default"].v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(f["default"].SOURCE_OPEN)},e.prototype._onSourceEnded=function(){u["default"].v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){u["default"].v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(f["default"].UPDATE_END)},e.prototype._onSourceBufferError=function(e){u["default"].e(this.TAG,"SourceBuffer Error: "+e)},e}();t["default"]=p,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=i(17),o=n(s),a=i(5),u=n(a),d=i(32),h=n(d),l=i(49),f=n(l),c=i(24),_=n(c),p=i(90),m=n(p),g=i(30),v=n(g),y=function(){function e(t,n){if(r(this,e),this.TAG="Transmuxer",this._emitter=new o["default"],n.enableWorker&&"undefined"!=typeof Worker)try{var s=i(165);this._worker=s(m["default"]),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[t,n]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},h["default"].registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:h["default"].getConfig()})}catch(a){u["default"].e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new f["default"](t,n)}else this._controller=new f["default"](t,n);if(this._controller){var d=this._controller;d.on(_["default"].IO_ERROR,this._onIOError.bind(this)),d.on(_["default"].DEMUX_ERROR,this._onDemuxError.bind(this)),d.on(_["default"].INIT_SEGMENT,this._onInitSegment.bind(this)),d.on(_["default"].MEDIA_SEGMENT,this._onMediaSegment.bind(this)),d.on(_["default"].LOADING_COMPLETE,this._onLoadingComplete.bind(this)),d.on(_["default"].RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),d.on(_["default"].MEDIA_INFO,this._onMediaInfo.bind(this)),d.on(_["default"].METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),d.on(_["default"].STATISTICS_INFO,this._onStatisticsInfo.bind(this)),d.on(_["default"].RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),h["default"].removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},e.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},e.prototype.seek=function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)},e.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},e.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(_["default"].INIT_SEGMENT,e,t)})},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(_["default"].MEDIA_SEGMENT,e,t)})},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then(function(){e._emitter.emit(_["default"].LOADING_COMPLETE)})},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then(function(){e._emitter.emit(_["default"].RECOVERED_EARLY_EOF)})},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(_["default"].MEDIA_INFO,e)})},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(_["default"].METADATA_ARRIVED,e)})},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(_["default"].STATISTICS_INFO,e)})},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(_["default"].IO_ERROR,e,t)})},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(_["default"].DEMUX_ERROR,e,t)})},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(_["default"].RECOMMEND_SEEKPOINT,e)})},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case _["default"].INIT_SEGMENT:case _["default"].MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case _["default"].LOADING_COMPLETE:case _["default"].RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case _["default"].MEDIA_INFO:Object.setPrototypeOf(i,v["default"].prototype),this._emitter.emit(t.msg,i);break;case _["default"].METADATA_ARRIVED:case _["default"].STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case _["default"].IO_ERROR:case _["default"].DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case _["default"].RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":u["default"].emitter.emit("log",i.type,i.logcat)}},e}();t["default"]=y,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var r=i(5),s=(n(r),i(32)),o=n(s),a=i(55),u=n(a),d=i(49),h=n(d),l=i(24),f=n(l),c=function(e){function t(t,i){var n={msg:f["default"].INIT_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function i(t,i){var n={msg:f["default"].MEDIA_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function n(){var t={msg:f["default"].LOADING_COMPLETE};e.postMessage(t)}function r(){var t={msg:f["default"].RECOVERED_EARLY_EOF};e.postMessage(t)}function s(t){var i={msg:f["default"].MEDIA_INFO,data:t};e.postMessage(i)}function a(t){var i={msg:f["default"].METADATA_ARRIVED,data:t};e.postMessage(i)}function d(t){var i={msg:f["default"].STATISTICS_INFO,data:t};e.postMessage(i)}function l(t,i){e.postMessage({msg:f["default"].IO_ERROR,data:{type:t,info:i}})}function c(t,i){e.postMessage({msg:f["default"].DEMUX_ERROR,data:{type:t,info:i}})}function _(t){e.postMessage({msg:f["default"].RECOMMEND_SEEKPOINT,data:t})}function p(t,i){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:i}})}var m=null,g=p.bind(this);u["default"].install(),e.addEventListener("message",function(u){switch(u.data.cmd){case"init":m=new h["default"](u.data.param[0],u.data.param[1]),m.on(f["default"].IO_ERROR,l.bind(this)),m.on(f["default"].DEMUX_ERROR,c.bind(this)),m.on(f["default"].INIT_SEGMENT,t.bind(this)),m.on(f["default"].MEDIA_SEGMENT,i.bind(this)),m.on(f["default"].LOADING_COMPLETE,n.bind(this)),m.on(f["default"].RECOVERED_EARLY_EOF,r.bind(this)),m.on(f["default"].MEDIA_INFO,s.bind(this)),m.on(f["default"].METADATA_ARRIVED,a.bind(this)),m.on(f["default"].STATISTICS_INFO,d.bind(this)),m.on(f["default"].RECOMMEND_SEEKPOINT,_.bind(this));break;case"destroy":m&&(m.destroy(),m=null),e.postMessage({msg:"destroyed"});break;case"start":m.start();break;case"stop":m.stop();break;case"seek":m.seek(u.data.param);break;case"pause":m.pause();break;case"resume":m.resume();break;case"logging_config":var p=u.data.param;o["default"].applyConfig(p),p.enableCallback===!0?o["default"].addLogListener(g):o["default"].removeLogListener(g)}})};t["default"]=c,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=i(5),o=n(s),a=i(107),u=n(a),d=i(6),h=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),l=function(){function e(){r(this,e)}return e.parseScriptData=function(t,i,n){var r={};try{var s=e.parseValue(t,i,n),a=e.parseValue(t,i+s.size,n-s.size);r[s.data]=a.data}catch(u){o["default"].e("AMF",u.toString())}return r},e.parseObject=function(t,i,n){if(n<3)throw new d.IllegalStateException("Data not enough when parse ScriptDataObject");var r=e.parseString(t,i,n),s=e.parseValue(t,i+r.size,n-r.size),o=s.objectEnd;return{data:{name:r.data,value:s.data},size:r.size+s.size,objectEnd:o}},e.parseVariable=function(t,i,n){return e.parseObject(t,i,n)},e.parseString=function(e,t,i){if(i<2)throw new d.IllegalStateException("Data not enough when parse String");var n=new DataView(e,t,i),r=n.getUint16(0,!h),s=void 0;return s=r>0?(0,u["default"])(new Uint8Array(e,t+2,r)):"",{data:s,size:2+r}},e.parseLongString=function(e,t,i){if(i<4)throw new d.IllegalStateException("Data not enough when parse LongString");var n=new DataView(e,t,i),r=n.getUint32(0,!h),s=void 0;return s=r>0?(0,u["default"])(new Uint8Array(e,t+4,r)):"",{data:s,size:4+r}},e.parseDate=function(e,t,i){if(i<10)throw new d.IllegalStateException("Data size invalid when parse Date");var n=new DataView(e,t,i),r=n.getFloat64(0,!h),s=n.getInt16(8,!h);return r+=60*s*1e3,{data:new Date(r),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new d.IllegalStateException("Data not enough when parse Value");var r=new DataView(t,i,n),s=1,a=r.getUint8(0),u=void 0,l=!1;try{switch(a){case 0:u=r.getFloat64(1,!h),s+=8;break;case 1:var f=r.getUint8(1);u=!!f,s+=1;break;case 2:var c=e.parseString(t,i+1,n-1);u=c.data,s+=c.size;break;case 3:u={};var _=0;for(9===(16777215&r.getUint32(n-4,!h))&&(_=3);s32)throw new r.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var n=e-this._current_word_bits_left;this._fillCurrentWord();var s=Math.min(n,this._current_word_bits_left),o=this._current_word>>>32-s;return this._current_word<<=s,this._current_word_bits_left-=s,i=i<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}();t["default"]=s,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}t.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var i=0;i>>2!==0,r=0!==(1&t[4]),o=s(t,5);return o<9?i:{match:!0,consumed:o,dataOffset:o,hasAudioTrack:n,hasVideoTrack:r}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},e.prototype.resetMediaInfo=function(){this._mediaInfo=new g["default"]},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,i){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new v.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0,r=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;var s=e.probe(t);n=s.dataOffset}if(this._firstParse){this._firstParse=!1,i+n!==this._dataOffset&&d["default"].w(this.TAG,"First time parsing but chunk byteStart invalid!");var o=new DataView(t,n),a=o.getUint32(0,!r);0!==a&&d["default"].w(this.TAG,"PrevTagSize0 !== 0 !!!"),n+=4}for(;nt.byteLength)break;var h=u.getUint8(0),l=16777215&u.getUint32(0,!r);if(n+11+l+4>t.byteLength)break;if(8===h||9===h||18===h){var f=u.getUint8(4),c=u.getUint8(5),_=u.getUint8(6),p=u.getUint8(7),m=_|c<<8|f<<16|p<<24,g=16777215&u.getUint32(7,!r);0!==g&&d["default"].w(this.TAG,"Meet tag which has StreamID != 0!");var y=n+11;switch(h){case 8:this._parseAudioData(t,y,l,m);break;case 9:this._parseVideoData(t,y,l,m,i+n);break;case 18:this._parseScriptData(t,y,l)}var E=u.getUint32(11+l,!r);E!==11+l&&d["default"].w(this.TAG,"Invalid PrevTagSize "+E),n+=11+l+4}else d["default"].w(this.TAG,"Unsupported tag type "+h+", skipped"),n+=11+l+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),n},e.prototype._parseScriptData=function(e,t,i){var n=l["default"].parseScriptData(e,t,i);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!==o(n.onMetaData))return void d["default"].w(this.TAG,"Invalid onMetaData structure!");this._metadata&&d["default"].w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var r=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},r)),"boolean"==typeof r.hasAudio&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=r.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof r.hasVideo&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=r.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof r.audiodatarate&&(this._mediaInfo.audioDataRate=r.audiodatarate),"number"==typeof r.videodatarate&&(this._mediaInfo.videoDataRate=r.videodatarate),"number"==typeof r.width&&(this._mediaInfo.width=r.width),"number"==typeof r.height&&(this._mediaInfo.height=r.height),"number"==typeof r.duration){if(!this._durationOverrided){var s=Math.floor(r.duration*this._timescale);this._duration=s,this._mediaInfo.duration=s}}else this._mediaInfo.duration=0;if("number"==typeof r.framerate){var a=Math.floor(1e3*r.framerate);if(a>0){var u=a/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=u,this._referenceFrameRate.fps_num=a,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=u}}if("object"===o(r.keyframes)){this._mediaInfo.hasKeyframesIndex=!0;var h=r.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(h),r.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=r,d["default"].v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],n=1;n>>4;if(2!==o&&10!==o)return void this._onError(p["default"].CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+o);var a=0,u=(12&s)>>>2;if(!(u>=0&&u<=4))return void this._onError(p["default"].FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+u);a=this._flvSoundRateTable[u];var h=1&s,l=this._audioMetadata,f=this._audioTrack;if(l||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),l=this._audioMetadata={},l.type="audio",l.id=f.id,l.timescale=this._timescale,l.duration=this._duration,l.audioSampleRate=a,l.channelCount=0===h?1:2),10===o){var c=this._parseAACAudioData(e,t+1,i-1);if(void 0==c)return;if(0===c.packetType){l.config&&d["default"].w(this.TAG,"Found another AudioSpecificConfig!");var _=c.data;l.audioSampleRate=_.samplingRate,l.channelCount=_.channelCount,l.codec=_.codec,l.originalCodec=_.originalCodec,l.config=_.config,l.refSampleDuration=1024/l.audioSampleRate*l.timescale,d["default"].v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",l);var m=this._mediaInfo;m.audioCodec=l.originalCodec,m.audioSampleRate=l.audioSampleRate,m.audioChannelCount=l.channelCount,m.hasVideo?null!=m.videoCodec&&(m.mimeType='video/x-flv; codecs="'+m.videoCodec+","+m.audioCodec+'"'):m.mimeType='video/x-flv; codecs="'+m.audioCodec+'"',m.isComplete()&&this._onMediaInfo(m)}else if(1===c.packetType){var g=this._timestampBase+n,v={unit:c.data,length:c.data.byteLength,dts:g,pts:g};f.samples.push(v),f.length+=c.data.length}else d["default"].e(this.TAG,"Flv: Unsupported AAC data type "+c.packetType)}else if(2===o){if(!l.codec){var y=this._parseMP3AudioData(e,t+1,i-1,!0);if(void 0==y)return;l.audioSampleRate=y.samplingRate,l.channelCount=y.channelCount,l.codec=y.codec,l.originalCodec=y.originalCodec,l.refSampleDuration=1152/l.audioSampleRate*l.timescale,d["default"].v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",l);var E=this._mediaInfo;E.audioCodec=l.codec,E.audioSampleRate=l.audioSampleRate,E.audioChannelCount=l.channelCount,E.audioDataRate=y.bitRate,E.hasVideo?null!=E.videoCodec&&(E.mimeType='video/x-flv; codecs="'+E.videoCodec+","+E.audioCodec+'"'):E.mimeType='video/x-flv; codecs="'+E.audioCodec+'"',E.isComplete()&&this._onMediaInfo(E)}var S=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0==S)return;var b=this._timestampBase+n,L={unit:S,length:S.byteLength,dts:b,pts:b};f.samples.push(L),f.length+=S.length}}},e.prototype._parseAACAudioData=function(e,t,i){if(i<=1)return void d["default"].w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");var n={},r=new Uint8Array(e,t,i);return n.packetType=r[0],0===r[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=r.subarray(1),n},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n=new Uint8Array(e,t,i),r=null,s=0,o=0,a=null,u=0,d=null;if(s=o=n[0]>>>3,u=(7&n[0])<<1|n[1]>>>7,u<0||u>=this._mpegSamplingRates.length)return void this._onError(p["default"].FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");var h=this._mpegSamplingRates[u],l=(120&n[1])>>>3;if(l<0||l>=8)return void this._onError(p["default"].FORMAT_ERROR,"Flv: AAC invalid channel configuration");5===s&&(d=(7&n[1])<<1|n[2]>>>7,a=(124&n[2])>>>2);var f=self.navigator.userAgent.toLowerCase();return f.indexOf("firefox")!==-1?u>=6?(s=5,r=new Array(4),d=u-3):(s=2,r=new Array(2),d=u):f.indexOf("android")!==-1?(s=2,r=new Array(2),d=u):(s=5,d=u,r=new Array(4),u>=6?d=u-3:1===l&&(s=2,r=new Array(2),d=u)),r[0]=s<<3,r[0]|=(15&u)>>>1,r[1]=(15&u)<<7,r[1]|=(15&l)<<3,5===s&&(r[1]|=(15&d)>>>1,r[2]=(1&d)<<7,r[2]|=8,r[3]=0),{config:r,samplingRate:h,channelCount:l,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+o}},e.prototype._parseMP3AudioData=function(e,t,i,n){if(i<4)return void d["default"].w(this.TAG,"Flv: Invalid MP3 packet, header missing!");var r=(this._littleEndian,new Uint8Array(e,t,i)),s=null;if(n){if(255!==r[0])return;var o=r[1]>>>3&3,a=(6&r[1])>>1,u=(240&r[2])>>>4,h=(12&r[2])>>>2,l=r[3]>>>6&3,f=3!==l?2:1,c=0,_=0,p=34,m="mp3";switch(o){case 0:c=this._mpegAudioV25SampleRateTable[h];break;case 2:c=this._mpegAudioV20SampleRateTable[h];break;case 3:c=this._mpegAudioV10SampleRateTable[h]}switch(a){case 1:p=34,u>>4,a=15&s;return 7!==a?void this._onError(p["default"].CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+a):void this._parseAVCVideoPacket(e,t+1,i-1,n,r,o)}},e.prototype._parseAVCVideoPacket=function(e,t,i,n,r,s){if(i<4)return void d["default"].w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");var o=this._littleEndian,a=new DataView(e,t,i),u=a.getUint8(0),h=16777215&a.getUint32(0,!o),l=h<<8>>8;if(0===u)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===u)this._parseAVCVideoData(e,t+4,i-4,n,r,s,l);else if(2!==u)return void this._onError(p["default"].FORMAT_ERROR,"Flv: Invalid video packet type "+u)},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){if(i<7)return void d["default"].w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");var n=this._videoMetadata,r=this._videoTrack,s=this._littleEndian,o=new DataView(e,t,i);n?"undefined"!=typeof n.avcc&&d["default"].w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),n=this._videoMetadata={},n.type="video",n.id=r.id,n.timescale=this._timescale,n.duration=this._duration);var a=o.getUint8(0),u=o.getUint8(1);o.getUint8(2),o.getUint8(3);if(1!==a||0===u)return void this._onError(p["default"].FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");if(this._naluLengthSize=(3&o.getUint8(4))+1,3!==this._naluLengthSize&&4!==this._naluLengthSize)return void this._onError(p["default"].FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));var h=31&o.getUint8(5);if(0===h)return void this._onError(p["default"].FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");h>1&&d["default"].w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+h);for(var l=6,f=0;f1&&d["default"].w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+A),l++;for(var w=0;w=i){d["default"].w(this.TAG,"Malformed Nalu near timestamp "+_+", offset = "+f+", dataSize = "+i);break}var m=u.getUint32(f,!a);if(3===c&&(m>>>=8),m>i-c)return void d["default"].w(this.TAG,"Malformed Nalus near timestamp "+_+", NaluSize > DataSize!");var g=31&u.getUint8(f+c);5===g&&(p=!0);var v=new Uint8Array(e,t+f,c+m),y={type:g,data:v};h.push(y),l+=v.byteLength,f+=c+m}if(h.length){var E=this._videoTrack,S={units:h,length:l,isKeyframe:p,dts:_,cts:o,pts:_+o};p&&(S.fileposition=r),E.samples.push(S),E.length+=l}},a(e,[{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}},{key:"overridedHasAudio",set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}},{key:"overridedHasVideo",set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}}]),e}();t["default"]=y,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=i(92),o=n(s),a=function(){function e(){r(this,e)}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,s=0;s=2&&3===t[s]&&0===t[s-1]&&0===t[s-2]||(n[r]=t[s],r++);return new Uint8Array(n.buffer,0,r)},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),n=new o["default"](i);n.readByte();var r=n.readByte();n.readByte();var s=n.readByte();n.readUEG();var a=e.getProfileString(r),u=e.getLevelString(s),d=1,h=420,l=[0,420,422,444],f=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(d=n.readUEG(),3===d&&n.readBits(1),d<=3&&(h=l[d]),f=n.readUEG()+8,n.readUEG(),n.readBits(1),n.readBool()))for(var c=3!==d?8:12,_=0;_0&&x<16?(k=B[x-1],T=U[x-1]):255===x&&(k=n.readByte()<<8|n.readByte(),T=n.readByte()<<8|n.readByte())}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(4),n.readBool()&&n.readBits(24)),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool()){var N=n.readBits(32),P=n.readBits(32);O=n.readBool(),I=P,M=2*N,C=I/M}}var F=1;1===k&&1===T||(F=k/T);var G=0,V=0;if(0===d)G=1,V=2-S;else{var z=3===d?1:2,j=1===d?2:1;G=z,V=j*(2-S)}var K=16*(y+1),H=(2-S)*(16*(E+1));K-=(b+L)*G,H-=(R+A)*V;var q=Math.ceil(K*F);return n.destroy(),n=null,{profile_string:a,level_string:u,bit_depth:f,ref_frames:v,chroma_format:h,chroma_format_string:e.getChromaFormatString(h),frame_rate:{fixed:O,fps:C,fps_den:M,fps_num:I},sar_ratio:{width:k,height:T},codec_size:{width:K,height:H},present_size:{width:q,height:H}}},e._skipScalingList=function(e,t){for(var i=8,n=8,r=0,s=0;s=15048,t=!h["default"].msedge||e;return self.fetch&&self.ReadableStream&&t}catch(i){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(n=e.redirectedURL);var r=this._seekHandler.getConfig(n,t),s=new self.Headers;if("object"===a(r.headers)){var o=r.headers;for(var u in o)o.hasOwnProperty(u)&&s.append(u,o[u])}var d={method:"GET",headers:s,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};e.cors===!1&&(d.mode="same-origin"),e.withCredentials&&(d.credentials="include"),e.referrerPolicy&&(d.referrerPolicy=e.referrerPolicy),this._status=l.LoaderStatus.kConnecting,self.fetch(r.url,d).then(function(e){if(i._requestAbort)return i._requestAbort=!1,void(i._status=l.LoaderStatus.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==r.url&&i._onURLRedirect){var t=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(t)}var n=e.headers.get("Content-Length");return null!=n&&(i._contentLength=parseInt(n),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,e.body.getReader())}if(i._status=l.LoaderStatus.kError,!i._onError)throw new f.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(l.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})["catch"](function(e){if(i._status=l.LoaderStatus.kError,!i._onError)throw e;i._onError(l.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})})},t.prototype.abort=function(){this._requestAbort=!0},t.prototype._pump=function(e){var t=this;return e.read().then(function(i){if(i.done)if(null!==t._contentLength&&t._receivedLength0)for(var s=i.split("&"),o=0;o0;a[0]!==this._startName&&a[0]!==this._endName&&(u&&(r+="&"),r+=s[o])}return 0===r.length?t:t+"?"+r},e}();t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var n=function(){function e(t){i(this,e),this._zeroStart=t||!1}return e.prototype.getConfig=function(e,t){var i={};if(0!==t.from||t.to!==-1){var n=void 0;n=t.to!==-1?"bytes="+t.from.toString()+"-"+t.to.toString():"bytes="+t.from.toString()+"-",i.Range=n}else this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}},e.prototype.removeURLParameters=function(e){return e},e}();t["default"]=n,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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}function o(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.__esModule=!0;var a=i(5),u=(n(a),i(12)),d=i(6),h=function(e){function t(){r(this,t);var i=s(this,e.call(this,"websocket-loader"));return i.TAG="WebSocketLoader",i._needStash=!0,i._ws=null,i._requestAbort=!1,i._receivedLength=0,i}return o(t,e),t.isSupported=function(){try{return"undefined"!=typeof self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=u.LoaderStatus.kConnecting}catch(i){this._status=u.LoaderStatus.kError;var n={code:i.code,msg:i.message};if(!this._onError)throw new d.RuntimeException(n.msg);this._onError(u.LoaderErrors.EXCEPTION,n)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=u.LoaderStatus.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=u.LoaderStatus.kBuffering},t.prototype._onWebSocketClose=function(e){return this._requestAbort===!0?void(this._requestAbort=!1):(this._status=u.LoaderStatus.kComplete,void(this._onComplete&&this._onComplete(0,this._receivedLength-1)))},t.prototype._onWebSocketMessage=function(e){ var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var i=new FileReader;i.onload=function(){t._dispatchArrayBuffer(i.result)},i.readAsArrayBuffer(e.data)}else{this._status=u.LoaderStatus.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new d.RuntimeException(n.msg);this._onError(u.LoaderErrors.EXCEPTION,n)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=u.LoaderStatus.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new d.RuntimeException(t.msg);this._onError(u.LoaderErrors.EXCEPTION,t)},t}(u.BaseLoader);t["default"]=h,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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}function o(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.__esModule=!0;var a="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},u=i(5),d=n(u),h=i(12),l=i(6),f=function(e){function t(i,n){r(this,t);var o=s(this,e.call(this,"xhr-moz-chunked-loader"));return o.TAG="MozChunkedLoader",o._seekHandler=i,o._config=n,o._needStash=!0,o._xhr=null,o._requestAbort=!1,o._contentLength=null,o._receivedLength=0,o}return o(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(t){return d["default"].w("MozChunkedLoader",t.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);var n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="moz-chunked-arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onloadend=this._onLoadEnd.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"===a(n.headers)){var s=n.headers;for(var o in s)s.hasOwnProperty(o)&&r.setRequestHeader(o,s[o])}this._status=h.LoaderStatus.kConnecting,r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=h.LoaderStatus.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var i=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(i)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=h.LoaderStatus.kError,!this._onError)throw new l.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=h.LoaderStatus.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==h.LoaderStatus.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}},t.prototype._onLoadEnd=function(e){return this._requestAbort===!0?void(this._requestAbort=!1):void(this._status!==h.LoaderStatus.kError&&(this._status=h.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)))},t.prototype._onXhrError=function(e){this._status=h.LoaderStatus.kError;var t=0,i=null;if(this._contentLength&&e.loaded=200&&t.status<=299){if(this._status=h.LoaderStatus.kBuffering,void 0!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}var n=t.getResponseHeader("Content-Length");if(null!=n&&null==this._contentLength){var r=parseInt(n);r>0&&(this._contentLength=r,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=h.LoaderStatus.kError,!this._onError)throw new l.RuntimeException("MSStreamLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else if(3===t.readyState&&t.status>=200&&t.status<=299){this._status=h.LoaderStatus.kBuffering;var s=t.response;this._reader.readAsArrayBuffer(s)}},t.prototype._xhrOnError=function(e){this._status=h.LoaderStatus.kError;var t=h.LoaderErrors.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type};if(!this._onError)throw new l.RuntimeException(i.msg);this._onError(t,i)},t.prototype._msrOnProgress=function(e){var t=e.target,i=t.result;if(null==i)return void this._doReconnectIfNeeded();var n=i.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=i.byteLength;var r=this._totalRange.from+this._receivedLength;this._receivedLength+=n.byteLength,this._onDataArrival&&this._onDataArrival(n,r,this._receivedLength),i.byteLength>=this._bufferLimit&&(d["default"].v(this.TAG,"MSStream buffer exceeded max size near "+(r+n.byteLength)+", reconnecting..."),this._doReconnectIfNeeded())},t.prototype._doReconnectIfNeeded=function(){if(null==this._contentLength||this._receivedLength=this._contentLength&&(i=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:i},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(void 0!=this._currentRedirectedURL?i=this._currentRedirectedURL:void 0!=e.redirectedURL&&(i=e.redirectedURL));var n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"===a(n.headers)){var s=n.headers;for(var o in s)s.hasOwnProperty(o)&&r.setRequestHeader(o,s[o])}r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=c.LoaderStatus.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=c.LoaderStatus.kBuffering}else{if(this._status=c.LoaderStatus.kError,!this._onError)throw new _.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(c.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==c.LoaderStatus.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var i=e.total;this._internalAbort(),null!=i&0!==i&&(this._totalLength=i)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var n=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(n)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,s=i;if(e=t[n]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var i=this._normalizeSpeed(t);this._currentSpeedNormalized!==i&&(this._currentSpeedNormalized=i,this._currentChunkSizeKB=i)}var n=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var s=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new m["default"](this._mediaDataSource,this._config),this._transmuxer.on(v["default"].INIT_SEGMENT,function(t,i){e._msectl.appendInitSegment(i)}),this._transmuxer.on(v["default"].MEDIA_SEGMENT,function(t,i){if(e._msectl.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var n=e._mediaElement.currentTime;i.info.endDts>=1e3*(n+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(h["default"].v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}}),this._transmuxer.on(v["default"].LOADING_COMPLETE,function(){e._msectl.endOfStream(),e._emitter.emit(_["default"].LOADING_COMPLETE)}),this._transmuxer.on(v["default"].RECOVERED_EARLY_EOF,function(){e._emitter.emit(_["default"].RECOVERED_EARLY_EOF)}),this._transmuxer.on(v["default"].IO_ERROR,function(t,i){e._emitter.emit(_["default"].ERROR,L.ErrorTypes.NETWORK_ERROR,t,i)}),this._transmuxer.on(v["default"].DEMUX_ERROR,function(t,i){e._emitter.emit(_["default"].ERROR,L.ErrorTypes.MEDIA_ERROR,t,{code:-1,msg:i})}),this._transmuxer.on(v["default"].MEDIA_INFO,function(t){e._mediaInfo=t,e._emitter.emit(_["default"].MEDIA_INFO,Object.assign({},t))}),this._transmuxer.on(v["default"].METADATA_ARRIVED,function(t){e._emitter.emit(_["default"].METADATA_ARRIVED,t)}),this._transmuxer.on(v["default"].STATISTICS_INFO,function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._config.isLive&&e._statisticsInfo&&(0===e._statisticsInfo.speed?e._emitter.emit("noLiveStream"):e._emitter.emit("alive")),e._emitter.emit(_["default"].STATISTICS_INFO,Object.assign({},e._statisticsInfo))}),this._transmuxer.on(v["default"].RECOMMEND_SEEKPOINT,function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)}),this._transmuxer.open()}},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype._onmseUpdateEnd=function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,i=0,n=0,r=0;r=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(h["default"].v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){h["default"].v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,i=!1,n=0;n=r&&e=s-this._config.lazyLoadRecoverDuration&&(i=!0);break}}i&&(window.clearInterval(this._progressChecker),this._progressChecker=null,i&&(h["default"].v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t=this._mediaElement.buffered,i=0;i=n&&e0){var r=this._mediaElement.buffered.start(0);(r<1&&e0&&t.currentTime0){var n=i.start(0);if(n<1&&t>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);for(var o=8,a=0;a>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,n=t.duration,r=t.presentWidth,s=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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,s>>>8&255,255&s,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,n=t.duration;return e.box(e.types.mdhd,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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},e.hdlr=function(t){var i=null;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i=null;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))},e.dinf=function(){var t=e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF));return t},e.stbl=function(t){var i=e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO));return i},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],r)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,r,e.esds(t))},e.esds=function(t){var i=t.config||[],n=i.length,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(i).concat([6,1,2]));return e.box(e.types.esds,r)},e.avc1=function(t){var i=t.avcc,n=t.codecWidth,r=t.codecHeight,s=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,n>>>8&255,255&n,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,s,e.box(e.types.avcC,i))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,n=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,n)},e.moof=function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))},e.mfhd=function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)},e.traf=function(t,i){var n=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),s=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),o=e.sdtp(t),a=e.trun(t,o.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,s,a,o)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,r=new Uint8Array(4+n),s=0;s>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var a=0;a>>24&255,u>>>16&255,u>>>8&255,255&u,d>>>24&255,d>>>16&255,d>>>8&255,255&d,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.isNonSync,0,0,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*a)}return e.box(e.types.trun,o)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();n.init(),t["default"]=n,e.exports=t["default"]},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var s=function(){function e(e,t){for(var i=0;i1&&(y=n.pop(),v-=y.length),null!=this._audioStashedLastSample){var E=this._audioStashedLastSample;this._audioStashedLastSample=null,n.unshift(E),v+=E.length}null!=y&&(this._audioStashedLastSample=y);var S=n[0].dts-this._dtsBase;if(this._audioNextDts)r=S-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())r=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(p=!0);else{var b=this._audioSegmentInfoList.getLastSampleBefore(S);if(null!=b){var L=S-(b.originalDts+b.duration);L<=3&&(L=0);var R=b.dts+b.duration+L;r=S-R}else r=0}if(p){var A=S-r,w=this._videoSegmentInfoList.getLastSegmentBefore(S);if(null!=w&&w.beginDts=1?O[O.length-1].duration:Math.floor(u);var F=!1,G=null;if(U>1.5*u&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!c["default"].safari){F=!0;var V=Math.abs(U-u),z=Math.ceil(V/u),j=B+u;a["default"].w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+("dts: "+(B+U)+" ms, expected: "+(B+Math.round(u))+" ms, ")+("delta: "+Math.round(V)+" ms, generate: "+z+" frames"));var K=l["default"].getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==K&&(a["default"].w(this.TAG,"Unable to generate silent frame for "+(this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame")),K=D),G=[];for(var H=0;H0){var W=G[G.length-1];W.duration=q-W.dts}var X={dts:q,pts:q,cts:0,unit:K,size:K.byteLength,duration:0,originalDts:x,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};G.push(X),v+=D.byteLength,j+=u}var Y=G[G.length-1];Y.duration=B+U-Y.dts,U=Math.round(u)}O.push({dts:B,pts:B,cts:0,unit:M.unit,size:M.unit.byteLength,duration:U,originalDts:x,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),F&&O.push.apply(O,G)}h?g=new Uint8Array(v):(g=new Uint8Array(v),g[0]=v>>>24&255,g[1]=v>>>16&255,g[2]=v>>>8&255,g[3]=255&v,g.set(d["default"].types.mdat,4));for(var Z=0;Z1&&(c=n.pop(),f-=c.length),null!=this._videoStashedLastSample){var p=this._videoStashedLastSample;this._videoStashedLastSample=null,n.unshift(p),f+=p.length}null!=c&&(this._videoStashedLastSample=c);var m=n[0].dts-this._dtsBase;if(this._videoNextDts)r=m-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())r=0;else{var g=this._videoSegmentInfoList.getLastSampleBefore(m);if(null!=g){var v=m-(g.originalDts+g.duration);v<=3&&(v=0);var y=g.dts+g.duration+v;r=m-y}else r=0}for(var E=new _.MediaSegmentInfo,S=[],b=0;b=1?S[S.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(A){var M=new _.SampleInfo(w,T,C,L.dts,(!0));M.fileposition=L.fileposition,E.appendSyncPoint(M)}S.push({dts:w,pts:T,cts:k,units:L.units,size:L.length,isKeyframe:A,duration:C,originalDts:R,flags:{isLeading:0,dependsOn:A?2:1,isDependedOn:A?1:0,hasRedundancy:0,isNonSync:A?0:1}})}l=new Uint8Array(f),l[0]=f>>>24&255,l[1]=f>>>16&255,l[2]=f>>>8&255,l[3]=255&f,l.set(d["default"].types.mdat,4);for(var D=0;D=128){t.push(String.fromCharCode(65535&o)),r+=2;continue}}}else if(n[r]<240){if(i(n,r,2)){var a=(15&n[r])<<12|(63&n[r+1])<<6|63&n[r+2];if(a>=2048&&55296!==(63488&a)){t.push(String.fromCharCode(65535&a)),r+=3;continue}}}else if(n[r]<248&&i(n,r,3)){var u=(7&n[r])<<18|(63&n[r+1])<<12|(63&n[r+2])<<6|63&n[r+3];if(u>65536&&u<1114112){u-=65536,t.push(String.fromCharCode(u>>>10|55296)),t.push(String.fromCharCode(1023&u|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){(function(t,n){/*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version 4.1.0 */ !function(t,i){e.exports=i()}(this,function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function s(e){Y=e}function o(e){Z=e}function a(){return function(){return t.nextTick(f)}}function u(){return"undefined"!=typeof X?function(){X(f)}:l()}function d(){var e=0,t=new $(f),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){i.data=e=++e%2}}function h(){var e=new MessageChannel;return e.port1.onmessage=f,function(){return e.port2.postMessage(0)}}function l(){var e=setTimeout;return function(){return e(f,1)}}function f(){for(var e=0;e1)for(var i=1;i