@alessmicrosystems/mpegts.js 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/d.ts/src/demux/ts-demuxer.d.ts +7 -0
- package/dist/mpegts.js +1 -1
- package/dist/mpegts.js.map +1 -1
- package/package.json +1 -1
- package/src/demux/ts-demuxer.ts +117 -6
- package/src/remux/mp4-remuxer.js +38 -8
package/dist/mpegts.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see mpegts.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mpegts=t():e.mpegts=t()}(self,()=>(()=>{var e={935(e,t,i){e.exports=function(){"use strict";function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=0,a=void 0,r=void 0,o=function(e,t){u[n]=e,u[n+1]=t,2===(n+=2)&&(r?r(p):y())};var s="undefined"!=typeof window?window:void 0,d=s||{},_=d.MutationObserver||d.WebKitMutationObserver,h="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),c="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var e=setTimeout;return function(){return e(p,1)}}var u=new Array(1e3);function p(){for(var e=0;e<n;e+=2)(0,u[e])(u[e+1]),u[e]=void 0,u[e+1]=void 0;n=0}var f,m,g,v,y=void 0;function A(e,t){var i=this,n=new this.constructor(E);void 0===n[b]&&x(n);var a=i._state;if(a){var r=arguments[a-1];o(function(){return P(a,n,r,i._result)})}else B(i,n,e,t);return n}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(E);return w(t,e),t}y=h?function(){return process.nextTick(p)}:_?(m=0,g=new _(p),v=document.createTextNode(""),g.observe(v,{characterData:!0}),function(){v.data=m=++m%2}):c?((f=new MessageChannel).port1.onmessage=p,function(){return f.port2.postMessage(0)}):void 0===s?function(){try{var e=Function("return this")().require("vertx");return void 0!==(a=e.runOnLoop||e.runOnContext)?function(){a(p)}:l()}catch(e){return l()}}():l();var b=Math.random().toString(36).substring(2);function E(){}var R=void 0,T=1,k=2;function L(t,i,n){i.constructor===t.constructor&&n===A&&i.constructor.resolve===S?function(e,t){t._state===T?D(e,t._result):t._state===k?M(e,t._result):B(t,void 0,function(t){return w(e,t)},function(t){return M(e,t)})}(t,i):void 0===n?D(t,i):e(n)?function(e,t,i){o(function(e){var n=!1,a=function(e,t,i,n){try{e.call(t,i,n)}catch(e){return e}}(i,t,function(i){n||(n=!0,t!==i?w(e,i):D(e,i))},function(t){n||(n=!0,M(e,t))},e._label);!n&&a&&(n=!0,M(e,a))},e)}(t,i,n):D(t,i)}function w(e,t){if(e===t)M(e,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=t),null===n||"object"!==a&&"function"!==a)D(e,t);else{var i=void 0;try{i=t.then}catch(t){return void M(e,t)}L(e,t,i)}var n,a}function C(e){e._onerror&&e._onerror(e._result),O(e)}function D(e,t){e._state===R&&(e._result=t,e._state=T,0!==e._subscribers.length&&o(O,e))}function M(e,t){e._state===R&&(e._state=k,e._result=t,o(C,e))}function B(e,t,i,n){var a=e._subscribers,r=a.length;e._onerror=null,a[r]=t,a[r+T]=i,a[r+k]=n,0===r&&e._state&&o(O,e)}function O(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var n=void 0,a=void 0,r=e._result,o=0;o<t.length;o+=3)n=t[o],a=t[o+i],n?P(i,n,a,r):a(r);e._subscribers.length=0}}function P(t,i,n,a){var r=e(n),o=void 0,s=void 0,d=!0;if(r){try{o=n(a)}catch(e){d=!1,s=e}if(i===o)return void M(i,new TypeError("A promises callback cannot return that same promise."))}else o=a;i._state!==R||(r&&d?w(i,o):!1===d?M(i,s):t===T?D(i,o):t===k&&M(i,o))}var I=0;function x(e){e[b]=I++,e._state=void 0,e._result=void 0,e._subscribers=[]}var U=function(){function e(e,i){this._instanceConstructor=e,this.promise=new e(E),this.promise[b]||x(this.promise),t(i)?(this.length=i.length,this._remaining=i.length,this._result=new Array(this.length),0===this.length?D(this.promise,this._result):(this.length=this.length||0,this._enumerate(i),0===this._remaining&&D(this.promise,this._result))):M(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===R&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===S){var a=void 0,r=void 0,o=!1;try{a=e.then}catch(e){o=!0,r=e}if(a===A&&e._state!==R)this._settledAt(e._state,t,e._result);else if("function"!=typeof a)this._remaining--,this._result[t]=e;else if(i===N){var s=new i(E);o?M(s,r):L(s,e,a),this._willSettleAt(s,t)}else this._willSettleAt(new i(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,i){var n=this.promise;n._state===R&&(this._remaining--,e===k?M(n,i):this._result[t]=i),0===this._remaining&&D(n,this._result)},e.prototype._willSettleAt=function(e,t){var i=this;B(e,void 0,function(e){return i._settledAt(T,t,e)},function(e){return i._settledAt(k,t,e)})},e}();var N=function(){function t(e){this[b]=I++,this._result=this._state=void 0,this._subscribers=[],E!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t(function(t){w(e,t)},function(t){M(e,t)})}catch(t){M(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var i=this,n=i.constructor;return e(t)?i.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})}):i.then(t,t)},t}();return N.prototype.then=A,N.all=function(e){return new U(this,e).promise},N.race=function(e){var i=this;return t(e)?new i(function(t,n){for(var a=e.length,r=0;r<a;r++)i.resolve(e[r]).then(t,n)}):new i(function(e,t){return t(new TypeError("You must pass an array to race."))})},N.resolve=S,N.reject=function(e){var t=new this(E);return M(t,e),t},N._setScheduler=function(e){r=e},N._setAsap=function(e){o=e},N._asap=o,N.polyfill=function(){var e=void 0;if(void 0!==i.g)e=i.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=N},N.Promise=N,N}()},402(e){"use strict";var t,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,e.exports.once=function(e,t){return new Promise(function(i,n){function a(i){e.removeListener(t,r),n(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",a),i([].slice.call(arguments))}f(e,t,r,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,a)})},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function _(e,t,i,n){var a,r,o,_;if(s(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),o=r[t]),void 0===o)o=r[t]=i,++e._eventsCount;else if("function"==typeof o?o=r[t]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(a=d(e))>0&&o.length>a&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,_=h,console&&console.warn&&console.warn(_)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},a=h.bind(n);return a.listener=i,n.wrapFn=a,a}function l(e,t,i){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?i?[a.listener||a]:[a]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(a):p(a,a.length)}function u(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function p(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function f(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function a(r){n.once&&e.removeEventListener(t,a),i(r)})}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return d(this)},r.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var a="error"===e,r=this._events;if(void 0!==r)a=a&&void 0===r.error;else if(!a)return!1;if(a){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var d=r[e];if(void 0===d)return!1;if("function"==typeof d)n(d,this,t);else{var _=d.length,h=p(d,_);for(i=0;i<_;++i)n(h[i],this,t)}return!0},r.prototype.addListener=function(e,t){return _(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return _(this,e,t,!0)},r.prototype.once=function(e,t){return s(t),this.on(e,c(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,c(this,e,t)),this},r.prototype.removeListener=function(e,t){var i,n,a,r,o;if(s(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(a=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){o=i[r].listener,a=r;break}if(a<0)return this;0===a?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,a),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var a,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(a=r[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},r.prototype.listeners=function(e){return l(this,e,!0)},r.prototype.rawListeners=function(e){return l(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):u.call(e,t)},r.prototype.listenerCount=u,r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},200(e,t,i){"use strict";i.d(t,{A:()=>n});const n=function(){function 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=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&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&&e&&t},e.prototype.isSeekable=function(){return!0===this.hasKeyframesIndex},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,a=0,r=0,o=n;for(t<e[0]&&(i=0,r=o+1);r<=o;){if((a=r+Math.floor((o-r)/2))===n||t>=e[a]&&t<e[a+1]){i=a;break}e[a]<t?r=a+1:o=a-1}return i},e}()},544(e,t,i){"use strict";i.d(t,{$_:()=>n,EX:()=>r,EZ:()=>a,Sc:()=>o});var n=function(e,t,i,n,a){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=a,this.fileposition=null},a=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),r=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0==this._list.length)return null;var t=this._list,i=0,n=t.length-1,a=0,r=0,o=n;for(e<t[0].dts&&(i=0,r=o+1);r<=o;){if((a=r+Math.floor((o-r)/2))===n||e>=t[a].dts&&e<t[a+1].dts){i=a;break}t[a].dts<e?r=a+1:o=a-1}return this._list[i]},e}(),o=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t=this._list;if(0===t.length)return-2;var i=t.length-1,n=0,a=0,r=i,o=0;if(e<t[0].originalBeginDts)return-1;for(;a<=r;){if((n=a+Math.floor((r-a)/2))===i||e>t[n].lastSample.originalDts&&e<t[n+1].originalBeginDts){o=n;break}t[n].originalBeginDts<e?a=n+1:r=n-1}return o},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t=this._list,i=e,n=this._lastAppendLocation,a=0;-1!==n&&n<t.length&&i.originalBeginDts>=t[n].lastSample.originalDts&&(n===t.length-1||n<t.length-1&&i.originalBeginDts<t[n+1].originalBeginDts)?a=n+1:t.length>0&&(a=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=a,this._list.splice(a,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},e}()},217(e,t,i){"use strict";i.d(t,{A:()=>_});var n=i(402),a=i.n(n),r=i(641),o=i(9),s=i(403),d=i(816);const _=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new(a()),this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onStartStreaming:this._onStartStreaming.bind(this),onEndStreaming:this._onEndStreaming.bind(this),onQualityChange:this._onQualityChange.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._useManagedMediaSource="ManagedMediaSource"in self&&!("MediaSource"in self),this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElementProxy=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]}}return e.prototype.destroy=function(){this._mediaSource&&this.shutdown(),this._mediaSourceObjectURL&&this.revokeObjectURL(),this.e=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.initialize=function(e){if(this._mediaSource)throw new d.j4("MediaSource has been attached to an HTMLMediaElement!");this._useManagedMediaSource&&r.A.v(this.TAG,"Using ManagedMediaSource");var t=this._mediaSource=this._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(t.addEventListener("startstreaming",this.e.onStartStreaming),t.addEventListener("endstreaming",this.e.onEndStreaming),t.addEventListener("qualitychange",this.e.onQualityChange)),this._mediaElementProxy=e},e.prototype.shutdown=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){r.A.e(this.TAG,e.message)}n.removeEventListener("error",this.e.onSourceBufferError),n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){r.A.e(this.TAG,e.message)}this._mediaElementProxy=null,e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(e.removeEventListener("startstreaming",this.e.onStartStreaming),e.removeEventListener("endstreaming",this.e.onEndStreaming),e.removeEventListener("qualitychange",this.e.onQualityChange)),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._mediaSource=null}},e.prototype.isManagedMediaSource=function(){return this._useManagedMediaSource},e.prototype.getObject=function(){if(!this._mediaSource)throw new d.j4("MediaSource has not been initialized yet!");return this._mediaSource},e.prototype.getHandle=function(){if(!this._mediaSource)throw new d.j4("MediaSource has not been initialized yet!");return this._mediaSource.handle},e.prototype.getObjectURL=function(){if(!this._mediaSource)throw new d.j4("MediaSource has not been initialized yet!");return null==this._mediaSourceObjectURL&&(this._mediaSourceObjectURL=URL.createObjectURL(this._mediaSource)),this._mediaSourceObjectURL},e.prototype.revokeObjectURL=function(){this._mediaSourceObjectURL&&(URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){if(void 0===t&&(t=void 0),!this._mediaSource||"open"!==this._mediaSource.readyState||!1===this._mediaSource.streaming)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var i=e,n="".concat(i.container);i.codec&&i.codec.length>0&&("opus"===i.codec&&o.A.safari&&(i.codec="Opus"),n+=";codecs=".concat(i.codec));var a=!1;if(r.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])r.A.v(this.TAG,"Notice: ".concat(i.type," mimeType changed, origin: ").concat(this._mimeTypes[i.type],", target: ").concat(n));else{a=!0;try{var d=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);d.addEventListener("error",this.e.onSourceBufferError),d.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return r.A.e(this.TAG,e.message),void this._emitter.emit(s.A.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),a||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),o.A.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.flush=function(){for(var e in this._sourceBuffers)if(this._sourceBuffers[e]){var t=this._sourceBuffers[e];if("open"===this._mediaSource.readyState)try{t.abort()}catch(e){r.A.e(this.TAG,e.message)}var i=this._pendingSegments[e];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var n=0;n<t.buffered.length;n++){var a=t.buffered.start(n),s=t.buffered.end(n);this._pendingRemoveRanges[e].push({start:a,end:s})}if(t.updating||this._doRemoveRanges(),o.A.safari){var d=this._lastInitSegments[e];d&&(this._pendingSegments[e].push(d),t.updating||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},e.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var e=this._mediaElementProxy.getCurrentTime();for(var t in this._sourceBuffers){var i=this._sourceBuffers[t];if(i){var n=i.buffered;if(n.length>=1&&e-n.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElementProxy.getCurrentTime();for(var t in this._sourceBuffers){var i=this._sourceBuffers[t];if(i){for(var n=i.buffered,a=!1,r=0;r<n.length;r++){var o=n.start(r),s=n.end(r);if(o<=e&&e<s+3){if(e-o>=this._config.autoCleanupMaxBackwardDuration){a=!0;var d=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:o,end:d})}}else s<e&&(a=!0,this._pendingRemoveRanges[t].push({start:o,end:s}))}a&&!i.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e=this._sourceBuffers;if(0!==this._mediaElementProxy.getReadyState()&&"open"===this._mediaSource.readyState&&!(e.video&&e.video.updating||e.audio&&e.audio.updating)){var t=this._mediaSource.duration,i=this._pendingMediaDuration;i>0&&(isNaN(t)||i>t)&&(r.A.v(this.TAG,"Update MediaSource duration from ".concat(t," to ").concat(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&&!1!==this._mediaSource.streaming&&e[t].length>0){var i=e[t].shift();if("number"==typeof i.timestampOffset&&isFinite(i.timestampOffset)){var n=this._sourceBuffers[t].timestampOffset,a=i.timestampOffset/1e3;Math.abs(n-a)>.1&&(r.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(n," to ").concat(a)),this._sourceBuffers[t].timestampOffset=a),delete i.timestampOffset}if(!i.data||0===i.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(i.data),this._isBufferFull=!1}catch(e){this._pendingSegments[t].unshift(i),22===e.code?(this._isBufferFull||this._emitter.emit(s.A.BUFFER_FULL),this._isBufferFull=!0):(r.A.e(this.TAG,e.message),this._emitter.emit(s.A.ERROR,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){if(r.A.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(s.A.SOURCE_OPEN)},e.prototype._onStartStreaming=function(){r.A.v(this.TAG,"ManagedMediaSource onStartStreaming"),this._emitter.emit(s.A.START_STREAMING)},e.prototype._onEndStreaming=function(){r.A.v(this.TAG,"ManagedMediaSource onEndStreaming"),this._emitter.emit(s.A.END_STREAMING)},e.prototype._onQualityChange=function(){r.A.v(this.TAG,"ManagedMediaSource onQualityChange")},e.prototype._onSourceEnded=function(){r.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){r.A.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),this._useManagedMediaSource&&(this._mediaSource.removeEventListener("startstreaming",this.e.onStartStreaming),this._mediaSource.removeEventListener("endstreaming",this.e.onEndStreaming),this._mediaSource.removeEventListener("qualitychange",this.e.onQualityChange)))},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(s.A.UPDATE_END)},e.prototype._onSourceBufferError=function(e){r.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}()},824(e,t,i){"use strict";i.d(t,{A:()=>l});var n=i(402),a=i.n(n),r=i(360),o=i.n(r),s=i(641),d=i(540),_=i(562),h=i(726),c=(i(514),i(200));const l=function(){function e(e,t){if(this.TAG="Transmuxer",this._emitter=new(a()),t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=o()(514),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},d.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:d.A.getConfig()})}catch(i){s.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new _.A(e,t)}else this._controller=new _.A(e,t);if(this._controller){var i=this._controller;i.on(h.A.IO_ERROR,this._onIOError.bind(this)),i.on(h.A.DEMUX_ERROR,this._onDemuxError.bind(this)),i.on(h.A.INIT_SEGMENT,this._onInitSegment.bind(this)),i.on(h.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),i.on(h.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),i.on(h.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),i.on(h.A.MEDIA_INFO,this._onMediaInfo.bind(this)),i.on(h.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),i.on(h.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),i.on(h.A.TRACKS_UPDATED,this._onTracksUpdated.bind(this)),i.on(h.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),i.on(h.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,this._onSynchronousKLVMetadataArrived.bind(this)),i.on(h.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,this._onAsynchronousKLVMetadataArrived.bind(this)),i.on(h.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),i.on(h.A.SEI_ARRIVED,this._onSEIArrived.bind(this)),i.on(h.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),i.on(h.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),i.on(h.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),i.on(h.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),i.on(h.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),d.A.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.switchAudioPid=function(e){this._worker?this._worker.postMessage({cmd:"switch_audio_pid",pid:e}):"function"==typeof this._controller.switchAudioPid&&this._controller.switchAudioPid(e)},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(h.A.INIT_SEGMENT,e,t)})},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(h.A.MEDIA_SEGMENT,e,t)})},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then(function(){e._emitter.emit(h.A.LOADING_COMPLETE)})},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then(function(){e._emitter.emit(h.A.RECOVERED_EARLY_EOF)})},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.MEDIA_INFO,e)})},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.METADATA_ARRIVED,e)})},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.SCRIPTDATA_ARRIVED,e)})},e.prototype._onTracksUpdated=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.TRACKS_UPDATED,e)})},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.TIMED_ID3_METADATA_ARRIVED,e)})},e.prototype._onPGSSubtitleArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.PGS_SUBTITLE_ARRIVED,e)})},e.prototype._onSynchronousKLVMetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,e)})},e.prototype._onAsynchronousKLVMetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,e)})},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.SMPTE2038_METADATA_ARRIVED,e)})},e.prototype._onSEIArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.SEI_ARRIVED,e)})},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.SCTE35_METADATA_ARRIVED,e)})},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.PES_PRIVATE_DATA_DESCRIPTOR,e)})},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.PES_PRIVATE_DATA_ARRIVED,e)})},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.STATISTICS_INFO,e)})},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(h.A.IO_ERROR,e,t)})},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(h.A.DEMUX_ERROR,e,t)})},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(h.A.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 h.A.INIT_SEGMENT:case h.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case h.A.LOADING_COMPLETE:case h.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case h.A.MEDIA_INFO:Object.setPrototypeOf(i,c.A.prototype),this._emitter.emit(t.msg,i);break;case h.A.METADATA_ARRIVED:case h.A.SCRIPTDATA_ARRIVED:case h.A.TRACKS_UPDATED:case h.A.TIMED_ID3_METADATA_ARRIVED:case h.A.PGS_SUBTITLE_ARRIVED:case h.A.SYNCHRONOUS_KLV_METADATA_ARRIVED:case h.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED:case h.A.SMPTE2038_METADATA_ARRIVED:case h.A.SCTE35_METADATA_ARRIVED:case h.A.SEI_ARRIVED:case h.A.PES_PRIVATE_DATA_DESCRIPTOR:case h.A.PES_PRIVATE_DATA_ARRIVED:case h.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case h.A.IO_ERROR:case h.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case h.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":s.A.emitter.emit("log",i.type,i.logcat)}},e}()},562(e,t,i){"use strict";i.d(t,{A:()=>Ge});var n=i(402),a=i.n(n),r=i(641),o=i(9),s=i(200);function d(e,t,i){var n=e;if(t+i<n.length){for(;i--;)if(128!=(192&n[++t]))return!1;return!0}return!1}const _=function(e){for(var t=[],i=e,n=0,a=e.length;n<a;)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(d(i,n,1)&&(r=(31&i[n])<<6|63&i[n+1])>=128){t.push(String.fromCharCode(65535&r)),n+=2;continue}}else if(i[n]<240){if(d(i,n,2)&&(r=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2])>=2048&&55296!=(63488&r)){t.push(String.fromCharCode(65535&r)),n+=3;continue}}else if(i[n]<248){var r;if(d(i,n,3)&&(r=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3])>65536&&r<1114112){r-=65536,t.push(String.fromCharCode(r>>>10|55296)),t.push(String.fromCharCode(1023&r|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};var h,c=i(816),l=(h=new ArrayBuffer(2),new DataView(h).setInt16(0,256,!0),256===new Int16Array(h)[0]);const u=function(){function e(){}return e.parseScriptData=function(t,i,n){var a={};try{var o=e.parseValue(t,i,n),s=e.parseValue(t,i+o.size,n-o.size);a[o.data]=s.data}catch(e){r.A.e("AMF",e.toString())}return a},e.parseObject=function(t,i,n){if(n<3)throw new c.j4("Data not enough when parse ScriptDataObject");var a=e.parseString(t,i,n),r=e.parseValue(t,i+a.size,n-a.size),o=r.objectEnd;return{data:{name:a.data,value:r.data},size:a.size+r.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 c.j4("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!l);return{data:n>0?_(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new c.j4("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!l);return{data:n>0?_(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new c.j4("Data size invalid when parse Date");var n=new DataView(e,t,i),a=n.getFloat64(0,!l),r=n.getInt16(8,!l);return{data:new Date(a+=60*r*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new c.j4("Data not enough when parse Value");var a,o=new DataView(t,i,n),s=1,d=o.getUint8(0),_=!1;try{switch(d){case 0:a=o.getFloat64(1,!l),s+=8;break;case 1:a=!!o.getUint8(1),s+=1;break;case 2:var h=e.parseString(t,i+1,n-1);a=h.data,s+=h.size;break;case 3:a={};var u=0;for(9==(16777215&o.getUint32(n-4,!l))&&(u=3);s<n-4;){var p=e.parseObject(t,i+s,n-s-u);if(p.objectEnd)break;a[p.data.name]=p.data.value,s+=p.size}s<=n-3&&9==(16777215&o.getUint32(s-1,!l))&&(s+=3);break;case 8:for(a={},s+=4,u=0,9==(16777215&o.getUint32(n-4,!l))&&(u=3);s<n-8;){var f=e.parseVariable(t,i+s,n-s-u);if(f.objectEnd)break;a[f.data.name]=f.data.value,s+=f.size}s<=n-3&&9==(16777215&o.getUint32(s-1,!l))&&(s+=3);break;case 9:a=void 0,s=1,_=!0;break;case 10:a=[];var m=o.getUint32(1,!l);s+=4;for(var g=0;g<m;g++){var v=e.parseValue(t,i+s,n-s);a.push(v.data),s+=v.size}break;case 11:var y=e.parseDate(t,i+1,n-1);a=y.data,s+=y.size;break;case 12:var A=e.parseString(t,i+1,n-1);a=A.data,s+=A.size;break;default:s=n,r.A.w("AMF","Unsupported AMF value type "+d)}}catch(e){r.A.e("AMF",e.toString())}return{data:a,size:s,objectEnd:_}},e}(),p=function(){function e(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e=this._total_bytes-this._buffer_index;if(e<=0)throw new c.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,e),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t},e.prototype.readBits=function(e){if(e>32)throw new c.Qn("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 a=Math.min(n,this._current_word_bits_left),r=this._current_word>>>32-a;return this._current_word<<=a,this._current_word_bits_left-=a,i<<a|r},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>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}(),f=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)},e.parseSPS=function(t){for(var i=t.subarray(1,4),n="avc1.",a=0;a<3;a++){var r=i[a].toString(16);r.length<2&&(r="0"+r),n+=r}var o=e._ebsp2rbsp(t),s=new p(o);s.readByte();var d=s.readByte();s.readByte();var _=s.readByte();s.readUEG();var h=e.getProfileString(d),c=e.getLevelString(_),l=1,u=420,f=8,m=8;if((100===d||110===d||122===d||244===d||44===d||83===d||86===d||118===d||128===d||138===d||144===d)&&(3===(l=s.readUEG())&&s.readBits(1),l<=3&&(u=[0,420,422,444][l]),f=s.readUEG()+8,m=s.readUEG()+8,s.readBits(1),s.readBool()))for(var g=3!==l?8:12,v=0;v<g;v++)s.readBool()&&(v<6?e._skipScalingList(s,16):e._skipScalingList(s,64));s.readUEG();var y=s.readUEG();if(0===y)s.readUEG();else if(1===y){s.readBits(1),s.readSEG(),s.readSEG();var A=s.readUEG();for(v=0;v<A;v++)s.readSEG()}var S=s.readUEG();s.readBits(1);var b=s.readUEG(),E=s.readUEG(),R=s.readBits(1);0===R&&s.readBits(1),s.readBits(1);var T=0,k=0,L=0,w=0;s.readBool()&&(T=s.readUEG(),k=s.readUEG(),L=s.readUEG(),w=s.readUEG());var C=1,D=1,M=0,B=!0,O=0,P=0;if(s.readBool()){if(s.readBool()){var I=s.readByte();I>0&&I<16?(C=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][I-1],D=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][I-1]):255===I&&(C=s.readByte()<<8|s.readByte(),D=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var x=s.readBits(32),U=s.readBits(32);B=s.readBool(),M=(O=U)/(P=2*x)}}var N=1;1===C&&1===D||(N=C/D);var V=0,G=0;0===l?(V=1,G=2-R):(V=3===l?1:2,G=(1===l?2:1)*(2-R));var F=16*(b+1),j=16*(E+1)*(2-R);F-=(T+k)*V,j-=(L+w)*G;var z=Math.ceil(F*N);return s.destroy(),s=null,{codec_mimetype:n,profile_idc:d,level_idc:_,profile_string:h,level_string:c,chroma_format_idc:l,bit_depth:f,bit_depth_luma:f,bit_depth_chroma:m,ref_frames:S,chroma_format:u,chroma_format_string:e.getChromaFormatString(u),frame_rate:{fixed:B,fps:M,fps_den:P,fps_num:O},sar_ratio:{width:C,height:D},codec_size:{width:F,height:j},present_size:{width:z,height:j}}},e._skipScalingList=function(e,t){for(var i=8,n=8,a=0;a<t;a++)0!==n&&(n=(i+e.readSEG()+256)%256),i=0===n?i:n},e.getProfileString=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"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=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"}},e}();var m=i(134);const g=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)},e.parseVPS=function(t){var i=e._ebsp2rbsp(t),n=new p(i);return n.readByte(),n.readByte(),n.readBits(4),n.readBits(2),n.readBits(6),{num_temporal_layers:n.readBits(3)+1,temporal_id_nested:n.readBool()}},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),n=new p(i);n.readByte(),n.readByte();for(var a=0,r=0,o=0,s=0,d=(n.readBits(4),n.readBits(3)),_=(n.readBool(),n.readBits(2)),h=n.readBool(),c=n.readBits(5),l=n.readByte(),u=n.readByte(),f=n.readByte(),m=n.readByte(),g=n.readByte(),v=n.readByte(),y=n.readByte(),A=n.readByte(),S=n.readByte(),b=n.readByte(),E=n.readByte(),R=[],T=[],k=0;k<d;k++)R.push(n.readBool()),T.push(n.readBool());if(d>0)for(k=d;k<8;k++)n.readBits(2);for(k=0;k<d;k++)R[k]&&(n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte()),T[k]&&n.readByte();n.readUEG();var L=n.readUEG();3==L&&n.readBits(1);var w=n.readUEG(),C=n.readUEG();n.readBool()&&(a+=n.readUEG(),r+=n.readUEG(),o+=n.readUEG(),s+=n.readUEG());var D=n.readUEG(),M=n.readUEG(),B=n.readUEG();for(k=n.readBool()?0:d;k<=d;k++)n.readUEG(),n.readUEG(),n.readUEG();if(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readBool()&&n.readBool())for(var O=0;O<4;O++)for(var P=0;P<(3===O?2:6);P++)if(n.readBool()){var I=Math.min(64,1<<4+(O<<1));for(O>1&&n.readSEG(),k=0;k<I;k++)n.readSEG()}else n.readUEG();n.readBool(),n.readBool(),n.readBool()&&(n.readByte(),n.readUEG(),n.readUEG(),n.readBool());var x=n.readUEG(),U=0;for(k=0;k<x;k++){var N=!1;if(0!==k&&(N=n.readBool()),N){k===x&&n.readUEG(),n.readBool(),n.readUEG();for(var V=0,G=0;G<=U;G++){var F=n.readBool(),j=!1;F||(j=n.readBool()),(F||j)&&V++}U=V}else{var z=n.readUEG(),H=n.readUEG();for(U=z+H,G=0;G<z;G++)n.readUEG(),n.readBool();for(G=0;G<H;G++)n.readUEG(),n.readBool()}}if(n.readBool()){var q=n.readUEG();for(k=0;k<q;k++){for(G=0;G<B+4;G++)n.readBits(1);n.readBits(1)}}var K=0,W=1,X=1,Y=!1,Q=1,Z=1;if(n.readBool(),n.readBool(),n.readBool()){if(n.readBool()){var $=n.readByte();$>0&&$<=16?(W=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][$-1],X=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][$-1]):255===$&&(W=n.readBits(16),X=n.readBits(16))}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(3),n.readBool(),n.readBool()&&(n.readByte(),n.readByte(),n.readByte())),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool(),n.readBool(),n.readBool(),n.readBool()&&(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG()),n.readBool()&&(Q=n.readBits(32),Z=n.readBits(32),n.readBool()&&n.readUEG(),n.readBool())){var J,ee,te=!1;for(J=n.readBool(),ee=n.readBool(),(J||ee)&&((te=n.readBool())&&(n.readByte(),n.readBits(5),n.readBool(),n.readBits(5)),n.readBits(4),n.readBits(4),te&&n.readBits(4),n.readBits(5),n.readBits(5),n.readBits(5)),k=0;k<=d;k++){var ie=n.readBool();Y=ie;var ne=!0,ae=1;ie||(ne=n.readBool());var re=!1;if(ne?n.readUEG():re=n.readBool(),re||(ae=n.readUEG()+1),J){for(G=0;G<ae;G++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG());n.readBool()}if(ee){for(G=0;G<ae;G++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG());n.readBool()}}}n.readBool()&&(n.readBool(),n.readBool(),n.readBool(),K=n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG())}n.readBool();var oe="hvc1.".concat(c,".1.L").concat(E,".B0"),se=w-(a+r)*(1===L||2===L?2:1),de=C-(o+s)*(1===L?2:1),_e=1;return 1!==W&&1!==X&&(_e=W/X),n.destroy(),n=null,{codec_mimetype:oe,profile_string:e.getProfileString(c),level_string:e.getLevelString(E),profile_idc:c,bit_depth:D+8,ref_frames:1,chroma_format:L,chroma_format_string:e.getChromaFormatString(L),general_level_idc:E,general_profile_space:_,general_tier_flag:h,general_profile_idc:c,general_profile_compatibility_flags_1:l,general_profile_compatibility_flags_2:u,general_profile_compatibility_flags_3:f,general_profile_compatibility_flags_4:m,general_constraint_indicator_flags_1:g,general_constraint_indicator_flags_2:v,general_constraint_indicator_flags_3:y,general_constraint_indicator_flags_4:A,general_constraint_indicator_flags_5:S,general_constraint_indicator_flags_6:b,min_spatial_segmentation_idc:K,constant_frame_rate:0,chroma_format_idc:L,bit_depth_luma_minus8:D,bit_depth_chroma_minus8:M,frame_rate:{fixed:Y,fps:Z/Q,fps_den:Q,fps_num:Z},sar_ratio:{width:W,height:X},codec_size:{width:se,height:de},present_size:{width:se*_e,height:de}}},e.parsePPS=function(t){var i=e._ebsp2rbsp(t),n=new p(i);n.readByte(),n.readByte(),n.readUEG(),n.readUEG(),n.readBool(),n.readBool(),n.readBits(3),n.readBool(),n.readBool(),n.readUEG(),n.readUEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool()&&n.readUEG(),n.readSEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool(),n.readBool();var a=n.readBool(),r=n.readBool(),o=1;return r&&a?o=0:r?o=3:a&&(o=2),{parallelismType:o}},e.getChromaFormatString=function(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},e.getProfileString=function(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},e.getLevelString=function(e){return(e/30).toFixed(1)},e}();function v(e){return e.byteOffset%2==0&&e.byteLength%2==0}function y(e){return e.byteOffset%4==0&&e.byteLength%4==0}function A(e,t){for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const S=function(e,t){return e.byteLength===t.byteLength&&(y(e)&&y(t)?function(e,t){return A(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):v(e)&&v(t)?function(e,t){return A(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return A(e,t)}(e,t))};var b=function(){return b=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var a in t=arguments[i])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},b.apply(this,arguments)};const E=function(){function e(){}return e.parseOBUs=function(t,i){for(var n=0;n<t.byteLength;){var a=n,r=(t[n],(120&t[n])>>3),o=!!(4&t[n]),s=!!(2&t[n]);t[n],n+=1,o&&(n+=1);var d=Number.POSITIVE_INFINITY;if(s){d=0;for(var _=0;;_++){var h=t[n++];if(d|=(127&h)<<7*_,!(128&h))break}}console.log(r),1===r?i=b(b({},e.parseSeuqneceHeader(t.subarray(n,n+d))),{sequence_header_data:t.subarray(a,n+d)}):(3==r&&i||6==r&&i)&&(i=e.parseOBUFrameHeader(t.subarray(n,n+d),0,0,i)),n+=d}return i},e.parseSeuqneceHeader=function(t){var i=new p(t),n=i.readBits(3),a=(i.readBool(),i.readBool()),r=!0,o=0,s=1,d=void 0,_=[];if(a)_.push({operating_point_idc:0,level:i.readBits(5),tier:0});else{if(i.readBool()){var h=i.readBits(32),c=i.readBits(32),l=i.readBool();if(l){for(var u=0;0===i.readBits(1);)u+=1;u>=32||i.readBits(u)}o=c,s=h,r=l,i.readBool()&&(i.readBits(5),i.readBits(32),d=i.readBits(5),i.readBits(5))}for(var f=i.readBool(),m=i.readBits(5),g=0;g<=m;g++){var v=i.readBits(12),y=i.readBits(5),A=y>7?i.readBits(1):0;_.push({operating_point_idc:v,level:y,tier:A}),f&&i.readBool()&&i.readBits(4)}}var S=_[0],b=S.level,E=S.tier,R=i.readBits(4),T=i.readBits(4),k=i.readBits(R+1)+1,L=i.readBits(T+1)+1,w=!1;a||(w=i.readBool()),w&&(i.readBits(4),i.readBits(4)),i.readBool(),i.readBool(),i.readBool();var C=!1,D=2,M=2,B=0;a||(i.readBool(),i.readBool(),i.readBool(),i.readBool(),(C=i.readBool())&&(i.readBool(),i.readBool()),M=(D=i.readBool()?2:i.readBits(1))?i.readBool()?2:i.readBits(1):2,B=C?i.readBits(3)+1:0);var O=i.readBool(),P=(i.readBool(),i.readBool(),i.readBool()),I=8;I=2===n&&P?i.readBool()?12:10:P?10:8;var x=!1;1!==n&&(x=i.readBool()),i.readBool()&&(i.readBits(8),i.readBits(8),i.readBits(8));var U=1,N=1;return x?(i.readBits(1),U=1,N=1):(i.readBits(1),0==n?(U=1,N=1):1==n?(U=0,N=0):12==I?i.readBits(1)&&i.readBits(1):(U=1,N=0),U&&N&&i.readBits(2),i.readBits(1)),i.readBool(),i.destroy(),i=null,{codec_mimetype:"av01.".concat(n,".").concat(e.getLevelString(b,E),".").concat(I.toString(10).padStart(2,"0")),level:b,tier:E,level_string:e.getLevelString(b,E),profile_idc:n,profile_string:"".concat(n),bit_depth:I,ref_frames:1,chroma_format:e.getChromaFormat(x,U,N),chroma_format_string:e.getChromaFormatString(x,U,N),sequence_header:{frame_id_numbers_present_flag:w,additional_frame_id_length_minus_1:void 0,delta_frame_id_length_minus_2:void 0,reduced_still_picture_header:a,decoder_model_info_present_flag:!1,operating_points:_,buffer_removal_time_length_minus_1:d,equal_picture_interval:r,seq_force_screen_content_tools:D,seq_force_integer_mv:M,enable_order_hint:C,order_hint_bits:B,enable_superres:O,frame_width_bit:R+1,frame_height_bit:T+1,max_frame_width:k,max_frame_height:L},keyframe:void 0,frame_rate:{fixed:r,fps:o/s,fps_den:s,fps_num:o}}},e.parseOBUFrameHeader=function(t,i,n,a){var r=a.sequence_header,o=new p(t),s=(r.max_frame_width,r.max_frame_height,0);r.frame_id_numbers_present_flag&&(s=r.additional_frame_id_length_minus_1+r.delta_frame_id_length_minus_2+3);var d=0,_=!0,h=!0,c=!1;if(!r.reduced_still_picture_header){if(o.readBool())return a;_=2===(d=o.readBits(2))||0===d,(h=o.readBool())&&r.decoder_model_info_present_flag&&r.equal_picture_interval,h&&o.readBool(),c=!!(3===d||0===d&&h)||o.readBool()}a.keyframe=_,o.readBool();var l=r.seq_force_screen_content_tools;2===r.seq_force_screen_content_tools&&(l=o.readBits(1)),l&&(r.seq_force_integer_mv,2==r.seq_force_integer_mv&&o.readBits(1)),r.frame_id_numbers_present_flag&&o.readBits(s);var u;if(u=3==d||!r.reduced_still_picture_header&&o.readBool(),o.readBits(r.order_hint_bits),_||c||o.readBits(3),r.decoder_model_info_present_flag&&o.readBool())for(var f=0;f<=r.operating_points_cnt_minus_1;f++)if(r.operating_points[f].decoder_model_present_for_this_op[f]){var m=r.operating_points[f].operating_point_idc;(0===m||m>>i&1&&m>>n+8&1)&&o.readBits(r.buffer_removal_time_length_minus_1+1)}var g=255;if(3===d||0==d&&h||(g=o.readBits(8)),(_||255!==g)&&c&&r.enable_order_hint)for(var v=0;v<8;v++)o.readBits(r.order_hint_bits);if(_){var y=e.frameSizeAndRenderSize(o,u,r);a.codec_size={width:y.FrameWidth,height:y.FrameHeight},a.present_size={width:y.RenderWidth,height:y.RenderHeight},a.sar_ratio={width:y.RenderWidth/y.FrameWidth,height:y.RenderHeight/y.FrameHeight}}return o.destroy(),o=null,a},e.frameSizeAndRenderSize=function(e,t,i){var n=i.max_frame_width,a=i.max_frame_height;t&&(n=e.readBits(i.frame_width_bit)+1,a=e.readBits(i.frame_height_bit)+1);var r=!1;i.enable_superres&&(r=e.readBool());var o=8;r&&(o=e.readBits(3)+9);var s=n;n=Math.floor((8*s+o/2)/o);var d=s,_=a;if(e.readBool()){var h=e.readBits(16)+1,c=e.readBits(16)+1;d=e.readBits(h)+1,_=e.readBits(c)+1}return{UpscaledWidth:s,FrameWidth:n,FrameHeight:a,RenderWidth:d,RenderHeight:_}},e.getLevelString=function(e,t){return"".concat(e.toString(10).padStart(2,"0")).concat(0===t?"M":"H")},e.getChromaFormat=function(e,t,i){return e?0:0===t&&0===i?3:1===t&&0===i?2:1===t&&1===i?1:Number.NaN},e.getChromaFormatString=function(e,t,i){return e?"4:0:0":0===t&&0===i?"4:4:4":1===t&&0===i?"4:2:2":1===t&&1===i?"4:2:0":"Unknown"},e}();var R=function(){};function T(e,t,i){if(!e||e.byteLength<2)return null;var n=1;"h265"===i&&(n=2);var a=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)}(e.subarray(n)),r=0;if(r===a.byteLength-1&&128===a[r])return null;for(var o=0;r<a.byteLength&&255===a[r];)o+=255,r++;if(r>=a.byteLength)return null;o+=a[r++];for(var s=0;r<a.byteLength&&255===a[r];)s+=255,r++;if(r>=a.byteLength)return null;if(s+=a[r++],r+s>a.byteLength)return null;var d=new R;d.type=o,d.size=s;var _=a.subarray(r,r+s);return 5===o&&s>=16&&(d.uuid=_.subarray(0,16),d.user_data=_.subarray(16)),void 0!==t&&(d.pts=t),d}var k=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._onSeiArrived=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new s.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._onSeiArrived=null},e.probe=function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var n,a=(4&t[4])>>>2!=0,r=!!(1&t[4]),o=(n=t)[5]<<24|n[6]<<16|n[7]<<8|n[8];return o<9?i:{match:!0,consumed:o,dataOffset:o,hasAudioTrack:a,hasVideoTrack:r}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeiArrived",{get:function(){return this._onSeiArrived},set:function(e){this._onSeiArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new s.A},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 c.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0,a=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;n=e.probe(t).dataOffset}for(this._firstParse&&(this._firstParse=!1,i+n!==this._dataOffset&&r.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(o=new DataView(t,n)).getUint32(0,!a)&&r.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),n+=4);n<t.byteLength;){this._dispatch=!0;var o=new DataView(t,n);if(n+11+4>t.byteLength)break;var s=o.getUint8(0),d=16777215&o.getUint32(0,!a);if(n+11+d+4>t.byteLength)break;if(8===s||9===s||18===s){var _=o.getUint8(4),h=o.getUint8(5),l=o.getUint8(6)|h<<8|_<<16|o.getUint8(7)<<24;16777215&o.getUint32(7,!a)&&r.A.w(this.TAG,"Meet tag which has StreamID != 0!");var u=n+11;switch(s){case 8:this._parseAudioData(t,u,d,l);break;case 9:this._parseVideoData(t,u,d,l,i+n);break;case 18:this._parseScriptData(t,u,d)}var p=o.getUint32(11+d,!a);p!==11+d&&r.A.w(this.TAG,"Invalid PrevTagSize ".concat(p)),n+=11+d+4}else r.A.w(this.TAG,"Unsupported tag type ".concat(s,", skipped")),n+=11+d+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=u.parseScriptData(e,t,i);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!=typeof n.onMetaData)return void r.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&r.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var a=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},a)),"boolean"==typeof a.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=a.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof a.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=a.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof a.audiodatarate&&(this._mediaInfo.audioDataRate=a.audiodatarate),"number"==typeof a.videodatarate&&(this._mediaInfo.videoDataRate=a.videodatarate),"number"==typeof a.width&&(this._mediaInfo.width=a.width),"number"==typeof a.height&&(this._mediaInfo.height=a.height),"number"==typeof a.duration){if(!this._durationOverrided){var o=Math.floor(a.duration*this._timescale);this._duration=o,this._mediaInfo.duration=o}}else this._mediaInfo.duration=0;if("number"==typeof a.framerate){var s=Math.floor(1e3*a.framerate);if(s>0){var d=s/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=d,this._referenceFrameRate.fps_num=s,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=d}}if("object"==typeof a.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var _=a.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(_),a.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=a,r.A.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))},e.prototype._parseSEIPayload=function(e,t,i){var n=T(e,t,i);n&&"function"==typeof this._onSeiArrived&&this._onSeiArrived(n)},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],n=1;n<e.times.length;n++){var a=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(a),i.push(e.filepositions[n])}return{times:t,filepositions:i}},e.prototype._parseAudioData=function(e,t,i,n){if(i<=1)r.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!0!==this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var a=new DataView(e,t,i).getUint8(0),o=a>>>4;if(9!==o)if(2===o||3===o||10===o){var s=0,d=(12&a)>>>2;if(d>=0&&d<=4){s=this._flvSoundRateTable[d];var _=(2&a)>>>1,h=1&a,c=this._audioMetadata,l=this._audioTrack;if(c||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(c=this._audioMetadata={}).type="audio",c.id=l.id,c.timescale=this._timescale,c.duration=this._duration,c.audioSampleRate=s,c.channelCount=0===h?1:2),10===o){var u=this._parseAACAudioData(e,t+1,i-1);if(null==u)return;if(0===u.packetType){if(c.config){if(S(u.data.config,c.config))return;r.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var p=u.data;c.audioSampleRate=p.samplingRate,c.channelCount=p.channelCount,c.codec=p.codec,c.originalCodec=p.originalCodec,c.config=p.config,c.refSampleDuration=1024/c.audioSampleRate*c.timescale,r.A.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",c),(y=this._mediaInfo).audioCodec=c.originalCodec,y.audioSampleRate=c.audioSampleRate,y.audioChannelCount=c.channelCount,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y)}else if(1===u.packetType){var f=this._timestampBase+n,g={unit:u.data,length:u.data.byteLength,dts:f,pts:f};l.samples.push(g),l.length+=u.data.length}else r.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(u.packetType))}else if(2===o){if(!c.codec){if(null==(p=this._parseMP3AudioData(e,t+1,i-1,!0)))return;c.audioSampleRate=p.samplingRate,c.channelCount=p.channelCount,c.codec=p.codec,c.originalCodec=p.originalCodec,c.refSampleDuration=1152/c.audioSampleRate*c.timescale,r.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",c),(y=this._mediaInfo).audioCodec=c.codec,y.audioSampleRate=c.audioSampleRate,y.audioChannelCount=c.channelCount,y.audioDataRate=p.bitRate,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y)}if(null==(A=this._parseMP3AudioData(e,t+1,i-1,!1)))return;f=this._timestampBase+n;var v={unit:A,length:A.byteLength,dts:f,pts:f};l.samples.push(v),l.length+=A.length}else if(3===o){var y;c.codec||(c.audioSampleRate=s,c.sampleSize=8*(_+1),c.littleEndian=!0,c.codec="ipcm",c.originalCodec="ipcm",this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",c),(y=this._mediaInfo).audioCodec=c.codec,y.audioSampleRate=c.audioSampleRate,y.audioChannelCount=c.channelCount,y.audioDataRate=c.sampleSize*c.audioSampleRate,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y));var A=new Uint8Array(e,t+1,i-1),b=(f=this._timestampBase+n,{unit:A,length:A.byteLength,dts:f,pts:f});l.samples.push(b),l.length+=A.length}}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+d)}else this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+o);else{if(i<=5)return void r.A.w(this.TAG,"Flv: Invalid audio packet, missing AudioFourCC in Ehnanced FLV payload!");var E=15&a,R=String.fromCharCode.apply(String,new Uint8Array(e,t,i).slice(1,5));switch(R){case"Opus":this._parseOpusAudioPacket(e,t+5,i-5,n,E);break;case"fLaC":this._parseFlacAudioPacket(e,t+5,i-5,n,E);break;default:this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec: "+R)}}}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var n={},a=new Uint8Array(e,t,i);return n.packetType=a[0],0===a[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=a.subarray(1),n}r.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n,a,r=new Uint8Array(e,t,i),o=null,s=0,d=null;if(s=n=r[0]>>>3,(a=(7&r[0])<<1|r[1]>>>7)<0||a>=this._mpegSamplingRates.length)this._onError(m.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var _=this._mpegSamplingRates[a],h=(120&r[1])>>>3;if(!(h<0||h>=8)){5===s&&(d=(7&r[1])<<1|r[2]>>>7,r[2]);var c=self.navigator.userAgent.toLowerCase();return-1!==c.indexOf("firefox")?a>=6?(s=5,o=new Array(4),d=a-3):(s=2,o=new Array(2),d=a):-1!==c.indexOf("android")?(s=2,o=new Array(2),d=a):(s=5,d=a,o=new Array(4),a>=6?d=a-3:1===h&&(s=2,o=new Array(2),d=a)),o[0]=s<<3,o[0]|=(15&a)>>>1,o[1]=(15&a)<<7,o[1]|=(15&h)<<3,5===s&&(o[1]|=(15&d)>>>1,o[2]=(1&d)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:_,channelCount:h,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+n}}this._onError(m.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,n){if(!(i<4)){this._littleEndian;var a=new Uint8Array(e,t,i),o=null;if(n){if(255!==a[0])return;var s=a[1]>>>3&3,d=(6&a[1])>>1,_=(240&a[2])>>>4,h=(12&a[2])>>>2,c=3&~(a[3]>>>6)?2:1,l=0,u=0;switch(s){case 0:l=this._mpegAudioV25SampleRateTable[h];break;case 2:l=this._mpegAudioV20SampleRateTable[h];break;case 3:l=this._mpegAudioV10SampleRateTable[h]}switch(d){case 1:_<this._mpegAudioL3BitRateTable.length&&(u=this._mpegAudioL3BitRateTable[_]);break;case 2:_<this._mpegAudioL2BitRateTable.length&&(u=this._mpegAudioL2BitRateTable[_]);break;case 3:_<this._mpegAudioL1BitRateTable.length&&(u=this._mpegAudioL1BitRateTable[_])}o={bitRate:u,samplingRate:l,channelCount:c,codec:"mp3",originalCodec:"mp3"}}else o=a;return o}r.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseOpusAudioPacket=function(e,t,i,n,a){if(0===a)this._parseOpusSequenceHeader(e,t,i);else if(1===a)this._parseOpusAudioData(e,t,i,n);else if(2!==a)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseOpusSequenceHeader=function(e,t,i){if(i<=16)r.A.w(this.TAG,"Flv: Invalid OpusSequenceHeader, lack of data!");else{var n=this._audioMetadata,a=this._audioTrack;n||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(n=this._audioMetadata={}).type="audio",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration);var o=new DataView(e,t,i);o.setUint8(8,0);var s=o.getUint8(9);o.setUint16(10,o.getUint16(10,!0),!1);var d=o.getUint32(12,!0);o.setUint32(12,o.getUint32(12,!0),!1);var _={config:new Uint8Array(e,t+8,i-8),channelCount:s,samplingFrequence:d,codec:"opus",originalCodec:"opus"};if(n.config){if(S(_.config,n.config))return;r.A.w(this.TAG,"OpusSequenceHeader has been changed, re-generate initialization segment")}n.audioSampleRate=_.samplingFrequence,n.channelCount=_.channelCount,n.codec=_.codec,n.originalCodec=_.originalCodec,n.config=_.config,n.refSampleDuration=20,r.A.v(this.TAG,"Parsed OpusSequenceHeader"),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",n);var h=this._mediaInfo;h.audioCodec=n.originalCodec,h.audioSampleRate=n.audioSampleRate,h.audioChannelCount=n.channelCount,h.hasVideo?null!=h.videoCodec&&(h.mimeType='video/x-flv; codecs="'+h.videoCodec+","+h.audioCodec+'"'):h.mimeType='video/x-flv; codecs="'+h.audioCodec+'"',h.isComplete()&&this._onMediaInfo(h)}},e.prototype._parseOpusAudioData=function(e,t,i,n){var a=this._audioTrack,r=new Uint8Array(e,t,i),o=this._timestampBase+n,s={unit:r,length:r.byteLength,dts:o,pts:o};a.samples.push(s),a.length+=r.length},e.prototype._parseFlacAudioPacket=function(e,t,i,n,a){if(0===a)this._parseFlacSequenceHeader(e,t,i);else if(1===a)this._parseFlacAudioData(e,t,i,n);else if(2!==a)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid Flac audio packet type ".concat(a))},e.prototype._parseFlacSequenceHeader=function(e,t,i){var n=this._audioMetadata,a=this._audioTrack;n||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(n=this._audioMetadata={}).type="audio",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration);var o=new Uint8Array(e,t+4,i-4),s=new p(o),d=s.readBits(16),_=s.readBits(16),h=_===d?_:null;s.readBits(24),s.readBits(24);var c=s.readBits(20),l=s.readBits(3)+1,u=s.readBits(5)+1;s.destroy();var f=new Uint8Array(o.byteLength+4);f.set(o,4),f[0]=128,f[1]=o.byteLength>>>16&255,f[2]=o.byteLength>>>8&255,f[3]=o.byteLength>>>0&255;var m={config:f,channelCount:l,samplingFrequence:c,sampleSize:u,codec:"flac",originalCodec:"flac"};if(n.config){if(S(m.config,n.config))return;r.A.w(this.TAG,"FlacSequenceHeader has been changed, re-generate initialization segment")}n.audioSampleRate=m.samplingFrequence,n.channelCount=m.channelCount,n.sampleSize=m.sampleSize,n.codec=m.codec,n.originalCodec=m.originalCodec,n.config=m.config,n.refSampleDuration=null!=h?1e3*h/m.samplingFrequence:null,r.A.v(this.TAG,"Parsed FlacSequenceHeader"),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",n);var g=this._mediaInfo;g.audioCodec=n.originalCodec,g.audioSampleRate=n.audioSampleRate,g.audioChannelCount=n.channelCount,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)},e.prototype._parseFlacAudioData=function(e,t,i,n){var a=this._audioTrack,r=new Uint8Array(e,t,i),o=this._timestampBase+n,s={unit:r,length:r.byteLength,dts:o,pts:o};a.samples.push(s),a.length+=r.length},e.prototype._parseVideoData=function(e,t,i,n,a){if(i<=1)r.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!0!==this._hasVideoFlagOverrided||!1!==this._hasVideo){var o=new Uint8Array(e,t,i)[0],s=(112&o)>>>4;if(128&o){var d=15&o,_=String.fromCharCode.apply(String,new Uint8Array(e,t,i).slice(1,5));if("hvc1"===_)this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,n,a,s,d);else{if("av01"!==_)return void this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(_));this._parseEnhancedAV1VideoPacket(e,t+5,i-5,n,a,s,d)}}else{var h=15&o;if(7===h)this._parseAVCVideoPacket(e,t+1,i-1,n,a,s);else{if(12!==h)return void this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(h));this._parseHEVCVideoPacket(e,t+1,i-1,n,a,s)}}}},e.prototype._parseAVCVideoPacket=function(e,t,i,n,a,o){if(i<4)r.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,d=new DataView(e,t,i),_=d.getUint8(0),h=(16777215&d.getUint32(0,!s))<<8>>8;if(0===_)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===_)this._parseAVCVideoData(e,t+4,i-4,n,a,o,h);else if(2!==_)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(_))}},e.prototype._parseHEVCVideoPacket=function(e,t,i,n,a,o){if(i<4)r.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,d=new DataView(e,t,i),_=d.getUint8(0),h=(16777215&d.getUint32(0,!s))<<8>>8;if(0===_)this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===_)this._parseHEVCVideoData(e,t+4,i-4,n,a,o,h);else if(2!==_)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(_))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,i,n,a,r,o){var s=this._littleEndian,d=new DataView(e,t,i);if(0===o)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===o){var _=(4294967040&d.getUint32(0,!s))>>8;this._parseHEVCVideoData(e,t+3,i-3,n,a,r,_)}else if(3===o)this._parseHEVCVideoData(e,t,i,n,a,r,0);else if(2!==o)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,i,n,a,r,o){if(this._littleEndian,new DataView(e,t,i),0===o)this._parseAV1CodecConfigurationRecord(e,t,i);else if(1===o)this._parseAV1VideoData(e,t,i,n,a,r,0);else{if(5===o)return void this._onError(m.A.FORMAT_ERROR,"Flv: Not Supported MP2T AV1 video packet type ".concat(o));if(2!==o)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))}},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){if(i<7)r.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,a=this._videoTrack,o=this._littleEndian,s=new DataView(e,t,i);if(n){if(void 0!==n.avcc){var d=new Uint8Array(e,t,i);if(S(d,n.avcc))return;r.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration;var _=s.getUint8(0),h=s.getUint8(1);if(s.getUint8(2),s.getUint8(3),1===_&&0!==h)if(this._naluLengthSize=1+(3&s.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var c=31&s.getUint8(5);if(0!==c){c>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(c));for(var l=6,u=0;u<c;u++){var p=s.getUint16(l,!o);if(l+=2,0!==p){var g=new Uint8Array(e,t+l,p);l+=p;var v=f.parseSPS(g);if(0===u){n.codecWidth=v.codec_size.width,n.codecHeight=v.codec_size.height,n.presentWidth=v.present_size.width,n.presentHeight=v.present_size.height,n.profile=v.profile_string,n.level=v.level_string,n.bitDepth=v.bit_depth,n.chromaFormat=v.chroma_format,n.sarRatio=v.sar_ratio,n.frameRate=v.frame_rate,!1!==v.frame_rate.fixed&&0!==v.frame_rate.fps_num&&0!==v.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);var y=n.frameRate.fps_den,A=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(y/A);for(var b=g.subarray(1,4),E="avc1.",R=0;R<3;R++){var T=b[R].toString(16);T.length<2&&(T="0"+T),E+=T}n.codec=E;var k=this._mediaInfo;k.width=n.codecWidth,k.height=n.codecHeight,k.fps=n.frameRate.fps,k.profile=n.profile,k.level=n.level,k.refFrames=v.ref_frames,k.chromaFormat=v.chroma_format_string,k.sarNum=n.sarRatio.width,k.sarDen=n.sarRatio.height,k.videoCodec=E,k.hasAudio?null!=k.audioCodec&&(k.mimeType='video/x-flv; codecs="'+k.videoCodec+","+k.audioCodec+'"'):k.mimeType='video/x-flv; codecs="'+k.videoCodec+'"',k.isComplete()&&this._onMediaInfo(k)}}}var L=s.getUint8(l);if(0!==L){for(L>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(L)),l++,u=0;u<L;u++)p=s.getUint16(l,!o),l+=2,0!==p&&(l+=p);n.avcc=new Uint8Array(i),n.avcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(m.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,i){if(i<22)r.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,a=this._videoTrack,o=this._littleEndian,s=new DataView(e,t,i);if(n){if(void 0!==n.hvcc){var d=new Uint8Array(e,t,i);if(S(d,n.hvcc))return;r.A.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration;var _=s.getUint8(0),h=31&s.getUint8(1);if(0!==_&&1!==_||0===h)this._onError(m.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord");else if(this._naluLengthSize=1+(3&s.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var c=s.getUint8(22),l=0,u=23;l<c;l++){var p=63&s.getUint8(u+0),f=s.getUint16(u+1,!o);u+=3;for(var v=0;v<f;v++){var y=s.getUint16(u+0,!o);if(0===v)if(33===p){u+=2;var A=new Uint8Array(e,t+u,y),b=g.parseSPS(A);n.codecWidth=b.codec_size.width,n.codecHeight=b.codec_size.height,n.presentWidth=b.present_size.width,n.presentHeight=b.present_size.height,n.profile=b.profile_string,n.level=b.level_string,n.bitDepth=b.bit_depth,n.chromaFormat=b.chroma_format,n.sarRatio=b.sar_ratio,n.frameRate=b.frame_rate,!1!==b.frame_rate.fixed&&0!==b.frame_rate.fps_num&&0!==b.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);var E=n.frameRate.fps_den,R=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(E/R),n.codec=b.codec_mimetype;var T=this._mediaInfo;T.width=n.codecWidth,T.height=n.codecHeight,T.fps=n.frameRate.fps,T.profile=n.profile,T.level=n.level,T.refFrames=b.ref_frames,T.chromaFormat=b.chroma_format_string,T.sarNum=n.sarRatio.width,T.sarDen=n.sarRatio.height,T.videoCodec=b.codec_mimetype,T.hasAudio?null!=T.audioCodec&&(T.mimeType='video/x-flv; codecs="'+T.videoCodec+","+T.audioCodec+'"'):T.mimeType='video/x-flv; codecs="'+T.videoCodec+'"',T.isComplete()&&this._onMediaInfo(T),u+=y}else u+=2+y;else u+=2+y}}n.hvcc=new Uint8Array(i),n.hvcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(m.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1))}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,i){if(i<4)r.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var n=this._videoMetadata,a=this._videoTrack,o=(this._littleEndian,new DataView(e,t,i));n?void 0!==n.av1c&&r.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration);var s=127&o.getUint8(0);if(o.getUint8(1),o.getUint8(1),o.getUint8(2),1===s){var d=E.parseOBUs(new Uint8Array(e,t+4,i-4));if(null!=d){n.profile=d.profile_string,n.level=d.level_string,n.bitDepth=d.bit_depth,n.chromaFormat=d.chroma_format,n.frameRate=d.frame_rate,!1!==d.frame_rate.fixed&&0!==d.frame_rate.fps_num&&0!==d.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);var _=n.frameRate.fps_den,h=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(_/h),n.codec=d.codec_mimetype,n.extra=d;var c=this._mediaInfo;c.fps=n.frameRate.fps,c.profile=n.profile,c.level=n.level,c.refFrames=d.ref_frames,c.chromaFormat=d.chroma_format_string,c.videoCodec=d.codec_mimetype,c.hasAudio?null!=c.audioCodec&&(c.mimeType='video/x-flv; codecs="'+c.videoCodec+","+c.audioCodec+'"'):c.mimeType='video/x-flv; codecs="'+c.videoCodec+'"',c.isComplete()&&this._onMediaInfo(c),n.av1c=new Uint8Array(i),n.av1c.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Preparing AV1CodecConfigurationRecord")}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,i,n,a,o,s){for(var d=this._littleEndian,_=new DataView(e,t,i),h=[],c=0,l=0,u=this._naluLengthSize,p=this._timestampBase+n,f=1===o;l<i;){if(l+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(l,", dataSize = ").concat(i));break}var m=_.getUint32(l,!d);if(3===u&&(m>>>=8),m>i-u)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var g=31&_.getUint8(l+u);5===g&&(f=!0);var v=new Uint8Array(e,t+l,u+m),y={type:g,data:v};h.push(y),c+=v.byteLength,6===g&&this._parseSEIPayload(v.subarray(u),p+s,"h264"),l+=u+m}if(h.length){var A=this._videoTrack,S={units:h,length:c,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(S.fileposition=a),A.samples.push(S),A.length+=c}},e.prototype._parseHEVCVideoData=function(e,t,i,n,a,o,s){for(var d=this._littleEndian,_=new DataView(e,t,i),h=[],c=0,l=0,u=this._naluLengthSize,p=this._timestampBase+n,f=1===o;l<i;){if(l+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(l,", dataSize = ").concat(i));break}var m=_.getUint32(l,!d);if(3===u&&(m>>>=8),m>i-u)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var g=_.getUint8(l+u)>>1&63;19!==g&&20!==g&&21!==g||(f=!0);var v=new Uint8Array(e,t+l,u+m),y={type:g,data:v};h.push(y),c+=v.byteLength,39!==g&&40!==g||this._parseSEIPayload(v.subarray(u),p+s,"h265"),l+=u+m}if(h.length){var A=this._videoTrack,S={units:h,length:c,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(S.fileposition=a),A.samples.push(S),A.length+=c}},e.prototype._parseAV1VideoData=function(e,t,i,n,a,o,s){this._littleEndian,new DataView(e,t,i);var d,_=[],h=this._timestampBase+n,c=1===o;if(c){var l=this._videoMetadata,u=E.parseOBUs(new Uint8Array(e,t,i),l.extra);if(null==u)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AV1 VideoData");console.log(u),l.codecWidth=u.codec_size.width,l.codecHeight=u.codec_size.height,l.presentWidth=u.present_size.width,l.presentHeight=u.present_size.height,l.sarRatio=u.sar_ratio;var p=this._mediaInfo;p.width=l.codecWidth,p.height=l.codecHeight,p.sarNum=l.sarRatio.width,p.sarDen=l.sarRatio.height,r.A.v(this.TAG,"Parsed AV1DecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",l)}if(d=i,_.push({unitType:0,data:new Uint8Array(e,t+0,i)}),_.length){var f=this._videoTrack,g={units:_,length:d,isKeyframe:c,dts:h,cts:s,pts:h+s};c&&(g.fileposition=a),f.samples.push(g),f.length+=d}},e}();const L=k,w=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onPGSSubtitleData=null,this.onSynchronousKLVMetadata=null,this.onAsynchronousKLVMetadata=null,this.onSMPTE2038Metadata=null,this.onSEI=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null,this.onTracksUpdated=null},e}();var C,D=function(){this.program_pmt_pid={}};!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kEAC3=135]="kEAC3",e[e.kMetadata=21]="kMetadata",e[e.kSCTE35=134]="kSCTE35",e[e.kPGS=144]="kPGS",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(C||(C={}));var M,B=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,av1:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.pgs_pids={},this.pgs_langs={},this.synchronous_klv_pids={},this.asynchronous_klv_pids={},this.scte_35_pids={},this.smpte2038_pids={},this.all_audio_pids=[],this.subtitle_pids=[],this.parsed_sections={}},O=function(){},P=function(){},I=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0};!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(M||(M={}));var x,U,N=function(){},V=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},G=function(){function e(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],a=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===a)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=31&e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3],a=(128&e[i])>>>7,r=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=r,!(n>=M.kReserved0)&&0===a){var o=e.subarray(i,r);(t=new N).type=n,t.data=o}}return t},e}(),F=function(){function e(e,t,i){var n=8+e.byteLength+1+2+t.byteLength,a=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(a=!0,n+=4);var r=this.data=new Uint8Array(n);r[0]=1,r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=255,r[5]=225;var o=e.byteLength;r[6]=o>>>8,r[7]=255&o;var s=8;r.set(e,8),r[s+=o]=1;var d=t.byteLength;r[s+1]=d>>>8,r[s+2]=255&d,r.set(t,s+3),s+=3+d,a&&(r[s]=252|i.chroma_format_idc,r[s+1]=248|i.bit_depth_luma-8,r[s+2]=248|i.bit_depth_chroma-8,r[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(x||(x={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(U||(U={}));var j,z,H=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],q=(j=function(e,t){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},j(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),K=function(){},W=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return q(t,e),t}(K),X=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095==(i[t+0]<<8|i[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=(8&e[i+1])>>>3,a=(6&e[i+1])>>>1,r=1&e[i+1],o=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,d=(1&e[i+2])<<2|(192&e[i+3])>>>6,_=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+_>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var h=1===r?7:9,c=_-h;i+=h;var l=this.findNextSyncwordOffset(i+c);if(this.current_syncword_offset_=l,(0===n||1===n)&&0===a){var u=e.subarray(i,i+c);(t=new K).audio_object_type=o+1,t.sampling_freq_index=s,t.sampling_frequency=H[s],t.channel_config=d,t.data=u}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Y=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+1>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(695==(i[t+0]<<3|i[t+1]>>>5))return t;t++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),i=0,n=0;n<=t;n++)i<<=8,i|=e.readByte();return i},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var n=this.current_syncword_offset_,a=(31&t[n+1])<<8|t[n+2];if(n+3+a>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var o=new p(t.subarray(n+3,n+3+a)),s=null;if(o.readBool()){if(null==e){r.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+a),o.destroy();continue}s=e}else{var d=o.readBool();if(d&&o.readBool()){r.A.e(this.TAG,"audioMuxVersionA is Not Supported"),o.destroy();break}if(d&&this.getLATMValue(o),!o.readBool()){r.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),o.destroy();break}if(0!==o.readBits(6)){r.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),o.destroy();break}if(0!==o.readBits(4)){r.A.e(this.TAG,"more than 2 numProgram Not Supported"),o.destroy();break}if(0!==o.readBits(3)){r.A.e(this.TAG,"more than 2 numLayer Not Supported"),o.destroy();break}var _=d?this.getLATMValue(o):0,h=o.readBits(5);_-=5;var c=o.readBits(4);_-=4;var l=o.readBits(4);_-=4,o.readBits(3),(_-=3)>0&&o.readBits(_);var u=o.readBits(3);if(0!==u){r.A.e(this.TAG,"frameLengthType = ".concat(u,". Only frameLengthType = 0 Supported")),o.destroy();break}o.readByte();var f=o.readBool();if(f)if(d)this.getLATMValue(o);else{for(var m=0;;){m<<=8;var g=o.readBool();if(m+=o.readByte(),!g)break}console.log(m)}o.readBool()&&o.readByte(),(s=new W).audio_object_type=h,s.sampling_freq_index=c,s.sampling_frequency=H[s.sampling_freq_index],s.channel_config=l,s.other_data_present=f}for(var v=0;;){var y=o.readByte();if(v+=y,255!==y)break}for(var A=new Uint8Array(v),S=0;S<v;S++)A[S]=o.readByte();(i=new W).audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=H[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=A,this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+a)}return i},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Q=function(e){var t=null,i=e.audio_object_type,n=e.audio_object_type,a=e.sampling_freq_index,r=e.channel_config,o=0,s=navigator.userAgent.toLowerCase();-1!==s.indexOf("firefox")?a>=6?(n=5,t=new Array(4),o=a-3):(n=2,t=new Array(2),o=a):-1!==s.indexOf("android")?(n=2,t=new Array(2),o=a):(n=5,o=a,t=new Array(4),a>=6?o=a-3:1===r&&(n=2,t=new Array(2),o=a)),t[0]=n<<3,t[0]|=(15&a)>>>1,t[1]=(15&a)<<7,t[1]|=(15&r)<<3,5===n&&(t[1]|=(15&o)>>>1,t[2]=(1&o)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=H[a],this.channel_count=r,this.codec_mimetype="mp4a.40."+n,this.original_codec_mimetype="mp4a.40."+i},Z=function(){},$=function(){};!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(z||(z={}));var J,ee=function(e){var t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},te=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},ie=function(e,t){var i=t.readBits(8);return e?{component_tag:i}:{component_tag:i,splice_time:ee(t)}},ne=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},ae=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),e.readBits(5),n.program_splice_flag)n.utc_splice_time=e.readBits(32);else{n.component_count=e.readBits(8),n.components=[];for(var a=0;a<n.component_count;a++)n.components.push(ne(e))}return n.duration_flag&&(n.break_duration=te(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n},re=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:n.readBits(32)}},oe=function(e,t,i,n){var a=n.readBits(8),r=n.readBits(3);n.readBits(5);for(var o="",s=0;s<r;s++)o+=String.fromCharCode(n.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:a,dtmf_count:r,DTMF_char:o}},se=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},de=function(e,t,i,n){var a=n.readBits(32),r=n.readBool();n.readBits(7);var o={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:a,segmentation_event_cancel_indicator:r};if(r)return o;if(o.program_segmentation_flag=n.readBool(),o.segmentation_duration_flag=n.readBool(),o.delivery_not_restricted_flag=n.readBool(),o.delivery_not_restricted_flag?n.readBits(5):(o.web_delivery_allowed_flag=n.readBool(),o.no_regional_blackout_flag=n.readBool(),o.archive_allowed_flag=n.readBool(),o.device_restrictions=n.readBits(2)),!o.program_segmentation_flag){o.component_count=n.readBits(8),o.components=[];for(var s=0;s<o.component_count;s++)o.components.push(se(n))}o.segmentation_duration_flag&&(o.segmentation_duration=n.readBits(40)),o.segmentation_upid_type=n.readBits(8),o.segmentation_upid_length=n.readBits(8);var d=new Uint8Array(o.segmentation_upid_length);for(s=0;s<o.segmentation_upid_length;s++)d[s]=n.readBits(8);return o.segmentation_upid=d.buffer,o.segmentation_type_id=n.readBits(8),o.segment_num=n.readBits(8),o.segments_expected=n.readBits(8),52!==o.segmentation_type_id&&54!==o.segmentation_type_id&&56!==o.segmentation_type_id&&58!==o.segmentation_type_id||(o.sub_segment_num=n.readBits(8),o.sub_segments_expected=n.readBits(8)),o},_e=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:n.readBits(48),TAI_ns:n.readBits(32),UTC_offset:n.readBits(16)}},he=function(e){return{component_tag:e.readBits(8),ISO_code:String.fromCharCode(e.readBits(8),e.readBits(8),e.readBits(8)),Bit_Stream_Mode:e.readBits(3),Num_Channels:e.readBits(4),Full_Srvc_Audio:e.readBool()}},ce=function(e,t,i,n){for(var a=n.readBits(4),r=[],o=0;o<a;o++)r.push(he(n));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:a,components:r}};!function(e){e[e.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",e[e.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",e[e.kSliceCRA_NUT=21]="kSliceCRA_NUT",e[e.kSliceVPS=32]="kSliceVPS",e[e.kSliceSPS=33]="kSliceSPS",e[e.kSlicePPS=34]="kSlicePPS",e[e.kSliceAUD=35]="kSliceAUD",e[e.kSliceSEI=39]="kSliceSEI",e[e.kSliceSEISuffix=40]="kSliceSEISuffix"}(J||(J={}));var le=function(){},ue=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},pe=function(){function e(e){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],a=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===a)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3]>>1&63,a=(128&e[i])>>>7,r=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=r,0===a){var o=e.subarray(i,r);(t=new le).type=n,t.data=o}}return t},e}(),fe=function(){function e(e,t,i,n){var a=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),r=this.data=new Uint8Array(a);r[0]=1,r[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,r[2]=n.general_profile_compatibility_flags_1,r[3]=n.general_profile_compatibility_flags_2,r[4]=n.general_profile_compatibility_flags_3,r[5]=n.general_profile_compatibility_flags_4,r[6]=n.general_constraint_indicator_flags_1,r[7]=n.general_constraint_indicator_flags_2,r[8]=n.general_constraint_indicator_flags_3,r[9]=n.general_constraint_indicator_flags_4,r[10]=n.general_constraint_indicator_flags_5,r[11]=n.general_constraint_indicator_flags_6,r[12]=n.general_level_idc,r[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,r[14]=255&n.min_spatial_segmentation_idc,r[15]=252|3&n.parallelismType,r[16]=252|3&n.chroma_format_idc,r[17]=248|7&n.bit_depth_luma_minus8,r[18]=248|7&n.bit_depth_chroma_minus8,r[19]=0,r[20]=0,r[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,r[22]=3,r[23]=128|J.kSliceVPS,r[24]=0,r[25]=1,r[26]=(65280&e.byteLength)>>8,r[27]=255&e.byteLength,r.set(e,28),r[23+(5+e.byteLength)+0]=128|J.kSliceSPS,r[23+(5+e.byteLength)+1]=0,r[23+(5+e.byteLength)+2]=1,r[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,r[23+(5+e.byteLength)+4]=255&t.byteLength,r.set(t,23+(5+e.byteLength)+5),r[23+(5+e.byteLength+5+t.byteLength)+0]=128|J.kSlicePPS,r[23+(5+e.byteLength+5+t.byteLength)+1]=0,r[23+(5+e.byteLength+5+t.byteLength)+2]=1,r[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&i.byteLength)>>8,r[23+(5+e.byteLength+5+t.byteLength)+4]=255&i.byteLength,r.set(i,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),me=function(){},ge=function(){},ve=function(){},ye=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],Ae=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=e[i+4]>>6,a=[48e3,44200,33e3][n],r=63&e[i+4],o=2*ye[n][r];if(isNaN(o)||i+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(i+o);this.current_syncword_offset_=s;var d=e[i+5]>>3,_=7&e[i+5],h=e[i+6]>>5,c=0;1&h&&1!==h&&(c+=2),4&h&&(c+=2),2===h&&(c+=2);var l=(e[i+6]<<8|e[i+7])>>12-c&1,u=[2,1,2,3,3,4,4,5][h]+l;(t=new ve).sampling_frequency=a,t.channel_count=u,t.channel_mode=h,t.bit_stream_identification=d,t.low_frequency_effects_channel_on=l,t.bit_stream_mode=_,t.frame_size_code=r,t.data=e.subarray(i,i+o)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Se=function(e){var t;t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},be=function(){},Ee=function(){function e(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextEAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=new p(e.subarray(i+2)),a=(n.readBits(2),n.readBits(3),n.readBits(11)+1<<1),r=n.readBits(2),o=null,s=null;3===r?(o=[24e3,22060,16e3][r=n.readBits(2)],s=3):(o=[48e3,44100,32e3][r],s=n.readBits(2));var d=n.readBits(3),_=n.readBits(1),h=n.readBits(5);if(i+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=this.findNextSyncwordOffset(i+a);this.current_syncword_offset_=c;var l=[2,1,2,3,3,4,4,5][d]+_;n.destroy(),(t=new be).sampling_frequency=o,t.channel_count=l,t.channel_mode=d,t.bit_stream_identification=h,t.low_frequency_effects_channel_on=_,t.frame_size=a,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+a)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Re=function(e){var t,i=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&i,248&i,e.sampling_rate_code<<6|e.bit_stream_identification<<1,e.channel_mode<<1|e.low_frequency_effects_channel_on,0],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.num_blks=e.num_blks,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},Te=function(){};const ke=function(){function e(e){this.TAG="AV1OBUInMpegTsParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find AV1 startcode until payload end!")}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)},e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+2>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(1==(i[t+0]<<16|i[t+1]<<8|i[t+2]))return t;t++}},e.prototype.readNextOBUPayload=function(){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var n=this.current_startcode_offset_+3,a=this.findNextStartCodeOffset(n);this.current_startcode_offset_=a,i=e._ebsp2rbsp(t.subarray(n,a))}return i},e}();var Le=function(){},we=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ce=function(){return Ce=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var a in t=arguments[i])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ce.apply(this,arguments)},De=function(e){function t(t,i){var n=e.call(this)||this;return n.TAG="TSDemuxer",n.first_parse_=!0,n.media_info_=new s.A,n.timescale_=90,n.duration_=0,n.current_pmt_pid_=-1,n.program_pmt_map_={},n.pes_slice_queues_={},n.section_slice_queues_={},n.video_metadata_={vps:void 0,sps:void 0,pps:void 0,av1c:void 0,details:void 0},n.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},n.last_pcr_base_=NaN,n.timestamp_offset_=0,n.audio_last_sample_pts_=void 0,n.aac_last_incomplete_data_=null,n.has_video_=!1,n.has_audio_=!1,n.video_init_segment_dispatched_=!1,n.audio_init_segment_dispatched_=!1,n.video_metadata_changed_=!1,n.audio_metadata_changed_=!1,n.video_keyframe_seen_after_init_=!1,n.stashed_audio_before_video_init_=[],n._last_dispatch_block_reason_="",n.video_init_dispatch_time_=0,n.active_audio_pid_=0,n.loas_previous_frame=null,n.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},n.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},n.ts_packet_size_=t.ts_packet_size,n.sync_offset_=t.sync_offset,n.config_=i,n}return we(t,e),t.prototype.destroy=function(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,e.prototype.destroy.call(this)},t.probe=function(e){var t=new Uint8Array(e),i=-1,n=188;if(t.byteLength<=3*n)return{needMoreData:!0};for(;-1===i;){for(var a=Math.min(1e3,t.byteLength-3*n),o=0;o<a;){if(71===t[o]&&71===t[o+n]&&71===t[o+2*n]){i=o;break}o++}if(-1===i)if(188===n)n=192;else{if(192!==n)break;n=204}}return-1===i?{match:!1}:(192===n&&i>=4?(r.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===n&&r.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:n,sync_offset:i})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new s.A},t.prototype.selectAudioPid=function(e){if(this.pmt_){var t=this.pmt_.all_audio_pids.map(function(e){return e.pid});if(0===e||t.includes(e)){r.A.v(this.TAG,"[muvie] selectAudioPid: switching active audio PID to ".concat(e||"(default)")),this.active_audio_pid_=e;var i=this.pmt_;i.common_pids.adts_aac=void 0,i.common_pids.loas_aac=void 0,i.common_pids.ac3=void 0,i.common_pids.eac3=void 0,i.common_pids.opus=void 0,i.common_pids.mp3=void 0;var n=0!==e?i.all_audio_pids.find(function(t){return t.pid===e}):void 0;n||(n=i.all_audio_pids[0]),n&&("aac"===n.codec?i.common_pids.adts_aac=n.pid:"aac-loas"===n.codec?i.common_pids.loas_aac=n.pid:"ac3"===n.codec?i.common_pids.ac3=n.pid:"eac3"===n.codec?i.common_pids.eac3=n.pid:"opus"===n.codec?i.common_pids.opus=n.pid:"mp3"===n.codec&&(i.common_pids.mp3=n.pid)),this.audio_init_segment_dispatched_=!1,this.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},this.audio_track_.samples=[],this.audio_track_.length=0,this.audio_last_sample_pts_=void 0,this.aac_last_incomplete_data_=null,this.loas_previous_frame=null,this.stashed_audio_before_video_init_=[]}else r.A.w(this.TAG,"[muvie] selectAudioPid: pid ".concat(e," not in available audio PIDs [").concat(t.join(", "),"]"))}},t.prototype.setPreferredAudioPid=function(e){this.active_audio_pid_=e,r.A.v(this.TAG,"[muvie] setPreferredAudioPid: ".concat(e))},t.prototype.getAvailableTracks=function(){return this.pmt_?{audioTracks:this.pmt_.all_audio_pids,subtitleTracks:this.pmt_.subtitle_pids}:{audioTracks:[],subtitleTracks:[]}},t.prototype.parseChunks=function(e,t){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new c.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0;for(this.first_parse_&&(this.first_parse_=!1,i=this.sync_offset_);i+this.ts_packet_size_<=e.byteLength;){var n=t+i;192===this.ts_packet_size_&&(i+=4);var a=new Uint8Array(e,i,188),o=a[0];if(71!==o){r.A.e(this.TAG,"sync_byte = ".concat(o,", not 0x47"));break}var s=(64&a[1])>>>6,d=(a[1],(31&a[1])<<8|a[2]),_=(48&a[3])>>>4,h=15&a[3],l=!(!this.pmt_||this.pmt_.pcr_pid!==d),u={},p=4;if(2==_||3==_){var f=a[4];if(f>0&&(l||3==_)&&(u.discontinuity_indicator=(128&a[5])>>>7,u.random_access_indicator=(64&a[5])>>>6,u.elementary_stream_priority_indicator=(32&a[5])>>>5,(16&a[5])>>>4)){var m=300*this.getPcrBase(a)+((1&a[10])<<8|a[11]);this.last_pcr_=m}if(2==_||5+f===188){i+=188,204===this.ts_packet_size_&&(i+=16);continue}p=5+f}if(1==_||3==_)if(0===d||d===this.current_pmt_pid_||null!=this.pmt_&&this.pmt_.pid_stream_type[d]===C.kSCTE35){var g=188-p;this.handleSectionSlice(e,i+p,g,{pid:d,file_position:n,payload_unit_start_indicator:s,continuity_conunter:h,random_access_indicator:u.random_access_indicator})}else if(null!=this.pmt_&&null!=this.pmt_.pid_stream_type[d]){g=188-p;var v=this.pmt_.pid_stream_type[d];d!==this.pmt_.common_pids.h264&&d!==this.pmt_.common_pids.h265&&d!==this.pmt_.common_pids.av1&&d!==this.pmt_.common_pids.adts_aac&&d!==this.pmt_.common_pids.loas_aac&&d!==this.pmt_.common_pids.ac3&&d!==this.pmt_.common_pids.eac3&&d!==this.pmt_.common_pids.opus&&d!==this.pmt_.common_pids.mp3&&!0!==this.pmt_.pes_private_data_pids[d]&&!0!==this.pmt_.timed_id3_pids[d]&&!0!==this.pmt_.pgs_pids[d]&&!0!==this.pmt_.synchronous_klv_pids[d]&&!0!==this.pmt_.asynchronous_klv_pids[d]||this.handlePESSlice(e,i+p,g,{pid:d,stream_type:v,file_position:n,payload_unit_start_indicator:s,continuity_conunter:h,random_access_indicator:u.random_access_indicator})}i+=188,204===this.ts_packet_size_&&(i+=16)}return this.dispatchAudioVideoMediaSegment(),i},t.prototype.handleSectionSlice=function(e,t,i,n){var a=new Uint8Array(e,t,i),r=this.section_slice_queues_[n.pid];if(n.payload_unit_start_indicator){var o=a[0];if(null!=r&&0!==r.total_length){var s=new Uint8Array(e,t+1,Math.min(i,o));r.slices.push(s),r.total_length+=s.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):this.clearSlices(r,n)}for(var d=1+o;d<a.byteLength&&255!==a[d+0];){var _=(15&a[d+1])<<8|a[d+2];this.section_slice_queues_[n.pid]=new I,(r=this.section_slice_queues_[n.pid]).expected_length=_+3,r.file_position=n.file_position,r.random_access_indicator=n.random_access_indicator,s=new Uint8Array(e,t+d,Math.min(i-d,r.expected_length-r.total_length)),r.slices.push(s),r.total_length+=s.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):r.total_length>=r.expected_length&&this.clearSlices(r,n),d+=s.byteLength}}else null!=r&&0!==r.total_length&&(s=new Uint8Array(e,t,Math.min(i,r.expected_length-r.total_length)),r.slices.push(s),r.total_length+=s.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):r.total_length>=r.expected_length&&this.clearSlices(r,n))},t.prototype.handlePESSlice=function(e,t,i,n){var a=new Uint8Array(e,t,i),o=a[0]<<16|a[1]<<8|a[2],s=(a[3],a[4]<<8|a[5]);if(n.payload_unit_start_indicator){if(1!==o)return void r.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(o));var d=this.pes_slice_queues_[n.pid];d&&(0===d.expected_length||d.expected_length===d.total_length?this.emitPESSlices(d,n):this.clearSlices(d,n)),this.pes_slice_queues_[n.pid]=new I,this.pes_slice_queues_[n.pid].file_position=n.file_position,this.pes_slice_queues_[n.pid].random_access_indicator=n.random_access_indicator}if(null!=this.pes_slice_queues_[n.pid]){var _=this.pes_slice_queues_[n.pid];_.slices.push(a),n.payload_unit_start_indicator&&(_.expected_length=0===s?0:s+6),_.total_length+=a.byteLength,_.expected_length>0&&_.expected_length===_.total_length?this.emitPESSlices(_,n):_.expected_length>0&&_.expected_length<_.total_length&&this.clearSlices(_,n)}},t.prototype.emitSectionSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,a=0;n<e.slices.length;n++){var r=e.slices[n];i.set(r,a),a+=r.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var o=new P;o.pid=t.pid,o.data=i,o.file_position=e.file_position,o.random_access_indicator=e.random_access_indicator,this.parseSection(o)},t.prototype.emitPESSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,a=0;n<e.slices.length;n++){var r=e.slices[n];i.set(r,a),a+=r.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var o=new O;o.pid=t.pid,o.data=i,o.stream_type=t.stream_type,o.file_position=e.file_position,o.random_access_indicator=e.random_access_indicator,this.parsePES(o)},t.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},t.prototype.parseSection=function(e){var t=e.data,i=e.pid;0===i?this.parsePAT(t):i===this.current_pmt_pid_?this.parsePMT(t):null!=this.pmt_&&this.pmt_.scte_35_pids[i]&&this.parseSCTE35(t)},t.prototype.parsePES=function(e){var t=e.data,i=t[0]<<16|t[1]<<8|t[2],n=t[3],a=t[4]<<8|t[5];if(1===i)if(188!==n&&190!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n){t[6];var o=(192&t[7])>>>6,s=t[8],d=void 0,_=void 0;2!==o&&3!==o||(d=this.getTimestamp(t,9),_=3===o?this.getTimestamp(t,14):d);var h=9+s,c=void 0;if(0!==a){if(a<3+s)return void r.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");c=a-3-s}else c=t.byteLength-h;var l=t.subarray(h,h+c);switch(e.stream_type){case C.kMPEG1Audio:case C.kMPEG2Audio:this.parseMP3Payload(l,d);break;case C.kPESPrivateData:this.pmt_.common_pids.av1===e.pid?this.parseAV1Payload(l,d,_,e.file_position,e.random_access_indicator):this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(l,d):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(l,d):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(l,d):this.pmt_.asynchronous_klv_pids[e.pid]?this.parseAsynchronousKLVMetadataPayload(l,e.pid,n):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(l,d,_,e.pid,n):this.parsePESPrivateDataPayload(l,d,_,e.pid,n);break;case C.kADTSAAC:this.parseADTSAACPayload(l,d);break;case C.kLOASAAC:this.parseLOASAACPayload(l,d);break;case C.kAC3:this.parseAC3Payload(l,d);break;case C.kEAC3:this.parseEAC3Payload(l,d);break;case C.kMetadata:this.pmt_.timed_id3_pids[e.pid]?this.parseTimedID3MetadataPayload(l,d,_,e.pid,n):this.pmt_.synchronous_klv_pids[e.pid]&&this.parseSynchronousKLVMetadataPayload(l,d,_,e.pid,n);break;case C.kPGS:this.parsePGSPayload(l,d,_,e.pid,n,this.pmt_.pgs_langs[e.pid]);break;case C.kH264:this.parseH264Payload(l,d,_,e.file_position,e.random_access_indicator);break;case C.kH265:this.parseH265Payload(l,d,_,e.file_position,e.random_access_indicator)}}else 188!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n||e.stream_type!==C.kPESPrivateData||(h=6,c=void 0,c=0!==a?a:t.byteLength-h,l=t.subarray(h,h+c),this.parsePESPrivateDataPayload(l,void 0,void 0,e.pid,n));else r.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(i))},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var i=(15&e[1])<<8|e[2],n=(e[3],e[4],(62&e[5])>>>1),a=1&e[5],o=e[6],s=(e[7],null);if(1===a&&0===o)(s=new D).version_number=n;else if(null==(s=this.pat_))return;for(var d=i-5-4,_=-1,h=-1,c=8;c<8+d;c+=4){var l=e[c]<<8|e[c+1],u=(31&e[c+2])<<8|e[c+3];0===l?s.network_pid=u:(s.program_pmt_pid[l]=u,-1===_&&(_=l),-1===h&&(h=u))}1===a&&0===o&&(null==this.pat_&&r.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=_,this.current_pmt_pid_=h)}else r.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},t.prototype.parsePMT=function(e){var t,i=this,n=e[0];if(2===n){var a=(15&e[1])<<8|e[2],o=e[3]<<8|e[4],s=(62&e[5])>>>1,d=1&e[5],_=e[6],h=(e[7],null),c=this.program_pmt_map_[o];if(!(c&&c.version_number===s&&c.parsed_sections&&c.parsed_sections[_])){var l=!1;if(1===d&&0===_)(h=new B).program_number=o,h.version_number=s,h.parsed_sections[_]=!0,this.program_pmt_map_[o]=h,l=!0;else{if(null==(h=this.program_pmt_map_[o]))return;h.parsed_sections[_]=!0}h.pcr_pid=(31&e[8])<<8|e[9];for(var u=(15&e[10])<<8|e[11],p=12+u,f=a-9-u-4,m=p;m<p+f;){var g=e[m],v=(31&e[m+1])<<8|e[m+2],y=(15&e[m+3])<<8|e[m+4];h.pid_stream_type[v]=g;for(var A=h.common_pids.h264||h.common_pids.h265,S=h.common_pids.adts_aac||h.common_pids.loas_aac||h.common_pids.ac3||h.common_pids.eac3||h.common_pids.opus||h.common_pids.mp3,b=void 0,E=m+5;E<m+5+y;){var R=e[E],T=e[E+1];10===R&&T>=3&&(b=String.fromCharCode(e[E+2],e[E+3],e[E+4]).trim()),E+=2+T}var k="";if(g!==C.kH264||A?g!==C.kH265||A?g===C.kADTSAAC?(S||(h.common_pids.adts_aac=v),h.all_audio_pids.push({pid:v,codec:"aac",lang:b}),k="aac"):g===C.kLOASAAC?(S||(h.common_pids.loas_aac=v),h.all_audio_pids.push({pid:v,codec:"aac-loas",lang:b}),k="aac-loas"):g===C.kAC3?(S||(h.common_pids.ac3=v),h.all_audio_pids.push({pid:v,codec:"ac3",lang:b}),k="ac3"):g===C.kEAC3?(S||(h.common_pids.eac3=v),h.all_audio_pids.push({pid:v,codec:"eac3",lang:b}),k="eac3"):g!==C.kMPEG1Audio&&g!==C.kMPEG2Audio||(S||(h.common_pids.mp3=v),h.all_audio_pids.push({pid:v,codec:"mp3",lang:b}),k="mp3"):h.common_pids.h265=v:h.common_pids.h264=v,k&&l&&r.A.v(this.TAG,"[muvie] PMT parsing: found audio track (codec=".concat(k,", pid=").concat(v,", lang=").concat(b||"und",", is_primary=").concat(!S,")")),g===C.kPESPrivateData){if(h.pes_private_data_pids[v]=!0,y>0){for(var L=m+5;L<m+5+y;){R=e[L+0];var w=e[L+1];if(5===R){var D=String.fromCharCode.apply(String,Array.from(e.subarray(L+2,L+2+w)));"VANC"===D?h.smpte2038_pids[v]=!0:"AV01"===D?h.common_pids.av1=v:"Opus"===D?h.common_pids.opus=v:"KLVA"===D&&(h.asynchronous_klv_pids[v]=!0)}else if(127===R){if(v===h.common_pids.opus){var M=null;if(128===e[L+2]&&(M=e[L+3]),null==M){r.A.e(this.TAG,"Not Supported Opus channel count.");continue}var O={codec:"opus",channel_count:15&M?15&M:2,channel_config_code:M,sample_rate:48e3},P={codec:"opus",meta:O};0==this.audio_init_segment_dispatched_?(this.audio_metadata_=O,this.dispatchAudioInitSegment(P)):this.detectAudioMetadataChange(P)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(P))}}else 128===R&&v===h.common_pids.av1&&(this.video_metadata_.av1c=e.subarray(L+2,L+2+w));L+=2+w}var I=e.subarray(m+5,m+5+y);this.dispatchPESPrivateDataDescriptor(v,g,I)}}else if(g===C.kMetadata){if(y>0)for(L=m+5;L<m+5+y;){R=e[L+0];var x=e[L+1];if(38===R){var U=e[L+2]<<8|e[L+3],N=null;65535===U&&(N=String.fromCharCode.apply(String,Array.from(e.subarray(L+4,L+4+4))));var V=null;if(255===e[L+4+(65535===U?4:0)]){var G=4+(65535===U?4:0)+1;V=String.fromCharCode.apply(String,Array.from(e.subarray(L+G,L+G+4)))}"ID3 "===N&&"ID3 "===V?h.timed_id3_pids[v]=!0:"KLVA"===V&&(h.synchronous_klv_pids[v]=!0)}L+=2+x}}else if(g===C.kSCTE35)h.scte_35_pids[v]=!0;else if(g===C.kPGS){if(h.pgs_langs[v]="und",y>0)for(L=m+5;L<m+5+y;){R=e[L+0];var F=e[L+1];if(10===R){var j=String.fromCharCode.apply(String,Array.from(e.slice(L+2,L+5)));h.pgs_langs[v]=j}L+=2+F}h.pgs_pids[v]=!0,h.subtitle_pids.push({pid:v,type:"pgs",lang:h.pgs_langs[v]})}m+=5+y}if(o===this.current_program_){null==this.pmt_&&r.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(h))),this.pmt_=h,(h.common_pids.h264||h.common_pids.h265||h.common_pids.av1)&&(this.has_video_=!0),(h.common_pids.adts_aac||h.common_pids.loas_aac||h.common_pids.ac3||h.common_pids.opus||h.common_pids.mp3)&&(this.has_audio_=!0);for(var z=function(e){h.subtitle_pids.find(function(t){return t.pid===e})||h.subtitle_pids.push({pid:e,type:"timed_id3"})},H=0,q=Object.keys(h.timed_id3_pids).map(Number);H<q.length;H++)z(q[H]);if(l&&(h.common_pids.ac3||h.common_pids.eac3)){var K=h.common_pids.ac3?"ac-3":"ec-3",W=null===(t=this.config_)||void 0===t?void 0:t.preferredAudioPid,X=void 0;W&&h.all_audio_pids.some(function(e){return e.pid===W})?X=h.all_audio_pids.find(function(e){return e.pid===W}):this.active_audio_pid_&&h.all_audio_pids.some(function(e){return e.pid===i.active_audio_pid_})&&(X=h.all_audio_pids.find(function(e){return e.pid===i.active_audio_pid_})),X||(X=h.all_audio_pids.find(function(e){return"aac"===e.codec||"mp3"===e.codec})),X&&(r.A.w(this.TAG,"[muvie] Primary audio is ".concat(K," (browser-incompatible) — auto-fallback to ").concat(X.codec," pid=").concat(X.pid," lang=").concat(X.lang||"und")),h.common_pids.ac3=0,h.common_pids.eac3=0,this.selectAudioPid(X.pid))}l&&this.onTracksUpdated&&(h.all_audio_pids.length>1||h.subtitle_pids.length>0)&&this.onTracksUpdated({audioTracks:h.all_audio_pids,subtitleTracks:h.subtitle_pids})}}}else r.A.e(this.TAG,"parsePMT: table_id ".concat(n," is not corresponded to PMT!"))},t.prototype.parseSCTE35=function(e){var t=function(e){var t=new p(e),i=t.readBits(8),n=t.readBool(),a=t.readBool();t.readBits(2);var r=t.readBits(12),o=t.readBits(8),s=t.readBool(),d=t.readBits(6),_=4*t.readBits(31)+t.readBits(2),h=t.readBits(8),c=t.readBits(12),l=t.readBits(12),u=t.readBits(8),f=null;u===z.kSpliceNull?f={}:u===z.kSpliceSchedule?f=function(e){for(var t=e.readBits(8),i=[],n=0;n<t;n++)i.push(ae(e));return{splice_count:t,events:i}}(t):u===z.kSpliceInsert?f=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),n.splice_immediate_flag=e.readBool(),e.readBits(4),n.program_splice_flag&&!n.splice_immediate_flag&&(n.splice_time=ee(e)),!n.program_splice_flag){n.component_count=e.readBits(8),n.components=[];for(var a=0;a<n.component_count;a++)n.components.push(ie(n.splice_immediate_flag,e))}return n.duration_flag&&(n.break_duration=te(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n}(t):u===z.kTimeSignal?f=function(e){return{splice_time:ee(e)}}(t):u===z.kBandwidthReservation?f={}:u===z.kPrivateCommand?f=function(e,t){for(var i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),n=new Uint8Array(e-4),a=0;a<e-4;a++)n[a]=t.readBits(8);return{identifier:i,private_data:n.buffer}}(l,t):t.readBits(8*l);for(var m=[],g=t.readBits(16),v=0;v<g;){var y=t.readBits(8),A=t.readBits(8),S=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8));0===y?m.push(re(y,A,S,t)):1===y?m.push(oe(y,A,S,t)):2===y?m.push(de(y,A,S,t)):3===y?m.push(_e(y,A,S,t)):4===y?m.push(ce(y,A,S,t)):t.readBits(8*(A-4)),v+=2+A}var b={table_id:i,section_syntax_indicator:n,private_indicator:a,section_length:r,protocol_version:o,encrypted_packet:s,encryption_algorithm:d,pts_adjustment:_,cw_index:h,tier:c,splice_command_length:l,splice_command_type:u,splice_command:f,descriptor_loop_length:g,splice_descriptors:m,E_CRC32:s?t.readBits(32):void 0,CRC32:t.readBits(32)};if(u===z.kSpliceInsert){var E=f;if(E.splice_event_cancel_indicator)return{splice_command_type:u,detail:b,data:e};if(E.program_splice_flag&&!E.splice_immediate_flag){var R=E.duration_flag?E.break_duration.auto_return:void 0,T=E.duration_flag?E.break_duration.duration/90:void 0;return E.splice_time.time_specified_flag?{splice_command_type:u,pts:(_+E.splice_time.pts_time)%Math.pow(2,33),auto_return:R,duraiton:T,detail:b,data:e}:{splice_command_type:u,auto_return:R,duraiton:T,detail:b,data:e}}return{splice_command_type:u,auto_return:R=E.duration_flag?E.break_duration.auto_return:void 0,duraiton:T=E.duration_flag?E.break_duration.duration/90:void 0,detail:b,data:e}}if(u===z.kTimeSignal){var k=f;return k.splice_time.time_specified_flag?{splice_command_type:u,pts:(_+k.splice_time.pts_time)%Math.pow(2,33),detail:b,data:e}:{splice_command_type:u,detail:b,data:e}}return{splice_command_type:u,detail:b,data:e}}(e);if(null!=t.pts){var i=Math.floor(t.pts/this.timescale_);t.pts=i}else t.nearest_pts=this.getNearestTimestampMilliseconds();this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},t.prototype.parseAV1Payload=function(e,t,i,n,a){for(var r=new ke(e),o=null,s=[],d=0,_=!1,h=null;null!=(o=r.readNextOBUPayload());){if((h=E.parseOBUs(o,this.video_metadata_.details))&&!0===h.keyframe)if(this.video_init_segment_dispatched_){if(!0===this.detectVideoMetadataChange(null,h)){var c;this.video_metadata_changed_=!0,this.dispatchVideoMediaSegment(),(c=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+h.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),c.set(h.sequence_header_data,this.video_metadata_.av1c.byteLength),h.av1c=c,this.dispatchVideoInitSegment()}}else(c=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+h.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),c.set(h.sequence_header_data,this.video_metadata_.av1c.byteLength),h.av1c=c,this.video_metadata_.details=h,this.dispatchVideoInitSegment();this.video_metadata_.details=h,this.video_init_segment_dispatched_&&(null==h?void 0:h.keyframe)&&(this.video_keyframe_seen_after_init_=!0),_||(_=h.keyframe),s.push({data:o}),d+=o.byteLength}var l=Math.floor(t/this.timescale_),u=Math.floor(i/this.timescale_);if(s.length){var p=this.video_track_,f={units:s,length:d,isKeyframe:_,dts:u,pts:l,cts:l-u,file_position:n};p.samples.push(f),p.length+=d}},t.prototype.parseH264Payload=function(e,t,i,n,a){for(var o=new G(e),s=null,d=[],_=0,h=!1;null!=(s=o.readNextNaluPayload());){var c=new V(s);if(c.type===M.kSliceSPS){var l=f.parseSPS(s.data);this.video_init_segment_dispatched_?!0===this.detectVideoMetadataChange(c,l)&&(r.A.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:c,pps:void 0,av1c:void 0,details:l}):(this.video_metadata_.sps=c,this.video_metadata_.details=l)}else c.type===M.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_.pps=c,this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):c.type===M.kSliceIDR||c.type===M.kSliceNonIDR&&1===a?h=!0:c.type===M.kSliceSEI&&this.parseSEIPayload(s.data,t,"h264");this.video_init_segment_dispatched_&&(h&&!this.video_keyframe_seen_after_init_?(r.A.v(this.TAG,"[muvie] H264: first IDR keyframe seen after init dispatch — media segments will now flow"),this.video_keyframe_seen_after_init_=!0):h&&(this.video_keyframe_seen_after_init_=!0),d.push(c),_+=c.data.byteLength)}var u=Math.floor(t/this.timescale_),p=Math.floor(i/this.timescale_);if(d.length){var m=this.video_track_,g={units:d,length:_,isKeyframe:h,dts:p,pts:u,cts:u-p,file_position:n};m.samples.push(g),m.length+=_}},t.prototype.parseH265Payload=function(e,t,i,n,a){for(var o=new pe(e),s=null,d=[],_=0,h=!1;null!=(s=o.readNextNaluPayload());){var c=new ue(s);if(c.type===J.kSliceVPS){if(!this.video_init_segment_dispatched_){var l=g.parseVPS(s.data);this.video_metadata_.vps=c,this.video_metadata_.details=Ce(Ce({},this.video_metadata_.details),l)}}else c.type===J.kSliceSPS?(l=g.parseSPS(s.data),this.video_init_segment_dispatched_?!0===this.detectVideoMetadataChange(c,l)&&(r.A.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:c,pps:void 0,av1c:void 0,details:l}):(this.video_metadata_.sps=c,this.video_metadata_.details=Ce(Ce({},this.video_metadata_.details),l))):c.type===J.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(l=g.parsePPS(s.data),this.video_metadata_.pps=c,this.video_metadata_.details=Ce(Ce({},this.video_metadata_.details),l),this.video_metadata_.vps&&this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):c.type===J.kSliceIDR_W_RADL||c.type===J.kSliceIDR_N_LP||c.type===J.kSliceCRA_NUT?h=!0:c.type!==J.kSliceSEI&&c.type!==J.kSliceSEISuffix||this.parseSEIPayload(s.data,t,"h265");this.video_init_segment_dispatched_&&(h&&!this.video_keyframe_seen_after_init_?(r.A.v(this.TAG,"[muvie] H265: first keyframe seen after init dispatch — media segments will now flow"),this.video_keyframe_seen_after_init_=!0):h&&(this.video_keyframe_seen_after_init_=!0),d.push(c),_+=c.data.byteLength)}var u=Math.floor(t/this.timescale_),p=Math.floor(i/this.timescale_);if(d.length){var f=this.video_track_,m={units:d,length:_,isKeyframe:h,dts:p,pts:u,cts:u-p,file_position:n};f.samples.push(m),f.length+=_}},t.prototype.detectVideoMetadataChange=function(e,t){if(t.codec_mimetype!==this.video_metadata_.details.codec_mimetype)return r.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(this.video_metadata_.details.codec_mimetype," to ").concat(t.codec_mimetype)),!0;if(t.codec_size.width!==this.video_metadata_.details.codec_size.width||t.codec_size.height!==this.video_metadata_.details.codec_size.height){var i=this.video_metadata_.details.codec_size,n=t.codec_size;return r.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(i.width,"x").concat(i.height," to ").concat(n.width,"x").concat(n.height)),!0}return t.present_size.width!==this.video_metadata_.details.present_size.width&&(r.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(this.video_metadata_.details.present_size.width," to ").concat(t.present_size.width)),!0)},t.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},t.prototype.dispatchVideoInitSegment=function(){var e=this.video_metadata_.details,t={type:"video"};t.id=this.video_track_.id,t.timescale=1e3,t.duration=this.duration_,t.codecWidth=e.codec_size.width,t.codecHeight=e.codec_size.height,t.presentWidth=e.present_size.width,t.presentHeight=e.present_size.height,t.profile=e.profile_string,t.level=e.level_string,t.bitDepth=e.bit_depth,t.chromaFormat=e.chroma_format,t.sarRatio=e.sar_ratio,t.frameRate=e.frame_rate;var i=t.frameRate.fps_den,n=t.frameRate.fps_num;if(t.refSampleDuration=i/n*1e3,t.codec=e.codec_mimetype,this.video_metadata_.av1c)t.av1c=this.video_metadata_.av1c,0==this.video_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first AV1 for mimeType: ".concat(t.codec));else if(this.video_metadata_.vps){var a=this.video_metadata_.vps.data.subarray(4),o=this.video_metadata_.sps.data.subarray(4),s=this.video_metadata_.pps.data.subarray(4),d=new fe(a,o,s,e);t.hvcc=d.getData(),0==this.video_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(t.codec))}else{o=this.video_metadata_.sps.data.subarray(4),s=this.video_metadata_.pps.data.subarray(4);var _=new F(o,s,e);t.avcc=_.getData(),0==this.video_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(t.codec))}this.onTrackMetadata("video",t),this.video_init_segment_dispatched_=!0,this.video_init_dispatch_time_=Date.now(),this.video_metadata_changed_=!1;var h=this.media_info_;h.hasVideo=!0,h.width=t.codecWidth,h.height=t.codecHeight,h.fps=t.frameRate.fps,h.profile=t.profile,h.level=t.level,h.refFrames=e.ref_frames,h.chromaFormat=e.chroma_format_string,h.sarNum=t.sarRatio.width,h.sarDen=t.sarRatio.height,h.videoCodec=t.codec,h.hasAudio&&h.audioCodec?h.mimeType='video/mp2t; codecs="'.concat(h.videoCodec,",").concat(h.audioCodec,'"'):h.mimeType='video/mp2t; codecs="'.concat(h.videoCodec,'"'),h.isComplete()&&this.onMediaInfo(h)},t.prototype.dispatchVideoMediaSegment=function(){this.isInitSegmentDispatched()&&this.video_track_.length&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){this.isInitSegmentDispatched()&&this.audio_track_.length&&this.onDataAvailable(this.audio_track_,null)},t.prototype.stashAudioBeforeVideoInit=function(e,t,i){this.stashed_audio_before_video_init_.push({codec:e,data:t,pts:i})},t.prototype.dispatchAudioVideoMediaSegment=function(){if(this.video_init_segment_dispatched_&&this.stashed_audio_before_video_init_.length>0){var e=this.stashed_audio_before_video_init_.length;r.A.v(this.TAG,"[muvie] Flushing ".concat(e," stashed audio payload(s) now that video init is dispatched"));var t=this.stashed_audio_before_video_init_;this.stashed_audio_before_video_init_=[];for(var i=0,n=t;i<n.length;i++){var a=n[i];switch(a.codec){case"aac":this.parseADTSAACPayload(a.data,a.pts);break;case"aac-loas":this.parseLOASAACPayload(a.data,a.pts);break;case"ac-3":this.parseAC3Payload(a.data,a.pts);break;case"ec-3":this.parseEAC3Payload(a.data,a.pts);break;case"opus":this.parseOpusPayload(a.data,a.pts);break;case"mp3":this.parseMP3Payload(a.data,a.pts)}}}if(this.isInitSegmentDispatched()){if(!this.video_keyframe_seen_after_init_&&this.video_track_.samples.length>0&&this.video_track_.samples.some(function(e){return e.isKeyframe})&&(r.A.v(this.TAG,"[muvie] H264: keyframe found in queued samples via retrospective scan — unblocking"),this.video_keyframe_seen_after_init_=!0),!this.video_keyframe_seen_after_init_&&this.video_init_dispatch_time_>0){var o=Date.now()-this.video_init_dispatch_time_;o>6e3&&(this.audio_track_.length||this.video_track_.length)&&(r.A.w(this.TAG,"[muvie] dispatchAV: no keyframe seen after ".concat(o,"ms — force-dispatching (fallback for strict MSE decoders)")),this.video_keyframe_seen_after_init_=!0)}var s=this.video_keyframe_seen_after_init_;s||(d="waiting for first keyframe after init",this._last_dispatch_block_reason_!==d&&(this._last_dispatch_block_reason_=d,r.A.v(this.TAG,"[muvie] dispatchAV blocked: ".concat(d)))),s&&(this._last_dispatch_block_reason_&&(r.A.v(this.TAG,"[muvie] dispatchAV unblocked — media segments now flowing"),this._last_dispatch_block_reason_=""),(this.audio_track_.length||this.video_track_.length)&&this.onDataAvailable(this.audio_track_,this.video_track_))}else{var d="waiting for init (video=".concat(this.video_init_segment_dispatched_," audio=").concat(this.audio_init_segment_dispatched_,")");this._last_dispatch_block_reason_!==d&&(this._last_dispatch_block_reason_=d,r.A.v(this.TAG,"[muvie] dispatchAV blocked: ".concat(d)))}},t.prototype.parseADTSAACPayload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var i=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);i.set(this.aac_last_incomplete_data_,0),i.set(e,this.aac_last_incomplete_data_.byteLength),e=i}var n,a;if(null!=t&&(a=t/this.timescale_),"aac"===this.audio_metadata_.codec){if(null==t&&null!=this.audio_last_sample_pts_)n=1024/this.audio_metadata_.sampling_frequency*1e3,a=this.audio_last_sample_pts_+n;else if(null==t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){n=1024/this.audio_metadata_.sampling_frequency*1e3;var o=this.audio_last_sample_pts_+n;Math.abs(o-a)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(o,"ms, PES pts: ").concat(a,"ms")),a=o)}}for(var s,d=new X(e),_=null,h=a;null!=(_=d.readNextAACFrame());){n=1024/_.sampling_frequency*1e3;var c={codec:"aac",data:_};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:_.audio_object_type,sampling_freq_index:_.sampling_freq_index,sampling_frequency:_.sampling_frequency,channel_config:_.channel_config},this.dispatchAudioInitSegment(c)):this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)),s=h;var l=Math.floor(h),u={unit:_.data,length:_.data.byteLength,pts:l,dts:l};this.audio_track_.samples.push(u),this.audio_track_.length+=_.data.byteLength,h+=n}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),s&&(this.audio_last_sample_pts_=s)}else this.stashAudioBeforeVideoInit("aac",e,t)},t.prototype.parseLOASAACPayload=function(e,t){var i;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var n=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);n.set(this.aac_last_incomplete_data_,0),n.set(e,this.aac_last_incomplete_data_.byteLength),e=n}var a,o;if(null!=t&&(o=t/this.timescale_),"aac"===this.audio_metadata_.codec){if(null==t&&null!=this.audio_last_sample_pts_)a=1024/this.audio_metadata_.sampling_frequency*1e3,o=this.audio_last_sample_pts_+a;else if(null==t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){a=1024/this.audio_metadata_.sampling_frequency*1e3;var s=this.audio_last_sample_pts_+a;Math.abs(s-o)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(s,"ms, PES pts: ").concat(o,"ms")),o=s)}}for(var d,_=new Y(e),h=null,c=o;null!=(h=_.readNextAACFrame(null!==(i=this.loas_previous_frame)&&void 0!==i?i:void 0));){this.loas_previous_frame=h,a=1024/h.sampling_frequency*1e3;var l={codec:"aac",data:h};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:h.audio_object_type,sampling_freq_index:h.sampling_freq_index,sampling_frequency:h.sampling_frequency,channel_config:h.channel_config},this.dispatchAudioInitSegment(l)):this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)),d=c;var u=Math.floor(c),p={unit:h.data,length:h.data.byteLength,pts:u,dts:u};this.audio_track_.samples.push(p),this.audio_track_.length+=h.data.byteLength,c+=a}_.hasIncompleteData()&&(this.aac_last_incomplete_data_=_.getIncompleteData()),d&&(this.audio_last_sample_pts_=d)}else this.stashAudioBeforeVideoInit("aac-loas",e,t)},t.prototype.parseAC3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var i,n;if(null!=t&&(n=t/this.timescale_),"ac-3"===this.audio_metadata_.codec)if(null==t&&null!=this.audio_last_sample_pts_)i=1536/this.audio_metadata_.sampling_frequency*1e3,n=this.audio_last_sample_pts_+i;else if(null==t)return void r.A.w(this.TAG,"AC3: Unknown pts");for(var a,o=new Ae(e),s=null,d=n;null!=(s=o.readNextAC3Frame());){i=1536/s.sampling_frequency*1e3;var _={codec:"ac-3",data:s};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"ac-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,bit_stream_mode:s.bit_stream_mode,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(_)):this.detectAudioMetadataChange(_)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(_)),a=d;var h=Math.floor(d),c={unit:s.data,length:s.data.byteLength,pts:h,dts:h};this.audio_track_.samples.push(c),this.audio_track_.length+=s.data.byteLength,d+=i}a&&(this.audio_last_sample_pts_=a)}else this.stashAudioBeforeVideoInit("ac-3",e,t)},t.prototype.parseEAC3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var i,n;if(null!=t&&(n=t/this.timescale_),"ec-3"===this.audio_metadata_.codec)if(null==t&&null!=this.audio_last_sample_pts_)i=256*this.audio_metadata_.num_blks/this.audio_metadata_.sampling_frequency*1e3,n=this.audio_last_sample_pts_+i;else if(null==t)return void r.A.w(this.TAG,"EAC3: Unknown pts");for(var a,o=new Ee(e),s=null,d=n;null!=(s=o.readNextEAC3Frame());){i=1536/s.sampling_frequency*1e3;var _={codec:"ec-3",data:s};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"ec-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,num_blks:s.num_blks,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(_)):this.detectAudioMetadataChange(_)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(_)),a=d;var h=Math.floor(d),c={unit:s.data,length:s.data.byteLength,pts:h,dts:h};this.audio_track_.samples.push(c),this.audio_track_.length+=s.data.byteLength,d+=i}a&&(this.audio_last_sample_pts_=a)}else this.stashAudioBeforeVideoInit("ec-3",e,t)},t.prototype.parseOpusPayload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var i,n;if(null!=t&&(n=t/this.timescale_),"opus"===this.audio_metadata_.codec)if(null==t&&null!=this.audio_last_sample_pts_)i=20,n=this.audio_last_sample_pts_+i;else if(null==t)return void r.A.w(this.TAG,"Opus: Unknown pts");for(var a,o=n,s=0;s<e.length;){i=20;for(var d=!!(16&e[s+1]),_=!!(8&e[s+1]),h=s+2,c=0;255===e[h];)c+=255,h+=1;c+=e[h],h+=1,h+=d?2:0,h+=_?2:0,a=o;var l=Math.floor(o),u=e.slice(h,h+c),p={unit:u,length:u.byteLength,pts:l,dts:l};this.audio_track_.samples.push(p),this.audio_track_.length+=u.byteLength,o+=i,s=h+c}a&&(this.audio_last_sample_pts_=a)}else this.stashAudioBeforeVideoInit("opus",e,t)},t.prototype.parseMP3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var i=e[1]>>>3&3,n=(6&e[1])>>1,a=(e[2],(12&e[2])>>>2),r=3&~(e[3]>>>6)?2:1,o=0,s=34;switch(i){case 0:o=[11025,12e3,8e3,0][a];break;case 2:o=[22050,24e3,16e3,0][a];break;case 3:o=[44100,48e3,32e3,0][a]}switch(n){case 1:s=34;break;case 2:s=33;break;case 3:s=32}var d=new ge;d.object_type=s,d.sample_rate=o,d.channel_count=r,d.data=e;var _={codec:"mp3",data:d};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"mp3",object_type:s,sample_rate:o,channel_count:r},this.dispatchAudioInitSegment(_)):this.detectAudioMetadataChange(_)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(_));var h={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_.samples.push(h),this.audio_track_.length+=e.byteLength,this.audio_last_sample_pts_=h.pts}else this.stashAudioBeforeVideoInit("mp3",e,t)},t.prototype.detectAudioMetadataChange=function(e){if(e.codec!==this.audio_metadata_.codec)return r.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(this.audio_metadata_.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((t=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return r.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(t.audio_object_type)),!0;if(t.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return r.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(t.sampling_freq_index)),!0;if(t.channel_config!==this.audio_metadata_.channel_config)return r.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(this.audio_metadata_.channel_config," to ").concat(t.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var t;if((t=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return r.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(this.audio_metadata_.sampling_frequency," to ").concat(t.sampling_frequency)),!0;if(t.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return r.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(t.bit_stream_identification)),!0;if(t.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return r.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(t.bit_stream_mode)),!0;if(t.channel_mode!==this.audio_metadata_.channel_mode)return r.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(t.channel_mode)),!0;if(t.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return r.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(t.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((i=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(i.sample_rate)),!0;if(i.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(i.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var i;if((i=e.data).object_type!==this.audio_metadata_.object_type)return r.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(i.object_type)),!0;if(i.sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(i.sample_rate)),!0;if(i.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(i.channel_count)),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t={type:"audio"};if(t.id=this.audio_track_.id,t.timescale=1e3,t.duration=this.duration_,"aac"===this.audio_metadata_.codec){var i="aac"===e.codec?e.data:null,n=new Q(i);t.audioSampleRate=n.sampling_rate,t.channelCount=n.channel_count,t.codec=n.codec_mimetype,t.originalCodec=n.original_codec_mimetype,t.config=n.config,t.refSampleDuration=1024/t.audioSampleRate*t.timescale}else if("ac-3"===this.audio_metadata_.codec){var a="ac-3"===e.codec?e.data:null,o=new Se(a);t.audioSampleRate=o.sampling_rate,t.channelCount=o.channel_count,t.codec=o.codec_mimetype,t.originalCodec=o.original_codec_mimetype,t.config=o.config,t.refSampleDuration=1536/t.audioSampleRate*t.timescale}else if("ec-3"===this.audio_metadata_.codec){var s="ec-3"===e.codec?e.data:null,d=new Re(s);t.audioSampleRate=d.sampling_rate,t.channelCount=d.channel_count,t.codec=d.codec_mimetype,t.originalCodec=d.original_codec_mimetype,t.config=d.config,t.refSampleDuration=256*d.num_blks/t.audioSampleRate*t.timescale}else"opus"===this.audio_metadata_.codec?(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.channelConfigCode=this.audio_metadata_.channel_config_code,t.codec="opus",t.originalCodec="opus",t.config=void 0,t.refSampleDuration=20):"mp3"===this.audio_metadata_.codec&&(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.codec="mp3",t.originalCodec="mp3",t.config=void 0,t.refSampleDuration=1152/t.audioSampleRate*t.timescale);0==this.audio_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(t.codec)),this.onTrackMetadata("audio",t),this.audio_init_segment_dispatched_=!0,this.audio_metadata_changed_=!1;var _=this.media_info_;_.hasAudio=!0,_.audioCodec=t.originalCodec,_.audioSampleRate=t.audioSampleRate,_.audioChannelCount=t.channelCount,_.hasVideo&&_.videoCodec?_.mimeType='video/mp2t; codecs="'.concat(_.videoCodec,",").concat(_.audioCodec,'"'):_.mimeType='video/mp2t; codecs="'.concat(_.audioCodec,'"'),_.isComplete()&&this.onMediaInfo(_)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,i){var n=new $;n.pid=e,n.stream_type=t,n.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(n)},t.prototype.parsePESPrivateDataPayload=function(e,t,i,n,a){var r=new Z;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}else r.nearest_pts=this.getNearestTimestampMilliseconds();if(null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}this.onPESPrivateData&&this.onPESPrivateData(r)},t.prototype.parseTimedID3MetadataPayload=function(e,t,i,n,a){var r=new Z;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}if(null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(r)},t.prototype.parsePGSPayload=function(e,t,i,n,a,r){var o=new Le;if(o.pid=n,o.lang=r,o.stream_id=a,o.len=e.byteLength,o.data=e,null!=t){var s=Math.floor(t/this.timescale_);o.pts=s}if(null!=i){var d=Math.floor(i/this.timescale_);o.dts=d}this.onPGSSubtitleData&&this.onPGSSubtitleData(o)},t.prototype.parseSynchronousKLVMetadataPayload=function(e,t,i,n,a){var r=new Te;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}if(null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}r.access_units=function(e){for(var t=[],i=0;i+5<e.byteLength;){var n=e[i+0],a=e[i+1],r=e[i+2],o=e[i+3]<<8|e[i+4],s=e.slice(i+5,i+5+o);t.push({service_id:n,sequence_number:a,flags:r,data:s}),i+=5+o}return t}(e),this.onSynchronousKLVMetadata&&this.onSynchronousKLVMetadata(r)},t.prototype.parseAsynchronousKLVMetadataPayload=function(e,t,i){var n=new Z;n.pid=t,n.stream_id=i,n.len=e.byteLength,n.data=e,this.onAsynchronousKLVMetadata&&this.onAsynchronousKLVMetadata(n)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,i,n,a){var r=new me;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}if(r.nearest_pts=this.getNearestTimestampMilliseconds(),null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}r.ancillaries=function(e){for(var t=new p(e),i=0,n=[];i+=6,0===t.readBits(6);){var a=t.readBool();i+=1;var r=t.readBits(11);i+=11;var o=t.readBits(12);i+=12;var s=255&t.readBits(10);i+=10;var d=255&t.readBits(10);i+=10;var _=255&t.readBits(10);i+=10;for(var h=new Uint8Array(_),c=0;c<_;c++){var l=255&t.readBits(10);i+=10,h[c]=l}t.readBits(10),i+=10;var u="User Defined";65===s?7===d&&(u="SCTE-104"):95===s?220===d?u="ARIB STD-B37 (1SEG)":221===d?u="ARIB STD-B37 (ANALOG)":222===d?u="ARIB STD-B37 (SD)":223===d&&(u="ARIB STD-B37 (HD)"):97===s&&(1===d?u="EIA-708":2===d&&(u="EIA-608")),n.push({yc_indicator:a,line_number:r,horizontal_offset:o,did:s,sdid:d,user_data:h,description:u,information:{}}),t.readBits(8-(i-Math.floor(i/8))%8),i+=(8-(i-Math.floor(i/8)))%8}return t.destroy(),t=null,n}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(r)},t.prototype.parseSEIPayload=function(e,t,i){var n=T(e,null!=t?Math.floor(t/this.timescale_):void 0,i);n&&this.onSEI&&this.onSEI(n)},t.prototype.getNearestTimestampMilliseconds=function(){return null!=this.audio_last_sample_pts_?Math.floor(this.audio_last_sample_pts_):null!=this.last_pcr_?Math.floor(this.last_pcr_/300/this.timescale_):void 0},t.prototype.getPcrBase=function(e){var t=33554432*e[6]+131072*e[7]+512*e[8]+2*e[9]+(128&e[10])/128+this.timestamp_offset_;return t+4294967296<this.last_pcr_base_&&(t+=8589934592,this.timestamp_offset_+=8589934592),this.last_pcr_base_=t,t},t.prototype.getTimestamp=function(e,t){var i=536870912*(14&e[t])+4194304*(255&e[t+1])+16384*(254&e[t+2])+128*(255&e[t+3])+(254&e[t+4])/2+this.timestamp_offset_;return i+4294967296<this.last_pcr_base_&&(i+=8589934592),i},t}(w);const Me=De;var Be=function(e,t,i){if(i||2===arguments.length)for(var n,a=0,r=t.length;a<r;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},Oe=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],chnl:[],".mp3":[],Opus:[],dOps:[],fLaC:[],dfLa:[],ipcm:[],pcmC:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([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]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e.box=function(e){for(var t=8,i=null,n=Array.prototype.slice.call(arguments,1),a=n.length,r=0;r<a;r++)t+=n[r].byteLength;(i=new Uint8Array(t))[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);var o=8;for(r=0;r<a;r++)i.set(n[r],o),o+=n[r].byteLength;return i},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),n=e.moov(t),a=new Uint8Array(i.byteLength+n.byteLength);return a.set(i,0),a.set(n,i.byteLength),a},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),n=e.trak(t),a=e.mvex(t);return e.box(e.types.moov,i,n,a)},e.mvhd=function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>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,a=t.presentWidth,r=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,a>>>8&255,255&a,0,0,r>>>8&255,255&r,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;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;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(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return 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))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"ec-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ec3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):"flac"==t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.fLaC(t)):"ipcm"==t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ipcm(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):"video"===t.type&&t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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"],a)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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,a,e.esds(t))},e.ac3=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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["ac-3"],a,e.box(e.types.dac3,new Uint8Array(t.config)))},e.ec3=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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["ec-3"],a,e.box(e.types.dec3,new Uint8Array(t.config)))},e.esds=function(t){var i=t.config||[],n=i.length,a=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,a)},e.Opus=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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.Opus,a,e.dOps(t))},e.dOps=function(t){var i=t.channelCount,n=t.channelConfigCode,a=t.audioSampleRate;if(t.config)return e.box(e.types.dOps,t.config);var r=[];switch(n){case 1:case 2:r=[0];break;case 0:r=[255,1,1,0,1];break;case 128:r=[255,2,0,0,1];break;case 3:r=[1,2,1,0,2,1];break;case 4:r=[1,2,2,0,1,2,3];break;case 5:r=[1,3,2,0,4,1,2,3];break;case 6:r=[1,4,2,0,4,1,2,3,5];break;case 7:r=[1,4,2,0,4,1,2,3,5,6];break;case 8:r=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:r=[1,1,2,0,1];break;case 131:r=[1,1,3,0,1,2];break;case 132:r=[1,1,4,0,1,2,3];break;case 133:r=[1,1,5,0,1,2,3,4];break;case 134:r=[1,1,6,0,1,2,3,4,5];break;case 135:r=[1,1,7,0,1,2,3,4,5,6];break;case 136:r=[1,1,8,0,1,2,3,4,5,6,7]}var o=new Uint8Array(Be([0,i,0,0,a>>>24&255,a>>>17&255,a>>>8&255,a>>>0&255,0,0],r,!0));return e.box(e.types.dOps,o)},e.fLaC=function(t){var i=t.channelCount,n=Math.min(t.audioSampleRate,65535),a=t.sampleSize,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,a,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.fLaC,r,e.dfLa(t))},e.dfLa=function(t){var i=new Uint8Array(Be([0,0,0,0],t.config,!0));return e.box(e.types.dfLa,i)},e.ipcm=function(t){var i=t.channelCount,n=Math.min(t.audioSampleRate,65535),a=t.sampleSize,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,a,0,0,0,0,n>>>8&255,255&n,0,0]);return 1===t.channelCount?e.box(e.types.ipcm,r,e.pcmC(t)):e.box(e.types.ipcm,r,e.chnl(t),e.pcmC(t))},e.chnl=function(t){var i=new Uint8Array([0,0,0,0,1,t.channelCount,0,0,0,0,0,0,0,0]);return e.box(e.types.chnl,i)},e.pcmC=function(t){var i=t.littleEndian?1:0,n=t.sampleSize,a=new Uint8Array([0,0,0,0,i,n]);return e.box(e.types.pcmC,a)},e.avc1=function(t){var i=t.avcc,n=t.codecWidth,a=t.codecHeight,r=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,a>>>8&255,255&a,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,r,e.box(e.types.avcC,i))},e.hvc1=function(t){var i=t.hvcc,n=t.codecWidth,a=t.codecHeight,r=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,a>>>8&255,255&a,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.hvc1,r,e.box(e.types.hvcC,i))},e.av01=function(t){var i=t.av1c,n=t.codecWidth||192,a=t.codecHeight||108,r=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,a>>>8&255,255&a,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.av01,r,e.box(e.types.av1C,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,a=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),r=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),s=e.trun(t,o.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,a,r,s,o)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,a=new Uint8Array(4+n),r=0;r<n;r++){var o=i[r].flags;a[r+4]=o.isLeading<<6|o.dependsOn<<4|o.isDependedOn<<2|o.hasRedundancy}return e.box(e.types.sdtp,a)},e.trun=function(t,i){var n=t.samples||[],a=n.length,r=12+16*a,o=new Uint8Array(r);i+=8+r,o.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,255&a,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s<a;s++){var d=n[s].duration,_=n[s].size,h=n[s].flags,c=n[s].cts;o.set([d>>>24&255,d>>>16&255,d>>>8&255,255&d,_>>>24&255,_>>>16&255,_>>>8&255,255&_,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.isNonSync,0,0,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*s)}return e.box(e.types.trun,o)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();Oe.init();const Pe=Oe,Ie=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return 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])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();var xe=i(544);const Ue=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new xe.Sc("audio"),this._videoSegmentInfoList=new xe.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!o.A.chrome||!(o.A.version.major<50||50===o.A.version.major&&o.A.version.build<2661)),this._fillSilentAfterSeek=o.A.msedge||o.A.msie,this._mp3UseMpegAudio=!o.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new c.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,n="mp4",a=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",a="",i=new Uint8Array):i=Pe.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Pe.generateInitSegment(t)}if(!this._onInitSegment)throw new c.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:a,container:"".concat(e,"/").concat(n),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e&&e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t&&t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var i,n=e,a=n.samples,s=void 0,d=-1,_=this._audioMeta.refSampleDuration,h="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,c=this._dtsBaseInited&&void 0===this._audioNextDts,l=!1;if(a&&0!==a.length&&(1!==a.length||t)){var u=0,p=null,f=0;h?(u=0,f=n.length):(u=8,f=8+n.length);var m=null;if(a.length>1&&(f-=(m=a.pop()).length),null!=this._audioStashedLastSample){var g=this._audioStashedLastSample;this._audioStashedLastSample=null,a.unshift(g),f+=g.length}null!=m&&(this._audioStashedLastSample=m);var v=a[0].dts-this._dtsBase;if(this._audioNextDts)s=v-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())s=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(l=!0);else{var y=this._audioSegmentInfoList.getLastSampleBefore(v);if(null!=y){var A=v-(y.originalDts+y.duration);A<=3&&(A=0),s=v-(y.dts+y.duration+A)}else s=0}if(l){var S=v-s,b=this._videoSegmentInfoList.getLastSegmentBefore(v);if(null!=b&&b.beginDts<S){if(O=Ie.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount)){var E=b.beginDts,R=S-b.beginDts;r.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(E,", duration: ").concat(R)),a.unshift({unit:O,dts:E,pts:E}),f+=O.byteLength}}else l=!1}for(var T=[],k=0;k<a.length;k++){var L=(g=a[k]).unit,w=g.dts-this._dtsBase,C=(E=w,!1),D=null,M=0;if(!(w<-.001)){if("mp3"!==this._audioMeta.codec&&null!=_){var B=w;if(this._audioNextDts&&(B=this._audioNextDts),(s=w-B)<=-3*_){r.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(w," ms ,curRefDts: ").concat(B," ms) due to dtsCorrection: ").concat(s," ms overlap."));continue}if(s>=3*_&&this._fillAudioTimestampGap&&!o.A.safari){C=!0;var O,P=Math.floor(s/_);r.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(w," ms, curRefDts: ").concat(B," ms, ")+"dtsCorrection: ".concat(Math.round(s)," ms, generate: ").concat(P," frames")),E=Math.floor(B),M=Math.floor(B+_)-E,null==(O=Ie.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))&&(r.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),O=L),D=[];for(var I=0;I<P;I++){B+=_;var x=Math.floor(B),U=Math.floor(B+_)-x,N={dts:x,pts:x,cts:0,unit:O,size:O.byteLength,duration:U,originalDts:w,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};D.push(N),f+=N.size}this._audioNextDts=B+_}else E=Math.floor(B),M=Math.floor(B+_)-E,this._audioNextDts=B+_}else E=w-s,M=k!==a.length-1?a[k+1].dts-this._dtsBase-s-E:null!=m?m.dts-this._dtsBase-s-E:T.length>=1?T[T.length-1].duration:Math.floor(_),this._audioNextDts=E+M;-1===d&&(d=E),T.push({dts:E,pts:E,cts:0,unit:g.unit,size:g.unit.byteLength,duration:M,originalDts:w,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),C&&T.push.apply(T,D)}}if(0===T.length)return n.samples=[],void(n.length=0);for(h?p=new Uint8Array(f):((p=new Uint8Array(f))[0]=f>>>24&255,p[1]=f>>>16&255,p[2]=f>>>8&255,p[3]=255&f,p.set(Pe.types.mdat,4)),k=0;k<T.length;k++)L=T[k].unit,p.set(L,u),u+=L.byteLength;var V=T[T.length-1];i=V.dts+V.duration;var G=new xe.EZ;G.beginDts=d,G.endDts=i,G.beginPts=d,G.endPts=i,G.originalBeginDts=T[0].originalDts,G.originalEndDts=V.originalDts+V.duration,G.firstSample=new xe.$_(T[0].dts,T[0].pts,T[0].duration,T[0].originalDts,!1),G.lastSample=new xe.$_(V.dts,V.pts,V.duration,V.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(G),n.samples=T,n.sequenceNumber++;var F;F=h?new Uint8Array:Pe.moof(n,d),n.samples=[],n.length=0;var j={type:"audio",data:this._mergeBoxes(F,p).buffer,sampleCount:T.length,info:G};h&&c&&(j.timestampOffset=d),this._onMediaSegment("audio",j)}}},e.prototype._remuxVideo=function(e,t){if(null!=this._videoMeta){var i,n,a=e,r=a.samples,o=void 0,s=-1,d=-1;if(r&&0!==r.length&&(1!==r.length||t)){var _=8,h=null,c=8+e.length,l=null;if(r.length>1&&(c-=(l=r.pop()).length),null!=this._videoStashedLastSample){var u=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(u),c+=u.length}null!=l&&(this._videoStashedLastSample=l);var p=r[0].dts-this._dtsBase;if(this._videoNextDts)o=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{var f=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=f){var m=p-(f.originalDts+f.duration);m<=3&&(m=0),o=p-(f.dts+f.duration+m)}else o=0}for(var g=new xe.EZ,v=[],y=0;y<r.length;y++){var A=(u=r[y]).dts-this._dtsBase,S=u.isKeyframe,b=A-o,E=u.cts,R=b+E;-1===s&&(s=b,d=R);var T=0;if(T=y!==r.length-1?r[y+1].dts-this._dtsBase-o-b:null!=l?l.dts-this._dtsBase-o-b:v.length>=1?v[v.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),S){var k=new xe.$_(b,R,T,u.dts,!0);k.fileposition=u.fileposition,g.appendSyncPoint(k)}v.push({dts:b,pts:R,cts:E,units:u.units,size:u.length,isKeyframe:S,duration:T,originalDts:A,flags:{isLeading:0,dependsOn:S?2:1,isDependedOn:S?1:0,hasRedundancy:0,isNonSync:S?0:1}})}for((h=new Uint8Array(c))[0]=c>>>24&255,h[1]=c>>>16&255,h[2]=c>>>8&255,h[3]=255&c,h.set(Pe.types.mdat,4),y=0;y<v.length;y++)for(var L=v[y].units;L.length;){var w=L.shift().data;h.set(w,_),_+=w.byteLength}var C=v[v.length-1];if(i=C.dts+C.duration,n=C.pts+C.duration,this._videoNextDts=i,g.beginDts=s,g.endDts=i,g.beginPts=d,g.endPts=n,g.originalBeginDts=v[0].originalDts,g.originalEndDts=C.originalDts+C.duration,g.firstSample=new xe.$_(v[0].dts,v[0].pts,v[0].duration,v[0].originalDts,v[0].isKeyframe),g.lastSample=new xe.$_(C.dts,C.pts,C.duration,C.originalDts,C.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),a.samples=v,a.sequenceNumber++,this._forceFirstIDR){var D=v[0].flags;D.dependsOn=2,D.isNonSync=0}var M=Pe.moof(a,s);a.samples=[],a.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(M,h).buffer,sampleCount:v.length,info:g})}}},e.prototype._mergeBoxes=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i},e}();var Ne=i(254),Ve=i(726);i(925);const Ge=function(){function e(e,t){this.TAG="TransmuxingController",this._emitter=new(a()),this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var i=0;this._mediaDataSource.segments.forEach(function(n){n.timestampBase=i,i+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)}),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),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 Ne.A(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.switchAudioPid=function(e){this._demuxer&&("function"==typeof this._demuxer.setPreferredAudioPid&&this._demuxer.setPreferredAudioPid(e),"function"==typeof this._demuxer.selectAudioPid&&this._demuxer.selectAudioPid(e))},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(null==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 a=this._mediaInfo.segments[t];null==a?(this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t)):(n=a.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,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){for(var t=this._mediaDataSource.segments,i=t.length-1,n=0;n<t.length;n++)if(e<t[n].timestampBase){i=n-1;break}return i},e.prototype._onInitChunkArrival=function(e,t){var i=this,n=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,n=this._demuxer.parseChunks(e,t);else{var a=null;(a=L.probe(e)).match&&(this._setupFLVDemuxerRemuxer(a),n=this._demuxer.parseChunks(e,t)),a.match||a.needMoreData||(a=Me.probe(e)).match&&(this._setupTSDemuxerRemuxer(a),n=this._demuxer.parseChunks(e,t)),a.match||a.needMoreData||(a=null,r.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then(function(){i._internalAbort()}),this._emitter.emit(Ve.A.DEMUX_ERROR,m.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return n},e.prototype._setupFLVDemuxerRemuxer=function(e){this._demuxer=new L(e,this._config),this._remuxer||(this._remuxer=new Ue(this._config));var t=this._mediaDataSource;null==t.duration||isNaN(t.duration)||(this._demuxer.overridedDuration=t.duration),"boolean"==typeof t.hasAudio&&(this._demuxer.overridedHasAudio=t.hasAudio),"boolean"==typeof t.hasVideo&&(this._demuxer.overridedHasVideo=t.hasVideo),this._demuxer.timestampBase=t.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._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._demuxer.onTracksUpdated=this._onTracksUpdated.bind(this),this._demuxer.onSeiArrived=this._onSEI.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new Me(e,this._config);this._remuxer||(this._remuxer=new Ue(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onPGSSubtitleData=this._onPGSSubtitle.bind(this),t.onSynchronousKLVMetadata=this._onSynchronousKLVMetadata.bind(this),t.onAsynchronousKLVMetadata=this._onAsynchronousKLVMetadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSEI=this._onSEI.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onTracksUpdated=this._onTracksUpdated.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},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,s.A.prototype));var i=Object.assign({},e);Object.setPrototypeOf(i,s.A.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(Ve.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(Ve.A.SCRIPTDATA_ARRIVED,e)},e.prototype._onTracksUpdated=function(e){this._emitter.emit(Ve.A.TRACKS_UPDATED,e)},e.prototype._onTimedID3Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ve.A.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onPGSSubtitle=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ve.A.PGS_SUBTITLE_ARRIVED,e))},e.prototype._onSynchronousKLVMetadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ve.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,e))},e.prototype._onAsynchronousKLVMetadata=function(e){this._emitter.emit(Ve.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,e)},e.prototype._onSMPTE2038Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),this._emitter.emit(Ve.A.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSEI=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),this._emitter.emit(Ve.A.SEI_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),this._emitter.emit(Ve.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(Ve.A.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ve.A.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(Ve.A.LOADING_COMPLETE),this._disableStatisticsReporter())},e.prototype._onIORedirect=function(e){var t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e},e.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(Ve.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){r.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(Ve.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){r.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(Ve.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(Ve.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(Ve.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var i=t.info.syncPoints,n=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.A.safari&&i.length>0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(Ve.A.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(Ve.A.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(Ve.A.STATISTICS_INFO,e)},e}()},514(e,t,i){"use strict";i(641),i(540),i(262),i(562),i(726)},134(e,t,i){"use strict";i.d(t,{A:()=>n});const n={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},215(e,t,i){e.exports=i(103).default},254(e,t,i){"use strict";i.d(t,{A:()=>A});var n=i(641);const a=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();var r,o=i(925),s=i(9),d=i(816),_=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});const h=function(e){function t(t,i){var n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._requestAbort=!1,n._abortController=null,n._contentLength=null,n._receivedLength=0,n}return _(t,e),t.isSupported=function(){try{var e=s.A.msedge&&s.A.version.minor>=15048,t=!s.A.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){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&&null!=e.redirectedURL&&(n=e.redirectedURL);var a=this._seekHandler.getConfig(n,t),r=new self.Headers;if("object"==typeof a.headers){var s=a.headers;for(var _ in s)s.hasOwnProperty(_)&&r.append(_,s[_])}var h={method:"GET",headers:r,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var _ in this._config.headers)r.append(_,this._config.headers[_]);!1===e.cors&&(h.mode="same-origin"),e.withCredentials&&(h.credentials="include"),e.referrerPolicy&&(h.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,h.signal=this._abortController.signal),this._status=o.eO.kConnecting,self.fetch(a.url,h).then(function(e){if(i._requestAbort)return i._status=o.eO.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==a.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=o.eO.kError,!i._onError)throw new d.Al("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}).catch(function(e){if(!i._abortController||!i._abortController.signal.aborted){if(i._status=o.eO.kError,!i._onError)throw e;i._onError(o.Xv.EXCEPTION,{code:-1,msg:e.message})}})},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==o.eO.kBuffering||!s.A.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then(function(i){if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=o.eO.kError;var n=o.Xv.EARLY_EOF,a={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new d.Al(a.msg);t._onError(n,a)}else t._status=o.eO.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(t._abortController&&t._abortController.signal.aborted)return void(t._status=o.eO.kComplete);if(!0===t._requestAbort)return t._status=o.eO.kComplete,e.cancel();t._status=o.eO.kBuffering;var r=i.value.buffer,s=t._range.from+t._receivedLength;t._receivedLength+=r.byteLength,t._onDataArrival&&t._onDataArrival(r,s,t._receivedLength),t._pump(e)}}).catch(function(e){if(t._abortController&&t._abortController.signal.aborted)t._status=o.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=o.eO.kError;var i=0,n=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(i=o.Xv.EXCEPTION,n={code:e.code,msg:e.message}):(i=o.Xv.EARLY_EOF,n={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new d.Al(n.msg);t._onError(i,n)}})},t}(o.HC);var c=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const l=function(e){function t(t,i){var n=e.call(this,"xhr-moz-chunked-loader")||this;return n.TAG="MozChunkedLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return c(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(e){return n.A.w("MozChunkedLoader",e.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&&null!=e.redirectedURL&&(i=e.redirectedURL);var n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",n.url,!0),a.responseType="moz-chunked-arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onloadend=this._onLoadEnd.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"==typeof n.headers){var r=n.headers;for(var s in r)r.hasOwnProperty(s)&&a.setRequestHeader(s,r[s])}if("object"==typeof this._config.headers)for(var s in r=this._config.headers)r.hasOwnProperty(s)&&a.setRequestHeader(s,r[s]);this._status=o.eO.kConnecting,a.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=o.eO.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=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=o.eO.kError,!this._onError)throw new d.Al("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=o.eO.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==o.eO.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){!0!==this._requestAbort?this._status!==o.eO.kError&&(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=o.eO.kError;var t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=o.Xv.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=o.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d.Al(i.msg);this._onError(t,i)},t}(o.HC);var u=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();!function(e){function t(t,i){var n=e.call(this,"xhr-msstream-loader")||this;return n.TAG="MSStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._reader=null,n._totalRange=null,n._currentRange=null,n._currentRequestURL=null,n._currentRedirectedURL=null,n._contentLength=null,n._receivedLength=0,n._bufferLimit=16777216,n._lastTimeBufferSize=0,n._isReconnecting=!1,n}u(t,e),t.isSupported=function(){try{if(void 0===self.MSStream||void 0===self.MSStreamReader)return!1;var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="ms-stream","ms-stream"===e.responseType}catch(e){return n.A.w("MSStreamLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._internalOpen(e,t,!1)},t.prototype._internalOpen=function(e,t,i){this._dataSource=e,i?this._currentRange=t:this._totalRange=t;var n=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?n=this._currentRedirectedURL:null!=e.redirectedURL&&(n=e.redirectedURL));var a=this._seekHandler.getConfig(n,t);this._currentRequestURL=a.url;var r=this._reader=new self.MSStreamReader;r.onprogress=this._msrOnProgress.bind(this),r.onload=this._msrOnLoad.bind(this),r.onerror=this._msrOnError.bind(this);var s=this._xhr=new XMLHttpRequest;if(s.open("GET",a.url,!0),s.responseType="ms-stream",s.onreadystatechange=this._xhrOnReadyStateChange.bind(this),s.onerror=this._xhrOnError.bind(this),e.withCredentials&&(s.withCredentials=!0),"object"==typeof a.headers){var d=a.headers;for(var _ in d)d.hasOwnProperty(_)&&s.setRequestHeader(_,d[_])}if("object"==typeof this._config.headers)for(var _ in d=this._config.headers)d.hasOwnProperty(_)&&s.setRequestHeader(_,d[_]);this._isReconnecting?this._isReconnecting=!1:this._status=o.eO.kConnecting,s.send()},t.prototype.abort=function(){this._internalAbort(),this._status=o.eO.kComplete},t.prototype._internalAbort=function(){this._reader&&(1===this._reader.readyState&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)},t.prototype._xhrOnReadyStateChange=function(e){var t=e.target;if(2===t.readyState)if(t.status>=200&&t.status<=299){if(this._status=o.eO.kBuffering,null!=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 a=parseInt(n);a>0&&(this._contentLength=a,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=o.eO.kError,!this._onError)throw new d.Al("MSStreamLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else if(3===t.readyState&&t.status>=200&&t.status<=299){this._status=o.eO.kBuffering;var r=t.response;this._reader.readAsArrayBuffer(r)}},t.prototype._xhrOnError=function(e){this._status=o.eO.kError;var t=o.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type};if(!this._onError)throw new d.Al(i.msg);this._onError(t,i)},t.prototype._msrOnProgress=function(e){var t=e.target.result;if(null!=t){var i=t.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=t.byteLength;var a=this._totalRange.from+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,a,this._receivedLength),t.byteLength>=this._bufferLimit&&(n.A.v(this.TAG,"MSStream buffer exceeded max size near ".concat(a+i.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}else this._doReconnectIfNeeded()},t.prototype._doReconnectIfNeeded=function(){if(null==this._contentLength||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var e={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,e,!0)}},t.prototype._msrOnLoad=function(e){this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)},t.prototype._msrOnError=function(e){this._status=o.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength<this._contentLength?(t=o.Xv.EARLY_EOF,i={code:-1,msg:"MSStream meet Early-Eof"}):(t=o.Xv.EARLY_EOF,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d.Al(i.msg);this._onError(t,i)}}(o.HC);var p=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const f=function(e){function t(t,i){var n=e.call(this,"xhr-range-loader")||this;return n.TAG="RangeLoader",n._seekHandler=t,n._config=i,n._needStash=!1,n._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],n._currentChunkSizeKB=384,n._currentSpeedNormalized=0,n._zeroSpeedChunkCount=0,n._xhr=null,n._speedSampler=new a,n._requestAbort=!1,n._waitForTotalLength=!1,n._totalLengthReceived=!1,n._currentRequestURL=null,n._currentRedirectedURL=null,n._currentRequestRange=null,n._totalLength=null,n._contentLength=null,n._receivedLength=0,n._lastTimeLoaded=0,n}return p(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return n.A.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=o.eO.kConnecting;var i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,i=t+e;null!=this._contentLength&&i-this._range.from>=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&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",n.url,!0),a.responseType="arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onload=this._onLoad.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"==typeof n.headers){var r=n.headers;for(var o in r)r.hasOwnProperty(o)&&a.setRequestHeader(o,r[o])}if("object"==typeof this._config.headers)for(var o in r=this._config.headers)r.hasOwnProperty(o)&&a.setRequestHeader(o,r[o]);a.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=o.eO.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(null!=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=o.eO.kBuffering}else{if(this._status=o.eO.kError,!this._onError)throw new d.Al("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==o.eO.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(-1===this._range.to?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,a=0,r=i;if(e<t[0])return t[0];for(;a<=r;){if((n=a+Math.floor((r-a)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?a=n+1:r=n-1}},t.prototype._onLoad=function(e){if(this._status!==o.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=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,a=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var r=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():r=!0,this._onDataArrival&&this._onDataArrival(n,a,this._receivedLength),r&&(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},t.prototype._onXhrError=function(e){this._status=o.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=o.Xv.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=o.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d.Al(i.msg);this._onError(t,i)},t}(o.HC);var m=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const g=function(e){function t(){var t=e.call(this,"websocket-loader")||this;return t.TAG="WebSocketLoader",t._needStash=!0,t._ws=null,t._requestAbort=!1,t._receivedLength=0,t}return m(t,e),t.isSupported=function(){try{return void 0!==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=o.eO.kConnecting}catch(e){this._status=o.eO.kError;var i={code:e.code,msg:e.message};if(!this._onError)throw new d.Al(i.msg);this._onError(o.Xv.EXCEPTION,i)}},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=o.eO.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=o.eO.kBuffering},t.prototype._onWebSocketClose=function(e){!0!==this._requestAbort?(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!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=o.eO.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new d.Al(n.msg);this._onError(o.Xv.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=o.eO.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new d.Al(t.msg);this._onError(o.Xv.EXCEPTION,t)},t}(o.HC),v=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i={};if(0!==t.from||-1!==t.to){var n;n=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(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}(),y=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var i=e;if(0!==t.from||-1!==t.to){var n=!0;-1===i.indexOf("?")&&(i+="?",n=!1),n&&(i+="&"),i+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(i+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:i,headers:{}}},e.prototype.removeURLParameters=function(e){var t=e.split("?")[0],i=void 0,n=e.indexOf("?");-1!==n&&(i=e.substring(n+1));var a="";if(null!=i&&i.length>0)for(var r=i.split("&"),o=0;o<r.length;o++){var s=r[o].split("="),d=o>0;s[0]!==this._startName&&s[0]!==this._endName&&(d&&(a+="&"),a+=r[o])}return 0===a.length?t:t+"?"+a},e}(),A=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=65536,null!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=Math.max(this._stashSize,3145728),this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new a,this._speedNormalizeList=[32,64,96,128,192,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},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===f?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new v(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new y(t,i)}else{if("custom"!==e.seekType)throw new d.Qn("Invalid seekType in config: ".concat(e.seekType));if("function"!=typeof e.customSeekHandler)throw new d.Qn("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=g;else if(h.isSupported())this._loaderClass=h;else if(l.isSupported())this._loaderClass=l;else{if(!f.isSupported())throw new d.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=f}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(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 d.Qn("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var i=new ArrayBuffer(t);if(this._stashUsed>0){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,a=0,r=i;if(e<t[0])return t[0];for(;a<=r;){if((n=a+Math.floor((r-a)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?a=n+1:r=n-1}},e.prototype._adjustStashSize=function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t},e.prototype._dispatchChunks=function(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)},e.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},e.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},e.prototype._onLoaderChunkArrival=function(e,t,i){if(!this._onDataArrival)throw new d.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var n=this._speedSampler.lastSecondKBps;if(0!==n){var a=this._normalizeSpeed(n);this._speedNormalized!==a&&(this._speedNormalized=a,this._adjustStashSize(a))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)(s=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else if(s=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var r=this._stashBuffer.slice(0,this._stashUsed);(_=this._dispatchChunks(r,this._stashByteStart))<r.byteLength?_>0&&(h=new Uint8Array(r,_),s.set(h,0),this._stashUsed=h.byteLength,this._stashByteStart+=_):(this._stashUsed=0,this._stashByteStart+=_),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),s=new Uint8Array(this._stashBuffer,0,this._bufferSize)),s.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(_=this._dispatchChunks(e,t))<e.byteLength&&((o=e.byteLength-_)>this._bufferSize&&(this._expandBuffer(o),s=new Uint8Array(this._stashBuffer,0,this._bufferSize)),s.set(new Uint8Array(e,_),0),this._stashUsed+=o,this._stashByteStart=t+_);else if(0===this._stashUsed){var o;(_=this._dispatchChunks(e,t))<e.byteLength&&((o=e.byteLength-_)>this._bufferSize&&this._expandBuffer(o),(s=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,_),0),this._stashUsed+=o,this._stashByteStart=t+_)}else{var s,_;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(s=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(_=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&_>0){var h=new Uint8Array(this._stashBuffer,_);s.set(h,0)}this._stashUsed-=_,this._stashByteStart+=_}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),a=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),o=new Uint8Array(t,i);r.set(o,0),this._stashUsed=o.byteLength,this._stashByteStart+=i}return 0}n.A.w(this.TAG,"".concat(a," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,a}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(n.A.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=o.Xv.UNRECOVERABLE_EARLY_EOF),e){case o.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var i=this._currentRange.to+1;return void(i<this._totalLength&&(n.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(i,!1)))}e=o.Xv.UNRECOVERABLE_EARLY_EOF;case o.Xv.UNRECOVERABLE_EARLY_EOF:case o.Xv.CONNECTING_TIMEOUT:case o.Xv.HTTP_STATUS_CODE_INVALID:case o.Xv.EXCEPTION:}if(!this._onError)throw new d.Al("IOException: "+t.msg);this._onError(e,t)},e}()},925(e,t,i){"use strict";i.d(t,{HC:()=>o,Xv:()=>r,eO:()=>a});var n=i(816),a={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},r={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},o=function(){function e(e){this._type=e||"undefined",this._status=a.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=a.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===a.kConnecting||this._status===a.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new n.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new n.Xu("Unimplemented abstract function!")},e}()},103(e,t,i){"use strict";i.d(t,{default:()=>P});var n=i(262),a=i(254),r={enableWorker:!1,enableWorkerForMSE:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,preferredAudioPid:0,liveBufferLatencyChasing:!1,liveBufferLatencyChasingOnPaused:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,liveSync:!1,liveSyncMaxLatency:1.2,liveSyncTargetLatency:.8,liveSyncPlaybackRate:1.2,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,headers:void 0,customLoader:void 0};function o(){return Object.assign({},r)}var s=function(){function e(){}return e.supportMSEH264Playback=function(){var e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',t=self.MediaSource&&self.MediaSource.isTypeSupported(e),i=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported(e);return t||i},e.supportMSEH265Playback=function(){var e='video/mp4; codecs="hvc1.1.6.L93.B0"',t=self.MediaSource&&self.MediaSource.isTypeSupported(e),i=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported(e);return t||i},e.supportNetworkStreamIO=function(){var e=new a.A({},o()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t},e.getNetworkLoaderTypeName=function(){var e=new a.A({},o()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"==i},e.getFeatureList=function(){var t={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.msePlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLivePlayback=t.msePlayback&&t.networkStreamIO,t.mseH265Playback=e.supportMSEH265Playback(),t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();const d=s;var _=i(925),h=i(641),c=i(402),l=i.n(c),u=i(217),p=i(117),f=i(824),m=i(403),g=i(270),v=i(816),y=i(726),A=i(9),S=i(544);const b=function(){function e(e,t,i){this.TAG="SeekingHandler",this._config=null,this._media_element=null,this._always_seek_keyframe=!1,this._on_unbuffered_seek=null,this._request_set_current_time=!1,this._seek_request_record_clocktime=null,this._idr_sample_list=new S.EX,this.e=null,this._config=e,this._media_element=t,this._on_unbuffered_seek=i,this.e={onMediaSeeking:this._onMediaSeeking.bind(this)};var n=A.A.chrome&&(A.A.version.major<50||50===A.A.version.major&&A.A.version.build<2661);this._always_seek_keyframe=!!(n||A.A.msedge||A.A.msie),this._always_seek_keyframe&&(this._config.accurateSeek=!1),this._media_element.addEventListener("seeking",this.e.onMediaSeeking)}return e.prototype.destroy=function(){this._idr_sample_list.clear(),this._idr_sample_list=null,this._media_element.removeEventListener("seeking",this.e.onMediaSeeking),this._media_element=null,this._on_unbuffered_seek=null},e.prototype.seek=function(e){var t=this._isPositionBuffered(e),i=!1;if(e<1&&this._media_element.buffered.length>0){var n=this._media_element.buffered.start(0);(n<1&&e<n||A.A.safari)&&(i=!0,e=A.A.safari?.1:n)}if(i)this.directSeek(e);else if(t)if(this._always_seek_keyframe){var a=this._getNearestKeyframe(Math.floor(1e3*e));null!=a&&(e=a.dts/1e3),this.directSeek(e)}else this.directSeek(e);else this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*e)),this._config.accurateSeek&&this.directSeek(e)},e.prototype.directSeek=function(e){this._request_set_current_time=!0,this._media_element.currentTime=e},e.prototype.appendSyncPoints=function(e){this._idr_sample_list.appendArray(e)},e.prototype._onMediaSeeking=function(t){if(this._request_set_current_time)this._request_set_current_time=!1;else{var i=this._media_element.currentTime,n=this._media_element.buffered;if(i<1&&n.length>0){var a=n.start(0);if(a<1&&i<a||A.A.safari){var r=A.A.safari?.1:a;return void this.directSeek(r)}}if(this._isPositionBuffered(i)){if(this._always_seek_keyframe){var o=this._getNearestKeyframe(Math.floor(1e3*i));null!=o&&(i=o.dts/1e3,this.directSeek(i))}}else this._seek_request_record_clocktime=e._getClockTime(),window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)}},e.prototype._pollAndApplyUnbufferedSeek=function(){if(null!=this._seek_request_record_clocktime)if(this._seek_request_record_clocktime<=e._getClockTime()-100){var t=this._media_element.currentTime;this._seek_request_record_clocktime=null,this._isPositionBuffered(t)||(this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*t)),this._config.accurateSeek&&this.directSeek(t))}else window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)},e.prototype._isPositionBuffered=function(e){for(var t=this._media_element.buffered,i=0;i<t.length;i++){var n=t.start(i),a=t.end(i);if(e>=n&&e<a)return!0}return!1},e.prototype._getNearestKeyframe=function(e){return this._idr_sample_list.getLastSyncPointBeforeDts(e)},e._getClockTime=function(){return self.performance&&self.performance.now?self.performance.now():Date.now()},e}(),E=function(){function e(e,t,i,n){this.TAG="LoadingController",this._config=null,this._media_element=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null,this._paused=!1,this.e=null,this._config=e,this._media_element=t,this._on_pause_transmuxer=i,this._on_resume_transmuxer=n,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)}}return e.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this.e=null,this._media_element=null,this._config=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null},e.prototype.notifyBufferedPositionChanged=function(e){!this._config.isLive&&this._config.lazyLoad&&(null==e?this._suspendTransmuxerIfNeeded():this._suspendTransmuxerIfBufferedPositionExceeded(e))},e.prototype._onMediaTimeUpdate=function(e){this._paused&&this._resumeTransmuxerIfNeeded()},e.prototype._suspendTransmuxerIfNeeded=function(){for(var e=this._media_element.buffered,t=this._media_element.currentTime,i=0,n=0;n<e.length;n++){var a=e.start(n),r=e.end(n);if(a<=t&&t<r){i=r;break}}i>0&&this._suspendTransmuxerIfBufferedPositionExceeded(i)},e.prototype._suspendTransmuxerIfBufferedPositionExceeded=function(e){e>=this._media_element.currentTime+this._config.lazyLoadMaxDuration&&!this._paused&&(h.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this.suspendTransmuxer(),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate))},e.prototype.suspendTransmuxer=function(){this._paused=!0,this._on_pause_transmuxer()},e.prototype._resumeTransmuxerIfNeeded=function(){for(var e=this._media_element.buffered,t=this._media_element.currentTime,i=this._config.lazyLoadRecoverDuration,n=!1,a=0;a<e.length;a++){var r=e.start(a),o=e.end(a);if(t>=r&&t<o){t>=o-i&&(n=!0);break}}n&&(h.A.v(this.TAG,"Continue loading from paused position"),this.resumeTransmuxer(),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate))},e.prototype.resumeTransmuxer=function(){this._paused=!1,this._on_resume_transmuxer()},e}(),R=function(){function e(e,t){this.TAG="StartupStallJumper",this._media_element=null,this._on_direct_seek=null,this._canplay_received=!1,this.e=null,this._media_element=e,this._on_direct_seek=t,this.e={onMediaCanPlay:this._onMediaCanPlay.bind(this),onMediaStalled:this._onMediaStalled.bind(this),onMediaProgress:this._onMediaProgress.bind(this)},this._media_element.addEventListener("canplay",this.e.onMediaCanPlay),this._media_element.addEventListener("stalled",this.e.onMediaStalled),this._media_element.addEventListener("progress",this.e.onMediaProgress)}return e.prototype.destroy=function(){this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay),this._media_element.removeEventListener("stalled",this.e.onMediaStalled),this._media_element.removeEventListener("progress",this.e.onMediaProgress),this._media_element=null,this._on_direct_seek=null},e.prototype._onMediaCanPlay=function(e){this._canplay_received=!0,this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay)},e.prototype._onMediaStalled=function(e){this._detectAndFixStuckPlayback(!0)},e.prototype._onMediaProgress=function(e){this._detectAndFixStuckPlayback()},e.prototype._detectAndFixStuckPlayback=function(e){var t=this._media_element,i=t.buffered;e||!this._canplay_received||t.readyState<2?i.length>0&&t.currentTime<i.start(0)&&(h.A.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(i.start(0))),this._on_direct_seek(i.start(0)),this._media_element.removeEventListener("progress",this.e.onMediaProgress)):this._media_element.removeEventListener("progress",this.e.onMediaProgress)},e}(),T=function(){function e(e,t,i){this._config=null,this._media_element=null,this._on_direct_seek=null,this._config=e,this._media_element=t,this._on_direct_seek=i}return e.prototype.destroy=function(){this._on_direct_seek=null,this._media_element=null,this._config=null},e.prototype.notifyBufferedRangeUpdate=function(){this._chaseLiveLatency()},e.prototype._chaseLiveLatency=function(){var e=this._media_element.buffered,t=this._media_element.currentTime,i=this._media_element.paused;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&0!=e.length&&(this._config.liveBufferLatencyChasingOnPaused||!i)){var n=e.end(e.length-1);if(n>this._config.liveBufferLatencyMaxLatency&&n-t>this._config.liveBufferLatencyMaxLatency){var a=n-this._config.liveBufferLatencyMinRemain;this._on_direct_seek(a)}}},e}(),k=function(){function e(e,t){this._config=null,this._media_element=null,this.e=null,this._config=e,this._media_element=t,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)},this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate)}return e.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element=null,this._config=null},e.prototype._onMediaTimeUpdate=function(e){if(this._config.isLive&&this._config.liveSync){var t=this._getCurrentLatency();if(t>this._config.liveSyncMaxLatency){var i=Math.min(2,Math.max(1,this._config.liveSyncPlaybackRate));this._media_element.playbackRate=i}else t>this._config.liveSyncTargetLatency||1!==this._media_element.playbackRate&&0!==this._media_element.playbackRate&&(this._media_element.playbackRate=1)}},e.prototype._getCurrentLatency=function(){if(!this._media_element)return 0;var e=this._media_element.buffered,t=this._media_element.currentTime;return 0==e.length?0:e.end(e.length-1)-t},e}(),L=function(){function e(e,t){this.TAG="PlayerEngineMainThread",this._emitter=new c,this._media_element=null,this._mse_controller=null,this._transmuxer=null,this._pending_seek_time=null,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._mse_source_opened=!1,this._has_pending_load=!1,this._loaded_metadata_received=!1,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=e,this._config=o(),"object"==typeof t&&Object.assign(this._config,t),!0===e.isLive&&(this._config.isLive=!0),this.e={onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this)}}return e.prototype.destroy=function(){this._emitter.emit(p.A.DESTROYING),this._transmuxer&&this.unload(),this._media_element&&this.detachMediaElement(),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;this._emitter.addListener(e,t),e===p.A.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return i._emitter.emit(p.A.MEDIA_INFO,i.mediaInfo)}):e==p.A.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return i._emitter.emit(p.A.STATISTICS_INFO,i.statisticsInfo)})},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t=this;this._media_element=e,e.src="",e.removeAttribute("src"),e.srcObject=null,e.load(),e.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._mse_controller=new u.A(this._config),this._mse_controller.on(m.A.UPDATE_END,this._onMSEUpdateEnd.bind(this)),this._mse_controller.on(m.A.BUFFER_FULL,this._onMSEBufferFull.bind(this)),this._mse_controller.on(m.A.SOURCE_OPEN,this._onMSESourceOpen.bind(this)),this._mse_controller.on(m.A.ERROR,this._onMSEError.bind(this)),this._mse_controller.on(m.A.START_STREAMING,this._onMSEStartStreaming.bind(this)),this._mse_controller.on(m.A.END_STREAMING,this._onMSEEndStreaming.bind(this)),this._mse_controller.initialize({getCurrentTime:function(){return t._media_element.currentTime},getReadyState:function(){return t._media_element.readyState}}),this._mse_controller.isManagedMediaSource()?(e.disableRemotePlayback=!0,e.srcObject=this._mse_controller.getObject()):e.src=this._mse_controller.getObjectURL()},e.prototype.detachMediaElement=function(){this._media_element&&(this._mse_controller.shutdown(),this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null,this._mse_controller.revokeObjectURL()),this._mse_controller&&(this._mse_controller.destroy(),this._mse_controller=null)},e.prototype.load=function(){var e=this;if(!this._media_element)throw new v.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new v.j4("load() has been called, please call unload() first!");this._has_pending_load||(!this._config.deferLoadAfterSourceOpen||this._mse_source_opened?(this._transmuxer=new f.A(this._media_data_source,this._config),this._transmuxer.on(y.A.INIT_SEGMENT,function(t,i){e._mse_controller.appendInitSegment(i)}),this._transmuxer.on(y.A.MEDIA_SEGMENT,function(t,i){e._mse_controller.appendMediaSegment(i),!e._config.isLive&&"video"===t&&i.data&&i.data.byteLength>0&&"info"in i&&e._seeking_handler.appendSyncPoints(i.info.syncPoints),e._loading_controller.notifyBufferedPositionChanged(i.info.endDts/1e3)}),this._transmuxer.on(y.A.LOADING_COMPLETE,function(){e._mse_controller.endOfStream(),e._emitter.emit(p.A.LOADING_COMPLETE)}),this._transmuxer.on(y.A.RECOVERED_EARLY_EOF,function(){e._emitter.emit(p.A.RECOVERED_EARLY_EOF)}),this._transmuxer.on(y.A.IO_ERROR,function(t,i){e._emitter.emit(p.A.ERROR,g.w.NETWORK_ERROR,t,i)}),this._transmuxer.on(y.A.DEMUX_ERROR,function(t,i){e._emitter.emit(p.A.ERROR,g.w.MEDIA_ERROR,t,i)}),this._transmuxer.on(y.A.MEDIA_INFO,function(t){e._media_info=t,e._emitter.emit(p.A.MEDIA_INFO,Object.assign({},t))}),this._transmuxer.on(y.A.STATISTICS_INFO,function(t){e._statistics_info=e._fillStatisticsInfo(t),e._emitter.emit(p.A.STATISTICS_INFO,Object.assign({},t))}),this._transmuxer.on(y.A.RECOMMEND_SEEKPOINT,function(t){e._media_element&&!e._config.accurateSeek&&e._seeking_handler.directSeek(t/1e3)}),this._transmuxer.on(y.A.METADATA_ARRIVED,function(t){e._emitter.emit(p.A.METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.SCRIPTDATA_ARRIVED,function(t){e._emitter.emit(p.A.SCRIPTDATA_ARRIVED,t)}),this._transmuxer.on(y.A.TRACKS_UPDATED,function(t){e._emitter.emit(p.A.TRACKS_UPDATED,t)}),this._transmuxer.on(y.A.TIMED_ID3_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.TIMED_ID3_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.PGS_SUBTITLE_ARRIVED,function(t){e._emitter.emit(p.A.PGS_SUBTITLE_ARRIVED,t)}),this._transmuxer.on(y.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.SMPTE2038_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.SMPTE2038_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.SEI_ARRIVED,function(t){e._emitter.emit(p.A.SEI_ARRIVED,t)}),this._transmuxer.on(y.A.SCTE35_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.SCTE35_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.PES_PRIVATE_DATA_DESCRIPTOR,function(t){e._emitter.emit(p.A.PES_PRIVATE_DATA_DESCRIPTOR,t)}),this._transmuxer.on(y.A.PES_PRIVATE_DATA_ARRIVED,function(t){e._emitter.emit(p.A.PES_PRIVATE_DATA_ARRIVED,t)}),this._seeking_handler=new b(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new E(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new R(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new T(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new k(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0),this._transmuxer.open()):this._has_pending_load=!0)},e.prototype.unload=function(){var e,t,i,n,a,r,o,s,d;null===(e=this._media_element)||void 0===e||e.pause(),null===(t=this._live_latency_synchronizer)||void 0===t||t.destroy(),this._live_latency_synchronizer=null,null===(i=this._live_latency_chaser)||void 0===i||i.destroy(),this._live_latency_chaser=null,null===(n=this._startup_stall_jumper)||void 0===n||n.destroy(),this._startup_stall_jumper=null,null===(a=this._loading_controller)||void 0===a||a.destroy(),this._loading_controller=null,null===(r=this._seeking_handler)||void 0===r||r.destroy(),this._seeking_handler=null,null===(o=this._mse_controller)||void 0===o||o.flush(),null===(s=this._transmuxer)||void 0===s||s.close(),null===(d=this._transmuxer)||void 0===d||d.destroy(),this._transmuxer=null},e.prototype.play=function(){return this._media_element.play()},e.prototype.pause=function(){this._media_element.pause()},e.prototype.seek=function(e){this._media_element&&this._seeking_handler?this._seeking_handler.seek(e):this._pending_seek_time=e},Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),e.prototype._onMSESourceOpen=function(){this._mse_source_opened=!0,this._has_pending_load&&(this._has_pending_load=!1,this.load())},e.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},e.prototype._onMSEBufferFull=function(){h.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},e.prototype._onMSEError=function(e){this._emitter.emit(p.A.ERROR,g.w.MEDIA_ERROR,g.v.MEDIA_MSE_ERROR,e)},e.prototype._onMSEStartStreaming=function(){this._loaded_metadata_received&&(this._config.isLive||(h.A.v(this.TAG,"Resume transmuxing task due to ManagedMediaSource onStartStreaming"),this._loading_controller.resumeTransmuxer()))},e.prototype._onMSEEndStreaming=function(){this._config.isLive||(h.A.v(this.TAG,"Suspend transmuxing task due to ManagedMediaSource onEndStreaming"),this._loading_controller.suspendTransmuxer())},e.prototype._onMediaLoadedMetadata=function(e){this._loaded_metadata_received=!0,null!=this._pending_seek_time&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},e.prototype._onRequestDirectSeek=function(e){this._seeking_handler.directSeek(e)},e.prototype._onRequiredUnbufferedSeek=function(e){this._mse_controller.flush(),this._transmuxer.seek(e)},e.prototype._onRequestPauseTransmuxer=function(){this._transmuxer.pause()},e.prototype._onRequestResumeTransmuxer=function(){this._transmuxer.resume()},e.prototype._fillStatisticsInfo=function(e){if(e.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._media_element.getVideoPlaybackQuality){var a=this._media_element.getVideoPlaybackQuality();i=a.totalVideoFrames,n=a.droppedVideoFrames}else null!=this._media_element.webkitDecodedFrameCount?(i=this._media_element.webkitDecodedFrameCount,n=this._media_element.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype.switchAudioPid=function(e){this._transmuxer&&this._transmuxer.switchAudioPid(e)},e}();var w=i(360),C=i(540);const D=function(){function e(e,t){this.TAG="PlayerEngineDedicatedThread",this._emitter=new c,this._media_element=null,this._worker_destroying=!1,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._pending_seek_time=null,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=e,this._config=o(),"object"==typeof t&&Object.assign(this._config,t),!0===e.isLive&&(this._config.isLive=!0),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this),onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this),onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this),onMediaReadyStateChanged:this._onMediaReadyStateChange.bind(this)},C.A.registerListener(this.e.onLoggingConfigChanged),this._worker=w(877,{all:!0}),this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",media_data_source:this._media_data_source,config:this._config}),this._worker.postMessage({cmd:"logging_config",logging_config:C.A.getConfig()})}return e.isSupported=function(){return!!(self.Worker&&(self.MediaSource&&"canConstructInDedicatedWorker"in self.MediaSource&&!0===self.MediaSource.canConstructInDedicatedWorker||self.ManagedMediaSource&&"canConstructInDedicatedWorker"in self.ManagedMediaSource&&!0===self.ManagedMediaSource.canConstructInDedicatedWorker))},e.prototype.destroy=function(){this._emitter.emit(p.A.DESTROYING),this.unload(),this.detachMediaElement(),this._worker_destroying=!0,this._worker.postMessage({cmd:"destroy"}),C.A.removeListener(this.e.onLoggingConfigChanged),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;this._emitter.addListener(e,t),e===p.A.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return i._emitter.emit(p.A.MEDIA_INFO,i.mediaInfo)}):e==p.A.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return i._emitter.emit(p.A.STATISTICS_INFO,i.statisticsInfo)})},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){this._media_element=e,this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.addEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._worker.postMessage({cmd:"initialize_mse"})},e.prototype.detachMediaElement=function(){this._worker.postMessage({cmd:"shutdown_mse"}),this._media_element&&(this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.removeEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null)},e.prototype.load=function(){this._worker.postMessage({cmd:"load"}),this._seeking_handler=new b(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new E(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new R(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new T(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new k(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0)},e.prototype.unload=function(){var e,t,i,n,a,r;null===(e=this._media_element)||void 0===e||e.pause(),this._worker.postMessage({cmd:"unload"}),null===(t=this._live_latency_synchronizer)||void 0===t||t.destroy(),this._live_latency_synchronizer=null,null===(i=this._live_latency_chaser)||void 0===i||i.destroy(),this._live_latency_chaser=null,null===(n=this._startup_stall_jumper)||void 0===n||n.destroy(),this._startup_stall_jumper=null,null===(a=this._loading_controller)||void 0===a||a.destroy(),this._loading_controller=null,null===(r=this._seeking_handler)||void 0===r||r.destroy(),this._seeking_handler=null},e.prototype.play=function(){return this._media_element.play()},e.prototype.pause=function(){this._media_element.pause()},e.prototype.seek=function(e){this._media_element&&this._seeking_handler?this._seeking_handler.seek(e):this._pending_seek_time=e},Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),e.prototype._onLoggingConfigChanged=function(e){var t;null===(t=this._worker)||void 0===t||t.postMessage({cmd:"logging_config",logging_config:e})},e.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},e.prototype._onMSEBufferFull=function(){h.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},e.prototype._onMediaLoadedMetadata=function(e){null!=this._pending_seek_time&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},e.prototype._onRequestDirectSeek=function(e){this._seeking_handler.directSeek(e)},e.prototype._onRequiredUnbufferedSeek=function(e){this._worker.postMessage({cmd:"unbuffered_seek",milliseconds:e})},e.prototype._onRequestPauseTransmuxer=function(){this._worker.postMessage({cmd:"pause_transmuxer"})},e.prototype._onRequestResumeTransmuxer=function(){this._worker.postMessage({cmd:"resume_transmuxer"})},e.prototype._onMediaTimeUpdate=function(e){this._worker.postMessage({cmd:"timeupdate",current_time:e.target.currentTime})},e.prototype._onMediaReadyStateChange=function(e){this._worker.postMessage({cmd:"readystatechange",ready_state:e.target.readyState})},e.prototype._onWorkerMessage=function(e){var t,i=e.data,n=i.msg;if("destroyed"==n||this._worker_destroying)return this._worker_destroying=!1,null===(t=this._worker)||void 0===t||t.terminate(),void(this._worker=null);switch(n){case"mse_init":var a=i;"ManagedMediaSource"in self&&!("MediaSource"in self)&&(this._media_element.disableRemotePlayback=!0),this._media_element.srcObject=a.handle;break;case"mse_event":(a=i).event==m.A.UPDATE_END?this._onMSEUpdateEnd():a.event==m.A.BUFFER_FULL&&this._onMSEBufferFull();break;case"transmuxing_event":if((a=i).event==y.A.MEDIA_INFO){var r=i;this._media_info=r.info,this._emitter.emit(p.A.MEDIA_INFO,Object.assign({},r.info))}else if(a.event==y.A.STATISTICS_INFO){var o=i;this._statistics_info=this._fillStatisticsInfo(o.info),this._emitter.emit(p.A.STATISTICS_INFO,Object.assign({},o.info))}else if(a.event==y.A.RECOMMEND_SEEKPOINT){var s=i;this._media_element&&!this._config.accurateSeek&&this._seeking_handler.directSeek(s.milliseconds/1e3)}break;case"player_event":if((a=i).event==p.A.ERROR){var d=i;this._emitter.emit(p.A.ERROR,d.error_type,d.error_detail,d.info)}else if("extraData"in a){var _=i;this._emitter.emit(_.event,_.extraData)}break;case"logcat_callback":a=i,h.A.emitter.emit("log",a.type,a.logcat);break;case"buffered_position_changed":a=i,this._loading_controller.notifyBufferedPositionChanged(a.buffered_position_milliseconds/1e3)}},e.prototype._fillStatisticsInfo=function(e){if(e.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._media_element.getVideoPlaybackQuality){var a=this._media_element.getVideoPlaybackQuality();i=a.totalVideoFrames,n=a.droppedVideoFrames}else null!=this._media_element.webkitDecodedFrameCount?(i=this._media_element.webkitDecodedFrameCount,n=this._media_element.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype.switchAudioPid=function(e){this._worker&&!this._worker_destroying&&this._worker.postMessage({cmd:"switch_audio_pid",pid:e})},e}(),M=function(){function e(e,t){this.TAG="MSEPlayer",this._type="MSEPlayer",this._media_element=null,this._player_engine=null;var i=e.type.toLowerCase();if("mse"!==i&&"mpegts"!==i&&"m2ts"!==i&&"flv"!==i)throw new v.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");if(t&&t.enableWorkerForMSE&&D.isSupported())try{this._player_engine=new D(e,t)}catch(i){h.A.e(this.TAG,"Error while initializing PlayerEngineDedicatedThread, fallback to PlayerEngineMainThread"),this._player_engine=new L(e,t)}else this._player_engine=new L(e,t)}return e.prototype.destroy=function(){this._player_engine.destroy(),this._player_engine=null,this._media_element=null},e.prototype.on=function(e,t){this._player_engine.on(e,t)},e.prototype.off=function(e,t){this._player_engine.off(e,t)},e.prototype.attachMediaElement=function(e){this._media_element=e,this._player_engine.attachMediaElement(e)},e.prototype.detachMediaElement=function(){this._media_element=null,this._player_engine.detachMediaElement()},e.prototype.load=function(){this._player_engine.load()},e.prototype.unload=function(){this._player_engine.unload()},e.prototype.play=function(){return this._player_engine.play()},e.prototype.pause=function(){this._player_engine.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._media_element.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._media_element.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._media_element.volume},set:function(e){this._media_element.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._media_element.muted},set:function(e){this._media_element.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._media_element?this._media_element.currentTime:0},set:function(e){this._player_engine.seek(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return this._player_engine.mediaInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return this._player_engine.statisticsInfo},enumerable:!1,configurable:!0}),e.prototype.switchAudioPid=function(e){this._player_engine.switchAudioPid(e)},e}(),B=function(){function e(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(l()),this._config=o(),"object"==typeof t&&Object.assign(this._config,t);var i=e.type.toLowerCase();if("mse"===i||"mpegts"===i||"m2ts"===i||"flv"===i)throw new v.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new v.Qn("NativePlayer(".concat(e.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}return e.prototype.destroy=function(){this._emitter.emit(p.A.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===p.A.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then(function(){i._emitter.emit(p.A.MEDIA_INFO,i.mediaInfo)}):e===p.A.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then(function(){i._emitter.emit(p.A.STATISTICS_INFO,i.statisticsInfo)}),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.load=function(){if(!this._mediaElement)throw new v.j4("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var a=this._mediaElement.getVideoPlaybackQuality();i=a.totalVideoFrames,n=a.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(p.A.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(p.A.STATISTICS_INFO,this.statisticsInfo)},e}();n.A.install();var O={createPlayer:function(e,t){var i=e;if(null==i||"object"!=typeof i)throw new v.Qn("MediaDataSource must be an javascript object!");if(!i.hasOwnProperty("type"))throw new v.Qn("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new M(i,t);default:return new B(i,t)}},isSupported:function(){return d.supportMSEH264Playback()},getFeatureList:function(){return d.getFeatureList()}};O.BaseLoader=_.HC,O.LoaderStatus=_.eO,O.LoaderErrors=_.Xv,O.Events=p.A,O.ErrorTypes=g.w,O.ErrorDetails=g.v,O.MSEPlayer=M,O.NativePlayer=B,O.LoggingControl=C.A,Object.defineProperty(O,"version",{enumerable:!0,get:function(){return"1.8.1"}});const P=O},270(e,t,i){"use strict";i.d(t,{v:()=>o,w:()=>r});var n=i(925),a=i(134),r={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},o={NETWORK_EXCEPTION:n.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:a.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:a.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:a.A.CODEC_UNSUPPORTED}},9(e,t,i){"use strict";i.d(t,{A:()=>a});var n={};!function(){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)||[],a={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},r={};if(a.browser){r[a.browser]=!0;var o=a.majorVersion.split(".");r.version={major:parseInt(a.majorVersion,10),string:a.version},o.length>1&&(r.version.minor=parseInt(o[1],10)),o.length>2&&(r.version.build=parseInt(o[2],10))}if(a.platform&&(r[a.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;var s="msie";a.browser=s,r[s]=!0}if(r.edge){delete r.edge;var d="msedge";a.browser=d,r[d]=!0}if(r.opr){var _="opera";a.browser=_,r[_]=!0}if(r.safari&&r.android){var h="android";a.browser=h,r[h]=!0}for(var c in r.name=a.browser,r.platform=a.platform,n)n.hasOwnProperty(c)&&delete n[c];Object.assign(n,r)}();const a=n},816(e,t,i){"use strict";i.d(t,{Al:()=>r,Qn:()=>s,Xu:()=>d,j4:()=>o});var n,a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),o=function(e){function t(t){return e.call(this,t)||this}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(r),s=function(e){function t(t){return e.call(this,t)||this}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(r),d=function(e){function t(t){return e.call(this,t)||this}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(r)},641(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(402),a=i.n(n),r=function(){function e(){}return e.e=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",n),e.ENABLE_VERBOSE&&console.log(n)},e}();r.GLOBAL_TAG="mpegts.js",r.FORCE_GLOBAL_TAG=!1,r.ENABLE_ERROR=!0,r.ENABLE_INFO=!0,r.ENABLE_WARN=!0,r.ENABLE_DEBUG=!0,r.ENABLE_VERBOSE=!0,r.ENABLE_CALLBACK=!1,r.emitter=new(a());const o=r},540(e,t,i){"use strict";i.d(t,{A:()=>s});var n=i(402),a=i.n(n),r=i(641),o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return r.A.FORCE_GLOBAL_TAG},set:function(t){r.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return r.A.GLOBAL_TAG},set:function(t){r.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return r.A.ENABLE_VERBOSE&&r.A.ENABLE_DEBUG&&r.A.ENABLE_INFO&&r.A.ENABLE_WARN&&r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_VERBOSE=t,r.A.ENABLE_DEBUG=t,r.A.ENABLE_INFO=t,r.A.ENABLE_WARN=t,r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return r.A.ENABLE_DEBUG},set:function(t){r.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return r.A.ENABLE_VERBOSE},set:function(t){r.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return r.A.ENABLE_INFO},set:function(t){r.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return r.A.ENABLE_WARN},set:function(t){r.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:r.A.GLOBAL_TAG,forceGlobalTag:r.A.FORCE_GLOBAL_TAG,enableVerbose:r.A.ENABLE_VERBOSE,enableDebug:r.A.ENABLE_DEBUG,enableInfo:r.A.ENABLE_INFO,enableWarn:r.A.ENABLE_WARN,enableError:r.A.ENABLE_ERROR,enableCallback:r.A.ENABLE_CALLBACK}},e.applyConfig=function(e){r.A.GLOBAL_TAG=e.globalTag,r.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,r.A.ENABLE_VERBOSE=e.enableVerbose,r.A.ENABLE_DEBUG=e.enableDebug,r.A.ENABLE_INFO=e.enableInfo,r.A.ENABLE_WARN=e.enableWarn,r.A.ENABLE_ERROR=e.enableError,r.A.ENABLE_CALLBACK=e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){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){r.A.emitter.addListener("log",t),r.A.emitter.listenerCount("log")>0&&(r.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){r.A.emitter.removeListener("log",t),0===r.A.emitter.listenerCount("log")&&(r.A.ENABLE_CALLBACK=!1,e._notifyChange())},e}();o.emitter=new(a());const s=o},262(e,t,i){"use strict";i.d(t,{A:()=>a});var n=function(){function e(){}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a])}return t},String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var i=t>0?0|t:0;return this.substring(i,i+e.length)===e}}),"function"!=typeof self.Promise&&i(935).polyfill()},e}();n.install();const a=n},360(e,t,i){function n(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var n=i(i.s=ENTRY_MODULE);return n.default||n}var a="[\\.|\\-|\\+|\\w|/|@]+",r="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+a+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e){return!isNaN(1*e)}function d(e,t,n){var d={};d[n]=[];var _=t.toString(),h=_.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return d;for(var c,l=h[1],u=new RegExp("(\\\\n|\\W)"+o(l)+r,"g");c=u.exec(_);)"dll-reference"!==c[3]&&d[n].push(c[3]);for(u=new RegExp("\\("+o(l)+'\\("(dll-reference\\s('+a+'))"\\)\\)'+r,"g");c=u.exec(_);)e[c[2]]||(d[n].push(c[1]),e[c[2]]=i(c[1]).m),d[c[2]]=d[c[2]]||[],d[c[2]].push(c[4]);for(var p=Object.keys(d),f=0;f<p.length;f++)for(var m=0;m<d[p[f]].length;m++)s(d[p[f]][m])&&(d[p[f]][m]=1*d[p[f]][m]);return d}function _(e){return Object.keys(e).reduce(function(t,i){return t||e[i].length>0},!1)}e.exports=function(e,t){t=t||{};var a={main:i.m},r=t.all?{main:Object.keys(a.main)}:function(e,t){for(var i={main:[t]},n={main:[]},a={main:{}};_(i);)for(var r=Object.keys(i),o=0;o<r.length;o++){var s=r[o],h=i[s].pop();if(a[s]=a[s]||{},!a[s][h]&&e[s][h]){a[s][h]=!0,n[s]=n[s]||[],n[s].push(h);for(var c=d(e,e[s][h],s),l=Object.keys(c),u=0;u<l.length;u++)i[l[u]]=i[l[u]]||[],i[l[u]]=i[l[u]].concat(c[l[u]])}}return n}(a,e),o="";Object.keys(r).filter(function(e){return"main"!==e}).forEach(function(e){for(var t=0;r[e][t];)t++;r[e].push(t),a[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+e+" = ("+n.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+r[e].map(function(t){return JSON.stringify(t)+": "+a[e][t].toString()}).join(",")+"});\n"}),o=o+"new (("+n.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+r.main.map(function(e){return JSON.stringify(e)+": "+a.main[e].toString()}).join(",")+"}))(self);";var s=new self.Blob([o],{type:"text/javascript"});if(t.bare)return s;var h=(self.URL||self.webkitURL||self.mozURL||self.msURL).createObjectURL(s),c=new self.Worker(h);return c.objectURL=h,c}},403(e,t,i){"use strict";var n;i.d(t,{A:()=>a}),function(e){e.ERROR="error",e.SOURCE_OPEN="source_open",e.UPDATE_END="update_end",e.BUFFER_FULL="buffer_full",e.START_STREAMING="start_streaming",e.END_STREAMING="end_streaming"}(n||(n={}));const a=n},726(e,t,i){"use strict";var n;i.d(t,{A:()=>a}),function(e){e.IO_ERROR="io_error",e.DEMUX_ERROR="demux_error",e.INIT_SEGMENT="init_segment",e.MEDIA_SEGMENT="media_segment",e.LOADING_COMPLETE="loading_complete",e.RECOVERED_EARLY_EOF="recovered_early_eof",e.MEDIA_INFO="media_info",e.METADATA_ARRIVED="metadata_arrived",e.SCRIPTDATA_ARRIVED="scriptdata_arrived",e.TRACKS_UPDATED="tracks_updated",e.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",e.PGS_SUBTITLE_ARRIVED="pgs_subtitle_arrived",e.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",e.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",e.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",e.SEI_ARRIVED="sei_arrived",e.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",e.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",e.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",e.STATISTICS_INFO="statistics_info",e.RECOMMEND_SEEKPOINT="recommend_seekpoint"}(n||(n={}));const a=n},877(e,t,i){"use strict";i(641),i(540),i(816),i(403),i(217),i(824),i(726),i(117),i(270)},117(e,t,i){"use strict";var n;i.d(t,{A:()=>a}),function(e){e.ERROR="error",e.LOADING_COMPLETE="loading_complete",e.RECOVERED_EARLY_EOF="recovered_early_eof",e.MEDIA_INFO="media_info",e.METADATA_ARRIVED="metadata_arrived",e.SCRIPTDATA_ARRIVED="scriptdata_arrived",e.TRACKS_UPDATED="tracks_updated",e.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",e.PGS_SUBTITLE_ARRIVED="pgs_subtitle_arrived",e.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",e.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",e.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",e.SEI_ARRIVED="sei_arrived",e.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",e.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",e.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",e.STATISTICS_INFO="statistics_info",e.DESTROYING="destroying"}(n||(n={}));const a=n}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,i),r.exports}return i.m=e,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(215)})());
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mpegts=t():e.mpegts=t()}(self,()=>(()=>{var e={935(e,t,i){e.exports=function(){"use strict";function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=0,a=void 0,r=void 0,o=function(e,t){u[n]=e,u[n+1]=t,2===(n+=2)&&(r?r(p):y())};var s="undefined"!=typeof window?window:void 0,d=s||{},_=d.MutationObserver||d.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var e=setTimeout;return function(){return e(p,1)}}var u=new Array(1e3);function p(){for(var e=0;e<n;e+=2)(0,u[e])(u[e+1]),u[e]=void 0,u[e+1]=void 0;n=0}var f,m,g,v,y=void 0;function A(e,t){var i=this,n=new this.constructor(E);void 0===n[b]&&x(n);var a=i._state;if(a){var r=arguments[a-1];o(function(){return P(a,n,r,i._result)})}else B(i,n,e,t);return n}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(E);return w(t,e),t}y=c?function(){return process.nextTick(p)}:_?(m=0,g=new _(p),v=document.createTextNode(""),g.observe(v,{characterData:!0}),function(){v.data=m=++m%2}):h?((f=new MessageChannel).port1.onmessage=p,function(){return f.port2.postMessage(0)}):void 0===s?function(){try{var e=Function("return this")().require("vertx");return void 0!==(a=e.runOnLoop||e.runOnContext)?function(){a(p)}:l()}catch(e){return l()}}():l();var b=Math.random().toString(36).substring(2);function E(){}var R=void 0,T=1,k=2;function L(t,i,n){i.constructor===t.constructor&&n===A&&i.constructor.resolve===S?function(e,t){t._state===T?M(e,t._result):t._state===k?D(e,t._result):B(t,void 0,function(t){return w(e,t)},function(t){return D(e,t)})}(t,i):void 0===n?M(t,i):e(n)?function(e,t,i){o(function(e){var n=!1,a=function(e,t,i,n){try{e.call(t,i,n)}catch(e){return e}}(i,t,function(i){n||(n=!0,t!==i?w(e,i):M(e,i))},function(t){n||(n=!0,D(e,t))},e._label);!n&&a&&(n=!0,D(e,a))},e)}(t,i,n):M(t,i)}function w(e,t){if(e===t)D(e,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=t),null===n||"object"!==a&&"function"!==a)M(e,t);else{var i=void 0;try{i=t.then}catch(t){return void D(e,t)}L(e,t,i)}var n,a}function C(e){e._onerror&&e._onerror(e._result),O(e)}function M(e,t){e._state===R&&(e._result=t,e._state=T,0!==e._subscribers.length&&o(O,e))}function D(e,t){e._state===R&&(e._state=k,e._result=t,o(C,e))}function B(e,t,i,n){var a=e._subscribers,r=a.length;e._onerror=null,a[r]=t,a[r+T]=i,a[r+k]=n,0===r&&e._state&&o(O,e)}function O(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var n=void 0,a=void 0,r=e._result,o=0;o<t.length;o+=3)n=t[o],a=t[o+i],n?P(i,n,a,r):a(r);e._subscribers.length=0}}function P(t,i,n,a){var r=e(n),o=void 0,s=void 0,d=!0;if(r){try{o=n(a)}catch(e){d=!1,s=e}if(i===o)return void D(i,new TypeError("A promises callback cannot return that same promise."))}else o=a;i._state!==R||(r&&d?w(i,o):!1===d?D(i,s):t===T?M(i,o):t===k&&D(i,o))}var I=0;function x(e){e[b]=I++,e._state=void 0,e._result=void 0,e._subscribers=[]}var U=function(){function e(e,i){this._instanceConstructor=e,this.promise=new e(E),this.promise[b]||x(this.promise),t(i)?(this.length=i.length,this._remaining=i.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(i),0===this._remaining&&M(this.promise,this._result))):D(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===R&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===S){var a=void 0,r=void 0,o=!1;try{a=e.then}catch(e){o=!0,r=e}if(a===A&&e._state!==R)this._settledAt(e._state,t,e._result);else if("function"!=typeof a)this._remaining--,this._result[t]=e;else if(i===N){var s=new i(E);o?D(s,r):L(s,e,a),this._willSettleAt(s,t)}else this._willSettleAt(new i(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,i){var n=this.promise;n._state===R&&(this._remaining--,e===k?D(n,i):this._result[t]=i),0===this._remaining&&M(n,this._result)},e.prototype._willSettleAt=function(e,t){var i=this;B(e,void 0,function(e){return i._settledAt(T,t,e)},function(e){return i._settledAt(k,t,e)})},e}();var N=function(){function t(e){this[b]=I++,this._result=this._state=void 0,this._subscribers=[],E!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t(function(t){w(e,t)},function(t){D(e,t)})}catch(t){D(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var i=this,n=i.constructor;return e(t)?i.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})}):i.then(t,t)},t}();return N.prototype.then=A,N.all=function(e){return new U(this,e).promise},N.race=function(e){var i=this;return t(e)?new i(function(t,n){for(var a=e.length,r=0;r<a;r++)i.resolve(e[r]).then(t,n)}):new i(function(e,t){return t(new TypeError("You must pass an array to race."))})},N.resolve=S,N.reject=function(e){var t=new this(E);return D(t,e),t},N._setScheduler=function(e){r=e},N._setAsap=function(e){o=e},N._asap=o,N.polyfill=function(){var e=void 0;if(void 0!==i.g)e=i.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=N},N.Promise=N,N}()},402(e){"use strict";var t,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,e.exports.once=function(e,t){return new Promise(function(i,n){function a(i){e.removeListener(t,r),n(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",a),i([].slice.call(arguments))}f(e,t,r,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,a)})},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function _(e,t,i,n){var a,r,o,_;if(s(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),o=r[t]),void 0===o)o=r[t]=i,++e._eventsCount;else if("function"==typeof o?o=r[t]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(a=d(e))>0&&o.length>a&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,_=c,console&&console.warn&&console.warn(_)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},a=c.bind(n);return a.listener=i,n.wrapFn=a,a}function l(e,t,i){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?i?[a.listener||a]:[a]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(a):p(a,a.length)}function u(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function p(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function f(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function a(r){n.once&&e.removeEventListener(t,a),i(r)})}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return d(this)},r.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var a="error"===e,r=this._events;if(void 0!==r)a=a&&void 0===r.error;else if(!a)return!1;if(a){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var d=r[e];if(void 0===d)return!1;if("function"==typeof d)n(d,this,t);else{var _=d.length,c=p(d,_);for(i=0;i<_;++i)n(c[i],this,t)}return!0},r.prototype.addListener=function(e,t){return _(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return _(this,e,t,!0)},r.prototype.once=function(e,t){return s(t),this.on(e,h(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,h(this,e,t)),this},r.prototype.removeListener=function(e,t){var i,n,a,r,o;if(s(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(a=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){o=i[r].listener,a=r;break}if(a<0)return this;0===a?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,a),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var a,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(a=r[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},r.prototype.listeners=function(e){return l(this,e,!0)},r.prototype.rawListeners=function(e){return l(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):u.call(e,t)},r.prototype.listenerCount=u,r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},200(e,t,i){"use strict";i.d(t,{A:()=>n});const n=function(){function 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=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&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&&e&&t},e.prototype.isSeekable=function(){return!0===this.hasKeyframesIndex},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,a=0,r=0,o=n;for(t<e[0]&&(i=0,r=o+1);r<=o;){if((a=r+Math.floor((o-r)/2))===n||t>=e[a]&&t<e[a+1]){i=a;break}e[a]<t?r=a+1:o=a-1}return i},e}()},544(e,t,i){"use strict";i.d(t,{$_:()=>n,EX:()=>r,EZ:()=>a,Sc:()=>o});var n=function(e,t,i,n,a){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=a,this.fileposition=null},a=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),r=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0==this._list.length)return null;var t=this._list,i=0,n=t.length-1,a=0,r=0,o=n;for(e<t[0].dts&&(i=0,r=o+1);r<=o;){if((a=r+Math.floor((o-r)/2))===n||e>=t[a].dts&&e<t[a+1].dts){i=a;break}t[a].dts<e?r=a+1:o=a-1}return this._list[i]},e}(),o=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t=this._list;if(0===t.length)return-2;var i=t.length-1,n=0,a=0,r=i,o=0;if(e<t[0].originalBeginDts)return-1;for(;a<=r;){if((n=a+Math.floor((r-a)/2))===i||e>t[n].lastSample.originalDts&&e<t[n+1].originalBeginDts){o=n;break}t[n].originalBeginDts<e?a=n+1:r=n-1}return o},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t=this._list,i=e,n=this._lastAppendLocation,a=0;-1!==n&&n<t.length&&i.originalBeginDts>=t[n].lastSample.originalDts&&(n===t.length-1||n<t.length-1&&i.originalBeginDts<t[n+1].originalBeginDts)?a=n+1:t.length>0&&(a=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=a,this._list.splice(a,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},e}()},217(e,t,i){"use strict";i.d(t,{A:()=>_});var n=i(402),a=i.n(n),r=i(641),o=i(9),s=i(403),d=i(816);const _=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new(a()),this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onStartStreaming:this._onStartStreaming.bind(this),onEndStreaming:this._onEndStreaming.bind(this),onQualityChange:this._onQualityChange.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._useManagedMediaSource="ManagedMediaSource"in self&&!("MediaSource"in self),this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElementProxy=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]}}return e.prototype.destroy=function(){this._mediaSource&&this.shutdown(),this._mediaSourceObjectURL&&this.revokeObjectURL(),this.e=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.initialize=function(e){if(this._mediaSource)throw new d.j4("MediaSource has been attached to an HTMLMediaElement!");this._useManagedMediaSource&&r.A.v(this.TAG,"Using ManagedMediaSource");var t=this._mediaSource=this._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(t.addEventListener("startstreaming",this.e.onStartStreaming),t.addEventListener("endstreaming",this.e.onEndStreaming),t.addEventListener("qualitychange",this.e.onQualityChange)),this._mediaElementProxy=e},e.prototype.shutdown=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){r.A.e(this.TAG,e.message)}n.removeEventListener("error",this.e.onSourceBufferError),n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){r.A.e(this.TAG,e.message)}this._mediaElementProxy=null,e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._useManagedMediaSource&&(e.removeEventListener("startstreaming",this.e.onStartStreaming),e.removeEventListener("endstreaming",this.e.onEndStreaming),e.removeEventListener("qualitychange",this.e.onQualityChange)),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._mediaSource=null}},e.prototype.isManagedMediaSource=function(){return this._useManagedMediaSource},e.prototype.getObject=function(){if(!this._mediaSource)throw new d.j4("MediaSource has not been initialized yet!");return this._mediaSource},e.prototype.getHandle=function(){if(!this._mediaSource)throw new d.j4("MediaSource has not been initialized yet!");return this._mediaSource.handle},e.prototype.getObjectURL=function(){if(!this._mediaSource)throw new d.j4("MediaSource has not been initialized yet!");return null==this._mediaSourceObjectURL&&(this._mediaSourceObjectURL=URL.createObjectURL(this._mediaSource)),this._mediaSourceObjectURL},e.prototype.revokeObjectURL=function(){this._mediaSourceObjectURL&&(URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){if(void 0===t&&(t=void 0),!this._mediaSource||"open"!==this._mediaSource.readyState||!1===this._mediaSource.streaming)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var i=e,n="".concat(i.container);i.codec&&i.codec.length>0&&("opus"===i.codec&&o.A.safari&&(i.codec="Opus"),n+=";codecs=".concat(i.codec));var a=!1;if(r.A.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])r.A.v(this.TAG,"Notice: ".concat(i.type," mimeType changed, origin: ").concat(this._mimeTypes[i.type],", target: ").concat(n));else{a=!0;try{var d=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);d.addEventListener("error",this.e.onSourceBufferError),d.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return r.A.e(this.TAG,e.message),void this._emitter.emit(s.A.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),a||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),o.A.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.flush=function(){for(var e in this._sourceBuffers)if(this._sourceBuffers[e]){var t=this._sourceBuffers[e];if("open"===this._mediaSource.readyState)try{t.abort()}catch(e){r.A.e(this.TAG,e.message)}var i=this._pendingSegments[e];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var n=0;n<t.buffered.length;n++){var a=t.buffered.start(n),s=t.buffered.end(n);this._pendingRemoveRanges[e].push({start:a,end:s})}if(t.updating||this._doRemoveRanges(),o.A.safari){var d=this._lastInitSegments[e];d&&(this._pendingSegments[e].push(d),t.updating||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},e.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var e=this._mediaElementProxy.getCurrentTime();for(var t in this._sourceBuffers){var i=this._sourceBuffers[t];if(i){var n=i.buffered;if(n.length>=1&&e-n.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElementProxy.getCurrentTime();for(var t in this._sourceBuffers){var i=this._sourceBuffers[t];if(i){for(var n=i.buffered,a=!1,r=0;r<n.length;r++){var o=n.start(r),s=n.end(r);if(o<=e&&e<s+3){if(e-o>=this._config.autoCleanupMaxBackwardDuration){a=!0;var d=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:o,end:d})}}else s<e&&(a=!0,this._pendingRemoveRanges[t].push({start:o,end:s}))}a&&!i.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e=this._sourceBuffers;if(0!==this._mediaElementProxy.getReadyState()&&"open"===this._mediaSource.readyState&&!(e.video&&e.video.updating||e.audio&&e.audio.updating)){var t=this._mediaSource.duration,i=this._pendingMediaDuration;i>0&&(isNaN(t)||i>t)&&(r.A.v(this.TAG,"Update MediaSource duration from ".concat(t," to ").concat(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&&!1!==this._mediaSource.streaming&&e[t].length>0){var i=e[t].shift();if("number"==typeof i.timestampOffset&&isFinite(i.timestampOffset)){var n=this._sourceBuffers[t].timestampOffset,a=i.timestampOffset/1e3;Math.abs(n-a)>.1&&(r.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(n," to ").concat(a)),this._sourceBuffers[t].timestampOffset=a),delete i.timestampOffset}if(!i.data||0===i.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(i.data),this._isBufferFull=!1}catch(e){this._pendingSegments[t].unshift(i),22===e.code?(this._isBufferFull||this._emitter.emit(s.A.BUFFER_FULL),this._isBufferFull=!0):(r.A.e(this.TAG,e.message),this._emitter.emit(s.A.ERROR,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){if(r.A.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(s.A.SOURCE_OPEN)},e.prototype._onStartStreaming=function(){r.A.v(this.TAG,"ManagedMediaSource onStartStreaming"),this._emitter.emit(s.A.START_STREAMING)},e.prototype._onEndStreaming=function(){r.A.v(this.TAG,"ManagedMediaSource onEndStreaming"),this._emitter.emit(s.A.END_STREAMING)},e.prototype._onQualityChange=function(){r.A.v(this.TAG,"ManagedMediaSource onQualityChange")},e.prototype._onSourceEnded=function(){r.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){r.A.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),this._useManagedMediaSource&&(this._mediaSource.removeEventListener("startstreaming",this.e.onStartStreaming),this._mediaSource.removeEventListener("endstreaming",this.e.onEndStreaming),this._mediaSource.removeEventListener("qualitychange",this.e.onQualityChange)))},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(s.A.UPDATE_END)},e.prototype._onSourceBufferError=function(e){r.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}()},824(e,t,i){"use strict";i.d(t,{A:()=>l});var n=i(402),a=i.n(n),r=i(360),o=i.n(r),s=i(641),d=i(540),_=i(562),c=i(726),h=(i(514),i(200));const l=function(){function e(e,t){if(this.TAG="Transmuxer",this._emitter=new(a()),t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=o()(514),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},d.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:d.A.getConfig()})}catch(i){s.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new _.A(e,t)}else this._controller=new _.A(e,t);if(this._controller){var i=this._controller;i.on(c.A.IO_ERROR,this._onIOError.bind(this)),i.on(c.A.DEMUX_ERROR,this._onDemuxError.bind(this)),i.on(c.A.INIT_SEGMENT,this._onInitSegment.bind(this)),i.on(c.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),i.on(c.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),i.on(c.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),i.on(c.A.MEDIA_INFO,this._onMediaInfo.bind(this)),i.on(c.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),i.on(c.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),i.on(c.A.TRACKS_UPDATED,this._onTracksUpdated.bind(this)),i.on(c.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),i.on(c.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,this._onSynchronousKLVMetadataArrived.bind(this)),i.on(c.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,this._onAsynchronousKLVMetadataArrived.bind(this)),i.on(c.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),i.on(c.A.SEI_ARRIVED,this._onSEIArrived.bind(this)),i.on(c.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),i.on(c.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),i.on(c.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),i.on(c.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),i.on(c.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),d.A.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.switchAudioPid=function(e){this._worker?this._worker.postMessage({cmd:"switch_audio_pid",pid:e}):"function"==typeof this._controller.switchAudioPid&&this._controller.switchAudioPid(e)},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(c.A.INIT_SEGMENT,e,t)})},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(c.A.MEDIA_SEGMENT,e,t)})},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then(function(){e._emitter.emit(c.A.LOADING_COMPLETE)})},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then(function(){e._emitter.emit(c.A.RECOVERED_EARLY_EOF)})},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.MEDIA_INFO,e)})},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.METADATA_ARRIVED,e)})},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.SCRIPTDATA_ARRIVED,e)})},e.prototype._onTracksUpdated=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.TRACKS_UPDATED,e)})},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.TIMED_ID3_METADATA_ARRIVED,e)})},e.prototype._onPGSSubtitleArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.PGS_SUBTITLE_ARRIVED,e)})},e.prototype._onSynchronousKLVMetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,e)})},e.prototype._onAsynchronousKLVMetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,e)})},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.SMPTE2038_METADATA_ARRIVED,e)})},e.prototype._onSEIArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.SEI_ARRIVED,e)})},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.SCTE35_METADATA_ARRIVED,e)})},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.PES_PRIVATE_DATA_DESCRIPTOR,e)})},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.PES_PRIVATE_DATA_ARRIVED,e)})},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.STATISTICS_INFO,e)})},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(c.A.IO_ERROR,e,t)})},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then(function(){i._emitter.emit(c.A.DEMUX_ERROR,e,t)})},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then(function(){t._emitter.emit(c.A.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 c.A.INIT_SEGMENT:case c.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case c.A.LOADING_COMPLETE:case c.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case c.A.MEDIA_INFO:Object.setPrototypeOf(i,h.A.prototype),this._emitter.emit(t.msg,i);break;case c.A.METADATA_ARRIVED:case c.A.SCRIPTDATA_ARRIVED:case c.A.TRACKS_UPDATED:case c.A.TIMED_ID3_METADATA_ARRIVED:case c.A.PGS_SUBTITLE_ARRIVED:case c.A.SYNCHRONOUS_KLV_METADATA_ARRIVED:case c.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED:case c.A.SMPTE2038_METADATA_ARRIVED:case c.A.SCTE35_METADATA_ARRIVED:case c.A.SEI_ARRIVED:case c.A.PES_PRIVATE_DATA_DESCRIPTOR:case c.A.PES_PRIVATE_DATA_ARRIVED:case c.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case c.A.IO_ERROR:case c.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case c.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":s.A.emitter.emit("log",i.type,i.logcat)}},e}()},562(e,t,i){"use strict";i.d(t,{A:()=>Ve});var n=i(402),a=i.n(n),r=i(641),o=i(9),s=i(200);function d(e,t,i){var n=e;if(t+i<n.length){for(;i--;)if(128!=(192&n[++t]))return!1;return!0}return!1}const _=function(e){for(var t=[],i=e,n=0,a=e.length;n<a;)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(d(i,n,1)&&(r=(31&i[n])<<6|63&i[n+1])>=128){t.push(String.fromCharCode(65535&r)),n+=2;continue}}else if(i[n]<240){if(d(i,n,2)&&(r=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2])>=2048&&55296!=(63488&r)){t.push(String.fromCharCode(65535&r)),n+=3;continue}}else if(i[n]<248){var r;if(d(i,n,3)&&(r=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3])>65536&&r<1114112){r-=65536,t.push(String.fromCharCode(r>>>10|55296)),t.push(String.fromCharCode(1023&r|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};var c,h=i(816),l=(c=new ArrayBuffer(2),new DataView(c).setInt16(0,256,!0),256===new Int16Array(c)[0]);const u=function(){function e(){}return e.parseScriptData=function(t,i,n){var a={};try{var o=e.parseValue(t,i,n),s=e.parseValue(t,i+o.size,n-o.size);a[o.data]=s.data}catch(e){r.A.e("AMF",e.toString())}return a},e.parseObject=function(t,i,n){if(n<3)throw new h.j4("Data not enough when parse ScriptDataObject");var a=e.parseString(t,i,n),r=e.parseValue(t,i+a.size,n-a.size),o=r.objectEnd;return{data:{name:a.data,value:r.data},size:a.size+r.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 h.j4("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!l);return{data:n>0?_(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new h.j4("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!l);return{data:n>0?_(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new h.j4("Data size invalid when parse Date");var n=new DataView(e,t,i),a=n.getFloat64(0,!l),r=n.getInt16(8,!l);return{data:new Date(a+=60*r*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new h.j4("Data not enough when parse Value");var a,o=new DataView(t,i,n),s=1,d=o.getUint8(0),_=!1;try{switch(d){case 0:a=o.getFloat64(1,!l),s+=8;break;case 1:a=!!o.getUint8(1),s+=1;break;case 2:var c=e.parseString(t,i+1,n-1);a=c.data,s+=c.size;break;case 3:a={};var u=0;for(9==(16777215&o.getUint32(n-4,!l))&&(u=3);s<n-4;){var p=e.parseObject(t,i+s,n-s-u);if(p.objectEnd)break;a[p.data.name]=p.data.value,s+=p.size}s<=n-3&&9==(16777215&o.getUint32(s-1,!l))&&(s+=3);break;case 8:for(a={},s+=4,u=0,9==(16777215&o.getUint32(n-4,!l))&&(u=3);s<n-8;){var f=e.parseVariable(t,i+s,n-s-u);if(f.objectEnd)break;a[f.data.name]=f.data.value,s+=f.size}s<=n-3&&9==(16777215&o.getUint32(s-1,!l))&&(s+=3);break;case 9:a=void 0,s=1,_=!0;break;case 10:a=[];var m=o.getUint32(1,!l);s+=4;for(var g=0;g<m;g++){var v=e.parseValue(t,i+s,n-s);a.push(v.data),s+=v.size}break;case 11:var y=e.parseDate(t,i+1,n-1);a=y.data,s+=y.size;break;case 12:var A=e.parseString(t,i+1,n-1);a=A.data,s+=A.size;break;default:s=n,r.A.w("AMF","Unsupported AMF value type "+d)}}catch(e){r.A.e("AMF",e.toString())}return{data:a,size:s,objectEnd:_}},e}(),p=function(){function e(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e=this._total_bytes-this._buffer_index;if(e<=0)throw new h.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,e),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t},e.prototype.readBits=function(e){if(e>32)throw new h.Qn("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 a=Math.min(n,this._current_word_bits_left),r=this._current_word>>>32-a;return this._current_word<<=a,this._current_word_bits_left-=a,i<<a|r},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>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}(),f=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)},e.parseSPS=function(t){for(var i=t.subarray(1,4),n="avc1.",a=0;a<3;a++){var r=i[a].toString(16);r.length<2&&(r="0"+r),n+=r}var o=e._ebsp2rbsp(t),s=new p(o);s.readByte();var d=s.readByte();s.readByte();var _=s.readByte();s.readUEG();var c=e.getProfileString(d),h=e.getLevelString(_),l=1,u=420,f=8,m=8;if((100===d||110===d||122===d||244===d||44===d||83===d||86===d||118===d||128===d||138===d||144===d)&&(3===(l=s.readUEG())&&s.readBits(1),l<=3&&(u=[0,420,422,444][l]),f=s.readUEG()+8,m=s.readUEG()+8,s.readBits(1),s.readBool()))for(var g=3!==l?8:12,v=0;v<g;v++)s.readBool()&&(v<6?e._skipScalingList(s,16):e._skipScalingList(s,64));s.readUEG();var y=s.readUEG();if(0===y)s.readUEG();else if(1===y){s.readBits(1),s.readSEG(),s.readSEG();var A=s.readUEG();for(v=0;v<A;v++)s.readSEG()}var S=s.readUEG();s.readBits(1);var b=s.readUEG(),E=s.readUEG(),R=s.readBits(1);0===R&&s.readBits(1),s.readBits(1);var T=0,k=0,L=0,w=0;s.readBool()&&(T=s.readUEG(),k=s.readUEG(),L=s.readUEG(),w=s.readUEG());var C=1,M=1,D=0,B=!0,O=0,P=0;if(s.readBool()){if(s.readBool()){var I=s.readByte();I>0&&I<16?(C=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][I-1],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][I-1]):255===I&&(C=s.readByte()<<8|s.readByte(),M=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var x=s.readBits(32),U=s.readBits(32);B=s.readBool(),D=(O=U)/(P=2*x)}}var N=1;1===C&&1===M||(N=C/M);var G=0,V=0;0===l?(G=1,V=2-R):(G=3===l?1:2,V=(1===l?2:1)*(2-R));var F=16*(b+1),j=16*(E+1)*(2-R);F-=(T+k)*G,j-=(L+w)*V;var z=Math.ceil(F*N);return s.destroy(),s=null,{codec_mimetype:n,profile_idc:d,level_idc:_,profile_string:c,level_string:h,chroma_format_idc:l,bit_depth:f,bit_depth_luma:f,bit_depth_chroma:m,ref_frames:S,chroma_format:u,chroma_format_string:e.getChromaFormatString(u),frame_rate:{fixed:B,fps:D,fps_den:P,fps_num:O},sar_ratio:{width:C,height:M},codec_size:{width:F,height:j},present_size:{width:z,height:j}}},e._skipScalingList=function(e,t){for(var i=8,n=8,a=0;a<t;a++)0!==n&&(n=(i+e.readSEG()+256)%256),i=0===n?i:n},e.getProfileString=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"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=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"}},e}();var m=i(134);const g=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)},e.parseVPS=function(t){var i=e._ebsp2rbsp(t),n=new p(i);return n.readByte(),n.readByte(),n.readBits(4),n.readBits(2),n.readBits(6),{num_temporal_layers:n.readBits(3)+1,temporal_id_nested:n.readBool()}},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),n=new p(i);n.readByte(),n.readByte();for(var a=0,r=0,o=0,s=0,d=(n.readBits(4),n.readBits(3)),_=(n.readBool(),n.readBits(2)),c=n.readBool(),h=n.readBits(5),l=n.readByte(),u=n.readByte(),f=n.readByte(),m=n.readByte(),g=n.readByte(),v=n.readByte(),y=n.readByte(),A=n.readByte(),S=n.readByte(),b=n.readByte(),E=n.readByte(),R=[],T=[],k=0;k<d;k++)R.push(n.readBool()),T.push(n.readBool());if(d>0)for(k=d;k<8;k++)n.readBits(2);for(k=0;k<d;k++)R[k]&&(n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte()),T[k]&&n.readByte();n.readUEG();var L=n.readUEG();3==L&&n.readBits(1);var w=n.readUEG(),C=n.readUEG();n.readBool()&&(a+=n.readUEG(),r+=n.readUEG(),o+=n.readUEG(),s+=n.readUEG());var M=n.readUEG(),D=n.readUEG(),B=n.readUEG();for(k=n.readBool()?0:d;k<=d;k++)n.readUEG(),n.readUEG(),n.readUEG();if(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readBool()&&n.readBool())for(var O=0;O<4;O++)for(var P=0;P<(3===O?2:6);P++)if(n.readBool()){var I=Math.min(64,1<<4+(O<<1));for(O>1&&n.readSEG(),k=0;k<I;k++)n.readSEG()}else n.readUEG();n.readBool(),n.readBool(),n.readBool()&&(n.readByte(),n.readUEG(),n.readUEG(),n.readBool());var x=n.readUEG(),U=0;for(k=0;k<x;k++){var N=!1;if(0!==k&&(N=n.readBool()),N){k===x&&n.readUEG(),n.readBool(),n.readUEG();for(var G=0,V=0;V<=U;V++){var F=n.readBool(),j=!1;F||(j=n.readBool()),(F||j)&&G++}U=G}else{var z=n.readUEG(),H=n.readUEG();for(U=z+H,V=0;V<z;V++)n.readUEG(),n.readBool();for(V=0;V<H;V++)n.readUEG(),n.readBool()}}if(n.readBool()){var q=n.readUEG();for(k=0;k<q;k++){for(V=0;V<B+4;V++)n.readBits(1);n.readBits(1)}}var K=0,W=1,X=1,Y=!1,Q=1,Z=1;if(n.readBool(),n.readBool(),n.readBool()){if(n.readBool()){var $=n.readByte();$>0&&$<=16?(W=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][$-1],X=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][$-1]):255===$&&(W=n.readBits(16),X=n.readBits(16))}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(3),n.readBool(),n.readBool()&&(n.readByte(),n.readByte(),n.readByte())),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool(),n.readBool(),n.readBool(),n.readBool()&&(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG()),n.readBool()&&(Q=n.readBits(32),Z=n.readBits(32),n.readBool()&&n.readUEG(),n.readBool())){var J,ee,te=!1;for(J=n.readBool(),ee=n.readBool(),(J||ee)&&((te=n.readBool())&&(n.readByte(),n.readBits(5),n.readBool(),n.readBits(5)),n.readBits(4),n.readBits(4),te&&n.readBits(4),n.readBits(5),n.readBits(5),n.readBits(5)),k=0;k<=d;k++){var ie=n.readBool();Y=ie;var ne=!0,ae=1;ie||(ne=n.readBool());var re=!1;if(ne?n.readUEG():re=n.readBool(),re||(ae=n.readUEG()+1),J){for(V=0;V<ae;V++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG());n.readBool()}if(ee){for(V=0;V<ae;V++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG());n.readBool()}}}n.readBool()&&(n.readBool(),n.readBool(),n.readBool(),K=n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG())}n.readBool();var oe="hvc1.".concat(h,".1.L").concat(E,".B0"),se=w-(a+r)*(1===L||2===L?2:1),de=C-(o+s)*(1===L?2:1),_e=1;return 1!==W&&1!==X&&(_e=W/X),n.destroy(),n=null,{codec_mimetype:oe,profile_string:e.getProfileString(h),level_string:e.getLevelString(E),profile_idc:h,bit_depth:M+8,ref_frames:1,chroma_format:L,chroma_format_string:e.getChromaFormatString(L),general_level_idc:E,general_profile_space:_,general_tier_flag:c,general_profile_idc:h,general_profile_compatibility_flags_1:l,general_profile_compatibility_flags_2:u,general_profile_compatibility_flags_3:f,general_profile_compatibility_flags_4:m,general_constraint_indicator_flags_1:g,general_constraint_indicator_flags_2:v,general_constraint_indicator_flags_3:y,general_constraint_indicator_flags_4:A,general_constraint_indicator_flags_5:S,general_constraint_indicator_flags_6:b,min_spatial_segmentation_idc:K,constant_frame_rate:0,chroma_format_idc:L,bit_depth_luma_minus8:M,bit_depth_chroma_minus8:D,frame_rate:{fixed:Y,fps:Z/Q,fps_den:Q,fps_num:Z},sar_ratio:{width:W,height:X},codec_size:{width:se,height:de},present_size:{width:se*_e,height:de}}},e.parsePPS=function(t){var i=e._ebsp2rbsp(t),n=new p(i);n.readByte(),n.readByte(),n.readUEG(),n.readUEG(),n.readBool(),n.readBool(),n.readBits(3),n.readBool(),n.readBool(),n.readUEG(),n.readUEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool()&&n.readUEG(),n.readSEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool(),n.readBool();var a=n.readBool(),r=n.readBool(),o=1;return r&&a?o=0:r?o=3:a&&(o=2),{parallelismType:o}},e.getChromaFormatString=function(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},e.getProfileString=function(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},e.getLevelString=function(e){return(e/30).toFixed(1)},e}();function v(e){return e.byteOffset%2==0&&e.byteLength%2==0}function y(e){return e.byteOffset%4==0&&e.byteLength%4==0}function A(e,t){for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const S=function(e,t){return e.byteLength===t.byteLength&&(y(e)&&y(t)?function(e,t){return A(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):v(e)&&v(t)?function(e,t){return A(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return A(e,t)}(e,t))};var b=function(){return b=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var a in t=arguments[i])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},b.apply(this,arguments)};const E=function(){function e(){}return e.parseOBUs=function(t,i){for(var n=0;n<t.byteLength;){var a=n,r=(t[n],(120&t[n])>>3),o=!!(4&t[n]),s=!!(2&t[n]);t[n],n+=1,o&&(n+=1);var d=Number.POSITIVE_INFINITY;if(s){d=0;for(var _=0;;_++){var c=t[n++];if(d|=(127&c)<<7*_,!(128&c))break}}console.log(r),1===r?i=b(b({},e.parseSeuqneceHeader(t.subarray(n,n+d))),{sequence_header_data:t.subarray(a,n+d)}):(3==r&&i||6==r&&i)&&(i=e.parseOBUFrameHeader(t.subarray(n,n+d),0,0,i)),n+=d}return i},e.parseSeuqneceHeader=function(t){var i=new p(t),n=i.readBits(3),a=(i.readBool(),i.readBool()),r=!0,o=0,s=1,d=void 0,_=[];if(a)_.push({operating_point_idc:0,level:i.readBits(5),tier:0});else{if(i.readBool()){var c=i.readBits(32),h=i.readBits(32),l=i.readBool();if(l){for(var u=0;0===i.readBits(1);)u+=1;u>=32||i.readBits(u)}o=h,s=c,r=l,i.readBool()&&(i.readBits(5),i.readBits(32),d=i.readBits(5),i.readBits(5))}for(var f=i.readBool(),m=i.readBits(5),g=0;g<=m;g++){var v=i.readBits(12),y=i.readBits(5),A=y>7?i.readBits(1):0;_.push({operating_point_idc:v,level:y,tier:A}),f&&i.readBool()&&i.readBits(4)}}var S=_[0],b=S.level,E=S.tier,R=i.readBits(4),T=i.readBits(4),k=i.readBits(R+1)+1,L=i.readBits(T+1)+1,w=!1;a||(w=i.readBool()),w&&(i.readBits(4),i.readBits(4)),i.readBool(),i.readBool(),i.readBool();var C=!1,M=2,D=2,B=0;a||(i.readBool(),i.readBool(),i.readBool(),i.readBool(),(C=i.readBool())&&(i.readBool(),i.readBool()),D=(M=i.readBool()?2:i.readBits(1))?i.readBool()?2:i.readBits(1):2,B=C?i.readBits(3)+1:0);var O=i.readBool(),P=(i.readBool(),i.readBool(),i.readBool()),I=8;I=2===n&&P?i.readBool()?12:10:P?10:8;var x=!1;1!==n&&(x=i.readBool()),i.readBool()&&(i.readBits(8),i.readBits(8),i.readBits(8));var U=1,N=1;return x?(i.readBits(1),U=1,N=1):(i.readBits(1),0==n?(U=1,N=1):1==n?(U=0,N=0):12==I?i.readBits(1)&&i.readBits(1):(U=1,N=0),U&&N&&i.readBits(2),i.readBits(1)),i.readBool(),i.destroy(),i=null,{codec_mimetype:"av01.".concat(n,".").concat(e.getLevelString(b,E),".").concat(I.toString(10).padStart(2,"0")),level:b,tier:E,level_string:e.getLevelString(b,E),profile_idc:n,profile_string:"".concat(n),bit_depth:I,ref_frames:1,chroma_format:e.getChromaFormat(x,U,N),chroma_format_string:e.getChromaFormatString(x,U,N),sequence_header:{frame_id_numbers_present_flag:w,additional_frame_id_length_minus_1:void 0,delta_frame_id_length_minus_2:void 0,reduced_still_picture_header:a,decoder_model_info_present_flag:!1,operating_points:_,buffer_removal_time_length_minus_1:d,equal_picture_interval:r,seq_force_screen_content_tools:M,seq_force_integer_mv:D,enable_order_hint:C,order_hint_bits:B,enable_superres:O,frame_width_bit:R+1,frame_height_bit:T+1,max_frame_width:k,max_frame_height:L},keyframe:void 0,frame_rate:{fixed:r,fps:o/s,fps_den:s,fps_num:o}}},e.parseOBUFrameHeader=function(t,i,n,a){var r=a.sequence_header,o=new p(t),s=(r.max_frame_width,r.max_frame_height,0);r.frame_id_numbers_present_flag&&(s=r.additional_frame_id_length_minus_1+r.delta_frame_id_length_minus_2+3);var d=0,_=!0,c=!0,h=!1;if(!r.reduced_still_picture_header){if(o.readBool())return a;_=2===(d=o.readBits(2))||0===d,(c=o.readBool())&&r.decoder_model_info_present_flag&&r.equal_picture_interval,c&&o.readBool(),h=!!(3===d||0===d&&c)||o.readBool()}a.keyframe=_,o.readBool();var l=r.seq_force_screen_content_tools;2===r.seq_force_screen_content_tools&&(l=o.readBits(1)),l&&(r.seq_force_integer_mv,2==r.seq_force_integer_mv&&o.readBits(1)),r.frame_id_numbers_present_flag&&o.readBits(s);var u;if(u=3==d||!r.reduced_still_picture_header&&o.readBool(),o.readBits(r.order_hint_bits),_||h||o.readBits(3),r.decoder_model_info_present_flag&&o.readBool())for(var f=0;f<=r.operating_points_cnt_minus_1;f++)if(r.operating_points[f].decoder_model_present_for_this_op[f]){var m=r.operating_points[f].operating_point_idc;(0===m||m>>i&1&&m>>n+8&1)&&o.readBits(r.buffer_removal_time_length_minus_1+1)}var g=255;if(3===d||0==d&&c||(g=o.readBits(8)),(_||255!==g)&&h&&r.enable_order_hint)for(var v=0;v<8;v++)o.readBits(r.order_hint_bits);if(_){var y=e.frameSizeAndRenderSize(o,u,r);a.codec_size={width:y.FrameWidth,height:y.FrameHeight},a.present_size={width:y.RenderWidth,height:y.RenderHeight},a.sar_ratio={width:y.RenderWidth/y.FrameWidth,height:y.RenderHeight/y.FrameHeight}}return o.destroy(),o=null,a},e.frameSizeAndRenderSize=function(e,t,i){var n=i.max_frame_width,a=i.max_frame_height;t&&(n=e.readBits(i.frame_width_bit)+1,a=e.readBits(i.frame_height_bit)+1);var r=!1;i.enable_superres&&(r=e.readBool());var o=8;r&&(o=e.readBits(3)+9);var s=n;n=Math.floor((8*s+o/2)/o);var d=s,_=a;if(e.readBool()){var c=e.readBits(16)+1,h=e.readBits(16)+1;d=e.readBits(c)+1,_=e.readBits(h)+1}return{UpscaledWidth:s,FrameWidth:n,FrameHeight:a,RenderWidth:d,RenderHeight:_}},e.getLevelString=function(e,t){return"".concat(e.toString(10).padStart(2,"0")).concat(0===t?"M":"H")},e.getChromaFormat=function(e,t,i){return e?0:0===t&&0===i?3:1===t&&0===i?2:1===t&&1===i?1:Number.NaN},e.getChromaFormatString=function(e,t,i){return e?"4:0:0":0===t&&0===i?"4:4:4":1===t&&0===i?"4:2:2":1===t&&1===i?"4:2:0":"Unknown"},e}();var R=function(){};function T(e,t,i){if(!e||e.byteLength<2)return null;var n=1;"h265"===i&&(n=2);var a=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)}(e.subarray(n)),r=0;if(r===a.byteLength-1&&128===a[r])return null;for(var o=0;r<a.byteLength&&255===a[r];)o+=255,r++;if(r>=a.byteLength)return null;o+=a[r++];for(var s=0;r<a.byteLength&&255===a[r];)s+=255,r++;if(r>=a.byteLength)return null;if(s+=a[r++],r+s>a.byteLength)return null;var d=new R;d.type=o,d.size=s;var _=a.subarray(r,r+s);return 5===o&&s>=16&&(d.uuid=_.subarray(0,16),d.user_data=_.subarray(16)),void 0!==t&&(d.pts=t),d}var k=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._onSeiArrived=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new s.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._onSeiArrived=null},e.probe=function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var n,a=(4&t[4])>>>2!=0,r=!!(1&t[4]),o=(n=t)[5]<<24|n[6]<<16|n[7]<<8|n[8];return o<9?i:{match:!0,consumed:o,dataOffset:o,hasAudioTrack:a,hasVideoTrack:r}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeiArrived",{get:function(){return this._onSeiArrived},set:function(e){this._onSeiArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new s.A},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 h.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0,a=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;n=e.probe(t).dataOffset}for(this._firstParse&&(this._firstParse=!1,i+n!==this._dataOffset&&r.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(o=new DataView(t,n)).getUint32(0,!a)&&r.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),n+=4);n<t.byteLength;){this._dispatch=!0;var o=new DataView(t,n);if(n+11+4>t.byteLength)break;var s=o.getUint8(0),d=16777215&o.getUint32(0,!a);if(n+11+d+4>t.byteLength)break;if(8===s||9===s||18===s){var _=o.getUint8(4),c=o.getUint8(5),l=o.getUint8(6)|c<<8|_<<16|o.getUint8(7)<<24;16777215&o.getUint32(7,!a)&&r.A.w(this.TAG,"Meet tag which has StreamID != 0!");var u=n+11;switch(s){case 8:this._parseAudioData(t,u,d,l);break;case 9:this._parseVideoData(t,u,d,l,i+n);break;case 18:this._parseScriptData(t,u,d)}var p=o.getUint32(11+d,!a);p!==11+d&&r.A.w(this.TAG,"Invalid PrevTagSize ".concat(p)),n+=11+d+4}else r.A.w(this.TAG,"Unsupported tag type ".concat(s,", skipped")),n+=11+d+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=u.parseScriptData(e,t,i);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!=typeof n.onMetaData)return void r.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&r.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var a=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},a)),"boolean"==typeof a.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=a.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof a.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=a.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof a.audiodatarate&&(this._mediaInfo.audioDataRate=a.audiodatarate),"number"==typeof a.videodatarate&&(this._mediaInfo.videoDataRate=a.videodatarate),"number"==typeof a.width&&(this._mediaInfo.width=a.width),"number"==typeof a.height&&(this._mediaInfo.height=a.height),"number"==typeof a.duration){if(!this._durationOverrided){var o=Math.floor(a.duration*this._timescale);this._duration=o,this._mediaInfo.duration=o}}else this._mediaInfo.duration=0;if("number"==typeof a.framerate){var s=Math.floor(1e3*a.framerate);if(s>0){var d=s/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=d,this._referenceFrameRate.fps_num=s,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=d}}if("object"==typeof a.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var _=a.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(_),a.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=a,r.A.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))},e.prototype._parseSEIPayload=function(e,t,i){var n=T(e,t,i);n&&"function"==typeof this._onSeiArrived&&this._onSeiArrived(n)},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],n=1;n<e.times.length;n++){var a=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(a),i.push(e.filepositions[n])}return{times:t,filepositions:i}},e.prototype._parseAudioData=function(e,t,i,n){if(i<=1)r.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!0!==this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var a=new DataView(e,t,i).getUint8(0),o=a>>>4;if(9!==o)if(2===o||3===o||10===o){var s=0,d=(12&a)>>>2;if(d>=0&&d<=4){s=this._flvSoundRateTable[d];var _=(2&a)>>>1,c=1&a,h=this._audioMetadata,l=this._audioTrack;if(h||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(h=this._audioMetadata={}).type="audio",h.id=l.id,h.timescale=this._timescale,h.duration=this._duration,h.audioSampleRate=s,h.channelCount=0===c?1:2),10===o){var u=this._parseAACAudioData(e,t+1,i-1);if(null==u)return;if(0===u.packetType){if(h.config){if(S(u.data.config,h.config))return;r.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var p=u.data;h.audioSampleRate=p.samplingRate,h.channelCount=p.channelCount,h.codec=p.codec,h.originalCodec=p.originalCodec,h.config=p.config,h.refSampleDuration=1024/h.audioSampleRate*h.timescale,r.A.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",h),(y=this._mediaInfo).audioCodec=h.originalCodec,y.audioSampleRate=h.audioSampleRate,y.audioChannelCount=h.channelCount,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y)}else if(1===u.packetType){var f=this._timestampBase+n,g={unit:u.data,length:u.data.byteLength,dts:f,pts:f};l.samples.push(g),l.length+=u.data.length}else r.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(u.packetType))}else if(2===o){if(!h.codec){if(null==(p=this._parseMP3AudioData(e,t+1,i-1,!0)))return;h.audioSampleRate=p.samplingRate,h.channelCount=p.channelCount,h.codec=p.codec,h.originalCodec=p.originalCodec,h.refSampleDuration=1152/h.audioSampleRate*h.timescale,r.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",h),(y=this._mediaInfo).audioCodec=h.codec,y.audioSampleRate=h.audioSampleRate,y.audioChannelCount=h.channelCount,y.audioDataRate=p.bitRate,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y)}if(null==(A=this._parseMP3AudioData(e,t+1,i-1,!1)))return;f=this._timestampBase+n;var v={unit:A,length:A.byteLength,dts:f,pts:f};l.samples.push(v),l.length+=A.length}else if(3===o){var y;h.codec||(h.audioSampleRate=s,h.sampleSize=8*(_+1),h.littleEndian=!0,h.codec="ipcm",h.originalCodec="ipcm",this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",h),(y=this._mediaInfo).audioCodec=h.codec,y.audioSampleRate=h.audioSampleRate,y.audioChannelCount=h.channelCount,y.audioDataRate=h.sampleSize*h.audioSampleRate,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y));var A=new Uint8Array(e,t+1,i-1),b=(f=this._timestampBase+n,{unit:A,length:A.byteLength,dts:f,pts:f});l.samples.push(b),l.length+=A.length}}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+d)}else this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+o);else{if(i<=5)return void r.A.w(this.TAG,"Flv: Invalid audio packet, missing AudioFourCC in Ehnanced FLV payload!");var E=15&a,R=String.fromCharCode.apply(String,new Uint8Array(e,t,i).slice(1,5));switch(R){case"Opus":this._parseOpusAudioPacket(e,t+5,i-5,n,E);break;case"fLaC":this._parseFlacAudioPacket(e,t+5,i-5,n,E);break;default:this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec: "+R)}}}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var n={},a=new Uint8Array(e,t,i);return n.packetType=a[0],0===a[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=a.subarray(1),n}r.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n,a,r=new Uint8Array(e,t,i),o=null,s=0,d=null;if(s=n=r[0]>>>3,(a=(7&r[0])<<1|r[1]>>>7)<0||a>=this._mpegSamplingRates.length)this._onError(m.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var _=this._mpegSamplingRates[a],c=(120&r[1])>>>3;if(!(c<0||c>=8)){5===s&&(d=(7&r[1])<<1|r[2]>>>7,r[2]);var h=self.navigator.userAgent.toLowerCase();return-1!==h.indexOf("firefox")?a>=6?(s=5,o=new Array(4),d=a-3):(s=2,o=new Array(2),d=a):-1!==h.indexOf("android")?(s=2,o=new Array(2),d=a):(s=5,d=a,o=new Array(4),a>=6?d=a-3:1===c&&(s=2,o=new Array(2),d=a)),o[0]=s<<3,o[0]|=(15&a)>>>1,o[1]=(15&a)<<7,o[1]|=(15&c)<<3,5===s&&(o[1]|=(15&d)>>>1,o[2]=(1&d)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:_,channelCount:c,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+n}}this._onError(m.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,n){if(!(i<4)){this._littleEndian;var a=new Uint8Array(e,t,i),o=null;if(n){if(255!==a[0])return;var s=a[1]>>>3&3,d=(6&a[1])>>1,_=(240&a[2])>>>4,c=(12&a[2])>>>2,h=3&~(a[3]>>>6)?2:1,l=0,u=0;switch(s){case 0:l=this._mpegAudioV25SampleRateTable[c];break;case 2:l=this._mpegAudioV20SampleRateTable[c];break;case 3:l=this._mpegAudioV10SampleRateTable[c]}switch(d){case 1:_<this._mpegAudioL3BitRateTable.length&&(u=this._mpegAudioL3BitRateTable[_]);break;case 2:_<this._mpegAudioL2BitRateTable.length&&(u=this._mpegAudioL2BitRateTable[_]);break;case 3:_<this._mpegAudioL1BitRateTable.length&&(u=this._mpegAudioL1BitRateTable[_])}o={bitRate:u,samplingRate:l,channelCount:h,codec:"mp3",originalCodec:"mp3"}}else o=a;return o}r.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseOpusAudioPacket=function(e,t,i,n,a){if(0===a)this._parseOpusSequenceHeader(e,t,i);else if(1===a)this._parseOpusAudioData(e,t,i,n);else if(2!==a)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseOpusSequenceHeader=function(e,t,i){if(i<=16)r.A.w(this.TAG,"Flv: Invalid OpusSequenceHeader, lack of data!");else{var n=this._audioMetadata,a=this._audioTrack;n||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(n=this._audioMetadata={}).type="audio",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration);var o=new DataView(e,t,i);o.setUint8(8,0);var s=o.getUint8(9);o.setUint16(10,o.getUint16(10,!0),!1);var d=o.getUint32(12,!0);o.setUint32(12,o.getUint32(12,!0),!1);var _={config:new Uint8Array(e,t+8,i-8),channelCount:s,samplingFrequence:d,codec:"opus",originalCodec:"opus"};if(n.config){if(S(_.config,n.config))return;r.A.w(this.TAG,"OpusSequenceHeader has been changed, re-generate initialization segment")}n.audioSampleRate=_.samplingFrequence,n.channelCount=_.channelCount,n.codec=_.codec,n.originalCodec=_.originalCodec,n.config=_.config,n.refSampleDuration=20,r.A.v(this.TAG,"Parsed OpusSequenceHeader"),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",n);var c=this._mediaInfo;c.audioCodec=n.originalCodec,c.audioSampleRate=n.audioSampleRate,c.audioChannelCount=n.channelCount,c.hasVideo?null!=c.videoCodec&&(c.mimeType='video/x-flv; codecs="'+c.videoCodec+","+c.audioCodec+'"'):c.mimeType='video/x-flv; codecs="'+c.audioCodec+'"',c.isComplete()&&this._onMediaInfo(c)}},e.prototype._parseOpusAudioData=function(e,t,i,n){var a=this._audioTrack,r=new Uint8Array(e,t,i),o=this._timestampBase+n,s={unit:r,length:r.byteLength,dts:o,pts:o};a.samples.push(s),a.length+=r.length},e.prototype._parseFlacAudioPacket=function(e,t,i,n,a){if(0===a)this._parseFlacSequenceHeader(e,t,i);else if(1===a)this._parseFlacAudioData(e,t,i,n);else if(2!==a)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid Flac audio packet type ".concat(a))},e.prototype._parseFlacSequenceHeader=function(e,t,i){var n=this._audioMetadata,a=this._audioTrack;n||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(n=this._audioMetadata={}).type="audio",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration);var o=new Uint8Array(e,t+4,i-4),s=new p(o),d=s.readBits(16),_=s.readBits(16),c=_===d?_:null;s.readBits(24),s.readBits(24);var h=s.readBits(20),l=s.readBits(3)+1,u=s.readBits(5)+1;s.destroy();var f=new Uint8Array(o.byteLength+4);f.set(o,4),f[0]=128,f[1]=o.byteLength>>>16&255,f[2]=o.byteLength>>>8&255,f[3]=o.byteLength>>>0&255;var m={config:f,channelCount:l,samplingFrequence:h,sampleSize:u,codec:"flac",originalCodec:"flac"};if(n.config){if(S(m.config,n.config))return;r.A.w(this.TAG,"FlacSequenceHeader has been changed, re-generate initialization segment")}n.audioSampleRate=m.samplingFrequence,n.channelCount=m.channelCount,n.sampleSize=m.sampleSize,n.codec=m.codec,n.originalCodec=m.originalCodec,n.config=m.config,n.refSampleDuration=null!=c?1e3*c/m.samplingFrequence:null,r.A.v(this.TAG,"Parsed FlacSequenceHeader"),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",n);var g=this._mediaInfo;g.audioCodec=n.originalCodec,g.audioSampleRate=n.audioSampleRate,g.audioChannelCount=n.channelCount,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)},e.prototype._parseFlacAudioData=function(e,t,i,n){var a=this._audioTrack,r=new Uint8Array(e,t,i),o=this._timestampBase+n,s={unit:r,length:r.byteLength,dts:o,pts:o};a.samples.push(s),a.length+=r.length},e.prototype._parseVideoData=function(e,t,i,n,a){if(i<=1)r.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!0!==this._hasVideoFlagOverrided||!1!==this._hasVideo){var o=new Uint8Array(e,t,i)[0],s=(112&o)>>>4;if(128&o){var d=15&o,_=String.fromCharCode.apply(String,new Uint8Array(e,t,i).slice(1,5));if("hvc1"===_)this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,n,a,s,d);else{if("av01"!==_)return void this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(_));this._parseEnhancedAV1VideoPacket(e,t+5,i-5,n,a,s,d)}}else{var c=15&o;if(7===c)this._parseAVCVideoPacket(e,t+1,i-1,n,a,s);else{if(12!==c)return void this._onError(m.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(c));this._parseHEVCVideoPacket(e,t+1,i-1,n,a,s)}}}},e.prototype._parseAVCVideoPacket=function(e,t,i,n,a,o){if(i<4)r.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var s=this._littleEndian,d=new DataView(e,t,i),_=d.getUint8(0),c=(16777215&d.getUint32(0,!s))<<8>>8;if(0===_)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===_)this._parseAVCVideoData(e,t+4,i-4,n,a,o,c);else if(2!==_)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(_))}},e.prototype._parseHEVCVideoPacket=function(e,t,i,n,a,o){if(i<4)r.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var s=this._littleEndian,d=new DataView(e,t,i),_=d.getUint8(0),c=(16777215&d.getUint32(0,!s))<<8>>8;if(0===_)this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===_)this._parseHEVCVideoData(e,t+4,i-4,n,a,o,c);else if(2!==_)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(_))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,i,n,a,r,o){var s=this._littleEndian,d=new DataView(e,t,i);if(0===o)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===o){var _=(4294967040&d.getUint32(0,!s))>>8;this._parseHEVCVideoData(e,t+3,i-3,n,a,r,_)}else if(3===o)this._parseHEVCVideoData(e,t,i,n,a,r,0);else if(2!==o)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,i,n,a,r,o){if(this._littleEndian,new DataView(e,t,i),0===o)this._parseAV1CodecConfigurationRecord(e,t,i);else if(1===o)this._parseAV1VideoData(e,t,i,n,a,r,0);else{if(5===o)return void this._onError(m.A.FORMAT_ERROR,"Flv: Not Supported MP2T AV1 video packet type ".concat(o));if(2!==o)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(o))}},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){if(i<7)r.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,a=this._videoTrack,o=this._littleEndian,s=new DataView(e,t,i);if(n){if(void 0!==n.avcc){var d=new Uint8Array(e,t,i);if(S(d,n.avcc))return;r.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration;var _=s.getUint8(0),c=s.getUint8(1);if(s.getUint8(2),s.getUint8(3),1===_&&0!==c)if(this._naluLengthSize=1+(3&s.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var h=31&s.getUint8(5);if(0!==h){h>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(h));for(var l=6,u=0;u<h;u++){var p=s.getUint16(l,!o);if(l+=2,0!==p){var g=new Uint8Array(e,t+l,p);l+=p;var v=f.parseSPS(g);if(0===u){n.codecWidth=v.codec_size.width,n.codecHeight=v.codec_size.height,n.presentWidth=v.present_size.width,n.presentHeight=v.present_size.height,n.profile=v.profile_string,n.level=v.level_string,n.bitDepth=v.bit_depth,n.chromaFormat=v.chroma_format,n.sarRatio=v.sar_ratio,n.frameRate=v.frame_rate,!1!==v.frame_rate.fixed&&0!==v.frame_rate.fps_num&&0!==v.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);var y=n.frameRate.fps_den,A=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(y/A);for(var b=g.subarray(1,4),E="avc1.",R=0;R<3;R++){var T=b[R].toString(16);T.length<2&&(T="0"+T),E+=T}n.codec=E;var k=this._mediaInfo;k.width=n.codecWidth,k.height=n.codecHeight,k.fps=n.frameRate.fps,k.profile=n.profile,k.level=n.level,k.refFrames=v.ref_frames,k.chromaFormat=v.chroma_format_string,k.sarNum=n.sarRatio.width,k.sarDen=n.sarRatio.height,k.videoCodec=E,k.hasAudio?null!=k.audioCodec&&(k.mimeType='video/x-flv; codecs="'+k.videoCodec+","+k.audioCodec+'"'):k.mimeType='video/x-flv; codecs="'+k.videoCodec+'"',k.isComplete()&&this._onMediaInfo(k)}}}var L=s.getUint8(l);if(0!==L){for(L>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(L)),l++,u=0;u<L;u++)p=s.getUint16(l,!o),l+=2,0!==p&&(l+=p);n.avcc=new Uint8Array(i),n.avcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(m.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,i){if(i<22)r.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,a=this._videoTrack,o=this._littleEndian,s=new DataView(e,t,i);if(n){if(void 0!==n.hvcc){var d=new Uint8Array(e,t,i);if(S(d,n.hvcc))return;r.A.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration;var _=s.getUint8(0),c=31&s.getUint8(1);if(0!==_&&1!==_||0===c)this._onError(m.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord");else if(this._naluLengthSize=1+(3&s.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var h=s.getUint8(22),l=0,u=23;l<h;l++){var p=63&s.getUint8(u+0),f=s.getUint16(u+1,!o);u+=3;for(var v=0;v<f;v++){var y=s.getUint16(u+0,!o);if(0===v)if(33===p){u+=2;var A=new Uint8Array(e,t+u,y),b=g.parseSPS(A);n.codecWidth=b.codec_size.width,n.codecHeight=b.codec_size.height,n.presentWidth=b.present_size.width,n.presentHeight=b.present_size.height,n.profile=b.profile_string,n.level=b.level_string,n.bitDepth=b.bit_depth,n.chromaFormat=b.chroma_format,n.sarRatio=b.sar_ratio,n.frameRate=b.frame_rate,!1!==b.frame_rate.fixed&&0!==b.frame_rate.fps_num&&0!==b.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);var E=n.frameRate.fps_den,R=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(E/R),n.codec=b.codec_mimetype;var T=this._mediaInfo;T.width=n.codecWidth,T.height=n.codecHeight,T.fps=n.frameRate.fps,T.profile=n.profile,T.level=n.level,T.refFrames=b.ref_frames,T.chromaFormat=b.chroma_format_string,T.sarNum=n.sarRatio.width,T.sarDen=n.sarRatio.height,T.videoCodec=b.codec_mimetype,T.hasAudio?null!=T.audioCodec&&(T.mimeType='video/x-flv; codecs="'+T.videoCodec+","+T.audioCodec+'"'):T.mimeType='video/x-flv; codecs="'+T.videoCodec+'"',T.isComplete()&&this._onMediaInfo(T),u+=y}else u+=2+y;else u+=2+y}}n.hvcc=new Uint8Array(i),n.hvcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(m.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1))}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,i){if(i<4)r.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var n=this._videoMetadata,a=this._videoTrack,o=(this._littleEndian,new DataView(e,t,i));n?void 0!==n.av1c&&r.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=a.id,n.timescale=this._timescale,n.duration=this._duration);var s=127&o.getUint8(0);if(o.getUint8(1),o.getUint8(1),o.getUint8(2),1===s){var d=E.parseOBUs(new Uint8Array(e,t+4,i-4));if(null!=d){n.profile=d.profile_string,n.level=d.level_string,n.bitDepth=d.bit_depth,n.chromaFormat=d.chroma_format,n.frameRate=d.frame_rate,!1!==d.frame_rate.fixed&&0!==d.frame_rate.fps_num&&0!==d.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);var _=n.frameRate.fps_den,c=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(_/c),n.codec=d.codec_mimetype,n.extra=d;var h=this._mediaInfo;h.fps=n.frameRate.fps,h.profile=n.profile,h.level=n.level,h.refFrames=d.ref_frames,h.chromaFormat=d.chroma_format_string,h.videoCodec=d.codec_mimetype,h.hasAudio?null!=h.audioCodec&&(h.mimeType='video/x-flv; codecs="'+h.videoCodec+","+h.audioCodec+'"'):h.mimeType='video/x-flv; codecs="'+h.videoCodec+'"',h.isComplete()&&this._onMediaInfo(h),n.av1c=new Uint8Array(i),n.av1c.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Preparing AV1CodecConfigurationRecord")}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,i,n,a,o,s){for(var d=this._littleEndian,_=new DataView(e,t,i),c=[],h=0,l=0,u=this._naluLengthSize,p=this._timestampBase+n,f=1===o;l<i;){if(l+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(l,", dataSize = ").concat(i));break}var m=_.getUint32(l,!d);if(3===u&&(m>>>=8),m>i-u)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var g=31&_.getUint8(l+u);5===g&&(f=!0);var v=new Uint8Array(e,t+l,u+m),y={type:g,data:v};c.push(y),h+=v.byteLength,6===g&&this._parseSEIPayload(v.subarray(u),p+s,"h264"),l+=u+m}if(c.length){var A=this._videoTrack,S={units:c,length:h,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(S.fileposition=a),A.samples.push(S),A.length+=h}},e.prototype._parseHEVCVideoData=function(e,t,i,n,a,o,s){for(var d=this._littleEndian,_=new DataView(e,t,i),c=[],h=0,l=0,u=this._naluLengthSize,p=this._timestampBase+n,f=1===o;l<i;){if(l+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(l,", dataSize = ").concat(i));break}var m=_.getUint32(l,!d);if(3===u&&(m>>>=8),m>i-u)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var g=_.getUint8(l+u)>>1&63;19!==g&&20!==g&&21!==g||(f=!0);var v=new Uint8Array(e,t+l,u+m),y={type:g,data:v};c.push(y),h+=v.byteLength,39!==g&&40!==g||this._parseSEIPayload(v.subarray(u),p+s,"h265"),l+=u+m}if(c.length){var A=this._videoTrack,S={units:c,length:h,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(S.fileposition=a),A.samples.push(S),A.length+=h}},e.prototype._parseAV1VideoData=function(e,t,i,n,a,o,s){this._littleEndian,new DataView(e,t,i);var d,_=[],c=this._timestampBase+n,h=1===o;if(h){var l=this._videoMetadata,u=E.parseOBUs(new Uint8Array(e,t,i),l.extra);if(null==u)return void this._onError(m.A.FORMAT_ERROR,"Flv: Invalid AV1 VideoData");console.log(u),l.codecWidth=u.codec_size.width,l.codecHeight=u.codec_size.height,l.presentWidth=u.present_size.width,l.presentHeight=u.present_size.height,l.sarRatio=u.sar_ratio;var p=this._mediaInfo;p.width=l.codecWidth,p.height=l.codecHeight,p.sarNum=l.sarRatio.width,p.sarDen=l.sarRatio.height,r.A.v(this.TAG,"Parsed AV1DecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",l)}if(d=i,_.push({unitType:0,data:new Uint8Array(e,t+0,i)}),_.length){var f=this._videoTrack,g={units:_,length:d,isKeyframe:h,dts:c,cts:s,pts:c+s};h&&(g.fileposition=a),f.samples.push(g),f.length+=d}},e}();const L=k,w=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onPGSSubtitleData=null,this.onSynchronousKLVMetadata=null,this.onAsynchronousKLVMetadata=null,this.onSMPTE2038Metadata=null,this.onSEI=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null,this.onTracksUpdated=null},e}();var C,M=function(){this.program_pmt_pid={}};!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kEAC3=135]="kEAC3",e[e.kMetadata=21]="kMetadata",e[e.kSCTE35=134]="kSCTE35",e[e.kPGS=144]="kPGS",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(C||(C={}));var D,B=function(){this.pid_stream_type={},this.common_pids={h264:void 0,h265:void 0,av1:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},this.pes_private_data_pids={},this.timed_id3_pids={},this.pgs_pids={},this.pgs_langs={},this.synchronous_klv_pids={},this.asynchronous_klv_pids={},this.scte_35_pids={},this.smpte2038_pids={},this.all_audio_pids=[],this.subtitle_pids=[],this.parsed_sections={}},O=function(){},P=function(){},I=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0};!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(D||(D={}));var x,U,N=function(){},G=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},V=function(){function e(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],a=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===a)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=31&e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3],a=(128&e[i])>>>7,r=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=r,!(n>=D.kReserved0)&&0===a){var o=e.subarray(i,r);(t=new N).type=n,t.data=o}}return t},e}(),F=function(){function e(e,t,i){var n=8+e.byteLength+1+2+t.byteLength,a=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(a=!0,n+=4);var r=this.data=new Uint8Array(n);r[0]=1,r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=255,r[5]=225;var o=e.byteLength;r[6]=o>>>8,r[7]=255&o;var s=8;r.set(e,8),r[s+=o]=1;var d=t.byteLength;r[s+1]=d>>>8,r[s+2]=255&d,r.set(t,s+3),s+=3+d,a&&(r[s]=252|i.chroma_format_idc,r[s+1]=248|i.bit_depth_luma-8,r[s+2]=248|i.bit_depth_chroma-8,r[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(x||(x={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(U||(U={}));var j,z,H=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],q=(j=function(e,t){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},j(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),K=function(){},W=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return q(t,e),t}(K),X=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095==(i[t+0]<<8|i[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=(8&e[i+1])>>>3,a=(6&e[i+1])>>>1,r=1&e[i+1],o=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,d=(1&e[i+2])<<2|(192&e[i+3])>>>6,_=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+_>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=1===r?7:9,h=_-c;i+=c;var l=this.findNextSyncwordOffset(i+h);if(this.current_syncword_offset_=l,(0===n||1===n)&&0===a){var u=e.subarray(i,i+h);(t=new K).audio_object_type=o+1,t.sampling_freq_index=s,t.sampling_frequency=H[s],t.channel_config=d,t.data=u}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Y=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+1>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(695==(i[t+0]<<3|i[t+1]>>>5))return t;t++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),i=0,n=0;n<=t;n++)i<<=8,i|=e.readByte();return i},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var n=this.current_syncword_offset_,a=(31&t[n+1])<<8|t[n+2];if(n+3+a>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var o=new p(t.subarray(n+3,n+3+a)),s=null;if(o.readBool()){if(null==e){r.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+a),o.destroy();continue}s=e}else{var d=o.readBool();if(d&&o.readBool()){r.A.e(this.TAG,"audioMuxVersionA is Not Supported"),o.destroy();break}if(d&&this.getLATMValue(o),!o.readBool()){r.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),o.destroy();break}if(0!==o.readBits(6)){r.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),o.destroy();break}if(0!==o.readBits(4)){r.A.e(this.TAG,"more than 2 numProgram Not Supported"),o.destroy();break}if(0!==o.readBits(3)){r.A.e(this.TAG,"more than 2 numLayer Not Supported"),o.destroy();break}var _=d?this.getLATMValue(o):0,c=o.readBits(5);_-=5;var h=o.readBits(4);_-=4;var l=o.readBits(4);_-=4,o.readBits(3),(_-=3)>0&&o.readBits(_);var u=o.readBits(3);if(0!==u){r.A.e(this.TAG,"frameLengthType = ".concat(u,". Only frameLengthType = 0 Supported")),o.destroy();break}o.readByte();var f=o.readBool();if(f)if(d)this.getLATMValue(o);else{for(var m=0;;){m<<=8;var g=o.readBool();if(m+=o.readByte(),!g)break}console.log(m)}o.readBool()&&o.readByte(),(s=new W).audio_object_type=c,s.sampling_freq_index=h,s.sampling_frequency=H[s.sampling_freq_index],s.channel_config=l,s.other_data_present=f}for(var v=0;;){var y=o.readByte();if(v+=y,255!==y)break}for(var A=new Uint8Array(v),S=0;S<v;S++)A[S]=o.readByte();(i=new W).audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=H[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=A,this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+a)}return i},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Q=function(e){var t=null,i=e.audio_object_type,n=e.audio_object_type,a=e.sampling_freq_index,r=e.channel_config,o=0,s=navigator.userAgent.toLowerCase();-1!==s.indexOf("firefox")?a>=6?(n=5,t=new Array(4),o=a-3):(n=2,t=new Array(2),o=a):-1!==s.indexOf("android")?(n=2,t=new Array(2),o=a):(n=5,o=a,t=new Array(4),a>=6?o=a-3:1===r&&(n=2,t=new Array(2),o=a)),t[0]=n<<3,t[0]|=(15&a)>>>1,t[1]=(15&a)<<7,t[1]|=(15&r)<<3,5===n&&(t[1]|=(15&o)>>>1,t[2]=(1&o)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=H[a],this.channel_count=r,this.codec_mimetype="mp4a.40."+n,this.original_codec_mimetype="mp4a.40."+i},Z=function(){},$=function(){};!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(z||(z={}));var J,ee=function(e){var t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},te=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},ie=function(e,t){var i=t.readBits(8);return e?{component_tag:i}:{component_tag:i,splice_time:ee(t)}},ne=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},ae=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),e.readBits(5),n.program_splice_flag)n.utc_splice_time=e.readBits(32);else{n.component_count=e.readBits(8),n.components=[];for(var a=0;a<n.component_count;a++)n.components.push(ne(e))}return n.duration_flag&&(n.break_duration=te(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n},re=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:n.readBits(32)}},oe=function(e,t,i,n){var a=n.readBits(8),r=n.readBits(3);n.readBits(5);for(var o="",s=0;s<r;s++)o+=String.fromCharCode(n.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:a,dtmf_count:r,DTMF_char:o}},se=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},de=function(e,t,i,n){var a=n.readBits(32),r=n.readBool();n.readBits(7);var o={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:a,segmentation_event_cancel_indicator:r};if(r)return o;if(o.program_segmentation_flag=n.readBool(),o.segmentation_duration_flag=n.readBool(),o.delivery_not_restricted_flag=n.readBool(),o.delivery_not_restricted_flag?n.readBits(5):(o.web_delivery_allowed_flag=n.readBool(),o.no_regional_blackout_flag=n.readBool(),o.archive_allowed_flag=n.readBool(),o.device_restrictions=n.readBits(2)),!o.program_segmentation_flag){o.component_count=n.readBits(8),o.components=[];for(var s=0;s<o.component_count;s++)o.components.push(se(n))}o.segmentation_duration_flag&&(o.segmentation_duration=n.readBits(40)),o.segmentation_upid_type=n.readBits(8),o.segmentation_upid_length=n.readBits(8);var d=new Uint8Array(o.segmentation_upid_length);for(s=0;s<o.segmentation_upid_length;s++)d[s]=n.readBits(8);return o.segmentation_upid=d.buffer,o.segmentation_type_id=n.readBits(8),o.segment_num=n.readBits(8),o.segments_expected=n.readBits(8),52!==o.segmentation_type_id&&54!==o.segmentation_type_id&&56!==o.segmentation_type_id&&58!==o.segmentation_type_id||(o.sub_segment_num=n.readBits(8),o.sub_segments_expected=n.readBits(8)),o},_e=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:n.readBits(48),TAI_ns:n.readBits(32),UTC_offset:n.readBits(16)}},ce=function(e){return{component_tag:e.readBits(8),ISO_code:String.fromCharCode(e.readBits(8),e.readBits(8),e.readBits(8)),Bit_Stream_Mode:e.readBits(3),Num_Channels:e.readBits(4),Full_Srvc_Audio:e.readBool()}},he=function(e,t,i,n){for(var a=n.readBits(4),r=[],o=0;o<a;o++)r.push(ce(n));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:a,components:r}};!function(e){e[e.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",e[e.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",e[e.kSliceCRA_NUT=21]="kSliceCRA_NUT",e[e.kSliceVPS=32]="kSliceVPS",e[e.kSliceSPS=33]="kSliceSPS",e[e.kSlicePPS=34]="kSlicePPS",e[e.kSliceAUD=35]="kSliceAUD",e[e.kSliceSEI=39]="kSliceSEI",e[e.kSliceSEISuffix=40]="kSliceSEISuffix"}(J||(J={}));var le=function(){},ue=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},pe=function(){function e(e){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],a=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===a)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3]>>1&63,a=(128&e[i])>>>7,r=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=r,0===a){var o=e.subarray(i,r);(t=new le).type=n,t.data=o}}return t},e}(),fe=function(){function e(e,t,i,n){var a=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),r=this.data=new Uint8Array(a);r[0]=1,r[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,r[2]=n.general_profile_compatibility_flags_1,r[3]=n.general_profile_compatibility_flags_2,r[4]=n.general_profile_compatibility_flags_3,r[5]=n.general_profile_compatibility_flags_4,r[6]=n.general_constraint_indicator_flags_1,r[7]=n.general_constraint_indicator_flags_2,r[8]=n.general_constraint_indicator_flags_3,r[9]=n.general_constraint_indicator_flags_4,r[10]=n.general_constraint_indicator_flags_5,r[11]=n.general_constraint_indicator_flags_6,r[12]=n.general_level_idc,r[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,r[14]=255&n.min_spatial_segmentation_idc,r[15]=252|3&n.parallelismType,r[16]=252|3&n.chroma_format_idc,r[17]=248|7&n.bit_depth_luma_minus8,r[18]=248|7&n.bit_depth_chroma_minus8,r[19]=0,r[20]=0,r[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,r[22]=3,r[23]=128|J.kSliceVPS,r[24]=0,r[25]=1,r[26]=(65280&e.byteLength)>>8,r[27]=255&e.byteLength,r.set(e,28),r[23+(5+e.byteLength)+0]=128|J.kSliceSPS,r[23+(5+e.byteLength)+1]=0,r[23+(5+e.byteLength)+2]=1,r[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,r[23+(5+e.byteLength)+4]=255&t.byteLength,r.set(t,23+(5+e.byteLength)+5),r[23+(5+e.byteLength+5+t.byteLength)+0]=128|J.kSlicePPS,r[23+(5+e.byteLength+5+t.byteLength)+1]=0,r[23+(5+e.byteLength+5+t.byteLength)+2]=1,r[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&i.byteLength)>>8,r[23+(5+e.byteLength+5+t.byteLength)+4]=255&i.byteLength,r.set(i,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),me=function(){},ge=function(){},ve=function(){},ye=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],Ae=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=e[i+4]>>6,a=[48e3,44200,33e3][n],r=63&e[i+4],o=2*ye[n][r];if(isNaN(o)||i+o>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(i+o);this.current_syncword_offset_=s;var d=e[i+5]>>3,_=7&e[i+5],c=e[i+6]>>5,h=0;1&c&&1!==c&&(h+=2),4&c&&(h+=2),2===c&&(h+=2);var l=(e[i+6]<<8|e[i+7])>>12-h&1,u=[2,1,2,3,3,4,4,5][c]+l;(t=new ve).sampling_frequency=a,t.channel_count=u,t.channel_mode=c,t.bit_stream_identification=d,t.low_frequency_effects_channel_on=l,t.bit_stream_mode=_,t.frame_size_code=r,t.data=e.subarray(i,i+o)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Se=function(e){var t;t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},be=function(){},Ee=function(){function e(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextEAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=new p(e.subarray(i+2)),a=(n.readBits(2),n.readBits(3),n.readBits(11)+1<<1),r=n.readBits(2),o=null,s=null;3===r?(o=[24e3,22060,16e3][r=n.readBits(2)],s=3):(o=[48e3,44100,32e3][r],s=n.readBits(2));var d=n.readBits(3),_=n.readBits(1),c=n.readBits(5);if(i+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var h=this.findNextSyncwordOffset(i+a);this.current_syncword_offset_=h;var l=[2,1,2,3,3,4,4,5][d]+_;n.destroy(),(t=new be).sampling_frequency=o,t.channel_count=l,t.channel_mode=d,t.bit_stream_identification=c,t.low_frequency_effects_channel_on=_,t.frame_size=a,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+a)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),Re=function(e){var t,i=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&i,248&i,e.sampling_rate_code<<6|e.bit_stream_identification<<1,e.channel_mode<<1|e.low_frequency_effects_channel_on,0],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.num_blks=e.num_blks,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},Te=function(){};const ke=function(){function e(e){this.TAG="AV1OBUInMpegTsParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find AV1 startcode until payload end!")}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),a=0,r=0;r<i;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(n[a]=t[r],a++);return new Uint8Array(n.buffer,0,a)},e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+2>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(1==(i[t+0]<<16|i[t+1]<<8|i[t+2]))return t;t++}},e.prototype.readNextOBUPayload=function(){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var n=this.current_startcode_offset_+3,a=this.findNextStartCodeOffset(n);this.current_startcode_offset_=a,i=e._ebsp2rbsp(t.subarray(n,a))}return i},e}();var Le=function(){},we=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ce=function(){return Ce=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var a in t=arguments[i])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ce.apply(this,arguments)},Me=function(e){function t(t,i){var n=e.call(this)||this;return n.TAG="TSDemuxer",n.first_parse_=!0,n.media_info_=new s.A,n.timescale_=90,n.duration_=0,n.current_pmt_pid_=-1,n.program_pmt_map_={},n.pes_slice_queues_={},n.section_slice_queues_={},n.video_metadata_={vps:void 0,sps:void 0,pps:void 0,av1c:void 0,details:void 0},n.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},n.last_pcr_base_=NaN,n.timestamp_offset_=0,n.audio_last_sample_pts_=void 0,n.aac_last_incomplete_data_=null,n.has_video_=!1,n.has_audio_=!1,n.video_init_segment_dispatched_=!1,n.audio_init_segment_dispatched_=!1,n.video_metadata_changed_=!1,n.audio_metadata_changed_=!1,n.video_keyframe_seen_after_init_=!1,n.stashed_audio_before_video_init_=[],n._last_dispatch_block_reason_="",n.video_init_dispatch_time_=0,n.audio_wrap_log_count_=0,n.audio_stale_drop_log_count_=0,n.audio_startup_align_log_count_=0,n.audio_startup_drop_log_count_=0,n.active_audio_pid_=0,n.loas_previous_frame=null,n.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},n.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},n.ts_packet_size_=t.ts_packet_size,n.sync_offset_=t.sync_offset,n.config_=i,n}return we(t,e),t.prototype.destroy=function(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,e.prototype.destroy.call(this)},t.probe=function(e){var t=new Uint8Array(e),i=-1,n=188;if(t.byteLength<=3*n)return{needMoreData:!0};for(;-1===i;){for(var a=Math.min(1e3,t.byteLength-3*n),o=0;o<a;){if(71===t[o]&&71===t[o+n]&&71===t[o+2*n]){i=o;break}o++}if(-1===i)if(188===n)n=192;else{if(192!==n)break;n=204}}return-1===i?{match:!1}:(192===n&&i>=4?(r.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===n&&r.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:n,sync_offset:i})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new s.A},t.prototype.selectAudioPid=function(e){if(this.pmt_){var t=this.pmt_.all_audio_pids.map(function(e){return e.pid});if(0===e||t.includes(e)){r.A.v(this.TAG,"[muvie] selectAudioPid: switching active audio PID to ".concat(e||"(default)")),this.active_audio_pid_=e;var i=this.pmt_;i.common_pids.adts_aac=void 0,i.common_pids.loas_aac=void 0,i.common_pids.ac3=void 0,i.common_pids.eac3=void 0,i.common_pids.opus=void 0,i.common_pids.mp3=void 0;var n=0!==e?i.all_audio_pids.find(function(t){return t.pid===e}):void 0;n||(n=i.all_audio_pids[0]),n&&("aac"===n.codec?i.common_pids.adts_aac=n.pid:"aac-loas"===n.codec?i.common_pids.loas_aac=n.pid:"ac3"===n.codec?i.common_pids.ac3=n.pid:"eac3"===n.codec?i.common_pids.eac3=n.pid:"opus"===n.codec?i.common_pids.opus=n.pid:"mp3"===n.codec&&(i.common_pids.mp3=n.pid)),this.audio_init_segment_dispatched_=!1,this.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},this.audio_track_.samples=[],this.audio_track_.length=0,this.audio_last_sample_pts_=void 0,this.aac_last_incomplete_data_=null,this.loas_previous_frame=null,this.stashed_audio_before_video_init_=[]}else r.A.w(this.TAG,"[muvie] selectAudioPid: pid ".concat(e," not in available audio PIDs [").concat(t.join(", "),"]"))}},t.prototype.setPreferredAudioPid=function(e){this.active_audio_pid_=e,r.A.v(this.TAG,"[muvie] setPreferredAudioPid: ".concat(e))},t.prototype.getAvailableTracks=function(){return this.pmt_?{audioTracks:this.pmt_.all_audio_pids,subtitleTracks:this.pmt_.subtitle_pids}:{audioTracks:[],subtitleTracks:[]}},t.prototype.parseChunks=function(e,t){if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new h.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0;for(this.first_parse_&&(this.first_parse_=!1,i=this.sync_offset_);i+this.ts_packet_size_<=e.byteLength;){var n=t+i;192===this.ts_packet_size_&&(i+=4);var a=new Uint8Array(e,i,188),o=a[0];if(71!==o){r.A.e(this.TAG,"sync_byte = ".concat(o,", not 0x47"));break}var s=(64&a[1])>>>6,d=(a[1],(31&a[1])<<8|a[2]),_=(48&a[3])>>>4,c=15&a[3],l=!(!this.pmt_||this.pmt_.pcr_pid!==d),u={},p=4;if(2==_||3==_){var f=a[4];if(f>0&&(l||3==_)&&(u.discontinuity_indicator=(128&a[5])>>>7,u.random_access_indicator=(64&a[5])>>>6,u.elementary_stream_priority_indicator=(32&a[5])>>>5,(16&a[5])>>>4)){var m=300*this.getPcrBase(a)+((1&a[10])<<8|a[11]);this.last_pcr_=m}if(2==_||5+f===188){i+=188,204===this.ts_packet_size_&&(i+=16);continue}p=5+f}if(1==_||3==_)if(0===d||d===this.current_pmt_pid_||null!=this.pmt_&&this.pmt_.pid_stream_type[d]===C.kSCTE35){var g=188-p;this.handleSectionSlice(e,i+p,g,{pid:d,file_position:n,payload_unit_start_indicator:s,continuity_conunter:c,random_access_indicator:u.random_access_indicator})}else if(null!=this.pmt_&&null!=this.pmt_.pid_stream_type[d]){g=188-p;var v=this.pmt_.pid_stream_type[d];d!==this.pmt_.common_pids.h264&&d!==this.pmt_.common_pids.h265&&d!==this.pmt_.common_pids.av1&&d!==this.pmt_.common_pids.adts_aac&&d!==this.pmt_.common_pids.loas_aac&&d!==this.pmt_.common_pids.ac3&&d!==this.pmt_.common_pids.eac3&&d!==this.pmt_.common_pids.opus&&d!==this.pmt_.common_pids.mp3&&!0!==this.pmt_.pes_private_data_pids[d]&&!0!==this.pmt_.timed_id3_pids[d]&&!0!==this.pmt_.pgs_pids[d]&&!0!==this.pmt_.synchronous_klv_pids[d]&&!0!==this.pmt_.asynchronous_klv_pids[d]||this.handlePESSlice(e,i+p,g,{pid:d,stream_type:v,file_position:n,payload_unit_start_indicator:s,continuity_conunter:c,random_access_indicator:u.random_access_indicator})}i+=188,204===this.ts_packet_size_&&(i+=16)}return this.dispatchAudioVideoMediaSegment(),i},t.prototype.handleSectionSlice=function(e,t,i,n){var a=new Uint8Array(e,t,i),r=this.section_slice_queues_[n.pid];if(n.payload_unit_start_indicator){var o=a[0];if(null!=r&&0!==r.total_length){var s=new Uint8Array(e,t+1,Math.min(i,o));r.slices.push(s),r.total_length+=s.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):this.clearSlices(r,n)}for(var d=1+o;d<a.byteLength&&255!==a[d+0];){var _=(15&a[d+1])<<8|a[d+2];this.section_slice_queues_[n.pid]=new I,(r=this.section_slice_queues_[n.pid]).expected_length=_+3,r.file_position=n.file_position,r.random_access_indicator=n.random_access_indicator,s=new Uint8Array(e,t+d,Math.min(i-d,r.expected_length-r.total_length)),r.slices.push(s),r.total_length+=s.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):r.total_length>=r.expected_length&&this.clearSlices(r,n),d+=s.byteLength}}else null!=r&&0!==r.total_length&&(s=new Uint8Array(e,t,Math.min(i,r.expected_length-r.total_length)),r.slices.push(s),r.total_length+=s.byteLength,r.total_length===r.expected_length?this.emitSectionSlices(r,n):r.total_length>=r.expected_length&&this.clearSlices(r,n))},t.prototype.handlePESSlice=function(e,t,i,n){var a=new Uint8Array(e,t,i),o=a[0]<<16|a[1]<<8|a[2],s=(a[3],a[4]<<8|a[5]);if(n.payload_unit_start_indicator){if(1!==o)return void r.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(o));var d=this.pes_slice_queues_[n.pid];d&&(0===d.expected_length||d.expected_length===d.total_length?this.emitPESSlices(d,n):this.clearSlices(d,n)),this.pes_slice_queues_[n.pid]=new I,this.pes_slice_queues_[n.pid].file_position=n.file_position,this.pes_slice_queues_[n.pid].random_access_indicator=n.random_access_indicator}if(null!=this.pes_slice_queues_[n.pid]){var _=this.pes_slice_queues_[n.pid];_.slices.push(a),n.payload_unit_start_indicator&&(_.expected_length=0===s?0:s+6),_.total_length+=a.byteLength,_.expected_length>0&&_.expected_length===_.total_length?this.emitPESSlices(_,n):_.expected_length>0&&_.expected_length<_.total_length&&this.clearSlices(_,n)}},t.prototype.emitSectionSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,a=0;n<e.slices.length;n++){var r=e.slices[n];i.set(r,a),a+=r.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var o=new P;o.pid=t.pid,o.data=i,o.file_position=e.file_position,o.random_access_indicator=e.random_access_indicator,this.parseSection(o)},t.prototype.emitPESSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,a=0;n<e.slices.length;n++){var r=e.slices[n];i.set(r,a),a+=r.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var o=new O;o.pid=t.pid,o.data=i,o.stream_type=t.stream_type,o.file_position=e.file_position,o.random_access_indicator=e.random_access_indicator,this.parsePES(o)},t.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},t.prototype.parseSection=function(e){var t=e.data,i=e.pid;0===i?this.parsePAT(t):i===this.current_pmt_pid_?this.parsePMT(t):null!=this.pmt_&&this.pmt_.scte_35_pids[i]&&this.parseSCTE35(t)},t.prototype.parsePES=function(e){var t=e.data,i=t[0]<<16|t[1]<<8|t[2],n=t[3],a=t[4]<<8|t[5];if(1===i)if(188!==n&&190!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n){t[6];var o=(192&t[7])>>>6,s=t[8],d=void 0,_=void 0;2!==o&&3!==o||(d=this.getTimestamp(t,9),_=3===o?this.getTimestamp(t,14):d);var c=9+s,h=void 0;if(0!==a){if(a<3+s)return void r.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");h=a-3-s}else h=t.byteLength-c;var l=t.subarray(c,c+h);switch(e.stream_type){case C.kMPEG1Audio:case C.kMPEG2Audio:this.parseMP3Payload(l,d);break;case C.kPESPrivateData:this.pmt_.common_pids.av1===e.pid?this.parseAV1Payload(l,d,_,e.file_position,e.random_access_indicator):this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(l,d):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(l,d):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(l,d):this.pmt_.asynchronous_klv_pids[e.pid]?this.parseAsynchronousKLVMetadataPayload(l,e.pid,n):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(l,d,_,e.pid,n):this.parsePESPrivateDataPayload(l,d,_,e.pid,n);break;case C.kADTSAAC:this.parseADTSAACPayload(l,d);break;case C.kLOASAAC:this.parseLOASAACPayload(l,d);break;case C.kAC3:this.parseAC3Payload(l,d);break;case C.kEAC3:this.parseEAC3Payload(l,d);break;case C.kMetadata:this.pmt_.timed_id3_pids[e.pid]?this.parseTimedID3MetadataPayload(l,d,_,e.pid,n):this.pmt_.synchronous_klv_pids[e.pid]&&this.parseSynchronousKLVMetadataPayload(l,d,_,e.pid,n);break;case C.kPGS:this.parsePGSPayload(l,d,_,e.pid,n,this.pmt_.pgs_langs[e.pid]);break;case C.kH264:this.parseH264Payload(l,d,_,e.file_position,e.random_access_indicator);break;case C.kH265:this.parseH265Payload(l,d,_,e.file_position,e.random_access_indicator)}}else 188!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n||e.stream_type!==C.kPESPrivateData||(c=6,h=void 0,h=0!==a?a:t.byteLength-c,l=t.subarray(c,c+h),this.parsePESPrivateDataPayload(l,void 0,void 0,e.pid,n));else r.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(i))},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var i=(15&e[1])<<8|e[2],n=(e[3],e[4],(62&e[5])>>>1),a=1&e[5],o=e[6],s=(e[7],null);if(1===a&&0===o)(s=new M).version_number=n;else if(null==(s=this.pat_))return;for(var d=i-5-4,_=-1,c=-1,h=8;h<8+d;h+=4){var l=e[h]<<8|e[h+1],u=(31&e[h+2])<<8|e[h+3];0===l?s.network_pid=u:(s.program_pmt_pid[l]=u,-1===_&&(_=l),-1===c&&(c=u))}1===a&&0===o&&(null==this.pat_&&r.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=_,this.current_pmt_pid_=c)}else r.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},t.prototype.parsePMT=function(e){var t,i,n=this,a=e[0];if(2===a){var o=(15&e[1])<<8|e[2],s=e[3]<<8|e[4],d=(62&e[5])>>>1,_=1&e[5],c=e[6],h=(e[7],null),l=this.program_pmt_map_[s];if(!(l&&l.version_number===d&&l.parsed_sections&&l.parsed_sections[c])){var u=!1;if(1===_&&0===c)(h=new B).program_number=s,h.version_number=d,h.parsed_sections[c]=!0,this.program_pmt_map_[s]=h,u=!0;else{if(null==(h=this.program_pmt_map_[s]))return;h.parsed_sections[c]=!0}h.pcr_pid=(31&e[8])<<8|e[9];for(var p=(15&e[10])<<8|e[11],f=12+p,m=o-9-p-4,g=f;g<f+m;){var v=e[g],y=(31&e[g+1])<<8|e[g+2],A=(15&e[g+3])<<8|e[g+4];h.pid_stream_type[y]=v;for(var S=h.common_pids.h264||h.common_pids.h265,b=h.common_pids.adts_aac||h.common_pids.loas_aac||h.common_pids.ac3||h.common_pids.eac3||h.common_pids.opus||h.common_pids.mp3,E=void 0,R=g+5;R<g+5+A;){var T=e[R],k=e[R+1];10===T&&k>=3&&(E=String.fromCharCode(e[R+2],e[R+3],e[R+4]).trim()),R+=2+k}var L="";if(v!==C.kH264||S?v!==C.kH265||S?v===C.kADTSAAC?(b||(h.common_pids.adts_aac=y),h.all_audio_pids.push({pid:y,codec:"aac",lang:E}),L="aac"):v===C.kLOASAAC?(b||(h.common_pids.loas_aac=y),h.all_audio_pids.push({pid:y,codec:"aac-loas",lang:E}),L="aac-loas"):v===C.kAC3?(b||(h.common_pids.ac3=y),h.all_audio_pids.push({pid:y,codec:"ac3",lang:E}),L="ac3"):v===C.kEAC3?(b||(h.common_pids.eac3=y),h.all_audio_pids.push({pid:y,codec:"eac3",lang:E}),L="eac3"):v!==C.kMPEG1Audio&&v!==C.kMPEG2Audio||(b||(h.common_pids.mp3=y),h.all_audio_pids.push({pid:y,codec:"mp3",lang:E}),L="mp3"):h.common_pids.h265=y:h.common_pids.h264=y,L&&u&&r.A.v(this.TAG,"[muvie] PMT parsing: found audio track (codec=".concat(L,", pid=").concat(y,", lang=").concat(E||"und",", is_primary=").concat(!b,")")),v===C.kPESPrivateData){if(h.pes_private_data_pids[y]=!0,A>0){for(var w=g+5;w<g+5+A;){T=e[w+0];var M=e[w+1];if(5===T){var D=String.fromCharCode.apply(String,Array.from(e.subarray(w+2,w+2+M)));"VANC"===D?h.smpte2038_pids[y]=!0:"AV01"===D?h.common_pids.av1=y:"Opus"===D?h.common_pids.opus=y:"KLVA"===D&&(h.asynchronous_klv_pids[y]=!0)}else if(127===T){if(y===h.common_pids.opus){var O=null;if(128===e[w+2]&&(O=e[w+3]),null==O){r.A.e(this.TAG,"Not Supported Opus channel count.");continue}var P={codec:"opus",channel_count:15&O?15&O:2,channel_config_code:O,sample_rate:48e3},I={codec:"opus",meta:P};0==this.audio_init_segment_dispatched_?(this.audio_metadata_=P,this.dispatchAudioInitSegment(I)):this.detectAudioMetadataChange(I)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(I))}}else 128===T&&y===h.common_pids.av1&&(this.video_metadata_.av1c=e.subarray(w+2,w+2+M));w+=2+M}var x=e.subarray(g+5,g+5+A);this.dispatchPESPrivateDataDescriptor(y,v,x)}}else if(v===C.kMetadata){if(A>0)for(w=g+5;w<g+5+A;){T=e[w+0];var U=e[w+1];if(38===T){var N=e[w+2]<<8|e[w+3],G=null;65535===N&&(G=String.fromCharCode.apply(String,Array.from(e.subarray(w+4,w+4+4))));var V=null;if(255===e[w+4+(65535===N?4:0)]){var F=4+(65535===N?4:0)+1;V=String.fromCharCode.apply(String,Array.from(e.subarray(w+F,w+F+4)))}"ID3 "===G&&"ID3 "===V?h.timed_id3_pids[y]=!0:"KLVA"===V&&(h.synchronous_klv_pids[y]=!0)}w+=2+U}}else if(v===C.kSCTE35)h.scte_35_pids[y]=!0;else if(v===C.kPGS){if(h.pgs_langs[y]="und",A>0)for(w=g+5;w<g+5+A;){T=e[w+0];var j=e[w+1];if(10===T){var z=String.fromCharCode.apply(String,Array.from(e.slice(w+2,w+5)));h.pgs_langs[y]=z}w+=2+j}h.pgs_pids[y]=!0,h.subtitle_pids.push({pid:y,type:"pgs",lang:h.pgs_langs[y]})}g+=5+A}if(s===this.current_program_){null==this.pmt_&&r.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(h))),this.pmt_=h,(h.common_pids.h264||h.common_pids.h265||h.common_pids.av1)&&(this.has_video_=!0),(h.common_pids.adts_aac||h.common_pids.loas_aac||h.common_pids.ac3||h.common_pids.opus||h.common_pids.mp3)&&(this.has_audio_=!0);for(var H=function(e){h.subtitle_pids.find(function(t){return t.pid===e})||h.subtitle_pids.push({pid:e,type:"timed_id3"})},q=0,K=Object.keys(h.timed_id3_pids).map(Number);q<K.length;q++)H(K[q]);if(u&&(h.common_pids.ac3||h.common_pids.eac3)){var W=h.common_pids.ac3?"ac-3":"ec-3",X=null===(t=this.config_)||void 0===t?void 0:t.preferredAudioPid,Y=void 0;X&&h.all_audio_pids.some(function(e){return e.pid===X})?Y=h.all_audio_pids.find(function(e){return e.pid===X}):this.active_audio_pid_&&h.all_audio_pids.some(function(e){return e.pid===n.active_audio_pid_})&&(Y=h.all_audio_pids.find(function(e){return e.pid===n.active_audio_pid_})),Y||(Y=h.all_audio_pids.find(function(e){return"aac"===e.codec||"mp3"===e.codec})),Y&&(r.A.w(this.TAG,"[muvie] Primary audio is ".concat(W," (browser-incompatible) — auto-fallback to ").concat(Y.codec," pid=").concat(Y.pid," lang=").concat(Y.lang||"und")),h.common_pids.ac3=0,h.common_pids.eac3=0,this.selectAudioPid(Y.pid))}else if(u){var Q=null===(i=this.config_)||void 0===i?void 0:i.preferredAudioPid;Q&&h.all_audio_pids.some(function(e){return e.pid===Q})&&this.selectAudioPid(Q)}u&&this.onTracksUpdated&&(h.all_audio_pids.length>1||h.subtitle_pids.length>0)&&this.onTracksUpdated({audioTracks:h.all_audio_pids,subtitleTracks:h.subtitle_pids})}}}else r.A.e(this.TAG,"parsePMT: table_id ".concat(a," is not corresponded to PMT!"))},t.prototype.parseSCTE35=function(e){var t=function(e){var t=new p(e),i=t.readBits(8),n=t.readBool(),a=t.readBool();t.readBits(2);var r=t.readBits(12),o=t.readBits(8),s=t.readBool(),d=t.readBits(6),_=4*t.readBits(31)+t.readBits(2),c=t.readBits(8),h=t.readBits(12),l=t.readBits(12),u=t.readBits(8),f=null;u===z.kSpliceNull?f={}:u===z.kSpliceSchedule?f=function(e){for(var t=e.readBits(8),i=[],n=0;n<t;n++)i.push(ae(e));return{splice_count:t,events:i}}(t):u===z.kSpliceInsert?f=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),n.splice_immediate_flag=e.readBool(),e.readBits(4),n.program_splice_flag&&!n.splice_immediate_flag&&(n.splice_time=ee(e)),!n.program_splice_flag){n.component_count=e.readBits(8),n.components=[];for(var a=0;a<n.component_count;a++)n.components.push(ie(n.splice_immediate_flag,e))}return n.duration_flag&&(n.break_duration=te(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n}(t):u===z.kTimeSignal?f=function(e){return{splice_time:ee(e)}}(t):u===z.kBandwidthReservation?f={}:u===z.kPrivateCommand?f=function(e,t){for(var i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),n=new Uint8Array(e-4),a=0;a<e-4;a++)n[a]=t.readBits(8);return{identifier:i,private_data:n.buffer}}(l,t):t.readBits(8*l);for(var m=[],g=t.readBits(16),v=0;v<g;){var y=t.readBits(8),A=t.readBits(8),S=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8));0===y?m.push(re(y,A,S,t)):1===y?m.push(oe(y,A,S,t)):2===y?m.push(de(y,A,S,t)):3===y?m.push(_e(y,A,S,t)):4===y?m.push(he(y,A,S,t)):t.readBits(8*(A-4)),v+=2+A}var b={table_id:i,section_syntax_indicator:n,private_indicator:a,section_length:r,protocol_version:o,encrypted_packet:s,encryption_algorithm:d,pts_adjustment:_,cw_index:c,tier:h,splice_command_length:l,splice_command_type:u,splice_command:f,descriptor_loop_length:g,splice_descriptors:m,E_CRC32:s?t.readBits(32):void 0,CRC32:t.readBits(32)};if(u===z.kSpliceInsert){var E=f;if(E.splice_event_cancel_indicator)return{splice_command_type:u,detail:b,data:e};if(E.program_splice_flag&&!E.splice_immediate_flag){var R=E.duration_flag?E.break_duration.auto_return:void 0,T=E.duration_flag?E.break_duration.duration/90:void 0;return E.splice_time.time_specified_flag?{splice_command_type:u,pts:(_+E.splice_time.pts_time)%Math.pow(2,33),auto_return:R,duraiton:T,detail:b,data:e}:{splice_command_type:u,auto_return:R,duraiton:T,detail:b,data:e}}return{splice_command_type:u,auto_return:R=E.duration_flag?E.break_duration.auto_return:void 0,duraiton:T=E.duration_flag?E.break_duration.duration/90:void 0,detail:b,data:e}}if(u===z.kTimeSignal){var k=f;return k.splice_time.time_specified_flag?{splice_command_type:u,pts:(_+k.splice_time.pts_time)%Math.pow(2,33),detail:b,data:e}:{splice_command_type:u,detail:b,data:e}}return{splice_command_type:u,detail:b,data:e}}(e);if(null!=t.pts){var i=Math.floor(t.pts/this.timescale_);t.pts=i}else t.nearest_pts=this.getNearestTimestampMilliseconds();this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},t.prototype.parseAV1Payload=function(e,t,i,n,a){for(var r=new ke(e),o=null,s=[],d=0,_=!1,c=null;null!=(o=r.readNextOBUPayload());){if((c=E.parseOBUs(o,this.video_metadata_.details))&&!0===c.keyframe)if(this.video_init_segment_dispatched_){if(!0===this.detectVideoMetadataChange(null,c)){var h;this.video_metadata_changed_=!0,this.dispatchVideoMediaSegment(),(h=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+c.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),h.set(c.sequence_header_data,this.video_metadata_.av1c.byteLength),c.av1c=h,this.dispatchVideoInitSegment()}}else(h=new Uint8Array(new ArrayBuffer(this.video_metadata_.av1c.byteLength+c.sequence_header_data.byteLength))).set(this.video_metadata_.av1c,0),h.set(c.sequence_header_data,this.video_metadata_.av1c.byteLength),c.av1c=h,this.video_metadata_.details=c,this.dispatchVideoInitSegment();this.video_metadata_.details=c,this.video_init_segment_dispatched_&&(null==c?void 0:c.keyframe)&&(this.video_keyframe_seen_after_init_=!0),_||(_=c.keyframe),s.push({data:o}),d+=o.byteLength}var l=Math.floor(t/this.timescale_),u=Math.floor(i/this.timescale_);if(s.length){var p=this.video_track_,f={units:s,length:d,isKeyframe:_,dts:u,pts:l,cts:l-u,file_position:n};p.samples.push(f),p.length+=d}},t.prototype.parseH264Payload=function(e,t,i,n,a){for(var o=new V(e),s=null,d=[],_=0,c=!1;null!=(s=o.readNextNaluPayload());){var h=new G(s);if(h.type===D.kSliceSPS){var l=f.parseSPS(s.data);this.video_init_segment_dispatched_?!0===this.detectVideoMetadataChange(h,l)&&(r.A.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:h,pps:void 0,av1c:void 0,details:l}):(this.video_metadata_.sps=h,this.video_metadata_.details=l)}else h.type===D.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_.pps=h,this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):h.type===D.kSliceIDR||h.type===D.kSliceNonIDR&&1===a?c=!0:h.type===D.kSliceSEI&&this.parseSEIPayload(s.data,t,"h264");this.video_init_segment_dispatched_&&(c&&!this.video_keyframe_seen_after_init_?(r.A.v(this.TAG,"[muvie] H264: first IDR keyframe seen after init dispatch — media segments will now flow"),this.video_keyframe_seen_after_init_=!0):c&&(this.video_keyframe_seen_after_init_=!0),d.push(h),_+=h.data.byteLength)}var u=Math.floor(t/this.timescale_),p=Math.floor(i/this.timescale_);if(d.length){var m=this.video_track_,g={units:d,length:_,isKeyframe:c,dts:p,pts:u,cts:u-p,file_position:n};m.samples.push(g),m.length+=_}},t.prototype.parseH265Payload=function(e,t,i,n,a){for(var o=new pe(e),s=null,d=[],_=0,c=!1;null!=(s=o.readNextNaluPayload());){var h=new ue(s);if(h.type===J.kSliceVPS){if(!this.video_init_segment_dispatched_){var l=g.parseVPS(s.data);this.video_metadata_.vps=h,this.video_metadata_.details=Ce(Ce({},this.video_metadata_.details),l)}}else h.type===J.kSliceSPS?(l=g.parseSPS(s.data),this.video_init_segment_dispatched_?!0===this.detectVideoMetadataChange(h,l)&&(r.A.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:h,pps:void 0,av1c:void 0,details:l}):(this.video_metadata_.sps=h,this.video_metadata_.details=Ce(Ce({},this.video_metadata_.details),l))):h.type===J.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(l=g.parsePPS(s.data),this.video_metadata_.pps=h,this.video_metadata_.details=Ce(Ce({},this.video_metadata_.details),l),this.video_metadata_.vps&&this.video_metadata_.sps&&this.video_metadata_.pps&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):h.type===J.kSliceIDR_W_RADL||h.type===J.kSliceIDR_N_LP||h.type===J.kSliceCRA_NUT?c=!0:h.type!==J.kSliceSEI&&h.type!==J.kSliceSEISuffix||this.parseSEIPayload(s.data,t,"h265");this.video_init_segment_dispatched_&&(c&&!this.video_keyframe_seen_after_init_?(r.A.v(this.TAG,"[muvie] H265: first keyframe seen after init dispatch — media segments will now flow"),this.video_keyframe_seen_after_init_=!0):c&&(this.video_keyframe_seen_after_init_=!0),d.push(h),_+=h.data.byteLength)}var u=Math.floor(t/this.timescale_),p=Math.floor(i/this.timescale_);if(d.length){var f=this.video_track_,m={units:d,length:_,isKeyframe:c,dts:p,pts:u,cts:u-p,file_position:n};f.samples.push(m),f.length+=_}},t.prototype.detectVideoMetadataChange=function(e,t){if(t.codec_mimetype!==this.video_metadata_.details.codec_mimetype)return r.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(this.video_metadata_.details.codec_mimetype," to ").concat(t.codec_mimetype)),!0;if(t.codec_size.width!==this.video_metadata_.details.codec_size.width||t.codec_size.height!==this.video_metadata_.details.codec_size.height){var i=this.video_metadata_.details.codec_size,n=t.codec_size;return r.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(i.width,"x").concat(i.height," to ").concat(n.width,"x").concat(n.height)),!0}return t.present_size.width!==this.video_metadata_.details.present_size.width&&(r.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(this.video_metadata_.details.present_size.width," to ").concat(t.present_size.width)),!0)},t.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},t.prototype.dispatchVideoInitSegment=function(){var e=this.video_metadata_.details,t={type:"video"};t.id=this.video_track_.id,t.timescale=1e3,t.duration=this.duration_,t.codecWidth=e.codec_size.width,t.codecHeight=e.codec_size.height,t.presentWidth=e.present_size.width,t.presentHeight=e.present_size.height,t.profile=e.profile_string,t.level=e.level_string,t.bitDepth=e.bit_depth,t.chromaFormat=e.chroma_format,t.sarRatio=e.sar_ratio,t.frameRate=e.frame_rate;var i=t.frameRate.fps_den,n=t.frameRate.fps_num;if(t.refSampleDuration=i/n*1e3,t.codec=e.codec_mimetype,this.video_metadata_.av1c)t.av1c=this.video_metadata_.av1c,0==this.video_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first AV1 for mimeType: ".concat(t.codec));else if(this.video_metadata_.vps){var a=this.video_metadata_.vps.data.subarray(4),o=this.video_metadata_.sps.data.subarray(4),s=this.video_metadata_.pps.data.subarray(4),d=new fe(a,o,s,e);t.hvcc=d.getData(),0==this.video_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(t.codec))}else{o=this.video_metadata_.sps.data.subarray(4),s=this.video_metadata_.pps.data.subarray(4);var _=new F(o,s,e);t.avcc=_.getData(),0==this.video_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(t.codec))}this.onTrackMetadata("video",t),this.video_init_segment_dispatched_=!0,this.video_init_dispatch_time_=Date.now(),this.video_metadata_changed_=!1;var c=this.media_info_;c.hasVideo=!0,c.width=t.codecWidth,c.height=t.codecHeight,c.fps=t.frameRate.fps,c.profile=t.profile,c.level=t.level,c.refFrames=e.ref_frames,c.chromaFormat=e.chroma_format_string,c.sarNum=t.sarRatio.width,c.sarDen=t.sarRatio.height,c.videoCodec=t.codec,c.hasAudio&&c.audioCodec?c.mimeType='video/mp2t; codecs="'.concat(c.videoCodec,",").concat(c.audioCodec,'"'):c.mimeType='video/mp2t; codecs="'.concat(c.videoCodec,'"'),c.isComplete()&&this.onMediaInfo(c)},t.prototype.dispatchVideoMediaSegment=function(){this.isInitSegmentDispatched()&&this.video_track_.length&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){this.isInitSegmentDispatched()&&this.audio_track_.length&&this.onDataAvailable(this.audio_track_,null)},t.prototype.normalizeIncomingAudioPtsMilliseconds=function(e){if(null==e||null==this.audio_last_sample_pts_)return e;var t=4294967296/this.timescale_,i=8589934592/this.timescale_;if(e+t<this.audio_last_sample_pts_){var n=e+i;return this.audio_wrap_log_count_++,(this.audio_wrap_log_count_<=3||this.audio_wrap_log_count_%25==0)&&r.A.w(this.TAG,"[muvie] Audio timestamp wrap normalized (#".concat(this.audio_wrap_log_count_,"): ").concat(e,"ms -> ").concat(n,"ms (last=").concat(this.audio_last_sample_pts_,"ms)")),n}return e>this.audio_last_sample_pts_+t?(this.audio_stale_drop_log_count_++,void((this.audio_stale_drop_log_count_<=3||this.audio_stale_drop_log_count_%25==0)&&r.A.w(this.TAG,"[muvie] Dropping stale pre-wrap audio timestamp (#".concat(this.audio_stale_drop_log_count_,") ").concat(e,"ms (last=").concat(this.audio_last_sample_pts_,"ms)")))):e},t.prototype.getStartupAudioAnchorMilliseconds=function(){if(this.video_track_.samples.length>0)return this.video_track_.samples[0].dts},t.prototype.normalizeStartupAudioPtsMilliseconds=function(e){if(null==e||null!=this.audio_last_sample_pts_)return e;var t=this.getStartupAudioAnchorMilliseconds();if(null==t)return e;var i=e-t;return Math.abs(i)>5e3?(this.audio_startup_align_log_count_++,(this.audio_startup_align_log_count_<=3||this.audio_startup_align_log_count_%25==0)&&r.A.w(this.TAG,"[muvie] Startup audio anchor normalize (#".concat(this.audio_startup_align_log_count_,"): ").concat(e,"ms -> ").concat(t,"ms (video=").concat(t,"ms drift=").concat(Math.round(i),"ms)")),t):e},t.prototype.stashAudioBeforeVideoInit=function(e,t,i){this.stashed_audio_before_video_init_.push({codec:e,data:t,pts:i})},t.prototype.dispatchAudioVideoMediaSegment=function(){var e=this;if(this.video_init_segment_dispatched_&&this.stashed_audio_before_video_init_.length>0){var t=this.getStartupAudioAnchorMilliseconds(),i=this.stashed_audio_before_video_init_;if(null!=t){var n=i.length;i=i.filter(function(i){return null==i.pts||i.pts/e.timescale_>=t-1500});var a=n-i.length;a>0&&(this.audio_startup_drop_log_count_++,(this.audio_startup_drop_log_count_<=3||this.audio_startup_drop_log_count_%25==0)&&r.A.w(this.TAG,"[muvie] Dropped ".concat(a," stale startup audio payload(s) before video anchor ").concat(t,"ms (#").concat(this.audio_startup_drop_log_count_,")")))}var o=i.length;r.A.v(this.TAG,"[muvie] Flushing ".concat(o," stashed audio payload(s) now that video init is dispatched")),this.stashed_audio_before_video_init_=[];for(var s=0,d=i;s<d.length;s++){var _=d[s];switch(_.codec){case"aac":this.parseADTSAACPayload(_.data,_.pts);break;case"aac-loas":this.parseLOASAACPayload(_.data,_.pts);break;case"ac-3":this.parseAC3Payload(_.data,_.pts);break;case"ec-3":this.parseEAC3Payload(_.data,_.pts);break;case"opus":this.parseOpusPayload(_.data,_.pts);break;case"mp3":this.parseMP3Payload(_.data,_.pts)}}}if(this.isInitSegmentDispatched()){if(!this.video_keyframe_seen_after_init_&&this.video_track_.samples.length>0&&this.video_track_.samples.some(function(e){return e.isKeyframe})&&(r.A.v(this.TAG,"[muvie] H264: keyframe found in queued samples via retrospective scan — unblocking"),this.video_keyframe_seen_after_init_=!0),!this.video_keyframe_seen_after_init_&&this.video_init_dispatch_time_>0){var c=Date.now()-this.video_init_dispatch_time_;c>6e3&&(this.audio_track_.length||this.video_track_.length)&&(r.A.w(this.TAG,"[muvie] dispatchAV: no keyframe seen after ".concat(c,"ms — force-dispatching (fallback for strict MSE decoders)")),this.video_keyframe_seen_after_init_=!0)}var h=this.video_keyframe_seen_after_init_;h||(l="waiting for first keyframe after init",this._last_dispatch_block_reason_!==l&&(this._last_dispatch_block_reason_=l,r.A.v(this.TAG,"[muvie] dispatchAV blocked: ".concat(l)))),h&&(this._last_dispatch_block_reason_&&(r.A.v(this.TAG,"[muvie] dispatchAV unblocked — media segments now flowing"),this._last_dispatch_block_reason_=""),(this.audio_track_.length||this.video_track_.length)&&this.onDataAvailable(this.audio_track_,this.video_track_))}else{var l="waiting for init (video=".concat(this.video_init_segment_dispatched_," audio=").concat(this.audio_init_segment_dispatched_,")");this._last_dispatch_block_reason_!==l&&(this._last_dispatch_block_reason_=l,r.A.v(this.TAG,"[muvie] dispatchAV blocked: ".concat(l)))}},t.prototype.parseADTSAACPayload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var i=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);i.set(this.aac_last_incomplete_data_,0),i.set(e,this.aac_last_incomplete_data_.byteLength),e=i}var n,a;if(null==t||(a=t/this.timescale_,a=this.normalizeStartupAudioPtsMilliseconds(a),null!=(a=this.normalizeIncomingAudioPtsMilliseconds(a)))){if("aac"===this.audio_metadata_.codec){if(null==t&&null!=this.audio_last_sample_pts_)n=1024/this.audio_metadata_.sampling_frequency*1e3,a=this.audio_last_sample_pts_+n;else if(null==t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){n=1024/this.audio_metadata_.sampling_frequency*1e3;var o=this.audio_last_sample_pts_+n;Math.abs(o-a)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(o,"ms, PES pts: ").concat(a,"ms")),a=o)}}for(var s,d=new X(e),_=null,c=a;null!=(_=d.readNextAACFrame());){n=1024/_.sampling_frequency*1e3;var h={codec:"aac",data:_};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:_.audio_object_type,sampling_freq_index:_.sampling_freq_index,sampling_frequency:_.sampling_frequency,channel_config:_.channel_config},this.dispatchAudioInitSegment(h)):this.detectAudioMetadataChange(h)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(h)),s=c;var l=Math.floor(c),u={unit:_.data,length:_.data.byteLength,pts:l,dts:l};this.audio_track_.samples.push(u),this.audio_track_.length+=_.data.byteLength,c+=n}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),s&&(this.audio_last_sample_pts_=s)}}else this.stashAudioBeforeVideoInit("aac",e,t)},t.prototype.parseLOASAACPayload=function(e,t){var i;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var n=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);n.set(this.aac_last_incomplete_data_,0),n.set(e,this.aac_last_incomplete_data_.byteLength),e=n}var a,o;if(null==t||(o=t/this.timescale_,o=this.normalizeStartupAudioPtsMilliseconds(o),null!=(o=this.normalizeIncomingAudioPtsMilliseconds(o)))){if("aac"===this.audio_metadata_.codec){if(null==t&&null!=this.audio_last_sample_pts_)a=1024/this.audio_metadata_.sampling_frequency*1e3,o=this.audio_last_sample_pts_+a;else if(null==t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){a=1024/this.audio_metadata_.sampling_frequency*1e3;var s=this.audio_last_sample_pts_+a;Math.abs(s-o)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(s,"ms, PES pts: ").concat(o,"ms")),o=s)}}for(var d,_=new Y(e),c=null,h=o;null!=(c=_.readNextAACFrame(null!==(i=this.loas_previous_frame)&&void 0!==i?i:void 0));){this.loas_previous_frame=c,a=1024/c.sampling_frequency*1e3;var l={codec:"aac",data:c};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(l)):this.detectAudioMetadataChange(l)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(l)),d=h;var u=Math.floor(h),p={unit:c.data,length:c.data.byteLength,pts:u,dts:u};this.audio_track_.samples.push(p),this.audio_track_.length+=c.data.byteLength,h+=a}_.hasIncompleteData()&&(this.aac_last_incomplete_data_=_.getIncompleteData()),d&&(this.audio_last_sample_pts_=d)}}else this.stashAudioBeforeVideoInit("aac-loas",e,t)},t.prototype.parseAC3Payload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){if(null==t||(n=t/this.timescale_,n=this.normalizeStartupAudioPtsMilliseconds(n),null!=(n=this.normalizeIncomingAudioPtsMilliseconds(n)))){if("ac-3"===this.audio_metadata_.codec)if(null==t&&null!=this.audio_last_sample_pts_)i=1536/this.audio_metadata_.sampling_frequency*1e3,n=this.audio_last_sample_pts_+i;else if(null==t)return void r.A.w(this.TAG,"AC3: Unknown pts");for(var a,o=new Ae(e),s=null,d=n;null!=(s=o.readNextAC3Frame());){i=1536/s.sampling_frequency*1e3;var _={codec:"ac-3",data:s};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"ac-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,bit_stream_mode:s.bit_stream_mode,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(_)):this.detectAudioMetadataChange(_)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(_)),a=d;var c=Math.floor(d),h={unit:s.data,length:s.data.byteLength,pts:c,dts:c};this.audio_track_.samples.push(h),this.audio_track_.length+=s.data.byteLength,d+=i}a&&(this.audio_last_sample_pts_=a)}}else this.stashAudioBeforeVideoInit("ac-3",e,t)},t.prototype.parseEAC3Payload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){if(null==t||(n=t/this.timescale_,n=this.normalizeStartupAudioPtsMilliseconds(n),null!=(n=this.normalizeIncomingAudioPtsMilliseconds(n)))){if("ec-3"===this.audio_metadata_.codec)if(null==t&&null!=this.audio_last_sample_pts_)i=256*this.audio_metadata_.num_blks/this.audio_metadata_.sampling_frequency*1e3,n=this.audio_last_sample_pts_+i;else if(null==t)return void r.A.w(this.TAG,"EAC3: Unknown pts");for(var a,o=new Ee(e),s=null,d=n;null!=(s=o.readNextEAC3Frame());){i=1536/s.sampling_frequency*1e3;var _={codec:"ec-3",data:s};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"ec-3",sampling_frequency:s.sampling_frequency,bit_stream_identification:s.bit_stream_identification,low_frequency_effects_channel_on:s.low_frequency_effects_channel_on,num_blks:s.num_blks,channel_mode:s.channel_mode},this.dispatchAudioInitSegment(_)):this.detectAudioMetadataChange(_)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(_)),a=d;var c=Math.floor(d),h={unit:s.data,length:s.data.byteLength,pts:c,dts:c};this.audio_track_.samples.push(h),this.audio_track_.length+=s.data.byteLength,d+=i}a&&(this.audio_last_sample_pts_=a)}}else this.stashAudioBeforeVideoInit("ec-3",e,t)},t.prototype.parseOpusPayload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){if(null==t||(n=t/this.timescale_,n=this.normalizeStartupAudioPtsMilliseconds(n),null!=(n=this.normalizeIncomingAudioPtsMilliseconds(n)))){if("opus"===this.audio_metadata_.codec)if(null==t&&null!=this.audio_last_sample_pts_)i=20,n=this.audio_last_sample_pts_+i;else if(null==t)return void r.A.w(this.TAG,"Opus: Unknown pts");for(var a,o=n,s=0;s<e.length;){i=20;for(var d=!!(16&e[s+1]),_=!!(8&e[s+1]),c=s+2,h=0;255===e[c];)h+=255,c+=1;h+=e[c],c+=1,c+=d?2:0,c+=_?2:0,a=o;var l=Math.floor(o),u=e.slice(c,c+h),p={unit:u,length:u.byteLength,pts:l,dts:l};this.audio_track_.samples.push(p),this.audio_track_.length+=u.byteLength,o+=i,s=c+h}a&&(this.audio_last_sample_pts_=a)}}else this.stashAudioBeforeVideoInit("opus",e,t)},t.prototype.parseMP3Payload=function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var i=e[1]>>>3&3,n=(6&e[1])>>1,a=(e[2],(12&e[2])>>>2),r=3&~(e[3]>>>6)?2:1,o=0,s=34;switch(i){case 0:o=[11025,12e3,8e3,0][a];break;case 2:o=[22050,24e3,16e3,0][a];break;case 3:o=[44100,48e3,32e3,0][a]}switch(n){case 1:s=34;break;case 2:s=33;break;case 3:s=32}var d=new ge;d.object_type=s,d.sample_rate=o,d.channel_count=r,d.data=e;var _,c={codec:"mp3",data:d};if(null==t||(_=t/this.timescale_,_=this.normalizeStartupAudioPtsMilliseconds(_),null!=(_=this.normalizeIncomingAudioPtsMilliseconds(_)))){0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"mp3",object_type:s,sample_rate:o,channel_count:r},this.dispatchAudioInitSegment(c)):this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c));var h={unit:e,length:e.byteLength,pts:_,dts:_};this.audio_track_.samples.push(h),this.audio_track_.length+=e.byteLength,this.audio_last_sample_pts_=h.pts}}else this.stashAudioBeforeVideoInit("mp3",e,t)},t.prototype.detectAudioMetadataChange=function(e){if(e.codec!==this.audio_metadata_.codec)return r.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(this.audio_metadata_.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((t=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return r.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(t.audio_object_type)),!0;if(t.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return r.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(t.sampling_freq_index)),!0;if(t.channel_config!==this.audio_metadata_.channel_config)return r.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(this.audio_metadata_.channel_config," to ").concat(t.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var t;if((t=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return r.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(this.audio_metadata_.sampling_frequency," to ").concat(t.sampling_frequency)),!0;if(t.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return r.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(t.bit_stream_identification)),!0;if(t.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return r.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(t.bit_stream_mode)),!0;if(t.channel_mode!==this.audio_metadata_.channel_mode)return r.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(t.channel_mode)),!0;if(t.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return r.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(t.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((i=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(i.sample_rate)),!0;if(i.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(i.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var i;if((i=e.data).object_type!==this.audio_metadata_.object_type)return r.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(i.object_type)),!0;if(i.sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(i.sample_rate)),!0;if(i.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(i.channel_count)),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t={type:"audio"};if(t.id=this.audio_track_.id,t.timescale=1e3,t.duration=this.duration_,"aac"===this.audio_metadata_.codec){var i="aac"===e.codec?e.data:null,n=new Q(i);t.audioSampleRate=n.sampling_rate,t.channelCount=n.channel_count,t.codec=n.codec_mimetype,t.originalCodec=n.original_codec_mimetype,t.config=n.config,t.refSampleDuration=1024/t.audioSampleRate*t.timescale}else if("ac-3"===this.audio_metadata_.codec){var a="ac-3"===e.codec?e.data:null,o=new Se(a);t.audioSampleRate=o.sampling_rate,t.channelCount=o.channel_count,t.codec=o.codec_mimetype,t.originalCodec=o.original_codec_mimetype,t.config=o.config,t.refSampleDuration=1536/t.audioSampleRate*t.timescale}else if("ec-3"===this.audio_metadata_.codec){var s="ec-3"===e.codec?e.data:null,d=new Re(s);t.audioSampleRate=d.sampling_rate,t.channelCount=d.channel_count,t.codec=d.codec_mimetype,t.originalCodec=d.original_codec_mimetype,t.config=d.config,t.refSampleDuration=256*d.num_blks/t.audioSampleRate*t.timescale}else"opus"===this.audio_metadata_.codec?(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.channelConfigCode=this.audio_metadata_.channel_config_code,t.codec="opus",t.originalCodec="opus",t.config=void 0,t.refSampleDuration=20):"mp3"===this.audio_metadata_.codec&&(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.codec="mp3",t.originalCodec="mp3",t.config=void 0,t.refSampleDuration=1152/t.audioSampleRate*t.timescale);0==this.audio_init_segment_dispatched_&&r.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(t.codec)),this.onTrackMetadata("audio",t),this.audio_init_segment_dispatched_=!0,this.audio_metadata_changed_=!1;var _=this.media_info_;_.hasAudio=!0,_.audioCodec=t.originalCodec,_.audioSampleRate=t.audioSampleRate,_.audioChannelCount=t.channelCount,_.hasVideo&&_.videoCodec?_.mimeType='video/mp2t; codecs="'.concat(_.videoCodec,",").concat(_.audioCodec,'"'):_.mimeType='video/mp2t; codecs="'.concat(_.audioCodec,'"'),_.isComplete()&&this.onMediaInfo(_)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,i){var n=new $;n.pid=e,n.stream_type=t,n.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(n)},t.prototype.parsePESPrivateDataPayload=function(e,t,i,n,a){var r=new Z;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}else r.nearest_pts=this.getNearestTimestampMilliseconds();if(null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}this.onPESPrivateData&&this.onPESPrivateData(r)},t.prototype.parseTimedID3MetadataPayload=function(e,t,i,n,a){var r=new Z;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}if(null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(r)},t.prototype.parsePGSPayload=function(e,t,i,n,a,r){var o=new Le;if(o.pid=n,o.lang=r,o.stream_id=a,o.len=e.byteLength,o.data=e,null!=t){var s=Math.floor(t/this.timescale_);o.pts=s}if(null!=i){var d=Math.floor(i/this.timescale_);o.dts=d}this.onPGSSubtitleData&&this.onPGSSubtitleData(o)},t.prototype.parseSynchronousKLVMetadataPayload=function(e,t,i,n,a){var r=new Te;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}if(null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}r.access_units=function(e){for(var t=[],i=0;i+5<e.byteLength;){var n=e[i+0],a=e[i+1],r=e[i+2],o=e[i+3]<<8|e[i+4],s=e.slice(i+5,i+5+o);t.push({service_id:n,sequence_number:a,flags:r,data:s}),i+=5+o}return t}(e),this.onSynchronousKLVMetadata&&this.onSynchronousKLVMetadata(r)},t.prototype.parseAsynchronousKLVMetadataPayload=function(e,t,i){var n=new Z;n.pid=t,n.stream_id=i,n.len=e.byteLength,n.data=e,this.onAsynchronousKLVMetadata&&this.onAsynchronousKLVMetadata(n)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,i,n,a){var r=new me;if(r.pid=n,r.stream_id=a,r.len=e.byteLength,r.data=e,null!=t){var o=Math.floor(t/this.timescale_);r.pts=o}if(r.nearest_pts=this.getNearestTimestampMilliseconds(),null!=i){var s=Math.floor(i/this.timescale_);r.dts=s}r.ancillaries=function(e){for(var t=new p(e),i=0,n=[];i+=6,0===t.readBits(6);){var a=t.readBool();i+=1;var r=t.readBits(11);i+=11;var o=t.readBits(12);i+=12;var s=255&t.readBits(10);i+=10;var d=255&t.readBits(10);i+=10;var _=255&t.readBits(10);i+=10;for(var c=new Uint8Array(_),h=0;h<_;h++){var l=255&t.readBits(10);i+=10,c[h]=l}t.readBits(10),i+=10;var u="User Defined";65===s?7===d&&(u="SCTE-104"):95===s?220===d?u="ARIB STD-B37 (1SEG)":221===d?u="ARIB STD-B37 (ANALOG)":222===d?u="ARIB STD-B37 (SD)":223===d&&(u="ARIB STD-B37 (HD)"):97===s&&(1===d?u="EIA-708":2===d&&(u="EIA-608")),n.push({yc_indicator:a,line_number:r,horizontal_offset:o,did:s,sdid:d,user_data:c,description:u,information:{}}),t.readBits(8-(i-Math.floor(i/8))%8),i+=(8-(i-Math.floor(i/8)))%8}return t.destroy(),t=null,n}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(r)},t.prototype.parseSEIPayload=function(e,t,i){var n=T(e,null!=t?Math.floor(t/this.timescale_):void 0,i);n&&this.onSEI&&this.onSEI(n)},t.prototype.getNearestTimestampMilliseconds=function(){return null!=this.audio_last_sample_pts_?Math.floor(this.audio_last_sample_pts_):null!=this.last_pcr_?Math.floor(this.last_pcr_/300/this.timescale_):void 0},t.prototype.getPcrBase=function(e){var t=33554432*e[6]+131072*e[7]+512*e[8]+2*e[9]+(128&e[10])/128+this.timestamp_offset_;return t+4294967296<this.last_pcr_base_&&(t+=8589934592,this.timestamp_offset_+=8589934592),this.last_pcr_base_=t,t},t.prototype.getTimestamp=function(e,t){var i=536870912*(14&e[t])+4194304*(255&e[t+1])+16384*(254&e[t+2])+128*(255&e[t+3])+(254&e[t+4])/2+this.timestamp_offset_;return i+4294967296<this.last_pcr_base_&&(i+=8589934592),i},t}(w);const De=Me;var Be=function(e,t,i){if(i||2===arguments.length)for(var n,a=0,r=t.length;a<r;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},Oe=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],chnl:[],".mp3":[],Opus:[],dOps:[],fLaC:[],dfLa:[],ipcm:[],pcmC:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([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]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e.box=function(e){for(var t=8,i=null,n=Array.prototype.slice.call(arguments,1),a=n.length,r=0;r<a;r++)t+=n[r].byteLength;(i=new Uint8Array(t))[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);var o=8;for(r=0;r<a;r++)i.set(n[r],o),o+=n[r].byteLength;return i},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),n=e.moov(t),a=new Uint8Array(i.byteLength+n.byteLength);return a.set(i,0),a.set(n,i.byteLength),a},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),n=e.trak(t),a=e.mvex(t);return e.box(e.types.moov,i,n,a)},e.mvhd=function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>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,a=t.presentWidth,r=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,a>>>8&255,255&a,0,0,r>>>8&255,255&r,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;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;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(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return 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))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"ec-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ec3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):"flac"==t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.fLaC(t)):"ipcm"==t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ipcm(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):"video"===t.type&&t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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"],a)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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,a,e.esds(t))},e.ac3=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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["ac-3"],a,e.box(e.types.dac3,new Uint8Array(t.config)))},e.ec3=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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["ec-3"],a,e.box(e.types.dec3,new Uint8Array(t.config)))},e.esds=function(t){var i=t.config||[],n=i.length,a=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,a)},e.Opus=function(t){var i=t.channelCount,n=t.audioSampleRate,a=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.Opus,a,e.dOps(t))},e.dOps=function(t){var i=t.channelCount,n=t.channelConfigCode,a=t.audioSampleRate;if(t.config)return e.box(e.types.dOps,t.config);var r=[];switch(n){case 1:case 2:r=[0];break;case 0:r=[255,1,1,0,1];break;case 128:r=[255,2,0,0,1];break;case 3:r=[1,2,1,0,2,1];break;case 4:r=[1,2,2,0,1,2,3];break;case 5:r=[1,3,2,0,4,1,2,3];break;case 6:r=[1,4,2,0,4,1,2,3,5];break;case 7:r=[1,4,2,0,4,1,2,3,5,6];break;case 8:r=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:r=[1,1,2,0,1];break;case 131:r=[1,1,3,0,1,2];break;case 132:r=[1,1,4,0,1,2,3];break;case 133:r=[1,1,5,0,1,2,3,4];break;case 134:r=[1,1,6,0,1,2,3,4,5];break;case 135:r=[1,1,7,0,1,2,3,4,5,6];break;case 136:r=[1,1,8,0,1,2,3,4,5,6,7]}var o=new Uint8Array(Be([0,i,0,0,a>>>24&255,a>>>17&255,a>>>8&255,a>>>0&255,0,0],r,!0));return e.box(e.types.dOps,o)},e.fLaC=function(t){var i=t.channelCount,n=Math.min(t.audioSampleRate,65535),a=t.sampleSize,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,a,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.fLaC,r,e.dfLa(t))},e.dfLa=function(t){var i=new Uint8Array(Be([0,0,0,0],t.config,!0));return e.box(e.types.dfLa,i)},e.ipcm=function(t){var i=t.channelCount,n=Math.min(t.audioSampleRate,65535),a=t.sampleSize,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,a,0,0,0,0,n>>>8&255,255&n,0,0]);return 1===t.channelCount?e.box(e.types.ipcm,r,e.pcmC(t)):e.box(e.types.ipcm,r,e.chnl(t),e.pcmC(t))},e.chnl=function(t){var i=new Uint8Array([0,0,0,0,1,t.channelCount,0,0,0,0,0,0,0,0]);return e.box(e.types.chnl,i)},e.pcmC=function(t){var i=t.littleEndian?1:0,n=t.sampleSize,a=new Uint8Array([0,0,0,0,i,n]);return e.box(e.types.pcmC,a)},e.avc1=function(t){var i=t.avcc,n=t.codecWidth,a=t.codecHeight,r=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,a>>>8&255,255&a,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,r,e.box(e.types.avcC,i))},e.hvc1=function(t){var i=t.hvcc,n=t.codecWidth,a=t.codecHeight,r=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,a>>>8&255,255&a,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.hvc1,r,e.box(e.types.hvcC,i))},e.av01=function(t){var i=t.av1c,n=t.codecWidth||192,a=t.codecHeight||108,r=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,a>>>8&255,255&a,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.av01,r,e.box(e.types.av1C,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,a=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),r=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),s=e.trun(t,o.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,a,r,s,o)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,a=new Uint8Array(4+n),r=0;r<n;r++){var o=i[r].flags;a[r+4]=o.isLeading<<6|o.dependsOn<<4|o.isDependedOn<<2|o.hasRedundancy}return e.box(e.types.sdtp,a)},e.trun=function(t,i){var n=t.samples||[],a=n.length,r=12+16*a,o=new Uint8Array(r);i+=8+r,o.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,255&a,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s<a;s++){var d=n[s].duration,_=n[s].size,c=n[s].flags,h=n[s].cts;o.set([d>>>24&255,d>>>16&255,d>>>8&255,255&d,_>>>24&255,_>>>16&255,_>>>8&255,255&_,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*s)}return e.box(e.types.trun,o)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();Oe.init();const Pe=Oe,Ie=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return 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])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}();var xe=i(544);const Ue=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new xe.Sc("audio"),this._videoSegmentInfoList=new xe.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!o.A.chrome||!(o.A.version.major<50||50===o.A.version.major&&o.A.version.build<2661)),this._fillSilentAfterSeek=o.A.msedge||o.A.msie,this._mp3UseMpegAudio=!o.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap,this._audioDiscontinuityResetLogCount=0,this._audioGapFillLogCount=0}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},e.prototype._shouldLogLimited=function(e){return this[e]=(this[e]||0)+1,this[e]<=3||this[e]%25==0},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new h.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,n="mp4",a=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",a="",i=new Uint8Array):i=Pe.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Pe.generateInitSegment(t)}if(!this._onInitSegment)throw new h.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:a,container:"".concat(e,"/").concat(n),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e&&e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t&&t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var i,n=e,a=n.samples,s=void 0,d=-1,_=this._audioMeta.refSampleDuration,c=Math.max(3e4,null!=_?180*_:3e4),h="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,l=this._dtsBaseInited&&void 0===this._audioNextDts,u=!1;if(a&&0!==a.length&&(1!==a.length||t)){var p=0,f=null,m=0;h?(p=0,m=n.length):(p=8,m=8+n.length);var g=null;if(a.length>1&&(m-=(g=a.pop()).length),null!=this._audioStashedLastSample){var v=this._audioStashedLastSample;this._audioStashedLastSample=null,a.unshift(v),m+=v.length}null!=g&&(this._audioStashedLastSample=g);var y=a[0].dts-this._dtsBase;if(this._audioNextDts)s=y-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())s=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(u=!0);else{var A=this._audioSegmentInfoList.getLastSampleBefore(y);if(null!=A){var S=y-(A.originalDts+A.duration);S<=3&&(S=0),s=y-(A.dts+A.duration+S)}else s=0}if(u){var b=y-s,E=this._videoSegmentInfoList.getLastSegmentBefore(y);if(null!=E&&E.beginDts<b){if(I=Ie.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount)){var R=E.beginDts,T=b-E.beginDts;r.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(R,", duration: ").concat(T)),a.unshift({unit:I,dts:R,pts:R}),m+=I.byteLength}}else u=!1}for(var k=[],L=0;L<a.length;L++){var w=(v=a[L]).unit,C=v.dts-this._dtsBase,M=(R=C,!1),D=null,B=0;if(!(C<-.001)){if("mp3"!==this._audioMeta.codec&&null!=_){var O=C;if(this._audioNextDts&&(O=this._audioNextDts),(s=C-O)<=-3*_){if(!(Math.abs(s)>c)){r.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(C," ms ,curRefDts: ").concat(O," ms) due to dtsCorrection: ").concat(s," ms overlap."));continue}this._shouldLogLimited("_audioDiscontinuityResetLogCount")&&r.A.w(this.TAG,"Audio discontinuity reset (#".concat(this._audioDiscontinuityResetLogCount,"): backward ").concat(Math.round(s)," ms, codec=").concat(this._audioMeta.codec)),R=Math.floor(C),B=Math.floor(_),this._audioNextDts=R+B}else if(s>=3*_&&this._fillAudioTimestampGap&&!o.A.safari){var P=Math.floor(s/_);if(P>180||s>c)this._shouldLogLimited("_audioDiscontinuityResetLogCount")&&r.A.w(this.TAG,"Audio discontinuity reset (#".concat(this._audioDiscontinuityResetLogCount,"): forward ").concat(Math.round(s)," ms, frames=").concat(P,", codec=").concat(this._audioMeta.codec)),R=Math.floor(C),B=Math.floor(_),this._audioNextDts=R+B;else{var I;M=!0,this._shouldLogLimited("_audioGapFillLogCount")&&r.A.w(this.TAG,"Audio gap fill (#".concat(this._audioGapFillLogCount,"): correction=").concat(Math.round(s)," ms, frames=").concat(P,", codec=").concat(this._audioMeta.codec)),R=Math.floor(O),B=Math.floor(O+_)-R,null==(I=Ie.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))&&(r.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),I=w),D=[];for(var x=0;x<P;x++){O+=_;var U=Math.floor(O),N=Math.floor(O+_)-U,G={dts:U,pts:U,cts:0,unit:I,size:I.byteLength,duration:N,originalDts:C,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};D.push(G),m+=G.size}this._audioNextDts=O+_}}else R=Math.floor(O),B=Math.floor(O+_)-R,this._audioNextDts=O+_}else R=C-s,B=L!==a.length-1?a[L+1].dts-this._dtsBase-s-R:null!=g?g.dts-this._dtsBase-s-R:k.length>=1?k[k.length-1].duration:Math.floor(_),this._audioNextDts=R+B;if(-1===d&&(d=R),k.push({dts:R,pts:R,cts:0,unit:v.unit,size:v.unit.byteLength,duration:B,originalDts:C,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),M)for(x=0;x<D.length;x++)k.push(D[x])}}if(0===k.length)return n.samples=[],void(n.length=0);for(h?f=new Uint8Array(m):((f=new Uint8Array(m))[0]=m>>>24&255,f[1]=m>>>16&255,f[2]=m>>>8&255,f[3]=255&m,f.set(Pe.types.mdat,4)),L=0;L<k.length;L++)w=k[L].unit,f.set(w,p),p+=w.byteLength;var V=k[k.length-1];i=V.dts+V.duration;var F=new xe.EZ;F.beginDts=d,F.endDts=i,F.beginPts=d,F.endPts=i,F.originalBeginDts=k[0].originalDts,F.originalEndDts=V.originalDts+V.duration,F.firstSample=new xe.$_(k[0].dts,k[0].pts,k[0].duration,k[0].originalDts,!1),F.lastSample=new xe.$_(V.dts,V.pts,V.duration,V.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(F),n.samples=k,n.sequenceNumber++;var j;j=h?new Uint8Array:Pe.moof(n,d),n.samples=[],n.length=0;var z={type:"audio",data:this._mergeBoxes(j,f).buffer,sampleCount:k.length,info:F};h&&l&&(z.timestampOffset=d),this._onMediaSegment("audio",z)}}},e.prototype._remuxVideo=function(e,t){if(null!=this._videoMeta){var i,n,a=e,r=a.samples,o=void 0,s=-1,d=-1;if(r&&0!==r.length&&(1!==r.length||t)){var _=8,c=null,h=8+e.length,l=null;if(r.length>1&&(h-=(l=r.pop()).length),null!=this._videoStashedLastSample){var u=this._videoStashedLastSample;this._videoStashedLastSample=null,r.unshift(u),h+=u.length}null!=l&&(this._videoStashedLastSample=l);var p=r[0].dts-this._dtsBase;if(this._videoNextDts)o=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{var f=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=f){var m=p-(f.originalDts+f.duration);m<=3&&(m=0),o=p-(f.dts+f.duration+m)}else o=0}for(var g=new xe.EZ,v=[],y=0;y<r.length;y++){var A=(u=r[y]).dts-this._dtsBase,S=u.isKeyframe,b=A-o,E=u.cts,R=b+E;-1===s&&(s=b,d=R);var T=0;if(T=y!==r.length-1?r[y+1].dts-this._dtsBase-o-b:null!=l?l.dts-this._dtsBase-o-b:v.length>=1?v[v.length-1].duration:Math.floor(this._videoMeta.refSampleDuration),S){var k=new xe.$_(b,R,T,u.dts,!0);k.fileposition=u.fileposition,g.appendSyncPoint(k)}v.push({dts:b,pts:R,cts:E,units:u.units,size:u.length,isKeyframe:S,duration:T,originalDts:A,flags:{isLeading:0,dependsOn:S?2:1,isDependedOn:S?1:0,hasRedundancy:0,isNonSync:S?0:1}})}for((c=new Uint8Array(h))[0]=h>>>24&255,c[1]=h>>>16&255,c[2]=h>>>8&255,c[3]=255&h,c.set(Pe.types.mdat,4),y=0;y<v.length;y++)for(var L=v[y].units;L.length;){var w=L.shift().data;c.set(w,_),_+=w.byteLength}var C=v[v.length-1];if(i=C.dts+C.duration,n=C.pts+C.duration,this._videoNextDts=i,g.beginDts=s,g.endDts=i,g.beginPts=d,g.endPts=n,g.originalBeginDts=v[0].originalDts,g.originalEndDts=C.originalDts+C.duration,g.firstSample=new xe.$_(v[0].dts,v[0].pts,v[0].duration,v[0].originalDts,v[0].isKeyframe),g.lastSample=new xe.$_(C.dts,C.pts,C.duration,C.originalDts,C.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),a.samples=v,a.sequenceNumber++,this._forceFirstIDR){var M=v[0].flags;M.dependsOn=2,M.isNonSync=0}var D=Pe.moof(a,s);a.samples=[],a.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(D,c).buffer,sampleCount:v.length,info:g})}}},e.prototype._mergeBoxes=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i},e}();var Ne=i(254),Ge=i(726);i(925);const Ve=function(){function e(e,t){this.TAG="TransmuxingController",this._emitter=new(a()),this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var i=0;this._mediaDataSource.segments.forEach(function(n){n.timestampBase=i,i+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)}),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),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 Ne.A(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.switchAudioPid=function(e){this._demuxer&&("function"==typeof this._demuxer.setPreferredAudioPid&&this._demuxer.setPreferredAudioPid(e),"function"==typeof this._demuxer.selectAudioPid&&this._demuxer.selectAudioPid(e))},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(null==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 a=this._mediaInfo.segments[t];null==a?(this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t)):(n=a.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,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){for(var t=this._mediaDataSource.segments,i=t.length-1,n=0;n<t.length;n++)if(e<t[n].timestampBase){i=n-1;break}return i},e.prototype._onInitChunkArrival=function(e,t){var i=this,n=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,n=this._demuxer.parseChunks(e,t);else{var a=null;(a=L.probe(e)).match&&(this._setupFLVDemuxerRemuxer(a),n=this._demuxer.parseChunks(e,t)),a.match||a.needMoreData||(a=De.probe(e)).match&&(this._setupTSDemuxerRemuxer(a),n=this._demuxer.parseChunks(e,t)),a.match||a.needMoreData||(a=null,r.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then(function(){i._internalAbort()}),this._emitter.emit(Ge.A.DEMUX_ERROR,m.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return n},e.prototype._setupFLVDemuxerRemuxer=function(e){this._demuxer=new L(e,this._config),this._remuxer||(this._remuxer=new Ue(this._config));var t=this._mediaDataSource;null==t.duration||isNaN(t.duration)||(this._demuxer.overridedDuration=t.duration),"boolean"==typeof t.hasAudio&&(this._demuxer.overridedHasAudio=t.hasAudio),"boolean"==typeof t.hasVideo&&(this._demuxer.overridedHasVideo=t.hasVideo),this._demuxer.timestampBase=t.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._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._demuxer.onTracksUpdated=this._onTracksUpdated.bind(this),this._demuxer.onSeiArrived=this._onSEI.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new De(e,this._config);this._remuxer||(this._remuxer=new Ue(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onPGSSubtitleData=this._onPGSSubtitle.bind(this),t.onSynchronousKLVMetadata=this._onSynchronousKLVMetadata.bind(this),t.onAsynchronousKLVMetadata=this._onAsynchronousKLVMetadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSEI=this._onSEI.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onTracksUpdated=this._onTracksUpdated.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},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,s.A.prototype));var i=Object.assign({},e);Object.setPrototypeOf(i,s.A.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(Ge.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(Ge.A.SCRIPTDATA_ARRIVED,e)},e.prototype._onTracksUpdated=function(e){this._emitter.emit(Ge.A.TRACKS_UPDATED,e)},e.prototype._onTimedID3Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ge.A.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onPGSSubtitle=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ge.A.PGS_SUBTITLE_ARRIVED,e))},e.prototype._onSynchronousKLVMetadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ge.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,e))},e.prototype._onAsynchronousKLVMetadata=function(e){this._emitter.emit(Ge.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,e)},e.prototype._onSMPTE2038Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.dts&&(e.dts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),this._emitter.emit(Ge.A.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSEI=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),this._emitter.emit(Ge.A.SEI_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),this._emitter.emit(Ge.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(Ge.A.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t=this._remuxer.getTimestampBase();null!=t&&(null!=e.pts&&(e.pts-=t),null!=e.nearest_pts&&(e.nearest_pts-=t),null!=e.dts&&(e.dts-=t),this._emitter.emit(Ge.A.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(Ge.A.LOADING_COMPLETE),this._disableStatisticsReporter())},e.prototype._onIORedirect=function(e){var t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e},e.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(Ge.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){r.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(Ge.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){r.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(Ge.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(Ge.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(Ge.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var i=t.info.syncPoints,n=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.A.safari&&i.length>0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(Ge.A.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(Ge.A.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(Ge.A.STATISTICS_INFO,e)},e}()},514(e,t,i){"use strict";i(641),i(540),i(262),i(562),i(726)},134(e,t,i){"use strict";i.d(t,{A:()=>n});const n={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},215(e,t,i){e.exports=i(103).default},254(e,t,i){"use strict";i.d(t,{A:()=>A});var n=i(641);const a=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();var r,o=i(925),s=i(9),d=i(816),_=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});const c=function(e){function t(t,i){var n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._requestAbort=!1,n._abortController=null,n._contentLength=null,n._receivedLength=0,n}return _(t,e),t.isSupported=function(){try{var e=s.A.msedge&&s.A.version.minor>=15048,t=!s.A.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){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&&null!=e.redirectedURL&&(n=e.redirectedURL);var a=this._seekHandler.getConfig(n,t),r=new self.Headers;if("object"==typeof a.headers){var s=a.headers;for(var _ in s)s.hasOwnProperty(_)&&r.append(_,s[_])}var c={method:"GET",headers:r,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var _ in this._config.headers)r.append(_,this._config.headers[_]);!1===e.cors&&(c.mode="same-origin"),e.withCredentials&&(c.credentials="include"),e.referrerPolicy&&(c.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,c.signal=this._abortController.signal),this._status=o.eO.kConnecting,self.fetch(a.url,c).then(function(e){if(i._requestAbort)return i._status=o.eO.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==a.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=o.eO.kError,!i._onError)throw new d.Al("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}).catch(function(e){if(!i._abortController||!i._abortController.signal.aborted){if(i._status=o.eO.kError,!i._onError)throw e;i._onError(o.Xv.EXCEPTION,{code:-1,msg:e.message})}})},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==o.eO.kBuffering||!s.A.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then(function(i){if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=o.eO.kError;var n=o.Xv.EARLY_EOF,a={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new d.Al(a.msg);t._onError(n,a)}else t._status=o.eO.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(t._abortController&&t._abortController.signal.aborted)return void(t._status=o.eO.kComplete);if(!0===t._requestAbort)return t._status=o.eO.kComplete,e.cancel();t._status=o.eO.kBuffering;var r=i.value.buffer,s=t._range.from+t._receivedLength;t._receivedLength+=r.byteLength,t._onDataArrival&&t._onDataArrival(r,s,t._receivedLength),t._pump(e)}}).catch(function(e){if(t._abortController&&t._abortController.signal.aborted)t._status=o.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=o.eO.kError;var i=0,n=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(i=o.Xv.EXCEPTION,n={code:e.code,msg:e.message}):(i=o.Xv.EARLY_EOF,n={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new d.Al(n.msg);t._onError(i,n)}})},t}(o.HC);var h=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const l=function(e){function t(t,i){var n=e.call(this,"xhr-moz-chunked-loader")||this;return n.TAG="MozChunkedLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return h(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(e){return n.A.w("MozChunkedLoader",e.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&&null!=e.redirectedURL&&(i=e.redirectedURL);var n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",n.url,!0),a.responseType="moz-chunked-arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onloadend=this._onLoadEnd.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"==typeof n.headers){var r=n.headers;for(var s in r)r.hasOwnProperty(s)&&a.setRequestHeader(s,r[s])}if("object"==typeof this._config.headers)for(var s in r=this._config.headers)r.hasOwnProperty(s)&&a.setRequestHeader(s,r[s]);this._status=o.eO.kConnecting,a.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=o.eO.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=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=o.eO.kError,!this._onError)throw new d.Al("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=o.eO.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==o.eO.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){!0!==this._requestAbort?this._status!==o.eO.kError&&(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=o.eO.kError;var t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=o.Xv.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=o.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d.Al(i.msg);this._onError(t,i)},t}(o.HC);var u=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();!function(e){function t(t,i){var n=e.call(this,"xhr-msstream-loader")||this;return n.TAG="MSStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._reader=null,n._totalRange=null,n._currentRange=null,n._currentRequestURL=null,n._currentRedirectedURL=null,n._contentLength=null,n._receivedLength=0,n._bufferLimit=16777216,n._lastTimeBufferSize=0,n._isReconnecting=!1,n}u(t,e),t.isSupported=function(){try{if(void 0===self.MSStream||void 0===self.MSStreamReader)return!1;var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="ms-stream","ms-stream"===e.responseType}catch(e){return n.A.w("MSStreamLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._internalOpen(e,t,!1)},t.prototype._internalOpen=function(e,t,i){this._dataSource=e,i?this._currentRange=t:this._totalRange=t;var n=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?n=this._currentRedirectedURL:null!=e.redirectedURL&&(n=e.redirectedURL));var a=this._seekHandler.getConfig(n,t);this._currentRequestURL=a.url;var r=this._reader=new self.MSStreamReader;r.onprogress=this._msrOnProgress.bind(this),r.onload=this._msrOnLoad.bind(this),r.onerror=this._msrOnError.bind(this);var s=this._xhr=new XMLHttpRequest;if(s.open("GET",a.url,!0),s.responseType="ms-stream",s.onreadystatechange=this._xhrOnReadyStateChange.bind(this),s.onerror=this._xhrOnError.bind(this),e.withCredentials&&(s.withCredentials=!0),"object"==typeof a.headers){var d=a.headers;for(var _ in d)d.hasOwnProperty(_)&&s.setRequestHeader(_,d[_])}if("object"==typeof this._config.headers)for(var _ in d=this._config.headers)d.hasOwnProperty(_)&&s.setRequestHeader(_,d[_]);this._isReconnecting?this._isReconnecting=!1:this._status=o.eO.kConnecting,s.send()},t.prototype.abort=function(){this._internalAbort(),this._status=o.eO.kComplete},t.prototype._internalAbort=function(){this._reader&&(1===this._reader.readyState&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)},t.prototype._xhrOnReadyStateChange=function(e){var t=e.target;if(2===t.readyState)if(t.status>=200&&t.status<=299){if(this._status=o.eO.kBuffering,null!=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 a=parseInt(n);a>0&&(this._contentLength=a,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=o.eO.kError,!this._onError)throw new d.Al("MSStreamLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else if(3===t.readyState&&t.status>=200&&t.status<=299){this._status=o.eO.kBuffering;var r=t.response;this._reader.readAsArrayBuffer(r)}},t.prototype._xhrOnError=function(e){this._status=o.eO.kError;var t=o.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type};if(!this._onError)throw new d.Al(i.msg);this._onError(t,i)},t.prototype._msrOnProgress=function(e){var t=e.target.result;if(null!=t){var i=t.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=t.byteLength;var a=this._totalRange.from+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,a,this._receivedLength),t.byteLength>=this._bufferLimit&&(n.A.v(this.TAG,"MSStream buffer exceeded max size near ".concat(a+i.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}else this._doReconnectIfNeeded()},t.prototype._doReconnectIfNeeded=function(){if(null==this._contentLength||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var e={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,e,!0)}},t.prototype._msrOnLoad=function(e){this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)},t.prototype._msrOnError=function(e){this._status=o.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength<this._contentLength?(t=o.Xv.EARLY_EOF,i={code:-1,msg:"MSStream meet Early-Eof"}):(t=o.Xv.EARLY_EOF,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d.Al(i.msg);this._onError(t,i)}}(o.HC);var p=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const f=function(e){function t(t,i){var n=e.call(this,"xhr-range-loader")||this;return n.TAG="RangeLoader",n._seekHandler=t,n._config=i,n._needStash=!1,n._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],n._currentChunkSizeKB=384,n._currentSpeedNormalized=0,n._zeroSpeedChunkCount=0,n._xhr=null,n._speedSampler=new a,n._requestAbort=!1,n._waitForTotalLength=!1,n._totalLengthReceived=!1,n._currentRequestURL=null,n._currentRedirectedURL=null,n._currentRequestRange=null,n._totalLength=null,n._contentLength=null,n._receivedLength=0,n._lastTimeLoaded=0,n}return p(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return n.A.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=o.eO.kConnecting;var i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,i=t+e;null!=this._contentLength&&i-this._range.from>=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&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var a=this._xhr=new XMLHttpRequest;if(a.open("GET",n.url,!0),a.responseType="arraybuffer",a.onreadystatechange=this._onReadyStateChange.bind(this),a.onprogress=this._onProgress.bind(this),a.onload=this._onLoad.bind(this),a.onerror=this._onXhrError.bind(this),e.withCredentials&&(a.withCredentials=!0),"object"==typeof n.headers){var r=n.headers;for(var o in r)r.hasOwnProperty(o)&&a.setRequestHeader(o,r[o])}if("object"==typeof this._config.headers)for(var o in r=this._config.headers)r.hasOwnProperty(o)&&a.setRequestHeader(o,r[o]);a.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=o.eO.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(null!=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=o.eO.kBuffering}else{if(this._status=o.eO.kError,!this._onError)throw new d.Al("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==o.eO.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(-1===this._range.to?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,a=0,r=i;if(e<t[0])return t[0];for(;a<=r;){if((n=a+Math.floor((r-a)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?a=n+1:r=n-1}},t.prototype._onLoad=function(e){if(this._status!==o.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=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,a=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var r=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():r=!0,this._onDataArrival&&this._onDataArrival(n,a,this._receivedLength),r&&(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},t.prototype._onXhrError=function(e){this._status=o.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=o.Xv.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=o.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new d.Al(i.msg);this._onError(t,i)},t}(o.HC);var m=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const g=function(e){function t(){var t=e.call(this,"websocket-loader")||this;return t.TAG="WebSocketLoader",t._needStash=!0,t._ws=null,t._requestAbort=!1,t._receivedLength=0,t}return m(t,e),t.isSupported=function(){try{return void 0!==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=o.eO.kConnecting}catch(e){this._status=o.eO.kError;var i={code:e.code,msg:e.message};if(!this._onError)throw new d.Al(i.msg);this._onError(o.Xv.EXCEPTION,i)}},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=o.eO.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=o.eO.kBuffering},t.prototype._onWebSocketClose=function(e){!0!==this._requestAbort?(this._status=o.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!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=o.eO.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new d.Al(n.msg);this._onError(o.Xv.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=o.eO.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new d.Al(t.msg);this._onError(o.Xv.EXCEPTION,t)},t}(o.HC),v=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i={};if(0!==t.from||-1!==t.to){var n;n=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(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}(),y=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var i=e;if(0!==t.from||-1!==t.to){var n=!0;-1===i.indexOf("?")&&(i+="?",n=!1),n&&(i+="&"),i+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(i+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:i,headers:{}}},e.prototype.removeURLParameters=function(e){var t=e.split("?")[0],i=void 0,n=e.indexOf("?");-1!==n&&(i=e.substring(n+1));var a="";if(null!=i&&i.length>0)for(var r=i.split("&"),o=0;o<r.length;o++){var s=r[o].split("="),d=o>0;s[0]!==this._startName&&s[0]!==this._endName&&(d&&(a+="&"),a+=r[o])}return 0===a.length?t:t+"?"+a},e}(),A=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=65536,null!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=Math.max(this._stashSize,3145728),this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new a,this._speedNormalizeList=[32,64,96,128,192,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},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===f?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new v(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new y(t,i)}else{if("custom"!==e.seekType)throw new d.Qn("Invalid seekType in config: ".concat(e.seekType));if("function"!=typeof e.customSeekHandler)throw new d.Qn("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=g;else if(c.isSupported())this._loaderClass=c;else if(l.isSupported())this._loaderClass=l;else{if(!f.isSupported())throw new d.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=f}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(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 d.Qn("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var i=new ArrayBuffer(t);if(this._stashUsed>0){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,a=0,r=i;if(e<t[0])return t[0];for(;a<=r;){if((n=a+Math.floor((r-a)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?a=n+1:r=n-1}},e.prototype._adjustStashSize=function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t},e.prototype._dispatchChunks=function(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)},e.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},e.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},e.prototype._onLoaderChunkArrival=function(e,t,i){if(!this._onDataArrival)throw new d.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var n=this._speedSampler.lastSecondKBps;if(0!==n){var a=this._normalizeSpeed(n);this._speedNormalized!==a&&(this._speedNormalized=a,this._adjustStashSize(a))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)(s=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else if(s=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var r=this._stashBuffer.slice(0,this._stashUsed);(_=this._dispatchChunks(r,this._stashByteStart))<r.byteLength?_>0&&(c=new Uint8Array(r,_),s.set(c,0),this._stashUsed=c.byteLength,this._stashByteStart+=_):(this._stashUsed=0,this._stashByteStart+=_),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),s=new Uint8Array(this._stashBuffer,0,this._bufferSize)),s.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(_=this._dispatchChunks(e,t))<e.byteLength&&((o=e.byteLength-_)>this._bufferSize&&(this._expandBuffer(o),s=new Uint8Array(this._stashBuffer,0,this._bufferSize)),s.set(new Uint8Array(e,_),0),this._stashUsed+=o,this._stashByteStart=t+_);else if(0===this._stashUsed){var o;(_=this._dispatchChunks(e,t))<e.byteLength&&((o=e.byteLength-_)>this._bufferSize&&this._expandBuffer(o),(s=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,_),0),this._stashUsed+=o,this._stashByteStart=t+_)}else{var s,_;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(s=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(_=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&_>0){var c=new Uint8Array(this._stashBuffer,_);s.set(c,0)}this._stashUsed-=_,this._stashByteStart+=_}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),a=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),o=new Uint8Array(t,i);r.set(o,0),this._stashUsed=o.byteLength,this._stashByteStart+=i}return 0}n.A.w(this.TAG,"".concat(a," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,a}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(n.A.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=o.Xv.UNRECOVERABLE_EARLY_EOF),e){case o.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var i=this._currentRange.to+1;return void(i<this._totalLength&&(n.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(i,!1)))}e=o.Xv.UNRECOVERABLE_EARLY_EOF;case o.Xv.UNRECOVERABLE_EARLY_EOF:case o.Xv.CONNECTING_TIMEOUT:case o.Xv.HTTP_STATUS_CODE_INVALID:case o.Xv.EXCEPTION:}if(!this._onError)throw new d.Al("IOException: "+t.msg);this._onError(e,t)},e}()},925(e,t,i){"use strict";i.d(t,{HC:()=>o,Xv:()=>r,eO:()=>a});var n=i(816),a={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},r={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},o=function(){function e(e){this._type=e||"undefined",this._status=a.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=a.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===a.kConnecting||this._status===a.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new n.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new n.Xu("Unimplemented abstract function!")},e}()},103(e,t,i){"use strict";i.d(t,{default:()=>P});var n=i(262),a=i(254),r={enableWorker:!1,enableWorkerForMSE:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,preferredAudioPid:0,liveBufferLatencyChasing:!1,liveBufferLatencyChasingOnPaused:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,liveSync:!1,liveSyncMaxLatency:1.2,liveSyncTargetLatency:.8,liveSyncPlaybackRate:1.2,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,headers:void 0,customLoader:void 0};function o(){return Object.assign({},r)}var s=function(){function e(){}return e.supportMSEH264Playback=function(){var e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',t=self.MediaSource&&self.MediaSource.isTypeSupported(e),i=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported(e);return t||i},e.supportMSEH265Playback=function(){var e='video/mp4; codecs="hvc1.1.6.L93.B0"',t=self.MediaSource&&self.MediaSource.isTypeSupported(e),i=self.ManagedMediaSource&&self.ManagedMediaSource.isTypeSupported(e);return t||i},e.supportNetworkStreamIO=function(){var e=new a.A({},o()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t},e.getNetworkLoaderTypeName=function(){var e=new a.A({},o()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"==i},e.getFeatureList=function(){var t={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.msePlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLivePlayback=t.msePlayback&&t.networkStreamIO,t.mseH265Playback=e.supportMSEH265Playback(),t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();const d=s;var _=i(925),c=i(641),h=i(402),l=i.n(h),u=i(217),p=i(117),f=i(824),m=i(403),g=i(270),v=i(816),y=i(726),A=i(9),S=i(544);const b=function(){function e(e,t,i){this.TAG="SeekingHandler",this._config=null,this._media_element=null,this._always_seek_keyframe=!1,this._on_unbuffered_seek=null,this._request_set_current_time=!1,this._seek_request_record_clocktime=null,this._idr_sample_list=new S.EX,this.e=null,this._config=e,this._media_element=t,this._on_unbuffered_seek=i,this.e={onMediaSeeking:this._onMediaSeeking.bind(this)};var n=A.A.chrome&&(A.A.version.major<50||50===A.A.version.major&&A.A.version.build<2661);this._always_seek_keyframe=!!(n||A.A.msedge||A.A.msie),this._always_seek_keyframe&&(this._config.accurateSeek=!1),this._media_element.addEventListener("seeking",this.e.onMediaSeeking)}return e.prototype.destroy=function(){this._idr_sample_list.clear(),this._idr_sample_list=null,this._media_element.removeEventListener("seeking",this.e.onMediaSeeking),this._media_element=null,this._on_unbuffered_seek=null},e.prototype.seek=function(e){var t=this._isPositionBuffered(e),i=!1;if(e<1&&this._media_element.buffered.length>0){var n=this._media_element.buffered.start(0);(n<1&&e<n||A.A.safari)&&(i=!0,e=A.A.safari?.1:n)}if(i)this.directSeek(e);else if(t)if(this._always_seek_keyframe){var a=this._getNearestKeyframe(Math.floor(1e3*e));null!=a&&(e=a.dts/1e3),this.directSeek(e)}else this.directSeek(e);else this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*e)),this._config.accurateSeek&&this.directSeek(e)},e.prototype.directSeek=function(e){this._request_set_current_time=!0,this._media_element.currentTime=e},e.prototype.appendSyncPoints=function(e){this._idr_sample_list.appendArray(e)},e.prototype._onMediaSeeking=function(t){if(this._request_set_current_time)this._request_set_current_time=!1;else{var i=this._media_element.currentTime,n=this._media_element.buffered;if(i<1&&n.length>0){var a=n.start(0);if(a<1&&i<a||A.A.safari){var r=A.A.safari?.1:a;return void this.directSeek(r)}}if(this._isPositionBuffered(i)){if(this._always_seek_keyframe){var o=this._getNearestKeyframe(Math.floor(1e3*i));null!=o&&(i=o.dts/1e3,this.directSeek(i))}}else this._seek_request_record_clocktime=e._getClockTime(),window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)}},e.prototype._pollAndApplyUnbufferedSeek=function(){if(null!=this._seek_request_record_clocktime)if(this._seek_request_record_clocktime<=e._getClockTime()-100){var t=this._media_element.currentTime;this._seek_request_record_clocktime=null,this._isPositionBuffered(t)||(this._idr_sample_list.clear(),this._on_unbuffered_seek(Math.floor(1e3*t)),this._config.accurateSeek&&this.directSeek(t))}else window.setTimeout(this._pollAndApplyUnbufferedSeek.bind(this),50)},e.prototype._isPositionBuffered=function(e){for(var t=this._media_element.buffered,i=0;i<t.length;i++){var n=t.start(i),a=t.end(i);if(e>=n&&e<a)return!0}return!1},e.prototype._getNearestKeyframe=function(e){return this._idr_sample_list.getLastSyncPointBeforeDts(e)},e._getClockTime=function(){return self.performance&&self.performance.now?self.performance.now():Date.now()},e}(),E=function(){function e(e,t,i,n){this.TAG="LoadingController",this._config=null,this._media_element=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null,this._paused=!1,this.e=null,this._config=e,this._media_element=t,this._on_pause_transmuxer=i,this._on_resume_transmuxer=n,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)}}return e.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this.e=null,this._media_element=null,this._config=null,this._on_pause_transmuxer=null,this._on_resume_transmuxer=null},e.prototype.notifyBufferedPositionChanged=function(e){!this._config.isLive&&this._config.lazyLoad&&(null==e?this._suspendTransmuxerIfNeeded():this._suspendTransmuxerIfBufferedPositionExceeded(e))},e.prototype._onMediaTimeUpdate=function(e){this._paused&&this._resumeTransmuxerIfNeeded()},e.prototype._suspendTransmuxerIfNeeded=function(){for(var e=this._media_element.buffered,t=this._media_element.currentTime,i=0,n=0;n<e.length;n++){var a=e.start(n),r=e.end(n);if(a<=t&&t<r){i=r;break}}i>0&&this._suspendTransmuxerIfBufferedPositionExceeded(i)},e.prototype._suspendTransmuxerIfBufferedPositionExceeded=function(e){e>=this._media_element.currentTime+this._config.lazyLoadMaxDuration&&!this._paused&&(c.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this.suspendTransmuxer(),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate))},e.prototype.suspendTransmuxer=function(){this._paused=!0,this._on_pause_transmuxer()},e.prototype._resumeTransmuxerIfNeeded=function(){for(var e=this._media_element.buffered,t=this._media_element.currentTime,i=this._config.lazyLoadRecoverDuration,n=!1,a=0;a<e.length;a++){var r=e.start(a),o=e.end(a);if(t>=r&&t<o){t>=o-i&&(n=!0);break}}n&&(c.A.v(this.TAG,"Continue loading from paused position"),this.resumeTransmuxer(),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate))},e.prototype.resumeTransmuxer=function(){this._paused=!1,this._on_resume_transmuxer()},e}(),R=function(){function e(e,t){this.TAG="StartupStallJumper",this._media_element=null,this._on_direct_seek=null,this._canplay_received=!1,this.e=null,this._media_element=e,this._on_direct_seek=t,this.e={onMediaCanPlay:this._onMediaCanPlay.bind(this),onMediaStalled:this._onMediaStalled.bind(this),onMediaProgress:this._onMediaProgress.bind(this)},this._media_element.addEventListener("canplay",this.e.onMediaCanPlay),this._media_element.addEventListener("stalled",this.e.onMediaStalled),this._media_element.addEventListener("progress",this.e.onMediaProgress)}return e.prototype.destroy=function(){this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay),this._media_element.removeEventListener("stalled",this.e.onMediaStalled),this._media_element.removeEventListener("progress",this.e.onMediaProgress),this._media_element=null,this._on_direct_seek=null},e.prototype._onMediaCanPlay=function(e){this._canplay_received=!0,this._media_element.removeEventListener("canplay",this.e.onMediaCanPlay)},e.prototype._onMediaStalled=function(e){this._detectAndFixStuckPlayback(!0)},e.prototype._onMediaProgress=function(e){this._detectAndFixStuckPlayback()},e.prototype._detectAndFixStuckPlayback=function(e){var t=this._media_element,i=t.buffered;e||!this._canplay_received||t.readyState<2?i.length>0&&t.currentTime<i.start(0)&&(c.A.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(i.start(0))),this._on_direct_seek(i.start(0)),this._media_element.removeEventListener("progress",this.e.onMediaProgress)):this._media_element.removeEventListener("progress",this.e.onMediaProgress)},e}(),T=function(){function e(e,t,i){this._config=null,this._media_element=null,this._on_direct_seek=null,this._config=e,this._media_element=t,this._on_direct_seek=i}return e.prototype.destroy=function(){this._on_direct_seek=null,this._media_element=null,this._config=null},e.prototype.notifyBufferedRangeUpdate=function(){this._chaseLiveLatency()},e.prototype._chaseLiveLatency=function(){var e=this._media_element.buffered,t=this._media_element.currentTime,i=this._media_element.paused;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&0!=e.length&&(this._config.liveBufferLatencyChasingOnPaused||!i)){var n=e.end(e.length-1);if(n>this._config.liveBufferLatencyMaxLatency&&n-t>this._config.liveBufferLatencyMaxLatency){var a=n-this._config.liveBufferLatencyMinRemain;this._on_direct_seek(a)}}},e}(),k=function(){function e(e,t){this._config=null,this._media_element=null,this.e=null,this._config=e,this._media_element=t,this.e={onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this)},this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate)}return e.prototype.destroy=function(){this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element=null,this._config=null},e.prototype._onMediaTimeUpdate=function(e){if(this._config.isLive&&this._config.liveSync){var t=this._getCurrentLatency();if(t>this._config.liveSyncMaxLatency){var i=Math.min(2,Math.max(1,this._config.liveSyncPlaybackRate));this._media_element.playbackRate=i}else t>this._config.liveSyncTargetLatency||1!==this._media_element.playbackRate&&0!==this._media_element.playbackRate&&(this._media_element.playbackRate=1)}},e.prototype._getCurrentLatency=function(){if(!this._media_element)return 0;var e=this._media_element.buffered,t=this._media_element.currentTime;return 0==e.length?0:e.end(e.length-1)-t},e}(),L=function(){function e(e,t){this.TAG="PlayerEngineMainThread",this._emitter=new h,this._media_element=null,this._mse_controller=null,this._transmuxer=null,this._pending_seek_time=null,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._mse_source_opened=!1,this._has_pending_load=!1,this._loaded_metadata_received=!1,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=e,this._config=o(),"object"==typeof t&&Object.assign(this._config,t),!0===e.isLive&&(this._config.isLive=!0),this.e={onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this)}}return e.prototype.destroy=function(){this._emitter.emit(p.A.DESTROYING),this._transmuxer&&this.unload(),this._media_element&&this.detachMediaElement(),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;this._emitter.addListener(e,t),e===p.A.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return i._emitter.emit(p.A.MEDIA_INFO,i.mediaInfo)}):e==p.A.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return i._emitter.emit(p.A.STATISTICS_INFO,i.statisticsInfo)})},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t=this;this._media_element=e,e.src="",e.removeAttribute("src"),e.srcObject=null,e.load(),e.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._mse_controller=new u.A(this._config),this._mse_controller.on(m.A.UPDATE_END,this._onMSEUpdateEnd.bind(this)),this._mse_controller.on(m.A.BUFFER_FULL,this._onMSEBufferFull.bind(this)),this._mse_controller.on(m.A.SOURCE_OPEN,this._onMSESourceOpen.bind(this)),this._mse_controller.on(m.A.ERROR,this._onMSEError.bind(this)),this._mse_controller.on(m.A.START_STREAMING,this._onMSEStartStreaming.bind(this)),this._mse_controller.on(m.A.END_STREAMING,this._onMSEEndStreaming.bind(this)),this._mse_controller.initialize({getCurrentTime:function(){return t._media_element.currentTime},getReadyState:function(){return t._media_element.readyState}}),this._mse_controller.isManagedMediaSource()?(e.disableRemotePlayback=!0,e.srcObject=this._mse_controller.getObject()):e.src=this._mse_controller.getObjectURL()},e.prototype.detachMediaElement=function(){this._media_element&&(this._mse_controller.shutdown(),this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null,this._mse_controller.revokeObjectURL()),this._mse_controller&&(this._mse_controller.destroy(),this._mse_controller=null)},e.prototype.load=function(){var e=this;if(!this._media_element)throw new v.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new v.j4("load() has been called, please call unload() first!");this._has_pending_load||(!this._config.deferLoadAfterSourceOpen||this._mse_source_opened?(this._transmuxer=new f.A(this._media_data_source,this._config),this._transmuxer.on(y.A.INIT_SEGMENT,function(t,i){e._mse_controller.appendInitSegment(i)}),this._transmuxer.on(y.A.MEDIA_SEGMENT,function(t,i){e._mse_controller.appendMediaSegment(i),!e._config.isLive&&"video"===t&&i.data&&i.data.byteLength>0&&"info"in i&&e._seeking_handler.appendSyncPoints(i.info.syncPoints),e._loading_controller.notifyBufferedPositionChanged(i.info.endDts/1e3)}),this._transmuxer.on(y.A.LOADING_COMPLETE,function(){e._mse_controller.endOfStream(),e._emitter.emit(p.A.LOADING_COMPLETE)}),this._transmuxer.on(y.A.RECOVERED_EARLY_EOF,function(){e._emitter.emit(p.A.RECOVERED_EARLY_EOF)}),this._transmuxer.on(y.A.IO_ERROR,function(t,i){e._emitter.emit(p.A.ERROR,g.w.NETWORK_ERROR,t,i)}),this._transmuxer.on(y.A.DEMUX_ERROR,function(t,i){e._emitter.emit(p.A.ERROR,g.w.MEDIA_ERROR,t,i)}),this._transmuxer.on(y.A.MEDIA_INFO,function(t){e._media_info=t,e._emitter.emit(p.A.MEDIA_INFO,Object.assign({},t))}),this._transmuxer.on(y.A.STATISTICS_INFO,function(t){e._statistics_info=e._fillStatisticsInfo(t),e._emitter.emit(p.A.STATISTICS_INFO,Object.assign({},t))}),this._transmuxer.on(y.A.RECOMMEND_SEEKPOINT,function(t){e._media_element&&!e._config.accurateSeek&&e._seeking_handler.directSeek(t/1e3)}),this._transmuxer.on(y.A.METADATA_ARRIVED,function(t){e._emitter.emit(p.A.METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.SCRIPTDATA_ARRIVED,function(t){e._emitter.emit(p.A.SCRIPTDATA_ARRIVED,t)}),this._transmuxer.on(y.A.TRACKS_UPDATED,function(t){e._emitter.emit(p.A.TRACKS_UPDATED,t)}),this._transmuxer.on(y.A.TIMED_ID3_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.TIMED_ID3_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.PGS_SUBTITLE_ARRIVED,function(t){e._emitter.emit(p.A.PGS_SUBTITLE_ARRIVED,t)}),this._transmuxer.on(y.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.SYNCHRONOUS_KLV_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.ASYNCHRONOUS_KLV_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.SMPTE2038_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.SMPTE2038_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.SEI_ARRIVED,function(t){e._emitter.emit(p.A.SEI_ARRIVED,t)}),this._transmuxer.on(y.A.SCTE35_METADATA_ARRIVED,function(t){e._emitter.emit(p.A.SCTE35_METADATA_ARRIVED,t)}),this._transmuxer.on(y.A.PES_PRIVATE_DATA_DESCRIPTOR,function(t){e._emitter.emit(p.A.PES_PRIVATE_DATA_DESCRIPTOR,t)}),this._transmuxer.on(y.A.PES_PRIVATE_DATA_ARRIVED,function(t){e._emitter.emit(p.A.PES_PRIVATE_DATA_ARRIVED,t)}),this._seeking_handler=new b(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new E(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new R(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new T(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new k(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0),this._transmuxer.open()):this._has_pending_load=!0)},e.prototype.unload=function(){var e,t,i,n,a,r,o,s,d;null===(e=this._media_element)||void 0===e||e.pause(),null===(t=this._live_latency_synchronizer)||void 0===t||t.destroy(),this._live_latency_synchronizer=null,null===(i=this._live_latency_chaser)||void 0===i||i.destroy(),this._live_latency_chaser=null,null===(n=this._startup_stall_jumper)||void 0===n||n.destroy(),this._startup_stall_jumper=null,null===(a=this._loading_controller)||void 0===a||a.destroy(),this._loading_controller=null,null===(r=this._seeking_handler)||void 0===r||r.destroy(),this._seeking_handler=null,null===(o=this._mse_controller)||void 0===o||o.flush(),null===(s=this._transmuxer)||void 0===s||s.close(),null===(d=this._transmuxer)||void 0===d||d.destroy(),this._transmuxer=null},e.prototype.play=function(){return this._media_element.play()},e.prototype.pause=function(){this._media_element.pause()},e.prototype.seek=function(e){this._media_element&&this._seeking_handler?this._seeking_handler.seek(e):this._pending_seek_time=e},Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),e.prototype._onMSESourceOpen=function(){this._mse_source_opened=!0,this._has_pending_load&&(this._has_pending_load=!1,this.load())},e.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},e.prototype._onMSEBufferFull=function(){c.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},e.prototype._onMSEError=function(e){this._emitter.emit(p.A.ERROR,g.w.MEDIA_ERROR,g.v.MEDIA_MSE_ERROR,e)},e.prototype._onMSEStartStreaming=function(){this._loaded_metadata_received&&(this._config.isLive||(c.A.v(this.TAG,"Resume transmuxing task due to ManagedMediaSource onStartStreaming"),this._loading_controller.resumeTransmuxer()))},e.prototype._onMSEEndStreaming=function(){this._config.isLive||(c.A.v(this.TAG,"Suspend transmuxing task due to ManagedMediaSource onEndStreaming"),this._loading_controller.suspendTransmuxer())},e.prototype._onMediaLoadedMetadata=function(e){this._loaded_metadata_received=!0,null!=this._pending_seek_time&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},e.prototype._onRequestDirectSeek=function(e){this._seeking_handler.directSeek(e)},e.prototype._onRequiredUnbufferedSeek=function(e){this._mse_controller.flush(),this._transmuxer.seek(e)},e.prototype._onRequestPauseTransmuxer=function(){this._transmuxer.pause()},e.prototype._onRequestResumeTransmuxer=function(){this._transmuxer.resume()},e.prototype._fillStatisticsInfo=function(e){if(e.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._media_element.getVideoPlaybackQuality){var a=this._media_element.getVideoPlaybackQuality();i=a.totalVideoFrames,n=a.droppedVideoFrames}else null!=this._media_element.webkitDecodedFrameCount?(i=this._media_element.webkitDecodedFrameCount,n=this._media_element.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype.switchAudioPid=function(e){this._transmuxer&&this._transmuxer.switchAudioPid(e)},e}();var w=i(360),C=i(540);const M=function(){function e(e,t){this.TAG="PlayerEngineDedicatedThread",this._emitter=new h,this._media_element=null,this._worker_destroying=!1,this._seeking_handler=null,this._loading_controller=null,this._startup_stall_jumper=null,this._live_latency_chaser=null,this._live_latency_synchronizer=null,this._pending_seek_time=null,this._media_info=null,this._statistics_info=null,this.e=null,this._media_data_source=e,this._config=o(),"object"==typeof t&&Object.assign(this._config,t),!0===e.isLive&&(this._config.isLive=!0),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this),onMediaLoadedMetadata:this._onMediaLoadedMetadata.bind(this),onMediaTimeUpdate:this._onMediaTimeUpdate.bind(this),onMediaReadyStateChanged:this._onMediaReadyStateChange.bind(this)},C.A.registerListener(this.e.onLoggingConfigChanged),this._worker=w(877,{all:!0}),this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",media_data_source:this._media_data_source,config:this._config}),this._worker.postMessage({cmd:"logging_config",logging_config:C.A.getConfig()})}return e.isSupported=function(){return!!(self.Worker&&(self.MediaSource&&"canConstructInDedicatedWorker"in self.MediaSource&&!0===self.MediaSource.canConstructInDedicatedWorker||self.ManagedMediaSource&&"canConstructInDedicatedWorker"in self.ManagedMediaSource&&!0===self.ManagedMediaSource.canConstructInDedicatedWorker))},e.prototype.destroy=function(){this._emitter.emit(p.A.DESTROYING),this.unload(),this.detachMediaElement(),this._worker_destroying=!0,this._worker.postMessage({cmd:"destroy"}),C.A.removeListener(this.e.onLoggingConfigChanged),this.e=null,this._media_data_source=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;this._emitter.addListener(e,t),e===p.A.MEDIA_INFO&&this._media_info?Promise.resolve().then(function(){return i._emitter.emit(p.A.MEDIA_INFO,i.mediaInfo)}):e==p.A.STATISTICS_INFO&&this._statistics_info&&Promise.resolve().then(function(){return i._emitter.emit(p.A.STATISTICS_INFO,i.statisticsInfo)})},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){this._media_element=e,this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element.addEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.addEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.addEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._worker.postMessage({cmd:"initialize_mse"})},e.prototype.detachMediaElement=function(){this._worker.postMessage({cmd:"shutdown_mse"}),this._media_element&&(this._media_element.removeEventListener("loadedmetadata",this.e.onMediaLoadedMetadata),this._media_element.removeEventListener("timeupdate",this.e.onMediaTimeUpdate),this._media_element.removeEventListener("readystatechange",this.e.onMediaReadyStateChanged),this._media_element.src="",this._media_element.removeAttribute("src"),this._media_element.srcObject=null,this._media_element.load(),this._media_element=null)},e.prototype.load=function(){this._worker.postMessage({cmd:"load"}),this._seeking_handler=new b(this._config,this._media_element,this._onRequiredUnbufferedSeek.bind(this)),this._loading_controller=new E(this._config,this._media_element,this._onRequestPauseTransmuxer.bind(this),this._onRequestResumeTransmuxer.bind(this)),this._startup_stall_jumper=new R(this._media_element,this._onRequestDirectSeek.bind(this)),this._config.isLive&&this._config.liveBufferLatencyChasing&&(this._live_latency_chaser=new T(this._config,this._media_element,this._onRequestDirectSeek.bind(this))),this._config.isLive&&this._config.liveSync&&(this._live_latency_synchronizer=new k(this._config,this._media_element)),this._media_element.readyState>0&&this._seeking_handler.directSeek(0)},e.prototype.unload=function(){var e,t,i,n,a,r;null===(e=this._media_element)||void 0===e||e.pause(),this._worker.postMessage({cmd:"unload"}),null===(t=this._live_latency_synchronizer)||void 0===t||t.destroy(),this._live_latency_synchronizer=null,null===(i=this._live_latency_chaser)||void 0===i||i.destroy(),this._live_latency_chaser=null,null===(n=this._startup_stall_jumper)||void 0===n||n.destroy(),this._startup_stall_jumper=null,null===(a=this._loading_controller)||void 0===a||a.destroy(),this._loading_controller=null,null===(r=this._seeking_handler)||void 0===r||r.destroy(),this._seeking_handler=null},e.prototype.play=function(){return this._media_element.play()},e.prototype.pause=function(){this._media_element.pause()},e.prototype.seek=function(e){this._media_element&&this._seeking_handler?this._seeking_handler.seek(e):this._pending_seek_time=e},Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._media_info)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return Object.assign({},this._statistics_info)},enumerable:!1,configurable:!0}),e.prototype._onLoggingConfigChanged=function(e){var t;null===(t=this._worker)||void 0===t||t.postMessage({cmd:"logging_config",logging_config:e})},e.prototype._onMSEUpdateEnd=function(){this._config.isLive&&this._config.liveBufferLatencyChasing&&this._live_latency_chaser&&this._live_latency_chaser.notifyBufferedRangeUpdate(),this._loading_controller.notifyBufferedPositionChanged()},e.prototype._onMSEBufferFull=function(){c.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._loading_controller.suspendTransmuxer()},e.prototype._onMediaLoadedMetadata=function(e){null!=this._pending_seek_time&&(this._seeking_handler.seek(this._pending_seek_time),this._pending_seek_time=null)},e.prototype._onRequestDirectSeek=function(e){this._seeking_handler.directSeek(e)},e.prototype._onRequiredUnbufferedSeek=function(e){this._worker.postMessage({cmd:"unbuffered_seek",milliseconds:e})},e.prototype._onRequestPauseTransmuxer=function(){this._worker.postMessage({cmd:"pause_transmuxer"})},e.prototype._onRequestResumeTransmuxer=function(){this._worker.postMessage({cmd:"resume_transmuxer"})},e.prototype._onMediaTimeUpdate=function(e){this._worker.postMessage({cmd:"timeupdate",current_time:e.target.currentTime})},e.prototype._onMediaReadyStateChange=function(e){this._worker.postMessage({cmd:"readystatechange",ready_state:e.target.readyState})},e.prototype._onWorkerMessage=function(e){var t,i=e.data,n=i.msg;if("destroyed"==n||this._worker_destroying)return this._worker_destroying=!1,null===(t=this._worker)||void 0===t||t.terminate(),void(this._worker=null);switch(n){case"mse_init":var a=i;"ManagedMediaSource"in self&&!("MediaSource"in self)&&(this._media_element.disableRemotePlayback=!0),this._media_element.srcObject=a.handle;break;case"mse_event":(a=i).event==m.A.UPDATE_END?this._onMSEUpdateEnd():a.event==m.A.BUFFER_FULL&&this._onMSEBufferFull();break;case"transmuxing_event":if((a=i).event==y.A.MEDIA_INFO){var r=i;this._media_info=r.info,this._emitter.emit(p.A.MEDIA_INFO,Object.assign({},r.info))}else if(a.event==y.A.STATISTICS_INFO){var o=i;this._statistics_info=this._fillStatisticsInfo(o.info),this._emitter.emit(p.A.STATISTICS_INFO,Object.assign({},o.info))}else if(a.event==y.A.RECOMMEND_SEEKPOINT){var s=i;this._media_element&&!this._config.accurateSeek&&this._seeking_handler.directSeek(s.milliseconds/1e3)}break;case"player_event":if((a=i).event==p.A.ERROR){var d=i;this._emitter.emit(p.A.ERROR,d.error_type,d.error_detail,d.info)}else if("extraData"in a){var _=i;this._emitter.emit(_.event,_.extraData)}break;case"logcat_callback":a=i,c.A.emitter.emit("log",a.type,a.logcat);break;case"buffered_position_changed":a=i,this._loading_controller.notifyBufferedPositionChanged(a.buffered_position_milliseconds/1e3)}},e.prototype._fillStatisticsInfo=function(e){if(e.playerType="MSEPlayer",!(this._media_element instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._media_element.getVideoPlaybackQuality){var a=this._media_element.getVideoPlaybackQuality();i=a.totalVideoFrames,n=a.droppedVideoFrames}else null!=this._media_element.webkitDecodedFrameCount?(i=this._media_element.webkitDecodedFrameCount,n=this._media_element.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype.switchAudioPid=function(e){this._worker&&!this._worker_destroying&&this._worker.postMessage({cmd:"switch_audio_pid",pid:e})},e}(),D=function(){function e(e,t){this.TAG="MSEPlayer",this._type="MSEPlayer",this._media_element=null,this._player_engine=null;var i=e.type.toLowerCase();if("mse"!==i&&"mpegts"!==i&&"m2ts"!==i&&"flv"!==i)throw new v.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");if(t&&t.enableWorkerForMSE&&M.isSupported())try{this._player_engine=new M(e,t)}catch(i){c.A.e(this.TAG,"Error while initializing PlayerEngineDedicatedThread, fallback to PlayerEngineMainThread"),this._player_engine=new L(e,t)}else this._player_engine=new L(e,t)}return e.prototype.destroy=function(){this._player_engine.destroy(),this._player_engine=null,this._media_element=null},e.prototype.on=function(e,t){this._player_engine.on(e,t)},e.prototype.off=function(e,t){this._player_engine.off(e,t)},e.prototype.attachMediaElement=function(e){this._media_element=e,this._player_engine.attachMediaElement(e)},e.prototype.detachMediaElement=function(){this._media_element=null,this._player_engine.detachMediaElement()},e.prototype.load=function(){this._player_engine.load()},e.prototype.unload=function(){this._player_engine.unload()},e.prototype.play=function(){return this._player_engine.play()},e.prototype.pause=function(){this._player_engine.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._media_element.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._media_element.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._media_element.volume},set:function(e){this._media_element.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._media_element.muted},set:function(e){this._media_element.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._media_element?this._media_element.currentTime:0},set:function(e){this._player_engine.seek(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return this._player_engine.mediaInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return this._player_engine.statisticsInfo},enumerable:!1,configurable:!0}),e.prototype.switchAudioPid=function(e){this._player_engine.switchAudioPid(e)},e}(),B=function(){function e(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(l()),this._config=o(),"object"==typeof t&&Object.assign(this._config,t);var i=e.type.toLowerCase();if("mse"===i||"mpegts"===i||"m2ts"===i||"flv"===i)throw new v.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new v.Qn("NativePlayer(".concat(e.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}return e.prototype.destroy=function(){this._emitter.emit(p.A.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===p.A.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then(function(){i._emitter.emit(p.A.MEDIA_INFO,i.mediaInfo)}):e===p.A.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then(function(){i._emitter.emit(p.A.STATISTICS_INFO,i.statisticsInfo)}),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.load=function(){if(!this._mediaElement)throw new v.j4("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var a=this._mediaElement.getVideoPlaybackQuality();i=a.totalVideoFrames,n=a.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(p.A.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(p.A.STATISTICS_INFO,this.statisticsInfo)},e}();n.A.install();var O={createPlayer:function(e,t){var i=e;if(null==i||"object"!=typeof i)throw new v.Qn("MediaDataSource must be an javascript object!");if(!i.hasOwnProperty("type"))throw new v.Qn("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new D(i,t);default:return new B(i,t)}},isSupported:function(){return d.supportMSEH264Playback()},getFeatureList:function(){return d.getFeatureList()}};O.BaseLoader=_.HC,O.LoaderStatus=_.eO,O.LoaderErrors=_.Xv,O.Events=p.A,O.ErrorTypes=g.w,O.ErrorDetails=g.v,O.MSEPlayer=D,O.NativePlayer=B,O.LoggingControl=C.A,Object.defineProperty(O,"version",{enumerable:!0,get:function(){return"1.8.2"}});const P=O},270(e,t,i){"use strict";i.d(t,{v:()=>o,w:()=>r});var n=i(925),a=i(134),r={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},o={NETWORK_EXCEPTION:n.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:a.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:a.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:a.A.CODEC_UNSUPPORTED}},9(e,t,i){"use strict";i.d(t,{A:()=>a});var n={};!function(){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)||[],a={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},r={};if(a.browser){r[a.browser]=!0;var o=a.majorVersion.split(".");r.version={major:parseInt(a.majorVersion,10),string:a.version},o.length>1&&(r.version.minor=parseInt(o[1],10)),o.length>2&&(r.version.build=parseInt(o[2],10))}if(a.platform&&(r[a.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;var s="msie";a.browser=s,r[s]=!0}if(r.edge){delete r.edge;var d="msedge";a.browser=d,r[d]=!0}if(r.opr){var _="opera";a.browser=_,r[_]=!0}if(r.safari&&r.android){var c="android";a.browser=c,r[c]=!0}for(var h in r.name=a.browser,r.platform=a.platform,n)n.hasOwnProperty(h)&&delete n[h];Object.assign(n,r)}();const a=n},816(e,t,i){"use strict";i.d(t,{Al:()=>r,Qn:()=>s,Xu:()=>d,j4:()=>o});var n,a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),o=function(e){function t(t){return e.call(this,t)||this}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(r),s=function(e){function t(t){return e.call(this,t)||this}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(r),d=function(e){function t(t){return e.call(this,t)||this}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(r)},641(e,t,i){"use strict";i.d(t,{A:()=>o});var n=i(402),a=i.n(n),r=function(){function e(){}return e.e=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(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="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",n),e.ENABLE_VERBOSE&&console.log(n)},e}();r.GLOBAL_TAG="mpegts.js",r.FORCE_GLOBAL_TAG=!1,r.ENABLE_ERROR=!0,r.ENABLE_INFO=!0,r.ENABLE_WARN=!0,r.ENABLE_DEBUG=!0,r.ENABLE_VERBOSE=!0,r.ENABLE_CALLBACK=!1,r.emitter=new(a());const o=r},540(e,t,i){"use strict";i.d(t,{A:()=>s});var n=i(402),a=i.n(n),r=i(641),o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return r.A.FORCE_GLOBAL_TAG},set:function(t){r.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return r.A.GLOBAL_TAG},set:function(t){r.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return r.A.ENABLE_VERBOSE&&r.A.ENABLE_DEBUG&&r.A.ENABLE_INFO&&r.A.ENABLE_WARN&&r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_VERBOSE=t,r.A.ENABLE_DEBUG=t,r.A.ENABLE_INFO=t,r.A.ENABLE_WARN=t,r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return r.A.ENABLE_DEBUG},set:function(t){r.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return r.A.ENABLE_VERBOSE},set:function(t){r.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return r.A.ENABLE_INFO},set:function(t){r.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return r.A.ENABLE_WARN},set:function(t){r.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:r.A.GLOBAL_TAG,forceGlobalTag:r.A.FORCE_GLOBAL_TAG,enableVerbose:r.A.ENABLE_VERBOSE,enableDebug:r.A.ENABLE_DEBUG,enableInfo:r.A.ENABLE_INFO,enableWarn:r.A.ENABLE_WARN,enableError:r.A.ENABLE_ERROR,enableCallback:r.A.ENABLE_CALLBACK}},e.applyConfig=function(e){r.A.GLOBAL_TAG=e.globalTag,r.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,r.A.ENABLE_VERBOSE=e.enableVerbose,r.A.ENABLE_DEBUG=e.enableDebug,r.A.ENABLE_INFO=e.enableInfo,r.A.ENABLE_WARN=e.enableWarn,r.A.ENABLE_ERROR=e.enableError,r.A.ENABLE_CALLBACK=e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){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){r.A.emitter.addListener("log",t),r.A.emitter.listenerCount("log")>0&&(r.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){r.A.emitter.removeListener("log",t),0===r.A.emitter.listenerCount("log")&&(r.A.ENABLE_CALLBACK=!1,e._notifyChange())},e}();o.emitter=new(a());const s=o},262(e,t,i){"use strict";i.d(t,{A:()=>a});var n=function(){function e(){}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a])}return t},String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var i=t>0?0|t:0;return this.substring(i,i+e.length)===e}}),"function"!=typeof self.Promise&&i(935).polyfill()},e}();n.install();const a=n},360(e,t,i){function n(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var n=i(i.s=ENTRY_MODULE);return n.default||n}var a="[\\.|\\-|\\+|\\w|/|@]+",r="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+a+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e){return!isNaN(1*e)}function d(e,t,n){var d={};d[n]=[];var _=t.toString(),c=_.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return d;for(var h,l=c[1],u=new RegExp("(\\\\n|\\W)"+o(l)+r,"g");h=u.exec(_);)"dll-reference"!==h[3]&&d[n].push(h[3]);for(u=new RegExp("\\("+o(l)+'\\("(dll-reference\\s('+a+'))"\\)\\)'+r,"g");h=u.exec(_);)e[h[2]]||(d[n].push(h[1]),e[h[2]]=i(h[1]).m),d[h[2]]=d[h[2]]||[],d[h[2]].push(h[4]);for(var p=Object.keys(d),f=0;f<p.length;f++)for(var m=0;m<d[p[f]].length;m++)s(d[p[f]][m])&&(d[p[f]][m]=1*d[p[f]][m]);return d}function _(e){return Object.keys(e).reduce(function(t,i){return t||e[i].length>0},!1)}e.exports=function(e,t){t=t||{};var a={main:i.m},r=t.all?{main:Object.keys(a.main)}:function(e,t){for(var i={main:[t]},n={main:[]},a={main:{}};_(i);)for(var r=Object.keys(i),o=0;o<r.length;o++){var s=r[o],c=i[s].pop();if(a[s]=a[s]||{},!a[s][c]&&e[s][c]){a[s][c]=!0,n[s]=n[s]||[],n[s].push(c);for(var h=d(e,e[s][c],s),l=Object.keys(h),u=0;u<l.length;u++)i[l[u]]=i[l[u]]||[],i[l[u]]=i[l[u]].concat(h[l[u]])}}return n}(a,e),o="";Object.keys(r).filter(function(e){return"main"!==e}).forEach(function(e){for(var t=0;r[e][t];)t++;r[e].push(t),a[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+e+" = ("+n.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+r[e].map(function(t){return JSON.stringify(t)+": "+a[e][t].toString()}).join(",")+"});\n"}),o=o+"new (("+n.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+r.main.map(function(e){return JSON.stringify(e)+": "+a.main[e].toString()}).join(",")+"}))(self);";var s=new self.Blob([o],{type:"text/javascript"});if(t.bare)return s;var c=(self.URL||self.webkitURL||self.mozURL||self.msURL).createObjectURL(s),h=new self.Worker(c);return h.objectURL=c,h}},403(e,t,i){"use strict";var n;i.d(t,{A:()=>a}),function(e){e.ERROR="error",e.SOURCE_OPEN="source_open",e.UPDATE_END="update_end",e.BUFFER_FULL="buffer_full",e.START_STREAMING="start_streaming",e.END_STREAMING="end_streaming"}(n||(n={}));const a=n},726(e,t,i){"use strict";var n;i.d(t,{A:()=>a}),function(e){e.IO_ERROR="io_error",e.DEMUX_ERROR="demux_error",e.INIT_SEGMENT="init_segment",e.MEDIA_SEGMENT="media_segment",e.LOADING_COMPLETE="loading_complete",e.RECOVERED_EARLY_EOF="recovered_early_eof",e.MEDIA_INFO="media_info",e.METADATA_ARRIVED="metadata_arrived",e.SCRIPTDATA_ARRIVED="scriptdata_arrived",e.TRACKS_UPDATED="tracks_updated",e.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",e.PGS_SUBTITLE_ARRIVED="pgs_subtitle_arrived",e.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",e.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",e.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",e.SEI_ARRIVED="sei_arrived",e.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",e.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",e.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",e.STATISTICS_INFO="statistics_info",e.RECOMMEND_SEEKPOINT="recommend_seekpoint"}(n||(n={}));const a=n},877(e,t,i){"use strict";i(641),i(540),i(816),i(403),i(217),i(824),i(726),i(117),i(270)},117(e,t,i){"use strict";var n;i.d(t,{A:()=>a}),function(e){e.ERROR="error",e.LOADING_COMPLETE="loading_complete",e.RECOVERED_EARLY_EOF="recovered_early_eof",e.MEDIA_INFO="media_info",e.METADATA_ARRIVED="metadata_arrived",e.SCRIPTDATA_ARRIVED="scriptdata_arrived",e.TRACKS_UPDATED="tracks_updated",e.TIMED_ID3_METADATA_ARRIVED="timed_id3_metadata_arrived",e.PGS_SUBTITLE_ARRIVED="pgs_subtitle_arrived",e.SYNCHRONOUS_KLV_METADATA_ARRIVED="synchronous_klv_metadata_arrived",e.ASYNCHRONOUS_KLV_METADATA_ARRIVED="asynchronous_klv_metadata_arrived",e.SMPTE2038_METADATA_ARRIVED="smpte2038_metadata_arrived",e.SEI_ARRIVED="sei_arrived",e.SCTE35_METADATA_ARRIVED="scte35_metadata_arrived",e.PES_PRIVATE_DATA_DESCRIPTOR="pes_private_data_descriptor",e.PES_PRIVATE_DATA_ARRIVED="pes_private_data_arrived",e.STATISTICS_INFO="statistics_info",e.DESTROYING="destroying"}(n||(n={}));const a=n}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,i),r.exports}return i.m=e,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(215)})());
|
|
3
3
|
//# sourceMappingURL=mpegts.js.map
|