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AAC0C,8BAA8B,GAAG,qBAAqB;AAClE1C,WAAW,CAAC0pB,kBAAkB,GAAG,cAAc;AAC/C1pB,WAAW,CAAC2pB,OAAO,GAAG,SAAS;AAC/B3pB,WAAW,CAAC4pB,qBAAqB,GAAG,iBAAiB;AACrD5pB,WAAW,CAAC6pB,UAAU,GAAG,OAAO;;;;;;;UCzLhC;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEyC;;AAEzC;AACA,IAAInsB,OAAO,GAAI,OAAOsiB,MAAM,KAAK,WAAW,IAAIA,MAAM,IAAK8J,MAAM;AAEjE,IAAInT,UAAM,GAAGjZ,OAAO,CAACiZ,MAAM;AAC3B,IAAI,CAACA,UAAM,EAAE;EACTA,UAAM,GAAGjZ,OAAO,CAACiZ,MAAM,GAAG,CAAC,CAAC;AAChC;AAEAA,UAAM,CAACzC,UAAU,GAAGA,sDAAU;AAE9B,+DAAeyC,UAAM,EAAC","sources":["webpack://dashjs/webpack/universalModuleDefinition","webpack://dashjs/./externals/BigInteger.js","webpack://dashjs/./src/core/FactoryMaker.js","webpack://dashjs/./src/core/errors/ErrorsBase.js","webpack://dashjs/./src/core/events/EventsBase.js","webpack://dashjs/./src/mss/MssFragmentInfoController.js","webpack://dashjs/./src/mss/MssFragmentMoofProcessor.js","webpack://dashjs/./src/mss/MssFragmentMoovProcessor.js","webpack://dashjs/./src/mss/MssFragmentProcessor.js","webpack://dashjs/./src/mss/MssHandler.js","webpack://dashjs/./src/mss/errors/MssErrors.js","webpack://dashjs/./src/mss/parser/MssParser.js","webpack://dashjs/./src/streaming/MediaPlayerEvents.js","webpack://dashjs/./src/streaming/constants/ProtectionConstants.js","webpack://dashjs/./src/streaming/vo/DashJSError.js","webpack://dashjs/./src/streaming/vo/DataChunk.js","webpack://dashjs/./src/streaming/vo/FragmentRequest.js","webpack://dashjs/./src/streaming/vo/metrics/HTTPRequest.js","webpack://dashjs/webpack/bootstrap","webpack://dashjs/webpack/runtime/define property getters","webpack://dashjs/webpack/runtime/hasOwnProperty shorthand","webpack://dashjs/webpack/runtime/make namespace object","webpack://dashjs/./src/mss/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dashjs\"] = factory();\n\telse\n\t\troot[\"dashjs\"] = factory();\n})(self, function() {\nreturn ","var bigInt = function (undefined) {\n 'use strict';\n var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT),\n DEFAULT_ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz';\n var supportsNativeBigInt = typeof BigInt === 'function';\n\n function Integer(v, radix, alphabet, caseSensitive) {\n if (typeof v === 'undefined') return Integer[0];\n if (typeof radix !== 'undefined') return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);\n return parseValue(v)\n }\n\n function BigInteger(value, sign) {\n this.value = value;\n this.sign = sign;\n this.isSmall = false\n }\n\n BigInteger.prototype = Object.create(Integer.prototype);\n\n function SmallInteger(value) {\n this.value = value;\n this.sign = value < 0;\n this.isSmall = true\n }\n\n SmallInteger.prototype = Object.create(Integer.prototype);\n\n function NativeBigInt(value) {\n this.value = value\n }\n\n NativeBigInt.prototype = Object.create(Integer.prototype);\n\n function isPrecise(n) {\n return -MAX_INT < n && n < MAX_INT\n }\n\n function smallToArray(n) {\n if (n < 1e7) return [n];\n if (n < 1e14) return [n % 1e7, Math.floor(n / 1e7)];\n return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)]\n }\n\n function arrayToSmall(arr) {\n trim(arr);\n var length = arr.length;\n if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {\n switch (length) {\n case 0:\n return 0;\n case 1:\n return arr[0];\n case 2:\n return arr[0] + arr[1] * BASE;\n default:\n return arr[0] + (arr[1] + arr[2] * BASE) * BASE\n }\n }\n return arr\n }\n\n function trim(v) {\n var i = v.length;\n while (v[--i] === 0) ;\n v.length = i + 1\n }\n\n function createArray(length) {\n var x = new Array(length);\n var i = -1;\n while (++i < length) {\n x[i] = 0\n }\n return x\n }\n\n function truncate(n) {\n if (n > 0) return Math.floor(n);\n return Math.ceil(n)\n }\n\n function add(a, b) {\n var l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE, sum, i;\n for (i = 0; i < l_b; i++) {\n sum = a[i] + b[i] + carry;\n carry = sum >= base ? 1 : 0;\n r[i] = sum - carry * base\n }\n while (i < l_a) {\n sum = a[i] + carry;\n carry = sum === base ? 1 : 0;\n r[i++] = sum - carry * base\n }\n if (carry > 0) r.push(carry);\n return r\n }\n\n function addAny(a, b) {\n if (a.length >= b.length) return add(a, b);\n return add(b, a)\n }\n\n function addSmall(a, carry) {\n var l = a.length, r = new Array(l), base = BASE, sum, i;\n for (i = 0; i < l; i++) {\n sum = a[i] - base + carry;\n carry = Math.floor(sum / base);\n r[i] = sum - carry * base;\n carry += 1\n }\n while (carry > 0) {\n r[i++] = carry % base;\n carry = Math.floor(carry / base)\n }\n return r\n }\n\n BigInteger.prototype.add = function (v) {\n var n = parseValue(v);\n if (this.sign !== n.sign) {\n return this.subtract(n.negate())\n }\n var a = this.value, b = n.value;\n if (n.isSmall) {\n return new BigInteger(addSmall(a, Math.abs(b)), this.sign)\n }\n return new BigInteger(addAny(a, b), this.sign)\n };\n BigInteger.prototype.plus = BigInteger.prototype.add;\n SmallInteger.prototype.add = function (v) {\n var n = parseValue(v);\n var a = this.value;\n if (a < 0 !== n.sign) {\n return this.subtract(n.negate())\n }\n var b = n.value;\n if (n.isSmall) {\n if (isPrecise(a + b)) return new SmallInteger(a + b);\n b = smallToArray(Math.abs(b))\n }\n return new BigInteger(addSmall(b, Math.abs(a)), a < 0)\n };\n SmallInteger.prototype.plus = SmallInteger.prototype.add;\n NativeBigInt.prototype.add = function (v) {\n return new NativeBigInt(this.value + parseValue(v).value)\n };\n NativeBigInt.prototype.plus = NativeBigInt.prototype.add;\n\n function subtract(a, b) {\n var a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0, base = BASE, i, difference;\n for (i = 0; i < b_l; i++) {\n difference = a[i] - borrow - b[i];\n if (difference < 0) {\n difference += base;\n borrow = 1\n } else borrow = 0;\n r[i] = difference\n }\n for (i = b_l; i < a_l; i++) {\n difference = a[i] - borrow;\n if (difference < 0) difference += base; else {\n r[i++] = difference;\n break\n }\n r[i] = difference\n }\n for (; i < a_l; i++) {\n r[i] = a[i]\n }\n trim(r);\n return r\n }\n\n function subtractAny(a, b, sign) {\n var value;\n if (compareAbs(a, b) >= 0) {\n value = subtract(a, b)\n } else {\n value = subtract(b, a);\n sign = !sign\n }\n value = arrayToSmall(value);\n if (typeof value === 'number') {\n if (sign) value = -value;\n return new SmallInteger(value)\n }\n return new BigInteger(value, sign)\n }\n\n function subtractSmall(a, b, sign) {\n var l = a.length, r = new Array(l), carry = -b, base = BASE, i, difference;\n for (i = 0; i < l; i++) {\n difference = a[i] + carry;\n carry = Math.floor(difference / base);\n difference %= base;\n r[i] = difference < 0 ? difference + base : difference\n }\n r = arrayToSmall(r);\n if (typeof r === 'number') {\n if (sign) r = -r;\n return new SmallInteger(r)\n }\n return new BigInteger(r, sign)\n }\n\n BigInteger.prototype.subtract = function (v) {\n var n = parseValue(v);\n if (this.sign !== n.sign) {\n return this.add(n.negate())\n }\n var a = this.value, b = n.value;\n if (n.isSmall) return subtractSmall(a, Math.abs(b), this.sign);\n return subtractAny(a, b, this.sign)\n };\n BigInteger.prototype.minus = BigInteger.prototype.subtract;\n SmallInteger.prototype.subtract = function (v) {\n var n = parseValue(v);\n var a = this.value;\n if (a < 0 !== n.sign) {\n return this.add(n.negate())\n }\n var b = n.value;\n if (n.isSmall) {\n return new SmallInteger(a - b)\n }\n return subtractSmall(b, Math.abs(a), a >= 0)\n };\n SmallInteger.prototype.minus = SmallInteger.prototype.subtract;\n NativeBigInt.prototype.subtract = function (v) {\n return new NativeBigInt(this.value - parseValue(v).value)\n };\n NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;\n BigInteger.prototype.negate = function () {\n return new BigInteger(this.value, !this.sign)\n };\n SmallInteger.prototype.negate = function () {\n var sign = this.sign;\n var small = new SmallInteger(-this.value);\n small.sign = !sign;\n return small\n };\n NativeBigInt.prototype.negate = function () {\n return new NativeBigInt(-this.value)\n };\n BigInteger.prototype.abs = function () {\n return new BigInteger(this.value, false)\n };\n SmallInteger.prototype.abs = function () {\n return new SmallInteger(Math.abs(this.value))\n };\n NativeBigInt.prototype.abs = function () {\n return new NativeBigInt(this.value >= 0 ? this.value : -this.value)\n };\n\n function multiplyLong(a, b) {\n var a_l = a.length, b_l = b.length, l = a_l + b_l, r = createArray(l), base = BASE, product, carry, i, a_i, b_j;\n for (i = 0; i < a_l; ++i) {\n a_i = a[i];\n for (var j = 0; j < b_l; ++j) {\n b_j = b[j];\n product = a_i * b_j + r[i + j];\n carry = Math.floor(product / base);\n r[i + j] = product - carry * base;\n r[i + j + 1] += carry\n }\n }\n trim(r);\n return r\n }\n\n function multiplySmall(a, b) {\n var l = a.length, r = new Array(l), base = BASE, carry = 0, product, i;\n for (i = 0; i < l; i++) {\n product = a[i] * b + carry;\n carry = Math.floor(product / base);\n r[i] = product - carry * base\n }\n while (carry > 0) {\n r[i++] = carry % base;\n carry = Math.floor(carry / base)\n }\n return r\n }\n\n function shiftLeft(x, n) {\n var r = [];\n while (n-- > 0) r.push(0);\n return r.concat(x)\n }\n\n function multiplyKaratsuba(x, y) {\n var n = Math.max(x.length, y.length);\n if (n <= 30) return multiplyLong(x, y);\n n = Math.ceil(n / 2);\n var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n);\n var ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d),\n abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));\n var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));\n trim(product);\n return product\n }\n\n function useKaratsuba(l1, l2) {\n return -.012 * l1 - .012 * l2 + 15e-6 * l1 * l2 > 0\n }\n\n BigInteger.prototype.multiply = function (v) {\n var n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign, abs;\n if (n.isSmall) {\n if (b === 0) return Integer[0];\n if (b === 1) return this;\n if (b === -1) return this.negate();\n abs = Math.abs(b);\n if (abs < BASE) {\n return new BigInteger(multiplySmall(a, abs), sign)\n }\n b = smallToArray(abs)\n }\n if (useKaratsuba(a.length, b.length)) return new BigInteger(multiplyKaratsuba(a, b), sign);\n return new BigInteger(multiplyLong(a, b), sign)\n };\n BigInteger.prototype.times = BigInteger.prototype.multiply;\n\n function multiplySmallAndArray(a, b, sign) {\n if (a < BASE) {\n return new BigInteger(multiplySmall(b, a), sign)\n }\n return new BigInteger(multiplyLong(b, smallToArray(a)), sign)\n }\n\n SmallInteger.prototype._multiplyBySmall = function (a) {\n if (isPrecise(a.value * this.value)) {\n return new SmallInteger(a.value * this.value)\n }\n return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign)\n };\n BigInteger.prototype._multiplyBySmall = function (a) {\n if (a.value === 0) return Integer[0];\n if (a.value === 1) return this;\n if (a.value === -1) return this.negate();\n return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign)\n };\n SmallInteger.prototype.multiply = function (v) {\n return parseValue(v)._multiplyBySmall(this)\n };\n SmallInteger.prototype.times = SmallInteger.prototype.multiply;\n NativeBigInt.prototype.multiply = function (v) {\n return new NativeBigInt(this.value * parseValue(v).value)\n };\n NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;\n\n function square(a) {\n var l = a.length, r = createArray(l + l), base = BASE, product, carry, i, a_i, a_j;\n for (i = 0; i < l; i++) {\n a_i = a[i];\n carry = 0 - a_i * a_i;\n for (var j = i; j < l; j++) {\n a_j = a[j];\n product = 2 * (a_i * a_j) + r[i + j] + carry;\n carry = Math.floor(product / base);\n r[i + j] = product - carry * base\n }\n r[i + l] = carry\n }\n trim(r);\n return r\n }\n\n BigInteger.prototype.square = function () {\n return new BigInteger(square(this.value), false)\n };\n SmallInteger.prototype.square = function () {\n var value = this.value * this.value;\n if (isPrecise(value)) return new SmallInteger(value);\n return new BigInteger(square(smallToArray(Math.abs(this.value))), false)\n };\n NativeBigInt.prototype.square = function (v) {\n return new NativeBigInt(this.value * this.value)\n };\n\n function divMod1(a, b) {\n var a_l = a.length, b_l = b.length, base = BASE, result = createArray(b.length),\n divisorMostSignificantDigit = b[b_l - 1], lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),\n remainder = multiplySmall(a, lambda), divisor = multiplySmall(b, lambda), quotientDigit, shift, carry,\n borrow, i, l, q;\n if (remainder.length <= a_l) remainder.push(0);\n divisor.push(0);\n divisorMostSignificantDigit = divisor[b_l - 1];\n for (shift = a_l - b_l; shift >= 0; shift--) {\n quotientDigit = base - 1;\n if (remainder[shift + b_l] !== divisorMostSignificantDigit) {\n quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit)\n }\n carry = 0;\n borrow = 0;\n l = divisor.length;\n for (i = 0; i < l; i++) {\n carry += quotientDigit * divisor[i];\n q = Math.floor(carry / base);\n borrow += remainder[shift + i] - (carry - q * base);\n carry = q;\n if (borrow < 0) {\n remainder[shift + i] = borrow + base;\n borrow = -1\n } else {\n remainder[shift + i] = borrow;\n borrow = 0\n }\n }\n while (borrow !== 0) {\n quotientDigit -= 1;\n carry = 0;\n for (i = 0; i < l; i++) {\n carry += remainder[shift + i] - base + divisor[i];\n if (carry < 0) {\n remainder[shift + i] = carry + base;\n carry = 0\n } else {\n remainder[shift + i] = carry;\n carry = 1\n }\n }\n borrow += carry\n }\n result[shift] = quotientDigit\n }\n remainder = divModSmall(remainder, lambda)[0];\n return [arrayToSmall(result), arrayToSmall(remainder)]\n }\n\n function divMod2(a, b) {\n var a_l = a.length, b_l = b.length, result = [], part = [], base = BASE, guess, xlen, highx, highy, check;\n while (a_l) {\n part.unshift(a[--a_l]);\n trim(part);\n if (compareAbs(part, b) < 0) {\n result.push(0);\n continue\n }\n xlen = part.length;\n highx = part[xlen - 1] * base + part[xlen - 2];\n highy = b[b_l - 1] * base + b[b_l - 2];\n if (xlen > b_l) {\n highx = (highx + 1) * base\n }\n guess = Math.ceil(highx / highy);\n do {\n check = multiplySmall(b, guess);\n if (compareAbs(check, part) <= 0) break;\n guess--\n } while (guess);\n result.push(guess);\n part = subtract(part, check)\n }\n result.reverse();\n return [arrayToSmall(result), arrayToSmall(part)]\n }\n\n function divModSmall(value, lambda) {\n var length = value.length, quotient = createArray(length), base = BASE, i, q, remainder, divisor;\n remainder = 0;\n for (i = length - 1; i >= 0; --i) {\n divisor = remainder * base + value[i];\n q = truncate(divisor / lambda);\n remainder = divisor - q * lambda;\n quotient[i] = q | 0\n }\n return [quotient, remainder | 0]\n }\n\n function divModAny(self, v) {\n var value, n = parseValue(v);\n if (supportsNativeBigInt) {\n return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)]\n }\n var a = self.value, b = n.value;\n var quotient;\n if (b === 0) throw new Error('Cannot divide by zero');\n if (self.isSmall) {\n if (n.isSmall) {\n return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)]\n }\n return [Integer[0], self]\n }\n if (n.isSmall) {\n if (b === 1) return [self, Integer[0]];\n if (b == -1) return [self.negate(), Integer[0]];\n var abs = Math.abs(b);\n if (abs < BASE) {\n value = divModSmall(a, abs);\n quotient = arrayToSmall(value[0]);\n var remainder = value[1];\n if (self.sign) remainder = -remainder;\n if (typeof quotient === 'number') {\n if (self.sign !== n.sign) quotient = -quotient;\n return [new SmallInteger(quotient), new SmallInteger(remainder)]\n }\n return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)]\n }\n b = smallToArray(abs)\n }\n var comparison = compareAbs(a, b);\n if (comparison === -1) return [Integer[0], self];\n if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];\n if (a.length + b.length <= 200) value = divMod1(a, b); else value = divMod2(a, b);\n quotient = value[0];\n var qSign = self.sign !== n.sign, mod = value[1], mSign = self.sign;\n if (typeof quotient === 'number') {\n if (qSign) quotient = -quotient;\n quotient = new SmallInteger(quotient)\n } else quotient = new BigInteger(quotient, qSign);\n if (typeof mod === 'number') {\n if (mSign) mod = -mod;\n mod = new SmallInteger(mod)\n } else mod = new BigInteger(mod, mSign);\n return [quotient, mod]\n }\n\n BigInteger.prototype.divmod = function (v) {\n var result = divModAny(this, v);\n return { quotient: result[0], remainder: result[1] }\n };\n NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;\n BigInteger.prototype.divide = function (v) {\n return divModAny(this, v)[0]\n };\n NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) {\n return new NativeBigInt(this.value / parseValue(v).value)\n };\n SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;\n BigInteger.prototype.mod = function (v) {\n return divModAny(this, v)[1]\n };\n NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) {\n return new NativeBigInt(this.value % parseValue(v).value)\n };\n SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;\n BigInteger.prototype.pow = function (v) {\n var n = parseValue(v), a = this.value, b = n.value, value, x, y;\n if (b === 0) return Integer[1];\n if (a === 0) return Integer[0];\n if (a === 1) return Integer[1];\n if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];\n if (n.sign) {\n return Integer[0]\n }\n if (!n.isSmall) throw new Error('The exponent ' + n.toString() + ' is too large.');\n if (this.isSmall) {\n if (isPrecise(value = Math.pow(a, b))) return new SmallInteger(truncate(value))\n }\n x = this;\n y = Integer[1];\n while (true) {\n if (b & 1 === 1) {\n y = y.times(x);\n --b\n }\n if (b === 0) break;\n b /= 2;\n x = x.square()\n }\n return y\n };\n SmallInteger.prototype.pow = BigInteger.prototype.pow;\n NativeBigInt.prototype.pow = function (v) {\n var n = parseValue(v);\n var a = this.value, b = n.value;\n var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);\n if (b === _0) return Integer[1];\n if (a === _0) return Integer[0];\n if (a === _1) return Integer[1];\n if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1];\n if (n.isNegative()) return new NativeBigInt(_0);\n var x = this;\n var y = Integer[1];\n while (true) {\n if ((b & _1) === _1) {\n y = y.times(x);\n --b\n }\n if (b === _0) break;\n b /= _2;\n x = x.square()\n }\n return y\n };\n BigInteger.prototype.modPow = function (exp, mod) {\n exp = parseValue(exp);\n mod = parseValue(mod);\n if (mod.isZero()) throw new Error('Cannot take modPow with modulus 0');\n var r = Integer[1], base = this.mod(mod);\n while (exp.isPositive()) {\n if (base.isZero()) return Integer[0];\n if (exp.isOdd()) r = r.multiply(base).mod(mod);\n exp = exp.divide(2);\n base = base.square().mod(mod)\n }\n return r\n };\n NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;\n\n function compareAbs(a, b) {\n if (a.length !== b.length) {\n return a.length > b.length ? 1 : -1\n }\n for (var i = a.length - 1; i >= 0; i--) {\n if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1\n }\n return 0\n }\n\n BigInteger.prototype.compareAbs = function (v) {\n var n = parseValue(v), a = this.value, b = n.value;\n if (n.isSmall) return 1;\n return compareAbs(a, b)\n };\n SmallInteger.prototype.compareAbs = function (v) {\n var n = parseValue(v), a = Math.abs(this.value), b = n.value;\n if (n.isSmall) {\n b = Math.abs(b);\n return a === b ? 0 : a > b ? 1 : -1\n }\n return -1\n };\n NativeBigInt.prototype.compareAbs = function (v) {\n var a = this.value;\n var b = parseValue(v).value;\n a = a >= 0 ? a : -a;\n b = b >= 0 ? b : -b;\n return a === b ? 0 : a > b ? 1 : -1\n };\n BigInteger.prototype.compare = function (v) {\n if (v === Infinity) {\n return -1\n }\n if (v === -Infinity) {\n return 1\n }\n var n = parseValue(v), a = this.value, b = n.value;\n if (this.sign !== n.sign) {\n return n.sign ? 1 : -1\n }\n if (n.isSmall) {\n return this.sign ? -1 : 1\n }\n return compareAbs(a, b) * (this.sign ? -1 : 1)\n };\n BigInteger.prototype.compareTo = BigInteger.prototype.compare;\n SmallInteger.prototype.compare = function (v) {\n if (v === Infinity) {\n return -1\n }\n if (v === -Infinity) {\n return 1\n }\n var n = parseValue(v), a = this.value, b = n.value;\n if (n.isSmall) {\n return a == b ? 0 : a > b ? 1 : -1\n }\n if (a < 0 !== n.sign) {\n return a < 0 ? -1 : 1\n }\n return a < 0 ? 1 : -1\n };\n SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;\n NativeBigInt.prototype.compare = function (v) {\n if (v === Infinity) {\n return -1\n }\n if (v === -Infinity) {\n return 1\n }\n var a = this.value;\n var b = parseValue(v).value;\n return a === b ? 0 : a > b ? 1 : -1\n };\n NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;\n BigInteger.prototype.equals = function (v) {\n return this.compare(v) === 0\n };\n NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;\n BigInteger.prototype.notEquals = function (v) {\n return this.compare(v) !== 0\n };\n NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;\n BigInteger.prototype.greater = function (v) {\n return this.compare(v) > 0\n };\n NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;\n BigInteger.prototype.lesser = function (v) {\n return this.compare(v) < 0\n };\n NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;\n BigInteger.prototype.greaterOrEquals = function (v) {\n return this.compare(v) >= 0\n };\n NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;\n BigInteger.prototype.lesserOrEquals = function (v) {\n return this.compare(v) <= 0\n };\n NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;\n BigInteger.prototype.isEven = function () {\n return (this.value[0] & 1) === 0\n };\n SmallInteger.prototype.isEven = function () {\n return (this.value & 1) === 0\n };\n NativeBigInt.prototype.isEven = function () {\n return (this.value & BigInt(1)) === BigInt(0)\n };\n BigInteger.prototype.isOdd = function () {\n return (this.value[0] & 1) === 1\n };\n SmallInteger.prototype.isOdd = function () {\n return (this.value & 1) === 1\n };\n NativeBigInt.prototype.isOdd = function () {\n return (this.value & BigInt(1)) === BigInt(1)\n };\n BigInteger.prototype.isPositive = function () {\n return !this.sign\n };\n SmallInteger.prototype.isPositive = function () {\n return this.value > 0\n };\n NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;\n BigInteger.prototype.isNegative = function () {\n return this.sign\n };\n SmallInteger.prototype.isNegative = function () {\n return this.value < 0\n };\n NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;\n BigInteger.prototype.isUnit = function () {\n return false\n };\n SmallInteger.prototype.isUnit = function () {\n return Math.abs(this.value) === 1\n };\n NativeBigInt.prototype.isUnit = function () {\n return this.abs().value === BigInt(1)\n };\n BigInteger.prototype.isZero = function () {\n return false\n };\n SmallInteger.prototype.isZero = function () {\n return this.value === 0\n };\n NativeBigInt.prototype.isZero = function () {\n return this.value === BigInt(0)\n };\n BigInteger.prototype.isDivisibleBy = function (v) {\n var n = parseValue(v);\n if (n.isZero()) return false;\n if (n.isUnit()) return true;\n if (n.compareAbs(2) === 0) return this.isEven();\n return this.mod(n).isZero()\n };\n NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;\n\n function isBasicPrime(v) {\n var n = v.abs();\n if (n.isUnit()) return false;\n if (n.equals(2) || n.equals(3) || n.equals(5)) return true;\n if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;\n if (n.lesser(49)) return true\n }\n\n function millerRabinTest(n, a) {\n var nPrev = n.prev(), b = nPrev, r = 0, d, t, i, x;\n while (b.isEven()) b = b.divide(2), r++;\n next:for (i = 0; i < a.length; i++) {\n if (n.lesser(a[i])) continue;\n x = bigInt(a[i]).modPow(b, n);\n if (x.isUnit() || x.equals(nPrev)) continue;\n for (d = r - 1; d != 0; d--) {\n x = x.square().mod(n);\n if (x.isUnit()) return false;\n if (x.equals(nPrev)) continue next\n }\n return false\n }\n return true\n }\n\n BigInteger.prototype.isPrime = function (strict) {\n var isPrime = isBasicPrime(this);\n if (isPrime !== undefined) return isPrime;\n var n = this.abs();\n var bits = n.bitLength();\n if (bits <= 64) return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);\n var logN = Math.log(2) * bits.toJSNumber();\n var t = Math.ceil(strict === true ? 2 * Math.pow(logN, 2) : logN);\n for (var a = [], i = 0; i < t; i++) {\n a.push(bigInt(i + 2))\n }\n return millerRabinTest(n, a)\n };\n NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;\n BigInteger.prototype.isProbablePrime = function (iterations) {\n var isPrime = isBasicPrime(this);\n if (isPrime !== undefined) return isPrime;\n var n = this.abs();\n var t = iterations === undefined ? 5 : iterations;\n for (var a = [], i = 0; i < t; i++) {\n a.push(bigInt.randBetween(2, n.minus(2)))\n }\n return millerRabinTest(n, a)\n };\n NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;\n BigInteger.prototype.modInv = function (n) {\n var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;\n while (!newR.isZero()) {\n q = r.divide(newR);\n lastT = t;\n lastR = r;\n t = newT;\n r = newR;\n newT = lastT.subtract(q.multiply(newT));\n newR = lastR.subtract(q.multiply(newR))\n }\n if (!r.isUnit()) throw new Error(this.toString() + ' and ' + n.toString() + ' are not co-prime');\n if (t.compare(0) === -1) {\n t = t.add(n)\n }\n if (this.isNegative()) {\n return t.negate()\n }\n return t\n };\n NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;\n BigInteger.prototype.next = function () {\n var value = this.value;\n if (this.sign) {\n return subtractSmall(value, 1, this.sign)\n }\n return new BigInteger(addSmall(value, 1), this.sign)\n };\n SmallInteger.prototype.next = function () {\n var value = this.value;\n if (value + 1 < MAX_INT) return new SmallInteger(value + 1);\n return new BigInteger(MAX_INT_ARR, false)\n };\n NativeBigInt.prototype.next = function () {\n return new NativeBigInt(this.value + BigInt(1))\n };\n BigInteger.prototype.prev = function () {\n var value = this.value;\n if (this.sign) {\n return new BigInteger(addSmall(value, 1), true)\n }\n return subtractSmall(value, 1, this.sign)\n };\n SmallInteger.prototype.prev = function () {\n var value = this.value;\n if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);\n return new BigInteger(MAX_INT_ARR, true)\n };\n NativeBigInt.prototype.prev = function () {\n return new NativeBigInt(this.value - BigInt(1))\n };\n var powersOfTwo = [1];\n while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);\n var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];\n\n function shift_isSmall(n) {\n return Math.abs(n) <= BASE\n }\n\n BigInteger.prototype.shiftLeft = function (v) {\n var n = parseValue(v).toJSNumber();\n if (!shift_isSmall(n)) {\n throw new Error(String(n) + ' is too large for shifting.')\n }\n if (n < 0) return this.shiftRight(-n);\n var result = this;\n if (result.isZero()) return result;\n while (n >= powers2Length) {\n result = result.multiply(highestPower2);\n n -= powers2Length - 1\n }\n return result.multiply(powersOfTwo[n])\n };\n NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;\n BigInteger.prototype.shiftRight = function (v) {\n var remQuo;\n var n = parseValue(v).toJSNumber();\n if (!shift_isSmall(n)) {\n throw new Error(String(n) + ' is too large for shifting.')\n }\n if (n < 0) return this.shiftLeft(-n);\n var result = this;\n while (n >= powers2Length) {\n if (result.isZero() || result.isNegative() && result.isUnit()) return result;\n remQuo = divModAny(result, highestPower2);\n result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\n n -= powers2Length - 1\n }\n remQuo = divModAny(result, powersOfTwo[n]);\n return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]\n };\n NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;\n\n function bitwise(x, y, fn) {\n y = parseValue(y);\n var xSign = x.isNegative(), ySign = y.isNegative();\n var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y;\n var xDigit = 0, yDigit = 0;\n var xDivMod = null, yDivMod = null;\n var result = [];\n while (!xRem.isZero() || !yRem.isZero()) {\n xDivMod = divModAny(xRem, highestPower2);\n xDigit = xDivMod[1].toJSNumber();\n if (xSign) {\n xDigit = highestPower2 - 1 - xDigit\n }\n yDivMod = divModAny(yRem, highestPower2);\n yDigit = yDivMod[1].toJSNumber();\n if (ySign) {\n yDigit = highestPower2 - 1 - yDigit\n }\n xRem = xDivMod[0];\n yRem = yDivMod[0];\n result.push(fn(xDigit, yDigit))\n }\n var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);\n for (var i = result.length - 1; i >= 0; i -= 1) {\n sum = sum.multiply(highestPower2).add(bigInt(result[i]))\n }\n return sum\n }\n\n BigInteger.prototype.not = function () {\n return this.negate().prev()\n };\n NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;\n BigInteger.prototype.and = function (n) {\n return bitwise(this, n, function (a, b) {\n return a & b\n })\n };\n NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;\n BigInteger.prototype.or = function (n) {\n return bitwise(this, n, function (a, b) {\n return a | b\n })\n };\n NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;\n BigInteger.prototype.xor = function (n) {\n return bitwise(this, n, function (a, b) {\n return a ^ b\n })\n };\n NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;\n var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;\n\n function roughLOB(n) {\n var v = n.value,\n x = typeof v === 'number' ? v | LOBMASK_I : typeof v === 'bigint' ? v | BigInt(LOBMASK_I) : v[0] + v[1] * BASE | LOBMASK_BI;\n return x & -x\n }\n\n function integerLogarithm(value, base) {\n if (base.compareTo(value) <= 0) {\n var tmp = integerLogarithm(value, base.square(base));\n var p = tmp.p;\n var e = tmp.e;\n var t = p.multiply(base);\n return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 }\n }\n return { p: bigInt(1), e: 0 }\n }\n\n BigInteger.prototype.bitLength = function () {\n var n = this;\n if (n.compareTo(bigInt(0)) < 0) {\n n = n.negate().subtract(bigInt(1))\n }\n if (n.compareTo(bigInt(0)) === 0) {\n return bigInt(0)\n }\n return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1))\n };\n NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;\n\n function max(a, b) {\n a = parseValue(a);\n b = parseValue(b);\n return a.greater(b) ? a : b\n }\n\n function min(a, b) {\n a = parseValue(a);\n b = parseValue(b);\n return a.lesser(b) ? a : b\n }\n\n function gcd(a, b) {\n a = parseValue(a).abs();\n b = parseValue(b).abs();\n if (a.equals(b)) return a;\n if (a.isZero()) return b;\n if (b.isZero()) return a;\n var c = Integer[1], d, t;\n while (a.isEven() && b.isEven()) {\n d = min(roughLOB(a), roughLOB(b));\n a = a.divide(d);\n b = b.divide(d);\n c = c.multiply(d)\n }\n while (a.isEven()) {\n a = a.divide(roughLOB(a))\n }\n do {\n while (b.isEven()) {\n b = b.divide(roughLOB(b))\n }\n if (a.greater(b)) {\n t = b;\n b = a;\n a = t\n }\n b = b.subtract(a)\n } while (!b.isZero());\n return c.isUnit() ? a : a.multiply(c)\n }\n\n function lcm(a, b) {\n a = parseValue(a).abs();\n b = parseValue(b).abs();\n return a.divide(gcd(a, b)).multiply(b)\n }\n\n function randBetween(a, b) {\n a = parseValue(a);\n b = parseValue(b);\n var low = min(a, b), high = max(a, b);\n var range = high.subtract(low).add(1);\n if (range.isSmall) return low.add(Math.floor(Math.random() * range));\n var digits = toBase(range, BASE).value;\n var result = [], restricted = true;\n for (var i = 0; i < digits.length; i++) {\n var top = restricted ? digits[i] : BASE;\n var digit = truncate(Math.random() * top);\n result.push(digit);\n if (digit < top) restricted = false\n }\n return low.add(Integer.fromArray(result, BASE, false))\n }\n\n var parseBase = function (text, base, alphabet, caseSensitive) {\n alphabet = alphabet || DEFAULT_ALPHABET;\n text = String(text);\n if (!caseSensitive) {\n text = text.toLowerCase();\n alphabet = alphabet.toLowerCase()\n }\n var length = text.length;\n var i;\n var absBase = Math.abs(base);\n var alphabetValues = {};\n for (i = 0; i < alphabet.length; i++) {\n alphabetValues[alphabet[i]] = i\n }\n for (i = 0; i < length; i++) {\n var c = text[i];\n if (c === '-') continue;\n if (c in alphabetValues) {\n if (alphabetValues[c] >= absBase) {\n if (c === '1' && absBase === 1) continue;\n throw new Error(c + ' is not a valid digit in base ' + base + '.')\n }\n }\n }\n base = parseValue(base);\n var digits = [];\n var isNegative = text[0] === '-';\n for (i = isNegative ? 1 : 0; i < text.length; i++) {\n var c = text[i];\n if (c in alphabetValues) digits.push(parseValue(alphabetValues[c])); else if (c === '<') {\n var start = i;\n do {\n i++\n } while (text[i] !== '>' && i < text.length);\n digits.push(parseValue(text.slice(start + 1, i)))\n } else throw new Error(c + ' is not a valid character')\n }\n return parseBaseFromArray(digits, base, isNegative)\n };\n\n function parseBaseFromArray(digits, base, isNegative) {\n var val = Integer[0], pow = Integer[1], i;\n for (i = digits.length - 1; i >= 0; i--) {\n val = val.add(digits[i].times(pow));\n pow = pow.times(base)\n }\n return isNegative ? val.negate() : val\n }\n\n function stringify(digit, alphabet) {\n alphabet = alphabet || DEFAULT_ALPHABET;\n if (digit < alphabet.length) {\n return alphabet[digit]\n }\n return '<' + digit + '>'\n }\n\n function toBase(n, base) {\n base = bigInt(base);\n if (base.isZero()) {\n if (n.isZero()) return { value: [0], isNegative: false };\n throw new Error('Cannot convert nonzero numbers to base 0.')\n }\n if (base.equals(-1)) {\n if (n.isZero()) return { value: [0], isNegative: false };\n if (n.isNegative()) return {\n value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber())).map(Array.prototype.valueOf, [1, 0])),\n isNegative: false\n };\n var arr = Array.apply(null, Array(n.toJSNumber() - 1)).map(Array.prototype.valueOf, [0, 1]);\n arr.unshift([1]);\n return { value: [].concat.apply([], arr), isNegative: false }\n }\n var neg = false;\n if (n.isNegative() && base.isPositive()) {\n neg = true;\n n = n.abs()\n }\n if (base.isUnit()) {\n if (n.isZero()) return { value: [0], isNegative: false };\n return { value: Array.apply(null, Array(n.toJSNumber())).map(Number.prototype.valueOf, 1), isNegative: neg }\n }\n var out = [];\n var left = n, divmod;\n while (left.isNegative() || left.compareAbs(base) >= 0) {\n divmod = left.divmod(base);\n left = divmod.quotient;\n var digit = divmod.remainder;\n if (digit.isNegative()) {\n digit = base.minus(digit).abs();\n left = left.next()\n }\n out.push(digit.toJSNumber())\n }\n out.push(left.toJSNumber());\n return { value: out.reverse(), isNegative: neg }\n }\n\n function toBaseString(n, base, alphabet) {\n var arr = toBase(n, base);\n return (arr.isNegative ? '-' : '') + arr.value.map(function (x) {\n return stringify(x, alphabet)\n }).join('')\n }\n\n BigInteger.prototype.toArray = function (radix) {\n return toBase(this, radix)\n };\n SmallInteger.prototype.toArray = function (radix) {\n return toBase(this, radix)\n };\n NativeBigInt.prototype.toArray = function (radix) {\n return toBase(this, radix)\n };\n BigInteger.prototype.toString = function (radix, alphabet) {\n if (radix === undefined) radix = 10;\n if (radix !== 10) return toBaseString(this, radix, alphabet);\n var v = this.value, l = v.length, str = String(v[--l]), zeros = '0000000', digit;\n while (--l >= 0) {\n digit = String(v[l]);\n str += zeros.slice(digit.length) + digit\n }\n var sign = this.sign ? '-' : '';\n return sign + str\n };\n SmallInteger.prototype.toString = function (radix, alphabet) {\n if (radix === undefined) radix = 10;\n if (radix != 10) return toBaseString(this, radix, alphabet);\n return String(this.value)\n };\n NativeBigInt.prototype.toString = SmallInteger.prototype.toString;\n NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () {\n return this.toString()\n };\n BigInteger.prototype.valueOf = function () {\n return parseInt(this.toString(), 10)\n };\n BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;\n SmallInteger.prototype.valueOf = function () {\n return this.value\n };\n SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;\n NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () {\n return parseInt(this.toString(), 10)\n };\n\n function parseStringValue(v) {\n if (isPrecise(+v)) {\n var x = +v;\n if (x === truncate(x)) return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);\n throw new Error('Invalid integer: ' + v)\n }\n var sign = v[0] === '-';\n if (sign) v = v.slice(1);\n var split = v.split(/e/i);\n if (split.length > 2) throw new Error('Invalid integer: ' + split.join('e'));\n if (split.length === 2) {\n var exp = split[1];\n if (exp[0] === '+') exp = exp.slice(1);\n exp = +exp;\n if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error('Invalid integer: ' + exp + ' is not a valid exponent.');\n var text = split[0];\n var decimalPlace = text.indexOf('.');\n if (decimalPlace >= 0) {\n exp -= text.length - decimalPlace - 1;\n text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1)\n }\n if (exp < 0) throw new Error('Cannot include negative exponent part for integers');\n text += new Array(exp + 1).join('0');\n v = text\n }\n var isValid = /^([0-9][0-9]*)$/.test(v);\n if (!isValid) throw new Error('Invalid integer: ' + v);\n if (supportsNativeBigInt) {\n return new NativeBigInt(BigInt(sign ? '-' + v : v))\n }\n var r = [], max = v.length, l = LOG_BASE, min = max - l;\n while (max > 0) {\n r.push(+v.slice(min, max));\n min -= l;\n if (min < 0) min = 0;\n max -= l\n }\n trim(r);\n return new BigInteger(r, sign)\n }\n\n function parseNumberValue(v) {\n if (supportsNativeBigInt) {\n return new NativeBigInt(BigInt(v))\n }\n if (isPrecise(v)) {\n if (v !== truncate(v)) throw new Error(v + ' is not an integer.');\n return new SmallInteger(v)\n }\n return parseStringValue(v.toString())\n }\n\n function parseValue(v) {\n if (typeof v === 'number') {\n return parseNumberValue(v)\n }\n if (typeof v === 'string') {\n return parseStringValue(v)\n }\n if (typeof v === 'bigint') {\n return new NativeBigInt(v)\n }\n return v\n }\n\n for (var i = 0; i < 1e3; i++) {\n Integer[i] = parseValue(i);\n if (i > 0) Integer[-i] = parseValue(-i)\n }\n Integer.one = Integer[1];\n Integer.zero = Integer[0];\n Integer.minusOne = Integer[-1];\n Integer.max = max;\n Integer.min = min;\n Integer.gcd = gcd;\n Integer.lcm = lcm;\n Integer.isInstance = function (x) {\n return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt\n };\n Integer.randBetween = randBetween;\n Integer.fromArray = function (digits, base, isNegative) {\n return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative)\n };\n return Integer\n}();\nif (typeof module !== 'undefined' && module.hasOwnProperty('exports')) {\n module.exports = bigInt\n}\nif (typeof define === 'function' && define.amd) {\n define('big-integer', [], function () {\n return bigInt\n })\n}\n\nexport default bigInt\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * @module FactoryMaker\n * @ignore\n */\nconst FactoryMaker = (function () {\n\n let instance;\n let singletonContexts = [];\n const singletonFactories = {};\n const classFactories = {};\n\n function extend(name, childInstance, override, context) {\n if (!context[name] && childInstance) {\n context[name] = {\n instance: childInstance,\n override: override\n };\n }\n }\n\n /**\n * Use this method from your extended object. this.factory is injected into your object.\n * this.factory.getSingletonInstance(this.context, 'VideoModel')\n * will return the video model for use in the extended object.\n *\n * @param {Object} context - injected into extended object as this.context\n * @param {string} className - string name found in all dash.js objects\n * with name __dashjs_factory_name Will be at the bottom. Will be the same as the object's name.\n * @returns {*} Context aware instance of specified singleton name.\n * @memberof module:FactoryMaker\n * @instance\n */\n function getSingletonInstance(context, className) {\n for (const i in singletonContexts) {\n const obj = singletonContexts[i];\n if (obj.context === context && obj.name === className) {\n return obj.instance;\n }\n }\n return null;\n }\n\n /**\n * Use this method to add an singleton instance to the system. Useful for unit testing to mock objects etc.\n *\n * @param {Object} context\n * @param {string} className\n * @param {Object} instance\n * @memberof module:FactoryMaker\n * @instance\n */\n function setSingletonInstance(context, className, instance) {\n for (const i in singletonContexts) {\n const obj = singletonContexts[i];\n if (obj.context === context && obj.name === className) {\n singletonContexts[i].instance = instance;\n return;\n }\n }\n singletonContexts.push({\n name: className,\n context: context,\n instance: instance\n });\n }\n\n /**\n * Use this method to remove all singleton instances associated with a particular context.\n *\n * @param {Object} context\n * @memberof module:FactoryMaker\n * @instance\n */\n function deleteSingletonInstances(context) {\n singletonContexts = singletonContexts.filter(x => x.context !== context);\n }\n\n /*------------------------------------------------------------------------------------------*/\n\n // Factories storage Management\n\n /*------------------------------------------------------------------------------------------*/\n\n function getFactoryByName(name, factoriesArray) {\n return factoriesArray[name];\n }\n\n function updateFactory(name, factory, factoriesArray) {\n if (name in factoriesArray) {\n factoriesArray[name] = factory;\n }\n }\n\n /*------------------------------------------------------------------------------------------*/\n\n // Class Factories Management\n\n /*------------------------------------------------------------------------------------------*/\n\n function updateClassFactory(name, factory) {\n updateFactory(name, factory, classFactories);\n }\n\n function getClassFactoryByName(name) {\n return getFactoryByName(name, classFactories);\n }\n\n function getClassFactory(classConstructor) {\n let factory = getFactoryByName(classConstructor.__dashjs_factory_name, classFactories);\n\n if (!factory) {\n factory = function (context) {\n if (context === undefined) {\n context = {};\n }\n return {\n create: function () {\n return merge(classConstructor, context, arguments);\n }\n };\n };\n\n classFactories[classConstructor.__dashjs_factory_name] = factory; // store factory\n }\n return factory;\n }\n\n /*------------------------------------------------------------------------------------------*/\n\n // Singleton Factory MAangement\n\n /*------------------------------------------------------------------------------------------*/\n\n function updateSingletonFactory(name, factory) {\n updateFactory(name, factory, singletonFactories);\n }\n\n function getSingletonFactoryByName(name) {\n return getFactoryByName(name, singletonFactories);\n }\n\n function getSingletonFactory(classConstructor) {\n let factory = getFactoryByName(classConstructor.__dashjs_factory_name, singletonFactories);\n if (!factory) {\n factory = function (context) {\n let instance;\n if (context === undefined) {\n context = {};\n }\n return {\n getInstance: function () {\n // If we don't have an instance yet check for one on the context\n if (!instance) {\n instance = getSingletonInstance(context, classConstructor.__dashjs_factory_name);\n }\n // If there's no instance on the context then create one\n if (!instance) {\n instance = merge(classConstructor, context, arguments);\n singletonContexts.push({\n name: classConstructor.__dashjs_factory_name,\n context: context,\n instance: instance\n });\n }\n return instance;\n }\n };\n };\n singletonFactories[classConstructor.__dashjs_factory_name] = factory; // store factory\n }\n\n return factory;\n }\n\n function merge(classConstructor, context, args) {\n\n let classInstance;\n const className = classConstructor.__dashjs_factory_name;\n const extensionObject = context[className];\n\n if (extensionObject) {\n\n let extension = extensionObject.instance;\n\n if (extensionObject.override) { //Override public methods in parent but keep parent.\n\n classInstance = classConstructor.apply({context}, args);\n extension = extension.apply({\n context,\n factory: instance,\n parent: classInstance\n }, args);\n\n for (const prop in extension) {\n if (classInstance.hasOwnProperty(prop)) {\n classInstance[prop] = extension[prop];\n }\n }\n\n } else { //replace parent object completely with new object. Same as dijon.\n\n return extension.apply({\n context,\n factory: instance\n }, args);\n\n }\n } else {\n // Create new instance of the class\n classInstance = classConstructor.apply({context}, args);\n }\n\n // Add getClassName function to class instance prototype (used by Debug)\n classInstance.getClassName = function () {return className;};\n\n return classInstance;\n }\n\n instance = {\n extend: extend,\n getSingletonInstance: getSingletonInstance,\n setSingletonInstance: setSingletonInstance,\n deleteSingletonInstances: deleteSingletonInstances,\n getSingletonFactory: getSingletonFactory,\n getSingletonFactoryByName: getSingletonFactoryByName,\n updateSingletonFactory: updateSingletonFactory,\n getClassFactory: getClassFactory,\n getClassFactoryByName: getClassFactoryByName,\n updateClassFactory: updateClassFactory\n };\n\n return instance;\n\n}());\n\nexport default FactoryMaker;\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * @class\n * @ignore\n */\nclass ErrorsBase {\n extend(errors, config) {\n if (!errors) {\n return;\n }\n\n let override = config ? config.override : false;\n let publicOnly = config ? config.publicOnly : false;\n\n\n for (const err in errors) {\n if (!errors.hasOwnProperty(err) || (this[err] && !override)) {\n continue;\n }\n if (publicOnly && errors[err].indexOf('public_') === -1) {\n continue;\n }\n this[err] = errors[err];\n\n }\n }\n}\n\nexport default ErrorsBase;\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * @class\n * @ignore\n */\nclass EventsBase {\n extend(events, config) {\n if (!events) {\n return;\n }\n\n let override = config ? config.override : false;\n let publicOnly = config ? config.publicOnly : false;\n\n\n for (const evt in events) {\n if (!events.hasOwnProperty(evt) || (this[evt] && !override)) {\n continue;\n }\n if (publicOnly && events[evt].indexOf('public_') === -1) {\n continue;\n }\n this[evt] = events[evt];\n\n }\n }\n}\n\nexport default EventsBase;\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport FragmentRequest from '../streaming/vo/FragmentRequest.js';\nimport {HTTPRequest} from '../streaming/vo/metrics/HTTPRequest.js';\nimport FactoryMaker from '../core/FactoryMaker.js';\n\nfunction MssFragmentInfoController(config) {\n\n config = config || {};\n\n let instance,\n logger,\n fragmentModel,\n started,\n type,\n loadFragmentTimeout,\n startTime,\n startFragmentTime,\n index;\n\n const streamProcessor = config.streamProcessor;\n const baseURLController = config.baseURLController;\n const debug = config.debug;\n const controllerType = 'MssFragmentInfoController';\n\n function setup() {\n logger = debug.getLogger(instance);\n }\n\n function initialize() {\n type = streamProcessor.getType();\n fragmentModel = streamProcessor.getFragmentModel();\n\n started = false;\n startTime = null;\n startFragmentTime = null;\n }\n\n function start() {\n if (started) {\n return;\n }\n\n logger.debug('Start');\n\n started = true;\n index = 0;\n\n loadNextFragmentInfo();\n }\n\n function stop() {\n if (!started) {\n return;\n }\n\n logger.debug('Stop');\n\n clearTimeout(loadFragmentTimeout);\n started = false;\n startTime = null;\n startFragmentTime = null;\n }\n\n function reset() {\n stop();\n }\n\n function loadNextFragmentInfo() {\n if (!started) {\n return;\n }\n\n // Get last segment from SegmentTimeline\n const representation = getCurrentRepresentation();\n const manifest = representation.adaptation.period.mpd.manifest;\n const adaptation = manifest.Period[representation.adaptation.period.index].AdaptationSet[representation.adaptation.index];\n const segments = adaptation.SegmentTemplate.SegmentTimeline.S;\n const segment = segments[segments.length - 1];\n\n // logger.debug('Last fragment time: ' + (segment.t / adaptation.SegmentTemplate.timescale));\n\n // Generate segment request\n const request = getRequestForSegment(adaptation, representation, segment);\n\n // Send segment request\n requestFragment.call(this, request);\n }\n\n function getRequestForSegment(adaptation, representation, segment) {\n let timescale = adaptation.SegmentTemplate.timescale;\n let request = new FragmentRequest();\n\n request.mediaType = type;\n request.type = HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE;\n // request.range = segment.mediaRange;\n request.startTime = segment.t / timescale;\n request.duration = segment.d / timescale;\n request.timescale = timescale;\n // request.availabilityStartTime = segment.availabilityStartTime;\n // request.availabilityEndTime = segment.availabilityEndTime;\n // request.wallStartTime = segment.wallStartTime;\n request.bandwidth = representation.bandwidth;\n request.index = index++;\n request.adaptationIndex = representation.adaptation.index;\n request.representation = representation;\n request.url = baseURLController.resolve(representation.path).url + adaptation.SegmentTemplate.media;\n request.url = request.url.replace('$Bandwidth$', representation.bandwidth);\n request.url = request.url.replace('$Time$', segment.tManifest ? segment.tManifest : segment.t);\n request.url = request.url.replace('/Fragments(', '/FragmentInfo(');\n\n return request;\n }\n\n function getCurrentRepresentation() {\n const representationController = streamProcessor.getRepresentationController();\n const representation = representationController.getCurrentRepresentation();\n return representation;\n }\n\n function requestFragment(request) {\n // logger.debug('Load FragmentInfo for time: ' + request.startTime);\n if (streamProcessor.getFragmentModel().isFragmentLoadedOrPending(request)) {\n // We may have reached end of timeline in case of start-over streams\n logger.debug('End of timeline');\n stop();\n return;\n }\n\n fragmentModel.executeRequest(request);\n }\n\n function fragmentInfoLoaded(e) {\n if (!started) {\n return;\n }\n\n const request = e.request;\n if (!e.response) {\n logger.error('Load error', request.url);\n return;\n }\n\n let deltaFragmentTime,\n deltaTime,\n delay;\n\n // logger.debug('FragmentInfo loaded: ', request.url);\n\n if (startTime === null) {\n startTime = new Date().getTime();\n }\n\n if (!startFragmentTime) {\n startFragmentTime = request.startTime;\n }\n\n // Determine delay before requesting next FragmentInfo\n deltaTime = (new Date().getTime() - startTime) / 1000;\n deltaFragmentTime = (request.startTime + request.duration) - startFragmentTime;\n delay = Math.max(0, (deltaFragmentTime - deltaTime));\n\n // Set timeout for requesting next FragmentInfo\n clearTimeout(loadFragmentTimeout);\n loadFragmentTimeout = setTimeout(function () {\n loadFragmentTimeout = null;\n loadNextFragmentInfo();\n }, delay * 1000);\n }\n\n function getType() {\n return type;\n }\n\n instance = {\n initialize: initialize,\n controllerType: controllerType,\n start: start,\n fragmentInfoLoaded: fragmentInfoLoaded,\n getType: getType,\n reset: reset\n };\n\n setup();\n\n return instance;\n}\n\nMssFragmentInfoController.__dashjs_factory_name = 'MssFragmentInfoController';\nexport default FactoryMaker.getClassFactory(MssFragmentInfoController);\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\nimport DashJSError from '../streaming/vo/DashJSError.js';\nimport MssErrors from './errors/MssErrors.js';\n\nimport Events from '../streaming/MediaPlayerEvents.js';\nimport FactoryMaker from '../core/FactoryMaker.js';\n\n/**\n * @module MssFragmentMoofProcessor\n * @ignore\n * @param {Object} config object\n */\nfunction MssFragmentMoofProcessor(config) {\n\n config = config || {};\n let instance,\n type,\n logger;\n const dashMetrics = config.dashMetrics;\n const playbackController = config.playbackController;\n const errorHandler = config.errHandler;\n const eventBus = config.eventBus;\n const ISOBoxer = config.ISOBoxer;\n const debug = config.debug;\n\n function setup() {\n logger = debug.getLogger(instance);\n type = '';\n }\n\n function processTfrf(request, tfrf, tfdt, streamProcessor) {\n const representationController = streamProcessor.getRepresentationController();\n const representation = representationController.getCurrentRepresentation();\n\n const manifest = representation.adaptation.period.mpd.manifest;\n const adaptation = manifest.Period[representation.adaptation.period.index].AdaptationSet[representation.adaptation.index];\n const timescale = adaptation.SegmentTemplate.timescale;\n\n type = streamProcessor.getType();\n\n // Process tfrf only for live streams or start-over static streams (timeShiftBufferDepth > 0)\n if (manifest.type !== 'dynamic' && !manifest.timeShiftBufferDepth) {\n return;\n }\n\n if (!tfrf) {\n errorHandler.error(new DashJSError(MssErrors.MSS_NO_TFRF_CODE, MssErrors.MSS_NO_TFRF_MESSAGE));\n return;\n }\n\n // Get adaptation's segment timeline (always a SegmentTimeline in Smooth Streaming use case)\n const segments = adaptation.SegmentTemplate.SegmentTimeline.S;\n const entries = tfrf.entry;\n let entry,\n segmentTime,\n range;\n let segment = null;\n let t = 0;\n let endTime;\n let availabilityStartTime = null;\n\n if (entries.length === 0) {\n return;\n }\n\n // Consider only first tfrf entry (to avoid pre-condition failure on fragment info requests)\n entry = entries[0];\n\n // In case of start-over streams, check if we have reached end of original manifest duration (set in timeShiftBufferDepth)\n // => then do not update anymore timeline\n if (manifest.type === 'static') {\n // Get first segment time\n segmentTime = segments[0].tManifest ? parseFloat(segments[0].tManifest) : segments[0].t;\n if (entry.fragment_absolute_time > (segmentTime + (manifest.timeShiftBufferDepth * timescale))) {\n return;\n }\n }\n\n // logger.debug('entry - t = ', (entry.fragment_absolute_time / timescale));\n\n // Get last segment time\n segmentTime = segments[segments.length - 1].tManifest ? parseFloat(segments[segments.length - 1].tManifest) : segments[segments.length - 1].t;\n // logger.debug('Last segment - t = ', (segmentTime / timescale));\n\n // Check if we have to append new segment to timeline\n if (entry.fragment_absolute_time <= segmentTime) {\n // Update DVR window range => set range end to end time of current segment\n range = {\n start: segments[0].t / timescale,\n end: (tfdt.baseMediaDecodeTime / timescale) + request.duration\n };\n\n updateDVR(request.mediaType, range, streamProcessor.getStreamInfo().manifestInfo);\n return;\n }\n\n // logger.debug('Add new segment - t = ', (entry.fragment_absolute_time / timescale));\n segment = {};\n segment.t = entry.fragment_absolute_time;\n segment.d = entry.fragment_duration;\n // If timestamps starts at 0 relative to 1st segment (dynamic to static) then update segment time\n if (segments[0].tManifest) {\n segment.t -= parseFloat(segments[0].tManifest) - segments[0].t;\n segment.tManifest = entry.fragment_absolute_time;\n }\n\n // Patch previous segment duration\n let lastSegment = segments[segments.length - 1];\n if (lastSegment.t + lastSegment.d !== segment.t) {\n logger.debug('Patch segment duration - t = ', lastSegment.t + ', d = ' + lastSegment.d + ' => ' + (segment.t - lastSegment.t));\n lastSegment.d = segment.t - lastSegment.t;\n }\n\n segments.push(segment);\n\n // In case of static start-over streams, update content duration\n if (manifest.type === 'static') {\n if (type === 'video') {\n segment = segments[segments.length - 1];\n endTime = (segment.t + segment.d) / timescale;\n if (endTime > representation.adaptation.period.duration) {\n eventBus.trigger(Events.MANIFEST_VALIDITY_CHANGED, { sender: this, newDuration: endTime });\n }\n }\n return;\n } else {\n // In case of live streams, update segment timeline according to DVR window\n if (manifest.timeShiftBufferDepth && manifest.timeShiftBufferDepth > 0) {\n // Get timestamp of the last segment\n segment = segments[segments.length - 1];\n t = segment.t;\n\n // Determine the segments' availability start time\n availabilityStartTime = (t - (manifest.timeShiftBufferDepth * timescale)) / timescale;\n\n // Remove segments prior to availability start time\n segment = segments[0];\n endTime = (segment.t + segment.d) / timescale;\n while (endTime < availabilityStartTime) {\n // Check if not currently playing the segment to be removed\n if (!playbackController.isPaused() && playbackController.getTime() < endTime) {\n break;\n }\n // logger.debug('Remove segment - t = ' + (segment.t / timescale));\n segments.splice(0, 1);\n segment = segments[0];\n endTime = (segment.t + segment.d) / timescale;\n }\n }\n\n // Update DVR window range => set range end to end time of current segment\n range = {\n start: segments[0].t / timescale,\n end: (tfdt.baseMediaDecodeTime / timescale) + request.duration\n };\n\n updateDVR(type, range, streamProcessor.getStreamInfo().manifestInfo);\n }\n\n }\n\n function updateDVR(type, range, manifestInfo) {\n if (type !== 'video' && type !== 'audio') {\n return;\n }\n const dvrInfos = dashMetrics.getCurrentDVRInfo(type);\n if (!dvrInfos || (range.end > dvrInfos.range.end)) {\n logger.debug('Update DVR range: [' + range.start + ' - ' + range.end + ']');\n dashMetrics.addDVRInfo(type, playbackController.getTime(), manifestInfo, range);\n playbackController.updateCurrentTime(type);\n }\n }\n\n // This function returns the offset of the 1st byte of a child box within a container box\n function getBoxOffset(parent, type) {\n let offset = 8;\n let i = 0;\n\n for (i = 0; i < parent.boxes.length; i++) {\n if (parent.boxes[i].type === type) {\n return offset;\n }\n offset += parent.boxes[i].size;\n }\n return offset;\n }\n\n function convertFragment(e, streamProcessor) {\n let i;\n\n // e.request contains request description object\n // e.response contains fragment bytes\n const isoFile = ISOBoxer.parseBuffer(e.response);\n // Update track_Id in tfhd box\n const tfhd = isoFile.fetch('tfhd');\n tfhd.track_ID = e.request.representation.mediaInfo.index + 1;\n\n // Add tfdt box\n let tfdt = isoFile.fetch('tfdt');\n const traf = isoFile.fetch('traf');\n if (tfdt === null) {\n tfdt = ISOBoxer.createFullBox('tfdt', traf, tfhd);\n tfdt.version = 1;\n tfdt.flags = 0;\n tfdt.baseMediaDecodeTime = Math.floor(e.request.startTime * e.request.timescale);\n }\n\n const trun = isoFile.fetch('trun');\n\n // Process tfxd boxes\n // This box provide absolute timestamp but we take the segment start time for tfdt\n let tfxd = isoFile.fetch('tfxd');\n if (tfxd) {\n tfxd._parent.boxes.splice(tfxd._parent.boxes.indexOf(tfxd), 1);\n tfxd = null;\n }\n let tfrf = isoFile.fetch('tfrf');\n processTfrf(e.request, tfrf, tfdt, streamProcessor);\n if (tfrf) {\n tfrf._parent.boxes.splice(tfrf._parent.boxes.indexOf(tfrf), 1);\n tfrf = null;\n }\n\n // If protected content in PIFF1.1 format (sepiff box = Sample Encryption PIFF)\n // => convert sepiff box it into a senc box\n // => create saio and saiz boxes (if not already present)\n const sepiff = isoFile.fetch('sepiff');\n if (sepiff !== null) {\n sepiff.type = 'senc';\n sepiff.usertype = undefined;\n\n let saio = isoFile.fetch('saio');\n if (saio === null) {\n // Create Sample Auxiliary Information Offsets Box box (saio)\n saio = ISOBoxer.createFullBox('saio', traf);\n saio.version = 0;\n saio.flags = 0;\n saio.entry_count = 1;\n saio.offset = [0];\n\n const saiz = ISOBoxer.createFullBox('saiz', traf);\n saiz.version = 0;\n saiz.flags = 0;\n saiz.sample_count = sepiff.sample_count;\n saiz.default_sample_info_size = 0;\n saiz.sample_info_size = [];\n\n if (sepiff.flags & 0x02) {\n // Sub-sample encryption => set sample_info_size for each sample\n for (i = 0; i < sepiff.sample_count; i += 1) {\n // 10 = 8 (InitializationVector field size) + 2 (subsample_count field size)\n // 6 = 2 (BytesOfClearData field size) + 4 (BytesOfEncryptedData field size)\n saiz.sample_info_size[i] = 10 + (6 * sepiff.entry[i].NumberOfEntries);\n }\n } else {\n // No sub-sample encryption => set default sample_info_size = InitializationVector field size (8)\n saiz.default_sample_info_size = 8;\n }\n }\n }\n\n tfhd.flags &= 0xFFFFFE; // set tfhd.base-data-offset-present to false\n tfhd.flags |= 0x020000; // set tfhd.default-base-is-moof to true\n trun.flags |= 0x000001; // set trun.data-offset-present to true\n\n // Update trun.data_offset field that corresponds to first data byte (inside mdat box)\n const moof = isoFile.fetch('moof');\n let length = moof.getLength();\n trun.data_offset = length + 8;\n\n // Update saio box offset field according to new senc box offset\n let saio = isoFile.fetch('saio');\n if (saio !== null) {\n let trafPosInMoof = getBoxOffset(moof, 'traf');\n let sencPosInTraf = getBoxOffset(traf, 'senc');\n // Set offset from begin fragment to the first IV field in senc box\n saio.offset[0] = trafPosInMoof + sencPosInTraf + 16; // 16 = box header (12) + sample_count field size (4)\n }\n\n // Write transformed/processed fragment into request reponse data\n e.response = isoFile.write();\n }\n\n function updateSegmentList(e, streamProcessor) {\n // e.request contains request description object\n // e.response contains fragment bytes\n if (!e.response) {\n throw new Error('e.response parameter is missing');\n }\n\n const isoFile = ISOBoxer.parseBuffer(e.response);\n // Update track_Id in tfhd box\n const tfhd = isoFile.fetch('tfhd');\n tfhd.track_ID = e.request.representation.mediaInfo.index + 1;\n\n // Add tfdt box\n let tfdt = isoFile.fetch('tfdt');\n let traf = isoFile.fetch('traf');\n if (tfdt === null) {\n tfdt = ISOBoxer.createFullBox('tfdt', traf, tfhd);\n tfdt.version = 1;\n tfdt.flags = 0;\n tfdt.baseMediaDecodeTime = Math.floor(e.request.startTime * e.request.timescale);\n }\n\n let tfrf = isoFile.fetch('tfrf');\n processTfrf(e.request, tfrf, tfdt, streamProcessor);\n if (tfrf) {\n tfrf._parent.boxes.splice(tfrf._parent.boxes.indexOf(tfrf), 1);\n tfrf = null;\n }\n }\n\n function getType() {\n return type;\n }\n\n instance = {\n convertFragment,\n updateSegmentList,\n getType\n };\n\n setup();\n return instance;\n}\n\nMssFragmentMoofProcessor.__dashjs_factory_name = 'MssFragmentMoofProcessor';\nexport default FactoryMaker.getClassFactory(MssFragmentMoofProcessor);\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\nimport MssErrors from './errors/MssErrors.js';\nimport FactoryMaker from '../core/FactoryMaker.js';\n\n/**\n * @module MssFragmentMoovProcessor\n * @ignore\n * @param {Object} config object\n */\nfunction MssFragmentMoovProcessor(config) {\n config = config || {};\n const NALUTYPE_SPS = 7;\n const NALUTYPE_PPS = 8;\n const constants = config.constants;\n const ISOBoxer = config.ISOBoxer;\n\n let protectionController = config.protectionController;\n let instance,\n period,\n adaptationSet,\n representation,\n contentProtection,\n timescale,\n trackId;\n\n function createFtypBox(isoFile) {\n let ftyp = ISOBoxer.createBox('ftyp', isoFile);\n ftyp.major_brand = 'iso6';\n ftyp.minor_version = 1; // is an informative integer for the minor version of the major brand\n ftyp.compatible_brands = []; //is a list, to the end of the box, of brands isom, iso6 and msdh\n ftyp.compatible_brands[0] = 'isom'; // => decimal ASCII value for isom\n ftyp.compatible_brands[1] = 'iso6'; // => decimal ASCII value for iso6\n ftyp.compatible_brands[2] = 'msdh'; // => decimal ASCII value for msdh\n\n return ftyp;\n }\n\n function createMoovBox(isoFile) {\n\n // moov box\n let moov = ISOBoxer.createBox('moov', isoFile);\n\n // moov/mvhd\n createMvhdBox(moov);\n\n // moov/trak\n let trak = ISOBoxer.createBox('trak', moov);\n\n // moov/trak/tkhd\n createTkhdBox(trak);\n\n // moov/trak/mdia\n let mdia = ISOBoxer.createBox('mdia', trak);\n\n // moov/trak/mdia/mdhd\n createMdhdBox(mdia);\n\n // moov/trak/mdia/hdlr\n createHdlrBox(mdia);\n\n // moov/trak/mdia/minf\n let minf = ISOBoxer.createBox('minf', mdia);\n\n switch (adaptationSet.type) {\n case constants.VIDEO:\n // moov/trak/mdia/minf/vmhd\n createVmhdBox(minf);\n break;\n case constants.AUDIO:\n // moov/trak/mdia/minf/smhd\n createSmhdBox(minf);\n break;\n default:\n break;\n }\n\n // moov/trak/mdia/minf/dinf\n let dinf = ISOBoxer.createBox('dinf', minf);\n\n // moov/trak/mdia/minf/dinf/dref\n createDrefBox(dinf);\n\n // moov/trak/mdia/minf/stbl\n let stbl = ISOBoxer.createBox('stbl', minf);\n\n // Create empty stts, stsc, stco and stsz boxes\n // Use data field as for codem-isoboxer unknown boxes for setting fields value\n\n // moov/trak/mdia/minf/stbl/stts\n let stts = ISOBoxer.createFullBox('stts', stbl);\n stts._data = [0, 0, 0, 0, 0, 0, 0, 0]; // version = 0, flags = 0, entry_count = 0\n\n // moov/trak/mdia/minf/stbl/stsc\n let stsc = ISOBoxer.createFullBox('stsc', stbl);\n stsc._data = [0, 0, 0, 0, 0, 0, 0, 0]; // version = 0, flags = 0, entry_count = 0\n\n // moov/trak/mdia/minf/stbl/stco\n let stco = ISOBoxer.createFullBox('stco', stbl);\n stco._data = [0, 0, 0, 0, 0, 0, 0, 0]; // version = 0, flags = 0, entry_count = 0\n\n // moov/trak/mdia/minf/stbl/stsz\n let stsz = ISOBoxer.createFullBox('stsz', stbl);\n stsz._data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; // version = 0, flags = 0, sample_size = 0, sample_count = 0\n\n // moov/trak/mdia/minf/stbl/stsd\n createStsdBox(stbl);\n\n // moov/mvex\n let mvex = ISOBoxer.createBox('mvex', moov);\n\n // moov/mvex/trex\n createTrexBox(mvex);\n\n if (contentProtection && protectionController) {\n let supportedKS = protectionController.getSupportedKeySystemMetadataFromContentProtection(contentProtection);\n createProtectionSystemSpecificHeaderBox(moov, supportedKS);\n }\n }\n\n function createMvhdBox(moov) {\n\n let mvhd = ISOBoxer.createFullBox('mvhd', moov);\n\n mvhd.version = 1; // version = 1 in order to have 64bits duration value\n\n mvhd.creation_time = 0; // the creation time of the presentation => ignore (set to 0)\n mvhd.modification_time = 0; // the most recent time the presentation was modified => ignore (set to 0)\n mvhd.timescale = timescale; // the time-scale for the entire presentation => 10000000 for MSS\n mvhd.duration = period.duration === Infinity ? 0xFFFFFFFFFFFFFFFF : Math.round(period.duration * timescale); // the length of the presentation (in the indicated timescale) => take duration of period\n mvhd.rate = 1.0; // 16.16 number, '1.0' = normal playback\n mvhd.volume = 1.0; // 8.8 number, '1.0' = full volume\n mvhd.reserved1 = 0;\n mvhd.reserved2 = [0x0, 0x0];\n mvhd.matrix = [\n 1, 0, 0, // provides a transformation matrix for the video;\n 0, 1, 0, // (u,v,w) are restricted here to (0,0,1)\n 0, 0, 16384\n ];\n mvhd.pre_defined = [0, 0, 0, 0, 0, 0];\n mvhd.next_track_ID = trackId + 1; // indicates a value to use for the track ID of the next track to be added to this presentation\n\n return mvhd;\n }\n\n function createTkhdBox(trak) {\n\n let tkhd = ISOBoxer.createFullBox('tkhd', trak);\n\n tkhd.version = 1; // version = 1 in order to have 64bits duration value\n tkhd.flags = 0x1 | // Track_enabled (0x000001): Indicates that the track is enabled\n 0x2 | // Track_in_movie (0x000002): Indicates that the track is used in the presentation\n 0x4; // Track_in_preview (0x000004): Indicates that the track is used when previewing the presentation\n\n tkhd.creation_time = 0; // the creation time of the presentation => ignore (set to 0)\n tkhd.modification_time = 0; // the most recent time the presentation was modified => ignore (set to 0)\n tkhd.track_ID = trackId; // uniquely identifies this track over the entire life-time of this presentation\n tkhd.reserved1 = 0;\n tkhd.duration = period.duration === Infinity ? 0xFFFFFFFFFFFFFFFF : Math.round(period.duration * timescale); // the duration of this track (in the timescale indicated in the Movie Header Box) => take duration of period\n tkhd.reserved2 = [0x0, 0x0];\n tkhd.layer = 0; // specifies the front-to-back ordering of video tracks; tracks with lower numbers are closer to the viewer => 0 since only one video track\n tkhd.alternate_group = 0; // specifies a group or collection of tracks => ignore\n tkhd.volume = 1.0; // '1.0' = full volume\n tkhd.reserved3 = 0;\n tkhd.matrix = [\n 1, 0, 0, // provides a transformation matrix for the video;\n 0, 1, 0, // (u,v,w) are restricted here to (0,0,1)\n 0, 0, 16384\n ];\n tkhd.width = representation.width; // visual presentation width\n tkhd.height = representation.height; // visual presentation height\n\n return tkhd;\n }\n\n function createMdhdBox(mdia) {\n\n let mdhd = ISOBoxer.createFullBox('mdhd', mdia);\n\n mdhd.version = 1; // version = 1 in order to have 64bits duration value\n\n mdhd.creation_time = 0; // the creation time of the presentation => ignore (set to 0)\n mdhd.modification_time = 0; // the most recent time the presentation was modified => ignore (set to 0)\n mdhd.timescale = timescale; // the time-scale for the entire presentation\n mdhd.duration = period.duration === Infinity ? 0xFFFFFFFFFFFFFFFF : Math.round(period.duration * timescale); // the duration of this media (in the scale of the timescale). If the duration cannot be determined then duration is set to all 1s.\n mdhd.language = adaptationSet.lang || 'und'; // declares the language code for this media\n mdhd.pre_defined = 0;\n\n return mdhd;\n }\n\n function createHdlrBox(mdia) {\n\n let hdlr = ISOBoxer.createFullBox('hdlr', mdia);\n\n hdlr.pre_defined = 0;\n switch (adaptationSet.type) {\n case constants.VIDEO:\n hdlr.handler_type = 'vide';\n break;\n case constants.AUDIO:\n hdlr.handler_type = 'soun';\n break;\n default:\n hdlr.handler_type = 'meta';\n break;\n }\n hdlr.name = representation.id;\n hdlr.reserved = [0, 0, 0];\n\n return hdlr;\n }\n\n function createVmhdBox(minf) {\n\n let vmhd = ISOBoxer.createFullBox('vmhd', minf);\n\n vmhd.flags = 1;\n\n vmhd.graphicsmode = 0; // specifies a composition mode for this video track, from the following enumerated set, which may be extended by derived specifications: copy = 0 copy over the existing image\n vmhd.opcolor = [0, 0, 0]; // is a set of 3 colour values (red, green, blue) available for use by graphics modes\n\n return vmhd;\n }\n\n function createSmhdBox(minf) {\n\n let smhd = ISOBoxer.createFullBox('smhd', minf);\n\n smhd.flags = 1;\n\n smhd.balance = 0; // is a fixed-point 8.8 number that places mono audio tracks in a stereo space; 0 is centre (the normal value); full left is -1.0 and full right is 1.0.\n smhd.reserved = 0;\n\n return smhd;\n }\n\n function createDrefBox(dinf) {\n\n let dref = ISOBoxer.createFullBox('dref', dinf);\n\n dref.entry_count = 1;\n dref.entries = [];\n\n let url = ISOBoxer.createFullBox('url ', dref, false);\n url.location = '';\n url.flags = 1;\n\n dref.entries.push(url);\n\n return dref;\n }\n\n function createStsdBox(stbl) {\n\n let stsd = ISOBoxer.createFullBox('stsd', stbl);\n\n stsd.entries = [];\n switch (adaptationSet.type) {\n case constants.VIDEO:\n case constants.AUDIO:\n stsd.entries.push(createSampleEntry(stsd));\n break;\n default:\n break;\n }\n\n stsd.entry_count = stsd.entries.length; // is an integer that counts the actual entries\n return stsd;\n }\n\n function createSampleEntry(stsd) {\n let codec = representation.codecs.substring(0, representation.codecs.indexOf('.'));\n\n switch (codec) {\n case 'avc1':\n return createAVCVisualSampleEntry(stsd, codec);\n case 'mp4a':\n return createMP4AudioSampleEntry(stsd, codec);\n default:\n throw {\n code: MssErrors.MSS_UNSUPPORTED_CODEC_CODE,\n message: MssErrors.MSS_UNSUPPORTED_CODEC_MESSAGE,\n data: {\n codec: codec\n }\n };\n }\n }\n\n function createAVCVisualSampleEntry(stsd, codec) {\n let avc1;\n\n if (contentProtection) {\n avc1 = ISOBoxer.createBox('encv', stsd, false);\n } else {\n avc1 = ISOBoxer.createBox('avc1', stsd, false);\n }\n\n // SampleEntry fields\n avc1.reserved1 = [0x0, 0x0, 0x0, 0x0, 0x0, 0x0];\n avc1.data_reference_index = 1;\n\n // VisualSampleEntry fields\n avc1.pre_defined1 = 0;\n avc1.reserved2 = 0;\n avc1.pre_defined2 = [0, 0, 0];\n avc1.height = representation.height;\n avc1.width = representation.width;\n avc1.horizresolution = 72; // 72 dpi\n avc1.vertresolution = 72; // 72 dpi\n avc1.reserved3 = 0;\n avc1.frame_count = 1; // 1 compressed video frame per sample\n avc1.compressorname = [\n 0x0A, 0x41, 0x56, 0x43, 0x20, 0x43, 0x6F, 0x64, // = 'AVC Coding';\n 0x69, 0x6E, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n ];\n avc1.depth = 0x0018; // 0x0018 – images are in colour with no alpha.\n avc1.pre_defined3 = 65535;\n avc1.config = createAVC1ConfigurationRecord();\n if (contentProtection) {\n // Create and add Protection Scheme Info Box\n let sinf = ISOBoxer.createBox('sinf', avc1);\n\n // Create and add Original Format Box => indicate codec type of the encrypted content\n createOriginalFormatBox(sinf, codec);\n\n // Create and add Scheme Type box\n createSchemeTypeBox(sinf);\n\n // Create and add Scheme Information Box\n createSchemeInformationBox(sinf);\n }\n\n return avc1;\n }\n\n function createAVC1ConfigurationRecord() {\n\n let avcC = null;\n let avcCLength = 15; // length = 15 by default (0 SPS and 0 PPS)\n\n // First get all SPS and PPS from codecPrivateData\n let sps = [];\n let pps = [];\n let AVCProfileIndication = 0;\n let AVCLevelIndication = 0;\n let profile_compatibility = 0;\n\n let nalus = representation.codecPrivateData.split('00000001').slice(1);\n let naluBytes, naluType;\n\n for (let i = 0; i < nalus.length; i++) {\n naluBytes = hexStringtoBuffer(nalus[i]);\n\n naluType = naluBytes[0] & 0x1F;\n\n switch (naluType) {\n case NALUTYPE_SPS:\n sps.push(naluBytes);\n avcCLength += naluBytes.length + 2; // 2 = sequenceParameterSetLength field length\n break;\n case NALUTYPE_PPS:\n pps.push(naluBytes);\n avcCLength += naluBytes.length + 2; // 2 = pictureParameterSetLength field length\n break;\n default:\n break;\n }\n }\n\n // Get profile and level from SPS\n if (sps.length > 0) {\n AVCProfileIndication = sps[0][1];\n profile_compatibility = sps[0][2];\n AVCLevelIndication = sps[0][3];\n }\n\n // Generate avcC buffer\n avcC = new Uint8Array(avcCLength);\n\n let i = 0;\n // length\n avcC[i++] = (avcCLength & 0xFF000000) >> 24;\n avcC[i++] = (avcCLength & 0x00FF0000) >> 16;\n avcC[i++] = (avcCLength & 0x0000FF00) >> 8;\n avcC[i++] = (avcCLength & 0x000000FF);\n avcC.set([0x61, 0x76, 0x63, 0x43], i); // type = 'avcC'\n i += 4;\n avcC[i++] = 1; // configurationVersion = 1\n avcC[i++] = AVCProfileIndication;\n avcC[i++] = profile_compatibility;\n avcC[i++] = AVCLevelIndication;\n avcC[i++] = 0xFF; // '11111' + lengthSizeMinusOne = 3\n avcC[i++] = 0xE0 | sps.length; // '111' + numOfSequenceParameterSets\n for (let n = 0; n < sps.length; n++) {\n avcC[i++] = (sps[n].length & 0xFF00) >> 8;\n avcC[i++] = (sps[n].length & 0x00FF);\n avcC.set(sps[n], i);\n i += sps[n].length;\n }\n avcC[i++] = pps.length; // numOfPictureParameterSets\n for (let n = 0; n < pps.length; n++) {\n avcC[i++] = (pps[n].length & 0xFF00) >> 8;\n avcC[i++] = (pps[n].length & 0x00FF);\n avcC.set(pps[n], i);\n i += pps[n].length;\n }\n\n return avcC;\n }\n\n function createMP4AudioSampleEntry(stsd, codec) {\n let mp4a;\n\n if (contentProtection) {\n mp4a = ISOBoxer.createBox('enca', stsd, false);\n } else {\n mp4a = ISOBoxer.createBox('mp4a', stsd, false);\n }\n\n // SampleEntry fields\n mp4a.reserved1 = [0x0, 0x0, 0x0, 0x0, 0x0, 0x0];\n mp4a.data_reference_index = 1;\n\n // AudioSampleEntry fields\n mp4a.reserved2 = [0x0, 0x0];\n mp4a.channelcount = representation.audioChannels;\n mp4a.samplesize = 16;\n mp4a.pre_defined = 0;\n mp4a.reserved_3 = 0;\n mp4a.samplerate = representation.audioSamplingRate << 16;\n\n mp4a.esds = createMPEG4AACESDescriptor();\n\n if (contentProtection) {\n // Create and add Protection Scheme Info Box\n let sinf = ISOBoxer.createBox('sinf', mp4a);\n\n // Create and add Original Format Box => indicate codec type of the encrypted content\n createOriginalFormatBox(sinf, codec);\n\n // Create and add Scheme Type box\n createSchemeTypeBox(sinf);\n\n // Create and add Scheme Information Box\n createSchemeInformationBox(sinf);\n }\n\n return mp4a;\n }\n\n function createMPEG4AACESDescriptor() {\n\n // AudioSpecificConfig (see ISO/IEC 14496-3, subpart 1) => corresponds to hex bytes contained in 'codecPrivateData' field\n let audioSpecificConfig = hexStringtoBuffer(representation.codecPrivateData);\n\n // ESDS length = esds box header length (= 12) +\n // ES_Descriptor header length (= 5) +\n // DecoderConfigDescriptor header length (= 15) +\n // decoderSpecificInfo header length (= 2) +\n // AudioSpecificConfig length (= codecPrivateData length)\n let esdsLength = 34 + audioSpecificConfig.length;\n let esds = new Uint8Array(esdsLength);\n\n let i = 0;\n // esds box\n esds[i++] = (esdsLength & 0xFF000000) >> 24; // esds box length\n esds[i++] = (esdsLength & 0x00FF0000) >> 16; // ''\n esds[i++] = (esdsLength & 0x0000FF00) >> 8; // ''\n esds[i++] = (esdsLength & 0x000000FF); // ''\n esds.set([0x65, 0x73, 0x64, 0x73], i); // type = 'esds'\n i += 4;\n esds.set([0, 0, 0, 0], i); // version = 0, flags = 0\n i += 4;\n // ES_Descriptor (see ISO/IEC 14496-1 (Systems))\n esds[i++] = 0x03; // tag = 0x03 (ES_DescrTag)\n esds[i++] = 20 + audioSpecificConfig.length; // size\n esds[i++] = (trackId & 0xFF00) >> 8; // ES_ID = track_id\n esds[i++] = (trackId & 0x00FF); // ''\n esds[i++] = 0; // flags and streamPriority\n\n // DecoderConfigDescriptor (see ISO/IEC 14496-1 (Systems))\n esds[i++] = 0x04; // tag = 0x04 (DecoderConfigDescrTag)\n esds[i++] = 15 + audioSpecificConfig.length; // size\n esds[i++] = 0x40; // objectTypeIndication = 0x40 (MPEG-4 AAC)\n esds[i] = 0x05 << 2; // streamType = 0x05 (Audiostream)\n esds[i] |= 0 << 1; // upStream = 0\n esds[i++] |= 1; // reserved = 1\n esds[i++] = 0xFF; // buffersizeDB = undefined\n esds[i++] = 0xFF; // ''\n esds[i++] = 0xFF; // ''\n esds[i++] = (representation.bandwidth & 0xFF000000) >> 24; // maxBitrate\n esds[i++] = (representation.bandwidth & 0x00FF0000) >> 16; // ''\n esds[i++] = (representation.bandwidth & 0x0000FF00) >> 8; // ''\n esds[i++] = (representation.bandwidth & 0x000000FF); // ''\n esds[i++] = (representation.bandwidth & 0xFF000000) >> 24; // avgbitrate\n esds[i++] = (representation.bandwidth & 0x00FF0000) >> 16; // ''\n esds[i++] = (representation.bandwidth & 0x0000FF00) >> 8; // ''\n esds[i++] = (representation.bandwidth & 0x000000FF); // ''\n\n // DecoderSpecificInfo (see ISO/IEC 14496-1 (Systems))\n esds[i++] = 0x05; // tag = 0x05 (DecSpecificInfoTag)\n esds[i++] = audioSpecificConfig.length; // size\n esds.set(audioSpecificConfig, i); // AudioSpecificConfig bytes\n\n return esds;\n }\n\n function createOriginalFormatBox(sinf, codec) {\n let frma = ISOBoxer.createBox('frma', sinf);\n frma.data_format = stringToCharCode(codec);\n }\n\n function createSchemeTypeBox(sinf) {\n let schm = ISOBoxer.createFullBox('schm', sinf);\n\n schm.flags = 0;\n schm.version = 0;\n schm.scheme_type = 0x63656E63; // 'cenc' => common encryption\n schm.scheme_version = 0x00010000; // version set to 0x00010000 (Major version 1, Minor version 0)\n }\n\n function createSchemeInformationBox(sinf) {\n let schi = ISOBoxer.createBox('schi', sinf);\n\n // Create and add Track Encryption Box\n createTrackEncryptionBox(schi);\n }\n\n function createProtectionSystemSpecificHeaderBox(moov, keySystems) {\n let pssh_bytes,\n pssh,\n i,\n parsedBuffer;\n\n for (i = 0; i < keySystems.length; i += 1) {\n pssh_bytes = keySystems[i].initData;\n if (pssh_bytes) {\n parsedBuffer = ISOBoxer.parseBuffer(pssh_bytes);\n pssh = parsedBuffer.fetch('pssh');\n if (pssh) {\n ISOBoxer.Utils.appendBox(moov, pssh);\n }\n }\n }\n }\n\n function createTrackEncryptionBox(schi) {\n let tenc = ISOBoxer.createFullBox('tenc', schi);\n\n tenc.flags = 0;\n tenc.version = 0;\n\n tenc.default_IsEncrypted = 0x1;\n tenc.default_IV_size = 8;\n tenc.default_KID = (contentProtection && (contentProtection.length) > 0 && contentProtection[0]['cenc:default_KID']) ?\n contentProtection[0]['cenc:default_KID'] : [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0];\n }\n\n function createTrexBox(moov) {\n let trex = ISOBoxer.createFullBox('trex', moov);\n\n trex.track_ID = trackId;\n trex.default_sample_description_index = 1;\n trex.default_sample_duration = 0;\n trex.default_sample_size = 0;\n trex.default_sample_flags = 0;\n\n return trex;\n }\n\n function hexStringtoBuffer(str) {\n let buf = new Uint8Array(str.length / 2);\n let i;\n\n for (i = 0; i < str.length / 2; i += 1) {\n buf[i] = parseInt('' + str[i * 2] + str[i * 2 + 1], 16);\n }\n return buf;\n }\n\n function stringToCharCode(str) {\n let code = 0;\n let i;\n\n for (i = 0; i < str.length; i += 1) {\n code |= str.charCodeAt(i) << ((str.length - i - 1) * 8);\n }\n return code;\n }\n\n function generateMoov(rep) {\n if (!rep || !rep.adaptation) {\n return;\n }\n\n let isoFile,\n arrayBuffer;\n\n representation = rep;\n adaptationSet = representation.adaptation;\n\n period = adaptationSet.period;\n trackId = adaptationSet.index + 1;\n contentProtection = period.mpd.manifest.Period[period.index].AdaptationSet[adaptationSet.index].ContentProtection;\n\n timescale = period.mpd.manifest.Period[period.index].AdaptationSet[adaptationSet.index].SegmentTemplate.timescale;\n\n isoFile = ISOBoxer.createFile();\n createFtypBox(isoFile);\n createMoovBox(isoFile);\n\n arrayBuffer = isoFile.write();\n\n return arrayBuffer;\n }\n\n instance = {\n generateMoov: generateMoov\n };\n\n return instance;\n}\n\nMssFragmentMoovProcessor.__dashjs_factory_name = 'MssFragmentMoovProcessor';\nexport default FactoryMaker.getClassFactory(MssFragmentMoovProcessor);\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport MssFragmentMoofProcessor from './MssFragmentMoofProcessor.js';\nimport MssFragmentMoovProcessor from './MssFragmentMoovProcessor.js';\nimport {HTTPRequest} from '../streaming/vo/metrics/HTTPRequest.js';\nimport FactoryMaker from '../core/FactoryMaker.js';\n\n\n// Add specific box processors not provided by codem-isoboxer library\n\nfunction arrayEqual(arr1, arr2) {\n return (arr1.length === arr2.length) && arr1.every(function (element, index) {\n return element === arr2[index];\n });\n}\n\nfunction saioProcessor() {\n this._procFullBox();\n if (this.flags & 1) {\n this._procField('aux_info_type', 'uint', 32);\n this._procField('aux_info_type_parameter', 'uint', 32);\n }\n this._procField('entry_count', 'uint', 32);\n this._procFieldArray('offset', this.entry_count, 'uint', (this.version === 1) ? 64 : 32);\n}\n\nfunction saizProcessor() {\n this._procFullBox();\n if (this.flags & 1) {\n this._procField('aux_info_type', 'uint', 32);\n this._procField('aux_info_type_parameter', 'uint', 32);\n }\n this._procField('default_sample_info_size', 'uint', 8);\n this._procField('sample_count', 'uint', 32);\n if (this.default_sample_info_size === 0) {\n this._procFieldArray('sample_info_size', this.sample_count, 'uint', 8);\n }\n}\n\nfunction sencProcessor() {\n this._procFullBox();\n this._procField('sample_count', 'uint', 32);\n if (this.flags & 1) {\n this._procField('IV_size', 'uint', 8);\n }\n this._procEntries('entry', this.sample_count, function (entry) {\n this._procEntryField(entry, 'InitializationVector', 'data', 8);\n if (this.flags & 2) {\n this._procEntryField(entry, 'NumberOfEntries', 'uint', 16);\n this._procSubEntries(entry, 'clearAndCryptedData', entry.NumberOfEntries, function (clearAndCryptedData) {\n this._procEntryField(clearAndCryptedData, 'BytesOfClearData', 'uint', 16);\n this._procEntryField(clearAndCryptedData, 'BytesOfEncryptedData', 'uint', 32);\n });\n }\n });\n}\n\nfunction uuidProcessor() {\n let tfxdUserType = [0x6D, 0x1D, 0x9B, 0x05, 0x42, 0xD5, 0x44, 0xE6, 0x80, 0xE2, 0x14, 0x1D, 0xAF, 0xF7, 0x57, 0xB2];\n let tfrfUserType = [0xD4, 0x80, 0x7E, 0xF2, 0xCA, 0x39, 0x46, 0x95, 0x8E, 0x54, 0x26, 0xCB, 0x9E, 0x46, 0xA7, 0x9F];\n let sepiffUserType = [0xA2, 0x39, 0x4F, 0x52, 0x5A, 0x9B, 0x4f, 0x14, 0xA2, 0x44, 0x6C, 0x42, 0x7C, 0x64, 0x8D, 0xF4];\n\n if (arrayEqual(this.usertype, tfxdUserType)) {\n this._procFullBox();\n if (this._parsing) {\n this.type = 'tfxd';\n }\n this._procField('fragment_absolute_time', 'uint', (this.version === 1) ? 64 : 32);\n this._procField('fragment_duration', 'uint', (this.version === 1) ? 64 : 32);\n }\n\n if (arrayEqual(this.usertype, tfrfUserType)) {\n this._procFullBox();\n if (this._parsing) {\n this.type = 'tfrf';\n }\n this._procField('fragment_count', 'uint', 8);\n this._procEntries('entry', this.fragment_count, function (entry) {\n this._procEntryField(entry, 'fragment_absolute_time', 'uint', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'fragment_duration', 'uint', (this.version === 1) ? 64 : 32);\n });\n }\n\n if (arrayEqual(this.usertype, sepiffUserType)) {\n if (this._parsing) {\n this.type = 'sepiff';\n }\n sencProcessor.call(this);\n }\n}\n\nfunction MssFragmentProcessor(config) {\n\n config = config || {};\n const context = this.context;\n const dashMetrics = config.dashMetrics;\n const playbackController = config.playbackController;\n const eventBus = config.eventBus;\n const protectionController = config.protectionController;\n const ISOBoxer = config.ISOBoxer;\n const debug = config.debug;\n let mssFragmentMoovProcessor,\n mssFragmentMoofProcessor,\n instance;\n\n function setup() {\n ISOBoxer.addBoxProcessor('uuid', uuidProcessor);\n ISOBoxer.addBoxProcessor('saio', saioProcessor);\n ISOBoxer.addBoxProcessor('saiz', saizProcessor);\n ISOBoxer.addBoxProcessor('senc', sencProcessor);\n\n mssFragmentMoovProcessor = MssFragmentMoovProcessor(context).create({\n protectionController: protectionController,\n constants: config.constants,\n ISOBoxer: ISOBoxer});\n\n mssFragmentMoofProcessor = MssFragmentMoofProcessor(context).create({\n dashMetrics: dashMetrics,\n playbackController: playbackController,\n ISOBoxer: ISOBoxer,\n eventBus: eventBus,\n debug: debug,\n errHandler: config.errHandler\n });\n }\n\n function generateMoov(rep) {\n return mssFragmentMoovProcessor.generateMoov(rep);\n }\n\n function processFragment(e, streamProcessor) {\n if (!e || !e.request || !e.response) {\n throw new Error('e parameter is missing or malformed');\n }\n\n if (e.request.type === 'MediaSegment') {\n // MediaSegment => convert to Smooth Streaming moof format\n mssFragmentMoofProcessor.convertFragment(e, streamProcessor);\n\n } else if (e.request.type === HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE) {\n // FragmentInfo (live) => update segments list\n mssFragmentMoofProcessor.updateSegmentList(e, streamProcessor);\n\n // Stop event propagation (FragmentInfo must not be added to buffer)\n e.sender = null;\n }\n }\n\n instance = {\n generateMoov,\n processFragment\n };\n\n setup();\n\n return instance;\n}\n\nMssFragmentProcessor.__dashjs_factory_name = 'MssFragmentProcessor';\nexport default FactoryMaker.getClassFactory(MssFragmentProcessor);\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport DataChunk from '../streaming/vo/DataChunk.js';\nimport FragmentRequest from '../streaming/vo/FragmentRequest.js';\nimport MssFragmentInfoController from './MssFragmentInfoController.js';\nimport MssFragmentProcessor from './MssFragmentProcessor.js';\nimport MssParser from './parser/MssParser.js';\nimport MssErrors from './errors/MssErrors.js';\nimport DashJSError from '../streaming/vo/DashJSError.js';\nimport {HTTPRequest} from '../streaming/vo/metrics/HTTPRequest.js';\n\nfunction MssHandler(config) {\n\n config = config || {};\n const context = this.context;\n const eventBus = config.eventBus;\n const events = config.events;\n const constants = config.constants;\n const initSegmentType = config.initSegmentType;\n const playbackController = config.playbackController;\n const streamController = config.streamController;\n let mssParser,\n mssFragmentProcessor,\n fragmentInfoControllers,\n instance;\n\n function setup() {\n fragmentInfoControllers = [];\n }\n\n function createMssFragmentProcessor() {\n mssFragmentProcessor = MssFragmentProcessor(context).create(config);\n }\n\n function getStreamProcessor(type) {\n return streamController.getActiveStreamProcessors().filter(processor => {\n return processor.getType() === type;\n })[0];\n }\n\n function getFragmentInfoController(type) {\n return fragmentInfoControllers.filter(controller => {\n return (controller.getType() === type);\n })[0];\n }\n\n function createDataChunk(request, streamId, endFragment) {\n const chunk = new DataChunk();\n\n chunk.streamId = streamId;\n chunk.segmentType = request.type;\n chunk.start = request.startTime;\n chunk.duration = request.duration;\n chunk.end = chunk.start + chunk.duration;\n chunk.index = request.index;\n chunk.bandwidth = request.bandwidth;\n chunk.representation = request.representation;\n chunk.endFragment = endFragment;\n\n return chunk;\n }\n\n function startFragmentInfoControllers() {\n\n // Create MssFragmentInfoControllers for each StreamProcessor of active stream (only for audio, video or text)\n let processors = streamController.getActiveStreamProcessors();\n processors.forEach(function (processor) {\n if (processor.getType() === constants.VIDEO ||\n processor.getType() === constants.AUDIO ||\n processor.getType() === constants.TEXT) {\n\n let fragmentInfoController = getFragmentInfoController(processor.getType());\n if (!fragmentInfoController) {\n fragmentInfoController = MssFragmentInfoController(context).create({\n streamProcessor: processor,\n baseURLController: config.baseURLController,\n debug: config.debug\n });\n fragmentInfoController.initialize();\n fragmentInfoControllers.push(fragmentInfoController);\n }\n fragmentInfoController.start();\n }\n });\n }\n\n function stopFragmentInfoControllers() {\n fragmentInfoControllers.forEach(c => {\n c.reset();\n });\n fragmentInfoControllers = [];\n }\n\n function onInitFragmentNeeded(e) {\n let streamProcessor = getStreamProcessor(e.mediaType);\n if (!streamProcessor) {\n return;\n }\n\n // Create init segment request\n let representationController = streamProcessor.getRepresentationController();\n let representation = representationController.getCurrentRepresentation();\n let mediaInfo = streamProcessor.getMediaInfo();\n\n let request = new FragmentRequest();\n request.mediaType = representation.adaptation.type;\n request.type = initSegmentType;\n request.range = representation.range;\n request.bandwidth = representation.bandwidth;\n request.representation = representation;\n\n const chunk = createDataChunk(request, mediaInfo.streamInfo.id, e.type !== events.FRAGMENT_LOADING_PROGRESS);\n\n try {\n // Generate init segment (moov)\n chunk.bytes = mssFragmentProcessor.generateMoov(representation);\n\n // Notify init segment has been loaded\n eventBus.trigger(events.INIT_FRAGMENT_LOADED,\n { chunk: chunk },\n { streamId: mediaInfo.streamInfo.id, mediaType: representation.adaptation.type }\n );\n } catch (e) {\n config.errHandler.error(new DashJSError(e.code, e.message, e.data));\n }\n\n // Change the sender value to stop event to be propagated\n e.sender = null;\n }\n\n function onSegmentMediaLoaded(e) {\n if (e.error) {\n return;\n }\n\n let streamProcessor = getStreamProcessor(e.request.mediaType);\n if (!streamProcessor) {\n return;\n }\n\n // Process moof to transcode it from MSS to DASH (or to update segment timeline for SegmentInfo fragments)\n mssFragmentProcessor.processFragment(e, streamProcessor);\n\n if (e.request.type === HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE) {\n // If FragmentInfo loaded, then notify corresponding MssFragmentInfoController\n let fragmentInfoController = getFragmentInfoController(e.request.mediaType);\n if (fragmentInfoController) {\n fragmentInfoController.fragmentInfoLoaded(e);\n }\n }\n\n // Start MssFragmentInfoControllers in case of start-over streams\n let manifestInfo = e.request.representation.mediaInfo.streamInfo.manifestInfo;\n if (!manifestInfo.isDynamic && manifestInfo.dvrWindowSize !== Infinity) {\n startFragmentInfoControllers();\n }\n }\n\n function onPlaybackPaused() {\n if (playbackController.getIsDynamic() && playbackController.getTime() !== 0) {\n startFragmentInfoControllers();\n }\n }\n\n function onPlaybackSeeking() {\n if (playbackController.getIsDynamic() && playbackController.getTime() !== 0) {\n startFragmentInfoControllers();\n }\n }\n\n function onTTMLPreProcess(ttmlSubtitles) {\n if (!ttmlSubtitles || !ttmlSubtitles.data) {\n return;\n }\n\n ttmlSubtitles.data = ttmlSubtitles.data.replace(/http:\\/\\/www.w3.org\\/2006\\/10\\/ttaf1/gi, 'http://www.w3.org/ns/ttml');\n }\n\n function registerEvents() {\n eventBus.on(events.INIT_FRAGMENT_NEEDED, onInitFragmentNeeded, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH });\n eventBus.on(events.PLAYBACK_PAUSED, onPlaybackPaused, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH });\n eventBus.on(events.PLAYBACK_SEEKING, onPlaybackSeeking, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH });\n eventBus.on(events.FRAGMENT_LOADING_COMPLETED, onSegmentMediaLoaded, instance, { priority: dashjs.FactoryMaker.getSingletonFactoryByName(eventBus.getClassName()).EVENT_PRIORITY_HIGH });\n eventBus.on(events.TTML_TO_PARSE, onTTMLPreProcess, instance);\n }\n\n function reset() {\n if (mssParser) {\n mssParser.reset();\n mssParser = undefined;\n }\n\n eventBus.off(events.INIT_FRAGMENT_NEEDED, onInitFragmentNeeded, this);\n eventBus.off(events.PLAYBACK_PAUSED, onPlaybackPaused, this);\n eventBus.off(events.PLAYBACK_SEEKING, onPlaybackSeeking, this);\n eventBus.off(events.FRAGMENT_LOADING_COMPLETED, onSegmentMediaLoaded, this);\n eventBus.off(events.TTML_TO_PARSE, onTTMLPreProcess, this);\n\n // Reset FragmentInfoControllers\n stopFragmentInfoControllers();\n }\n\n function createMssParser() {\n mssParser = MssParser(context).create(config);\n return mssParser;\n }\n\n instance = {\n reset,\n createMssParser,\n createMssFragmentProcessor,\n registerEvents\n };\n\n setup();\n\n return instance;\n}\n\nMssHandler.__dashjs_factory_name = 'MssHandler';\nconst factory = dashjs.FactoryMaker.getClassFactory(MssHandler);\nfactory.errors = MssErrors;\ndashjs.FactoryMaker.updateClassFactory(MssHandler.__dashjs_factory_name, factory);\nexport default factory;\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\nimport ErrorsBase from '../../core/errors/ErrorsBase.js';\n\n/**\n * @class\n *\n */\nclass MssErrors extends ErrorsBase {\n constructor() {\n super();\n /**\n * Error code returned when no tfrf box is detected in MSS live stream\n */\n this.MSS_NO_TFRF_CODE = 200;\n\n /**\n * Error code returned when one of the codecs defined in the manifest is not supported\n */\n this.MSS_UNSUPPORTED_CODEC_CODE = 201;\n\n this.MSS_NO_TFRF_MESSAGE = 'Missing tfrf in live media segment';\n this.MSS_UNSUPPORTED_CODEC_MESSAGE = 'Unsupported codec';\n }\n}\n\nlet mssErrors = new MssErrors();\nexport default mssErrors;\n","/**\n * The copyright in this software is being made available under the BSD License,\n * included below. This software may be subject to other third party and contributor\n * rights, including patent rights, and no such rights are granted under this license.\n *\n * Copyright (c) 2013, Dash Industry Forum.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n * * Neither the name of Dash Industry Forum nor the names of its\n * contributors may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * @module MssParser\n * @ignore\n * @param {Object} config object\n */\n\nimport BigInt from '../../../externals/BigInteger.js';\nimport FactoryMaker from '../../core/FactoryMaker.js';\nimport ProtectionConstants from '../../streaming/constants/ProtectionConstants.js';\n\nfunction MssParser(config) {\n config = config || {};\n const BASE64 = config.BASE64;\n const debug = config.debug;\n const constants = config.constants;\n const manifestModel = config.manifestModel;\n const settings = config.settings;\n\n const DEFAULT_TIME_SCALE = 10000000.0;\n const SUPPORTED_CODECS = ['AAC', 'AACL', 'AACH', 'AACP', 'AVC1', 'H264', 'TTML', 'DFXP'];\n // MPEG-DASH Role and accessibility mapping for text tracks according to ETSI TS 103 285 v1.1.1 (section 7.1.2)\n const ROLE = {\n 'CAPT': 'main',\n 'SUBT': 'alternate',\n 'DESC': 'main'\n };\n const ACCESSIBILITY = {\n 'DESC': '2'\n };\n const samplingFrequencyIndex = {\n 96000: 0x0,\n 88200: 0x1,\n 64000: 0x2,\n 48000: 0x3,\n 44100: 0x4,\n 32000: 0x5,\n 24000: 0x6,\n 22050: 0x7,\n 16000: 0x8,\n 12000: 0x9,\n 11025: 0xA,\n 8000: 0xB,\n 7350: 0xC\n };\n const mimeTypeMap = {\n 'video': 'video/mp4',\n 'audio': 'audio/mp4',\n 'text': 'application/mp4'\n };\n\n let instance,\n logger,\n initialBufferSettings;\n\n\n function setup() {\n logger = debug.getLogger(instance);\n }\n\n function getAttributeAsBoolean(node, attrName) {\n const value = node.getAttribute(attrName);\n if (!value) {\n return false;\n }\n return value.toLowerCase() === 'true';\n }\n\n function mapPeriod(smoothStreamingMedia, timescale) {\n const period = {};\n let streams,\n adaptation;\n\n // For each StreamIndex node, create an AdaptationSet element\n period.AdaptationSet = [];\n streams = smoothStreamingMedia.getElementsByTagName('StreamIndex');\n for (let i = 0; i < streams.length; i++) {\n adaptation = mapAdaptationSet(streams[i], timescale);\n if (adaptation !== null) {\n period.AdaptationSet.push(adaptation);\n }\n }\n\n return period;\n }\n\n function mapAdaptationSet(streamIndex, timescale) {\n const adaptationSet = {};\n const representations = [];\n let segmentTemplate;\n let qualityLevels,\n representation,\n i,\n index;\n\n const name = streamIndex.getAttribute('Name');\n const type = streamIndex.getAttribute('Type');\n const lang = streamIndex.getAttribute('Language');\n const fallBackId = lang ? type + '_' + lang : type;\n\n adaptationSet.id = name || fallBackId;\n adaptationSet.contentType = type;\n adaptationSet.lang = lang || 'und';\n adaptationSet.mimeType = mimeTypeMap[type];\n adaptationSet.subType = streamIndex.getAttribute('Subtype');\n adaptationSet.maxWidth = streamIndex.getAttribute('MaxWidth');\n adaptationSet.maxHeight = streamIndex.getAttribute('MaxHeight');\n\n // Map text tracks subTypes to MPEG-DASH AdaptationSet role and accessibility (see ETSI TS 103 285 v1.1.1, section 7.1.2)\n if (adaptationSet.subType) {\n if (ROLE[adaptationSet.subType]) {\n adaptationSet.Role = [{\n schemeIdUri: 'urn:mpeg:dash:role:2011',\n value: ROLE[adaptationSet.subType]\n }];\n }\n if (ACCESSIBILITY[adaptationSet.subType]) {\n adaptationSet.Accessibility = [{\n schemeIdUri: 'urn:tva:metadata:cs:AudioPurposeCS:2007',\n value: ACCESSIBILITY[adaptationSet.subType]\n }];\n }\n }\n\n // Create a SegmentTemplate with a SegmentTimeline\n segmentTemplate = mapSegmentTemplate(streamIndex, timescale);\n\n qualityLevels = streamIndex.getElementsByTagName('QualityLevel');\n // For each QualityLevel node, create a Representation element\n for (i = 0; i < qualityLevels.length; i++) {\n // Propagate BaseURL and mimeType\n qualityLevels[i].BaseURL = adaptationSet.BaseURL;\n qualityLevels[i].mimeType = adaptationSet.mimeType;\n\n // Set quality level id\n index = qualityLevels[i].getAttribute('Index');\n qualityLevels[i].Id = adaptationSet.id + ((index !== null) ? ('_' + index) : '');\n\n // Map Representation to QualityLevel\n representation = mapRepresentation(qualityLevels[i], streamIndex);\n\n if (representation !== null) {\n // Copy SegmentTemplate into Representation\n representation.SegmentTemplate = segmentTemplate;\n\n representations.push(representation);\n }\n }\n\n if (representations.length === 0) {\n return null;\n }\n\n adaptationSet.Representation = representations;\n\n // Set SegmentTemplate\n adaptationSet.SegmentTemplate = segmentTemplate;\n\n return adaptationSet;\n }\n\n function mapRepresentation(qualityLevel, streamIndex) {\n const representation = {};\n const type = streamIndex.getAttribute('Type');\n let fourCCValue = null;\n let width = null;\n let height = null;\n\n representation.id = qualityLevel.Id;\n representation.bandwidth = parseInt(qualityLevel.getAttribute('Bitrate'), 10);\n representation.mimeType = qualityLevel.mimeType;\n\n width = parseInt(qualityLevel.getAttribute('MaxWidth'), 10);\n height = parseInt(qualityLevel.getAttribute('MaxHeight'), 10);\n if (!isNaN(width)) {\n representation.width = width;\n }\n if (!isNaN(height)) {\n representation.height = height;\n }\n\n\n fourCCValue = qualityLevel.getAttribute('FourCC');\n\n // If FourCC not defined at QualityLevel level, then get it from StreamIndex level\n if (fourCCValue === null || fourCCValue === '') {\n fourCCValue = streamIndex.getAttribute('FourCC');\n }\n\n // If still not defined (optionnal for audio stream, see https://msdn.microsoft.com/en-us/library/ff728116%28v=vs.95%29.aspx),\n // then we consider the stream is an audio AAC stream\n if (fourCCValue === null || fourCCValue === '') {\n if (type === constants.AUDIO) {\n fourCCValue = 'AAC';\n } else if (type === constants.VIDEO) {\n logger.debug('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type \"video\"');\n return null;\n }\n }\n\n // Check if codec is supported\n if (SUPPORTED_CODECS.indexOf(fourCCValue.toUpperCase()) === -1) {\n // Do not send warning\n logger.warn('Codec not supported: ' + fourCCValue);\n return null;\n }\n\n // Get codecs value according to FourCC field\n if (fourCCValue === 'H264' || fourCCValue === 'AVC1') {\n representation.codecs = getH264Codec(qualityLevel);\n } else if (fourCCValue.indexOf('AAC') >= 0) {\n representation.codecs = getAACCodec(qualityLevel, fourCCValue);\n representation.audioSamplingRate = parseInt(qualityLevel.getAttribute('SamplingRate'), 10);\n representation.audioChannels = parseInt(qualityLevel.getAttribute('Channels'), 10);\n } else if (fourCCValue.indexOf('TTML') || fourCCValue.indexOf('DFXP')) {\n representation.codecs = constants.STPP;\n }\n\n representation.codecPrivateData = '' + qualityLevel.getAttribute('CodecPrivateData');\n representation.BaseURL = qualityLevel.BaseURL;\n\n return representation;\n }\n\n function getH264Codec(qualityLevel) {\n let codecPrivateData = qualityLevel.getAttribute('CodecPrivateData').toString();\n let nalHeader,\n avcoti;\n\n\n // Extract from the CodecPrivateData field the hexadecimal representation of the following\n // three bytes in the sequence parameter set NAL unit.\n // => Find the SPS nal header\n nalHeader = /00000001[0-9]7/.exec(codecPrivateData);\n // => Find the 6 characters after the SPS nalHeader (if it exists)\n avcoti = nalHeader && nalHeader[0] ? (codecPrivateData.substr(codecPrivateData.indexOf(nalHeader[0]) + 10, 6)) : undefined;\n\n return 'avc1.' + avcoti;\n }\n\n function getAACCodec(qualityLevel, fourCCValue) {\n const samplingRate = parseInt(qualityLevel.getAttribute('SamplingRate'), 10);\n let codecPrivateData = qualityLevel.getAttribute('CodecPrivateData').toString();\n let objectType = 0;\n let codecPrivateDataHex,\n arr16,\n indexFreq,\n extensionSamplingFrequencyIndex;\n\n //chrome problem, in implicit AAC HE definition, so when AACH is detected in FourCC\n //set objectType to 5 => strange, it should be 2\n if (fourCCValue === 'AACH') {\n objectType = 0x05;\n }\n //if codecPrivateData is empty, build it :\n if (codecPrivateData === undefined || codecPrivateData === '') {\n objectType = 0x02; //AAC Main Low Complexity => object Type = 2\n indexFreq = samplingFrequencyIndex[samplingRate];\n if (fourCCValue === 'AACH') {\n // 4 bytes : XXXXX XXXX XXXX XXXX XXXXX XXX XXXXXXX\n // ' ObjectType' 'Freq Index' 'Channels value' 'Extens Sampl Freq' 'ObjectType' 'GAS' 'alignment = 0'\n objectType = 0x05; // High Efficiency AAC Profile = object Type = 5 SBR\n codecPrivateData = new Uint8Array(4);\n extensionSamplingFrequencyIndex = samplingFrequencyIndex[samplingRate * 2]; // in HE AAC Extension Sampling frequence\n // equals to SamplingRate*2\n //Freq Index is present for 3 bits in the first byte, last bit is in the second\n codecPrivateData[0] = (objectType << 3) | (indexFreq >> 1);\n codecPrivateData[1] = (indexFreq << 7) | (qualityLevel.Channels << 3) | (extensionSamplingFrequencyIndex >> 1);\n codecPrivateData[2] = (extensionSamplingFrequencyIndex << 7) | (0x02 << 2); // origin object type equals to 2 => AAC Main Low Complexity\n codecPrivateData[3] = 0x0; //alignment bits\n\n arr16 = new Uint16Array(2);\n arr16[0] = (codecPrivateData[0] << 8) + codecPrivateData[1];\n arr16[1] = (codecPrivateData[2] << 8) + codecPrivateData[3];\n //convert decimal to hex value\n codecPrivateDataHex = arr16[0].toString(16);\n codecPrivateDataHex = arr16[0].toString(16) + arr16[1].toString(16);\n\n } else {\n // 2 bytes : XXXXX XXXX XXXX XXX\n // ' ObjectType' 'Freq Index' 'Channels value' 'GAS = 000'\n codecPrivateData = new Uint8Array(2);\n //Freq Index is present for 3 bits in the first byte, last bit is in the second\n codecPrivateData[0] = (objectType << 3) | (indexFreq >> 1);\n codecPrivateData[1] = (indexFreq << 7) | (parseInt(qualityLevel.getAttribute('Channels'), 10) << 3);\n // put the 2 bytes in an 16 bits array\n arr16 = new Uint16Array(1);\n arr16[0] = (codecPrivateData[0] << 8) + codecPrivateData[1];\n //convert decimal to hex value\n codecPrivateDataHex = arr16[0].toString(16);\n }\n\n codecPrivateData = '' + codecPrivateDataHex;\n codecPrivateData = codecPrivateData.toUpperCase();\n qualityLevel.setAttribute('CodecPrivateData', codecPrivateData);\n } else if (objectType === 0) {\n objectType = (parseInt(codecPrivateData.substr(0, 2), 16) & 0xF8) >> 3;\n }\n\n return 'mp4a.40.' + objectType;\n }\n\n function mapSegmentTemplate(streamIndex, timescale) {\n const segmentTemplate = {};\n let mediaUrl,\n streamIndexTimeScale,\n url;\n\n url = streamIndex.getAttribute('Url');\n mediaUrl = url ? url.replace('{bitrate}', '$Bandwidth$') : null;\n mediaUrl = mediaUrl ? mediaUrl.replace('{start time}', '$Time$') : null;\n\n streamIndexTimeScale = streamIndex.getAttribute('TimeScale');\n streamIndexTimeScale = streamIndexTimeScale ? parseFloat(streamIndexTimeScale) : timescale;\n\n segmentTemplate.media = mediaUrl;\n segmentTemplate.timescale = streamIndexTimeScale;\n\n segmentTemplate.SegmentTimeline = mapSegmentTimeline(streamIndex, segmentTemplate.timescale);\n\n // Patch: set availabilityTimeOffset to Infinity since segments are available as long as they are present in timeline\n segmentTemplate.availabilityTimeOffset = 'INF';\n\n return segmentTemplate;\n }\n\n function mapSegmentTimeline(streamIndex, timescale) {\n const segmentTimeline = {};\n const chunks = streamIndex.getElementsByTagName('c');\n const segments = [];\n let segment,\n prevSegment,\n tManifest,\n i, j, r;\n let duration = 0;\n\n for (i = 0; i < chunks.length; i++) {\n segment = {};\n\n // Get time 't' attribute value\n tManifest = chunks[i].getAttribute('t');\n\n // => segment.tManifest = original timestamp value as a string (for constructing the fragment request url, see DashHandler)\n // => segment.t = number value of timestamp (maybe rounded value, but only for 0.1 microsecond)\n if (tManifest && BigInt(tManifest).greater(BigInt(Number.MAX_SAFE_INTEGER))) {\n segment.tManifest = tManifest;\n }\n segment.t = parseFloat(tManifest);\n\n // Get duration 'd' attribute value\n segment.d = parseFloat(chunks[i].getAttribute('d'));\n\n // If 't' not defined for first segment then t=0\n if ((i === 0) && !segment.t) {\n segment.t = 0;\n }\n\n if (i > 0) {\n prevSegment = segments[segments.length - 1];\n // Update previous segment duration if not defined\n if (!prevSegment.d) {\n if (prevSegment.tManifest) {\n prevSegment.d = BigInt(tManifest).subtract(BigInt(prevSegment.tManifest)).toJSNumber();\n } else {\n prevSegment.d = segment.t - prevSegment.t;\n }\n duration += prevSegment.d;\n }\n // Set segment absolute timestamp if not set in manifest\n if (!segment.t) {\n if (prevSegment.tManifest) {\n segment.tManifest = BigInt(prevSegment.tManifest).add(BigInt(prevSegment.d)).toString();\n segment.t = parseFloat(segment.tManifest);\n } else {\n segment.t = prevSegment.t + prevSegment.d;\n }\n }\n }\n\n if (segment.d) {\n duration += segment.d;\n }\n\n // Create new segment\n segments.push(segment);\n\n // Support for 'r' attribute (i.e. \"repeat\" as in MPEG-DASH)\n r = parseFloat(chunks[i].getAttribute('r'));\n if (r) {\n\n for (j = 0; j < (r - 1); j++) {\n prevSegment = segments[segments.length - 1];\n segment = {};\n segment.t = prevSegment.t + prevSegment.d;\n segment.d = prevSegment.d;\n if (prevSegment.tManifest) {\n segment.tManifest = BigInt(prevSegment.tManifest).add(BigInt(prevSegment.d)).toString();\n }\n duration += segment.d;\n segments.push(segment);\n }\n }\n }\n\n segmentTimeline.S = segments;\n segmentTimeline.duration = duration / timescale;\n\n return segmentTimeline;\n }\n\n function getKIDFromProtectionHeader(protectionHeader) {\n let prHeader,\n wrmHeader,\n xmlReader,\n KID;\n\n // Get PlayReady header as byte array (base64 decoded)\n prHeader = BASE64.decodeArray(protectionHeader.firstChild.data);\n\n // Get Right Management header (WRMHEADER) from PlayReady header\n wrmHeader = getWRMHeaderFromPRHeader(prHeader);\n\n if (wrmHeader) {\n // Convert from multi-byte to unicode\n wrmHeader = new Uint16Array(wrmHeader.buffer);\n\n // Convert to string\n wrmHeader = String.fromCharCode.apply(null, wrmHeader);\n\n // Parse to get KID field value\n xmlReader = (new DOMParser()).parseFromString(wrmHeader, 'application/xml');\n KID = xmlReader.querySelector('KID').textContent;\n\n // Get KID (base64 decoded) as byte array\n KID = BASE64.decodeArray(KID);\n\n // Convert UUID from little-endian to big-endian\n convertUuidEndianness(KID);\n }\n\n return KID;\n }\n\n function getWRMHeaderFromPRHeader(prHeader) {\n let length,\n recordCount,\n recordType,\n recordLength,\n recordValue;\n let i = 0;\n\n // Parse PlayReady header\n\n // Length - 32 bits (LE format)\n length = (prHeader[i + 3] << 24) + (prHeader[i + 2] << 16) + (prHeader[i + 1] << 8) + prHeader[i]; // eslint-disable-line\n i += 4;\n\n // Record count - 16 bits (LE format)\n recordCount = (prHeader[i + 1] << 8) + prHeader[i]; // eslint-disable-line\n i += 2;\n\n // Parse records\n while (i < prHeader.length) {\n // Record type - 16 bits (LE format)\n recordType = (prHeader[i + 1] << 8) + prHeader[i];\n i += 2;\n\n // Check if Rights Management header (record type = 0x01)\n if (recordType === 0x01) {\n\n // Record length - 16 bits (LE format)\n recordLength = (prHeader[i + 1] << 8) + prHeader[i];\n i += 2;\n\n // Record value => contains \n recordValue = new Uint8Array(recordLength);\n recordValue.set(prHeader.subarray(i, i + recordLength));\n return recordValue;\n }\n }\n\n return null;\n }\n\n function convertUuidEndianness(uuid) {\n swapBytes(uuid, 0, 3);\n swapBytes(uuid, 1, 2);\n swapBytes(uuid, 4, 5);\n swapBytes(uuid, 6, 7);\n }\n\n function swapBytes(bytes, pos1, pos2) {\n const temp = bytes[pos1];\n bytes[pos1] = bytes[pos2];\n bytes[pos2] = temp;\n }\n\n\n function createPRContentProtection(protectionHeader) {\n let pro = {\n __text: protectionHeader.firstChild.data,\n __prefix: 'mspr'\n };\n return {\n schemeIdUri: 'urn:uuid:' + ProtectionConstants.PLAYREADY_UUID,\n value: ProtectionConstants.PLAYREADY_KEYSTEM_STRING,\n pro: pro\n };\n }\n\n function createWidevineContentProtection(KID) {\n let widevineCP = {\n schemeIdUri: 'urn:uuid:' + ProtectionConstants.WIDEVINE_UUID,\n value: ProtectionConstants.WIDEVINE_KEYSTEM_STRING\n };\n if (!KID) {\n return widevineCP;\n }\n // Create Widevine CENC header (Protocol Buffer) with KID value\n const wvCencHeader = new Uint8Array(2 + KID.length);\n wvCencHeader[0] = 0x12;\n wvCencHeader[1] = 0x10;\n wvCencHeader.set(KID, 2);\n\n // Create a pssh box\n const length = 12 /* box length, type, version and flags */ + 16 /* SystemID */ + 4 /* data length */ + wvCencHeader.length;\n let pssh = new Uint8Array(length);\n let i = 0;\n\n // Set box length value\n pssh[i++] = (length & 0xFF000000) >> 24;\n pssh[i++] = (length & 0x00FF0000) >> 16;\n pssh[i++] = (length & 0x0000FF00) >> 8;\n pssh[i++] = (length & 0x000000FF);\n\n // Set type ('pssh'), version (0) and flags (0)\n pssh.set([0x70, 0x73, 0x73, 0x68, 0x00, 0x00, 0x00, 0x00], i);\n i += 8;\n\n // Set SystemID ('edef8ba9-79d6-4ace-a3c8-27dcd51d21ed')\n pssh.set([0xed, 0xef, 0x8b, 0xa9, 0x79, 0xd6, 0x4a, 0xce, 0xa3, 0xc8, 0x27, 0xdc, 0xd5, 0x1d, 0x21, 0xed], i);\n i += 16;\n\n // Set data length value\n pssh[i++] = (wvCencHeader.length & 0xFF000000) >> 24;\n pssh[i++] = (wvCencHeader.length & 0x00FF0000) >> 16;\n pssh[i++] = (wvCencHeader.length & 0x0000FF00) >> 8;\n pssh[i++] = (wvCencHeader.length & 0x000000FF);\n\n // Copy Widevine CENC header\n pssh.set(wvCencHeader, i);\n\n // Convert to BASE64 string\n pssh = String.fromCharCode.apply(null, pssh);\n pssh = BASE64.encodeASCII(pssh);\n\n widevineCP.pssh = { __text: pssh };\n\n return widevineCP;\n }\n\n function processManifest(xmlDoc) {\n const manifest = {};\n const contentProtections = [];\n const smoothStreamingMedia = xmlDoc.getElementsByTagName('SmoothStreamingMedia')[0];\n const protection = xmlDoc.getElementsByTagName('Protection')[0];\n let protectionHeader = null;\n let period,\n adaptations,\n contentProtection,\n KID,\n timestampOffset,\n startTime,\n segments,\n timescale,\n segmentDuration,\n i, j;\n\n // Set manifest node properties\n manifest.protocol = 'MSS';\n manifest.profiles = 'urn:mpeg:dash:profile:isoff-live:2011';\n manifest.type = getAttributeAsBoolean(smoothStreamingMedia, 'IsLive') ? 'dynamic' : 'static';\n timescale = smoothStreamingMedia.getAttribute('TimeScale');\n manifest.timescale = timescale ? parseFloat(timescale) : DEFAULT_TIME_SCALE;\n let dvrWindowLength = parseFloat(smoothStreamingMedia.getAttribute('DVRWindowLength'));\n // If the DVRWindowLength field is omitted for a live presentation or set to 0, the DVR window is effectively infinite\n if (manifest.type === 'dynamic' && (dvrWindowLength === 0 || isNaN(dvrWindowLength))) {\n dvrWindowLength = Infinity;\n }\n // Star-over\n if (dvrWindowLength === 0 && getAttributeAsBoolean(smoothStreamingMedia, 'CanSeek')) {\n dvrWindowLength = Infinity;\n }\n\n if (dvrWindowLength > 0) {\n manifest.timeShiftBufferDepth = dvrWindowLength / manifest.timescale;\n }\n\n let duration = parseFloat(smoothStreamingMedia.getAttribute('Duration'));\n manifest.mediaPresentationDuration = (duration === 0) ? Infinity : duration / manifest.timescale;\n // By default, set minBufferTime to 2 sec. (but set below according to video segment duration)\n manifest.minBufferTime = 2;\n manifest.ttmlTimeIsRelative = true;\n\n // Live manifest with Duration = start-over\n if (manifest.type === 'dynamic' && duration > 0) {\n manifest.type = 'static';\n // We set timeShiftBufferDepth to initial duration, to be used by MssFragmentController to update segment timeline\n manifest.timeShiftBufferDepth = duration / manifest.timescale;\n // Duration will be set according to current segment timeline duration (see below)\n }\n\n if (manifest.type === 'dynamic') {\n manifest.refreshManifestOnSwitchTrack = true; // Refresh manifest when switching tracks\n manifest.doNotUpdateDVRWindowOnBufferUpdated = true; // DVRWindow is update by MssFragmentMoofPocessor based on tfrf boxes\n manifest.ignorePostponeTimePeriod = true; // Never update manifest\n manifest.availabilityStartTime = new Date(null); // Returns 1970\n }\n\n // Map period node to manifest root node\n period = mapPeriod(smoothStreamingMedia, manifest.timescale);\n manifest.Period = [period];\n\n // Initialize period start time\n period.start = 0;\n\n // Uncomment to test live to static manifests\n // if (manifest.type !== 'static') {\n // manifest.type = 'static';\n // manifest.mediaPresentationDuration = manifest.timeShiftBufferDepth;\n // manifest.timeShiftBufferDepth = null;\n // }\n\n // ContentProtection node\n if (protection !== undefined) {\n protectionHeader = xmlDoc.getElementsByTagName('ProtectionHeader')[0];\n\n // Some packagers put newlines into the ProtectionHeader base64 string, which is not good\n // because this cannot be correctly parsed. Let's just filter out any newlines found in there.\n protectionHeader.firstChild.data = protectionHeader.firstChild.data.replace(/\\n|\\r/g, '');\n\n // Get KID (in CENC format) from protection header\n KID = getKIDFromProtectionHeader(protectionHeader);\n\n // Create ContentProtection for PlayReady\n contentProtection = createPRContentProtection(protectionHeader);\n contentProtection['cenc:default_KID'] = KID;\n contentProtections.push(contentProtection);\n\n // Create ContentProtection for Widevine (as a CENC protection)\n contentProtection = createWidevineContentProtection(KID);\n contentProtection['cenc:default_KID'] = KID;\n contentProtections.push(contentProtection);\n\n manifest.ContentProtection = contentProtections;\n }\n\n adaptations = period.AdaptationSet;\n\n for (i = 0; i < adaptations.length; i += 1) {\n adaptations[i].SegmentTemplate.initialization = '$Bandwidth$';\n // Propagate content protection information into each adaptation\n if (manifest.ContentProtection !== undefined) {\n adaptations[i].ContentProtection = manifest.ContentProtection;\n adaptations[i].ContentProtection = manifest.ContentProtection;\n }\n\n if (adaptations[i].contentType === 'video') {\n // Get video segment duration\n segmentDuration = adaptations[i].SegmentTemplate.SegmentTimeline.S[0].d / adaptations[i].SegmentTemplate.timescale;\n // Set minBufferTime to one segment duration\n manifest.minBufferTime = segmentDuration;\n\n if (manifest.type === 'dynamic') {\n // Match timeShiftBufferDepth to video segment timeline duration\n if (manifest.timeShiftBufferDepth > 0 &&\n manifest.timeShiftBufferDepth !== Infinity &&\n manifest.timeShiftBufferDepth > adaptations[i].SegmentTemplate.SegmentTimeline.duration) {\n manifest.timeShiftBufferDepth = adaptations[i].SegmentTemplate.SegmentTimeline.duration;\n }\n }\n }\n }\n\n // Cap minBufferTime to timeShiftBufferDepth\n manifest.minBufferTime = Math.min(manifest.minBufferTime, (manifest.timeShiftBufferDepth ? manifest.timeShiftBufferDepth : Infinity));\n\n // In case of live streams:\n // 1- configure player buffering properties according to target live delay\n // 2- adapt live delay and then buffers length in case timeShiftBufferDepth is too small compared to target live delay (see PlaybackController.computeLiveDelay())\n // 3- Set retry attempts and intervals for FragmentInfo requests\n if (manifest.type === 'dynamic') {\n let targetLiveDelay = settings.get().streaming.delay.liveDelay;\n if (!targetLiveDelay) {\n const liveDelayFragmentCount = settings.get().streaming.delay.liveDelayFragmentCount !== null && !isNaN(settings.get().streaming.delay.liveDelayFragmentCount) ? settings.get().streaming.delay.liveDelayFragmentCount : 4;\n targetLiveDelay = segmentDuration * liveDelayFragmentCount;\n }\n let targetDelayCapping = Math.max(manifest.timeShiftBufferDepth - 10/*END_OF_PLAYLIST_PADDING*/, manifest.timeShiftBufferDepth / 2);\n let liveDelay = Math.min(targetDelayCapping, targetLiveDelay);\n // Consider a margin of more than one segment in order to avoid Precondition Failed errors (412), for example if audio and video are not correctly synchronized\n let bufferTime = liveDelay - (segmentDuration * 1.5);\n\n // Store initial buffer settings\n initialBufferSettings = {\n 'streaming': {\n 'buffer': {\n 'bufferTimeDefault': settings.get().streaming.buffer.bufferTimeDefault,\n 'bufferTimeAtTopQuality': settings.get().streaming.buffer.bufferTimeAtTopQuality,\n 'bufferTimeAtTopQualityLongForm': settings.get().streaming.buffer.bufferTimeAtTopQualityLongForm\n },\n 'timeShiftBuffer': {\n calcFromSegmentTimeline: settings.get().streaming.timeShiftBuffer.calcFromSegmentTimeline\n },\n 'delay': {\n 'liveDelay': settings.get().streaming.delay.liveDelay\n }\n }\n };\n\n settings.update({\n 'streaming': {\n 'buffer': {\n 'bufferTimeDefault': bufferTime,\n 'bufferTimeAtTopQuality': bufferTime,\n 'bufferTimeAtTopQualityLongForm': bufferTime\n },\n 'timeShiftBuffer': {\n calcFromSegmentTimeline: true\n },\n 'delay': {\n 'liveDelay': liveDelay\n }\n }\n });\n }\n\n // Delete Content Protection under root manifest node\n delete manifest.ContentProtection;\n\n // In case of VOD streams, check if start time is greater than 0\n // Then determine timestamp offset according to higher audio/video start time\n // (use case = live stream delinearization)\n if (manifest.type === 'static') {\n // In case of start-over stream and manifest reloading (due to track switch)\n // we consider previous timestampOffset to keep timelines synchronized\n var prevManifest = manifestModel.getValue();\n if (prevManifest && prevManifest.timestampOffset) {\n timestampOffset = prevManifest.timestampOffset;\n } else {\n for (i = 0; i < adaptations.length; i++) {\n if (adaptations[i].contentType === constants.AUDIO || adaptations[i].contentType === constants.VIDEO) {\n segments = adaptations[i].SegmentTemplate.SegmentTimeline.S;\n startTime = segments[0].t;\n if (timestampOffset === undefined) {\n timestampOffset = startTime;\n }\n timestampOffset = Math.min(timestampOffset, startTime);\n // Correct content duration according to minimum adaptation's segment timeline duration\n // in order to force