-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
dash.mss.min.js
2 lines (2 loc) · 59.6 KB
/
dash.mss.min.js
1
2
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dashjs=e():t.dashjs=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist/",r(r.s=102)}({10:function(t,e,r){"use strict";e.a=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.code=e||null,this.message=r||null,this.data=n||null}},102:function(t,e,r){"use strict";r.r(e),function(t){var n=r(99);r.d(e,"MssHandler",(function(){return n.a}));var i="undefined"!=typeof window&&window||t,o=i.dashjs;o||(o=i.dashjs={}),o.MssHandler=n.a,e.default=o}.call(this,r(23))},103:function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},17:function(t,e,r){"use strict";var n=r(5);function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.action=t.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=e||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var e,r,o;return e=t,(r=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===n.a.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(t){this.type=t&&t.init?n.a.INIT_SEGMENT_TYPE:n.a.MEDIA_SEGMENT_TYPE,this.url=t&&t.url?t.url:null,this.range=t&&t.range?t.range.start+"-"+t.range.end:null,this.mediaType=t&&t.mediaType?t.mediaType:null}}])&&i(e.prototype,r),o&&i(e,o),t}();o.ACTION_DOWNLOAD="download",o.ACTION_COMPLETE="complete",e.a=o},18:function(t,e,r){"use strict";function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,i;return e=t,(r=[{key:"extend",value:function(t,e){if(t){var r=!!e&&e.override,n=!!e&&e.publicOnly;for(var i in t)!t.hasOwnProperty(i)||this[i]&&!r||n&&-1===t[i].indexOf("public_")||(this[i]=t[i])}}}])&&n(e.prototype,r),i&&n(e,i),t}();e.a=i},23:function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},28:function(t,e,r){"use strict";function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,i;return e=t,(r=[{key:"extend",value:function(t,e){if(t){var r=!!e&&e.override,n=!!e&&e.publicOnly;for(var i in t)!t.hasOwnProperty(i)||this[i]&&!r||n&&-1===t[i].indexOf("public_")||(this[i]=t[i])}}}])&&n(e.prototype,r),i&&n(e,i),t}();e.a=i},4:function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var u=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}(r,t);var e=o(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=e.call(this)).AST_IN_FUTURE="astInFuture",t.BUFFER_EMPTY="bufferStalled",t.BUFFER_LOADED="bufferLoaded",t.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",t.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",t.DYNAMIC_TO_STATIC="dynamicToStatic",t.ERROR="error",t.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",t.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",t.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",t.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",t.LOG="log",t.MANIFEST_LOADED="manifestLoaded",t.METRICS_CHANGED="metricsChanged",t.METRIC_CHANGED="metricChanged",t.METRIC_ADDED="metricAdded",t.METRIC_UPDATED="metricUpdated",t.PERIOD_SWITCH_STARTED="periodSwitchStarted",t.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",t.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",t.QUALITY_CHANGE_RENDERED="qualityChangeRendered",t.TRACK_CHANGE_RENDERED="trackChangeRendered",t.STREAM_INITIALIZING="streamInitializing",t.STREAM_UPDATED="streamUpdated",t.STREAM_ACTIVATED="streamActivated",t.STREAM_DEACTIVATED="streamDeactivated",t.STREAM_INITIALIZED="streamInitialized",t.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",t.TEXT_TRACKS_ADDED="allTextTracksAdded",t.TEXT_TRACK_ADDED="textTrackAdded",t.TTML_PARSED="ttmlParsed",t.TTML_TO_PARSE="ttmlToParse",t.CAPTION_RENDERED="captionRendered",t.CAPTION_CONTAINER_RESIZE="captionContainerResize",t.CAN_PLAY="canPlay",t.CAN_PLAY_THROUGH="canPlayThrough",t.PLAYBACK_ENDED="playbackEnded",t.PLAYBACK_ERROR="playbackError",t.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",t.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",t.PLAYBACK_LOADED_DATA="playbackLoadedData",t.PLAYBACK_PAUSED="playbackPaused",t.PLAYBACK_PLAYING="playbackPlaying",t.PLAYBACK_PROGRESS="playbackProgress",t.PLAYBACK_RATE_CHANGED="playbackRateChanged",t.PLAYBACK_SEEKED="playbackSeeked",t.PLAYBACK_SEEKING="playbackSeeking",t.PLAYBACK_STALLED="playbackStalled",t.PLAYBACK_STARTED="playbackStarted",t.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",t.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",t.PLAYBACK_WAITING="playbackWaiting",t.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",t.EVENT_MODE_ON_START="eventModeOnStart",t.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",t.CONFORMANCE_VIOLATION="conformanceViolation",t.REPRESENTATION_SWITCH="representationSwitch",t.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",t}return r}(r(18).a));e.a=u},5:function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));var i=function t(){n(this,t),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null},o=function t(){n(this,t),this.s=null,this.d=null,this.b=[]};i.GET="GET",i.HEAD="HEAD",i.MPD_TYPE="MPD",i.XLINK_EXPANSION_TYPE="XLinkExpansion",i.INIT_SEGMENT_TYPE="InitializationSegment",i.INDEX_SEGMENT_TYPE="IndexSegment",i.MEDIA_SEGMENT_TYPE="MediaSegment",i.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",i.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",i.DVB_REPORTING_TYPE="DVBReporting",i.LICENSE="license",i.OTHER_TYPE="other"},57:function(t,e,r){(function(t){var r,n=function(t){"use strict";var e=1e7,r=9007199254740992,i=f(r),o="function"==typeof BigInt;function a(t,e,r,n){return void 0===t?a[0]:void 0!==e&&(10!=+e||r)?k(t,e,r,n):V(t)}function s(t,e){this.value=t,this.sign=e,this.isSmall=!1}function u(t){this.value=t,this.sign=t<0,this.isSmall=!0}function l(t){this.value=t}function p(t){return-r<t&&t<r}function f(t){return t<1e7?[t]:t<1e14?[t%1e7,Math.floor(t/1e7)]:[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function c(t){d(t);var r=t.length;if(r<4&&N(t,i)<0)switch(r){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*e;default:return t[0]+(t[1]+t[2]*e)*e}return t}function d(t){for(var e=t.length;0===t[--e];);t.length=e+1}function h(t){for(var e=new Array(t),r=-1;++r<t;)e[r]=0;return e}function y(t){return t>0?Math.floor(t):Math.ceil(t)}function m(t,r){var n,i,o=t.length,a=r.length,s=new Array(o),u=0,l=e;for(i=0;i<a;i++)u=(n=t[i]+r[i]+u)>=l?1:0,s[i]=n-u*l;for(;i<o;)u=(n=t[i]+u)===l?1:0,s[i++]=n-u*l;return u>0&&s.push(u),s}function g(t,e){return t.length>=e.length?m(t,e):m(e,t)}function v(t,r){var n,i,o=t.length,a=new Array(o),s=e;for(i=0;i<o;i++)n=t[i]-s+r,r=Math.floor(n/s),a[i]=n-r*s,r+=1;for(;r>0;)a[i++]=r%s,r=Math.floor(r/s);return a}function _(t,e){var r,n,i=t.length,o=e.length,a=new Array(i),s=0;for(r=0;r<o;r++)(n=t[r]-s-e[r])<0?(n+=1e7,s=1):s=0,a[r]=n;for(r=o;r<i;r++){if(!((n=t[r]-s)<0)){a[r++]=n;break}n+=1e7,a[r]=n}for(;r<i;r++)a[r]=t[r];return d(a),a}function b(t,e,r){var n,i,o=t.length,a=new Array(o),l=-e;for(n=0;n<o;n++)i=t[n]+l,l=Math.floor(i/1e7),i%=1e7,a[n]=i<0?i+1e7:i;return"number"==typeof(a=c(a))?(r&&(a=-a),new u(a)):new s(a,r)}function T(t,e){var r,n,i,o,a=t.length,s=e.length,u=h(a+s);for(i=0;i<a;++i){o=t[i];for(var l=0;l<s;++l)r=o*e[l]+u[i+l],n=Math.floor(r/1e7),u[i+l]=r-1e7*n,u[i+l+1]+=n}return d(u),u}function E(t,r){var n,i,o=t.length,a=new Array(o),s=e,u=0;for(i=0;i<o;i++)n=t[i]*r+u,u=Math.floor(n/s),a[i]=n-u*s;for(;u>0;)a[i++]=u%s,u=Math.floor(u/s);return a}function A(t,e){for(var r=[];e-- >0;)r.push(0);return r.concat(t)}function S(t,r,n){return new s(t<e?E(r,t):T(r,f(t)),n)}function w(t){var e,r,n,i,o=t.length,a=h(o+o);for(n=0;n<o;n++){r=0-(i=t[n])*i;for(var s=n;s<o;s++)e=i*t[s]*2+a[n+s]+r,r=Math.floor(e/1e7),a[n+s]=e-1e7*r;a[n+o]=r}return d(a),a}function I(t,e){var r,n,i,o,a=t.length,s=h(a);for(i=0,r=a-1;r>=0;--r)i=(o=1e7*i+t[r])-(n=y(o/e))*e,s[r]=0|n;return[s,0|i]}function M(t,r){var n,i=V(r);if(o)return[new l(t.value/i.value),new l(t.value%i.value)];var p,m=t.value,g=i.value;if(0===g)throw new Error("Cannot divide by zero");if(t.isSmall)return i.isSmall?[new u(y(m/g)),new u(m%g)]:[a[0],t];if(i.isSmall){if(1===g)return[t,a[0]];if(-1==g)return[t.negate(),a[0]];var v=Math.abs(g);if(v<e){p=c((n=I(m,v))[0]);var b=n[1];return t.sign&&(b=-b),"number"==typeof p?(t.sign!==i.sign&&(p=-p),[new u(p),new u(b)]):[new s(p,t.sign!==i.sign),new u(b)]}g=f(v)}var T=N(m,g);if(-1===T)return[a[0],t];if(0===T)return[a[t.sign===i.sign?1:-1],a[0]];p=(n=m.length+g.length<=200?function(t,r){var n,i,o,a,s,u,l,p=t.length,f=r.length,d=e,y=h(r.length),m=r[f-1],g=Math.ceil(d/(2*m)),v=E(t,g),_=E(r,g);for(v.length<=p&&v.push(0),_.push(0),m=_[f-1],i=p-f;i>=0;i--){for(n=d-1,v[i+f]!==m&&(n=Math.floor((v[i+f]*d+v[i+f-1])/m)),o=0,a=0,u=_.length,s=0;s<u;s++)o+=n*_[s],l=Math.floor(o/d),a+=v[i+s]-(o-l*d),o=l,a<0?(v[i+s]=a+d,a=-1):(v[i+s]=a,a=0);for(;0!==a;){for(n-=1,o=0,s=0;s<u;s++)(o+=v[i+s]-d+_[s])<0?(v[i+s]=o+d,o=0):(v[i+s]=o,o=1);a+=o}y[i]=n}return v=I(v,g)[0],[c(y),c(v)]}(m,g):function(t,e){for(var r,n,i,o,a,s=t.length,u=e.length,l=[],p=[];s;)if(p.unshift(t[--s]),d(p),N(p,e)<0)l.push(0);else{i=1e7*p[(n=p.length)-1]+p[n-2],o=1e7*e[u-1]+e[u-2],n>u&&(i=1e7*(i+1)),r=Math.ceil(i/o);do{if(N(a=E(e,r),p)<=0)break;r--}while(r);l.push(r),p=_(p,a)}return l.reverse(),[c(l),c(p)]}(m,g))[0];var A=t.sign!==i.sign,S=n[1],w=t.sign;return"number"==typeof p?(A&&(p=-p),p=new u(p)):p=new s(p,A),"number"==typeof S?(w&&(S=-S),S=new u(S)):S=new s(S,w),[p,S]}function N(t,e){if(t.length!==e.length)return t.length>e.length?1:-1;for(var r=t.length-1;r>=0;r--)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return 0}function D(t){var e=t.abs();return!e.isUnit()&&(!!(e.equals(2)||e.equals(3)||e.equals(5))||!(e.isEven()||e.isDivisibleBy(3)||e.isDivisibleBy(5))&&(!!e.lesser(49)||void 0))}function P(t,e){for(var r,i,o,a=t.prev(),s=a,u=0;s.isEven();)s=s.divide(2),u++;t:for(i=0;i<e.length;i++)if(!t.lesser(e[i])&&!(o=n(e[i]).modPow(s,t)).isUnit()&&!o.equals(a)){for(r=u-1;0!=r;r--){if((o=o.square().mod(t)).isUnit())return!1;if(o.equals(a))continue t}return!1}return!0}s.prototype=Object.create(a.prototype),u.prototype=Object.create(a.prototype),l.prototype=Object.create(a.prototype),s.prototype.add=function(t){var e=V(t);if(this.sign!==e.sign)return this.subtract(e.negate());var r=this.value,n=e.value;return e.isSmall?new s(v(r,Math.abs(n)),this.sign):new s(g(r,n),this.sign)},s.prototype.plus=s.prototype.add,u.prototype.add=function(t){var e=V(t),r=this.value;if(r<0!==e.sign)return this.subtract(e.negate());var n=e.value;if(e.isSmall){if(p(r+n))return new u(r+n);n=f(Math.abs(n))}return new s(v(n,Math.abs(r)),r<0)},u.prototype.plus=u.prototype.add,l.prototype.add=function(t){return new l(this.value+V(t).value)},l.prototype.plus=l.prototype.add,s.prototype.subtract=function(t){var e=V(t);if(this.sign!==e.sign)return this.add(e.negate());var r=this.value,n=e.value;return e.isSmall?b(r,Math.abs(n),this.sign):function(t,e,r){var n;return N(t,e)>=0?n=_(t,e):(n=_(e,t),r=!r),"number"==typeof(n=c(n))?(r&&(n=-n),new u(n)):new s(n,r)}(r,n,this.sign)},s.prototype.minus=s.prototype.subtract,u.prototype.subtract=function(t){var e=V(t),r=this.value;if(r<0!==e.sign)return this.add(e.negate());var n=e.value;return e.isSmall?new u(r-n):b(n,Math.abs(r),r>=0)},u.prototype.minus=u.prototype.subtract,l.prototype.subtract=function(t){return new l(this.value-V(t).value)},l.prototype.minus=l.prototype.subtract,s.prototype.negate=function(){return new s(this.value,!this.sign)},u.prototype.negate=function(){var t=this.sign,e=new u(-this.value);return e.sign=!t,e},l.prototype.negate=function(){return new l(-this.value)},s.prototype.abs=function(){return new s(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},l.prototype.abs=function(){return new l(this.value>=0?this.value:-this.value)},s.prototype.multiply=function(t){var r,n,i,o=V(t),u=this.value,l=o.value,p=this.sign!==o.sign;if(o.isSmall){if(0===l)return a[0];if(1===l)return this;if(-1===l)return this.negate();if((r=Math.abs(l))<e)return new s(E(u,r),p);l=f(r)}return n=u.length,i=l.length,new s(-.012*n-.012*i+15e-6*n*i>0?function t(e,r){var n=Math.max(e.length,r.length);if(n<=30)return T(e,r);n=Math.ceil(n/2);var i=e.slice(n),o=e.slice(0,n),a=r.slice(n),s=r.slice(0,n),u=t(o,s),l=t(i,a),p=t(g(o,i),g(s,a)),f=g(g(u,A(_(_(p,u),l),n)),A(l,2*n));return d(f),f}(u,l):T(u,l),p)},s.prototype.times=s.prototype.multiply,u.prototype._multiplyBySmall=function(t){return p(t.value*this.value)?new u(t.value*this.value):S(Math.abs(t.value),f(Math.abs(this.value)),this.sign!==t.sign)},s.prototype._multiplyBySmall=function(t){return 0===t.value?a[0]:1===t.value?this:-1===t.value?this.negate():S(Math.abs(t.value),this.value,this.sign!==t.sign)},u.prototype.multiply=function(t){return V(t)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,l.prototype.multiply=function(t){return new l(this.value*V(t).value)},l.prototype.times=l.prototype.multiply,s.prototype.square=function(){return new s(w(this.value),!1)},u.prototype.square=function(){var t=this.value*this.value;return p(t)?new u(t):new s(w(f(Math.abs(this.value))),!1)},l.prototype.square=function(t){return new l(this.value*this.value)},s.prototype.divmod=function(t){var e=M(this,t);return{quotient:e[0],remainder:e[1]}},l.prototype.divmod=u.prototype.divmod=s.prototype.divmod,s.prototype.divide=function(t){return M(this,t)[0]},l.prototype.over=l.prototype.divide=function(t){return new l(this.value/V(t).value)},u.prototype.over=u.prototype.divide=s.prototype.over=s.prototype.divide,s.prototype.mod=function(t){return M(this,t)[1]},l.prototype.mod=l.prototype.remainder=function(t){return new l(this.value%V(t).value)},u.prototype.remainder=u.prototype.mod=s.prototype.remainder=s.prototype.mod,s.prototype.pow=function(t){var e,r,n,i=V(t),o=this.value,s=i.value;if(0===s)return a[1];if(0===o)return a[0];if(1===o)return a[1];if(-1===o)return i.isEven()?a[1]:a[-1];if(i.sign)return a[0];if(!i.isSmall)throw new Error("The exponent "+i.toString()+" is too large.");if(this.isSmall&&p(e=Math.pow(o,s)))return new u(y(e));for(r=this,n=a[1];!0&s&&(n=n.times(r),--s),0!==s;)s/=2,r=r.square();return n},u.prototype.pow=s.prototype.pow,l.prototype.pow=function(t){var e=V(t),r=this.value,n=e.value,i=BigInt(0),o=BigInt(1),s=BigInt(2);if(n===i)return a[1];if(r===i)return a[0];if(r===o)return a[1];if(r===BigInt(-1))return e.isEven()?a[1]:a[-1];if(e.isNegative())return new l(i);for(var u=this,p=a[1];(n&o)===o&&(p=p.times(u),--n),n!==i;)n/=s,u=u.square();return p},s.prototype.modPow=function(t,e){if(t=V(t),(e=V(e)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var r=a[1],n=this.mod(e);t.isPositive();){if(n.isZero())return a[0];t.isOdd()&&(r=r.multiply(n).mod(e)),t=t.divide(2),n=n.square().mod(e)}return r},l.prototype.modPow=u.prototype.modPow=s.prototype.modPow,s.prototype.compareAbs=function(t){var e=V(t),r=this.value,n=e.value;return e.isSmall?1:N(r,n)},u.prototype.compareAbs=function(t){var e=V(t),r=Math.abs(this.value),n=e.value;return e.isSmall?r===(n=Math.abs(n))?0:r>n?1:-1:-1},l.prototype.compareAbs=function(t){var e=this.value,r=V(t).value;return(e=e>=0?e:-e)===(r=r>=0?r:-r)?0:e>r?1:-1},s.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=V(t),r=this.value,n=e.value;return this.sign!==e.sign?e.sign?1:-1:e.isSmall?this.sign?-1:1:N(r,n)*(this.sign?-1:1)},s.prototype.compareTo=s.prototype.compare,u.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=V(t),r=this.value,n=e.value;return e.isSmall?r==n?0:r>n?1:-1:r<0!==e.sign?r<0?-1:1:r<0?1:-1},u.prototype.compareTo=u.prototype.compare,l.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=this.value,r=V(t).value;return e===r?0:e>r?1:-1},l.prototype.compareTo=l.prototype.compare,s.prototype.equals=function(t){return 0===this.compare(t)},l.prototype.eq=l.prototype.equals=u.prototype.eq=u.prototype.equals=s.prototype.eq=s.prototype.equals,s.prototype.notEquals=function(t){return 0!==this.compare(t)},l.prototype.neq=l.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=s.prototype.neq=s.prototype.notEquals,s.prototype.greater=function(t){return this.compare(t)>0},l.prototype.gt=l.prototype.greater=u.prototype.gt=u.prototype.greater=s.prototype.gt=s.prototype.greater,s.prototype.lesser=function(t){return this.compare(t)<0},l.prototype.lt=l.prototype.lesser=u.prototype.lt=u.prototype.lesser=s.prototype.lt=s.prototype.lesser,s.prototype.greaterOrEquals=function(t){return this.compare(t)>=0},l.prototype.geq=l.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=s.prototype.geq=s.prototype.greaterOrEquals,s.prototype.lesserOrEquals=function(t){return this.compare(t)<=0},l.prototype.leq=l.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=s.prototype.leq=s.prototype.lesserOrEquals,s.prototype.isEven=function(){return 0==(1&this.value[0])},u.prototype.isEven=function(){return 0==(1&this.value)},l.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},s.prototype.isOdd=function(){return 1==(1&this.value[0])},u.prototype.isOdd=function(){return 1==(1&this.value)},l.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},s.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},l.prototype.isPositive=u.prototype.isPositive,s.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},l.prototype.isNegative=u.prototype.isNegative,s.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return 1===Math.abs(this.value)},l.prototype.isUnit=function(){return this.abs().value===BigInt(1)},s.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return 0===this.value},l.prototype.isZero=function(){return this.value===BigInt(0)},s.prototype.isDivisibleBy=function(t){var e=V(t);return!e.isZero()&&(!!e.isUnit()||(0===e.compareAbs(2)?this.isEven():this.mod(e).isZero()))},l.prototype.isDivisibleBy=u.prototype.isDivisibleBy=s.prototype.isDivisibleBy,s.prototype.isPrime=function(t){var e=D(this);if(void 0!==e)return e;var r=this.abs(),i=r.bitLength();if(i<=64)return P(r,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*i.toJSNumber(),a=Math.ceil(!0===t?2*Math.pow(o,2):o),s=[],u=0;u<a;u++)s.push(n(u+2));return P(r,s)},l.prototype.isPrime=u.prototype.isPrime=s.prototype.isPrime,s.prototype.isProbablePrime=function(t){var e=D(this);if(void 0!==e)return e;for(var r=this.abs(),i=void 0===t?5:t,o=[],a=0;a<i;a++)o.push(n.randBetween(2,r.minus(2)));return P(r,o)},l.prototype.isProbablePrime=u.prototype.isProbablePrime=s.prototype.isProbablePrime,s.prototype.modInv=function(t){for(var e,r,i,o=n.zero,a=n.one,s=V(t),u=this.abs();!u.isZero();)e=s.divide(u),r=o,i=s,o=a,s=u,a=r.subtract(e.multiply(a)),u=i.subtract(e.multiply(u));if(!s.isUnit())throw new Error(this.toString()+" and "+t.toString()+" are not co-prime");return-1===o.compare(0)&&(o=o.add(t)),this.isNegative()?o.negate():o},l.prototype.modInv=u.prototype.modInv=s.prototype.modInv,s.prototype.next=function(){var t=this.value;return this.sign?b(t,1,this.sign):new s(v(t,1),this.sign)},u.prototype.next=function(){var t=this.value;return t+1<r?new u(t+1):new s(i,!1)},l.prototype.next=function(){return new l(this.value+BigInt(1))},s.prototype.prev=function(){var t=this.value;return this.sign?new s(v(t,1),!0):b(t,1,this.sign)},u.prototype.prev=function(){var t=this.value;return t-1>-r?new u(t-1):new s(i,!0)},l.prototype.prev=function(){return new l(this.value-BigInt(1))};for(var C=[1];2*C[C.length-1]<=e;)C.push(2*C[C.length-1]);var O=C.length,x=C[O-1];function B(t){return Math.abs(t)<=e}function F(t,e,r){e=V(e);for(var i=t.isNegative(),o=e.isNegative(),a=i?t.not():t,s=o?e.not():e,u=0,l=0,p=null,f=null,c=[];!a.isZero()||!s.isZero();)u=(p=M(a,x))[1].toJSNumber(),i&&(u=x-1-u),l=(f=M(s,x))[1].toJSNumber(),o&&(l=x-1-l),a=p[0],s=f[0],c.push(r(u,l));for(var d=0!==r(i?1:0,o?1:0)?n(-1):n(0),h=c.length-1;h>=0;h-=1)d=d.multiply(x).add(n(c[h]));return d}s.prototype.shiftLeft=function(t){var e=V(t).toJSNumber();if(!B(e))throw new Error(String(e)+" is too large for shifting.");if(e<0)return this.shiftRight(-e);var r=this;if(r.isZero())return r;for(;e>=O;)r=r.multiply(x),e-=O-1;return r.multiply(C[e])},l.prototype.shiftLeft=u.prototype.shiftLeft=s.prototype.shiftLeft,s.prototype.shiftRight=function(t){var e,r=V(t).toJSNumber();if(!B(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var n=this;r>=O;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(e=M(n,x))[1].isNegative()?e[0].prev():e[0],r-=O-1}return(e=M(n,C[r]))[1].isNegative()?e[0].prev():e[0]},l.prototype.shiftRight=u.prototype.shiftRight=s.prototype.shiftRight,s.prototype.not=function(){return this.negate().prev()},l.prototype.not=u.prototype.not=s.prototype.not,s.prototype.and=function(t){return F(this,t,(function(t,e){return t&e}))},l.prototype.and=u.prototype.and=s.prototype.and,s.prototype.or=function(t){return F(this,t,(function(t,e){return t|e}))},l.prototype.or=u.prototype.or=s.prototype.or,s.prototype.xor=function(t){return F(this,t,(function(t,e){return t^e}))},l.prototype.xor=u.prototype.xor=s.prototype.xor;function R(t){var r=t.value,n="number"==typeof r?r|1<<30:"bigint"==typeof r?r|BigInt(1<<30):r[0]+r[1]*e|1073758208;return n&-n}function L(t,e){return t=V(t),e=V(e),t.greater(e)?t:e}function q(t,e){return t=V(t),e=V(e),t.lesser(e)?t:e}function U(t,e){if(t=V(t).abs(),e=V(e).abs(),t.equals(e))return t;if(t.isZero())return e;if(e.isZero())return t;for(var r,n,i=a[1];t.isEven()&&e.isEven();)r=q(R(t),R(e)),t=t.divide(r),e=e.divide(r),i=i.multiply(r);for(;t.isEven();)t=t.divide(R(t));do{for(;e.isEven();)e=e.divide(R(e));t.greater(e)&&(n=e,e=t,t=n),e=e.subtract(t)}while(!e.isZero());return i.isUnit()?t:t.multiply(i)}s.prototype.bitLength=function(){var t=this;return t.compareTo(n(0))<0&&(t=t.negate().subtract(n(1))),0===t.compareTo(n(0))?n(0):n(function t(e,r){if(r.compareTo(e)<=0){var i=t(e,r.square(r)),o=i.p,a=i.e,s=o.multiply(r);return s.compareTo(e)<=0?{p:s,e:2*a+1}:{p:o,e:2*a}}return{p:n(1),e:0}}(t,n(2)).e).add(n(1))},l.prototype.bitLength=u.prototype.bitLength=s.prototype.bitLength;var k=function(t,e,r,n){r=r||"0123456789abcdefghijklmnopqrstuvwxyz",t=String(t),n||(t=t.toLowerCase(),r=r.toLowerCase());var i,o=t.length,a=Math.abs(e),s={};for(i=0;i<r.length;i++)s[r[i]]=i;for(i=0;i<o;i++){if("-"!==(p=t[i])&&(p in s&&s[p]>=a)){if("1"===p&&1===a)continue;throw new Error(p+" is not a valid digit in base "+e+".")}}e=V(e);var u=[],l="-"===t[0];for(i=l?1:0;i<t.length;i++){var p;if((p=t[i])in s)u.push(V(s[p]));else{if("<"!==p)throw new Error(p+" is not a valid character");var f=i;do{i++}while(">"!==t[i]&&i<t.length);u.push(V(t.slice(f+1,i)))}}return G(u,e,l)};function G(t,e,r){var n,i=a[0],o=a[1];for(n=t.length-1;n>=0;n--)i=i.add(t[n].times(o)),o=o.times(e);return r?i.negate():i}function j(t,e){if((e=n(e)).isZero()){if(t.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(e.equals(-1)){if(t.isZero())return{value:[0],isNegative:!1};if(t.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-t.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(t.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(t.isNegative()&&e.isPositive()&&(i=!0,t=t.abs()),e.isUnit())return t.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(t.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:i};for(var o,a=[],s=t;s.isNegative()||s.compareAbs(e)>=0;){o=s.divmod(e),s=o.quotient;var u=o.remainder;u.isNegative()&&(u=e.minus(u).abs(),s=s.next()),a.push(u.toJSNumber())}return a.push(s.toJSNumber()),{value:a.reverse(),isNegative:i}}function Y(t,e,r){var n=j(t,e);return(n.isNegative?"-":"")+n.value.map((function(t){return function(t,e){return t<(e=e||"0123456789abcdefghijklmnopqrstuvwxyz").length?e[t]:"<"+t+">"}(t,r)})).join("")}function H(t){if(p(+t)){var e=+t;if(e===y(e))return o?new l(BigInt(e)):new u(e);throw new Error("Invalid integer: "+t)}var r="-"===t[0];r&&(t=t.slice(1));var n=t.split(/e/i);if(n.length>2)throw new Error("Invalid integer: "+n.join("e"));if(2===n.length){var i=n[1];if("+"===i[0]&&(i=i.slice(1)),(i=+i)!==y(i)||!p(i))throw new Error("Invalid integer: "+i+" is not a valid exponent.");var a=n[0],f=a.indexOf(".");if(f>=0&&(i-=a.length-f-1,a=a.slice(0,f)+a.slice(f+1)),i<0)throw new Error("Cannot include negative exponent part for integers");t=a+=new Array(i+1).join("0")}if(!/^([0-9][0-9]*)$/.test(t))throw new Error("Invalid integer: "+t);if(o)return new l(BigInt(r?"-"+t:t));for(var c=[],h=t.length,m=h-7;h>0;)c.push(+t.slice(m,h)),(m-=7)<0&&(m=0),h-=7;return d(c),new s(c,r)}function V(t){return"number"==typeof t?function(t){if(o)return new l(BigInt(t));if(p(t)){if(t!==y(t))throw new Error(t+" is not an integer.");return new u(t)}return H(t.toString())}(t):"string"==typeof t?H(t):"bigint"==typeof t?new l(t):t}s.prototype.toArray=function(t){return j(this,t)},u.prototype.toArray=function(t){return j(this,t)},l.prototype.toArray=function(t){return j(this,t)},s.prototype.toString=function(t,e){if(void 0===t&&(t=10),10!==t)return Y(this,t,e);for(var r,n=this.value,i=n.length,o=String(n[--i]);--i>=0;)r=String(n[i]),o+="0000000".slice(r.length)+r;return(this.sign?"-":"")+o},u.prototype.toString=function(t,e){return void 0===t&&(t=10),10!=t?Y(this,t,e):String(this.value)},l.prototype.toString=u.prototype.toString,l.prototype.toJSON=s.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},s.prototype.valueOf=function(){return parseInt(this.toString(),10)},s.prototype.toJSNumber=s.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,l.prototype.valueOf=l.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var K=0;K<1e3;K++)a[K]=V(K),K>0&&(a[-K]=V(-K));return a.one=a[1],a.zero=a[0],a.minusOne=a[-1],a.max=L,a.min=q,a.gcd=U,a.lcm=function(t,e){return t=V(t).abs(),e=V(e).abs(),t.divide(U(t,e)).multiply(e)},a.isInstance=function(t){return t instanceof s||t instanceof u||t instanceof l},a.randBetween=function(t,r){var n=q(t=V(t),r=V(r)),i=L(t,r).subtract(n).add(1);if(i.isSmall)return n.add(Math.floor(Math.random()*i));for(var o=j(i,e).value,s=[],u=!0,l=0;l<o.length;l++){var p=u?o[l]:e,f=y(Math.random()*p);s.push(f),f<p&&(u=!1)}return n.add(a.fromArray(s,e,!1))},a.fromArray=function(t,e,r){return G(t.map(V),V(e||10),r)},a}();t.hasOwnProperty("exports")&&(t.exports=n),void 0===(r=function(){return n}.apply(e,[]))||(t.exports=r)}).call(this,r(103)(t))},59:function(t,e,r){"use strict";e.a=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},99:function(t,e,r){"use strict";var n=r(59),i=r(17),o=r(5);function a(t){var e,r,n,a,s,u,l,p,f,c=(t=t||{}).streamProcessor,d=t.baseURLController,h=t.debug;function y(){a&&(r.debug("Stop"),clearTimeout(u),a=!1,l=null,p=null)}function m(){if(a){var t=c.getRepresentationController().getCurrentRepresentation(),e=t.adaptation.period.mpd.manifest.Period_asArray[t.adaptation.period.index].AdaptationSet_asArray[t.adaptation.index],r=e.SegmentTemplate.SegmentTimeline.S_asArray,n=function(t,e,r){var n=t.SegmentTemplate.timescale,a=new i.a;return a.mediaType=s,a.type=o.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE,a.startTime=r.t/n,a.duration=r.d/n,a.timescale=n,a.quality=e.index,a.index=f++,a.mediaInfo=c.getMediaInfo(),a.adaptationIndex=e.adaptation.index,a.representationId=e.id,a.url=d.resolve(e.path).url+t.SegmentTemplate.media,a.url=a.url.replace("$Bandwidth$",e.bandwidth),a.url=a.url.replace("$Time$",r.tManifest?r.tManifest:r.t),a.url=a.url.replace("/Fragments(","/FragmentInfo("),a}(e,t,r[r.length-1]);g.call(this,n)}}function g(t){if(c.getFragmentModel().isFragmentLoadedOrPending(t))return r.debug("End of timeline"),void y();n.executeRequest(t)}return e={initialize:function(){s=c.getType(),n=c.getFragmentModel(),a=!1,l=null,p=null},controllerType:"MssFragmentInfoController",start:function(){a||(r.debug("Start"),a=!0,f=0,m())},fragmentInfoLoaded:function(t){if(a){var e,n,i,o=t.request;if(t.response)null===l&&(l=(new Date).getTime()),p||(p=o.startTime),n=((new Date).getTime()-l)/1e3,e=o.startTime+o.duration-p,i=Math.max(0,e-n),clearTimeout(u),u=setTimeout((function(){u=null,m()}),1e3*i);else r.error("Load error",o.url)}},getType:function(){return s},reset:function(){y()}},r=h.getLogger(e),e}a.__dashjs_factory_name="MssFragmentInfoController";var s=dashjs.FactoryMaker.getClassFactory(a),u=r(10);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=d(t);if(e){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function c(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h=new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(r,t);var e=f(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=e.call(this)).MSS_NO_TFRF_CODE=200,t.MSS_UNSUPPORTED_CODEC_CODE=201,t.MSS_NO_TFRF_MESSAGE="Missing tfrf in live media segment",t.MSS_UNSUPPORTED_CODEC_MESSAGE="Unsupported codec",t}return r}(r(28).a)),y=r(4);function m(t){var e,r,n,i=(t=t||{}).dashMetrics,o=t.playbackController,a=t.errHandler,s=t.eventBus,l=t.ISOBoxer,p=t.debug;function f(t,e,i,l){var p=l.getRepresentationController().getCurrentRepresentation(),f=p.adaptation.period.mpd.manifest,d=f.Period_asArray[p.adaptation.period.index].AdaptationSet_asArray[p.adaptation.index],m=d.SegmentTemplate.timescale;if(r=l.getType(),"dynamic"===f.type||f.timeShiftBufferDepth)if(e){var g,v,_,b,T=d.SegmentTemplate.SegmentTimeline.S,E=e.entry,A=null,S=null;if(0!==E.length&&(g=E[0],!("static"===f.type&&(v=T[0].tManifest?parseFloat(T[0].tManifest):T[0].t,g.fragment_absolute_time>v+f.timeShiftBufferDepth*m)))){if(v=T[T.length-1].tManifest?parseFloat(T[T.length-1].tManifest):T[T.length-1].t,g.fragment_absolute_time<=v)return _={start:T[0].t/m,end:i.baseMediaDecodeTime/m+t.duration},void c(t.mediaType,_,l.getStreamInfo().manifestInfo);(A={}).t=g.fragment_absolute_time,A.d=g.fragment_duration,T[0].tManifest&&(A.t-=parseFloat(T[0].tManifest)-T[0].t,A.tManifest=g.fragment_absolute_time);var w=T[T.length-1];if(w.t+w.d!==A.t&&(n.debug("Patch segment duration - t = ",w.t+", d = "+w.d+" => "+(A.t-w.t)),w.d=A.t-w.t),T.push(A),"static"!==f.type){if(f.timeShiftBufferDepth&&f.timeShiftBufferDepth>0)for(S=((A=T[T.length-1]).t-f.timeShiftBufferDepth*m)/m,b=((A=T[0]).t+A.d)/m;b<S&&(o.isPaused()||!(o.getTime()<b));)T.splice(0,1),b=((A=T[0]).t+A.d)/m;_={start:T[0].t/m,end:i.baseMediaDecodeTime/m+t.duration},c(r,_,l.getStreamInfo().manifestInfo)}else"video"===r&&(b=((A=T[T.length-1]).t+A.d)/m)>p.adaptation.period.duration&&s.trigger(y.a.MANIFEST_VALIDITY_CHANGED,{sender:this,newDuration:b})}}else a.error(new u.a(h.MSS_NO_TFRF_CODE,h.MSS_NO_TFRF_MESSAGE))}function c(t,e,r){if("video"===t||"audio"===t){var a=i.getCurrentDVRInfo(t);(!a||e.end>a.range.end)&&(n.debug("Update DVR range: ["+e.start+" - "+e.end+"]"),i.addDVRInfo(t,o.getTime(),r,e),o.updateCurrentTime(t))}}function d(t,e){var r=8,n=0;for(n=0;n<t.boxes.length;n++){if(t.boxes[n].type===e)return r;r+=t.boxes[n].size}return r}return e={convertFragment:function(t,e){var r,n=l.parseBuffer(t.response),i=n.fetch("tfhd");i.track_ID=t.request.mediaInfo.index+1;var o=n.fetch("tfdt"),a=n.fetch("traf");null===o&&((o=l.createFullBox("tfdt",a,i)).version=1,o.flags=0,o.baseMediaDecodeTime=Math.floor(t.request.startTime*t.request.timescale));var s=n.fetch("trun"),u=n.fetch("tfxd");u&&(u._parent.boxes.splice(u._parent.boxes.indexOf(u),1),u=null);var p=n.fetch("tfrf");f(t.request,p,o,e),p&&(p._parent.boxes.splice(p._parent.boxes.indexOf(p),1),p=null);var c=n.fetch("sepiff");if(null!==c){c.type="senc",c.usertype=void 0;var h=n.fetch("saio");if(null===h){(h=l.createFullBox("saio",a)).version=0,h.flags=0,h.entry_count=1,h.offset=[0];var y=l.createFullBox("saiz",a);if(y.version=0,y.flags=0,y.sample_count=c.sample_count,y.default_sample_info_size=0,y.sample_info_size=[],2&c.flags)for(r=0;r<c.sample_count;r+=1)y.sample_info_size[r]=10+6*c.entry[r].NumberOfEntries;else y.default_sample_info_size=8}}i.flags&=16777214,i.flags|=131072,s.flags|=1;var m=n.fetch("moof"),g=m.getLength();s.data_offset=g+8;var v=n.fetch("saio");if(null!==v){var _=d(m,"traf"),b=d(a,"senc");v.offset[0]=_+b+16}t.response=n.write()},updateSegmentList:function(t,e){if(!t.response)throw new Error("e.response parameter is missing");var r=l.parseBuffer(t.response),n=r.fetch("tfhd");n.track_ID=t.request.mediaInfo.index+1;var i=r.fetch("tfdt"),o=r.fetch("traf");null===i&&((i=l.createFullBox("tfdt",o,n)).version=1,i.flags=0,i.baseMediaDecodeTime=Math.floor(t.request.startTime*t.request.timescale));var a=r.fetch("tfrf");f(t.request,a,i,e),a&&(a._parent.boxes.splice(a._parent.boxes.indexOf(a),1),a=null)},getType:function(){return r}},n=p.getLogger(e),r="",e}m.__dashjs_factory_name="MssFragmentMoofProcessor";var g=dashjs.FactoryMaker.getClassFactory(m);function v(t){var e,r,n,i,o,a,s=(t=t||{}).constants,u=t.ISOBoxer,l=t.protectionController;function p(t){var p=u.createBox("moov",t);!function(t){var r=u.createFullBox("mvhd",t);r.version=1,r.creation_time=0,r.modification_time=0,r.timescale=o,r.duration=e.duration===1/0?0x10000000000000000:Math.round(e.duration*o),r.rate=1,r.volume=1,r.reserved1=0,r.reserved2=[0,0],r.matrix=[1,0,0,0,1,0,0,0,16384],r.pre_defined=[0,0,0,0,0,0],r.next_track_ID=a+1}(p);var m=u.createBox("trak",p);!function(t){var r=u.createFullBox("tkhd",t);r.version=1,r.flags=7,r.creation_time=0,r.modification_time=0,r.track_ID=a,r.reserved1=0,r.duration=e.duration===1/0?0x10000000000000000:Math.round(e.duration*o),r.reserved2=[0,0],r.layer=0,r.alternate_group=0,r.volume=1,r.reserved3=0,r.matrix=[1,0,0,0,1,0,0,0,16384],r.width=n.width,r.height=n.height}(m);var g=u.createBox("mdia",m);!function(t){var n=u.createFullBox("mdhd",t);n.version=1,n.creation_time=0,n.modification_time=0,n.timescale=o,n.duration=e.duration===1/0?0x10000000000000000:Math.round(e.duration*o),n.language=r.lang||"und",n.pre_defined=0}(g),function(t){var e=u.createFullBox("hdlr",t);switch(e.pre_defined=0,r.type){case s.VIDEO:e.handler_type="vide";break;case s.AUDIO:e.handler_type="soun";break;default:e.handler_type="meta"}e.name=n.id,e.reserved=[0,0,0]}(g);var v=u.createBox("minf",g);switch(r.type){case s.VIDEO:!function(t){var e=u.createFullBox("vmhd",t);e.flags=1,e.graphicsmode=0,e.opcolor=[0,0,0]}(v);break;case s.AUDIO:!function(t){var e=u.createFullBox("smhd",t);e.flags=1,e.balance=0,e.reserved=0}(v)}!function(t){var e=u.createFullBox("dref",t);e.entry_count=1,e.entries=[];var r=u.createFullBox("url ",e,!1);r.location="",r.flags=1,e.entries.push(r)}(u.createBox("dinf",v));var _=u.createBox("stbl",v);(u.createFullBox("stts",_)._data=[0,0,0,0,0,0,0,0],u.createFullBox("stsc",_)._data=[0,0,0,0,0,0,0,0],u.createFullBox("stco",_)._data=[0,0,0,0,0,0,0,0],u.createFullBox("stsz",_)._data=[0,0,0,0,0,0,0,0,0,0,0,0],function(t){var e=u.createFullBox("stsd",t);switch(e.entries=[],r.type){case s.VIDEO:case s.AUDIO:e.entries.push(function(t){var e=n.codecs.substring(0,n.codecs.indexOf("."));switch(e){case"avc1":return function(t,e){var r;r=i?u.createBox("encv",t,!1):u.createBox("avc1",t,!1);if(r.reserved1=[0,0,0,0,0,0],r.data_reference_index=1,r.pre_defined1=0,r.reserved2=0,r.pre_defined2=[0,0,0],r.height=n.height,r.width=n.width,r.horizresolution=72,r.vertresolution=72,r.reserved3=0,r.frame_count=1,r.compressorname=[10,65,86,67,32,67,111,100,105,110,103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r.depth=24,r.pre_defined3=65535,r.config=function(){for(var t,e=null,r=15,i=[],o=[],a=0,s=0,u=0,l=n.codecPrivateData.split("00000001").slice(1),p=0;p<l.length;p++)switch(t=y(l[p]),31&t[0]){case 7:i.push(t),r+=t.length+2;break;case 8:o.push(t),r+=t.length+2}i.length>0&&(a=i[0][1],u=i[0][2],s=i[0][3]);e=new Uint8Array(r);var f=0;e[f++]=(4278190080&r)>>24,e[f++]=(16711680&r)>>16,e[f++]=(65280&r)>>8,e[f++]=255&r,e.set([97,118,99,67],f),f+=4,e[f++]=1,e[f++]=a,e[f++]=u,e[f++]=s,e[f++]=255,e[f++]=224|i.length;for(var c=0;c<i.length;c++)e[f++]=(65280&i[c].length)>>8,e[f++]=255&i[c].length,e.set(i[c],f),f+=i[c].length;e[f++]=o.length;for(var d=0;d<o.length;d++)e[f++]=(65280&o[d].length)>>8,e[f++]=255&o[d].length,e.set(o[d],f),f+=o[d].length;return e}(),i){var o=u.createBox("sinf",r);f(o,e),c(o),d(o)}return r}(t,e);case"mp4a":return function(t,e){var r;r=i?u.createBox("enca",t,!1):u.createBox("mp4a",t,!1);if(r.reserved1=[0,0,0,0,0,0],r.data_reference_index=1,r.reserved2=[0,0],r.channelcount=n.audioChannels,r.samplesize=16,r.pre_defined=0,r.reserved_3=0,r.samplerate=n.audioSamplingRate<<16,r.esds=function(){var t=y(n.codecPrivateData),e=34+t.length,r=new Uint8Array(e),i=0;return r[i++]=(4278190080&e)>>24,r[i++]=(16711680&e)>>16,r[i++]=(65280&e)>>8,r[i++]=255&e,r.set([101,115,100,115],i),i+=4,r.set([0,0,0,0],i),i+=4,r[i++]=3,r[i++]=20+t.length,r[i++]=(65280&a)>>8,r[i++]=255&a,r[i++]=0,r[i++]=4,r[i++]=15+t.length,r[i++]=64,r[i]=20,r[i]|=0,r[i++]|=1,r[i++]=255,r[i++]=255,r[i++]=255,r[i++]=(4278190080&n.bandwidth)>>24,r[i++]=(16711680&n.bandwidth)>>16,r[i++]=(65280&n.bandwidth)>>8,r[i++]=255&n.bandwidth,r[i++]=(4278190080&n.bandwidth)>>24,r[i++]=(16711680&n.bandwidth)>>16,r[i++]=(65280&n.bandwidth)>>8,r[i++]=255&n.bandwidth,r[i++]=5,r[i++]=t.length,r.set(t,i),r}(),i){var o=u.createBox("sinf",r);f(o,e),c(o),d(o)}return r}(t,e);default:throw{code:h.MSS_UNSUPPORTED_CODEC_CODE,message:h.MSS_UNSUPPORTED_CODEC_MESSAGE,data:{codec:e}}}}(e))}e.entry_count=e.entries.length}(_),function(t){var e=u.createFullBox("trex",t);e.track_ID=a,e.default_sample_description_index=1,e.default_sample_duration=0,e.default_sample_size=0,e.default_sample_flags=0}(u.createBox("mvex",p)),i&&l)&&function(t,e){var r,n,i,o;for(i=0;i<e.length;i+=1)(r=e[i].initData)&&(o=u.parseBuffer(r),(n=o.fetch("pssh"))&&u.Utils.appendBox(t,n))}(p,l.getSupportedKeySystemsFromContentProtection(i))}function f(t,e){u.createBox("frma",t).data_format=function(t){var e,r=0;for(e=0;e<t.length;e+=1)r|=t.charCodeAt(e)<<8*(t.length-e-1);return r}(e)}function c(t){var e=u.createFullBox("schm",t);e.flags=0,e.version=0,e.scheme_type=1667591779,e.scheme_version=65536}function d(t){!function(t){var e=u.createFullBox("tenc",t);e.flags=0,e.version=0,e.default_IsEncrypted=1,e.default_IV_size=8,e.default_KID=i&&i.length>0&&i[0]["cenc:default_KID"]?i[0]["cenc:default_KID"]:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}(u.createBox("schi",t))}function y(t){var e,r=new Uint8Array(t.length/2);for(e=0;e<t.length/2;e+=1)r[e]=parseInt(""+t[2*e]+t[2*e+1],16);return r}return{generateMoov:function(t){var s;if(t&&t.adaptation)return r=(n=t).adaptation,e=r.period,a=r.index+1,i=e.mpd.manifest.Period_asArray[e.index].AdaptationSet_asArray[r.index].ContentProtection,o=e.mpd.manifest.Period_asArray[e.index].AdaptationSet_asArray[r.index].SegmentTemplate.timescale,function(t){var e=u.createBox("ftyp",t);e.major_brand="iso6",e.minor_version=1,e.compatible_brands=[],e.compatible_brands[0]="isom",e.compatible_brands[1]="iso6",e.compatible_brands[2]="msdh"}(s=u.createFile()),p(s),s.write()}}}v.__dashjs_factory_name="MssFragmentMoovProcessor";var _=dashjs.FactoryMaker.getClassFactory(v);function b(t,e){return t.length===e.length&&t.every((function(t,r){return t===e[r]}))}function T(){this._procFullBox(),1&this.flags&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32)),this._procField("entry_count","uint",32),this._procFieldArray("offset",this.entry_count,"uint",1===this.version?64:32)}function E(){this._procFullBox(),1&this.flags&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32)),this._procField("default_sample_info_size","uint",8),this._procField("sample_count","uint",32),0===this.default_sample_info_size&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)}function A(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("IV_size","uint",8),this._procEntries("entry",this.sample_count,(function(t){this._procEntryField(t,"InitializationVector","data",8),2&this.flags&&(this._procEntryField(t,"NumberOfEntries","uint",16),this._procSubEntries(t,"clearAndCryptedData",t.NumberOfEntries,(function(t){this._procEntryField(t,"BytesOfClearData","uint",16),this._procEntryField(t,"BytesOfEncryptedData","uint",32)})))}))}function S(){b(this.usertype,[109,29,155,5,66,213,68,230,128,226,20,29,175,247,87,178])&&(this._procFullBox(),this._parsing&&(this.type="tfxd"),this._procField("fragment_absolute_time","uint",1===this.version?64:32),this._procField("fragment_duration","uint",1===this.version?64:32)),b(this.usertype,[212,128,126,242,202,57,70,149,142,84,38,203,158,70,167,159])&&(this._procFullBox(),this._parsing&&(this.type="tfrf"),this._procField("fragment_count","uint",8),this._procEntries("entry",this.fragment_count,(function(t){this._procEntryField(t,"fragment_absolute_time","uint",1===this.version?64:32),this._procEntryField(t,"fragment_duration","uint",1===this.version?64:32)}))),b(this.usertype,[162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244])&&(this._parsing&&(this.type="sepiff"),A.call(this))}function w(t){t=t||{};var e,r,n,i=this.context,a=t.dashMetrics,s=t.playbackController,u=t.eventBus,l=t.protectionController,p=t.ISOBoxer,f=t.debug;return n={generateMoov:function(t){return e.generateMoov(t)},processFragment:function(t,e){if(!t||!t.request||!t.response)throw new Error("e parameter is missing or malformed");"MediaSegment"===t.request.type?r.convertFragment(t,e):t.request.type===o.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(r.updateSegmentList(t,e),t.sender=null)}},p.addBoxProcessor("uuid",S),p.addBoxProcessor("saio",T),p.addBoxProcessor("saiz",E),p.addBoxProcessor("senc",A),e=_(i).create({protectionController:l,constants:t.constants,ISOBoxer:p}),r=g(i).create({dashMetrics:a,playbackController:s,ISOBoxer:p,eventBus:u,debug:f,errHandler:t.errHandler}),n}w.__dashjs_factory_name="MssFragmentProcessor";var I=dashjs.FactoryMaker.getClassFactory(w),M=r(57),N=r.n(M);function D(t){var e,r,n,i=(t=t||{}).BASE64,o=t.debug,a=t.constants,s=t.manifestModel,u=t.settings,l=["AAC","AACL","AACH","AACP","AVC1","H264","TTML","DFXP"],p={CAPT:"main",SUBT:"alternate",DESC:"main"},f={DESC:"2"},c={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12},d={video:"video/mp4",audio:"audio/mp4",text:"application/mp4"};function h(t,e){var r=t.getAttribute(e);return!!r&&"true"===r.toLowerCase()}function y(t,e){var r,n,i,o,a,s={},u=[],l=t.getAttribute("Name"),c=t.getAttribute("Type"),h=t.getAttribute("Language"),y=h?c+"_"+h:c;if(s.id=l||y,s.contentType=c,s.lang=h||"und",s.mimeType=d[c],s.subType=t.getAttribute("Subtype"),s.maxWidth=t.getAttribute("MaxWidth"),s.maxHeight=t.getAttribute("MaxHeight"),s.subType){if(p[s.subType]){var g={schemeIdUri:"urn:mpeg:dash:role:2011",value:p[s.subType]};s.Role=g,s.Role_asArray=[g]}if(f[s.subType]){var v={schemeIdUri:"urn:tva:metadata:cs:AudioPurposeCS:2007",value:f[s.subType]};s.Accessibility=v,s.Accessibility_asArray=[v]}}for(r=function(t,e){var r,n,i,o={};return i=t.getAttribute("Url"),r=(r=i?i.replace("{bitrate}","$Bandwidth$"):null)?r.replace("{start time}","$Time$"):null,n=(n=t.getAttribute("TimeScale"))?parseFloat(n):e,o.media=r,o.timescale=n,o.SegmentTimeline=function(t,e){var r,n,i,o,a,s,u={},l=t.getElementsByTagName("c"),p=[],f=0;for(o=0;o<l.length;o++)if(r={},(i=l[o].getAttribute("t"))&&N()(i).greater(N()(Number.MAX_SAFE_INTEGER))&&(r.tManifest=i),r.t=parseFloat(i),r.d=parseFloat(l[o].getAttribute("d")),0!==o||r.t||(r.t=0),o>0&&((n=p[p.length-1]).d||(n.tManifest?n.d=N()(i).subtract(N()(n.tManifest)).toJSNumber():n.d=r.t-n.t,f+=n.d),r.t||(n.tManifest?(r.tManifest=N()(n.tManifest).add(N()(n.d)).toString(),r.t=parseFloat(r.tManifest)):r.t=n.t+n.d)),r.d&&(f+=r.d),p.push(r),s=parseFloat(l[o].getAttribute("r")))for(a=0;a<s-1;a++)n=p[p.length-1],(r={}).t=n.t+n.d,r.d=n.d,n.tManifest&&(r.tManifest=N()(n.tManifest).add(N()(n.d)).toString()),f+=r.d,p.push(r);return u.S=p,u.S_asArray=p,u.duration=f/e,u}(t,o.timescale),o.availabilityTimeOffset="INF",o}(t,e),n=t.getElementsByTagName("QualityLevel"),o=0;o<n.length;o++)n[o].BaseURL=s.BaseURL,n[o].mimeType=s.mimeType,a=n[o].getAttribute("Index"),n[o].Id=s.id+(null!==a?"_"+a:""),null!==(i=m(n[o],t))&&(i.SegmentTemplate=r,u.push(i));return 0===u.length?null:(s.Representation=u.length>1?u:u[0],s.Representation_asArray=u,s.SegmentTemplate=r,s)}function m(t,e){var n,i,o={},s=e.getAttribute("Type"),u=null;if(o.id=t.Id,o.bandwidth=parseInt(t.getAttribute("Bitrate"),10),o.mimeType=t.mimeType,n=parseInt(t.getAttribute("MaxWidth"),10),i=parseInt(t.getAttribute("MaxHeight"),10),isNaN(n)||(o.width=n),isNaN(i)||(o.height=i),null!==(u=t.getAttribute("FourCC"))&&""!==u||(u=e.getAttribute("FourCC")),null===u||""===u)if(s===a.AUDIO)u="AAC";else if(s===a.VIDEO)return r.debug('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),null;return-1===l.indexOf(u.toUpperCase())?(r.warn("Codec not supported: "+u),null):("H264"===u||"AVC1"===u?o.codecs=function(t){var e,r=t.getAttribute("CodecPrivateData").toString();return e=/00000001[0-9]7/.exec(r),"avc1."+(e&&e[0]?r.substr(r.indexOf(e[0])+10,6):void 0)}(t):u.indexOf("AAC")>=0?(o.codecs=function(t,e){var r,n,i,o,a=parseInt(t.getAttribute("SamplingRate"),10),s=t.getAttribute("CodecPrivateData").toString(),u=0;"AACH"===e&&(u=5);void 0===s||""===s?(u=2,i=c[a],"AACH"===e?(u=5,s=new Uint8Array(4),o=c[2*a],s[0]=u<<3|i>>1,s[1]=i<<7|t.Channels<<3|o>>1,s[2]=o<<7|8,s[3]=0,(n=new Uint16Array(2))[0]=(s[0]<<8)+s[1],n[1]=(s[2]<<8)+s[3],r=n[0].toString(16),r=n[0].toString(16)+n[1].toString(16)):((s=new Uint8Array(2))[0]=u<<3|i>>1,s[1]=i<<7|parseInt(t.getAttribute("Channels"),10)<<3,(n=new Uint16Array(1))[0]=(s[0]<<8)+s[1],r=n[0].toString(16)),s=(s=""+r).toUpperCase(),t.setAttribute("CodecPrivateData",s)):0===u&&(u=(248&parseInt(s.substr(0,2),16))>>3);return"mp4a.40."+u}(t,u),o.audioSamplingRate=parseInt(t.getAttribute("SamplingRate"),10),o.audioChannels=parseInt(t.getAttribute("Channels"),10)):(u.indexOf("TTML")||u.indexOf("DFXP"))&&(o.codecs=a.STPP),o.codecPrivateData=""+t.getAttribute("CodecPrivateData"),o.BaseURL=t.BaseURL,o)}function g(t){var e,r,n;return(e=function(t){var e,r,n,i=0;(t[i+3]<<24)+(t[i+2]<<16)+(t[i+1]<<8)+t[i],(t[(i+=4)+1]<<8)+t[i],i+=2;for(;i<t.length;)if(e=(t[i+1]<<8)+t[i],i+=2,1===e)return r=(t[i+1]<<8)+t[i],i+=2,(n=new Uint8Array(r)).set(t.subarray(i,i+r)),n;return null}(i.decodeArray(t.firstChild.data)))&&(e=new Uint16Array(e.buffer),e=String.fromCharCode.apply(null,e),r=(new DOMParser).parseFromString(e,"application/xml").querySelector("KID").textContent,r=i.decodeArray(r),v(n=r,0,3),v(n,1,2),v(n,4,5),v(n,6,7)),r}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(t){var e,r,o,l,p,f,c,d,m,v,_,b={},T=[],E=t.getElementsByTagName("SmoothStreamingMedia")[0],A=t.getElementsByTagName("Protection")[0],S=null;b.protocol="MSS",b.profiles="urn:mpeg:dash:profile:isoff-live:2011",b.type=h(E,"IsLive")?"dynamic":"static",d=E.getAttribute("TimeScale"),b.timescale=d?parseFloat(d):1e7;var w=parseFloat(E.getAttribute("DVRWindowLength"));"dynamic"!==b.type||0!==w&&!isNaN(w)||(w=1/0),0===w&&h(E,"CanSeek")&&(w=1/0),w>0&&(b.timeShiftBufferDepth=w/b.timescale);var I=parseFloat(E.getAttribute("Duration"));for(b.mediaPresentationDuration=0===I?1/0:I/b.timescale,b.minBufferTime=2,b.ttmlTimeIsRelative=!0,"dynamic"===b.type&&I>0&&(b.type="static",b.timeShiftBufferDepth=I/b.timescale),"dynamic"===b.type&&(b.refreshManifestOnSwitchTrack=!0,b.doNotUpdateDVRWindowOnBufferUpdated=!0,b.ignorePostponeTimePeriod=!0,b.availabilityStartTime=new Date(null)),b.Period=function(t,e){var r,n,i={AdaptationSet_asArray:[]};r=t.getElementsByTagName("StreamIndex");for(var o=0;o<r.length;o++)null!==(n=y(r[o],e))&&i.AdaptationSet_asArray.push(n);return i.AdaptationSet_asArray.length>0&&(i.AdaptationSet=i.AdaptationSet_asArray.length>1?i.AdaptationSet_asArray:i.AdaptationSet_asArray[0]),i}(E,b.timescale),b.Period_asArray=[b.Period],(e=b.Period).start=0,void 0!==A&&((S=t.getElementsByTagName("ProtectionHeader")[0]).firstChild.data=S.firstChild.data.replace(/\n|\r/g,""),l=g(S),(o=function(t){var e={__text:t.firstChild.data,__prefix:"mspr"};return{schemeIdUri:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",value:"com.microsoft.playready",pro:e,pro_asArray:e}}(S))["cenc:default_KID"]=l,T.push(o),(o=function(t){var e={schemeIdUri:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",value:"com.widevine.alpha"};if(!t)return e;var r=new Uint8Array(2+t.length);r[0]=18,r[1]=16,r.set(t,2);var n=32+r.length,o=new Uint8Array(n),a=0;return o[a++]=(4278190080&n)>>24,o[a++]=(16711680&n)>>16,o[a++]=(65280&n)>>8,o[a++]=255&n,o.set([112,115,115,104,0,0,0,0],a),a+=8,o.set([237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237],a),a+=16,o[a++]=(4278190080&r.length)>>24,o[a++]=(16711680&r.length)>>16,o[a++]=(65280&r.length)>>8,o[a++]=255&r.length,o.set(r,a),o=String.fromCharCode.apply(null,o),o=i.encodeASCII(o),e.pssh={__text:o},e}(l))["cenc:default_KID"]=l,T.push(o),b.ContentProtection=T,b.ContentProtection_asArray=T),r=e.AdaptationSet_asArray,v=0;v<r.length;v+=1)r[v].SegmentTemplate.initialization="$Bandwidth$",void 0!==b.ContentProtection&&(r[v].ContentProtection=b.ContentProtection,r[v].ContentProtection_asArray=b.ContentProtection_asArray),"video"===r[v].contentType&&(m=r[v].SegmentTemplate.SegmentTimeline.S_asArray[0].d/r[v].SegmentTemplate.timescale,b.minBufferTime=m,"dynamic"===b.type&&b.timeShiftBufferDepth>0&&b.timeShiftBufferDepth!==1/0&&b.timeShiftBufferDepth>r[v].SegmentTemplate.SegmentTimeline.duration&&(b.timeShiftBufferDepth=r[v].SegmentTemplate.SegmentTimeline.duration));if(b.minBufferTime=Math.min(b.minBufferTime,b.timeShiftBufferDepth?b.timeShiftBufferDepth:1/0),"dynamic"===b.type){var M=u.get().streaming.delay.liveDelay;if(!M)M=m*(null===u.get().streaming.delay.liveDelayFragmentCount||isNaN(u.get().streaming.delay.liveDelayFragmentCount)?4:u.get().streaming.delay.liveDelayFragmentCount);var N=Math.max(b.timeShiftBufferDepth-10,b.timeShiftBufferDepth/2),D=Math.min(N,M),P=D-1.5*m;n={streaming:{buffer:{stableBufferTime:u.get().streaming.buffer.stableBufferTime,bufferTimeAtTopQuality:u.get().streaming.buffer.bufferTimeAtTopQuality,bufferTimeAtTopQualityLongForm:u.get().streaming.buffer.bufferTimeAtTopQualityLongForm},timeShiftBuffer:{calcFromSegmentTimeline:u.get().streaming.timeShiftBuffer.calcFromSegmentTimeline},delay:{liveDelay:u.get().streaming.delay.liveDelay}}},u.update({streaming:{buffer:{stableBufferTime:P,bufferTimeAtTopQuality:P,bufferTimeAtTopQualityLongForm:P},timeShiftBuffer:{calcFromSegmentTimeline:!0},delay:{liveDelay:D}}})}if(delete b.ContentProtection,delete b.ContentProtection_asArray,"static"===b.type){var C=s.getValue();if(C&&C.timestampOffset)p=C.timestampOffset;else for(v=0;v<r.length;v++)r[v].contentType!==a.AUDIO&&r[v].contentType!==a.VIDEO||(f=(c=r[v].SegmentTemplate.SegmentTimeline.S_asArray)[0].t,void 0===p&&(p=f),p=Math.min(p,f),b.mediaPresentationDuration=Math.min(b.mediaPresentationDuration,r[v].SegmentTemplate.SegmentTimeline.duration));if(p>0){for(b.timestampOffset=p,v=0;v<r.length;v++){for(c=r[v].SegmentTemplate.SegmentTimeline.S_asArray,_=0;_<c.length;_++)c[_].tManifest||(c[_].tManifest=c[_].t.toString()),c[_].t-=p;r[v].contentType!==a.AUDIO&&r[v].contentType!==a.VIDEO||(e.start=Math.max(c[0].t,e.start),r[v].SegmentTemplate.presentationTimeOffset=e.start)}e.start/=b.timescale}}return b.mediaPresentationDuration=Math.floor(1e3*b.mediaPresentationDuration)/1e3,e.duration=b.mediaPresentationDuration,b}return e={parse:function(t){var e,n,i=window.performance.now();e=function(t){var e=null;if(window.DOMParser&&(e=(new window.DOMParser).parseFromString(t,"text/xml")).getElementsByTagName("parsererror").length>0)throw new Error("parsing the manifest failed");return e}(t);var o=window.performance.now();if(null===e)return null;n=_(e,new Date);var a=window.performance.now();return r.info("Parsing complete: (xmlParsing: "+(o-i).toPrecision(3)+"ms, mss2dash: "+(a-o).toPrecision(3)+"ms, total: "+((a-i)/1e3).toPrecision(3)+"s)"),n},getMatchers:function(){return null},getIron:function(){return null},reset:function(){n&&u.update(n)}},r=o.getLogger(e),e}D.__dashjs_factory_name="MssParser";var P=dashjs.FactoryMaker.getClassFactory(D);function C(t){t=t||{};var e,r,a,l=this.context,p=t.eventBus,f=t.events,c=t.constants,d=t.initSegmentType,h=t.dashMetrics,y=t.playbackController,m=t.streamController,g=t.protectionController,v=I(l).create({dashMetrics:h,playbackController:y,protectionController:g,streamController:m,eventBus:p,constants:c,ISOBoxer:t.ISOBoxer,debug:t.debug,errHandler:t.errHandler});function _(t){return m.getActiveStreamProcessors().filter((function(e){return e.getType()===t}))[0]}function b(t){return r.filter((function(e){return e.getType()===t}))[0]}function T(){m.getActiveStreamProcessors().forEach((function(e){if(e.getType()===c.VIDEO||e.getType()===c.AUDIO||e.getType()===c.TEXT){var n=b(e.getType());n||((n=s(l).create({streamProcessor:e,baseURLController:t.baseURLController,debug:t.debug})).initialize(),r.push(n)),n.start()}}))}function E(e){var r=_(e.mediaType);if(r){var o=r.getRepresentationController().getCurrentRepresentation(),a=r.getMediaInfo(),s=new i.a;s.mediaType=o.adaptation.type,s.type=d,s.range=o.range,s.quality=o.index,s.mediaInfo=a,s.representationId=o.id;var l=function(t,e,r){var i=new n.a;return i.streamId=e,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=r,i}(s,a.streamInfo.id,e.type!==f.FRAGMENT_LOADING_PROGRESS);try{l.bytes=v.generateMoov(o),p.trigger(f.INIT_FRAGMENT_LOADED,{chunk:l},{streamId:a.streamInfo.id,mediaType:o.adaptation.type})}catch(e){t.errHandler.error(new u.a(e.code,e.message,e.data))}e.sender=null}}function A(t){if(!t.error){var e=_(t.request.mediaType);if(e){if(v.processFragment(t,e),t.request.type===o.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE){var r=b(t.request.mediaType);r&&r.fragmentInfoLoaded(t)}var n=t.request.mediaInfo.streamInfo.manifestInfo;n.isDynamic||n.dvrWindowSize===1/0||T()}}}function S(){y.getIsDynamic()&&0!==y.getTime()&&T()}function w(){y.getIsDynamic()&&0!==y.getTime()&&T()}function M(t){t&&t.data&&(t.data=t.data.replace(/http:\/\/www.w3.org\/2006\/10\/ttaf1/gi,"http://www.w3.org/ns/ttml"))}return a={reset:function(){e&&(e.reset(),e=void 0),p.off(f.INIT_FRAGMENT_NEEDED,E,this),p.off(f.PLAYBACK_PAUSED,S,this),p.off(f.PLAYBACK_SEEKING,w,this),p.off(f.FRAGMENT_LOADING_COMPLETED,A,this),p.off(f.TTML_TO_PARSE,M,this),r.forEach((function(t){t.reset()})),r=[]},createMssParser:function(){return e=P(l).create(t)},registerEvents:function(){p.on(f.INIT_FRAGMENT_NEEDED,E,a,{priority:dashjs.FactoryMaker.getSingletonFactoryByName(p.getClassName()).EVENT_PRIORITY_HIGH}),p.on(f.PLAYBACK_PAUSED,S,a,{priority:dashjs.FactoryMaker.getSingletonFactoryByName(p.getClassName()).EVENT_PRIORITY_HIGH}),p.on(f.PLAYBACK_SEEKING,w,a,{priority:dashjs.FactoryMaker.getSingletonFactoryByName(p.getClassName()).EVENT_PRIORITY_HIGH}),p.on(f.FRAGMENT_LOADING_COMPLETED,A,a,{priority:dashjs.FactoryMaker.getSingletonFactoryByName(p.getClassName()).EVENT_PRIORITY_HIGH}),p.on(f.TTML_TO_PARSE,M,a)}},r=[],a}C.__dashjs_factory_name="MssHandler";var O=dashjs.FactoryMaker.getClassFactory(C);O.errors=h,dashjs.FactoryMaker.updateClassFactory(C.__dashjs_factory_name,O);e.a=O}}).default}));
//# sourceMappingURL=dash.mss.min.js.map