UNPKG

dashjs

Version:

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.

2 lines 1.05 MB
/*! For license information please see dash.mediaplayer.min.js.LICENSE.txt */ !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()}(self,(function(){return function(){var t={7267:function(t,e,n){"use strict";n(6280),n(3792),n(8598),n(4114),n(4743),n(6573),n(8100),n(7936),n(6099),n(1489),n(8140),n(1630),n(2170),n(5044),n(1920),n(1694),n(9955),n(1903),n(1134),n(3206),n(4496),n(6651),n(2887),n(9369),n(6812),n(8995),n(1575),n(6072),n(8747),n(8845),n(9423),n(7301),n(373),n(6614),n(1405),n(7467),n(4732),n(3684),n(9577),e.byteLength=function(t){var e=s(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=s(t),o=r[0],l=r[1],u=new i(function(t,e,n){return 3*(e+n)/4-n}(0,o,l)),c=0,f=l>0?o-4:o;for(n=0;n<f;n+=4)e=a[t.charCodeAt(n)]<<18|a[t.charCodeAt(n+1)]<<12|a[t.charCodeAt(n+2)]<<6|a[t.charCodeAt(n+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===l&&(e=a[t.charCodeAt(n)]<<2|a[t.charCodeAt(n+1)]>>4,u[c++]=255&e),1===l&&(e=a[t.charCodeAt(n)]<<10|a[t.charCodeAt(n+1)]<<4|a[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,a=n%3,i=[],o=16383,l=0,s=n-a;l<s;l+=o)i.push(u(t,l,l+o>s?s:l+o));return 1===a?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===a&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0;l<64;++l)r[l]=o[l],a[o.charCodeAt(l)]=l;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var a,i,o=[],l=e;l<n;l+=3)a=(t[l]<<16&16711680)+(t[l+1]<<8&65280)+(255&t[l+2]),o.push(r[(i=a)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},44:function(t,e,n){"use strict";var r=n(5429);n(2675),n(9463),n(5700),n(6280),n(8706),n(6835),n(3771),n(4423),n(3792),n(4114),n(4782),n(4743),n(6573),n(8100),n(7936),n(9572),n(2010),n(2892),n(6099),n(7495),n(8781),n(1699),n(5440),n(2762),n(1489),n(8140),n(1630),n(2170),n(5044),n(1920),n(1694),n(9955),n(1903),n(1134),n(3206),n(4496),n(6651),n(2887),n(9369),n(6812),n(8995),n(1575),n(6072),n(8747),n(8845),n(9423),n(7301),n(373),n(6614),n(1405),n(7467),n(4732),n(3684),n(9577);var a=n(7267),i=n(7986),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;var l=2147483647;function s(t){if(t>l)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|h(t,e),r=s(n),a=r.write(t,e);return a!==n&&(r=r.slice(0,a)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(q(t,Uint8Array)){var e=new Uint8Array(t);return m(e.buffer,e.byteOffset,e.byteLength)}return g(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+r(t));if(q(t,ArrayBuffer)||t&&q(t.buffer,ArrayBuffer))return m(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(q(t,SharedArrayBuffer)||t&&q(t.buffer,SharedArrayBuffer)))return m(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=t.valueOf&&t.valueOf();if(null!=a&&a!==t)return u.from(a,e,n);var i=function(t){if(u.isBuffer(t)){var e=0|p(t.length),n=s(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||G(t.length)?s(0):g(t):"Buffer"===t.type&&Array.isArray(t.data)?g(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+r(t))}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return f(t),s(t<0?0:0|p(t))}function g(t){for(var e=t.length<0?0:0|p(t.length),n=s(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function m(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,u.prototype),r}function p(t){if(t>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return 0|t}function h(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+r(t));var n=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(i)return a?-1:U(t).length;e=(""+e).toLowerCase(),i=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return I(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,a){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:E(t,e,n,r,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):E(t,[e],n,r,a);throw new TypeError("val must be string, number or Buffer")}function E(t,e,n,r,a){var i,o=1,l=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,l/=2,s/=2,n/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var c=-1;for(i=n;i<l;i++)if(u(t,i)===u(e,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===s)return c*o}else-1!==c&&(i-=i-c),c=-1}else for(n+s>l&&(n=l-s),i=n;i>=0;i--){for(var f=!0,d=0;d<s;d++)if(u(t,i+d)!==u(e,d)){f=!1;break}if(f)return i}return-1}function A(t,e,n,r){n=Number(n)||0;var a=t.length-n;r?(r=Number(r))>a&&(r=a):r=a;var i=e.length;r>i/2&&(r=i/2);for(var o=0;o<r;++o){var l=parseInt(e.substr(2*o,2),16);if(G(l))return o;t[n+o]=l}return o}function T(t,e,n,r){return B(U(e,t.length-n),t,n,r)}function _(t,e,n,r){return B(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return B(j(e),t,n,r)}function S(t,e,n,r){return B(function(t,e){for(var n,r,a,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=(n=t.charCodeAt(o))>>8,a=n%256,i.push(a),i.push(r);return i}(e,t.length-n),t,n,r)}function k(t,e,n){return 0===e&&n===t.length?a.fromByteArray(t):a.fromByteArray(t.slice(e,n))}function I(t,e,n){n=Math.min(t.length,n);for(var r=[],a=e;a<n;){var i,o,l,s,u=t[a],c=null,f=u>239?4:u>223?3:u>191?2:1;if(a+f<=n)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[a+1]))&&(s=(31&u)<<6|63&i)>127&&(c=s);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(s=(15&u)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=t[a+1],o=t[a+2],l=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&l)&&(s=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(c=s)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),a+=f}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=R));return n}(r)}e.kMaxLength=l,u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,n){return c(t,e,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,n){return function(t,e,n){return f(t),t<=0?s(t):void 0!==e?"string"==typeof n?s(t).fill(e,n):s(t).fill(e):s(t)}(t,e,n)},u.allocUnsafe=function(t){return d(t)},u.allocUnsafeSlow=function(t){return d(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,a=0,i=Math.min(n,r);a<i;++a)if(t[a]!==e[a]){n=t[a],r=e[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),a=0;for(n=0;n<t.length;++n){var i=t[n];if(q(i,Uint8Array))a+i.length>r.length?u.from(i).copy(r,a):Uint8Array.prototype.set.call(r,i,a);else{if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,a)}a+=i.length}return r},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)b(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?I(this,0,t):v.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,n,a,i){if(q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+r(t));if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),e<0||n>t.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&e>=n)return 0;if(a>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(a>>>=0),l=(n>>>=0)-(e>>>=0),s=Math.min(o,l),c=this.slice(a,i),f=t.slice(e,n),d=0;d<s;++d)if(c[d]!==f[d]){o=c[d],l=f[d];break}return o<l?-1:l<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-e;if((void 0===n||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return A(this,t,e,n);case"utf8":case"utf-8":return T(this,t,e,n);case"ascii":case"latin1":case"binary":return _(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function x(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(127&t[a]);return r}function N(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(t[a]);return r}function C(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=e;i<n;++i)a+=H[t[i]];return a}function D(t,e,n){for(var r=t.slice(e,n),a="",i=0;i<r.length-1;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function z(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,n,r,a,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function M(t,e,n,r,a,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,r,a){return e=+e,n>>>=0,a||M(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function L(t,e,n,r,a){return e=+e,n>>>=0,a||M(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||z(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||z(t,e,this.length);for(var r=this[t+--e],a=1;e>0&&(a*=256);)r+=this[t+--e]*a;return r},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||z(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||z(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||z(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||z(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||z(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||z(t,e,this.length);for(var r=e,a=1,i=this[t+--r];r>0&&(a*=256);)i+=this[t+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return t>>>=0,e||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||z(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){t>>>=0,e||z(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||z(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||z(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||z(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||z(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||O(this,t,e,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[e]=255&t;++i<n&&(a*=256);)this[e+i]=t/a&255;return e+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||O(this,t,e,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var a=Math.pow(2,8*n-1);O(this,t,e,n,a-1,-a)}var i=0,o=1,l=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===l&&0!==this[e+i-1]&&(l=1),this[e+i]=(t/o|0)-l&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var a=Math.pow(2,8*n-1);O(this,t,e,n,a-1,-a)}var i=n-1,o=1,l=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/o|0)-l&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var a=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),a},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var a=t.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(t=a)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var o=u.isBuffer(t)?t:u.from(t,r),l=o.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=o[i%l]}return this};var F=/[^+/0-9A-Za-z-_]/g;function U(t,e){var n;e=e||1/0;for(var r=t.length,a=null,i=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function j(t){return a.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,n,r){for(var a=0;a<r&&!(a+n>=e.length||a>=t.length);++a)e[a+n]=t[a];return a}function q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function G(t){return t!=t}var H=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=16*n,a=0;a<16;++a)e[r+a]=t[n]+t[a];return e}()},6877:function(t,e,n){var r=n(5429);n(3792),n(8598),n(4114),n(4554),n(4743),n(6573),n(8100),n(7936),n(6099),n(9479),n(1489),n(8140),n(1630),n(2170),n(5044),n(1920),n(1694),n(9955),n(1903),n(1134),n(3206),n(4496),n(6651),n(2887),n(9369),n(6812),n(8995),n(1575),n(6072),n(8747),n(8845),n(9423),n(7301),n(373),n(6614),n(1405),n(7467),n(4732),n(3684),n(9577);var a={parseBuffer:function(t){return new i(t).parse()},addBoxProcessor:function(t,e){"string"==typeof t&&"function"==typeof e&&(o.prototype._boxProcessors[t]=e)},createFile:function(){return new i},createBox:function(t,e,n){var r=o.create(t);return e&&e.append(r,n),r},createFullBox:function(t,e,n){var r=a.createBox(t,e,n);return r.version=0,r.flags=0,r},Utils:{}};a.Utils.dataViewToString=function(t,e){var n=e||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(t);var r=[],a=0;if("utf-8"===n)for(;a<t.byteLength;){var i=t.getUint8(a++);i<128||(i<224?(i=(31&i)<<6,i|=63&t.getUint8(a++)):i<240?(i=(15&i)<<12,i|=(63&t.getUint8(a++))<<6,i|=63&t.getUint8(a++)):(i=(7&i)<<18,i|=(63&t.getUint8(a++))<<12,i|=(63&t.getUint8(a++))<<6,i|=63&t.getUint8(a++))),r.push(String.fromCharCode(i))}else for(;a<t.byteLength;)r.push(String.fromCharCode(t.getUint8(a++)));return r.join("")},a.Utils.utf8ToByteArray=function(t){var e,n;if("undefined"!=typeof TextEncoder)e=(new TextEncoder).encode(t);else for(e=[],n=0;n<t.length;++n){var r=t.charCodeAt(n);r<128?e.push(r):r<2048?(e.push(192|r>>6),e.push(128|63&r)):r<65536?(e.push(224|r>>12),e.push(128|63&r>>6),e.push(128|63&r)):(e.push(240|r>>18),e.push(128|63&r>>12),e.push(128|63&r>>6),e.push(128|63&r))}return e},a.Utils.appendBox=function(t,e,n){if(e._offset=t._cursor.offset,e._root=t._root?t._root:t,e._raw=t._raw,e._parent=t,-1!==n)if(null!=n){var a,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)a=n;else{if("object"!==r(n)||!n.type)return void t.boxes.push(e);a=n.type}for(var o=0;o<t.boxes.length;o++)if(a===t.boxes[o].type){i=o+1;break}}t.boxes.splice(i,0,e)}else t.boxes.push(e)},e.parseBuffer=a.parseBuffer,e.addBoxProcessor=a.addBoxProcessor,e.createFile=a.createFile,e.createBox=a.createBox,e.createFullBox=a.createFullBox,e.Utils=a.Utils,a.Cursor=function(t){this.offset=void 0===t?0:t};var i=function(t){this._cursor=new a.Cursor,this.boxes=[],t&&(this._raw=new DataView(t))};i.prototype.fetch=function(t){var e=this.fetchAll(t,!0);return e.length?e[0]:null},i.prototype.fetchAll=function(t,e){var n=[];return i._sweep.call(this,t,n,e),n},i.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var t=o.parse(this);if(void 0===t.type)break;this.boxes.push(t)}return this},i._sweep=function(t,e,n){for(var r in this.type&&this.type==t&&e.push(this),this.boxes){if(e.length&&n)return;i._sweep.call(this.boxes[r],t,e,n)}},i.prototype.write=function(){var t,e=0;for(t=0;t<this.boxes.length;t++)e+=this.boxes[t].getLength(!1);var n=new Uint8Array(e);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,t=0;t<this.boxes.length;t++)this.boxes[t].write();return n.buffer},i.prototype.append=function(t,e){a.Utils.appendBox(this,t,e)};var o=function(){this._cursor=new a.Cursor};o.parse=function(t){var e=new o;return e._offset=t._cursor.offset,e._root=t._root?t._root:t,e._raw=t._raw,e._parent=t,e._parseBox(),t._cursor.offset=e._raw.byteOffset+e._raw.byteLength,e},o.create=function(t){var e=new o;return e.type=t,e.boxes=[],e},o.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca","meta","grpl","prsl"],o.prototype._boxProcessors={},o.prototype._procField=function(t,e,n){this._parsing?this[t]=this._readField(e,n):this._writeField(e,n,this[t])},o.prototype._procFieldArray=function(t,e,n,r){var a;if(this._parsing)for(this[t]=[],a=0;a<e;a++)this[t][a]=this._readField(n,r);else for(a=0;a<this[t].length;a++)this._writeField(n,r,this[t][a])},o.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},o.prototype._procEntries=function(t,e,n){var r;if(this._parsing)for(this[t]=[],r=0;r<e;r++)this[t].push({}),n.call(this,this[t][r]);else for(r=0;r<e;r++)n.call(this,this[t][r])},o.prototype._procSubEntries=function(t,e,n,r){var a;if(this._parsing)for(t[e]=[],a=0;a<n;a++)t[e].push({}),r.call(this,t[e][a]);else for(a=0;a<n;a++)r.call(this,t[e][a])},o.prototype._procEntryField=function(t,e,n,r){this._parsing?t[e]=this._readField(n,r):this._writeField(n,r,t[e])},o.prototype._procSubBoxes=function(t,e){var n;if(this._parsing)for(this[t]=[],n=0;n<e;n++)this[t].push(o.parse(this));else for(n=0;n<e;n++)this._rawo?this[t][n].write():this.size+=this[t][n].getLength()},o.prototype._readField=function(t,e){switch(t){case"uint":return this._readUint(e);case"int":return this._readInt(e);case"template":return this._readTemplate(e);case"string":return-1===e?this._readTerminatedString():this._readString(e);case"data":return this._readData(e);case"utf8":return this._readUTF8String();case"utf8string":return this._readUTF8TerminatedString();default:return-1}},o.prototype._readInt=function(t){var e=null,n=this._cursor.offset-this._raw.byteOffset;switch(t){case 8:e=this._raw.getInt8(n);break;case 16:e=this._raw.getInt16(n);break;case 32:e=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),a=this._raw.getInt32(n+4);e=r*Math.pow(2,32)+a}return this._cursor.offset+=t>>3,e},o.prototype._readUint=function(t){var e,n,r=null,a=this._cursor.offset-this._raw.byteOffset;switch(t){case 8:r=this._raw.getUint8(a);break;case 16:r=this._raw.getUint16(a);break;case 24:r=((e=this._raw.getUint16(a))<<8)+(n=this._raw.getUint8(a+2));break;case 32:r=this._raw.getUint32(a);break;case 64:e=this._raw.getUint32(a),n=this._raw.getUint32(a+4),r=e*Math.pow(2,32)+n}return this._cursor.offset+=t>>3,r},o.prototype._readString=function(t){for(var e="",n=0;n<t;n++){var r=this._readUint(8);e+=String.fromCharCode(r)}return e},o.prototype._readTemplate=function(t){return this._readUint(t/2)+this._readUint(t/2)/Math.pow(2,t/2)},o.prototype._readTerminatedString=function(){for(var t="";this._cursor.offset-this._offset<this._raw.byteLength;){var e=this._readUint(8);if(0===e)break;t+=String.fromCharCode(e)}return t},o.prototype._readData=function(t){var e=t>0?t:this._raw.byteLength-(this._cursor.offset-this._offset);if(e>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,e);return this._cursor.offset+=e,n}return null},o.prototype._readUTF8String=function(){var t=this._raw.byteLength-(this._cursor.offset-this._offset),e=null;return t>0&&(e=new DataView(this._raw.buffer,this._cursor.offset,t),this._cursor.offset+=t),e?a.Utils.dataViewToString(e):e},o.prototype._readUTF8TerminatedString=function(){var t=this._raw.byteLength-(this._cursor.offset-this._offset),e=null;if(t>0){var n;for(e=new DataView(this._raw.buffer,this._cursor.offset,t),n=0;n<t&&0!==e.getUint8(n);n++);e=new DataView(this._raw.buffer,this._cursor.offset,n),this._cursor.offset+=Math.min(n+1,t)}return e?a.Utils.dataViewToString(e):e},o.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},o.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},o.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(o.parse(this))},o.prototype.append=function(t,e){a.Utils.appendBox(this,t,e)},o.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var t=0;t<this.boxes.length;t++)this.size+=this.boxes[t].getLength();return this._data&&this._writeData(this._data),this.size},o.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var t=0;t<this.boxes.length;t++)this.boxes[t].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},o.prototype._writeInt=function(t,e){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(t){case 8:this._rawo.setInt8(n,e);break;case 16:this._rawo.setInt16(n,e);break;case 32:this._rawo.setInt32(n,e);break;case 64:var r=Math.floor(e/Math.pow(2,32)),a=e-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,a)}this._cursor.offset+=t>>3}else this.size+=t>>3},o.prototype._writeUint=function(t,e){if(this._rawo){var n,r,a=this._cursor.offset-this._rawo.byteOffset;switch(t){case 8:this._rawo.setUint8(a,e);break;case 16:this._rawo.setUint16(a,e);break;case 24:n=(16776960&e)>>8,r=255&e,this._rawo.setUint16(a,n),this._rawo.setUint8(a+2,r);break;case 32:this._rawo.setUint32(a,e);break;case 64:r=e-(n=Math.floor(e/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(a,n),this._rawo.setUint32(a+4,r)}this._cursor.offset+=t>>3}else this.size+=t>>3},o.prototype._writeString=function(t,e){for(var n=0;n<t;n++)this._writeUint(8,e.charCodeAt(n))},o.prototype._writeTerminatedString=function(t){if(0!==t.length){for(var e=0;e<t.length;e++)this._writeUint(8,t.charCodeAt(e));this._writeUint(8,0)}},o.prototype._writeTemplate=function(t,e){var n=Math.floor(e),r=(e-n)*Math.pow(2,t/2);this._writeUint(t/2,n),this._writeUint(t/2,r)},o.prototype._writeData=function(t){if(t)if(this._rawo){if(t instanceof Array){for(var e=this._cursor.offset-this._rawo.byteOffset,n=0;n<t.length;n++)this._rawo.setInt8(e+n,t[n]);this._cursor.offset+=t.length}t instanceof Uint8Array&&(this._root.bytes.set(t,this._cursor.offset),this._cursor.offset+=t.length)}else this.size+=t.length},o.prototype._writeUTF8String=function(t){var e=a.Utils.utf8ToByteArray(t);if(this._rawo)for(var n=new DataView(this._rawo.buffer,this._cursor.offset,e.length),r=0;r<e.length;r++)n.setUint8(r,e[r]);else this.size+=e.length},o.prototype._writeField=function(t,e,n){switch(t){case"uint":this._writeUint(e,n);break;case"int":this._writeInt(e,n);break;case"template":this._writeTemplate(e,n);break;case"string":-1==e?this._writeTerminatedString(n):this._writeString(e,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},o.prototype._boxProcessors.ardi=function(){this._procFullBox(),this._procField("audio_rendering_indication","uint",8)},o.prototype._boxProcessors.avc1=o.prototype._boxProcessors.avc2=o.prototype._boxProcessors.avc3=o.prototype._boxProcessors.avc4=o.prototype._boxProcessors.hvc1=o.prototype._boxProcessors.hev1=o.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},o.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"sample_count","uint",32),this._procEntryField(t,"sample_offset",1===this.version?"int":"uint",32)}))},o.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},o.prototype._boxProcessors.elng=function(){this._procFullBox(),this._procField("extended_language","utf8string")},o.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"segment_duration","uint",1===this.version?64:32),this._procEntryField(t,"media_time","int",1===this.version?64:32),this._procEntryField(t,"media_rate_integer","int",16),this._procEntryField(t,"media_rate_fraction","int",16)}))},o.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},o.prototype._boxProcessors.free=o.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},o.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},o.prototype._boxProcessors.ftyp=o.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var t=-1;this._parsing&&(t=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",t,"string",4)},o.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},o.prototype._boxProcessors.imda=function(){this._procField("imda_identifier","uint",32),this._procField("data","data",-1)},o.prototype._boxProcessors.kind=function(){this._procFullBox(),this._procField("schemeURI","utf8string"),this._procField("value","utf8string")},o.prototype._boxProcessors.labl=function(){this._procFullBox(),this.is_group_label=!!(1&this.flags),this._procField("label_id","uint",16),this._procField("language","utf8string"),this._procField("label","utf8string")},o.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},o.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},o.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},o.prototype._boxProcessors.meta=function(){this._procFullBox()},o.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},o.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},o.prototype._boxProcessors.mp4a=o.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},o.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},o.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},o.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField("reference_track_ID","uint",32),this._procField("ntp_timestamp_sec","uint",32),this._procField("ntp_timestamp_frac","uint",32),this._procField("media_time","uint",1==this.version?64:32)},o.prototype._boxProcessors.prsl=function(){this._procFullBox(),this._procField("group_id","uint",32),this._procField("num_entities_in_group","uint",32),this._procEntries("entities",this.num_entities_in_group,(function(t){this._procEntryField(t,"entity_id","uint",32)})),4096&this.flags&&this._procField("preselection_tag","utf8string"),8192&this.flags&&this._procField("selection_priority","uint",8),16384&this.flags&&this._procField("interleaving_tag","utf8string")},o.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},o.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},o.prototype._boxProcessors.sdtp=function(){this._procFullBox();var t=-1;this._parsing&&(t=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",t,"uint",8)},o.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(t){this._parsing||(t.reference=(1&t.reference_type)<<31,t.reference|=2147483647&t.referenced_size,t.sap=(1&t.starts_with_SAP)<<31,t.sap|=(3&t.SAP_type)<<28,t.sap|=268435455&t.SAP_delta_time),this._procEntryField(t,"reference","uint",32),this._procEntryField(t,"subsegment_duration","uint",32),this._procEntryField(t,"sap","uint",32),this._parsing&&(t.reference_type=t.reference>>31&1,t.referenced_size=2147483647&t.reference,t.starts_with_SAP=t.sap>>31&1,t.SAP_type=t.sap>>28&7,t.SAP_delta_time=268435455&t.sap)}))},o.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},o.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(t){this._procEntryField(t,"ranges_count","uint",32),this._procSubEntries(t,"ranges",t.ranges_count,(function(t){this._procEntryField(t,"level","uint",8),this._procEntryField(t,"range_size","uint",24)}))}))},o.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},o.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},o.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"sample_count","uint",32),this._procEntryField(t,"sample_delta","uint",32)}))},o.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"sample_delta","uint",32),this._procEntryField(t,"subsample_count","uint",16),this._procSubEntries(t,"subsamples",t.subsample_count,(function(t){this._procEntryField(t,"subsample_size","uint",1===this.version?32:16),this._procEntryField(t,"subsample_priority","uint",8),this._procEntryField(t,"discardable","uint",8),this._procEntryField(t,"codec_specific_parameters","uint",32)}))}))},o.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},o.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},o.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},o.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(t){this._procEntryField(t,"time","uint",1===this.version?64:32),this._procEntryField(t,"moof_offset","uint",1===this.version?64:32),this._procEntryField(t,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(t,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(t,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},o.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},o.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},o.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(t){256&this.flags&&this._procEntryField(t,"sample_duration","uint",32),512&this.flags&&this._procEntryField(t,"sample_size","uint",32),1024&this.flags&&this._procEntryField(t,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(t,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},o.prototype._boxProcessors["url "]=o.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},o.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},o.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},o.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},o.prototype._boxProcessors.vtte=function(){}},9826:function(t,e,n){"use strict";var r=n(5429);n(2675),n(6280),n(8706),n(4114),n(4782),n(2010),n(150),n(1480),n(875),n(9432),n(6099),n(3362),n(9796),n(1137),n(5472);var a,i="object"===("undefined"==typeof Reflect?"undefined":r(Reflect))?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};a=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var l=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,r){function a(n){t.removeListener(e,i),r(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",a),n([].slice.call(arguments))}b(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&b(t,"error",e,{once:!0