· 6 years ago · Sep 15, 2019, 11:12 PM
1(function(t) {
2 var e = {};
3 function n(i) {
4 if (e[i])
5 return e[i].exports;
6 var r = e[i] = {
7 i: i,
8 l: !1,
9 exports: {}
10 };
11 return t[i].call(r.exports, r, r.exports, n),
12 r.l = !0,
13 r.exports
14 }
15 n.m = t,
16 n.c = e,
17 n.i = function(t) {
18 return t
19 }
20 ,
21 n.d = function(t, e, i) {
22 n.o(t, e) || Object.defineProperty(t, e, {
23 configurable: !1,
24 enumerable: !0,
25 get: i
26 })
27 }
28 ,
29 n.n = function(t) {
30 var e = t && t.__esModule ? function() {
31 return t.default
32 }
33 : function() {
34 return t
35 }
36 ;
37 return n.d(e, "a", e),
38 e
39 }
40 ,
41 n.o = function(t, e) {
42 return Object.prototype.hasOwnProperty.call(t, e)
43 }
44 ,
45 n.p = "/",
46 n.oe = function(t) {
47 throw console.error(t),
48 t
49 }
50 ;
51 var i = n(n.s = 10);
52 return i.default || i
53}
54)({
55 10: function(t, e, n) {
56 "use strict";
57 Object.defineProperty(e, "__esModule", {
58 value: !0
59 });
60 var i = n(7)
61 , r = n(1)
62 , o = n(0)
63 , a = n(5)
64 , s = n.n(a);
65 e.default = function(t) {
66 var e = new s.a;
67 e.trigger = function(t) {
68 for (var n = arguments.length, i = Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++)
69 i[r - 1] = arguments[r];
70 e.emit.apply(e, [t, t].concat(i))
71 }
72 ,
73 e.off = function(t) {
74 for (var n = arguments.length, i = Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++)
75 i[r - 1] = arguments[r];
76 e.removeListener.apply(e, [t].concat(i))
77 }
78 ;
79 var n = function(e, n) {
80 t.postMessage({
81 event: e,
82 data: n
83 })
84 };
85 t.addEventListener("message", function(r) {
86 var a = r.data;
87 switch (a.cmd) {
88 case "init":
89 var s = JSON.parse(a.config);
90 t.demuxer = new i.a(e,a.typeSupported,s,a.vendor);
91 try {
92 Object(o.a)(!0 === s.debug)
93 } catch (t) {
94 console.warn("demuxerWorker: unable to enable logs")
95 }
96 n("init", null);
97 break;
98 case "demux":
99 t.demuxer.push(a.data, a.decryptdata, a.initSegment, a.audioCodec, a.videoCodec, a.timeOffset, a.discontinuity, a.trackSwitch, a.contiguous, a.duration, a.accurateTimeOffset, a.defaultInitPTS)
100 }
101 }),
102 e.on(r.a.FRAG_DECRYPTED, n),
103 e.on(r.a.FRAG_PARSING_INIT_SEGMENT, n),
104 e.on(r.a.FRAG_PARSED, n),
105 e.on(r.a.ERROR, n),
106 e.on(r.a.FRAG_PARSING_METADATA, n),
107 e.on(r.a.FRAG_PARSING_USERDATA, n),
108 e.on(r.a.INIT_PTS_FOUND, n),
109 e.on(r.a.FRAG_PARSING_DATA, function(e, n) {
110 var i = []
111 , r = {
112 event: e,
113 data: n
114 };
115 n.data1 && (r.data1 = n.data1.buffer,
116 i.push(n.data1.buffer),
117 delete n.data1),
118 n.data2 && (r.data2 = n.data2.buffer,
119 i.push(n.data2.buffer),
120 delete n.data2),
121 t.postMessage(r, i)
122 })
123 }
124 },
125 "5": function(t, e) {
126 function n() {
127 this._events = this._events || {},
128 this._maxListeners = this._maxListeners || void 0
129 }
130 function i(t) {
131 return "function" == typeof t
132 }
133 function r(t) {
134 return "object" == typeof t && null !== t
135 }
136 function o(t) {
137 return void 0 === t
138 }
139 t.exports = n,
140 n.EventEmitter = n,
141 n.prototype._events = void 0,
142 n.prototype._maxListeners = void 0,
143 n.defaultMaxListeners = 10,
144 n.prototype.setMaxListeners = function(t) {
145 if (!function(t) {
146 return "number" == typeof t
147 }(t) || t < 0 || isNaN(t))
148 throw TypeError("n must be a positive number");
149 return this._maxListeners = t,
150 this
151 }
152 ,
153 n.prototype.emit = function(t) {
154 var e, n, a, s, l, u;
155 if (this._events || (this._events = {}),
156 "error" === t && (!this._events.error || r(this._events.error) && !this._events.error.length)) {
157 if ((e = arguments[1])instanceof Error)
158 throw e;
159 var c = new Error('Uncaught, unspecified "error" event. (' + e + ")");
160 throw c.context = e,
161 c
162 }
163 if (o(n = this._events[t]))
164 return !1;
165 if (i(n))
166 switch (arguments.length) {
167 case 1:
168 n.call(this);
169 break;
170 case 2:
171 n.call(this, arguments[1]);
172 break;
173 case 3:
174 n.call(this, arguments[1], arguments[2]);
175 break;
176 default:
177 s = Array.prototype.slice.call(arguments, 1),
178 n.apply(this, s)
179 }
180 else if (r(n))
181 for (s = Array.prototype.slice.call(arguments, 1),
182 a = (u = n.slice()).length,
183 l = 0; l < a; l++)
184 u[l].apply(this, s);
185 return !0
186 }
187 ,
188 n.prototype.addListener = function(t, e) {
189 var a;
190 if (!i(e))
191 throw TypeError("listener must be a function");
192 return this._events || (this._events = {}),
193 this._events.newListener && this.emit("newListener", t, i(e.listener) ? e.listener : e),
194 this._events[t] ? r(this._events[t]) ? this._events[t].push(e) : this._events[t] = [this._events[t], e] : this._events[t] = e,
195 r(this._events[t]) && !this._events[t].warned && (a = o(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && a > 0 && this._events[t].length > a && (this._events[t].warned = !0,
196 console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[t].length),
197 "function" == typeof console.trace && console.trace()),
198 this
199 }
200 ,
201 n.prototype.on = n.prototype.addListener,
202 n.prototype.once = function(t, e) {
203 if (!i(e))
204 throw TypeError("listener must be a function");
205 var n = !1;
206 function r() {
207 this.removeListener(t, r),
208 n || (n = !0,
209 e.apply(this, arguments))
210 }
211 return r.listener = e,
212 this.on(t, r),
213 this
214 }
215 ,
216 n.prototype.removeListener = function(t, e) {
217 var n, o, a, s;
218 if (!i(e))
219 throw TypeError("listener must be a function");
220 if (!this._events || !this._events[t])
221 return this;
222 if (a = (n = this._events[t]).length,
223 o = -1,
224 n === e || i(n.listener) && n.listener === e)
225 delete this._events[t],
226 this._events.removeListener && this.emit("removeListener", t, e);
227 else if (r(n)) {
228 for (s = a; s-- > 0; )
229 if (n[s] === e || n[s].listener && n[s].listener === e) {
230 o = s;
231 break
232 }
233 if (o < 0)
234 return this;
235 1 === n.length ? (n.length = 0,
236 delete this._events[t]) : n.splice(o, 1),
237 this._events.removeListener && this.emit("removeListener", t, e)
238 }
239 return this
240 }
241 ,
242 n.prototype.removeAllListeners = function(t) {
243 var e, n;
244 if (!this._events)
245 return this;
246 if (!this._events.removeListener)
247 return 0 === arguments.length ? this._events = {} : this._events[t] && delete this._events[t],
248 this;
249 if (0 === arguments.length) {
250 for (e in this._events)
251 "removeListener" !== e && this.removeAllListeners(e);
252 return this.removeAllListeners("removeListener"),
253 this._events = {},
254 this
255 }
256 if (i(n = this._events[t]))
257 this.removeListener(t, n);
258 else if (n)
259 for (; n.length; )
260 this.removeListener(t, n[n.length - 1]);
261 return delete this._events[t],
262 this
263 }
264 ,
265 n.prototype.listeners = function(t) {
266 return this._events && this._events[t] ? i(this._events[t]) ? [this._events[t]] : this._events[t].slice() : []
267 }
268 ,
269 n.prototype.listenerCount = function(t) {
270 if (this._events) {
271 var e = this._events[t];
272 if (i(e))
273 return 1;
274 if (e)
275 return e.length
276 }
277 return 0
278 }
279 ,
280 n.listenerCount = function(t, e) {
281 return t.listenerCount(e)
282 }
283 },
284 "0": function(t, e, n) {
285 "use strict";
286 n.d(e, "a", function() {
287 return l
288 }),
289 n.d(e, "b", function() {
290 return u
291 });
292 var i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
293 return typeof t
294 }
295 : function(t) {
296 return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
297 }
298 ;
299 function r() {}
300 var o = {
301 trace: r,
302 debug: r,
303 log: r,
304 warn: r,
305 info: r,
306 error: r
307 }
308 , a = o;
309 function s(t) {
310 for (var e = arguments.length, n = Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
311 n[i - 1] = arguments[i];
312 n.forEach(function(e) {
313 a[e] = t[e] ? t[e].bind(t) : function(t) {
314 var e = self.console[t];
315 return e ? function() {
316 for (var n = arguments.length, i = Array(n), r = 0; r < n; r++)
317 i[r] = arguments[r];
318 i[0] && (i[0] = function(t, e) {
319 return e = "[" + t + "] > " + e
320 }(t, i[0])),
321 e.apply(self.console, i)
322 }
323 : r
324 }(e)
325 })
326 }
327 var l = function(t) {
328 if (!0 === t || "object" === (void 0 === t ? "undefined" : i(t))) {
329 s(t, "debug", "log", "info", "warn", "error");
330 try {
331 a.log()
332 } catch (t) {
333 a = o
334 }
335 } else
336 a = o
337 }
338 , u = o
339 },
340 "1": function(t, e, n) {
341 "use strict";
342 e.a = {
343 MEDIA_ATTACHING: "hlsMediaAttaching",
344 MEDIA_ATTACHED: "hlsMediaAttached",
345 MEDIA_DETACHING: "hlsMediaDetaching",
346 MEDIA_DETACHED: "hlsMediaDetached",
347 BUFFER_RESET: "hlsBufferReset",
348 BUFFER_CODECS: "hlsBufferCodecs",
349 BUFFER_CREATED: "hlsBufferCreated",
350 BUFFER_APPENDING: "hlsBufferAppending",
351 BUFFER_APPENDED: "hlsBufferAppended",
352 BUFFER_EOS: "hlsBufferEos",
353 BUFFER_FLUSHING: "hlsBufferFlushing",
354 BUFFER_FLUSHED: "hlsBufferFlushed",
355 MANIFEST_LOADING: "hlsManifestLoading",
356 MANIFEST_LOADED: "hlsManifestLoaded",
357 MANIFEST_PARSED: "hlsManifestParsed",
358 LEVEL_SWITCH: "hlsLevelSwitch",
359 LEVEL_SWITCHING: "hlsLevelSwitching",
360 LEVEL_SWITCHED: "hlsLevelSwitched",
361 LEVEL_LOADING: "hlsLevelLoading",
362 LEVEL_LOADED: "hlsLevelLoaded",
363 LEVEL_UPDATED: "hlsLevelUpdated",
364 LEVEL_PTS_UPDATED: "hlsLevelPtsUpdated",
365 AUDIO_TRACKS_UPDATED: "hlsAudioTracksUpdated",
366 AUDIO_TRACK_SWITCH: "hlsAudioTrackSwitch",
367 AUDIO_TRACK_SWITCHING: "hlsAudioTrackSwitching",
368 AUDIO_TRACK_SWITCHED: "hlsAudioTrackSwitched",
369 AUDIO_TRACK_LOADING: "hlsAudioTrackLoading",
370 AUDIO_TRACK_LOADED: "hlsAudioTrackLoaded",
371 SUBTITLE_TRACKS_UPDATED: "hlsSubtitleTracksUpdated",
372 SUBTITLE_TRACK_SWITCH: "hlsSubtitleTrackSwitch",
373 SUBTITLE_TRACK_LOADING: "hlsSubtitleTrackLoading",
374 SUBTITLE_TRACK_LOADED: "hlsSubtitleTrackLoaded",
375 SUBTITLE_FRAG_PROCESSED: "hlsSubtitleFragProcessed",
376 INIT_PTS_FOUND: "hlsInitPtsFound",
377 FRAG_LOADING: "hlsFragLoading",
378 FRAG_LOAD_PROGRESS: "hlsFragLoadProgress",
379 FRAG_LOAD_EMERGENCY_ABORTED: "hlsFragLoadEmergencyAborted",
380 FRAG_LOADED: "hlsFragLoaded",
381 FRAG_DECRYPTED: "hlsFragDecrypted",
382 FRAG_PARSING_INIT_SEGMENT: "hlsFragParsingInitSegment",
383 FRAG_PARSING_USERDATA: "hlsFragParsingUserdata",
384 FRAG_PARSING_METADATA: "hlsFragParsingMetadata",
385 FRAG_PARSING_DATA: "hlsFragParsingData",
386 FRAG_PARSED: "hlsFragParsed",
387 FRAG_BUFFERED: "hlsFragBuffered",
388 FRAG_CHANGED: "hlsFragChanged",
389 FPS_DROP: "hlsFpsDrop",
390 FPS_DROP_LEVEL_CAPPING: "hlsFpsDropLevelCapping",
391 ERROR: "hlsError",
392 DESTROYING: "hlsDestroying",
393 KEY_LOADING: "hlsKeyLoading",
394 KEY_LOADED: "hlsKeyLoaded",
395 STREAM_STATE_TRANSITION: "hlsStreamStateTransition"
396 }
397 },
398 "7": function(t, e, n) {
399 "use strict";
400 var i = n(1)
401 , r = n(2)
402 , o = n(4)
403 , a = n(0);
404 function s(t, e) {
405 return 255 === t[e] && 240 == (246 & t[e + 1])
406 }
407 function l(t, e) {
408 return 1 & t[e + 1] ? 7 : 9
409 }
410 function u(t, e) {
411 return (3 & t[e + 3]) << 11 | t[e + 4] << 3 | (224 & t[e + 5]) >>> 5
412 }
413 function c(t, e) {
414 return !!(e + 1 < t.length && s(t, e))
415 }
416 function d(t, e) {
417 if (e + 1 < t.length && s(t, e)) {
418 var n = l(t, e);
419 e + 5 < t.length && (n = u(t, e));
420 var i = e + n;
421 if (i === t.length || i + 1 < t.length && s(t, i))
422 return !0
423 }
424 return !1
425 }
426 function h(t, e, n, i, o) {
427 if (!t.samplerate) {
428 var s = function(t, e, n, i) {
429 var o, s, l, u, c, d = navigator.userAgent.toLowerCase(), h = i, p = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
430 if (o = 1 + ((192 & e[n + 2]) >>> 6),
431 !((s = (60 & e[n + 2]) >>> 2) > p.length - 1))
432 return u = (1 & e[n + 2]) << 2,
433 u |= (192 & e[n + 3]) >>> 6,
434 a.b.log("manifest codec:" + i + ",ADTS data:type:" + o + ",sampleingIndex:" + s + "[" + p[s] + "Hz],channelConfig:" + u),
435 /firefox/i.test(d) ? s >= 6 ? (o = 5,
436 c = new Array(4),
437 l = s - 3) : (o = 2,
438 c = new Array(2),
439 l = s) : -1 !== d.indexOf("android") ? (o = 2,
440 c = new Array(2),
441 l = s) : (o = 5,
442 c = new Array(4),
443 i && (-1 !== i.indexOf("mp4a.40.29") || -1 !== i.indexOf("mp4a.40.5")) || !i && s >= 6 ? l = s - 3 : ((i && -1 !== i.indexOf("mp4a.40.2") && (s >= 6 && 1 === u || /vivaldi/i.test(d)) || !i && 1 === u) && (o = 2,
444 c = new Array(2)),
445 l = s)),
446 c[0] = o << 3,
447 c[0] |= (14 & s) >> 1,
448 c[1] |= (1 & s) << 7,
449 c[1] |= u << 3,
450 5 === o && (c[1] |= (14 & l) >> 1,
451 c[2] = (1 & l) << 7,
452 c[2] |= 8,
453 c[3] = 0),
454 {
455 config: c,
456 samplerate: p[s],
457 channelCount: u,
458 codec: "mp4a.40." + o,
459 manifestCodec: h
460 };
461 t.trigger(Event.ERROR, {
462 type: r.b.MEDIA_ERROR,
463 details: r.a.FRAG_PARSING_ERROR,
464 fatal: !0,
465 reason: "invalid ADTS sampling index:" + s
466 })
467 }(e, n, i, o);
468 t.config = s.config,
469 t.samplerate = s.samplerate,
470 t.channelCount = s.channelCount,
471 t.codec = s.codec,
472 t.manifestCodec = s.manifestCodec,
473 a.b.log("parsed codec:" + t.codec + ",rate:" + s.samplerate + ",nb channel:" + s.channelCount)
474 }
475 }
476 function p(t) {
477 return 9216e4 / t
478 }
479 function f(t, e, n, i, r) {
480 var o = function(t, e, n, i, r) {
481 var o, a, s = t.length;
482 if (o = l(t, e),
483 a = u(t, e),
484 (a -= o) > 0 && e + o + a <= s)
485 return {
486 headerLength: o,
487 frameLength: a,
488 stamp: n + i * r
489 }
490 }(e, n, i, r, p(t.samplerate));
491 if (o) {
492 var a = o.stamp
493 , s = o.headerLength
494 , c = o.frameLength
495 , d = {
496 unit: e.subarray(n + s, n + s + c),
497 pts: a,
498 dts: a
499 };
500 return t.samples.push(d),
501 t.len += c,
502 {
503 sample: d,
504 length: c + s
505 }
506 }
507 }
508 var y = n(3);
509 var v = function() {
510 function t(e, n, i) {
511 !function(t, e) {
512 if (!(t instanceof e))
513 throw new TypeError("Cannot call a class as a function")
514 }(this, t),
515 this.observer = e,
516 this.config = i,
517 this.remuxer = n
518 }
519 return t.prototype.resetInitSegment = function(t, e, n, i) {
520 this._audioTrack = {
521 container: "audio/adts",
522 type: "audio",
523 id: 0,
524 sequenceNumber: 0,
525 isAAC: !0,
526 samples: [],
527 len: 0,
528 manifestCodec: e,
529 duration: i,
530 inputTimeScale: 9e4
531 }
532 }
533 ,
534 t.prototype.resetTimeStamp = function() {}
535 ,
536 t.probe = function(t) {
537 if (!t)
538 return !1;
539 for (var e = (y.a.getID3Data(t, 0) || []).length, n = t.length; e < n; e++)
540 if (d(t, e))
541 return a.b.log("ADTS sync word found !"),
542 !0;
543 return !1
544 }
545 ,
546 t.prototype.append = function(t, e, n, i) {
547 for (var r = this._audioTrack, o = y.a.getID3Data(t, 0) || [], s = y.a.getTimeStamp(o), l = s ? 90 * s : 9e4 * e, u = 0, d = l, p = t.length, v = o.length, g = [{
548 pts: d,
549 dts: d,
550 data: o
551 }]; v < p - 1; )
552 if (c(t, v) && v + 5 < p) {
553 h(r, this.observer, t, v, r.manifestCodec);
554 var m = f(r, t, v, l, u);
555 if (!m) {
556 a.b.log("Unable to parse AAC frame");
557 break
558 }
559 v += m.length,
560 d = m.sample.pts,
561 u++
562 } else
563 y.a.isHeader(t, v) ? (o = y.a.getID3Data(t, v),
564 g.push({
565 pts: d,
566 dts: d,
567 data: o
568 }),
569 v += o.length) : v++;
570 this.remuxer.remux(r, {
571 samples: []
572 }, {
573 samples: g,
574 inputTimeScale: 9e4
575 }, {
576 samples: []
577 }, e, n, i)
578 }
579 ,
580 t.prototype.destroy = function() {}
581 ,
582 t
583 }();
584 var g = Math.pow(2, 32) - 1
585 , m = function() {
586 function t(e, n) {
587 !function(t, e) {
588 if (!(t instanceof e))
589 throw new TypeError("Cannot call a class as a function")
590 }(this, t),
591 this.observer = e,
592 this.remuxer = n
593 }
594 return t.prototype.resetTimeStamp = function(t) {
595 this.initPTS = t
596 }
597 ,
598 t.prototype.resetInitSegment = function(e, n, r, o) {
599 if (e && e.byteLength) {
600 var a = this.initData = t.parseInitSegment(e);
601 null == n && (n = "mp4a.40.5"),
602 null == r && (r = "avc1.42e01e");
603 var s = {};
604 a.audio && a.video ? s.audiovideo = {
605 container: "video/mp4",
606 codec: n + "," + r,
607 initSegment: o ? e : null
608 } : (a.audio && (s.audio = {
609 container: "audio/mp4",
610 codec: n,
611 initSegment: o ? e : null
612 }),
613 a.video && (s.video = {
614 container: "video/mp4",
615 codec: r,
616 initSegment: o ? e : null
617 })),
618 this.observer.trigger(i.a.FRAG_PARSING_INIT_SEGMENT, {
619 tracks: s
620 })
621 } else
622 n && (this.audioCodec = n),
623 r && (this.videoCodec = r)
624 }
625 ,
626 t.probe = function(e) {
627 return t.findBox({
628 data: e,
629 start: 0,
630 end: Math.min(e.length, 16384)
631 }, ["moof"]).length > 0
632 }
633 ,
634 t.bin2str = function(t) {
635 return String.fromCharCode.apply(null, t)
636 }
637 ,
638 t.readUint32 = function(t, e) {
639 t.data && (e += t.start,
640 t = t.data);
641 var n = t[e] << 24 | t[e + 1] << 16 | t[e + 2] << 8 | t[e + 3];
642 return n < 0 ? 4294967296 + n : n
643 }
644 ,
645 t.writeUint32 = function(t, e, n) {
646 t.data && (e += t.start,
647 t = t.data),
648 t[e] = n >> 24,
649 t[e + 1] = n >> 16 & 255,
650 t[e + 2] = n >> 8 & 255,
651 t[e + 3] = 255 & n
652 }
653 ,
654 t.findBox = function(e, n) {
655 var i, r, o, a, s, l, u, c = [];
656 if (e.data ? (l = e.start,
657 a = e.end,
658 e = e.data) : (l = 0,
659 a = e.byteLength),
660 !n.length)
661 return null;
662 for (i = l; i < a; )
663 r = t.readUint32(e, i),
664 o = t.bin2str(e.subarray(i + 4, i + 8)),
665 u = r > 1 ? i + r : a,
666 o === n[0] && (1 === n.length ? c.push({
667 data: e,
668 start: i + 8,
669 end: u
670 }) : (s = t.findBox({
671 data: e,
672 start: i + 8,
673 end: u
674 }, n.slice(1))).length && (c = c.concat(s))),
675 i = u;
676 return c
677 }
678 ,
679 t.parseInitSegment = function(e) {
680 var n = [];
681 return t.findBox(e, ["moov", "trak"]).forEach(function(e) {
682 var i = t.findBox(e, ["tkhd"])[0];
683 if (i) {
684 var r = i.data[i.start]
685 , o = 0 === r ? 12 : 20
686 , s = t.readUint32(i, o)
687 , l = t.findBox(e, ["mdia", "mdhd"])[0];
688 if (l) {
689 o = 0 === (r = l.data[l.start]) ? 12 : 20;
690 var u = t.readUint32(l, o)
691 , c = t.findBox(e, ["mdia", "hdlr"])[0];
692 if (c) {
693 var d = {
694 soun: "audio",
695 vide: "video"
696 }[t.bin2str(c.data.subarray(c.start + 8, c.start + 12))];
697 if (d) {
698 var h = t.findBox(e, ["mdia", "minf", "stbl", "stsd"]);
699 if (h.length) {
700 h = h[0];
701 var p = t.bin2str(h.data.subarray(h.start + 12, h.start + 16));
702 a.b.log("MP4Demuxer:" + d + ":" + p + " found")
703 }
704 n[s] = {
705 timescale: u,
706 type: d
707 },
708 n[d] = {
709 timescale: u,
710 id: s
711 }
712 }
713 }
714 }
715 }
716 }),
717 n
718 }
719 ,
720 t.getStartDTS = function(e, n) {
721 var i, r, o;
722 return i = t.findBox(n, ["moof", "traf"]),
723 r = [].concat.apply([], i.map(function(n) {
724 return t.findBox(n, ["tfhd"]).map(function(i) {
725 var r, o;
726 return r = t.readUint32(i, 4),
727 o = e[r].timescale || 9e4,
728 t.findBox(n, ["tfdt"]).map(function(e) {
729 var n, i;
730 return n = e.data[e.start],
731 i = t.readUint32(e, 4),
732 1 === n && (i *= Math.pow(2, 32),
733 i += t.readUint32(e, 8)),
734 i
735 })[0] / o
736 })
737 })),
738 o = Math.min.apply(null, r),
739 isFinite(o) ? o : 0
740 }
741 ,
742 t.offsetStartDTS = function(e, n, i) {
743 t.findBox(n, ["moof", "traf"]).map(function(n) {
744 return t.findBox(n, ["tfhd"]).map(function(r) {
745 var o = t.readUint32(r, 4)
746 , a = e[o].timescale || 9e4;
747 t.findBox(n, ["tfdt"]).map(function(e) {
748 var n = e.data[e.start]
749 , r = t.readUint32(e, 4);
750 if (0 === n)
751 t.writeUint32(e, 4, r - i * a);
752 else {
753 r *= Math.pow(2, 32),
754 r += t.readUint32(e, 8),
755 r -= i * a,
756 r = Math.max(r, 0);
757 var o = Math.floor(r / (g + 1))
758 , s = Math.floor(r % (g + 1));
759 t.writeUint32(e, 4, o),
760 t.writeUint32(e, 8, s)
761 }
762 })
763 })
764 })
765 }
766 ,
767 t.prototype.append = function(e, n, r, o) {
768 var a = this.initData;
769 a || (this.resetInitSegment(e, this.audioCodec, this.videoCodec),
770 a = this.initData);
771 var s, l = this.initPTS;
772 if (void 0 === l) {
773 var u = t.getStartDTS(a, e);
774 this.initPTS = l = u - n,
775 this.observer.trigger(i.a.INIT_PTS_FOUND, {
776 initPTS: l
777 })
778 }
779 t.offsetStartDTS(a, e, l),
780 s = t.getStartDTS(a, e),
781 this.remuxer.remux(a.audio, a.video, null, null, s, r, o, e)
782 }
783 ,
784 t.prototype.destroy = function() {}
785 ,
786 t
787 }()
788 , b = {
789 BitratesMap: [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160],
790 SamplingRateMap: [44100, 48e3, 32e3, 22050, 24e3, 16e3, 11025, 12e3, 8e3],
791 SamplesCoefficients: [[0, 72, 144, 12], [0, 0, 0, 0], [0, 72, 144, 12], [0, 144, 144, 12]],
792 BytesInSlot: [0, 1, 1, 4],
793 appendFrame: function(t, e, n, i, r) {
794 if (!(n + 24 > e.length)) {
795 var o = this.parseHeader(e, n);
796 if (o && n + o.frameLength <= e.length) {
797 var a = i + r * (9e4 * o.samplesPerFrame / o.sampleRate)
798 , s = {
799 unit: e.subarray(n, n + o.frameLength),
800 pts: a,
801 dts: a
802 };
803 return t.config = [],
804 t.channelCount = o.channelCount,
805 t.samplerate = o.sampleRate,
806 t.samples.push(s),
807 t.len += o.frameLength,
808 {
809 sample: s,
810 length: o.frameLength
811 }
812 }
813 }
814 },
815 parseHeader: function(t, e) {
816 var n = t[e + 1] >> 3 & 3
817 , i = t[e + 1] >> 1 & 3
818 , r = t[e + 2] >> 4 & 15
819 , o = t[e + 2] >> 2 & 3
820 , a = t[e + 2] >> 1 & 1;
821 if (1 !== n && 0 !== r && 15 !== r && 3 !== o) {
822 var s = 3 === n ? 3 - i : 3 === i ? 3 : 4
823 , l = 1e3 * b.BitratesMap[14 * s + r - 1]
824 , u = 3 === n ? 0 : 2 === n ? 1 : 2
825 , c = b.SamplingRateMap[3 * u + o]
826 , d = t[e + 3] >> 6 == 3 ? 1 : 2
827 , h = b.SamplesCoefficients[n][i]
828 , p = b.BytesInSlot[i]
829 , f = 8 * h * p;
830 return {
831 sampleRate: c,
832 channelCount: d,
833 frameLength: parseInt(h * l / c + a, 10) * p,
834 samplesPerFrame: f
835 }
836 }
837 },
838 isHeaderPattern: function(t, e) {
839 return 255 === t[e] && 224 == (224 & t[e + 1]) && 0 != (6 & t[e + 1])
840 },
841 isHeader: function(t, e) {
842 return !!(e + 1 < t.length && this.isHeaderPattern(t, e))
843 },
844 probe: function(t, e) {
845 if (e + 1 < t.length && this.isHeaderPattern(t, e)) {
846 var n = this.parseHeader(t, e)
847 , i = 4;
848 n && n.frameLength && (i = n.frameLength);
849 var r = e + i;
850 if (r === t.length || r + 1 < t.length && this.isHeaderPattern(t, r))
851 return !0
852 }
853 return !1
854 }
855 }
856 , _ = b;
857 var A = function() {
858 function t(e) {
859 !function(t, e) {
860 if (!(t instanceof e))
861 throw new TypeError("Cannot call a class as a function")
862 }(this, t),
863 this.data = e,
864 this.bytesAvailable = e.byteLength,
865 this.word = 0,
866 this.bitsAvailable = 0
867 }
868 return t.prototype.loadWord = function() {
869 var t = this.data
870 , e = this.bytesAvailable
871 , n = t.byteLength - e
872 , i = new Uint8Array(4)
873 , r = Math.min(4, e);
874 if (0 === r)
875 throw new Error("no bytes available");
876 i.set(t.subarray(n, n + r)),
877 this.word = new DataView(i.buffer).getUint32(0),
878 this.bitsAvailable = 8 * r,
879 this.bytesAvailable -= r
880 }
881 ,
882 t.prototype.skipBits = function(t) {
883 var e;
884 this.bitsAvailable > t ? (this.word <<= t,
885 this.bitsAvailable -= t) : (t -= this.bitsAvailable,
886 t -= (e = t >> 3) >> 3,
887 this.bytesAvailable -= e,
888 this.loadWord(),
889 this.word <<= t,
890 this.bitsAvailable -= t)
891 }
892 ,
893 t.prototype.readBits = function(t) {
894 var e = Math.min(this.bitsAvailable, t)
895 , n = this.word >>> 32 - e;
896 return t > 32 && a.b.error("Cannot read more than 32 bits at a time"),
897 this.bitsAvailable -= e,
898 this.bitsAvailable > 0 ? this.word <<= e : this.bytesAvailable > 0 && this.loadWord(),
899 (e = t - e) > 0 && this.bitsAvailable ? n << e | this.readBits(e) : n
900 }
901 ,
902 t.prototype.skipLZ = function() {
903 var t;
904 for (t = 0; t < this.bitsAvailable; ++t)
905 if (0 != (this.word & 2147483648 >>> t))
906 return this.word <<= t,
907 this.bitsAvailable -= t,
908 t;
909 return this.loadWord(),
910 t + this.skipLZ()
911 }
912 ,
913 t.prototype.skipUEG = function() {
914 this.skipBits(1 + this.skipLZ())
915 }
916 ,
917 t.prototype.skipEG = function() {
918 this.skipBits(1 + this.skipLZ())
919 }
920 ,
921 t.prototype.readUEG = function() {
922 var t = this.skipLZ();
923 return this.readBits(t + 1) - 1
924 }
925 ,
926 t.prototype.readEG = function() {
927 var t = this.readUEG();
928 return 1 & t ? 1 + t >>> 1 : -1 * (t >>> 1)
929 }
930 ,
931 t.prototype.readBoolean = function() {
932 return 1 === this.readBits(1)
933 }
934 ,
935 t.prototype.readUByte = function() {
936 return this.readBits(8)
937 }
938 ,
939 t.prototype.readUShort = function() {
940 return this.readBits(16)
941 }
942 ,
943 t.prototype.readUInt = function() {
944 return this.readBits(32)
945 }
946 ,
947 t.prototype.skipScalingList = function(t) {
948 var e, n = 8, i = 8;
949 for (e = 0; e < t; e++)
950 0 !== i && (i = (n + this.readEG() + 256) % 256),
951 n = 0 === i ? n : i
952 }
953 ,
954 t.prototype.readSPS = function() {
955 var t, e, n, i, r, o, a, s = 0, l = 0, u = 0, c = 0, d = this.readUByte.bind(this), h = this.readBits.bind(this), p = this.readUEG.bind(this), f = this.readBoolean.bind(this), y = this.skipBits.bind(this), v = this.skipEG.bind(this), g = this.skipUEG.bind(this), m = this.skipScalingList.bind(this);
956 if (d(),
957 t = d(),
958 h(5),
959 y(3),
960 d(),
961 g(),
962 100 === t || 110 === t || 122 === t || 244 === t || 44 === t || 83 === t || 86 === t || 118 === t || 128 === t) {
963 var b = p();
964 if (3 === b && y(1),
965 g(),
966 g(),
967 y(1),
968 f())
969 for (o = 3 !== b ? 8 : 12,
970 a = 0; a < o; a++)
971 f() && m(a < 6 ? 16 : 64)
972 }
973 g();
974 var _ = p();
975 if (0 === _)
976 p();
977 else if (1 === _)
978 for (y(1),
979 v(),
980 v(),
981 e = p(),
982 a = 0; a < e; a++)
983 v();
984 g(),
985 y(1),
986 n = p(),
987 i = p(),
988 0 === (r = h(1)) && y(1),
989 y(1),
990 f() && (s = p(),
991 l = p(),
992 u = p(),
993 c = p());
994 var A = [1, 1];
995 if (f() && f())
996 switch (d()) {
997 case 1:
998 A = [1, 1];
999 break;
1000 case 2:
1001 A = [12, 11];
1002 break;
1003 case 3:
1004 A = [10, 11];
1005 break;
1006 case 4:
1007 A = [16, 11];
1008 break;
1009 case 5:
1010 A = [40, 33];
1011 break;
1012 case 6:
1013 A = [24, 11];
1014 break;
1015 case 7:
1016 A = [20, 11];
1017 break;
1018 case 8:
1019 A = [32, 11];
1020 break;
1021 case 9:
1022 A = [80, 33];
1023 break;
1024 case 10:
1025 A = [18, 11];
1026 break;
1027 case 11:
1028 A = [15, 11];
1029 break;
1030 case 12:
1031 A = [64, 33];
1032 break;
1033 case 13:
1034 A = [160, 99];
1035 break;
1036 case 14:
1037 A = [4, 3];
1038 break;
1039 case 15:
1040 A = [3, 2];
1041 break;
1042 case 16:
1043 A = [2, 1];
1044 break;
1045 case 255:
1046 A = [d() << 8 | d(), d() << 8 | d()]
1047 }
1048 return {
1049 width: Math.ceil(16 * (n + 1) - 2 * s - 2 * l),
1050 height: (2 - r) * (i + 1) * 16 - (r ? 2 : 4) * (u + c),
1051 pixelRatio: A
1052 }
1053 }
1054 ,
1055 t.prototype.readSliceType = function() {
1056 return this.readUByte(),
1057 this.readUEG(),
1058 this.readUEG()
1059 }
1060 ,
1061 t
1062 }();
1063 var E = function() {
1064 function t(e, n, i, r) {
1065 !function(t, e) {
1066 if (!(t instanceof e))
1067 throw new TypeError("Cannot call a class as a function")
1068 }(this, t),
1069 this.decryptdata = i,
1070 this.discardEPB = r,
1071 this.decrypter = new o.a(e,n)
1072 }
1073 return t.prototype.decryptBuffer = function(t, e) {
1074 this.decrypter.decrypt(t, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, e)
1075 }
1076 ,
1077 t.prototype.decryptAacSample = function(t, e, n, i) {
1078 var r = t[e].unit
1079 , o = r.subarray(16, r.length - r.length % 16)
1080 , a = o.buffer.slice(o.byteOffset, o.byteOffset + o.length)
1081 , s = this;
1082 this.decryptBuffer(a, function(o) {
1083 o = new Uint8Array(o),
1084 r.set(o, 16),
1085 i || s.decryptAacSamples(t, e + 1, n)
1086 })
1087 }
1088 ,
1089 t.prototype.decryptAacSamples = function(t, e, n) {
1090 for (; ; e++) {
1091 if (e >= t.length)
1092 return void n();
1093 if (!(t[e].unit.length < 32)) {
1094 var i = this.decrypter.isSync();
1095 if (this.decryptAacSample(t, e, n, i),
1096 !i)
1097 return
1098 }
1099 }
1100 }
1101 ,
1102 t.prototype.getAvcEncryptedData = function(t) {
1103 for (var e = 16 * Math.floor((t.length - 48) / 160) + 16, n = new Int8Array(e), i = 0, r = 32; r <= t.length - 16; r += 160,
1104 i += 16)
1105 n.set(t.subarray(r, r + 16), i);
1106 return n
1107 }
1108 ,
1109 t.prototype.getAvcDecryptedUnit = function(t, e) {
1110 e = new Uint8Array(e);
1111 for (var n = 0, i = 32; i <= t.length - 16; i += 160,
1112 n += 16)
1113 t.set(e.subarray(n, n + 16), i);
1114 return t
1115 }
1116 ,
1117 t.prototype.decryptAvcSample = function(t, e, n, i, r, o) {
1118 var a = this.discardEPB(r.data)
1119 , s = this.getAvcEncryptedData(a)
1120 , l = this;
1121 this.decryptBuffer(s.buffer, function(s) {
1122 r.data = l.getAvcDecryptedUnit(a, s),
1123 o || l.decryptAvcSamples(t, e, n + 1, i)
1124 })
1125 }
1126 ,
1127 t.prototype.decryptAvcSamples = function(t, e, n, i) {
1128 for (; ; e++,
1129 n = 0) {
1130 if (e >= t.length)
1131 return void i();
1132 for (var r = t[e].units; !(n >= r.length); n++) {
1133 var o = r[n];
1134 if (!(o.length <= 48 || 1 !== o.type && 5 !== o.type)) {
1135 var a = this.decrypter.isSync();
1136 if (this.decryptAvcSample(t, e, n, i, o, a),
1137 !a)
1138 return
1139 }
1140 }
1141 }
1142 }
1143 ,
1144 t
1145 }();
1146 var k = {
1147 video: 0,
1148 audio: 1,
1149 id3: 2,
1150 text: 3
1151 }
1152 , T = function() {
1153 function t(e, n, i, r) {
1154 !function(t, e) {
1155 if (!(t instanceof e))
1156 throw new TypeError("Cannot call a class as a function")
1157 }(this, t),
1158 this.observer = e,
1159 this.config = i,
1160 this.typeSupported = r,
1161 this.remuxer = n,
1162 this.sampleAes = null
1163 }
1164 return t.prototype.setDecryptData = function(t) {
1165 null != t && null != t.key && "SAMPLE-AES" === t.method ? this.sampleAes = new E(this.observer,this.config,t,this.discardEPB) : this.sampleAes = null
1166 }
1167 ,
1168 t.probe = function(e) {
1169 var n = t._syncOffset(e);
1170 return !(n < 0) && (n && a.b.warn("MPEG2-TS detected but first sync word found @ offset " + n + ", junk ahead ?"),
1171 !0)
1172 }
1173 ,
1174 t._syncOffset = function(t) {
1175 for (var e = Math.min(1e3, t.length - 564), n = 0; n < e; ) {
1176 if (71 === t[n] && 71 === t[n + 188] && 71 === t[n + 376])
1177 return n;
1178 n++
1179 }
1180 return -1
1181 }
1182 ,
1183 t.createTrack = function(t, e) {
1184 return {
1185 container: "video" === t || "audio" === t ? "video/mp2t" : void 0,
1186 type: t,
1187 id: k[t],
1188 pid: -1,
1189 inputTimeScale: 9e4,
1190 sequenceNumber: 0,
1191 samples: [],
1192 len: 0,
1193 dropped: "video" === t ? 0 : void 0,
1194 isAAC: "audio" === t || void 0,
1195 duration: "audio" === t ? e : void 0
1196 }
1197 }
1198 ,
1199 t.prototype.resetInitSegment = function(e, n, i, r) {
1200 this.pmtParsed = !1,
1201 this._pmtId = -1,
1202 this._avcTrack = t.createTrack("video", r),
1203 this._audioTrack = t.createTrack("audio", r),
1204 this._id3Track = t.createTrack("id3", r),
1205 this._txtTrack = t.createTrack("text", r),
1206 this.aacOverFlow = null,
1207 this.aacLastPTS = null,
1208 this.avcSample = null,
1209 this.audioCodec = n,
1210 this.videoCodec = i,
1211 this._duration = r
1212 }
1213 ,
1214 t.prototype.resetTimeStamp = function() {}
1215 ,
1216 t.prototype.append = function(e, n, o, s) {
1217 var l, u, c, d, h, p = e.length, f = !1;
1218 this.contiguous = o;
1219 var y = this.pmtParsed
1220 , v = this._avcTrack
1221 , g = this._audioTrack
1222 , m = this._id3Track
1223 , b = v.pid
1224 , _ = g.pid
1225 , A = m.pid
1226 , E = this._pmtId
1227 , k = v.pesData
1228 , T = g.pesData
1229 , w = m.pesData
1230 , S = this._parsePAT
1231 , C = this._parsePMT
1232 , O = this._parsePES
1233 , P = this._parseAVCPES.bind(this)
1234 , R = this._parseAACPES.bind(this)
1235 , I = this._parseMPEGPES.bind(this)
1236 , L = this._parseID3PES.bind(this)
1237 , D = t._syncOffset(e);
1238 for (p -= (p + D) % 188,
1239 l = D; l < p; l += 188)
1240 if (71 === e[l]) {
1241 if (u = !!(64 & e[l + 1]),
1242 c = ((31 & e[l + 1]) << 8) + e[l + 2],
1243 (48 & e[l + 3]) >> 4 > 1) {
1244 if ((d = l + 5 + e[l + 4]) === l + 188)
1245 continue
1246 } else
1247 d = l + 4;
1248 switch (c) {
1249 case b:
1250 u && (k && (h = O(k)) && P(h, !1),
1251 k = {
1252 data: [],
1253 size: 0
1254 }),
1255 k && (k.data.push(e.subarray(d, l + 188)),
1256 k.size += l + 188 - d);
1257 break;
1258 case _:
1259 u && (T && (h = O(T)) && (g.isAAC ? R(h) : I(h)),
1260 T = {
1261 data: [],
1262 size: 0
1263 }),
1264 T && (T.data.push(e.subarray(d, l + 188)),
1265 T.size += l + 188 - d);
1266 break;
1267 case A:
1268 u && (w && (h = O(w)) && L(h),
1269 w = {
1270 data: [],
1271 size: 0
1272 }),
1273 w && (w.data.push(e.subarray(d, l + 188)),
1274 w.size += l + 188 - d);
1275 break;
1276 case 0:
1277 u && (d += e[d] + 1),
1278 E = this._pmtId = S(e, d);
1279 break;
1280 case E:
1281 u && (d += e[d] + 1);
1282 var x = C(e, d, !0 === this.typeSupported.mpeg || !0 === this.typeSupported.mp3, null != this.sampleAes);
1283 (b = x.avc) > 0 && (v.pid = b),
1284 (_ = x.audio) > 0 && (g.pid = _,
1285 g.isAAC = x.isAAC),
1286 (A = x.id3) > 0 && (m.pid = A),
1287 f && !y && (a.b.log("reparse from beginning"),
1288 f = !1,
1289 l = D - 188),
1290 y = this.pmtParsed = !0;
1291 break;
1292 case 17:
1293 case 8191:
1294 break;
1295 default:
1296 f = !0
1297 }
1298 } else
1299 this.observer.trigger(i.a.ERROR, {
1300 type: r.b.MEDIA_ERROR,
1301 details: r.a.FRAG_PARSING_ERROR,
1302 fatal: !1,
1303 reason: "TS packet did not start with 0x47"
1304 });
1305 k && (h = O(k)) ? (P(h, !0),
1306 v.pesData = null) : v.pesData = k,
1307 T && (h = O(T)) ? (g.isAAC ? R(h) : I(h),
1308 g.pesData = null) : (T && T.size && a.b.log("last AAC PES packet truncated,might overlap between fragments"),
1309 g.pesData = T),
1310 w && (h = O(w)) ? (L(h),
1311 m.pesData = null) : m.pesData = w,
1312 null == this.sampleAes ? this.remuxer.remux(g, v, m, this._txtTrack, n, o, s) : this.decryptAndRemux(g, v, m, this._txtTrack, n, o, s)
1313 }
1314 ,
1315 t.prototype.decryptAndRemux = function(t, e, n, i, r, o, a) {
1316 if (t.samples && t.isAAC) {
1317 var s = this;
1318 this.sampleAes.decryptAacSamples(t.samples, 0, function() {
1319 s.decryptAndRemuxAvc(t, e, n, i, r, o, a)
1320 })
1321 } else
1322 this.decryptAndRemuxAvc(t, e, n, i, r, o, a)
1323 }
1324 ,
1325 t.prototype.decryptAndRemuxAvc = function(t, e, n, i, r, o, a) {
1326 if (e.samples) {
1327 var s = this;
1328 this.sampleAes.decryptAvcSamples(e.samples, 0, 0, function() {
1329 s.remuxer.remux(t, e, n, i, r, o, a)
1330 })
1331 } else
1332 this.remuxer.remux(t, e, n, i, r, o, a)
1333 }
1334 ,
1335 t.prototype.destroy = function() {
1336 this._initPTS = this._initDTS = void 0,
1337 this._duration = 0
1338 }
1339 ,
1340 t.prototype._parsePAT = function(t, e) {
1341 return (31 & t[e + 10]) << 8 | t[e + 11]
1342 }
1343 ,
1344 t.prototype._parsePMT = function(t, e, n, i) {
1345 var r, o, s = {
1346 audio: -1,
1347 avc: -1,
1348 id3: -1,
1349 isAAC: !0
1350 };
1351 for (r = e + 3 + ((15 & t[e + 1]) << 8 | t[e + 2]) - 4,
1352 e += 12 + ((15 & t[e + 10]) << 8 | t[e + 11]); e < r; ) {
1353 switch (o = (31 & t[e + 1]) << 8 | t[e + 2],
1354 t[e]) {
1355 case 207:
1356 if (!i) {
1357 a.b.log("unkown stream type:" + t[e]);
1358 break
1359 }
1360 case 15:
1361 -1 === s.audio && (s.audio = o);
1362 break;
1363 case 21:
1364 -1 === s.id3 && (s.id3 = o);
1365 break;
1366 case 219:
1367 if (!i) {
1368 a.b.log("unkown stream type:" + t[e]);
1369 break
1370 }
1371 case 27:
1372 -1 === s.avc && (s.avc = o);
1373 break;
1374 case 3:
1375 case 4:
1376 n ? -1 === s.audio && (s.audio = o,
1377 s.isAAC = !1) : a.b.log("MPEG audio found, not supported in this browser for now");
1378 break;
1379 case 36:
1380 a.b.warn("HEVC stream type found, not supported for now");
1381 break;
1382 default:
1383 a.b.log("unkown stream type:" + t[e])
1384 }
1385 e += 5 + ((15 & t[e + 3]) << 8 | t[e + 4])
1386 }
1387 return s
1388 }
1389 ,
1390 t.prototype._parsePES = function(t) {
1391 var e, n, i, r, o, s, l, u, c = 0, d = t.data;
1392 if (!t || 0 === t.size)
1393 return null;
1394 for (; d[0].length < 19 && d.length > 1; ) {
1395 var h = new Uint8Array(d[0].length + d[1].length);
1396 h.set(d[0]),
1397 h.set(d[1], d[0].length),
1398 d[0] = h,
1399 d.splice(1, 1)
1400 }
1401 if (1 === ((e = d[0])[0] << 16) + (e[1] << 8) + e[2]) {
1402 if ((i = (e[4] << 8) + e[5]) && i > t.size - 6)
1403 return null;
1404 192 & (n = e[7]) && ((s = 536870912 * (14 & e[9]) + 4194304 * (255 & e[10]) + 16384 * (254 & e[11]) + 128 * (255 & e[12]) + (254 & e[13]) / 2) > 4294967295 && (s -= 8589934592),
1405 64 & n ? ((l = 536870912 * (14 & e[14]) + 4194304 * (255 & e[15]) + 16384 * (254 & e[16]) + 128 * (255 & e[17]) + (254 & e[18]) / 2) > 4294967295 && (l -= 8589934592),
1406 s - l > 54e5 && (a.b.warn(Math.round((s - l) / 9e4) + "s delta between PTS and DTS, align them"),
1407 s = l)) : l = s),
1408 u = (r = e[8]) + 9,
1409 t.size -= u,
1410 o = new Uint8Array(t.size);
1411 for (var p = 0, f = d.length; p < f; p++) {
1412 var y = (e = d[p]).byteLength;
1413 if (u) {
1414 if (u > y) {
1415 u -= y;
1416 continue
1417 }
1418 e = e.subarray(u),
1419 y -= u,
1420 u = 0
1421 }
1422 o.set(e, c),
1423 c += y
1424 }
1425 return i && (i -= r + 3),
1426 {
1427 data: o,
1428 pts: s,
1429 dts: l,
1430 len: i
1431 }
1432 }
1433 return null
1434 }
1435 ,
1436 t.prototype.pushAccesUnit = function(t, e) {
1437 if (t.units.length && t.frame) {
1438 var n = e.samples
1439 , i = n.length;
1440 !this.config.forceKeyFrameOnDiscontinuity || !0 === t.key || e.sps && (i || this.contiguous) ? (t.id = i,
1441 n.push(t)) : e.dropped++
1442 }
1443 t.debug.length && a.b.log(t.pts + "/" + t.dts + ":" + t.debug)
1444 }
1445 ,
1446 t.prototype._parseAVCPES = function(t, e) {
1447 var n, i, r, o = this, a = this._avcTrack, s = this._parseAVCNALu(t.data), l = this.avcSample, u = !1, c = this.pushAccesUnit.bind(this), d = function(t, e, n, i) {
1448 return {
1449 key: t,
1450 pts: e,
1451 dts: n,
1452 units: [],
1453 debug: i
1454 }
1455 };
1456 t.data = null,
1457 l && s.length && !a.audFound && (c(l, a),
1458 l = this.avcSample = d(!1, t.pts, t.dts, "")),
1459 s.forEach(function(e) {
1460 switch (e.type) {
1461 case 1:
1462 i = !0,
1463 l || (l = o.avcSample = d(!0, t.pts, t.dts, "")),
1464 l.frame = !0;
1465 var s = e.data;
1466 if (u && s.length > 4) {
1467 var h = new A(s).readSliceType();
1468 2 !== h && 4 !== h && 7 !== h && 9 !== h || (l.key = !0)
1469 }
1470 break;
1471 case 5:
1472 i = !0,
1473 l || (l = o.avcSample = d(!0, t.pts, t.dts, "")),
1474 l.key = !0,
1475 l.frame = !0;
1476 break;
1477 case 6:
1478 i = !0,
1479 (n = new A(o.discardEPB(e.data))).readUByte();
1480 for (var p = 0, f = 0, y = !1, v = 0; !y && n.bytesAvailable > 1; ) {
1481 p = 0;
1482 do {
1483 p += v = n.readUByte()
1484 } while (255 === v);f = 0;
1485 do {
1486 f += v = n.readUByte()
1487 } while (255 === v);if (4 === p && 0 !== n.bytesAvailable) {
1488 if (y = !0,
1489 181 === n.readUByte())
1490 if (49 === n.readUShort())
1491 if (1195456820 === n.readUInt())
1492 if (3 === n.readUByte()) {
1493 var g = n.readUByte()
1494 , m = 31 & g
1495 , b = [g, n.readUByte()];
1496 for (r = 0; r < m; r++)
1497 b.push(n.readUByte()),
1498 b.push(n.readUByte()),
1499 b.push(n.readUByte());
1500 o._insertSampleInOrder(o._txtTrack.samples, {
1501 type: 3,
1502 pts: t.pts,
1503 bytes: b
1504 })
1505 }
1506 } else if (f < n.bytesAvailable)
1507 for (r = 0; r < f; r++)
1508 n.readUByte()
1509 }
1510 break;
1511 case 7:
1512 if (i = !0,
1513 u = !0,
1514 !a.sps) {
1515 var _ = (n = new A(e.data)).readSPS();
1516 a.width = _.width,
1517 a.height = _.height,
1518 a.pixelRatio = _.pixelRatio,
1519 a.sps = [e.data],
1520 a.duration = o._duration;
1521 var E = e.data.subarray(1, 4)
1522 , k = "avc1.";
1523 for (r = 0; r < 3; r++) {
1524 var T = E[r].toString(16);
1525 T.length < 2 && (T = "0" + T),
1526 k += T
1527 }
1528 a.codec = k
1529 }
1530 break;
1531 case 8:
1532 i = !0,
1533 a.pps || (a.pps = [e.data]);
1534 break;
1535 case 9:
1536 i = !1,
1537 a.audFound = !0,
1538 l && c(l, a),
1539 l = o.avcSample = d(!1, t.pts, t.dts, "");
1540 break;
1541 case 12:
1542 i = !1;
1543 break;
1544 default:
1545 i = !1,
1546 l && (l.debug += "unknown NAL " + e.type + " ")
1547 }
1548 l && i && l.units.push(e)
1549 }),
1550 e && l && (c(l, a),
1551 this.avcSample = null)
1552 }
1553 ,
1554 t.prototype._insertSampleInOrder = function(t, e) {
1555 var n = t.length;
1556 if (n > 0) {
1557 if (e.pts >= t[n - 1].pts)
1558 t.push(e);
1559 else
1560 for (var i = n - 1; i >= 0; i--)
1561 if (e.pts < t[i].pts) {
1562 t.splice(i, 0, e);
1563 break
1564 }
1565 } else
1566 t.push(e)
1567 }
1568 ,
1569 t.prototype._getLastNalUnit = function() {
1570 var t = this.avcSample
1571 , e = void 0;
1572 if (!t || 0 === t.units.length) {
1573 var n = this._avcTrack.samples;
1574 t = n[n.length - 1]
1575 }
1576 if (t) {
1577 var i = t.units;
1578 e = i[i.length - 1]
1579 }
1580 return e
1581 }
1582 ,
1583 t.prototype._parseAVCNALu = function(t) {
1584 var e, n, i, r, o = 0, a = t.byteLength, s = this._avcTrack, l = s.naluState || 0, u = l, c = [], d = -1;
1585 for (-1 === l && (d = 0,
1586 r = 31 & t[0],
1587 l = 0,
1588 o = 1); o < a; )
1589 if (e = t[o++],
1590 l)
1591 if (1 !== l)
1592 if (e)
1593 if (1 === e) {
1594 if (d >= 0)
1595 i = {
1596 data: t.subarray(d, o - l - 1),
1597 type: r
1598 },
1599 c.push(i);
1600 else {
1601 var h = this._getLastNalUnit();
1602 if (h && (u && o <= 4 - u && h.state && (h.data = h.data.subarray(0, h.data.byteLength - u)),
1603 (n = o - l - 1) > 0)) {
1604 var p = new Uint8Array(h.data.byteLength + n);
1605 p.set(h.data, 0),
1606 p.set(t.subarray(0, n), h.data.byteLength),
1607 h.data = p
1608 }
1609 }
1610 o < a ? (d = o,
1611 r = 31 & t[o],
1612 l = 0) : l = -1
1613 } else
1614 l = 0;
1615 else
1616 l = 3;
1617 else
1618 l = e ? 0 : 2;
1619 else
1620 l = e ? 0 : 1;
1621 if (d >= 0 && l >= 0 && (i = {
1622 data: t.subarray(d, a),
1623 type: r,
1624 state: l
1625 },
1626 c.push(i)),
1627 0 === c.length) {
1628 var f = this._getLastNalUnit();
1629 if (f) {
1630 var y = new Uint8Array(f.data.byteLength + t.byteLength);
1631 y.set(f.data, 0),
1632 y.set(t, f.data.byteLength),
1633 f.data = y
1634 }
1635 }
1636 return s.naluState = l,
1637 c
1638 }
1639 ,
1640 t.prototype.discardEPB = function(t) {
1641 for (var e, n, i = t.byteLength, r = [], o = 1; o < i - 2; )
1642 0 === t[o] && 0 === t[o + 1] && 3 === t[o + 2] ? (r.push(o + 2),
1643 o += 2) : o++;
1644 if (0 === r.length)
1645 return t;
1646 e = i - r.length,
1647 n = new Uint8Array(e);
1648 var a = 0;
1649 for (o = 0; o < e; a++,
1650 o++)
1651 a === r[0] && (a++,
1652 r.shift()),
1653 n[o] = t[a];
1654 return n
1655 }
1656 ,
1657 t.prototype._parseAACPES = function(t) {
1658 var e, n, o, s, l, u, d, y = this._audioTrack, v = t.data, g = t.pts, m = this.aacOverFlow, b = this.aacLastPTS;
1659 if (m) {
1660 var _ = new Uint8Array(m.byteLength + v.byteLength);
1661 _.set(m, 0),
1662 _.set(v, m.byteLength),
1663 v = _
1664 }
1665 for (o = 0,
1666 l = v.length; o < l - 1 && !c(v, o); o++)
1667 ;
1668 if (o && (o < l - 1 ? (u = "AAC PES did not start with ADTS header,offset:" + o,
1669 d = !1) : (u = "no ADTS header found in AAC PES",
1670 d = !0),
1671 a.b.warn("parsing error:" + u),
1672 this.observer.trigger(i.a.ERROR, {
1673 type: r.b.MEDIA_ERROR,
1674 details: r.a.FRAG_PARSING_ERROR,
1675 fatal: d,
1676 reason: u
1677 }),
1678 d))
1679 return;
1680 if (h(y, this.observer, v, o, this.audioCodec),
1681 n = 0,
1682 e = p(y.samplerate),
1683 m && b) {
1684 var A = b + e;
1685 Math.abs(A - g) > 1 && (a.b.log("AAC: align PTS for overlapping frames by " + Math.round((A - g) / 90)),
1686 g = A)
1687 }
1688 for (; o < l; )
1689 if (c(v, o) && o + 5 < l) {
1690 var E = f(y, v, o, g, n);
1691 if (!E)
1692 break;
1693 o += E.length,
1694 s = E.sample.pts,
1695 n++
1696 } else
1697 o++;
1698 m = o < l ? v.subarray(o, l) : null,
1699 this.aacOverFlow = m,
1700 this.aacLastPTS = s
1701 }
1702 ,
1703 t.prototype._parseMPEGPES = function(t) {
1704 for (var e = t.data, n = e.length, i = 0, r = 0, o = t.pts; r < n; )
1705 if (_.isHeader(e, r)) {
1706 var a = _.appendFrame(this._audioTrack, e, r, o, i);
1707 if (!a)
1708 break;
1709 r += a.length,
1710 i++
1711 } else
1712 r++
1713 }
1714 ,
1715 t.prototype._parseID3PES = function(t) {
1716 this._id3Track.samples.push(t)
1717 }
1718 ,
1719 t
1720 }();
1721 var w = function() {
1722 function t(e, n, i) {
1723 !function(t, e) {
1724 if (!(t instanceof e))
1725 throw new TypeError("Cannot call a class as a function")
1726 }(this, t),
1727 this.observer = e,
1728 this.config = i,
1729 this.remuxer = n
1730 }
1731 return t.prototype.resetInitSegment = function(t, e, n, i) {
1732 this._audioTrack = {
1733 container: "audio/mpeg",
1734 type: "audio",
1735 id: -1,
1736 sequenceNumber: 0,
1737 isAAC: !1,
1738 samples: [],
1739 len: 0,
1740 manifestCodec: e,
1741 duration: i,
1742 inputTimeScale: 9e4
1743 }
1744 }
1745 ,
1746 t.prototype.resetTimeStamp = function() {}
1747 ,
1748 t.probe = function(t) {
1749 var e, n, i = y.a.getID3Data(t, 0);
1750 if (i && void 0 !== y.a.getTimeStamp(i))
1751 for (e = i.length,
1752 n = Math.min(t.length - 1, e + 100); e < n; e++)
1753 if (_.probe(t, e))
1754 return a.b.log("MPEG Audio sync word found !"),
1755 !0;
1756 return !1
1757 }
1758 ,
1759 t.prototype.append = function(t, e, n, i) {
1760 for (var r = y.a.getID3Data(t, 0), o = y.a.getTimeStamp(r), a = o ? 90 * o : 9e4 * e, s = r.length, l = t.length, u = 0, c = 0, d = this._audioTrack, h = [{
1761 pts: a,
1762 dts: a,
1763 data: r
1764 }]; s < l; )
1765 if (_.isHeader(t, s)) {
1766 var p = _.appendFrame(d, t, s, a, u);
1767 if (!p)
1768 break;
1769 s += p.length,
1770 c = p.sample.pts,
1771 u++
1772 } else
1773 y.a.isHeader(t, s) ? (r = y.a.getID3Data(t, s),
1774 h.push({
1775 pts: c,
1776 dts: c,
1777 data: r
1778 }),
1779 s += r.length) : s++;
1780 this.remuxer.remux(d, {
1781 samples: []
1782 }, {
1783 samples: h,
1784 inputTimeScale: 9e4
1785 }, {
1786 samples: []
1787 }, e, n, i)
1788 }
1789 ,
1790 t.prototype.destroy = function() {}
1791 ,
1792 t
1793 }();
1794 var S = function() {
1795 function t() {
1796 !function(t, e) {
1797 if (!(t instanceof e))
1798 throw new TypeError("Cannot call a class as a function")
1799 }(this, t)
1800 }
1801 return t.getSilentFrame = function(t, e) {
1802 switch (t) {
1803 case "mp4a.40.2":
1804 if (1 === e)
1805 return new Uint8Array([0, 200, 0, 128, 35, 128]);
1806 if (2 === e)
1807 return new Uint8Array([33, 0, 73, 144, 2, 25, 0, 35, 128]);
1808 if (3 === e)
1809 return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142]);
1810 if (4 === e)
1811 return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44, 128, 8, 2, 56]);
1812 if (5 === e)
1813 return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 56]);
1814 if (6 === e)
1815 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]);
1816 break;
1817 default:
1818 if (1 === e)
1819 return new Uint8Array([1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28, 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
1820 if (2 === e)
1821 return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
1822 if (3 === e)
1823 return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94])
1824 }
1825 return null
1826 }
1827 ,
1828 t
1829 }();
1830 var C = Math.pow(2, 32) - 1
1831 , O = function() {
1832 function t() {
1833 !function(t, e) {
1834 if (!(t instanceof e))
1835 throw new TypeError("Cannot call a class as a function")
1836 }(this, t)
1837 }
1838 return t.init = function() {
1839 var e;
1840 for (e in t.types = {
1841 avc1: [],
1842 avcC: [],
1843 btrt: [],
1844 dinf: [],
1845 dref: [],
1846 esds: [],
1847 ftyp: [],
1848 hdlr: [],
1849 mdat: [],
1850 mdhd: [],
1851 mdia: [],
1852 mfhd: [],
1853 minf: [],
1854 moof: [],
1855 moov: [],
1856 mp4a: [],
1857 ".mp3": [],
1858 mvex: [],
1859 mvhd: [],
1860 pasp: [],
1861 sdtp: [],
1862 stbl: [],
1863 stco: [],
1864 stsc: [],
1865 stsd: [],
1866 stsz: [],
1867 stts: [],
1868 tfdt: [],
1869 tfhd: [],
1870 traf: [],
1871 trak: [],
1872 trun: [],
1873 trex: [],
1874 tkhd: [],
1875 vmhd: [],
1876 smhd: []
1877 },
1878 t.types)
1879 t.types.hasOwnProperty(e) && (t.types[e] = [e.charCodeAt(0), e.charCodeAt(1), e.charCodeAt(2), e.charCodeAt(3)]);
1880 var n = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0])
1881 , i = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0]);
1882 t.HDLR_TYPES = {
1883 video: n,
1884 audio: i
1885 };
1886 var r = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1])
1887 , o = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]);
1888 t.STTS = t.STSC = t.STCO = o,
1889 t.STSZ = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
1890 t.VMHD = new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]),
1891 t.SMHD = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]),
1892 t.STSD = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]);
1893 var a = new Uint8Array([105, 115, 111, 109])
1894 , s = new Uint8Array([97, 118, 99, 49])
1895 , l = new Uint8Array([0, 0, 0, 1]);
1896 t.FTYP = t.box(t.types.ftyp, a, l, a, s),
1897 t.DINF = t.box(t.types.dinf, t.box(t.types.dref, r))
1898 }
1899 ,
1900 t.box = function(t) {
1901 for (var e, n = Array.prototype.slice.call(arguments, 1), i = 8, r = n.length, o = r; r--; )
1902 i += n[r].byteLength;
1903 for ((e = new Uint8Array(i))[0] = i >> 24 & 255,
1904 e[1] = i >> 16 & 255,
1905 e[2] = i >> 8 & 255,
1906 e[3] = 255 & i,
1907 e.set(t, 4),
1908 r = 0,
1909 i = 8; r < o; r++)
1910 e.set(n[r], i),
1911 i += n[r].byteLength;
1912 return e
1913 }
1914 ,
1915 t.hdlr = function(e) {
1916 return t.box(t.types.hdlr, t.HDLR_TYPES[e])
1917 }
1918 ,
1919 t.mdat = function(e) {
1920 return t.box(t.types.mdat, e)
1921 }
1922 ,
1923 t.mdhd = function(e, n) {
1924 n *= e;
1925 var i = Math.floor(n / (C + 1))
1926 , r = Math.floor(n % (C + 1));
1927 return t.box(t.types.mdhd, new Uint8Array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e, i >> 24, i >> 16 & 255, i >> 8 & 255, 255 & i, r >> 24, r >> 16 & 255, r >> 8 & 255, 255 & r, 85, 196, 0, 0]))
1928 }
1929 ,
1930 t.mdia = function(e) {
1931 return t.box(t.types.mdia, t.mdhd(e.timescale, e.duration), t.hdlr(e.type), t.minf(e))
1932 }
1933 ,
1934 t.mfhd = function(e) {
1935 return t.box(t.types.mfhd, new Uint8Array([0, 0, 0, 0, e >> 24, e >> 16 & 255, e >> 8 & 255, 255 & e]))
1936 }
1937 ,
1938 t.minf = function(e) {
1939 return "audio" === e.type ? t.box(t.types.minf, t.box(t.types.smhd, t.SMHD), t.DINF, t.stbl(e)) : t.box(t.types.minf, t.box(t.types.vmhd, t.VMHD), t.DINF, t.stbl(e))
1940 }
1941 ,
1942 t.moof = function(e, n, i) {
1943 return t.box(t.types.moof, t.mfhd(e), t.traf(i, n))
1944 }
1945 ,
1946 t.moov = function(e) {
1947 for (var n = e.length, i = []; n--; )
1948 i[n] = t.trak(e[n]);
1949 return t.box.apply(null, [t.types.moov, t.mvhd(e[0].timescale, e[0].duration)].concat(i).concat(t.mvex(e)))
1950 }
1951 ,
1952 t.mvex = function(e) {
1953 for (var n = e.length, i = []; n--; )
1954 i[n] = t.trex(e[n]);
1955 return t.box.apply(null, [t.types.mvex].concat(i))
1956 }
1957 ,
1958 t.mvhd = function(e, n) {
1959 n *= e;
1960 var i = Math.floor(n / (C + 1))
1961 , r = Math.floor(n % (C + 1))
1962 , o = new Uint8Array([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e, i >> 24, i >> 16 & 255, i >> 8 & 255, 255 & i, r >> 24, r >> 16 & 255, r >> 8 & 255, 255 & r, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255]);
1963 return t.box(t.types.mvhd, o)
1964 }
1965 ,
1966 t.sdtp = function(e) {
1967 var n, i, r = e.samples || [], o = new Uint8Array(4 + r.length);
1968 for (i = 0; i < r.length; i++)
1969 n = r[i].flags,
1970 o[i + 4] = n.dependsOn << 4 | n.isDependedOn << 2 | n.hasRedundancy;
1971 return t.box(t.types.sdtp, o)
1972 }
1973 ,
1974 t.stbl = function(e) {
1975 return t.box(t.types.stbl, t.stsd(e), t.box(t.types.stts, t.STTS), t.box(t.types.stsc, t.STSC), t.box(t.types.stsz, t.STSZ), t.box(t.types.stco, t.STCO))
1976 }
1977 ,
1978 t.avc1 = function(e) {
1979 var n, i, r, o = [], a = [];
1980 for (n = 0; n < e.sps.length; n++)
1981 r = (i = e.sps[n]).byteLength,
1982 o.push(r >>> 8 & 255),
1983 o.push(255 & r),
1984 o = o.concat(Array.prototype.slice.call(i));
1985 for (n = 0; n < e.pps.length; n++)
1986 r = (i = e.pps[n]).byteLength,
1987 a.push(r >>> 8 & 255),
1988 a.push(255 & r),
1989 a = a.concat(Array.prototype.slice.call(i));
1990 var s = t.box(t.types.avcC, new Uint8Array([1, o[3], o[4], o[5], 255, 224 | e.sps.length].concat(o).concat([e.pps.length]).concat(a)))
1991 , l = e.width
1992 , u = e.height
1993 , c = e.pixelRatio[0]
1994 , d = e.pixelRatio[1];
1995 return t.box(t.types.avc1, new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, l >> 8 & 255, 255 & l, u >> 8 & 255, 255 & u, 0, 72, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 1, 18, 100, 97, 105, 108, 121, 109, 111, 116, 105, 111, 110, 47, 104, 108, 115, 46, 106, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 17, 17]), s, t.box(t.types.btrt, new Uint8Array([0, 28, 156, 128, 0, 45, 198, 192, 0, 45, 198, 192])), t.box(t.types.pasp, new Uint8Array([c >> 24, c >> 16 & 255, c >> 8 & 255, 255 & c, d >> 24, d >> 16 & 255, d >> 8 & 255, 255 & d])))
1996 }
1997 ,
1998 t.esds = function(t) {
1999 var e = t.config.length;
2000 return new Uint8Array([0, 0, 0, 0, 3, 23 + e, 0, 1, 0, 4, 15 + e, 64, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5].concat([e]).concat(t.config).concat([6, 1, 2]))
2001 }
2002 ,
2003 t.mp4a = function(e) {
2004 var n = e.samplerate;
2005 return t.box(t.types.mp4a, new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, e.channelCount, 0, 16, 0, 0, 0, 0, n >> 8 & 255, 255 & n, 0, 0]), t.box(t.types.esds, t.esds(e)))
2006 }
2007 ,
2008 t.mp3 = function(e) {
2009 var n = e.samplerate;
2010 return t.box(t.types[".mp3"], new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, e.channelCount, 0, 16, 0, 0, 0, 0, n >> 8 & 255, 255 & n, 0, 0]))
2011 }
2012 ,
2013 t.stsd = function(e) {
2014 return "audio" === e.type ? e.isAAC || "mp3" !== e.codec ? t.box(t.types.stsd, t.STSD, t.mp4a(e)) : t.box(t.types.stsd, t.STSD, t.mp3(e)) : t.box(t.types.stsd, t.STSD, t.avc1(e))
2015 }
2016 ,
2017 t.tkhd = function(e) {
2018 var n = e.id
2019 , i = e.duration * e.timescale
2020 , r = e.width
2021 , o = e.height
2022 , a = Math.floor(i / (C + 1))
2023 , s = Math.floor(i % (C + 1));
2024 return t.box(t.types.tkhd, new Uint8Array([1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n, 0, 0, 0, 0, a >> 24, a >> 16 & 255, a >> 8 & 255, 255 & a, s >> 24, s >> 16 & 255, s >> 8 & 255, 255 & s, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, r >> 8 & 255, 255 & r, 0, 0, o >> 8 & 255, 255 & o, 0, 0]))
2025 }
2026 ,
2027 t.traf = function(e, n) {
2028 var i = t.sdtp(e)
2029 , r = e.id
2030 , o = Math.floor(n / (C + 1))
2031 , a = Math.floor(n % (C + 1));
2032 return t.box(t.types.traf, t.box(t.types.tfhd, new Uint8Array([0, 0, 0, 0, r >> 24, r >> 16 & 255, r >> 8 & 255, 255 & r])), t.box(t.types.tfdt, new Uint8Array([1, 0, 0, 0, o >> 24, o >> 16 & 255, o >> 8 & 255, 255 & o, a >> 24, a >> 16 & 255, a >> 8 & 255, 255 & a])), t.trun(e, i.length + 16 + 20 + 8 + 16 + 8 + 8), i)
2033 }
2034 ,
2035 t.trak = function(e) {
2036 return e.duration = e.duration || 4294967295,
2037 t.box(t.types.trak, t.tkhd(e), t.mdia(e))
2038 }
2039 ,
2040 t.trex = function(e) {
2041 var n = e.id;
2042 return t.box(t.types.trex, new Uint8Array([0, 0, 0, 0, n >> 24, n >> 16 & 255, n >> 8 & 255, 255 & n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1]))
2043 }
2044 ,
2045 t.trun = function(e, n) {
2046 var i, r, o, a, s, l, u = e.samples || [], c = u.length, d = 12 + 16 * c, h = new Uint8Array(d);
2047 for (n += 8 + d,
2048 h.set([0, 0, 15, 1, c >>> 24 & 255, c >>> 16 & 255, c >>> 8 & 255, 255 & c, n >>> 24 & 255, n >>> 16 & 255, n >>> 8 & 255, 255 & n], 0),
2049 i = 0; i < c; i++)
2050 o = (r = u[i]).duration,
2051 a = r.size,
2052 s = r.flags,
2053 l = r.cts,
2054 h.set([o >>> 24 & 255, o >>> 16 & 255, o >>> 8 & 255, 255 & o, a >>> 24 & 255, a >>> 16 & 255, a >>> 8 & 255, 255 & a, s.isLeading << 2 | s.dependsOn, s.isDependedOn << 6 | s.hasRedundancy << 4 | s.paddingValue << 1 | s.isNonSync, 61440 & s.degradPrio, 15 & s.degradPrio, l >>> 24 & 255, l >>> 16 & 255, l >>> 8 & 255, 255 & l], 12 + 16 * i);
2055 return t.box(t.types.trun, h)
2056 }
2057 ,
2058 t.initSegment = function(e) {
2059 t.types || t.init();
2060 var n, i = t.moov(e);
2061 return (n = new Uint8Array(t.FTYP.byteLength + i.byteLength)).set(t.FTYP),
2062 n.set(i, t.FTYP.byteLength),
2063 n
2064 }
2065 ,
2066 t
2067 }();
2068 var P = function() {
2069 function t(e, n, i, r) {
2070 !function(t, e) {
2071 if (!(t instanceof e))
2072 throw new TypeError("Cannot call a class as a function")
2073 }(this, t),
2074 this.observer = e,
2075 this.config = n,
2076 this.typeSupported = i;
2077 var o = navigator.userAgent;
2078 this.isSafari = r && r.indexOf("Apple") > -1 && o && !o.match("CriOS"),
2079 this.ISGenerated = !1
2080 }
2081 return t.prototype.destroy = function() {}
2082 ,
2083 t.prototype.resetTimeStamp = function(t) {
2084 this._initPTS = this._initDTS = t
2085 }
2086 ,
2087 t.prototype.resetInitSegment = function() {
2088 this.ISGenerated = !1
2089 }
2090 ,
2091 t.prototype.remux = function(t, e, n, r, o, s, l) {
2092 if (this.ISGenerated || this.generateIS(t, e, o),
2093 this.ISGenerated) {
2094 var u = t.samples.length
2095 , c = e.samples.length
2096 , d = o
2097 , h = o;
2098 if (u && c) {
2099 var p = (t.samples[0].dts - e.samples[0].dts) / e.inputTimeScale;
2100 d += Math.max(0, p),
2101 h += Math.max(0, -p)
2102 }
2103 if (u) {
2104 t.timescale || (a.b.warn("regenerate InitSegment as audio detected"),
2105 this.generateIS(t, e, o));
2106 var f = this.remuxAudio(t, d, s, l);
2107 if (c) {
2108 var y = void 0;
2109 f && (y = f.endPTS - f.startPTS),
2110 e.timescale || (a.b.warn("regenerate InitSegment as video detected"),
2111 this.generateIS(t, e, o)),
2112 this.remuxVideo(e, h, s, y, l)
2113 }
2114 } else {
2115 var v = void 0;
2116 c && (v = this.remuxVideo(e, h, s, l)),
2117 v && t.codec && this.remuxEmptyAudio(t, d, s, v)
2118 }
2119 }
2120 n.samples.length && this.remuxID3(n, o),
2121 r.samples.length && this.remuxText(r, o),
2122 this.observer.trigger(i.a.FRAG_PARSED)
2123 }
2124 ,
2125 t.prototype.generateIS = function(t, e, n) {
2126 var o, s, l = this.observer, u = t.samples, c = e.samples, d = this.typeSupported, h = "audio/mp4", p = {}, f = {
2127 tracks: p
2128 }, y = void 0 === this._initPTS;
2129 if (y && (o = s = 1 / 0),
2130 t.config && u.length && (t.timescale = t.samplerate,
2131 a.b.log("audio sampling rate : " + t.samplerate),
2132 t.isAAC || (d.mpeg ? (h = "audio/mpeg",
2133 t.codec = "") : d.mp3 && (t.codec = "mp3")),
2134 p.audio = {
2135 container: h,
2136 codec: t.codec,
2137 initSegment: !t.isAAC && d.mpeg ? new Uint8Array : O.initSegment([t]),
2138 metadata: {
2139 channelCount: t.channelCount
2140 }
2141 },
2142 y && (o = s = u[0].pts - t.inputTimeScale * n)),
2143 e.sps && e.pps && c.length) {
2144 var v = e.inputTimeScale;
2145 e.timescale = v,
2146 p.video = {
2147 container: "video/mp4",
2148 codec: e.codec,
2149 initSegment: O.initSegment([e]),
2150 metadata: {
2151 width: e.width,
2152 height: e.height
2153 }
2154 },
2155 y && (o = Math.min(o, c[0].pts - v * n),
2156 s = Math.min(s, c[0].dts - v * n),
2157 this.observer.trigger(i.a.INIT_PTS_FOUND, {
2158 initPTS: o
2159 }))
2160 }
2161 Object.keys(p).length ? (l.trigger(i.a.FRAG_PARSING_INIT_SEGMENT, f),
2162 this.ISGenerated = !0,
2163 y && (this._initPTS = o,
2164 this._initDTS = s)) : l.trigger(i.a.ERROR, {
2165 type: r.b.MEDIA_ERROR,
2166 details: r.a.FRAG_PARSING_ERROR,
2167 fatal: !1,
2168 reason: "no audio/video samples found"
2169 })
2170 }
2171 ,
2172 t.prototype.remuxVideo = function(t, e, n, o, s) {
2173 var l, u, c, d, h, p, f, y = 8, v = t.timescale, g = t.samples, m = [], b = g.length, _ = this._PTSNormalize, A = this._initDTS, E = this.nextAvcDts, k = this.isSafari;
2174 k && (n |= g.length && E && (s && Math.abs(e - E / v) < .1 || Math.abs(g[0].pts - E - A) < v / 5)),
2175 n || (E = e * v),
2176 g.forEach(function(t) {
2177 t.pts = _(t.pts - A, E),
2178 t.dts = _(t.dts - A, E)
2179 }),
2180 g.sort(function(t, e) {
2181 var n = t.dts - e.dts
2182 , i = t.pts - e.pts;
2183 return n || (i || t.id - e.id)
2184 });
2185 var T = g.reduce(function(t, e) {
2186 return Math.max(Math.min(t, e.pts - e.dts), -18e3)
2187 }, 0);
2188 if (T < 0) {
2189 a.b.warn("PTS < DTS detected in video samples, shifting DTS by " + Math.round(T / 90) + " ms to overcome this issue");
2190 for (var w = 0; w < g.length; w++)
2191 g[w].dts += T
2192 }
2193 var S = g[0];
2194 h = Math.max(S.dts, 0),
2195 d = Math.max(S.pts, 0);
2196 var C = Math.round((h - E) / 90);
2197 n && C && (C > 1 ? a.b.log("AVC:" + C + " ms hole between fragments detected,filling it") : C < -1 && a.b.log("AVC:" + -C + " ms overlapping between fragments detected"),
2198 h = E,
2199 g[0].dts = h,
2200 d = Math.max(d - C, E),
2201 g[0].pts = d,
2202 a.b.log("Video/PTS/DTS adjusted: " + Math.round(d / 90) + "/" + Math.round(h / 90) + ",delta:" + C + " ms")),
2203 S = g[g.length - 1],
2204 f = Math.max(S.dts, 0),
2205 p = Math.max(S.pts, 0, f),
2206 k && (l = Math.round((f - h) / (g.length - 1)));
2207 for (var P = 0, R = 0, I = 0; I < b; I++) {
2208 for (var L = g[I], D = L.units, x = D.length, M = 0, N = 0; N < x; N++)
2209 M += D[N].data.length;
2210 R += M,
2211 P += x,
2212 L.length = M,
2213 L.dts = k ? h + I * l : Math.max(L.dts, h),
2214 L.pts = Math.max(L.pts, L.dts)
2215 }
2216 var B = R + 4 * P + 8;
2217 try {
2218 u = new Uint8Array(B)
2219 } catch (t) {
2220 return void this.observer.trigger(i.a.ERROR, {
2221 type: r.b.MUX_ERROR,
2222 details: r.a.REMUX_ALLOC_ERROR,
2223 fatal: !1,
2224 bytes: B,
2225 reason: "fail allocating video mdat " + B
2226 })
2227 }
2228 var U = new DataView(u.buffer);
2229 U.setUint32(0, B),
2230 u.set(O.types.mdat, 4);
2231 for (var F = 0; F < b; F++) {
2232 for (var j = g[F], H = j.units, V = 0, G = void 0, z = 0, K = H.length; z < K; z++) {
2233 var Y = H[z]
2234 , $ = Y.data
2235 , W = Y.data.byteLength;
2236 U.setUint32(y, W),
2237 y += 4,
2238 u.set($, y),
2239 y += W,
2240 V += 4 + W
2241 }
2242 if (k)
2243 G = Math.max(0, l * Math.round((j.pts - j.dts) / l));
2244 else {
2245 if (F < b - 1)
2246 l = g[F + 1].dts - j.dts;
2247 else {
2248 var q = this.config
2249 , X = j.dts - g[F > 0 ? F - 1 : F].dts;
2250 if (q.stretchShortVideoTrack) {
2251 var Z = q.maxBufferHole
2252 , Q = q.maxSeekHole
2253 , J = Math.floor(Math.min(Z, Q) * v)
2254 , tt = (o ? d + o * v : this.nextAudioPts) - j.pts;
2255 tt > J ? ((l = tt - X) < 0 && (l = X),
2256 a.b.log("It is approximately " + tt / 90 + " ms to the next segment; using duration " + l / 90 + " ms for the last video frame.")) : l = X
2257 } else
2258 l = X
2259 }
2260 G = Math.round(j.pts - j.dts)
2261 }
2262 m.push({
2263 size: V,
2264 duration: l,
2265 cts: G,
2266 flags: {
2267 isLeading: 0,
2268 isDependedOn: 0,
2269 hasRedundancy: 0,
2270 degradPrio: 0,
2271 dependsOn: j.key ? 2 : 1,
2272 isNonSync: j.key ? 0 : 1
2273 }
2274 })
2275 }
2276 this.nextAvcDts = f + l;
2277 var et = t.dropped;
2278 if (t.len = 0,
2279 t.nbNalu = 0,
2280 t.dropped = 0,
2281 m.length && navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
2282 var nt = m[0].flags;
2283 nt.dependsOn = 2,
2284 nt.isNonSync = 0
2285 }
2286 t.samples = m,
2287 c = O.moof(t.sequenceNumber++, h, t),
2288 t.samples = [];
2289 var it = {
2290 data1: c,
2291 data2: u,
2292 startPTS: d / v,
2293 endPTS: (p + l) / v,
2294 startDTS: h / v,
2295 endDTS: this.nextAvcDts / v,
2296 type: "video",
2297 nb: m.length,
2298 dropped: et
2299 };
2300 return this.observer.trigger(i.a.FRAG_PARSING_DATA, it),
2301 it
2302 }
2303 ,
2304 t.prototype.remuxAudio = function(t, e, n, o) {
2305 var s, l, u, c, d, h, p, f = t.inputTimeScale, y = t.timescale, v = f / y, g = (t.isAAC ? 1024 : 1152) * v, m = this._PTSNormalize, b = this._initDTS, _ = !t.isAAC && this.typeSupported.mpeg, A = t.samples, E = [], k = this.nextAudioPts;
2306 if (n |= A.length && k && (o && Math.abs(e - k / f) < .1 || Math.abs(A[0].pts - k - b) < 20 * g),
2307 A.forEach(function(t) {
2308 t.pts = t.dts = m(t.pts - b, e * f)
2309 }),
2310 0 !== (A = A.filter(function(t) {
2311 return t.pts >= 0
2312 })).length) {
2313 if (n || (k = o ? e * f : A[0].pts),
2314 t.isAAC)
2315 for (var T = this.config.maxAudioFramesDrift, w = 0, C = k; w < A.length; ) {
2316 var P, R = A[w];
2317 P = R.pts - C;
2318 var I = Math.abs(1e3 * P / f);
2319 if (P <= -T * g)
2320 a.b.warn("Dropping 1 audio frame @ " + (C / f).toFixed(3) + "s due to " + Math.round(I) + " ms overlap."),
2321 A.splice(w, 1),
2322 t.len -= R.unit.length;
2323 else if (P >= T * g && I < 1e4 && C) {
2324 var L = Math.round(P / g);
2325 a.b.warn("Injecting " + L + " audio frame @ " + (C / f).toFixed(3) + "s due to " + Math.round(1e3 * P / f) + " ms gap.");
2326 for (var D = 0; D < L; D++) {
2327 var x = Math.max(C, 0);
2328 (u = S.getSilentFrame(t.manifestCodec || t.codec, t.channelCount)) || (a.b.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),
2329 u = R.unit.subarray()),
2330 A.splice(w, 0, {
2331 unit: u,
2332 pts: x,
2333 dts: x
2334 }),
2335 t.len += u.length,
2336 C += g,
2337 w++
2338 }
2339 R.pts = R.dts = C,
2340 C += g,
2341 w++
2342 } else
2343 Math.abs(P),
2344 R.pts = R.dts = C,
2345 C += g,
2346 w++
2347 }
2348 for (var M = 0, N = A.length; M < N; M++) {
2349 var B = A[M]
2350 , U = B.unit
2351 , F = B.pts;
2352 if (void 0 !== p)
2353 l.duration = Math.round((F - p) / v);
2354 else {
2355 var j = Math.round(1e3 * (F - k) / f)
2356 , H = 0;
2357 if (n && t.isAAC && j) {
2358 if (j > 0 && j < 1e4)
2359 H = Math.round((F - k) / g),
2360 a.b.log(j + " ms hole between AAC samples detected,filling it"),
2361 H > 0 && ((u = S.getSilentFrame(t.manifestCodec || t.codec, t.channelCount)) || (u = U.subarray()),
2362 t.len += H * u.length);
2363 else if (j < -12) {
2364 a.b.log("drop overlapping AAC sample, expected/parsed/delta:" + (k / f).toFixed(3) + "s/" + (F / f).toFixed(3) + "s/" + -j + "ms"),
2365 t.len -= U.byteLength;
2366 continue
2367 }
2368 F = k
2369 }
2370 if (h = F,
2371 !(t.len > 0))
2372 return;
2373 var V = _ ? t.len : t.len + 8;
2374 s = _ ? 0 : 8;
2375 try {
2376 c = new Uint8Array(V)
2377 } catch (t) {
2378 return void this.observer.trigger(i.a.ERROR, {
2379 type: r.b.MUX_ERROR,
2380 details: r.a.REMUX_ALLOC_ERROR,
2381 fatal: !1,
2382 bytes: V,
2383 reason: "fail allocating audio mdat " + V
2384 })
2385 }
2386 _ || (new DataView(c.buffer).setUint32(0, V),
2387 c.set(O.types.mdat, 4));
2388 for (var G = 0; G < H; G++)
2389 (u = S.getSilentFrame(t.manifestCodec || t.codec, t.channelCount)) || (a.b.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),
2390 u = U.subarray()),
2391 c.set(u, s),
2392 s += u.byteLength,
2393 l = {
2394 size: u.byteLength,
2395 cts: 0,
2396 duration: 1024,
2397 flags: {
2398 isLeading: 0,
2399 isDependedOn: 0,
2400 hasRedundancy: 0,
2401 degradPrio: 0,
2402 dependsOn: 1
2403 }
2404 },
2405 E.push(l)
2406 }
2407 c.set(U, s);
2408 var z = U.byteLength;
2409 s += z,
2410 l = {
2411 size: z,
2412 cts: 0,
2413 duration: 0,
2414 flags: {
2415 isLeading: 0,
2416 isDependedOn: 0,
2417 hasRedundancy: 0,
2418 degradPrio: 0,
2419 dependsOn: 1
2420 }
2421 },
2422 E.push(l),
2423 p = F
2424 }
2425 var K = 0
2426 , Y = E.length;
2427 if (Y >= 2 && (K = E[Y - 2].duration,
2428 l.duration = K),
2429 Y) {
2430 this.nextAudioPts = k = p + v * K,
2431 t.len = 0,
2432 t.samples = E,
2433 d = _ ? new Uint8Array : O.moof(t.sequenceNumber++, h / v, t),
2434 t.samples = [];
2435 var $ = h / f
2436 , W = k / f
2437 , q = {
2438 data1: d,
2439 data2: c,
2440 startPTS: $,
2441 endPTS: W,
2442 startDTS: $,
2443 endDTS: W,
2444 type: "audio",
2445 nb: Y
2446 };
2447 return this.observer.trigger(i.a.FRAG_PARSING_DATA, q),
2448 q
2449 }
2450 return null
2451 }
2452 }
2453 ,
2454 t.prototype.remuxEmptyAudio = function(t, e, n, i) {
2455 var r = t.inputTimeScale
2456 , o = r / (t.samplerate ? t.samplerate : r)
2457 , s = this.nextAudioPts
2458 , l = (void 0 !== s ? s : i.startDTS * r) + this._initDTS
2459 , u = i.endDTS * r + this._initDTS
2460 , c = 1024 * o
2461 , d = Math.ceil((u - l) / c)
2462 , h = S.getSilentFrame(t.manifestCodec || t.codec, t.channelCount);
2463 if (a.b.warn("remux empty Audio"),
2464 h) {
2465 for (var p = [], f = 0; f < d; f++) {
2466 var y = l + f * c;
2467 p.push({
2468 unit: h,
2469 pts: y,
2470 dts: y
2471 }),
2472 t.len += h.length
2473 }
2474 t.samples = p,
2475 this.remuxAudio(t, e, n)
2476 } else
2477 a.b.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")
2478 }
2479 ,
2480 t.prototype.remuxID3 = function(t, e) {
2481 var n, r = t.samples.length, o = t.inputTimeScale, a = this._initPTS, s = this._initDTS;
2482 if (r) {
2483 for (var l = 0; l < r; l++)
2484 (n = t.samples[l]).pts = (n.pts - a) / o,
2485 n.dts = (n.dts - s) / o;
2486 this.observer.trigger(i.a.FRAG_PARSING_METADATA, {
2487 samples: t.samples
2488 })
2489 }
2490 t.samples = [],
2491 e = e
2492 }
2493 ,
2494 t.prototype.remuxText = function(t, e) {
2495 t.samples.sort(function(t, e) {
2496 return t.pts - e.pts
2497 });
2498 var n, r = t.samples.length, o = t.inputTimeScale, a = this._initPTS;
2499 if (r) {
2500 for (var s = 0; s < r; s++)
2501 (n = t.samples[s]).pts = (n.pts - a) / o;
2502 this.observer.trigger(i.a.FRAG_PARSING_USERDATA, {
2503 samples: t.samples
2504 })
2505 }
2506 t.samples = [],
2507 e = e
2508 }
2509 ,
2510 t.prototype._PTSNormalize = function(t, e) {
2511 var n;
2512 if (void 0 === e)
2513 return t;
2514 for (n = e < t ? -8589934592 : 8589934592; Math.abs(t - e) > 4294967296; )
2515 t += n;
2516 return t
2517 }
2518 ,
2519 t
2520 }();
2521 var R = function() {
2522 function t(e) {
2523 !function(t, e) {
2524 if (!(t instanceof e))
2525 throw new TypeError("Cannot call a class as a function")
2526 }(this, t),
2527 this.observer = e
2528 }
2529 return t.prototype.destroy = function() {}
2530 ,
2531 t.prototype.resetTimeStamp = function() {}
2532 ,
2533 t.prototype.resetInitSegment = function() {}
2534 ,
2535 t.prototype.remux = function(t, e, n, r, o, a, s, l) {
2536 var u = this.observer
2537 , c = "";
2538 t && (c += "audio"),
2539 e && (c += "video"),
2540 u.trigger(i.a.FRAG_PARSING_DATA, {
2541 data1: l,
2542 startPTS: o,
2543 startDTS: o,
2544 type: c,
2545 nb: 1,
2546 dropped: 0
2547 }),
2548 u.trigger(i.a.FRAG_PARSED)
2549 }
2550 ,
2551 t
2552 }();
2553 var I = function() {
2554 function t(e, n, i, r) {
2555 !function(t, e) {
2556 if (!(t instanceof e))
2557 throw new TypeError("Cannot call a class as a function")
2558 }(this, t),
2559 this.observer = e,
2560 this.typeSupported = n,
2561 this.config = i,
2562 this.vendor = r
2563 }
2564 return t.prototype.destroy = function() {
2565 var t = this.demuxer;
2566 t && t.destroy()
2567 }
2568 ,
2569 t.prototype.push = function(t, e, n, r, a, s, l, u, c, d, h, p) {
2570 if (t.byteLength > 0 && null != e && null != e.key && "AES-128" === e.method) {
2571 var f = this.decrypter;
2572 null == f && (f = this.decrypter = new o.a(this.observer,this.config));
2573 var y, v = this;
2574 try {
2575 y = performance.now()
2576 } catch (t) {
2577 y = Date.now()
2578 }
2579 f.decrypt(t, e.key.buffer, e.iv.buffer, function(t) {
2580 var o;
2581 try {
2582 o = performance.now()
2583 } catch (t) {
2584 o = Date.now()
2585 }
2586 v.observer.trigger(i.a.FRAG_DECRYPTED, {
2587 stats: {
2588 tstart: y,
2589 tdecrypt: o
2590 }
2591 }),
2592 v.pushDecrypted(new Uint8Array(t), e, new Uint8Array(n), r, a, s, l, u, c, d, h, p)
2593 })
2594 } else
2595 this.pushDecrypted(new Uint8Array(t), e, new Uint8Array(n), r, a, s, l, u, c, d, h, p)
2596 }
2597 ,
2598 t.prototype.pushDecrypted = function(t, e, n, o, a, s, l, u, c, d, h, p) {
2599 var f = this.demuxer;
2600 if (!f || l && !this.probe(t)) {
2601 for (var y = this.observer, g = this.typeSupported, b = this.config, _ = [{
2602 demux: T,
2603 remux: P
2604 }, {
2605 demux: m,
2606 remux: R
2607 }, {
2608 demux: v,
2609 remux: P
2610 }, {
2611 demux: w,
2612 remux: P
2613 }], A = 0, E = _.length; A < E; A++) {
2614 var k = _[A]
2615 , S = k.demux.probe;
2616 if (S(t)) {
2617 var C = this.remuxer = new k.remux(y,b,g,this.vendor);
2618 f = new k.demux(y,C,b,g),
2619 this.probe = S;
2620 break
2621 }
2622 }
2623 if (!f)
2624 return void y.trigger(i.a.ERROR, {
2625 type: r.b.MEDIA_ERROR,
2626 details: r.a.FRAG_PARSING_ERROR,
2627 fatal: !0,
2628 reason: "no demux matching with content found"
2629 });
2630 this.demuxer = f
2631 }
2632 var O = this.remuxer;
2633 (l || u) && (f.resetInitSegment(n, o, a, d),
2634 O.resetInitSegment()),
2635 l && (f.resetTimeStamp(p),
2636 O.resetTimeStamp(p)),
2637 "function" == typeof f.setDecryptData && f.setDecryptData(e),
2638 f.append(t, s, c, h)
2639 }
2640 ,
2641 t
2642 }();
2643 e.a = I
2644 },
2645 "3": function(t, e, n) {
2646 "use strict";
2647 n.d(e, "b", function() {
2648 return r
2649 });
2650 var i = function() {
2651 function t() {
2652 !function(t, e) {
2653 if (!(t instanceof e))
2654 throw new TypeError("Cannot call a class as a function")
2655 }(this, t)
2656 }
2657 return t.isHeader = function(t, e) {
2658 return e + 10 <= t.length && 73 === t[e] && 68 === t[e + 1] && 51 === t[e + 2] && t[e + 3] < 255 && t[e + 4] < 255 && t[e + 6] < 128 && t[e + 7] < 128 && t[e + 8] < 128 && t[e + 9] < 128
2659 }
2660 ,
2661 t.isFooter = function(t, e) {
2662 return e + 10 <= t.length && 51 === t[e] && 68 === t[e + 1] && 73 === t[e + 2] && t[e + 3] < 255 && t[e + 4] < 255 && t[e + 6] < 128 && t[e + 7] < 128 && t[e + 8] < 128 && t[e + 9] < 128
2663 }
2664 ,
2665 t.getID3Data = function(e, n) {
2666 for (var i = n, r = 0; t.isHeader(e, n); ) {
2667 r += 10,
2668 r += t._readSize(e, n + 6),
2669 t.isFooter(e, n + 10) && (r += 10),
2670 n += r
2671 }
2672 if (r > 0)
2673 return e.subarray(i, i + r)
2674 }
2675 ,
2676 t._readSize = function(t, e) {
2677 var n = 0;
2678 return n = (127 & t[e]) << 21,
2679 n |= (127 & t[e + 1]) << 14,
2680 n |= (127 & t[e + 2]) << 7,
2681 n |= 127 & t[e + 3]
2682 }
2683 ,
2684 t.getTimeStamp = function(e) {
2685 for (var n = t.getID3Frames(e), i = 0; i < n.length; i++) {
2686 var r = n[i];
2687 if (t.isTimeStampFrame(r))
2688 return t._readTimeStamp(r)
2689 }
2690 }
2691 ,
2692 t.isTimeStampFrame = function(t) {
2693 return t && "PRIV" === t.key && "com.apple.streaming.transportStreamTimestamp" === t.info
2694 }
2695 ,
2696 t._getFrameData = function(e) {
2697 var n = String.fromCharCode(e[0], e[1], e[2], e[3])
2698 , i = t._readSize(e, 4);
2699 return {
2700 type: n,
2701 size: i,
2702 data: e.subarray(10, 10 + i)
2703 }
2704 }
2705 ,
2706 t.getID3Frames = function(e) {
2707 for (var n = 0, i = []; t.isHeader(e, n); ) {
2708 for (var r = t._readSize(e, n + 6), o = (n += 10) + r; n + 8 < o; ) {
2709 var a = t._getFrameData(e.subarray(n))
2710 , s = t._decodeFrame(a);
2711 s && i.push(s),
2712 n += a.size + 10
2713 }
2714 t.isFooter(e, n) && (n += 10)
2715 }
2716 return i
2717 }
2718 ,
2719 t._decodeFrame = function(e) {
2720 return "PRIV" === e.type ? t._decodePrivFrame(e) : "T" === e.type[0] ? t._decodeTextFrame(e) : "W" === e.type[0] ? t._decodeURLFrame(e) : void 0
2721 }
2722 ,
2723 t._readTimeStamp = function(t) {
2724 if (8 === t.data.byteLength) {
2725 var e = new Uint8Array(t.data)
2726 , n = 1 & e[3]
2727 , i = (e[4] << 23) + (e[5] << 15) + (e[6] << 7) + e[7];
2728 return i /= 45,
2729 n && (i += 47721858.84),
2730 Math.round(i)
2731 }
2732 }
2733 ,
2734 t._decodePrivFrame = function(e) {
2735 if (!(e.size < 2)) {
2736 var n = t._utf8ArrayToStr(e.data, !0)
2737 , i = new Uint8Array(e.data.subarray(n.length + 1));
2738 return {
2739 key: e.type,
2740 info: n,
2741 data: i.buffer
2742 }
2743 }
2744 }
2745 ,
2746 t._decodeTextFrame = function(e) {
2747 if (!(e.size < 2)) {
2748 if ("TXXX" === e.type) {
2749 var n = 1
2750 , i = t._utf8ArrayToStr(e.data.subarray(n));
2751 n += i.length + 1;
2752 var r = t._utf8ArrayToStr(e.data.subarray(n));
2753 return {
2754 key: e.type,
2755 info: i,
2756 data: r
2757 }
2758 }
2759 var o = t._utf8ArrayToStr(e.data.subarray(1));
2760 return {
2761 key: e.type,
2762 data: o
2763 }
2764 }
2765 }
2766 ,
2767 t._decodeURLFrame = function(e) {
2768 if ("WXXX" === e.type) {
2769 if (e.size < 2)
2770 return;
2771 var n = 1
2772 , i = t._utf8ArrayToStr(e.data.subarray(n));
2773 n += i.length + 1;
2774 var r = t._utf8ArrayToStr(e.data.subarray(n));
2775 return {
2776 key: e.type,
2777 info: i,
2778 data: r
2779 }
2780 }
2781 var o = t._utf8ArrayToStr(e.data);
2782 return {
2783 key: e.type,
2784 data: o
2785 }
2786 }
2787 ,
2788 t._utf8ArrayToStr = function(t) {
2789 for (var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = t.length, i = void 0, r = void 0, o = void 0, a = "", s = 0; s < n; ) {
2790 if (0 === (i = t[s++]) && e)
2791 return a;
2792 if (0 !== i && 3 !== i)
2793 switch (i >> 4) {
2794 case 0:
2795 case 1:
2796 case 2:
2797 case 3:
2798 case 4:
2799 case 5:
2800 case 6:
2801 case 7:
2802 a += String.fromCharCode(i);
2803 break;
2804 case 12:
2805 case 13:
2806 r = t[s++],
2807 a += String.fromCharCode((31 & i) << 6 | 63 & r);
2808 break;
2809 case 14:
2810 r = t[s++],
2811 o = t[s++],
2812 a += String.fromCharCode((15 & i) << 12 | (63 & r) << 6 | (63 & o) << 0)
2813 }
2814 }
2815 return a
2816 }
2817 ,
2818 t
2819 }()
2820 , r = i._utf8ArrayToStr;
2821 e.a = i
2822 },
2823 "4": function(t, e, n) {
2824 "use strict";
2825 var i = function() {
2826 function t(e, n) {
2827 !function(t, e) {
2828 if (!(t instanceof e))
2829 throw new TypeError("Cannot call a class as a function")
2830 }(this, t),
2831 this.subtle = e,
2832 this.aesIV = n
2833 }
2834 return t.prototype.decrypt = function(t, e) {
2835 return this.subtle.decrypt({
2836 name: "AES-CBC",
2837 iv: this.aesIV
2838 }, e, t)
2839 }
2840 ,
2841 t
2842 }();
2843 var r = function() {
2844 function t(e, n) {
2845 !function(t, e) {
2846 if (!(t instanceof e))
2847 throw new TypeError("Cannot call a class as a function")
2848 }(this, t),
2849 this.subtle = e,
2850 this.key = n
2851 }
2852 return t.prototype.expandKey = function() {
2853 return this.subtle.importKey("raw", this.key, {
2854 name: "AES-CBC"
2855 }, !1, ["encrypt", "decrypt"])
2856 }
2857 ,
2858 t
2859 }();
2860 var o = function() {
2861 function t() {
2862 !function(t, e) {
2863 if (!(t instanceof e))
2864 throw new TypeError("Cannot call a class as a function")
2865 }(this, t),
2866 this.rcon = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],
2867 this.subMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)],
2868 this.invSubMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)],
2869 this.sBox = new Uint32Array(256),
2870 this.invSBox = new Uint32Array(256),
2871 this.key = new Uint32Array(0),
2872 this.initTable()
2873 }
2874 return t.prototype.uint8ArrayToUint32Array_ = function(t) {
2875 for (var e = new DataView(t), n = new Uint32Array(4), i = 0; i < 4; i++)
2876 n[i] = e.getUint32(4 * i);
2877 return n
2878 }
2879 ,
2880 t.prototype.initTable = function() {
2881 var t = this.sBox
2882 , e = this.invSBox
2883 , n = this.subMix
2884 , i = n[0]
2885 , r = n[1]
2886 , o = n[2]
2887 , a = n[3]
2888 , s = this.invSubMix
2889 , l = s[0]
2890 , u = s[1]
2891 , c = s[2]
2892 , d = s[3]
2893 , h = new Uint32Array(256)
2894 , p = 0
2895 , f = 0
2896 , y = 0;
2897 for (y = 0; y < 256; y++)
2898 h[y] = y < 128 ? y << 1 : y << 1 ^ 283;
2899 for (y = 0; y < 256; y++) {
2900 var v = f ^ f << 1 ^ f << 2 ^ f << 3 ^ f << 4;
2901 v = v >>> 8 ^ 255 & v ^ 99,
2902 t[p] = v,
2903 e[v] = p;
2904 var g = h[p]
2905 , m = h[g]
2906 , b = h[m]
2907 , _ = 257 * h[v] ^ 16843008 * v;
2908 i[p] = _ << 24 | _ >>> 8,
2909 r[p] = _ << 16 | _ >>> 16,
2910 o[p] = _ << 8 | _ >>> 24,
2911 a[p] = _,
2912 _ = 16843009 * b ^ 65537 * m ^ 257 * g ^ 16843008 * p,
2913 l[v] = _ << 24 | _ >>> 8,
2914 u[v] = _ << 16 | _ >>> 16,
2915 c[v] = _ << 8 | _ >>> 24,
2916 d[v] = _,
2917 p ? (p = g ^ h[h[h[b ^ g]]],
2918 f ^= h[h[f]]) : p = f = 1
2919 }
2920 }
2921 ,
2922 t.prototype.expandKey = function(t) {
2923 for (var e = this.uint8ArrayToUint32Array_(t), n = !0, i = 0; i < e.length && n; )
2924 n = e[i] === this.key[i],
2925 i++;
2926 if (!n) {
2927 this.key = e;
2928 var r = this.keySize = e.length;
2929 if (4 !== r && 6 !== r && 8 !== r)
2930 throw new Error("Invalid aes key size=" + r);
2931 var o = this.ksRows = 4 * (r + 6 + 1)
2932 , a = void 0
2933 , s = void 0
2934 , l = this.keySchedule = new Uint32Array(o)
2935 , u = this.invKeySchedule = new Uint32Array(o)
2936 , c = this.sBox
2937 , d = this.rcon
2938 , h = this.invSubMix
2939 , p = h[0]
2940 , f = h[1]
2941 , y = h[2]
2942 , v = h[3]
2943 , g = void 0
2944 , m = void 0;
2945 for (a = 0; a < o; a++)
2946 a < r ? g = l[a] = e[a] : (m = g,
2947 a % r == 0 ? (m = c[(m = m << 8 | m >>> 24) >>> 24] << 24 | c[m >>> 16 & 255] << 16 | c[m >>> 8 & 255] << 8 | c[255 & m],
2948 m ^= d[a / r | 0] << 24) : r > 6 && a % r == 4 && (m = c[m >>> 24] << 24 | c[m >>> 16 & 255] << 16 | c[m >>> 8 & 255] << 8 | c[255 & m]),
2949 l[a] = g = (l[a - r] ^ m) >>> 0);
2950 for (s = 0; s < o; s++)
2951 a = o - s,
2952 m = 3 & s ? l[a] : l[a - 4],
2953 u[s] = s < 4 || a <= 4 ? m : p[c[m >>> 24]] ^ f[c[m >>> 16 & 255]] ^ y[c[m >>> 8 & 255]] ^ v[c[255 & m]],
2954 u[s] = u[s] >>> 0
2955 }
2956 }
2957 ,
2958 t.prototype.networkToHostOrderSwap = function(t) {
2959 return t << 24 | (65280 & t) << 8 | (16711680 & t) >> 8 | t >>> 24
2960 }
2961 ,
2962 t.prototype.decrypt = function(t, e, n) {
2963 for (var i, r, o = this.keySize + 6, a = this.invKeySchedule, s = this.invSBox, l = this.invSubMix, u = l[0], c = l[1], d = l[2], h = l[3], p = this.uint8ArrayToUint32Array_(n), f = p[0], y = p[1], v = p[2], g = p[3], m = new Int32Array(t), b = new Int32Array(m.length), _ = void 0, A = void 0, E = void 0, k = void 0, T = void 0, w = void 0, S = void 0, C = void 0, O = void 0, P = void 0, R = void 0, I = void 0, L = this.networkToHostOrderSwap; e < m.length; ) {
2964 for (O = L(m[e]),
2965 P = L(m[e + 1]),
2966 R = L(m[e + 2]),
2967 I = L(m[e + 3]),
2968 T = O ^ a[0],
2969 w = I ^ a[1],
2970 S = R ^ a[2],
2971 C = P ^ a[3],
2972 i = 4,
2973 r = 1; r < o; r++)
2974 _ = u[T >>> 24] ^ c[w >> 16 & 255] ^ d[S >> 8 & 255] ^ h[255 & C] ^ a[i],
2975 A = u[w >>> 24] ^ c[S >> 16 & 255] ^ d[C >> 8 & 255] ^ h[255 & T] ^ a[i + 1],
2976 E = u[S >>> 24] ^ c[C >> 16 & 255] ^ d[T >> 8 & 255] ^ h[255 & w] ^ a[i + 2],
2977 k = u[C >>> 24] ^ c[T >> 16 & 255] ^ d[w >> 8 & 255] ^ h[255 & S] ^ a[i + 3],
2978 T = _,
2979 w = A,
2980 S = E,
2981 C = k,
2982 i += 4;
2983 _ = s[T >>> 24] << 24 ^ s[w >> 16 & 255] << 16 ^ s[S >> 8 & 255] << 8 ^ s[255 & C] ^ a[i],
2984 A = s[w >>> 24] << 24 ^ s[S >> 16 & 255] << 16 ^ s[C >> 8 & 255] << 8 ^ s[255 & T] ^ a[i + 1],
2985 E = s[S >>> 24] << 24 ^ s[C >> 16 & 255] << 16 ^ s[T >> 8 & 255] << 8 ^ s[255 & w] ^ a[i + 2],
2986 k = s[C >>> 24] << 24 ^ s[T >> 16 & 255] << 16 ^ s[w >> 8 & 255] << 8 ^ s[255 & S] ^ a[i + 3],
2987 i += 3,
2988 b[e] = L(_ ^ f),
2989 b[e + 1] = L(k ^ y),
2990 b[e + 2] = L(E ^ v),
2991 b[e + 3] = L(A ^ g),
2992 f = O,
2993 y = P,
2994 v = R,
2995 g = I,
2996 e += 4
2997 }
2998 return b.buffer
2999 }
3000 ,
3001 t.prototype.destroy = function() {
3002 this.key = void 0,
3003 this.keySize = void 0,
3004 this.ksRows = void 0,
3005 this.sBox = void 0,
3006 this.invSBox = void 0,
3007 this.subMix = void 0,
3008 this.invSubMix = void 0,
3009 this.keySchedule = void 0,
3010 this.invKeySchedule = void 0,
3011 this.rcon = void 0
3012 }
3013 ,
3014 t
3015 }()
3016 , a = n(2)
3017 , s = n(0);
3018 var l = function() {
3019 function t(e, n) {
3020 !function(t, e) {
3021 if (!(t instanceof e))
3022 throw new TypeError("Cannot call a class as a function")
3023 }(this, t),
3024 this.observer = e,
3025 this.config = n,
3026 this.logEnabled = !0;
3027 try {
3028 var i = crypto || self.crypto;
3029 this.subtle = i.subtle || i.webkitSubtle
3030 } catch (t) {}
3031 this.disableWebCrypto = !this.subtle
3032 }
3033 return t.prototype.isSync = function() {
3034 return this.disableWebCrypto && this.config.enableSoftwareAES
3035 }
3036 ,
3037 t.prototype.decrypt = function(t, e, n, a) {
3038 var l = this;
3039 if (this.disableWebCrypto && this.config.enableSoftwareAES) {
3040 this.logEnabled && (s.b.log("JS AES decrypt"),
3041 this.logEnabled = !1);
3042 var u = this.decryptor;
3043 u || (this.decryptor = u = new o),
3044 u.expandKey(e),
3045 a(u.decrypt(t, 0, n))
3046 } else {
3047 this.logEnabled && (s.b.log("WebCrypto AES decrypt"),
3048 this.logEnabled = !1);
3049 var c = this.subtle;
3050 this.key !== e && (this.key = e,
3051 this.fastAesKey = new r(c,e)),
3052 this.fastAesKey.expandKey().then(function(r) {
3053 new i(c,n).decrypt(t, r).catch(function(i) {
3054 l.onWebCryptoError(i, t, e, n, a)
3055 }).then(function(t) {
3056 a(t)
3057 })
3058 }).catch(function(i) {
3059 l.onWebCryptoError(i, t, e, n, a)
3060 })
3061 }
3062 }
3063 ,
3064 t.prototype.onWebCryptoError = function(t, e, n, i, r) {
3065 this.config.enableSoftwareAES ? (s.b.log("WebCrypto Error, disable WebCrypto API"),
3066 this.disableWebCrypto = !0,
3067 this.logEnabled = !0,
3068 this.decrypt(e, n, i, r)) : (s.b.error("decrypting error : " + t.message),
3069 this.observer.trigger(Event.ERROR, {
3070 type: a.b.MEDIA_ERROR,
3071 details: a.a.FRAG_DECRYPT_ERROR,
3072 fatal: !0,
3073 reason: t.message
3074 }))
3075 }
3076 ,
3077 t.prototype.destroy = function() {
3078 var t = this.decryptor;
3079 t && (t.destroy(),
3080 this.decryptor = void 0)
3081 }
3082 ,
3083 t
3084 }();
3085 e.a = l
3086 },
3087 "2": function(t, e, n) {
3088 "use strict";
3089 n.d(e, "b", function() {
3090 return i
3091 }),
3092 n.d(e, "a", function() {
3093 return r
3094 });
3095 var i = {
3096 NETWORK_ERROR: "networkError",
3097 MEDIA_ERROR: "mediaError",
3098 MUX_ERROR: "muxError",
3099 OTHER_ERROR: "otherError"
3100 }
3101 , r = {
3102 MANIFEST_LOAD_ERROR: "manifestLoadError",
3103 MANIFEST_LOAD_TIMEOUT: "manifestLoadTimeOut",
3104 MANIFEST_PARSING_ERROR: "manifestParsingError",
3105 MANIFEST_INCOMPATIBLE_CODECS_ERROR: "manifestIncompatibleCodecsError",
3106 LEVEL_LOAD_ERROR: "levelLoadError",
3107 LEVEL_LOAD_TIMEOUT: "levelLoadTimeOut",
3108 LEVEL_SWITCH_ERROR: "levelSwitchError",
3109 AUDIO_TRACK_LOAD_ERROR: "audioTrackLoadError",
3110 AUDIO_TRACK_LOAD_TIMEOUT: "audioTrackLoadTimeOut",
3111 FRAG_LOAD_ERROR: "fragLoadError",
3112 FRAG_LOOP_LOADING_ERROR: "fragLoopLoadingError",
3113 FRAG_LOAD_TIMEOUT: "fragLoadTimeOut",
3114 FRAG_DECRYPT_ERROR: "fragDecryptError",
3115 FRAG_PARSING_ERROR: "fragParsingError",
3116 REMUX_ALLOC_ERROR: "remuxAllocError",
3117 KEY_LOAD_ERROR: "keyLoadError",
3118 KEY_LOAD_TIMEOUT: "keyLoadTimeOut",
3119 BUFFER_ADD_CODEC_ERROR: "bufferAddCodecError",
3120 BUFFER_APPEND_ERROR: "bufferAppendError",
3121 BUFFER_APPENDING_ERROR: "bufferAppendingError",
3122 BUFFER_STALLED_ERROR: "bufferStalledError",
3123 BUFFER_FULL_ERROR: "bufferFullError",
3124 BUFFER_SEEK_OVER_HOLE: "bufferSeekOverHole",
3125 BUFFER_NUDGE_ON_STALL: "bufferNudgeOnStall",
3126 INTERNAL_EXCEPTION: "internalException"
3127 }
3128 }
3129})(self);