园林绿化
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6083 lines
278 KiB

  1. !(function (e, t) {
  2. "object" == typeof exports && "object" == typeof module
  3. ? (module.exports = t())
  4. : "function" == typeof define && define.amd
  5. ? define([], t)
  6. : "object" == typeof exports
  7. ? (exports.flvjs = t())
  8. : (e.flvjs = t());
  9. })(self, function () {
  10. return (function () {
  11. var e = {
  12. 264: function (e, t, i) {
  13. /*!
  14. * @overview es6-promise - a tiny implementation of Promises/A+.
  15. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  16. * @license Licensed under MIT license
  17. * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  18. * @version v4.2.8+1e68dce6
  19. */
  20. e.exports = (function () {
  21. "use strict";
  22. function e(e) {
  23. var t = typeof e;
  24. return null !== e && ("object" === t || "function" === t);
  25. }
  26. function t(e) {
  27. return "function" == typeof e;
  28. }
  29. var n = Array.isArray
  30. ? Array.isArray
  31. : function (e) {
  32. return "[object Array]" === Object.prototype.toString.call(e);
  33. },
  34. r = 0,
  35. s = void 0,
  36. o = void 0,
  37. a = function (e, t) {
  38. (b[r] = e), (b[r + 1] = t), 2 === (r += 2) && (o ? o(E) : A());
  39. };
  40. function h(e) {
  41. o = e;
  42. }
  43. function u(e) {
  44. a = e;
  45. }
  46. var l = "undefined" != typeof window ? window : void 0,
  47. d = l || {},
  48. c = d.MutationObserver || d.WebKitMutationObserver,
  49. f = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process),
  50. _ = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel;
  51. function p() {
  52. return function () {
  53. return process.nextTick(E);
  54. };
  55. }
  56. function m() {
  57. return void 0 !== s
  58. ? function () {
  59. s(E);
  60. }
  61. : y();
  62. }
  63. function g() {
  64. var e = 0,
  65. t = new c(E),
  66. i = document.createTextNode("");
  67. return (
  68. t.observe(i, { characterData: !0 }),
  69. function () {
  70. i.data = e = ++e % 2;
  71. }
  72. );
  73. }
  74. function v() {
  75. var e = new MessageChannel();
  76. return (
  77. (e.port1.onmessage = E),
  78. function () {
  79. return e.port2.postMessage(0);
  80. }
  81. );
  82. }
  83. function y() {
  84. var e = setTimeout;
  85. return function () {
  86. return e(E, 1);
  87. };
  88. }
  89. var b = new Array(1e3);
  90. function E() {
  91. for (var e = 0; e < r; e += 2) (0, b[e])(b[e + 1]), (b[e] = void 0), (b[e + 1] = void 0);
  92. r = 0;
  93. }
  94. function S() {
  95. try {
  96. var e = Function("return this")().require("vertx");
  97. return (s = e.runOnLoop || e.runOnContext), m();
  98. } catch (e) {
  99. return y();
  100. }
  101. }
  102. var A = void 0;
  103. function L(e, t) {
  104. var i = this,
  105. n = new this.constructor(O);
  106. void 0 === n[w] && W(n);
  107. var r = i._state;
  108. if (r) {
  109. var s = arguments[r - 1];
  110. a(function () {
  111. return V(r, n, s, i._result);
  112. });
  113. } else G(i, n, e, t);
  114. return n;
  115. }
  116. function R(e) {
  117. var t = this;
  118. if (e && "object" == typeof e && e.constructor === t) return e;
  119. var i = new t(O);
  120. return U(i, e), i;
  121. }
  122. A = f ? p() : c ? g() : _ ? v() : void 0 === l ? S() : y();
  123. var w = Math.random().toString(36).substring(2);
  124. function O() {}
  125. var T = void 0,
  126. C = 1,
  127. k = 2;
  128. function D() {
  129. return new TypeError("You cannot resolve a promise with itself");
  130. }
  131. function I() {
  132. return new TypeError("A promises callback cannot return that same promise.");
  133. }
  134. function M(e, t, i, n) {
  135. try {
  136. e.call(t, i, n);
  137. } catch (e) {
  138. return e;
  139. }
  140. }
  141. function B(e, t, i) {
  142. a(function (e) {
  143. var n = !1,
  144. r = M(
  145. i,
  146. t,
  147. function (i) {
  148. n || ((n = !0), t !== i ? U(e, i) : Z(e, i));
  149. },
  150. function (t) {
  151. n || ((n = !0), F(e, t));
  152. },
  153. "Settle: " + (e._label || " unknown promise")
  154. );
  155. !n && r && ((n = !0), F(e, r));
  156. }, e);
  157. }
  158. function x(e, t) {
  159. t._state === C
  160. ? Z(e, t._result)
  161. : t._state === k
  162. ? F(e, t._result)
  163. : G(
  164. t,
  165. void 0,
  166. function (t) {
  167. return U(e, t);
  168. },
  169. function (t) {
  170. return F(e, t);
  171. }
  172. );
  173. }
  174. function P(e, i, n) {
  175. i.constructor === e.constructor && n === L && i.constructor.resolve === R
  176. ? x(e, i)
  177. : void 0 === n
  178. ? Z(e, i)
  179. : t(n)
  180. ? B(e, i, n)
  181. : Z(e, i);
  182. }
  183. function U(t, i) {
  184. if (t === i) F(t, D());
  185. else if (e(i)) {
  186. var n = void 0;
  187. try {
  188. n = i.then;
  189. } catch (e) {
  190. return void F(t, e);
  191. }
  192. P(t, i, n);
  193. } else Z(t, i);
  194. }
  195. function N(e) {
  196. e._onerror && e._onerror(e._result), j(e);
  197. }
  198. function Z(e, t) {
  199. e._state === T && ((e._result = t), (e._state = C), 0 !== e._subscribers.length && a(j, e));
  200. }
  201. function F(e, t) {
  202. e._state === T && ((e._state = k), (e._result = t), a(N, e));
  203. }
  204. function G(e, t, i, n) {
  205. var r = e._subscribers,
  206. s = r.length;
  207. (e._onerror = null), (r[s] = t), (r[s + C] = i), (r[s + k] = n), 0 === s && e._state && a(j, e);
  208. }
  209. function j(e) {
  210. var t = e._subscribers,
  211. i = e._state;
  212. if (0 !== t.length) {
  213. for (var n = void 0, r = void 0, s = e._result, o = 0; o < t.length; o += 3) (n = t[o]), (r = t[o + i]), n ? V(i, n, r, s) : r(s);
  214. e._subscribers.length = 0;
  215. }
  216. }
  217. function V(e, i, n, r) {
  218. var s = t(n),
  219. o = void 0,
  220. a = void 0,
  221. h = !0;
  222. if (s) {
  223. try {
  224. o = n(r);
  225. } catch (e) {
  226. (h = !1), (a = e);
  227. }
  228. if (i === o) return void F(i, I());
  229. } else o = r;
  230. i._state !== T || (s && h ? U(i, o) : !1 === h ? F(i, a) : e === C ? Z(i, o) : e === k && F(i, o));
  231. }
  232. function z(e, t) {
  233. try {
  234. t(
  235. function (t) {
  236. U(e, t);
  237. },
  238. function (t) {
  239. F(e, t);
  240. }
  241. );
  242. } catch (t) {
  243. F(e, t);
  244. }
  245. }
  246. var K = 0;
  247. function H() {
  248. return K++;
  249. }
  250. function W(e) {
  251. (e[w] = K++), (e._state = void 0), (e._result = void 0), (e._subscribers = []);
  252. }
  253. function q() {
  254. return new Error("Array Methods must be provided an Array");
  255. }
  256. var Y = (function () {
  257. function e(e, t) {
  258. (this._instanceConstructor = e),
  259. (this.promise = new e(O)),
  260. this.promise[w] || W(this.promise),
  261. n(t)
  262. ? ((this.length = t.length),
  263. (this._remaining = t.length),
  264. (this._result = new Array(this.length)),
  265. 0 === this.length
  266. ? Z(this.promise, this._result)
  267. : ((this.length = this.length || 0), this._enumerate(t), 0 === this._remaining && Z(this.promise, this._result)))
  268. : F(this.promise, q());
  269. }
  270. return (
  271. (e.prototype._enumerate = function (e) {
  272. for (var t = 0; this._state === T && t < e.length; t++) this._eachEntry(e[t], t);
  273. }),
  274. (e.prototype._eachEntry = function (e, t) {
  275. var i = this._instanceConstructor,
  276. n = i.resolve;
  277. if (n === R) {
  278. var r = void 0,
  279. s = void 0,
  280. o = !1;
  281. try {
  282. r = e.then;
  283. } catch (e) {
  284. (o = !0), (s = e);
  285. }
  286. if (r === L && e._state !== T) this._settledAt(e._state, t, e._result);
  287. else if ("function" != typeof r) this._remaining--, (this._result[t] = e);
  288. else if (i === te) {
  289. var a = new i(O);
  290. o ? F(a, s) : P(a, e, r), this._willSettleAt(a, t);
  291. } else
  292. this._willSettleAt(
  293. new i(function (t) {
  294. return t(e);
  295. }),
  296. t
  297. );
  298. } else this._willSettleAt(n(e), t);
  299. }),
  300. (e.prototype._settledAt = function (e, t, i) {
  301. var n = this.promise;
  302. n._state === T && (this._remaining--, e === k ? F(n, i) : (this._result[t] = i)), 0 === this._remaining && Z(n, this._result);
  303. }),
  304. (e.prototype._willSettleAt = function (e, t) {
  305. var i = this;
  306. G(
  307. e,
  308. void 0,
  309. function (e) {
  310. return i._settledAt(C, t, e);
  311. },
  312. function (e) {
  313. return i._settledAt(k, t, e);
  314. }
  315. );
  316. }),
  317. e
  318. );
  319. })();
  320. function X(e) {
  321. return new Y(this, e).promise;
  322. }
  323. function J(e) {
  324. var t = this;
  325. return n(e)
  326. ? new t(function (i, n) {
  327. for (var r = e.length, s = 0; s < r; s++) t.resolve(e[s]).then(i, n);
  328. })
  329. : new t(function (e, t) {
  330. return t(new TypeError("You must pass an array to race."));
  331. });
  332. }
  333. function Q(e) {
  334. var t = new this(O);
  335. return F(t, e), t;
  336. }
  337. function $() {
  338. throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
  339. }
  340. function ee() {
  341. throw new TypeError(
  342. "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."
  343. );
  344. }
  345. var te = (function () {
  346. function e(t) {
  347. (this[w] = H()),
  348. (this._result = this._state = void 0),
  349. (this._subscribers = []),
  350. O !== t && ("function" != typeof t && $(), this instanceof e ? z(this, t) : ee());
  351. }
  352. return (
  353. (e.prototype.catch = function (e) {
  354. return this.then(null, e);
  355. }),
  356. (e.prototype.finally = function (e) {
  357. var i = this,
  358. n = i.constructor;
  359. return t(e)
  360. ? i.then(
  361. function (t) {
  362. return n.resolve(e()).then(function () {
  363. return t;
  364. });
  365. },
  366. function (t) {
  367. return n.resolve(e()).then(function () {
  368. throw t;
  369. });
  370. }
  371. )
  372. : i.then(e, e);
  373. }),
  374. e
  375. );
  376. })();
  377. function ie() {
  378. var e = void 0;
  379. if (void 0 !== i.g) e = i.g;
  380. else if ("undefined" != typeof self) e = self;
  381. else
  382. try {
  383. e = Function("return this")();
  384. } catch (e) {
  385. throw new Error("polyfill failed because global object is unavailable in this environment");
  386. }
  387. var t = e.Promise;
  388. if (t) {
  389. var n = null;
  390. try {
  391. n = Object.prototype.toString.call(t.resolve());
  392. } catch (e) {}
  393. if ("[object Promise]" === n && !t.cast) return;
  394. }
  395. e.Promise = te;
  396. }
  397. return (
  398. (te.prototype.then = L),
  399. (te.all = X),
  400. (te.race = J),
  401. (te.resolve = R),
  402. (te.reject = Q),
  403. (te._setScheduler = h),
  404. (te._setAsap = u),
  405. (te._asap = a),
  406. (te.polyfill = ie),
  407. (te.Promise = te),
  408. te
  409. );
  410. })();
  411. },
  412. 716: function (e) {
  413. "use strict";
  414. var t,
  415. i = "object" == typeof Reflect ? Reflect : null,
  416. n =
  417. i && "function" == typeof i.apply
  418. ? i.apply
  419. : function (e, t, i) {
  420. return Function.prototype.apply.call(e, t, i);
  421. };
  422. t =
  423. i && "function" == typeof i.ownKeys
  424. ? i.ownKeys
  425. : Object.getOwnPropertySymbols
  426. ? function (e) {
  427. return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
  428. }
  429. : function (e) {
  430. return Object.getOwnPropertyNames(e);
  431. };
  432. var r =
  433. Number.isNaN ||
  434. function (e) {
  435. return e != e;
  436. };
  437. function s() {
  438. s.init.call(this);
  439. }
  440. (e.exports = s),
  441. (e.exports.once = function (e, t) {
  442. return new Promise(function (i, n) {
  443. function r(i) {
  444. e.removeListener(t, s), n(i);
  445. }
  446. function s() {
  447. "function" == typeof e.removeListener && e.removeListener("error", r), i([].slice.call(arguments));
  448. }
  449. p(e, t, s, { once: !0 }),
  450. "error" !== t &&
  451. (function (e, t, i) {
  452. "function" == typeof e.on && p(e, "error", t, i);
  453. })(e, r, { once: !0 });
  454. });
  455. }),
  456. (s.EventEmitter = s),
  457. (s.prototype._events = void 0),
  458. (s.prototype._eventsCount = 0),
  459. (s.prototype._maxListeners = void 0);
  460. var o = 10;
  461. function a(e) {
  462. if ("function" != typeof e) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e);
  463. }
  464. function h(e) {
  465. return void 0 === e._maxListeners ? s.defaultMaxListeners : e._maxListeners;
  466. }
  467. function u(e, t, i, n) {
  468. var r, s, o, u;
  469. if (
  470. (a(i),
  471. void 0 === (s = e._events)
  472. ? ((s = e._events = Object.create(null)), (e._eventsCount = 0))
  473. : (void 0 !== s.newListener && (e.emit("newListener", t, i.listener ? i.listener : i), (s = e._events)), (o = s[t])),
  474. void 0 === o)
  475. )
  476. (o = s[t] = i), ++e._eventsCount;
  477. else if (
  478. ("function" == typeof o ? (o = s[t] = n ? [i, o] : [o, i]) : n ? o.unshift(i) : o.push(i), (r = h(e)) > 0 && o.length > r && !o.warned)
  479. ) {
  480. o.warned = !0;
  481. var l = new Error(
  482. "Possible EventEmitter memory leak detected. " +
  483. o.length +
  484. " " +
  485. String(t) +
  486. " listeners added. Use emitter.setMaxListeners() to increase limit"
  487. );
  488. (l.name = "MaxListenersExceededWarning"),
  489. (l.emitter = e),
  490. (l.type = t),
  491. (l.count = o.length),
  492. (u = l),
  493. console && console.warn && console.warn(u);
  494. }
  495. return e;
  496. }
  497. function l() {
  498. if (!this.fired)
  499. return (
  500. this.target.removeListener(this.type, this.wrapFn),
  501. (this.fired = !0),
  502. 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments)
  503. );
  504. }
  505. function d(e, t, i) {
  506. var n = { fired: !1, wrapFn: void 0, target: e, type: t, listener: i },
  507. r = l.bind(n);
  508. return (r.listener = i), (n.wrapFn = r), r;
  509. }
  510. function c(e, t, i) {
  511. var n = e._events;
  512. if (void 0 === n) return [];
  513. var r = n[t];
  514. return void 0 === r
  515. ? []
  516. : "function" == typeof r
  517. ? i
  518. ? [r.listener || r]
  519. : [r]
  520. : i
  521. ? (function (e) {
  522. for (var t = new Array(e.length), i = 0; i < t.length; ++i) t[i] = e[i].listener || e[i];
  523. return t;
  524. })(r)
  525. : _(r, r.length);
  526. }
  527. function f(e) {
  528. var t = this._events;
  529. if (void 0 !== t) {
  530. var i = t[e];
  531. if ("function" == typeof i) return 1;
  532. if (void 0 !== i) return i.length;
  533. }
  534. return 0;
  535. }
  536. function _(e, t) {
  537. for (var i = new Array(t), n = 0; n < t; ++n) i[n] = e[n];
  538. return i;
  539. }
  540. function p(e, t, i, n) {
  541. if ("function" == typeof e.on) n.once ? e.once(t, i) : e.on(t, i);
  542. else {
  543. if ("function" != typeof e.addEventListener)
  544. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof e);
  545. e.addEventListener(t, function r(s) {
  546. n.once && e.removeEventListener(t, r), i(s);
  547. });
  548. }
  549. }
  550. Object.defineProperty(s, "defaultMaxListeners", {
  551. enumerable: !0,
  552. get: function () {
  553. return o;
  554. },
  555. set: function (e) {
  556. if ("number" != typeof e || e < 0 || r(e))
  557. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e + ".");
  558. o = e;
  559. },
  560. }),
  561. (s.init = function () {
  562. (void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events) ||
  563. ((this._events = Object.create(null)), (this._eventsCount = 0)),
  564. (this._maxListeners = this._maxListeners || void 0);
  565. }),
  566. (s.prototype.setMaxListeners = function (e) {
  567. if ("number" != typeof e || e < 0 || r(e))
  568. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
  569. return (this._maxListeners = e), this;
  570. }),
  571. (s.prototype.getMaxListeners = function () {
  572. return h(this);
  573. }),
  574. (s.prototype.emit = function (e) {
  575. for (var t = [], i = 1; i < arguments.length; i++) t.push(arguments[i]);
  576. var r = "error" === e,
  577. s = this._events;
  578. if (void 0 !== s) r = r && void 0 === s.error;
  579. else if (!r) return !1;
  580. if (r) {
  581. var o;
  582. if ((t.length > 0 && (o = t[0]), o instanceof Error)) throw o;
  583. var a = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
  584. throw ((a.context = o), a);
  585. }
  586. var h = s[e];
  587. if (void 0 === h) return !1;
  588. if ("function" == typeof h) n(h, this, t);
  589. else {
  590. var u = h.length,
  591. l = _(h, u);
  592. for (i = 0; i < u; ++i) n(l[i], this, t);
  593. }
  594. return !0;
  595. }),
  596. (s.prototype.addListener = function (e, t) {
  597. return u(this, e, t, !1);
  598. }),
  599. (s.prototype.on = s.prototype.addListener),
  600. (s.prototype.prependListener = function (e, t) {
  601. return u(this, e, t, !0);
  602. }),
  603. (s.prototype.once = function (e, t) {
  604. return a(t), this.on(e, d(this, e, t)), this;
  605. }),
  606. (s.prototype.prependOnceListener = function (e, t) {
  607. return a(t), this.prependListener(e, d(this, e, t)), this;
  608. }),
  609. (s.prototype.removeListener = function (e, t) {
  610. var i, n, r, s, o;
  611. if ((a(t), void 0 === (n = this._events))) return this;
  612. if (void 0 === (i = n[e])) return this;
  613. if (i === t || i.listener === t)
  614. 0 == --this._eventsCount
  615. ? (this._events = Object.create(null))
  616. : (delete n[e], n.removeListener && this.emit("removeListener", e, i.listener || t));
  617. else if ("function" != typeof i) {
  618. for (r = -1, s = i.length - 1; s >= 0; s--)
  619. if (i[s] === t || i[s].listener === t) {
  620. (o = i[s].listener), (r = s);
  621. break;
  622. }
  623. if (r < 0) return this;
  624. 0 === r
  625. ? i.shift()
  626. : (function (e, t) {
  627. for (; t + 1 < e.length; t++) e[t] = e[t + 1];
  628. e.pop();
  629. })(i, r),
  630. 1 === i.length && (n[e] = i[0]),
  631. void 0 !== n.removeListener && this.emit("removeListener", e, o || t);
  632. }
  633. return this;
  634. }),
  635. (s.prototype.off = s.prototype.removeListener),
  636. (s.prototype.removeAllListeners = function (e) {
  637. var t, i, n;
  638. if (void 0 === (i = this._events)) return this;
  639. if (void 0 === i.removeListener)
  640. return (
  641. 0 === arguments.length
  642. ? ((this._events = Object.create(null)), (this._eventsCount = 0))
  643. : void 0 !== i[e] && (0 == --this._eventsCount ? (this._events = Object.create(null)) : delete i[e]),
  644. this
  645. );
  646. if (0 === arguments.length) {
  647. var r,
  648. s = Object.keys(i);
  649. for (n = 0; n < s.length; ++n) "removeListener" !== (r = s[n]) && this.removeAllListeners(r);
  650. return this.removeAllListeners("removeListener"), (this._events = Object.create(null)), (this._eventsCount = 0), this;
  651. }
  652. if ("function" == typeof (t = i[e])) this.removeListener(e, t);
  653. else if (void 0 !== t) for (n = t.length - 1; n >= 0; n--) this.removeListener(e, t[n]);
  654. return this;
  655. }),
  656. (s.prototype.listeners = function (e) {
  657. return c(this, e, !0);
  658. }),
  659. (s.prototype.rawListeners = function (e) {
  660. return c(this, e, !1);
  661. }),
  662. (s.listenerCount = function (e, t) {
  663. return "function" == typeof e.listenerCount ? e.listenerCount(t) : f.call(e, t);
  664. }),
  665. (s.prototype.listenerCount = f),
  666. (s.prototype.eventNames = function () {
  667. return this._eventsCount > 0 ? t(this._events) : [];
  668. });
  669. },
  670. 397: function (e, t, i) {
  671. function n(e) {
  672. var t = {};
  673. function i(n) {
  674. if (t[n]) return t[n].exports;
  675. var r = (t[n] = { i: n, l: !1, exports: {} });
  676. return e[n].call(r.exports, r, r.exports, i), (r.l = !0), r.exports;
  677. }
  678. (i.m = e),
  679. (i.c = t),
  680. (i.i = function (e) {
  681. return e;
  682. }),
  683. (i.d = function (e, t, n) {
  684. i.o(e, t) || Object.defineProperty(e, t, { configurable: !1, enumerable: !0, get: n });
  685. }),
  686. (i.r = function (e) {
  687. Object.defineProperty(e, "__esModule", { value: !0 });
  688. }),
  689. (i.n = function (e) {
  690. var t =
  691. e && e.__esModule
  692. ? function () {
  693. return e.default;
  694. }
  695. : function () {
  696. return e;
  697. };
  698. return i.d(t, "a", t), t;
  699. }),
  700. (i.o = function (e, t) {
  701. return Object.prototype.hasOwnProperty.call(e, t);
  702. }),
  703. (i.p = "/"),
  704. (i.oe = function (e) {
  705. throw (console.error(e), e);
  706. });
  707. var n = i((i.s = ENTRY_MODULE));
  708. return n.default || n;
  709. }
  710. var r = "[\\.|\\-|\\+|\\w|/|@]+",
  711. s = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";
  712. function o(e) {
  713. return (e + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
  714. }
  715. function a(e, t, n) {
  716. var a = {};
  717. a[n] = [];
  718. var h = t.toString(),
  719. u = h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);
  720. if (!u) return a;
  721. for (var l, d = u[1], c = new RegExp("(\\\\n|\\W)" + o(d) + s, "g"); (l = c.exec(h)); ) "dll-reference" !== l[3] && a[n].push(l[3]);
  722. for (c = new RegExp("\\(" + o(d) + '\\("(dll-reference\\s(' + r + '))"\\)\\)' + s, "g"); (l = c.exec(h)); )
  723. e[l[2]] || (a[n].push(l[1]), (e[l[2]] = i(l[1]).m)), (a[l[2]] = a[l[2]] || []), a[l[2]].push(l[4]);
  724. for (var f, _ = Object.keys(a), p = 0; p < _.length; p++)
  725. for (var m = 0; m < a[_[p]].length; m++) (f = a[_[p]][m]), isNaN(1 * f) || (a[_[p]][m] = 1 * a[_[p]][m]);
  726. return a;
  727. }
  728. function h(e) {
  729. return Object.keys(e).reduce(function (t, i) {
  730. return t || e[i].length > 0;
  731. }, !1);
  732. }
  733. e.exports = function (e, t) {
  734. t = t || {};
  735. var r = { main: i.m },
  736. s = t.all
  737. ? { main: Object.keys(r.main) }
  738. : (function (e, t) {
  739. for (var i = { main: [t] }, n = { main: [] }, r = { main: {} }; h(i); )
  740. for (var s = Object.keys(i), o = 0; o < s.length; o++) {
  741. var u = s[o],
  742. l = i[u].pop();
  743. if (((r[u] = r[u] || {}), !r[u][l] && e[u][l])) {
  744. (r[u][l] = !0), (n[u] = n[u] || []), n[u].push(l);
  745. for (var d = a(e, e[u][l], u), c = Object.keys(d), f = 0; f < c.length; f++)
  746. (i[c[f]] = i[c[f]] || []), (i[c[f]] = i[c[f]].concat(d[c[f]]));
  747. }
  748. }
  749. return n;
  750. })(r, e),
  751. o = "";
  752. Object.keys(s)
  753. .filter(function (e) {
  754. return "main" !== e;
  755. })
  756. .forEach(function (e) {
  757. for (var t = 0; s[e][t]; ) t++;
  758. s[e].push(t),
  759. (r[e][t] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })"),
  760. (o =
  761. o +
  762. "var " +
  763. e +
  764. " = (" +
  765. n.toString().replace("ENTRY_MODULE", JSON.stringify(t)) +
  766. ")({" +
  767. s[e]
  768. .map(function (t) {
  769. return JSON.stringify(t) + ": " + r[e][t].toString();
  770. })
  771. .join(",") +
  772. "});\n");
  773. }),
  774. (o =
  775. o +
  776. "new ((" +
  777. n.toString().replace("ENTRY_MODULE", JSON.stringify(e)) +
  778. ")({" +
  779. s.main
  780. .map(function (e) {
  781. return JSON.stringify(e) + ": " + r.main[e].toString();
  782. })
  783. .join(",") +
  784. "}))(self);");
  785. var u = new window.Blob([o], { type: "text/javascript" });
  786. if (t.bare) return u;
  787. var l = (window.URL || window.webkitURL || window.mozURL || window.msURL).createObjectURL(u),
  788. d = new window.Worker(l);
  789. return (d.objectURL = l), d;
  790. };
  791. },
  792. 118: function (e, t) {
  793. "use strict";
  794. var i = (function () {
  795. function e() {
  796. (this.mimeType = null),
  797. (this.duration = null),
  798. (this.hasAudio = null),
  799. (this.hasVideo = null),
  800. (this.audioCodec = null),
  801. (this.videoCodec = null),
  802. (this.audioDataRate = null),
  803. (this.videoDataRate = null),
  804. (this.audioSampleRate = null),
  805. (this.audioChannelCount = null),
  806. (this.width = null),
  807. (this.height = null),
  808. (this.fps = null),
  809. (this.profile = null),
  810. (this.level = null),
  811. (this.refFrames = null),
  812. (this.chromaFormat = null),
  813. (this.sarNum = null),
  814. (this.sarDen = null),
  815. (this.metadata = null),
  816. (this.segments = null),
  817. (this.segmentCount = null),
  818. (this.hasKeyframesIndex = null),
  819. (this.keyframesIndex = null);
  820. }
  821. return (
  822. (e.prototype.isComplete = function () {
  823. var e =
  824. !1 === this.hasAudio ||
  825. (!0 === this.hasAudio && null != this.audioCodec && null != this.audioSampleRate && null != this.audioChannelCount),
  826. t =
  827. !1 === this.hasVideo ||
  828. (!0 === this.hasVideo &&
  829. null != this.videoCodec &&
  830. null != this.width &&
  831. null != this.height &&
  832. null != this.fps &&
  833. null != this.profile &&
  834. null != this.level &&
  835. null != this.refFrames &&
  836. null != this.chromaFormat &&
  837. null != this.sarNum &&
  838. null != this.sarDen);
  839. return null != this.mimeType && null != this.duration && null != this.metadata && null != this.hasKeyframesIndex && e && t;
  840. }),
  841. (e.prototype.isSeekable = function () {
  842. return !0 === this.hasKeyframesIndex;
  843. }),
  844. (e.prototype.getNearestKeyframe = function (e) {
  845. if (null == this.keyframesIndex) return null;
  846. var t = this.keyframesIndex,
  847. i = this._search(t.times, e);
  848. return { index: i, milliseconds: t.times[i], fileposition: t.filepositions[i] };
  849. }),
  850. (e.prototype._search = function (e, t) {
  851. var i = 0,
  852. n = e.length - 1,
  853. r = 0,
  854. s = 0,
  855. o = n;
  856. for (t < e[0] && ((i = 0), (s = o + 1)); s <= o; ) {
  857. if ((r = s + Math.floor((o - s) / 2)) === n || (t >= e[r] && t < e[r + 1])) {
  858. i = r;
  859. break;
  860. }
  861. e[r] < t ? (s = r + 1) : (o = r - 1);
  862. }
  863. return i;
  864. }),
  865. e
  866. );
  867. })();
  868. t.Z = i;
  869. },
  870. 51: function (e, t, i) {
  871. "use strict";
  872. i.d(t, {
  873. Wk: function () {
  874. return n;
  875. },
  876. Yy: function () {
  877. return r;
  878. },
  879. Vn: function () {
  880. return s;
  881. },
  882. J1: function () {
  883. return o;
  884. },
  885. });
  886. var n = function (e, t, i, n, r) {
  887. (this.dts = e), (this.pts = t), (this.duration = i), (this.originalDts = n), (this.isSyncPoint = r), (this.fileposition = null);
  888. },
  889. r = (function () {
  890. function e() {
  891. (this.beginDts = 0),
  892. (this.endDts = 0),
  893. (this.beginPts = 0),
  894. (this.endPts = 0),
  895. (this.originalBeginDts = 0),
  896. (this.originalEndDts = 0),
  897. (this.syncPoints = []),
  898. (this.firstSample = null),
  899. (this.lastSample = null);
  900. }
  901. return (
  902. (e.prototype.appendSyncPoint = function (e) {
  903. (e.isSyncPoint = !0), this.syncPoints.push(e);
  904. }),
  905. e
  906. );
  907. })(),
  908. s = (function () {
  909. function e() {
  910. this._list = [];
  911. }
  912. return (
  913. (e.prototype.clear = function () {
  914. this._list = [];
  915. }),
  916. (e.prototype.appendArray = function (e) {
  917. var t = this._list;
  918. 0 !== e.length &&
  919. (t.length > 0 && e[0].originalDts < t[t.length - 1].originalDts && this.clear(), Array.prototype.push.apply(t, e));
  920. }),
  921. (e.prototype.getLastSyncPointBeforeDts = function (e) {
  922. if (0 == this._list.length) return null;
  923. var t = this._list,
  924. i = 0,
  925. n = t.length - 1,
  926. r = 0,
  927. s = 0,
  928. o = n;
  929. for (e < t[0].dts && ((i = 0), (s = o + 1)); s <= o; ) {
  930. if ((r = s + Math.floor((o - s) / 2)) === n || (e >= t[r].dts && e < t[r + 1].dts)) {
  931. i = r;
  932. break;
  933. }
  934. t[r].dts < e ? (s = r + 1) : (o = r - 1);
  935. }
  936. return this._list[i];
  937. }),
  938. e
  939. );
  940. })(),
  941. o = (function () {
  942. function e(e) {
  943. (this._type = e), (this._list = []), (this._lastAppendLocation = -1);
  944. }
  945. return (
  946. Object.defineProperty(e.prototype, "type", {
  947. get: function () {
  948. return this._type;
  949. },
  950. enumerable: !1,
  951. configurable: !0,
  952. }),
  953. Object.defineProperty(e.prototype, "length", {
  954. get: function () {
  955. return this._list.length;
  956. },
  957. enumerable: !1,
  958. configurable: !0,
  959. }),
  960. (e.prototype.isEmpty = function () {
  961. return 0 === this._list.length;
  962. }),
  963. (e.prototype.clear = function () {
  964. (this._list = []), (this._lastAppendLocation = -1);
  965. }),
  966. (e.prototype._searchNearestSegmentBefore = function (e) {
  967. var t = this._list;
  968. if (0 === t.length) return -2;
  969. var i = t.length - 1,
  970. n = 0,
  971. r = 0,
  972. s = i,
  973. o = 0;
  974. if (e < t[0].originalBeginDts) return (o = -1);
  975. for (; r <= s; ) {
  976. if ((n = r + Math.floor((s - r) / 2)) === i || (e > t[n].lastSample.originalDts && e < t[n + 1].originalBeginDts)) {
  977. o = n;
  978. break;
  979. }
  980. t[n].originalBeginDts < e ? (r = n + 1) : (s = n - 1);
  981. }
  982. return o;
  983. }),
  984. (e.prototype._searchNearestSegmentAfter = function (e) {
  985. return this._searchNearestSegmentBefore(e) + 1;
  986. }),
  987. (e.prototype.append = function (e) {
  988. var t = this._list,
  989. i = e,
  990. n = this._lastAppendLocation,
  991. r = 0;
  992. -1 !== n &&
  993. n < t.length &&
  994. i.originalBeginDts >= t[n].lastSample.originalDts &&
  995. (n === t.length - 1 || (n < t.length - 1 && i.originalBeginDts < t[n + 1].originalBeginDts))
  996. ? (r = n + 1)
  997. : t.length > 0 && (r = this._searchNearestSegmentBefore(i.originalBeginDts) + 1),
  998. (this._lastAppendLocation = r),
  999. this._list.splice(r, 0, i);
  1000. }),
  1001. (e.prototype.getLastSegmentBefore = function (e) {
  1002. var t = this._searchNearestSegmentBefore(e);
  1003. return t >= 0 ? this._list[t] : null;
  1004. }),
  1005. (e.prototype.getLastSampleBefore = function (e) {
  1006. var t = this.getLastSegmentBefore(e);
  1007. return null != t ? t.lastSample : null;
  1008. }),
  1009. (e.prototype.getLastSyncPointBefore = function (e) {
  1010. for (var t = this._searchNearestSegmentBefore(e), i = this._list[t].syncPoints; 0 === i.length && t > 0; )
  1011. t--, (i = this._list[t].syncPoints);
  1012. return i.length > 0 ? i[i.length - 1] : null;
  1013. }),
  1014. e
  1015. );
  1016. })();
  1017. },
  1018. 949: function (e, t, i) {
  1019. "use strict";
  1020. i.d(t, {
  1021. Z: function () {
  1022. return R;
  1023. },
  1024. });
  1025. var n = i(716),
  1026. r = i.n(n),
  1027. s = i(300),
  1028. o = i(538),
  1029. a = i(118);
  1030. function h(e, t, i) {
  1031. var n = e;
  1032. if (t + i < n.length) {
  1033. for (; i--; ) if (128 != (192 & n[++t])) return !1;
  1034. return !0;
  1035. }
  1036. return !1;
  1037. }
  1038. var u,
  1039. l = function (e) {
  1040. for (var t = [], i = e, n = 0, r = e.length; n < r; )
  1041. if (i[n] < 128) t.push(String.fromCharCode(i[n])), ++n;
  1042. else {
  1043. if (i[n] < 192);
  1044. else if (i[n] < 224) {
  1045. if (h(i, n, 1))
  1046. if ((s = ((31 & i[n]) << 6) | (63 & i[n + 1])) >= 128) {
  1047. t.push(String.fromCharCode(65535 & s)), (n += 2);
  1048. continue;
  1049. }
  1050. } else if (i[n] < 240) {
  1051. if (h(i, n, 2))
  1052. if ((s = ((15 & i[n]) << 12) | ((63 & i[n + 1]) << 6) | (63 & i[n + 2])) >= 2048 && 55296 != (63488 & s)) {
  1053. t.push(String.fromCharCode(65535 & s)), (n += 3);
  1054. continue;
  1055. }
  1056. } else if (i[n] < 248) {
  1057. var s;
  1058. if (h(i, n, 3))
  1059. if ((s = ((7 & i[n]) << 18) | ((63 & i[n + 1]) << 12) | ((63 & i[n + 2]) << 6) | (63 & i[n + 3])) > 65536 && s < 1114112) {
  1060. (s -= 65536), t.push(String.fromCharCode((s >>> 10) | 55296)), t.push(String.fromCharCode((1023 & s) | 56320)), (n += 4);
  1061. continue;
  1062. }
  1063. }
  1064. t.push(String.fromCharCode(65533)), ++n;
  1065. }
  1066. return t.join("");
  1067. },
  1068. d = i(29),
  1069. c = ((u = new ArrayBuffer(2)), new DataView(u).setInt16(0, 256, !0), 256 === new Int16Array(u)[0]),
  1070. f = (function () {
  1071. function e() {}
  1072. return (
  1073. (e.parseScriptData = function (t, i, n) {
  1074. var r = {};
  1075. try {
  1076. var o = e.parseValue(t, i, n),
  1077. a = e.parseValue(t, i + o.size, n - o.size);
  1078. r[o.data] = a.data;
  1079. } catch (e) {
  1080. s.Z.e("AMF", e.toString());
  1081. }
  1082. return r;
  1083. }),
  1084. (e.parseObject = function (t, i, n) {
  1085. if (n < 3) throw new d.rT("Data not enough when parse ScriptDataObject");
  1086. var r = e.parseString(t, i, n),
  1087. s = e.parseValue(t, i + r.size, n - r.size),
  1088. o = s.objectEnd;
  1089. return { data: { name: r.data, value: s.data }, size: r.size + s.size, objectEnd: o };
  1090. }),
  1091. (e.parseVariable = function (t, i, n) {
  1092. return e.parseObject(t, i, n);
  1093. }),
  1094. (e.parseString = function (e, t, i) {
  1095. if (i < 2) throw new d.rT("Data not enough when parse String");
  1096. var n = new DataView(e, t, i).getUint16(0, !c);
  1097. return { data: n > 0 ? l(new Uint8Array(e, t + 2, n)) : "", size: 2 + n };
  1098. }),
  1099. (e.parseLongString = function (e, t, i) {
  1100. if (i < 4) throw new d.rT("Data not enough when parse LongString");
  1101. var n = new DataView(e, t, i).getUint32(0, !c);
  1102. return { data: n > 0 ? l(new Uint8Array(e, t + 4, n)) : "", size: 4 + n };
  1103. }),
  1104. (e.parseDate = function (e, t, i) {
  1105. if (i < 10) throw new d.rT("Data size invalid when parse Date");
  1106. var n = new DataView(e, t, i),
  1107. r = n.getFloat64(0, !c),
  1108. s = n.getInt16(8, !c);
  1109. return { data: new Date((r += 60 * s * 1e3)), size: 10 };
  1110. }),
  1111. (e.parseValue = function (t, i, n) {
  1112. if (n < 1) throw new d.rT("Data not enough when parse Value");
  1113. var r,
  1114. o = new DataView(t, i, n),
  1115. a = 1,
  1116. h = o.getUint8(0),
  1117. u = !1;
  1118. try {
  1119. switch (h) {
  1120. case 0:
  1121. (r = o.getFloat64(1, !c)), (a += 8);
  1122. break;
  1123. case 1:
  1124. (r = !!o.getUint8(1)), (a += 1);
  1125. break;
  1126. case 2:
  1127. var l = e.parseString(t, i + 1, n - 1);
  1128. (r = l.data), (a += l.size);
  1129. break;
  1130. case 3:
  1131. r = {};
  1132. var f = 0;
  1133. for (9 == (16777215 & o.getUint32(n - 4, !c)) && (f = 3); a < n - 4; ) {
  1134. var _ = e.parseObject(t, i + a, n - a - f);
  1135. if (_.objectEnd) break;
  1136. (r[_.data.name] = _.data.value), (a += _.size);
  1137. }
  1138. if (a <= n - 3) 9 === (16777215 & o.getUint32(a - 1, !c)) && (a += 3);
  1139. break;
  1140. case 8:
  1141. (r = {}), (a += 4);
  1142. f = 0;
  1143. for (9 == (16777215 & o.getUint32(n - 4, !c)) && (f = 3); a < n - 8; ) {
  1144. var p = e.parseVariable(t, i + a, n - a - f);
  1145. if (p.objectEnd) break;
  1146. (r[p.data.name] = p.data.value), (a += p.size);
  1147. }
  1148. if (a <= n - 3) 9 === (16777215 & o.getUint32(a - 1, !c)) && (a += 3);
  1149. break;
  1150. case 9:
  1151. (r = void 0), (a = 1), (u = !0);
  1152. break;
  1153. case 10:
  1154. r = [];
  1155. var m = o.getUint32(1, !c);
  1156. a += 4;
  1157. for (var g = 0; g < m; g++) {
  1158. var v = e.parseValue(t, i + a, n - a);
  1159. r.push(v.data), (a += v.size);
  1160. }
  1161. break;
  1162. case 11:
  1163. var y = e.parseDate(t, i + 1, n - 1);
  1164. (r = y.data), (a += y.size);
  1165. break;
  1166. case 12:
  1167. var b = e.parseString(t, i + 1, n - 1);
  1168. (r = b.data), (a += b.size);
  1169. break;
  1170. default:
  1171. (a = n), s.Z.w("AMF", "Unsupported AMF value type " + h);
  1172. }
  1173. } catch (e) {
  1174. s.Z.e("AMF", e.toString());
  1175. }
  1176. return { data: r, size: a, objectEnd: u };
  1177. }),
  1178. e
  1179. );
  1180. })(),
  1181. _ = (function () {
  1182. function e(e) {
  1183. (this.TAG = "ExpGolomb"),
  1184. (this._buffer = e),
  1185. (this._buffer_index = 0),
  1186. (this._total_bytes = e.byteLength),
  1187. (this._total_bits = 8 * e.byteLength),
  1188. (this._current_word = 0),
  1189. (this._current_word_bits_left = 0);
  1190. }
  1191. return (
  1192. (e.prototype.destroy = function () {
  1193. this._buffer = null;
  1194. }),
  1195. (e.prototype._fillCurrentWord = function () {
  1196. var e = this._total_bytes - this._buffer_index;
  1197. if (e <= 0) throw new d.rT("ExpGolomb: _fillCurrentWord() but no bytes available");
  1198. var t = Math.min(4, e),
  1199. i = new Uint8Array(4);
  1200. i.set(this._buffer.subarray(this._buffer_index, this._buffer_index + t)),
  1201. (this._current_word = new DataView(i.buffer).getUint32(0, !1)),
  1202. (this._buffer_index += t),
  1203. (this._current_word_bits_left = 8 * t);
  1204. }),
  1205. (e.prototype.readBits = function (e) {
  1206. if (e > 32) throw new d.OC("ExpGolomb: readBits() bits exceeded max 32bits!");
  1207. if (e <= this._current_word_bits_left) {
  1208. var t = this._current_word >>> (32 - e);
  1209. return (this._current_word <<= e), (this._current_word_bits_left -= e), t;
  1210. }
  1211. var i = this._current_word_bits_left ? this._current_word : 0;
  1212. i >>>= 32 - this._current_word_bits_left;
  1213. var n = e - this._current_word_bits_left;
  1214. this._fillCurrentWord();
  1215. var r = Math.min(n, this._current_word_bits_left),
  1216. s = this._current_word >>> (32 - r);
  1217. return (this._current_word <<= r), (this._current_word_bits_left -= r), (i = (i << r) | s);
  1218. }),
  1219. (e.prototype.readBool = function () {
  1220. return 1 === this.readBits(1);
  1221. }),
  1222. (e.prototype.readByte = function () {
  1223. return this.readBits(8);
  1224. }),
  1225. (e.prototype._skipLeadingZero = function () {
  1226. var e;
  1227. for (e = 0; e < this._current_word_bits_left; e++)
  1228. if (0 != (this._current_word & (2147483648 >>> e))) return (this._current_word <<= e), (this._current_word_bits_left -= e), e;
  1229. return this._fillCurrentWord(), e + this._skipLeadingZero();
  1230. }),
  1231. (e.prototype.readUEG = function () {
  1232. var e = this._skipLeadingZero();
  1233. return this.readBits(e + 1) - 1;
  1234. }),
  1235. (e.prototype.readSEG = function () {
  1236. var e = this.readUEG();
  1237. return 1 & e ? (e + 1) >>> 1 : -1 * (e >>> 1);
  1238. }),
  1239. e
  1240. );
  1241. })(),
  1242. p = (function () {
  1243. function e() {}
  1244. return (
  1245. (e._ebsp2rbsp = function (e) {
  1246. for (var t = e, i = t.byteLength, n = new Uint8Array(i), r = 0, s = 0; s < i; s++)
  1247. (s >= 2 && 3 === t[s] && 0 === t[s - 1] && 0 === t[s - 2]) || ((n[r] = t[s]), r++);
  1248. return new Uint8Array(n.buffer, 0, r);
  1249. }),
  1250. (e.parseSPS = function (t) {
  1251. var i = e._ebsp2rbsp(t),
  1252. n = new _(i);
  1253. n.readByte();
  1254. var r = n.readByte();
  1255. n.readByte();
  1256. var s = n.readByte();
  1257. n.readUEG();
  1258. var o = e.getProfileString(r),
  1259. a = e.getLevelString(s),
  1260. h = 1,
  1261. u = 420,
  1262. l = 8;
  1263. if (
  1264. (100 === r ||
  1265. 110 === r ||
  1266. 122 === r ||
  1267. 244 === r ||
  1268. 44 === r ||
  1269. 83 === r ||
  1270. 86 === r ||
  1271. 118 === r ||
  1272. 128 === r ||
  1273. 138 === r ||
  1274. 144 === r) &&
  1275. (3 === (h = n.readUEG()) && n.readBits(1),
  1276. h <= 3 && (u = [0, 420, 422, 444][h]),
  1277. (l = n.readUEG() + 8),
  1278. n.readUEG(),
  1279. n.readBits(1),
  1280. n.readBool())
  1281. )
  1282. for (var d = 3 !== h ? 8 : 12, c = 0; c < d; c++) n.readBool() && (c < 6 ? e._skipScalingList(n, 16) : e._skipScalingList(n, 64));
  1283. n.readUEG();
  1284. var f = n.readUEG();
  1285. if (0 === f) n.readUEG();
  1286. else if (1 === f) {
  1287. n.readBits(1), n.readSEG(), n.readSEG();
  1288. var p = n.readUEG();
  1289. for (c = 0; c < p; c++) n.readSEG();
  1290. }
  1291. var m = n.readUEG();
  1292. n.readBits(1);
  1293. var g = n.readUEG(),
  1294. v = n.readUEG(),
  1295. y = n.readBits(1);
  1296. 0 === y && n.readBits(1), n.readBits(1);
  1297. var b = 0,
  1298. E = 0,
  1299. S = 0,
  1300. A = 0;
  1301. n.readBool() && ((b = n.readUEG()), (E = n.readUEG()), (S = n.readUEG()), (A = n.readUEG()));
  1302. var L = 1,
  1303. R = 1,
  1304. w = 0,
  1305. O = !0,
  1306. T = 0,
  1307. C = 0;
  1308. if (n.readBool()) {
  1309. if (n.readBool()) {
  1310. var k = n.readByte();
  1311. k > 0 && k < 16
  1312. ? ((L = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2][k - 1]),
  1313. (R = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1][k - 1]))
  1314. : 255 === k && ((L = (n.readByte() << 8) | n.readByte()), (R = (n.readByte() << 8) | n.readByte()));
  1315. }
  1316. if (
  1317. (n.readBool() && n.readBool(),
  1318. n.readBool() && (n.readBits(4), n.readBool() && n.readBits(24)),
  1319. n.readBool() && (n.readUEG(), n.readUEG()),
  1320. n.readBool())
  1321. ) {
  1322. var D = n.readBits(32),
  1323. I = n.readBits(32);
  1324. (O = n.readBool()), (w = (T = I) / (C = 2 * D));
  1325. }
  1326. }
  1327. var M = 1;
  1328. (1 === L && 1 === R) || (M = L / R);
  1329. var B = 0,
  1330. x = 0;
  1331. 0 === h ? ((B = 1), (x = 2 - y)) : ((B = 3 === h ? 1 : 2), (x = (1 === h ? 2 : 1) * (2 - y)));
  1332. var P = 16 * (g + 1),
  1333. U = 16 * (v + 1) * (2 - y);
  1334. (P -= (b + E) * B), (U -= (S + A) * x);
  1335. var N = Math.ceil(P * M);
  1336. return (
  1337. n.destroy(),
  1338. (n = null),
  1339. {
  1340. profile_string: o,
  1341. level_string: a,
  1342. bit_depth: l,
  1343. ref_frames: m,
  1344. chroma_format: u,
  1345. chroma_format_string: e.getChromaFormatString(u),
  1346. frame_rate: { fixed: O, fps: w, fps_den: C, fps_num: T },
  1347. sar_ratio: { width: L, height: R },
  1348. codec_size: { width: P, height: U },
  1349. present_size: { width: N, height: U },
  1350. }
  1351. );
  1352. }),
  1353. (e._skipScalingList = function (e, t) {
  1354. for (var i = 8, n = 8, r = 0; r < t; r++) 0 !== n && (n = (i + e.readSEG() + 256) % 256), (i = 0 === n ? i : n);
  1355. }),
  1356. (e.getProfileString = function (e) {
  1357. switch (e) {
  1358. case 66:
  1359. return "Baseline";
  1360. case 77:
  1361. return "Main";
  1362. case 88:
  1363. return "Extended";
  1364. case 100:
  1365. return "High";
  1366. case 110:
  1367. return "High10";
  1368. case 122:
  1369. return "High422";
  1370. case 244:
  1371. return "High444";
  1372. default:
  1373. return "Unknown";
  1374. }
  1375. }),
  1376. (e.getLevelString = function (e) {
  1377. return (e / 10).toFixed(1);
  1378. }),
  1379. (e.getChromaFormatString = function (e) {
  1380. switch (e) {
  1381. case 420:
  1382. return "4:2:0";
  1383. case 422:
  1384. return "4:2:2";
  1385. case 444:
  1386. return "4:4:4";
  1387. default:
  1388. return "Unknown";
  1389. }
  1390. }),
  1391. e
  1392. );
  1393. })(),
  1394. m = i(600);
  1395. var g = (function () {
  1396. function e(e, t) {
  1397. (this.TAG = "FLVDemuxer"),
  1398. (this._config = t),
  1399. (this._onError = null),
  1400. (this._onMediaInfo = null),
  1401. (this._onMetaDataArrived = null),
  1402. (this._onScriptDataArrived = null),
  1403. (this._onTrackMetadata = null),
  1404. (this._onDataAvailable = null),
  1405. (this._dataOffset = e.dataOffset),
  1406. (this._firstParse = !0),
  1407. (this._dispatch = !1),
  1408. (this._hasAudio = e.hasAudioTrack),
  1409. (this._hasVideo = e.hasVideoTrack),
  1410. (this._hasAudioFlagOverrided = !1),
  1411. (this._hasVideoFlagOverrided = !1),
  1412. (this._audioInitialMetadataDispatched = !1),
  1413. (this._videoInitialMetadataDispatched = !1),
  1414. (this._mediaInfo = new a.Z()),
  1415. (this._mediaInfo.hasAudio = this._hasAudio),
  1416. (this._mediaInfo.hasVideo = this._hasVideo),
  1417. (this._metadata = null),
  1418. (this._audioMetadata = null),
  1419. (this._videoMetadata = null),
  1420. (this._naluLengthSize = 4),
  1421. (this._timestampBase = 0),
  1422. (this._timescale = 1e3),
  1423. (this._duration = 0),
  1424. (this._durationOverrided = !1),
  1425. (this._referenceFrameRate = { fixed: !0, fps: 23.976, fps_num: 23976, fps_den: 1e3 }),
  1426. (this._flvSoundRateTable = [5500, 11025, 22050, 44100, 48e3]),
  1427. (this._mpegSamplingRates = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350]),
  1428. (this._mpegAudioV10SampleRateTable = [44100, 48e3, 32e3, 0]),
  1429. (this._mpegAudioV20SampleRateTable = [22050, 24e3, 16e3, 0]),
  1430. (this._mpegAudioV25SampleRateTable = [11025, 12e3, 8e3, 0]),
  1431. (this._mpegAudioL1BitRateTable = [0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1]),
  1432. (this._mpegAudioL2BitRateTable = [0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1]),
  1433. (this._mpegAudioL3BitRateTable = [0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1]),
  1434. (this._videoTrack = { type: "video", id: 1, sequenceNumber: 0, samples: [], length: 0 }),
  1435. (this._audioTrack = { type: "audio", id: 2, sequenceNumber: 0, samples: [], length: 0 }),
  1436. (this._littleEndian = (function () {
  1437. var e = new ArrayBuffer(2);
  1438. return new DataView(e).setInt16(0, 256, !0), 256 === new Int16Array(e)[0];
  1439. })());
  1440. }
  1441. return (
  1442. (e.prototype.destroy = function () {
  1443. (this._mediaInfo = null),
  1444. (this._metadata = null),
  1445. (this._audioMetadata = null),
  1446. (this._videoMetadata = null),
  1447. (this._videoTrack = null),
  1448. (this._audioTrack = null),
  1449. (this._onError = null),
  1450. (this._onMediaInfo = null),
  1451. (this._onMetaDataArrived = null),
  1452. (this._onScriptDataArrived = null),
  1453. (this._onTrackMetadata = null),
  1454. (this._onDataAvailable = null);
  1455. }),
  1456. (e.probe = function (e) {
  1457. var t = new Uint8Array(e),
  1458. i = { match: !1 };
  1459. if (70 !== t[0] || 76 !== t[1] || 86 !== t[2] || 1 !== t[3]) return i;
  1460. var n,
  1461. r,
  1462. s = (4 & t[4]) >>> 2 != 0,
  1463. o = 0 != (1 & t[4]),
  1464. a = ((n = t)[(r = 5)] << 24) | (n[r + 1] << 16) | (n[r + 2] << 8) | n[r + 3];
  1465. return a < 9 ? i : { match: !0, consumed: a, dataOffset: a, hasAudioTrack: s, hasVideoTrack: o };
  1466. }),
  1467. (e.prototype.bindDataSource = function (e) {
  1468. return (e.onDataArrival = this.parseChunks.bind(this)), this;
  1469. }),
  1470. Object.defineProperty(e.prototype, "onTrackMetadata", {
  1471. get: function () {
  1472. return this._onTrackMetadata;
  1473. },
  1474. set: function (e) {
  1475. this._onTrackMetadata = e;
  1476. },
  1477. enumerable: !1,
  1478. configurable: !0,
  1479. }),
  1480. Object.defineProperty(e.prototype, "onMediaInfo", {
  1481. get: function () {
  1482. return this._onMediaInfo;
  1483. },
  1484. set: function (e) {
  1485. this._onMediaInfo = e;
  1486. },
  1487. enumerable: !1,
  1488. configurable: !0,
  1489. }),
  1490. Object.defineProperty(e.prototype, "onMetaDataArrived", {
  1491. get: function () {
  1492. return this._onMetaDataArrived;
  1493. },
  1494. set: function (e) {
  1495. this._onMetaDataArrived = e;
  1496. },
  1497. enumerable: !1,
  1498. configurable: !0,
  1499. }),
  1500. Object.defineProperty(e.prototype, "onScriptDataArrived", {
  1501. get: function () {
  1502. return this._onScriptDataArrived;
  1503. },
  1504. set: function (e) {
  1505. this._onScriptDataArrived = e;
  1506. },
  1507. enumerable: !1,
  1508. configurable: !0,
  1509. }),
  1510. Object.defineProperty(e.prototype, "onError", {
  1511. get: function () {
  1512. return this._onError;
  1513. },
  1514. set: function (e) {
  1515. this._onError = e;
  1516. },
  1517. enumerable: !1,
  1518. configurable: !0,
  1519. }),
  1520. Object.defineProperty(e.prototype, "onDataAvailable", {
  1521. get: function () {
  1522. return this._onDataAvailable;
  1523. },
  1524. set: function (e) {
  1525. this._onDataAvailable = e;
  1526. },
  1527. enumerable: !1,
  1528. configurable: !0,
  1529. }),
  1530. Object.defineProperty(e.prototype, "timestampBase", {
  1531. get: function () {
  1532. return this._timestampBase;
  1533. },
  1534. set: function (e) {
  1535. this._timestampBase = e;
  1536. },
  1537. enumerable: !1,
  1538. configurable: !0,
  1539. }),
  1540. Object.defineProperty(e.prototype, "overridedDuration", {
  1541. get: function () {
  1542. return this._duration;
  1543. },
  1544. set: function (e) {
  1545. (this._durationOverrided = !0), (this._duration = e), (this._mediaInfo.duration = e);
  1546. },
  1547. enumerable: !1,
  1548. configurable: !0,
  1549. }),
  1550. Object.defineProperty(e.prototype, "overridedHasAudio", {
  1551. set: function (e) {
  1552. (this._hasAudioFlagOverrided = !0), (this._hasAudio = e), (this._mediaInfo.hasAudio = e);
  1553. },
  1554. enumerable: !1,
  1555. configurable: !0,
  1556. }),
  1557. Object.defineProperty(e.prototype, "overridedHasVideo", {
  1558. set: function (e) {
  1559. (this._hasVideoFlagOverrided = !0), (this._hasVideo = e), (this._mediaInfo.hasVideo = e);
  1560. },
  1561. enumerable: !1,
  1562. configurable: !0,
  1563. }),
  1564. (e.prototype.resetMediaInfo = function () {
  1565. this._mediaInfo = new a.Z();
  1566. }),
  1567. (e.prototype._isInitialMetadataDispatched = function () {
  1568. return this._hasAudio && this._hasVideo
  1569. ? this._audioInitialMetadataDispatched && this._videoInitialMetadataDispatched
  1570. : this._hasAudio && !this._hasVideo
  1571. ? this._audioInitialMetadataDispatched
  1572. : !(this._hasAudio || !this._hasVideo) && this._videoInitialMetadataDispatched;
  1573. }),
  1574. (e.prototype.parseChunks = function (t, i) {
  1575. if (!(this._onError && this._onMediaInfo && this._onTrackMetadata && this._onDataAvailable))
  1576. throw new d.rT("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");
  1577. var n = 0,
  1578. r = this._littleEndian;
  1579. if (0 === i) {
  1580. if (!(t.byteLength > 13)) return 0;
  1581. n = e.probe(t).dataOffset;
  1582. }
  1583. this._firstParse &&
  1584. ((this._firstParse = !1),
  1585. i + n !== this._dataOffset && s.Z.w(this.TAG, "First time parsing but chunk byteStart invalid!"),
  1586. 0 !== (o = new DataView(t, n)).getUint32(0, !r) && s.Z.w(this.TAG, "PrevTagSize0 !== 0 !!!"),
  1587. (n += 4));
  1588. for (; n < t.byteLength; ) {
  1589. this._dispatch = !0;
  1590. var o = new DataView(t, n);
  1591. if (n + 11 + 4 > t.byteLength) break;
  1592. var a = o.getUint8(0),
  1593. h = 16777215 & o.getUint32(0, !r);
  1594. if (n + 11 + h + 4 > t.byteLength) break;
  1595. if (8 === a || 9 === a || 18 === a) {
  1596. var u = o.getUint8(4),
  1597. l = o.getUint8(5),
  1598. c = o.getUint8(6) | (l << 8) | (u << 16) | (o.getUint8(7) << 24);
  1599. 0 !== (16777215 & o.getUint32(7, !r)) && s.Z.w(this.TAG, "Meet tag which has StreamID != 0!");
  1600. var f = n + 11;
  1601. switch (a) {
  1602. case 8:
  1603. this._parseAudioData(t, f, h, c);
  1604. break;
  1605. case 9:
  1606. this._parseVideoData(t, f, h, c, i + n);
  1607. break;
  1608. case 18:
  1609. this._parseScriptData(t, f, h);
  1610. }
  1611. var _ = o.getUint32(11 + h, !r);
  1612. _ !== 11 + h && s.Z.w(this.TAG, "Invalid PrevTagSize " + _), (n += 11 + h + 4);
  1613. } else s.Z.w(this.TAG, "Unsupported tag type " + a + ", skipped"), (n += 11 + h + 4);
  1614. }
  1615. return (
  1616. this._isInitialMetadataDispatched() &&
  1617. this._dispatch &&
  1618. (this._audioTrack.length || this._videoTrack.length) &&
  1619. this._onDataAvailable(this._audioTrack, this._videoTrack),
  1620. n
  1621. );
  1622. }),
  1623. (e.prototype._parseScriptData = function (e, t, i) {
  1624. var n = f.parseScriptData(e, t, i);
  1625. if (n.hasOwnProperty("onMetaData")) {
  1626. if (null == n.onMetaData || "object" != typeof n.onMetaData) return void s.Z.w(this.TAG, "Invalid onMetaData structure!");
  1627. this._metadata && s.Z.w(this.TAG, "Found another onMetaData tag!"), (this._metadata = n);
  1628. var r = this._metadata.onMetaData;
  1629. if (
  1630. (this._onMetaDataArrived && this._onMetaDataArrived(Object.assign({}, r)),
  1631. "boolean" == typeof r.hasAudio &&
  1632. !1 === this._hasAudioFlagOverrided &&
  1633. ((this._hasAudio = r.hasAudio), (this._mediaInfo.hasAudio = this._hasAudio)),
  1634. "boolean" == typeof r.hasVideo &&
  1635. !1 === this._hasVideoFlagOverrided &&
  1636. ((this._hasVideo = r.hasVideo), (this._mediaInfo.hasVideo = this._hasVideo)),
  1637. "number" == typeof r.audiodatarate && (this._mediaInfo.audioDataRate = r.audiodatarate),
  1638. "number" == typeof r.videodatarate && (this._mediaInfo.videoDataRate = r.videodatarate),
  1639. "number" == typeof r.width && (this._mediaInfo.width = r.width),
  1640. "number" == typeof r.height && (this._mediaInfo.height = r.height),
  1641. "number" == typeof r.duration)
  1642. ) {
  1643. if (!this._durationOverrided) {
  1644. var o = Math.floor(r.duration * this._timescale);
  1645. (this._duration = o), (this._mediaInfo.duration = o);
  1646. }
  1647. } else this._mediaInfo.duration = 0;
  1648. if ("number" == typeof r.framerate) {
  1649. var a = Math.floor(1e3 * r.framerate);
  1650. if (a > 0) {
  1651. var h = a / 1e3;
  1652. (this._referenceFrameRate.fixed = !0),
  1653. (this._referenceFrameRate.fps = h),
  1654. (this._referenceFrameRate.fps_num = a),
  1655. (this._referenceFrameRate.fps_den = 1e3),
  1656. (this._mediaInfo.fps = h);
  1657. }
  1658. }
  1659. if ("object" == typeof r.keyframes) {
  1660. this._mediaInfo.hasKeyframesIndex = !0;
  1661. var u = r.keyframes;
  1662. (this._mediaInfo.keyframesIndex = this._parseKeyframesIndex(u)), (r.keyframes = null);
  1663. } else this._mediaInfo.hasKeyframesIndex = !1;
  1664. (this._dispatch = !1),
  1665. (this._mediaInfo.metadata = r),
  1666. s.Z.v(this.TAG, "Parsed onMetaData"),
  1667. this._mediaInfo.isComplete() && this._onMediaInfo(this._mediaInfo);
  1668. }
  1669. Object.keys(n).length > 0 && this._onScriptDataArrived && this._onScriptDataArrived(Object.assign({}, n));
  1670. }),
  1671. (e.prototype._parseKeyframesIndex = function (e) {
  1672. for (var t = [], i = [], n = 1; n < e.times.length; n++) {
  1673. var r = this._timestampBase + Math.floor(1e3 * e.times[n]);
  1674. t.push(r), i.push(e.filepositions[n]);
  1675. }
  1676. return { times: t, filepositions: i };
  1677. }),
  1678. (e.prototype._parseAudioData = function (e, t, i, n) {
  1679. if (i <= 1) s.Z.w(this.TAG, "Flv: Invalid audio packet, missing SoundData payload!");
  1680. else if (!0 !== this._hasAudioFlagOverrided || !1 !== this._hasAudio) {
  1681. this._littleEndian;
  1682. var r = new DataView(e, t, i).getUint8(0),
  1683. o = r >>> 4;
  1684. if (2 === o || 10 === o) {
  1685. var a = 0,
  1686. h = (12 & r) >>> 2;
  1687. if (h >= 0 && h <= 4) {
  1688. a = this._flvSoundRateTable[h];
  1689. var u = 1 & r,
  1690. l = this._audioMetadata,
  1691. d = this._audioTrack;
  1692. if (
  1693. (l ||
  1694. (!1 === this._hasAudio && !1 === this._hasAudioFlagOverrided && ((this._hasAudio = !0), (this._mediaInfo.hasAudio = !0)),
  1695. ((l = this._audioMetadata = {}).type = "audio"),
  1696. (l.id = d.id),
  1697. (l.timescale = this._timescale),
  1698. (l.duration = this._duration),
  1699. (l.audioSampleRate = a),
  1700. (l.channelCount = 0 === u ? 1 : 2)),
  1701. 10 === o)
  1702. ) {
  1703. var c = this._parseAACAudioData(e, t + 1, i - 1);
  1704. if (null == c) return;
  1705. if (0 === c.packetType) {
  1706. l.config && s.Z.w(this.TAG, "Found another AudioSpecificConfig!");
  1707. var f = c.data;
  1708. (l.audioSampleRate = f.samplingRate),
  1709. (l.channelCount = f.channelCount),
  1710. (l.codec = f.codec),
  1711. (l.originalCodec = f.originalCodec),
  1712. (l.config = f.config),
  1713. (l.refSampleDuration = (1024 / l.audioSampleRate) * l.timescale),
  1714. s.Z.v(this.TAG, "Parsed AudioSpecificConfig"),
  1715. this._isInitialMetadataDispatched()
  1716. ? this._dispatch &&
  1717. (this._audioTrack.length || this._videoTrack.length) &&
  1718. this._onDataAvailable(this._audioTrack, this._videoTrack)
  1719. : (this._audioInitialMetadataDispatched = !0),
  1720. (this._dispatch = !1),
  1721. this._onTrackMetadata("audio", l),
  1722. ((g = this._mediaInfo).audioCodec = l.originalCodec),
  1723. (g.audioSampleRate = l.audioSampleRate),
  1724. (g.audioChannelCount = l.channelCount),
  1725. g.hasVideo
  1726. ? null != g.videoCodec && (g.mimeType = 'video/x-flv; codecs="' + g.videoCodec + "," + g.audioCodec + '"')
  1727. : (g.mimeType = 'video/x-flv; codecs="' + g.audioCodec + '"'),
  1728. g.isComplete() && this._onMediaInfo(g);
  1729. } else if (1 === c.packetType) {
  1730. var _ = this._timestampBase + n,
  1731. p = { unit: c.data, length: c.data.byteLength, dts: _, pts: _ };
  1732. d.samples.push(p), (d.length += c.data.length);
  1733. } else s.Z.e(this.TAG, "Flv: Unsupported AAC data type " + c.packetType);
  1734. } else if (2 === o) {
  1735. if (!l.codec) {
  1736. var g;
  1737. if (null == (f = this._parseMP3AudioData(e, t + 1, i - 1, !0))) return;
  1738. (l.audioSampleRate = f.samplingRate),
  1739. (l.channelCount = f.channelCount),
  1740. (l.codec = f.codec),
  1741. (l.originalCodec = f.originalCodec),
  1742. (l.refSampleDuration = (1152 / l.audioSampleRate) * l.timescale),
  1743. s.Z.v(this.TAG, "Parsed MPEG Audio Frame Header"),
  1744. (this._audioInitialMetadataDispatched = !0),
  1745. this._onTrackMetadata("audio", l),
  1746. ((g = this._mediaInfo).audioCodec = l.codec),
  1747. (g.audioSampleRate = l.audioSampleRate),
  1748. (g.audioChannelCount = l.channelCount),
  1749. (g.audioDataRate = f.bitRate),
  1750. g.hasVideo
  1751. ? null != g.videoCodec && (g.mimeType = 'video/x-flv; codecs="' + g.videoCodec + "," + g.audioCodec + '"')
  1752. : (g.mimeType = 'video/x-flv; codecs="' + g.audioCodec + '"'),
  1753. g.isComplete() && this._onMediaInfo(g);
  1754. }
  1755. var v = this._parseMP3AudioData(e, t + 1, i - 1, !1);
  1756. if (null == v) return;
  1757. _ = this._timestampBase + n;
  1758. var y = { unit: v, length: v.byteLength, dts: _, pts: _ };
  1759. d.samples.push(y), (d.length += v.length);
  1760. }
  1761. } else this._onError(m.Z.FORMAT_ERROR, "Flv: Invalid audio sample rate idx: " + h);
  1762. } else this._onError(m.Z.CODEC_UNSUPPORTED, "Flv: Unsupported audio codec idx: " + o);
  1763. }
  1764. }),
  1765. (e.prototype._parseAACAudioData = function (e, t, i) {
  1766. if (!(i <= 1)) {
  1767. var n = {},
  1768. r = new Uint8Array(e, t, i);
  1769. return (
  1770. (n.packetType = r[0]), 0 === r[0] ? (n.data = this._parseAACAudioSpecificConfig(e, t + 1, i - 1)) : (n.data = r.subarray(1)), n
  1771. );
  1772. }
  1773. s.Z.w(this.TAG, "Flv: Invalid AAC packet, missing AACPacketType or/and Data!");
  1774. }),
  1775. (e.prototype._parseAACAudioSpecificConfig = function (e, t, i) {
  1776. var n,
  1777. r,
  1778. s = new Uint8Array(e, t, i),
  1779. o = null,
  1780. a = 0,
  1781. h = null;
  1782. if (((a = n = s[0] >>> 3), (r = ((7 & s[0]) << 1) | (s[1] >>> 7)) < 0 || r >= this._mpegSamplingRates.length))
  1783. this._onError(m.Z.FORMAT_ERROR, "Flv: AAC invalid sampling frequency index!");
  1784. else {
  1785. var u = this._mpegSamplingRates[r],
  1786. l = (120 & s[1]) >>> 3;
  1787. if (!(l < 0 || l >= 8)) {
  1788. 5 === a && ((h = ((7 & s[1]) << 1) | (s[2] >>> 7)), (124 & s[2]) >>> 2);
  1789. var d = self.navigator.userAgent.toLowerCase();
  1790. return (
  1791. -1 !== d.indexOf("firefox")
  1792. ? r >= 6
  1793. ? ((a = 5), (o = new Array(4)), (h = r - 3))
  1794. : ((a = 2), (o = new Array(2)), (h = r))
  1795. : -1 !== d.indexOf("android")
  1796. ? ((a = 2), (o = new Array(2)), (h = r))
  1797. : ((a = 5), (h = r), (o = new Array(4)), r >= 6 ? (h = r - 3) : 1 === l && ((a = 2), (o = new Array(2)), (h = r))),
  1798. (o[0] = a << 3),
  1799. (o[0] |= (15 & r) >>> 1),
  1800. (o[1] = (15 & r) << 7),
  1801. (o[1] |= (15 & l) << 3),
  1802. 5 === a && ((o[1] |= (15 & h) >>> 1), (o[2] = (1 & h) << 7), (o[2] |= 8), (o[3] = 0)),
  1803. { config: o, samplingRate: u, channelCount: l, codec: "mp4a.40." + a, originalCodec: "mp4a.40." + n }
  1804. );
  1805. }
  1806. this._onError(m.Z.FORMAT_ERROR, "Flv: AAC invalid channel configuration");
  1807. }
  1808. }),
  1809. (e.prototype._parseMP3AudioData = function (e, t, i, n) {
  1810. if (!(i < 4)) {
  1811. this._littleEndian;
  1812. var r = new Uint8Array(e, t, i),
  1813. o = null;
  1814. if (n) {
  1815. if (255 !== r[0]) return;
  1816. var a = (r[1] >>> 3) & 3,
  1817. h = (6 & r[1]) >> 1,
  1818. u = (240 & r[2]) >>> 4,
  1819. l = (12 & r[2]) >>> 2,
  1820. d = 3 !== ((r[3] >>> 6) & 3) ? 2 : 1,
  1821. c = 0,
  1822. f = 0;
  1823. switch (a) {
  1824. case 0:
  1825. c = this._mpegAudioV25SampleRateTable[l];
  1826. break;
  1827. case 2:
  1828. c = this._mpegAudioV20SampleRateTable[l];
  1829. break;
  1830. case 3:
  1831. c = this._mpegAudioV10SampleRateTable[l];
  1832. }
  1833. switch (h) {
  1834. case 1:
  1835. 34, u < this._mpegAudioL3BitRateTable.length && (f = this._mpegAudioL3BitRateTable[u]);
  1836. break;
  1837. case 2:
  1838. 33, u < this._mpegAudioL2BitRateTable.length && (f = this._mpegAudioL2BitRateTable[u]);
  1839. break;
  1840. case 3:
  1841. 32, u < this._mpegAudioL1BitRateTable.length && (f = this._mpegAudioL1BitRateTable[u]);
  1842. }
  1843. o = { bitRate: f, samplingRate: c, channelCount: d, codec: "mp3", originalCodec: "mp3" };
  1844. } else o = r;
  1845. return o;
  1846. }
  1847. s.Z.w(this.TAG, "Flv: Invalid MP3 packet, header missing!");
  1848. }),
  1849. (e.prototype._parseVideoData = function (e, t, i, n, r) {
  1850. if (i <= 1) s.Z.w(this.TAG, "Flv: Invalid video packet, missing VideoData payload!");
  1851. else if (!0 !== this._hasVideoFlagOverrided || !1 !== this._hasVideo) {
  1852. var o = new Uint8Array(e, t, i)[0],
  1853. a = (240 & o) >>> 4,
  1854. h = 15 & o;
  1855. 7 === h
  1856. ? this._parseAVCVideoPacket(e, t + 1, i - 1, n, r, a)
  1857. : this._onError(m.Z.CODEC_UNSUPPORTED, "Flv: Unsupported codec in video frame: " + h);
  1858. }
  1859. }),
  1860. (e.prototype._parseAVCVideoPacket = function (e, t, i, n, r, o) {
  1861. if (i < 4) s.Z.w(this.TAG, "Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");
  1862. else {
  1863. var a = this._littleEndian,
  1864. h = new DataView(e, t, i),
  1865. u = h.getUint8(0),
  1866. l = ((16777215 & h.getUint32(0, !a)) << 8) >> 8;
  1867. if (0 === u) this._parseAVCDecoderConfigurationRecord(e, t + 4, i - 4);
  1868. else if (1 === u) this._parseAVCVideoData(e, t + 4, i - 4, n, r, o, l);
  1869. else if (2 !== u) return void this._onError(m.Z.FORMAT_ERROR, "Flv: Invalid video packet type " + u);
  1870. }
  1871. }),
  1872. (e.prototype._parseAVCDecoderConfigurationRecord = function (e, t, i) {
  1873. if (i < 7) s.Z.w(this.TAG, "Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");
  1874. else {
  1875. var n = this._videoMetadata,
  1876. r = this._videoTrack,
  1877. o = this._littleEndian,
  1878. a = new DataView(e, t, i);
  1879. n
  1880. ? void 0 !== n.avcc && s.Z.w(this.TAG, "Found another AVCDecoderConfigurationRecord!")
  1881. : (!1 === this._hasVideo && !1 === this._hasVideoFlagOverrided && ((this._hasVideo = !0), (this._mediaInfo.hasVideo = !0)),
  1882. ((n = this._videoMetadata = {}).type = "video"),
  1883. (n.id = r.id),
  1884. (n.timescale = this._timescale),
  1885. (n.duration = this._duration));
  1886. var h = a.getUint8(0),
  1887. u = a.getUint8(1);
  1888. a.getUint8(2), a.getUint8(3);
  1889. if (1 === h && 0 !== u)
  1890. if (((this._naluLengthSize = 1 + (3 & a.getUint8(4))), 3 === this._naluLengthSize || 4 === this._naluLengthSize)) {
  1891. var l = 31 & a.getUint8(5);
  1892. if (0 !== l) {
  1893. l > 1 && s.Z.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: SPS Count = " + l);
  1894. for (var d = 6, c = 0; c < l; c++) {
  1895. var f = a.getUint16(d, !o);
  1896. if (((d += 2), 0 !== f)) {
  1897. var _ = new Uint8Array(e, t + d, f);
  1898. d += f;
  1899. var g = p.parseSPS(_);
  1900. if (0 === c) {
  1901. (n.codecWidth = g.codec_size.width),
  1902. (n.codecHeight = g.codec_size.height),
  1903. (n.presentWidth = g.present_size.width),
  1904. (n.presentHeight = g.present_size.height),
  1905. (n.profile = g.profile_string),
  1906. (n.level = g.level_string),
  1907. (n.bitDepth = g.bit_depth),
  1908. (n.chromaFormat = g.chroma_format),
  1909. (n.sarRatio = g.sar_ratio),
  1910. (n.frameRate = g.frame_rate),
  1911. (!1 !== g.frame_rate.fixed && 0 !== g.frame_rate.fps_num && 0 !== g.frame_rate.fps_den) ||
  1912. (n.frameRate = this._referenceFrameRate);
  1913. var v = n.frameRate.fps_den,
  1914. y = n.frameRate.fps_num;
  1915. n.refSampleDuration = n.timescale * (v / y);
  1916. for (var b = _.subarray(1, 4), E = "avc1.", S = 0; S < 3; S++) {
  1917. var A = b[S].toString(16);
  1918. A.length < 2 && (A = "0" + A), (E += A);
  1919. }
  1920. n.codec = E;
  1921. var L = this._mediaInfo;
  1922. (L.width = n.codecWidth),
  1923. (L.height = n.codecHeight),
  1924. (L.fps = n.frameRate.fps),
  1925. (L.profile = n.profile),
  1926. (L.level = n.level),
  1927. (L.refFrames = g.ref_frames),
  1928. (L.chromaFormat = g.chroma_format_string),
  1929. (L.sarNum = n.sarRatio.width),
  1930. (L.sarDen = n.sarRatio.height),
  1931. (L.videoCodec = E),
  1932. L.hasAudio
  1933. ? null != L.audioCodec && (L.mimeType = 'video/x-flv; codecs="' + L.videoCodec + "," + L.audioCodec + '"')
  1934. : (L.mimeType = 'video/x-flv; codecs="' + L.videoCodec + '"'),
  1935. L.isComplete() && this._onMediaInfo(L);
  1936. }
  1937. }
  1938. }
  1939. var R = a.getUint8(d);
  1940. if (0 !== R) {
  1941. R > 1 && s.Z.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: PPS Count = " + R), d++;
  1942. for (c = 0; c < R; c++) {
  1943. f = a.getUint16(d, !o);
  1944. (d += 2), 0 !== f && (d += f);
  1945. }
  1946. (n.avcc = new Uint8Array(i)),
  1947. n.avcc.set(new Uint8Array(e, t, i), 0),
  1948. s.Z.v(this.TAG, "Parsed AVCDecoderConfigurationRecord"),
  1949. this._isInitialMetadataDispatched()
  1950. ? this._dispatch &&
  1951. (this._audioTrack.length || this._videoTrack.length) &&
  1952. this._onDataAvailable(this._audioTrack, this._videoTrack)
  1953. : (this._videoInitialMetadataDispatched = !0),
  1954. (this._dispatch = !1),
  1955. this._onTrackMetadata("video", n);
  1956. } else this._onError(m.Z.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No PPS");
  1957. } else this._onError(m.Z.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No SPS");
  1958. } else this._onError(m.Z.FORMAT_ERROR, "Flv: Strange NaluLengthSizeMinusOne: " + (this._naluLengthSize - 1));
  1959. else this._onError(m.Z.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord");
  1960. }
  1961. }),
  1962. (e.prototype._parseAVCVideoData = function (e, t, i, n, r, o, a) {
  1963. for (
  1964. var h = this._littleEndian,
  1965. u = new DataView(e, t, i),
  1966. l = [],
  1967. d = 0,
  1968. c = 0,
  1969. f = this._naluLengthSize,
  1970. _ = this._timestampBase + n,
  1971. p = 1 === o;
  1972. c < i;
  1973. ) {
  1974. if (c + 4 >= i) {
  1975. s.Z.w(this.TAG, "Malformed Nalu near timestamp " + _ + ", offset = " + c + ", dataSize = " + i);
  1976. break;
  1977. }
  1978. var m = u.getUint32(c, !h);
  1979. if ((3 === f && (m >>>= 8), m > i - f))
  1980. return void s.Z.w(this.TAG, "Malformed Nalus near timestamp " + _ + ", NaluSize > DataSize!");
  1981. var g = 31 & u.getUint8(c + f);
  1982. 5 === g && (p = !0);
  1983. var v = new Uint8Array(e, t + c, f + m),
  1984. y = { type: g, data: v };
  1985. l.push(y), (d += v.byteLength), (c += f + m);
  1986. }
  1987. if (l.length) {
  1988. var b = this._videoTrack,
  1989. E = { units: l, length: d, isKeyframe: p, dts: _, cts: a, pts: _ + a };
  1990. p && (E.fileposition = r), b.samples.push(E), (b.length += d);
  1991. }
  1992. }),
  1993. e
  1994. );
  1995. })(),
  1996. v = (function () {
  1997. function e() {}
  1998. return (
  1999. (e.init = function () {
  2000. for (var t in ((e.types = {
  2001. avc1: [],
  2002. avcC: [],
  2003. btrt: [],
  2004. dinf: [],
  2005. dref: [],
  2006. esds: [],
  2007. ftyp: [],
  2008. hdlr: [],
  2009. mdat: [],
  2010. mdhd: [],
  2011. mdia: [],
  2012. mfhd: [],
  2013. minf: [],
  2014. moof: [],
  2015. moov: [],
  2016. mp4a: [],
  2017. mvex: [],
  2018. mvhd: [],
  2019. sdtp: [],
  2020. stbl: [],
  2021. stco: [],
  2022. stsc: [],
  2023. stsd: [],
  2024. stsz: [],
  2025. stts: [],
  2026. tfdt: [],
  2027. tfhd: [],
  2028. traf: [],
  2029. trak: [],
  2030. trun: [],
  2031. trex: [],
  2032. tkhd: [],
  2033. vmhd: [],
  2034. smhd: [],
  2035. ".mp3": [],
  2036. }),
  2037. e.types))
  2038. e.types.hasOwnProperty(t) && (e.types[t] = [t.charCodeAt(0), t.charCodeAt(1), t.charCodeAt(2), t.charCodeAt(3)]);
  2039. var i = (e.constants = {});
  2040. (i.FTYP = new Uint8Array([105, 115, 111, 109, 0, 0, 0, 1, 105, 115, 111, 109, 97, 118, 99, 49])),
  2041. (i.STSD_PREFIX = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1])),
  2042. (i.STTS = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
  2043. (i.STSC = i.STCO = i.STTS),
  2044. (i.STSZ = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])),
  2045. (i.HDLR_VIDEO = new Uint8Array([
  2046. 0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108,
  2047. 101, 114, 0,
  2048. ])),
  2049. (i.HDLR_AUDIO = new Uint8Array([
  2050. 0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108,
  2051. 101, 114, 0,
  2052. ])),
  2053. (i.DREF = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1])),
  2054. (i.SMHD = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
  2055. (i.VMHD = new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]));
  2056. }),
  2057. (e.box = function (e) {
  2058. for (var t = 8, i = null, n = Array.prototype.slice.call(arguments, 1), r = n.length, s = 0; s < r; s++) t += n[s].byteLength;
  2059. ((i = new Uint8Array(t))[0] = (t >>> 24) & 255), (i[1] = (t >>> 16) & 255), (i[2] = (t >>> 8) & 255), (i[3] = 255 & t), i.set(e, 4);
  2060. var o = 8;
  2061. for (s = 0; s < r; s++) i.set(n[s], o), (o += n[s].byteLength);
  2062. return i;
  2063. }),
  2064. (e.generateInitSegment = function (t) {
  2065. var i = e.box(e.types.ftyp, e.constants.FTYP),
  2066. n = e.moov(t),
  2067. r = new Uint8Array(i.byteLength + n.byteLength);
  2068. return r.set(i, 0), r.set(n, i.byteLength), r;
  2069. }),
  2070. (e.moov = function (t) {
  2071. var i = e.mvhd(t.timescale, t.duration),
  2072. n = e.trak(t),
  2073. r = e.mvex(t);
  2074. return e.box(e.types.moov, i, n, r);
  2075. }),
  2076. (e.mvhd = function (t, i) {
  2077. return e.box(
  2078. e.types.mvhd,
  2079. new Uint8Array([
  2080. 0,
  2081. 0,
  2082. 0,
  2083. 0,
  2084. 0,
  2085. 0,
  2086. 0,
  2087. 0,
  2088. 0,
  2089. 0,
  2090. 0,
  2091. 0,
  2092. (t >>> 24) & 255,
  2093. (t >>> 16) & 255,
  2094. (t >>> 8) & 255,
  2095. 255 & t,
  2096. (i >>> 24) & 255,
  2097. (i >>> 16) & 255,
  2098. (i >>> 8) & 255,
  2099. 255 & i,
  2100. 0,
  2101. 1,
  2102. 0,
  2103. 0,
  2104. 1,
  2105. 0,
  2106. 0,
  2107. 0,
  2108. 0,
  2109. 0,
  2110. 0,
  2111. 0,
  2112. 0,
  2113. 0,
  2114. 0,
  2115. 0,
  2116. 0,
  2117. 1,
  2118. 0,
  2119. 0,
  2120. 0,
  2121. 0,
  2122. 0,
  2123. 0,
  2124. 0,
  2125. 0,
  2126. 0,
  2127. 0,
  2128. 0,
  2129. 0,
  2130. 0,
  2131. 0,
  2132. 0,
  2133. 1,
  2134. 0,
  2135. 0,
  2136. 0,
  2137. 0,
  2138. 0,
  2139. 0,
  2140. 0,
  2141. 0,
  2142. 0,
  2143. 0,
  2144. 0,
  2145. 0,
  2146. 0,
  2147. 0,
  2148. 64,
  2149. 0,
  2150. 0,
  2151. 0,
  2152. 0,
  2153. 0,
  2154. 0,
  2155. 0,
  2156. 0,
  2157. 0,
  2158. 0,
  2159. 0,
  2160. 0,
  2161. 0,
  2162. 0,
  2163. 0,
  2164. 0,
  2165. 0,
  2166. 0,
  2167. 0,
  2168. 0,
  2169. 0,
  2170. 0,
  2171. 0,
  2172. 0,
  2173. 0,
  2174. 0,
  2175. 0,
  2176. 255,
  2177. 255,
  2178. 255,
  2179. 255,
  2180. ])
  2181. );
  2182. }),
  2183. (e.trak = function (t) {
  2184. return e.box(e.types.trak, e.tkhd(t), e.mdia(t));
  2185. }),
  2186. (e.tkhd = function (t) {
  2187. var i = t.id,
  2188. n = t.duration,
  2189. r = t.presentWidth,
  2190. s = t.presentHeight;
  2191. return e.box(
  2192. e.types.tkhd,
  2193. new Uint8Array([
  2194. 0,
  2195. 0,
  2196. 0,
  2197. 7,
  2198. 0,
  2199. 0,
  2200. 0,
  2201. 0,
  2202. 0,
  2203. 0,
  2204. 0,
  2205. 0,
  2206. (i >>> 24) & 255,
  2207. (i >>> 16) & 255,
  2208. (i >>> 8) & 255,
  2209. 255 & i,
  2210. 0,
  2211. 0,
  2212. 0,
  2213. 0,
  2214. (n >>> 24) & 255,
  2215. (n >>> 16) & 255,
  2216. (n >>> 8) & 255,
  2217. 255 & n,
  2218. 0,
  2219. 0,
  2220. 0,
  2221. 0,
  2222. 0,
  2223. 0,
  2224. 0,
  2225. 0,
  2226. 0,
  2227. 0,
  2228. 0,
  2229. 0,
  2230. 0,
  2231. 0,
  2232. 0,
  2233. 0,
  2234. 0,
  2235. 1,
  2236. 0,
  2237. 0,
  2238. 0,
  2239. 0,
  2240. 0,
  2241. 0,
  2242. 0,
  2243. 0,
  2244. 0,
  2245. 0,
  2246. 0,
  2247. 0,
  2248. 0,
  2249. 0,
  2250. 0,
  2251. 1,
  2252. 0,
  2253. 0,
  2254. 0,
  2255. 0,
  2256. 0,
  2257. 0,
  2258. 0,
  2259. 0,
  2260. 0,
  2261. 0,
  2262. 0,
  2263. 0,
  2264. 0,
  2265. 0,
  2266. 64,
  2267. 0,
  2268. 0,
  2269. 0,
  2270. (r >>> 8) & 255,
  2271. 255 & r,
  2272. 0,
  2273. 0,
  2274. (s >>> 8) & 255,
  2275. 255 & s,
  2276. 0,
  2277. 0,
  2278. ])
  2279. );
  2280. }),
  2281. (e.mdia = function (t) {
  2282. return e.box(e.types.mdia, e.mdhd(t), e.hdlr(t), e.minf(t));
  2283. }),
  2284. (e.mdhd = function (t) {
  2285. var i = t.timescale,
  2286. n = t.duration;
  2287. return e.box(
  2288. e.types.mdhd,
  2289. new Uint8Array([
  2290. 0,
  2291. 0,
  2292. 0,
  2293. 0,
  2294. 0,
  2295. 0,
  2296. 0,
  2297. 0,
  2298. 0,
  2299. 0,
  2300. 0,
  2301. 0,
  2302. (i >>> 24) & 255,
  2303. (i >>> 16) & 255,
  2304. (i >>> 8) & 255,
  2305. 255 & i,
  2306. (n >>> 24) & 255,
  2307. (n >>> 16) & 255,
  2308. (n >>> 8) & 255,
  2309. 255 & n,
  2310. 85,
  2311. 196,
  2312. 0,
  2313. 0,
  2314. ])
  2315. );
  2316. }),
  2317. (e.hdlr = function (t) {
  2318. var i = null;
  2319. return (i = "audio" === t.type ? e.constants.HDLR_AUDIO : e.constants.HDLR_VIDEO), e.box(e.types.hdlr, i);
  2320. }),
  2321. (e.minf = function (t) {
  2322. var i = null;
  2323. return (
  2324. (i = "audio" === t.type ? e.box(e.types.smhd, e.constants.SMHD) : e.box(e.types.vmhd, e.constants.VMHD)),
  2325. e.box(e.types.minf, i, e.dinf(), e.stbl(t))
  2326. );
  2327. }),
  2328. (e.dinf = function () {
  2329. return e.box(e.types.dinf, e.box(e.types.dref, e.constants.DREF));
  2330. }),
  2331. (e.stbl = function (t) {
  2332. return e.box(
  2333. e.types.stbl,
  2334. e.stsd(t),
  2335. e.box(e.types.stts, e.constants.STTS),
  2336. e.box(e.types.stsc, e.constants.STSC),
  2337. e.box(e.types.stsz, e.constants.STSZ),
  2338. e.box(e.types.stco, e.constants.STCO)
  2339. );
  2340. }),
  2341. (e.stsd = function (t) {
  2342. return "audio" === t.type
  2343. ? "mp3" === t.codec
  2344. ? e.box(e.types.stsd, e.constants.STSD_PREFIX, e.mp3(t))
  2345. : e.box(e.types.stsd, e.constants.STSD_PREFIX, e.mp4a(t))
  2346. : e.box(e.types.stsd, e.constants.STSD_PREFIX, e.avc1(t));
  2347. }),
  2348. (e.mp3 = function (t) {
  2349. var i = t.channelCount,
  2350. n = t.audioSampleRate,
  2351. r = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, i, 0, 16, 0, 0, 0, 0, (n >>> 8) & 255, 255 & n, 0, 0]);
  2352. return e.box(e.types[".mp3"], r);
  2353. }),
  2354. (e.mp4a = function (t) {
  2355. var i = t.channelCount,
  2356. n = t.audioSampleRate,
  2357. r = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, i, 0, 16, 0, 0, 0, 0, (n >>> 8) & 255, 255 & n, 0, 0]);
  2358. return e.box(e.types.mp4a, r, e.esds(t));
  2359. }),
  2360. (e.esds = function (t) {
  2361. var i = t.config || [],
  2362. n = i.length,
  2363. r = new Uint8Array(
  2364. [0, 0, 0, 0, 3, 23 + n, 0, 1, 0, 4, 15 + n, 64, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5].concat([n]).concat(i).concat([6, 1, 2])
  2365. );
  2366. return e.box(e.types.esds, r);
  2367. }),
  2368. (e.avc1 = function (t) {
  2369. var i = t.avcc,
  2370. n = t.codecWidth,
  2371. r = t.codecHeight,
  2372. s = new Uint8Array([
  2373. 0,
  2374. 0,
  2375. 0,
  2376. 0,
  2377. 0,
  2378. 0,
  2379. 0,
  2380. 1,
  2381. 0,
  2382. 0,
  2383. 0,
  2384. 0,
  2385. 0,
  2386. 0,
  2387. 0,
  2388. 0,
  2389. 0,
  2390. 0,
  2391. 0,
  2392. 0,
  2393. 0,
  2394. 0,
  2395. 0,
  2396. 0,
  2397. (n >>> 8) & 255,
  2398. 255 & n,
  2399. (r >>> 8) & 255,
  2400. 255 & r,
  2401. 0,
  2402. 72,
  2403. 0,
  2404. 0,
  2405. 0,
  2406. 72,
  2407. 0,
  2408. 0,
  2409. 0,
  2410. 0,
  2411. 0,
  2412. 0,
  2413. 0,
  2414. 1,
  2415. 10,
  2416. 120,
  2417. 113,
  2418. 113,
  2419. 47,
  2420. 102,
  2421. 108,
  2422. 118,
  2423. 46,
  2424. 106,
  2425. 115,
  2426. 0,
  2427. 0,
  2428. 0,
  2429. 0,
  2430. 0,
  2431. 0,
  2432. 0,
  2433. 0,
  2434. 0,
  2435. 0,
  2436. 0,
  2437. 0,
  2438. 0,
  2439. 0,
  2440. 0,
  2441. 0,
  2442. 0,
  2443. 0,
  2444. 0,
  2445. 0,
  2446. 0,
  2447. 0,
  2448. 24,
  2449. 255,
  2450. 255,
  2451. ]);
  2452. return e.box(e.types.avc1, s, e.box(e.types.avcC, i));
  2453. }),
  2454. (e.mvex = function (t) {
  2455. return e.box(e.types.mvex, e.trex(t));
  2456. }),
  2457. (e.trex = function (t) {
  2458. var i = t.id,
  2459. n = new Uint8Array([
  2460. 0,
  2461. 0,
  2462. 0,
  2463. 0,
  2464. (i >>> 24) & 255,
  2465. (i >>> 16) & 255,
  2466. (i >>> 8) & 255,
  2467. 255 & i,
  2468. 0,
  2469. 0,
  2470. 0,
  2471. 1,
  2472. 0,
  2473. 0,
  2474. 0,
  2475. 0,
  2476. 0,
  2477. 0,
  2478. 0,
  2479. 0,
  2480. 0,
  2481. 1,
  2482. 0,
  2483. 1,
  2484. ]);
  2485. return e.box(e.types.trex, n);
  2486. }),
  2487. (e.moof = function (t, i) {
  2488. return e.box(e.types.moof, e.mfhd(t.sequenceNumber), e.traf(t, i));
  2489. }),
  2490. (e.mfhd = function (t) {
  2491. var i = new Uint8Array([0, 0, 0, 0, (t >>> 24) & 255, (t >>> 16) & 255, (t >>> 8) & 255, 255 & t]);
  2492. return e.box(e.types.mfhd, i);
  2493. }),
  2494. (e.traf = function (t, i) {
  2495. var n = t.id,
  2496. r = e.box(e.types.tfhd, new Uint8Array([0, 0, 0, 0, (n >>> 24) & 255, (n >>> 16) & 255, (n >>> 8) & 255, 255 & n])),
  2497. s = e.box(e.types.tfdt, new Uint8Array([0, 0, 0, 0, (i >>> 24) & 255, (i >>> 16) & 255, (i >>> 8) & 255, 255 & i])),
  2498. o = e.sdtp(t),
  2499. a = e.trun(t, o.byteLength + 16 + 16 + 8 + 16 + 8 + 8);
  2500. return e.box(e.types.traf, r, s, a, o);
  2501. }),
  2502. (e.sdtp = function (t) {
  2503. for (var i = t.samples || [], n = i.length, r = new Uint8Array(4 + n), s = 0; s < n; s++) {
  2504. var o = i[s].flags;
  2505. r[s + 4] = (o.isLeading << 6) | (o.dependsOn << 4) | (o.isDependedOn << 2) | o.hasRedundancy;
  2506. }
  2507. return e.box(e.types.sdtp, r);
  2508. }),
  2509. (e.trun = function (t, i) {
  2510. var n = t.samples || [],
  2511. r = n.length,
  2512. s = 12 + 16 * r,
  2513. o = new Uint8Array(s);
  2514. (i += 8 + s),
  2515. o.set(
  2516. [
  2517. 0,
  2518. 0,
  2519. 15,
  2520. 1,
  2521. (r >>> 24) & 255,
  2522. (r >>> 16) & 255,
  2523. (r >>> 8) & 255,
  2524. 255 & r,
  2525. (i >>> 24) & 255,
  2526. (i >>> 16) & 255,
  2527. (i >>> 8) & 255,
  2528. 255 & i,
  2529. ],
  2530. 0
  2531. );
  2532. for (var a = 0; a < r; a++) {
  2533. var h = n[a].duration,
  2534. u = n[a].size,
  2535. l = n[a].flags,
  2536. d = n[a].cts;
  2537. o.set(
  2538. [
  2539. (h >>> 24) & 255,
  2540. (h >>> 16) & 255,
  2541. (h >>> 8) & 255,
  2542. 255 & h,
  2543. (u >>> 24) & 255,
  2544. (u >>> 16) & 255,
  2545. (u >>> 8) & 255,
  2546. 255 & u,
  2547. (l.isLeading << 2) | l.dependsOn,
  2548. (l.isDependedOn << 6) | (l.hasRedundancy << 4) | l.isNonSync,
  2549. 0,
  2550. 0,
  2551. (d >>> 24) & 255,
  2552. (d >>> 16) & 255,
  2553. (d >>> 8) & 255,
  2554. 255 & d,
  2555. ],
  2556. 12 + 16 * a
  2557. );
  2558. }
  2559. return e.box(e.types.trun, o);
  2560. }),
  2561. (e.mdat = function (t) {
  2562. return e.box(e.types.mdat, t);
  2563. }),
  2564. e
  2565. );
  2566. })();
  2567. v.init();
  2568. var y = v,
  2569. b = (function () {
  2570. function e() {}
  2571. return (
  2572. (e.getSilentFrame = function (e, t) {
  2573. if ("mp4a.40.2" === e) {
  2574. if (1 === t) return new Uint8Array([0, 200, 0, 128, 35, 128]);
  2575. if (2 === t) return new Uint8Array([33, 0, 73, 144, 2, 25, 0, 35, 128]);
  2576. if (3 === t) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142]);
  2577. if (4 === t) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44, 128, 8, 2, 56]);
  2578. if (5 === t) return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 56]);
  2579. if (6 === t)
  2580. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 0, 178, 0, 32, 8, 224]);
  2581. } else {
  2582. if (1 === t)
  2583. return new Uint8Array([
  2584. 1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28, 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  2585. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94,
  2586. ]);
  2587. if (2 === t)
  2588. return new Uint8Array([
  2589. 1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  2590. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94,
  2591. ]);
  2592. if (3 === t)
  2593. return new Uint8Array([
  2594. 1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  2595. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94,
  2596. ]);
  2597. }
  2598. return null;
  2599. }),
  2600. e
  2601. );
  2602. })(),
  2603. E = i(51),
  2604. S = (function () {
  2605. function e(e) {
  2606. (this.TAG = "MP4Remuxer"),
  2607. (this._config = e),
  2608. (this._isLive = !0 === e.isLive),
  2609. (this._dtsBase = -1),
  2610. (this._dtsBaseInited = !1),
  2611. (this._audioDtsBase = 1 / 0),
  2612. (this._videoDtsBase = 1 / 0),
  2613. (this._audioNextDts = void 0),
  2614. (this._videoNextDts = void 0),
  2615. (this._audioStashedLastSample = null),
  2616. (this._videoStashedLastSample = null),
  2617. (this._audioMeta = null),
  2618. (this._videoMeta = null),
  2619. (this._audioSegmentInfoList = new E.J1("audio")),
  2620. (this._videoSegmentInfoList = new E.J1("video")),
  2621. (this._onInitSegment = null),
  2622. (this._onMediaSegment = null),
  2623. (this._forceFirstIDR = !(!o.Z.chrome || !(o.Z.version.major < 50 || (50 === o.Z.version.major && o.Z.version.build < 2661)))),
  2624. (this._fillSilentAfterSeek = o.Z.msedge || o.Z.msie),
  2625. (this._mp3UseMpegAudio = !o.Z.firefox),
  2626. (this._fillAudioTimestampGap = this._config.fixAudioTimestampGap);
  2627. }
  2628. return (
  2629. (e.prototype.destroy = function () {
  2630. (this._dtsBase = -1),
  2631. (this._dtsBaseInited = !1),
  2632. (this._audioMeta = null),
  2633. (this._videoMeta = null),
  2634. this._audioSegmentInfoList.clear(),
  2635. (this._audioSegmentInfoList = null),
  2636. this._videoSegmentInfoList.clear(),
  2637. (this._videoSegmentInfoList = null),
  2638. (this._onInitSegment = null),
  2639. (this._onMediaSegment = null);
  2640. }),
  2641. (e.prototype.bindDataSource = function (e) {
  2642. return (e.onDataAvailable = this.remux.bind(this)), (e.onTrackMetadata = this._onTrackMetadataReceived.bind(this)), this;
  2643. }),
  2644. Object.defineProperty(e.prototype, "onInitSegment", {
  2645. get: function () {
  2646. return this._onInitSegment;
  2647. },
  2648. set: function (e) {
  2649. this._onInitSegment = e;
  2650. },
  2651. enumerable: !1,
  2652. configurable: !0,
  2653. }),
  2654. Object.defineProperty(e.prototype, "onMediaSegment", {
  2655. get: function () {
  2656. return this._onMediaSegment;
  2657. },
  2658. set: function (e) {
  2659. this._onMediaSegment = e;
  2660. },
  2661. enumerable: !1,
  2662. configurable: !0,
  2663. }),
  2664. (e.prototype.insertDiscontinuity = function () {
  2665. this._audioNextDts = this._videoNextDts = void 0;
  2666. }),
  2667. (e.prototype.seek = function (e) {
  2668. (this._audioStashedLastSample = null),
  2669. (this._videoStashedLastSample = null),
  2670. this._videoSegmentInfoList.clear(),
  2671. this._audioSegmentInfoList.clear();
  2672. }),
  2673. (e.prototype.remux = function (e, t) {
  2674. if (!this._onMediaSegment) throw new d.rT("MP4Remuxer: onMediaSegment callback must be specificed!");
  2675. this._dtsBaseInited || this._calculateDtsBase(e, t), this._remuxVideo(t), this._remuxAudio(e);
  2676. }),
  2677. (e.prototype._onTrackMetadataReceived = function (e, t) {
  2678. var i = null,
  2679. n = "mp4",
  2680. r = t.codec;
  2681. if ("audio" === e)
  2682. (this._audioMeta = t),
  2683. "mp3" === t.codec && this._mp3UseMpegAudio ? ((n = "mpeg"), (r = ""), (i = new Uint8Array())) : (i = y.generateInitSegment(t));
  2684. else {
  2685. if ("video" !== e) return;
  2686. (this._videoMeta = t), (i = y.generateInitSegment(t));
  2687. }
  2688. if (!this._onInitSegment) throw new d.rT("MP4Remuxer: onInitSegment callback must be specified!");
  2689. this._onInitSegment(e, { type: e, data: i.buffer, codec: r, container: e + "/" + n, mediaDuration: t.duration });
  2690. }),
  2691. (e.prototype._calculateDtsBase = function (e, t) {
  2692. this._dtsBaseInited ||
  2693. (e.samples && e.samples.length && (this._audioDtsBase = e.samples[0].dts),
  2694. t.samples && t.samples.length && (this._videoDtsBase = t.samples[0].dts),
  2695. (this._dtsBase = Math.min(this._audioDtsBase, this._videoDtsBase)),
  2696. (this._dtsBaseInited = !0));
  2697. }),
  2698. (e.prototype.flushStashedSamples = function () {
  2699. var e = this._videoStashedLastSample,
  2700. t = this._audioStashedLastSample,
  2701. i = { type: "video", id: 1, sequenceNumber: 0, samples: [], length: 0 };
  2702. null != e && (i.samples.push(e), (i.length = e.length));
  2703. var n = { type: "audio", id: 2, sequenceNumber: 0, samples: [], length: 0 };
  2704. null != t && (n.samples.push(t), (n.length = t.length)),
  2705. (this._videoStashedLastSample = null),
  2706. (this._audioStashedLastSample = null),
  2707. this._remuxVideo(i, !0),
  2708. this._remuxAudio(n, !0);
  2709. }),
  2710. (e.prototype._remuxAudio = function (e, t) {
  2711. if (null != this._audioMeta) {
  2712. var i,
  2713. n = e,
  2714. r = n.samples,
  2715. a = void 0,
  2716. h = -1,
  2717. u = this._audioMeta.refSampleDuration,
  2718. l = "mp3" === this._audioMeta.codec && this._mp3UseMpegAudio,
  2719. d = this._dtsBaseInited && void 0 === this._audioNextDts,
  2720. c = !1;
  2721. if (r && 0 !== r.length && (1 !== r.length || t)) {
  2722. var f = 0,
  2723. _ = null,
  2724. p = 0;
  2725. l ? ((f = 0), (p = n.length)) : ((f = 8), (p = 8 + n.length));
  2726. var m = null;
  2727. if ((r.length > 1 && (p -= (m = r.pop()).length), null != this._audioStashedLastSample)) {
  2728. var g = this._audioStashedLastSample;
  2729. (this._audioStashedLastSample = null), r.unshift(g), (p += g.length);
  2730. }
  2731. null != m && (this._audioStashedLastSample = m);
  2732. var v = r[0].dts - this._dtsBase;
  2733. if (this._audioNextDts) a = v - this._audioNextDts;
  2734. else if (this._audioSegmentInfoList.isEmpty())
  2735. (a = 0),
  2736. this._fillSilentAfterSeek && !this._videoSegmentInfoList.isEmpty() && "mp3" !== this._audioMeta.originalCodec && (c = !0);
  2737. else {
  2738. var S = this._audioSegmentInfoList.getLastSampleBefore(v);
  2739. if (null != S) {
  2740. var A = v - (S.originalDts + S.duration);
  2741. A <= 3 && (A = 0), (a = v - (S.dts + S.duration + A));
  2742. } else a = 0;
  2743. }
  2744. if (c) {
  2745. var L = v - a,
  2746. R = this._videoSegmentInfoList.getLastSegmentBefore(v);
  2747. if (null != R && R.beginDts < L) {
  2748. if ((P = b.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount))) {
  2749. var w = R.beginDts,
  2750. O = L - R.beginDts;
  2751. s.Z.v(this.TAG, "InsertPrefixSilentAudio: dts: " + w + ", duration: " + O),
  2752. r.unshift({ unit: P, dts: w, pts: w }),
  2753. (p += P.byteLength);
  2754. }
  2755. } else c = !1;
  2756. }
  2757. for (var T = [], C = 0; C < r.length; C++) {
  2758. var k = (g = r[C]).unit,
  2759. D = g.dts - this._dtsBase,
  2760. I = ((w = D), !1),
  2761. M = null,
  2762. B = 0;
  2763. if (!(D < -0.001)) {
  2764. if ("mp3" !== this._audioMeta.codec) {
  2765. var x = D;
  2766. if ((this._audioNextDts && (x = this._audioNextDts), (a = D - x) <= -3 * u)) {
  2767. s.Z.w(
  2768. this.TAG,
  2769. "Dropping 1 audio frame (originalDts: " +
  2770. D +
  2771. " ms ,curRefDts: " +
  2772. x +
  2773. " ms) due to dtsCorrection: " +
  2774. a +
  2775. " ms overlap."
  2776. );
  2777. continue;
  2778. }
  2779. if (a >= 3 * u && this._fillAudioTimestampGap && !o.Z.safari) {
  2780. I = !0;
  2781. var P,
  2782. U = Math.floor(a / u);
  2783. s.Z.w(
  2784. this.TAG,
  2785. "Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: " +
  2786. D +
  2787. " ms, curRefDts: " +
  2788. x +
  2789. " ms, dtsCorrection: " +
  2790. Math.round(a) +
  2791. " ms, generate: " +
  2792. U +
  2793. " frames"
  2794. ),
  2795. (w = Math.floor(x)),
  2796. (B = Math.floor(x + u) - w),
  2797. null == (P = b.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount)) &&
  2798. (s.Z.w(
  2799. this.TAG,
  2800. "Unable to generate silent frame for " +
  2801. this._audioMeta.originalCodec +
  2802. " with " +
  2803. this._audioMeta.channelCount +
  2804. " channels, repeat last frame"
  2805. ),
  2806. (P = k)),
  2807. (M = []);
  2808. for (var N = 0; N < U; N++) {
  2809. x += u;
  2810. var Z = Math.floor(x),
  2811. F = Math.floor(x + u) - Z,
  2812. G = {
  2813. dts: Z,
  2814. pts: Z,
  2815. cts: 0,
  2816. unit: P,
  2817. size: P.byteLength,
  2818. duration: F,
  2819. originalDts: D,
  2820. flags: { isLeading: 0, dependsOn: 1, isDependedOn: 0, hasRedundancy: 0 },
  2821. };
  2822. M.push(G), (p += G.size);
  2823. }
  2824. this._audioNextDts = x + u;
  2825. } else (w = Math.floor(x)), (B = Math.floor(x + u) - w), (this._audioNextDts = x + u);
  2826. } else {
  2827. if (((w = D - a), C !== r.length - 1)) B = r[C + 1].dts - this._dtsBase - a - w;
  2828. else if (null != m) B = m.dts - this._dtsBase - a - w;
  2829. else B = T.length >= 1 ? T[T.length - 1].duration : Math.floor(u);
  2830. this._audioNextDts = w + B;
  2831. }
  2832. -1 === h && (h = w),
  2833. T.push({
  2834. dts: w,
  2835. pts: w,
  2836. cts: 0,
  2837. unit: g.unit,
  2838. size: g.unit.byteLength,
  2839. duration: B,
  2840. originalDts: D,
  2841. flags: { isLeading: 0, dependsOn: 1, isDependedOn: 0, hasRedundancy: 0 },
  2842. }),
  2843. I && T.push.apply(T, M);
  2844. }
  2845. }
  2846. if (0 === T.length) return (n.samples = []), void (n.length = 0);
  2847. l
  2848. ? (_ = new Uint8Array(p))
  2849. : (((_ = new Uint8Array(p))[0] = (p >>> 24) & 255),
  2850. (_[1] = (p >>> 16) & 255),
  2851. (_[2] = (p >>> 8) & 255),
  2852. (_[3] = 255 & p),
  2853. _.set(y.types.mdat, 4));
  2854. for (C = 0; C < T.length; C++) {
  2855. k = T[C].unit;
  2856. _.set(k, f), (f += k.byteLength);
  2857. }
  2858. var j = T[T.length - 1];
  2859. i = j.dts + j.duration;
  2860. var V = new E.Yy();
  2861. (V.beginDts = h),
  2862. (V.endDts = i),
  2863. (V.beginPts = h),
  2864. (V.endPts = i),
  2865. (V.originalBeginDts = T[0].originalDts),
  2866. (V.originalEndDts = j.originalDts + j.duration),
  2867. (V.firstSample = new E.Wk(T[0].dts, T[0].pts, T[0].duration, T[0].originalDts, !1)),
  2868. (V.lastSample = new E.Wk(j.dts, j.pts, j.duration, j.originalDts, !1)),
  2869. this._isLive || this._audioSegmentInfoList.append(V),
  2870. (n.samples = T),
  2871. n.sequenceNumber++;
  2872. var z = null;
  2873. (z = l ? new Uint8Array() : y.moof(n, h)), (n.samples = []), (n.length = 0);
  2874. var K = { type: "audio", data: this._mergeBoxes(z, _).buffer, sampleCount: T.length, info: V };
  2875. l && d && (K.timestampOffset = h), this._onMediaSegment("audio", K);
  2876. }
  2877. }
  2878. }),
  2879. (e.prototype._remuxVideo = function (e, t) {
  2880. if (null != this._videoMeta) {
  2881. var i,
  2882. n,
  2883. r = e,
  2884. s = r.samples,
  2885. o = void 0,
  2886. a = -1,
  2887. h = -1;
  2888. if (s && 0 !== s.length && (1 !== s.length || t)) {
  2889. var u = 8,
  2890. l = null,
  2891. d = 8 + e.length,
  2892. c = null;
  2893. if ((s.length > 1 && (d -= (c = s.pop()).length), null != this._videoStashedLastSample)) {
  2894. var f = this._videoStashedLastSample;
  2895. (this._videoStashedLastSample = null), s.unshift(f), (d += f.length);
  2896. }
  2897. null != c && (this._videoStashedLastSample = c);
  2898. var _ = s[0].dts - this._dtsBase;
  2899. if (this._videoNextDts) o = _ - this._videoNextDts;
  2900. else if (this._videoSegmentInfoList.isEmpty()) o = 0;
  2901. else {
  2902. var p = this._videoSegmentInfoList.getLastSampleBefore(_);
  2903. if (null != p) {
  2904. var m = _ - (p.originalDts + p.duration);
  2905. m <= 3 && (m = 0), (o = _ - (p.dts + p.duration + m));
  2906. } else o = 0;
  2907. }
  2908. for (var g = new E.Yy(), v = [], b = 0; b < s.length; b++) {
  2909. var S = (f = s[b]).dts - this._dtsBase,
  2910. A = f.isKeyframe,
  2911. L = S - o,
  2912. R = f.cts,
  2913. w = L + R;
  2914. -1 === a && ((a = L), (h = w));
  2915. var O = 0;
  2916. if (b !== s.length - 1) O = s[b + 1].dts - this._dtsBase - o - L;
  2917. else if (null != c) O = c.dts - this._dtsBase - o - L;
  2918. else O = v.length >= 1 ? v[v.length - 1].duration : Math.floor(this._videoMeta.refSampleDuration);
  2919. if (A) {
  2920. var T = new E.Wk(L, w, O, f.dts, !0);
  2921. (T.fileposition = f.fileposition), g.appendSyncPoint(T);
  2922. }
  2923. v.push({
  2924. dts: L,
  2925. pts: w,
  2926. cts: R,
  2927. units: f.units,
  2928. size: f.length,
  2929. isKeyframe: A,
  2930. duration: O,
  2931. originalDts: S,
  2932. flags: { isLeading: 0, dependsOn: A ? 2 : 1, isDependedOn: A ? 1 : 0, hasRedundancy: 0, isNonSync: A ? 0 : 1 },
  2933. });
  2934. }
  2935. ((l = new Uint8Array(d))[0] = (d >>> 24) & 255),
  2936. (l[1] = (d >>> 16) & 255),
  2937. (l[2] = (d >>> 8) & 255),
  2938. (l[3] = 255 & d),
  2939. l.set(y.types.mdat, 4);
  2940. for (b = 0; b < v.length; b++)
  2941. for (var C = v[b].units; C.length; ) {
  2942. var k = C.shift().data;
  2943. l.set(k, u), (u += k.byteLength);
  2944. }
  2945. var D = v[v.length - 1];
  2946. if (
  2947. ((i = D.dts + D.duration),
  2948. (n = D.pts + D.duration),
  2949. (this._videoNextDts = i),
  2950. (g.beginDts = a),
  2951. (g.endDts = i),
  2952. (g.beginPts = h),
  2953. (g.endPts = n),
  2954. (g.originalBeginDts = v[0].originalDts),
  2955. (g.originalEndDts = D.originalDts + D.duration),
  2956. (g.firstSample = new E.Wk(v[0].dts, v[0].pts, v[0].duration, v[0].originalDts, v[0].isKeyframe)),
  2957. (g.lastSample = new E.Wk(D.dts, D.pts, D.duration, D.originalDts, D.isKeyframe)),
  2958. this._isLive || this._videoSegmentInfoList.append(g),
  2959. (r.samples = v),
  2960. r.sequenceNumber++,
  2961. this._forceFirstIDR)
  2962. ) {
  2963. var I = v[0].flags;
  2964. (I.dependsOn = 2), (I.isNonSync = 0);
  2965. }
  2966. var M = y.moof(r, a);
  2967. (r.samples = []),
  2968. (r.length = 0),
  2969. this._onMediaSegment("video", { type: "video", data: this._mergeBoxes(M, l).buffer, sampleCount: v.length, info: g });
  2970. }
  2971. }
  2972. }),
  2973. (e.prototype._mergeBoxes = function (e, t) {
  2974. var i = new Uint8Array(e.byteLength + t.byteLength);
  2975. return i.set(e, 0), i.set(t, e.byteLength), i;
  2976. }),
  2977. e
  2978. );
  2979. })(),
  2980. A = i(191),
  2981. L = i(257),
  2982. R = (function () {
  2983. function e(e, t) {
  2984. (this.TAG = "TransmuxingController"),
  2985. (this._emitter = new (r())()),
  2986. (this._config = t),
  2987. e.segments || (e.segments = [{ duration: e.duration, filesize: e.filesize, url: e.url }]),
  2988. "boolean" != typeof e.cors && (e.cors = !0),
  2989. "boolean" != typeof e.withCredentials && (e.withCredentials = !1),
  2990. (this._mediaDataSource = e),
  2991. (this._currentSegmentIndex = 0);
  2992. var i = 0;
  2993. this._mediaDataSource.segments.forEach(function (n) {
  2994. (n.timestampBase = i),
  2995. (i += n.duration),
  2996. (n.cors = e.cors),
  2997. (n.withCredentials = e.withCredentials),
  2998. t.referrerPolicy && (n.referrerPolicy = t.referrerPolicy);
  2999. }),
  3000. isNaN(i) || this._mediaDataSource.duration === i || (this._mediaDataSource.duration = i),
  3001. (this._mediaInfo = null),
  3002. (this._demuxer = null),
  3003. (this._remuxer = null),
  3004. (this._ioctl = null),
  3005. (this._pendingSeekTime = null),
  3006. (this._pendingResolveSeekPoint = null),
  3007. (this._statisticsReporter = null);
  3008. }
  3009. return (
  3010. (e.prototype.destroy = function () {
  3011. (this._mediaInfo = null),
  3012. (this._mediaDataSource = null),
  3013. this._statisticsReporter && this._disableStatisticsReporter(),
  3014. this._ioctl && (this._ioctl.destroy(), (this._ioctl = null)),
  3015. this._demuxer && (this._demuxer.destroy(), (this._demuxer = null)),
  3016. this._remuxer && (this._remuxer.destroy(), (this._remuxer = null)),
  3017. this._emitter.removeAllListeners(),
  3018. (this._emitter = null);
  3019. }),
  3020. (e.prototype.on = function (e, t) {
  3021. this._emitter.addListener(e, t);
  3022. }),
  3023. (e.prototype.off = function (e, t) {
  3024. this._emitter.removeListener(e, t);
  3025. }),
  3026. (e.prototype.start = function () {
  3027. this._loadSegment(0), this._enableStatisticsReporter();
  3028. }),
  3029. (e.prototype._loadSegment = function (e, t) {
  3030. this._currentSegmentIndex = e;
  3031. var i = this._mediaDataSource.segments[e],
  3032. n = (this._ioctl = new A.Z(i, this._config, e));
  3033. (n.onError = this._onIOException.bind(this)),
  3034. (n.onSeeked = this._onIOSeeked.bind(this)),
  3035. (n.onComplete = this._onIOComplete.bind(this)),
  3036. (n.onRedirect = this._onIORedirect.bind(this)),
  3037. (n.onRecoveredEarlyEof = this._onIORecoveredEarlyEof.bind(this)),
  3038. t ? this._demuxer.bindDataSource(this._ioctl) : (n.onDataArrival = this._onInitChunkArrival.bind(this)),
  3039. n.open(t);
  3040. }),
  3041. (e.prototype.stop = function () {
  3042. this._internalAbort(), this._disableStatisticsReporter();
  3043. }),
  3044. (e.prototype._internalAbort = function () {
  3045. this._ioctl && (this._ioctl.destroy(), (this._ioctl = null));
  3046. }),
  3047. (e.prototype.pause = function () {
  3048. this._ioctl && this._ioctl.isWorking() && (this._ioctl.pause(), this._disableStatisticsReporter());
  3049. }),
  3050. (e.prototype.resume = function () {
  3051. this._ioctl && this._ioctl.isPaused() && (this._ioctl.resume(), this._enableStatisticsReporter());
  3052. }),
  3053. (e.prototype.seek = function (e) {
  3054. if (null != this._mediaInfo && this._mediaInfo.isSeekable()) {
  3055. var t = this._searchSegmentIndexContains(e);
  3056. if (t === this._currentSegmentIndex) {
  3057. var i = this._mediaInfo.segments[t];
  3058. if (null == i) this._pendingSeekTime = e;
  3059. else {
  3060. var n = i.getNearestKeyframe(e);
  3061. this._remuxer.seek(n.milliseconds), this._ioctl.seek(n.fileposition), (this._pendingResolveSeekPoint = n.milliseconds);
  3062. }
  3063. } else {
  3064. var r = this._mediaInfo.segments[t];
  3065. if (null == r)
  3066. (this._pendingSeekTime = e),
  3067. this._internalAbort(),
  3068. this._remuxer.seek(),
  3069. this._remuxer.insertDiscontinuity(),
  3070. this._loadSegment(t);
  3071. else {
  3072. n = r.getNearestKeyframe(e);
  3073. this._internalAbort(),
  3074. this._remuxer.seek(e),
  3075. this._remuxer.insertDiscontinuity(),
  3076. this._demuxer.resetMediaInfo(),
  3077. (this._demuxer.timestampBase = this._mediaDataSource.segments[t].timestampBase),
  3078. this._loadSegment(t, n.fileposition),
  3079. (this._pendingResolveSeekPoint = n.milliseconds),
  3080. this._reportSegmentMediaInfo(t);
  3081. }
  3082. }
  3083. this._enableStatisticsReporter();
  3084. }
  3085. }),
  3086. (e.prototype._searchSegmentIndexContains = function (e) {
  3087. for (var t = this._mediaDataSource.segments, i = t.length - 1, n = 0; n < t.length; n++)
  3088. if (e < t[n].timestampBase) {
  3089. i = n - 1;
  3090. break;
  3091. }
  3092. return i;
  3093. }),
  3094. (e.prototype._onInitChunkArrival = function (e, t) {
  3095. var i = this,
  3096. n = null,
  3097. r = 0;
  3098. if (t > 0)
  3099. this._demuxer.bindDataSource(this._ioctl),
  3100. (this._demuxer.timestampBase = this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase),
  3101. (r = this._demuxer.parseChunks(e, t));
  3102. else if ((n = g.probe(e)).match) {
  3103. (this._demuxer = new g(n, this._config)), this._remuxer || (this._remuxer = new S(this._config));
  3104. var o = this._mediaDataSource;
  3105. null == o.duration || isNaN(o.duration) || (this._demuxer.overridedDuration = o.duration),
  3106. "boolean" == typeof o.hasAudio && (this._demuxer.overridedHasAudio = o.hasAudio),
  3107. "boolean" == typeof o.hasVideo && (this._demuxer.overridedHasVideo = o.hasVideo),
  3108. (this._demuxer.timestampBase = o.segments[this._currentSegmentIndex].timestampBase),
  3109. (this._demuxer.onError = this._onDemuxException.bind(this)),
  3110. (this._demuxer.onMediaInfo = this._onMediaInfo.bind(this)),
  3111. (this._demuxer.onMetaDataArrived = this._onMetaDataArrived.bind(this)),
  3112. (this._demuxer.onScriptDataArrived = this._onScriptDataArrived.bind(this)),
  3113. this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),
  3114. (this._remuxer.onInitSegment = this._onRemuxerInitSegmentArrival.bind(this)),
  3115. (this._remuxer.onMediaSegment = this._onRemuxerMediaSegmentArrival.bind(this)),
  3116. (r = this._demuxer.parseChunks(e, t));
  3117. } else
  3118. (n = null),
  3119. s.Z.e(this.TAG, "Non-FLV, Unsupported media type!"),
  3120. Promise.resolve().then(function () {
  3121. i._internalAbort();
  3122. }),
  3123. this._emitter.emit(L.Z.DEMUX_ERROR, m.Z.FORMAT_UNSUPPORTED, "Non-FLV, Unsupported media type"),
  3124. (r = 0);
  3125. return r;
  3126. }),
  3127. (e.prototype._onMediaInfo = function (e) {
  3128. var t = this;
  3129. null == this._mediaInfo &&
  3130. ((this._mediaInfo = Object.assign({}, e)),
  3131. (this._mediaInfo.keyframesIndex = null),
  3132. (this._mediaInfo.segments = []),
  3133. (this._mediaInfo.segmentCount = this._mediaDataSource.segments.length),
  3134. Object.setPrototypeOf(this._mediaInfo, a.Z.prototype));
  3135. var i = Object.assign({}, e);
  3136. Object.setPrototypeOf(i, a.Z.prototype),
  3137. (this._mediaInfo.segments[this._currentSegmentIndex] = i),
  3138. this._reportSegmentMediaInfo(this._currentSegmentIndex),
  3139. null != this._pendingSeekTime &&
  3140. Promise.resolve().then(function () {
  3141. var e = t._pendingSeekTime;
  3142. (t._pendingSeekTime = null), t.seek(e);
  3143. });
  3144. }),
  3145. (e.prototype._onMetaDataArrived = function (e) {
  3146. this._emitter.emit(L.Z.METADATA_ARRIVED, e);
  3147. }),
  3148. (e.prototype._onScriptDataArrived = function (e) {
  3149. this._emitter.emit(L.Z.SCRIPTDATA_ARRIVED, e);
  3150. }),
  3151. (e.prototype._onIOSeeked = function () {
  3152. this._remuxer.insertDiscontinuity();
  3153. }),
  3154. (e.prototype._onIOComplete = function (e) {
  3155. var t = e + 1;
  3156. t < this._mediaDataSource.segments.length
  3157. ? (this._internalAbort(), this._remuxer.flushStashedSamples(), this._loadSegment(t))
  3158. : (this._remuxer.flushStashedSamples(), this._emitter.emit(L.Z.LOADING_COMPLETE), this._disableStatisticsReporter());
  3159. }),
  3160. (e.prototype._onIORedirect = function (e) {
  3161. var t = this._ioctl.extraData;
  3162. this._mediaDataSource.segments[t].redirectedURL = e;
  3163. }),
  3164. (e.prototype._onIORecoveredEarlyEof = function () {
  3165. this._emitter.emit(L.Z.RECOVERED_EARLY_EOF);
  3166. }),
  3167. (e.prototype._onIOException = function (e, t) {
  3168. s.Z.e(this.TAG, "IOException: type = " + e + ", code = " + t.code + ", msg = " + t.msg),
  3169. this._emitter.emit(L.Z.IO_ERROR, e, t),
  3170. this._disableStatisticsReporter();
  3171. }),
  3172. (e.prototype._onDemuxException = function (e, t) {
  3173. s.Z.e(this.TAG, "DemuxException: type = " + e + ", info = " + t), this._emitter.emit(L.Z.DEMUX_ERROR, e, t);
  3174. }),
  3175. (e.prototype._onRemuxerInitSegmentArrival = function (e, t) {
  3176. this._emitter.emit(L.Z.INIT_SEGMENT, e, t);
  3177. }),
  3178. (e.prototype._onRemuxerMediaSegmentArrival = function (e, t) {
  3179. if (
  3180. null == this._pendingSeekTime &&
  3181. (this._emitter.emit(L.Z.MEDIA_SEGMENT, e, t), null != this._pendingResolveSeekPoint && "video" === e)
  3182. ) {
  3183. var i = t.info.syncPoints,
  3184. n = this._pendingResolveSeekPoint;
  3185. (this._pendingResolveSeekPoint = null),
  3186. o.Z.safari && i.length > 0 && i[0].originalDts === n && (n = i[0].pts),
  3187. this._emitter.emit(L.Z.RECOMMEND_SEEKPOINT, n);
  3188. }
  3189. }),
  3190. (e.prototype._enableStatisticsReporter = function () {
  3191. null == this._statisticsReporter &&
  3192. (this._statisticsReporter = self.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval));
  3193. }),
  3194. (e.prototype._disableStatisticsReporter = function () {
  3195. this._statisticsReporter && (self.clearInterval(this._statisticsReporter), (this._statisticsReporter = null));
  3196. }),
  3197. (e.prototype._reportSegmentMediaInfo = function (e) {
  3198. var t = this._mediaInfo.segments[e],
  3199. i = Object.assign({}, t);
  3200. (i.duration = this._mediaInfo.duration),
  3201. (i.segmentCount = this._mediaInfo.segmentCount),
  3202. delete i.segments,
  3203. delete i.keyframesIndex,
  3204. this._emitter.emit(L.Z.MEDIA_INFO, i);
  3205. }),
  3206. (e.prototype._reportStatisticsInfo = function () {
  3207. var e = {};
  3208. (e.url = this._ioctl.currentURL),
  3209. (e.hasRedirect = this._ioctl.hasRedirect),
  3210. e.hasRedirect && (e.redirectedURL = this._ioctl.currentRedirectedURL),
  3211. (e.speed = this._ioctl.currentSpeed),
  3212. (e.loaderType = this._ioctl.loaderType),
  3213. (e.currentSegmentIndex = this._currentSegmentIndex),
  3214. (e.totalSegmentCount = this._mediaDataSource.segments.length),
  3215. this._emitter.emit(L.Z.STATISTICS_INFO, e);
  3216. }),
  3217. e
  3218. );
  3219. })();
  3220. },
  3221. 257: function (e, t) {
  3222. "use strict";
  3223. t.Z = {
  3224. IO_ERROR: "io_error",
  3225. DEMUX_ERROR: "demux_error",
  3226. INIT_SEGMENT: "init_segment",
  3227. MEDIA_SEGMENT: "media_segment",
  3228. LOADING_COMPLETE: "loading_complete",
  3229. RECOVERED_EARLY_EOF: "recovered_early_eof",
  3230. MEDIA_INFO: "media_info",
  3231. METADATA_ARRIVED: "metadata_arrived",
  3232. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  3233. STATISTICS_INFO: "statistics_info",
  3234. RECOMMEND_SEEKPOINT: "recommend_seekpoint",
  3235. };
  3236. },
  3237. 82: function (e, t, i) {
  3238. "use strict";
  3239. i(846), i(219), i(949), i(257);
  3240. },
  3241. 600: function (e, t) {
  3242. "use strict";
  3243. t.Z = { OK: "OK", FORMAT_ERROR: "FormatError", FORMAT_UNSUPPORTED: "FormatUnsupported", CODEC_UNSUPPORTED: "CodecUnsupported" };
  3244. },
  3245. 60: function (e, t, i) {
  3246. "use strict";
  3247. i.d(t, {
  3248. default: function () {
  3249. return D;
  3250. },
  3251. });
  3252. var n = i(219),
  3253. r = i(191),
  3254. s = {
  3255. enableWorker: !1,
  3256. enableStashBuffer: !0,
  3257. stashInitialSize: void 0,
  3258. isLive: !1,
  3259. lazyLoad: !0,
  3260. lazyLoadMaxDuration: 180,
  3261. lazyLoadRecoverDuration: 30,
  3262. deferLoadAfterSourceOpen: !0,
  3263. autoCleanupMaxBackwardDuration: 180,
  3264. autoCleanupMinBackwardDuration: 120,
  3265. statisticsInfoReportInterval: 600,
  3266. fixAudioTimestampGap: !0,
  3267. accurateSeek: !1,
  3268. seekType: "range",
  3269. seekParamStart: "bstart",
  3270. seekParamEnd: "bend",
  3271. rangeLoadZeroStart: !1,
  3272. customSeekHandler: void 0,
  3273. reuseRedirectedURL: !1,
  3274. headers: void 0,
  3275. customLoader: void 0,
  3276. };
  3277. function o() {
  3278. return Object.assign({}, s);
  3279. }
  3280. var a = (function () {
  3281. function e() {}
  3282. return (
  3283. (e.supportMSEH264Playback = function () {
  3284. return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
  3285. }),
  3286. (e.supportNetworkStreamIO = function () {
  3287. var e = new r.Z({}, o()),
  3288. t = e.loaderType;
  3289. return e.destroy(), "fetch-stream-loader" == t || "xhr-moz-chunked-loader" == t;
  3290. }),
  3291. (e.getNetworkLoaderTypeName = function () {
  3292. var e = new r.Z({}, o()),
  3293. t = e.loaderType;
  3294. return e.destroy(), t;
  3295. }),
  3296. (e.supportNativeMediaPlayback = function (t) {
  3297. null == e.videoElement && (e.videoElement = window.document.createElement("video"));
  3298. var i = e.videoElement.canPlayType(t);
  3299. return "probably" === i || "maybe" == i;
  3300. }),
  3301. (e.getFeatureList = function () {
  3302. var t = {
  3303. mseFlvPlayback: !1,
  3304. mseLiveFlvPlayback: !1,
  3305. networkStreamIO: !1,
  3306. networkLoaderName: "",
  3307. nativeMP4H264Playback: !1,
  3308. nativeWebmVP8Playback: !1,
  3309. nativeWebmVP9Playback: !1,
  3310. };
  3311. return (
  3312. (t.mseFlvPlayback = e.supportMSEH264Playback()),
  3313. (t.networkStreamIO = e.supportNetworkStreamIO()),
  3314. (t.networkLoaderName = e.getNetworkLoaderTypeName()),
  3315. (t.mseLiveFlvPlayback = t.mseFlvPlayback && t.networkStreamIO),
  3316. (t.nativeMP4H264Playback = e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"')),
  3317. (t.nativeWebmVP8Playback = e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"')),
  3318. (t.nativeWebmVP9Playback = e.supportNativeMediaPlayback('video/webm; codecs="vp9"')),
  3319. t
  3320. );
  3321. }),
  3322. e
  3323. );
  3324. })(),
  3325. h = i(939),
  3326. u = i(716),
  3327. l = i.n(u),
  3328. d = i(300),
  3329. c = i(538),
  3330. f = {
  3331. ERROR: "error",
  3332. LOADING_COMPLETE: "loading_complete",
  3333. RECOVERED_EARLY_EOF: "recovered_early_eof",
  3334. MEDIA_INFO: "media_info",
  3335. METADATA_ARRIVED: "metadata_arrived",
  3336. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  3337. STATISTICS_INFO: "statistics_info",
  3338. },
  3339. _ = i(397),
  3340. p = i.n(_),
  3341. m = i(846),
  3342. g = i(949),
  3343. v = i(257),
  3344. y = i(118),
  3345. b = (function () {
  3346. function e(e, t) {
  3347. if (((this.TAG = "Transmuxer"), (this._emitter = new (l())()), t.enableWorker && "undefined" != typeof Worker))
  3348. try {
  3349. (this._worker = p()(82)),
  3350. (this._workerDestroying = !1),
  3351. this._worker.addEventListener("message", this._onWorkerMessage.bind(this)),
  3352. this._worker.postMessage({ cmd: "init", param: [e, t] }),
  3353. (this.e = { onLoggingConfigChanged: this._onLoggingConfigChanged.bind(this) }),
  3354. m.Z.registerListener(this.e.onLoggingConfigChanged),
  3355. this._worker.postMessage({ cmd: "logging_config", param: m.Z.getConfig() });
  3356. } catch (i) {
  3357. d.Z.e(this.TAG, "Error while initialize transmuxing worker, fallback to inline transmuxing"),
  3358. (this._worker = null),
  3359. (this._controller = new g.Z(e, t));
  3360. }
  3361. else this._controller = new g.Z(e, t);
  3362. if (this._controller) {
  3363. var i = this._controller;
  3364. i.on(v.Z.IO_ERROR, this._onIOError.bind(this)),
  3365. i.on(v.Z.DEMUX_ERROR, this._onDemuxError.bind(this)),
  3366. i.on(v.Z.INIT_SEGMENT, this._onInitSegment.bind(this)),
  3367. i.on(v.Z.MEDIA_SEGMENT, this._onMediaSegment.bind(this)),
  3368. i.on(v.Z.LOADING_COMPLETE, this._onLoadingComplete.bind(this)),
  3369. i.on(v.Z.RECOVERED_EARLY_EOF, this._onRecoveredEarlyEof.bind(this)),
  3370. i.on(v.Z.MEDIA_INFO, this._onMediaInfo.bind(this)),
  3371. i.on(v.Z.METADATA_ARRIVED, this._onMetaDataArrived.bind(this)),
  3372. i.on(v.Z.SCRIPTDATA_ARRIVED, this._onScriptDataArrived.bind(this)),
  3373. i.on(v.Z.STATISTICS_INFO, this._onStatisticsInfo.bind(this)),
  3374. i.on(v.Z.RECOMMEND_SEEKPOINT, this._onRecommendSeekpoint.bind(this));
  3375. }
  3376. }
  3377. return (
  3378. (e.prototype.destroy = function () {
  3379. this._worker
  3380. ? this._workerDestroying ||
  3381. ((this._workerDestroying = !0),
  3382. this._worker.postMessage({ cmd: "destroy" }),
  3383. m.Z.removeListener(this.e.onLoggingConfigChanged),
  3384. (this.e = null))
  3385. : (this._controller.destroy(), (this._controller = null)),
  3386. this._emitter.removeAllListeners(),
  3387. (this._emitter = null);
  3388. }),
  3389. (e.prototype.on = function (e, t) {
  3390. this._emitter.addListener(e, t);
  3391. }),
  3392. (e.prototype.off = function (e, t) {
  3393. this._emitter.removeListener(e, t);
  3394. }),
  3395. (e.prototype.hasWorker = function () {
  3396. return null != this._worker;
  3397. }),
  3398. (e.prototype.open = function () {
  3399. this._worker ? this._worker.postMessage({ cmd: "start" }) : this._controller.start();
  3400. }),
  3401. (e.prototype.close = function () {
  3402. this._worker ? this._worker.postMessage({ cmd: "stop" }) : this._controller.stop();
  3403. }),
  3404. (e.prototype.seek = function (e) {
  3405. this._worker ? this._worker.postMessage({ cmd: "seek", param: e }) : this._controller.seek(e);
  3406. }),
  3407. (e.prototype.pause = function () {
  3408. this._worker ? this._worker.postMessage({ cmd: "pause" }) : this._controller.pause();
  3409. }),
  3410. (e.prototype.resume = function () {
  3411. this._worker ? this._worker.postMessage({ cmd: "resume" }) : this._controller.resume();
  3412. }),
  3413. (e.prototype._onInitSegment = function (e, t) {
  3414. var i = this;
  3415. Promise.resolve().then(function () {
  3416. i._emitter.emit(v.Z.INIT_SEGMENT, e, t);
  3417. });
  3418. }),
  3419. (e.prototype._onMediaSegment = function (e, t) {
  3420. var i = this;
  3421. Promise.resolve().then(function () {
  3422. i._emitter.emit(v.Z.MEDIA_SEGMENT, e, t);
  3423. });
  3424. }),
  3425. (e.prototype._onLoadingComplete = function () {
  3426. var e = this;
  3427. Promise.resolve().then(function () {
  3428. e._emitter.emit(v.Z.LOADING_COMPLETE);
  3429. });
  3430. }),
  3431. (e.prototype._onRecoveredEarlyEof = function () {
  3432. var e = this;
  3433. Promise.resolve().then(function () {
  3434. e._emitter.emit(v.Z.RECOVERED_EARLY_EOF);
  3435. });
  3436. }),
  3437. (e.prototype._onMediaInfo = function (e) {
  3438. var t = this;
  3439. Promise.resolve().then(function () {
  3440. t._emitter.emit(v.Z.MEDIA_INFO, e);
  3441. });
  3442. }),
  3443. (e.prototype._onMetaDataArrived = function (e) {
  3444. var t = this;
  3445. Promise.resolve().then(function () {
  3446. t._emitter.emit(v.Z.METADATA_ARRIVED, e);
  3447. });
  3448. }),
  3449. (e.prototype._onScriptDataArrived = function (e) {
  3450. var t = this;
  3451. Promise.resolve().then(function () {
  3452. t._emitter.emit(v.Z.SCRIPTDATA_ARRIVED, e);
  3453. });
  3454. }),
  3455. (e.prototype._onStatisticsInfo = function (e) {
  3456. var t = this;
  3457. Promise.resolve().then(function () {
  3458. t._emitter.emit(v.Z.STATISTICS_INFO, e);
  3459. });
  3460. }),
  3461. (e.prototype._onIOError = function (e, t) {
  3462. var i = this;
  3463. Promise.resolve().then(function () {
  3464. i._emitter.emit(v.Z.IO_ERROR, e, t);
  3465. });
  3466. }),
  3467. (e.prototype._onDemuxError = function (e, t) {
  3468. var i = this;
  3469. Promise.resolve().then(function () {
  3470. i._emitter.emit(v.Z.DEMUX_ERROR, e, t);
  3471. });
  3472. }),
  3473. (e.prototype._onRecommendSeekpoint = function (e) {
  3474. var t = this;
  3475. Promise.resolve().then(function () {
  3476. t._emitter.emit(v.Z.RECOMMEND_SEEKPOINT, e);
  3477. });
  3478. }),
  3479. (e.prototype._onLoggingConfigChanged = function (e) {
  3480. this._worker && this._worker.postMessage({ cmd: "logging_config", param: e });
  3481. }),
  3482. (e.prototype._onWorkerMessage = function (e) {
  3483. var t = e.data,
  3484. i = t.data;
  3485. if ("destroyed" === t.msg || this._workerDestroying)
  3486. return (this._workerDestroying = !1), this._worker.terminate(), void (this._worker = null);
  3487. switch (t.msg) {
  3488. case v.Z.INIT_SEGMENT:
  3489. case v.Z.MEDIA_SEGMENT:
  3490. this._emitter.emit(t.msg, i.type, i.data);
  3491. break;
  3492. case v.Z.LOADING_COMPLETE:
  3493. case v.Z.RECOVERED_EARLY_EOF:
  3494. this._emitter.emit(t.msg);
  3495. break;
  3496. case v.Z.MEDIA_INFO:
  3497. Object.setPrototypeOf(i, y.Z.prototype), this._emitter.emit(t.msg, i);
  3498. break;
  3499. case v.Z.METADATA_ARRIVED:
  3500. case v.Z.SCRIPTDATA_ARRIVED:
  3501. case v.Z.STATISTICS_INFO:
  3502. this._emitter.emit(t.msg, i);
  3503. break;
  3504. case v.Z.IO_ERROR:
  3505. case v.Z.DEMUX_ERROR:
  3506. this._emitter.emit(t.msg, i.type, i.info);
  3507. break;
  3508. case v.Z.RECOMMEND_SEEKPOINT:
  3509. this._emitter.emit(t.msg, i);
  3510. break;
  3511. case "logcat_callback":
  3512. d.Z.emitter.emit("log", i.type, i.logcat);
  3513. }
  3514. }),
  3515. e
  3516. );
  3517. })(),
  3518. E = { ERROR: "error", SOURCE_OPEN: "source_open", UPDATE_END: "update_end", BUFFER_FULL: "buffer_full" },
  3519. S = i(51),
  3520. A = i(29),
  3521. L = (function () {
  3522. function e(e) {
  3523. (this.TAG = "MSEController"),
  3524. (this._config = e),
  3525. (this._emitter = new (l())()),
  3526. this._config.isLive && null == this._config.autoCleanupSourceBuffer && (this._config.autoCleanupSourceBuffer = !0),
  3527. (this.e = {
  3528. onSourceOpen: this._onSourceOpen.bind(this),
  3529. onSourceEnded: this._onSourceEnded.bind(this),
  3530. onSourceClose: this._onSourceClose.bind(this),
  3531. onSourceBufferError: this._onSourceBufferError.bind(this),
  3532. onSourceBufferUpdateEnd: this._onSourceBufferUpdateEnd.bind(this),
  3533. }),
  3534. (this._mediaSource = null),
  3535. (this._mediaSourceObjectURL = null),
  3536. (this._mediaElement = null),
  3537. (this._isBufferFull = !1),
  3538. (this._hasPendingEos = !1),
  3539. (this._requireSetMediaDuration = !1),
  3540. (this._pendingMediaDuration = 0),
  3541. (this._pendingSourceBufferInit = []),
  3542. (this._mimeTypes = { video: null, audio: null }),
  3543. (this._sourceBuffers = { video: null, audio: null }),
  3544. (this._lastInitSegments = { video: null, audio: null }),
  3545. (this._pendingSegments = { video: [], audio: [] }),
  3546. (this._pendingRemoveRanges = { video: [], audio: [] }),
  3547. (this._idrList = new S.Vn());
  3548. }
  3549. return (
  3550. (e.prototype.destroy = function () {
  3551. (this._mediaElement || this._mediaSource) && this.detachMediaElement(),
  3552. (this.e = null),
  3553. this._emitter.removeAllListeners(),
  3554. (this._emitter = null);
  3555. }),
  3556. (e.prototype.on = function (e, t) {
  3557. this._emitter.addListener(e, t);
  3558. }),
  3559. (e.prototype.off = function (e, t) {
  3560. this._emitter.removeListener(e, t);
  3561. }),
  3562. (e.prototype.attachMediaElement = function (e) {
  3563. if (this._mediaSource) throw new A.rT("MediaSource has been attached to an HTMLMediaElement!");
  3564. var t = (this._mediaSource = new window.MediaSource());
  3565. t.addEventListener("sourceopen", this.e.onSourceOpen),
  3566. t.addEventListener("sourceended", this.e.onSourceEnded),
  3567. t.addEventListener("sourceclose", this.e.onSourceClose),
  3568. (this._mediaElement = e),
  3569. (this._mediaSourceObjectURL = window.URL.createObjectURL(this._mediaSource)),
  3570. (e.src = this._mediaSourceObjectURL);
  3571. }),
  3572. (e.prototype.detachMediaElement = function () {
  3573. if (this._mediaSource) {
  3574. var e = this._mediaSource;
  3575. for (var t in this._sourceBuffers) {
  3576. var i = this._pendingSegments[t];
  3577. i.splice(0, i.length),
  3578. (this._pendingSegments[t] = null),
  3579. (this._pendingRemoveRanges[t] = null),
  3580. (this._lastInitSegments[t] = null);
  3581. var n = this._sourceBuffers[t];
  3582. if (n) {
  3583. if ("closed" !== e.readyState) {
  3584. try {
  3585. e.removeSourceBuffer(n);
  3586. } catch (e) {
  3587. d.Z.e(this.TAG, e.message);
  3588. }
  3589. n.removeEventListener("error", this.e.onSourceBufferError),
  3590. n.removeEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  3591. }
  3592. (this._mimeTypes[t] = null), (this._sourceBuffers[t] = null);
  3593. }
  3594. }
  3595. if ("open" === e.readyState)
  3596. try {
  3597. e.endOfStream();
  3598. } catch (e) {
  3599. d.Z.e(this.TAG, e.message);
  3600. }
  3601. e.removeEventListener("sourceopen", this.e.onSourceOpen),
  3602. e.removeEventListener("sourceended", this.e.onSourceEnded),
  3603. e.removeEventListener("sourceclose", this.e.onSourceClose),
  3604. (this._pendingSourceBufferInit = []),
  3605. (this._isBufferFull = !1),
  3606. this._idrList.clear(),
  3607. (this._mediaSource = null);
  3608. }
  3609. this._mediaElement && ((this._mediaElement.src = ""), this._mediaElement.removeAttribute("src"), (this._mediaElement = null)),
  3610. this._mediaSourceObjectURL && (window.URL.revokeObjectURL(this._mediaSourceObjectURL), (this._mediaSourceObjectURL = null));
  3611. }),
  3612. (e.prototype.appendInitSegment = function (e, t) {
  3613. if (!this._mediaSource || "open" !== this._mediaSource.readyState)
  3614. return this._pendingSourceBufferInit.push(e), void this._pendingSegments[e.type].push(e);
  3615. var i = e,
  3616. n = "" + i.container;
  3617. i.codec && i.codec.length > 0 && (n += ";codecs=" + i.codec);
  3618. var r = !1;
  3619. if (
  3620. (d.Z.v(this.TAG, "Received Initialization Segment, mimeType: " + n),
  3621. (this._lastInitSegments[i.type] = i),
  3622. n !== this._mimeTypes[i.type])
  3623. ) {
  3624. if (this._mimeTypes[i.type])
  3625. d.Z.v(this.TAG, "Notice: " + i.type + " mimeType changed, origin: " + this._mimeTypes[i.type] + ", target: " + n);
  3626. else {
  3627. r = !0;
  3628. try {
  3629. var s = (this._sourceBuffers[i.type] = this._mediaSource.addSourceBuffer(n));
  3630. s.addEventListener("error", this.e.onSourceBufferError), s.addEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  3631. } catch (e) {
  3632. return d.Z.e(this.TAG, e.message), void this._emitter.emit(E.ERROR, { code: e.code, msg: e.message });
  3633. }
  3634. }
  3635. this._mimeTypes[i.type] = n;
  3636. }
  3637. t || this._pendingSegments[i.type].push(i),
  3638. r || (this._sourceBuffers[i.type] && !this._sourceBuffers[i.type].updating && this._doAppendSegments()),
  3639. c.Z.safari &&
  3640. "audio/mpeg" === i.container &&
  3641. i.mediaDuration > 0 &&
  3642. ((this._requireSetMediaDuration = !0), (this._pendingMediaDuration = i.mediaDuration / 1e3), this._updateMediaSourceDuration());
  3643. }),
  3644. (e.prototype.appendMediaSegment = function (e) {
  3645. var t = e;
  3646. this._pendingSegments[t.type].push(t),
  3647. this._config.autoCleanupSourceBuffer && this._needCleanupSourceBuffer() && this._doCleanupSourceBuffer();
  3648. var i = this._sourceBuffers[t.type];
  3649. !i || i.updating || this._hasPendingRemoveRanges() || this._doAppendSegments();
  3650. }),
  3651. (e.prototype.seek = function (e) {
  3652. for (var t in this._sourceBuffers)
  3653. if (this._sourceBuffers[t]) {
  3654. var i = this._sourceBuffers[t];
  3655. if ("open" === this._mediaSource.readyState)
  3656. try {
  3657. i.abort();
  3658. } catch (e) {
  3659. d.Z.e(this.TAG, e.message);
  3660. }
  3661. this._idrList.clear();
  3662. var n = this._pendingSegments[t];
  3663. if ((n.splice(0, n.length), "closed" !== this._mediaSource.readyState)) {
  3664. for (var r = 0; r < i.buffered.length; r++) {
  3665. var s = i.buffered.start(r),
  3666. o = i.buffered.end(r);
  3667. this._pendingRemoveRanges[t].push({ start: s, end: o });
  3668. }
  3669. if ((i.updating || this._doRemoveRanges(), c.Z.safari)) {
  3670. var a = this._lastInitSegments[t];
  3671. a && (this._pendingSegments[t].push(a), i.updating || this._doAppendSegments());
  3672. }
  3673. }
  3674. }
  3675. }),
  3676. (e.prototype.endOfStream = function () {
  3677. var e = this._mediaSource,
  3678. t = this._sourceBuffers;
  3679. e && "open" === e.readyState
  3680. ? (t.video && t.video.updating) || (t.audio && t.audio.updating)
  3681. ? (this._hasPendingEos = !0)
  3682. : ((this._hasPendingEos = !1), e.endOfStream())
  3683. : e && "closed" === e.readyState && this._hasPendingSegments() && (this._hasPendingEos = !0);
  3684. }),
  3685. (e.prototype.getNearestKeyframe = function (e) {
  3686. return this._idrList.getLastSyncPointBeforeDts(e);
  3687. }),
  3688. (e.prototype._needCleanupSourceBuffer = function () {
  3689. if (!this._config.autoCleanupSourceBuffer) return !1;
  3690. var e = this._mediaElement.currentTime;
  3691. for (var t in this._sourceBuffers) {
  3692. var i = this._sourceBuffers[t];
  3693. if (i) {
  3694. var n = i.buffered;
  3695. if (n.length >= 1 && e - n.start(0) >= this._config.autoCleanupMaxBackwardDuration) return !0;
  3696. }
  3697. }
  3698. return !1;
  3699. }),
  3700. (e.prototype._doCleanupSourceBuffer = function () {
  3701. var e = this._mediaElement.currentTime;
  3702. for (var t in this._sourceBuffers) {
  3703. var i = this._sourceBuffers[t];
  3704. if (i) {
  3705. for (var n = i.buffered, r = !1, s = 0; s < n.length; s++) {
  3706. var o = n.start(s),
  3707. a = n.end(s);
  3708. if (o <= e && e < a + 3) {
  3709. if (e - o >= this._config.autoCleanupMaxBackwardDuration) {
  3710. r = !0;
  3711. var h = e - this._config.autoCleanupMinBackwardDuration;
  3712. this._pendingRemoveRanges[t].push({ start: o, end: h });
  3713. }
  3714. } else a < e && ((r = !0), this._pendingRemoveRanges[t].push({ start: o, end: a }));
  3715. }
  3716. r && !i.updating && this._doRemoveRanges();
  3717. }
  3718. }
  3719. }),
  3720. (e.prototype._updateMediaSourceDuration = function () {
  3721. var e = this._sourceBuffers;
  3722. if (
  3723. 0 !== this._mediaElement.readyState &&
  3724. "open" === this._mediaSource.readyState &&
  3725. !((e.video && e.video.updating) || (e.audio && e.audio.updating))
  3726. ) {
  3727. var t = this._mediaSource.duration,
  3728. i = this._pendingMediaDuration;
  3729. i > 0 &&
  3730. (isNaN(t) || i > t) &&
  3731. (d.Z.v(this.TAG, "Update MediaSource duration from " + t + " to " + i), (this._mediaSource.duration = i)),
  3732. (this._requireSetMediaDuration = !1),
  3733. (this._pendingMediaDuration = 0);
  3734. }
  3735. }),
  3736. (e.prototype._doRemoveRanges = function () {
  3737. for (var e in this._pendingRemoveRanges)
  3738. if (this._sourceBuffers[e] && !this._sourceBuffers[e].updating)
  3739. for (var t = this._sourceBuffers[e], i = this._pendingRemoveRanges[e]; i.length && !t.updating; ) {
  3740. var n = i.shift();
  3741. t.remove(n.start, n.end);
  3742. }
  3743. }),
  3744. (e.prototype._doAppendSegments = function () {
  3745. var e = this._pendingSegments;
  3746. for (var t in e)
  3747. if (this._sourceBuffers[t] && !this._sourceBuffers[t].updating && e[t].length > 0) {
  3748. var i = e[t].shift();
  3749. if (i.timestampOffset) {
  3750. var n = this._sourceBuffers[t].timestampOffset,
  3751. r = i.timestampOffset / 1e3;
  3752. Math.abs(n - r) > 0.1 &&
  3753. (d.Z.v(this.TAG, "Update MPEG audio timestampOffset from " + n + " to " + r), (this._sourceBuffers[t].timestampOffset = r)),
  3754. delete i.timestampOffset;
  3755. }
  3756. if (!i.data || 0 === i.data.byteLength) continue;
  3757. try {
  3758. this._sourceBuffers[t].appendBuffer(i.data),
  3759. (this._isBufferFull = !1),
  3760. "video" === t && i.hasOwnProperty("info") && this._idrList.appendArray(i.info.syncPoints);
  3761. } catch (e) {
  3762. this._pendingSegments[t].unshift(i),
  3763. 22 === e.code
  3764. ? (this._isBufferFull || this._emitter.emit(E.BUFFER_FULL), (this._isBufferFull = !0))
  3765. : (d.Z.e(this.TAG, e.message), this._emitter.emit(E.ERROR, { code: e.code, msg: e.message }));
  3766. }
  3767. }
  3768. }),
  3769. (e.prototype._onSourceOpen = function () {
  3770. if (
  3771. (d.Z.v(this.TAG, "MediaSource onSourceOpen"),
  3772. this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen),
  3773. this._pendingSourceBufferInit.length > 0)
  3774. )
  3775. for (var e = this._pendingSourceBufferInit; e.length; ) {
  3776. var t = e.shift();
  3777. this.appendInitSegment(t, !0);
  3778. }
  3779. this._hasPendingSegments() && this._doAppendSegments(), this._emitter.emit(E.SOURCE_OPEN);
  3780. }),
  3781. (e.prototype._onSourceEnded = function () {
  3782. d.Z.v(this.TAG, "MediaSource onSourceEnded");
  3783. }),
  3784. (e.prototype._onSourceClose = function () {
  3785. d.Z.v(this.TAG, "MediaSource onSourceClose"),
  3786. this._mediaSource &&
  3787. null != this.e &&
  3788. (this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen),
  3789. this._mediaSource.removeEventListener("sourceended", this.e.onSourceEnded),
  3790. this._mediaSource.removeEventListener("sourceclose", this.e.onSourceClose));
  3791. }),
  3792. (e.prototype._hasPendingSegments = function () {
  3793. var e = this._pendingSegments;
  3794. return e.video.length > 0 || e.audio.length > 0;
  3795. }),
  3796. (e.prototype._hasPendingRemoveRanges = function () {
  3797. var e = this._pendingRemoveRanges;
  3798. return e.video.length > 0 || e.audio.length > 0;
  3799. }),
  3800. (e.prototype._onSourceBufferUpdateEnd = function () {
  3801. this._requireSetMediaDuration
  3802. ? this._updateMediaSourceDuration()
  3803. : this._hasPendingRemoveRanges()
  3804. ? this._doRemoveRanges()
  3805. : this._hasPendingSegments()
  3806. ? this._doAppendSegments()
  3807. : this._hasPendingEos && this.endOfStream(),
  3808. this._emitter.emit(E.UPDATE_END);
  3809. }),
  3810. (e.prototype._onSourceBufferError = function (e) {
  3811. d.Z.e(this.TAG, "SourceBuffer Error: " + e);
  3812. }),
  3813. e
  3814. );
  3815. })(),
  3816. R = i(600),
  3817. w = { NETWORK_ERROR: "NetworkError", MEDIA_ERROR: "MediaError", OTHER_ERROR: "OtherError" },
  3818. O = {
  3819. NETWORK_EXCEPTION: h.nm.EXCEPTION,
  3820. NETWORK_STATUS_CODE_INVALID: h.nm.HTTP_STATUS_CODE_INVALID,
  3821. NETWORK_TIMEOUT: h.nm.CONNECTING_TIMEOUT,
  3822. NETWORK_UNRECOVERABLE_EARLY_EOF: h.nm.UNRECOVERABLE_EARLY_EOF,
  3823. MEDIA_MSE_ERROR: "MediaMSEError",
  3824. MEDIA_FORMAT_ERROR: R.Z.FORMAT_ERROR,
  3825. MEDIA_FORMAT_UNSUPPORTED: R.Z.FORMAT_UNSUPPORTED,
  3826. MEDIA_CODEC_UNSUPPORTED: R.Z.CODEC_UNSUPPORTED,
  3827. },
  3828. T = (function () {
  3829. function e(e, t) {
  3830. if (
  3831. ((this.TAG = "FlvPlayer"),
  3832. (this._type = "FlvPlayer"),
  3833. (this._emitter = new (l())()),
  3834. (this._config = o()),
  3835. "object" == typeof t && Object.assign(this._config, t),
  3836. "flv" !== e.type.toLowerCase())
  3837. )
  3838. throw new A.OC("FlvPlayer requires an flv MediaDataSource input!");
  3839. !0 === e.isLive && (this._config.isLive = !0),
  3840. (this.e = {
  3841. onvLoadedMetadata: this._onvLoadedMetadata.bind(this),
  3842. onvSeeking: this._onvSeeking.bind(this),
  3843. onvCanPlay: this._onvCanPlay.bind(this),
  3844. onvStalled: this._onvStalled.bind(this),
  3845. onvProgress: this._onvProgress.bind(this),
  3846. }),
  3847. self.performance && self.performance.now ? (this._now = self.performance.now.bind(self.performance)) : (this._now = Date.now),
  3848. (this._pendingSeekTime = null),
  3849. (this._requestSetTime = !1),
  3850. (this._seekpointRecord = null),
  3851. (this._progressChecker = null),
  3852. (this._mediaDataSource = e),
  3853. (this._mediaElement = null),
  3854. (this._msectl = null),
  3855. (this._transmuxer = null),
  3856. (this._mseSourceOpened = !1),
  3857. (this._hasPendingLoad = !1),
  3858. (this._receivedCanPlay = !1),
  3859. (this._mediaInfo = null),
  3860. (this._statisticsInfo = null);
  3861. var i = c.Z.chrome && (c.Z.version.major < 50 || (50 === c.Z.version.major && c.Z.version.build < 2661));
  3862. (this._alwaysSeekKeyframe = !!(i || c.Z.msedge || c.Z.msie)), this._alwaysSeekKeyframe && (this._config.accurateSeek = !1);
  3863. }
  3864. return (
  3865. (e.prototype.destroy = function () {
  3866. null != this._progressChecker && (window.clearInterval(this._progressChecker), (this._progressChecker = null)),
  3867. this._transmuxer && this.unload(),
  3868. this._mediaElement && this.detachMediaElement(),
  3869. (this.e = null),
  3870. (this._mediaDataSource = null),
  3871. this._emitter.removeAllListeners(),
  3872. (this._emitter = null);
  3873. }),
  3874. (e.prototype.on = function (e, t) {
  3875. var i = this;
  3876. e === f.MEDIA_INFO
  3877. ? null != this._mediaInfo &&
  3878. Promise.resolve().then(function () {
  3879. i._emitter.emit(f.MEDIA_INFO, i.mediaInfo);
  3880. })
  3881. : e === f.STATISTICS_INFO &&
  3882. null != this._statisticsInfo &&
  3883. Promise.resolve().then(function () {
  3884. i._emitter.emit(f.STATISTICS_INFO, i.statisticsInfo);
  3885. }),
  3886. this._emitter.addListener(e, t);
  3887. }),
  3888. (e.prototype.off = function (e, t) {
  3889. this._emitter.removeListener(e, t);
  3890. }),
  3891. (e.prototype.attachMediaElement = function (e) {
  3892. var t = this;
  3893. if (
  3894. ((this._mediaElement = e),
  3895. e.addEventListener("loadedmetadata", this.e.onvLoadedMetadata),
  3896. e.addEventListener("seeking", this.e.onvSeeking),
  3897. e.addEventListener("canplay", this.e.onvCanPlay),
  3898. e.addEventListener("stalled", this.e.onvStalled),
  3899. e.addEventListener("progress", this.e.onvProgress),
  3900. (this._msectl = new L(this._config)),
  3901. this._msectl.on(E.UPDATE_END, this._onmseUpdateEnd.bind(this)),
  3902. this._msectl.on(E.BUFFER_FULL, this._onmseBufferFull.bind(this)),
  3903. this._msectl.on(E.SOURCE_OPEN, function () {
  3904. (t._mseSourceOpened = !0), t._hasPendingLoad && ((t._hasPendingLoad = !1), t.load());
  3905. }),
  3906. this._msectl.on(E.ERROR, function (e) {
  3907. t._emitter.emit(f.ERROR, w.MEDIA_ERROR, O.MEDIA_MSE_ERROR, e);
  3908. }),
  3909. this._msectl.attachMediaElement(e),
  3910. null != this._pendingSeekTime)
  3911. )
  3912. try {
  3913. (e.currentTime = this._pendingSeekTime), (this._pendingSeekTime = null);
  3914. } catch (e) {}
  3915. }),
  3916. (e.prototype.detachMediaElement = function () {
  3917. this._mediaElement &&
  3918. (this._msectl.detachMediaElement(),
  3919. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata),
  3920. this._mediaElement.removeEventListener("seeking", this.e.onvSeeking),
  3921. this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay),
  3922. this._mediaElement.removeEventListener("stalled", this.e.onvStalled),
  3923. this._mediaElement.removeEventListener("progress", this.e.onvProgress),
  3924. (this._mediaElement = null)),
  3925. this._msectl && (this._msectl.destroy(), (this._msectl = null));
  3926. }),
  3927. (e.prototype.load = function () {
  3928. var e = this;
  3929. if (!this._mediaElement) throw new A.rT("HTMLMediaElement must be attached before load()!");
  3930. if (this._transmuxer) throw new A.rT("FlvPlayer.load() has been called, please call unload() first!");
  3931. this._hasPendingLoad ||
  3932. (this._config.deferLoadAfterSourceOpen && !1 === this._mseSourceOpened
  3933. ? (this._hasPendingLoad = !0)
  3934. : (this._mediaElement.readyState > 0 && ((this._requestSetTime = !0), (this._mediaElement.currentTime = 0)),
  3935. (this._transmuxer = new b(this._mediaDataSource, this._config)),
  3936. this._transmuxer.on(v.Z.INIT_SEGMENT, function (t, i) {
  3937. e._msectl.appendInitSegment(i);
  3938. }),
  3939. this._transmuxer.on(v.Z.MEDIA_SEGMENT, function (t, i) {
  3940. if ((e._msectl.appendMediaSegment(i), e._config.lazyLoad && !e._config.isLive)) {
  3941. var n = e._mediaElement.currentTime;
  3942. i.info.endDts >= 1e3 * (n + e._config.lazyLoadMaxDuration) &&
  3943. null == e._progressChecker &&
  3944. (d.Z.v(e.TAG, "Maximum buffering duration exceeded, suspend transmuxing task"), e._suspendTransmuxer());
  3945. }
  3946. }),
  3947. this._transmuxer.on(v.Z.LOADING_COMPLETE, function () {
  3948. e._msectl.endOfStream(), e._emitter.emit(f.LOADING_COMPLETE);
  3949. }),
  3950. this._transmuxer.on(v.Z.RECOVERED_EARLY_EOF, function () {
  3951. e._emitter.emit(f.RECOVERED_EARLY_EOF);
  3952. }),
  3953. this._transmuxer.on(v.Z.IO_ERROR, function (t, i) {
  3954. e._emitter.emit(f.ERROR, w.NETWORK_ERROR, t, i);
  3955. }),
  3956. this._transmuxer.on(v.Z.DEMUX_ERROR, function (t, i) {
  3957. e._emitter.emit(f.ERROR, w.MEDIA_ERROR, t, { code: -1, msg: i });
  3958. }),
  3959. this._transmuxer.on(v.Z.MEDIA_INFO, function (t) {
  3960. (e._mediaInfo = t), e._emitter.emit(f.MEDIA_INFO, Object.assign({}, t));
  3961. }),
  3962. this._transmuxer.on(v.Z.METADATA_ARRIVED, function (t) {
  3963. e._emitter.emit(f.METADATA_ARRIVED, t);
  3964. }),
  3965. this._transmuxer.on(v.Z.SCRIPTDATA_ARRIVED, function (t) {
  3966. e._emitter.emit(f.SCRIPTDATA_ARRIVED, t);
  3967. }),
  3968. this._transmuxer.on(v.Z.STATISTICS_INFO, function (t) {
  3969. (e._statisticsInfo = e._fillStatisticsInfo(t)), e._emitter.emit(f.STATISTICS_INFO, Object.assign({}, e._statisticsInfo));
  3970. }),
  3971. this._transmuxer.on(v.Z.RECOMMEND_SEEKPOINT, function (t) {
  3972. e._mediaElement && !e._config.accurateSeek && ((e._requestSetTime = !0), (e._mediaElement.currentTime = t / 1e3));
  3973. }),
  3974. this._transmuxer.open()));
  3975. }),
  3976. (e.prototype.unload = function () {
  3977. this._mediaElement && this._mediaElement.pause(),
  3978. this._msectl && this._msectl.seek(0),
  3979. this._transmuxer && (this._transmuxer.close(), this._transmuxer.destroy(), (this._transmuxer = null));
  3980. }),
  3981. (e.prototype.play = function () {
  3982. return this._mediaElement.play();
  3983. }),
  3984. (e.prototype.pause = function () {
  3985. this._mediaElement.pause();
  3986. }),
  3987. Object.defineProperty(e.prototype, "type", {
  3988. get: function () {
  3989. return this._type;
  3990. },
  3991. enumerable: !1,
  3992. configurable: !0,
  3993. }),
  3994. Object.defineProperty(e.prototype, "buffered", {
  3995. get: function () {
  3996. return this._mediaElement.buffered;
  3997. },
  3998. enumerable: !1,
  3999. configurable: !0,
  4000. }),
  4001. Object.defineProperty(e.prototype, "duration", {
  4002. get: function () {
  4003. return this._mediaElement.duration;
  4004. },
  4005. enumerable: !1,
  4006. configurable: !0,
  4007. }),
  4008. Object.defineProperty(e.prototype, "volume", {
  4009. get: function () {
  4010. return this._mediaElement.volume;
  4011. },
  4012. set: function (e) {
  4013. this._mediaElement.volume = e;
  4014. },
  4015. enumerable: !1,
  4016. configurable: !0,
  4017. }),
  4018. Object.defineProperty(e.prototype, "muted", {
  4019. get: function () {
  4020. return this._mediaElement.muted;
  4021. },
  4022. set: function (e) {
  4023. this._mediaElement.muted = e;
  4024. },
  4025. enumerable: !1,
  4026. configurable: !0,
  4027. }),
  4028. Object.defineProperty(e.prototype, "currentTime", {
  4029. get: function () {
  4030. return this._mediaElement ? this._mediaElement.currentTime : 0;
  4031. },
  4032. set: function (e) {
  4033. this._mediaElement ? this._internalSeek(e) : (this._pendingSeekTime = e);
  4034. },
  4035. enumerable: !1,
  4036. configurable: !0,
  4037. }),
  4038. Object.defineProperty(e.prototype, "mediaInfo", {
  4039. get: function () {
  4040. return Object.assign({}, this._mediaInfo);
  4041. },
  4042. enumerable: !1,
  4043. configurable: !0,
  4044. }),
  4045. Object.defineProperty(e.prototype, "statisticsInfo", {
  4046. get: function () {
  4047. return (
  4048. null == this._statisticsInfo && (this._statisticsInfo = {}),
  4049. (this._statisticsInfo = this._fillStatisticsInfo(this._statisticsInfo)),
  4050. Object.assign({}, this._statisticsInfo)
  4051. );
  4052. },
  4053. enumerable: !1,
  4054. configurable: !0,
  4055. }),
  4056. (e.prototype._fillStatisticsInfo = function (e) {
  4057. if (((e.playerType = this._type), !(this._mediaElement instanceof HTMLVideoElement))) return e;
  4058. var t = !0,
  4059. i = 0,
  4060. n = 0;
  4061. if (this._mediaElement.getVideoPlaybackQuality) {
  4062. var r = this._mediaElement.getVideoPlaybackQuality();
  4063. (i = r.totalVideoFrames), (n = r.droppedVideoFrames);
  4064. } else
  4065. null != this._mediaElement.webkitDecodedFrameCount
  4066. ? ((i = this._mediaElement.webkitDecodedFrameCount), (n = this._mediaElement.webkitDroppedFrameCount))
  4067. : (t = !1);
  4068. return t && ((e.decodedFrames = i), (e.droppedFrames = n)), e;
  4069. }),
  4070. (e.prototype._onmseUpdateEnd = function () {
  4071. if (this._config.lazyLoad && !this._config.isLive) {
  4072. for (var e = this._mediaElement.buffered, t = this._mediaElement.currentTime, i = 0, n = 0; n < e.length; n++) {
  4073. var r = e.start(n),
  4074. s = e.end(n);
  4075. if (r <= t && t < s) {
  4076. r, (i = s);
  4077. break;
  4078. }
  4079. }
  4080. i >= t + this._config.lazyLoadMaxDuration &&
  4081. null == this._progressChecker &&
  4082. (d.Z.v(this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task"), this._suspendTransmuxer());
  4083. }
  4084. }),
  4085. (e.prototype._onmseBufferFull = function () {
  4086. d.Z.v(this.TAG, "MSE SourceBuffer is full, suspend transmuxing task"), null == this._progressChecker && this._suspendTransmuxer();
  4087. }),
  4088. (e.prototype._suspendTransmuxer = function () {
  4089. this._transmuxer &&
  4090. (this._transmuxer.pause(),
  4091. null == this._progressChecker && (this._progressChecker = window.setInterval(this._checkProgressAndResume.bind(this), 1e3)));
  4092. }),
  4093. (e.prototype._checkProgressAndResume = function () {
  4094. for (var e = this._mediaElement.currentTime, t = this._mediaElement.buffered, i = !1, n = 0; n < t.length; n++) {
  4095. var r = t.start(n),
  4096. s = t.end(n);
  4097. if (e >= r && e < s) {
  4098. e >= s - this._config.lazyLoadRecoverDuration && (i = !0);
  4099. break;
  4100. }
  4101. }
  4102. i &&
  4103. (window.clearInterval(this._progressChecker),
  4104. (this._progressChecker = null),
  4105. i && (d.Z.v(this.TAG, "Continue loading from paused position"), this._transmuxer.resume()));
  4106. }),
  4107. (e.prototype._isTimepointBuffered = function (e) {
  4108. for (var t = this._mediaElement.buffered, i = 0; i < t.length; i++) {
  4109. var n = t.start(i),
  4110. r = t.end(i);
  4111. if (e >= n && e < r) return !0;
  4112. }
  4113. return !1;
  4114. }),
  4115. (e.prototype._internalSeek = function (e) {
  4116. var t = this._isTimepointBuffered(e),
  4117. i = !1,
  4118. n = 0;
  4119. if (e < 1 && this._mediaElement.buffered.length > 0) {
  4120. var r = this._mediaElement.buffered.start(0);
  4121. ((r < 1 && e < r) || c.Z.safari) && ((i = !0), (n = c.Z.safari ? 0.1 : r));
  4122. }
  4123. if (i) (this._requestSetTime = !0), (this._mediaElement.currentTime = n);
  4124. else if (t) {
  4125. if (this._alwaysSeekKeyframe) {
  4126. var s = this._msectl.getNearestKeyframe(Math.floor(1e3 * e));
  4127. (this._requestSetTime = !0), (this._mediaElement.currentTime = null != s ? s.dts / 1e3 : e);
  4128. } else (this._requestSetTime = !0), (this._mediaElement.currentTime = e);
  4129. null != this._progressChecker && this._checkProgressAndResume();
  4130. } else
  4131. null != this._progressChecker && (window.clearInterval(this._progressChecker), (this._progressChecker = null)),
  4132. this._msectl.seek(e),
  4133. this._transmuxer.seek(Math.floor(1e3 * e)),
  4134. this._config.accurateSeek && ((this._requestSetTime = !0), (this._mediaElement.currentTime = e));
  4135. }),
  4136. (e.prototype._checkAndApplyUnbufferedSeekpoint = function () {
  4137. if (this._seekpointRecord)
  4138. if (this._seekpointRecord.recordTime <= this._now() - 100) {
  4139. var e = this._mediaElement.currentTime;
  4140. (this._seekpointRecord = null),
  4141. this._isTimepointBuffered(e) ||
  4142. (null != this._progressChecker && (window.clearTimeout(this._progressChecker), (this._progressChecker = null)),
  4143. this._msectl.seek(e),
  4144. this._transmuxer.seek(Math.floor(1e3 * e)),
  4145. this._config.accurateSeek && ((this._requestSetTime = !0), (this._mediaElement.currentTime = e)));
  4146. } else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  4147. }),
  4148. (e.prototype._checkAndResumeStuckPlayback = function (e) {
  4149. var t = this._mediaElement;
  4150. if (e || !this._receivedCanPlay || t.readyState < 2) {
  4151. var i = t.buffered;
  4152. i.length > 0 &&
  4153. t.currentTime < i.start(0) &&
  4154. (d.Z.w(this.TAG, "Playback seems stuck at " + t.currentTime + ", seek to " + i.start(0)),
  4155. (this._requestSetTime = !0),
  4156. (this._mediaElement.currentTime = i.start(0)),
  4157. this._mediaElement.removeEventListener("progress", this.e.onvProgress));
  4158. } else this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  4159. }),
  4160. (e.prototype._onvLoadedMetadata = function (e) {
  4161. null != this._pendingSeekTime && ((this._mediaElement.currentTime = this._pendingSeekTime), (this._pendingSeekTime = null));
  4162. }),
  4163. (e.prototype._onvSeeking = function (e) {
  4164. var t = this._mediaElement.currentTime,
  4165. i = this._mediaElement.buffered;
  4166. if (this._requestSetTime) this._requestSetTime = !1;
  4167. else {
  4168. if (t < 1 && i.length > 0) {
  4169. var n = i.start(0);
  4170. if ((n < 1 && t < n) || c.Z.safari)
  4171. return (this._requestSetTime = !0), void (this._mediaElement.currentTime = c.Z.safari ? 0.1 : n);
  4172. }
  4173. if (this._isTimepointBuffered(t)) {
  4174. if (this._alwaysSeekKeyframe) {
  4175. var r = this._msectl.getNearestKeyframe(Math.floor(1e3 * t));
  4176. null != r && ((this._requestSetTime = !0), (this._mediaElement.currentTime = r.dts / 1e3));
  4177. }
  4178. null != this._progressChecker && this._checkProgressAndResume();
  4179. } else
  4180. (this._seekpointRecord = { seekPoint: t, recordTime: this._now() }),
  4181. window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  4182. }
  4183. }),
  4184. (e.prototype._onvCanPlay = function (e) {
  4185. (this._receivedCanPlay = !0), this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
  4186. }),
  4187. (e.prototype._onvStalled = function (e) {
  4188. this._checkAndResumeStuckPlayback(!0);
  4189. }),
  4190. (e.prototype._onvProgress = function (e) {
  4191. this._checkAndResumeStuckPlayback();
  4192. }),
  4193. e
  4194. );
  4195. })(),
  4196. C = (function () {
  4197. function e(e, t) {
  4198. if (
  4199. ((this.TAG = "NativePlayer"),
  4200. (this._type = "NativePlayer"),
  4201. (this._emitter = new (l())()),
  4202. (this._config = o()),
  4203. "object" == typeof t && Object.assign(this._config, t),
  4204. "flv" === e.type.toLowerCase())
  4205. )
  4206. throw new A.OC("NativePlayer does't support flv MediaDataSource input!");
  4207. if (e.hasOwnProperty("segments")) throw new A.OC("NativePlayer(" + e.type + ") doesn't support multipart playback!");
  4208. (this.e = { onvLoadedMetadata: this._onvLoadedMetadata.bind(this) }),
  4209. (this._pendingSeekTime = null),
  4210. (this._statisticsReporter = null),
  4211. (this._mediaDataSource = e),
  4212. (this._mediaElement = null);
  4213. }
  4214. return (
  4215. (e.prototype.destroy = function () {
  4216. this._mediaElement && (this.unload(), this.detachMediaElement()),
  4217. (this.e = null),
  4218. (this._mediaDataSource = null),
  4219. this._emitter.removeAllListeners(),
  4220. (this._emitter = null);
  4221. }),
  4222. (e.prototype.on = function (e, t) {
  4223. var i = this;
  4224. e === f.MEDIA_INFO
  4225. ? null != this._mediaElement &&
  4226. 0 !== this._mediaElement.readyState &&
  4227. Promise.resolve().then(function () {
  4228. i._emitter.emit(f.MEDIA_INFO, i.mediaInfo);
  4229. })
  4230. : e === f.STATISTICS_INFO &&
  4231. null != this._mediaElement &&
  4232. 0 !== this._mediaElement.readyState &&
  4233. Promise.resolve().then(function () {
  4234. i._emitter.emit(f.STATISTICS_INFO, i.statisticsInfo);
  4235. }),
  4236. this._emitter.addListener(e, t);
  4237. }),
  4238. (e.prototype.off = function (e, t) {
  4239. this._emitter.removeListener(e, t);
  4240. }),
  4241. (e.prototype.attachMediaElement = function (e) {
  4242. if (((this._mediaElement = e), e.addEventListener("loadedmetadata", this.e.onvLoadedMetadata), null != this._pendingSeekTime))
  4243. try {
  4244. (e.currentTime = this._pendingSeekTime), (this._pendingSeekTime = null);
  4245. } catch (e) {}
  4246. }),
  4247. (e.prototype.detachMediaElement = function () {
  4248. this._mediaElement &&
  4249. ((this._mediaElement.src = ""),
  4250. this._mediaElement.removeAttribute("src"),
  4251. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata),
  4252. (this._mediaElement = null)),
  4253. null != this._statisticsReporter && (window.clearInterval(this._statisticsReporter), (this._statisticsReporter = null));
  4254. }),
  4255. (e.prototype.load = function () {
  4256. if (!this._mediaElement) throw new A.rT("HTMLMediaElement must be attached before load()!");
  4257. (this._mediaElement.src = this._mediaDataSource.url),
  4258. this._mediaElement.readyState > 0 && (this._mediaElement.currentTime = 0),
  4259. (this._mediaElement.preload = "auto"),
  4260. this._mediaElement.load(),
  4261. (this._statisticsReporter = window.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval));
  4262. }),
  4263. (e.prototype.unload = function () {
  4264. this._mediaElement && ((this._mediaElement.src = ""), this._mediaElement.removeAttribute("src")),
  4265. null != this._statisticsReporter && (window.clearInterval(this._statisticsReporter), (this._statisticsReporter = null));
  4266. }),
  4267. (e.prototype.play = function () {
  4268. return this._mediaElement.play();
  4269. }),
  4270. (e.prototype.pause = function () {
  4271. this._mediaElement.pause();
  4272. }),
  4273. Object.defineProperty(e.prototype, "type", {
  4274. get: function () {
  4275. return this._type;
  4276. },
  4277. enumerable: !1,
  4278. configurable: !0,
  4279. }),
  4280. Object.defineProperty(e.prototype, "buffered", {
  4281. get: function () {
  4282. return this._mediaElement.buffered;
  4283. },
  4284. enumerable: !1,
  4285. configurable: !0,
  4286. }),
  4287. Object.defineProperty(e.prototype, "duration", {
  4288. get: function () {
  4289. return this._mediaElement.duration;
  4290. },
  4291. enumerable: !1,
  4292. configurable: !0,
  4293. }),
  4294. Object.defineProperty(e.prototype, "volume", {
  4295. get: function () {
  4296. return this._mediaElement.volume;
  4297. },
  4298. set: function (e) {
  4299. this._mediaElement.volume = e;
  4300. },
  4301. enumerable: !1,
  4302. configurable: !0,
  4303. }),
  4304. Object.defineProperty(e.prototype, "muted", {
  4305. get: function () {
  4306. return this._mediaElement.muted;
  4307. },
  4308. set: function (e) {
  4309. this._mediaElement.muted = e;
  4310. },
  4311. enumerable: !1,
  4312. configurable: !0,
  4313. }),
  4314. Object.defineProperty(e.prototype, "currentTime", {
  4315. get: function () {
  4316. return this._mediaElement ? this._mediaElement.currentTime : 0;
  4317. },
  4318. set: function (e) {
  4319. this._mediaElement ? (this._mediaElement.currentTime = e) : (this._pendingSeekTime = e);
  4320. },
  4321. enumerable: !1,
  4322. configurable: !0,
  4323. }),
  4324. Object.defineProperty(e.prototype, "mediaInfo", {
  4325. get: function () {
  4326. var e = { mimeType: (this._mediaElement instanceof HTMLAudioElement ? "audio/" : "video/") + this._mediaDataSource.type };
  4327. return (
  4328. this._mediaElement &&
  4329. ((e.duration = Math.floor(1e3 * this._mediaElement.duration)),
  4330. this._mediaElement instanceof HTMLVideoElement &&
  4331. ((e.width = this._mediaElement.videoWidth), (e.height = this._mediaElement.videoHeight))),
  4332. e
  4333. );
  4334. },
  4335. enumerable: !1,
  4336. configurable: !0,
  4337. }),
  4338. Object.defineProperty(e.prototype, "statisticsInfo", {
  4339. get: function () {
  4340. var e = { playerType: this._type, url: this._mediaDataSource.url };
  4341. if (!(this._mediaElement instanceof HTMLVideoElement)) return e;
  4342. var t = !0,
  4343. i = 0,
  4344. n = 0;
  4345. if (this._mediaElement.getVideoPlaybackQuality) {
  4346. var r = this._mediaElement.getVideoPlaybackQuality();
  4347. (i = r.totalVideoFrames), (n = r.droppedVideoFrames);
  4348. } else
  4349. null != this._mediaElement.webkitDecodedFrameCount
  4350. ? ((i = this._mediaElement.webkitDecodedFrameCount), (n = this._mediaElement.webkitDroppedFrameCount))
  4351. : (t = !1);
  4352. return t && ((e.decodedFrames = i), (e.droppedFrames = n)), e;
  4353. },
  4354. enumerable: !1,
  4355. configurable: !0,
  4356. }),
  4357. (e.prototype._onvLoadedMetadata = function (e) {
  4358. null != this._pendingSeekTime && ((this._mediaElement.currentTime = this._pendingSeekTime), (this._pendingSeekTime = null)),
  4359. this._emitter.emit(f.MEDIA_INFO, this.mediaInfo);
  4360. }),
  4361. (e.prototype._reportStatisticsInfo = function () {
  4362. this._emitter.emit(f.STATISTICS_INFO, this.statisticsInfo);
  4363. }),
  4364. e
  4365. );
  4366. })();
  4367. n.Z.install();
  4368. var k = {
  4369. createPlayer: function (e, t) {
  4370. var i = e;
  4371. if (null == i || "object" != typeof i) throw new A.OC("MediaDataSource must be an javascript object!");
  4372. if (!i.hasOwnProperty("type")) throw new A.OC("MediaDataSource must has type field to indicate video file type!");
  4373. switch (i.type) {
  4374. case "flv":
  4375. return new T(i, t);
  4376. default:
  4377. return new C(i, t);
  4378. }
  4379. },
  4380. isSupported: function () {
  4381. return a.supportMSEH264Playback();
  4382. },
  4383. getFeatureList: function () {
  4384. return a.getFeatureList();
  4385. },
  4386. };
  4387. (k.BaseLoader = h.fp),
  4388. (k.LoaderStatus = h.GM),
  4389. (k.LoaderErrors = h.nm),
  4390. (k.Events = f),
  4391. (k.ErrorTypes = w),
  4392. (k.ErrorDetails = O),
  4393. (k.FlvPlayer = T),
  4394. (k.NativePlayer = C),
  4395. (k.LoggingControl = m.Z),
  4396. Object.defineProperty(k, "version", {
  4397. enumerable: !0,
  4398. get: function () {
  4399. return "1.6.2";
  4400. },
  4401. });
  4402. var D = k;
  4403. },
  4404. 324: function (e, t, i) {
  4405. e.exports = i(60).default;
  4406. },
  4407. 191: function (e, t, i) {
  4408. "use strict";
  4409. i.d(t, {
  4410. Z: function () {
  4411. return y;
  4412. },
  4413. });
  4414. var n,
  4415. r = i(300),
  4416. s = (function () {
  4417. function e() {
  4418. (this._firstCheckpoint = 0),
  4419. (this._lastCheckpoint = 0),
  4420. (this._intervalBytes = 0),
  4421. (this._totalBytes = 0),
  4422. (this._lastSecondBytes = 0),
  4423. self.performance && self.performance.now ? (this._now = self.performance.now.bind(self.performance)) : (this._now = Date.now);
  4424. }
  4425. return (
  4426. (e.prototype.reset = function () {
  4427. (this._firstCheckpoint = this._lastCheckpoint = 0), (this._totalBytes = this._intervalBytes = 0), (this._lastSecondBytes = 0);
  4428. }),
  4429. (e.prototype.addBytes = function (e) {
  4430. 0 === this._firstCheckpoint
  4431. ? ((this._firstCheckpoint = this._now()),
  4432. (this._lastCheckpoint = this._firstCheckpoint),
  4433. (this._intervalBytes += e),
  4434. (this._totalBytes += e))
  4435. : this._now() - this._lastCheckpoint < 1e3
  4436. ? ((this._intervalBytes += e), (this._totalBytes += e))
  4437. : ((this._lastSecondBytes = this._intervalBytes),
  4438. (this._intervalBytes = e),
  4439. (this._totalBytes += e),
  4440. (this._lastCheckpoint = this._now()));
  4441. }),
  4442. Object.defineProperty(e.prototype, "currentKBps", {
  4443. get: function () {
  4444. this.addBytes(0);
  4445. var e = (this._now() - this._lastCheckpoint) / 1e3;
  4446. return 0 == e && (e = 1), this._intervalBytes / e / 1024;
  4447. },
  4448. enumerable: !1,
  4449. configurable: !0,
  4450. }),
  4451. Object.defineProperty(e.prototype, "lastSecondKBps", {
  4452. get: function () {
  4453. return (
  4454. this.addBytes(0),
  4455. 0 !== this._lastSecondBytes ? this._lastSecondBytes / 1024 : this._now() - this._lastCheckpoint >= 500 ? this.currentKBps : 0
  4456. );
  4457. },
  4458. enumerable: !1,
  4459. configurable: !0,
  4460. }),
  4461. Object.defineProperty(e.prototype, "averageKBps", {
  4462. get: function () {
  4463. var e = (this._now() - this._firstCheckpoint) / 1e3;
  4464. return this._totalBytes / e / 1024;
  4465. },
  4466. enumerable: !1,
  4467. configurable: !0,
  4468. }),
  4469. e
  4470. );
  4471. })(),
  4472. o = i(939),
  4473. a = i(538),
  4474. h = i(29),
  4475. u =
  4476. ((n = function (e, t) {
  4477. return (n =
  4478. Object.setPrototypeOf ||
  4479. ({ __proto__: [] } instanceof Array &&
  4480. function (e, t) {
  4481. e.__proto__ = t;
  4482. }) ||
  4483. function (e, t) {
  4484. for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  4485. })(e, t);
  4486. }),
  4487. function (e, t) {
  4488. if ("function" != typeof t && null !== t) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  4489. function i() {
  4490. this.constructor = e;
  4491. }
  4492. n(e, t), (e.prototype = null === t ? Object.create(t) : ((i.prototype = t.prototype), new i()));
  4493. }),
  4494. l = (function (e) {
  4495. function t(t, i) {
  4496. var n = e.call(this, "fetch-stream-loader") || this;
  4497. return (
  4498. (n.TAG = "FetchStreamLoader"),
  4499. (n._seekHandler = t),
  4500. (n._config = i),
  4501. (n._needStash = !0),
  4502. (n._requestAbort = !1),
  4503. (n._contentLength = null),
  4504. (n._receivedLength = 0),
  4505. n
  4506. );
  4507. }
  4508. return (
  4509. u(t, e),
  4510. (t.isSupported = function () {
  4511. try {
  4512. var e = a.Z.msedge && a.Z.version.minor >= 15048,
  4513. t = !a.Z.msedge || e;
  4514. return self.fetch && self.ReadableStream && t;
  4515. } catch (e) {
  4516. return !1;
  4517. }
  4518. }),
  4519. (t.prototype.destroy = function () {
  4520. this.isWorking() && this.abort(), e.prototype.destroy.call(this);
  4521. }),
  4522. (t.prototype.open = function (e, t) {
  4523. var i = this;
  4524. (this._dataSource = e), (this._range = t);
  4525. var n = e.url;
  4526. this._config.reuseRedirectedURL && null != e.redirectedURL && (n = e.redirectedURL);
  4527. var r = this._seekHandler.getConfig(n, t),
  4528. s = new self.Headers();
  4529. if ("object" == typeof r.headers) {
  4530. var a = r.headers;
  4531. for (var u in a) a.hasOwnProperty(u) && s.append(u, a[u]);
  4532. }
  4533. var l = { method: "GET", headers: s, mode: "cors", cache: "default", referrerPolicy: "no-referrer-when-downgrade" };
  4534. if ("object" == typeof this._config.headers) for (var u in this._config.headers) s.append(u, this._config.headers[u]);
  4535. !1 === e.cors && (l.mode = "same-origin"),
  4536. e.withCredentials && (l.credentials = "include"),
  4537. e.referrerPolicy && (l.referrerPolicy = e.referrerPolicy),
  4538. self.AbortController && ((this._abortController = new self.AbortController()), (l.signal = this._abortController.signal)),
  4539. (this._status = o.GM.kConnecting),
  4540. self
  4541. .fetch(r.url, l)
  4542. .then(function (e) {
  4543. if (i._requestAbort) return (i._status = o.GM.kIdle), void e.body.cancel();
  4544. if (e.ok && e.status >= 200 && e.status <= 299) {
  4545. if (e.url !== r.url && i._onURLRedirect) {
  4546. var t = i._seekHandler.removeURLParameters(e.url);
  4547. i._onURLRedirect(t);
  4548. }
  4549. var n = e.headers.get("Content-Length");
  4550. return (
  4551. null != n &&
  4552. ((i._contentLength = parseInt(n)),
  4553. 0 !== i._contentLength && i._onContentLengthKnown && i._onContentLengthKnown(i._contentLength)),
  4554. i._pump.call(i, e.body.getReader())
  4555. );
  4556. }
  4557. if (((i._status = o.GM.kError), !i._onError))
  4558. throw new h.OZ("FetchStreamLoader: Http code invalid, " + e.status + " " + e.statusText);
  4559. i._onError(o.nm.HTTP_STATUS_CODE_INVALID, { code: e.status, msg: e.statusText });
  4560. })
  4561. .catch(function (e) {
  4562. if (!i._abortController || !i._abortController.signal.aborted) {
  4563. if (((i._status = o.GM.kError), !i._onError)) throw e;
  4564. i._onError(o.nm.EXCEPTION, { code: -1, msg: e.message });
  4565. }
  4566. });
  4567. }),
  4568. (t.prototype.abort = function () {
  4569. if (((this._requestAbort = !0), (this._status !== o.GM.kBuffering || !a.Z.chrome) && this._abortController))
  4570. try {
  4571. this._abortController.abort();
  4572. } catch (e) {}
  4573. }),
  4574. (t.prototype._pump = function (e) {
  4575. var t = this;
  4576. return e
  4577. .read()
  4578. .then(function (i) {
  4579. if (i.done)
  4580. if (null !== t._contentLength && t._receivedLength < t._contentLength) {
  4581. t._status = o.GM.kError;
  4582. var n = o.nm.EARLY_EOF,
  4583. r = { code: -1, msg: "Fetch stream meet Early-EOF" };
  4584. if (!t._onError) throw new h.OZ(r.msg);
  4585. t._onError(n, r);
  4586. } else (t._status = o.GM.kComplete), t._onComplete && t._onComplete(t._range.from, t._range.from + t._receivedLength - 1);
  4587. else {
  4588. if (t._abortController && t._abortController.signal.aborted) return void (t._status = o.GM.kComplete);
  4589. if (!0 === t._requestAbort) return (t._status = o.GM.kComplete), e.cancel();
  4590. t._status = o.GM.kBuffering;
  4591. var s = i.value.buffer,
  4592. a = t._range.from + t._receivedLength;
  4593. (t._receivedLength += s.byteLength), t._onDataArrival && t._onDataArrival(s, a, t._receivedLength), t._pump(e);
  4594. }
  4595. })
  4596. .catch(function (e) {
  4597. if (t._abortController && t._abortController.signal.aborted) t._status = o.GM.kComplete;
  4598. else if (11 !== e.code || !a.Z.msedge) {
  4599. t._status = o.GM.kError;
  4600. var i = 0,
  4601. n = null;
  4602. if (
  4603. ((19 !== e.code && "network error" !== e.message) ||
  4604. !(null === t._contentLength || (null !== t._contentLength && t._receivedLength < t._contentLength))
  4605. ? ((i = o.nm.EXCEPTION), (n = { code: e.code, msg: e.message }))
  4606. : ((i = o.nm.EARLY_EOF), (n = { code: e.code, msg: "Fetch stream meet Early-EOF" })),
  4607. !t._onError)
  4608. )
  4609. throw new h.OZ(n.msg);
  4610. t._onError(i, n);
  4611. }
  4612. });
  4613. }),
  4614. t
  4615. );
  4616. })(o.fp),
  4617. d = (function () {
  4618. var e = function (t, i) {
  4619. return (e =
  4620. Object.setPrototypeOf ||
  4621. ({ __proto__: [] } instanceof Array &&
  4622. function (e, t) {
  4623. e.__proto__ = t;
  4624. }) ||
  4625. function (e, t) {
  4626. for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  4627. })(t, i);
  4628. };
  4629. return function (t, i) {
  4630. if ("function" != typeof i && null !== i) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null");
  4631. function n() {
  4632. this.constructor = t;
  4633. }
  4634. e(t, i), (t.prototype = null === i ? Object.create(i) : ((n.prototype = i.prototype), new n()));
  4635. };
  4636. })(),
  4637. c = (function (e) {
  4638. function t(t, i) {
  4639. var n = e.call(this, "xhr-moz-chunked-loader") || this;
  4640. return (
  4641. (n.TAG = "MozChunkedLoader"),
  4642. (n._seekHandler = t),
  4643. (n._config = i),
  4644. (n._needStash = !0),
  4645. (n._xhr = null),
  4646. (n._requestAbort = !1),
  4647. (n._contentLength = null),
  4648. (n._receivedLength = 0),
  4649. n
  4650. );
  4651. }
  4652. return (
  4653. d(t, e),
  4654. (t.isSupported = function () {
  4655. try {
  4656. var e = new XMLHttpRequest();
  4657. return (
  4658. e.open("GET", "https://example.com", !0),
  4659. (e.responseType = "moz-chunked-arraybuffer"),
  4660. "moz-chunked-arraybuffer" === e.responseType
  4661. );
  4662. } catch (e) {
  4663. return r.Z.w("MozChunkedLoader", e.message), !1;
  4664. }
  4665. }),
  4666. (t.prototype.destroy = function () {
  4667. this.isWorking() && this.abort(),
  4668. this._xhr &&
  4669. ((this._xhr.onreadystatechange = null),
  4670. (this._xhr.onprogress = null),
  4671. (this._xhr.onloadend = null),
  4672. (this._xhr.onerror = null),
  4673. (this._xhr = null)),
  4674. e.prototype.destroy.call(this);
  4675. }),
  4676. (t.prototype.open = function (e, t) {
  4677. (this._dataSource = e), (this._range = t);
  4678. var i = e.url;
  4679. this._config.reuseRedirectedURL && null != e.redirectedURL && (i = e.redirectedURL);
  4680. var n = this._seekHandler.getConfig(i, t);
  4681. this._requestURL = n.url;
  4682. var r = (this._xhr = new XMLHttpRequest());
  4683. if (
  4684. (r.open("GET", n.url, !0),
  4685. (r.responseType = "moz-chunked-arraybuffer"),
  4686. (r.onreadystatechange = this._onReadyStateChange.bind(this)),
  4687. (r.onprogress = this._onProgress.bind(this)),
  4688. (r.onloadend = this._onLoadEnd.bind(this)),
  4689. (r.onerror = this._onXhrError.bind(this)),
  4690. e.withCredentials && (r.withCredentials = !0),
  4691. "object" == typeof n.headers)
  4692. ) {
  4693. var s = n.headers;
  4694. for (var a in s) s.hasOwnProperty(a) && r.setRequestHeader(a, s[a]);
  4695. }
  4696. if ("object" == typeof this._config.headers) {
  4697. s = this._config.headers;
  4698. for (var a in s) s.hasOwnProperty(a) && r.setRequestHeader(a, s[a]);
  4699. }
  4700. (this._status = o.GM.kConnecting), r.send();
  4701. }),
  4702. (t.prototype.abort = function () {
  4703. (this._requestAbort = !0), this._xhr && this._xhr.abort(), (this._status = o.GM.kComplete);
  4704. }),
  4705. (t.prototype._onReadyStateChange = function (e) {
  4706. var t = e.target;
  4707. if (2 === t.readyState) {
  4708. if (null != t.responseURL && t.responseURL !== this._requestURL && this._onURLRedirect) {
  4709. var i = this._seekHandler.removeURLParameters(t.responseURL);
  4710. this._onURLRedirect(i);
  4711. }
  4712. if (0 !== t.status && (t.status < 200 || t.status > 299)) {
  4713. if (((this._status = o.GM.kError), !this._onError))
  4714. throw new h.OZ("MozChunkedLoader: Http code invalid, " + t.status + " " + t.statusText);
  4715. this._onError(o.nm.HTTP_STATUS_CODE_INVALID, { code: t.status, msg: t.statusText });
  4716. } else this._status = o.GM.kBuffering;
  4717. }
  4718. }),
  4719. (t.prototype._onProgress = function (e) {
  4720. if (this._status !== o.GM.kError) {
  4721. null === this._contentLength &&
  4722. null !== e.total &&
  4723. 0 !== e.total &&
  4724. ((this._contentLength = e.total), this._onContentLengthKnown && this._onContentLengthKnown(this._contentLength));
  4725. var t = e.target.response,
  4726. i = this._range.from + this._receivedLength;
  4727. (this._receivedLength += t.byteLength), this._onDataArrival && this._onDataArrival(t, i, this._receivedLength);
  4728. }
  4729. }),
  4730. (t.prototype._onLoadEnd = function (e) {
  4731. !0 !== this._requestAbort
  4732. ? this._status !== o.GM.kError &&
  4733. ((this._status = o.GM.kComplete),
  4734. this._onComplete && this._onComplete(this._range.from, this._range.from + this._receivedLength - 1))
  4735. : (this._requestAbort = !1);
  4736. }),
  4737. (t.prototype._onXhrError = function (e) {
  4738. this._status = o.GM.kError;
  4739. var t = 0,
  4740. i = null;
  4741. if (
  4742. (this._contentLength && e.loaded < this._contentLength
  4743. ? ((t = o.nm.EARLY_EOF), (i = { code: -1, msg: "Moz-Chunked stream meet Early-Eof" }))
  4744. : ((t = o.nm.EXCEPTION), (i = { code: -1, msg: e.constructor.name + " " + e.type })),
  4745. !this._onError)
  4746. )
  4747. throw new h.OZ(i.msg);
  4748. this._onError(t, i);
  4749. }),
  4750. t
  4751. );
  4752. })(o.fp),
  4753. f = (function () {
  4754. var e = function (t, i) {
  4755. return (e =
  4756. Object.setPrototypeOf ||
  4757. ({ __proto__: [] } instanceof Array &&
  4758. function (e, t) {
  4759. e.__proto__ = t;
  4760. }) ||
  4761. function (e, t) {
  4762. for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  4763. })(t, i);
  4764. };
  4765. return function (t, i) {
  4766. if ("function" != typeof i && null !== i) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null");
  4767. function n() {
  4768. this.constructor = t;
  4769. }
  4770. e(t, i), (t.prototype = null === i ? Object.create(i) : ((n.prototype = i.prototype), new n()));
  4771. };
  4772. })(),
  4773. _ = (function (e) {
  4774. function t(t, i) {
  4775. var n = e.call(this, "xhr-range-loader") || this;
  4776. return (
  4777. (n.TAG = "RangeLoader"),
  4778. (n._seekHandler = t),
  4779. (n._config = i),
  4780. (n._needStash = !1),
  4781. (n._chunkSizeKBList = [128, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168, 8192]),
  4782. (n._currentChunkSizeKB = 384),
  4783. (n._currentSpeedNormalized = 0),
  4784. (n._zeroSpeedChunkCount = 0),
  4785. (n._xhr = null),
  4786. (n._speedSampler = new s()),
  4787. (n._requestAbort = !1),
  4788. (n._waitForTotalLength = !1),
  4789. (n._totalLengthReceived = !1),
  4790. (n._currentRequestURL = null),
  4791. (n._currentRedirectedURL = null),
  4792. (n._currentRequestRange = null),
  4793. (n._totalLength = null),
  4794. (n._contentLength = null),
  4795. (n._receivedLength = 0),
  4796. (n._lastTimeLoaded = 0),
  4797. n
  4798. );
  4799. }
  4800. return (
  4801. f(t, e),
  4802. (t.isSupported = function () {
  4803. try {
  4804. var e = new XMLHttpRequest();
  4805. return e.open("GET", "https://example.com", !0), (e.responseType = "arraybuffer"), "arraybuffer" === e.responseType;
  4806. } catch (e) {
  4807. return r.Z.w("RangeLoader", e.message), !1;
  4808. }
  4809. }),
  4810. (t.prototype.destroy = function () {
  4811. this.isWorking() && this.abort(),
  4812. this._xhr &&
  4813. ((this._xhr.onreadystatechange = null),
  4814. (this._xhr.onprogress = null),
  4815. (this._xhr.onload = null),
  4816. (this._xhr.onerror = null),
  4817. (this._xhr = null)),
  4818. e.prototype.destroy.call(this);
  4819. }),
  4820. Object.defineProperty(t.prototype, "currentSpeed", {
  4821. get: function () {
  4822. return this._speedSampler.lastSecondKBps;
  4823. },
  4824. enumerable: !1,
  4825. configurable: !0,
  4826. }),
  4827. (t.prototype.open = function (e, t) {
  4828. (this._dataSource = e), (this._range = t), (this._status = o.GM.kConnecting);
  4829. var i = !1;
  4830. null != this._dataSource.filesize && 0 !== this._dataSource.filesize && ((i = !0), (this._totalLength = this._dataSource.filesize)),
  4831. this._totalLengthReceived || i
  4832. ? this._openSubRange()
  4833. : ((this._waitForTotalLength = !0), this._internalOpen(this._dataSource, { from: 0, to: -1 }));
  4834. }),
  4835. (t.prototype._openSubRange = function () {
  4836. var e = 1024 * this._currentChunkSizeKB,
  4837. t = this._range.from + this._receivedLength,
  4838. i = t + e;
  4839. null != this._contentLength && i - this._range.from >= this._contentLength && (i = this._range.from + this._contentLength - 1),
  4840. (this._currentRequestRange = { from: t, to: i }),
  4841. this._internalOpen(this._dataSource, this._currentRequestRange);
  4842. }),
  4843. (t.prototype._internalOpen = function (e, t) {
  4844. this._lastTimeLoaded = 0;
  4845. var i = e.url;
  4846. this._config.reuseRedirectedURL &&
  4847. (null != this._currentRedirectedURL ? (i = this._currentRedirectedURL) : null != e.redirectedURL && (i = e.redirectedURL));
  4848. var n = this._seekHandler.getConfig(i, t);
  4849. this._currentRequestURL = n.url;
  4850. var r = (this._xhr = new XMLHttpRequest());
  4851. if (
  4852. (r.open("GET", n.url, !0),
  4853. (r.responseType = "arraybuffer"),
  4854. (r.onreadystatechange = this._onReadyStateChange.bind(this)),
  4855. (r.onprogress = this._onProgress.bind(this)),
  4856. (r.onload = this._onLoad.bind(this)),
  4857. (r.onerror = this._onXhrError.bind(this)),
  4858. e.withCredentials && (r.withCredentials = !0),
  4859. "object" == typeof n.headers)
  4860. ) {
  4861. var s = n.headers;
  4862. for (var o in s) s.hasOwnProperty(o) && r.setRequestHeader(o, s[o]);
  4863. }
  4864. if ("object" == typeof this._config.headers) {
  4865. s = this._config.headers;
  4866. for (var o in s) s.hasOwnProperty(o) && r.setRequestHeader(o, s[o]);
  4867. }
  4868. r.send();
  4869. }),
  4870. (t.prototype.abort = function () {
  4871. (this._requestAbort = !0), this._internalAbort(), (this._status = o.GM.kComplete);
  4872. }),
  4873. (t.prototype._internalAbort = function () {
  4874. this._xhr &&
  4875. ((this._xhr.onreadystatechange = null),
  4876. (this._xhr.onprogress = null),
  4877. (this._xhr.onload = null),
  4878. (this._xhr.onerror = null),
  4879. this._xhr.abort(),
  4880. (this._xhr = null));
  4881. }),
  4882. (t.prototype._onReadyStateChange = function (e) {
  4883. var t = e.target;
  4884. if (2 === t.readyState) {
  4885. if (null != t.responseURL) {
  4886. var i = this._seekHandler.removeURLParameters(t.responseURL);
  4887. t.responseURL !== this._currentRequestURL &&
  4888. i !== this._currentRedirectedURL &&
  4889. ((this._currentRedirectedURL = i), this._onURLRedirect && this._onURLRedirect(i));
  4890. }
  4891. if (t.status >= 200 && t.status <= 299) {
  4892. if (this._waitForTotalLength) return;
  4893. this._status = o.GM.kBuffering;
  4894. } else {
  4895. if (((this._status = o.GM.kError), !this._onError))
  4896. throw new h.OZ("RangeLoader: Http code invalid, " + t.status + " " + t.statusText);
  4897. this._onError(o.nm.HTTP_STATUS_CODE_INVALID, { code: t.status, msg: t.statusText });
  4898. }
  4899. }
  4900. }),
  4901. (t.prototype._onProgress = function (e) {
  4902. if (this._status !== o.GM.kError) {
  4903. if (null === this._contentLength) {
  4904. var t = !1;
  4905. if (this._waitForTotalLength) {
  4906. (this._waitForTotalLength = !1), (this._totalLengthReceived = !0), (t = !0);
  4907. var i = e.total;
  4908. this._internalAbort(), (null != i) & (0 !== i) && (this._totalLength = i);
  4909. }
  4910. if (
  4911. (-1 === this._range.to
  4912. ? (this._contentLength = this._totalLength - this._range.from)
  4913. : (this._contentLength = this._range.to - this._range.from + 1),
  4914. t)
  4915. )
  4916. return void this._openSubRange();
  4917. this._onContentLengthKnown && this._onContentLengthKnown(this._contentLength);
  4918. }
  4919. var n = e.loaded - this._lastTimeLoaded;
  4920. (this._lastTimeLoaded = e.loaded), this._speedSampler.addBytes(n);
  4921. }
  4922. }),
  4923. (t.prototype._normalizeSpeed = function (e) {
  4924. var t = this._chunkSizeKBList,
  4925. i = t.length - 1,
  4926. n = 0,
  4927. r = 0,
  4928. s = i;
  4929. if (e < t[0]) return t[0];
  4930. for (; r <= s; ) {
  4931. if ((n = r + Math.floor((s - r) / 2)) === i || (e >= t[n] && e < t[n + 1])) return t[n];
  4932. t[n] < e ? (r = n + 1) : (s = n - 1);
  4933. }
  4934. }),
  4935. (t.prototype._onLoad = function (e) {
  4936. if (this._status !== o.GM.kError)
  4937. if (this._waitForTotalLength) this._waitForTotalLength = !1;
  4938. else {
  4939. this._lastTimeLoaded = 0;
  4940. var t = this._speedSampler.lastSecondKBps;
  4941. if (
  4942. (0 === t && (this._zeroSpeedChunkCount++, this._zeroSpeedChunkCount >= 3 && (t = this._speedSampler.currentKBps)), 0 !== t)
  4943. ) {
  4944. var i = this._normalizeSpeed(t);
  4945. this._currentSpeedNormalized !== i && ((this._currentSpeedNormalized = i), (this._currentChunkSizeKB = i));
  4946. }
  4947. var n = e.target.response,
  4948. r = this._range.from + this._receivedLength;
  4949. this._receivedLength += n.byteLength;
  4950. var s = !1;
  4951. null != this._contentLength && this._receivedLength < this._contentLength ? this._openSubRange() : (s = !0),
  4952. this._onDataArrival && this._onDataArrival(n, r, this._receivedLength),
  4953. s &&
  4954. ((this._status = o.GM.kComplete),
  4955. this._onComplete && this._onComplete(this._range.from, this._range.from + this._receivedLength - 1));
  4956. }
  4957. }),
  4958. (t.prototype._onXhrError = function (e) {
  4959. this._status = o.GM.kError;
  4960. var t = 0,
  4961. i = null;
  4962. if (
  4963. (this._contentLength && this._receivedLength > 0 && this._receivedLength < this._contentLength
  4964. ? ((t = o.nm.EARLY_EOF), (i = { code: -1, msg: "RangeLoader meet Early-Eof" }))
  4965. : ((t = o.nm.EXCEPTION), (i = { code: -1, msg: e.constructor.name + " " + e.type })),
  4966. !this._onError)
  4967. )
  4968. throw new h.OZ(i.msg);
  4969. this._onError(t, i);
  4970. }),
  4971. t
  4972. );
  4973. })(o.fp),
  4974. p = (function () {
  4975. var e = function (t, i) {
  4976. return (e =
  4977. Object.setPrototypeOf ||
  4978. ({ __proto__: [] } instanceof Array &&
  4979. function (e, t) {
  4980. e.__proto__ = t;
  4981. }) ||
  4982. function (e, t) {
  4983. for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  4984. })(t, i);
  4985. };
  4986. return function (t, i) {
  4987. if ("function" != typeof i && null !== i) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null");
  4988. function n() {
  4989. this.constructor = t;
  4990. }
  4991. e(t, i), (t.prototype = null === i ? Object.create(i) : ((n.prototype = i.prototype), new n()));
  4992. };
  4993. })(),
  4994. m = (function (e) {
  4995. function t() {
  4996. var t = e.call(this, "websocket-loader") || this;
  4997. return (t.TAG = "WebSocketLoader"), (t._needStash = !0), (t._ws = null), (t._requestAbort = !1), (t._receivedLength = 0), t;
  4998. }
  4999. return (
  5000. p(t, e),
  5001. (t.isSupported = function () {
  5002. try {
  5003. return void 0 !== self.WebSocket;
  5004. } catch (e) {
  5005. return !1;
  5006. }
  5007. }),
  5008. (t.prototype.destroy = function () {
  5009. this._ws && this.abort(), e.prototype.destroy.call(this);
  5010. }),
  5011. (t.prototype.open = function (e) {
  5012. try {
  5013. var t = (this._ws = new self.WebSocket(e.url));
  5014. (t.binaryType = "arraybuffer"),
  5015. (t.onopen = this._onWebSocketOpen.bind(this)),
  5016. (t.onclose = this._onWebSocketClose.bind(this)),
  5017. (t.onmessage = this._onWebSocketMessage.bind(this)),
  5018. (t.onerror = this._onWebSocketError.bind(this)),
  5019. (this._status = o.GM.kConnecting);
  5020. } catch (e) {
  5021. this._status = o.GM.kError;
  5022. var i = { code: e.code, msg: e.message };
  5023. if (!this._onError) throw new h.OZ(i.msg);
  5024. this._onError(o.nm.EXCEPTION, i);
  5025. }
  5026. }),
  5027. (t.prototype.abort = function () {
  5028. var e = this._ws;
  5029. !e || (0 !== e.readyState && 1 !== e.readyState) || ((this._requestAbort = !0), e.close()),
  5030. (this._ws = null),
  5031. (this._status = o.GM.kComplete);
  5032. }),
  5033. (t.prototype._onWebSocketOpen = function (e) {
  5034. this._status = o.GM.kBuffering;
  5035. }),
  5036. (t.prototype._onWebSocketClose = function (e) {
  5037. !0 !== this._requestAbort
  5038. ? ((this._status = o.GM.kComplete), this._onComplete && this._onComplete(0, this._receivedLength - 1))
  5039. : (this._requestAbort = !1);
  5040. }),
  5041. (t.prototype._onWebSocketMessage = function (e) {
  5042. var t = this;
  5043. if (e.data instanceof ArrayBuffer) this._dispatchArrayBuffer(e.data);
  5044. else if (e.data instanceof Blob) {
  5045. var i = new FileReader();
  5046. (i.onload = function () {
  5047. t._dispatchArrayBuffer(i.result);
  5048. }),
  5049. i.readAsArrayBuffer(e.data);
  5050. } else {
  5051. this._status = o.GM.kError;
  5052. var n = { code: -1, msg: "Unsupported WebSocket message type: " + e.data.constructor.name };
  5053. if (!this._onError) throw new h.OZ(n.msg);
  5054. this._onError(o.nm.EXCEPTION, n);
  5055. }
  5056. }),
  5057. (t.prototype._dispatchArrayBuffer = function (e) {
  5058. var t = e,
  5059. i = this._receivedLength;
  5060. (this._receivedLength += t.byteLength), this._onDataArrival && this._onDataArrival(t, i, this._receivedLength);
  5061. }),
  5062. (t.prototype._onWebSocketError = function (e) {
  5063. this._status = o.GM.kError;
  5064. var t = { code: e.code, msg: e.message };
  5065. if (!this._onError) throw new h.OZ(t.msg);
  5066. this._onError(o.nm.EXCEPTION, t);
  5067. }),
  5068. t
  5069. );
  5070. })(o.fp),
  5071. g = (function () {
  5072. function e(e) {
  5073. this._zeroStart = e || !1;
  5074. }
  5075. return (
  5076. (e.prototype.getConfig = function (e, t) {
  5077. var i = {};
  5078. if (0 !== t.from || -1 !== t.to) {
  5079. var n = void 0;
  5080. (n = -1 !== t.to ? "bytes=" + t.from.toString() + "-" + t.to.toString() : "bytes=" + t.from.toString() + "-"), (i.Range = n);
  5081. } else this._zeroStart && (i.Range = "bytes=0-");
  5082. return { url: e, headers: i };
  5083. }),
  5084. (e.prototype.removeURLParameters = function (e) {
  5085. return e;
  5086. }),
  5087. e
  5088. );
  5089. })(),
  5090. v = (function () {
  5091. function e(e, t) {
  5092. (this._startName = e), (this._endName = t);
  5093. }
  5094. return (
  5095. (e.prototype.getConfig = function (e, t) {
  5096. var i = e;
  5097. if (0 !== t.from || -1 !== t.to) {
  5098. var n = !0;
  5099. -1 === i.indexOf("?") && ((i += "?"), (n = !1)),
  5100. n && (i += "&"),
  5101. (i += this._startName + "=" + t.from.toString()),
  5102. -1 !== t.to && (i += "&" + this._endName + "=" + t.to.toString());
  5103. }
  5104. return { url: i, headers: {} };
  5105. }),
  5106. (e.prototype.removeURLParameters = function (e) {
  5107. var t = e.split("?")[0],
  5108. i = void 0,
  5109. n = e.indexOf("?");
  5110. -1 !== n && (i = e.substring(n + 1));
  5111. var r = "";
  5112. if (null != i && i.length > 0)
  5113. for (var s = i.split("&"), o = 0; o < s.length; o++) {
  5114. var a = s[o].split("="),
  5115. h = o > 0;
  5116. a[0] !== this._startName && a[0] !== this._endName && (h && (r += "&"), (r += s[o]));
  5117. }
  5118. return 0 === r.length ? t : t + "?" + r;
  5119. }),
  5120. e
  5121. );
  5122. })(),
  5123. y = (function () {
  5124. function e(e, t, i) {
  5125. (this.TAG = "IOController"),
  5126. (this._config = t),
  5127. (this._extraData = i),
  5128. (this._stashInitialSize = 393216),
  5129. null != t.stashInitialSize && t.stashInitialSize > 0 && (this._stashInitialSize = t.stashInitialSize),
  5130. (this._stashUsed = 0),
  5131. (this._stashSize = this._stashInitialSize),
  5132. (this._bufferSize = 3145728),
  5133. (this._stashBuffer = new ArrayBuffer(this._bufferSize)),
  5134. (this._stashByteStart = 0),
  5135. (this._enableStash = !0),
  5136. !1 === t.enableStashBuffer && (this._enableStash = !1),
  5137. (this._loader = null),
  5138. (this._loaderClass = null),
  5139. (this._seekHandler = null),
  5140. (this._dataSource = e),
  5141. (this._isWebSocketURL = /wss?:\/\/(.+?)/.test(e.url)),
  5142. (this._refTotalLength = e.filesize ? e.filesize : null),
  5143. (this._totalLength = this._refTotalLength),
  5144. (this._fullRequestFlag = !1),
  5145. (this._currentRange = null),
  5146. (this._redirectedURL = null),
  5147. (this._speedNormalized = 0),
  5148. (this._speedSampler = new s()),
  5149. (this._speedNormalizeList = [64, 128, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096]),
  5150. (this._isEarlyEofReconnecting = !1),
  5151. (this._paused = !1),
  5152. (this._resumeFrom = 0),
  5153. (this._onDataArrival = null),
  5154. (this._onSeeked = null),
  5155. (this._onError = null),
  5156. (this._onComplete = null),
  5157. (this._onRedirect = null),
  5158. (this._onRecoveredEarlyEof = null),
  5159. this._selectSeekHandler(),
  5160. this._selectLoader(),
  5161. this._createLoader();
  5162. }
  5163. return (
  5164. (e.prototype.destroy = function () {
  5165. this._loader.isWorking() && this._loader.abort(),
  5166. this._loader.destroy(),
  5167. (this._loader = null),
  5168. (this._loaderClass = null),
  5169. (this._dataSource = null),
  5170. (this._stashBuffer = null),
  5171. (this._stashUsed = this._stashSize = this._bufferSize = this._stashByteStart = 0),
  5172. (this._currentRange = null),
  5173. (this._speedSampler = null),
  5174. (this._isEarlyEofReconnecting = !1),
  5175. (this._onDataArrival = null),
  5176. (this._onSeeked = null),
  5177. (this._onError = null),
  5178. (this._onComplete = null),
  5179. (this._onRedirect = null),
  5180. (this._onRecoveredEarlyEof = null),
  5181. (this._extraData = null);
  5182. }),
  5183. (e.prototype.isWorking = function () {
  5184. return this._loader && this._loader.isWorking() && !this._paused;
  5185. }),
  5186. (e.prototype.isPaused = function () {
  5187. return this._paused;
  5188. }),
  5189. Object.defineProperty(e.prototype, "status", {
  5190. get: function () {
  5191. return this._loader.status;
  5192. },
  5193. enumerable: !1,
  5194. configurable: !0,
  5195. }),
  5196. Object.defineProperty(e.prototype, "extraData", {
  5197. get: function () {
  5198. return this._extraData;
  5199. },
  5200. set: function (e) {
  5201. this._extraData = e;
  5202. },
  5203. enumerable: !1,
  5204. configurable: !0,
  5205. }),
  5206. Object.defineProperty(e.prototype, "onDataArrival", {
  5207. get: function () {
  5208. return this._onDataArrival;
  5209. },
  5210. set: function (e) {
  5211. this._onDataArrival = e;
  5212. },
  5213. enumerable: !1,
  5214. configurable: !0,
  5215. }),
  5216. Object.defineProperty(e.prototype, "onSeeked", {
  5217. get: function () {
  5218. return this._onSeeked;
  5219. },
  5220. set: function (e) {
  5221. this._onSeeked = e;
  5222. },
  5223. enumerable: !1,
  5224. configurable: !0,
  5225. }),
  5226. Object.defineProperty(e.prototype, "onError", {
  5227. get: function () {
  5228. return this._onError;
  5229. },
  5230. set: function (e) {
  5231. this._onError = e;
  5232. },
  5233. enumerable: !1,
  5234. configurable: !0,
  5235. }),
  5236. Object.defineProperty(e.prototype, "onComplete", {
  5237. get: function () {
  5238. return this._onComplete;
  5239. },
  5240. set: function (e) {
  5241. this._onComplete = e;
  5242. },
  5243. enumerable: !1,
  5244. configurable: !0,
  5245. }),
  5246. Object.defineProperty(e.prototype, "onRedirect", {
  5247. get: function () {
  5248. return this._onRedirect;
  5249. },
  5250. set: function (e) {
  5251. this._onRedirect = e;
  5252. },
  5253. enumerable: !1,
  5254. configurable: !0,
  5255. }),
  5256. Object.defineProperty(e.prototype, "onRecoveredEarlyEof", {
  5257. get: function () {
  5258. return this._onRecoveredEarlyEof;
  5259. },
  5260. set: function (e) {
  5261. this._onRecoveredEarlyEof = e;
  5262. },
  5263. enumerable: !1,
  5264. configurable: !0,
  5265. }),
  5266. Object.defineProperty(e.prototype, "currentURL", {
  5267. get: function () {
  5268. return this._dataSource.url;
  5269. },
  5270. enumerable: !1,
  5271. configurable: !0,
  5272. }),
  5273. Object.defineProperty(e.prototype, "hasRedirect", {
  5274. get: function () {
  5275. return null != this._redirectedURL || null != this._dataSource.redirectedURL;
  5276. },
  5277. enumerable: !1,
  5278. configurable: !0,
  5279. }),
  5280. Object.defineProperty(e.prototype, "currentRedirectedURL", {
  5281. get: function () {
  5282. return this._redirectedURL || this._dataSource.redirectedURL;
  5283. },
  5284. enumerable: !1,
  5285. configurable: !0,
  5286. }),
  5287. Object.defineProperty(e.prototype, "currentSpeed", {
  5288. get: function () {
  5289. return this._loaderClass === _ ? this._loader.currentSpeed : this._speedSampler.lastSecondKBps;
  5290. },
  5291. enumerable: !1,
  5292. configurable: !0,
  5293. }),
  5294. Object.defineProperty(e.prototype, "loaderType", {
  5295. get: function () {
  5296. return this._loader.type;
  5297. },
  5298. enumerable: !1,
  5299. configurable: !0,
  5300. }),
  5301. (e.prototype._selectSeekHandler = function () {
  5302. var e = this._config;
  5303. if ("range" === e.seekType) this._seekHandler = new g(this._config.rangeLoadZeroStart);
  5304. else if ("param" === e.seekType) {
  5305. var t = e.seekParamStart || "bstart",
  5306. i = e.seekParamEnd || "bend";
  5307. this._seekHandler = new v(t, i);
  5308. } else {
  5309. if ("custom" !== e.seekType) throw new h.OC("Invalid seekType in config: " + e.seekType);
  5310. if ("function" != typeof e.customSeekHandler)
  5311. throw new h.OC("Custom seekType specified in config but invalid customSeekHandler!");
  5312. this._seekHandler = new e.customSeekHandler();
  5313. }
  5314. }),
  5315. (e.prototype._selectLoader = function () {
  5316. if (null != this._config.customLoader) this._loaderClass = this._config.customLoader;
  5317. else if (this._isWebSocketURL) this._loaderClass = m;
  5318. else if (l.isSupported()) this._loaderClass = l;
  5319. else if (c.isSupported()) this._loaderClass = c;
  5320. else {
  5321. if (!_.isSupported()) throw new h.OZ("Your browser doesn't support xhr with arraybuffer responseType!");
  5322. this._loaderClass = _;
  5323. }
  5324. }),
  5325. (e.prototype._createLoader = function () {
  5326. (this._loader = new this._loaderClass(this._seekHandler, this._config)),
  5327. !1 === this._loader.needStashBuffer && (this._enableStash = !1),
  5328. (this._loader.onContentLengthKnown = this._onContentLengthKnown.bind(this)),
  5329. (this._loader.onURLRedirect = this._onURLRedirect.bind(this)),
  5330. (this._loader.onDataArrival = this._onLoaderChunkArrival.bind(this)),
  5331. (this._loader.onComplete = this._onLoaderComplete.bind(this)),
  5332. (this._loader.onError = this._onLoaderError.bind(this));
  5333. }),
  5334. (e.prototype.open = function (e) {
  5335. (this._currentRange = { from: 0, to: -1 }),
  5336. e && (this._currentRange.from = e),
  5337. this._speedSampler.reset(),
  5338. e || (this._fullRequestFlag = !0),
  5339. this._loader.open(this._dataSource, Object.assign({}, this._currentRange));
  5340. }),
  5341. (e.prototype.abort = function () {
  5342. this._loader.abort(), this._paused && ((this._paused = !1), (this._resumeFrom = 0));
  5343. }),
  5344. (e.prototype.pause = function () {
  5345. this.isWorking() &&
  5346. (this._loader.abort(),
  5347. 0 !== this._stashUsed
  5348. ? ((this._resumeFrom = this._stashByteStart), (this._currentRange.to = this._stashByteStart - 1))
  5349. : (this._resumeFrom = this._currentRange.to + 1),
  5350. (this._stashUsed = 0),
  5351. (this._stashByteStart = 0),
  5352. (this._paused = !0));
  5353. }),
  5354. (e.prototype.resume = function () {
  5355. if (this._paused) {
  5356. this._paused = !1;
  5357. var e = this._resumeFrom;
  5358. (this._resumeFrom = 0), this._internalSeek(e, !0);
  5359. }
  5360. }),
  5361. (e.prototype.seek = function (e) {
  5362. (this._paused = !1), (this._stashUsed = 0), (this._stashByteStart = 0), this._internalSeek(e, !0);
  5363. }),
  5364. (e.prototype._internalSeek = function (e, t) {
  5365. this._loader.isWorking() && this._loader.abort(), this._flushStashBuffer(t), this._loader.destroy(), (this._loader = null);
  5366. var i = { from: e, to: -1 };
  5367. (this._currentRange = { from: i.from, to: -1 }),
  5368. this._speedSampler.reset(),
  5369. (this._stashSize = this._stashInitialSize),
  5370. this._createLoader(),
  5371. this._loader.open(this._dataSource, i),
  5372. this._onSeeked && this._onSeeked();
  5373. }),
  5374. (e.prototype.updateUrl = function (e) {
  5375. if (!e || "string" != typeof e || 0 === e.length) throw new h.OC("Url must be a non-empty string!");
  5376. this._dataSource.url = e;
  5377. }),
  5378. (e.prototype._expandBuffer = function (e) {
  5379. for (var t = this._stashSize; t + 1048576 < e; ) t *= 2;
  5380. if ((t += 1048576) !== this._bufferSize) {
  5381. var i = new ArrayBuffer(t);
  5382. if (this._stashUsed > 0) {
  5383. var n = new Uint8Array(this._stashBuffer, 0, this._stashUsed);
  5384. new Uint8Array(i, 0, t).set(n, 0);
  5385. }
  5386. (this._stashBuffer = i), (this._bufferSize = t);
  5387. }
  5388. }),
  5389. (e.prototype._normalizeSpeed = function (e) {
  5390. var t = this._speedNormalizeList,
  5391. i = t.length - 1,
  5392. n = 0,
  5393. r = 0,
  5394. s = i;
  5395. if (e < t[0]) return t[0];
  5396. for (; r <= s; ) {
  5397. if ((n = r + Math.floor((s - r) / 2)) === i || (e >= t[n] && e < t[n + 1])) return t[n];
  5398. t[n] < e ? (r = n + 1) : (s = n - 1);
  5399. }
  5400. }),
  5401. (e.prototype._adjustStashSize = function (e) {
  5402. var t = 0;
  5403. (t = this._config.isLive || e < 512 ? e : e >= 512 && e <= 1024 ? Math.floor(1.5 * e) : 2 * e) > 8192 && (t = 8192);
  5404. var i = 1024 * t + 1048576;
  5405. this._bufferSize < i && this._expandBuffer(i), (this._stashSize = 1024 * t);
  5406. }),
  5407. (e.prototype._dispatchChunks = function (e, t) {
  5408. return (this._currentRange.to = t + e.byteLength - 1), this._onDataArrival(e, t);
  5409. }),
  5410. (e.prototype._onURLRedirect = function (e) {
  5411. (this._redirectedURL = e), this._onRedirect && this._onRedirect(e);
  5412. }),
  5413. (e.prototype._onContentLengthKnown = function (e) {
  5414. e && this._fullRequestFlag && ((this._totalLength = e), (this._fullRequestFlag = !1));
  5415. }),
  5416. (e.prototype._onLoaderChunkArrival = function (e, t, i) {
  5417. if (!this._onDataArrival) throw new h.rT("IOController: No existing consumer (onDataArrival) callback!");
  5418. if (!this._paused) {
  5419. this._isEarlyEofReconnecting && ((this._isEarlyEofReconnecting = !1), this._onRecoveredEarlyEof && this._onRecoveredEarlyEof()),
  5420. this._speedSampler.addBytes(e.byteLength);
  5421. var n = this._speedSampler.lastSecondKBps;
  5422. if (0 !== n) {
  5423. var r = this._normalizeSpeed(n);
  5424. this._speedNormalized !== r && ((this._speedNormalized = r), this._adjustStashSize(r));
  5425. }
  5426. if (this._enableStash)
  5427. if (
  5428. (0 === this._stashUsed && 0 === this._stashByteStart && (this._stashByteStart = t),
  5429. this._stashUsed + e.byteLength <= this._stashSize)
  5430. ) {
  5431. (a = new Uint8Array(this._stashBuffer, 0, this._stashSize)).set(new Uint8Array(e), this._stashUsed),
  5432. (this._stashUsed += e.byteLength);
  5433. } else {
  5434. a = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  5435. if (this._stashUsed > 0) {
  5436. var s = this._stashBuffer.slice(0, this._stashUsed);
  5437. if ((u = this._dispatchChunks(s, this._stashByteStart)) < s.byteLength) {
  5438. if (u > 0) {
  5439. l = new Uint8Array(s, u);
  5440. a.set(l, 0), (this._stashUsed = l.byteLength), (this._stashByteStart += u);
  5441. }
  5442. } else (this._stashUsed = 0), (this._stashByteStart += u);
  5443. this._stashUsed + e.byteLength > this._bufferSize &&
  5444. (this._expandBuffer(this._stashUsed + e.byteLength), (a = new Uint8Array(this._stashBuffer, 0, this._bufferSize))),
  5445. a.set(new Uint8Array(e), this._stashUsed),
  5446. (this._stashUsed += e.byteLength);
  5447. } else {
  5448. if ((u = this._dispatchChunks(e, t)) < e.byteLength)
  5449. (o = e.byteLength - u) > this._bufferSize &&
  5450. (this._expandBuffer(o), (a = new Uint8Array(this._stashBuffer, 0, this._bufferSize))),
  5451. a.set(new Uint8Array(e, u), 0),
  5452. (this._stashUsed += o),
  5453. (this._stashByteStart = t + u);
  5454. }
  5455. }
  5456. else if (0 === this._stashUsed) {
  5457. var o;
  5458. if ((u = this._dispatchChunks(e, t)) < e.byteLength)
  5459. (o = e.byteLength - u) > this._bufferSize && this._expandBuffer(o),
  5460. (a = new Uint8Array(this._stashBuffer, 0, this._bufferSize)).set(new Uint8Array(e, u), 0),
  5461. (this._stashUsed += o),
  5462. (this._stashByteStart = t + u);
  5463. } else {
  5464. var a, u;
  5465. if (
  5466. (this._stashUsed + e.byteLength > this._bufferSize && this._expandBuffer(this._stashUsed + e.byteLength),
  5467. (a = new Uint8Array(this._stashBuffer, 0, this._bufferSize)).set(new Uint8Array(e), this._stashUsed),
  5468. (this._stashUsed += e.byteLength),
  5469. (u = this._dispatchChunks(this._stashBuffer.slice(0, this._stashUsed), this._stashByteStart)) < this._stashUsed && u > 0)
  5470. ) {
  5471. var l = new Uint8Array(this._stashBuffer, u);
  5472. a.set(l, 0);
  5473. }
  5474. (this._stashUsed -= u), (this._stashByteStart += u);
  5475. }
  5476. }
  5477. }),
  5478. (e.prototype._flushStashBuffer = function (e) {
  5479. if (this._stashUsed > 0) {
  5480. var t = this._stashBuffer.slice(0, this._stashUsed),
  5481. i = this._dispatchChunks(t, this._stashByteStart),
  5482. n = t.byteLength - i;
  5483. if (i < t.byteLength) {
  5484. if (!e) {
  5485. if (i > 0) {
  5486. var s = new Uint8Array(this._stashBuffer, 0, this._bufferSize),
  5487. o = new Uint8Array(t, i);
  5488. s.set(o, 0), (this._stashUsed = o.byteLength), (this._stashByteStart += i);
  5489. }
  5490. return 0;
  5491. }
  5492. r.Z.w(this.TAG, n + " bytes unconsumed data remain when flush buffer, dropped");
  5493. }
  5494. return (this._stashUsed = 0), (this._stashByteStart = 0), n;
  5495. }
  5496. return 0;
  5497. }),
  5498. (e.prototype._onLoaderComplete = function (e, t) {
  5499. this._flushStashBuffer(!0), this._onComplete && this._onComplete(this._extraData);
  5500. }),
  5501. (e.prototype._onLoaderError = function (e, t) {
  5502. switch (
  5503. (r.Z.e(this.TAG, "Loader error, code = " + t.code + ", msg = " + t.msg),
  5504. this._flushStashBuffer(!1),
  5505. this._isEarlyEofReconnecting && ((this._isEarlyEofReconnecting = !1), (e = o.nm.UNRECOVERABLE_EARLY_EOF)),
  5506. e)
  5507. ) {
  5508. case o.nm.EARLY_EOF:
  5509. if (!this._config.isLive && this._totalLength) {
  5510. var i = this._currentRange.to + 1;
  5511. return void (
  5512. i < this._totalLength &&
  5513. (r.Z.w(this.TAG, "Connection lost, trying reconnect..."), (this._isEarlyEofReconnecting = !0), this._internalSeek(i, !1))
  5514. );
  5515. }
  5516. e = o.nm.UNRECOVERABLE_EARLY_EOF;
  5517. break;
  5518. case o.nm.UNRECOVERABLE_EARLY_EOF:
  5519. case o.nm.CONNECTING_TIMEOUT:
  5520. case o.nm.HTTP_STATUS_CODE_INVALID:
  5521. case o.nm.EXCEPTION:
  5522. }
  5523. if (!this._onError) throw new h.OZ("IOException: " + t.msg);
  5524. this._onError(e, t);
  5525. }),
  5526. e
  5527. );
  5528. })();
  5529. },
  5530. 939: function (e, t, i) {
  5531. "use strict";
  5532. i.d(t, {
  5533. GM: function () {
  5534. return r;
  5535. },
  5536. nm: function () {
  5537. return s;
  5538. },
  5539. fp: function () {
  5540. return o;
  5541. },
  5542. });
  5543. var n = i(29),
  5544. r = { kIdle: 0, kConnecting: 1, kBuffering: 2, kError: 3, kComplete: 4 },
  5545. s = {
  5546. OK: "OK",
  5547. EXCEPTION: "Exception",
  5548. HTTP_STATUS_CODE_INVALID: "HttpStatusCodeInvalid",
  5549. CONNECTING_TIMEOUT: "ConnectingTimeout",
  5550. EARLY_EOF: "EarlyEof",
  5551. UNRECOVERABLE_EARLY_EOF: "UnrecoverableEarlyEof",
  5552. },
  5553. o = (function () {
  5554. function e(e) {
  5555. (this._type = e || "undefined"),
  5556. (this._status = r.kIdle),
  5557. (this._needStash = !1),
  5558. (this._onContentLengthKnown = null),
  5559. (this._onURLRedirect = null),
  5560. (this._onDataArrival = null),
  5561. (this._onError = null),
  5562. (this._onComplete = null);
  5563. }
  5564. return (
  5565. (e.prototype.destroy = function () {
  5566. (this._status = r.kIdle),
  5567. (this._onContentLengthKnown = null),
  5568. (this._onURLRedirect = null),
  5569. (this._onDataArrival = null),
  5570. (this._onError = null),
  5571. (this._onComplete = null);
  5572. }),
  5573. (e.prototype.isWorking = function () {
  5574. return this._status === r.kConnecting || this._status === r.kBuffering;
  5575. }),
  5576. Object.defineProperty(e.prototype, "type", {
  5577. get: function () {
  5578. return this._type;
  5579. },
  5580. enumerable: !1,
  5581. configurable: !0,
  5582. }),
  5583. Object.defineProperty(e.prototype, "status", {
  5584. get: function () {
  5585. return this._status;
  5586. },
  5587. enumerable: !1,
  5588. configurable: !0,
  5589. }),
  5590. Object.defineProperty(e.prototype, "needStashBuffer", {
  5591. get: function () {
  5592. return this._needStash;
  5593. },
  5594. enumerable: !1,
  5595. configurable: !0,
  5596. }),
  5597. Object.defineProperty(e.prototype, "onContentLengthKnown", {
  5598. get: function () {
  5599. return this._onContentLengthKnown;
  5600. },
  5601. set: function (e) {
  5602. this._onContentLengthKnown = e;
  5603. },
  5604. enumerable: !1,
  5605. configurable: !0,
  5606. }),
  5607. Object.defineProperty(e.prototype, "onURLRedirect", {
  5608. get: function () {
  5609. return this._onURLRedirect;
  5610. },
  5611. set: function (e) {
  5612. this._onURLRedirect = e;
  5613. },
  5614. enumerable: !1,
  5615. configurable: !0,
  5616. }),
  5617. Object.defineProperty(e.prototype, "onDataArrival", {
  5618. get: function () {
  5619. return this._onDataArrival;
  5620. },
  5621. set: function (e) {
  5622. this._onDataArrival = e;
  5623. },
  5624. enumerable: !1,
  5625. configurable: !0,
  5626. }),
  5627. Object.defineProperty(e.prototype, "onError", {
  5628. get: function () {
  5629. return this._onError;
  5630. },
  5631. set: function (e) {
  5632. this._onError = e;
  5633. },
  5634. enumerable: !1,
  5635. configurable: !0,
  5636. }),
  5637. Object.defineProperty(e.prototype, "onComplete", {
  5638. get: function () {
  5639. return this._onComplete;
  5640. },
  5641. set: function (e) {
  5642. this._onComplete = e;
  5643. },
  5644. enumerable: !1,
  5645. configurable: !0,
  5646. }),
  5647. (e.prototype.open = function (e, t) {
  5648. throw new n.do("Unimplemented abstract function!");
  5649. }),
  5650. (e.prototype.abort = function () {
  5651. throw new n.do("Unimplemented abstract function!");
  5652. }),
  5653. e
  5654. );
  5655. })();
  5656. },
  5657. 538: function (e, t) {
  5658. "use strict";
  5659. var i = {};
  5660. !(function () {
  5661. var e = self.navigator.userAgent.toLowerCase(),
  5662. t =
  5663. /(edge)\/([\w.]+)/.exec(e) ||
  5664. /(opr)[\/]([\w.]+)/.exec(e) ||
  5665. /(chrome)[ \/]([\w.]+)/.exec(e) ||
  5666. /(iemobile)[\/]([\w.]+)/.exec(e) ||
  5667. /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e) ||
  5668. /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e) ||
  5669. /(webkit)[ \/]([\w.]+)/.exec(e) ||
  5670. /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e) ||
  5671. /(msie) ([\w.]+)/.exec(e) ||
  5672. (e.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(e)) ||
  5673. (e.indexOf("compatible") < 0 && /(firefox)[ \/]([\w.]+)/.exec(e)) ||
  5674. [],
  5675. n =
  5676. /(ipad)/.exec(e) ||
  5677. /(ipod)/.exec(e) ||
  5678. /(windows phone)/.exec(e) ||
  5679. /(iphone)/.exec(e) ||
  5680. /(kindle)/.exec(e) ||
  5681. /(android)/.exec(e) ||
  5682. /(windows)/.exec(e) ||
  5683. /(mac)/.exec(e) ||
  5684. /(linux)/.exec(e) ||
  5685. /(cros)/.exec(e) ||
  5686. [],
  5687. r = { browser: t[5] || t[3] || t[1] || "", version: t[2] || t[4] || "0", majorVersion: t[4] || t[2] || "0", platform: n[0] || "" },
  5688. s = {};
  5689. if (r.browser) {
  5690. s[r.browser] = !0;
  5691. var o = r.majorVersion.split(".");
  5692. (s.version = { major: parseInt(r.majorVersion, 10), string: r.version }),
  5693. o.length > 1 && (s.version.minor = parseInt(o[1], 10)),
  5694. o.length > 2 && (s.version.build = parseInt(o[2], 10));
  5695. }
  5696. if ((r.platform && (s[r.platform] = !0), (s.chrome || s.opr || s.safari) && (s.webkit = !0), s.rv || s.iemobile)) {
  5697. s.rv && delete s.rv;
  5698. var a = "msie";
  5699. (r.browser = a), (s.msie = !0);
  5700. }
  5701. if (s.edge) {
  5702. delete s.edge;
  5703. var h = "msedge";
  5704. (r.browser = h), (s.msedge = !0);
  5705. }
  5706. if (s.opr) {
  5707. var u = "opera";
  5708. (r.browser = u), (s.opera = !0);
  5709. }
  5710. if (s.safari && s.android) {
  5711. var l = "android";
  5712. (r.browser = l), (s.android = !0);
  5713. }
  5714. for (var d in ((s.name = r.browser), (s.platform = r.platform), i)) i.hasOwnProperty(d) && delete i[d];
  5715. Object.assign(i, s);
  5716. })(),
  5717. (t.Z = i);
  5718. },
  5719. 29: function (e, t, i) {
  5720. "use strict";
  5721. i.d(t, {
  5722. OZ: function () {
  5723. return s;
  5724. },
  5725. rT: function () {
  5726. return o;
  5727. },
  5728. OC: function () {
  5729. return a;
  5730. },
  5731. do: function () {
  5732. return h;
  5733. },
  5734. });
  5735. var n,
  5736. r =
  5737. ((n = function (e, t) {
  5738. return (n =
  5739. Object.setPrototypeOf ||
  5740. ({ __proto__: [] } instanceof Array &&
  5741. function (e, t) {
  5742. e.__proto__ = t;
  5743. }) ||
  5744. function (e, t) {
  5745. for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  5746. })(e, t);
  5747. }),
  5748. function (e, t) {
  5749. if ("function" != typeof t && null !== t) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  5750. function i() {
  5751. this.constructor = e;
  5752. }
  5753. n(e, t), (e.prototype = null === t ? Object.create(t) : ((i.prototype = t.prototype), new i()));
  5754. }),
  5755. s = (function () {
  5756. function e(e) {
  5757. this._message = e;
  5758. }
  5759. return (
  5760. Object.defineProperty(e.prototype, "name", {
  5761. get: function () {
  5762. return "RuntimeException";
  5763. },
  5764. enumerable: !1,
  5765. configurable: !0,
  5766. }),
  5767. Object.defineProperty(e.prototype, "message", {
  5768. get: function () {
  5769. return this._message;
  5770. },
  5771. enumerable: !1,
  5772. configurable: !0,
  5773. }),
  5774. (e.prototype.toString = function () {
  5775. return this.name + ": " + this.message;
  5776. }),
  5777. e
  5778. );
  5779. })(),
  5780. o = (function (e) {
  5781. function t(t) {
  5782. return e.call(this, t) || this;
  5783. }
  5784. return (
  5785. r(t, e),
  5786. Object.defineProperty(t.prototype, "name", {
  5787. get: function () {
  5788. return "IllegalStateException";
  5789. },
  5790. enumerable: !1,
  5791. configurable: !0,
  5792. }),
  5793. t
  5794. );
  5795. })(s),
  5796. a = (function (e) {
  5797. function t(t) {
  5798. return e.call(this, t) || this;
  5799. }
  5800. return (
  5801. r(t, e),
  5802. Object.defineProperty(t.prototype, "name", {
  5803. get: function () {
  5804. return "InvalidArgumentException";
  5805. },
  5806. enumerable: !1,
  5807. configurable: !0,
  5808. }),
  5809. t
  5810. );
  5811. })(s),
  5812. h = (function (e) {
  5813. function t(t) {
  5814. return e.call(this, t) || this;
  5815. }
  5816. return (
  5817. r(t, e),
  5818. Object.defineProperty(t.prototype, "name", {
  5819. get: function () {
  5820. return "NotImplementedException";
  5821. },
  5822. enumerable: !1,
  5823. configurable: !0,
  5824. }),
  5825. t
  5826. );
  5827. })(s);
  5828. },
  5829. 300: function (e, t, i) {
  5830. "use strict";
  5831. var n = i(716),
  5832. r = i.n(n),
  5833. s = (function () {
  5834. function e() {}
  5835. return (
  5836. (e.e = function (t, i) {
  5837. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  5838. var n = "[" + t + "] > " + i;
  5839. e.ENABLE_CALLBACK && e.emitter.emit("log", "error", n),
  5840. e.ENABLE_ERROR && (console.error ? console.error(n) : console.warn ? console.warn(n) : console.log(n));
  5841. }),
  5842. (e.i = function (t, i) {
  5843. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  5844. var n = "[" + t + "] > " + i;
  5845. e.ENABLE_CALLBACK && e.emitter.emit("log", "info", n), e.ENABLE_INFO && (console.info ? console.info(n) : console.log(n));
  5846. }),
  5847. (e.w = function (t, i) {
  5848. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  5849. var n = "[" + t + "] > " + i;
  5850. e.ENABLE_CALLBACK && e.emitter.emit("log", "warn", n), e.ENABLE_WARN && (console.warn ? console.warn(n) : console.log(n));
  5851. }),
  5852. (e.d = function (t, i) {
  5853. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  5854. var n = "[" + t + "] > " + i;
  5855. e.ENABLE_CALLBACK && e.emitter.emit("log", "debug", n), e.ENABLE_DEBUG && (console.debug ? console.debug(n) : console.log(n));
  5856. }),
  5857. (e.v = function (t, i) {
  5858. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  5859. var n = "[" + t + "] > " + i;
  5860. e.ENABLE_CALLBACK && e.emitter.emit("log", "verbose", n), e.ENABLE_VERBOSE && console.log(n);
  5861. }),
  5862. e
  5863. );
  5864. })();
  5865. (s.GLOBAL_TAG = "flv.js"),
  5866. (s.FORCE_GLOBAL_TAG = !1),
  5867. (s.ENABLE_ERROR = !0),
  5868. (s.ENABLE_INFO = !0),
  5869. (s.ENABLE_WARN = !0),
  5870. (s.ENABLE_DEBUG = !0),
  5871. (s.ENABLE_VERBOSE = !0),
  5872. (s.ENABLE_CALLBACK = !1),
  5873. (s.emitter = new (r())()),
  5874. (t.Z = s);
  5875. },
  5876. 846: function (e, t, i) {
  5877. "use strict";
  5878. var n = i(716),
  5879. r = i.n(n),
  5880. s = i(300),
  5881. o = (function () {
  5882. function e() {}
  5883. return (
  5884. Object.defineProperty(e, "forceGlobalTag", {
  5885. get: function () {
  5886. return s.Z.FORCE_GLOBAL_TAG;
  5887. },
  5888. set: function (t) {
  5889. (s.Z.FORCE_GLOBAL_TAG = t), e._notifyChange();
  5890. },
  5891. enumerable: !1,
  5892. configurable: !0,
  5893. }),
  5894. Object.defineProperty(e, "globalTag", {
  5895. get: function () {
  5896. return s.Z.GLOBAL_TAG;
  5897. },
  5898. set: function (t) {
  5899. (s.Z.GLOBAL_TAG = t), e._notifyChange();
  5900. },
  5901. enumerable: !1,
  5902. configurable: !0,
  5903. }),
  5904. Object.defineProperty(e, "enableAll", {
  5905. get: function () {
  5906. return s.Z.ENABLE_VERBOSE && s.Z.ENABLE_DEBUG && s.Z.ENABLE_INFO && s.Z.ENABLE_WARN && s.Z.ENABLE_ERROR;
  5907. },
  5908. set: function (t) {
  5909. (s.Z.ENABLE_VERBOSE = t),
  5910. (s.Z.ENABLE_DEBUG = t),
  5911. (s.Z.ENABLE_INFO = t),
  5912. (s.Z.ENABLE_WARN = t),
  5913. (s.Z.ENABLE_ERROR = t),
  5914. e._notifyChange();
  5915. },
  5916. enumerable: !1,
  5917. configurable: !0,
  5918. }),
  5919. Object.defineProperty(e, "enableDebug", {
  5920. get: function () {
  5921. return s.Z.ENABLE_DEBUG;
  5922. },
  5923. set: function (t) {
  5924. (s.Z.ENABLE_DEBUG = t), e._notifyChange();
  5925. },
  5926. enumerable: !1,
  5927. configurable: !0,
  5928. }),
  5929. Object.defineProperty(e, "enableVerbose", {
  5930. get: function () {
  5931. return s.Z.ENABLE_VERBOSE;
  5932. },
  5933. set: function (t) {
  5934. (s.Z.ENABLE_VERBOSE = t), e._notifyChange();
  5935. },
  5936. enumerable: !1,
  5937. configurable: !0,
  5938. }),
  5939. Object.defineProperty(e, "enableInfo", {
  5940. get: function () {
  5941. return s.Z.ENABLE_INFO;
  5942. },
  5943. set: function (t) {
  5944. (s.Z.ENABLE_INFO = t), e._notifyChange();
  5945. },
  5946. enumerable: !1,
  5947. configurable: !0,
  5948. }),
  5949. Object.defineProperty(e, "enableWarn", {
  5950. get: function () {
  5951. return s.Z.ENABLE_WARN;
  5952. },
  5953. set: function (t) {
  5954. (s.Z.ENABLE_WARN = t), e._notifyChange();
  5955. },
  5956. enumerable: !1,
  5957. configurable: !0,
  5958. }),
  5959. Object.defineProperty(e, "enableError", {
  5960. get: function () {
  5961. return s.Z.ENABLE_ERROR;
  5962. },
  5963. set: function (t) {
  5964. (s.Z.ENABLE_ERROR = t), e._notifyChange();
  5965. },
  5966. enumerable: !1,
  5967. configurable: !0,
  5968. }),
  5969. (e.getConfig = function () {
  5970. return {
  5971. globalTag: s.Z.GLOBAL_TAG,
  5972. forceGlobalTag: s.Z.FORCE_GLOBAL_TAG,
  5973. enableVerbose: s.Z.ENABLE_VERBOSE,
  5974. enableDebug: s.Z.ENABLE_DEBUG,
  5975. enableInfo: s.Z.ENABLE_INFO,
  5976. enableWarn: s.Z.ENABLE_WARN,
  5977. enableError: s.Z.ENABLE_ERROR,
  5978. enableCallback: s.Z.ENABLE_CALLBACK,
  5979. };
  5980. }),
  5981. (e.applyConfig = function (e) {
  5982. (s.Z.GLOBAL_TAG = e.globalTag),
  5983. (s.Z.FORCE_GLOBAL_TAG = e.forceGlobalTag),
  5984. (s.Z.ENABLE_VERBOSE = e.enableVerbose),
  5985. (s.Z.ENABLE_DEBUG = e.enableDebug),
  5986. (s.Z.ENABLE_INFO = e.enableInfo),
  5987. (s.Z.ENABLE_WARN = e.enableWarn),
  5988. (s.Z.ENABLE_ERROR = e.enableError),
  5989. (s.Z.ENABLE_CALLBACK = e.enableCallback);
  5990. }),
  5991. (e._notifyChange = function () {
  5992. var t = e.emitter;
  5993. if (t.listenerCount("change") > 0) {
  5994. var i = e.getConfig();
  5995. t.emit("change", i);
  5996. }
  5997. }),
  5998. (e.registerListener = function (t) {
  5999. e.emitter.addListener("change", t);
  6000. }),
  6001. (e.removeListener = function (t) {
  6002. e.emitter.removeListener("change", t);
  6003. }),
  6004. (e.addLogListener = function (t) {
  6005. s.Z.emitter.addListener("log", t), s.Z.emitter.listenerCount("log") > 0 && ((s.Z.ENABLE_CALLBACK = !0), e._notifyChange());
  6006. }),
  6007. (e.removeLogListener = function (t) {
  6008. s.Z.emitter.removeListener("log", t), 0 === s.Z.emitter.listenerCount("log") && ((s.Z.ENABLE_CALLBACK = !1), e._notifyChange());
  6009. }),
  6010. e
  6011. );
  6012. })();
  6013. (o.emitter = new (r())()), (t.Z = o);
  6014. },
  6015. 219: function (e, t, i) {
  6016. "use strict";
  6017. var n = (function () {
  6018. function e() {}
  6019. return (
  6020. (e.install = function () {
  6021. (Object.setPrototypeOf =
  6022. Object.setPrototypeOf ||
  6023. function (e, t) {
  6024. return (e.__proto__ = t), e;
  6025. }),
  6026. (Object.assign =
  6027. Object.assign ||
  6028. function (e) {
  6029. if (null == e) throw new TypeError("Cannot convert undefined or null to object");
  6030. for (var t = Object(e), i = 1; i < arguments.length; i++) {
  6031. var n = arguments[i];
  6032. if (null != n) for (var r in n) n.hasOwnProperty(r) && (t[r] = n[r]);
  6033. }
  6034. return t;
  6035. }),
  6036. "function" != typeof self.Promise && i(264).polyfill();
  6037. }),
  6038. e
  6039. );
  6040. })();
  6041. n.install(), (t.Z = n);
  6042. },
  6043. },
  6044. t = {};
  6045. function i(n) {
  6046. var r = t[n];
  6047. if (void 0 !== r) return r.exports;
  6048. var s = (t[n] = { exports: {} });
  6049. return e[n].call(s.exports, s, s.exports, i), s.exports;
  6050. }
  6051. return (
  6052. (i.m = e),
  6053. (i.n = function (e) {
  6054. var t =
  6055. e && e.__esModule
  6056. ? function () {
  6057. return e.default;
  6058. }
  6059. : function () {
  6060. return e;
  6061. };
  6062. return i.d(t, { a: t }), t;
  6063. }),
  6064. (i.d = function (e, t) {
  6065. for (var n in t) i.o(t, n) && !i.o(e, n) && Object.defineProperty(e, n, { enumerable: !0, get: t[n] });
  6066. }),
  6067. (i.g = (function () {
  6068. if ("object" == typeof globalThis) return globalThis;
  6069. try {
  6070. return this || new Function("return this")();
  6071. } catch (e) {
  6072. if ("object" == typeof window) return window;
  6073. }
  6074. })()),
  6075. (i.o = function (e, t) {
  6076. return Object.prototype.hasOwnProperty.call(e, t);
  6077. }),
  6078. i(324)
  6079. );
  6080. })();
  6081. });
  6082. //# sourceMappingURL=flv.min.js.map