1/** 2 * @license 3 * Video.js 8.20.0 <http://videojs.com/> 4 * Copyright Brightcove, Inc. <https://www.brightcove.com/> 5 * Available under Apache License Version 2.0 6 * <https://github.com/videojs/video.js/blob/main/LICENSE> 7 * 8 * Includes vtt.js <https://github.com/mozilla/vtt.js> 9 * Available under Apache License Version 2.0 10 * <https://github.com/mozilla/vtt.js/blob/main/LICENSE> 11 */ 12!(function (e, t) { 13 'object' == typeof exports && 'undefined' != typeof module 14 ? (module.exports = t()) 15 : 'function' == typeof define && define.amd 16 ? define(t) 17 : ((e = 'undefined' != typeof globalThis ? globalThis : e || self).videojs = t()); 18})(this, function () { 19 var M = '8.20.0'; 20 let U = {}, 21 B = function (e, t) { 22 return ((U[e] = U[e] || []), t && (U[e] = U[e].concat(t)), U[e]); 23 }; 24 function F(e, t) { 25 return !((t = B(e).indexOf(t)) <= -1 || ((U[e] = U[e].slice()), U[e].splice(t, 1), 0)); 26 } 27 let q = { prefixed: !0 }; 28 var j = [ 29 [ 30 'requestFullscreen', 31 'exitFullscreen', 32 'fullscreenElement', 33 'fullscreenEnabled', 34 'fullscreenchange', 35 'fullscreenerror', 36 'fullscreen' 37 ], 38 [ 39 'webkitRequestFullscreen', 40 'webkitExitFullscreen', 41 'webkitFullscreenElement', 42 'webkitFullscreenEnabled', 43 'webkitfullscreenchange', 44 'webkitfullscreenerror', 45 '-webkit-full-screen' 46 ] 47 ], 48 V = j[0]; 49 let H; 50 for (let e = 0; e < j.length; e++) 51 if (j[e][1] in document) { 52 H = j[e]; 53 break; 54 } 55 if (H) { 56 for (let e = 0; e < H.length; e++) q[V[e]] = H[e]; 57 q.prefixed = H[0] !== V[0]; 58 } 59 let z = []; 60 function $(e) { 61 return Y(e) ? Object.keys(e) : []; 62 } 63 let o = (function s(r, n = ':', a = '') { 64 let t = 'info', 65 i; 66 function o(...e) { 67 i('log', t, e); 68 } 69 var l, d, h; 70 return ( 71 (i = 72 ((l = r), 73 (h = a), 74 (t, i, s) => { 75 var e, 76 i = d.levels[i], 77 r = new RegExp(`^(${i})$`); 78 let n = l; 79 if ( 80 ('log' !== t && s.unshift(t.toUpperCase() + ':'), 81 h && ((n = '%c' + l), s.unshift(h)), 82 s.unshift(n + ':'), 83 z && (z.push([].concat(s)), (e = z.length - 1e3), z.splice(0, 0 < e ? e : 0)), 84 window.console) 85 ) { 86 let e = window.console[t]; 87 (e = e || 'debug' !== t ? e : window.console.info || window.console.log) && 88 i && 89 r.test(t) && 90 e[Array.isArray(s) ? 'apply' : 'call'](window.console, s); 91 } 92 })), 93 ((d = o).createLogger = (e, t, i) => 94 s(r + ` ${(t = void 0 !== t ? t : n)} ` + e, t, void 0 !== i ? i : a)), 95 (o.createNewLogger = (e, t, i) => s(e, t, i)), 96 (o.levels = { 97 all: 'debug|log|warn|error', 98 off: '', 99 debug: 'debug|log|warn|error', 100 info: 'log|warn|error', 101 warn: 'warn|error', 102 error: 'error', 103 DEFAULT: t 104 }), 105 (o.level = (e) => { 106 if ('string' == typeof e) { 107 if (!o.levels.hasOwnProperty(e)) throw new Error(`"${e}" in not a valid log level`); 108 t = e; 109 } 110 return t; 111 }), 112 ((o.history = () => (z ? [].concat(z) : [])).filter = (t) => 113 (z || []).filter((e) => new RegExp(`.*${t}.*`).test(e[0]))), 114 (o.history.clear = () => { 115 z && (z.length = 0); 116 }), 117 (o.history.disable = () => { 118 null !== z && ((z.length = 0), (z = null)); 119 }), 120 (o.history.enable = () => { 121 null === z && (z = []); 122 }), 123 (o.error = (...e) => i('error', t, e)), 124 (o.warn = (...e) => i('warn', t, e)), 125 (o.debug = (...e) => i('debug', t, e)), 126 o 127 ); 128 })('VIDEOJS'), 129 W = o.createLogger, 130 G = Object.prototype.toString; 131 function X(t, i) { 132 $(t).forEach((e) => i(t[e], e)); 133 } 134 function K(i, s, e = 0) { 135 return $(i).reduce((e, t) => s(e, i[t], t), e); 136 } 137 function Y(e) { 138 return !!e && 'object' == typeof e; 139 } 140 function Q(e) { 141 return Y(e) && '[object Object]' === G.call(e) && e.constructor === Object; 142 } 143 function d(...e) { 144 let i = {}; 145 return ( 146 e.forEach((e) => { 147 e && 148 X(e, (e, t) => { 149 Q(e) ? (Q(i[t]) || (i[t] = {}), (i[t] = d(i[t], e))) : (i[t] = e); 150 }); 151 }), 152 i 153 ); 154 } 155 function J(e = {}) { 156 var t, 157 i, 158 s = []; 159 for (t in e) e.hasOwnProperty(t) && ((i = e[t]), s.push(i)); 160 return s; 161 } 162 function Z(t, i, s, e = !0) { 163 let r = (e) => Object.defineProperty(t, i, { value: e, enumerable: !0, writable: !0 }); 164 var n = { 165 configurable: !0, 166 enumerable: !0, 167 get() { 168 var e = s(); 169 return (r(e), e); 170 } 171 }; 172 return (e && (n.set = r), Object.defineProperty(t, i, n)); 173 } 174 let ee = Object.freeze({ 175 __proto__: null, 176 each: X, 177 reduce: K, 178 isObject: Y, 179 isPlain: Q, 180 merge: d, 181 values: J, 182 defineLazyProperty: Z 183 }), 184 te = !1, 185 ie = null, 186 se = !1, 187 re, 188 ne = !1, 189 ae = !1, 190 oe = !1, 191 le = !1, 192 de = null, 193 he = null; 194 var e = Boolean( 195 window.cast && window.cast.framework && window.cast.framework.CastReceiverContext 196 ); 197 let ue = null, 198 ce = !1, 199 pe = !1, 200 me = !1, 201 ge = !1, 202 fe = !1, 203 ye = !1, 204 _e = !1, 205 ve = Boolean( 206 Ee() && 207 ('ontouchstart' in window || 208 window.navigator.maxTouchPoints || 209 (window.DocumentTouch && window.document instanceof window.DocumentTouch)) 210 ); 211 var be, 212 t = window.navigator && window.navigator.userAgentData; 213 if ( 214 (t && 215 t.platform && 216 t.brands && 217 ((se = 'Android' === t.platform), 218 (ae = Boolean(t.brands.find((e) => 'Microsoft Edge' === e.brand))), 219 (oe = Boolean(t.brands.find((e) => 'Chromium' === e.brand))), 220 (le = !ae && oe), 221 (de = he = (t.brands.find((e) => 'Chromium' === e.brand) || {}).version || null), 222 (pe = 'Windows' === t.platform)), 223 !oe) 224 ) { 225 let i = (window.navigator && window.navigator.userAgent) || ''; 226 ((te = /iPod/i.test(i)), 227 (ie = (t = i.match(/OS (\d+)_/i)) && t[1] ? t[1] : null),
228 (se = /Android/i.test(i)), 229 (re = (t = i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i)) 230 ? ((vi = t[1] && parseFloat(t[1])), 231 (be = t[2] && parseFloat(t[2])), 232 vi && be ? parseFloat(t[1] + '.' + t[2]) : vi || null) 233 : null), 234 (ne = /Firefox/i.test(i)), 235 (ae = /Edg/i.test(i)), 236 (oe = /Chrome/i.test(i) || /CriOS/i.test(i)), 237 (le = !ae && oe), 238 (de = he = (be = i.match(/(Chrome|CriOS)\/(\d+)/)) && be[2] ? parseFloat(be[2]) : null), 239 (ue = (function () { 240 var e = /MSIE\s(\d+)\.\d/.exec(i); 241 let t = e && parseFloat(e[1]); 242 return (t = !t && /Trident\/7.0/i.test(i) && /rv:11.0/.test(i) ? 11 : t); 243 })()), 244 (fe = /Tizen/i.test(i)), 245 (ye = /Web0S/i.test(i)), 246 (_e = fe || ye), 247 (ce = /Safari/i.test(i) && !le && !se && !ae && !_e), 248 (pe = /Windows/i.test(i)), 249 (me = /iPad/i.test(i) || (ce && ve && !/iPhone/i.test(i))), 250 (ge = /iPhone/i.test(i) && !me)); 251 } 252 let u = ge || me || te, 253 Te = (ce || u) && !le; 254 var Se = Object.freeze({ 255 __proto__: null, 256 get IS_IPOD() { 257 return te; 258 }, 259 get IOS_VERSION() { 260 return ie; 261 }, 262 get IS_ANDROID() { 263 return se; 264 }, 265 get ANDROID_VERSION() { 266 return re; 267 }, 268 get IS_FIREFOX() { 269 return ne; 270 }, 271 get IS_EDGE() { 272 return ae; 273 }, 274 get IS_CHROMIUM() { 275 return oe; 276 }, 277 get IS_CHROME() { 278 return le; 279 }, 280 get CHROMIUM_VERSION() { 281 return de; 282 }, 283 get CHROME_VERSION() { 284 return he; 285 }, 286 IS_CHROMECAST_RECEIVER: e, 287 get IE_VERSION() { 288 return ue; 289 }, 290 get IS_SAFARI() { 291 return ce; 292 }, 293 get IS_WINDOWS() { 294 return pe; 295 }, 296 get IS_IPAD() { 297 return me; 298 }, 299 get IS_IPHONE() { 300 return ge; 301 }, 302 get IS_TIZEN() { 303 return fe; 304 }, 305 get IS_WEBOS() { 306 return ye; 307 }, 308 get IS_SMART_TV() { 309 return _e; 310 }, 311 TOUCH_ENABLED: ve, 312 IS_IOS: u, 313 IS_ANY_SAFARI: Te 314 }); 315 function we(e) { 316 return 'string' == typeof e && Boolean(e.trim()); 317 } 318 function Ee() { 319 return document === window.document; 320 } 321 function Ce(e) { 322 return Y(e) && 1 === e.nodeType; 323 } 324 function ke() { 325 try { 326 return window.parent !== window.self; 327 } catch (e) { 328 return !0; 329 } 330 } 331 function Ie(i) { 332 return function (e, t) { 333 return we(e) 334 ? (t = Ce((t = we(t) ? document.querySelector(t) : t)) ? t : document)[i] && t[i](e) 335 : document[i](null); 336 }; 337 } 338 function l(e = 'div', i = {}, t = {}, s) { 339 let r = document.createElement(e); 340 return ( 341 Object.getOwnPropertyNames(i).forEach(function (e) { 342 var t = i[e]; 343 'textContent' === e ? xe(r, t) : (r[e] === t && 'tabIndex' !== e) || (r[e] = t); 344 }), 345 Object.getOwnPropertyNames(t).forEach(function (e) { 346 r.setAttribute(e, t[e]); 347 }), 348 s && Ge(r, s), 349 r 350 ); 351 } 352 function xe(e, t) { 353 return ('undefined' == typeof e.textContent ? (e.innerText = t) : (e.textContent = t), e); 354 } 355 function Ae(e, t) { 356 t.firstChild ? t.insertBefore(e, t.firstChild) : t.appendChild(e); 357 } 358 function De(e, t) { 359 if (0 <= t.indexOf(' ')) throw new Error('class has illegal whitespace characters'); 360 return e.classList.contains(t); 361 } 362 function Pe(e, ...t) { 363 return (e.classList.add(...t.reduce((e, t) => e.concat(t.split(/\s+/)), [])), e); 364 } 365 function Le(e, ...t) { 366 return e 367 ? (e.classList.remove(...t.reduce((e, t) => e.concat(t.split(/\s+/)), [])), e) 368 : (o.warn("removeClass was called with an element that doesn't exist"), null); 369 } 370 function Oe(t, e, i) { 371 return ( 372 'boolean' != typeof (i = 'function' == typeof i ? i(t, e) : i) && (i = void 0), 373 e.split(/\s+/).forEach((e) => t.classList.toggle(e, i)), 374 t 375 ); 376 } 377 function Re(i, s) { 378 Object.getOwnPropertyNames(s).forEach(function (e) { 379 var t = s[e]; 380 null === t || 'undefined' == typeof t || !1 === t 381 ? i.removeAttribute(e) 382 : i.setAttribute(e, !0 === t ? '' : t); 383 }); 384 } 385 function Ne(e) { 386 var i = {}, 387 s = ['autoplay', 'controls', 'playsinline', 'loop', 'muted', 'default', 'defaultMuted']; 388 if (e && e.attributes && 0 < e.attributes.length) { 389 var r = e.attributes; 390 for (let t = r.length - 1; 0 <= t; t--) { 391 var n = r[t].name; 392 let e = r[t].value; 393 (s.includes(n) && (e = null !== e), (i[n] = e)); 394 } 395 } 396 return i; 397 } 398 function Me(e, t) { 399 return e.getAttribute(t); 400 } 401 function Ue(e, t, i) { 402 e.setAttribute(t, i); 403 } 404 function Be(e, t) { 405 e.removeAttribute(t); 406 } 407 function Fe() { 408 (document.body.focus(), 409 (document.onselectstart = function () { 410 return !1; 411 })); 412 } 413 function qe() { 414 document.onselectstart = function () { 415 return !0; 416 }; 417 } 418 function je(e) { 419 if (e && e.getBoundingClientRect && e.parentNode) { 420 let t = e.getBoundingClientRect(), 421 i = {}; 422 return ( 423 ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach((e) => { 424 void 0 !== t[e] && (i[e] = t[e]); 425 }), 426 i.height || (i.height = parseFloat(Je(e, 'height'))), 427 i.width || (i.width = parseFloat(Je(e, 'width'))), 428 i 429 ); 430 } 431 } 432 function Ve(e) { 433 if (!e || !e.offsetParent) return { left: 0, top: 0, width: 0, height: 0 }; 434 var t = e.offsetWidth, 435 i = e.offsetHeight; 436 let s = 0, 437 r = 0; 438 for (; e.offsetParent && e !== document[q.fullscreenElement]; ) 439 ((s += e.offsetLeft), (r += e.offsetTop), (e = e.offsetParent)); 440 return { left: s, top: r, width: t, height: i }; 441 } 442 function He(t, e) { 443 var i = { x: 0, y: 0 }; 444 if (u) { 445 let e = t; 446 for (; e && 'html' !== e.nodeName.toLowerCase(); ) { 447 var s, 448 r = Je(e, 'transform'); 449 (/^matrix/.test(r)
450 ? ((s = r.slice(7, -1).split(/,\s/).map(Number)), (i.x += s[4]), (i.y += s[5])) 451 : /^matrix3d/.test(r) && 452 ((s = r.slice(9, -1).split(/,\s/).map(Number)), (i.x += s[12]), (i.y += s[13])), 453 e.assignedSlot && 454 e.assignedSlot.parentElement && 455 window.WebKitCSSMatrix && 456 ((r = window.getComputedStyle(e.assignedSlot.parentElement).transform), 457 (r = new window.WebKitCSSMatrix(r)), 458 (i.x += r.m41), 459 (i.y += r.m42)), 460 (e = e.parentNode || e.host)); 461 } 462 } 463 var n = {}, 464 a = Ve(e.target), 465 t = Ve(t), 466 o = t.width, 467 l = t.height; 468 let d = e.offsetY - (t.top - a.top), 469 h = e.offsetX - (t.left - a.left); 470 return ( 471 e.changedTouches && 472 ((h = e.changedTouches[0].pageX - t.left), (d = e.changedTouches[0].pageY + t.top), u) && 473 ((h -= i.x), (d -= i.y)), 474 (n.y = 1 - Math.max(0, Math.min(1, d / l))), 475 (n.x = Math.max(0, Math.min(1, h / o))), 476 n 477 ); 478 } 479 function ze(e) { 480 return Y(e) && 3 === e.nodeType; 481 } 482 function $e(e) { 483 for (; e.firstChild; ) e.removeChild(e.firstChild); 484 return e; 485 } 486 function We(e) { 487 return ( 488 'function' == typeof e && (e = e()), 489 (Array.isArray(e) ? e : [e]) 490 .map((e) => 491 Ce((e = 'function' == typeof e ? e() : e)) || ze(e) 492 ? e 493 : 'string' == typeof e && /\S/.test(e) 494 ? document.createTextNode(e) 495 : void 0 496 ) 497 .filter((e) => e) 498 ); 499 } 500 function Ge(t, e) { 501 return (We(e).forEach((e) => t.appendChild(e)), t); 502 } 503 function Xe(e, t) { 504 return Ge($e(e), t); 505 } 506 function Ke(e) { 507 return ( 508 (void 0 === e.button && void 0 === e.buttons) || 509 (0 === e.button && void 0 === e.buttons) || 510 ('mouseup' === e.type && 0 === e.button && 0 === e.buttons) || 511 ('mousedown' === e.type && 0 === e.button && 0 === e.buttons) || 512 (0 === e.button && 1 === e.buttons) 513 ); 514 } 515 let Ye = Ie('querySelector'), 516 Qe = Ie('querySelectorAll'); 517 function Je(t, i) { 518 if (!t || !i) return ''; 519 if ('function' != typeof window.getComputedStyle) return ''; 520 { 521 let e; 522 try { 523 e = window.getComputedStyle(t); 524 } catch (e) { 525 return ''; 526 } 527 return e ? e.getPropertyValue(i) || e[i] : ''; 528 } 529 } 530 function Ze(s) { 531 [...document.styleSheets].forEach((t) => { 532 try { 533 var i = [...t.cssRules].map((e) => e.cssText).join(''), 534 e = document.createElement('style'); 535 ((e.textContent = i), s.document.head.appendChild(e)); 536 } catch (e) { 537 i = document.createElement('link'); 538 ((i.rel = 'stylesheet'), 539 (i.type = t.type), 540 (i.media = t.media.mediaText), 541 (i.href = t.href), 542 s.document.head.appendChild(i)); 543 } 544 }); 545 } 546 var et = Object.freeze({ 547 __proto__: null, 548 isReal: Ee, 549 isEl: Ce, 550 isInFrame: ke, 551 createEl: l, 552 textContent: xe, 553 prependTo: Ae, 554 hasClass: De, 555 addClass: Pe, 556 removeClass: Le, 557 toggleClass: Oe, 558 setAttributes: Re, 559 getAttributes: Ne, 560 getAttribute: Me, 561 setAttribute: Ue, 562 removeAttribute: Be, 563 blockTextSelection: Fe, 564 unblockTextSelection: qe, 565 getBoundingClientRect: je, 566 findPosition: Ve, 567 getPointerPosition: He, 568 isTextNode: ze, 569 emptyEl: $e, 570 normalizeContent: We, 571 appendContent: Ge, 572 insertContent: Xe, 573 isSingleLeftClick: Ke, 574 $: Ye, 575 $$: Qe, 576 computedStyle: Je, 577 copyStyleSheetsToWindow: Ze 578 }); 579 function tt() { 580 if (!1 !== st.options.autoSetup) { 581 var e = Array.prototype.slice.call(document.getElementsByTagName('video')), 582 t = Array.prototype.slice.call(document.getElementsByTagName('audio')), 583 i = Array.prototype.slice.call(document.getElementsByTagName('video-js')), 584 s = e.concat(t, i); 585 if (s && 0 < s.length) 586 for (let e = 0, t = s.length; e < t; e++) { 587 var r = s[e]; 588 if (!r || !r.getAttribute) { 589 rt(1); 590 break; 591 } 592 void 0 === r.player && null !== r.getAttribute('data-setup') && st(r); 593 } 594 else it || rt(1); 595 } 596 } 597 let it = !1, 598 st; 599 function rt(e, t) { 600 Ee() && (t && (st = t), window.setTimeout(tt, e)); 601 } 602 function nt() { 603 ((it = !0), window.removeEventListener('load', nt)); 604 } 605 Ee() && ('complete' === document.readyState ? nt() : window.addEventListener('load', nt)); 606 function at(e) { 607 var t = document.createElement('style'); 608 return ((t.className = e), t); 609 } 610 function ot(e, t) { 611 e.styleSheet ? (e.styleSheet.cssText = t) : (e.textContent = t); 612 }
613 var h = new WeakMap(); 614 let lt = 3; 615 function dt(e, t) { 616 var i; 617 h.has(e) && 618 (0 === (i = h.get(e)).handlers[t].length && 619 (delete i.handlers[t], 620 e.removeEventListener 621 ? e.removeEventListener(t, i.dispatcher, !1) 622 : e.detachEvent && e.detachEvent('on' + t, i.dispatcher)), 623 Object.getOwnPropertyNames(i.handlers).length <= 0 && 624 (delete i.handlers, delete i.dispatcher, delete i.disabled), 625 0 === Object.getOwnPropertyNames(i).length) && 626 h.delete(e); 627 } 628 function ht(t, i, e, s) { 629 e.forEach(function (e) { 630 t(i, e, s); 631 }); 632 } 633 function ut(t) { 634 if (!t.fixed_) { 635 if (!t || !t.isPropagationStopped || !t.isImmediatePropagationStopped) { 636 let e = t || window.event; 637 t = {}; 638 var i, 639 s, 640 r, 641 n = [ 642 'layerX', 643 'layerY', 644 'keyLocation', 645 'path', 646 'webkitMovementX', 647 'webkitMovementY', 648 'mozPressure', 649 'mozInputSource' 650 ]; 651 for (i in e) n.includes(i) || ('returnValue' === i && e.preventDefault) || (t[i] = e[i]); 652 (t.target || (t.target = t.srcElement || document), 653 t.relatedTarget || 654 (t.relatedTarget = t.fromElement === t.target ? t.toElement : t.fromElement), 655 (t.preventDefault = function () { 656 (e.preventDefault && e.preventDefault(), 657 (t.returnValue = !1), 658 (e.returnValue = !1), 659 (t.defaultPrevented = !0)); 660 }), 661 (t.defaultPrevented = !1), 662 (t.stopPropagation = function () { 663 (e.stopPropagation && e.stopPropagation(), 664 (t.cancelBubble = !0), 665 (e.cancelBubble = !0), 666 (t.isPropagationStopped = a)); 667 }), 668 (t.isPropagationStopped = o), 669 (t.stopImmediatePropagation = function () { 670 (e.stopImmediatePropagation && e.stopImmediatePropagation(), 671 (t.isImmediatePropagationStopped = a), 672 t.stopPropagation()); 673 }), 674 (t.isImmediatePropagationStopped = o), 675 null != t.clientX && 676 ((s = document.documentElement), 677 (r = document.body), 678 (t.pageX = 679 t.clientX + 680 ((s && s.scrollLeft) || (r && r.scrollLeft) || 0) - 681 ((s && s.clientLeft) || (r && r.clientLeft) || 0)), 682 (t.pageY = 683 t.clientY + 684 ((s && s.scrollTop) || (r && r.scrollTop) || 0) - 685 ((s && s.clientTop) || (r && r.clientTop) || 0))), 686 (t.which = t.charCode || t.keyCode), 687 null != t.button && 688 (t.button = 1 & t.button ? 0 : 4 & t.button ? 1 : 2 & t.button ? 2 : 0)); 689 } 690 t.fixed_ = !0; 691 } 692 return t; 693 function a() { 694 return !0; 695 } 696 function o() { 697 return !1; 698 } 699 } 700 let ct, 701 pt = ['touchstart', 'touchmove']; 702 function mt(n, t, e) { 703 if (Array.isArray(t)) return ht(mt, n, t, e); 704 h.has(n) || h.set(n, {}); 705 let a = h.get(n); 706 if ( 707 (a.handlers || (a.handlers = {}), 708 a.handlers[t] || (a.handlers[t] = []), 709 e.guid || (e.guid = lt++), 710 a.handlers[t].push(e), 711 a.dispatcher || 712 ((a.disabled = !1), 713 (a.dispatcher = function (i, s) { 714 if (!a.disabled) { 715 i = ut(i); 716 var e = a.handlers[i.type]; 717 if (e) { 718 var r = e.slice(0); 719 for (let e = 0, t = r.length; e < t && !i.isImmediatePropagationStopped(); e++) 720 try { 721 r[e].call(n, i, s); 722 } catch (e) { 723 o.error(e); 724 } 725 } 726 } 727 })), 728 1 === a.handlers[t].length) 729 ) 730 if (n.addEventListener) { 731 let e = !1; 732 ((function () { 733 if ('boolean' != typeof ct) { 734 ct = !1; 735 try { 736 var e = Object.defineProperty({}, 'passive', { 737 get() { 738 ct = !0; 739 } 740 }); 741 (window.addEventListener('test', null, e), 742 window.removeEventListener('test', null, e)); 743 } catch (e) {} 744 } 745 return ct; 746 })() && 747 -1 < pt.indexOf(t) && 748 (e = { passive: !0 }), 749 n.addEventListener(t, a.dispatcher, e)); 750 } else n.attachEvent && n.attachEvent('on' + t, a.dispatcher); 751 } 752 function c(e, t, s) { 753 if (h.has(e)) { 754 let i = h.get(e); 755 if (i.handlers) { 756 if (Array.isArray(t)) return ht(c, e, t, s); 757 var r = function (e, t) { 758 ((i.handlers[t] = []), dt(e, t)); 759 }; 760 if (void 0 === t) 761 for (var n in i.handlers) 762 Object.prototype.hasOwnProperty.call(i.handlers || {}, n) && r(e, n); 763 else { 764 var a = i.handlers[t]; 765 if (a) 766 if (s) { 767 if (s.guid) 768 for (let e = 0; e < a.length; e++) a[e].guid === s.guid && a.splice(e--, 1); 769 dt(e, t); 770 } else r(e, t); 771 } 772 } 773 } 774 } 775 function gt(e, t, i) { 776 var s = h.has(e) ? h.get(e) : {}, 777 r = e.parentNode || e.ownerDocument; 778 return ( 779 'string' == typeof t ? (t = { type: t, target: e }) : t.target || (t.target = e), 780 (t = ut(t)), 781 s.dispatcher && s.dispatcher.call(e, t, i), 782 r && !t.isPropagationStopped() && !0 === t.bubbles 783 ? gt.call(null, r, t, i) 784 : !r && 785 !t.defaultPrevented && 786 t.target && 787 t.target[t.type] && 788 (h.has(t.target) || h.set(t.target, {}), (s = h.get(t.target)), t.target[t.type]) && 789 ((s.disabled = !0), 790 'function' == typeof t.target[t.type] && t.target[t.type](), 791 (s.disabled = !1)), 792 !t.defaultPrevented 793 ); 794 } 795 function ft(e, t, i) { 796 if (Array.isArray(t)) return ht(ft, e, t, i); 797 function s() { 798 (c(e, t, s), i.apply(this, arguments)); 799 } 800 ((s.guid = i.guid = i.guid || lt++), mt(e, t, s)); 801 } 802 function yt(e, t, i) { 803 function s() { 804 (c(e, t, s), i.apply(this, arguments)); 805 } 806 ((s.guid = i.guid = i.guid || lt++), mt(e, t, s)); 807 } 808 var _t = Object.freeze({ 809 __proto__: null, 810 fixEvent: ut, 811 on: mt, 812 off: c, 813 trigger: gt, 814 one: ft, 815 any: yt 816 }); 817 function p(e, t, i) { 818 return (t.guid || (t.guid = lt++), ((e = t.bind(e)).guid = i ? i + '_' + t.guid : t.guid
818), e); 819 } 820 function vt(i, s) { 821 let r = window.performance.now(); 822 return function (...e) { 823 var t = window.performance.now(); 824 t - r >= s && (i(...e), (r = t)); 825 }; 826 } 827 function bt(s, r, n, a = window) { 828 let o; 829 function e() { 830 let e = this, 831 t = arguments, 832 i = function () { 833 ((o = null), (i = null), n || s.apply(e, t)); 834 }; 835 (!o && n && s.apply(e, t), a.clearTimeout(o), (o = a.setTimeout(i, r))); 836 } 837 return ( 838 (e.cancel = () => { 839 (a.clearTimeout(o), (o = null)); 840 }), 841 e 842 ); 843 } 844 let Tt = Object.freeze({ 845 __proto__: null, 846 UPDATE_REFRESH_INTERVAL: 30, 847 bind_: p, 848 throttle: vt, 849 debounce: bt 850 }), 851 St; 852 class wt { 853 on(e, t) { 854 var i = this.addEventListener; 855 ((this.addEventListener = () => {}), mt(this, e, t), (this.addEventListener = i)); 856 } 857 off(e, t) { 858 c(this, e, t); 859 } 860 one(e, t) { 861 var i = this.addEventListener; 862 ((this.addEventListener = () => {}), ft(this, e, t), (this.addEventListener = i)); 863 } 864 any(e, t) { 865 var i = this.addEventListener; 866 ((this.addEventListener = () => {}), yt(this, e, t), (this.addEventListener = i)); 867 } 868 trigger(e) { 869 var t = e.type || e; 870 ((e = ut((e = 'string' == typeof e ? { type: t } : e))), 871 this.allowedEvents_[t] && this['on' + t] && this['on' + t](e), 872 gt(this, e)); 873 } 874 queueTrigger(e) { 875 St = St || new Map(); 876 let t = e.type || e, 877 i = St.get(this); 878 i || ((i = new Map()), St.set(this, i)); 879 var s = i.get(t), 880 s = 881 (i.delete(t), 882 window.clearTimeout(s), 883 window.setTimeout(() => { 884 (i.delete(t), 0 === i.size && ((i = null), St.delete(this)), this.trigger(e)); 885 }, 0)); 886 i.set(t, s); 887 } 888 } 889 ((wt.prototype.allowedEvents_ = {}), 890 (wt.prototype.addEventListener = wt.prototype.on), 891 (wt.prototype.removeEventListener = wt.prototype.off), 892 (wt.prototype.dispatchEvent = wt.prototype.trigger)); 893 let Et = (e) => 894 'function' == typeof e.name 895 ? e.name() 896 : 'string' == typeof e.name 897 ? e.name 898 : e.name_ || (e.constructor && e.constructor.name ? e.constructor.name : typeof e), 899 Ct = (t) => 900 t instanceof wt || 901 (!!t.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every((e) => 'function' == typeof t[e])), 902 kt = (e) => ('string' == typeof e && /\S/.test(e)) || (Array.isArray(e) && !!e.length), 903 It = (e, t, i) => { 904 if (!e || (!e.nodeName && !Ct(e))) 905 throw new Error(`Invalid target for ${Et(t)}#${i}; must be a DOM node or evented object.`); 906 }, 907 xt = (e, t, i) => { 908 if (!kt(e)) 909 throw new Error( 910 `Invalid event type for ${Et(t)}#${i}; must be a non-empty string or array.` 911 ); 912 }, 913 At = (e, t, i) => { 914 if ('function' != typeof e) 915 throw new Error(`Invalid listener for ${Et(t)}#${i}; must be a function.`); 916 }, 917 Dt = (e, t, i) => { 918 var s = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_; 919 let r, n, a; 920 return ( 921 s 922 ? ((r = e.eventBusEl_), 3 <= t.length && t.shift(), ([n, a] = t)) 923 : ((r = t[0]), (n = t[1]), (a = t[2])), 924 It(r, e, i), 925 xt(n, e, i), 926 At(a, e, i), 927 (a = p(e, a)), 928 { isTargetingSelf: s, target: r, type: n, listener: a } 929 ); 930 }, 931 Pt = (e, t, i, s) => { 932 (It(e, e, t), e.nodeName ? _t[t](e, i, s) : e[t](i, s)); 933 }, 934 Lt = { 935 on(...t) { 936 let { isTargetingSelf: e, target: i, type: s, listener: r } = Dt(this, t, 'on'); 937 if ((Pt(i, 'on', s, r), !e)) { 938 let e = () => this.off(i, s, r); 939 e.guid = r.guid; 940 t = () => this.off('dispose', e); 941 ((t.guid = r.guid), Pt(this, 'on', 'dispose', e), Pt(i, 'on', 'dispose', t)); 942 } 943 }, 944 one(...e) { 945 let { isTargetingSelf: t, target: i, type: s, listener: r } = Dt(this, e, 'one'); 946 if (t) Pt(i, 'one', s, r); 947 else { 948 let t = (...e) => { 949 (this.off(i, s, t), r.apply(null, e)); 950 }; 951 ((t.guid = r.guid), Pt(i, 'one', s, t)); 952 } 953 }, 954 any(...e) { 955 let { isTargetingSelf: t, target: i, type: s, listener: r } = Dt(this, e, 'any'); 956 if (t) Pt(i, 'any', s, r); 957 else { 958 let t = (...e) => { 959 (this.off(i, s, t), r.apply(null, e)); 960 }; 961 ((t.guid = r.guid), Pt(i, 'any', s, t)); 962 } 963 }, 964 off(e, t, i) { 965 !e || kt(e) 966 ? c(this.eventBusEl_, e, t) 967 : ((e = e), 968 (t = t), 969 It(e, this, 'off'), 970 xt(t, this, 'off'), 971 At(i, this, 'off'), 972 (i = p(this, i)), 973 this.off('dispose', i), 974 e.nodeName 975 ? (c(e, t, i), c(e, 'dispose', i)) 976 : Ct(e) && (e.off(t, i), e.off('dispose', i))); 977 }, 978 trigger(e, t) { 979 It(this.eventBusEl_, this, 'trigger'); 980 var i = e && 'string' != typeof e ? e.type : e; 981 if (kt(i)) return gt(this.eventBusEl_, e, t); 982 throw new Error( 983 `Invalid event type for ${Et(this)}#trigger; ` + 984 'must be a non-empty string or object with a type key that has a non-empty value.' 985 ); 986 } 987 }; 988 function Ot(e, t = {}) { 989 t = t.eventBusKey; 990 if (t) { 991 if (!e[t].nodeName) throw new Error(`The eventBusKey "${t}" does not refer to an element.`); 992 e.eventBusEl_ = e[t]; 993 } else e.eventBusEl_ = l('span', { className: 'vjs-event-bus' }); 994 (Object.assign(e, Lt), 995 e.eventedCallbacks && 996 e.eventedCallbacks.forEach((e) => { 997 e(); 998 }), 999 e.on('dispose', () => { 1000 (e.off(), 1001 [e, e.el_, e.eventBusEl_].forEach(function (e) { 1002 e && h.has(e) && h.delete(e); 1003 }), 1004 window.setTimeout(() => { 1005 e.eventBusEl_ = null; 1006 }, 0)); 1007 })); 1008 } 1009 let Rt = { 1010 state: {}, 1011 setState(e) { 1012 'function' == typeof e && (e = e()); 1013 let i; 1014 return ( 1015 X(e, (e, t) => { 1016 (this.state[t] !== e && ((i = i || {})[t] = { from: this.state[t], to: e }), 1017 (this.state[t] = e)); 1018 }), 1019 i && Ct(this) && this.trigger({ changes: i, type: 'statechanged' }), 1020 i 1021 ); 1022 } 1023 }; 1024 function Nt(e, t) { 1025 (Object.assign(e, Rt), 1026 (e.state = Object.assign({}, e.state, t)), 1027 'function' == typeof e.handleStateChanged && 1028 Ct(e) && 1029 e.on('statechanged', e.handleStateChanged)); 1030 } 1031 function Mt(e) { 1032 return 'string' != typeof e ? e : e.replace(/./, (e) => e.toLowerCase()); 1033 } 1034 function m(e) { 1035 return 'string' != typeof e ? e : e.replace(/./, (e) => e.toUpperCase()); 1036 } 1037 function Ut(e, t) { 1038 return m(e) === m(t); 1039 } 1040 let Bt = Object.freeze({ __proto__: null, toLowerCase: Mt, toTitleCase: m, titleCaseEquals: Ut }); 1041 class g { 1042 constructor(e, t, i) { 1043 (!e && this.play ? (this.player_ = e = this) : (this.player_ = e), 1044 (this.isDisposed_ = !1), 1045 (this.parentComponent_ = null),
1046 (this.options_ = d({}, this.options_)), 1047 (t = this.options_ = d(this.options_, t)), 1048 (this.id_ = t.id || (t.el && t.el.id)), 1049 this.id_ || 1050 ((e = (e && e.id && e.id()) || 'no_player'), (this.id_ = e + '_component_' + lt++)), 1051 (this.name_ = t.name || null), 1052 t.el ? (this.el_ = t.el) : !1 !== t.createEl && (this.el_ = this.createEl()), 1053 t.className && this.el_ && t.className.split(' ').forEach((e) => this.addClass(e)), 1054 ['on', 'off', 'one', 'any', 'trigger'].forEach((e) => { 1055 this[e] = void 0; 1056 }), 1057 !1 !== t.evented && 1058 (Ot(this, { eventBusKey: this.el_ ? 'el_' : null }), 1059 (this.handleLanguagechange = this.handleLanguagechange.bind(this)), 1060 this.on(this.player_, 'languagechange', this.handleLanguagechange)), 1061 Nt(this, this.constructor.defaultState), 1062 (this.children_ = []), 1063 (this.childIndex_ = {}), 1064 (this.childNameIndex_ = {}), 1065 (this.setTimeoutIds_ = new Set()), 1066 (this.setIntervalIds_ = new Set()), 1067 (this.rafIds_ = new Set()), 1068 (this.namedRafs_ = new Map()), 1069 (this.clearingTimersOnDispose_ = !1) !== t.initChildren && this.initChildren(), 1070 this.ready(i), 1071 !1 !== t.reportTouchActivity && this.enableTouchActivity()); 1072 } 1073 dispose(e = {}) { 1074 if (!this.isDisposed_) { 1075 if ( 1076 (this.readyQueue_ && (this.readyQueue_.length = 0), 1077 this.trigger({ type: 'dispose', bubbles: !1 }), 1078 (this.isDisposed_ = !0), 1079 this.children_) 1080 ) 1081 for (let e = this.children_.length - 1; 0 <= e; e--) 1082 this.children_[e].dispose && this.children_[e].dispose(); 1083 ((this.children_ = null), 1084 (this.childIndex_ = null), 1085 (this.childNameIndex_ = null), 1086 (this.parentComponent_ = null), 1087 this.el_ && 1088 (this.el_.parentNode && 1089 (e.restoreEl 1090 ? this.el_.parentNode.replaceChild(e.restoreEl, this.el_) 1091 : this.el_.parentNode.removeChild(this.el_)), 1092 (this.el_ = null)), 1093 (this.player_ = null)); 1094 } 1095 } 1096 isDisposed() { 1097 return Boolean(this.isDisposed_); 1098 } 1099 player() { 1100 return this.player_; 1101 } 1102 options(e) { 1103 return (e && (this.options_ = d(this.options_, e)), this.options_); 1104 } 1105 el() { 1106 return this.el_; 1107 } 1108 createEl(e, t, i) { 1109 return l(e, t, i); 1110 } 1111 localize(e, s, t = e) { 1112 var i = this.player_.language && this.player_.language(), 1113 r = this.player_.languages && this.player_.languages(), 1114 n = r && r[i], 1115 i = i && i.split('-')[0], 1116 r = r && r[i]; 1117 let a = t; 1118 return ( 1119 n && n[e] ? (a = n[e]) : r && r[e] && (a = r[e]), 1120 (a = s 1121 ? a.replace(/\{(\d+)\}/g, function (e, t) { 1122 t = s[t - 1]; 1123 let i = 'undefined' == typeof t ? e : t; 1124 return i; 1125 }) 1126 : a) 1127 ); 1128 } 1129 handleLanguagechange() {} 1130 contentEl() { 1131 return this.contentEl_ || this.el_; 1132 } 1133 id() { 1134 return this.id_; 1135 } 1136 name() { 1137 return this.name_; 1138 } 1139 children() { 1140 return this.children_; 1141 } 1142 getChildById(e) { 1143 return this.childIndex_[e]; 1144 } 1145 getChild(e) { 1146 if (e) return this.childNameIndex_[e]; 1147 } 1148 getDescendant(...t) { 1149 t = t.reduce((e, t) => e.concat(t), []); 1150 let i = this; 1151 for (let e = 0; e < t.length; e++) if (!(i = i.getChild(t[e])) || !i.getChild) return; 1152 return i; 1153 } 1154 setIcon(e, t = this.el()) { 1155 var i, s, r; 1156 if (this.player_.options_.experimentalSvgIcons) 1157 return ( 1158 (r = 'http://www.w3.org/2000/svg'), 1159 (i = l( 1160 'span', 1161 { className: 'vjs-icon-placeholder vjs-svg-icon' }, 1162 { 'aria-hidden': 'true' } 1163 )), 1164 (s = document.createElementNS(r, 'svg')).setAttributeNS(null, 'viewBox', '0 0 512 512'), 1165 (r = document.createElementNS(r, 'use')), 1166 s.appendChild(r), 1167 r.setAttributeNS(null, 'href', '#vjs-icon-' + e), 1168 i.appendChild(s), 1169 this.iconIsSet_ 1170 ? t.replaceChild(i, t.querySelector('.vjs-icon-placeholder')) 1171 : t.appendChild(i), 1172 (this.iconIsSet_ = !0), 1173 i 1174 ); 1175 } 1176 addChild(e, t = {}, i = this.children_.length) { 1177 let s, r; 1178 if ('string' == typeof e) { 1179 r = m(e); 1180 var n = t.componentClass || r, 1181 a = ((t.name = r), g.getComponent(n)); 1182 if (!a) throw new Error(`Component ${n} does not exist`); 1183 if ('function' != typeof a) return null; 1184 s = new a(this.player_ || this, t); 1185 } else s = e; 1186 if ( 1187 (s.parentComponent_ && s.parentComponent_.removeChild(s), 1188 this.children_.splice(i, 0, s), 1189 (s.parentComponent_ = this), 1190 'function' == typeof s.id && (this.childIndex_[s.id()] = s), 1191 (r = r || (s.name && m(s.name()))) && 1192 ((this.childNameIndex_[r] = s), (this.childNameIndex_[Mt(r)] = s)), 1193 'function' == typeof s.el && s.el()) 1194 ) { 1195 let e = null; 1196 (this.children_[i + 1] && 1197 (this.children_[i + 1].el_ 1198 ? (e = this.children_[i + 1].el_) 1199 : Ce(this.children_[i + 1]) && (e = this.children_[i + 1])), 1200 this.contentEl().insertBefore(s.el(), e)); 1201 } 1202 return s; 1203 } 1204 removeChild(i) {
1205 if ((i = 'string' == typeof i ? this.getChild(i) : i) && this.children_) { 1206 let t = !1; 1207 for (let e = this.children_.length - 1; 0 <= e; e--) 1208 if (this.children_[e] === i) { 1209 ((t = !0), this.children_.splice(e, 1)); 1210 break; 1211 } 1212 var e; 1213 t && 1214 ((i.parentComponent_ = null), 1215 (this.childIndex_[i.id()] = null), 1216 (this.childNameIndex_[m(i.name())] = null), 1217 (this.childNameIndex_[Mt(i.name())] = null), 1218 (e = i.el())) && 1219 e.parentNode === this.contentEl() && 1220 this.contentEl().removeChild(i.el()); 1221 } 1222 } 1223 initChildren() { 1224 let r = this.options_.children; 1225 if (r) { 1226 let s = this.options_; 1227 let e, 1228 t = g.getComponent('Tech'); 1229 (e = Array.isArray(r) ? r : Object.keys(r)) 1230 .concat( 1231 Object.keys(this.options_).filter(function (t) { 1232 return !e.some(function (e) { 1233 return 'string' == typeof e ? t === e : t === e.name; 1234 }); 1235 }) 1236 ) 1237 .map((e) => { 1238 let t, i; 1239 return ( 1240 (i = 1241 'string' == typeof e 1242 ? ((t = e), r[t] || this.options_[t] || {}) 1243 : ((t = e.name), e)), 1244 { name: t, opts: i } 1245 ); 1246 }) 1247 .filter((e) => { 1248 e = g.getComponent(e.opts.componentClass || m(e.name)); 1249 return e && !t.isTech(e); 1250 }) 1251 .forEach((e) => { 1252 var t = e.name; 1253 let i = e.opts; 1254 !1 !== (i = void 0 !== s[t] ? s[t] : i) && 1255 (((i = !0 === i ? {} : i).playerOptions = this.options_.playerOptions), 1256 (e = this.addChild(t, i))) && 1257 (this[t] = e); 1258 }); 1259 } 1260 } 1261 buildCSSClass() { 1262 return ''; 1263 } 1264 ready(e, t = !1) { 1265 e && 1266 (this.isReady_ 1267 ? t 1268 ? e.call(this) 1269 : this.setTimeout(e, 1) 1270 : ((this.readyQueue_ = this.readyQueue_ || []), this.readyQueue_.push(e))); 1271 } 1272 triggerReady() { 1273 ((this.isReady_ = !0), 1274 this.setTimeout(function () { 1275 var e = this.readyQueue_; 1276 ((this.readyQueue_ = []), 1277 e && 1278 0 < e.length && 1279 e.forEach(function (e) { 1280 e.call(this); 1281 }, this), 1282 this.trigger('ready')); 1283 }, 1)); 1284 } 1285 $(e, t) { 1286 return Ye(e, t || this.contentEl()); 1287 } 1288 $$(e, t) { 1289 return Qe(e, t || this.contentEl()); 1290 } 1291 hasClass(e) { 1292 return De(this.el_, e); 1293 } 1294 addClass(...e) { 1295 Pe(this.el_, ...e); 1296 } 1297 removeClass(...e) { 1298 Le(this.el_, ...e); 1299 } 1300 toggleClass(e, t) { 1301 Oe(this.el_, e, t); 1302 } 1303 show() { 1304 this.removeClass('vjs-hidden'); 1305 } 1306 hide() { 1307 this.addClass('vjs-hidden'); 1308 } 1309 lockShowing() { 1310 this.addClass('vjs-lock-showing'); 1311 } 1312 unlockShowing() { 1313 this.removeClass('vjs-lock-showing'); 1314 } 1315 getAttribute(e) { 1316 return Me(this.el_, e); 1317 } 1318 setAttribute(e, t) { 1319 Ue(this.el_, e, t); 1320 } 1321 removeAttribute(e) { 1322 Be(this.el_, e); 1323 } 1324 width(e, t) { 1325 return this.dimension('width', e, t); 1326 } 1327 height(e, t) { 1328 return this.dimension('height', e, t); 1329 } 1330 dimensions(e, t) { 1331 (this.width(e, !0), this.height(t)); 1332 } 1333 dimension(e, t, i) { 1334 var s, r; 1335 if (void 0 === t) 1336 return this.el_ 1337 ? -1 !== (r = (s = this.el_.style[e]).indexOf('px')) 1338 ? parseInt(s.slice(0, r), 10) 1339 : parseInt(this.el_['offset' + m(e)], 10) 1340 : 0; 1341 (-1 !== ('' + (t = null !== t && t == t ? t : 0)).indexOf('%') || 1342 -1 !== ('' + t).indexOf('px') 1343 ? (this.el_.style[e] = t) 1344 : (this.el_.style[e] = 'auto' === t ? '' : t + 'px'), 1345 i || this.trigger('componentresize')); 1346 } 1347 currentDimension(e) { 1348 let t = 0; 1349 if ('width' !== e && 'height' !== e) 1350 throw new Error('currentDimension only accepts width or height value'); 1351 return ( 1352 (t = Je(this.el_, e)), 1353 (0 !== (t = parseFloat(t)) && !isNaN(t)) || ((e = 'offset' + m(e)), (t = this.el_[e])), 1354 t 1355 ); 1356 } 1357 currentDimensions() { 1358 return { width: this.currentDimension('width'), height: this.currentDimension('height') }; 1359 } 1360 currentWidth() { 1361 return this.currentDimension('width'); 1362 } 1363 currentHeight() { 1364 return this.currentDimension('height'); 1365 } 1366 getPositions() { 1367 var e = this.el_.getBoundingClientRect(); 1368 return { 1369 boundingClientRect: { 1370 x: e.x, 1371 y: e.y, 1372 width: e.width, 1373 height: e.height, 1374 top: e.top, 1375 right: e.right, 1376 bottom: e.bottom, 1377 left: e.left 1378 }, 1379 center: { 1380 x: e.left + e.width / 2, 1381 y: e.top + e.height / 2, 1382 width: 0, 1383 height: 0, 1384 top: e.top + e.height / 2, 1385 right: e.left + e.width / 2, 1386 bottom: e.top + e.height / 2, 1387 left: e.left + e.width / 2 1388 } 1389 }; 1390 } 1391 focus() { 1392 this.el_.focus(); 1393 } 1394 blur() { 1395 this.el_.blur(); 1396 } 1397 handleKeyDown(e) { 1398 this.player_ && 1399 ('Tab' === e.key || 1400 (this.player_.options_.playerOptions.spatialNavigation && 1401 this.player_.options_.playerOptions.spatialNavigation.enabled) || 1402 e.stopPropagation(), 1403 this.player_.handleKeyDown(e)); 1404 } 1405 handleKeyPress(e) { 1406 this.handleKeyDown(e); 1407 } 1408 emitTapEvents() { 1409 let t = 0, 1410 i = null, 1411 s; 1412 (this.on('touchstart', function (e) { 1413 1 === e.touches.length && 1414 ((i = { pageX: e.touches[0].pageX, pageY: e.touches[0].pageY }), 1415 (t = window.performance.now()), 1416 (s = !0)); 1417 }), 1418 this.on('touchmove', function (e) { 1419 var t; 1420 (1 < e.touches.length || 1421 (i && 1422 ((t = e.touches[0].pageX - i.pageX), 1423 (e = e.touches[0].pageY - i.pageY), 1424 10 < Math.sqrt(t * t + e * e)))) && 1425 (s = !1); 1426 })); 1427 function e() { 1428 s = !1; 1429 } 1430 (this.on('touchleave', e), 1431 this.on('touchcancel', e), 1432 this.on('touchend', function (e) { 1433 !(i = null) === s && 1434 window.performance.now() - t < 200 && 1435 (e.preventDefault(), this.trigger('tap')); 1436 })); 1437 } 1438 enableTouchActivity() { 1439 if (this.player() && this.player().reportUserActivity) { 1440 let t = p(this.player(), this.player().reportUserActivity), 1441 i; 1442 this.on('touchstart', function () { 1443 (t(), this.clearInterval(i), (i = this.setInterval(t, 250))); 1444 }); 1445 var e = function (e) { 1446 (t(), this.clearInterval(i)); 1447 }; 1448 (this.on('touchmove', t), this.on('touchend', e), this.on('touchcancel', e)); 1449 } 1450 } 1451 setTimeout(e, t) { 1452 var i; 1453 return ( 1454 (e = p(this, e)), 1455 this.clearTimersOnDispose_(), 1456 (i = window.setTimeout(() => { 1457 (this.setTimeoutIds_.has(i) && this.setTimeoutIds_.delete(i), e()); 1458 }, t)), 1459 this.setTimeoutIds_.add(i), 1460 i 1461 ); 1462 } 1463 clearTimeout(e) { 1464 return ( 1465 this.setTimeoutIds_.has(e) && (this.setTimeoutIds_.delete(e), window.clearTimeout(e)), 1466 e 1467 ); 1468 } 1469 setInterval(e, t) { 1470 ((e = p(this, e)), this.clearTimersOnDispose_()); 1471 e = window.setInterval(e, t); 1472 return (this.setIntervalIds_.add(e), e); 1473 } 1474 clearInterval(e) { 1475 return ( 1476 this.setIntervalIds_.has(e) && (this.setIntervalIds_.delete(e), window.clearInterval(e)), 1477 e 1478 ); 1479 } 1480 requestAnimationFrame(e) { 1481 var t; 1482 return ( 1483 this.clearTimersOnDispose_(), 1484 (e = p(this, e)), 1485 (t = window.requestAnimationFrame(() => { 1486 (this.rafIds_.has(t) && this.rafIds_.delete(t), e()); 1487 })), 1488 this.rafIds_.add(t), 1489 t 1490 ); 1491 } 1492 requestNamedAnimationFrame(e, t) { 1493 (this.namedRafs_.has(e) && this.cancelNamedAnimationFrame(e), 1494 this.clearTimersOnDispose_(), 1495 (t = p(this, t))); 1496 var i = this.requestAnimationFrame(() => { 1497 (t(), this.namedRafs_.has(e) && this.namedRafs_.delete(e)); 1498 }); 1499 return (this.namedRafs_.set(e, i), e); 1500 } 1501 cancelNamedAnimationFrame(e) { 1502 this.namedRafs_.has(e) && 1503 (this.cancelAnimationFrame(this.namedRafs_.get(e)), this.namedRafs_.delete(e)); 1504 } 1505 cancelAnimationFrame(e) { 1506 return (this.rafIds_.has(e) && (this.rafIds_.delete(e), window.cancelAnimationFrame(e)), e); 1507 } 1508 clearTimersOnDispose_() { 1509 this.clearingTimersOnDispose_ || 1510 ((this.clearingTimersOnDispose_ = !0), 1511 this.one('dispose', () => { 1512 ([ 1513 ['namedRafs_', 'cancelNamedAnimationFrame'], 1514 ['rafIds_', 'cancelAnimationFrame'], 1515 ['setTimeoutIds_', 'clearTimeout'], 1516 ['setIntervalIds_', 'clearInterval'] 1517 ].forEach(([e, i]) => { 1518 this[e].forEach((e, t) => this[i](t)); 1519 }), 1520 (this.clearingTimersOnDispose_ = !1)); 1521 })); 1522 } 1523 getIsDisabled() { 1524 return Boolean(this.el_.disabled); 1525 } 1526 getIsExpresslyInert() { 1527 return this.el_.inert && !this.el_.ownerDocument.documentElement.inert; 1528 }
1529 getIsFocusable(e) { 1530 return 0 <= (e || this.el_).tabIndex && !(this.getIsDisabled() || this.getIsExpresslyInert()); 1531 } 1532 getIsAvailableToBeFocused(e) { 1533 function t(e) { 1534 var e = window.getComputedStyle(e, null), 1535 t = e.getPropertyValue('visibility'); 1536 return 'none' !== e.getPropertyValue('display') && !['hidden', 'collapse'].includes(t); 1537 } 1538 var i; 1539 return !( 1540 !(function (t) { 1541 if ( 1542 t.offsetWidth + 1543 t.offsetHeight + 1544 t.getBoundingClientRect().height + 1545 t.getBoundingClientRect().width !== 1546 0 1547 ) { 1548 var i = { 1549 x: t.getBoundingClientRect().left + t.offsetWidth / 2, 1550 y: t.getBoundingClientRect().top + t.offsetHeight / 2 1551 }; 1552 if ( 1553 !( 1554 i.x < 0 || 1555 i.x > (document.documentElement.clientWidth || window.innerWidth) || 1556 i.y < 0 || 1557 i.y > (document.documentElement.clientHeight || window.innerHeight) 1558 ) 1559 ) { 1560 let e = document.elementFromPoint(i.x, i.y); 1561 for (; e; ) { 1562 if (e === t) return 1; 1563 if (!e.parentNode) return; 1564 e = e.parentNode; 1565 } 1566 } 1567 } 1568 })((e = e || this.el())) || 1569 !t((i = e).parentElement) || 1570 !t(i) || 1571 '0' === i.style.opacity || 1572 '0px' === window.getComputedStyle(i).height || 1573 '0px' === window.getComputedStyle(i).width || 1574 (e.parentElement && !(0 <= e.tabIndex)) 1575 ); 1576 } 1577 static registerComponent(t, e) { 1578 if ('string' != typeof t || !t) 1579 throw new Error(`Illegal component name, "${t}"; must be a non-empty string.`); 1580 var i = g.getComponent('Tech'), 1581 i = i && i.isTech(e), 1582 s = g === e || g.prototype.isPrototypeOf(e.prototype); 1583 if (i || !s) { 1584 let e; 1585 throw ( 1586 (e = i 1587 ? 'techs must be registered using Tech.registerTech()' 1588 : 'must be a Component subclass'), 1589 new Error(`Illegal component, "${t}"; ${e}.`) 1590 ); 1591 } 1592 ((t = m(t)), g.components_ || (g.components_ = {})); 1593 s = g.getComponent('Player'); 1594 if ('Player' === t && s && s.players) { 1595 let t = s.players; 1596 i = Object.keys(t); 1597 if (t && 0 < i.length && i.map((e) => t[e]).every(Boolean)) 1598 throw new Error('Can not register Player component after player has been created.'); 1599 } 1600 return ((g.components_[t] = e), (g.components_[Mt(t)] = e)); 1601 } 1602 static getComponent(e) { 1603 if (e && g.components_) return g.components_[e]; 1604 } 1605 } 1606 function Ft(e, t, i, s) { 1607 var r = s, 1608 n = i.length - 1; 1609 if ('number' != typeof r || r < 0 || n < r) 1610 throw new Error( 1611 `Failed to execute '${e}' on 'TimeRanges': The index provided (${r}) is non-numeric or out of bounds (0-${n}).` 1612 ); 1613 return i[s][t]; 1614 } 1615 function qt(e) { 1616 let t; 1617 return ( 1618 (t = 1619 void 0 === e || 0 === e.length 1620 ? { 1621 length: 0, 1622 start() { 1623 throw new Error('This TimeRanges object is empty'); 1624 }, 1625 end() { 1626 throw new Error('This TimeRanges object is empty'); 1627 } 1628 } 1629 : { 1630 length: e.length, 1631 start: Ft.bind(null, 'start', 0, e), 1632 end: Ft.bind(null, 'end', 1, e) 1633 }), 1634 window.Symbol && 1635 window.Symbol.iterator && 1636 (t[window.Symbol.iterator] = () => (e || []).values()), 1637 t 1638 ); 1639 } 1640 function jt(e, t) { 1641 return Array.isArray(e) ? qt(e) : void 0 === e || void 0 === t ? qt() : qt([[e, t]]); 1642 } 1643 g.registerComponent('Component', g); 1644 function Vt(e, t) { 1645 e = e < 0 ? 0 : e; 1646 let i = Math.floor(e % 60), 1647 s = Math.floor((e / 60) % 60), 1648 r = Math.floor(e / 3600); 1649 var n = Math.floor((t / 60) % 60), 1650 t = Math.floor(t / 3600); 1651 return ( 1652 (r = 0 < (r = !isNaN(e) && e !== 1 / 0 ? r : (s = i = '-')) || 0 < t ? r + ':' : ''), 1653 (s = ((r || 10 <= n) && s < 10 ? '0' + s : s) + ':'), 1654 (i = i < 10 ? '0' + i : i), 1655 r + s + i 1656 ); 1657 } 1658 let Ht = Vt; 1659 function zt(e) { 1660 Ht = e; 1661 } 1662 function $t() { 1663 Ht = Vt; 1664 } 1665 function Wt(e, t = e) { 1666 return Ht(e, t); 1667 } 1668 t = Object.freeze({ 1669 __proto__: null, 1670 createTimeRanges: jt, 1671 createTimeRange: jt, 1672 setFormatTime: zt, 1673 resetFormatTime: $t, 1674 formatTime: Wt 1675 }); 1676 function Gt(t, i) { 1677 let s = 0; 1678 var r; 1679 let n; 1680 if (!i) return 0; 1681 (t && t.length) || (t = jt(0, 0)); 1682 for (let e = 0; e < t.length; e++) 1683 ((r = t.start(e)), (n = t.end(e)) > i && (n = i), (s += n - r)); 1684 return s / i; 1685 } 1686 function i(e) { 1687 if (e instanceof i) return e; 1688 ('number' == typeof e 1689 ? (this.code = e) 1690 : 'string' == typeof e 1691 ? (this.message = e) 1692 : Y(e) && ('number' == typeof e.code && (this.code = e.code), Object.assign(this, e)), 1693 this.message || (this.message = i.defaultMessages[this.code] || '')); 1694 } 1695 function Xt(e) { 1696 return null != e && 'function' == typeof e.then; 1697 } 1698 function Kt(e) { 1699 Xt(e) && e.then(null, (e) => {}); 1700 } 1701 ((i.prototype.code = 0), 1702 (i.prototype.message = ''), 1703 (i.prototype.status = null),
1704 (i.prototype.metadata = null), 1705 (i.errorTypes = [ 1706 'MEDIA_ERR_CUSTOM', 1707 'MEDIA_ERR_ABORTED', 1708 'MEDIA_ERR_NETWORK', 1709 'MEDIA_ERR_DECODE', 1710 'MEDIA_ERR_SRC_NOT_SUPPORTED', 1711 'MEDIA_ERR_ENCRYPTED' 1712 ]), 1713 (i.defaultMessages = { 1714 1: 'You aborted the media playback', 1715 2: 'A network error caused the media download to fail part-way.', 1716 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.', 1717 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.', 1718 5: 'The media is encrypted and we do not have the keys to decrypt it.' 1719 }), 1720 (i.MEDIA_ERR_CUSTOM = 0), 1721 (i.prototype.MEDIA_ERR_CUSTOM = 0), 1722 (i.MEDIA_ERR_ABORTED = 1), 1723 (i.prototype.MEDIA_ERR_ABORTED = 1), 1724 (i.MEDIA_ERR_NETWORK = 2), 1725 (i.prototype.MEDIA_ERR_NETWORK = 2), 1726 (i.MEDIA_ERR_DECODE = 3), 1727 (i.prototype.MEDIA_ERR_DECODE = 3), 1728 (i.MEDIA_ERR_SRC_NOT_SUPPORTED = 4), 1729 (i.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED = 4), 1730 (i.MEDIA_ERR_ENCRYPTED = 5), 1731 (i.prototype.MEDIA_ERR_ENCRYPTED = 5)); 1732 function Yt(s) { 1733 return [ 1734 'kind', 1735 'label', 1736 'language', 1737 'id', 1738 'inBandMetadataTrackDispatchType', 1739 'mode', 1740 'src' 1741 ].reduce((e, t, i) => (s[t] && (e[t] = s[t]), e), { 1742 cues: 1743 s.cues && 1744 Array.prototype.map.call(s.cues, function (e) { 1745 return { startTime: e.startTime, endTime: e.endTime, text: e.text, id: e.id }; 1746 }) 1747 }); 1748 } 1749 var Qt, 1750 Jt = function (e) { 1751 var t = e.$$('track'); 1752 let i = Array.prototype.map.call(t, (e) => e.track); 1753 return Array.prototype.map 1754 .call(t, function (e) { 1755 var t = Yt(e.track); 1756 return (e.src && (t.src = e.src), t); 1757 }) 1758 .concat( 1759 Array.prototype.filter 1760 .call(e.textTracks(), function (e) { 1761 return -1 === i.indexOf(e); 1762 }) 1763 .map(Yt) 1764 ); 1765 }, 1766 Zt = function (e, i) { 1767 return ( 1768 e.forEach(function (e) { 1769 let t = i.addRemoteTextTrack(e).track; 1770 !e.src && e.cues && e.cues.forEach((e) => t.addCue(e)); 1771 }), 1772 i.textTracks() 1773 ); 1774 }; 1775 Yt; 1776 let ei = 'vjs-modal-dialog'; 1777 class ti extends g { 1778 constructor(e, t) { 1779 (super(e, t), 1780 (this.handleKeyDown_ = (e) => this.handleKeyDown(e)), 1781 (this.close_ = (e) => this.close(e)), 1782 (this.opened_ = this.hasBeenOpened_ = this.hasBeenFilled_ = !1), 1783 this.closeable(!this.options_.uncloseable), 1784 this.content(this.options_.content), 1785 (this.contentEl_ = l('div', { className: ei + '-content' }, { role: 'document' })), 1786 (this.descEl_ = l('p', { 1787 className: ei + '-description vjs-control-text', 1788 id: this.el().getAttribute('aria-describedby') 1789 })), 1790 xe(this.descEl_, this.description()), 1791 this.el_.appendChild(this.descEl_), 1792 this.el_.appendChild(this.contentEl_)); 1793 } 1794 createEl() { 1795 return super.createEl( 1796 'div', 1797 { className: this.buildCSSClass(), tabIndex: -1 }, 1798 { 1799 'aria-describedby': this.id() + '_description', 1800 'aria-hidden': 'true', 1801 'aria-label': this.label(), 1802 role: 'dialog', 1803 'aria-live': 'polite' 1804 } 1805 ); 1806 } 1807 dispose() { 1808 ((this.contentEl_ = null), 1809 (this.descEl_ = null), 1810 (this.previouslyActiveEl_ = null), 1811 super.dispose()); 1812 } 1813 buildCSSClass() { 1814 return ei + ' vjs-hidden ' + super.buildCSSClass(); 1815 } 1816 label() { 1817 return this.localize(this.options_.label || 'Modal Window'); 1818 } 1819 description() { 1820 let e = this.options_.description || this.localize('This is a modal window.'); 1821 return ( 1822 this.closeable() && 1823 (e += 1824 ' ' + 1825 this.localize( 1826 'This modal can be closed by pressing the Escape key or activating the close button.' 1827 )), 1828 e 1829 ); 1830 } 1831 open() { 1832 var e; 1833 this.opened_ 1834 ? this.options_.fillAlways && this.fill() 1835 : ((e = this.player()), 1836 this.trigger('beforemodalopen'), 1837 (this.opened_ = !0), 1838 (!this.options_.fillAlways && (this.hasBeenOpened_ || this.hasBeenFilled_)) || 1839 this.fill(), 1840 (this.wasPlaying_ = !e.paused()),
1841 this.options_.pauseOnOpen && this.wasPlaying_ && e.pause(), 1842 this.on('keydown', this.handleKeyDown_), 1843 (this.hadControls_ = e.controls()), 1844 e.controls(!1), 1845 this.show(), 1846 this.conditionalFocus_(), 1847 this.el().setAttribute('aria-hidden', 'false'), 1848 this.trigger('modalopen'), 1849 (this.hasBeenOpened_ = !0)); 1850 } 1851 opened(e) { 1852 return ('boolean' == typeof e && this[e ? 'open' : 'close'](), this.opened_); 1853 } 1854 close() { 1855 var e; 1856 this.opened_ && 1857 ((e = this.player()), 1858 this.trigger('beforemodalclose'), 1859 (this.opened_ = !1), 1860 this.wasPlaying_ && this.options_.pauseOnOpen && e.play(), 1861 this.off('keydown', this.handleKeyDown_), 1862 this.hadControls_ && e.controls(!0), 1863 this.hide(), 1864 this.el().setAttribute('aria-hidden', 'true'), 1865 this.trigger({ type: 'modalclose', bubbles: !0 }), 1866 this.conditionalBlur_(), 1867 this.options_.temporary) && 1868 this.dispose(); 1869 } 1870 closeable(t) { 1871 if ('boolean' == typeof t) { 1872 var i, 1873 t = (this.closeable_ = !!t); 1874 let e = this.getChild('closeButton'); 1875 (t && 1876 !e && 1877 ((i = this.contentEl_), 1878 (this.contentEl_ = this.el_), 1879 (e = this.addChild('closeButton', { controlText: 'Close Modal Dialog' })), 1880 (this.contentEl_ = i), 1881 this.on(e, 'close', this.close_)), 1882 !t && e && (this.off(e, 'close', this.close_), this.removeChild(e), e.dispose())); 1883 } 1884 return this.closeable_; 1885 } 1886 fill() { 1887 this.fillWith(this.content()); 1888 } 1889 fillWith(e) { 1890 var t = this.contentEl(), 1891 i = t.parentNode, 1892 s = t.nextSibling, 1893 e = 1894 (this.trigger('beforemodalfill'), 1895 (this.hasBeenFilled_ = !0), 1896 i.removeChild(t), 1897 this.empty(), 1898 Xe(t, e), 1899 this.trigger('modalfill'), 1900 s ? i.insertBefore(t, s) : i.appendChild(t), 1901 this.getChild('closeButton')); 1902 (e && i.appendChild(e.el_), this.trigger('aftermodalfill')); 1903 } 1904 empty() { 1905 (this.trigger('beforemodalempty'), $e(this.contentEl()), this.trigger('modalempty')); 1906 } 1907 content(e) { 1908 return ('undefined' != typeof e && (this.content_ = e), this.content_); 1909 } 1910 conditionalFocus_() { 1911 var e = document.activeElement, 1912 t = this.player_.el_; 1913 ((this.previouslyActiveEl_ = null), 1914 (!t.contains(e) && t !== e) || ((this.previouslyActiveEl_ = e), this.focus())); 1915 } 1916 conditionalBlur_() { 1917 this.previouslyActiveEl_ && 1918 (this.previouslyActiveEl_.focus(), (this.previouslyActiveEl_ = null)); 1919 } 1920 handleKeyDown(e) { 1921 if ( 1922 (this.trigger({ type: 'modalKeydown', originalEvent: e, target: this, bubbles: !0 }), 1923 e.stopPropagation(), 1924 'Escape' === e.key && this.closeable()) 1925 ) 1926 (e.preventDefault(), this.close()); 1927 else if ('Tab' === e.key) { 1928 var i = this.focusableEls_(), 1929 s = this.el_.querySelector(':focus'); 1930 let t; 1931 for (let e = 0; e < i.length; e++) 1932 if (s === i[e]) { 1933 t = e; 1934 break; 1935 } 1936 (document.activeElement === this.el_ && (t = 0), 1937 e.shiftKey && 0 === t 1938 ? (i[i.length - 1].focus(), e.preventDefault()) 1939 : e.shiftKey || t !== i.length - 1 || (i[0].focus(), e.preventDefault())); 1940 } 1941 } 1942 focusableEls_() { 1943 var e = this.el_.querySelectorAll('*'); 1944 return Array.prototype.filter.call( 1945 e, 1946 (e) => 1947 ((e instanceof window.HTMLAnchorElement || e instanceof window.HTMLAreaElement) && 1948 e.hasAttribute('href')) || 1949 ((e instanceof window.HTMLInputElement || 1950 e instanceof window.HTMLSelectElement || 1951 e instanceof window.HTMLTextAreaElement || 1952 e instanceof window.HTMLButtonElement) && 1953 !e.hasAttribute('disabled')) || 1954 e instanceof window.HTMLIFrameElement || 1955 e instanceof window.HTMLObjectElement || 1956 e instanceof window.HTMLEmbedElement || 1957 (e.hasAttribute('tabindex') && -1 !== e.getAttribute('tabindex')) || 1958 e.hasAttribute('contenteditable') 1959 ); 1960 } 1961 }
1962 ((ti.prototype.options_ = { pauseOnOpen: !0, temporary: !0 }), 1963 g.registerComponent('ModalDialog', ti)); 1964 class ii extends wt { 1965 constructor(t = []) { 1966 (super(), 1967 (this.tracks_ = []), 1968 Object.defineProperty(this, 'length', { 1969 get() { 1970 return this.tracks_.length; 1971 } 1972 })); 1973 for (let e = 0; e < t.length; e++) this.addTrack(t[e]); 1974 } 1975 addTrack(e) { 1976 let t = this.tracks_.length; 1977 ('' + t in this || 1978 Object.defineProperty(this, t, { 1979 get() { 1980 return this.tracks_[t]; 1981 } 1982 }), 1983 -1 === this.tracks_.indexOf(e) && 1984 (this.tracks_.push(e), this.trigger({ track: e, type: 'addtrack', target: this })), 1985 (e.labelchange_ = () => { 1986 this.trigger({ track: e, type: 'labelchange', target: this }); 1987 }), 1988 Ct(e) && e.addEventListener('labelchange', e.labelchange_)); 1989 } 1990 removeTrack(i) { 1991 let s; 1992 for (let e = 0, t = this.length; e < t; e++) 1993 if (this[e] === i) { 1994 ((s = this[e]).off && s.off(), this.tracks_.splice(e, 1)); 1995 break; 1996 } 1997 s && this.trigger({ track: s, type: 'removetrack', target: this }); 1998 } 1999 getTrackById(i) { 2000 let s = null; 2001 for (let e = 0, t = this.length; e < t; e++) { 2002 var r = this[e]; 2003 if (r.id === i) { 2004 s = r; 2005 break; 2006 } 2007 } 2008 return s; 2009 } 2010 } 2011 for (Qt in (ii.prototype.allowedEvents_ = { 2012 change: 'change', 2013 addtrack: 'addtrack', 2014 removetrack: 'removetrack', 2015 labelchange: 'labelchange' 2016 })) 2017 ii.prototype['on' + Qt] = null; 2018 function si(t, i) { 2019 for (let e = 0; e < t.length; e++) 2020 Object.keys(t[e]).length && i.id !== t[e].id && (t[e].enabled = !1); 2021 } 2022 class ri extends ii { 2023 constructor(t = []) { 2024 for (let e = t.length - 1; 0 <= e; e--) 2025 if (t[e].enabled) { 2026 si(t, t[e]); 2027 break; 2028 } 2029 (super(t), (this.changing_ = !1)); 2030 } 2031 addTrack(e) { 2032 (e.enabled && si(this, e), 2033 super.addTrack(e), 2034 e.addEventListener && 2035 ((e.enabledChange_ = () => { 2036 this.changing_ || 2037 ((this.changing_ = !0), si(this, e), (this.changing_ = !1), this.trigger('change')); 2038 }), 2039 e.addEventListener('enabledchange', e.enabledChange_))); 2040 } 2041 removeTrack(e) { 2042 (super.removeTrack(e), 2043 e.removeEventListener && 2044 e.enabledChange_ && 2045 (e.removeEventListener('enabledchange', e.enabledChange_), (e.enabledChange_ = null))); 2046 } 2047 } 2048 function ni(t, i) { 2049 for (let e = 0; e < t.length; e++) 2050 Object.keys(t[e]).length && i.id !== t[e].id && (t[e].selected = !1); 2051 } 2052 class ai extends ii { 2053 constructor(t = []) { 2054 for (let e = t.length - 1; 0 <= e; e--) 2055 if (t[e].selected) { 2056 ni(t, t[e]); 2057 break; 2058 } 2059 (super(t), 2060 (this.changing_ = !1), 2061 Object.defineProperty(this, 'selectedIndex', { 2062 get() { 2063 for (let e = 0; e < this.length; e++) if (this[e].selected) return e; 2064 return -1; 2065 }, 2066 set() {} 2067 })); 2068 } 2069 addTrack(e) { 2070 (e.selected && ni(this, e), 2071 super.addTrack(e), 2072 e.addEventListener && 2073 ((e.selectedChange_ = () => { 2074 this.changing_ || 2075 ((this.changing_ = !0), ni(this, e), (this.changing_ = !1), this.trigger('change')); 2076 }), 2077 e.addEventListener('selectedchange', e.selectedChange_))); 2078 } 2079 removeTrack(e) { 2080 (super.removeTrack(e), 2081 e.removeEventListener && 2082 e.selectedChange_ && 2083 (e.removeEventListener('selectedchange', e.selectedChange_), (e.selectedChange_ = null))); 2084 } 2085 } 2086 class oi extends ii { 2087 addTrack(e) { 2088 (super.addTrack(e), 2089 this.queueChange_ || (this.queueChange_ = () => this.queueTrigger('change')), 2090 this.triggerSelectedlanguagechange || 2091 (this.triggerSelectedlanguagechange_ = () => this.trigger('selectedlanguagechange')), 2092 e.addEventListener('modechange', this.queueChange_)); 2093 -1 === ['metadata', 'chapters'].indexOf(e.kind) && 2094 e.addEventListener('modechange', this.triggerSelectedlanguagechange_); 2095 } 2096 removeTrack(e) { 2097 (super.removeTrack(e), 2098 e.removeEventListener && 2099 (this.queueChange_ && e.removeEventListener('modechange', this.queueChange_), 2100 this.selectedlanguagechange_) && 2101 e.removeEventListener('modechange', this.triggerSelectedlanguagechange_)); 2102 } 2103 } 2104 class li { 2105 constructor(e) { 2106 (li.prototype.setCues_.call(this, e), 2107 Object.defineProperty(this, 'length', { 2108 get() { 2109 return this.length_; 2110 } 2111 })); 2112 } 2113 setCues_(e) { 2114 var t = this.length || 0; 2115 let i = 0; 2116 function s(e) { 2117 '' + e in this || 2118 Object.defineProperty(this, '' + e, { 2119 get() { 2120 return this.cues_[e]; 2121 } 2122 }); 2123 } 2124 var r = e.length; 2125 ((this.cues_ = e), (this.length_ = e.length)); 2126 if (t < r) for (i = t; i < r; i++) s.call(this, i); 2127 } 2128 getCueById(i) { 2129 let s = null; 2130 for (let e = 0, t = this.length; e < t; e++) { 2131 var r = this[e]; 2132 if (r.id === i) { 2133 s = r; 2134 break; 2135 } 2136 } 2137 return s; 2138 } 2139 } 2140 let di = { 2141 alternative: 'alternative', 2142 captions: 'captions', 2143 main: 'main', 2144 sign: 'sign', 2145 subtitles: 'subtitles', 2146 commentary: 'commentary' 2147 }, 2148 hi = { 2149 alternative: 'alternative', 2150 descriptions: 'descriptions', 2151 main: 'main', 2152 'main-desc': 'main-desc', 2153 translation: 'translation', 2154 commentary: 'commentary' 2155 }, 2156 ui = { 2157 subtitles: 'subtitles', 2158 captions: 'captions', 2159 descriptions: 'descriptions', 2160 chapters: 'chapters', 2161 metadata: 'metadata' 2162 }, 2163 ci = { disabled: 'disabled', hidden: 'hidden', showing: 'showing' }; 2164 class pi extends wt { 2165 constructor(e = {}) { 2166 super(); 2167 let t = { id: e.id || 'vjs_track_' + lt++, kind: e.kind || '', language: e.language || '' }, 2168 i = e.label || ''; 2169 for (let e in t) 2170 Object.defineProperty(this, e, { 2171 get() { 2172 return t[e]; 2173 }, 2174 set() {} 2175 }); 2176 Object.defineProperty(this, 'label', { 2177 get() { 2178 return i; 2179 }, 2180 set(e) { 2181 e !== i && ((i = e), this.trigger('labelchange')); 2182 } 2183 }); 2184 } 2185 } 2186 function mi(e) { 2187 return new URL(e, document.baseURI); 2188 } 2189 function gi(e) { 2190 return new URL(e, document.baseURI).href; 2191 } 2192 function fi(e, t = window.location) { 2193 return mi(e).origin !== t.origin; 2194 } 2195 let yi = function (e) { 2196 if ('string' == typeof e) { 2197 e = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e); 2198 if (e) return e.pop().toLowerCase(); 2199 } 2200 return ''; 2201 }, 2202 _i = Object.freeze({ 2203 __proto__: null, 2204 parseUrl: mi, 2205 getAbsoluteURL: gi, 2206 getFileExtension: yi, 2207 isCrossOrigin: fi 2208 }); 2209 var vi = 2210 'undefined' != typeof globalThis 2211 ? globalThis 2212 : 'undefined' != typeof window 2213 ? window 2214 : 'undefined' != typeof global 2215 ? global 2216 : 'undefined' != typeof self 2217 ? self 2218 : {}; 2219 function bi(e, t) { 2220 return (e((t = { exports: {} }), t.exports), t.exports); 2221 } 2222 var Ti = 2223 'undefined' != typeof window 2224 ? window 2225 : 'undefined' != typeof vi 2226 ? vi 2227 : 'undefined' != typeof self 2228 ? self 2229 : {}, 2230 Si = bi(function (e) { 2231 function t() { 2232 return ( 2233 (e.exports = t = 2234 Object.assign 2235 ? Object.assign.bind() 2236 : function (e) { 2237 for (var t = 1; t < arguments.length; t++) { 2238 var i, 2239 s = arguments[t]; 2240 for (i in s) !{}.hasOwnProperty.call(s, i) || (e[i] = s[i]); 2241 } 2242 return e; 2243 }), 2244 (e.exports.__esModule = !0), 2245 (e.exports.default = e.exports), 2246 t.apply(null, arguments) 2247 ); 2248 } 2249 ((e.exports = t), (e.exports.__esModule = !0), (e.exports.default = e.exports)); 2250 }), 2251 f =
2252 (e = Si) && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default') 2253 ? e.default 2254 : e, 2255 wi = function (e) { 2256 var t; 2257 return ( 2258 !!e && 2259 ('[object Function]' === (t = Ei.call(e)) || 2260 ('function' == typeof e && '[object RegExp]' !== t) || 2261 ('undefined' != typeof window && 2262 (e === window.setTimeout || 2263 e === window.alert || 2264 e === window.confirm || 2265 e === window.prompt))) 2266 ); 2267 }, 2268 Ei = Object.prototype.toString; 2269 function Ci(e, t) { 2270 var i, 2271 s = ('undefined' != typeof Symbol && e[Symbol.iterator]) || e['@@iterator']; 2272 if (s) return (s = s.call(e)).next.bind(s); 2273 if ( 2274 Array.isArray(e) || 2275 (s = (function (e, t) { 2276 var i; 2277 if (e) 2278 return 'string' == typeof e 2279 ? ki(e, t) 2280 : 'Map' === 2281 (i = 2282 'Object' === (i = Object.prototype.toString.call(e).slice(8, -1)) && 2283 e.constructor 2284 ? e.constructor.name 2285 : i) || 'Set' === i 2286 ? Array.from(e) 2287 : 'Arguments' === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) 2288 ? ki(e, t) 2289 : void 0; 2290 })(e)) || 2291 (t && e && 'number' == typeof e.length) 2292 ) 2293 return ( 2294 s && (e = s), 2295 (i = 0), 2296 function () { 2297 return i >= e.length ? { done: !0 } : { done: !1, value: e[i++] }; 2298 } 2299 ); 2300 throw new TypeError( 2301 'Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.' 2302 ); 2303 } 2304 function ki(e, t) { 2305 (null == t || t > e.length) && (t = e.length); 2306 for (var i = 0, s = new Array(t); i < t; i++) s[i] = e[i]; 2307 return s; 2308 } 2309 var e = (function () { 2310 function e() { 2311 ((this.typeToInterceptorsMap_ = new Map()), (this.enabled_ = !1)); 2312 } 2313 var t = e.prototype; 2314 return ( 2315 (t.getIsEnabled = function () { 2316 return this.enabled_; 2317 }), 2318 (t.enable = function () { 2319 this.enabled_ = !0; 2320 }), 2321 (t.disable = function () { 2322 this.enabled_ = !1; 2323 }), 2324 (t.reset = function () { 2325 ((this.typeToInterceptorsMap_ = new Map()), (this.enabled_ = !1)); 2326 }), 2327 (t.addInterceptor = function (e, t) { 2328 this.typeToInterceptorsMap_.has(e) || this.typeToInterceptorsMap_.set(e, new Set()); 2329 e = this.typeToInterceptorsMap_.get(e); 2330 return !e.has(t) && (e.add(t), !0); 2331 }), 2332 (t.removeInterceptor = function (e, t) { 2333 e = this.typeToInterceptorsMap_.get(e); 2334 return !(!e || !e.has(t) || (e.delete(t), 0)); 2335 }), 2336 (t.clearInterceptorsByType = function (e) { 2337 return ( 2338 !!this.typeToInterceptorsMap_.get(e) && 2339 (this.typeToInterceptorsMap_.delete(e), 2340 this.typeToInterceptorsMap_.set(e, new Set()), 2341 !0) 2342 ); 2343 }), 2344 (t.clear = function () { 2345 return ( 2346 !!this.typeToInterceptorsMap_.size && ((this.typeToInterceptorsMap_ = new Map()), !0) 2347 ); 2348 }), 2349 (t.getForType = function (e) { 2350 return this.typeToInterceptorsMap_.get(e) || new Set(); 2351 }), 2352 (t.execute = function (e, t) { 2353 for (var i = Ci(this.getForType(e)); !(s = i()).done; ) { 2354 var s = s.value; 2355 try { 2356 t = s(t); 2357 } catch (e) {} 2358 } 2359 return t; 2360 }), 2361 e 2362 ); 2363 })(), 2364 Ii = (function () { 2365 function e() { 2366 ((this.maxAttempts_ = 1), 2367 (this.delayFactor_ = 0.1), 2368 (this.fuzzFactor_ = 0.1), 2369 (this.initialDelay_ = 1e3), 2370 (this.enabled_ = !1)); 2371 } 2372 var t = e.prototype; 2373 return ( 2374 (t.getIsEnabled = function () { 2375 return this.enabled_; 2376 }), 2377 (t.enable = function () { 2378 this.enabled_ = !0; 2379 }), 2380 (t.disable = function () { 2381 this.enabled_ = !1; 2382 }), 2383 (t.reset = function () { 2384 ((this.maxAttempts_ = 1), 2385 (this.delayFactor_ = 0.1), 2386 (this.fuzzFactor_ = 0.1), 2387 (this.initialDelay_ = 1e3), 2388 (this.enabled_ = !1)); 2389 }), 2390 (t.getMaxAttempts = function () { 2391 return this.maxAttempts_; 2392 }), 2393 (t.setMaxAttempts = function (e) { 2394 this.maxAttempts_ = e; 2395 }), 2396 (t.getDelayFactor = function () { 2397 return this.delayFactor_; 2398 }), 2399 (t.setDelayFactor = function (e) { 2400 this.delayFactor_ = e; 2401 }), 2402 (t.getFuzzFactor = function () { 2403 return this.fuzzFactor_; 2404 }), 2405 (t.setFuzzFactor = function (e) { 2406 this.fuzzFactor_ = e; 2407 }), 2408 (t.getInitialDelay = function () { 2409 return this.initialDelay_; 2410 }), 2411 (t.setInitialDelay = function (e) { 2412 this.initialDelay_ = e; 2413 }), 2414 (t.createRetry = function (e) { 2415 var e = void 0 === e ? {} : e, 2416 t = e.maxAttempts; 2417 return new xi({ 2418 maxAttempts: t || this.maxAttempts_, 2419 delayFactor: e.delayFactor || this.delayFactor_, 2420 fuzzFactor: e.fuzzFactor || this.fuzzFactor_, 2421 initialDelay: e.initialDelay || this.initialDelay_ 2422 }); 2423 }), 2424 e 2425 ); 2426 })(), 2427 xi = (function () { 2428 function e(e) { 2429 ((this.maxAttempts_ = e.maxAttempts), 2430 (this.delayFactor_ = e.delayFactor), 2431 (this.fuzzFactor_ = e.fuzzFactor), 2432 (this.currentDelay_ = e.initialDelay), 2433 (this.currentAttempt_ = 1)); 2434 } 2435 var t = e.prototype; 2436 return ( 2437 (t.moveToNextAttempt = function () { 2438 this.currentAttempt_++; 2439 var e = this.currentDelay_ * this.delayFactor_; 2440 this.currentDelay_ = this.currentDelay_ + e; 2441 }), 2442 (t.shouldRetry = function () { 2443 return this.currentAttempt_ < this.maxAttempts_; 2444 }),
2445 (t.getCurrentDelay = function () { 2446 return this.currentDelay_; 2447 }), 2448 (t.getCurrentMinPossibleDelay = function () { 2449 return (1 - this.fuzzFactor_) * this.currentDelay_; 2450 }), 2451 (t.getCurrentMaxPossibleDelay = function () { 2452 return (1 + this.fuzzFactor_) * this.currentDelay_; 2453 }), 2454 (t.getCurrentFuzzedDelay = function () { 2455 var e = this.getCurrentMinPossibleDelay(), 2456 t = this.getCurrentMaxPossibleDelay(); 2457 return e + Math.random() * (t - e); 2458 }), 2459 e 2460 ); 2461 })(); 2462 ((y.httpHandler = function (s, r) { 2463 return ( 2464 void 0 === r && (r = !1), 2465 function (e, t, i) { 2466 if (e) s(e); 2467 else if (400 <= t.statusCode && t.statusCode <= 599) { 2468 e = i; 2469 if (r) 2470 if (Ti.TextDecoder) { 2471 t = (function (e) { 2472 void 0 === e && (e = ''); 2473 return e 2474 .toLowerCase() 2475 .split(';') 2476 .reduce(function (e, t) { 2477 var t = t.split('='), 2478 i = t[0], 2479 t = t[1]; 2480 return 'charset' === i.trim() ? t.trim() : e; 2481 }, 'utf-8'); 2482 })(t.headers && t.headers['content-type']); 2483 try { 2484 e = new TextDecoder(t).decode(i); 2485 } catch (e) {} 2486 } else e = String.fromCharCode.apply(null, new Uint8Array(i)); 2487 s({ cause: e }); 2488 } else s(null, i); 2489 } 2490 ); 2491 }), 2492 (y.requestInterceptorsStorage = new e()), 2493 (y.responseInterceptorsStorage = new e()), 2494 (y.retryManager = new Ii())); 2495 for ( 2496 var Ai = function (e) { 2497 var s = {}; 2498 return ( 2499 e && 2500 e 2501 .trim() 2502 .split('\n') 2503 .forEach(function (e) { 2504 var t = e.indexOf(':'), 2505 i = e.slice(0, t).trim().toLowerCase(), 2506 e = e.slice(t + 1).trim(); 2507 'undefined' == typeof s[i] 2508 ? (s[i] = e) 2509 : Array.isArray(s[i]) 2510 ? s[i].push(e) 2511 : (s[i] = [s[i], e]); 2512 }), 2513 s 2514 ); 2515 }, 2516 Di = y, 2517 e = y, 2518 Pi = 2519 ((y.XMLHttpRequest = Ti.XMLHttpRequest || function () {}), 2520 (y.XDomainRequest = 2521 ('withCredentials' in new y.XMLHttpRequest()) ? y.XMLHttpRequest : Ti.XDomainRequest), 2522 ['get', 'put', 'post', 'patch', 'head', 'delete']), 2523 Li = function (s) { 2524 y['delete' === s ? 'del' : s] = function (e, t, i) { 2525 return (((t = Ri(e, t, i)).method = s.toUpperCase()), Ni(t)); 2526 }; 2527 }, 2528 Oi = 0; 2529 Oi < Pi.length; 2530 Oi++ 2531 ) 2532 Li(Pi[Oi]); 2533 function Ri(e, t, i) { 2534 var s = e; 2535 return ( 2536 wi(t) ? ((i = t), 'string' == typeof e && (s = { uri: e })) : (s = Si({}, t, { uri: e })), 2537 (s.callback = i), 2538 s 2539 ); 2540 } 2541 function y(e, t, i) { 2542 return Ni((t = Ri(e, t, i))); 2543 } 2544 function Ni(s) { 2545 if ('undefined' == typeof s.callback) throw new Error('callback argument missing'); 2546 s.requestType && 2547 y.requestInterceptorsStorage.getIsEnabled() && 2548 ((c = y.requestInterceptorsStorage.execute(s.requestType, { 2549 uri: s.uri || s.url, 2550 headers: s.headers || {}, 2551 body: s.body, 2552 metadata: s.metadata || {}, 2553 retry: s.retry, 2554 timeout: s.timeout 2555 })), 2556 (s.uri = c.uri), 2557 (s.headers = c.headers), 2558 (s.body = c.body), 2559 (s.metadata = c.metadata), 2560 (s.retry = c.retry), 2561 (s.timeout = c.timeout)); 2562 var r = !1, 2563 n = function (e, t, i) { 2564 r || ((r = !0), s.callback(e, t, i)); 2565 }; 2566 function a() { 2567 var e = void 0, 2568 e = 2569 d.response || 2570 d.responseText || 2571 (function (e) { 2572 try { 2573 if ('document' === e.responseType) return e.responseXML; 2574 var t = e.responseXML && 'parsererror' === e.responseXML.documentElement.nodeName; 2575 if ('' === e.responseType && !t) return e.responseXML; 2576 } catch (e) {} 2577 return null; 2578 })(d); 2579 if (g) 2580 try { 2581 e = JSON.parse(e); 2582 } catch (e) {} 2583 return e; 2584 } 2585 function t(e) { 2586 var t; 2587 if ( 2588 (clearTimeout(l), 2589 clearTimeout(s.retryTimeout), 2590 ((e = 2591 e instanceof Error 2592 ? e 2593 : new Error('' + (e || 'Unknown XMLHttpRequest Error'))).statusCode = 0), 2594 o || !y.retryManager.getIsEnabled() || !s.retry || !s.retry.shouldRetry()) 2595 ) 2596 return ( 2597 s.requestType && 2598 y.responseInterceptorsStorage.getIsEnabled() && 2599 ((t = { 2600 headers: f.headers || {}, 2601 body: f.body, 2602 responseUrl: d.responseURL, 2603 responseType: d.responseType 2604 }), 2605 (t = y.responseInterceptorsStorage.execute(s.requestType, t)), 2606 (f.body = t.body), 2607 (f.headers = t.headers)), 2608 n(e, f) 2609 ); 2610 s.retryTimeout = setTimeout(function () { 2611 (s.retry.moveToNextAttempt(), (s.xhr = d), Ni(s)); 2612 }, s.retry.getCurrentFuzzedDelay()); 2613 } 2614 function e() { 2615 var e, t, i; 2616 if (!o) 2617 return ( 2618 clearTimeout(l), 2619 clearTimeout(s.retryTimeout), 2620 (i = s.useXDR && void 0 === d.status ? 200 : 1223 === d.status ? 204 : d.status), 2621 (e = f), 2622 (t = null),
2623 0 !== i 2624 ? ((e = { body: a(), statusCode: i, method: u, headers: {}, url: h, rawRequest: d }), 2625 d.getAllResponseHeaders && (e.headers = Ai(d.getAllResponseHeaders()))) 2626 : (t = new Error('Internal XMLHttpRequest Error')), 2627 s.requestType && 2628 y.responseInterceptorsStorage.getIsEnabled() && 2629 ((i = { 2630 headers: e.headers || {}, 2631 body: e.body, 2632 responseUrl: d.responseURL, 2633 responseType: d.responseType 2634 }), 2635 (i = y.responseInterceptorsStorage.execute(s.requestType, i)), 2636 (e.body = i.body), 2637 (e.headers = i.headers)), 2638 n(t, e, e.body) 2639 ); 2640 } 2641 var i, 2642 o, 2643 l, 2644 d = s.xhr || null, 2645 h = ((d = d || new (s.cors || s.useXDR ? y.XDomainRequest : y.XMLHttpRequest)()).url = 2646 s.uri || s.url), 2647 u = (d.method = s.method || 'GET'), 2648 c = s.body || s.data, 2649 p = (d.headers = s.headers || {}), 2650 m = !!s.sync, 2651 g = !1, 2652 f = { body: void 0, headers: {}, statusCode: 0, method: u, url: h, rawRequest: d }; 2653 if ( 2654 ('json' in s && 2655 !1 !== s.json && 2656 ((g = !0), p.accept || p.Accept || (p.Accept = 'application/json'), 'GET' !== u) && 2657 'HEAD' !== u && 2658 (p['content-type'] || p['Content-Type'] || (p['Content-Type'] = 'application/json'), 2659 (c = JSON.stringify(!0 === s.json ? c : s.json))), 2660 (d.onreadystatechange = function () { 2661 4 !== d.readyState || y.responseInterceptorsStorage.getIsEnabled() || setTimeout(e, 0); 2662 }), 2663 (d.onload = e), 2664 (d.onerror = t), 2665 (d.onprogress = function () {}), 2666 (d.onabort = function () { 2667 ((o = !0), clearTimeout(s.retryTimeout)); 2668 }), 2669 (d.ontimeout = t), 2670 d.open(u, h, !m, s.username, s.password), 2671 m || (d.withCredentials = !!s.withCredentials), 2672 !m && 2673 0 < s.timeout && 2674 (l = setTimeout(function () { 2675 var e; 2676 o || 2677 ((o = !0), 2678 d.abort('timeout'), 2679 ((e = new Error('XMLHttpRequest timeout')).code = 'ETIMEDOUT'), 2680 t(e)); 2681 }, s.timeout)), 2682 d.setRequestHeader) 2683 ) 2684 for (i in p) p.hasOwnProperty(i) && d.setRequestHeader(i, p[i]); 2685 else if ( 2686 s.headers && 2687 !(function (e) { 2688 for (var t in e) if (e.hasOwnProperty(t)) return; 2689 return 1; 2690 })(s.headers) 2691 ) 2692 throw new Error('Headers cannot be set on an XDomainRequest object'); 2693 return ( 2694 'responseType' in s && (d.responseType = s.responseType), 2695 'beforeSend' in s && 'function' == typeof s.beforeSend && s.beforeSend(d), 2696 d.send(c || null), 2697 d 2698 ); 2699 } 2700 Di.default = e; 2701 function Mi(e, t) { 2702 var i = new window.WebVTT.Parser(window, window.vttjs, window.WebVTT.StringDecoder()); 2703 let s = []; 2704 ((i.oncue = function (e) { 2705 t.addCue(e); 2706 }), 2707 (i.onparsingerror = function (e) { 2708 s.push(e); 2709 }), 2710 (i.onflush = function () { 2711 t.trigger({ type: 'loadeddata', target: t }); 2712 }), 2713 i.parse(e), 2714 0 < s.length && 2715 (window.console && 2716 window.console.groupCollapsed && 2717 window.console.groupCollapsed('Text Track parsing errors for ' + t.src), 2718 s.forEach((e) => o.error(e)), 2719 window.console) && 2720 window.console.groupEnd && 2721 window.console.groupEnd(), 2722 i.flush()); 2723 } 2724 function Ui(e, s) { 2725 var t = { uri: e }; 2726 ((e = fi(e)) && (t.cors = e), 2727 (e = 'use-credentials' === s.tech_.crossOrigin()) && (t.withCredentials = e), 2728 Di( 2729 t, 2730 p(this, function (e, t, i) { 2731 if (e) return o.error(e, t); 2732 ((s.loaded_ = !0), 2733 'function' != typeof window.WebVTT 2734 ? s.tech_ && 2735 s.tech_.any(['vttjsloaded', 'vttjserror'], (e) => { 2736 if ('vttjserror' !== e.type) return Mi(i, s); 2737 o.error('vttjs failed to load, stopping trying to process ' + s.src); 2738 }) 2739 : Mi(i, s)); 2740 }) 2741 )); 2742 } 2743 class Bi extends pi { 2744 constructor(e = {}) {
2745 if (!e.tech) throw new Error('A tech was not provided.'); 2746 e = d(e, { kind: ui[e.kind] || 'subtitles', language: e.language || e.srclang || '' }); 2747 let t = ci[e.mode] || 'disabled', 2748 i = e.default, 2749 s = 2750 (('metadata' !== e.kind && 'chapters' !== e.kind) || (t = 'hidden'), 2751 super(e), 2752 (this.tech_ = e.tech), 2753 (this.cues_ = []), 2754 (this.activeCues_ = []), 2755 (this.preload_ = !1 !== this.tech_.preloadTextTracks), 2756 new li(this.cues_)), 2757 n = new li(this.activeCues_), 2758 a = !1; 2759 this.timeupdateHandler = p(this, function (e = {}) { 2760 this.tech_.isDisposed() || 2761 (this.tech_.isReady_ && 2762 ((this.activeCues = this.activeCues), a) && 2763 (this.trigger('cuechange'), (a = !1)), 2764 'timeupdate' !== e.type && 2765 (this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler))); 2766 }); 2767 (this.tech_.one('dispose', () => { 2768 this.stopTracking(); 2769 }), 2770 'disabled' !== t && this.startTracking(), 2771 Object.defineProperties(this, { 2772 default: { 2773 get() { 2774 return i; 2775 }, 2776 set() {} 2777 }, 2778 mode: { 2779 get() { 2780 return t; 2781 }, 2782 set(e) { 2783 ci[e] && 2784 t !== e && 2785 ((t = e), 2786 this.preload_ || 'disabled' === t || 0 !== this.cues.length || Ui(this.src, this), 2787 this.stopTracking(), 2788 'disabled' !== t && this.startTracking(), 2789 this.trigger('modechange')); 2790 } 2791 }, 2792 cues: { 2793 get() { 2794 return this.loaded_ ? s : null; 2795 }, 2796 set() {} 2797 }, 2798 activeCues: { 2799 get() { 2800 if (!this.loaded_) return null; 2801 if (0 !== this.cues.length) { 2802 var i = this.tech_.currentTime(), 2803 s = []; 2804 for (let e = 0, t = this.cues.length; e < t; e++) { 2805 var r = this.cues[e]; 2806 r.startTime <= i && i <= r.endTime && s.push(r); 2807 } 2808 if (((a = !1), s.length !== this.activeCues_.length)) a = !0; 2809 else 2810 for (let e = 0; e < s.length; e++) 2811 -1 === this.activeCues_.indexOf(s[e]) && (a = !0); 2812 ((this.activeCues_ = s), n.setCues_(this.activeCues_)); 2813 } 2814 return n; 2815 }, 2816 set() {} 2817 } 2818 }), 2819 e.src 2820 ? ((this.src = e.src), 2821 this.preload_ || (this.loaded_ = !0), 2822 (this.preload_ || ('subtitles' !== e.kind && 'captions' !== e.kind)) && 2823 Ui(this.src, this)) 2824 : (this.loaded_ = !0)); 2825 } 2826 startTracking() { 2827 ((this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler)), 2828 this.tech_.on('timeupdate', this.timeupdateHandler)); 2829 } 2830 stopTracking() { 2831 (this.rvf_ && (this.tech_.cancelVideoFrameCallback(this.rvf_), (this.rvf_ = void 0)), 2832 this.tech_.off('timeupdate', this.timeupdateHandler)); 2833 } 2834 addCue(e) { 2835 let t = e; 2836 if (!('getCueAsHTML' in t)) { 2837 for (var i in ((t = new window.vttjs.VTTCue(e.startTime, e.endTime, e.text)), e)) 2838 i in t || (t[i] = e[i]); 2839 ((t.id = e.id), (t.originalCue_ = e)); 2840 } 2841 var s = this.tech_.textTracks(); 2842 for (let e = 0; e < s.length; e++) s[e] !== this && s[e].removeCue(t); 2843 (this.cues_.push(t), this.cues.setCues_(this.cues_)); 2844 } 2845 removeCue(e) { 2846 let t = this.cues_.length; 2847 for (; t--; ) { 2848 var i = this.cues_[t]; 2849 if (i === e || (i.originalCue_ && i.originalCue_ === e)) { 2850 (this.cues_.splice(t, 1), this.cues.setCues_(this.cues_)); 2851 break; 2852 } 2853 } 2854 } 2855 } 2856 Bi.prototype.allowedEvents_ = { cuechange: 'cuechange' }; 2857 class Fi extends pi { 2858 constructor(e = {}) { 2859 e = d(e, { kind: hi[e.kind] || '' }); 2860 super(e); 2861 let t = !1; 2862 (Object.defineProperty(this, 'enabled', { 2863 get() { 2864 return t; 2865 }, 2866 set(e) { 2867 'boolean' == typeof e && e !== t && ((t = e), this.trigger('enabledchange')); 2868 } 2869 }), 2870 e.enabled && (this.enabled = e.enabled), 2871 (this.loaded_ = !0)); 2872 } 2873 } 2874 class qi extends pi { 2875 constructor(e = {}) { 2876 e = d(e, { kind: di[e.kind] || '' }); 2877 super(e); 2878 let t = !1; 2879 (Object.defineProperty(this, 'selected', { 2880 get() { 2881 return t; 2882 }, 2883 set(e) { 2884 'boolean' == typeof e && e !== t && ((t = e), this.trigger('selectedchange')); 2885 } 2886 }), 2887 e.selected && (this.selected = e.selected)); 2888 } 2889 } 2890 class ji extends wt { 2891 constructor(e = {}) { 2892 super(); 2893 let t, 2894 i = new Bi(e); 2895 ((this.kind = i.kind), 2896 (this.src = i.src), 2897 (this.srclang = i.language), 2898 (this.label = i.label), 2899 (this.default = i.default), 2900 Object.defineProperties(this, { 2901 readyState: { 2902 get() { 2903 return t; 2904 } 2905 }, 2906 track: { 2907 get() { 2908 return i; 2909 } 2910 } 2911 }), 2912 (t = ji.NONE), 2913 i.addEventListener('loadeddata', () => { 2914 ((t = ji.LOADED), this.trigger({ type: 'load', target: this })); 2915 })); 2916 } 2917 } 2918 ((ji.prototype.allowedEvents_ = { load: 'load' }), 2919 (ji.NONE = 0), 2920 (ji.LOADING = 1), 2921 (ji.LOADED = 2), 2922 (ji.ERROR = 3)); 2923 let Vi = { 2924 audio: { ListClass: ri, TrackClass: Fi, capitalName: 'Audio' },
2925 video: { ListClass: ai, TrackClass: qi, capitalName: 'Video' }, 2926 text: { ListClass: oi, TrackClass: Bi, capitalName: 'Text' } 2927 }, 2928 Hi = 2929 (Object.keys(Vi).forEach(function (e) { 2930 ((Vi[e].getterName = e + 'Tracks'), (Vi[e].privateName = e + 'Tracks_')); 2931 }), 2932 { 2933 remoteText: { 2934 ListClass: oi, 2935 TrackClass: Bi, 2936 capitalName: 'RemoteText', 2937 getterName: 'remoteTextTracks', 2938 privateName: 'remoteTextTracks_' 2939 }, 2940 remoteTextEl: { 2941 ListClass: class { 2942 constructor(i = []) { 2943 ((this.trackElements_ = []), 2944 Object.defineProperty(this, 'length', { 2945 get() { 2946 return this.trackElements_.length; 2947 } 2948 })); 2949 for (let e = 0, t = i.length; e < t; e++) this.addTrackElement_(i[e]); 2950 } 2951 addTrackElement_(e) { 2952 let t = this.trackElements_.length; 2953 ('' + t in this || 2954 Object.defineProperty(this, t, { 2955 get() { 2956 return this.trackElements_[t]; 2957 } 2958 }), 2959 -1 === this.trackElements_.indexOf(e) && this.trackElements_.push(e)); 2960 } 2961 getTrackElementByTrack_(i) { 2962 let s; 2963 for (let e = 0, t = this.trackElements_.length; e < t; e++) 2964 if (i === this.trackElements_[e].track) { 2965 s = this.trackElements_[e]; 2966 break; 2967 } 2968 return s; 2969 } 2970 removeTrackElement_(i) { 2971 for (let e = 0, t = this.trackElements_.length; e < t; e++) 2972 if (i === this.trackElements_[e]) { 2973 (this.trackElements_[e].track && 2974 'function' == typeof this.trackElements_[e].track.off && 2975 this.trackElements_[e].track.off(), 2976 'function' == typeof this.trackElements_[e].off && this.trackElements_[e].off(), 2977 this.trackElements_.splice(e, 1)); 2978 break; 2979 } 2980 } 2981 }, 2982 TrackClass: ji, 2983 capitalName: 'RemoteTextTrackEls', 2984 getterName: 'remoteTextTrackEls', 2985 privateName: 'remoteTextTrackEls_' 2986 } 2987 }), 2988 a = Object.assign({}, Vi, Hi); 2989 ((Hi.names = Object.keys(Hi)), 2990 (Vi.names = Object.keys(Vi)), 2991 (a.names = [].concat(Hi.names).concat(Vi.names))); 2992 var Ii = 'undefined' != typeof vi ? vi : 'undefined' != typeof window ? window : {}, 2993 zi = 2994 'undefined' != typeof document 2995 ? document 2996 : (zi = Ii['__GLOBAL_DOCUMENT_CACHE@4']) || (Ii['__GLOBAL_DOCUMENT_CACHE@4'] = {}), 2997 e = zi, 2998 $i = 2999 Object.create || 3000 function (e) { 3001 if (1 !== arguments.length) 3002 throw new Error('Object.create shim only accepts one parameter.'); 3003 return ((Wi.prototype = e), new Wi()); 3004 }; 3005 function Wi() {} 3006 function Gi(e, t) { 3007 ((this.name = 'ParsingError'), (this.code = e.code), (this.message = t || e.message)); 3008 } 3009 function Xi(e) { 3010 function t(e, t, i, s) { 3011 return 3600 * (0 | e) + 60 * (0 | t) + (0 | i) + (0 | s) / 1e3; 3012 } 3013 e = e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/); 3014 return e 3015 ? e[3] 3016 ? t(e[1], e[2], e[3].replace(':', ''), e[4]) 3017 : 59 < e[1] 3018 ? t(e[1], e[2], 0, e[4]) 3019 : t(0, e[1], e[2], e[4]) 3020 : null; 3021 } 3022 function Ki() { 3023 this.values = $i(null); 3024 } 3025 function Yi(e, t, i, s) { 3026 var r, 3027 n, 3028 a = s ? e.split(s) : [e]; 3029 for (r in a) 3030 'string' == typeof a[r] && 2 === (n = a[r].split(i)).length && t(n[0].trim(), n[1].trim()); 3031 } 3032 ((((Gi.prototype = $i(Error.prototype)).constructor = Gi).Errors = { 3033 BadSignature: { code: 0, message: 'Malformed WebVTT signature.' }, 3034 BadTimeStamp: { code: 1, message: 'Malformed time stamp.' } 3035 }), 3036 (Ki.prototype = { 3037 set: function (e, t) { 3038 this.get(e) || '' === t || (this.values[e] = t); 3039 }, 3040 get: function (e, t, i) { 3041 return i ? (this.has(e) ? this.values[e] : t[i]) : this.has(e) ? this.values[e] : t; 3042 }, 3043 has: function (e) { 3044 return e in this.values; 3045 }, 3046 alt: function (e, t, i) { 3047 for (var s = 0; s < i.length; ++s) 3048 if (t === i[s]) { 3049 this.set(e, t); 3050 break; 3051 } 3052 }, 3053 integer: function (e, t) { 3054 /^-?\d+$/.test(t) && this.set(e, parseInt(t, 10)); 3055 }, 3056 percent: function (e, t) { 3057 return ( 3058 !!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/) && 0 <= (t = parseFloat(t)) && t <= 100) && 3059 (this.set(e, t), !0) 3060 ); 3061 } 3062 })); 3063 var Qi = e.createElement && e.createElement('textarea'), 3064 Ji = { c: 'span', i: 'i', b: 'b', u: 'u', ruby: 'ruby', rt: 'rt', v: 'span', lang: 'span' }, 3065 Zi = { 3066 white: 'rgba(255,255,255,1)', 3067 lime: 'rgba(0,255,0,1)', 3068 cyan: 'rgba(0,255,255,1)', 3069 red: 'rgba(255,0,0,1)', 3070 yellow: 'rgba(255,255,0,1)', 3071 magenta: 'rgba(255,0,255,1)', 3072 blue: 'rgba(0,0,255,1)', 3073 black: 'rgba(0,0,0,1)' 3074 }, 3075 es = { v: 'title', lang: 'lang' }, 3076 ts = { rt: 'ruby' }; 3077 function is(e, t) { 3078 for ( 3079 var i, s, r, n, a, o, l = e.document.createElement('div'), d = l, h = []; 3080 null !== 3081 ((o = void 0), 3082 (o = t 3083 ? ((o = (o = t.match(/^([^<]*)(<[^>
3083]*>?)?/))[1] || o[2]), (t = t.substr(o.length)), o) 3084 : null)); 3085 3086 ) 3087 '<' === o[0] 3088 ? '/' === o[1] 3089 ? h.length && 3090 h[h.length - 1] === o.substr(2).replace('>', '') && 3091 (h.pop(), (d = d.parentNode)) 3092 : (s = Xi(o.substr(1, o.length - 2))) 3093 ? ((i = e.document.createProcessingInstruction('timestamp', s)), d.appendChild(i)) 3094 : (s = o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)) && 3095 ((r = s[1]), 3096 (n = s[3]), 3097 (a = void 0), 3098 (a = Ji[r]), 3099 (i = a 3100 ? ((a = e.document.createElement(a)), (r = es[r]) && n && (a[r] = n.trim()), a) 3101 : null)) && 3102 ((r = d), 3103 (ts[(n = i).localName] && ts[n.localName] !== r.localName) || 3104 (s[2] && 3105 ((a = s[2].split('.')).forEach(function (e) { 3106 var t = /^bg_/.test(e), 3107 e = t ? e.slice(3) : e; 3108 Zi.hasOwnProperty(e) && 3109 ((e = Zi[e]), (i.style[t ? 'background-color' : 'color'] = e)); 3110 }), 3111 (i.className = a.join(' '))), 3112 h.push(s[1]), 3113 d.appendChild(i), 3114 (d = i))) 3115 : d.appendChild( 3116 e.document.createTextNode( 3117 ((n = o), (Qi.innerHTML = n), (n = Qi.textContent), (Qi.textContent = ''), n) 3118 ) 3119 ); 3120 return l; 3121 } 3122 var ss = [ 3123 [1470, 1470], 3124 [1472, 1472], 3125 [1475, 1475], 3126 [1478, 1478], 3127 [1488, 1514], 3128 [1520, 1524], 3129 [1544, 1544], 3130 [1547, 1547], 3131 [1549, 1549], 3132 [1563, 1563], 3133 [1566, 1610], 3134 [1645, 1647], 3135 [1649, 1749], 3136 [1765, 1766], 3137 [1774, 1775], 3138 [1786, 1805], 3139 [1807, 1808], 3140 [1810, 1839], 3141 [1869, 1957], 3142 [1969, 1969], 3143 [1984, 2026], 3144 [2036, 2037], 3145 [2042, 2042], 3146 [2048, 2069], 3147 [2074, 2074], 3148 [2084, 2084], 3149 [2088, 2088], 3150 [2096, 2110], 3151 [2112, 2136], 3152 [2142, 2142], 3153 [2208, 2208], 3154 [2210, 2220], 3155 [8207, 8207], 3156 [64285, 64285], 3157 [64287, 64296], 3158 [64298, 64310], 3159 [64312, 64316], 3160 [64318, 64318], 3161 [64320, 64321], 3162 [64323, 64324], 3163 [64326, 64449], 3164 [64467, 64829], 3165 [64848, 64911], 3166 [64914, 64967], 3167 [65008, 65020], 3168 [65136, 65140], 3169 [65142, 65276], 3170 [67584, 67589], 3171 [67592, 67592], 3172 [67594, 67637], 3173 [67639, 67640], 3174 [67644, 67644], 3175 [67647, 67669], 3176 [67671, 67679], 3177 [67840, 67867], 3178 [67872, 67897], 3179 [67903, 67903], 3180 [67968, 68023], 3181 [68030, 68031], 3182 [68096, 68096], 3183 [68112, 68115], 3184 [68117, 68119], 3185 [68121, 68147], 3186 [68160, 68167], 3187 [68176, 68184], 3188 [68192, 68223], 3189 [68352, 68405], 3190 [68416, 68437], 3191 [68440, 68466], 3192 [68472, 68479], 3193 [68608, 68680], 3194 [126464, 126467], 3195 [126469, 126495], 3196 [126497, 126498], 3197 [126500, 126500], 3198 [126503, 126503], 3199 [126505, 126514], 3200 [126516, 126519], 3201 [126521, 126521], 3202 [126523, 126523], 3203 [126530, 126530], 3204 [126535, 126535], 3205 [126537, 126537], 3206 [126539, 126539], 3207 [126541, 126543], 3208 [126545, 126546], 3209 [126548, 126548], 3210 [126551, 126551], 3211 [126553, 126553], 3212 [126555, 126555], 3213 [126557, 126557], 3214 [126559, 126559], 3215 [126561, 126562], 3216 [126564, 126564], 3217 [126567, 126570], 3218 [126572, 126578], 3219 [126580, 126583], 3220 [126585, 126588], 3221 [126590, 126590], 3222 [126592, 126601], 3223 [126603, 126619], 3224 [126625, 126627], 3225 [126629, 126633], 3226 [126635, 126651], 3227 [1114109, 1114109] 3228 ]; 3229 function rs(e) { 3230 var t = [], 3231 i = ''; 3232 if (e && e.childNodes) 3233 for ( 3234 n(t, e); 3235 (i = (function e(t) { 3236 var i, s, r; 3237 return t && t.length 3238 ? (s = (i = t.pop()).textContent || i.innerText) 3239 ? (r = s.match(/^.*(\n|\r)/)) 3240 ? r[(t.length = 0)] 3241 : s 3242 : 'ruby' === i.tagName 3243 ? e(t) 3244 : i.childNodes 3245 ? (n(t, i), e(t)) 3246 : void 0 3247 : null; 3248 })(t)); 3249 3250 ) 3251 for (var s = 0; s < i.length; s++) 3252 if ( 3253 (function (e) { 3254 for (var t = 0; t < ss.length; t++) { 3255 var i = ss[t]; 3256 if (e >
3256= i[0] && e <= i[1]) return 1; 3257 } 3258 })(i.charCodeAt(s)) 3259 ) 3260 return 'rtl'; 3261 return 'ltr'; 3262 function n(e, t) { 3263 for (var i = t.childNodes.length - 1; 0 <= i; i--) e.push(t.childNodes[i]); 3264 } 3265 } 3266 function ns() {} 3267 function as(e, t, i) { 3268 (ns.call(this), (this.cue = t), (this.cueDiv = is(e, t.text))); 3269 (this.applyStyles( 3270 { 3271 color: 'rgba(255, 255, 255, 1)', 3272 backgroundColor: 'rgba(0, 0, 0, 0.8)', 3273 position: 'relative', 3274 left: 0, 3275 right: 0, 3276 top: 0, 3277 bottom: 0, 3278 display: 'inline', 3279 writingMode: 3280 '' === t.vertical ? 'horizontal-tb' : 'lr' === t.vertical ? 'vertical-lr' : 'vertical-rl', 3281 unicodeBidi: 'plaintext' 3282 }, 3283 this.cueDiv 3284 ), 3285 (this.div = e.document.createElement('div')), 3286 (e = { 3287 direction: rs(this.cueDiv), 3288 writingMode: 3289 '' === t.vertical ? 'horizontal-tb' : 'lr' === t.vertical ? 'vertical-lr' : 'vertical-rl', 3290 unicodeBidi: 'plaintext', 3291 textAlign: 'middle' === t.align ? 'center' : t.align, 3292 font: i.font, 3293 whiteSpace: 'pre-line', 3294 position: 'absolute' 3295 }), 3296 this.applyStyles(e), 3297 this.div.appendChild(this.cueDiv)); 3298 var s = 0; 3299 switch (t.positionAlign) { 3300 case 'start': 3301 case 'line-left': 3302 s = t.position; 3303 break; 3304 case 'center': 3305 s = t.position - t.size / 2; 3306 break; 3307 case 'end': 3308 case 'line-right': 3309 s = t.position - t.size; 3310 } 3311 ('' === t.vertical 3312 ? this.applyStyles({ left: this.formatStyle(s, '%'), width: this.formatStyle(t.size, '%') }) 3313 : this.applyStyles({ top: this.formatStyle(s, '%'), height: this.formatStyle(t.size, '%') }), 3314 (this.move = function (e) { 3315 this.applyStyles({ 3316 top: this.formatStyle(e.top, 'px'), 3317 bottom: this.formatStyle(e.bottom, 'px'), 3318 left: this.formatStyle(e.left, 'px'), 3319 right: this.formatStyle(e.right, 'px'), 3320 height: this.formatStyle(e.height, 'px'), 3321 width: this.formatStyle(e.width, 'px') 3322 }); 3323 })); 3324 } 3325 function _(e) { 3326 var t, i, s, r; 3327 (e.div && 3328 ((t = e.div.offsetHeight), 3329 (i = e.div.offsetWidth), 3330 (s = e.div.offsetTop), 3331 (r = (r = (r = e.div.childNodes) && r[0]) && r.getClientRects && r.getClientRects()), 3332 (e = e.div.getBoundingClientRect()), 3333 (r = r ? Math.max((r[0] && r[0].height) || 0, e.height / r.length) : 0)), 3334 (this.left = e.left), 3335 (this.right = e.right),
3336 (this.top = e.top || s), 3337 (this.height = e.height || t), 3338 (this.bottom = e.bottom || s + (e.height || t)), 3339 (this.width = e.width || i), 3340 (this.lineHeight = void 0 !== r ? r : e.lineHeight)); 3341 } 3342 function os(e, t, o, l) { 3343 var i, 3344 s = new _(t), 3345 r = t.cue, 3346 n = (function (e) { 3347 if ('number' == typeof e.line && (e.snapToLines || (0 <= e.line && e.line <= 100))) 3348 return e.line; 3349 if (!e.track || !e.track.textTrackList || !e.track.textTrackList.mediaElement) return -1; 3350 for (var t = e.track, i = t.textTrackList, s = 0, r = 0; r < i.length && i[r] !== t; r++) 3351 'showing' === i[r].mode && s++; 3352 return -1 * ++s; 3353 })(r), 3354 a = []; 3355 if (r.snapToLines) { 3356 switch (r.vertical) { 3357 case '': 3358 ((a = ['+y', '-y']), (i = 'height')); 3359 break; 3360 case 'rl': 3361 ((a = ['+x', '-x']), (i = 'width')); 3362 break; 3363 case 'lr': 3364 ((a = ['-x', '+x']), (i = 'width')); 3365 } 3366 var d = s.lineHeight, 3367 h = d * Math.round(n), 3368 u = o[i] + d, 3369 c = a[0]; 3370 (Math.abs(h) > u && ((h = h < 0 ? -1 : 1), (h *= Math.ceil(u / d) * d)), 3371 n < 0 && ((h += '' === r.vertical ? o.height : o.width), (a = a.reverse())), 3372 s.move(c, h)); 3373 } else { 3374 var p = (s.lineHeight / o.height) * 100; 3375 switch (r.lineAlign) { 3376 case 'center': 3377 n -= p / 2; 3378 break; 3379 case 'end': 3380 n -= p; 3381 } 3382 switch (r.vertical) { 3383 case '': 3384 t.applyStyles({ top: t.formatStyle(n, '%') }); 3385 break; 3386 case 'rl': 3387 t.applyStyles({ left: t.formatStyle(n, '%') }); 3388 break; 3389 case 'lr': 3390 t.applyStyles({ right: t.formatStyle(n, '%') }); 3391 } 3392 ((a = ['+y', '-x', '+x', '-y']), (s = new _(t))); 3393 } 3394 u = (function (e, t) { 3395 for (var i, s = new _(e), r = 1, n = 0; n < t.length; n++) { 3396 for (; e.overlapsOppositeAxis(o, t[n]) || (e.within(o) && e.overlapsAny(l)); ) e.move(t[n]); 3397 if (e.within(o)) return e; 3398 var a = e.intersectPercentage(o); 3399 (a < r && ((i = new _(e)), (r = a)), (e = new _(s))); 3400 } 3401 return i || s; 3402 })(s, a); 3403 t.move(u.toCSSCompatValues(o)); 3404 } 3405 function ls() {} 3406 ((ns.prototype.applyStyles = function (e, t) { 3407 for (var i in ((t = t || this.div), e)) e.hasOwnProperty(i) && (t.style[i] = e[i]); 3408 }), 3409 (ns.prototype.formatStyle = function (e, t) { 3410 return 0 === e ? 0 : e + t; 3411 }), 3412 ((as.prototype = $i(ns.prototype)).constructor = as), 3413 (_.prototype.move = function (e, t) { 3414 switch (((t = void 0 !== t ? t : this.lineHeight), e)) { 3415 case '+x': 3416 ((this.left += t), (this.right += t)); 3417 break; 3418 case '-x': 3419 ((this.left -= t), (this.right -= t)); 3420 break; 3421 case '+y': 3422 ((this.top += t), (this.bottom += t)); 3423 break; 3424 case '-y': 3425 ((this.top -= t), (this.bottom -= t)); 3426 } 3427 }), 3428 (_.prototype.overlaps = function (e) { 3429 return ( 3430 this.left < e.right && this.right > e.left && this.top < e.bottom && this.bottom > e.top 3431 ); 3432 }), 3433 (_.prototype.overlapsAny = function (e) { 3434 for (var t = 0; t < e.length; t++) if (this.overlaps(e[t])) return !0; 3435 return !1; 3436 }), 3437 (_.prototype.within = function (e) { 3438 return ( 3439 this.top >= e.top && this.bottom <= e.bottom && this.left >= e.left && this.right <= e.right 3440 ); 3441 }), 3442 (_.prototype.overlapsOppositeAxis = function (e, t) { 3443 switch (t) { 3444 case '+x': 3445 return this.left < e.left; 3446 case '-x': 3447 return this.right > e.right; 3448 case '+y': 3449 return this.top < e.top; 3450 case '-y': 3451 return this.bottom > e.bottom; 3452 } 3453 }), 3454 (_.prototype.intersectPercentage = function (e) { 3455 return ( 3456 (Math.max(0, Math.min(this.right, e.right) - Math.max(this.left, e.left)) * 3457 Math.max(0, Math.min(this.bottom, e.bottom) - Math.max(this.top, e.top))) / 3458 (this.height * this.width) 3459 ); 3460 }), 3461 (_.prototype.toCSSCompatValues = function (e) { 3462 return { 3463 top: this.top - e.top, 3464 bottom: e.bottom - this.bottom, 3465 left: this.left - e.left, 3466 right: e.right - this.right, 3467 height: this.height, 3468 width: this.width 3469 }; 3470 }), 3471 (_.getSimpleBoxPosition = function (e) { 3472 var t = e.div ? e.div.offsetHeight : e.tagName ? e.offsetHeight : 0, 3473 i = e.div ? e.div.offsetWidth : e.tagName ? e.offsetWidth : 0, 3474 s = e.div ? e.div.offsetTop : e.tagName ? e.offsetTop : 0; 3475 return { 3476 left: (e = e.div 3477 ? e.div.getBoundingClientRect() 3478 : e.tagName 3479 ? e.getBoundingClientRect() 3480 : e).left, 3481 right: e.right, 3482 top: e.top || s, 3483 height: e.height || t, 3484 bottom: e.bottom || s + (e.height || t), 3485 width: e.width || i 3486 }; 3487 }), 3488 (ls.StringDecoder = function () { 3489 return { 3490 decode: function (e) { 3491 if (!e) return ''; 3492 if ('string' != typeof e) throw new Error('Error - expected string data.'); 3493 return decodeURIComponent(encodeURIComponent(e)); 3494 } 3495 }; 3496 }), 3497 (ls.convertCueToDOMTree = function (e, t) { 3498 return e && t ? is(e, t) : null; 3499 })); 3500 ((ls.processCues = function (e, t, i) { 3501 if (!e || !t || !i) return null; 3502 for (; i.firstChild; ) i.removeChild(i.firstChild); 3503 var s = e.document.createElement('div'); 3504 if ( 3505 ((s.style.position = 'absolute'), 3506 (s.style.left = '0'), 3507 (s.style.right = '0'), 3508 (s.style.top = '0'), 3509 (s.style.bottom = '0'), 3510 (s.style.margin = '1.5%'), 3511 i.appendChild(s), 3512 (function (e) { 3513 for (var t = 0; t < e.length; t++) if (e[t].hasBeenReset || !e[t].displayState) return 1; 3514 })(t)) 3515 ) 3516 for ( 3517 var r, 3518 n, 3519 a = [], 3520 o = _.getSimpleBoxPosition(s), 3521 l = { font: Math.round(0.05 * o.height * 100) / 100 + 'px sans-serif' }, 3522 d = 0; 3523 d < t.length; 3524 d++ 3525 ) 3526 ((r = new as(e, (n = t[d]), l)), 3527 s.appendChild(r.div), 3528 os(0, r, o, a), 3529 (n.displayState = r.div), 3530 a.push(_.getSimpleBoxPosition(r))); 3531 else for (var h = 0; h < t.length; h++) s.appendChild(t[h].displayState); 3532 }), 3533 ((ls.Parser = function (e, t, i) { 3534 (i || ((i = t), (t = {})), 3535 (t = t || {}), 3536 (this.window = e), 3537 (this.vttjs = t), 3538 (this.state = 'INITIAL'), 3539 (this.buffer = ''), 3540 (this.decoder = i || new TextDecoder('utf8')), 3541 (this.regionList = [])); 3542 }).prototype = { 3543 reportOrThrowError: function (e) { 3544 if (!(e instanceof Gi)) throw e; 3545 this.onparsingerror && this.onparsingerror(e); 3546 }, 3547 parse: function (e) { 3548 var s = this; 3549 function t() { 3550 for (var e = s.buffer, t = 0; t < e.length && '\r' !== e[t] && '\n' !== e[t]; ) ++t; 3551 var i = e.substr(0, t);
3552 return ('\r' === e[t] && ++t, '\n' === e[t] && ++t, (s.buffer = e.substr(t)), i); 3553 } 3554 function i(e) { 3555 e.match(/X-TIMESTAMP-MAP/) 3556 ? Yi( 3557 e, 3558 function (e, t) { 3559 var i; 3560 'X-TIMESTAMP-MAP' === e && 3561 ((e = t), 3562 (i = new Ki()), 3563 Yi( 3564 e, 3565 function (e, t) { 3566 switch (e) { 3567 case 'MPEGT': 3568 i.integer(e + 'S', t); 3569 break; 3570 case 'LOCA': 3571 i.set(e + 'L', Xi(t)); 3572 } 3573 }, 3574 /[^\d]:/, 3575 /,/ 3576 ), 3577 s.ontimestampmap) && 3578 s.ontimestampmap({ MPEGTS: i.get('MPEGTS'), LOCAL: i.get('LOCAL') }); 3579 }, 3580 /=/ 3581 ) 3582 : Yi( 3583 e, 3584 function (e, t) { 3585 var r; 3586 'Region' === e && 3587 ((e = t), 3588 (r = new Ki()), 3589 Yi( 3590 e, 3591 function (e, t) { 3592 switch (e) { 3593 case 'id': 3594 r.set(e, t); 3595 break; 3596 case 'width': 3597 r.percent(e, t); 3598 break; 3599 case 'lines': 3600 r.integer(e, t); 3601 break; 3602 case 'regionanchor': 3603 case 'viewportanchor': 3604 var i, 3605 s = t.split(','); 3606 2 === s.length && 3607 ((i = new Ki()).percent('x', s[0]), 3608 i.percent('y', s[1]), 3609 i.has('x') && i.has('y')) && 3610 (r.set(e + 'X', i.get('x')), r.set(e + 'Y', i.get('y'))); 3611 break; 3612 case 'scroll': 3613 r.alt(e, t, ['up']); 3614 } 3615 }, 3616 /=/, 3617 /\s/ 3618 ), 3619 r.has('id')) && 3620 (((e = new (s.vttjs.VTTRegion || s.window.VTTRegion)()).width = r.get( 3621 'width', 3622 100 3623 )), 3624 (e.lines = r.get('lines', 3)), 3625 (e.regionAnchorX = r.get('regionanchorX', 0)), 3626 (e.regionAnchorY = r.get('regionanchorY', 100)), 3627 (e.viewportAnchorX = r.get('viewportanchorX', 0)), 3628 (e.viewportAnchorY = r.get('viewportanchorY', 100)), 3629 (e.scroll = r.get('scroll', '')), 3630 s.onregion && s.onregion(e), 3631 s.regionList.push({ id: r.get('id'), region: e })); 3632 }, 3633 /:/ 3634 ); 3635 } 3636 e && (s.buffer += s.decoder.decode(e, { stream: !0 })); 3637 try { 3638 if ('INITIAL' === s.state) { 3639 if (!/\r\n|\n/.test(s.buffer)) return this; 3640 var r, 3641 n = (r = t()).match(/^WEBVTT([ \t].*)?$/); 3642 if (!n || !n[0]) throw new Gi(Gi.Errors.BadSignature); 3643 s.state = 'HEADER'; 3644 } 3645 for (var a = !1; s.buffer; ) { 3646 if (!/\r\n|\n/.test(s.buffer)) return this; 3647 switch ((a ? (a = !1) : (r = t()), s.state)) { 3648 case 'HEADER': 3649 /:/.test(r) ? i(r) : r || (s.state = 'ID'); 3650 continue; 3651 case 'NOTE': 3652 r || (s.state = 'ID'); 3653 continue; 3654 case 'ID': 3655 if (/^NOTE($|[ \t])/.test(r)) { 3656 s.state = 'NOTE'; 3657 break; 3658 } 3659 if (!r) continue; 3660 s.cue = new (s.vttjs.VTTCue || s.window.VTTCue)(0, 0, ''); 3661 try { 3662 s.cue.align = 'center'; 3663 } catch (e) { 3664 s.cue.align = 'middle'; 3665 } 3666 if (((s.state = 'CUE'), -1 === r.indexOf('--\x3e'))) { 3667 s.cue.id = r; 3668 continue; 3669 } 3670 case 'CUE': 3671 try { 3672 !(function (t, i, n) { 3673 var s = t; 3674 function e() { 3675 var e = Xi(t); 3676 if (null === e) 3677 throw new Gi(Gi.Errors.BadTimeStamp, 'Malformed timestamp: ' + s); 3678 return ((t = t.replace(/^[^\sa-zA-Z-]+/, '')), e); 3679 } 3680 function r() { 3681 t = t.replace(/^\s+/, ''); 3682 } 3683 if ((r(), (i.startTime = e()), r(), '--\x3e' !== t.substr(0, 3))) 3684 throw new Gi( 3685 Gi.Errors.BadTimeStamp, 3686 "Malformed time stamp (time stamps must be separated by '--\x3e'): " + s 3687 ); 3688 ((t = t.substr(3)), r(), (i.endTime = e()), r()); 3689 var a = t, 3690 o = new Ki(); 3691 (Yi( 3692 a, 3693 function (e, t) { 3694 switch (e) { 3695 case 'region': 3696 for (var i = n.length - 1; 0 <= i; i--) 3697 if (n[i].id === t) { 3698 o.set(e, n[i].region); 3699 break; 3700 } 3701 break; 3702 case 'vertical': 3703 o.alt(e, t, ['rl', 'lr']); 3704 break; 3705 case 'line': 3706 var s = t.split(','), 3707 r = s[0]; 3708 (o.integer(e, r), 3709 o.percent(e, r) && o.set('snapToLines', !1), 3710 o.alt(e, r, ['auto']), 3711 2 === s.length && 3712 o.alt('lineAlign', s[1], ['start', 'center', 'end'])); 3713 break; 3714 case 'position': 3715 ((s = t.split(',')), 3716 o.percent(e, s[0]), 3717 2 === s.length && 3718 o.alt('positionAlign', s[1], ['start', 'center', 'end'])); 3719 break; 3720 case 'size': 3721 o.percent(e, t); 3722 break; 3723 case 'align': 3724 o.alt(e, t, ['start', 'center', 'end', 'left', 'right']); 3725 } 3726 }, 3727 /:/, 3728 /\s/ 3729 ), 3730 (i.region = o.get('region', null)), 3731 (i.vertical = o.get('vertical', ''))); 3732 try { 3733 i.line = o.get('line', 'auto'); 3734 } catch (e) {} 3735 ((i.lineAlign = o.get('lineAlign', 'start')), 3736 (i.snapToLines = o.get('snapToLines', !0)), 3737 (i.size = o.get('size', 100))); 3738 try { 3739 i.align = o.get('align', 'center'); 3740 } catch (e) { 3741 i.align = o.get('align', 'middle'); 3742 } 3743 try { 3744 i.position = o.get('position', 'auto'); 3745 } catch (e) { 3746 i.position = o.get( 3747 'position', 3748 { start: 0, left: 0, center: 50, middle: 50, end: 100, right: 100 }, 3749 i.align 3750 ); 3751 } 3752 i.positionAlign = o.get( 3753 'positionAlign', 3754 { 3755 start: 'start', 3756 left: 'start', 3757 center: 'center', 3758 middle: 'center', 3759 end: 'end', 3760 right: 'end' 3761 }, 3762 i.align 3763 ); 3764 })(r, s.cue, s.regionList); 3765 } catch (e) { 3766 (s.reportOrThrowError(e), (s.cue = null), (s.state = 'BADCUE')); 3767 continue; 3768 } 3769 s.state = 'CUETEXT'; 3770 continue; 3771 case 'CUETEXT': 3772 var o = -1 !== r.indexOf('--\x3e');
3773 if (!r || (o && (a = !0))) { 3774 (s.oncue && s.oncue(s.cue), (s.cue = null), (s.state = 'ID')); 3775 continue; 3776 } 3777 (s.cue.text && (s.cue.text += '\n'), 3778 (s.cue.text += r.replace(/\u2028/g, '\n').replace(/u2029/g, '\n'))); 3779 continue; 3780 case 'BADCUE': 3781 r || (s.state = 'ID'); 3782 continue; 3783 } 3784 } 3785 } catch (e) { 3786 (s.reportOrThrowError(e), 3787 'CUETEXT' === s.state && s.cue && s.oncue && s.oncue(s.cue), 3788 (s.cue = null), 3789 (s.state = 'INITIAL' === s.state ? 'BADWEBVTT' : 'BADCUE')); 3790 } 3791 return this; 3792 }, 3793 flush: function () { 3794 var t = this; 3795 try { 3796 if ( 3797 ((t.buffer += t.decoder.decode()), 3798 (!t.cue && 'HEADER' !== t.state) || ((t.buffer += '\n\n'), t.parse()), 3799 'INITIAL' === t.state) 3800 ) 3801 throw new Gi(Gi.Errors.BadSignature); 3802 } catch (e) { 3803 t.reportOrThrowError(e); 3804 } 3805 return (t.onflush && t.onflush(), this); 3806 } 3807 })); 3808 var ds = ls, 3809 hs = { '': 1, lr: 1, rl: 1 }, 3810 us = { 3811 start: 1, 3812 center: 1, 3813 end: 1, 3814 left: 1, 3815 right: 1, 3816 auto: 1, 3817 'line-left': 1, 3818 'line-right': 1 3819 }; 3820 function cs(e) { 3821 return 'string' == typeof e && !!us[e.toLowerCase()] && e.toLowerCase(); 3822 } 3823 function ps(e, t, i) { 3824 this.hasBeenReset = !1; 3825 var s = '', 3826 r = !1, 3827 n = e, 3828 a = t, 3829 o = i, 3830 l = null, 3831 d = '', 3832 h = !0, 3833 u = 'auto', 3834 c = 'start', 3835 p = 'auto', 3836 m = 'auto', 3837 g = 100, 3838 f = 'center'; 3839 (Object.defineProperties(this, { 3840 id: { 3841 enumerable: !0, 3842 get: function () { 3843 return s; 3844 }, 3845 set: function (e) { 3846 s = '' + e; 3847 } 3848 }, 3849 pauseOnExit: { 3850 enumerable: !0, 3851 get: function () { 3852 return r; 3853 }, 3854 set: function (e) { 3855 r = !!e; 3856 } 3857 }, 3858 startTime: { 3859 enumerable: !0, 3860 get: function () { 3861 return n; 3862 }, 3863 set: function (e) { 3864 if ('number' != typeof e) throw new TypeError('Start time must be set to a number.'); 3865 ((n = e), (this.hasBeenReset = !0)); 3866 } 3867 }, 3868 endTime: { 3869 enumerable: !0, 3870 get: function () { 3871 return a; 3872 }, 3873 set: function (e) { 3874 if ('number' != typeof e) throw new TypeError('End time must be set to a number.'); 3875 ((a = e), (this.hasBeenReset = !0)); 3876 } 3877 }, 3878 text: { 3879 enumerable: !0, 3880 get: function () { 3881 return o; 3882 }, 3883 set: function (e) { 3884 ((o = '' + e), (this.hasBeenReset = !0)); 3885 } 3886 }, 3887 region: { 3888 enumerable: !0, 3889 get: function () { 3890 return l; 3891 }, 3892 set: function (e) { 3893 ((l = e), (this.hasBeenReset = !0)); 3894 } 3895 }, 3896 vertical: { 3897 enumerable: !0, 3898 get: function () { 3899 return d; 3900 }, 3901 set: function (e) { 3902 e = 'string' == typeof (e = e) && !!hs[e.toLowerCase()] && e.toLowerCase(); 3903 if (!1 === e) 3904 throw new SyntaxError( 3905 'Vertical: an invalid or illegal direction string was specified.' 3906 ); 3907 ((d = e), (this.hasBeenReset = !0)); 3908 } 3909 }, 3910 snapToLines: { 3911 enumerable: !0, 3912 get: function () { 3913 return h; 3914 }, 3915 set: function (e) { 3916 ((h = !!e), (this.hasBeenReset = !0)); 3917 } 3918 }, 3919 line: { 3920 enumerable: !0, 3921 get: function () { 3922 return u; 3923 }, 3924 set: function (e) { 3925 if ('number' != typeof e && 'auto' !== e) 3926 throw new SyntaxError('Line: an invalid number or illegal string was specified.'); 3927 ((u = e), (this.hasBeenReset = !0)); 3928 } 3929 }, 3930 lineAlign: { 3931 enumerable: !0, 3932 get: function () { 3933 return c; 3934 }, 3935 set: function (e) { 3936 e = cs(e); 3937 e && ((c = e), (this.hasBeenReset = !0)); 3938 } 3939 }, 3940 position: { 3941 enumerable: !0, 3942 get: function () { 3943 return p; 3944 }, 3945 set: function (e) { 3946 if (e < 0 || 100 < e) throw new Error('Position must be between 0 and 100.'); 3947 ((p = e), (this.hasBeenReset = !0)); 3948 } 3949 }, 3950 positionAlign: { 3951 enumerable: !0, 3952 get: function () { 3953 return m; 3954 }, 3955 set: function (e) { 3956 e = cs(e); 3957 e && ((m = e), (this.hasBeenReset = !0)); 3958 } 3959 }, 3960 size: { 3961 enumerable: !0, 3962 get: function () { 3963 return g; 3964 }, 3965 set: function (e) { 3966 if (e < 0 || 100 < e) throw new Error('Size must be between 0 and 100.'); 3967 ((g = e), (this.hasBeenReset = !0)); 3968 } 3969 }, 3970 align: { 3971 enumerable: !0, 3972 get: function () { 3973 return f; 3974 }, 3975 set: function (e) { 3976 e = cs(e); 3977 if (!e)
3978 throw new SyntaxError('align: an invalid or illegal alignment string was specified.'); 3979 ((f = e), (this.hasBeenReset = !0)); 3980 } 3981 } 3982 }), 3983 (this.displayState = void 0)); 3984 } 3985 ps.prototype.getCueAsHTML = function () { 3986 return WebVTT.convertCueToDOMTree(window, this.text); 3987 }; 3988 var ms = ps, 3989 gs = { '': !0, up: !0 }; 3990 function fs(e) { 3991 return 'number' == typeof e && 0 <= e && e <= 100; 3992 } 3993 function ys() { 3994 var t = 100, 3995 i = 3, 3996 s = 0, 3997 r = 100, 3998 n = 0, 3999 a = 100, 4000 o = ''; 4001 Object.defineProperties(this, { 4002 width: { 4003 enumerable: !0, 4004 get: function () { 4005 return t; 4006 }, 4007 set: function (e) { 4008 if (!fs(e)) throw new Error('Width must be between 0 and 100.'); 4009 t = e; 4010 } 4011 }, 4012 lines: { 4013 enumerable: !0, 4014 get: function () { 4015 return i; 4016 }, 4017 set: function (e) { 4018 if ('number' != typeof e) throw new TypeError('Lines must be set to a number.'); 4019 i = e; 4020 } 4021 }, 4022 regionAnchorY: { 4023 enumerable: !0, 4024 get: function () { 4025 return r; 4026 }, 4027 set: function (e) { 4028 if (!fs(e)) throw new Error('RegionAnchorX must be between 0 and 100.'); 4029 r = e; 4030 } 4031 }, 4032 regionAnchorX: { 4033 enumerable: !0, 4034 get: function () { 4035 return s; 4036 }, 4037 set: function (e) { 4038 if (!fs(e)) throw new Error('RegionAnchorY must be between 0 and 100.'); 4039 s = e; 4040 } 4041 }, 4042 viewportAnchorY: { 4043 enumerable: !0, 4044 get: function () { 4045 return a; 4046 }, 4047 set: function (e) { 4048 if (!fs(e)) throw new Error('ViewportAnchorY must be between 0 and 100.'); 4049 a = e; 4050 } 4051 }, 4052 viewportAnchorX: { 4053 enumerable: !0, 4054 get: function () { 4055 return n; 4056 }, 4057 set: function (e) { 4058 if (!fs(e)) throw new Error('ViewportAnchorX must be between 0 and 100.'); 4059 n = e; 4060 } 4061 }, 4062 scroll: { 4063 enumerable: !0, 4064 get: function () { 4065 return o; 4066 }, 4067 set: function (e) { 4068 e = 'string' == typeof (e = e) && !!gs[e.toLowerCase()] && e.toLowerCase(); 4069 !1 !== e && (o = e); 4070 } 4071 } 4072 }); 4073 } 4074 var _s = bi(function (e) { 4075 var e = (e.exports = { WebVTT: ds, VTTCue: ms, VTTRegion: ys }), 4076 t = ((Ti.vttjs = e), (Ti.WebVTT = e.WebVTT), e.VTTCue), 4077 i = e.VTTRegion, 4078 s = Ti.VTTCue, 4079 r = Ti.VTTRegion; 4080 ((e.shim = function () { 4081 ((Ti.VTTCue = t), (Ti.VTTRegion = i)); 4082 }), 4083 (e.restore = function () { 4084 ((Ti.VTTCue = s), (Ti.VTTRegion = r)); 4085 }), 4086 Ti.VTTCue || e.shim()); 4087 }); 4088 _s.WebVTT; 4089 class v extends g { 4090 constructor(t = {}, e = function () {}) { 4091 ((t.reportTouchActivity = !1), 4092 super(null, t, e), 4093 (this.onDurationChange_ = (e) => this.onDurationChange(e)), 4094 (this.trackProgress_ = (e) => this.trackProgress(e)), 4095 (this.trackCurrentTime_ = (e) => this.trackCurrentTime(e)), 4096 (this.stopTrackingCurrentTime_ = (e) => this.stopTrackingCurrentTime(e)), 4097 (this.disposeSourceHandler_ = (e) => this.disposeSourceHandler(e)), 4098 (this.queuedHanders_ = new Set()), 4099 (this.hasStarted_ = !1), 4100 this.on('playing', function () { 4101 this.hasStarted_ = !0; 4102 }), 4103 this.on('loadstart', function () { 4104 this.hasStarted_ = !1; 4105 }), 4106 a.names.forEach((e) => { 4107 e = a[e]; 4108 t && t[e.getterName] && (this[e.privateName] = t[e.getterName]); 4109 }), 4110 this.featuresProgressEvents || this.manualProgressOn(), 4111 this.featuresTimeupdateEvents || this.manualTimeUpdatesOn(), 4112 ['Text', 'Audio', 'Video'].forEach((e) => { 4113 !1 === t[`native${e}Tracks`] && (this[`featuresNative${e}Tracks`] = !1); 4114 }), 4115 !1 === t.nativeCaptions || !1 === t.nativeTextTracks 4116 ? (this.featuresNativeTextTracks = !1) 4117 : (!0 !== t.nativeCaptions && !0 !== t.nativeTextTracks) || 4118 (this.featuresNativeTextTracks = !0), 4119 this.featuresNativeTextTracks || this.emulateTextTracks(), 4120 (this.preloadTextTracks = !1 !== t.preloadTextTracks), 4121 (this.autoRemoteTextTracks_ = new a.text.ListClass()), 4122 this.initTrackListeners(), 4123 t.nativeControlsForTouch || this.emitTapEvents(), 4124 this.constructor && (this.name_ = this.constructor.name || 'Unknown Tech')); 4125 } 4126 triggerSourceset(e) { 4127 (this.isReady_ || this.one('ready', () => this.setTimeout(() => this.triggerSourceset(e), 1)), 4128 this.trigger({ src: e, type: 'sourceset' })); 4129 } 4130 manualProgressOn() { 4131 (this.on('durationchange', this.onDurationChange_), 4132 (this.manualProgress = !0), 4133 this.one('ready', this.trackProgress_)); 4134 } 4135 manualProgressOff() { 4136 ((this.manualProgress = !1), 4137 this.stopTrackingProgress(), 4138 this.off('durationchange', this.onDurationChange_)); 4139 } 4140 trackProgress(e) { 4141 (this.stopTrackingProgress(), 4142 (this.progressInterval = this.setInterval( 4143 p(this, function () { 4144 var e = this.bufferedPercent(); 4145 (this.bufferedPercent_ !== e && this.trigger('progress'), 4146 1 === (this.bufferedPercent_ = e) && this.stopTrackingProgress()); 4147 }), 4148 500 4149 ))); 4150 } 4151 onDurationChange(e) { 4152 this.duration_ = this.duration(); 4153 } 4154 buffered() { 4155 return jt(0, 0); 4156 } 4157 bufferedPercent() { 4158 return Gt(this.buffered(), this.duration_); 4159 } 4160 stopTrackingProgress() { 4161 this.clearInterval(this.progressInterval); 4162 } 4163 manualTimeUpdatesOn() { 4164 ((this.manualTimeUpdates = !0), 4165 this.on('play', this.trackCurrentTime_), 4166 this.on('pause', this.stopTrackingCurrentTime_)); 4167 } 4168 manualTimeUpdatesOff() { 4169 ((this.manualTimeUpdates = !1), 4170 this.stopTrackingCurrentTime(), 4171 this.off('play', this.trackCurrentTime_), 4172 this.off('pause', this.stopTrackingCurrentTime_)); 4173 } 4174 trackCurrentTime() { 4175 (this.currentTimeInterval && this.stopTrackingCurrentTime(), 4176 (this.currentTimeInterval = this.setInterval(function () { 4177 this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 }); 4178 }, 250))); 4179 } 4180 stopTrackingCurrentTime() { 4181 (this.clearInterval(this.currentTimeInterval), 4182 this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 })); 4183 } 4184 dispose() { 4185 (this.clearTracks(Vi.names), 4186 this.manualProgress && this.manualProgressOff(), 4187 this.manualTimeUpdates && this.manualTimeUpdatesOff(), 4188 super.dispose()); 4189 } 4190 clearTracks(e) {
4191 (e = [].concat(e)).forEach((e) => { 4192 var t = this[e + 'Tracks']() || []; 4193 let i = t.length; 4194 for (; i--; ) { 4195 var s = t[i]; 4196 ('text' === e && this.removeRemoteTextTrack(s), t.removeTrack(s)); 4197 } 4198 }); 4199 } 4200 cleanupAutoTextTracks() { 4201 var e = this.autoRemoteTextTracks_ || []; 4202 let t = e.length; 4203 for (; t--; ) { 4204 var i = e[t]; 4205 this.removeRemoteTextTrack(i); 4206 } 4207 } 4208 reset() {} 4209 crossOrigin() {} 4210 setCrossOrigin() {} 4211 error(e) { 4212 return (void 0 !== e && ((this.error_ = new i(e)), this.trigger('error')), this.error_); 4213 } 4214 played() { 4215 return this.hasStarted_ ? jt(0, 0) : jt(); 4216 } 4217 play() {} 4218 setScrubbing(e) {} 4219 scrubbing() {} 4220 setCurrentTime(e) { 4221 this.manualTimeUpdates && 4222 this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 }); 4223 } 4224 initTrackListeners() { 4225 Vi.names.forEach((e) => { 4226 var t = Vi[e]; 4227 let i = () => { 4228 this.trigger(e + 'trackchange'); 4229 }, 4230 s = this[t.getterName](); 4231 (s.addEventListener('removetrack', i), 4232 s.addEventListener('addtrack', i), 4233 this.on('dispose', () => { 4234 (s.removeEventListener('removetrack', i), s.removeEventListener('addtrack', i)); 4235 })); 4236 }); 4237 } 4238 addWebVttScript_() { 4239 if (!window.WebVTT) 4240 if (document.body.contains(this.el())) 4241 if (!this.options_['vtt.js'] && Q(_s) && 0 < Object.keys(_s).length) 4242 this.trigger('vttjsloaded'); 4243 else { 4244 let e = document.createElement('script'); 4245 ((e.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js'), 4246 (e.onload = () => { 4247 this.trigger('vttjsloaded'); 4248 }), 4249 (e.onerror = () => { 4250 this.trigger('vttjserror'); 4251 }), 4252 this.on('dispose', () => { 4253 ((e.onload = null), (e.onerror = null)); 4254 }), 4255 (window.WebVTT = !0), 4256 this.el().parentNode.appendChild(e)); 4257 } 4258 else this.ready(this.addWebVttScript_); 4259 } 4260 emulateTextTracks() { 4261 let i = this.textTracks(), 4262 e = this.remoteTextTracks(), 4263 t = (e) => i.addTrack(e.track), 4264 s = (e) => i.removeTrack(e.track), 4265 r = 4266 (e.on('addtrack', t), 4267 e.on('removetrack', s), 4268 this.addWebVttScript_(), 4269 () => this.trigger('texttrackchange')), 4270 n = () => { 4271 r(); 4272 for (let e = 0; e < i.length; e++) { 4273 var t = i[e]; 4274 (t.removeEventListener('cuechange', r), 4275 'showing' === t.mode && t.addEventListener('cuechange', r)); 4276 } 4277 }; 4278 (n(), 4279 i.addEventListener('change', n), 4280 i.addEventListener('addtrack', n), 4281 i.addEventListener('removetrack', n), 4282 this.on('dispose', function () { 4283 (e.off('addtrack', t), 4284 e.off('removetrack', s), 4285 i.removeEventListener('change', n), 4286 i.removeEventListener('addtrack', n), 4287 i.removeEventListener('removetrack', n)); 4288 for (let e = 0; e < i.length; e++) i[e].removeEventListener('cuechange', r); 4289 })); 4290 } 4291 addTextTrack(e, t, i) { 4292 if (e) 4293 return ( 4294 (e = e), 4295 (t = t), 4296 (i = i), 4297 (r = {}), 4298 (n = (s = this).textTracks()), 4299 (r.kind = e), 4300 t && (r.label = t), 4301 i && (r.language = i), 4302 (r.tech = s), 4303 (e = new a.text.TrackClass(r)), 4304 n.addTrack(e), 4305 e 4306 ); 4307 throw new Error('TextTrack kind is required but was not provided'); 4308 var s, r, n; 4309 } 4310 createRemoteTextTrack(e) { 4311 e = d(e, { tech: this }); 4312 return new Hi.remoteTextEl.TrackClass(e); 4313 } 4314 addRemoteTextTrack(e = {}, t) { 4315 let i = this.createRemoteTextTrack(e); 4316 return ( 4317 'boolean' != typeof t && (t = !1), 4318 this.remoteTextTrackEls().addTrackElement_(i), 4319 this.remoteTextTracks().addTrack(i.track), 4320 !1 === t && this.ready(() => this.autoRemoteTextTracks_.addTrack(i.track)), 4321 i 4322 ); 4323 } 4324 removeRemoteTextTrack(e) { 4325 var t = this.remoteTextTrackEls().getTrackElementByTrack_(e); 4326 (this.remoteTextTrackEls().removeTrackElement_(t), 4327 this.remoteTextTracks().removeTrack(e), 4328 this.autoRemoteTextTracks_.removeTrack(e)); 4329 } 4330 getVideoPlaybackQuality() { 4331 return {}; 4332 } 4333 requestPictureInPicture() { 4334 return Promise.reject(); 4335 } 4336 disablePictureInPicture() { 4337 return !0; 4338 } 4339 setDisablePictureInPicture() {} 4340 requestVideoFrameCallback(e) { 4341 let t = lt++; 4342 return ( 4343 !this.isReady_ || this.paused() 4344 ? (this.queuedHanders_.add(t), 4345 this.one('playing', () => { 4346 this.queuedHanders_.has(t) && (this.queuedHanders_.delete(t), e()); 4347 })) 4348 : this.requestNamedAnimationFrame(t, e), 4349 t 4350 ); 4351 } 4352 cancelVideoFrameCallback(e) { 4353 this.queuedHanders_.has(e) 4354 ? this.queuedHanders_.delete(e) 4355 : this.cancelNamedAnimationFrame(e); 4356 } 4357 setPoster() {} 4358 playsinline() {} 4359 setPlaysinline() {} 4360 overrideNativeAudioTracks(e) {} 4361 overrideNativeVideoTracks(e) {} 4362 canPlayType(e) { 4363 return ''; 4364 } 4365 static canPlayType(e) { 4366 return ''; 4367 } 4368 static canPlaySource(e, t) { 4369 return v.canPlayType(e.type); 4370 } 4371 static isTech(e) { 4372 return e.prototype instanceof v || e instanceof v || e === v; 4373 } 4374 static registerTech(e, t) { 4375 if ((v.techs_ || (v.techs_ = {}), !v.isTech(t))) throw new Error(`Tech ${e} must be a Tech`); 4376 if (!v.canPlayType) throw new Error('Techs must have a static canPlayType method on them'); 4377 if (v.canPlaySource) 4378 return ( 4379 (e = m(e)), 4380 (v.techs_[e] = t), 4381 (v.techs_[Mt(e)] = t), 4382 'Tech' !== e && v.defaultTechOrder_.push(e), 4383 t 4384 ); 4385 throw new Error('Techs must have a static canPlaySource method on them'); 4386 } 4387 static getTech(e) { 4388 if (e) 4389 return v.techs_ && v.techs_[e] 4390 ? v.techs_[e] 4391 : ((e = m(e)), 4392 window && window.videojs && window.videojs[e] 4393 ? (o.warn( 4394 `The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)` 4395 ), 4396 window.videojs[e]) 4397 : void 0); 4398 } 4399 }
4400 (a.names.forEach(function (e) { 4401 let t = a[e]; 4402 v.prototype[t.getterName] = function () { 4403 return ( 4404 (this[t.privateName] = this[t.privateName] || new t.ListClass()), 4405 this[t.privateName] 4406 ); 4407 }; 4408 }), 4409 (v.prototype.featuresVolumeControl = !0), 4410 (v.prototype.featuresMuteControl = !0), 4411 (v.prototype.featuresFullscreenResize = !1), 4412 (v.prototype.featuresPlaybackRate = !1), 4413 (v.prototype.featuresProgressEvents = !1), 4414 (v.prototype.featuresSourceset = !1), 4415 (v.prototype.featuresTimeupdateEvents = !1), 4416 (v.prototype.featuresNativeTextTracks = !1), 4417 (v.prototype.featuresVideoFrameCallback = !1), 4418 (v.withSourceHandlers = function (r) { 4419 ((r.registerSourceHandler = function (e, t) { 4420 let i = r.sourceHandlers; 4421 ((i = i || (r.sourceHandlers = [])), void 0 === t && (t = i.length), i.splice(t, 0, e)); 4422 }), 4423 (r.canPlayType = function (t) { 4424 var i, 4425 s = r.sourceHandlers || []; 4426 for (let e = 0; e < s.length; e++) if ((i = s[e].canPlayType(t))) return i; 4427 return ''; 4428 }), 4429 (r.selectSourceHandler = function (t, i) { 4430 var s = r.sourceHandlers || []; 4431 for (let e = 0; e < s.length; e++) if (s[e].canHandleSource(t, i)) return s[e]; 4432 return null; 4433 }), 4434 (r.canPlaySource = function (e, t) { 4435 var i = r.selectSourceHandler(e, t); 4436 return i ? i.canHandleSource(e, t) : ''; 4437 })); 4438 (['seekable', 'seeking', 'duration'].forEach(function (e) { 4439 let t = this[e]; 4440 'function' == typeof t && 4441 (this[e] = function () { 4442 return this.sourceHandler_ && this.sourceHandler_[e] 4443 ? this.sourceHandler_[e].apply(this.sourceHandler_, arguments) 4444 : t.apply(this, arguments); 4445 }); 4446 }, r.prototype), 4447 (r.prototype.setSource = function (e) { 4448 let t = r.selectSourceHandler(e, this.options_); 4449 (t || 4450 (r.nativeSourceHandler 4451 ? (t = r.nativeSourceHandler) 4452 : o.error('No source handler found for the current source.')), 4453 this.disposeSourceHandler(), 4454 this.off('dispose', this.disposeSourceHandler_), 4455 t !== r.nativeSourceHandler && (this.currentSource_ = e), 4456 (this.sourceHandler_ = t.handleSource(e, this, this.options_)), 4457 this.one('dispose', this.disposeSourceHandler_)); 4458 }), 4459 (r.prototype.disposeSourceHandler = function () { 4460 (this.currentSource_ && 4461 (this.clearTracks(['audio', 'video']), (this.currentSource_ = null)), 4462 this.cleanupAutoTextTracks(), 4463 this.sourceHandler_ && 4464 (this.sourceHandler_.dispose && this.sourceHandler_.dispose(), 4465 (this.sourceHandler_ = null))); 4466 })); 4467 }), 4468 g.registerComponent('Tech', v), 4469 v.registerTech('Tech', v), 4470 (v.defaultTechOrder_ = [])); 4471 let vs = {}, 4472 bs = {}, 4473 Ts = {}; 4474 function Ss(e, t, i) { 4475 e.setTimeout( 4476 () => 4477 (function s(r = {}, e = [], n, a, o = [], l = !1) { 4478 let [t, ...d] = e; 4479 if ('string' == typeof t) s(r, vs[t], n, a, o, l); 4480 else if (t) { 4481 let i = xs(a, t); 4482 if (!i.setSource) return (o.push(i), s(r, d, n, a, o, l)); 4483 i.setSource(Object.assign({}, r), function (e, t) { 4484 if (e) return s(r, d, n, a, o, l); 4485 (o.push(i), s(t, r.type === t.type ? d : vs[t.type], n, a, o, l)); 4486 }); 4487 } else d.length ? s(r, d, n, a, o, l) : l ? n(r, o) : s(r, vs['*'], n, a, o, !0); 4488 })(t, vs[t.type], i, e), 4489 1 4490 ); 4491 } 4492 function ws(e, t, i, s = null) { 4493 var r = 'call' + m(i), 4494 r = e.reduce(Is(r), s), 4495 s = r === Ts, 4496 t = s ? null : t[i](r), 4497 n = e, 4498 a = i, 4499 o = t, 4500 l = s; 4501 for (let e = n.length - 1; 0 <= e; e--) { 4502 var d = n[e]; 4503 d[a] && d[a](l, o); 4504 } 4505 return t; 4506 } 4507 let Es = { 4508 buffered: 1, 4509 currentTime: 1, 4510 duration: 1, 4511 muted: 1, 4512 played: 1, 4513 paused: 1, 4514 seekable: 1, 4515 volume: 1, 4516 ended: 1 4517 }, 4518 Cs = { setCurrentTime: 1, setMuted: 1, setVolume: 1 }, 4519 ks = { play: 1, pause: 1 }; 4520 function Is(i) { 4521 return (e, t) =>
4521 (e === Ts ? Ts : t[i] ? t[i](e) : e); 4522 } 4523 function xs(e, t) { 4524 var i = bs[e.id()]; 4525 let s = null; 4526 if (null == i) ((s = t(e)), (bs[e.id()] = [[t, s]])); 4527 else { 4528 for (let e = 0; e < i.length; e++) { 4529 var [r, n] = i[e]; 4530 r === t && (s = n); 4531 } 4532 null === s && ((s = t(e)), i.push([t, s])); 4533 } 4534 return s; 4535 } 4536 function As(e) { 4537 if (Array.isArray(e)) { 4538 let t = []; 4539 (e.forEach(function (e) { 4540 ((e = As(e)), Array.isArray(e) ? (t = t.concat(e)) : Y(e) && t.push(e)); 4541 }), 4542 (e = t)); 4543 } else 4544 e = 4545 'string' == typeof e && e.trim() 4546 ? [Ls({ src: e })] 4547 : Y(e) && 'string' == typeof e.src && e.src && e.src.trim() 4548 ? [Ls(e)] 4549 : []; 4550 return e; 4551 } 4552 let Ds = { 4553 opus: 'video/ogg', 4554 ogv: 'video/ogg', 4555 mp4: 'video/mp4', 4556 mov: 'video/mp4', 4557 m4v: 'video/mp4', 4558 mkv: 'video/x-matroska', 4559 m4a: 'audio/mp4', 4560 mp3: 'audio/mpeg', 4561 aac: 'audio/aac', 4562 caf: 'audio/x-caf', 4563 flac: 'audio/flac', 4564 oga: 'audio/ogg', 4565 wav: 'audio/wav', 4566 m3u8: 'application/x-mpegURL', 4567 mpd: 'application/dash+xml', 4568 jpg: 'image/jpeg', 4569 jpeg: 'image/jpeg', 4570 gif: 'image/gif', 4571 png: 'image/png', 4572 svg: 'image/svg+xml', 4573 webp: 'image/webp' 4574 }, 4575 Ps = function (e = '') { 4576 e = yi(e); 4577 return Ds[e.toLowerCase()] || ''; 4578 }; 4579 function Ls(e) { 4580 var t; 4581 return (e.type || ((t = Ps(e.src)) && (e.type = t)), e); 4582 } 4583 Ii = fe ? 10009 : ye ? 461 : 8; 4584 let Os = { 4585 codes: { play: 415, pause: 19, ff: 417, rw: 412, back: Ii }, 4586 names: { 415: 'play', 19: 'pause', 417: 'ff', 412: 'rw', [Ii]: 'back' }, 4587 isEventKey(e, t) { 4588 return ((t = t.toLowerCase()), !(!this.names[e.keyCode] || this.names[e.keyCode] !== t)); 4589 }, 4590 getEventName(e) { 4591 return ( 4592 this.names[e.keyCode] || 4593 (this.codes[e.code] ? ((e = this.codes[e.code]), this.names[e]) : null) 4594 ); 4595 } 4596 }; 4597 class Rs extends wt { 4598 constructor(e) { 4599 (super(), 4600 (this.player_ = e), 4601 (this.focusableComponents = []), 4602 (this.isListening_ = !1), 4603 (this.isPaused_ = !1), 4604 (this.onKeyDown_ = this.onKeyDown_.bind(this)), 4605 (this.lastFocusedComponent_ = null)); 4606 } 4607 start() { 4608 this.isListening_ || 4609 (this.player_.on('keydown', this.onKeyDown_), 4610 this.player_.on('modalKeydown', this.onKeyDown_), 4611 this.player_.on('loadedmetadata', () => { 4612 this.focus(this.updateFocusableComponents()[0]); 4613 }), 4614 this.player_.on('modalclose', () => { 4615 this.refocusComponent(); 4616 }), 4617 this.player_.on('focusin', this.handlePlayerFocus_.bind(this)), 4618 this.player_.on('focusout', this.handlePlayerBlur_.bind(this)), 4619 (this.isListening_ = !0), 4620 this.player_.errorDisplay && 4621 this.player_.errorDisplay.on('aftermodalfill', () => { 4622 (this.updateFocusableComponents(), 4623 this.focusableComponents.length && 4624 (1 < this.focusableComponents.length 4625 ? this.focusableComponents[1] 4626 : this.focusableComponents[0] 4627 ).focus()); 4628 })); 4629 } 4630 stop() { 4631 (this.player_.off('keydown', this.onKeyDown_), (this.isListening_ = !1)); 4632 } 4633 onKeyDown_(e) { 4634 var t, 4635 i = e.originalEvent || e; 4636 ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(i.key) 4637 ? this.isPaused_ || 4638 (i.preventDefault(), (t = i.key.substring(5).toLowerCase()), this.move(t)) 4639 : Os.isEventKey(i, 'play') || 4640 Os.isEventKey(i, 'pause') || 4641 Os.isEventKey(i, 'ff') || 4642 Os.isEventKey(i, 'rw') 4643 ? (i.preventDefault(), (t = Os.getEventName(i)), this.performMediaAction_(t)) 4644 : Os.isEventKey(i, 'Back') && 4645 e.target && 4646 'function' == typeof e.target.closeable && 4647 e.target.closeable() && 4648 (i.preventDefault(), e.target.close()); 4649 } 4650 performMediaAction_(e) { 4651 if (this.player_) 4652 switch (e) { 4653 case 'play': 4654 this.player_.paused() && this.player_.play(); 4655 break; 4656 case 'pause': 4657 this.player_.paused() || this.player_.pause(); 4658 break; 4659 case 'ff': 4660 this.userSeek_(this.player_.currentTime() + 5); 4661 break; 4662 case 'rw': 4663 this.userSeek_(this.player_.currentTime() - 5); 4664 } 4665 } 4666 userSeek_(e) { 4667 (this.player_.liveTracker && 4668 this.player_.liveTracker.isLive() && 4669 this.player_.liveTracker.nextSeekedFromUser(), 4670 this.player_.currentTime(e)); 4671 } 4672 pause() { 4673 this.isPaused_ = !0; 4674 } 4675 resume() { 4676 this.isPaused_ = !1; 4677 } 4678 handlePlayerBlur_(e) { 4679 var t = e.relatedTarget; 4680 let i = null; 4681 var s = this.getCurrentComponent(e.target); 4682 (t && 4683 ((i = Boolean(t.closest('.video-js'))), t.classList.contains('vjs-text-track-settings')) && 4684 !this.isPaused_ && 4685 this.searchForTrackSelect_(), 4686 ((e.currentTarget.contains(e.relatedTarget) || i) && t) || 4687 (s && 'CloseButton' === s.name() 4688 ? this.refocusComponent() 4689 : (this.pause(), s && s.el() && (this.lastFocusedComponent_ = s)))); 4690 } 4691 handlePlayerFocus_() { 4692 this.getCurrentComponent() && this.getCurrentComponent().getIsF
4692ocusable() && this.resume(); 4693 } 4694 updateFocusableComponents() { 4695 var e = this.player_; 4696 let i = []; 4697 function s(e) { 4698 for (var t of e) 4699 (t.hasOwnProperty('el_') && 4700 t.getIsFocusable() && 4701 t.getIsAvailableToBeFocused(t.el()) && 4702 i.push(t), 4703 t.hasOwnProperty('children_') && 0 < t.children_.length && s(t.children_)); 4704 } 4705 return ( 4706 e.children_.forEach((e) => { 4707 if (e.hasOwnProperty('el_')) { 4708 if ( 4709 e.getIsFocusable && 4710 e.getIsAvailableToBeFocused && 4711 e.getIsFocusable() && 4712 e.getIsAvailableToBeFocused(e.el()) 4713 ) 4714 return void i.push(e); 4715 e.hasOwnProperty('children_') && 0 < e.children_.length 4716 ? s(e.children_) 4717 : e.hasOwnProperty('items') && 0 < e.items.length 4718 ? s(e.items) 4719 : this.findSuitableDOMChild(e) && i.push(e); 4720 } 4721 'ErrorDisplay' === e.name_ && 4722 e.opened_ && 4723 (e = e.el_.querySelector('.vjs-errors-ok-button-container')) && 4724 e.querySelectorAll('button').forEach((t, e) => { 4725 i.push({ 4726 name: () => 'ModalButton' + (e + 1), 4727 el: () => t, 4728 getPositions: () => { 4729 var e = t.getBoundingClientRect(); 4730 return { 4731 boundingClientRect: { 4732 x: e.x, 4733 y: e.y, 4734 width: e.width, 4735 height: e.height, 4736 top: e.top, 4737 right: e.right, 4738 bottom: e.bottom, 4739 left: e.left 4740 }, 4741 center: { 4742 x: e.left + e.width / 2, 4743 y: e.top + e.height / 2, 4744 width: 0, 4745 height: 0, 4746 top: e.top + e.height / 2, 4747 right: e.left + e.width / 2, 4748 bottom: e.top + e.height / 2, 4749 left: e.left + e.width / 2 4750 } 4751 }; 4752 }, 4753 getIsAvailableToBeFocused: () => !0, 4754 getIsFocusable: (e) => !0, 4755 focus: () => t.focus() 4756 }); 4757 }); 4758 }), 4759 (this.focusableComponents = i), 4760 this.focusableComponents 4761 ); 4762 } 4763 findSuitableDOMChild(e) { 4764 return e.el() 4765 ? (function t(i) { 4766 if (e.getIsFocusable(i) && e.getIsAvailableToBeFocused(i)) return i; 4767 for (let e = 0; e < i.children.length; e++) { 4768 var s = t(i.children[e]); 4769 if (s) return s; 4770 } 4771 return null; 4772 })(e.el()) 4773 : null; 4774 } 4775 getCurrentComponent(e) { 4776 this.updateFocusableComponents(); 4777 var t = e || document.activeElement; 4778 if (this.focusableComponents.length) 4779 for (var i of this.focusableComponents) if (i.el() === t) return i; 4780 } 4781 add(e) { 4782 var t = [...this.focusableComponents]; 4783 (e.hasOwnProperty('el_') && 4784 e.getIsFocusable() && 4785 e.getIsAvailableToBeFocused(e.el()) && 4786 t.push(e), 4787 (this.focusableComponents = t), 4788 this.trigger({ 4789 type: 'focusableComponentsChanged', 4790 focusableComponents: this.focusableComponents 4791 })); 4792 } 4793 remove(t) { 4794 for (let e = 0; e < this.focusableComponents.length; e++) 4795 if (this.focusableComponents[e].name() === t.name()) 4796 return ( 4797 this.focusableComponents.splice(e, 1), 4798 void this.trigger({ 4799 type: 'focusableComponentsChanged', 4800 focusableComponents: this.focusableComponents 4801 }) 4802 ); 4803 } 4804 clear() { 4805 0 < this.focusableComponents.length && 4806 ((this.focusableComponents = []), 4807 this.trigger({ 4808 type: 'focusableComponentsChanged', 4809 focusableComponents: this.focusableComponents 4810 })); 4811 } 4812 move(i) { 4813 let s = this.getCurrentComponent(); 4814 if (s) { 4815 let t = s.getPositions(); 4816 var e = this.focusableComponents.filter( 4817 (e) => 4818 e !== s && 4819 this.isInDirection_(t.boundingClientRect, e.getPositions().boundingClientRect, i) 4820 ), 4821 e = this.findBestCandidate_(t.center, e, i); 4822 e 4823 ? this.focus(e) 4824 : this.trigger({ type: 'endOfFocusableComponents', direction: i, focusedComponent: s }); 4825 } 4826 } 4827 findBestCandidate_(e, t, i) { 4828 let s = 1 / 0, 4829 r = null; 4830 for (var n of t) { 4831 var a = n.getPositions().center, 4832 a = this.calculateDistance_(e, a, i); 4833 a < s && ((s = a), (r = n)); 4834 } 4835 return r; 4836 } 4837 isInDirection_(e, t, i) { 4838 switch (i) { 4839 case 'right': 4840 return t.left >= e.right; 4841 case 'left': 4842 return t.right <= e.left; 4843 case 'down': 4844 return t.top >= e.bottom; 4845 case 'up': 4846 return t.bottom <= e.top; 4847 default: 4848 return !1; 4849 } 4850 } 4851 refocusComponent() { 4852 if (this.lastFocusedComponent_) { 4853 (this.player_.userActive() || this.player_.userActive(!0), 4854 this.updateFocusableComponents()); 4855 for (let e = 0; e < this.focusableComponents.length; e++) 4856 if (this.focusableComponents[e].name() === this.lastFocusedComponent_.name()) 4857 return void this.focus(this.focusableComponents[e]); 4858 } else this.focus(this.updateFocusableComponents()[0]); 4859 } 4860 focus(e) { 4861 'object' == typeof e && 4862 (e.getIsAvailableToBeFocused(e.el()) 4863 ? e.focus() 4864 : this.findSuitableDOMChild(e) && this.findSuitableDOMChild(e).focus()); 4865 } 4866 calculateDistance_(e, t, i) { 4867 var s = Math.abs(e.x - t.x), 4868 r = Math.abs(e.y - t.y); 4869 let n; 4870 switch (i) { 4871 case 'right': 4872 case 'left': 4873 n = s + 100 * r; 4874 break; 4875 case 'up': 4876 n = 2 * r + 0.5 * s; 4877 break; 4878 case 'down': 4879 n = 5 * r + s; 4880 break; 4881 default: 4882 n = s + r; 4883 } 4884 return n; 4885 } 4886 searchForTrackSelect_() { 4887 var e; 4888 for (e of this.updateFocusableComponents()) 4889 if ('TextTrackSelect' === e.constructor.name) { 4890 this.focus(e); 4891 break; 4892 } 4893 } 4894 } 4895 class Ns extends g { 4896 constructor(s, e, t) { 4897 if ( 4898 (super(s, d({ createEl: !1 }, e), t), 4899 e.playerOptions.sources && 0 !== e.playerOptions.sources.length) 4900 ) 4901 s.src(e.playerOptions.sources); 4902 else 4903 for (let t = 0, i = e.playerOptions.techOrder; t < i.length; t++) { 4904 var r = m(i[t]); 4905 let e = v.getTech(r); 4906 if ((e = r ? e : g.getComponent(r)) && e.isSupported()) { 4907 s.loadTech_(r); 4908 break; 4909 } 4910 } 4911 } 4912 } 4913 g.registerComponent('MediaLoader', Ns); 4914 class Ms extends g { 4915 constructor(e, t) { 4916 (super(e, t), 4917 this.options_.controlText && this.controlText(this.options_.controlText), 4918 (this.handleMouseOver_ = (e) => this.handleMouseOver(e)), 4919 (this.handleMouseOut_ = (e) => this.handleMouseOut(e)), 4920 (this.handleClick_ = (e) => this.handleClick(e)), 4921 (this.handleKeyDown_ = (e) => this.handleKeyDown(e)), 4922 this.emitTapEvents(), 4923 this.enable()); 4924 } 4925 createEl(e = 'div', t = {}, i = {}) { 4926 ((t = Object.assign({ className: this.buildCSSClass(), tabIndex: 0 }, t)), 4927 'button' === e && 4928 o.error( 4929 `Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.` 4930 ), 4931 (i = Object.assign({ role: 'button' }, i)), 4932 (this.tabIndex_ = t.tabIndex)); 4933 e = l(e, t, i); 4934 return ( 4935 this.player_.options_.experimentalSvgIcons || 4936 e.appendChild(l('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 })), 4937 this.createControlTextEl(e), 4938 e 4939 ); 4940 } 4941 dispose() { 4942 ((this.controlTextEl_ = null), super.dispose()); 4943 } 4944 createControlTextEl(e) { 4945 return ( 4946 (this.controlTextEl_ = l( 4947 'span', 4948 { className: 'vjs-control-text' }, 4949 { 'aria-live': 'polite' } 4950 )), 4951 e && e.appendChild(this.controlTextEl_), 4952 this.controlText(this.controlText_, e), 4953 this.controlTextEl_ 4954 ); 4955 } 4956 controlText(e, t = this.el()) { 4957 if (void 0 === e) return this.controlText_ || 'Need Text'; 4958 var i = this.localize(e); 4959 ((this.controlText_ = e), 4960 xe(this.controlTextEl_, i), 4961 this.nonIconControl || 4962 this.player_.options_.noUITitleAttributes || 4963 t.setAttribute('title', i)); 4964 } 4965 buildCSSClass() { 4966 return 'vjs-control vjs-button ' + super.buildCSSClass(); 4967 } 4968 enable() { 4969 this.enabled_ || 4970 ((this.enabled_ = !0), 4971 this.removeClass('vjs-disabled'), 4972 this.el_.setAttribute('aria-disabled', 'false'), 4973 'undefined' != typeof this.tabIndex_ && this.el_.setAttribute('tabIndex', this.tabIndex_), 4974 this.on(['tap', 'click'], this.handleClick_), 4975 this.on('keydown', this.handleKeyDown_)); 4976 } 4977 disable() { 4978 ((this.enabled_ = !1), 4979 this.addClass('vjs-disabled'), 4980 this.el_.setAttribute('aria-disabled', 'true'), 4981 'undefined' != typeof this.tabIndex_ && this.el_.removeAttribute('tabIndex'),
4982 this.off('mouseover', this.handleMouseOver_), 4983 this.off('mouseout', this.handleMouseOut_), 4984 this.off(['tap', 'click'], this.handleClick_), 4985 this.off('keydown', this.handleKeyDown_)); 4986 } 4987 handleLanguagechange() { 4988 this.controlText(this.controlText_); 4989 } 4990 handleClick(e) { 4991 this.options_.clickHandler && this.options_.clickHandler.call(this, arguments); 4992 } 4993 handleKeyDown(e) { 4994 ' ' === e.key || 'Enter' === e.key 4995 ? (e.preventDefault(), e.stopPropagation(), this.trigger('click')) 4996 : super.handleKeyDown(e); 4997 } 4998 } 4999 g.registerComponent('ClickableComponent', Ms); 5000 class Us extends Ms { 5001 constructor(e, t) { 5002 (super(e, t), 5003 this.update(), 5004 (this.update_ = (e) => this.update(e)), 5005 e.on('posterchange', this.update_)); 5006 } 5007 dispose() { 5008 (this.player().off('posterchange', this.update_), super.dispose()); 5009 } 5010 createEl() { 5011 return l('div', { className: 'vjs-poster' }); 5012 } 5013 crossOrigin(e) { 5014 if ('undefined' == typeof e) 5015 return this.$('img') 5016 ? this.$('img').crossOrigin 5017 : this.player_.tech_ && this.player_.tech_.isReady_ 5018 ? this.player_.crossOrigin() 5019 : this.player_.options_.crossOrigin || this.player_.options_.crossorigin || null; 5020 null !== e && 'anonymous' !== e && 'use-credentials' !== e 5021 ? this.player_.log.warn( 5022 `crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"` 5023 ) 5024 : this.$('img') && (this.$('img').crossOrigin = e); 5025 } 5026 update(e) { 5027 var t = this.player().poster(); 5028 (this.setSrc(t), t ? this.show() : this.hide()); 5029 } 5030 setSrc(e) { 5031 e 5032 ? (this.$('img') || 5033 this.el_.appendChild( 5034 l( 5035 'picture', 5036 { className: 'vjs-poster', tabIndex: -1 }, 5037 {}, 5038 l('img', { loading: 'lazy', crossOrigin: this.crossOrigin() }, { alt: '' }) 5039 ) 5040 ), 5041 (this.$('img').src = e)) 5042 : (this.el_.textContent = ''); 5043 } 5044 handleClick(e) { 5045 this.player_.controls() && 5046 (this.player_.tech(!0) && this.player_.tech(!0).focus(), 5047 this.player_.paused() ? Kt(this.player_.play()) : this.player_.pause()); 5048 } 5049 } 5050 ((Us.prototype.crossorigin = Us.prototype.crossOrigin), g.registerComponent('PosterImage', Us)); 5051 let Bs = { 5052 monospace: 'monospace', 5053 sansSerif: 'sans-serif', 5054 serif: 'serif', 5055 monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace', 5056 monospaceSerif: '"Courier New", monospace', 5057 proportionalSansSerif: 'sans-serif', 5058 proportionalSerif: 'serif', 5059 casual: '"Comic Sans MS", Impact, fantasy', 5060 script: '"Monotype Corsiva", cursive', 5061 smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif' 5062 }; 5063 function Fs(e, t) { 5064 let i; 5065 if (4 === e.length) i = e[1] + e[1] + e[2] + e[2] + e[3] + e[3]; 5066 else { 5067 if (7 !== e.length) 5068 throw new Error( 5069 'Invalid color code provided, ' + e + '; must be formatted as e.g. #f0e or #f604e2.' 5070 ); 5071 i = e.slice(1); 5072 } 5073 return ( 5074 'rgba(' + 5075 parseInt(i.slice(0, 2), 16) + 5076 ',' + 5077 parseInt(i.slice(2, 4), 16) + 5078 ',' + 5079 parseInt(i.slice(4, 6), 16) + 5080 ',' + 5081 t + 5082 ')' 5083 ); 5084 } 5085 function qs(e, t, i) { 5086 try { 5087 e.style[t] = i; 5088 } catch (e) {} 5089 } 5090 function js(e) { 5091 return e ? e + 'px' : ''; 5092 } 5093 class Vs extends g { 5094 constructor(s, e, t) { 5095 super(s, e, t); 5096 let r = (e) => { 5097 (this.updateDisplayOverlay(), this.updateDisplay(e)); 5098 }; 5099 (s.on('loadstart', (e) => this.toggleDisplay(e)), 5100 s.on('texttrackchange', (e) => this.updateDisplay(e)), 5101 s.on('loadedmetadata', (e) => { 5102 (this.updateDisplayOverlay(), this.preselectTrack(e)); 5103 }), 5104 s.ready( 5105 p(this, function () { 5106 if (s.tech_ && s.tech_.featuresNativeTextTracks) this.hide(); 5107 else { 5108 (s.on('fullscreenchange', r), s.on('playerresize', r)); 5109 let e = window.screen.orientation || window, 5110 t = window.screen.orientation ? 'change' : 'orientationchange'; 5111 (e.addEventListener(t, r), s.on('dispose', () => e.removeEventListener(t, r))); 5112 var i = this.options_.playerOptions.tracks || []; 5113 for (let e = 0; e < i.length; e++) this.player_.addRemoteTextTrack(i[e], !0); 5114 this.preselectTrack(); 5115 } 5116 }) 5117 )); 5118 } 5119 preselectTrack() { 5120 var t = { captions: 1, subtitles: 1 }, 5121 i = this.player_.textTracks(), 5122 s = this.player_.cache_.selectedLanguage; 5123 let r, n, a; 5124 for (let e = 0; e < i.length; e++) { 5125 var o = i[e]; 5126 s && s.enabled && s.language && s.language === o.language && o.kind in t 5127 ? (a = (o.kind !== s.kind && a) || o) 5128 : s && !s.enabled 5129 ? ((a = null), (r = null), (n = null)) 5130 : o.default && 5131 ('descriptions' !== o.kind || r ? o.kind in t && !n && (n = o) : (r = o)); 5132 } 5133 a ? (a.mode = 'showing') : n ? (n.mode = 'showing') : r && (r.mode = 'showing'); 5134 } 5135 toggleDisplay() { 5136 this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show(); 5137 } 5138 createEl() { 5139 return super.createEl( 5140 'div', 5141 { className: 'vjs-text-track-display' }, 5142 { translate: 'yes', 'aria-live': 'off', 'aria-atomic': 'true' } 5143 ); 5144 } 5145 clearDisplay() { 5146 'function' == typeof window.WebVTT && window.WebVTT.processCues(window, [], this.el_); 5147 } 5148 updateDisplay() { 5149 var s, 5150 r, 5151 n, 5152 a = this.player_.textTracks(), 5153 o = this.options_.allowMultipleShowingTracks; 5154 if ((this.clearDisplay(), o)) { 5155 var t = []; 5156 for (let e = 0; e < a.length; ++e) { 5157 var i = a[e]; 5158 'showing' === i.mode && t.push(i); 5159 } 5160 this.updateForTrack(t); 5161 } else { 5162 let e = null, 5163 t = null, 5164 i = a.length; 5165 for (; i--; ) { 5166 var l = a[i]; 5167 'showing' === l.mode && ('descriptions' === l.kind ? (e = l) : (t = l)); 5168 } 5169 (t 5170 ? ('off' !== this.getAttribute('aria-live') && this.setAttribute('aria-live', 'off'), 5171 this.updateForTrack(t)) 5172 : e && 5173 ('assertive' !== this.getAttribute('aria-live') && 5174 this.setAttribute('aria-live', 'assertive'), 5175 this.updateForTrack(e)), 5176 window.CSS.supports('inset', '10px') || 5177 ((s = (o = this.el_).querySelectorAll('.vjs-text-track-cue')), 5178 (r = this.player_.controlBar.el_.getBoundingClientRect().height), 5179 (n = this.player_.el_.getBoundingClientRect().height), 5180 (o.style = ''), 5181 qs(o, 'position', 'relative'), 5182 qs(o, 'height', n - r + 'px'), 5183 qs(o, 'top', 'unset'), 5184 _e ? qs(o, 'bottom', n + 'px') : qs(o, 'bottom', '0px'), 5185 0 < s.length &&
5186 s.forEach((e) => { 5187 var t; 5188 e.style.inset && 5189 3 === (t = e.style.inset.split(' ')).length && 5190 Object.assign(e.style, { top: t[0], right: t[1], bottom: t[2], left: 'unset' }); 5191 }))); 5192 } 5193 } 5194 updateDisplayOverlay() { 5195 if (this.player_.videoHeight() && window.CSS.supports('inset-inline: 10px')) { 5196 var i = this.player_.currentWidth(), 5197 s = this.player_.currentHeight(), 5198 r = i / s, 5199 n = this.player_.videoWidth() / this.player_.videoHeight(); 5200 let e = 0, 5201 t = 0; 5202 (0.1 < Math.abs(r - n) && 5203 (n < r ? (e = Math.round((i - s * n) / 2)) : (t = Math.round((s - i / n) / 2))), 5204 qs(this.el_, 'insetInline', js(e)), 5205 qs(this.el_, 'insetBlock', js(t))); 5206 } 5207 } 5208 updateDisplayState(e) { 5209 var t = this.player_.textTrackSettings.getValues(), 5210 i = e.activeCues; 5211 let s = i.length; 5212 for (; s--; ) { 5213 var r, 5214 n = i[s]; 5215 n && 5216 ((n = n.displayState), 5217 t.color && (n.firstChild.style.color = t.color), 5218 t.textOpacity && qs(n.firstChild, 'color', Fs(t.color || '#fff', t.textOpacity)), 5219 t.backgroundColor && (n.firstChild.style.backgroundColor = t.backgroundColor), 5220 t.backgroundOpacity && 5221 qs( 5222 n.firstChild, 5223 'backgroundColor', 5224 Fs(t.backgroundColor || '#000', t.backgroundOpacity) 5225 ), 5226 t.windowColor && 5227 (t.windowOpacity 5228 ? qs(n, 'backgroundColor', Fs(t.windowColor, t.windowOpacity)) 5229 : (n.style.backgroundColor = t.windowColor)), 5230 t.edgeStyle && 5231 ('dropshadow' === t.edgeStyle 5232 ? (n.firstChild.style.textShadow = 5233 '2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222') 5234 : 'raised' === t.edgeStyle 5235 ? (n.firstChild.style.textShadow = '1px 1px #222, 2px 2px #222, 3px 3px #222') 5236 : 'depressed' === t.edgeStyle 5237 ? (n.firstChild.style.textShadow = 5238 '1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222') 5239 : 'uniform' === t.edgeStyle && 5240 (n.firstChild.style.textShadow = 5241 '0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222')), 5242 t.fontPercent && 5243 1 !== t.fontPercent && 5244 ((r = window.parseFloat(n.style.fontSize)), 5245 (n.style.fontSize = r * t.fontPercent + 'px'), 5246 (n.style.height = 'auto'), 5247 (n.style.top = 'auto')), 5248 t.fontFamily) && 5249 'default' !== t.fontFamily && 5250 ('small-caps' === t.fontFamily 5251 ? (n.firstChild.style.fontVariant = 'small-caps') 5252 : (n.firstChild.style.fontFamily = Bs[t.fontFamily])); 5253 } 5254 } 5255 updateForTrack(i) { 5256 if ( 5257 (Array.isArray(i) || (i = [i]), 5258 'function' == typeof window.WebVTT && !i.every((e) => !e.activeCues)) 5259 ) { 5260 var t = []; 5261 for (let e = 0; e < i.length; ++e) { 5262 var s = i[e]; 5263 for (let e = 0; e < s.activeCues.length; ++e) t.push(s.activeCues[e]); 5264 } 5265 window.WebVTT.processCues(window, t, this.el_); 5266 for (let t = 0; t < i.length; ++t) { 5267 var r = i[t]; 5268 for (let e = 0; e < r.activeCues.length; ++e) { 5269 var n = r.activeCues[e].displayState; 5270 (Pe(n, 'vjs-text-track-cue', 'vjs-text-track-cue-' + (r.language || t)), 5271 r.language && Ue(n, 'lang', r.language)); 5272 } 5273 this.player_.textTrackSettings && this.updateDisplayState(r); 5274 } 5275 } 5276 } 5277 } 5278 g.registerComponent('TextTrackDisplay', Vs); 5279 class Hs extends g { 5280 createEl() { 5281 var e = this.player_.isAudio(), 5282 e = this.localize(e ? 'Audio Player' : 'Video Player'), 5283 e = l('span', { 5284 className: 'vjs-control-text', 5285 textContent: this.localize('{1} is loading.', [e]) 5286 }), 5287 t = super.createEl('div', { className: 'vjs-loading-spinner', dir: 'ltr' }); 5288 return (t.appendChild(e), t); 5289 } 5290 handleLanguagechange() { 5291 this.$('.vjs-control-text').textContent = this.localize('{1} is loading.', [ 5292 this.player_.isAudio() ? 'Audio Player' : 'Video Player' 5293 ]); 5294 } 5295 } 5296 g.registerComponent('LoadingSpinner', Hs); 5297 class s extends Ms { 5298 createEl(e, t = {}, i = {}) { 5299 t = l( 5300 'button', 5301 (t = Object.assign({ className: this.buildCSSClass() }, t)), 5302 (i = Object.assign({ type: 'button' }, i)) 5303 ); 5304 return ( 5305 this.player_.options_.experimentalSvgIcons || 5306 t.appendChild(l('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 })), 5307 this.createControlTextEl(t), 5308 t 5309 ); 5310 } 5311 addChild(e, t = {}) { 5312 var i = this.constructor.name; 5313 return ( 5314 o.warn( 5315 `Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.` 5316 ), 5317 g.prototype.addChild.call(this, e, t) 5318 ); 5319 } 5320 enable() { 5321 (super.enable(), this.el_.removeAttribute('disabled')); 5322 } 5323 disable() { 5324 (super.disable(), this.el_.setAttribute('disabled', 'disabled')); 5325 } 5326 handleKeyDown(e) { 5327 ' ' === e.key || 'Enter' === e.key ? e.stopPropagation() : super.handleKeyDown(e); 5328 } 5329 } 5330 g.registerComponent('Button', s); 5331 class zs extends s { 5332 constructor(e, t) { 5333 (super(e, t), 5334 (this.mouseused_ = !1), 5335 this.setIcon('play'), 5336 this.on('mousedown', (e) => this.handleMouseDown(e))); 5337 } 5338 buildCSSClass() { 5339 return 'vjs-big-play-button'; 5340 } 5341 handleClick(t) { 5342 var i = this.player_.play(); 5343 if (this.mouseused_ && 'clientX' in t && 'clientY' in t) 5344 (Kt(i), this.player_.tech(!0) && this.player_.tech(!0).focus()); 5345 else { 5346 var t = this.player_.getChild('controlBar'); 5347 let e = t && t.getChild('playToggle'); 5348 e 5349 ? ((t = () => e.focus()), Xt(i) ? i.then(t, () => {}) : this.setTimeout(t, 1)) 5350 : this.player_.tech(!0).focus(); 5351 } 5352 } 5353 handleKeyDown(e) { 5354 ((this.mouseused_ = !1), super.handleKeyDown(e)); 5355 } 5356 handleMouseDown(e) { 5357 this.mouseused_ = !0; 5358 } 5359 } 5360 ((zs.prototype.controlText_ = 'Play Video'), g.registerComponent('BigPlayButton', zs)); 5361 class $s extends s { 5362 constructor(e, t) { 5363 (super(e, t), 5364 this.setIcon('cancel'), 5365 this.controlText((t && t.controlText) || this.localize('Close'))); 5366 } 5367 buildCSSClass() { 5368 return 'vjs-close-button ' + super.buildCSSClass(); 5369 } 5370 handleClick(e) { 5371 this.trigger({ type: 'close', bubbles: !1 }); 5372 } 5373 handleKeyDown(e) { 5374 'Escape' === e.key 5375 ? (e.preventDefault(), e.stopPropagation(), this.trigger('click')) 5376 : super.handleKeyDown(e); 5377 } 5378 } 5379 g.registerComponent('CloseButton', $s); 5380 class Ws extends s { 5381 constructor(e, t = {}) { 5382 (super(e, t), 5383 (t.replay = void 0 === t.replay || t.replay), 5384 this.setIcon('play'), 5385 this.on(e, 'play', (e) => this.handlePlay(e)), 5386 this.on(e, 'pause', (e) => this.handlePause(e)), 5387 t.replay && this.on(e, 'ended', (e) => this.handleEnded(e))); 5388 } 5389 buildCSSClass() { 5390 return 'vjs-play-control ' + super.buildCSSClass(); 5391 } 5392 handleClick(e) { 5393 this.player_.paused() ? Kt(this.player_.play()) : this.player_.pause(); 5394 } 5395 handleSeeked(e) { 5396 (this.removeClass('vjs-ended'), 5397 this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)); 5398 } 5399 handlePlay(e) { 5400 (this.removeClass('vjs-ended', 'vjs-paused'), 5401 this.addClass('vjs-playing'), 5402 this.setIcon('pause'), 5403 this.controlText('Pause')); 5404 } 5405 handlePause(e) { 5406 (this.removeClass('vjs-playing'), 5407 this.addClass('vjs-paused'), 5408 this.setIcon('play'), 5409 this.controlText('Play')); 5410 } 5411 handleEnded(e) { 5412 (this.removeClass('vjs-playing'), 5413 this.addClass('vjs-ended'), 5414 this.setIcon('replay'), 5415 this.controlText('Replay'), 5416 this.one(this.player_, 'seeked', (e) => this.handleSeeked(e))); 5417 } 5418 } 5419 ((Ws.prototype.controlText_ = 'Play'), g.registerComponent('PlayToggle', Ws)); 5420 class Gs extends g { 5421 constructor(e, t) { 5422 (super(e, t), 5423 this.on(e, ['timeupdate', 'ended', 'seeking'], (e) => this.update(e)), 5424 this.updateTextNode_()); 5425 } 5426 createEl() { 5427 var e = this.buildCSSClass(), 5428 t = super.createEl('div', { className: e + ' vjs-time-control vjs-control' }), 5429 i = l( 5430 'span', 5431 { className: 'vjs-control-text', textContent: this.localize(this.labelText_) + 'Â ' }, 5432 { role: 'presentation' } 5433 ); 5434 return ( 5435 t.appendChild(i), 5436 (this.contentEl_ = l('span', { className: e + '-display' }, { role: 'presentation' })), 5437 t.appendChild(this.contentEl_), 5438 t 5439 ); 5440 } 5441 dispose() { 5442 ((this.contentEl_ = null), (this.textNode_ = null), super.dispose()); 5443 } 5444 update(e) { 5445 (!this.player_.options_.enableSmoothSeeking && 'seeking' === e.type) || this.updateContent(e); 5446 } 5447 updateTextNode_(e = 0) { 5448 ((e = Wt(e)), 5449 this.formattedTime_ !== e && 5450 ((this.formattedTime_ = e), 5451 this.requestNamedAnimationFrame('TimeDisplay#updateTextNode_', () => { 5452 if (this.contentEl_) { 5453 let e = this.textNode_; 5454 (e && 5455 this.contentEl_.firstChild !== e && 5456 ((e = null),
5457 o.warn( 5458 'TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.' 5459 )), 5460 (this.textNode_ = document.createTextNode(this.formattedTime_)), 5461 this.textNode_ && 5462 (e 5463 ? this.contentEl_.replaceChild(this.textNode_, e) 5464 : this.contentEl_.appendChild(this.textNode_))); 5465 } 5466 }))); 5467 } 5468 updateContent(e) {} 5469 } 5470 ((Gs.prototype.labelText_ = 'Time'), 5471 (Gs.prototype.controlText_ = 'Time'), 5472 g.registerComponent('TimeDisplay', Gs)); 5473 class Xs extends Gs { 5474 buildCSSClass() { 5475 return 'vjs-current-time'; 5476 } 5477 updateContent(e) { 5478 let t; 5479 ((t = this.player_.ended() 5480 ? this.player_.duration() 5481 : this.player_.scrubbing() 5482 ? this.player_.getCache().currentTime 5483 : this.player_.currentTime()), 5484 this.updateTextNode_(t)); 5485 } 5486 } 5487 ((Xs.prototype.labelText_ = 'Current Time'), 5488 (Xs.prototype.controlText_ = 'Current Time'), 5489 g.registerComponent('CurrentTimeDisplay', Xs)); 5490 class Ks extends Gs { 5491 constructor(e, t) { 5492 super(e, t); 5493 t = (e) => this.updateContent(e); 5494 (this.on(e, 'durationchange', t), 5495 this.on(e, 'loadstart', t), 5496 this.on(e, 'loadedmetadata', t)); 5497 } 5498 buildCSSClass() { 5499 return 'vjs-duration'; 5500 } 5501 updateContent(e) { 5502 var t = this.player_.duration(); 5503 this.updateTextNode_(t); 5504 } 5505 } 5506 ((Ks.prototype.labelText_ = 'Duration'), 5507 (Ks.prototype.controlText_ = 'Duration'), 5508 g.registerComponent('DurationDisplay', Ks)); 5509 class Ys extends g { 5510 createEl() { 5511 var e = super.createEl( 5512 'div', 5513 { className: 'vjs-time-control vjs-time-divider' }, 5514 { 'aria-hidden': !0 } 5515 ), 5516 t = super.createEl('div'), 5517 i = super.createEl('span', { textContent: '/' }); 5518 return (t.appendChild(i), e.appendChild(t), e); 5519 } 5520 } 5521 g.registerComponent('TimeDivider', Ys); 5522 class Qs extends Gs { 5523 constructor(e, t) { 5524 (super(e, t), this.on(e, 'durationchange', (e) => this.updateContent(e))); 5525 } 5526 buildCSSClass() { 5527 return 'vjs-remaining-time'; 5528 } 5529 createEl() { 5530 var e = super.createEl(); 5531 return ( 5532 !1 !== this.options_.displayNegative && 5533 e.insertBefore(l('span', {}, { 'aria-hidden': !0 }, '-'), this.contentEl_), 5534 e 5535 ); 5536 } 5537 updateContent(e) { 5538 if ('number' == typeof this.player_.duration()) { 5539 let e; 5540 ((e = this.player_.ended() 5541 ? 0 5542 : this.player_.remainingTimeDisplay 5543 ? this.player_.remainingTimeDisplay() 5544 : this.player_.remainingTime()), 5545 this.updateTextNode_(e)); 5546 } 5547 } 5548 } 5549 ((Qs.prototype.labelText_ = 'Remaining Time'), 5550 (Qs.prototype.controlText_ = 'Remaining Time'), 5551 g.registerComponent('RemainingTimeDisplay', Qs)); 5552 class Js extends g { 5553 constructor(e, t) { 5554 (super(e, t), 5555 this.updateShowing(), 5556 this.on(this.player(), 'durationchange', (e) => this.updateShowing(e))); 5557 } 5558 createEl() { 5559 var e = super.createEl('div', { className: 'vjs-live-control vjs-control' }); 5560 return ( 5561 (this.contentEl_ = l('div', { className: 'vjs-live-display' }, { 'aria-live': 'off' })), 5562 this.contentEl_.appendChild( 5563 l('span', { 5564 className: 'vjs-control-text', 5565 textContent: this.localize('Stream Type') + 'Â ' 5566 }) 5567 ), 5568 this.contentEl_.appendChild(document.createTextNode(this.localize('LIVE'))), 5569 e.appendChild(this.contentEl_), 5570 e 5571 ); 5572 } 5573 dispose() { 5574 ((this.contentEl_ = null), super.dispose()); 5575 } 5576 updateShowing(e) { 5577 this.player().duration() === 1 / 0 ? this.show() : this.hide(); 5578 } 5579 } 5580 g.registerComponent('LiveDisplay', Js); 5581 class Zs extends s { 5582 constructor(e, t) { 5583 (super(e, t), 5584 this.updateLiveEdgeStatus(), 5585 this.player_.liveTracker && 5586 ((this.updateLiveEdgeStatusHandler_ = (e) => this.updateLiveEdgeStatus(e)), 5587 this.on(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatusHandler_))); 5588 } 5589 createEl() { 5590 var e = super.createEl('button', { className: 'vjs-seek-to-live-control vjs-control' }); 5591 return ( 5592 this.setIcon('circle', e), 5593 (this.textEl_ = l( 5594 'span', 5595 { className: 'vjs-seek-to-live-text', textContent: this.localize('LIVE') }, 5596 { 'aria-hidden': 'true' } 5597 )), 5598 e.appendChild(this.textEl_), 5599 e 5600 ); 5601 } 5602 updateLiveEdgeStatus() { 5603 !this.player_.liveTracker || this.player_.liveTracker.atLiveEdge() 5604 ? (this.setAttribute('aria-disabled', !0), 5605 this.addClass('vjs-at-live-edge'), 5606 this.controlText('Seek to live, currently playing live')) 5607 : (this.setAttribute('aria-disabled', !1), 5608 this.removeClass('vjs-at-live-edge'), 5609 this.controlText('Seek to live, currently behind live')); 5610 } 5611 handleClick() { 5612 this.player_.liveTracker.seekToLiveEdge(); 5613 } 5614 dispose() { 5615 (this.player_.liveTracker && 5616 this.off(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatusHandler_), 5617 (this.textEl_ = null),
5618 super.dispose()); 5619 } 5620 } 5621 function er(e, t, i) { 5622 return ((e = Number(e)), Math.min(i, Math.max(t, isNaN(e) ? t : e))); 5623 } 5624 ((Zs.prototype.controlText_ = 'Seek to live, currently playing live'), 5625 g.registerComponent('SeekToLive', Zs)); 5626 zi = Object.freeze({ __proto__: null, clamp: er }); 5627 class tr extends g { 5628 constructor(e, t) { 5629 (super(e, t), 5630 (this.handleMouseDown_ = (e) => this.handleMouseDown(e)), 5631 (this.handleMouseUp_ = (e) => this.handleMouseUp(e)), 5632 (this.handleKeyDown_ = (e) => this.handleKeyDown(e)), 5633 (this.handleClick_ = (e) => this.handleClick(e)), 5634 (this.handleMouseMove_ = (e) => this.handleMouseMove(e)), 5635 (this.update_ = (e) => this.update(e)), 5636 (this.bar = this.getChild(this.options_.barName)), 5637 this.vertical(!!this.options_.vertical), 5638 this.enable()); 5639 } 5640 enabled() { 5641 return this.enabled_; 5642 } 5643 enable() { 5644 this.enabled() || 5645 (this.on('mousedown', this.handleMouseDown_), 5646 this.on('touchstart', this.handleMouseDown_), 5647 this.on('keydown', this.handleKeyDown_), 5648 this.on('click', this.handleClick_), 5649 this.on(this.player_, 'controlsvisible', this.update), 5650 this.playerEvent && this.on(this.player_, this.playerEvent, this.update), 5651 this.removeClass('disabled'), 5652 this.setAttribute('tabindex', 0), 5653 (this.enabled_ = !0)); 5654 } 5655 disable() { 5656 var e; 5657 this.enabled() && 5658 ((e = this.bar.el_.ownerDocument), 5659 this.off('mousedown', this.handleMouseDown_), 5660 this.off('touchstart', this.handleMouseDown_), 5661 this.off('keydown', this.handleKeyDown_), 5662 this.off('click', this.handleClick_), 5663 this.off(this.player_, 'controlsvisible', this.update_), 5664 this.off(e, 'mousemove', this.handleMouseMove_), 5665 this.off(e, 'mouseup', this.handleMouseUp_), 5666 this.off(e, 'touchmove', this.handleMouseMove_), 5667 this.off(e, 'touchend', this.handleMouseUp_), 5668 this.removeAttribute('tabindex'), 5669 this.addClass('disabled'), 5670 this.playerEvent && this.off(this.player_, this.playerEvent, this.update), 5671 (this.enabled_ = !1)); 5672 } 5673 createEl(e, t = {}, i = {}) { 5674 return ( 5675 (t.className = t.className + ' vjs-slider'), 5676 (t = Object.assign({ tabIndex: 0 }, t)), 5677 (i = Object.assign( 5678 { role: 'slider', 'aria-valuenow': 0, 'aria-valuemin': 0, 'aria-valuemax': 100 }, 5679 i 5680 )), 5681 super.createEl(e, t, i) 5682 ); 5683 } 5684 handleMouseDown(e) { 5685 var t = this.bar.el_.ownerDocument; 5686 ('mousedown' === e.type && e.preventDefault(), 5687 'touchstart' !== e.type || le || e.preventDefault(), 5688 Fe(), 5689 this.addClass('vjs-sliding'), 5690 this.trigger('slideractive'), 5691 this.on(t, 'mousemove', this.handleMouseMove_), 5692 this.on(t, 'mouseup', this.handleMouseUp_), 5693 this.on(t, 'touchmove', this.handleMouseMove_), 5694 this.on(t, 'touchend', this.handleMouseUp_), 5695 this.handleMouseMove(e, !0)); 5696 } 5697 handleMouseMove(e) {} 5698 handleMouseUp(e) { 5699 var t = this.bar.el_.ownerDocument; 5700 (qe(), 5701 this.removeClass('vjs-sliding'), 5702 this.trigger('sliderinactive'), 5703 this.off(t, 'mousemove', this.handleMouseMove_), 5704 this.off(t, 'mouseup', this.handleMouseUp_), 5705 this.off(t, 'touchmove', this.handleMouseMove_), 5706 this.off(t, 'touchend', this.handleMouseUp_), 5707 this.update()); 5708 } 5709 update() { 5710 if (this.el_ && this.bar) { 5711 let t = this.getProgress(); 5712 return ( 5713 t !== this.progress_ && 5714 ((this.progress_ = t), 5715 this.requestNamedAnimationFrame('Slider#update', () => { 5716 var e = this.vertical() ? 'height' : 'width'; 5717 this.bar.el().style[e] = (100 * t).toFixed(2) + '%'; 5718 })), 5719 t 5720 ); 5721 } 5722 } 5723 getProgress() { 5724 return Number(er(this.getPercent(), 0, 1).toFixed(4)); 5725 } 5726 calculateDistance(e) { 5727 e = He(this.el_, e); 5728 return this.vertical() ? e.y : e.x; 5729 } 5730 handleKeyDown(e) { 5731 var t = this.options_.playerOptions.spatialNavigation, 5732 i = t && t.enabled, 5733 t = t && t.horizontalSeek; 5734 i 5735 ? (t && 'ArrowLeft' === e.key) || (!t && 'ArrowDown' === e.key) 5736 ? (e.preventDefault(), e.stopPropagation(), this.stepBack()) 5737 : (t && 'ArrowRight' === e.key) || (!t && 'ArrowUp' === e.key) 5738 ? (e.preventDefault(), e.stopPropagation(), this.stepForward()) 5739 : super.handleKeyDown(e) 5740 : 'ArrowLeft' === e.key || 'ArrowDown' === e.key 5741 ? (e.preventDefault(), e.stopPropagation(), this.stepBack()) 5742 : 'ArrowUp' === e.key || 'ArrowRight' === e.key 5743 ? (e.preventDefault(), e.stopPropagation(), this.stepForward()) 5744 : super.handleKeyDown(e); 5745 } 5746 handleClick(e) { 5747 (e.stopPropagation(), e.preventDefault()); 5748 } 5749 vertical(e) { 5750 if (void 0 === e) return this.vertical_ || !1; 5751 ((this.vertical_ = !!e), 5752 this.vertical_ 5753 ? this.addClass('vjs-slider-vertical') 5754 : this.addClass('vjs-slider-horizontal')); 5755 } 5756 } 5757 g.registerComponent('Slider', tr); 5758 let ir = (e, t) => er((e / t) * 100, 0, 100).toFixed(2) + '%'; 5759 class sr extends g { 5760 constructor(e, t) { 5761 (super(e, t), (this.partEls_ = []), this.on(e, 'progress',
5761(e) => this.update(e))); 5762 } 5763 createEl() { 5764 var e = super.createEl('div', { className: 'vjs-load-progress' }), 5765 t = l('span', { className: 'vjs-control-text' }), 5766 i = l('span', { textContent: this.localize('Loaded') }), 5767 s = document.createTextNode(': '); 5768 return ( 5769 (this.percentageEl_ = l('span', { 5770 className: 'vjs-control-text-loaded-percentage', 5771 textContent: '0%' 5772 })), 5773 e.appendChild(t), 5774 t.appendChild(i), 5775 t.appendChild(s), 5776 t.appendChild(this.percentageEl_), 5777 e 5778 ); 5779 } 5780 dispose() { 5781 ((this.partEls_ = null), (this.percentageEl_ = null), super.dispose()); 5782 } 5783 update(e) { 5784 this.requestNamedAnimationFrame('LoadProgressBar#update', () => { 5785 var e = this.player_.liveTracker, 5786 i = this.player_.buffered(), 5787 e = e && e.isLive() ? e.seekableEnd() : this.player_.duration(), 5788 s = this.player_.bufferedEnd(), 5789 r = this.partEls_, 5790 e = ir(s, e); 5791 this.percent_ !== e && 5792 ((this.el_.style.width = e), xe(this.percentageEl_, e), (this.percent_ = e)); 5793 for (let t = 0; t < i.length; t++) { 5794 var n = i.start(t), 5795 a = i.end(t); 5796 let e = r[t]; 5797 (e || ((e = this.el_.appendChild(l())), (r[t] = e)), 5798 (e.dataset.start === n && e.dataset.end === a) || 5799 ((e.dataset.start = n), 5800 (e.dataset.end = a), 5801 (e.style.left = ir(n, s)), 5802 (e.style.width = ir(a - n, s)))); 5803 } 5804 for (let e = r.length; e > i.length; e--) this.el_.removeChild(r[e - 1]); 5805 r.length = i.length; 5806 }); 5807 } 5808 } 5809 g.registerComponent('LoadProgressBar', sr); 5810 class rr extends g { 5811 constructor(e, t) { 5812 (super(e, t), (this.update = vt(p(this, this.update), 30))); 5813 } 5814 createEl() { 5815 return super.createEl('div', { className: 'vjs-time-tooltip' }, { 'aria-hidden': 'true' }); 5816 } 5817 update(s, r, n) { 5818 var a = Ve(this.el_), 5819 o = je(this.player_.el()), 5820 r = s.width * r; 5821 if (o && a) { 5822 let e = s.left - o.left + r, 5823 t = s.width - r + (o.right - s.right), 5824 i = (t || ((t = s.width - r), (e = r)), a.width / 2); 5825 (e < i ? (i += i - e) : t < i && (i = t), 5826 i < 0 ? (i = 0) : i > a.width && (i = a.width), 5827 (i = Math.round(i)), 5828 (this.el_.style.right = `-${i}px`), 5829 this.write(n)); 5830 } 5831 } 5832 write(e) { 5833 xe(this.el_, e); 5834 } 5835 updateTime(r, n, a, o) { 5836 this.requestNamedAnimationFrame('TimeTooltip#updateTime', () => { 5837 let e; 5838 var t, 5839 i, 5840 s = this.player_.duration(); 5841 ((e = 5842 this.player_.liveTracker && this.player_.liveTracker.isLive() 5843 ? ((i = (t = this.player_.liveTracker.liveWindow()) - n * t) < 1 ? '' : '-') + Wt(i, t) 5844 : Wt(a, s)), 5845 this.update(r, n, e), 5846 o && o()); 5847 }); 5848 } 5849 } 5850 g.registerComponent('TimeTooltip', rr); 5851 class nr extends g { 5852 constructor(e, t) { 5853 (super(e, t), this.setIcon('circle'), (this.update = vt(p(this, this.update), 30))); 5854 } 5855 createEl() { 5856 return super.createEl( 5857 'div', 5858 { className: 'vjs-play-progress vjs-slider-bar' }, 5859 { 'aria-hidden': 'true' } 5860 ); 5861 } 5862 update(e, t) { 5863 var i, 5864 s = this.getChild('timeTooltip'); 5865 s && 5866 ((i = this.player_.scrubbing() 5867 ? this.player_.getCache().currentTime 5868 : this.player_.currentTime()), 5869 s.updateTime(e, t, i)); 5870 } 5871 } 5872 ((nr.prototype.options_ = { children: [] }), 5873 u || se || nr.prototype.options_.children.push('timeTooltip'), 5874 g.registerComponent('PlayProgressBar', nr)); 5875 class ar extends g { 5876 constructor(e, t) { 5877 (super(e, t), (this.update = vt(p(this, this.update), 30))); 5878 } 5879 createEl() { 5880 return super.createEl('div', { className: 'vjs-mouse-display' }); 5881 } 5882 update(e, t) { 5883 var i = t * this.player_.duration(); 5884 this.getChild('timeTooltip').updateTime(e, t, i, () => { 5885 this.el_.style.left = e.width * t + 'px'; 5886 }); 5887 } 5888 } 5889 ((ar.prototype.options_ = { children: ['timeTooltip'] }), 5890 g.registerComponent('MouseTimeDisplay', ar)); 5891 class or extends tr { 5892 constructor(e, t) { 5893 (super(e, t), this.setEventHandlers_()); 5894 } 5895 setEventHandlers_() { 5896 ((this.update_ = p(this, this.update)), 5897 (this.update = vt(this.update_, 30)), 5898 this.on(this.player_, ['durationchange', 'timeupdate'], this.update), 5899 this.on(this.player_, ['ended'], this.update_), 5900 this.player_.liveTracker && 5901 this.on(this.player_.liveTracker, 'liveedgechange', this.update), 5902 (this.updateInterval = null),
5903 (this.enableIntervalHandler_ = (e) => this.enableInterval_(e)), 5904 (this.disableIntervalHandler_ = (e) => this.disableInterval_(e)), 5905 this.on(this.player_, ['playing'], this.enableIntervalHandler_), 5906 this.on(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_), 5907 'hidden' in document && 5908 'visibilityState' in document && 5909 this.on(document, 'visibilitychange', this.toggleVisibility_)); 5910 } 5911 toggleVisibility_(e) { 5912 'hidden' === document.visibilityState 5913 ? (this.cancelNamedAnimationFrame('SeekBar#update'), 5914 this.cancelNamedAnimationFrame('Slider#update'), 5915 this.disableInterval_(e)) 5916 : (this.player_.ended() || this.player_.paused() || this.enableInterval_(), this.update()); 5917 } 5918 enableInterval_() { 5919 this.updateInterval || (this.updateInterval = this.setInterval(this.update, 30)); 5920 } 5921 disableInterval_(e) { 5922 (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && 'ended' !== e.type) || 5923 (this.updateInterval && 5924 (this.clearInterval(this.updateInterval), (this.updateInterval = null))); 5925 } 5926 createEl() { 5927 return super.createEl( 5928 'div', 5929 { className: 'vjs-progress-holder' }, 5930 { 'aria-label': this.localize('Progress Bar') } 5931 ); 5932 } 5933 update(e) { 5934 if ('hidden' !== document.visibilityState) { 5935 let s = super.update(); 5936 return ( 5937 this.requestNamedAnimationFrame('SeekBar#update', () => { 5938 var e = this.player_.ended() ? this.player_.duration() : this.getCurrentTime_(), 5939 t = this.player_.liveTracker; 5940 let i = this.player_.duration(); 5941 (t && t.isLive() && (i = this.player_.liveTracker.liveCurrentTime()), 5942 this.percent_ !== s && 5943 (this.el_.setAttribute('aria-valuenow', (100 * s).toFixed(2)), (this.percent_ = s)), 5944 (this.currentTime_ === e && this.duration_ === i) || 5945 (this.el_.setAttribute( 5946 'aria-valuetext', 5947 this.localize( 5948 'progress bar timing: currentTime={1} duration={2}', 5949 [Wt(e, i), Wt(i, i)], 5950 '{1} of {2}' 5951 ) 5952 ), 5953 (this.currentTime_ = e), 5954 (this.duration_ = i)), 5955 this.bar && this.bar.update(je(this.el()), this.getProgress())); 5956 }), 5957 s 5958 ); 5959 } 5960 } 5961 userSeek_(e) { 5962 (this.player_.liveTracker && 5963 this.player_.liveTracker.isLive() && 5964 this.player_.liveTracker.nextSeekedFromUser(), 5965 this.player_.currentTime(e)); 5966 } 5967 getCurrentTime_() { 5968 return this.player_.scrubbing() 5969 ? this.player_.getCache().currentTime 5970 : this.player_.currentTime(); 5971 } 5972 getPercent() { 5973 var e = this.getCurrentTime_(); 5974 let t; 5975 var i = this.player_.liveTracker; 5976 return ( 5977 i && i.isLive() 5978 ? ((t = (e - i.seekableStart()) / i.liveWindow()), i.atLiveEdge() && (t = 1)) 5979 : (t = e / this.player_.duration()), 5980 t 5981 ); 5982 } 5983 handleMouseDown(e) { 5984 Ke(e) && 5985 (e.stopPropagation(), 5986 (this.videoWasPlaying = !this.player_.paused()), 5987 this.player_.pause(), 5988 super.handleMouseDown(e)); 5989 } 5990 handleMouseMove(t, i = !1) { 5991 if (Ke(t) && !isNaN(this.player_.duration())) { 5992 i || this.player_.scrubbing() || this.player_.scrubbing(!0); 5993 let e; 5994 ((i = this.calculateDistance(t)), (t = this.player_.liveTracker)); 5995 if (t && t.isLive()) { 5996 if (0.99 <= i) return void t.seekToLiveEdge(); 5997 var s = t.seekableStart(), 5998 r = t.liveCurrentTime(); 5999 if ((e = (e = (e = s + i * t.liveWindow()) >= r ? r : e) <= s ? s + 0.1 : e) === 1 / 0) 6000 return; 6001 } else (e = i * this.player_.duration()) === this.player_.duration() && (e -= 0.1); 6002 (this.userSeek_(e), this.player_.options_.enableSmoothSeeking && this.update()); 6003 } 6004 } 6005 enable() { 6006 super.enable(); 6007 var e = this.getChild('mouseTimeDisplay'); 6008 e && e.show(); 6009 } 6010 disable() { 6011 super.disable(); 6012 var e = this.getChild('mouseTimeDisplay'); 6013 e && e.hide(); 6014 } 6015 handleMouseUp(e) { 6016 (super.handleMouseUp(e), 6017 e && e.stopPropagation(), 6018 this.player_.scrubbing(!1), 6019 this.player_.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 }), 6020 this.videoWasPlaying ? Kt(this.player_.play()) : this.update_()); 6021 } 6022 stepForward() { 6023 this.userSeek_(this.player_.currentTime() + 5); 6024 } 6025 stepBack() { 6026 this.userSeek_(this.player_.currentTime() - 5); 6027 } 6028 handleAction(e) { 6029 this.player_.paused() ? this.player_.play() : this.player_.pause(); 6030 } 6031 handleKeyDown(e) { 6032 var t, 6033 i = this.player_.liveTracker; 6034 ' ' === e.key || 'Enter' === e.key 6035 ? (e.preventDefault(), e.stopPropagation(), this.handleAction(e)) 6036 : 'Home' === e.key 6037 ? (e.preventDefault(), e.stopPropagation(), this.userSeek_(0)) 6038 : 'End' === e.key 6039 ? (e.preventDefault(), 6040 e.stopPropagation(),
6041 i && i.isLive() 6042 ? this.userSeek_(i.liveCurrentTime()) 6043 : this.userSeek_(this.player_.duration())) 6044 : /^[0-9]$/.test(e.key) 6045 ? (e.preventDefault(), 6046 e.stopPropagation(), 6047 (t = 0.1 * parseInt(e.key, 10)), 6048 i && i.isLive() 6049 ? this.userSeek_(i.seekableStart() + i.liveWindow() * t) 6050 : this.userSeek_(this.player_.duration() * t)) 6051 : 'PageDown' === e.key 6052 ? (e.preventDefault(), 6053 e.stopPropagation(), 6054 this.userSeek_(this.player_.currentTime() - 60)) 6055 : 'PageUp' === e.key 6056 ? (e.preventDefault(), 6057 e.stopPropagation(), 6058 this.userSeek_(this.player_.currentTime() + 60)) 6059 : super.handleKeyDown(e); 6060 } 6061 dispose() { 6062 (this.disableInterval_(), 6063 this.off(this.player_, ['durationchange', 'timeupdate'], this.update), 6064 this.off(this.player_, ['ended'], this.update_), 6065 this.player_.liveTracker && 6066 this.off(this.player_.liveTracker, 'liveedgechange', this.update), 6067 this.off(this.player_, ['playing'], this.enableIntervalHandler_), 6068 this.off(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_), 6069 'hidden' in document && 6070 'visibilityState' in document && 6071 this.off(document, 'visibilitychange', this.toggleVisibility_), 6072 super.dispose()); 6073 } 6074 } 6075 ((or.prototype.options_ = { 6076 children: ['loadProgressBar', 'playProgressBar'], 6077 barName: 'playProgressBar' 6078 }), 6079 u || se || or.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay'), 6080 g.registerComponent('SeekBar', or)); 6081 class lr extends g { 6082 constructor(e, t) { 6083 (super(e, t), 6084 (this.handleMouseMove = vt(p(this, this.handleMouseMove), 30)), 6085 (this.throttledHandleMouseSeek = vt(p(this, this.handleMouseSeek), 30)), 6086 (this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e)), 6087 (this.handleMouseDownHandler_ = (e) => this.handleMouseDown(e)), 6088 this.enable()); 6089 } 6090 createEl() { 6091 return super.createEl('div', { className: 'vjs-progress-control vjs-control' }); 6092 } 6093 handleMouseMove(e) { 6094 var t, 6095 i, 6096 s, 6097 r, 6098 n = this.getChild('seekBar'); 6099 n && 6100 ((t = n.getChild('playProgressBar')), (i = n.getChild('mouseTimeDisplay')), t || i) && 6101 ((s = Ve((r = n.el()))), (r = er((r = He(r, e).x), 0, 1)), i && i.update(s, r), t) && 6102 t.update(s, n.getProgress()); 6103 } 6104 handleMouseSeek(e) { 6105 var t = this.getChild('seekBar'); 6106 t && t.handleMouseMove(e); 6107 } 6108 enabled() { 6109 return this.enabled_; 6110 } 6111 disable() { 6112 var e;
6113 (this.children().forEach((e) => e.disable && e.disable()), 6114 this.enabled() && 6115 (this.off(['mousedown', 'touchstart'], this.handleMouseDownHandler_), 6116 this.off(this.el_, 'mousemove', this.handleMouseMove), 6117 this.removeListenersAddedOnMousedownAndTouchstart(), 6118 this.addClass('disabled'), 6119 (this.enabled_ = !1), 6120 this.player_.scrubbing()) && 6121 ((e = this.getChild('seekBar')), this.player_.scrubbing(!1), e.videoWasPlaying) && 6122 Kt(this.player_.play())); 6123 } 6124 enable() { 6125 (this.children().forEach((e) => e.enable && e.enable()), 6126 this.enabled() || 6127 (this.on(['mousedown', 'touchstart'], this.handleMouseDownHandler_), 6128 this.on(this.el_, 'mousemove', this.handleMouseMove), 6129 this.removeClass('disabled'), 6130 (this.enabled_ = !0))); 6131 } 6132 removeListenersAddedOnMousedownAndTouchstart() { 6133 var e = this.el_.ownerDocument; 6134 (this.off(e, 'mousemove', this.throttledHandleMouseSeek), 6135 this.off(e, 'touchmove', this.throttledHandleMouseSeek), 6136 this.off(e, 'mouseup', this.handleMouseUpHandler_), 6137 this.off(e, 'touchend', this.handleMouseUpHandler_)); 6138 } 6139 handleMouseDown(e) { 6140 var t = this.el_.ownerDocument, 6141 i = this.getChild('seekBar'); 6142 (i && i.handleMouseDown(e), 6143 this.on(t, 'mousemove', this.throttledHandleMouseSeek), 6144 this.on(t, 'touchmove', this.throttledHandleMouseSeek), 6145 this.on(t, 'mouseup', this.handleMouseUpHandler_), 6146 this.on(t, 'touchend', this.handleMouseUpHandler_)); 6147 } 6148 handleMouseUp(e) { 6149 var t = this.getChild('seekBar'); 6150 (t && t.handleMouseUp(e), this.removeListenersAddedOnMousedownAndTouchstart()); 6151 } 6152 } 6153 ((lr.prototype.options_ = { children: ['seekBar'] }), g.registerComponent('ProgressControl', lr)); 6154 class dr extends s { 6155 constructor(e, t) { 6156 (super(e, t), 6157 this.setIcon('picture-in-picture-enter'), 6158 this.on(e, ['enterpictureinpicture', 'leavepictureinpicture'], (e) => 6159 this.handlePictureInPictureChange(e) 6160 ), 6161 this.on(e, ['disablepictureinpicturechanged', 'loadedmetadata'], (e) => 6162 this.handlePictureInPictureEnabledChange(e) 6163 ), 6164 this.on(e, ['loadedmetadata', 'audioonlymodechange', 'audiopostermodechange'], () => 6165 this.handlePictureInPictureAudioModeChange() 6166 ), 6167 this.disable()); 6168 } 6169 buildCSSClass() { 6170 return 'vjs-picture-in-picture-control vjs-hidden ' + super.buildCSSClass(); 6171 } 6172 handlePictureInPictureAudioModeChange() { 6173 'audio' === this.player_.currentType().substring(0, 5) || 6174 this.player_.audioPosterMode() || 6175 this.player_.audioOnlyMode() 6176 ? (this.player_.isInPictureInPicture() && this.player_.exitPictureInPicture(), this.hide()) 6177 : this.show(); 6178 } 6179 handlePictureInPictureEnabledChange() { 6180 (document.pictureInPictureEnabled && !1 === this.player_.disablePictureInPicture()) || 6181 (this.player_.options_.enableDocumentPictureInPicture && 'documentPictureInPicture' in window) 6182 ? this.enable() 6183 : this.disable(); 6184 } 6185 handlePictureInPictureChange(e) { 6186 (this.player_.isInPictureInPicture() 6187 ? (this.setIcon('picture-in-picture-exit'), this.controlText('Exit Picture-in-Picture')) 6188 : (this.setIcon('picture-in-picture-enter'), this.controlText('Picture-in-Picture')), 6189 this.handlePictureInPictureEnabledChange()); 6190 } 6191 handleClick(e) { 6192 this.player_.isInPictureInPicture() 6193 ? this.player_.exitPictureInPicture() 6194 : this.player_.requestPictureInPicture(); 6195 } 6196 show() { 6197 'function' == typeof document.exitPictureInPicture && super.show(); 6198 } 6199 } 6200 ((dr.prototype.controlText_ = 'Picture-in-Picture'), 6201 g.registerComponent('PictureInPictureToggle', dr)); 6202 class hr extends s { 6203 constructor(e, t) { 6204 (super(e, t), 6205 this.setIcon('fullscreen-enter'), 6206 this.on(e, 'fullscreenchange', (e) => this.handleFullscreenChange(e)), 6207 !1 === document[e.fsApi_.fullscreenEnabled] && this.disable()); 6208 } 6209 buildCSSClass() { 6210 return 'vjs-fullscreen-control ' + super.buildCSSClass(); 6211 } 6212 handleFullscreenChange(e) { 6213 this.player_.isFullscreen() 6214 ? (this.controlText('Exit Fullscreen'), this.setIcon('fullscreen-exit')) 6215 : (this.controlText('Fullscreen'), this.setIcon('fullscreen-enter')); 6216 } 6217 handleClick(e) { 6218 this.player_.isFullscreen() 6219 ? this.player_.exitFullscreen() 6220 : this.player_.requestFullscreen(); 6221 } 6222 } 6223 ((hr.prototype.controlText_ = 'Fullscreen'), g.registerComponent('FullscreenToggle', hr)); 6224 class ur extends g { 6225 createEl() { 6226 var e = super.createEl('div', { className: 'vjs-volume-level' }); 6227 return ( 6228 this.setIcon('circle', e), 6229 e.appendChild(super.createEl('span', { className: 'vjs-control-text' })), 6230 e 6231 ); 6232 } 6233 } 6234 g.registerComponent('VolumeLevel', ur); 6235 class cr extends g { 6236 constructor(e, t) { 6237 (super(e, t), (this.update = vt(p(this, this.update), 30))); 6238 } 6239 createEl() { 6240 return super.createEl('div', { className: 'vjs-volume-tooltip' }, { 'aria-hidden': 'true' }); 6241 } 6242 update(t, i, s, e) { 6243 if (!s) { 6244 var s = je(this.el_), 6245 r = je(this.player_.el()), 6246 i = t.width * i; 6247 if (!r || !s) return; 6248 var n = t.left - r.left + i, 6249 i = t.width - i + (r.right - t.right); 6250 let e = s.width / 2; 6251 (n < e ? (e += e - n) : i < e && (e = i), 6252 e < 0 ? (e = 0) : e >
6252 s.width && (e = s.width), 6253 (this.el_.style.right = `-${e}px`)); 6254 } 6255 this.write(e + '%'); 6256 } 6257 write(e) { 6258 xe(this.el_, e); 6259 } 6260 updateVolume(e, t, i, s, r) { 6261 this.requestNamedAnimationFrame('VolumeLevelTooltip#updateVolume', () => { 6262 (this.update(e, t, i, s.toFixed(0)), r && r()); 6263 }); 6264 } 6265 } 6266 g.registerComponent('VolumeLevelTooltip', cr); 6267 class pr extends g { 6268 constructor(e, t) { 6269 (super(e, t), (this.update = vt(p(this, this.update), 30))); 6270 } 6271 createEl() { 6272 return super.createEl('div', { className: 'vjs-mouse-display' }); 6273 } 6274 update(e, t, i) { 6275 var s = 100 * t; 6276 this.getChild('volumeLevelTooltip').updateVolume(e, t, i, s, () => { 6277 i 6278 ? (this.el_.style.bottom = e.height * t + 'px') 6279 : (this.el_.style.left = e.width * t + 'px'); 6280 }); 6281 } 6282 } 6283 ((pr.prototype.options_ = { children: ['volumeLevelTooltip'] }), 6284 g.registerComponent('MouseVolumeLevelDisplay', pr)); 6285 class mr extends tr { 6286 constructor(e, t) { 6287 (super(e, t), 6288 this.on('slideractive', (e) => this.updateLastVolume_(e)), 6289 this.on(e, 'volumechange', (e) => this.updateARIAAttributes(e)), 6290 e.ready(() => this.updateARIAAttributes())); 6291 } 6292 createEl() { 6293 return super.createEl( 6294 'div', 6295 { className: 'vjs-volume-bar vjs-slider-bar' }, 6296 { 'aria-label': this.localize('Volume Level'), 'aria-live': 'polite' } 6297 ); 6298 } 6299 handleMouseDown(e) { 6300 Ke(e) && super.handleMouseDown(e); 6301 } 6302 handleMouseMove(e) { 6303 var t, 6304 i, 6305 s, 6306 r = this.getChild('mouseVolumeLevelDisplay'); 6307 (r && 6308 ((t = je((s = this.el()))), 6309 (i = this.vertical()), 6310 (s = He(s, e)), 6311 (s = er((s = i ? s.y : s.x), 0, 1)), 6312 r.update(t, s, i)), 6313 Ke(e) && (this.checkMuted(), this.player_.volume(this.calculateDistance(e)))); 6314 } 6315 checkMuted() { 6316 this.player_.muted() && this.player_.muted(!1); 6317 } 6318 getPercent() { 6319 return this.player_.muted() ? 0 : this.player_.volume(); 6320 } 6321 stepForward() { 6322 (this.checkMuted(), this.player_.volume(this.player_.volume() + 0.1)); 6323 } 6324 stepBack() { 6325 (this.checkMuted(), this.player_.volume(this.player_.volume() - 0.1)); 6326 } 6327 updateARIAAttributes(e) { 6328 var t = this.player_.muted() ? 0 : this.volumeAsPercentage_(); 6329 (this.el_.setAttribute('aria-valuenow', t), this.el_.setAttribute('aria-valuetext', t + '%')); 6330 } 6331 volumeAsPercentage_() { 6332 return Math.round(100 * this.player_.volume()); 6333 } 6334 updateLastVolume_() { 6335 let e = this.player_.volume(); 6336 this.one('sliderinactive', () => { 6337 0 === this.player_.volume() && this.player_.lastVolume_(e); 6338 }); 6339 } 6340 } 6341 ((mr.prototype.options_ = { children: ['volumeLevel'], barName: 'volumeLevel' }), 6342 u || se || mr.prototype.options_.children.splice(0, 0, 'mouseVolumeLevelDisplay'), 6343 (mr.prototype.playerEvent = 'volumechange'), 6344 g.registerComponent('VolumeBar', mr)); 6345 class gr extends g { 6346 constructor(e, t = {}) { 6347 var i, s; 6348 ((t.vertical = t.vertical || !1), 6349 ('undefined' != typeof t.volumeBar && !Q(t.volumeBar)) || 6350 ((t.volumeBar = t.volumeBar || {}), (t.volumeBar.vertical = t.vertical)), 6351 super(e, t), 6352 (i = this), 6353 (s = e).tech_ && !s.tech_.featuresVolumeControl && i.addClass('vjs-hidden'), 6354 i.on(s, 'loadstart', function () { 6355 s.tech_.featuresVolumeControl ? i.removeClass('vjs-hidden') : i.addClass('vjs-hidden'); 6356 }), 6357 (this.throttledHandleMouseMove = vt(p(this, this.handleMouseMove), 30)), 6358 (this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e)), 6359 this.on('mousedown', (e) => this.handleMouseDown(e)), 6360 this.on('touchstart', (e) => this.handleMouseDown(e)), 6361 this.on('mousemove', (e) => this.handleMouseMove(e)), 6362 this.on(this.volumeBar, ['focus', 'slideractive'], () => { 6363 (this.volumeBar.addClass('vjs-slider-active'), 6364 this.addClass('vjs-slider-active'), 6365 this.trigger('slideractive')); 6366 }),
6367 this.on(this.volumeBar, ['blur', 'sliderinactive'], () => { 6368 (this.volumeBar.removeClass('vjs-slider-active'), 6369 this.removeClass('vjs-slider-active'), 6370 this.trigger('sliderinactive')); 6371 })); 6372 } 6373 createEl() { 6374 let e = 'vjs-volume-horizontal'; 6375 return ( 6376 this.options_.vertical && (e = 'vjs-volume-vertical'), 6377 super.createEl('div', { className: 'vjs-volume-control vjs-control ' + e }) 6378 ); 6379 } 6380 handleMouseDown(e) { 6381 var t = this.el_.ownerDocument; 6382 (this.on(t, 'mousemove', this.throttledHandleMouseMove), 6383 this.on(t, 'touchmove', this.throttledHandleMouseMove), 6384 this.on(t, 'mouseup', this.handleMouseUpHandler_), 6385 this.on(t, 'touchend', this.handleMouseUpHandler_)); 6386 } 6387 handleMouseUp(e) { 6388 var t = this.el_.ownerDocument; 6389 (this.off(t, 'mousemove', this.throttledHandleMouseMove), 6390 this.off(t, 'touchmove', this.throttledHandleMouseMove), 6391 this.off(t, 'mouseup', this.handleMouseUpHandler_), 6392 this.off(t, 'touchend', this.handleMouseUpHandler_)); 6393 } 6394 handleMouseMove(e) { 6395 this.volumeBar.handleMouseMove(e); 6396 } 6397 } 6398 ((gr.prototype.options_ = { children: ['volumeBar'] }), g.registerComponent('VolumeControl', gr)); 6399 class fr extends s { 6400 constructor(e, t) { 6401 var i, s; 6402 (super(e, t), 6403 (i = this), 6404 (s = e).tech_ && !s.tech_.featuresMuteControl && i.addClass('vjs-hidden'), 6405 i.on(s, 'loadstart', function () { 6406 s.tech_.featuresMuteControl ? i.removeClass('vjs-hidden') : i.addClass('vjs-hidden'); 6407 }), 6408 this.on(e, ['loadstart', 'volumechange'], (e) => this.update(e))); 6409 } 6410 buildCSSClass() { 6411 return 'vjs-mute-control ' + super.buildCSSClass(); 6412 } 6413 handleClick(e) { 6414 var t = this.player_.volume(), 6415 i = this.player_.lastVolume_(); 6416 0 === t 6417 ? (this.player_.volume(i < 0.1 ? 0.1 : i), this.player_.muted(!1)) 6418 : this.player_.muted(!this.player_.muted()); 6419 } 6420 update(e) { 6421 (this.updateIcon_(), this.updateControlText_()); 6422 } 6423 updateIcon_() { 6424 var e = this.player_.volume(); 6425 let t = 3; 6426 (this.setIcon('volume-high'), 6427 u && 6428 this.player_.tech_ && 6429 this.player_.tech_.el_ && 6430 this.player_.muted(this.player_.tech_.el_.muted), 6431 0 === e || this.player_.muted() 6432 ? (this.setIcon('volume-mute'), (t = 0)) 6433 : e < 0.33 6434 ? (this.setIcon('volume-low'), (t = 1)) 6435 : e < 0.67 && (this.setIcon('volume-medium'), (t = 2)), 6436 Le( 6437 this.el_, 6438 [0, 1, 2, 3].reduce((e, t) => e + `${t ? ' ' : ''}vjs-vol-` + t, '') 6439 ), 6440 Pe(this.el_, 'vjs-vol-' + t)); 6441 } 6442 updateControlText_() { 6443 var e = this.player_.muted() || 0 === this.player_.volume() ? 'Unmute' : 'Mute'; 6444 this.controlText() !== e && this.controlText(e); 6445 } 6446 } 6447 ((fr.prototype.controlText_ = 'Mute'), g.registerComponent('MuteToggle', fr)); 6448 class yr extends g { 6449 constructor(e, t = {}) { 6450 ('undefined' != typeof t.inline ? (t.inline = t.inline) : (t.inline = !0), 6451 ('undefined' != typeof t.volumeControl && !Q(t.volumeControl)) || 6452 ((t.volumeControl = t.volumeControl || {}), (t.volumeControl.vertical = !t.inline)), 6453 super(e, t), 6454 (this.handleKeyPressHandler_ = (e) => this.handleKeyPress(e)), 6455 this.on(e, ['loadstart'], (e) => this.volumePanelState_(e)), 6456 this.on(this.muteToggle, 'keyup', (e) => this.handleKeyPress(e)), 6457 this.on(this.volumeControl, 'keyup', (e) => this.handleVolumeControlKeyUp(e)), 6458 this.on('keydown', (e) => this.handleKeyPress(e)), 6459 this.on('mouseover', (e) => this.handleMouseOver(e)), 6460 this.on('mouseout', (e) => this.handleMouseOut(e)), 6461 this.on(this.volumeControl, ['slideractive'], this.sliderActive_), 6462 this.on(this.volumeControl, ['sliderinactive'], this.sliderInactive_)); 6463 } 6464 sliderActive_() { 6465 this.addClass('vjs-slider-active'); 6466 } 6467 sliderInactive_() { 6468 this.removeClass('vjs-slider-active'); 6469 } 6470 volumePanelState_() { 6471 (this.volumeControl.hasClass('vjs-hidden') && 6472 this.muteToggle.hasClass('vjs-hidden') && 6473 this.addClass('vjs-hidden'), 6474 this.volumeControl.hasClass('vjs-hidden') && 6475 !this.muteToggle.hasClass('vjs-hidden') && 6476 this.addClass('vjs-mute-toggle-only')); 6477 } 6478 createEl() { 6479 let e = 'vjs-volume-panel-horizontal'; 6480 return ( 6481 this.options_.inline || (e = 'vjs-volume-panel-vertical'), 6482 super.createEl('div', { className: 'vjs-volume-panel vjs-control ' + e }) 6483 ); 6484 } 6485 dispose() { 6486 (this.handleMouseOut(), super.dispose()); 6487 } 6488 handleVolumeControlKeyUp(e) { 6489 'Escape' === e.key && this.muteToggle.focus(); 6490 } 6491 handleMouseOver(e) { 6492 (this.addClass('vjs-hover'), mt(document, 'keyup', this.handleKeyPressHandler_)); 6493 } 6494 handleMouseOut(e) { 6495 (this.removeClass('vjs-hover'), c(document, 'keyup', this.handleKeyPressHandler_)); 6496 } 6497 handleKeyPress(e) { 6498 'Escape' === e.key && this.handleMouseOut(); 6499 } 6500 } 6501 ((yr.prototype.options_ = { children: ['muteToggle', 'volumeControl'] }), 6502 g.registerComponent('VolumePanel', yr)); 6503 class _r extends s { 6504 constructor(e, t) { 6505 (super(e, t), 6506 (this.validOptions = [5, 10, 30]),
6507 (this.skipTime = this.getSkipForwardTime()), 6508 this.skipTime && this.validOptions.includes(this.skipTime) 6509 ? (this.setIcon('forward-' + this.skipTime), 6510 this.controlText( 6511 this.localize('Skip forward {1} seconds', [ 6512 this.skipTime.toLocaleString(e.language()) 6513 ]) 6514 ), 6515 this.show()) 6516 : this.hide()); 6517 } 6518 getSkipForwardTime() { 6519 var e = this.options_.playerOptions; 6520 return e.controlBar && e.controlBar.skipButtons && e.controlBar.skipButtons.forward; 6521 } 6522 buildCSSClass() { 6523 return `vjs-skip-forward-${this.getSkipForwardTime()} ` + super.buildCSSClass(); 6524 } 6525 handleClick(e) { 6526 if (!isNaN(this.player_.duration())) { 6527 var t = this.player_.currentTime(), 6528 i = this.player_.liveTracker, 6529 i = i && i.isLive() ? i.seekableEnd() : this.player_.duration(); 6530 let e; 6531 ((e = t + this.skipTime <= i ? t + this.skipTime : i), this.player_.currentTime(e)); 6532 } 6533 } 6534 handleLanguagechange() { 6535 this.controlText(this.localize('Skip forward {1} seconds', [this.skipTime])); 6536 } 6537 } 6538 ((_r.prototype.controlText_ = 'Skip Forward'), g.registerComponent('SkipForward', _r)); 6539 class vr extends s { 6540 constructor(e, t) { 6541 (super(e, t), 6542 (this.validOptions = [5, 10, 30]), 6543 (this.skipTime = this.getSkipBackwardTime()), 6544 this.skipTime && this.validOptions.includes(this.skipTime) 6545 ? (this.setIcon('replay-' + this.skipTime), 6546 this.controlText( 6547 this.localize('Skip backward {1} seconds', [ 6548 this.skipTime.toLocaleString(e.language()) 6549 ]) 6550 ), 6551 this.show()) 6552 : this.hide()); 6553 } 6554 getSkipBackwardTime() { 6555 var e = this.options_.playerOptions; 6556 return e.controlBar && e.controlBar.skipButtons && e.controlBar.skipButtons.backward; 6557 } 6558 buildCSSClass() { 6559 return `vjs-skip-backward-${this.getSkipBackwardTime()} ` + super.buildCSSClass(); 6560 } 6561 handleClick(e) { 6562 var t = this.player_.currentTime(), 6563 i = this.player_.liveTracker, 6564 i = i && i.isLive() && i.seekableStart(); 6565 let s; 6566 ((s = i && t - this.skipTime <= i ? i : t >= this.skipTime ? t - this.skipTime : 0), 6567 this.player_.currentTime(s)); 6568 } 6569 handleLanguagechange() { 6570 this.controlText(this.localize('Skip backward {1} seconds', [this.skipTime])); 6571 } 6572 } 6573 ((vr.prototype.controlText_ = 'Skip Backward'), g.registerComponent('SkipBackward', vr)); 6574 class br extends g { 6575 constructor(e, t) { 6576 (super(e, t), 6577 t && (this.menuButton_ = t.menuButton), 6578 (this.focusedChild_ = -1), 6579 this.on('keydown', (e) => this.handleKeyDown(e)), 6580 (this.boundHandleBlur_ = (e) => this.handleBlur(e)), 6581 (this.boundHandleTapClick_ = (e) => this.handleTapClick(e))); 6582 } 6583 addEventListenerForItem(e) { 6584 e instanceof g && 6585 (this.on(e, 'blur', this.boundHandleBlur_), 6586 this.on(e, ['tap', 'click'], this.boundHandleTapClick_)); 6587 } 6588 removeEventListenerForItem(e) { 6589 e instanceof g && 6590 (this.off(e, 'blur', this.boundHandleBlur_), 6591 this.off(e, ['tap', 'click'], this.boundHandleTapClick_)); 6592 } 6593 removeChild(e) { 6594 ('string' == typeof e && (e = this.getChild(e)), 6595 this.removeEventListenerForItem(e), 6596 super.removeChild(e)); 6597 } 6598 addItem(e) { 6599 e = this.addChild(e); 6600 e && this.addEventListenerForItem(e); 6601 } 6602 createEl() { 6603 var e = this.options_.contentElType || 'ul', 6604 e = 6605 ((this.contentEl_ = l(e, { className: 'vjs-menu-content' })), 6606 this.contentEl_.setAttribute('role', 'menu'), 6607 super.createEl('div', { append: this.contentEl_, className: 'vjs-menu' })); 6608 return ( 6609 e.appendChild(this.contentEl_), 6610 mt(e, 'click', function (e) { 6611 (e.preventDefault(), e.stopImmediatePropagation()); 6612 }), 6613 e 6614 ); 6615 } 6616 dispose() { 6617 ((this.contentEl_ = null), 6618 (this.boundHandleBlur_ = null),
6619 (this.boundHandleTapClick_ = null), 6620 super.dispose()); 6621 } 6622 handleBlur(e) { 6623 let t = e.relatedTarget || document.activeElement; 6624 this.children().some((e) => e.el() === t) || 6625 ((e = this.menuButton_) && 6626 e.buttonPressed_ && 6627 t !== e.el().firstChild && 6628 e.unpressButton()); 6629 } 6630 handleTapClick(t) { 6631 var e; 6632 this.menuButton_ && 6633 (this.menuButton_.unpressButton(), (e = this.children()), Array.isArray(e)) && 6634 (e = e.filter((e) => e.el() === t.target)[0]) && 6635 'CaptionSettingsMenuItem' !== e.name() && 6636 this.menuButton_.focus(); 6637 } 6638 handleKeyDown(e) { 6639 'ArrowLeft' === e.key || 'ArrowDown' === e.key 6640 ? (e.preventDefault(), e.stopPropagation(), this.stepForward()) 6641 : ('ArrowRight' !== e.key && 'ArrowUp' !== e.key) || 6642 (e.preventDefault(), e.stopPropagation(), this.stepBack()); 6643 } 6644 stepForward() { 6645 let e = 0; 6646 (void 0 !== this.focusedChild_ && (e = this.focusedChild_ + 1), this.focus(e)); 6647 } 6648 stepBack() { 6649 let e = 0; 6650 (void 0 !== this.focusedChild_ && (e = this.focusedChild_ - 1), this.focus(e)); 6651 } 6652 focus(e = 0) { 6653 var t = this.children().slice(); 6654 (t.length && t[0].hasClass('vjs-menu-title') && t.shift(), 6655 0 < t.length && 6656 (e < 0 ? (e = 0) : t.length <= e && (e = t.length - 1), 6657 t[(this.focusedChild_ = e)].el_.focus())); 6658 } 6659 } 6660 g.registerComponent('Menu', br); 6661 class Tr extends g { 6662 constructor(e, t = {}) { 6663 (super(e, t), 6664 (this.menuButton_ = new s(e, t)), 6665 this.menuButton_.controlText(this.controlText_), 6666 this.menuButton_.el_.setAttribute('aria-haspopup', 'true')); 6667 ((e = s.prototype.buildCSSClass()), 6668 (this.menuButton_.el_.className = this.buildCSSClass() + ' ' + e), 6669 this.menuButton_.removeClass('vjs-control'), 6670 this.addChild(this.menuButton_), 6671 this.update(), 6672 (this.enabled_ = !0), 6673 (t = (e) => this.handleClick(e))); 6674 ((this.handleMenuKeyUp_ = (e) => this.handleMenuKeyUp(e)), 6675 this.on(this.menuButton_, 'tap', t), 6676 this.on(this.menuButton_, 'click', t), 6677 this.on(this.menuButton_, 'keydown', (e) => this.handleKeyDown(e)), 6678 this.on(this.menuButton_, 'mouseenter', () => { 6679 (this.addClass('vjs-hover'), 6680 this.menu.show(), 6681 mt(document, 'keyup', this.handleMenuKeyUp_)); 6682 }), 6683 this.on('mouseleave', (e) => this.handleMouseLeave(e)), 6684 this.on('keydown', (e) => this.handleSubmenuKeyDown(e))); 6685 } 6686 update() { 6687 var e = this.createMenu(); 6688 (this.menu && (this.menu.dispose(), this.removeChild(this.menu)), 6689 (this.menu = e), 6690 this.addChild(e), 6691 (this.buttonPressed_ = !1), 6692 this.menuButton_.el_.setAttribute('aria-expanded', 'false'), 6693 this.items && this.items.length <= this.hideThreshold_ 6694 ? (this.hide(), this.menu.contentEl_.removeAttribute('role')) 6695 : (this.show(), this.menu.contentEl_.setAttribute('role', 'menu'))); 6696 } 6697 createMenu() { 6698 var e, 6699 t = new br(this.player_, { menuButton: this }); 6700 if ( 6701 ((this.hideThreshold_ = 0), 6702 this.options_.title && 6703 ((e = l('li', { 6704 className: 'vjs-menu-title', 6705 textContent: m(this.options_.title), 6706 tabIndex: -1 6707 })), 6708 (e = new g(this.player_, { el: e })), 6709 t.addItem(e)), 6710 (this.items = this.createItems()), 6711 this.items) 6712 ) 6713 for (let e = 0; e < this.items.length; e++) t.addItem(this.items[e]); 6714 return t; 6715 } 6716 createItems() {} 6717 createEl() { 6718 return super.createEl('div', { className: this.buildWrapperCSSClass() }, {}); 6719 } 6720 setIcon(e) { 6721 super.setIcon(e, this.menuButton_.el_); 6722 } 6723 buildWrapperCSSClass() { 6724 let e = 'vjs-menu-button'; 6725 !0 === this.options_.inline ? (e += '-inline') : (e += '-popup'); 6726 var t = s.prototype.buildCSSClass(); 6727 return `vjs-menu-button ${e} ${t} ` + super.buildCSSClass(); 6728 } 6729 buildCSSClass() { 6730 let e = 'vjs-menu-button'; 6731 return ( 6732 !0 === this.options_.inline ? (e += '-inline') : (e += '-popup'), 6733 `vjs-menu-button ${e} ` + super.buildCSSClass() 6734 ); 6735 } 6736 controlText(e, t = this.menuButton_.el()) { 6737 return this.menuButton_.controlText(e, t); 6738 } 6739 dispose() { 6740 (this.handleMouseLeave(), super.dispose()); 6741 } 6742 handleClick(e) { 6743 this.buttonPressed_ ? this.unpressButton() : this.pressButton(); 6744 } 6745 handleMouseLeave(e) { 6746 (this.removeClass('vjs-hover'), c(document, 'keyup', this.handleMenuKeyUp_)); 6747 } 6748 focus() { 6749 this.menuButton_.focus(); 6750 } 6751 blur() { 6752 this.menuButton_.blur(); 6753 } 6754 handleKeyDown(e) { 6755 'Escape' === e.key || 'Tab' === e.key 6756 ? (this.buttonPressed_ && this.unpressButton(), 6757 'Tab' === !e.key && (e.preventDefault(), this.menuButton_.focus())) 6758 : ('Up' !== e.key && 6759 ('Down' !== e.key || 6760 (this.player_.options_.playerOptions.spatialNavigation && 6761 this.player_.options_.playerOptions.spatialNavigation.enabled))) || 6762 this.buttonPressed_ || 6763 (e.preventDefault(), this.pressButton()); 6764 } 6765 handleMenuKeyUp(e) { 6766 ('Escape' !== e.key && 'Tab' !== e.key) || this.removeClass('vjs-hover'); 6767 } 6768 handleSubmenuKeyPress(e) { 6769 this.handleSubmenuKeyDown(e); 6770 } 6771 handleSubmenuKeyDown(e) { 6772 ('Escape' !== e.key && 'Tab' !== e.key) || 6773 (this.buttonPressed_ && this.unpressButton(), 6774 'Tab' === !e.key && (e.preventDefault(), this.menuButton_.focus())); 6775 } 6776 pressButton() { 6777 this.enabled_ && 6778 ((this.buttonPressed_ = !0), 6779 this.menu.show(), 6780 this.menu.lockShowing(), 6781 this.menuButton_.el_.setAttribute('aria-expanded', 'true'), 6782 (u && ke()) || this.menu.focus()); 6783 } 6784 unpressButton() { 6785 this.enabled_ && 6786 ((this.buttonPressed_ = !1), 6787 this.menu.unlockShowing(), 6788 this.menu.hide(), 6789 this.menuButton_.el_.setAttribute('aria-expanded', 'false')); 6790 } 6791 disable() { 6792 (this.unpressButton(), 6793 (this.enabled_ = !1), 6794 this.addClass('vjs-disabled'), 6795 this.menuButton_.disable()); 6796 } 6797 enable() { 6798 ((this.enabled_ = !0), this.removeClass('vjs-disabled'), this.menuButton_.enable()); 6799 } 6800 } 6801 g.registerComponent('MenuButton', Tr); 6802 class Sr extends Tr { 6803 constructor(e, t) { 6804 let i = t.tracks; 6805 if ((super(e, t), this.items.length <= 1 && this.hide(), i)) { 6806 let e = p(this, this.update); 6807 (i.addEventListener('removetrack', e), 6808 i.addEventListener('addtrack', e), 6809 i.addEventListener('labelchange', e), 6810 this.player_.on('ready', e), 6811 this.player_.on('dispose', function () { 6812 (i.removeEventListener('removetrack', e), 6813 i.removeEventListener('addtrack', e), 6814 i.removeEventListener('labelchange', e)); 6815 })); 6816 } 6817 } 6818 } 6819 g.registerComponent('TrackButton', Sr); 6820 class wr extends Ms { 6821 constructor(e, t) { 6822 (super(e, t), 6823 (this.selectable = t.selectable), 6824 (this.isSelected_ = t.selected || !1), 6825 (this.multiSelectable = t.multiSelectable), 6826 this.selected(this.isSelected_), 6827 this.selectable 6828 ? this.multiSelectable 6829 ? this.el_.setAttribute('role', 'menuitemcheckbox') 6830 : this.el_.setAttribute('role', 'menuitemradio') 6831 : this.el_.setAttribute('role', 'menuitem')); 6832 } 6833 createEl(e, t, i) { 6834 this.nonIconControl = !0; 6835 ((t = super.createEl( 6836 'li', 6837 Object.assign({ className: 'vjs-menu-item', tabIndex: -1 }, t), 6838 i 6839 )), 6840 (i = l('span', { 6841 className: 'vjs-menu-item-text', 6842 textContent: this.localize(this.options_.label) 6843 }))); 6844 return ( 6845 this.player_.options_.experimentalSvgIcons 6846 ? t.appendChild(i) 6847 : t.replaceChild(i, t.querySelector('.vjs-icon-placeholder')), 6848 t 6849 ); 6850 } 6851 handleKeyDown(e) { 6852 ['Tab', 'Escape', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'ArrowDown'].includes(e.ke
6852y) || 6853 super.handleKeyDown(e); 6854 } 6855 handleClick(e) { 6856 this.selected(!0); 6857 } 6858 selected(e) { 6859 this.selectable && 6860 (e 6861 ? (this.addClass('vjs-selected'), 6862 this.el_.setAttribute('aria-checked', 'true'), 6863 this.controlText(', selected'), 6864 (this.isSelected_ = !0)) 6865 : (this.removeClass('vjs-selected'), 6866 this.el_.setAttribute('aria-checked', 'false'), 6867 this.controlText(''), 6868 (this.isSelected_ = !1))); 6869 } 6870 } 6871 g.registerComponent('MenuItem', wr); 6872 class Er extends wr { 6873 constructor(e, t) { 6874 var i = t.track; 6875 let s = e.textTracks(), 6876 r = 6877 ((t.label = i.label || i.language || 'Unknown'), 6878 (t.selected = 'showing' === i.mode), 6879 super(e, t), 6880 (this.track = i), 6881 (this.kinds = (t.kinds || [t.kind || this.track.kind]).filter(Boolean)), 6882 (...e) => { 6883 this.handleTracksChange.apply(this, e); 6884 }), 6885 n = (...e) => { 6886 this.handleSelectedLanguageChange.apply(this, e); 6887 }; 6888 if ( 6889 (e.on(['loadstart', 'texttrackchange'], r), 6890 s.addEventListener('change', r), 6891 s.addEventListener('selectedlanguagechange', n), 6892 this.on('dispose', function () { 6893 (e.off(['loadstart', 'texttrackchange'], r), 6894 s.removeEventListener('change', r), 6895 s.removeEventListener('selectedlanguagechange', n)); 6896 }), 6897 void 0 === s.onchange) 6898 ) { 6899 let e; 6900 this.on(['tap', 'click'], function () { 6901 if ('object' != typeof window.Event) 6902 try { 6903 e = new window.Event('change'); 6904 } catch (e) {} 6905 (e || (e = document.createEvent('Event')).initEvent('change', !0, !0), 6906 s.dispatchEvent(e)); 6907 }); 6908 } 6909 this.handleTracksChange(); 6910 } 6911 handleClick(e) { 6912 var t = this.track, 6913 i = this.player_.textTracks(); 6914 if ((super.handleClick(e), i)) 6915 for (let e = 0; e < i.length; e++) { 6916 var s = i[e]; 6917 -1 !== this.kinds.indexOf(s.kind) && 6918 (s === t 6919 ? 'showing' !== s.mode && (s.mode = 'showing') 6920 : 'disabled' !== s.mode && (s.mode = 'disabled')); 6921 } 6922 } 6923 handleTracksChange(e) { 6924 var t = 'showing' === this.track.mode; 6925 t !== this.isSelected_ && this.selected(t); 6926 } 6927 handleSelectedLanguageChange(e) { 6928 var t; 6929 'showing' !== this.track.mode || 6930 ((t = this.player_.cache_.selectedLanguage) && 6931 t.enabled && 6932 t.language === this.track.language && 6933 t.kind !== this.track.kind) || 6934 (this.player_.cache_.selectedLanguage = { 6935 enabled: !0, 6936 language: this.track.language, 6937 kind: this.track.kind 6938 }); 6939 } 6940 dispose() { 6941 ((this.track = null), super.dispose()); 6942 } 6943 } 6944 g.registerComponent('TextTrackMenuItem', Er); 6945 class Cr extends Er { 6946 constructor(e, t) { 6947 ((t.track = { player: e, kind: t.kind, kinds: t.kinds, default: !1, mode: 'disabled' }), 6948 t.kinds || (t.kinds = [t.kind]), 6949 (t.track.label = t.label || t.kinds.join(' and ') + ' off'), 6950 (t.selectable = !0), 6951 (t.multiSelectable = !1), 6952 super(e, t)); 6953 } 6954 handleTracksChange(e) { 6955 var i = this.player().textTracks(); 6956 let s = !0; 6957 for (let e = 0, t = i.length; e < t; e++) { 6958 var r = i[e]; 6959 if (-1 < this.options_.kinds.indexOf(r.kind) && 'showing' === r.mode) { 6960 s = !1; 6961 break; 6962 } 6963 } 6964 s !== this.isSelected_ && this.selected(s); 6965 } 6966 handleSelectedLanguageChange(e) { 6967 var i = this.player().textTracks(); 6968 let s = !0; 6969 for (let e = 0, t = i.length; e < t; e++) { 6970 var r = i[e]; 6971 if ( 6972 -1 < ['captions', 'descriptions', 'subtitles'].indexOf(r.kind) && 6973 'showing' === r.mode 6974 ) { 6975 s = !1; 6976 break; 6977 } 6978 } 6979 s && (this.player_.cache_.selectedLanguage = { enabled: !1 }); 6980 } 6981 handleLanguagechange() { 6982 ((this.$('.vjs-menu-item-text').textContent = this.player_.localize(this.options_.label)), 6983 super.handleLanguagechange()); 6984 } 6985 } 6986 g.registerComponent('OffTextTrackMenuItem', Cr); 6987 class kr extends Sr { 6988 constructor(e, t = {}) { 6989 ((t.tracks = e.textTracks()), super(e, t)); 6990 } 6991 createItems(t = [], i = Er) { 6992 let e; 6993 (this.label_ && (e = this.label_ + ' off'), 6994 t.push(new Cr(this.player_, { kinds: this.kinds_, kind: this.kind_, label: e })), 6995 (this.hideThreshold_ += 1)); 6996 var s = this.player_.textTracks(); 6997 Array.isArray(this.kinds_) || (this.kinds_ = [this.kind_]); 6998 for (let e = 0; e < s.length; e++) { 6999 var r, 7000 n = s[e]; 7001 -1 < this.kinds_.indexOf(n.kind) && 7002 ((r = new i(this.player_, { 7003 track: n, 7004 kinds: this.kinds_, 7005 kind: this.kind_, 7006 selectable: !0, 7007 multiSelectable: !1 7008 })).addClass(`vjs-${n.kind}-menu-item`), 7009 t.push(r)); 7010 } 7011 return t; 7012 } 7013 } 7014 g.registerComponent('TextTrackButton', kr); 7015 class Ir extends wr { 7016 constructor(e, t) { 7017 var i = t.track, 7018 s = t.cue, 7019 r = e.currentTime(); 7020 ((t.selectable = !0), 7021 (t.multiSelectable = !1), 7022 (t.label = s.text), 7023 (t.selected = s.startTime <= r && r < s.endTime), 7024 super(e, t), 7025 (this.track = i), 7026 (this.cue = s)); 7027 } 7028 handleClick(e) { 7029 (super.handleClick(), this.player_.currentTime(this.cue.startTime)); 7030 } 7031 } 7032 g.registerComponent('ChaptersTrackMenuItem', Ir); 7033 class xr extends kr { 7034 constructor(e, t, i) { 7035 (super(e, t, i), 7036 this.setIcon('chapters'), 7037 (this.selectCurrentItem_ = () => {
7038 this.items.forEach((e) => { 7039 e.selected(this.track_.activeCues[0] === e.cue); 7040 }); 7041 })); 7042 } 7043 buildCSSClass() { 7044 return 'vjs-chapters-button ' + super.buildCSSClass(); 7045 } 7046 buildWrapperCSSClass() { 7047 return 'vjs-chapters-button ' + super.buildWrapperCSSClass(); 7048 } 7049 update(e) { 7050 (e && e.track && 'chapters' !== e.track.kind) || 7051 ((e = this.findChaptersTrack()) !== this.track_ 7052 ? (this.setTrack(e), super.update()) 7053 : (!this.items || (e && e.cues && e.cues.length !== this.items.length)) && 7054 super.update()); 7055 } 7056 setTrack(e) { 7057 var t; 7058 this.track_ !== e && 7059 (this.updateHandler_ || (this.updateHandler_ = this.update.bind(this)), 7060 this.track_ && 7061 ((t = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_)) && 7062 t.removeEventListener('load', this.updateHandler_), 7063 this.track_.removeEventListener('cuechange', this.selectCurrentItem_), 7064 (this.track_ = null)), 7065 (this.track_ = e), 7066 this.track_) && 7067 ((this.track_.mode = 'hidden'), 7068 (t = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_)) && 7069 t.addEventListener('load', this.updateHandler_), 7070 this.track_.addEventListener('cuechange', this.selectCurrentItem_)); 7071 } 7072 findChaptersTrack() { 7073 var t = this.player_.textTracks() || []; 7074 for (let e = t.length - 1; 0 <= e; e--) { 7075 var i = t[e]; 7076 if (i.kind === this.kind_) return i; 7077 } 7078 } 7079 getMenuCaption() { 7080 return this.track_ && this.track_.label ? this.track_.label : this.localize(m(this.kind_)); 7081 } 7082 createMenu() { 7083 return ((this.options_.title = this.getMenuCaption()), super.createMenu()); 7084 } 7085 createItems() { 7086 var i = []; 7087 if (this.track_) { 7088 var s = this.track_.cues; 7089 if (s) 7090 for (let e = 0, t = s.length; e < t; e++) { 7091 var r = s[e], 7092 r = new Ir(this.player_, { track: this.track_, cue: r }); 7093 i.push(r); 7094 } 7095 } 7096 return i; 7097 } 7098 } 7099 ((xr.prototype.kind_ = 'chapters'), 7100 (xr.prototype.controlText_ = 'Chapters'), 7101 g.registerComponent('ChaptersButton', xr)); 7102 class Ar extends kr { 7103 constructor(e, t, i) { 7104 (super(e, t, i), this.setIcon('audio-description')); 7105 let s = e.textTracks(), 7106 r = p(this, this.handleTracksChange); 7107 (s.addEventListener('change', r), 7108 this.on('dispose', function () { 7109 s.removeEventListener('change', r); 7110 })); 7111 } 7112 handleTracksChange(e) { 7113 var i = this.player().textTracks(); 7114 let s = !1; 7115 for (let e = 0, t = i.length; e < t; e++) { 7116 var r = i[e]; 7117 if (r.kind !== this.kind_ && 'showing' === r.mode) { 7118 s = !0; 7119 break; 7120 } 7121 } 7122 s ? this.disable() : this.enable(); 7123 } 7124 buildCSSClass() { 7125 return 'vjs-descriptions-button ' + super.buildCSSClass(); 7126 } 7127 buildWrapperCSSClass() { 7128 return 'vjs-descriptions-button ' + super.buildWrapperCSSClass(); 7129 } 7130 } 7131 ((Ar.prototype.kind_ = 'descriptions'), 7132 (Ar.prototype.controlText_ = 'Descriptions'), 7133 g.registerComponent('DescriptionsButton', Ar)); 7134 class Dr extends kr { 7135 constructor(e, t, i) { 7136 (super(e, t, i), this.setIcon('subtitles')); 7137 } 7138 buildCSSClass() { 7139 return 'vjs-subtitles-button ' + super.buildCSSClass(); 7140 } 7141 buildWrapperCSSClass() { 7142 return 'vjs-subtitles-button ' + super.buildWrapperCSSClass(); 7143 } 7144 } 7145 ((Dr.prototype.kind_ = 'subtitles'), 7146 (Dr.prototype.controlText_ = 'Subtitles'), 7147 g.registerComponent('SubtitlesButton', Dr)); 7148 class Pr extends Er { 7149 constructor(e, t) { 7150 ((t.track = { 7151 player: e, 7152 kind: t.kind, 7153 label: t.kind + ' settings', 7154 selectable: !1, 7155 default: !1, 7156 mode: 'disabled' 7157 }), 7158 (t.selectable = !1), 7159 (t.name = 'CaptionSettingsMenuItem'), 7160 super(e, t), 7161 this.addClass('vjs-texttrack-settings'), 7162 this.controlText(', opens ' + t.kind + ' settings dialog')); 7163 } 7164 handleClick(e) { 7165 this.player().getChild('textTrackSettings').open(); 7166 } 7167 handleLanguagechange() { 7168 ((this.$('.vjs-menu-item-text').textContent = this.player_.localize( 7169 this.options_.kind + ' settings' 7170 )), 7171 super.handleLanguagechange()); 7172 } 7173 } 7174 g.registerComponent('CaptionSettingsMenuItem', Pr); 7175 class Lr extends kr { 7176 constructor(e, t, i) { 7177 (super(e, t, i), this.setIcon('captions')); 7178 } 7179 buildCSSClass() { 7180 return 'vjs-captions-button ' + super.buildCSSClass(); 7181 } 7182 buildWrapperCSSClass() { 7183 return 'vjs-captions-button ' + super.buildWrapperCSSClass(); 7184 } 7185 createItems() { 7186 var e = []; 7187 return ( 7188 (this.player().tech_ && this.player().tech_.featuresNativeTextTracks) || 7189 !this.player().getChild('textTrackSettings') || 7190 (e.push(new Pr(this.player_, { kind: this.kind_ })), (this.hideThreshold_ += 1)), 7191 super.createItems(e) 7192 ); 7193 } 7194 } 7195 ((Lr.prototype.kind_ = 'captions'), 7196 (Lr.prototype.controlText_ = 'Captions'), 7197 g.registerComponent('CaptionsButton', Lr));
7198 class Or extends Er { 7199 createEl(e, t, i) { 7200 ((e = super.createEl(e, t, i)), (t = e.querySelector('.vjs-menu-item-text'))); 7201 return ( 7202 'captions' === this.options_.track.kind && 7203 (this.player_.options_.experimentalSvgIcons 7204 ? this.setIcon('captions', e) 7205 : t.appendChild( 7206 l('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 }) 7207 ), 7208 t.appendChild( 7209 l('span', { 7210 className: 'vjs-control-text', 7211 textContent: ' ' + this.localize('Captions') 7212 }) 7213 )), 7214 e 7215 ); 7216 } 7217 } 7218 g.registerComponent('SubsCapsMenuItem', Or); 7219 class Rr extends kr { 7220 constructor(e, t = {}) { 7221 (super(e, t), 7222 (this.label_ = 'subtitles'), 7223 this.setIcon('subtitles'), 7224 -1 < ['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(this.player_.language_) && 7225 ((this.label_ = 'captions'), this.setIcon('captions')), 7226 this.menuButton_.controlText(m(this.label_))); 7227 } 7228 buildCSSClass() { 7229 return 'vjs-subs-caps-button ' + super.buildCSSClass(); 7230 } 7231 buildWrapperCSSClass() { 7232 return 'vjs-subs-caps-button ' + super.buildWrapperCSSClass(); 7233 } 7234 createItems() { 7235 let e = []; 7236 return ( 7237 (this.player().tech_ && this.player().tech_.featuresNativeTextTracks) || 7238 !this.player().getChild('textTrackSettings') || 7239 (e.push(new Pr(this.player_, { kind: this.label_ })), (this.hideThreshold_ += 1)), 7240 (e = super.createItems(e, Or)) 7241 ); 7242 } 7243 } 7244 ((Rr.prototype.kinds_ = ['captions', 'subtitles']), 7245 (Rr.prototype.controlText_ = 'Subtitles'), 7246 g.registerComponent('SubsCapsButton', Rr)); 7247 class Nr extends wr { 7248 constructor(e, t) { 7249 var i = t.track; 7250 let s = e.audioTracks(), 7251 r = 7252 ((t.label = i.label || i.language || 'Unknown'), 7253 (t.selected = i.enabled), 7254 super(e, t), 7255 (this.track = i), 7256 this.addClass(`vjs-${i.kind}-menu-item`), 7257 (...e) => { 7258 this.handleTracksChange.apply(this, e); 7259 }); 7260 (s.addEventListener('change', r), 7261 this.on('dispose', () => { 7262 s.removeEventListener('change', r); 7263 })); 7264 } 7265 createEl(e, t, i) { 7266 ((e = super.createEl(e, t, i)), (t = e.querySelector('.vjs-menu-item-text'))); 7267 return ( 7268 0 <= ['main-desc', 'descriptions'].indexOf(this.options_.track.kind) && 7269 (t.appendChild(l('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 })), 7270 t.appendChild( 7271 l('span', { 7272 className: 'vjs-control-text', 7273 textContent: ' ' + this.localize('Descriptions') 7274 }) 7275 )), 7276 e 7277 ); 7278 } 7279 handleClick(e) { 7280 if ( 7281 (super.handleClick(e), 7282 (this.track.enabled = !0), 7283 this.player_.tech_.featuresNativeAudioTracks) 7284 ) { 7285 var t = this.player_.audioTracks(); 7286 for (let e = 0; e < t.length; e++) { 7287 var i = t[e]; 7288 i !== this.track && (i.enabled = i === this.track); 7289 } 7290 } 7291 } 7292 handleTracksChange(e) { 7293 this.selected(this.track.enabled); 7294 } 7295 } 7296 g.registerComponent('AudioTrackMenuItem', Nr); 7297 class Mr extends Sr { 7298 constructor(e, t = {}) { 7299 ((t.tracks = e.audioTracks()), super(e, t), this.setIcon('audio')); 7300 } 7301 buildCSSClass() { 7302 return 'vjs-audio-button ' + super.buildCSSClass(); 7303 } 7304 buildWrapperCSSClass() { 7305 return 'vjs-audio-button ' + super.buildWrapperCSSClass(); 7306 } 7307 createItems(t = []) { 7308 this.hideThreshold_ = 1; 7309 var i = this.player_.audioTracks(); 7310 for (let e = 0; e < i.length; e++) { 7311 var s = i[e]; 7312 t.push(new Nr(this.player_, { track: s, selectable: !0, multiSelectable: !1 })); 7313 } 7314 return t; 7315 } 7316 } 7317 ((Mr.prototype.controlText_ = 'Audio Track'), g.registerComponent('AudioTrackButton', Mr)); 7318 class Ur extends wr { 7319 constructor(e, t) { 7320 var i = t.rate, 7321 s = parseFloat(i, 10); 7322 ((t.label = i), 7323 (t.selected = s === e.playbackRate()), 7324 (t.selectable = !0), 7325 (t.multiSelectable = !1), 7326 super(e, t), 7327 (this.label = i), 7328 (this.rate = s), 7329 this.on(e, 'ratechange', (e) => this.update(e))); 7330 } 7331 handleClick(e) { 7332 (super.handleClick(), this.player().playbackRate(this.rate)); 7333 } 7334 update(e) { 7335 this.selected(this.player().playbackRate() === this.rate); 7336 } 7337 } 7338 ((Ur.prototype.contentElType = 'button'), g.registerComponent('PlaybackRateMenuItem', Ur)); 7339 class Br extends Tr { 7340 constructor(e, t) { 7341 (super(e, t), 7342 this.menuButton_.el_.setAttribute('aria-describedby', this.labelElId_), 7343 this.updateVisibility(), 7344 this.updateLabel(), 7345 this.on(e, 'loadstart', (e) => this.updateVisibility(e)), 7346 this.on(e, 'ratechange', (e) => this.updateLabel(e)), 7347 this.on(e, 'playbackrateschange', (e) => this.handlePlaybackRateschange(e))); 7348 } 7349 createEl() { 7350 var e = super.createEl(); 7351 return ( 7352 (this.labelElId_ = 'vjs-playback-rate-value-label-' + this.id_), 7353 (this.labelEl_ = l('div', { 7354 className: 'vjs-playback-rate-value', 7355 id: this.labelElId_, 7356 textContent: '1x' 7357 })), 7358 e.appendChild(this.labelEl_), 7359 e 7360 ); 7361 } 7362 dispose() { 7363 ((this.labelEl_ = null), super.dispose()); 7364 } 7365 buildCSSClass() { 7366 return 'vjs-playback-rate ' + super.buildCSSClass(); 7367 } 7368 buildWrapperCSSClass() { 7369 return 'vjs-playback-rate ' + super.buildWrapperCSSClass(); 7370 } 7371 createItems() { 7372 var t = this.playbackRates(), 7373 i = []; 7374 for (let e = t.length - 1; 0 <= e; e--) i.push(new Ur(this.player(), { rate: t[e] + 'x' })); 7375 return i; 7376 } 7377 handlePlaybackRateschange(e) { 7378 this.update(); 7379 } 7380 playbackRates() { 7381 var e = this.player(); 7382 return (e.playbackRates && e.playbackRates()) || []; 7383 } 7384 playbackRateSupported() { 7385 return ( 7386 this.player().tech_ && 7387 this.player().tech_.featuresPlaybackRate && 7388 this.playbackRates() && 7389 0 < this.playbackRates().length 7390 ); 7391 } 7392 updateVisibility(e) { 7393 this.playbackRateSupported() ? this.removeClass('vjs-hidden') : this.addClass('vjs-hidden'); 7394 } 7395 updateLabel(e) { 7396 this.playbackRateSupported() && 7397 (this.labelEl_.textContent = this.player().playbackRate() + 'x'); 7398 } 7399 } 7400 ((Br.prototype.controlText_ = 'Playback Rate'), 7401 g.registerComponent('PlaybackRateMenuButton', Br)); 7402 class Fr extends g { 7403 buildCSSClass() { 7404 return 'vjs-spacer ' + super.buildCSSClass(); 7405 } 7406 createEl(e = 'div', t = {}, i = {}) { 7407 return (t.className || (t.className = this.buildCSSClass()), super.createEl(e, t, i)); 7408 } 7409 } 7410 g.registerComponent('Spacer', Fr); 7411 class qr extends Fr { 7412 buildCSSClass() { 7413 return 'vjs-custom-control-spacer ' + super.buildCSSClass(); 7414 } 7415 createEl() { 7416 return super.createEl('div', { className: this.buildCSSClass(), textContent: 'Â ' }); 7417 } 7418 } 7419 g.registerComponent('CustomControlSpacer', qr); 7420 class jr extends g { 7421 createEl() { 7422 return super.createEl('div', { className: 'vjs-control-bar', dir: 'ltr' }); 7423 } 7424 } 7425 ((jr.prototype.options_ = { 7426 children: [ 7427 'playToggle',
7428 'skipBackward', 7429 'skipForward', 7430 'volumePanel', 7431 'currentTimeDisplay', 7432 'timeDivider', 7433 'durationDisplay', 7434 'progressControl', 7435 'liveDisplay', 7436 'seekToLive', 7437 'remainingTimeDisplay', 7438 'customControlSpacer', 7439 'playbackRateMenuButton', 7440 'chaptersButton', 7441 'descriptionsButton', 7442 'subsCapsButton', 7443 'audioTrackButton', 7444 'pictureInPictureToggle', 7445 'fullscreenToggle' 7446 ] 7447 }), 7448 g.registerComponent('ControlBar', jr)); 7449 class Vr extends ti { 7450 constructor(e, t) { 7451 (super(e, t), 7452 this.on(e, 'error', (e) => { 7453 this.open(e); 7454 })); 7455 } 7456 buildCSSClass() { 7457 return 'vjs-error-display ' + super.buildCSSClass(); 7458 } 7459 content() { 7460 var e = this.player().error(); 7461 return e ? this.localize(e.message) : ''; 7462 } 7463 } 7464 ((Vr.prototype.options_ = Object.assign({}, ti.prototype.options_, { 7465 pauseOnOpen: !1, 7466 fillAlways: !0, 7467 temporary: !1, 7468 uncloseable: !0 7469 })), 7470 g.registerComponent('ErrorDisplay',
7470Vr)); 7471 class Hr extends g { 7472 constructor(e, t = {}) { 7473 (super(e, t), this.el_.setAttribute('aria-labelledby', this.selectLabelledbyIds)); 7474 } 7475 createEl() { 7476 return ( 7477 (this.selectLabelledbyIds = [this.options_.legendId, this.options_.labelId] 7478 .join(' ') 7479 .trim()), 7480 l( 7481 'select', 7482 { id: this.options_.id }, 7483 {}, 7484 this.options_.SelectOptions.map((e) => { 7485 var t = 7486 (this.options_.labelId || 'vjs-track-option-' + lt++) + 7487 '-' + 7488 e[1].replace(/\W+/g, ''), 7489 e = l('option', { 7490 id: t, 7491 value: this.localize(e[0]), 7492 textContent: this.localize(e[1]) 7493 }); 7494 return (e.setAttribute('aria-labelledby', this.selectLabelledbyIds + ' ' + t), e); 7495 }) 7496 ) 7497 ); 7498 } 7499 } 7500 g.registerComponent('TextTrackSelect', Hr); 7501 class zr extends g { 7502 constructor(t, e = {}) { 7503 super(t, e); 7504 var i, 7505 e = l('legend', { 7506 textContent: this.localize(this.options_.legendText), 7507 id: this.options_.legendId 7508 }), 7509 e = (this.el().appendChild(e), this.options_.selects); 7510 for (i of e) { 7511 var s = this.options_.selectConfigs[i], 7512 r = s.className, 7513 n = s.id.replace('%s', this.options_.id_); 7514 let e = null; 7515 var a = 'vjs_select_' + lt++, 7516 r = 7517 ('colors' === this.options_.type && 7518 ((e = l('span', { className: r })), 7519 (r = l('label', { 7520 id: n, 7521 className: 'vjs-label', 7522 textContent: this.localize(s.label) 7523 })).setAttribute('for', a), 7524 e.appendChild(r)), 7525 new Hr(t, { 7526 SelectOptions: s.options, 7527 legendId: this.options_.legendId, 7528 id: a, 7529 labelId: n 7530 })); 7531 (this.addChild(r), 7532 'colors' === this.options_.type && (e.appendChild(r.el()), this.el().appendChild(e))); 7533 } 7534 } 7535 createEl() { 7536 return l('fieldset', { className: this.options_.className }); 7537 } 7538 } 7539 g.registerComponent('TextTrackFieldset', zr); 7540 class $r extends g { 7541 constructor(e, t = {}) { 7542 super(e, t); 7543 var t = this.options_.textTrackComponentid, 7544 i = new zr(e, { 7545 id_: t, 7546 legendId: 'captions-text-legend-' + t, 7547 legendText: this.localize('Text'), 7548 className: 'vjs-fg vjs-track-setting', 7549 selects: this.options_.fieldSets[0], 7550 selectConfigs: this.options_.selectConfigs, 7551 type: 'colors' 7552 }), 7553 i = 7554 (this.addChild(i), 7555 new zr(e, { 7556 id_: t, 7557 legendId: 'captions-background-' + t, 7558 legendText: this.localize('Text Background'), 7559 className: 'vjs-bg vjs-track-setting', 7560 selects: this.options_.fieldSets[1], 7561 selectConfigs: this.options_.selectConfigs, 7562 type: 'colors' 7563 })), 7564 i = 7565 (this.addChild(i), 7566 new zr(e, { 7567 id_: t, 7568 legendId: 'captions-window-' + t, 7569 legendText: this.localize('Caption Area Background'), 7570 className: 'vjs-window vjs-track-setting', 7571 selects: this.options_.fieldSets[2], 7572 selectConfigs: this.options_.selectConfigs, 7573 type: 'colors' 7574 })); 7575 this.addChild(i); 7576 } 7577 createEl() { 7578 return l('div', { className: 'vjs-track-settings-colors' }); 7579 } 7580 } 7581 g.registerComponent('TextTrackSettingsColors', $r); 7582 class Wr extends g { 7583 constructor(e, t = {}) { 7584 super(e, t); 7585 var t = this.options_.textTrackComponentid, 7586 i = new zr(e, { 7587 id_: t, 7588 legendId: 'captions-font-size-' + t, 7589 legendText: 'Font Size', 7590 className: 'vjs-font-percent vjs-track-setting', 7591 selects: this.options_.fieldSets[0], 7592 selectConfigs: this.options_.selectConfigs, 7593 type: 'font' 7594 }), 7595 i = 7596 (this.addChild(i), 7597 new zr(e, { 7598 id_: t, 7599 legendId: 'captions-edge-style-' + t, 7600 legendText: this.localize('Text Edge Style'), 7601 className: 'vjs-edge-style vjs-track-setting', 7602 selects: this.options_.fieldSets[1], 7603 selectConfigs: this.options_.selectConfigs, 7604 type: 'font' 7605 })), 7606 i = 7607 (this.addChild(i), 7608 new zr(e, { 7609 id_: t, 7610 legendId: 'captions-font-family-' + t, 7611 legendText: this.localize('Font Family'), 7612 className: 'vjs-font-family vjs-track-setting', 7613 selects: this.options_.fieldSets[2], 7614 selectConfigs: this.options_.selectConfigs, 7615 type: 'font' 7616 })); 7617 this.addChild(i); 7618 } 7619 createEl() { 7620 return l('div', { className: 'vjs-track-settings-font' }); 7621 } 7622 } 7623 g.registerComponent('TextTrackSettingsFont', Wr); 7624 class Gr extends g { 7625 constructor(e, t = {}) { 7626 super(e, t); 7627 var t = this.localize('restore all settings to the default values'), 7628 i = new s(e, { controlText: t, className: 'vjs-default-button' }), 7629 i = 7630 (i.el().classList.remove('vjs-control', 'vjs-button'), 7631 (i.el().textContent = this.localize('Reset')), 7632 this.addChild(i), 7633 new s(e, { controlText: t, className: 'vjs-done-button' })); 7634 (i.el().classList.remove('vjs-control', 'vjs-button'), 7635 (i.el().textContent = this.localize('Done')), 7636 this.addChild(i)); 7637 } 7638 createEl() { 7639 return l('div', { className: 'vjs-track-settings-controls' }); 7640 } 7641 }
7642 g.registerComponent('TrackSettingsControls', Gr); 7643 let Xr = 'vjs-text-track-settings'; 7644 var e = ['#000', 'Black'], 7645 Ii = ['#00F', 'Blue'], 7646 Kr = ['#0FF', 'Cyan'], 7647 Yr = ['#0F0', 'Green'], 7648 r = ['#F0F', 'Magenta'], 7649 Qr = ['#F00', 'Red'], 7650 Jr = ['#FFF', 'White'], 7651 n = ['#FF0', 'Yellow'], 7652 Zr = ['1', 'Opaque'], 7653 en = ['0.5', 'Semi-Transparent'], 7654 tn = ['0', 'Transparent']; 7655 let sn = { 7656 backgroundColor: { 7657 selector: '.vjs-bg-color > select', 7658 id: 'captions-background-color-%s', 7659 label: 'Color', 7660 options: [e, Jr, Qr, Yr, Ii, n, r, Kr], 7661 className: 'vjs-bg-color' 7662 }, 7663 backgroundOpacity: { 7664 selector: '.vjs-bg-opacity > select', 7665 id: 'captions-background-opacity-%s', 7666 label: 'Opacity', 7667 options: [Zr, en, tn], 7668 className: 'vjs-bg-opacity vjs-opacity' 7669 }, 7670 color: { 7671 selector: '.vjs-text-color > select', 7672 id: 'captions-foreground-color-%s', 7673 label: 'Color', 7674 options: [Jr, e, Qr, Yr, Ii, n, r, Kr], 7675 className: 'vjs-text-color' 7676 }, 7677 edgeStyle: { 7678 selector: '.vjs-edge-style > select', 7679 id: '', 7680 label: 'Text Edge Style', 7681 options: [ 7682 ['none', 'None'], 7683 ['raised', 'Raised'], 7684 ['depressed', 'Depressed'], 7685 ['uniform', 'Uniform'], 7686 ['dropshadow', 'Drop shadow'] 7687 ] 7688 }, 7689 fontFamily: { 7690 selector: '.vjs-font-family > select', 7691 id: '', 7692 label: 'Font Family', 7693 options: [ 7694 ['proportionalSansSerif', 'Proportional Sans-Serif'], 7695 ['monospaceSansSerif', 'Monospace Sans-Serif'], 7696 ['proportionalSerif', 'Proportional Serif'], 7697 ['monospaceSerif', 'Monospace Serif'], 7698 ['casual', 'Casual'], 7699 ['script', 'Script'], 7700 ['small-caps', 'Small Caps'] 7701 ] 7702 }, 7703 fontPercent: { 7704 selector: '.vjs-font-percent > select', 7705 id: '', 7706 label: 'Font Size', 7707 options: [ 7708 ['0.50', '50%'], 7709 ['0.75', '75%'], 7710 ['1.00', '100%'], 7711 ['1.25', '125%'], 7712 ['1.50', '150%'], 7713 ['1.75', '175%'], 7714 ['2.00', '200%'], 7715 ['3.00', '300%'], 7716 ['4.00', '400%'] 7717 ], 7718 default: 2, 7719 parser: (e) => ('1.00' === e ? null : Number(e)) 7720 }, 7721 textOpacity: { 7722 selector: '.vjs-text-opacity > select', 7723 id: 'captions-foreground-opacity-%s', 7724 label: 'Opacity', 7725 options: [Zr, en], 7726 className: 'vjs-text-opacity vjs-opacity' 7727 }, 7728 windowColor: { 7729 selector: '.vjs-window-color > select', 7730 id: 'captions-window-color-%s', 7731 label: 'Color', 7732 className: 'vjs-window-color' 7733 }, 7734 windowOpacity: { 7735 selector: '.vjs-window-opacity > select', 7736 id: 'captions-window-opacity-%s', 7737 label: 'Opacity', 7738 options: [tn, en, Zr], 7739 className: 'vjs-window-opacity vjs-opacity' 7740 } 7741 }; 7742 function rn(e, t) { 7743 if ((e = t ? t(e) : e) && 'none' !== e) return e; 7744 } 7745 sn.windowColor.options = sn.backgroundColor.options; 7746 class nn extends ti { 7747 constructor(e, t) { 7748 ((t.temporary = !1), 7749 super(e, t), 7750 (this.updateDisplay = this.updateDisplay.bind(this)), 7751 this.fill(), 7752 (this.hasBeenOpened_ = this.hasBeenFilled_ = !0), 7753 this.renderModalComponents(e), 7754 (this.endDialog = l('p', { 7755 className: 'vjs-control-text', 7756 textContent: this.localize('End of dialog window.') 7757 })), 7758 this.el().appendChild(this.endDialog), 7759 this.setDefaults(), 7760 void 0 === t.persistTextTrackSettings && 7761 (this.options_.persistTextTrackSettings = 7762 this.options_.playerOptions.persistTextTrackSettings), 7763 this.bindFunctionsToSelectsAndButtons(), 7764 this.options_.persistTextTrackSettings && this.restoreSettings()); 7765 } 7766 renderModalComponents(e) { 7767 var t = new $r(e, { 7768 textTrackComponentid: this.id_, 7769 selectConfigs: sn, 7770 fieldSets: [ 7771 ['color', 'textOpacity'], 7772 ['backgroundColor', 'backgroundOpacity'], 7773 ['windowColor', 'windowOpacity'] 7774 ] 7775 }), 7776 t = 7777 (this.addChild(t), 7778 new Wr(e, { 7779 textTrackComponentid: this.id_, 7780 selectConfigs: sn, 7781 fieldSets: [['fontPercent'], ['edgeStyle'], ['fontFamily']] 7782 })), 7783 t = (this.addChild(t), new Gr(e)); 7784 this.addChild(t); 7785 } 7786 bindFunctionsToSelectsAndButtons() { 7787 (this.on(this.$('.vjs-done-button'), ['click', 'tap'], () => { 7788 (this.saveSettings(), this.close()); 7789 }), 7790 this.on(this.$('.vjs-default-button'), ['click', 'tap'], () => { 7791 (this.setDefaults(), this.updateDisplay()); 7792 }), 7793 X(sn, (e) => { 7794 this.on(this.$(e.selector), 'change', this.updateDisplay); 7795 })); 7796 } 7797 dispose() { 7798 ((this.endDialog = null), super.dispose()); 7799 } 7800 label() { 7801 return this.localize('Caption Settings Dialog'); 7802 } 7803 description() { 7804 return this.localize('Beginning of dialog window. Escape will cancel and close the window.'); 7805 } 7806 buildCSSClass() { 7807 return super.buildCSSClass() + ' vjs-text-track-settings'; 7808 } 7809 getValues() { 7810 return K( 7811 sn, 7812 (e, t, i) => { 7813 ((s = this.$(t.selector)), (t = t.parser)); 7814 var s = rn(s.options[s.options.selectedIndex].value, t); 7815 return (void 0 !== s && (e[i] = s), e); 7816 }, 7817 {} 7818 ); 7819 } 7820 setValues(n) { 7821 X(sn, (e, t) => { 7822 var i = this.$(e.selector), 7823 s = n[t], 7824 r = e.parser; 7825 if (s) 7826 for (let e = 0; e < i.options.length; e++) 7827 if (rn(i.options[e].value, r) === s) { 7828 i.selectedIndex = e; 7829 break; 7830 } 7831 }); 7832 } 7833 setDefaults() { 7834 X(sn, (e) => { 7835 var t = e.hasOwnProperty('default') ? e.default : 0; 7836 this.$(e.selector).selectedIndex = t; 7837 }); 7838 } 7839 restoreSettings() { 7840 let e;
7841 try { 7842 e = JSON.parse(window.localStorage.getItem(Xr)); 7843 } catch (e) { 7844 o.warn(e); 7845 } 7846 e && this.setValues(e); 7847 } 7848 saveSettings() { 7849 if (this.options_.persistTextTrackSettings) { 7850 var e = this.getValues(); 7851 try { 7852 Object.keys(e).length 7853 ? window.localStorage.setItem(Xr, JSON.stringify(e)) 7854 : window.localStorage.removeItem(Xr); 7855 } catch (e) { 7856 o.warn(e); 7857 } 7858 } 7859 } 7860 updateDisplay() { 7861 var e = this.player_.getChild('textTrackDisplay'); 7862 e && e.updateDisplay(); 7863 } 7864 handleLanguagechange() { 7865 (this.fill(), 7866 this.renderModalComponents(this.player_), 7867 this.bindFunctionsToSelectsAndButtons()); 7868 } 7869 } 7870 g.registerComponent('TextTrackSettings', nn); 7871 class an extends g { 7872 constructor(e, t) { 7873 let i = t.ResizeObserver || window.ResizeObserver; 7874 (super( 7875 e, 7876 d({ createEl: !(i = null === t.ResizeObserver ? !1 : i), reportTouchActivity: !1 }, t) 7877 ), 7878 (this.ResizeObserver = t.ResizeObserver || window.ResizeObserver), 7879 (this.loadListener_ = null), 7880 (this.resizeObserver_ = null), 7881 (this.debouncedHandler_ = bt( 7882 () => { 7883 this.resizeHandler(); 7884 }, 7885 100, 7886 !1, 7887 this 7888 )), 7889 i 7890 ? ((this.resizeObserver_ = new this.ResizeObserver(this.debouncedHandler_)), 7891 this.resizeObserver_.observe(e.el())) 7892 : ((this.loadListener_ = () => { 7893 if (this.el_ && this.el_.contentWindow) { 7894 let e = this.debouncedHandler_, 7895 t = (this.unloadListener_ = function () { 7896 (c(this, 'resize', e), c(this, 'unload', t), (t = null)); 7897 }); 7898 (mt(this.el_.contentWindow, 'unload', t), mt(this.el_.contentWindow, 'resize', e)); 7899 } 7900 }), 7901 this.one('load', this.loadListener_))); 7902 } 7903 createEl() { 7904 return super.createEl( 7905 'iframe', 7906 { className: 'vjs-resize-manager', tabIndex: -1, title: this.localize('No content') }, 7907 { 'aria-hidden': 'true' } 7908 ); 7909 } 7910 resizeHandler() { 7911 this.player_ && this.player_.trigger && this.player_.trigger('playerresize'); 7912 } 7913 dispose() { 7914 (this.debouncedHandler_ && this.debouncedHandler_.cancel(), 7915 this.resizeObserver_ && 7916 (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()), 7917 this.resizeObserver_.disconnect()), 7918 this.loadListener_ && this.off('load', this.loadListener_), 7919 this.el_ && 7920 this.el_.contentWindow && 7921 this.unloadListener_ && 7922 this.unloadListener_.call(this.el_.contentWindow), 7923 (this.ResizeObserver = null), 7924 (this.resizeObserver = null), 7925 (this.debouncedHandler_ = null), 7926 (this.loadListener_ = null), 7927 super.dispose()); 7928 } 7929 } 7930 g.registerComponent('ResizeManager', an); 7931 let on = { trackingThreshold: 20, liveTolerance: 15 }; 7932 class ln extends g { 7933 constructor(e, t) { 7934 (super(e, d(on, t, { createEl: !1 })), 7935 (this.trackLiveHandler_ = () => this.trackLive_()), 7936 (this.handlePlay_ = (e) => this.handlePlay(e)), 7937 (this.handleFirstTimeupdate_ = (e) => this.handleFirstTimeupdate(e)), 7938 (this.handleSeeked_ = (e) => this.handleSeeked(e)), 7939 (this.seekToLiveEdge_ = (e) => this.seekToLiveEdge(e)), 7940 this.reset_(), 7941 this.on(this.player_, 'durationchange', (e) => this.handleDurationchange(e)), 7942 this.on(this.player_, 'canplay', () => this.toggleTracking())); 7943 } 7944 trackLive_() { 7945 var t = this.player_.seekable(); 7946 if (t && t.length) { 7947 var t = Number(window.performance.now().toFixed(4)), 7948 i = -1 === this.lastTime_ ? 0 : (t - this.lastTime_) / 1e3, 7949 t = 7950 ((this.lastTime_ = t), 7951 (this.pastSeekEnd_ = this.pastSeekEnd() + i), 7952 this.liveCurrentTime()), 7953 i = this.player_.currentTime(); 7954 let e = 7955 this.player_.paused() || 7956 this.seekedBehindLive_ || 7957 Math.abs(t - i) > this.options_.liveTolerance; 7958 (e = this.timeupdateSeen_ && t !== 1 / 0 ? e : !1) !== this.behindLiveEdge_ && 7959 ((this.behindLiveEdge_ = e), this.trigger('liveedgechange')); 7960 } 7961 } 7962 handleDurationchange() { 7963 this.toggleTracking(); 7964 } 7965 toggleTracking() { 7966 this.player_.duration() === 1 / 0 && this.liveWindow() >= this.options_.trackingThreshold 7967 ? (this.player_.options_.liveui && this.player_.addClass('vjs-liveui'), 7968 this.startTracking()) 7969 : (this.player_.removeClass('vjs-liveui'), this.stopTracking()); 7970 } 7971 startTracking() { 7972 this.isTracking() || 7973 (this.timeupdateSeen_ || (this.timeupdateSeen_ = this.player_.hasStarted()), 7974 (this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, 30)), 7975 this.trackLive_(), 7976 this.on(this.player_, ['play', 'pause'], this.trackLiveHandler_), 7977 this.timeupdateSeen_ 7978 ? this.on(this.player_, 'seeked', this.handleSeeked_) 7979 : (this.one(this.player_, 'play', this.handlePlay_), 7980 this.one(this.player_, 'timeupdate', this.handleFirstTimeupdate_))); 7981 } 7982 handleFirstTimeupdate() { 7983 ((this.timeupdateSeen_ = !0), this.on(this.player_, 'seeked', this.handleSeeked_)); 7984 } 7985 handleSeeked() { 7986 var e = Math.abs(this.liveCurrentTime() - this.player_.currentTime()); 7987 ((this.seekedBehindLive_ = this.nextSeekedFromUser_ && 2 < e), 7988 (this.nextSeekedFromUser_ = !1), 7989 this.trackLive_()); 7990 } 7991 handlePlay() { 7992 this.one(this.player_, 'timeupdate', this.seekToLiveEdge_); 7993 } 7994 reset_() { 7995 ((this.lastTime_ = -1), 7996 (this.pastSeekEnd_ = 0), 7997 (this.lastSeekEnd_ = -1), 7998 (this.behindLiveEdge_ = !0), 7999 (this.timeupdateSeen_ = !1), 8000 (this.seekedBehindLive_ = !1), 8001 (this.nextSeekedFromUser_ = !1), 8002 this.clearInterval(this.trackingInterval_), 8003 (this.trackingInterval_ = null),
8004 this.off(this.player_, ['play', 'pause'], this.trackLiveHandler_), 8005 this.off(this.player_, 'seeked', this.handleSeeked_), 8006 this.off(this.player_, 'play', this.handlePlay_), 8007 this.off(this.player_, 'timeupdate', this.handleFirstTimeupdate_), 8008 this.off(this.player_, 'timeupdate', this.seekToLiveEdge_)); 8009 } 8010 nextSeekedFromUser() { 8011 this.nextSeekedFromUser_ = !0; 8012 } 8013 stopTracking() { 8014 this.isTracking() && (this.reset_(), this.trigger('liveedgechange')); 8015 } 8016 seekableEnd() { 8017 var e = this.player_.seekable(), 8018 t = []; 8019 let i = e ? e.length : 0; 8020 for (; i--; ) t.push(e.end(i)); 8021 return t.length ? t.sort()[t.length - 1] : 1 / 0; 8022 } 8023 seekableStart() { 8024 var e = this.player_.seekable(), 8025 t = []; 8026 let i = e ? e.length : 0; 8027 for (; i--; ) t.push(e.start(i)); 8028 return t.length ? t.sort()[0] : 0; 8029 } 8030 liveWindow() { 8031 var e = this.liveCurrentTime(); 8032 return e === 1 / 0 ? 0 : e - this.seekableStart(); 8033 }
8034 isLive() { 8035 return this.isTracking(); 8036 } 8037 atLiveEdge() { 8038 return !this.behindLiveEdge(); 8039 } 8040 liveCurrentTime() { 8041 return this.pastSeekEnd() + this.seekableEnd(); 8042 } 8043 pastSeekEnd() { 8044 var e = this.seekableEnd(); 8045 return ( 8046 -1 !== this.lastSeekEnd_ && e !== this.lastSeekEnd_ && (this.pastSeekEnd_ = 0), 8047 (this.lastSeekEnd_ = e), 8048 this.pastSeekEnd_ 8049 ); 8050 } 8051 behindLiveEdge() { 8052 return this.behindLiveEdge_; 8053 } 8054 isTracking() { 8055 return 'number' == typeof this.trackingInterval_; 8056 } 8057 seekToLiveEdge() { 8058 ((this.seekedBehindLive_ = !1), 8059 this.atLiveEdge() || 8060 ((this.nextSeekedFromUser_ = !1), this.player_.currentTime(this.liveCurrentTime()))); 8061 } 8062 dispose() { 8063 (this.stopTracking(), super.dispose()); 8064 } 8065 } 8066 g.registerComponent('LiveTracker', ln); 8067 class dn extends g { 8068 constructor(e, t) { 8069 (super(e, t), this.on('statechanged', (e) => this.updateDom_()), this.updateDom_()); 8070 } 8071 createEl() { 8072 return ( 8073 (this.els = { 8074 title: l('div', { className: 'vjs-title-bar-title', id: 'vjs-title-bar-title-' + lt++ }), 8075 description: l('div', { 8076 className: 'vjs-title-bar-description', 8077 id: 'vjs-title-bar-description-' + lt++ 8078 }) 8079 }), 8080 l('div', { className: 'vjs-title-bar' }, {}, J(this.els)) 8081 ); 8082 } 8083 updateDom_() { 8084 var e = this.player_.tech_; 8085 let s = e && e.el_, 8086 r = { title: 'aria-labelledby', description: 'aria-describedby' }; 8087 (['title', 'description'].forEach((e) => { 8088 var t = this.state[e], 8089 i = this.els[e], 8090 e = r[e]; 8091 ($e(i), t && xe(i, t), s && (s.removeAttribute(e), t) && s.setAttribute(e, i.id)); 8092 }), 8093 this.state.title || this.state.description ? this.show() : this.hide()); 8094 } 8095 update(e) { 8096 this.setState(e); 8097 } 8098 dispose() { 8099 var e = this.player_.tech_, 8100 e = e && e.el_; 8101 (e && (e.removeAttribute('aria-labelledby'), e.removeAttribute('aria-describedby')), 8102 super.dispose(), 8103 (this.els = null)); 8104 } 8105 } 8106 g.registerComponent('TitleBar', dn); 8107 let hn = { initialDisplay: 4e3, position: [], takeFocus: !1 }; 8108 class un extends s { 8109 constructor(e, t) { 8110 (super(e, (t = d(hn, t))), 8111 this.controlText(t.controlText), 8112 this.hide(), 8113 this.on(this.player_, ['useractive', 'userinactive'], (e) => { 8114 this.removeClass('force-display'); 8115 })); 8116 } 8117 buildCSSClass() { 8118 return ( 8119 'vjs-transient-button focus-visible ' + 8120 this.options_.position.map((e) => 'vjs-' + e).join(' ') 8121 ); 8122 } 8123 createEl() { 8124 var e = l('button', {}, { type: 'button', class: this.buildCSSClass() }, l('span')); 8125 return ((this.controlTextEl_ = e.querySelector('span')), e); 8126 } 8127 show() { 8128 (super.show(), 8129 this.addClass('force-display'), 8130 this.options_.takeFocus && this.el().focus({ preventScroll: !0 }), 8131 (this.forceDisplayTimeout = this.player_.setTimeout(() => { 8132 this.removeClass('force-display'); 8133 }, this.options_.initialDisplay))); 8134 } 8135 hide() { 8136 (this.removeClass('force-display'), super.hide()); 8137 } 8138 dispose() { 8139 (this.player_.clearTimeout(this.forceDisplayTimeout), super.dispose()); 8140 } 8141 } 8142 g.registerComponent('TransientButton', un); 8143 function cn(s) { 8144 let r = s.el(); 8145 if (!r.resetSourceWatch_) { 8146 let t = {}, 8147 e = yn(s), 8148 i = 8149 (t) => 8150 (...e) => { 8151 e = t.apply(r, e); 8152 return (mn(s), e); 8153 }; 8154 (['append', 'appendChild', 'insertAdjacentHTML'].forEach((e) => { 8155 r[e] && ((t[e] = r[e]), (r[e] = i(t[e]))); 8156 }), 8157 Object.defineProperty(r, 'innerHTML', d(e, { set: i(e.set) })), 8158 (r.resetSourceWatch_ = () => { 8159 ((r.resetSourceWatch_ = null), 8160 Object.keys(t).forEach((e) => { 8161 r[e] = t[e]; 8162 }), 8163 Object.defineProperty(r, 'innerHTML', e)); 8164 }), 8165 s.one('sourceset', r.resetSourceWatch_)); 8166 } 8167 } 8168 function pn(n) { 8169 if (n.featuresSourceset) { 8170 let r = n.el(); 8171 if (!r.resetSourceset_) { 8172 e = n; 8173 let t = fn([e.el(), window.HTMLMediaElement.prototype, _n], 'src'); 8174 var e; 8175 let i = r.setAttribute, 8176 s = r.load; 8177 (Object.defineProperty( 8178 r, 8179 'src', 8180 d(t, { 8181 set: (e) => { 8182 e = t.set.call(r, e); 8183 return (n.triggerSourceset(r.src), e); 8184 } 8185 }) 8186 ), 8187 (r.setAttribute = (e, t) => { 8188 t = i.call(r, e, t); 8189 return (/src/i.test(e) && n.triggerSourceset(r.src), t); 8190 }), 8191 (r.load = () => { 8192 var e = s.call(r); 8193 return (mn(n) || (n.triggerSourceset(''), cn(n)), e); 8194 }), 8195 r.currentSrc ? n.triggerSourceset(r.currentSrc) : mn(n) || cn(n), 8196 (r.resetSourceset_ = () => { 8197 ((r.resetSourceset_ = null),
8198 (r.load = s), 8199 (r.setAttribute = i), 8200 Object.defineProperty(r, 'src', t), 8201 r.resetSourceWatch_ && r.resetSourceWatch_()); 8202 })); 8203 } 8204 } 8205 } 8206 let mn = (t) => { 8207 var e = t.el(); 8208 if (e.hasAttribute('src')) t.triggerSourceset(e.src); 8209 else { 8210 var i = t.$$('source'), 8211 s = []; 8212 let e = ''; 8213 if (!i.length) return !1; 8214 for (let e = 0; e < i.length; e++) { 8215 var r = i[e].src; 8216 r && -1 === s.indexOf(r) && s.push(r); 8217 } 8218 if (!s.length) return !1; 8219 (1 === s.length && (e = s[0]), t.triggerSourceset(e)); 8220 } 8221 return !0; 8222 }, 8223 gn = Object.defineProperty({}, 'innerHTML', { 8224 get() { 8225 return this.cloneNode(!0).innerHTML; 8226 }, 8227 set(e) { 8228 for ( 8229 var t = document.createElement(this.nodeName.toLowerCase()), 8230 i = ((t.innerHTML = e), document.createDocumentFragment()); 8231 t.childNodes.length; 8232 8233 ) 8234 i.appendChild(t.childNodes[0]); 8235 return ( 8236 (this.innerText = ''), 8237 window.Element.prototype.appendChild.call(this, i), 8238 this.innerHTML 8239 ); 8240 } 8241 }), 8242 fn = (t, i) => { 8243 let s = {}; 8244 for ( 8245 let e = 0; 8246 e < t.length && !((s = Object.getOwnPropertyDescriptor(t[e], i)) && s.set && s.get); 8247 e++ 8248 ); 8249 return ((s.enumerable = !0), (s.configurable = !0), s); 8250 }, 8251 yn = (e) => 8252 fn([e.el(), window.HTMLMediaElement.prototype, window.Element.prototype, gn], 'innerHTML'), 8253 _n = Object.defineProperty({}, 'src', { 8254 get() { 8255 return this.hasAttribute('src') 8256 ? gi(window.Element.prototype.getAttribute.call(this, 'src')) 8257 : ''; 8258 }, 8259 set(e) { 8260 return (window.Element.prototype.setAttribute.call(this, 'src', e), e); 8261 } 8262 }); 8263 class b extends v { 8264 constructor(e, t) { 8265 super(e, t); 8266 t = e.source; 8267 let i = !1; 8268 if ( 8269 ((this.featuresVideoFrameCallback = 8270 this.featuresVideoFrameCallback && 'VIDEO' === this.el_.tagName), 8271 t && (this.el_.currentSrc !== t.src || (e.tag && 3 === e.tag.initNetworkState_)) 8272 ? this.setSource(t) 8273 : this.handleLateInit_(this.el_), 8274 e.enableSourceset && this.setupSourcesetHandling_(), 8275 (this.isScrubbing_ = !1), 8276 this.el_.hasChildNodes()) 8277 ) { 8278 var s = this.el_.childNodes; 8279 let e = s.length; 8280 for (var r = []; e--; ) { 8281 var n = s[e]; 8282 'track' === n.nodeName.toLowerCase() && 8283 (this.featuresNativeTextTracks 8284 ? (this.remoteTextTrackEls().addTrackElement_(n), 8285 this.remoteTextTracks().addTrack(n.track), 8286 this.textTracks().addTrack(n.track), 8287 i || this.el_.hasAttribute('crossorigin') || !fi(n.src) || (i = !0)) 8288 : r.push(n)); 8289 } 8290 for (let e = 0; e < r.length; e++) this.el_.removeChild(r[e]); 8291 } 8292 (this.proxyNativeTracks_(), 8293 this.featuresNativeTextTracks && 8294 i && 8295 o.warn( 8296 "Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading." 8297 ), 8298 this.restoreMetadataTracksInIOSNativePlayer_(), 8299 (ve || ge) && !0 === e.nativeControlsForTouch && this.setControls(!0), 8300 this.proxyWebkitFullscreen_(), 8301 this.triggerReady()); 8302 } 8303 dispose() { 8304 (this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(), 8305 b.disposeMediaElement(this.el_), 8306 (this.options_ = null), 8307 super.dispose()); 8308 } 8309 setupSourcesetHandling_() { 8310 pn(this); 8311 } 8312 restoreMetadataTracksInIOSNativePlayer_() { 8313 let i = this.textTracks(), 8314 s, 8315 e = () => { 8316 s = []; 8317 for (let e = 0; e < i.length; e++) { 8318 var t = i[e]; 8319 'metadata' === t.kind && s.push({ track: t, storedMode: t.mode }); 8320 } 8321 }, 8322 r = 8323 (e(), 8324 i.addEventListener('change', e), 8325 this.on('dispose', () => i.removeEventListener('change', e)), 8326 () => { 8327 for (let e = 0; e < s.length; e++) { 8328 var t = s[e]; 8329 'disabled' === t.track.mode && 8330 t.track.mode !== t.storedMode && 8331 (t.track.mode = t.storedMode); 8332 } 8333 i.removeEventListener('change', r); 8334 }); 8335 (this.on('webkitbeginfullscreen', () => { 8336 (i.removeEventListener('change', e), 8337 i.removeEventListener('change', r), 8338 i.addEventListener('change', r)); 8339 }), 8340 this.on('webkitendfullscreen', () => { 8341 (i.removeEventListener('change', e), 8342 i.addEventListener('change', e), 8343 i.removeEventListener('change', r)); 8344 })); 8345 } 8346 overrideNative_(e, i) { 8347 if (i === this[`featuresNative${e}Tracks`]) { 8348 let t = e.toLowerCase(); 8349 (this[t + 'TracksListeners_'] &&
8350 Object.keys(this[t + 'TracksListeners_']).forEach((e) => { 8351 this.el()[t + 'Tracks'].removeEventListener(e, this[t + 'TracksListeners_'][e]); 8352 }), 8353 (this[`featuresNative${e}Tracks`] = !i), 8354 (this[t + 'TracksListeners_'] = null), 8355 this.proxyNativeTracksForType_(t)); 8356 } 8357 } 8358 overrideNativeAudioTracks(e) { 8359 this.overrideNative_('Audio', e); 8360 } 8361 overrideNativeVideoTracks(e) { 8362 this.overrideNative_('Video', e); 8363 } 8364 proxyNativeTracksForType_(i) { 8365 var s = Vi[i]; 8366 let r = this.el()[s.getterName], 8367 n = this[s.getterName](); 8368 if (this[`featuresNative${s.capitalName}Tracks`] && r && r.addEventListener) { 8369 let e = { 8370 change: (e) => { 8371 var t = { type: 'change', target: n, currentTarget: n, srcElement: n }; 8372 (n.trigger(t), 'text' === i && this[Hi.remoteText.getterName]().trigger(t)); 8373 }, 8374 addtrack(e) { 8375 n.addTrack(e.track); 8376 }, 8377 removetrack(e) { 8378 n.removeTrack(e.track); 8379 } 8380 }, 8381 t = function () { 8382 var e = []; 8383 for (let i = 0; i < n.length; i++) { 8384 let t = !1; 8385 for (let e = 0; e < r.length; e++) 8386 if (r[e] === n[i]) { 8387 t = !0; 8388 break; 8389 } 8390 t || e.push(n[i]); 8391 } 8392 for (; e.length; ) n.removeTrack(e.shift()); 8393 }; 8394 ((this[s.getterName + 'Listeners_'] = e), 8395 Object.keys(e).forEach((t) => { 8396 let i = e[t]; 8397 (r.addEventListener(t, i), this.on('dispose', (e) => r.removeEventListener(t, i))); 8398 }), 8399 this.on('loadstart', t), 8400 this.on('dispose', (e) => this.off('loadstart', t))); 8401 } 8402 } 8403 proxyNativeTracks_() { 8404 Vi.names.forEach((e) => { 8405 this.proxyNativeTracksForType_(e); 8406 }); 8407 } 8408 createEl() { 8409 let t = this.options_.tag; 8410 ((t && (this.options_.playerElIngest || this.movingMediaElementInDOM)) || 8411 (t 8412 ? ((e = t.cloneNode(!0)), 8413 t.parentNode && t.parentNode.insertBefore(e, t), 8414 b.disposeMediaElement(t), 8415 (t = e)) 8416 : ((t = document.createElement('video')), 8417 (e = d({}, this.options_.tag && Ne(this.options_.tag))), 8418 (ve && !0 === this.options_.nativeControlsForTouch) || delete e.controls, 8419 Re(t, Object.assign(e, { id: this.options_.techId, class: 'vjs-tech' }))), 8420 (t.playerId = this.options_.playerId)), 8421 'undefined' != typeof this.options_.preload && Ue(t, 'preload', this.options_.preload), 8422 void 0 !== this.options_.disablePictureInPicture && 8423 (t.disablePictureInPicture = this.options_.disablePictureInPicture)); 8424 var e, 8425 i = ['loop', 'muted', 'playsinline', 'autoplay']; 8426 for (let e = 0; e < i.length; e++) { 8427 var s = i[e], 8428 r = this.options_[s]; 8429 'undefined' != typeof r && (r ? Ue(t, s, s) : Be(t, s), (t[s] = r)); 8430 } 8431 return t; 8432 } 8433 handleLateInit_(t) { 8434 if (0 !== t.networkState && 3 !== t.networkState) 8435 if (0 === t.readyState) { 8436 let e = !1, 8437 t = function () { 8438 e = !0; 8439 }, 8440 i = 8441 (this.on('loadstart', t), 8442 function () { 8443 e || this.trigger('loadstart'); 8444 }); 8445 (this.on('loadedmetadata', i), 8446 void this.ready(function () { 8447 (this.off('loadstart', t), 8448 this.off('loadedmetadata', i), 8449 e || this.trigger('loadstart')); 8450 })); 8451 } else { 8452 let e = ['loadstart']; 8453 (e.push('loadedmetadata'), 8454 2 <= t.readyState && e.push('loadeddata'), 8455 3 <= t.readyState && e.push('canplay'), 8456 4 <= t.readyState && e.push('canplaythrough'), 8457 this.ready(function () { 8458 e.forEach(function (e) { 8459 this.trigger(e); 8460 }, this); 8461 })); 8462 } 8463 } 8464 setScrubbing(e) { 8465 this.isScrubbing_ = e; 8466 } 8467 scrubbing() { 8468 return this.isScrubbing_; 8469 } 8470 setCurrentTime(e) {
8471 try { 8472 this.isScrubbing_ && this.el_.fastSeek && Te 8473 ? this.el_.fastSeek(e) 8474 : (this.el_.currentTime = e); 8475 } catch (e) { 8476 o(e, 'Video is not ready. (Video.js)'); 8477 } 8478 } 8479 duration() { 8480 if (this.el_.duration === 1 / 0 && se && le && 0 === this.el_.currentTime) { 8481 let e = () => { 8482 0 < this.el_.currentTime && 8483 (this.el_.duration === 1 / 0 && this.trigger('durationchange'), 8484 this.off('timeupdate', e)); 8485 }; 8486 return (this.on('timeupdate', e), NaN); 8487 } 8488 return this.el_.duration || NaN; 8489 } 8490 width() { 8491 return this.el_.offsetWidth; 8492 } 8493 height() { 8494 return this.el_.offsetHeight; 8495 } 8496 proxyWebkitFullscreen_() { 8497 if ('webkitDisplayingFullscreen' in this.el_) { 8498 let e = function () { 8499 (this.trigger('fullscreenchange', { isFullscreen: !1 }), 8500 this.el_.controls && 8501 !this.options_.nativeControlsForTouch && 8502 this.controls() && 8503 (this.el_.controls = !1)); 8504 }, 8505 t = function () { 8506 'webkitPresentationMode' in this.el_ && 8507 'picture-in-picture' !== this.el_.webkitPresentationMode && 8508 (this.one('webkitendfullscreen', e), 8509 this.trigger('fullscreenchange', { isFullscreen: !0, nativeIOSFullscreen: !0 })); 8510 }; 8511 (this.on('webkitbeginfullscreen', t), 8512 this.on('dispose', () => { 8513 (this.off('webkitbeginfullscreen', t), this.off('webkitendfullscreen', e)); 8514 })); 8515 } 8516 } 8517 supportsFullScreen() { 8518 return 'function' == typeof this.el_.webkitEnterFullScreen; 8519 } 8520 enterFullScreen() { 8521 let e = this.el_; 8522 if (e.paused && e.networkState <= e.HAVE_METADATA) 8523 (Kt(this.el_.play()), 8524 this.setTimeout(function () { 8525 e.pause(); 8526 try { 8527 e.webkitEnterFullScreen(); 8528 } catch (e) { 8529 this.trigger('fullscreenerror', e); 8530 } 8531 }, 0)); 8532 else 8533 try { 8534 e.webkitEnterFullScreen(); 8535 } catch (e) { 8536 this.trigger('fullscreenerror', e); 8537 } 8538 } 8539 exitFullScreen() { 8540 this.el_.webkitDisplayingFullscreen 8541 ? this.el_.webkitExitFullScreen() 8542 : this.trigger('fullscreenerror', new Error('The video is not fullscreen')); 8543 } 8544 requestPictureInPicture() { 8545 return this.el_.requestPictureInPicture(); 8546 } 8547 requestVideoFrameCallback(e) { 8548 return this.featuresVideoFrameCallback && !this.el_.webkitKeys 8549 ? this.el_.requestVideoFrameCallback(e) 8550 : super.requestVideoFrameCallback(e); 8551 } 8552 cancelVideoFrameCallback(e) { 8553 this.featuresVideoFrameCallback && !this.el_.webkitKeys 8554 ? this.el_.cancelVideoFrameCallback(e) 8555 : super.cancelVideoFrameCallback(e); 8556 } 8557 src(e) { 8558 if (void 0 === e) return this.el_.src; 8559 this.setSrc(e); 8560 } 8561 addSourceElement(e, t) { 8562 return e 8563 ? ((e = { src: e }), 8564 t && (e.type = t), 8565 (t = l('source', {}, e)), 8566 this.el_.appendChild(t), 8567 !0) 8568 : (o.error('Invalid source URL.'), !1); 8569 } 8570 removeSourceElement(e) { 8571 if (e) { 8572 var t; 8573 for (t of this.el_.querySelectorAll('source')) 8574 if (t.src === e) return (this.el_.removeChild(t), !0); 8575 o.warn('No matching source element found with src: ' + e); 8576 } else o.error('Source URL is required to remove the source element.'); 8577 return !1; 8578 } 8579 reset() { 8580 b.resetMediaElement(this.el_); 8581 } 8582 currentSrc() { 8583 return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc; 8584 } 8585 setControls(e) { 8586 this.el_.controls = !!e; 8587 } 8588 addTextTrack(e, t, i) { 8589 return this.featuresNativeTextTracks 8590 ? this.el_.addTextTrack(e, t, i) 8591 : super.addTextTrack(e, t, i); 8592 } 8593 createRemoteTextTrack(e) { 8594 var t; 8595 return this.featuresNativeTextTracks 8596 ? ((t = document.createElement('track')), 8597 e.kind && (t.kind = e.kind), 8598 e.label && (t.label = e.label), 8599 (e.language || e.srclang) && (t.srclang = e.language || e.srclang), 8600 e.default && (t.default = e.default), 8601 e.id && (t.id = e.id), 8602 e.src && (t.src = e.src), 8603 t) 8604 : super.createRemoteTextTrack(e); 8605 } 8606 addRemoteTextTrack(e, t) { 8607 e = super.addRemoteTextTrack(e, t); 8608 return (this.featuresNativeTextTracks && this.el().appendChild(e), e); 8609 } 8610 removeRemoteTextTrack(t) { 8611 if ((super.removeRemoteTextTrack(t), this.featuresNativeTextTracks)) { 8612 var i = this.$$('track'); 8613 let e = i.length; 8614 for (; e--; ) (t !== i[e] && t !== i[e].track) || this.el().removeChild(i[e]); 8615 } 8616 } 8617 getVideoPlaybackQuality() { 8618 var e; 8619 return 'function' == typeof this.el().getVideoPlaybackQuality 8620 ? this.el().getVideoPlaybackQuality() 8621 : ((e = {}), 8622 'undefined' != typeof this.el().webkitDroppedFrameCount && 8623 'undefined' != typeof this.el().webkitDecodedFrameCount && 8624 ((e.droppedVideoFrames = this.el().webkitDroppedFrameCount), 8625 (e.totalVideoFrames = this.el().webkitDecodedFrameCount)), 8626 window.performance && (e.creationTime = window.performance.now()), 8627 e); 8628 } 8629 } 8630 (Z(b, 'TEST_VID', function () { 8631 var e, t; 8632 if (Ee()) 8633 return ( 8634 (e = document.createElement('video')), 8635 ((t = document.createElement('track')).kind = 'captions'), 8636 (t.srclang = 'en'), 8637 (t.label = 'English'), 8638 e.appendChild(t), 8639 e 8640 ); 8641 }), 8642 (b.isSupported = function () {
8643 try { 8644 b.TEST_VID.volume = 0.5; 8645 } catch (e) { 8646 return !1; 8647 } 8648 return !(!b.TEST_VID || !b.TEST_VID.canPlayType); 8649 }), 8650 (b.canPlayType = function (e) { 8651 return b.TEST_VID.canPlayType(e); 8652 }), 8653 (b.canPlaySource = function (e, t) { 8654 return b.canPlayType(e.type); 8655 }), 8656 (b.canControlVolume = function () { 8657 try { 8658 let e = b.TEST_VID.volume; 8659 b.TEST_VID.volume = e / 2 + 0.1; 8660 var t = e !== b.TEST_VID.volume; 8661 return t && u 8662 ? (window.setTimeout(() => { 8663 b && b.prototype && (b.prototype.featuresVolumeControl = e !== b.TEST_VID.volume); 8664 }), 8665 !1) 8666 : t; 8667 } catch (e) { 8668 return !1; 8669 } 8670 }), 8671 (b.canMuteVolume = function () { 8672 try { 8673 var e = b.TEST_VID.muted; 8674 return ( 8675 (b.TEST_VID.muted = !e), 8676 b.TEST_VID.muted ? Ue(b.TEST_VID, 'muted', 'muted') : Be(b.TEST_VID, 'muted'), 8677 e !== b.TEST_VID.muted 8678 ); 8679 } catch (e) { 8680 return !1; 8681 } 8682 }), 8683 (b.canControlPlaybackRate = function () { 8684 if (se && le && he < 58) return !1; 8685 try { 8686 var e = b.TEST_VID.playbackRate; 8687 return ((b.TEST_VID.playbackRate = e / 2 + 0.1), e !== b.TEST_VID.playbackRate); 8688 } catch (e) { 8689 return !1; 8690 } 8691 }), 8692 (b.canOverrideAttributes = function () { 8693 try { 8694 var e = () => {}; 8695 (Object.defineProperty(document.createElement('video'), 'src', { get: e, set: e }), 8696 Object.defineProperty(document.createElement('audio'), 'src', { get: e, set: e }), 8697 Object.defineProperty(document.createElement('video'), 'innerHTML', { get: e, set: e }), 8698 Object.defineProperty(document.createElement('audio'), 'innerHTML', { get: e, set: e })); 8699 } catch (e) { 8700 return !1; 8701 } 8702 return !0; 8703 }), 8704 (b.supportsNativeTextTracks = function () { 8705 return Te || (u && le); 8706 }), 8707 (b.supportsNativeVideoTracks = function () { 8708 return !(!b.TEST_VID || !b.TEST_VID.videoTracks); 8709 }), 8710 (b.supportsNativeAudioTracks = function () { 8711 return !(!b.TEST_VID || !b.TEST_VID.audioTracks); 8712 }), 8713 (b.Events = [ 8714 'loadstart', 8715 'suspend', 8716 'abort', 8717 'error', 8718 'emptied', 8719 'stalled', 8720 'loadedmetadata', 8721 'loadeddata', 8722 'canplay', 8723 'canplaythrough', 8724 'playing', 8725 'waiting', 8726 'seeking', 8727 'seeked', 8728 'ended', 8729 'durationchange', 8730 'timeupdate', 8731 'progress', 8732 'play', 8733 'pause', 8734 'ratechange', 8735 'resize', 8736 'volumechange' 8737 ]), 8738 [ 8739 ['featuresMuteControl', 'canMuteVolume'], 8740 ['featuresPlaybackRate', 'canControlPlaybackRate'], 8741 ['featuresSourceset', 'canOverrideAttributes'], 8742 ['featuresNativeTextTracks', 'supportsNativeTextTracks'], 8743 ['featuresNativeVideoTracks', 'supportsNativeVideoTracks'], 8744 ['featuresNativeAudioTracks', 'supportsNativeAudioTracks'] 8745 ].forEach(function ([e, t]) { 8746 Z(b.prototype, e, () => b[t](), !0); 8747 }), 8748 (b.prototype.featuresVolumeControl = b.canControlVolume()), 8749 (b.prototype.movingMediaElementInDOM = !u), 8750 (b.prototype.featuresFullscreenResize = !0), 8751 (b.prototype.featuresProgressEvents = !0), 8752 (b.prototype.featuresTimeupdateEvents = !0), 8753 (b.prototype.featuresVideoFrameCallback = !( 8754 !b.TEST_VID || !b.TEST_VID.requestVideoFrameCallback 8755 )), 8756 (b.disposeMediaElement = function (e) { 8757 if (e) { 8758 for (e.parentNode && e.parentNode.removeChild(e); e.hasChildNodes(); ) 8759 e.removeChild(e.firstChild); 8760 if ((e.removeAttribute('src'), 'function' == typeof e.load)) 8761 try { 8762 e.load(); 8763 } catch (e) {} 8764 } 8765 }), 8766 (b.resetMediaElement = function (t) { 8767 if (t) { 8768 var i = t.querySelectorAll('source'); 8769 let e = i.length; 8770 for (; e--; ) t.removeChild(i[e]); 8771 if ((t.removeAttribute('src'), 'function' == typeof t.load)) 8772 try { 8773 t.load(); 8774 } catch (e) {} 8775 } 8776 }), 8777 ['muted', 'defaultMuted', 'autoplay', 'controls', 'loop', 'playsinline'].forEach(function (e) { 8778 b.prototype[e] = function () { 8779 return this.el_[e] || this.el_.hasAttribute(e); 8780 }; 8781 }), 8782 ['muted', 'defaultMuted', 'autoplay', 'loop', 'playsinline'].forEach(function (t) { 8783 b.prototype['set' + m(t)] = function (e) { 8784 (this.el_[t] = e) ? this.el_.setAttribute(t, t) : this.el_.removeAttribute(t); 8785 }; 8786 }), 8787 [ 8788 'paused', 8789 'currentTime', 8790 'buffered', 8791 'volume', 8792 'poster', 8793 'preload', 8794 'error', 8795 'seeking', 8796 'seekable', 8797 'ended', 8798 'playbackRate', 8799 'defaultPlaybackRate', 8800 'disablePictureInPicture', 8801 'played', 8802 'networkState', 8803 'readyState', 8804 'videoWidth', 8805 'videoHeight', 8806 'crossOrigin' 8807 ].forEach(function (e) { 8808 b.prototype[e] = function () { 8809 return this.el_[e]; 8810 }; 8811 }), 8812 [ 8813 'volume', 8814 'src', 8815 'poster', 8816 'preload', 8817 'playbackRate', 8818 'defaultPlaybackRate', 8819 'disablePictureInPicture', 8820 'crossOrigin' 8821 ].forEach(function (t) { 8822 b.prototype['set' + m(t)] = function (e) { 8823 this.el_[t] = e; 8824 }; 8825 }), 8826 ['pause', 'load', 'play'].forEach(function (e) { 8827 b.prototype[e] = function () { 8828 return this.el_[e](); 8829 }; 8830 }),
8831 v.withSourceHandlers(b), 8832 (b.nativeSourceHandler = {}), 8833 (b.nativeSourceHandler.canPlayType = function (e) { 8834 try { 8835 return b.TEST_VID.canPlayType(e); 8836 } catch (e) { 8837 return ''; 8838 } 8839 }), 8840 (b.nativeSourceHandler.canHandleSource = function (e, t) { 8841 return e.type 8842 ? b.nativeSourceHandler.canPlayType(e.type) 8843 : e.src 8844 ? ((e = yi(e.src)), b.nativeSourceHandler.canPlayType('video/' + e)) 8845 : ''; 8846 }), 8847 (b.nativeSourceHandler.handleSource = function (e, t, i) { 8848 t.setSrc(e.src); 8849 }), 8850 (b.nativeSourceHandler.dispose = function () {}), 8851 b.registerSourceHandler(b.nativeSourceHandler), 8852 v.registerTech('Html5', b)); 8853 let vn = [ 8854 'progress', 8855 'abort', 8856 'suspend', 8857 'emptied', 8858 'stalled', 8859 'loadedmetadata', 8860 'loadeddata', 8861 'timeupdate', 8862 'resize', 8863 'volumechange', 8864 'texttrackchange' 8865 ], 8866 bn = { 8867 canplay: 'CanPlay', 8868 canplaythrough: 'CanPlayThrough', 8869 playing: 'Playing', 8870 seeked: 'Seeked' 8871 }, 8872 Tn = ['tiny', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'huge'], 8873 Sn = {}, 8874 wn = 8875 (Tn.forEach((e) => { 8876 var t = 'x' === e.charAt(0) ? 'x-' + e.substring(1) : e; 8877 Sn[e] = 'vjs-layout-' + t; 8878 }), 8879 { tiny: 210, xsmall: 320, small: 425, medium: 768, large: 1440, xlarge: 2560, huge: 1 / 0 }); 8880 class T extends g { 8881 constructor(e, i, t) { 8882 if ( 8883 ((e.id = e.id || i.id || 'vjs_video_' + lt++), 8884 ((i = Object.assign(T.getTagSettings(e), i)).initChildren = !1), 8885 (i.createEl = !1), 8886 (i.evented = !1), 8887 (i.reportTouchActivity = !1), 8888 i.language || ((s = e.closest('[lang]')) && (i.language = s.getAttribute('lang'))), 8889 super(null, i, t), 8890 (this.boundDocumentFullscreenChange_ = (e) => this.documentFullscreenChange_(e)), 8891 (this.boundFullWindowOnEscKey_ = (e) => this.fullWindowOnEscKey(e)), 8892 (this.boundUpdateStyleEl_ = (e) => this.updateStyleEl_(e)), 8893 (this.boundApplyInitTime_ = (e) => this.applyInitTime_(e)), 8894 (this.boundUpdateCurrentBreakpoint_ = (e) => this.updateCurrentBreakpoint_(e)), 8895 (this.boundHandleTechClick_ = (e) => this.handleTechClick_(e)), 8896 (this.boundHandleTechDoubleClick_ = (e) => this.handleTechDoubleClick_(e)), 8897 (this.boundHandleTechTouchStart_ = (e) => this.handleTechTouchStart_(e)), 8898 (this.boundHandleTechTouchMove_ = (e) => this.handleTechTouchMove_(e)), 8899 (this.boundHandleTechTouchEnd_ = (e) => this.handleTechTouchEnd_(e)), 8900 (this.boundHandleTechTap_ = (e) => this.handleTechTap_(e)), 8901 (this.boundUpdatePlayerHeightOnAudioOnlyMode_ = (e) => 8902 this.updatePlayerHeightOnAudioOnlyMode_(e)), 8903 (this.isFullscreen_ = !1), 8904 (this.log = W(this.id_)), 8905 (this.fsApi_ = q), 8906 (this.isPosterFromTech_ = !1), 8907 (this.queuedCallbacks_ = []), 8908 (this.isReady_ = !1), 8909 (this.hasStarted_ = !1), 8910 (this.userActive_ = !1), 8911 (this.debugEnabled_ = !1), 8912 (this.audioOnlyMode_ = !1), 8913 (this.audioPosterMode_ = !1), 8914 (this.audioOnlyCache_ = { controlBarHeight: null, playerHeight: null, hiddenChildren: [] }), 8915 !this.options_ || !this.options_.techOrder || !this.options_.techOrder.length) 8916 ) 8917 throw new Error( 8918 'No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?' 8919 ); 8920 if ( 8921 ((this.tag = e), 8922 (this.tagAttributes = e && Ne(e)), 8923 this.language(this.options_.language), 8924 i.languages) 8925 ) { 8926 let t = {}; 8927 (Object.getOwnPropertyNames(i.languages).forEach(function (e) { 8928 t[e.toLowerCase()] = i.languages[e]; 8929 }), 8930 (this.languages_ = t)); 8931 } else this.languages_ = T.prototype.options_.languages; 8932 (this.resetCache_(), 8933 (this.poster_ = i.poster || ''), 8934 (this.controls_ = !!i.controls), 8935 (e.controls = !1), 8936 e.removeAttribute('controls'), 8937 (this.changingSrc_ = !1), 8938 (this.playCallbacks_ = []), 8939 (this.playTerminatedQueue_ = []), 8940 e.hasAttribute('autoplay') ? this.autoplay(!0) : this.autoplay(this.options_.autoplay), 8941 i.plugins &&
8942 Object.keys(i.plugins).forEach((e) => { 8943 if ('function' != typeof this[e]) throw new Error(`plugin "${e}" does not exist`); 8944 }), 8945 (this.scrubbing_ = !1), 8946 (this.el_ = this.createEl()), 8947 Ot(this, { eventBusKey: 'el_' }), 8948 this.fsApi_.requestFullscreen && 8949 (mt(document, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_), 8950 this.on(this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_)), 8951 this.fluid_ && this.on(['playerreset', 'resize'], this.boundUpdateStyleEl_)); 8952 var s = d(this.options_), 8953 t = 8954 (i.plugins && 8955 Object.keys(i.plugins).forEach((e) => { 8956 this[e](i.plugins[e]); 8957 }), 8958 i.debug && this.debug(!0), 8959 (this.options_.playerOptions = s), 8960 (this.middleware_ = []), 8961 this.playbackRates(i.playbackRates), 8962 i.experimentalSvgIcons && 8963 ((t = new window.DOMParser().parseFromString( 8964
vendor: 8,123 bytes, line 8964
8964'<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-
vendor: 9,625 bytes, line 8964
89647.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',
8964 8965 'image/svg+xml' 8966 )).querySelector('parsererror') 8967 ? (o.warn('Failed to load SVG Icons. Falling back to Font Icons.'), 8968 (this.options_.experimentalSvgIcons = null)) 8969 : (((s = t.documentElement).style.display = 'none'), 8970 this.el_.appendChild(s), 8971 this.addClass('vjs-svg-icons-enabled'))), 8972 this.initChildren(), 8973 this.isAudio('audio' === e.nodeName.toLowerCase()), 8974 this.controls() 8975 ? this.addClass('vjs-controls-enabled') 8976 : this.addClass('vjs-controls-disabled'), 8977 this.el_.setAttribute('role', 'region'), 8978 this.isAudio() 8979 ? this.el_.setAttribute('aria-label', this.localize('Audio Player')) 8980 : this.el_.setAttribute('aria-label', this.localize('Video Player')), 8981 this.isAudio() && this.addClass('vjs-audio'), 8982 i.spatialNavigation && 8983 i.spatialNavigation.enabled && 8984 ((this.spatialNavigation = new Rs(this)), 8985 this.addClass('vjs-spatial-navigation-enabled')), 8986 ve && this.addClass('vjs-touch-enabled'), 8987 u || this.addClass('vjs-workinghover'), 8988 (T.players[this.id_] = this), 8989 M.split('.')[0]); 8990 (this.addClass('vjs-v' + t), 8991 this.userActive(!0), 8992 this.reportUserActivity(), 8993 this.one('play', (e) => this.listenForUserActivity_(e)), 8994 this.on('keydown', (e) => this.handleKeyDown(e)), 8995 this.on('languagechange', (e) => this.handleLanguagechange(e)), 8996 this.breakpoints(this.options_.breakpoints), 8997 this.responsive(this.options_.responsive), 8998 this.on('ready', () => { 8999 (this.audioPosterMode(this.options_.audioPosterMode), 9000 this.audioOnlyMode(this.options_.audioOnlyMode)); 9001 })); 9002 } 9003 dispose() { 9004 var e; 9005 (this.trigger('dispose'), 9006 this.off('dispose'), 9007 c(document, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_), 9008 c(document, 'keydown', this.boundFullWindowOnEscKey_), 9009 this.styleEl_ && 9010 this.styleEl_.parentNode && 9011 (this.styleEl_.parentNode.removeChild(this.styleEl_), (this.styleEl_ = null)), 9012 (T.players[this.id_] = null), 9013 this.tag && this.tag.player && (this.tag.player = null), 9014 this.el_ && this.el_.player && (this.el_.player = null), 9015 this.tech_ && (this.tech_.dispose(), (this.isPosterFromTech_ = !1), (this.poster_ = '')), 9016 this.playerElIngest_ && (this.playerElIngest_ = null), 9017 this.tag && (this.tag = null), 9018 (e = this), 9019 bs.hasOwnProperty(e.id()) && delete bs[e.id()], 9020 a.names.forEach((e) => { 9021 e = this[a[e].getterName](); 9022 e && e.off && e.off(); 9023 }), 9024 super.dispose({ restoreEl: this.options_.restoreEl })); 9025 } 9026 createEl() { 9027 let t = this.tag, 9028 i, 9029 e = (this.playerElIngest_ = 9030 t.parentNode && 9031 t.parentNode.hasAttribute && 9032 t.parentNode.hasAttribute('data-vjs-player')), 9033 s = 'video-js' === this.tag.tagName.toLowerCase(), 9034 r = 9035 (e ? (i = this.el_ = t.parentNode) : s || (i = this.el_ = super.createEl('div')), Ne(t)); 9036 if (s) { 9037 for (i = this.el_ = t, t = this.tag = document.createElement('video'); i.children.length; ) 9038 t.appendChild(i.firstChild); 9039 (De(i, 'video-js') || Pe(i, 'video-js'), 9040 i.appendChild(t), 9041 (e = this.playerElIngest_ = i),
9042 Object.keys(i).forEach((e) => { 9043 try { 9044 t[e] = i[e]; 9045 } catch (e) {} 9046 })); 9047 } 9048 (t.setAttribute('tabindex', '-1'), 9049 (r.tabindex = '-1'), 9050 le && pe && (t.setAttribute('role', 'application'), (r.role = 'application')), 9051 t.removeAttribute('width'), 9052 t.removeAttribute('height'), 9053 'width' in r && delete r.width, 9054 'height' in r && delete r.height, 9055 Object.getOwnPropertyNames(r).forEach(function (e) { 9056 ((s && 'class' === e) || i.setAttribute(e, r[e]), s && t.setAttribute(e, r[e])); 9057 }), 9058 (t.playerId = t.id), 9059 (t.id += '_html5_api'), 9060 (t.className = 'vjs-tech'), 9061 (t.player = i.player = this).addClass('vjs-paused')); 9062 var n, 9063 a = [ 9064 'IS_SMART_TV', 9065 'IS_TIZEN', 9066 'IS_WEBOS', 9067 'IS_ANDROID', 9068 'IS_IPAD', 9069 'IS_IPHONE', 9070 'IS_CHROMECAST_RECEIVER' 9071 ] 9072 .filter((e) => Se[e]) 9073 .map((e) => 'vjs-device-' + e.substring(3).toLowerCase().replace(/\_/g, '-')), 9074 o = 9075 (this.addClass(...a), 9076 !0 !== window.VIDEOJS_NO_DYNAMIC_STYLE && 9077 ((this.styleEl_ = at('vjs-styles-dimensions')), 9078 (a = Ye('.vjs-styles-defaults')), 9079 (n = Ye('head')).insertBefore(this.styleEl_, a ? a.nextSibling : n.firstChild)), 9080 (this.fill_ = !1), 9081 (this.fluid_ = !1), 9082 this.width(this.options_.width), 9083 this.height(this.options_.height), 9084 this.fill(this.options_.fill), 9085 this.fluid(this.options_.fluid), 9086 this.aspectRatio(this.options_.aspectRatio), 9087 this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin), 9088 t.getElementsByTagName('a')); 9089 for (let e = 0; e < o.length; e++) { 9090 var l = o.item(e); 9091 (Pe(l, 'vjs-hidden'), l.setAttribute('hidden', 'hidden')); 9092 } 9093 return ( 9094 (t.initNetworkState_ = t.networkState), 9095 t.parentNode && !e && t.parentNode.insertBefore(i, t), 9096 Ae(t, i), 9097 this.children_.unshift(t), 9098 this.el_.setAttribute('lang', this.language_), 9099 this.el_.setAttribute('translate', 'no'), 9100 (this.el_ = i) 9101 ); 9102 } 9103 crossOrigin(e) { 9104 if ('undefined' == typeof e) return this.techGet_('crossOrigin'); 9105 null !== e && 'anonymous' !== e && 'use-credentials' !== e 9106 ? o.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`) 9107 : (this.techCall_('setCrossOrigin', e), 9108 this.posterImage && this.posterImage.crossOrigin(e)); 9109 } 9110 width(e) { 9111 return this.dimension('width', e); 9112 } 9113 height(e) { 9114 return this.dimension('height', e); 9115 } 9116 dimension(e, t) { 9117 var i, 9118 s = e + '_'; 9119 if (void 0 === t) return this[s] || 0; 9120 '' === t || 'auto' === t 9121 ? ((this[s] = void 0), this.updateStyleEl_()) 9122 : ((i = parseFloat(t)), 9123 isNaN(i) 9124 ? o.error(`Improper value "${t}" supplied for for ` + e) 9125 : ((this[s] = i), this.updateStyleEl_())); 9126 } 9127 fluid(e) { 9128 if (void 0 === e) return !!this.fluid_; 9129 var t; 9130 ((this.fluid_ = !!e), 9131 Ct(this) && this.off(['playerreset', 'resize'], this.boundUpdateStyleEl_), 9132 e 9133 ? (this.addClass('vjs-fluid'), 9134 this.fill(!1), 9135 (e = this), 9136 (t = () => { 9137 this.on(['playerreset', 'resize'], this.boundUpdateStyleEl_); 9138 }), 9139 Ct(e) 9140 ? t() 9141 : (e.eventedCallbacks || (e.eventedCallbacks = []), e.eventedCallbacks.push(t))) 9142 : this.removeClass('vjs-fluid'), 9143 this.updateStyleEl_()); 9144 } 9145 fill(e) { 9146 if (void 0 === e) return !!this.fill_; 9147 ((this.fill_ = !!e), 9148 e ? (this.addClass('vjs-fill'), this.fluid(!1)) : this.removeClass('vjs-fill')); 9149 } 9150 aspectRatio(e) { 9151 if (void 0 === e) return this.aspectRatio_; 9152 if (!/^\d+\:\d+$/.test(e)) 9153 throw new Error( 9154 'Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.' 9155 ); 9156 ((this.aspectRatio_ = e), this.fluid(!0), this.updateStyleEl_()); 9157 } 9158 updateStyleEl_() { 9159 if (!0 === window.VIDEOJS_NO_DYNAMIC_STYLE) { 9160 let e = 'number' == typeof this.width_ ? this.width_ : this.options_.width, 9161 t = 'number' == typeof this.height_ ? this.height_ : this.options_.height; 9162 var r = this.tech_ && this.tech_.el(); 9163 void (r && (0 <= e && (r.width = e), 0 <= t) && (r.height = t)); 9164 } else { 9165 let e, t, i, s; 9166 ((r = (i = 9167 void 0 !== this.aspectRatio_ && 'auto' !== this.aspectRatio_ 9168 ? this.aspectRatio_ 9169 : 0 < this.videoWidth() 9170 ? this.videoWidth() + ':' + this.videoHeight() 9171 : '16:9').split(':')), 9172 (r = r[1] / r[0])); 9173 ((e = 9174 void 0 !== this.width_ 9175 ? this.width_ 9176 : void 0 !== this.height_ 9177 ? this.height_ / r 9178 : this.videoWidth() || 300), 9179 (t = void 0 !== this.height_ ? this.height_ : e * r), 9180 (s = /^[^a-zA-Z]/.test(this.id()) 9181 ? 'dimensions-' + this.id() 9182 : this.id() + '-dimensions'), 9183 this.addClass(s), 9184 ot( 9185 this.styleEl_, 9186 ` 9187 .${s} { 9188 width: ${e}px; 9189 height: ${t}px; 9190 } 9191 9192 .${s}.vjs-fluid:not(.vjs-audio-only-mode) { 9193 padding-top: ${100 * r}%; 9194 } 9195 ` 9196 )); 9197 } 9198 } 9199 loadTech_(e, t) { 9200 this.tech_ && this.unloadTech_(); 9201 var i = m(e), 9202 s = e.charAt(0).toLowerCase() + e.slice(1); 9203 ('Html5' !== i && 9204 this.tag && 9205 (v.getTech('Html5').disposeMediaElement(this.tag), 9206 (this.tag.player = null),
9207 (this.tag = null)), 9208 (this.techName_ = i), 9209 (this.isReady_ = !1)); 9210 let r = this.autoplay(), 9211 n = { 9212 source: t, 9213 autoplay: (r = 9214 'string' == typeof this.autoplay() || 9215 (!0 === this.autoplay() && this.options_.normalizeAutoplay) 9216 ? !1 9217 : r), 9218 nativeControlsForTouch: this.options_.nativeControlsForTouch, 9219 playerId: this.id(), 9220 techId: this.id() + `_${s}_api`, 9221 playsinline: this.options_.playsinline, 9222 preload: this.options_.preload, 9223 loop: this.options_.loop, 9224 disablePictureInPicture: this.options_.disablePictureInPicture, 9225 muted: this.options_.muted, 9226 poster: this.poster(), 9227 language: this.language(), 9228 playerElIngest: this.playerElIngest_ || !1, 9229 'vtt.js': this.options_['vtt.js'], 9230 canOverridePoster: !!this.options_.techCanOverridePoster, 9231 enableSourceset: this.options_.enableSourceset 9232 }; 9233 (a.names.forEach((e) => { 9234 e = a[e]; 9235 n[e.getterName] = this[e.privateName]; 9236 }), 9237 Object.assign(n, this.options_[i]), 9238 Object.assign(n, this.options_[s]), 9239 Object.assign(n, this.options_[e.toLowerCase()]), 9240 this.tag && (n.tag = this.tag), 9241 t && 9242 t.src === this.cache_.src && 9243 0 < this.cache_.currentTime && 9244 (n.startTime = this.cache_.currentTime)); 9245 s = v.getTech(e); 9246 if (!s) 9247 throw new Error( 9248 `No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'` 9249 ); 9250 ((this.tech_ = new s(n)), 9251 this.tech_.ready(p(this, this.handleTechReady_), !0), 9252 Zt(this.textTracksJson_ || [], this.tech_), 9253 vn.forEach((t) => { 9254 this.on(this.tech_, t, (e) => this[`handleTech${m(t)}_`](e)); 9255 }), 9256 Object.keys(bn).forEach((t) => { 9257 this.on(this.tech_, t, (e) => { 9258 0 === this.tech_.playbackRate() && this.tech_.seeking() 9259 ? this.queuedCallbacks_.push({ 9260 callback: this[`handleTech${bn[t]}_`].bind(this), 9261 event: e 9262 }) 9263 : this[`handleTech${bn[t]}_`](e); 9264 }); 9265 }), 9266 this.on(this.tech_, 'loadstart', (e) => this.handleTechLoadStart_(e)), 9267 this.on(this.tech_, 'sourceset', (e) => this.handleTechSourceset_(e)), 9268 this.on(this.tech_, 'waiting', (e) => this.handleTechWaiting_(e)), 9269 this.on(this.tech_, 'ended', (e) => this.handleTechEnded_(e)), 9270 this.on(this.tech_, 'seeking', (e) => this.handleTechSeeking_(e)), 9271 this.on(this.tech_, 'play', (e) => this.handleTechPlay_(e)), 9272 this.on(this.tech_, 'pause', (e) => this.handleTechPause_(e)), 9273 this.on(this.tech_, 'durationchange', (e) => this.handleTechDurationChange_(e)), 9274 this.on(this.tech_, 'fullscreenchange', (e, t) => this.handleTechFullscreenChange_(e, t)), 9275 this.on(this.tech_, 'fullscreenerror', (e, t) => this.handleTechFullscreenError_(e, t)), 9276 this.on(this.tech_, 'enterpictureinpicture', (e) => 9277 this.handleTechEnterPictureInPicture_(e) 9278 ), 9279 this.on(this.tech_, 'leavepictureinpicture', (e) => 9280 this.handleTechLeavePictureInPicture_(e) 9281 ), 9282 this.on(this.tech_, 'error', (e) => this.handleTechError_(e)), 9283 this.on(this.tech_, 'posterchange', (e) => this.handleTechPosterChange_(e)), 9284 this.on(this.tech_, 'textdata', (e) => this.handleTechTextData_(e)), 9285 this.on(this.tech_, 'ratechange', (e) => this.handleTechRateChange_(e)), 9286 this.on(this.tech_, 'loadedmetadata', this.boundUpdateStyleEl_), 9287 this.usingNativeControls(this.techGet_('controls')), 9288 this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(), 9289 this.tech_.el().parentNode === this.el() || 9290 ('Html5' === i && this.tag) || 9291 Ae(this.tech_.el(), this.el()), 9292 this.tag && ((this.tag.player = null), (this.tag = null))); 9293 } 9294 unloadTech_() {
9295 (a.names.forEach((e) => { 9296 e = a[e]; 9297 this[e.privateName] = this[e.getterName](); 9298 }), 9299 (this.textTracksJson_ = Jt(this.tech_)), 9300 (this.isReady_ = !1), 9301 this.tech_.dispose(), 9302 (this.tech_ = !1), 9303 this.isPosterFromTech_ && ((this.poster_ = ''), this.trigger('posterchange')), 9304 (this.isPosterFromTech_ = !1)); 9305 } 9306 tech(e) { 9307 return ( 9308 void 0 === e && 9309 o.warn( 9310 "Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n" 9311 ), 9312 this.tech_ 9313 ); 9314 } 9315 version() { 9316 return { 'video.js': M }; 9317 } 9318 addTechControlsListeners_() { 9319 (this.removeTechControlsListeners_(), 9320 this.on(this.tech_, 'click', this.boundHandleTechClick_), 9321 this.on(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_), 9322 this.on(this.tech_, 'touchstart', this.boundHandleTechTouchStart_), 9323 this.on(this.tech_, 'touchmove', this.boundHandleTechTouchMove_), 9324 this.on(this.tech_, 'touchend', this.boundHandleTechTouchEnd_), 9325 this.on(this.tech_, 'tap', this.boundHandleTechTap_)); 9326 } 9327 removeTechControlsListeners_() { 9328 (this.off(this.tech_, 'tap', this.boundHandleTechTap_), 9329 this.off(this.tech_, 'touchstart', this.boundHandleTechTouchStart_), 9330 this.off(this.tech_, 'touchmove', this.boundHandleTechTouchMove_), 9331 this.off(this.tech_, 'touchend', this.boundHandleTechTouchEnd_), 9332 this.off(this.tech_, 'click', this.boundHandleTechClick_), 9333 this.off(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_)); 9334 } 9335 handleTechReady_() { 9336 (this.triggerReady(), 9337 this.cache_.volume && this.techCall_('setVolume', this.cache_.volume), 9338 this.handleTechPosterChange_(), 9339 this.handleTechDurationChange_()); 9340 } 9341 handleTechLoadStart_() { 9342 (this.removeClass('vjs-ended', 'vjs-seeking'), 9343 this.error(null), 9344 this.handleTechDurationChange_(), 9345 this.paused() && this.hasStarted(!1), 9346 this.trigger('loadstart'), 9347 this.manualAutoplay_( 9348 !0 === this.autoplay() && this.options_.normalizeAutoplay ? 'play' : this.autoplay() 9349 )); 9350 } 9351 manualAutoplay_(t) { 9352 if (this.tech_ && 'string' == typeof t) { 9353 var i = () => { 9354 let e = this.muted(), 9355 t = 9356 (this.muted(!0), 9357 () => { 9358 this.muted(e); 9359 }); 9360 this.playTerminatedQueue_.push(t); 9361 var i = this.play(); 9362 if (Xt(i)) 9363 return i.catch((e) => { 9364 throw ( 9365 t(), 9366 new Error('Rejection at manualAutoplay. Restoring muted value. ' + (e || '')) 9367 ); 9368 }); 9369 }; 9370 let e; 9371 if ( 9372 ('any' !== t || this.muted() 9373 ? (e = 'muted' !== t || this.muted() ? this.play() : i()) 9374 : Xt((e = this.play())) && (e = e.catch(i)), 9375 Xt(e)) 9376 ) 9377 return e 9378 .then(() => { 9379 this.trigger({ type: 'autoplay-success', autoplay: t }); 9380 }) 9381 .catch(() => { 9382 this.trigger({ type: 'autoplay-failure', autoplay: t }); 9383 }); 9384 } 9385 } 9386 updateSourceCaches_(e = '') { 9387 let t = e, 9388 i = ''; 9389 ('string' != typeof t && ((t = e.src), (i = e.type)), 9390 (this.cache_.source = this.cache_.source || {}), 9391 (this.cache_.sources = this.cache_.sources || []), 9392 t && 9393 !i && 9394 (i = ((e, t) => { 9395 if (!t) return ''; 9396 if (e.cache_.source.src === t && e.cache_.source.type) return e.cache_.source.type; 9397 var i = e.cache_.sources.filter((e) => e.src === t); 9398 if (i.length) return i[0].type; 9399 var s = e.$$('source'); 9400 for (let e = 0; e < s.length; e++) { 9401 var r = s[e]; 9402 if (r.type && r.src && r.src === t) return r.type; 9403 } 9404 return Ps(t); 9405 })(this, t)), 9406 (this.cache_.source = d({}, e, { src: t, type: i }))); 9407 var e = this.cache_.sources.filter((e) => e.src && e.src === t), 9408 s = [], 9409 r = this.$$('source'), 9410 n = []; 9411 for (let e = 0; e < r.length; e++) { 9412 var a = Ne(r[e]); 9413 (s.push(a), a.src && a.src === t && n.push(a.src)); 9414 } 9415 (n.length && !e.length
9416 ? (this.cache_.sources = s) 9417 : e.length || (this.cache_.sources = [this.cache_.source]), 9418 (this.cache_.src = t)); 9419 } 9420 handleTechSourceset_(t) { 9421 if (!this.changingSrc_) { 9422 let e = (e) => this.updateSourceCaches_(e); 9423 var i = this.currentSource().src, 9424 s = t.src; 9425 ((e = 9426 !i || 9427 /^blob:/.test(i) || 9428 !/^blob:/.test(s) || 9429 (this.lastSource_ && (this.lastSource_.tech === s || this.lastSource_.player === i)) 9430 ? e 9431 : () => {})(s), 9432 t.src || 9433 this.tech_.any(['sourceset', 'loadstart'], (e) => { 9434 'sourceset' !== e.type && 9435 ((e = this.techGet_('currentSrc')), 9436 (this.lastSource_.tech = e), 9437 this.updateSourceCaches_(e)); 9438 })); 9439 } 9440 ((this.lastSource_ = { player: this.currentSource().src, tech: t.src }), 9441 this.trigger({ src: t.src, type: 'sourceset' })); 9442 } 9443 hasStarted(e) { 9444 if (void 0 === e) return this.hasStarted_; 9445 e !== this.hasStarted_ && 9446 ((this.hasStarted_ = e), 9447 this.hasStarted_ ? this.addClass('vjs-has-started') : this.removeClass('vjs-has-started')); 9448 } 9449 handleTechPlay_() { 9450 (this.removeClass('vjs-ended', 'vjs-paused'), 9451 this.addClass('vjs-playing'), 9452 this.hasStarted(!0), 9453 this.trigger('play')); 9454 } 9455 handleTechRateChange_() { 9456 (0 < this.tech_.playbackRate() && 9457 0 === this.cache_.lastPlaybackRate && 9458 (this.queuedCallbacks_.forEach((e) => e.callback(e.event)), (this.queuedCallbacks_ = [])), 9459 (this.cache_.lastPlaybackRate = this.tech_.playbackRate()), 9460 this.trigger('ratechange')); 9461 } 9462 handleTechWaiting_() { 9463 (this.addClass('vjs-waiting'), this.trigger('waiting')); 9464 let e = this.currentTime(), 9465 t = () => { 9466 e !== this.currentTime() && (this.removeClass('vjs-waiting'), this.off('timeupdate', t)); 9467 }; 9468 this.on('timeupdate', t); 9469 } 9470 handleTechCanPlay_() { 9471 (this.removeClass('vjs-waiting'), this.trigger('canplay')); 9472 } 9473 handleTechCanPlayThrough_() { 9474 (this.removeClass('vjs-waiting'), this.trigger('canplaythrough')); 9475 } 9476 handleTechPlaying_() { 9477 (this.removeClass('vjs-waiting'), this.trigger('playing')); 9478 } 9479 handleTechSeeking_() { 9480 (this.addClass('vjs-seeking'), this.trigger('seeking')); 9481 } 9482 handleTechSeeked_() { 9483 (this.removeClass('vjs-seeking', 'vjs-ended'), this.trigger('seeked')); 9484 } 9485 handleTechPause_() { 9486 (this.removeClass('vjs-playing'), this.addClass('vjs-paused'), this.trigger('pause')); 9487 } 9488 handleTechEnded_() { 9489 (this.addClass('vjs-ended'), 9490 this.removeClass('vjs-waiting'), 9491 this.options_.loop ? (this.currentTime(0), this.play()) : this.paused() || this.pause(), 9492 this.trigger('ended')); 9493 } 9494 handleTechDurationChange_() { 9495 this.duration(this.techGet_('duration')); 9496 } 9497 handleTechClick_(e) { 9498 !this.controls_ || 9499 (void 0 !== this.options_ && 9500 void 0 !== this.options_.userActions && 9501 void 0 !== this.options_.userActions.click && 9502 !1 === this.options_.userActions.click) || 9503 (void 0 !== this.options_ && 9504 void 0 !== this.options_.userActions && 9505 'function' == typeof this.options_.userActions.click 9506 ? this.options_.userActions.click.call(this, e) 9507 : this.paused() 9508 ? Kt(this.play()) 9509 : this.pause()); 9510 } 9511 handleTechDoubleClick_(t) { 9512 !this.controls_ || 9513 Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'), (e) => 9514 e.contains(t.target) 9515 ) || 9516 (void 0 !== this.options_ && 9517 void 0 !== this.options_.userActions && 9518 void 0 !== this.options_.userActions.doubleClick && 9519 !1 === this.options_.userActions.doubleClick) || 9520 (void 0 !== this.options_ && 9521 void 0 !== this.options_.userActions && 9522 'function' == typeof this.options_.userActions.doubleClick 9523 ? this.options_.userActions.doubleClick.call(this, t) 9524 : this.isInPictureInPicture() && !document.pictureInPictureElement 9525 ? this.exitPictureInPicture() 9526 : this.isFullscreen() 9527 ? this.exitFullscreen() 9528 : this.requestFullscreen()); 9529 } 9530 handleTechTap_() { 9531 this.userActive(!this.userActive()); 9532 } 9533 handleTechTouchStart_() { 9534 this.userWasActive = this.userActive(); 9535 } 9536 handleTechTouchMove_() { 9537 this.userWasActive && this.reportUserActivity(); 9538 } 9539 handleTechTouchEnd_(e) { 9540 e.cancelable && e.preventDefault(); 9541 } 9542 toggleFullscreenClass_() { 9543 this.isFullscreen() ? this.addClass('vjs-fullscreen') : this.removeClass('vjs-fullscreen'); 9544 } 9545 documentFullscreenChange_(t) { 9546 t = t.target.player; 9547 if (!t || t === this) { 9548 t = this.el(); 9549 let e = document[this.fsApi_.fullscreenElement] === t; 9550 (!e && t.matches && (e = t.matches(':' + this.fsApi_.fullscreen)), this.isFullscreen(e)); 9551 } 9552 } 9553 handleTechFullscreenChange_(e, t) { 9554 t && 9555 (t.nativeIOSFullscreen && 9556 (this.addClass('vjs-ios-native-fs'), 9557 this.tech_.one('webkitendfullscreen', () => { 9558 this.removeClass('vjs-ios-native-fs'); 9559 })), 9560 this.isFullscreen(t.isFullscreen)); 9561 } 9562 handleTechFullscreenError_(e, t) { 9563 this.trigger('fullscreenerror', t); 9564 } 9565 togglePictureInPictureClass_() { 9566 this.isInPictureInPicture() 9567 ? this.addClass('vjs-picture-in-picture') 9568 : this.removeClass('vjs-picture-in-picture'); 9569 } 9570 handleTechEnterPictureInPicture_(e) { 9571 this.isInPictureInPicture(!0); 9572 } 9573 handleTechLeavePictureInPicture_(e) { 9574 this.isInPictureInPicture(!1); 9575 } 9576 handleTechError_() { 9577 var e = this.tech_.error(); 9578 e && this.error(e); 9579 } 9580 handleTechTextData_() { 9581 let e = 1 < arguments.length ? arguments[1] : null; 9582 this.trigger('textdata', e); 9583 } 9584 getCache() { 9585 return this.cache_; 9586 } 9587 resetCache_() { 9588 this.cache_ = { 9589 currentTime: 0, 9590 initTime: 0, 9591 inactivityTimeout: this.options_.inactivityTimeout, 9592 duration: NaN, 9593 lastVolume: 1, 9594 lastPlaybackRate: this.defaultPlaybackRate(), 9595 media: null, 9596 src: '', 9597 source: {}, 9598 sources: [], 9599 playbackRates: [], 9600 volume: 1 9601 }; 9602 } 9603 techCall_(t, i) { 9604 this.ready(function () { 9605 if (t in Cs) return ((e = this.middleware_), this.tech_[t](e.reduce(Is(t), i))); 9606 if (t in ks) return ws(this.middleware_, this.tech_, t, i); 9607 var e; 9608 try { 9609 this.tech_ && this.tech_[t](i); 9610 } catch (e) { 9611 throw (o(e), e); 9612 } 9613 }, !0); 9614 } 9615 techGet_(t) { 9616 if (this.tech_ && this.tech_.isReady_) { 9617 if (t in Es) 9618 return ((e = this.middleware_), (i = this.tech_), e.reduceRight(Is(t), i[t]())); 9619 if (t in ks) return ws(this.middleware_, this.tech_, t); 9620 var e, i; 9621 try { 9622 return this.tech_[t](); 9623 } catch (e) { 9624 throw ( 9625 void 0 === this.tech_[t] 9626 ? o(`Video.js: ${t} method not defined for ${this.techName_} playback technology.`, e) 9627 : 'TypeError' === e.name 9628 ? (o( 9629 `Video.js: ${t} unavailable on ${this.techName_} playback technology element.`, 9630 e 9631 ), 9632 (this.tech_.isReady_ = !1)) 9633 : o(e), 9634 e 9635 ); 9636 } 9637 } 9638 } 9639 play() { 9640 return new Promise((e) => { 9641 this.play_(e); 9642 }); 9643 } 9644 play_(e = Kt) { 9645 this.playCallbacks_.push(e); 9646 var t, 9647 e = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc())), 9648 i = Boolean(Te || u); 9649 (this.waitToPlay_ && 9650 (this.off(['ready', 'loadstart'], this.waitToPlay_), (this.waitToPlay_ = null)), 9651 this.isReady_ && e 9652 ? ((t = this.techGet_('play')), 9653 i && this.hasClass('vjs-ended') && this.resetProgressBar_(), 9654 null === t ? this.runPlayTerminatedQueue_() : this.runPlayCallbacks_(t)) 9655 : ((this.waitToPlay_ = (e) => { 9656 this.play_(); 9657 }), 9658 this.one(['ready', 'loadstart'], this.waitToPlay_), 9659 !e && i && this.load())); 9660 } 9661 runPlayTerminatedQueue_() { 9662 var e = this.playTerminatedQueue_.slice(0); 9663 ((this.playTerminatedQueue_ = []), 9664 e.forEach(function (e) { 9665 e(); 9666 })); 9667 } 9668 runPlayCallbacks_(t) { 9669 var e = this.playCallbacks_.slice(0); 9670 ((this.playCallbacks_ = []), 9671 (this.playTerminatedQueue_ = []), 9672 e.forEach(function (e) { 9673 e(t); 9674 })); 9675 } 9676 pause() { 9677 this.techCall_('pause'); 9678 } 9679 paused() { 9680 return !1 !== this.techGet_('paused'); 9681 } 9682 played() { 9683 return this.techGet_('played') || jt(0, 0); 9684 } 9685 scrubbing(e) { 9686 if ('undefined' == typeof e) return this.scrubbing_; 9687 ((this.scrubbing_ = !!e), 9688 this.techCall_('setScrubbing', this.scrubbing_), 9689 e ? this.addClass('vjs-scrubbing') : this.removeClass('vjs-scrubbing')); 9690 } 9691 currentTime(e) { 9692 if (void 0 === e) 9693 return ( 9694 (this.cache_.currentTime = this.techGet_('currentTime') || 0), 9695 this.cache_.currentTime 9696 ); 9697 (e < 0 && (e = 0), 9698 this.isReady_ && !this.changingSrc_ && this.tech_ && this.tech_.isReady_ 9699 ? (this.techCall_('setCurrentTime', e), 9700 (this.cache_.initTime = 0), 9701 isFinite(e) && (this.cache_.currentTime = Number(e))) 9702 : ((this.cache_.initTime = e), 9703 this.off('canplay', this.boundApplyInitTime_), 9704 this.one('canplay', this.boundApplyInitTime_))); 9705 } 9706 applyInitTime_() { 9707 this.currentTime(this.cache_.initTime); 9708 } 9709 duration(e) { 9710 if (void 0 === e) return void 0 !== this.cache_.duration ? this.cache_.duration : NaN; 9711 (e = (e = parseFloat(e)) < 0 ? 1 / 0 : e) !== this.cache_.duration && 9712 ((this.cache_.duration = e) === 1 / 0 9713 ? this.addClass('vjs-live') 9714 : this.removeClass('vjs-live'), 9715 isNaN(e) || this.trigger('durationchange')); 9716 } 9717 remainingTime() { 9718 return this.duration() - this.currentTime(); 9719 } 9720 remainingTimeDisplay() { 9721 return Math.floor(this.duration()) - Math.floor(this.currentTime()); 9722 } 9723 buffered() { 9724 let e = this.techGet_('buffered'); 9725 return (e = e && e.length ? e : jt(0, 0)); 9726 } 9727 seekable() { 9728 let e = this.techGet_('seekable'); 9729 return (e = e && e.length ? e : jt(0, 0)); 9730 } 9731 seeking() { 9732 return this.techGet_('seeking'); 9733 } 9734 ended() { 9735 return this.techGet_('ended'); 9736 } 9737 networkState() { 9738 return this.techGet_('networkState'); 9739 } 9740 readyState() { 9741 return this.techGet_('readyState'); 9742 } 9743 bufferedPercent() { 9744 return Gt(this.buffered(), this.duration()); 9745 } 9746 bufferedEnd() { 9747 var e = this.buffered(), 9748 t = this.duration(); 9749 let i = e.end(e.length - 1); 9750 return (i = i > t ? t : i); 9751 } 9752 volume(e) { 9753 let t; 9754 if (void 0 === e) return ((t = parseFloat(this.techGet_('volume'))), isNaN(t) ? 1 : t); 9755 ((t = Math.max(0, Math.min(1, e))), 9756 (this.cache_.volume = t), 9757 this.techCall_('setVolume', t), 9758 0 < t && this.lastVolume_(t)); 9759 } 9760 muted(e) { 9761 if (void 0 === e) return this.techGet_('muted') || !1; 9762 this.techCall_('setMuted', e); 9763 } 9764 defaultMuted(e) { 9765 return ( 9766 void 0 !== e && this.techCall_('setDefaultMuted', e), 9767 this.techGet_('defaultMuted') || !1 9768 ); 9769 } 9770 lastVolume_(e) { 9771 if (void 0 === e || 0 === e) return this.cache_.lastVolume; 9772 this.cache_.lastVolume = e; 9773 } 9774 supportsFullScreen() { 9775 return this.techGet_('supportsFullScreen') || !1; 9776 } 9777 isFullscreen(e) { 9778 var t; 9779 if (void 0 === e) return this.isFullscreen_; 9780 ((t = this.isFullscreen_), 9781 (this.isFullscreen_ = Boolean(e)), 9782 this.isFullscreen_ !== t && this.fsApi_.prefixed && this.trigger('fullscreenchange'), 9783 this.toggleFullscreenClass_()); 9784 } 9785 requestFullscreen(a) { 9786 this.isInPictureInPicture() && this.exitPictureInPicture(); 9787 let o = this; 9788 return new Promise((e, i) => { 9789 function s() { 9790 (o.off('fullscreenerror', r), o.off('fullscreenchange', t)); 9791 } 9792 function t() { 9793 (s(), e()); 9794 } 9795 function r(e, t) { 9796 (s(), i(t)); 9797 } 9798 (o.one('fullscreenchange', t), o.one('fullscreenerror', r)); 9799 var n = o.requestFullscreenHelper_(a); 9800 n && (n.then(s, s), n.then(e, i)); 9801 }); 9802 } 9803 requestFullscreenHelper_(e) { 9804 let t; 9805 if ( 9806 (this.fsApi_.prefixed || 9807 ((t = (this.options_.fullscreen && this.options_.fullscreen.options) || {}), 9808 void 0 !== e && (t = e)), 9809 this.fsApi_.requestFullscreen) 9810 ) 9811 return ( 9812 (e = this.el_[this.fsApi_.requestFullscreen](t)) && 9813 e.then( 9814 () => this.isFullscreen(!0), 9815 () => this.isFullscreen(!1) 9816 ), 9817 e 9818 ); 9819 this.tech_.supportsFullScreen() && !0 == !this.options_.preferFullWindow 9820 ? this.techCall_('enterFullScreen') 9821 : this.enterFullWindow(); 9822 } 9823 exitFullscreen() { 9824 let a = this; 9825 return new Promise((e, i) => { 9826 function s() { 9827 (a.off('fullscreenerror', r), a.off('fullscreenchange', t)); 9828 } 9829 function t() { 9830 (s(), e()); 9831 } 9832 function r(e, t) { 9833 (s(), i(t)); 9834 } 9835 (a.one('fullscreenchange', t), a.one('fullscreenerror', r)); 9836 var n = a.exitFullscreenHelper_(); 9837 n && (n.then(s, s), n.then(e, i)); 9838 }); 9839 } 9840 exitFullscreenHelper_() { 9841 var e; 9842 if (this.fsApi_.requestFullscreen) 9843 return ( 9844 (e = document[this.fsApi_.exitFullscreen]()) && Kt(e.then(() => this.isFullscreen(!1))), 9845 e 9846 ); 9847 this.tech_.supportsFullScreen() && !0 == !this.options_.preferFullWindow 9848 ? this.techCall_('exitFullScreen') 9849 : this.exitFullWindow(); 9850 } 9851 enterFullWindow() { 9852 (this.isFullscreen(!0), 9853 (this.isFullWindow = !0), 9854 (this.docOrigOverflow = document.documentElement.style.overflow), 9855 mt(document, 'keydown', this.boundFullWindowOnEscKey_), 9856 (document.documentElement.style.overflow = 'hidden'),
9857 Pe(document.body, 'vjs-full-window'), 9858 this.trigger('enterFullWindow')); 9859 } 9860 fullWindowOnEscKey(e) { 9861 'Escape' === e.key && 9862 !0 === this.isFullscreen() && 9863 (this.isFullWindow ? this.exitFullWindow() : this.exitFullscreen()); 9864 } 9865 exitFullWindow() { 9866 (this.isFullscreen(!1), 9867 (this.isFullWindow = !1), 9868 c(document, 'keydown', this.boundFullWindowOnEscKey_), 9869 (document.documentElement.style.overflow = this.docOrigOverflow), 9870 Le(document.body, 'vjs-full-window'), 9871 this.trigger('exitFullWindow')); 9872 } 9873 disablePictureInPicture(e) { 9874 if (void 0 === e) return this.techGet_('disablePictureInPicture'); 9875 (this.techCall_('setDisablePictureInPicture', e), 9876 (this.options_.disablePictureInPicture = e), 9877 this.trigger('disablepictureinpicturechanged')); 9878 } 9879 isInPictureInPicture(e) { 9880 if (void 0 === e) return !!this.isInPictureInPicture_; 9881 ((this.isInPictureInPicture_ = !!e), this.togglePictureInPictureClass_()); 9882 } 9883 requestPictureInPicture() { 9884 if (this.options_.enableDocumentPictureInPicture && window.documentPictureInPicture) { 9885 let t = document.createElement(this.el().tagName); 9886 return ( 9887 (t.classList = this.el().classList), 9888 t.classList.add('vjs-pip-container'), 9889 this.posterImage && t.appendChild(this.posterImage.el().cloneNode(!0)), 9890 this.titleBar && t.appendChild(this.titleBar.el().cloneNode(!0)), 9891 t.appendChild( 9892 l( 9893 'p', 9894 { className: 'vjs-pip-text' }, 9895 {}, 9896 this.localize('Playing in picture-in-picture') 9897 ) 9898 ), 9899 window.documentPictureInPicture 9900 .requestWindow({ width: this.videoWidth(), height: this.videoHeight() }) 9901 .then( 9902 (e) => ( 9903 Ze(e), 9904 this.el_.parentNode.insertBefore(t, this.el_), 9905 e.document.body.appendChild(this.el_), 9906 e.document.body.classList.add('vjs-pip-window'), 9907 this.player_.isInPictureInPicture(!0), 9908 this.player_.trigger({ type: 'enterpictureinpicture', pipWindow: e }), 9909 e.addEventListener('pagehide', (e) => { 9910 e = e.target.querySelector('.video-js'); 9911 (t.parentNode.replaceChild(e, t), 9912 this.player_.isInPictureInPicture(!1), 9913 this.player_.trigger('leavepictureinpicture')); 9914 }), 9915 e 9916 ) 9917 ) 9918 ); 9919 } 9920 return 'pictureInPictureEnabled' in document && !1 === this.disablePictureInPicture() 9921 ? this.techGet_('requestPictureInPicture') 9922 : Promise.reject('No PiP mode is available'); 9923 } 9924 exitPictureInPicture() { 9925 return window.documentPictureInPicture && window.documentPictureInPicture.window 9926 ? (window.documentPictureInPicture.window.close(), Promise.resolve()) 9927 : 'pictureInPictureEnabled' in document 9928 ? document.exitPictureInPicture() 9929 : void 0; 9930 } 9931 handleKeyDown(e) { 9932 var t, 9933 i, 9934 s = this.options_.userActions; 9935 s && 9936 s.hotkeys && 9937 ((t = this.el_.ownerDocument.activeElement), 9938 (i = t.tagName.toLowerCase()), 9939 t.isContentEditable || 9940 ('input' === i 9941 ? -1 === ['button', 'checkbox', 'hidden', 'radio', 'reset', 'submit'].indexOf(t.type) 9942 : -1 !== ['textarea'].indexOf(i)) || 9943 ('function' == typeof s.hotkeys ? s.hotkeys.call(this, e) : this.handleHotkeys(e))); 9944 } 9945 handleHotkeys(t) { 9946 var { 9947 fullscreenKey: e = (e) => 'f' === t.key.toLowerCase(), 9948 muteKey: i = (e) => 'm' === t.key.toLowerCase(), 9949 playPauseKey: s = (e) => 'k' === t.key.toLowerCase() || ' ' === t.key.toLowerCase() 9950 } = this.options_.userActions ? this.options_.userActions.hotkeys : {}; 9951 e.call(this, t) 9952 ? (t.preventDefault(), 9953 t.stopPropagation(), 9954 (e = g.getComponent('FullscreenToggle')), 9955 !1 !== document[this.fsApi_.fullscreenEnabled] && e.prototype.handleClick.call(this, t)) 9956 : i.call(this, t) 9957 ? (t.preventDefault(), 9958 t.stopPropagation(), 9959 g.getComponent('MuteToggle').prototype.handleClick.call(this, t)) 9960 : s.call(this, t) && 9961 (t.preventDefault(), 9962 t.stopPropagation(), 9963 g.getComponent('PlayToggle').prototype.handleClick.call(this, t)); 9964 } 9965 canPlayType(s) { 9966 var r; 9967 for (let t = 0, i = this.options_.techOrder; t < i.length; t++) { 9968 var n = i[t]; 9969 let e = v.getTech(n); 9970 if ((e = e || g.getComponent(n))) { 9971 if (e.isSupported() && (r = e.canPlayType(s))) return r; 9972 } else 9973 o.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`); 9974 } 9975 return ''; 9976 } 9977 selectSource(e) { 9978 function t(e, i, s) { 9979 let r; 9980 return ( 9981 e.some((t) => 9982 i.some((e) => { 9983 if ((r = s(t, e))) return !0; 9984 }) 9985 ), 9986 r 9987 ); 9988 } 9989 var i = this.options_.techOrder 9990 .map((e) => [e, v.getTech(e)]) 9991 .filter(([e, t]) => 9992 t 9993 ? t.isSupported() 9994 : (o.error( 9995 `The "${e}" tech is undefined. Skipped browser support check for that tech.` 9996 ), 9997 !1) 9998 ); 9999 let s; 10000 var r, 10001 n = ([e, t], i) => { 10002 if (t.canPlaySource(i, this.options_[e.toLowerCase()])) return { source: i, tech: e }; 10003 }; 10004 return ( 10005 (s = this.options_.sourceOrder ? t(e, i, ((r = n), (e, t) => r(t, e))) : t(i, e, n)) || !1 10006 ); 10007 } 10008 handleSrc_(e, s) { 10009 if ('undefined' == typeof e) return this.cache_.src || ''; 10010 this.resetRetryOnError_ && this.resetRetryOnError_(); 10011 let r = As(e); 10012 if (r.length) { 10013 if ( 10014 ((this.changingSrc_ = !0), 10015 s || (this.cache_.sources = r), 10016 this.updateSourceCaches_(r[0]), 10017 Ss(this, r[0], (e, t) => { 10018 var i; 10019 if ( 10020 ((this.middleware_ = t), 10021 s || (this.cache_.sources = r), 10022 this.updateSourceCaches_(e), 10023 this.src_(e)) 10024 ) 10025 return 1 < r.length 10026 ? this.handleSrc_(r.slice(1)) 10027 : ((this.changingSrc_ = !1), 10028 this.setTimeout(function () { 10029 this.error({ code: 4, message: this.options_.notSupportedMessage }); 10030 }, 0), 10031 void this.triggerReady()); 10032 ((i = this.tech_), t.forEach((e) => e.setTech && e.setTech(i))); 10033 }), 10034 1 < r.length) 10035 ) { 10036 let e = () => { 10037 (this.error(null), this.handleSrc_(r.slice(1), !0)); 10038 }, 10039 t = () => { 10040 this.off('error', e); 10041 }; 10042 (this.one('error', e), 10043 this.one('playing', t), 10044 (this.resetRetryOnError_ = () => { 10045 (this.off('error', e), this.off('playing', t)); 10046 })); 10047 } 10048 } else 10049 this.setTimeout(function () { 10050 this.error({ code: 4, message: this.options_.notSupportedMessage }); 10051 }, 0); 10052 } 10053 src(e) { 10054 return this.handleSrc_(e, !1); 10055 } 10056 src_(e) { 10057 var t = this.selectSource([e]); 10058 return ( 10059 !t || 10060 (Ut(t.tech, this.techName_) 10061 ? this.ready(function () { 10062 (this.tech_.constructor.prototype.hasOwnProperty('setSource') 10063 ? this.techCall_('setSource', e) 10064 : this.techCall_('src', e.src), 10065 (this.changingSrc_ = !1)); 10066 }, !0) 10067 : ((this.changingSrc_ = !0), 10068 this.loadTech_(t.tech, t.source), 10069 this.tech_.ready(() => { 10070 this.changingSrc_ = !1; 10071 })), 10072 !1) 10073 ); 10074 } 10075 addSourceElement(e, t) { 10076 return !!this.tech_ && this.tech_.addSourceElement(e, t); 10077 } 10078 removeSourceElement(e) { 10079 return !!this.tech_ && this.tech_.removeSourceElement(e); 10080 } 10081 load() { 10082 this.tech_ && this.tech_.vhs ? this.src(this.currentSource()) : this.techCall_('load'); 10083 } 10084 reset() { 10085 this.paused() ? this.doReset_() : Kt(this.play().then(() => this.doReset_())); 10086 } 10087 doReset_() { 10088 (this.tech_ && this.tech_.clearTracks('text'), 10089 this.removeClass('vjs-playing'), 10090 this.addClass('vjs-paused'), 10091 this.resetCache_(), 10092 this.poster(''), 10093 this.loadTech_(this.options_.techOrder[0], null), 10094 this.techCall_('reset'), 10095 this.resetControlBarUI_(), 10096 this.error(null), 10097 this.titleBar && this.titleBar.update({ title: void 0, description: void 0 }), 10098 Ct(this) && this.trigger('playerreset')); 10099 } 10100 resetControlBarUI_() { 10101 (this.resetProgressBar_(), this.resetPlaybackRate_(), this.resetVolumeBar_()); 10102 } 10103 resetProgressBar_() { 10104 this.currentTime(0); 10105 var { 10106 currentTimeDisplay: e, 10107 durationDisplay: t, 10108 progressControl: i, 10109 remainingTimeDisplay: s 10110 } = this.controlBar || {}, 10111 i = (i || {}).seekBar; 10112 (e && e.updateContent(), 10113 t && t.updateContent(), 10114 s && s.updateContent(), 10115 i && (i.update(), i.loadProgressBar) && i.loadProgressBar.update(
10115)); 10116 } 10117 resetPlaybackRate_() { 10118 (this.playbackRate(this.defaultPlaybackRate()), this.handleTechRateChange_()); 10119 } 10120 resetVolumeBar_() { 10121 (this.volume(1), this.trigger('volumechange')); 10122 } 10123 currentSources() { 10124 var e = this.currentSource(), 10125 t = []; 10126 return (0 !== Object.keys(e).length && t.push(e), this.cache_.sources || t); 10127 } 10128 currentSource() { 10129 return this.cache_.source || {}; 10130 } 10131 currentSrc() { 10132 return (this.currentSource() && this.currentSource().src) || ''; 10133 } 10134 currentType() { 10135 return (this.currentSource() && this.currentSource().type) || ''; 10136 } 10137 preload(e) { 10138 if (void 0 === e) return this.techGet_('preload'); 10139 (this.techCall_('setPreload', e), (this.options_.preload = e)); 10140 } 10141 autoplay(e) { 10142 if (void 0 === e) return this.options_.autoplay || !1; 10143 let t; 10144 (('string' == typeof e && /(any|play|muted)/.test(e)) || 10145 (!0 === e && this.options_.normalizeAutoplay) 10146 ? ((this.options_.autoplay = e), 10147 this.manualAutoplay_('string' == typeof e ? e : 'play'), 10148 (t = !1)) 10149 : (this.options_.autoplay = !!e), 10150 (t = 'undefined' == typeof t ? this.options_.autoplay : t), 10151 this.tech_ && this.techCall_('setAutoplay', t)); 10152 } 10153 playsinline(e) { 10154 return ( 10155 void 0 !== e && (this.techCall_('setPlaysinline', e), (this.options_.playsinline = e)), 10156 this.techGet_('playsinline') 10157 ); 10158 } 10159 loop(e) { 10160 if (void 0 === e) return this.techGet_('loop'); 10161 (this.techCall_('setLoop', e), (this.options_.loop = e)); 10162 } 10163 poster(e) { 10164 if (void 0 === e) return this.poster_; 10165 (e = e || '') !== this.poster_ && 10166 ((this.poster_ = e), 10167 this.techCall_('setPoster', e), 10168 (this.isPosterFromTech_ = !1), 10169 this.trigger('posterchange')); 10170 } 10171 handleTechPosterChange_() { 10172 var e; 10173 (!this.poster_ || this.options_.techCanOverridePoster) && 10174 this.tech_ && 10175 this.tech_.poster && 10176 (e = this.tech_.poster() || '') !== this.poster_ && 10177 ((this.poster_ = e), (this.isPosterFromTech_ = !0), this.trigger('posterchange')); 10178 } 10179 controls(e) { 10180 if (void 0 === e) return !!this.controls_; 10181 this.controls_ !== (e = !!e) && 10182 ((this.controls_ = e), 10183 this.usingNativeControls() && this.techCall_('setControls', e), 10184 this.controls_ 10185 ? (this.removeClass('vjs-controls-disabled'), 10186 this.addClass('vjs-controls-enabled'), 10187 this.trigger('controlsenabled'), 10188 this.usingNativeControls() || this.addTechControlsListeners_()) 10189 : (this.removeClass('vjs-controls-enabled'), 10190 this.addClass('vjs-controls-disabled'), 10191 this.trigger('controlsdisabled'), 10192 this.usingNativeControls() || this.removeTechControlsListeners_())); 10193 } 10194 usingNativeControls(e) { 10195 if (void 0 === e) return !!this.usingNativeControls_; 10196 this.usingNativeControls_ !== (e = !!e) && 10197 ((this.usingNativeControls_ = e), 10198 this.usingNativeControls_ 10199 ? (this.addClass('vjs-using-native-controls'), this.trigger('usingnativecontrols')) 10200 : (this.removeClass('vjs-using-native-controls'), this.trigger('usingcustomcontrols'))); 10201 } 10202 error(t) { 10203 if (void 0 === t) return this.error_ || null; 10204 if ( 10205 (B('beforeerror').forEach((e) => { 10206 e = e(this, t); 10207 (Y(e) && !Array.isArray(e)) || 'string' == typeof e || 'number' == typeof e || null === e 10208 ? (t = e) 10209 : this.log.error('please return a value that MediaError expects in beforeerror hooks'); 10210 }), 10211 this.options_.suppressNotSupportedError && t && 4 === t.code) 10212 ) { 10213 let e = function () { 10214 this.error(t); 10215 }; 10216 ((this.options_.suppressNotSupportedError = !1), 10217 this.any(['click', 'touchstart'], e), 10218 void this.one('loadstart', function () { 10219 this.off(['click', 'touchstart'], e); 10220 })); 10221 } else 10222 null === t 10223 ? ((this.error_ = null),
10224 this.removeClass('vjs-error'), 10225 this.errorDisplay && this.errorDisplay.close()) 10226 : ((this.error_ = new i(t)), 10227 this.addClass('vjs-error'), 10228 o.error( 10229 `(CODE:${this.error_.code} ${i.errorTypes[this.error_.code]})`, 10230 this.error_.message, 10231 this.error_ 10232 ), 10233 this.trigger('error'), 10234 B('error').forEach((e) => e(this, this.error_))); 10235 } 10236 reportUserActivity(e) { 10237 this.userActivity_ = !0; 10238 } 10239 userActive(e) { 10240 if (void 0 === e) return this.userActive_; 10241 (e = !!e) !== this.userActive_ && 10242 ((this.userActive_ = e), 10243 this.userActive_ 10244 ? ((this.userActivity_ = !0), 10245 this.removeClass('vjs-user-inactive'), 10246 this.addClass('vjs-user-active'), 10247 this.trigger('useractive')) 10248 : (this.tech_ && 10249 this.tech_.one('mousemove', function (e) { 10250 (e.stopPropagation(), e.preventDefault()); 10251 }), 10252 (this.userActivity_ = !1), 10253 this.removeClass('vjs-user-active'), 10254 this.addClass('vjs-user-inactive'), 10255 this.trigger('userinactive'))); 10256 } 10257 listenForUserActivity_() { 10258 let t, 10259 i, 10260 s, 10261 r = p(this, this.reportUserActivity); 10262 function e(e) { 10263 (r(), this.clearInterval(t)); 10264 } 10265 (this.on('mousedown', function () { 10266 (r(), this.clearInterval(t), (t = this.setInterval(r, 250))); 10267 }), 10268 this.on('mousemove', function (e) { 10269 (e.screenX === i && e.screenY === s) || ((i = e.screenX), (s = e.screenY), r()); 10270 }), 10271 this.on('mouseup', e), 10272 this.on('mouseleave', e)); 10273 var n = this.getChild('controlBar'); 10274 (!n || 10275 u || 10276 se || 10277 (n.on('mouseenter', function (e) { 10278 (0 !== this.player().options_.inactivityTimeout && 10279 (this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout), 10280 (this.player().options_.inactivityTimeout = 0)); 10281 }), 10282 n.on('mouseleave', function (e) { 10283 this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout; 10284 })), 10285 this.on('keydown', r), 10286 this.on('keyup', r)); 10287 let a; 10288 this.setInterval(function () { 10289 var e; 10290 this.userActivity_ && 10291 ((this.userActivity_ = !1), 10292 this.userActive(!0), 10293 this.clearTimeout(a), 10294 (e = this.options_.inactivityTimeout) <= 0 || 10295 (a = this.setTimeout(function () { 10296 this.userActivity_ || this.userActive(!1); 10297 }, e))); 10298 }, 250); 10299 } 10300 playbackRate(e) { 10301 if (void 0 === e) 10302 return this.tech_ && this.tech_.featuresPlaybackRate 10303 ? this.cache_.lastPlaybackRate || this.techGet_('playbackRate') 10304 : 1; 10305 this.techCall_('setPlaybackRate', e); 10306 } 10307 defaultPlaybackRate(e) { 10308 return void 0 !== e 10309 ? this.techCall_('setDefaultPlaybackRate', e) 10310 : this.tech_ && this.tech_.featuresPlaybackRate 10311 ? this.techGet_('defaultPlaybackRate') 10312 : 1; 10313 } 10314 isAudio(e) { 10315 if (void 0 === e) return !!this.isAudio_; 10316 this.isAudio_ = !!e; 10317 } 10318 updatePlayerHeightOnAudioOnlyMode_() { 10319 var e = this.getChild('ControlBar'); 10320 e && 10321 this.audioOnlyCache_.controlBarHeight !== e.currentHeight() && 10322 ((this.audioOnlyCache_.controlBarHeight = e.currentHeight()), 10323 this.height(this.audioOnlyCache_.controlBarHeight)); 10324 } 10325 enableAudioOnlyUI_() { 10326 this.addClass('vjs-audio-only-mode'); 10327 var e = this.children(); 10328 let t = this.getChild('ControlBar'); 10329 var i = t && t.currentHeight(); 10330 (e.forEach((e) => { 10331 e !== t && 10332 e.el_ && 10333 !e.hasClass('vjs-hidden') && 10334 (e.hide(), this.audioOnlyCache_.hiddenChildren.push(e)); 10335 }), 10336 (this.audioOnlyCache_.playerHeight = this.currentHeight()), 10337 (this.audioOnlyCache_.controlBarHeight = i), 10338 this.on('playerresize', this.boundUpdatePlayerHeightOnAudioOnlyMode_), 10339 this.height(i), 10340 this.trigger('audioonlymodechange')); 10341 } 10342 disableAudioOnlyUI_() { 10343 (this.removeClass('vjs-audio-only-mode'), 10344 this.off('playerresize', this.boundUpdatePlayerHeightOnAudioOnlyMode_),
10345 this.audioOnlyCache_.hiddenChildren.forEach((e) => e.show()), 10346 this.height(this.audioOnlyCache_.playerHeight), 10347 this.trigger('audioonlymodechange')); 10348 } 10349 audioOnlyMode(e) { 10350 return 'boolean' != typeof e || e === this.audioOnlyMode_ 10351 ? this.audioOnlyMode_ 10352 : (this.audioOnlyMode_ = e) 10353 ? ((e = []), 10354 this.isInPictureInPicture() && e.push(this.exitPictureInPicture()), 10355 this.isFullscreen() && e.push(this.exitFullscreen()), 10356 this.audioPosterMode() && e.push(this.audioPosterMode(!1)), 10357 Promise.all(e).then(() => this.enableAudioOnlyUI_())) 10358 : Promise.resolve().then(() => this.disableAudioOnlyUI_()); 10359 } 10360 enablePosterModeUI_() { 10361 ((this.tech_ && this.tech_).hide(), 10362 this.addClass('vjs-audio-poster-mode'), 10363 this.trigger('audiopostermodechange')); 10364 } 10365 disablePosterModeUI_() { 10366 ((this.tech_ && this.tech_).show(), 10367 this.removeClass('vjs-audio-poster-mode'), 10368 this.trigger('audiopostermodechange')); 10369 } 10370 audioPosterMode(e) { 10371 return 'boolean' != typeof e || e === this.audioPosterMode_ 10372 ? this.audioPosterMode_ 10373 : (this.audioPosterMode_ = e) 10374 ? (this.audioOnlyMode() ? this.audioOnlyMode(!1) : Promise.resolve()).then(() => { 10375 this.enablePosterModeUI_(); 10376 }) 10377 : Promise.resolve().then(() => { 10378 this.disablePosterModeUI_(); 10379 }); 10380 } 10381 addTextTrack(e, t, i) { 10382 if (this.tech_) return this.tech_.addTextTrack(e, t, i); 10383 } 10384 addRemoteTextTrack(e, t) { 10385 if (this.tech_) return this.tech_.addRemoteTextTrack(e, t); 10386 } 10387 removeRemoteTextTrack(e = {}) { 10388 let t = e.track; 10389 if (((t = t || e), this.tech_)) return this.tech_.removeRemoteTextTrack(t); 10390 } 10391 getVideoPlaybackQuality() { 10392 return this.techGet_('getVideoPlaybackQuality'); 10393 } 10394 videoWidth() { 10395 return (this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth()) || 0; 10396 } 10397 videoHeight() { 10398 return (this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight()) || 0; 10399 } 10400 language(e) { 10401 if (void 0 === e) return this.language_; 10402 this.language_ !== String(e).toLowerCase() && 10403 ((this.language_ = String(e).toLowerCase()), Ct(this)) && 10404 this.trigger('languagechange'); 10405 } 10406 languages() { 10407 return d(T.prototype.options_.languages, this.languages_); 10408 } 10409 toJSON() { 10410 var t = d(this.options_), 10411 i = t.tracks; 10412 t.tracks = []; 10413 for (let e = 0; e < i.length; e++) { 10414 var s = i[e]; 10415 (((s = d(s)).player = void 0), (t.tracks[e] = s)); 10416 } 10417 return t; 10418 } 10419 createModal(e, t) { 10420 (t = t || {}).content = e || ''; 10421 let i = new ti(this, t); 10422 return ( 10423 this.addChild(i), 10424 i.on('dispose', () => { 10425 this.removeChild(i); 10426 }), 10427 i.open(), 10428 i 10429 ); 10430 } 10431 updateCurrentBreakpoint_() { 10432 if (this.responsive()) { 10433 var t = this.currentBreakpoint(), 10434 i = this.currentWidth(); 10435 for (let e = 0; e < Tn.length; e++) { 10436 var s = Tn[e]; 10437 if (i <= this.breakpoints_[s]) { 10438 if (t === s) return; 10439 (t && this.removeClass(Sn[t]), this.addClass(Sn[s]), (this.breakpoint_ = s)); 10440 break; 10441 } 10442 } 10443 } 10444 } 10445 removeCurrentBreakpoint_() { 10446 var e = this.currentBreakpointClass(); 10447 ((this.breakpoint_ = ''), e && this.removeClass(e)); 10448 } 10449 breakpoints(e) { 10450 return ( 10451 void 0 !== e && 10452 ((this.breakpoint_ = ''), 10453 (this.breakpoints_ = Object.assign({}, wn, e)), 10454 this.updateCurrentBreakpoint_()), 10455 Object.assign(this.breakpoints_) 10456 ); 10457 } 10458 responsive(e) { 10459 return void 0 === e 10460 ? this.responsive_ 10461 : (e = Boolean(e)) !== this.responsive_ 10462 ? ((this.responsive_ = e) 10463 ? (this.on('playerresize', this.boundUpdateCurrentBreakpoint_), 10464 this.updateCurrentBreakpoint_()) 10465 : (this.off('playerresize', this.boundUpdateCurrentBreakpoint_), 10466 this.removeCurrentBreakpoint_()), 10467 e) 10468 : void 0; 10469 } 10470 currentBreakpoint() { 10471 return this.breakpoint_; 10472 } 10473 currentBreakpointClass() { 10474 return Sn[this.breakpoint_] || ''; 10475 } 10476 loadMedia(e, t) { 10477 var i, s, r, n, a, o, l; 10478 e && 10479 'object' == typeof e && 10480 ((i = this.crossOrigin()), 10481 ({ 10482 artist: e, 10483 artwork: s, 10484 description: r, 10485 poster: n, 10486 src: a, 10487 textTracks: o, 10488 title: l 10489 } = (this.reset(), (this.cache_.media = d(e)), this.cache_.media)), 10490 !s && n && (this.cache_.media.artwork = [{ src: n, type: Ps(n) }]), 10491 i && this.crossOrigin(i), 10492 a && this.src(a), 10493 n && this.poster(n), 10494 Array.isArray(o) && o.forEach((e) => this.addRemoteTextTrack(e, !1)), 10495 this.titleBar && this.titleBar.update({ title: l, description: r || e || '' }), 10496 this.ready(t)); 10497 } 10498 getMedia() { 10499 var e, t; 10500 return this.cache_.media 10501 ? d(this.cache_.media)
10502 : ((e = this.poster()), 10503 (t = { 10504 src: this.currentSources(), 10505 textTracks: Array.prototype.map.call(this.remoteTextTracks(), (e) => ({ 10506 kind: e.kind, 10507 label: e.label, 10508 language: e.language, 10509 src: e.src 10510 })) 10511 }), 10512 e && ((t.poster = e), (t.artwork = [{ src: t.poster, type: Ps(t.poster) }])), 10513 t); 10514 } 10515 static getTagSettings(e) { 10516 var i = { sources: [], tracks: [] }, 10517 t = Ne(e), 10518 s = t['data-setup']; 10519 if ((De(e, 'vjs-fill') && (t.fill = !0), De(e, 'vjs-fluid') && (t.fluid = !0), null !== s)) 10520 try { 10521 Object.assign(t, JSON.parse(s || '{}')); 10522 } catch (e) { 10523 o.error('data-setup', e); 10524 } 10525 if ((Object.assign(i, t), e.hasChildNodes())) { 10526 var r = e.childNodes; 10527 for (let e = 0, t = r.length; e < t; e++) { 10528 var n = r[e], 10529 a = n.nodeName.toLowerCase(); 10530 'source' === a ? i.sources.push(Ne(n)) : 'track' === a && i.tracks.push(Ne(n)); 10531 } 10532 } 10533 return i; 10534 } 10535 debug(e) { 10536 if (void 0 === e) return this.debugEnabled_; 10537 e 10538 ? (this.trigger('debugon'), 10539 (this.previousLogLevel_ = this.log.level), 10540 this.log.level('debug'), 10541 (this.debugEnabled_ = !0)) 10542 : (this.trigger('debugoff'), 10543 this.log.level(this.previousLogLevel_), 10544 (this.previousLogLevel_ = void 0), 10545 (this.debugEnabled_ = !1)); 10546 } 10547 playbackRates(e) { 10548 if (void 0 === e) return this.cache_.playbackRates; 10549 Array.isArray(e) && 10550 e.every((e) => 'number' == typeof e) && 10551 ((this.cache_.playbackRates = e), this.trigger('playbackrateschange')); 10552 } 10553 } 10554 (a.names.forEach(function (e) { 10555 let t = a[e]; 10556 T.prototype[t.getterName] = function () { 10557 return this.tech_ 10558 ? this.tech_[t.getterName]() 10559 : ((this[t.privateName] = this[t.privateName] || new t.ListClass()), this[t.privateName]); 10560 }; 10561 }), 10562 (T.prototype.crossorigin = T.prototype.crossOrigin), 10563 (T.players = {})); 10564 Jr = window.navigator; 10565 ((T.prototype.options_ = { 10566 techOrder: v.defaultTechOrder_, 10567 html5: {}, 10568 enableSourceset: !0, 10569 inactivityTimeout: 2e3, 10570 playbackRates: [], 10571 liveui: !1, 10572 children: [ 10573 'mediaLoader', 10574 'posterImage', 10575 'titleBar', 10576 'textTrackDisplay', 10577 'loadingSpinner', 10578 'bigPlayButton', 10579 'liveTracker', 10580 'controlBar', 10581 'errorDisplay', 10582 'textTrackSettings', 10583 'resizeManager' 10584 ], 10585 language: (Jr && ((Jr.languages && Jr.languages[0]) || Jr.userLanguage || Jr.language)) || 'en', 10586 languages: {}, 10587 notSupportedMessage: 'No compatible source was found for this media.', 10588 normalizeAutoplay: !1, 10589 fullscreen: { options: { navigationUI: 'hide' } }, 10590 breakpoints: {}, 10591 responsive: !1, 10592 audioOnlyMode: !1, 10593 audioPosterMode: !1, 10594 spatialNavigation: { enabled: !1, horizontalSeek: !1 }, 10595 enableSmoothSeeking: !1 10596 }), 10597 vn.forEach(function (e) { 10598 T.prototype[`handleTech${m(e)}_`] = function () { 10599 return this.trigger(e); 10600 }; 10601 }), 10602 g.registerComponent('Player', T)); 10603 function En(t, i) { 10604 function s() { 10605 Pn(this, { name: t, plugin: i, instance: null }, !0); 10606 var e = i.apply(this, arguments); 10607 return (Dn(this, t), Pn(this, { name: t, plugin: i, instance: e }), e); 10608 } 10609 return (
10610 Object.keys(i).forEach(function (e) { 10611 s[e] = i[e]; 10612 }), 10613 s 10614 ); 10615 } 10616 let Cn = 'plugin', 10617 kn = 'activePlugins_', 10618 In = {}, 10619 xn = (e) => In.hasOwnProperty(e), 10620 An = (e) => (xn(e) ? In[e] : void 0), 10621 Dn = (e, t) => { 10622 ((e[kn] = e[kn] || {}), (e[kn][t] = !0)); 10623 }, 10624 Pn = (e, t, i) => { 10625 i = (i ? 'before' : '') + 'pluginsetup'; 10626 (e.trigger(i, t), e.trigger(i + ':' + t.name, t)); 10627 }, 10628 Ln = (i, s) => ( 10629 (s.prototype.name = i), 10630 function (...e) { 10631 Pn(this, { name: i, plugin: s, instance: null }, !0); 10632 let t = new s(this, ...e); 10633 return ((this[i] = () => t), Pn(this, t.getEventHash()), t); 10634 } 10635 ); 10636 class On { 10637 constructor(e) { 10638 if (this.constructor === On) 10639 throw new Error('Plugin must be sub-classed; not directly instantiated.'); 10640 ((this.player = e), 10641 this.log || (this.log = this.player.log.createLogger(this.name)), 10642 Ot(this), 10643 delete this.trigger, 10644 Nt(this, this.constructor.defaultState), 10645 Dn(e, this.name), 10646 (this.dispose = this.dispose.bind(this)), 10647 e.on('dispose', this.dispose)); 10648 } 10649 version() { 10650 return this.constructor.VERSION; 10651 } 10652 getEventHash(e = {}) { 10653 return ((e.name = this.name), (e.plugin = this.constructor), (e.instance = this), e); 10654 } 10655 trigger(e, t = {}) { 10656 return gt(this.eventBusEl_, e, this.getEventHash(t)); 10657 } 10658 handleStateChanged(e) {} 10659 dispose() { 10660 var { name: e, player: t } = this; 10661 (this.trigger('dispose'), 10662 this.off(), 10663 t.off('dispose', this.dispose), 10664 (t[kn][e] = !1), 10665 (this.player = this.state = null), 10666 (t[e] = Ln(e, In[e]))); 10667 } 10668 static isBasic(e) { 10669 e = 'string' == typeof e ? An(e) : e; 10670 return 'function' == typeof e && !On.prototype.isPrototypeOf(e.prototype); 10671 } 10672 static registerPlugin(e, t) { 10673 if ('string' != typeof e) 10674 throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`); 10675 if (xn(e)) 10676 o.warn( 10677 `A plugin named "${e}" already exists. You may want to avoid re-registering plugins!` 10678 ); 10679 else if (T.prototype.hasOwnProperty(e)) 10680 throw new Error( 10681 `Illegal plugin name, "${e}", cannot share a name with an existing player method!` 10682 ); 10683 if ('function' != typeof t) 10684 throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`); 10685 return ( 10686 (In[e] = t), 10687 e !== Cn && (On.isBasic(t) ? (T.prototype[e] = En(e, t)) : (T.prototype[e] = Ln(e, t))), 10688 t 10689 ); 10690 } 10691 static deregisterPlugin(e) { 10692 if (e === Cn) throw new Error('Cannot de-register base plugin.'); 10693 xn(e) && (delete In[e], delete T.prototype[e]); 10694 } 10695 static getPlugins(e = Object.keys(In)) { 10696 let i; 10697 return ( 10698 e.forEach((e) => { 10699 var t = An(e); 10700 t && ((i = i || {})[e] = t); 10701 }), 10702 i 10703 ); 10704 } 10705 static getPluginVersion(e) { 10706 e = An(e); 10707 return (e && e.VERSION) || ''; 10708 } 10709 } 10710 function Rn(e, i, s, r) { 10711 { 10712 var n = i + ` is deprecated and will be removed in ${e}.0; please use ${s} instead.`, 10713 a = r; 10714 let t = !1; 10715 return function (...e) { 10716 return (t || o.warn(n), (t = !0), a.apply(this, e)); 10717 }; 10718 } 10719 } 10720 ((On.getPlugin = An), 10721 (On.BASE_PLUGIN_NAME = Cn), 10722 On.registerPlugin(Cn, On), 10723 (T.prototype.usingPlugin = function (e) { 10724 return !!this[kn] && !0 === this[kn][e]; 10725 }), 10726 (T.prototype.hasPlugin = function (e) { 10727 return !!xn(e); 10728 })); 10729 let Nn = (e) => (0 === e.indexOf('#') ? e.slice(1) : e); 10730 function E(e, i, s) { 10731 let r = E.getPlayer(e); 10732 if (r) 10733 (i && o.warn(`Player "${e}" is already initialised. Options will not be applied.`), 10734 s && r.ready(s)); 10735 else { 10736 let t = 'string' == typeof e ? Ye('#' + Nn(e)) : e; 10737 if (!Ce(t)) throw new TypeError('The element or ID supplied is not valid. (videojs)'); 10738 ((e = 10739 'getRootNode' in t && t.getRootNode() instanceof window.ShadowRoot 10740 ? t.getRootNode() 10741 : t.ownerDocument.body), 10742 (e = 10743 ((t.ownerDocument.defaultView && e.contains(t)) || 10744 o.warn('The element supplied is not included in the DOM'), 10745 !0 === (i = i || {}).restoreEl && 10746 (i.restoreEl = ( 10747 t.parentNode && 10748 t.parentNode.hasAttribute && 10749 t.parentNode.hasAttribute('data-vjs-player') 10750 ? t.parentNode 10751 : t 10752 ).cloneNode(!0)), 10753 B('beforesetup').forEach((e) => { 10754 e = e(t, d(i)); 10755 !Y(e) || Array.isArray(e) 10756 ? o.error('please return an object in beforesetup hooks') 10757 : (i = d(i, e)); 10758 }), 10759 g.getComponent('Player')))); 10760 ((r = new e(t, i, s)), B('setup').forEach((e) => e(r))); 10761 } 10762 return r; 10763 } 10764 ((E.hooks_ = U), 10765 (E.hooks = B), 10766 (E.hook = function (e, t) { 10767 B(e, t); 10768 }), 10769 (E.hookOnce = function (s, e) { 10770 B( 10771 s, 10772 [].concat(e).map((t) => { 10773 let i = (...e) => (F(s, i), t(...e)); 10774 return i; 10775 }) 10776 ); 10777 }), 10778 (E.removeHook = F), 10779 !0 !== window.VIDEOJS_NO_DYNAMIC_STYLE && 10780 Ee() && 10781 !(e = Ye('.vjs-styles-defaults')) && 10782 ((e = at('vjs-styles-defaults')), 10783 (Qr = Ye('head')) && Qr.insertBefore(e, Qr.firstChild), 10784 ot( 10785 e, 10786 ` 10787 .video-js { 10788 width: 300px; 10789 height: 150px; 10790 } 10791 10792 .vjs-fluid:not(.vjs-audio-only-mode) { 10793 padding-top: 56.25% 10794 } 10795 ` 10796 )), 10797 rt(1, E), 10798 (E.VERSION = M), 10799 (E.options = T.prototype.options_), 10800 (E.getPlayers = () => T.players), 10801 (E.getPlayer = (e) => { 10802 var t = T.players; 10803 let i; 10804 if ('string' == typeof e) { 10805 var s = Nn(e), 10806 r = t[s]; 10807 if (r) return r;
10808 i = Ye('#' + s); 10809 } else i = e; 10810 if (Ce(i)) { 10811 var { player: r, playerId: s } = i; 10812 if (r || t[s]) return r || t[s]; 10813 } 10814 }), 10815 (E.getAllPlayers = () => 10816 Object.keys(T.players) 10817 .map((e) => T.players[e]) 10818 .filter(Boolean)), 10819 (E.players = T.players), 10820 (E.getComponent = g.getComponent), 10821 (E.registerComponent = (e, t) => ( 10822 v.isTech(t) && 10823 o.warn( 10824 `The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)` 10825 ), 10826 g.registerComponent.call(g, e, t) 10827 )), 10828 (E.getTech = v.getTech), 10829 (E.registerTech = v.registerTech), 10830 (E.use = function (e, t) { 10831 ((vs[e] = vs[e] || []), vs[e].push(t)); 10832 }), 10833 Object.defineProperty(E, 'middleware', { value: {}, writeable: !1, enumerable: !0 }), 10834 Object.defineProperty(E.middleware, 'TERMINATOR', { value: Ts, writeable: !1, enumerable: !0 }), 10835 (E.browser = Se), 10836 (E.obj = ee), 10837 (E.mergeOptions = Rn(9, 'videojs.mergeOptions', 'videojs.obj.merge', d)), 10838 (E.defineLazyProperty = Rn( 10839 9, 10840 'videojs.defineLazyProperty', 10841 'videojs.obj.defineLazyProperty', 10842 Z 10843 )), 10844 (E.bind = Rn(9, 'videojs.bind', 'native Function.prototype.bind', p)), 10845 (E.registerPlugin = On.registerPlugin), 10846 (E.deregisterPlugin = On.deregisterPlugin), 10847 (E.plugin = (e, t) => ( 10848 o.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead'), 10849 On.registerPlugin(e, t) 10850 )), 10851 (E.getPlugins = On.getPlugins), 10852 (E.getPlugin = On.getPlugin), 10853 (E.getPluginVersion = On.getPluginVersion), 10854 (E.addLanguage = function (e, t) { 10855 return ( 10856 (e = ('' + e).toLowerCase()), 10857 (E.options.languages = d(E.options.languages, { [e]: t })), 10858 E.options.languages[e] 10859 ); 10860 }), 10861 (E.log = o), 10862 (E.createLogger = W), 10863 (E.time = t), 10864 (E.createTimeRange = Rn(9, 'videojs.createTimeRange', 'videojs.time.createTimeRanges', jt)), 10865 (E.createTimeRanges = Rn(9, 'videojs.createTimeRanges', 'videojs.time.createTimeRanges', jt)), 10866 (E.formatTime = Rn(9, 'videojs.formatTime', 'videojs.time.formatTime', Wt)), 10867 (E.setFormatTime = Rn(9, 'videojs.setFormatTime', 'videojs.time.setFormatTime', zt)), 10868 (E.resetFormatTime = Rn(9, 'videojs.resetFormatTime', 'videojs.time.resetFormatTime', $t)), 10869 (E.parseUrl = Rn(9, 'videojs.parseUrl', 'videojs.url.parseUrl', mi)), 10870 (E.isCrossOrigin = Rn(9, 'videojs.isCrossOrigin', 'videojs.url.isCrossOrigin', fi)), 10871 (E.EventTarget = wt), 10872 (E.any = yt), 10873 (E.on = mt), 10874 (E.one = ft), 10875 (E.off = c), 10876 (E.trigger = gt), 10877 (E.xhr = Di), 10878 (E.TextTrack = Bi), 10879 (E.AudioTrack = Fi), 10880 (E.VideoTrack = qi), 10881 [ 10882 'isEl', 10883 'isTextNode', 10884 'createEl', 10885 'hasClass', 10886 'addClass', 10887 'removeClass', 10888 'toggleClass', 10889 'setAttributes', 10890 'getAttributes', 10891 'emptyEl', 10892 'appendContent', 10893 'insertContent' 10894 ].forEach((e) => { 10895 E[e] = function () { 10896 return ( 10897 o.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`), 10898 et[e].apply(null, arguments) 10899 ); 10900 }; 10901 }), 10902 (E.computedStyle = Rn(9, 'videojs.computedStyle', 'videojs.dom.computedStyle', Je)), 10903 (E.dom = et), 10904 (E.fn = Tt), 10905 (E.num = zi), 10906 (E.str = Bt), 10907 (E.url = _i), 10908 (E.Error = { 10909 NetworkBadStatus: 'networkbadstatus', 10910 NetworkRequestFailed: 'networkrequestfailed', 10911 NetworkRequestAborted: 'networkrequestaborted', 10912 NetworkRequestTimeout: 'networkrequesttimeout', 10913 NetworkBodyParserFailed: 'networkbodyparserfailed', 10914 StreamingHlsPlaylistParserError: 'streaminghlsplaylistparsererror', 10915 StreamingDashManifestParserError: 'streamingdashmanifestparsererror', 10916 StreamingContentSteeringParserError: 'streamingcontentsteeringparsererror', 10917 StreamingVttParserError: 'streamingvttparsererror', 10918 StreamingFailedToSelectNextSegment: 'streamingfailedtoselectnextsegment', 10919 StreamingFailedToDecryptSegment: 'streamingfailedtodecryptsegment', 10920 StreamingFailedToTransmuxSegment: 'streamingfailedtotransmuxsegment', 10921 StreamingFailedToAppendSegment: 'streamingfailedtoappendsegment', 10922 StreamingCodecsChangeError: 'streamingcodecschangeerror' 10923 }), 10924 bi(function (e, t) { 10925 /*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */ 10926 e.exports = (function (e) { 10927 function t(e) { 10928 return e && typeof e === 'object' && 'default' in e ? e : { default: e }; 10929 } 10930 var i = t(e); 10931 class s { 10932 constructor(e) { 10933 let t = this; 10934 t.id = e.id; 10935 t.label = t.id; 10936 t.width = e.width; 10937 t.height = e.height; 10938 t.bitrate = e.bandwidth; 10939 t.frameRate = e.frameRate; 10940 t.enabled_ = e.enabled; 10941 Object.defineProperty(t, 'enabled', { 10942 get() { 10943 return t.enabled_(); 10944 }, 10945 set(e) { 10946 t.enabled_(e); 10947 } 10948 }); 10949 return t; 10950 } 10951 } 10952 class n extends i['default'].EventTarget { 10953 constructor() { 10954 super(); 10955 let e = this; 10956 e.levels_ = []; 10957 e.selectedIndex_ = -1; 10958 Object.defineProperty(e, 'selectedIndex', { 10959 get() { 10960 return e.selectedIndex_; 10961 } 10962 }); 10963 Object.defineProperty(e, 'length', { 10964 get() { 10965 return e.levels_.length; 10966 } 10967 }); 10968 e[Symbol.iterator] = () => e.levels_.values(); 10969 return e; 10970 } 10971 addQualityLevel(e) { 10972 let t = this.getQualityLevelById(e.id); 10973 if (t) return t; 10974 const i = this.levels_.length; 10975 t = new s(e); 10976 if (!('' + i in this)) 10977 Object.defineProperty(this, i, { 10978 get() { 10979 return this.levels_[i]; 10980 } 10981 }); 10982 this.levels_.push(t); 10983 this.trigger({ qualityLevel: t, type: 'addqualitylevel' }); 10984 return t; 10985 } 10986 removeQualityLevel(i) { 10987 let s = null; 10988 for (let e = 0, t = this.length; e < t; e++) 10989 if (this[e] === i) { 10990 s = this.levels_.splice(e, 1)[0]; 10991 if (this.selectedIndex_ === e) this.selectedIndex_ = -1; 10992 else if (this.selectedIndex_ > e) this.selectedIndex_--; 10993 break; 10994 } 10995 if (s) this.trigger({ qualityLevel: i, type: 'removequalitylevel' }); 10996 return s; 10997 } 10998 getQualityLevelById(i) { 10999 for (let e = 0, t = this.length; e < t; e++) { 11000 const s = this[e]; 11001 if (s.id === i) return s; 11002 } 11003 return null; 11004 } 11005 dispose() { 11006 this.selectedIndex_ = -1; 11007 this.levels_.length = 0; 11008 } 11009 } 11010 n.prototype.allowedEvents_ = { 11011 change: 'change', 11012 addqualitylevel: 'addqualitylevel', 11013 removequalitylevel: 'removequalitylevel' 11014 }; 11015 for (const l in n.prototype.allowedEvents_) n.prototype['on' + l] = null; 11016 var a = '4.1.0'; 11017 const r = function (e, t) { 11018 const i = e.qualityLevels; 11019 const s = new n(); 11020 const r = function () { 11021 s.dispose(); 11022 e.qualityLevels = i; 11023 e.off('dispose', r); 11024 }; 11025 e.on('dispose', r); 11026 e.qualityLevels = () => s; 11027 e.qualityLevels.VERSION = a; 11028 return s; 11029 }, 11030 o = function (e) { 11031 return r(this, i['default'].obj.merge({}, e)); 11032 }; 11033 return (i['default'].registerPlugin('qualityLevels', o), (
11033o.VERSION = a), o); 11034 })(E); 11035 })); 11036 function Mn(e) { 11037 return window.atob ? window.atob(e) : Buffer.from(e, 'base64').toString('binary'); 11038 } 11039 var Un = 'https://example.com', 11040 Bn = function (e, t) { 11041 if (/^[a-z]+:/i.test(t)) return t; 11042 /^data:/.test(e) && (e = (window.location && window.location.href) || ''); 11043 var i = /^\/\//.test(e), 11044 s = !window.location && !/\/\//i.test(e), 11045 t = ((e = new window.URL(e, window.location || Un)), new URL(t, e)); 11046 return s ? t.href.slice(Un.length) : i ? t.href.slice(t.protocol.length) : t.href; 11047 }, 11048 Yr = (function () { 11049 function e() { 11050 this.listeners = {}; 11051 } 11052 var t = e.prototype; 11053 return ( 11054 (t.on = function (e, t) { 11055 (this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t)); 11056 }), 11057 (t.off = function (e, t) { 11058 return ( 11059 !!this.listeners[e] && 11060 ((t = this.listeners[e].indexOf(t)), 11061 (this.listeners[e] = this.listeners[e].slice(0)), 11062 this.listeners[e].splice(t, 1), 11063 -1 < t) 11064 ); 11065 }), 11066 (t.trigger = function (e) { 11067 var t = this.listeners[e]; 11068 if (t) 11069 if (2 === arguments.length) 11070 for (var i = t.length, s = 0; s < i; ++s) t[s].call(this, arguments[1]); 11071 else 11072 for ( 11073 var r = Array.prototype.slice.call(arguments, 1), n = t.length, a = 0; 11074 a < n; 11075 ++a 11076 ) 11077 t[a].apply(this, r); 11078 }), 11079 (t.dispose = function () { 11080 this.listeners = {}; 11081 }), 11082 (t.pipe = function (t) { 11083 this.on('data', function (e) { 11084 t.push(e); 11085 }); 11086 }), 11087 e 11088 ); 11089 })(); 11090 function Fn(e) { 11091 for (var t = Mn(e), i = new Uint8Array(t.length), s = 0; s < t.length; s++) 11092 i[s] = t.charCodeAt(s); 11093 return i; 11094 } 11095 /*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */ class qn extends Yr { 11096 constructor() { 11097 (super(), (this.buffer = '')); 11098 } 11099 push(e) { 11100 let t; 11101 for (this.buffer += e, t = this.buffer.indexOf('\n'); -1 < t; t = this.buffer.indexOf('\n')) 11102 (this.trigger('data', this.buffer.substring(0, t)), 11103 (this.buffer = this.buffer.substring(t + 1))); 11104 } 11105 } 11106 function jn(e) { 11107 var e = /([0-9.]*)?@?([0-9.]*)?/.exec(e || ''), 11108 t = {}; 11109 return (e[1] && (t.length = parseInt(e[1], 10)), e[2] && (t.offset = parseInt(e[2], 10)), t); 11110 } 11111 function Vn(t) { 11112 var i = {}; 11113 if (t) { 11114 var s, 11115 r = t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')); 11116 let e = r.length; 11117 for (; e--; ) 11118 '' !== r[e] && 11119 (((s = /([^=]*)=(.*)/.exec(r[e]).slice(1))[0] = s[0].replace(/^\s+|\s+$/g, '')), 11120 (s[1] = s[1].replace(/^\s+|\s+$/g, '')), 11121 (s[1] = s[1].replace(/^['"](.*)['"]$/g, '$1')), 11122 (i[s[0]] = s[1])); 11123 } 11124 return i; 11125 } 11126 let Hn = String.fromCharCode(9), 11127 zn = (e) => { 11128 var e = e.split('x'), 11129 t = {}; 11130 return (e[0] && (t.width = parseInt(e[0], 10)), e[1] && (t.height = parseInt(e[1], 10)), t); 11131 }; 11132 class $n extends Yr { 11133 constructor() { 11134 (super(), (this.customParsers = []), (this.tagMappers = [])); 11135 } 11136 push(i) { 11137 let a, o; 11138 0 !== (i = i.trim()).length && 11139 ('#' !== i[0] 11140 ? this.trigger('data', { type: 'uri', uri: i }) 11141 : this.tagMappers 11142 .reduce( 11143 (e, t) => { 11144 t = t(i); 11145 return t === i ? e : e.concat([t]); 11146 }, 11147 [i] 11148 ) 11149 .forEach((t) => { 11150 for (let e = 0; e < this.customParsers.length; e++) 11151 if (this.customParsers[e].call(this, t)) return; 11152 var e; 11153 if (0 !== t.indexOf('#EXT')) 11154 this.trigger('data', { type: 'comment', text: t.slice(1) }); 11155 else if (((t = t.replace('\r', '')), (a = /^#EXTM3U/.exec(t)))) 11156 this.trigger('data', { type: 'tag', tagType: 'm3u' }); 11157 else if ((a = /^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t))) 11158 ((o = { type: 'tag', tagType: 'inf' }), 11159 a[1] && (o.duration = parseFloat(a[1])), 11160 a[2] && (o.title = a[2]), 11161 this.trigger('data', o)); 11162 else if ((a = /^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t))) 11163 ((o = { type: 'tag', tagType: 'targetduration' }), 11164 a[1] && (o.duration = parseInt(a[1], 10)), 11165 this.trigger('data', o)); 11166 else if ((a = /^#EXT-X-VERSION:([0-9.]*)?/.exec(t))) 11167 ((o = { type: 'tag', tagType: 'version' }), 11168 a[1] && (o.version = parseInt(a[1], 10)), 11169 this.trigger('data', o)); 11170 else if ((a = /^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t))) 11171 ((o = { type: 'tag', tagType: 'media-sequence' }), 11172 a[1] && (o.number = parseInt(a[1], 10)), 11173 this.trigger('data', o)); 11174 else if ((a = /^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t))) 11175 ((o = { type: 'tag', tagType: 'discontinuity-sequence' }), 11176 a[1] && (o.number = parseInt(a[1], 10)), 11177 this.trigger('data', o)); 11178 else if ((a = /^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t))) 11179 ((o = { type: 'tag', tagType: 'playlist-type' }), 11180 a[1] && (o.playlistType = a[1]), 11181 this.trigger('data', o)); 11182 else if ((a = /^#EXT-X-BYTERANGE:(.*)?$/.exec(t))) 11183 ((o = f(jn(a[1]), { type: 'tag', tagType: 'byterange' })), 11184 this.trigger('data', o)); 11185 else if ((a = /^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t))) 11186 ((o = { type: 'tag', tagType: 'allow-cache' }), 11187 a[1] && (o.allowed = !/NO/.test(a[1])), 11188 this.trigger('data', o)); 11189 else if ((a = /^#EXT-X-MAP:(.*)$/.exec(t))) 11190 ((o = { type: 'tag', tagType: 'map' }), 11191 a[1] && 11192 ((e = Vn(a[1])).URI && (o.uri = e.URI), e.BYTERANGE) && 11193 (o.byterange = jn(e.BYTERANGE)), 11194 this.trigger('data', o)); 11195 else if ((a = /^#EXT-X-STREAM-INF:(.*)$/.exec(t))) 11196 ((o = { type: 'tag', tagType: 'stream-inf' }), 11197 a[1] && 11198 ((o.attributes = Vn(a[1])), 11199 o.attributes.RESOLUTION && 11200 (o.attributes.RESOLUTION = zn(o.attributes.RESOLUTION)), 11201 o.attributes.BANDWIDTH && 11202 (o.attributes.BANDWIDTH = parseInt(o.attributes.BANDWIDTH, 10)), 11203 o.attributes['FRAME-RATE'] && 11204 (o.attributes['FRAME-RATE'] = parseFloat(o.attributes['FRAME-RATE'])), 11205 o.attributes['PROGRAM-ID']) && 11206 (o.attributes['PROGRAM-ID'] = parseInt(o.attributes['PROGRAM-ID'], 10)), 11207 this.trigger('data', o)); 11208 else if ((a = /^#EXT-X-MEDIA:(.*)$/.exec(t))) 11209 ((o = { type: 'tag', tagType: 'media' }), 11210 a[1] && (o.attributes = Vn(a[1])), 11211 this.trigger('data', o)); 11212 else if ((a = /^#EXT-X-ENDLIST/.exec(t))) 11213 this.trigger('data', { type: 'tag', tagType: 'endlist' }); 11214 else if ((a = /^#EXT-X-DISCONTINUITY/.exec(t))) 11215 this.trigger('data', { type: 'tag', tagType: 'discontinuity' }); 11216 else if ((a = /^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t))) 11217 ((o = { type: 'tag', tagType: 'program-date-time' }), 11218 a[1] && ((o.dateTimeString = a[1]), (o.dateTimeObject = new Date(a[1]))), 11219 this.trigger('data', o)); 11220 else if ((a = /^#EXT-X-KEY:(.*)$/.exec(t))) 11221 ((o = { type: 'tag', tagType: 'key' }), 11222 a[1] && 11223 ((o.attributes = Vn(a[1])), o.attributes.IV) && 11224 ('0x' === o.attributes.IV.substring(0, 2).toLowerCase() && 11225 (o.attributes.IV = o.attributes.IV.substring(2)), 11226 (o.attributes.IV = o.attributes.IV.match(/.{8}/g)), 11227 (o.attributes.IV[0] = parseInt(o.attributes.IV[0], 16)), 11228 (o.attributes.IV[1] = parseInt(o.attributes.IV[1], 16)), 11229 (o.attributes.IV[2] = parseInt(o.attributes.IV[2], 16)), 11230 (o.attributes.IV[3] = parseInt(o.attributes.IV[3], 16)), 11231 (o.attributes.IV = new Uint32Array(o.attributes.IV))), 11232 this.trigger('data', o)); 11233 else if ((a = /^#EXT-X-START:(.*)$/.exec(t))) 11234 ((o = { type: 'tag', tagType: 'start' }), 11235 a[1] && 11236 ((o.attributes = Vn(a[1])), 11237 (o.attributes['TIME-OFFSET'] = parseFloat(o.attributes['TIME-OFFSET'])), 11238 (o.attributes.PRECISE = /YES/.test(o.attributes.PRECISE))), 11239 this.trigger('data', o)); 11240 else if ((a = /^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t))) 11241 ((o = { type: 'tag', tagType: 'cue-out-cont' }), 11242 a[1] ? (o.data = a[1]) : (o.data = ''), 11243 this.trigger('data', o)); 11244 else if ((a = /^#EXT-X-CUE-OUT:(.*)?$/.exec(t))) 11245 ((o = { type: 'tag', tagType: 'cue-out' }), 11246 a[1] ? (o.data = a[1]) : (o.data = ''), 11247 this.trigger('data', o)); 11248 else if ((a = /^#EXT-X-CUE-IN:?(.*)?$/.exec(t))) 11249 ((o = { type: 'tag', tagType: 'cue-in' }), 11250 a[1] ? (o.data = a[1]) : (o.data = ''), 11251 this.trigger('data', o)); 11252 else if ((a = /^#EXT-X-SKIP:(.*)$/.exec(t)) && a[1]) 11253 (((o = { type: 'tag', tagType: 'skip' }).attributes = Vn(a[1])), 11254 o.attributes.hasOwnProperty('SKIPPED-SEGMENTS') && 11255 (o.attributes['SKIPPED-SEGMENTS'] = parseInt( 11256 o.attributes['SKIPPED-SEGMENTS'], 11257 10 11258 )), 11259 o.attributes.hasOwnProperty('RECENTLY-REMOVED-DATERANGES') && 11260 (o.attributes['RECENTLY-REMOVED-DATERANGES'] = 11261 o.attributes['RECENTLY-REMOVED-DATERANGES'].split(Hn)), 11262 this.trigger('data', o));
11263 else if ((a = /^#EXT-X-PART:(.*)$/.exec(t)) && a[1]) 11264 (((o = { type: 'tag', tagType: 'part' }).attributes = Vn(a[1])), 11265 ['DURATION'].forEach(function (e) { 11266 o.attributes.hasOwnProperty(e) && 11267 (o.attributes[e] = parseFloat(o.attributes[e])); 11268 }), 11269 ['INDEPENDENT', 'GAP'].forEach(function (e) { 11270 o.attributes.hasOwnProperty(e) && 11271 (o.attributes[e] = /YES/.test(o.attributes[e])); 11272 }), 11273 o.attributes.hasOwnProperty('BYTERANGE') && 11274 (o.attributes.byterange = jn(o.attributes.BYTERANGE)), 11275 this.trigger('data', o)); 11276 else if ((a = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t)) && a[1]) 11277 (((o = { type: 'tag', tagType: 'server-control' }).attributes = Vn(a[1])), 11278 ['CAN-SKIP-UNTIL', 'PART-HOLD-BACK', 'HOLD-BACK'].forEach(function (e) { 11279 o.attributes.hasOwnProperty(e) && 11280 (o.attributes[e] = parseFloat(o.attributes[e])); 11281 }), 11282 ['CAN-SKIP-DATERANGES', 'CAN-BLOCK-RELOAD'].forEach(function (e) { 11283 o.attributes.hasOwnProperty(e) && 11284 (o.attributes[e] = /YES/.test(o.attributes[e])); 11285 }), 11286 this.trigger('data', o)); 11287 else if ((a = /^#EXT-X-PART-INF:(.*)$/.exec(t)) && a[1]) 11288 (((o = { type: 'tag', tagType: 'part-inf' }).attributes = Vn(a[1])), 11289 ['PART-TARGET'].forEach(function (e) { 11290 o.attributes.hasOwnProperty(e) && 11291 (o.attributes[e] = parseFloat(o.attributes[e])); 11292 }), 11293 this.trigger('data', o)); 11294 else if ((a = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t)) && a[1]) 11295 (((o = { type: 'tag', tagType: 'preload-hint' }).attributes = Vn(a[1])), 11296 ['BYTERANGE-START', 'BYTERANGE-LENGTH'].forEach(function (e) { 11297 var t; 11298 o.attributes.hasOwnProperty(e) && 11299 ((o.attributes[e] = parseInt(o.attributes[e], 10)), 11300 (t = 'BYTERANGE-LENGTH' === e ? 'length' : 'offset'), 11301 (o.attributes.byterange = o.attributes.byterange || {}), 11302 (o.attributes.byterange[t] = o.attributes[e]), 11303 delete o.attributes[e]); 11304 }), 11305 this.trigger('data', o)); 11306 else if ((a = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t)) && a[1]) 11307 (((o = { type: 'tag', tagType: 'rendition-report' }).attributes = Vn(a[1])), 11308 ['LAST-MSN', 'LAST-PART'].forEach(function (e) { 11309 o.attributes.hasOwnProperty(e) && 11310 (o.attributes[e] = parseInt(o.attributes[e], 10)); 11311 }), 11312 this.trigger('data', o)); 11313 else if ((a = /^#EXT-X-DATERANGE:(.*)$/.exec(t)) && a[1]) { 11314 (((o = { type: 'tag', tagType: 'daterange' }).attributes = Vn(a[1])), 11315 ['ID', 'CLASS'].forEach(function (e) { 11316 o.attributes.hasOwnProperty(e) && (o.attributes[e] = String(o.attributes[e])); 11317 }), 11318 ['START-DATE', 'END-DATE'].forEach(function (e) { 11319 o.attributes.hasOwnProperty(e) && 11320 (o.attributes[e] = new Date(o.attributes[e])); 11321 }), 11322 ['DURATION', 'PLANNED-DURATION'].forEach(function (e) { 11323 o.attributes.hasOwnProperty(e) && 11324 (o.attributes[e] = parseFloat(o.attributes[e])); 11325 }), 11326 ['END-ON-NEXT'].forEach(function (e) { 11327 o.attributes.hasOwnProperty(e) && 11328 (o.attributes[e] = /YES/i.test(o.attributes[e])); 11329 }), 11330 ['SCTE35-CMD', ' SCTE35-OUT', 'SCTE35-IN'].forEach(function (e) { 11331 o.attributes.hasOwnProperty(e) && 11332 (o.attributes[e] = o.attributes[e].toString(16)); 11333 })); 11334 var i, 11335 s, 11336 r, 11337 n = /^X-([A-Z]+-)+[A-Z]+$/; 11338 for (i in o.attributes) 11339 n.test(i) && 11340 ((s = /[0-9A-Fa-f]{6}/g.test(o.attributes[i])), 11341 (r = /^\d+(\.\d+)?$/.test(o.attributes[i])), 11342 (o.attributes[i] = s 11343 ? o.attributes[i].toString(16) 11344 : (r ? parseFloat : String)(o.attributes[i]))); 11345 this.trigger('data', o); 11346 } else 11347 (a = /^#EXT-X-INDEPENDENT-SEGMENTS/.exec(t)) 11348 ? this.trigger('data', { type: 'tag', tagType: 'independent-segments' }) 11349 : (a = /^#EXT-X-I-FRAMES-ONLY/.exec(t)) 11350 ? this.trigger('data', { type: 'tag', tagType: 'i-frames-only' }) 11351 : (a = /^#EXT-X-CONTENT-STEERING:(.*)$/.exec(t)) 11352 ? (((o = { type: 'tag', tagType: 'content-steering' }).attributes = Vn( 11353 a[1] 11354 )), 11355 this.trigger('data', o)) 11356 : (a = /^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(t)) 11357 ? (((o = { type: 'tag', tagType: 'i-frame-playlist' }).attributes = Vn( 11358 a[1] 11359 )), 11360 o.attributes.URI && (o.uri = o.attributes.URI), 11361 o.attributes.BANDWIDTH && 11362 (o.attributes.BANDWIDTH = parseInt(o.attributes.BANDWIDTH, 10)), 11363 o.attributes.RESOLUTION && 11364 (o.attributes.RESOLUTION = zn(o.attributes.RESOLUTION)), 11365 o.attributes['AVERAGE-BANDWIDTH'] && 11366 (o.attributes['AVERAGE-BANDWIDTH']
11366= parseInt( 11367 o.attributes['AVERAGE-BANDWIDTH'], 11368 10 11369 )), 11370 o.attributes['FRAME-RATE'] && 11371 (o.attributes['FRAME-RATE'] = parseFloat(o.attributes['FRAME-RATE'])), 11372 this.trigger('data', o)) 11373 : (a = /^#EXT-X-DEFINE:(.*)$/.exec(t)) 11374 ? (((o = { type: 'tag', tagType: 'define' }).attributes = Vn(a[1])), 11375 this.trigger('data', o)) 11376 : this.trigger('data', { type: 'tag', data: t.slice(4) }); 11377 })); 11378 } 11379 addParser({ expression: t, customType: i, dataParser: s, segment: r }) { 11380 ('function' != typeof s && (s = (e) => e), 11381 this.customParsers.push((e) => { 11382 if (t.exec(e)) 11383 return ( 11384 this.trigger('data', { type: 'custom', data: s(e), customType: i, segment: r }), 11385 !0 11386 ); 11387 })); 11388 } 11389 addTagMapper({ expression: t, map: i }) { 11390 this.tagMappers.push((e) => (t.test(e) ? i(e) : e)); 11391 } 11392 } 11393 function Wn(t) { 11394 let i = {}; 11395 return ( 11396 Object.keys(t).forEach(function (e) { 11397 i[e.toLowerCase().replace(/-(\w)/g, (e) => e[1].toUpperCase())] = t[e]; 11398 }), 11399 i 11400 ); 11401 } 11402 function Gn(e) { 11403 var t, 11404 i, 11405 s, 11406 r, 11407 n, 11408 { serverControl: e, targetDuration: a, partTargetDuration: o } = e; 11409 e && 11410 ((t = '#EXT-X-SERVER-CONTROL'), 11411 (i = 'holdBack'), 11412 (s = 'partHoldBack'), 11413 (r = a && 3 * a), 11414 (n = o && 2 * o), 11415 a && 11416 !e.hasOwnProperty(i) && 11417 ((e[i] = r), 11418 this.trigger('info', { 11419 message: t + ` defaulting HOLD-BACK to targetDuration * 3 (${r}).` 11420 })), 11421 r && 11422 e[i] < r && 11423 (this.trigger('warn', { 11424 message: t + ` clamping HOLD-BACK (${e[i]}) to targetDuration * 3 (${r})` 11425 }), 11426 (e[i] = r)), 11427 o && 11428 !e.hasOwnProperty(s) && 11429 ((e[s] = 3 * o), 11430 this.trigger('info', { 11431 message: t + ` defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[s]}).` 11432 })), 11433 o) && 11434 e[s] < n && 11435 (this.trigger('warn', { 11436 message: t + ` clamping PART-HOLD-BACK (${e[s]}) to partTargetDuration * 2 (${n}).` 11437 }), 11438 (e[s] = n)); 11439 } 11440 class Xn extends Yr { 11441 constructor(e = {}) { 11442 (super(), 11443 (this.lineStream = new qn()), 11444 (this.parseStream = new $n()), 11445 this.lineStream.pipe(this.parseStream), 11446 (this.mainDefinitions = e.mainDefinitions || {}), 11447 (this.params = new URL(e.uri, 'https://a.com').searchParams), 11448 (this.lastProgramDateTime = null)); 11449 let r = this, 11450 a = [], 11451 o = {}, 11452 l, 11453 d, 11454 h = !1, 11455 u = { AUDIO: {}, VIDEO: {}, 'CLOSED-CAPTIONS': {}, SUBTITLES: {} }, 11456 c = 0, 11457 p = 11458 ((this.manifest = { 11459 allowCache: !0, 11460 discontinuityStarts: [], 11461 dateRanges: [], 11462 iFramePlaylists: [], 11463 segments: [] 11464 }), 11465 0), 11466 m = 0, 11467 g = {}; 11468 (this.on('end', () => { 11469 o.uri || 11470 (!o.parts && !o.preloadHints) || 11471 (!o.map && l && (o.map = l), 11472 !o.key && d && (o.key = d), 11473 o.timeline || 'number' != typeof c || (o.timeline = c), 11474 (this.manifest.preloadSegment = o)); 11475 }), 11476 this.parseStream.on('data', function (n) { 11477 let t, i; 11478 if (r.manifest.definitions) 11479 for (var e in r.manifest.definitions) 11480 if ( 11481 (n.uri && (n.uri = n.uri.replace(`{$${e}}`, r.manifest.definitions[e])), 11482 n.attributes) 11483 ) 11484 for (var s in n.attributes) 11485 'string' == typeof n.attributes[s] && 11486 (n.attributes[s] = n.attributes[s].replace( 11487 `{$${e}}`, 11488 r.manifest.definitions[e] 11489 )); 11490 ({ 11491 tag() { 11492 ( 11493 ({ 11494 version() { 11495 n.version && (this.manifest.version = n.version); 11496 }, 11497 'allow-cache'() { 11498 ((this.manifest.allowCache = n.allowed), 11499 'allowed' in n || 11500 (this.trigger('info', { message: 'defaulting allowCache to YES' }), 11501 (this.manifest.allowCache = !0))); 11502 }, 11503 byterange() { 11504 var e = {}; 11505 ('length' in n && 11506 (((o.byterange = e).length = n.length), 'offset' in n || (n.offset = p)), 11507 'offset' in n && ((o.byterange = e).offset = n.offset), 11508 (p = e.offset + e.length)); 11509 }, 11510 endlist() { 11511 this.manifest.endList = !0; 11512 }, 11513 inf() { 11514 ('mediaSequence' in this.manifest || 11515 ((this.manifest.mediaSequence = 0), 11516 this.trigger('info', { message: 'defaulting media sequence to zero' })), 11517 'discontinuitySequence' in this.manifest || 11518 ((this.manifest.discontinuitySequence = 0), 11519 this.trigger('info', { 11520 message: 'defaulting discontinuity sequence to zero' 11521 })), 11522 n.title && (o.title = n.title),
11523 0 < n.duration && (o.duration = n.duration), 11524 0 === n.duration && 11525 ((o.duration = 0.01), 11526 this.trigger('info', { 11527 message: 'updating zero segment duration to a small value' 11528 })), 11529 (this.manifest.segments = a)); 11530 }, 11531 key() { 11532 if (n.attributes) 11533 if ('NONE' === n.attributes.METHOD) d = null; 11534 else if (n.attributes.URI) 11535 if ('com.apple.streamingkeydelivery' === n.attributes.KEYFORMAT) 11536 ((this.manifest.contentProtection = 11537 this.manifest.contentProtection || {}), 11538 (this.manifest.contentProtection['com.apple.fps.1_0'] = { 11539 attributes: n.attributes 11540 })); 11541 else if ('com.microsoft.playready' === n.attributes.KEYFORMAT) 11542 ((this.manifest.contentProtection = 11543 this.manifest.contentProtection || {}), 11544 (this.manifest.contentProtection['com.microsoft.playready'] = { 11545 uri: n.attributes.URI 11546 })); 11547 else { 11548 if ( 11549 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed' === 11550 n.attributes.KEYFORMAT 11551 ) 11552 return -1 === 11553 ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'].indexOf( 11554 n.attributes.METHOD 11555 ) 11556 ? void this.trigger('warn', { 11557 message: 'invalid key method provided for Widevine' 11558 }) 11559 : ('SAMPLE-AES-CENC' === n.attributes.METHOD && 11560 this.trigger('warn', { 11561 message: 11562 'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead' 11563 }), 11564 'data:text/plain;base64,' !== n.attributes.URI.substring(0, 23) 11565 ? void this.trigger('warn', { 11566 message: 'invalid key URI provided for Widevine' 11567 }) 11568 : n.attributes.KEYID && 11569 '0x' === n.attributes.KEYID.substring(0, 2) 11570 ? ((this.manifest.contentProtection = 11571 this.manifest.contentProtection || {}), 11572 void (this.manifest.contentProtection['com.widevine.alpha'] = 11573 { 11574 attributes: { 11575 schemeIdUri: n.attributes.KEYFORMAT, 11576 keyId: n.attributes.KEYID.substring(2) 11577 }, 11578 pssh: Fn(n.attributes.URI.split(',')[1]) 11579 })) 11580 : void this.trigger('warn', { 11581 message: 'invalid key ID provided for Widevine' 11582 })); 11583 (n.attributes.METHOD || 11584 this.trigger('warn', { message: 'defaulting key method to AES-128' }), 11585 (d = { 11586 method: n.attributes.METHOD || 'AES-128', 11587 uri: n.attributes.URI 11588 }), 11589 'undefined' != typeof n.attributes.IV && (d.iv = n.attributes.IV)); 11590 } 11591 else 11592 this.trigger('warn', { message: 'ignoring key declaration without URI' }); 11593 else 11594 this.trigger('warn', { 11595 message: 'ignoring key declaration without attribute list' 11596 }); 11597 }, 11598 'media-sequence'() { 11599 isFinite(n.number) 11600 ? (this.manifest.mediaSequence = n.number) 11601 : this.trigger('warn', { 11602 message: 'ignoring invalid media sequence: ' + n.number 11603 }); 11604 }, 11605 'discontinuity-sequence'() { 11606 isFinite(n.number) 11607 ? ((this.manifest.discontinuitySequence = n.number), (c = n.number)) 11608 : this.trigger('warn', { 11609 message: 'ignoring invalid discontinuity sequence: ' + n.number 11610 }); 11611 }, 11612 'playlist-type'() { 11613 /VOD|EVENT/.test(n.playlistType) 11614 ? (this.manifest.playlistType = n.playlistType) 11615 : this.trigger('warn', { 11616 message: 'ignoring unknown playlist type: ' + n.playlist 11617 }); 11618 }, 11619 map() { 11620 ((l = {}), 11621 n.uri && (l.uri = n.uri),
11622 n.byterange && (l.byterange = n.byterange), 11623 d && (l.key = d)); 11624 }, 11625 'stream-inf'() { 11626 ((this.manifest.playlists = a), 11627 (this.manifest.mediaGroups = this.manifest.mediaGroups || u), 11628 n.attributes 11629 ? (o.attributes || (o.attributes = {}), f(o.attributes, n.attributes)) 11630 : this.trigger('warn', { 11631 message: 'ignoring empty stream-inf attributes' 11632 })); 11633 }, 11634 media() { 11635 var e; 11636 ((this.manifest.mediaGroups = this.manifest.mediaGroups || u), 11637 n.attributes && 11638 n.attributes.TYPE && 11639 n.attributes['GROUP-ID'] && 11640 n.attributes.NAME 11641 ? (((e = this.manifest.mediaGroups[n.attributes.TYPE])[ 11642 n.attributes['GROUP-ID'] 11643 ] = e[n.attributes['GROUP-ID']] || {}), 11644 (t = e[n.attributes['GROUP-ID']]), 11645 (i = { default: /yes/i.test(n.attributes.DEFAULT) }).default 11646 ? (i.autoselect = !0) 11647 : (i.autoselect = /yes/i.test(n.attributes.AUTOSELECT)), 11648 n.attributes.LANGUAGE && (i.language = n.attributes.LANGUAGE), 11649 n.attributes.URI && (i.uri = n.attributes.URI), 11650 n.attributes['INSTREAM-ID'] && 11651 (i.instreamId = n.attributes['INSTREAM-ID']), 11652 n.attributes.CHARACTERISTICS && 11653 (i.characteristics = n.attributes.CHARACTERISTICS), 11654 n.attributes.FORCED && (i.forced = /yes/i.test(n.attributes.FORCED)), 11655 (t[n.attributes.NAME] = i)) 11656 : this.trigger('warn', { 11657 message: 'ignoring incomplete or missing media group' 11658 })); 11659 }, 11660 discontinuity() { 11661 ((c += 1), 11662 (o.discontinuity = !0), 11663 this.manifest.discontinuityStarts.push(a.length)); 11664 }, 11665 'program-date-time'() { 11666 ('undefined' == typeof this.manifest.dateTimeString && 11667 ((this.manifest.dateTimeString = n.dateTimeString), 11668 (this.manifest.dateTimeObject = n.dateTimeObject)), 11669 (o.dateTimeString = n.dateTimeString), 11670 (o.dateTimeObject = n.dateTimeObject)); 11671 var e = this.lastProgramDateTime; 11672 ((this.lastProgramDateTime = new Date(n.dateTimeString).getTime()), 11673 null === e && 11674 this.manifest.segments.reduceRight( 11675 (e, t) => ((t.programDateTime = e - 1e3 * t.duration), t.programDateTime), 11676 this.lastProgramDateTime
11677 )); 11678 }, 11679 targetduration() { 11680 !isFinite(n.duration) || n.duration < 0 11681 ? this.trigger('warn', { 11682 message: 'ignoring invalid target duration: ' + n.duration 11683 }) 11684 : ((this.manifest.targetDuration = n.duration), Gn.call(this, this.manifest)); 11685 }, 11686 start() { 11687 !n.attributes || isNaN(n.attributes['TIME-OFFSET']) 11688 ? this.trigger('warn', { 11689 message: 'ignoring start declaration without appropriate attribute list' 11690 }) 11691 : (this.manifest.start = { 11692 timeOffset: n.attributes['TIME-OFFSET'], 11693 precise: n.attributes.PRECISE 11694 }); 11695 }, 11696 'cue-out'() { 11697 o.cueOut = n.data; 11698 }, 11699 'cue-out-cont'() { 11700 o.cueOutCont = n.data; 11701 }, 11702 'cue-in'() { 11703 o.cueIn = n.data; 11704 }, 11705 skip() { 11706 ((this.manifest.skip = Wn(n.attributes)), 11707 this.warnOnMissingAttributes_('#EXT-X-SKIP', n.attributes, [ 11708 'SKIPPED-SEGMENTS' 11709 ])); 11710 }, 11711 part() { 11712 h = !0; 11713 var e = this.manifest.segments.length, 11714 t = Wn(n.attributes), 11715 t = 11716 ((o.parts = o.parts || []), 11717 o.parts.push(t), 11718 t.byterange && 11719 (t.byterange.hasOwnProperty('offset') || (t.byterange.offset = m), 11720 (m = t.byterange.offset + t.byterange.length)), 11721 o.parts.length - 1); 11722 (this.warnOnMissingAttributes_( 11723 `#EXT-X-PART #${t} for segment #` + e, 11724 n.attributes, 11725 ['URI', 'DURATION'] 11726 ), 11727 this.manifest.renditionReports && 11728 this.manifest.renditionReports.forEach((e, t) => { 11729 e.hasOwnProperty('lastPart') || 11730 this.trigger('warn', { 11731 message: `#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART` 11732 }); 11733 })); 11734 }, 11735 'server-control'() { 11736 var e = (this.manifest.serverControl = Wn(n.attributes)); 11737 (e.hasOwnProperty('canBlockReload') || 11738 ((e.canBlockReload = !1), 11739 this.trigger('info', { 11740 message: '#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false' 11741 })), 11742 Gn.call(this, this.manifest), 11743 e.canSkipDateranges && 11744 !e.hasOwnProperty('canSkipUntil') && 11745 this.trigger('warn', { 11746 message: 11747 '#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set' 11748 })); 11749 }, 11750 'preload-hint'() { 11751 var t = this.manifest.segments.length, 11752 i = Wn(n.attributes), 11753 e = i.type && 'PART' === i.type, 11754 s = 11755 ((o.preloadHints = o.preloadHints || []), 11756 o.preloadHints.push(i), 11757 !i.byterange || 11758 i.byterange.hasOwnProperty('offset') || 11759 ((i.byterange.offset = e ? m : 0), 11760 e && (m = i.byterange.offset + i.byterange.length)), 11761 o.preloadHints.length - 1); 11762 if ( 11763 (this.warnOnMissingAttributes_( 11764 `#EXT-X-PRELOAD-HINT #${s} for segment #` + t, 11765 n.attributes, 11766 ['TYPE', 'URI'] 11767 ), 11768 i.type) 11769 ) 11770 for (let e = 0; e < o.preloadHints.length - 1; e++) { 11771 var r = o.preloadHints[e]; 11772 r.type && 11773 r.type === i.type && 11774 this.trigger('warn', { 11775 message: 11776 `#EXT-X-PRELOAD-HINT #${s} for segment #${t} has the same TYPE ${i.type} as preload hint #` + 11777 e 11778 }); 11779 } 11780 }, 11781 'rendition-report'() { 11782 var e = Wn(n.attributes), 11783 e = 11784 ((this.manifest.renditionReports = this.manifest.renditionReports || []), 11785 this.manifest.renditionReports.push(e), 11786 this.manifest.renditionReports.length - 1), 11787 t = ['LAST-MSN', 'URI']; 11788 (h && t.push('LAST-PART'), 11789 this.warnOnMissingAttributes_( 11790 '#EXT-X-RENDITION-REPORT #' + e, 11791 n.attributes, 11792 t 11793 )); 11794 }, 11795 'part-inf'() { 11796 ((this.manifest.partInf = Wn(n.attributes)), 11797 this.warnOnMissingAttributes_('#EXT-X-PART-INF', n.attributes, [ 11798 'PART-TARGET' 11799 ]), 11800 this.manifest.partInf.partTarget && 11801 (this.manifest.partTargetDuration = this.manifest.partInf.partTarget), 11802 Gn.call(this, this.manifest)); 11803 }, 11804 daterange() { 11805 this.manifest.dateRanges.push(Wn(n.attributes)); 11806 var e = this.manifest.dateRanges.length - 1; 11807 this.warnOnMissingAttributes_('#EXT-X-DATERANGE #' + e, n.attributes, [ 11808 'ID', 11809 'START-DATE' 11810 ]); 11811 let t = this.manifest.dateRanges[e]; 11812 (t.endDate && 11813 t.startDate && 11814 new Date(t.endDate) < new Date(t.startDate) && 11815 this.trigger('warn', { 11816 message: 11817 'EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE' 11818 }), 11819 t.duration && 11820 t.duration < 0 && 11821 this.trigger('warn', { 11822 message: 'EXT-X-DATERANGE DURATION must not be negative' 11823 }), 11824 t.plannedDuration && 11825 t.plannedDuration < 0 && 11826 this.trigger('warn', { 11827 message: 'EXT-X-DATERANGE PLANNED-DURATION must not be negative' 11828 })); 11829 var i = !!t.endOnNext; 11830 if ( 11831 (i && 11832 !t.class && 11833 this.trigger('warn', { 11834 message: 11835 'EXT-X-DATERANGE with an END-ON-NEXT
11835=YES attribute must have a CLASS attribute' 11836 }), 11837 i && 11838 (t.duration || t.endDate) && 11839 this.trigger('warn', { 11840 message: 11841 'EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes' 11842 }), 11843 t.duration && 11844 t.endDate && 11845 ((i = t.startDate.getTime() + 1e3 * t.duration), 11846 (this.manifest.dateRanges[e].endDate = new Date(i))), 11847 g[t.id]) 11848 ) { 11849 for (var s in g[t.id]) 11850 if (t[s] && JSON.stringify(g[t.id][s]) !== JSON.stringify(t[s])) { 11851 this.trigger('warn', { 11852 message: 11853 'EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values' 11854 }); 11855 break; 11856 } 11857 e = this.manifest.dateRanges.findIndex((e) => e.id === t.id); 11858 ((this.manifest.dateRanges[e] = f(this.manifest.dateRanges[e], t)), 11859 (g[t.id] = f(g[t.id], t)), 11860 this.manifest.dateRanges.pop()); 11861 } else g[t.id] = t; 11862 }, 11863 'independent-segments'() { 11864 this.manifest.independentSegments = !0; 11865 }, 11866 'i-frames-only'() { 11867 ((this.manifest.iFramesOnly = !0), 11868 this.requiredCompatibilityversion(this.manifest.version, 4)); 11869 }, 11870 'content-steering'() { 11871 ((this.manifest.contentSteering = Wn(n.attributes)), 11872 this.warnOnMissingAttributes_('#EXT-X-CONTENT-STEERING', n.attributes, [ 11873 'SERVER-URI' 11874 ])); 11875 }, 11876 define() { 11877 this.manifest.definitions = this.manifest.definitions || {}; 11878 var e, 11879 t = (e, t) => { 11880 e in this.manifest.definitions 11881 ? this.trigger('error', { message: 'EXT-X-DEFINE: Duplicate name ' + e }) 11882 : (this.manifest.definitions[e] = t); 11883 }; 11884 return 'QUERYPARAM' in n.attributes 11885 ? 'NAME' in n.attributes || 'IMPORT' in n.attributes 11886 ? void this.trigger('error', { 11887 message: 'EXT-X-DEFINE: Invalid attributes' 11888 }) 11889 : (e = this.params.get(n.attributes.QUERYPARAM)) 11890 ? void t(n.attributes.QUERYPARAM, decodeURIComponent(e)) 11891 : void this.trigger('error', { 11892 message: 'EXT-X-DEFINE: No query param ' + n.attributes.QUERYPARAM 11893 }) 11894 : 'NAME' in n.attributes 11895 ? 'IMPORT' in n.attributes 11896 ? void this.trigger('error', { 11897 message: 'EXT-X-DEFINE: Invalid attributes' 11898 }) 11899 : 'VALUE' in n.attributes && 'string' == typeof n.attributes.VALUE 11900 ? void t(n.attributes.NAME, n.attributes.VALUE) 11901 : void this.trigger('error', { 11902 message: 'EXT-X-DEFINE: No value for ' + n.attributes.NAME 11903 }) 11904 : 'IMPORT' in n.attributes 11905 ? this.mainDefinitions[n.attributes.IMPORT] 11906 ? void t(n.attributes.IMPORT, this.mainDefinitions[n.attributes.IMPORT]) 11907 : void this.trigger('error', { 11908 message: `EXT-X-DEFINE: No value ${n.attributes.IMPORT} to import, or IMPORT used on main playlist` 11909 }) 11910 : void this.trigger('error', { message: 'EXT-X-DEFINE: No attribute' }); 11911 }, 11912 'i-frame-playlist'() { 11913 (this.manifest.iFramePlaylists.push({ 11914 attributes: n.attributes, 11915 uri: n.uri, 11916 timeline: c 11917 }), 11918 this.warnOnMissingAttributes_('#EXT-X-I-FRAME-STREAM-INF', n.attributes, [ 11919 'BANDWIDTH', 11920 'URI' 11921 ])); 11922 } 11923 })[n.tagType] || function () {} 11924 ).call(r); 11925 }, 11926 uri() { 11927 ((o.uri = n.uri), 11928 a.push(o), 11929 !this.manifest.targetDuration || 11930 'duration' in o || 11931 (this.trigger('warn', { 11932 message: 'defaulting segment duration to the target duration' 11933 }), 11934 (o.duration = this.manifest.targetDuration)), 11935 d && (o.key = d), 11936 (o.timeline = c), 11937 l && (o.map = l), 11938 (m = 0), 11939 null !== this.lastProgramDateTime && 11940 ((o.programDateTime = this.lastProgramDateTime), 11941 (this.lastProgramDateTime += 1e3 * o.duration)), 11942 (o = {})); 11943 }, 11944 comment() {}, 11945 custom() { 11946 n.segment 11947 ? ((o.custom = o.custom || {}), (o.custom[n.customType] = n.data)) 11948 : ((this.manifest.custom = this.manifest.custom || {}), 11949 (this.manifest.custom[n.customType] = n.data)); 11950 } 11951 })[n.type].call(r); 11952 })); 11953 } 11954 requiredCompatibilityversion(e, t) { 11955 (e < t || !e) && this.trigger('warn', { message: 'manifest must be at least version ' + t }); 11956 } 11957 warnOnMissingAttributes_(e, t, i) { 11958 let s = []; 11959 (i.forEach(function (e) { 11960 t.hasOwnProperty(e) || s.push(e); 11961 }), 11962 s.length && 11963 this.trigger('warn', { message: e + ' lacks required attribute(s): ' + s.join(', ') })); 11964 } 11965 push(e) { 11966 this.lineStream.push(e); 11967 } 11968 end() { 11969 (this.lineStream.push('\n'), 11970 this.manifest.dateRanges.length && 11971 null === this.lastProgramDateTime && 11972 this.trigger('warn', { 11973 message: 11974 'A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag' 11975 }), 11976 (this.lastProgramDateTime = null),
11977 this.trigger('end')); 11978 } 11979 addParser(e) { 11980 this.parseStream.addParser(e); 11981 } 11982 addTagMapper(e) { 11983 this.parseStream.addTagMapper(e); 11984 } 11985 } 11986 function Kn(e) { 11987 return ta.audio.test((e = void 0 === e ? '' : e).trim().toLowerCase()); 11988 } 11989 function Yn(e) { 11990 return ta.text.test((e = void 0 === e ? '' : e).trim().toLowerCase()); 11991 } 11992 function Qn(e, t) { 11993 return ( 11994 void 0 === e && (e = ''), 11995 void 0 === t && (t = !1), 11996 (window.MediaSource && 11997 window.MediaSource.isTypeSupported && 11998 window.MediaSource.isTypeSupported(aa(e))) || 11999 (t && 12000 window.ManagedMediaSource && 12001 window.ManagedMediaSource.isTypeSupported && 12002 window.ManagedMediaSource.isTypeSupported(aa(e))) || 12003 !1 12004 ); 12005 } 12006 function Jn(e) { 12007 return (e = void 0 === e ? '' : e) 12008 .toLowerCase() 12009 .split(',') 12010 .every(function (e) { 12011 e = e.trim(); 12012 for (var t = 0; t < sa.length; t++) { 12013 var i = sa[t]; 12014 if (ta['muxer' + i].test(e)) return !0; 12015 } 12016 return !1; 12017 }); 12018 } 12019 function Zn(e) { 12020 return la.test(e) 12021 ? 'hls' 12022 : da.test(e) 12023 ? 'dash' 12024 : 'application/vnd.videojs.vhs+json' === e 12025 ? 'vhs-json' 12026 : null; 12027 } 12028 function ea(e) { 12029 return ca(e); 12030 } 12031 var ta = { 12032 mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/, 12033 webm: /^(vp0?[89]|av0?1|opus|vorbis)/, 12034 ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/, 12035 video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/, 12036 audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/, 12037 text: /^(stpp.ttml.im1t)/, 12038 muxerVideo: /^(avc0?1)/, 12039 muxerAudio: /^(mp4a)/, 12040 muxerText: /a^/ 12041 }, 12042 ia = ['video', 'audio', 'text'], 12043 sa = ['Video', 'Audio', 'Text'], 12044 ra = function (e) { 12045 return ( 12046 e && 12047 e.replace(/avc1\.(\d+)\.(\d+)/i, function (e, t, i) { 12048 return ( 12049 'avc1.' + 12050 ('00' + Number(t).toString(16)).slice(-2) + 12051 '00' + 12052 ('00' + Number(i).toString(16)).slice(-2) 12053 ); 12054 }) 12055 ); 12056 }, 12057 na = function (e) { 12058 var e = (e = void 0 === e ? '' : e).split(','), 12059 n = []; 12060 return ( 12061 e.forEach(function (s) { 12062 var r; 12063 ((s = s.trim()), 12064 ia.forEach(function (e) { 12065 var t, 12066 i = ta[e].exec(s.toLowerCase()); 12067 !i || 12068 i.length <= 1 || 12069 ((r = e), 12070 (i = s.substring(0, i[1].length)), 12071 (t = s.replace(i, '')), 12072 n.push({ type: i, details: t, mediaType: e })); 12073 }), 12074 r || n.push({ type: s, details: '', mediaType: 'unknown' })); 12075 }), 12076 n 12077 ); 12078 }, 12079 aa = function (e) { 12080 var t, i, s; 12081 if (e && 'string' == typeof e) 12082 return ( 12083 (i = 'video'), 12084 1 === 12085 (t = e 12086 .toLowerCase() 12087 .split(',') 12088 .map(function (e) { 12089 return ra(e.trim()); 12090 })).length && Kn(t[0]) 12091 ? (i = 'audio') 12092 : 1 === t.length && Yn(t[0]) && (i = 'application'), 12093 (s = 'mp4'), 12094 t.every(function (e) { 12095 return ta.mp4.test(e); 12096 }) 12097 ? (s = 'mp4') 12098 : t.every(function (e) { 12099 return ta.webm.test(e); 12100 }) 12101 ? (s = 'webm') 12102 : t.every(function (e) { 12103 return ta.ogg.test(e); 12104 }) && (s = 'ogg'), 12105 i + '/' + s + ';codecs="' + e + '"' 12106 ); 12107 }, 12108 oa = 'mp4a.40.2', 12109 la = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i, 12110 da = /^application\/dash\+xml/i, 12111 ha = function (e) { 12112 return e.toString(2).length; 12113 }, 12114 ua = function (e) { 12115 return Math.ceil(ha(e) / 8); 12116 }, 12117 ca = function (e) { 12118 return 'function' === ArrayBuffer.isView 12119 ? ArrayBuffer.isView(e) 12120 : e && e.buffer instanceof ArrayBuffer; 12121 }, 12122 S = function (e) { 12123 return e instanceof Uint8Array 12124 ? e 12125 : (Array.isArray(e) || 12126 ea(e) || 12127 e instanceof ArrayBuffer || 12128 (e = 'number' != typeof e || ('number' == typeof e && e != e) ? 0 : [e]), 12129 new Uint8Array((e && e.buffer) || e, (e && e.byteOffset) || 0, (e && e.byteLength) || 0)); 12130 }, 12131 w = window.BigInt || Number, 12132 pa = [ 12133 w('0x1'), 12134 w('0x100'), 12135 w('0x10000'), 12136 w('0x1000000'), 12137 w('0x100000000'), 12138 w('0x10000000000'), 12139 w('0x1000000000000'), 12140 w('0x100000000000000'), 12141 w('0x10000000000000000') 12142 ], 12143 ma = 12144 ((Ii = new Uint16Array([65484])), 12145 (Ii = new Uint8Array(Ii.buffer, Ii.byteOffset, Ii.byteLength))[0], 12146 function (s, e) { 12147 var e = void 0 === e ? {} : e, 12148 t = e.signed, 12149 t = void 0 !== t && t, 12150 e = e.le, 12151 r = void 0 !== e && e, 12152 e = ((s = S(s)), r ? 'reduce' : 'reduceRight'), 12153 e = (s[e] || Array.prototype[e]).call( 12154 s, 12155 function (e, t, i) { 12156 i = r ? i : Math.abs(i + 1 - s.length); 12157 return e + w(t) * pa[i]; 12158 }, 12159 w(0) 12160 ); 12161 return ( 12162 t && (t = pa[s.length] / w(2) - w(1)) < (e = w(e)) && (e = (e = e - t - t) - w(2)), 12163 Number(e) 12164 ); 12165 }), 12166 ga = function (e, t) { 12167 for ( 12168 var t = (void 0 === t ? {} : t).le, 12169 i = void 0 !== t && t, 12170 s = 12171 ((e = w( 12172 (e = 12173 ('bigint' != typeof e && 'number' != typeof e) || ('number' == typeof e && e != e) 12174 ? 0 12175 : e) 12176 )), 12177 ua(e)), 12178 r = new Uint8Array(new ArrayBuffer(s)), 12179 n = 0; 12180 n < s; 12181 n++ 12182 ) { 12183 var a = i ? n : Math.abs(n + 1 - r.length); 12184 ((r[a] = Number((e / pa[n]) & w(255))), 12185 e < 0 && ((r[a] = Math.abs(~r[a])), (r[a] -= 0 === n ? 1 : 2))); 12186 } 12187 return r; 12188 }, 12189 fa = function (e, t) { 12190 if ( 12191 'string' != 12192 typeof (e = 'string' != typeof e && e && 'function' == typeof e.toString ? e.toString() : e) 12193 ) 12194 return new Uint8Array(); 12195 t || (e = unescape(encodeURIComponent(e))); 12196 for (var i = new Uint8Array(e.length), s = 0; s < e.length; s++) i[s] = e.charCodeAt(s); 12197 return i; 12198 }, 12199 C = function (i, e, t) { 12200 var t = void 0 === t ? {} : t, 12201 s = t.offset, 12202 r = void 0 === s ? 0 : s, 12203 s = t.mask, 12204 n = void 0 === s ? [] : s, 12205 t = ((i = S(i)), (e = S(e)).every || Array.prototype.every); 12206 return ( 12207 e.length && 12208 i.length - r >= e.length && 12209 t.call(e, function (e, t) { 12210 return e === (n[t] ? n[t] & i[r + t] : i[r + t]); 12211 }) 12212 ); 12213 }, 12214 ya = function (r, e, n) { 12215 e.forEach(function (e) { 12216 for (var t in r.mediaGroups[e]) 12217 for (var i in r.mediaGroups[e][t]) { 12218 var s = r.mediaGroups[e][t][i]; 12219 n(s, e, t, i); 12220 } 12221 }); 12222 }; 12223 function _a(e, t) { 12224 return (t = void 0 === t ? Object : t) && 'function' == typeof t.freeze ? t.freeze(e) : e; 12225 } 12226 var va = _a({ 12227 HTML: 'text/html', 12228 isHTML: function (e) { 12229 return e === va.HTML; 12230 }, 12231 XML_APPLICATION: 'application/xml', 12232 XML_TEXT: 'text/xml', 12233 XML_XHTML_APPLICATION: 'application/xhtml+xml', 12234 XML_SVG_IMAGE: 'image/svg+xml' 12235 }), 12236 ba = _a({ 12237 HTML: 'http://www.w3.org/1999/xhtml', 12238 isHTML: function (e) { 12239 return e === ba.HTML; 12240 }, 12241 SVG: 'http://www.w3.org/2000/svg', 12242 XML: 'http://www.w3.org/XML/1998/namespace', 12243 XMLNS: 'http://www.w3.org/2000/xmlns/' 12244 }), 12245 Ta = { 12246 assign: function (e, t) { 12247 if (null === e || 'object' != typeof e) throw new TypeError('target is not an object'); 12248 for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); 12249 return e; 12250 }, 12251 find: function (e, t, i) { 12252 if ((void 0 === i && (i = Array.prototype), e && 'function' == typeof i.find)) 12253 return i.find.call(e, t); 12254 for (var s = 0; s < e.length; s++) 12255 if (Object.prototype.hasOwnProperty.call(e, s)) { 12256 var r = e[s]; 12257 if (t.call(void 0, r, s, e)) return r; 12258 } 12259 }, 12260 freeze: _a, 12261 MIME_TYPE: va, 12262 NAMESPACE: ba 12263 }, 12264 Sa = Ta.find, 12265 wa = Ta.NAMESPACE; 12266 function Ea(e) { 12267 return '' !== e; 12268 } 12269 function Ca(e, t) { 12270 return (e.hasOwnProperty(t) || (e[t] = !0), e); 12271 } 12272 function ka(e) { 12273 return e 12274 ? ((e = (e = e) ? e.split(/[\t\n\f\r ]+/).filter(Ea) : []), Object.keys(e.reduce(Ca, {}))) 12275 : []; 12276 } 12277 function Ia(e, t) { 12278 for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); 12279 } 12280 function xa(e, t) { 12281 var i = e.prototype; 12282 function s() {} 12283 (i instanceof t || ((s.prototype = t.prototype), Ia(i, (s = new s())), (e.prototype = i = s)), 12284 i.constructor != e && (i.constructor = e)); 12285 } 12286 var n = {}, 12287 r = 12288 ((n.ELEMENT_NODE = 1), 12289 (n.ATTRIBUTE_NODE = 2), 12290 (n.TEXT_NODE = 3), 12291 (n.CDATA_SECTION_NODE = 4), 12292 (n.ENTITY_REFERENCE_NODE = 5), 12293 (n.ENTITY_NODE = 6), 12294 (n.PROCESSING_INSTRUCTION_NODE = 7), 12295 (n.COMMENT_NODE = 8), 12296 (n.DOCUMENT_NODE = 9), 12297 (n.DOCUMENT_TYPE_NODE = 10), 12298 (n.DOCUMENT_FRAGMENT_NODE = 11), 12299 (n.NOTATION_NODE = 12), 12300 {}), 12301 k = {}, 12302 Aa = 12303 ((r.INDEX_SIZE_ERR = ((k[1] = 'Index size error'), 1)), 12304 (r.DOMSTRING_SIZE_ERR = ((k[2] = 'DOMString size error'), 2)), 12305 (r.HIERARCHY_REQUEST_ERR = ((k[3] = 'Hierarchy request error'), 3))), 12306 Da = 12307 ((r.WRONG_DOCUMENT_ERR = ((k[4] = 'Wrong document'), 4)), 12308 (r.INVALID_CHARACTER_ERR = ((k[5] = 'Invalid character'), 5)),
12309 (r.NO_DATA_ALLOWED_ERR = ((k[6] = 'No data allowed'), 6)), 12310 (r.NO_MODIFICATION_ALLOWED_ERR = ((k[7] = 'No modification allowed'), 7)), 12311 (r.NOT_FOUND_ERR = ((k[8] = 'Not found'), 8))); 12312 ((r.NOT_SUPPORTED_ERR = ((k[9] = 'Not supported'), 9)), 12313 (r.INUSE_ATTRIBUTE_ERR = ((k[10] = 'Attribute in use'), 10))); 12314 function I(e, t) { 12315 var i; 12316 return ( 12317 t instanceof Error 12318 ? (i = t) 12319 : ((i = this), 12320 Error.call(this, k[e]), 12321 (this.message = k[e]), 12322 Error.captureStackTrace && Error.captureStackTrace(this, I)), 12323 (i.code = e), 12324 t && (this.message = this.message + ': ' + t), 12325 i 12326 ); 12327 } 12328 function Pa() {} 12329 function La(e, t) { 12330 ((this._node = e), (this._refresh = t), Oa(this)); 12331 } 12332 function Oa(e) { 12333 var t = e._node._inc || e._node.ownerDocument._inc; 12334 if (e._inc !== t) { 12335 var i = e._refresh(e._node); 12336 if ((_o(e, 'length', i.length), !e.$$length || i.length < e.$$length)) 12337 for (var s = i.length; s in e; s++) 12338 Object.prototype.hasOwnProperty.call(e, s) && delete e[s]; 12339 (Ia(i, e), (e._inc = t)); 12340 } 12341 } 12342 function Ra() {} 12343 function Na(e, t) { 12344 for (var i = e.length; i--; ) if (e[i] === t) return i; 12345 } 12346 function Ma(e, t, i, s) { 12347 (s ? (t[Na(t, s)] = i) : (t[t.length++] = i), 12348 e && 12349 (t = (i.ownerElement = e).ownerDocument) && 12350 (s && Va(t, e, s), (s = e), (e = i), (i = t) && i._inc++, e.namespaceURI === wa.XMLNS) && 12351 (s._nsMap[e.prefix ? e.localName : ''] = e.value)); 12352 } 12353 function Ua(e, t, i) { 12354 var s = Na(t, i); 12355 if (!(0 <= s)) throw new I(Da, new Error(e.tagName + '@' + i)); 12356 for (var r, n = t.length - 1; s < n; ) t[s] = t[++s]; 12357 ((t.length = n), e && (r = e.ownerDocument) && (Va(r, e, i), (i.ownerElement = null))); 12358 } 12359 function Ba() {} 12360 function x() {} 12361 function Fa(e) { 12362 return ( 12363 ('<' == e ? '<' : '>' == e && '>') || 12364 ('&' == e ? '&' : '"' == e && '"') || 12365 '&#' + e.charCodeAt() + ';' 12366 ); 12367 } 12368 function qa(e, t) { 12369 if (t(e)) return 1; 12370 if ((e = e.firstChild)) 12371 do { 12372 if (qa(e, t)) return 1; 12373 } while ((e = e.nextSibling)); 12374 } 12375 function ja() { 12376 this.ownerDocument = this; 12377 } 12378 function Va(e, t, i) { 12379 (e && e._inc++, i.namespaceURI === wa.XMLNS && delete t._nsMap[i.prefix ? i.localName : '']); 12380 } 12381 function Ha(e, t, i) { 12382 if (e && e._inc) { 12383 e._inc++; 12384 var s = t.childNodes; 12385 if (i) s[s.length++] = i; 12386 else { 12387 for (var r = t.firstChild, n = 0; r; ) r = (s[n++] = r).nextSibling; 12388 ((s.length = n), delete s[s.length]); 12389 } 12390 } 12391 } 12392 function za(e, t) { 12393 var i = t.previousSibling, 12394 s = t.nextSibling; 12395 return ( 12396 i ? (i.nextSibling = s) : (e.firstChild = s), 12397 s ? (s.previousSibling = i) : (e.lastChild = i), 12398 (t.parentNode = null), 12399 (t.previousSibling = null), 12400 (t.nextSibling = null), 12401 Ha(e.ownerDocument, e), 12402 t 12403 ); 12404 } 12405 function $a(e) { 12406 return e && e.nodeType === x.DOCUMENT_TYPE_NODE; 12407 } 12408 function Wa(e) { 12409 return e && e.nodeType === x.ELEMENT_NODE; 12410 } 12411 function Ga(e) { 12412 return e && e.nodeType === x.TEXT_NODE; 12413 } 12414 function Xa(e, t) { 12415 var i, 12416 e = e.childNodes || []; 12417 if (!Sa(e, Wa) && !$a(t)) return ((i = Sa(e, $a)), !(t && i && e.indexOf(i) > e.indexOf(t))); 12418 } 12419 function Ka(e, t) { 12420 var i, 12421 e = e.childNodes || []; 12422 if ( 12423 !Sa(e, function (e) { 12424 return Wa(e) && e !== t; 12425 }) 12426 ) 12427 return ((i = Sa(e, $a)), !(t && i && e.indexOf(i) > e.indexOf(t))); 12428 } 12429 function Ya(e, t, i) { 12430 if ( 12431 !(s = e) || 12432 (s.nodeType !== x.DOCUMENT_NODE && 12433 s.nodeType !== x.DOCUMENT_FRAGMENT_NODE && 12434 s.nodeType !== x.ELEMENT_NODE) 12435 ) 12436 throw new I(Aa, 'Unexpected parent node type ' + e.nodeType); 12437 var s; 12438 if (i && i.parentNode !== e) throw new I(Da, 'child not in parent'); 12439 if ( 12440 !(s = t) || 12441 !( 12442 Wa(s) || 12443 Ga(s) || 12444 $a(s) || 12445 s.nodeType === x.DOCUMENT_FRAGMENT_NODE || 12446 s.nodeType === x.COMMENT_NODE || 12447 s.nodeType === x.PROCESSING_INSTRUCTION_NODE 12448 ) || 12449 ($a(t) && e.nodeType !== x.DOCUMENT_NODE) 12450 ) 12451 throw new I(Aa, 'Unexpected node type ' + t.nodeType + ' for parent node type ' + e.nodeType); 12452 } 12453 function Qa(e, t, i) { 12454 var s = e.childNodes || [], 12455 r = t.childNodes || []; 12456 if (t.nodeType === x.DOCUMENT_FRAGMENT_NODE) { 12457 var n = r.filter(Wa); 12458 if (1 < n.length || Sa(r, Ga)) throw new I(Aa, 'More than one element or text in fragment'); 12459 if (1 === n.length && !Xa(e, i)) 12460 throw new I(Aa, 'Element in fragment can not be inserted before doctype'); 12461 } 12462 if (Wa(t) && !Xa(e, i)) throw new I(Aa, 'Only one element can be added and only after doctype'); 12463 if ($a(t)) { 12464 if (Sa(s, $a)) throw new I(Aa, 'Only one doctype is allowed'); 12465 r = Sa(s, Wa); 12466 if (i && s.indexOf(r) < s.indexOf(i)) 12467 throw new I(Aa, 'Doctype can only be inserted before an element'); 12468 if (!i && r) throw new I(Aa, 'Doctype can not be appended since element is present'); 12469 } 12470 } 12471 function Ja(e, t, i) { 12472 var s = e.childNodes || [], 12473 r = t.childNodes || []; 12474 if (t.nodeType === x.DOCUMENT_FRAGMENT_NODE) { 12475 var n = r.filter(Wa); 12476 if (1 < n.length || Sa(r, Ga)) throw new I(Aa, 'More than one element or text in fragment'); 12477 if (1 === n.length && !Ka(e, i)) 12478 throw new I(Aa, 'Element in fragment can not be inserted before doctype'); 12479 } 12480 if (Wa(t) && !Ka(e, i)) throw new I(Aa, 'Only one element can be added and only after doctype'); 12481 if ($a(t)) { 12482 if ( 12483 Sa(s, function (e) { 12484 return $a(e) && e !== i; 12485 }) 12486 ) 12487 throw new I(Aa, 'Only one doctype is allowed'); 12488 r = Sa(s, Wa); 12489 if (i && s.indexOf(r) < s.indexOf(i)) 12490 throw new I(Aa, 'Doctype can only be inserted before an element'); 12491 } 12492 } 12493 function Za(e, t, i, s) { 12494 (Ya(e, t, i), e.nodeType === x.DOCUMENT_NODE && (s || Qa)(e, t, i)); 12495 s = t.parentNode; 12496 if ((s && s.removeChild(t), 11 === t.nodeType)) { 12497 var r = t.firstChild; 12498 if (null == r) return t;
12499 var n = t.lastChild; 12500 } else r = n = t; 12501 s = i ? i.previousSibling : e.lastChild; 12502 for ( 12503 r.previousSibling = s, 12504 n.nextSibling = i, 12505 s ? (s.nextSibling = r) : (e.firstChild = r), 12506 null == i ? (e.lastChild = n) : (i.previousSibling = n); 12507 (r.parentNode = e), r !== n && (r = r.nextSibling); 12508 12509 ); 12510 return ( 12511 Ha(e.ownerDocument || e, e), 12512 11 == t.nodeType && (t.firstChild = t.lastChild = null), 12513 t 12514 ); 12515 } 12516 function eo() { 12517 this._nsMap = {}; 12518 } 12519 function to() {} 12520 function io() {} 12521 function so() {} 12522 function ro() {} 12523 function no() {} 12524 function ao() {} 12525 function oo() {} 12526 function lo() {} 12527 function ho() {} 12528 function uo() {} 12529 function co() {} 12530 function po() {} 12531 function mo(e, t) { 12532 var i, 12533 s = [], 12534 r = (9 == this.nodeType && this.documentElement) || this, 12535 n = r.prefix, 12536 a = r.namespaceURI; 12537 return ( 12538 yo( 12539 this, 12540 s, 12541 e, 12542 t, 12543 (i = a && null == n && null == r.lookupPrefix(a) ? [{ namespace: a, prefix: null }] : i) 12544 ), 12545 s.join('') 12546 ); 12547 } 12548 function go(e, t, i) { 12549 var s = e.prefix || '', 12550 r = e.namespaceURI; 12551 if (r && ('xml' !== s || r !== wa.XML) && r !== wa.XMLNS) { 12552 for (var n = i.length; n--; ) { 12553 var a = i[n]; 12554 if (a.prefix === s) return a.namespace !== r; 12555 } 12556 return 1; 12557 } 12558 } 12559 function fo(e, t, i) { 12560 e.push(' ', t, '="', i.replace(/[<>&"\t\n\r]/g, Fa), '"'); 12561 } 12562 function yo(e, t, i, s, r) { 12563 if (((r = r || []), s)) { 12564 if (!(e = s(e))) return; 12565 if ('string' == typeof e) return void t.push(e); 12566 } 12567 switch (e.nodeType) { 12568 case 1: 12569 var n = e.attributes, 12570 a = n.length, 12571 o = e.firstChild, 12572 l = e.tagName, 12573 d = l; 12574 if (!(i = wa.isHTML(e.namespaceURI) || i) && !e.prefix && e.namespaceURI) { 12575 for (var h, u = 0; u < n.length; u++) 12576 if ('xmlns' === n.item(u).name) { 12577 h = n.item(u).value; 12578 break; 12579 } 12580 if (!h) 12581 for (var c = r.length - 1; 0 <= c; c--) 12582 if ('' === (p = r[c]).prefix && p.namespace === e.namespaceURI) { 12583 h = p.namespace; 12584 break; 12585 } 12586 if (h !== e.namespaceURI) 12587 for (var p, c = r.length - 1; 0 <= c; c--) 12588 if ((p = r[c]).namespace === e.namespaceURI) { 12589 p.prefix && (d = p.prefix + ':' + l); 12590 break; 12591 } 12592 } 12593 t.push('<', d); 12594 for (var m = 0; m < a; m++) 12595 'xmlns' == (g = n.item(m)).prefix 12596 ? r.push({ prefix: g.localName, namespace: g.value }) 12597 : 'xmlns' == g.nodeName && r.push({ prefix: '', namespace: g.value }); 12598 for (var g, f, y, m = 0; m < a; m++) 12599 (go((g = n.item(m)), 0, r) && 12600 (fo(t, (f = g.prefix || '') ? 'xmlns:' + f : 'xmlns', (y = g.namespaceURI)), 12601 r.push({ prefix: f, namespace: y })), 12602 yo(g, t, i, s, r)); 12603 if ( 12604 (l === d && 12605 go(e, 0, r) && 12606 (fo(t, (f = e.prefix || '') ? 'xmlns:' + f : 'xmlns', (y = e.namespaceURI)), 12607 r.push({ prefix: f, namespace: y })), 12608 o || (i && !/^(?:meta|link|img|br|hr|input)$/i.test(l))) 12609 ) { 12610 if ((t.push('>'), i && /^script$/i.test(l))) 12611 for (; o; ) (o.data ? t.push(o.data) : yo(o, t, i, s, r.slice()), (o = o.nextSibling)); 12612 else for (; o; ) (yo(o, t, i, s, r.slice()), (o = o.nextSibling)); 12613 t.push('</', d, '>'); 12614 } else t.push('/>'); 12615 return; 12616 case 9: 12617 case 11: 12618 for (o = e.firstChild; o; ) (yo(o, t, i, s, r.slice()), (o = o.nextSibling)); 12619 return; 12620 case 2: 12621 return fo(t, e.name, e.value); 12622 case 3: 12623 return t.push(e.data.replace(/[<&>]/g, Fa)); 12624 case 4: 12625 return t.push('<![CDATA[', e.data, ']]>'); 12626 case 8: 12627 return t.push('\x3c!--', e.data, '--\x3e'); 12628 case 10: 12629 var _ = e.publicId, 12630 v = e.systemId; 12631 return ( 12632 t.push('<!DOCTYPE ', e.name), 12633 void (_ 12634 ? (t.push(' PUBLIC ', _), v && '.' != v && t.push(' ', v), t.push('>')) 12635 : v && '.' != v 12636 ? t.push(' SYSTEM ', v, '>') 12637 : ((_ = e.internalSubset) && t.push(' [', _, ']'), t.push('>'))) 12638 ); 12639 case 7: 12640 return t.push('<?', e.target, ' ', e.data, '?>'); 12641 case 5: 12642 return t.push('&', e.nodeName, ';'); 12643 default: 12644 t.push('??', e.nodeName); 12645 } 12646 } 12647 function _o(e, t, i) { 12648 e[t] = i; 12649 } 12650 ((r.INVALID_STATE_ERR = ((k[11] = 'Invalid state'), 11)), 12651 (r.SYNTAX_ERR = ((k[12] = 'Syntax error'), 12)), 12652 (r.INVALID_MODIFICATION_ERR = ((k[13] = 'Invalid modification'), 13)), 12653 (r.NAMESPACE_ERR = ((k[14] = 'Invalid namespace'), 14)), 12654 (r.INVALID_ACCESS_ERR = ((k[15] = 'Invalid access'), 15)), 12655 (I.prototype = Error.prototype), 12656 Ia(r, I), 12657 (Pa.prototype = { 12658 length: 0, 12659 item: function (e) { 12660 return 0 <= e && e < this.length ? this[e] : null; 12661 }, 12662 toString: function (e, t) { 12663 for (var i = [], s = 0; s < this.length; s++) yo(this[s], i, e, t); 12664 return i.join(''); 12665 }, 12666 filter: function (e) { 12667 return Array.prototype.filter.call(this, e); 12668 }, 12669 indexOf: function (e) { 12670 return Array.prototype.indexOf.call(this, e); 12671 } 12672 }), 12673 (La.prototype.item = function (e) { 12674 return (Oa(this), this[e] || null); 12675 }), 12676 xa(La, Pa), 12677 (Ra.prototype = { 12678 length: 0, 12679 item: Pa.prototype.item, 12680 getNamedItem: function (e) { 12681 for (var t = this.length; t--; ) { 12682 var i = this[t]; 12683 if (i.nodeName == e) return i; 12684 } 12685 }, 12686 setNamedItem: function (e) { 12687 var t = e.ownerElement; 12688 if (t && t != this._ownerElement) throw new I(10); 12689 t = this.getNamedItem(e.nodeName); 12690 return (Ma(this._ownerElement, this, e, t), t); 12691 }, 12692 setNamedItemNS: function (e) { 12693 var t = e.ownerElement; 12694 if (t && t != this._ownerElement) throw new I(10); 12695 return ( 12696 (t = this.getNamedItemNS(e.namespaceURI, e.localName)), 12697 Ma(this._ownerElement, this, e, t), 12698 t 12699 ); 12700 }, 12701 removeNamedItem: function (e) { 12702 e = this.getNamedItem(e); 12703 return (Ua(this._ownerElement, this, e), e); 12704 }, 12705 removeNamedItemNS: function (e, t) { 12706 e = this.getNamedItemNS(e, t); 12707 return (Ua(this._ownerElement, this, e), e); 12708 }, 12709 getNamedItemNS: function (e, t) { 12710 for (var i = this.length; i--; ) { 12711 var s = this[i]; 12712 if (s.localName == t && s.namespaceURI == e) return s; 12713 } 12714 return null; 12715 } 12716 }), 12717 (Ba.prototype = { 12718 hasFeature: function (e, t) { 12719 return !0; 12720 }, 12721 createDocument: function (e, t, i) { 12722 var s = new ja(); 12723 return ( 12724 (s.implementation = this), 12725 (s.childNodes = new Pa()), 12726 (s.doctype = i || null), 12727 i && s.appendChild(i), 12728 t && ((i = s.createElementNS(e, t)), s.appendChild(i)), 12729 s 12730 ); 12731 }, 12732 createDocumentType: function (e, t, i) { 12733 var s = new ao(); 12734 return ((s.name = e), (s.nodeName = e), (s.publicId = t || ''), (s.systemId = i || ''), s); 12735 } 12736 }), 12737 (x.prototype = { 12738 firstChild: null, 12739 lastChild: null, 12740 previousSibling: null, 12741 nextSibling: null, 12742 attributes: null, 12743 parentNode: null, 12744 childNodes: null, 12745 ownerDocument: null, 12746 nodeValue: null, 12747 namespaceURI: null, 12748 prefix: null, 12749 localName: null, 12750 insertBefore: function (e, t) { 12751 return Za(this, e, t); 12752 }, 12753 replaceChild: function (e, t) { 12754 (Za(this, e, t, Ja), t && this.removeChild(t)); 12755 }, 12756 removeChild: function (e) { 12757 return za(this, e); 12758 }, 12759 appendChild: function (e) { 12760 return this.insertBefore(e, null); 12761 }, 12762 hasChildNodes: function () { 12763 return null != this.firstChild; 12764 }, 12765 cloneNode: function (e) { 12766 return (function e(t, i, s) { 12767 var r = new i.constructor(); 12768 for (var n in i) { 12769 var a; 12770 Object.prototype.hasOwnProperty.call(i, n) && 12771 'object' != typeof (a = i[n]) && 12772 a != r[n] && 12773 (r[n] = a); 12774 } 12775 i.childNodes && (r.childNodes = new Pa()); 12776 r.ownerDocument = t; 12777 switch (r.nodeType) { 12778 case 1: 12779 var o = i.attributes, 12780 l = (r.attributes = new Ra()), 12781 d = o.length; 12782 l._ownerElement = r; 12783 for (var h = 0; h < d; h++) r.setAttributeNode(e(t, o.item(h), !0)); 12784 break; 12785 case 2: 12786 s = !0; 12787 } 12788 if (s) for (var u = i.firstChild; u; ) (r.appendChild(e(t, u, s)), (u = u.nextSibling)); 12789 return r; 12790 })(this.ownerDocument || this, this, e); 12791 }, 12792 normalize: function () { 12793 for (var e = this.firstChild; e; ) { 12794 var t = e.nextSibling; 12795 t && 3 == t.nodeType && 3 == e.nodeType 12796 ? (this.removeChild(t), e.appendData(t.data)) 12797 : (e.normalize(), (e = t)); 12798 } 12799 }, 12800 isSupported: function (e, t) { 12801 return this.ownerDocument.implementation.hasFeature(e, t); 12802 }, 12803 hasAttributes: function () { 12804 return 0 < this.attributes.length; 12805 }, 12806 lookupPrefix: function (e) { 12807 for (var t = this; t; ) { 12808 var i = t._nsMap; 12809 if (i) 12810 for (var s in i) if (Object.prototype.hasOwnProperty.call(i, s) && i[s] === e) return s; 12811 t = 2 == t.nodeType ? t.ownerDocument : t.parentNode; 12812 } 12813 return null; 12814 }, 12815 lookupNamespaceURI: function (e) { 12816 for (var t = this; t; ) { 12817 var i = t._nsMap; 12818 if (i && Object.prototype.hasOwnProperty.call(i, e)) return i[e]; 12819 t = 2 == t.nodeType ? t.ownerDocument : t.parentNode; 12820 } 12821 return null; 12822 }, 12823 isDefaultNamespace: function (e) { 12824 return null == this.lookupPrefix(e); 12825 } 12826 }), 12827 Ia(n, x), 12828 Ia(n, x.prototype), 12829 (ja.prototype = { 12830 nodeName: '#document', 12831 nodeType: 9, 12832 doctype: null, 12833 documentElement: null, 12834 _inc: 1, 12835 insertBefore: function (e, t) { 12836 if (11 == e.nodeType) 12837 for (var i = e.firstChild; i; ) { 12838 var s = i.nextSibling; 12839 (this.insertBefore(i, t), (i = s)); 12840 } 12841 else 12842 (Za(this, e, t), 12843 null === (e.ownerDocument = this).documentElement && 12844 1 === e.nodeType && 12845 (this.documentElement = e)); 12846 return e; 12847 }, 12848 removeChild: function (e) { 12849 return (this.documentElement == e && (this.documentElement = null), za(this, e)); 12850 }, 12851 replaceChild: function (e, t) { 12852 (Za(this, e, t, Ja), 12853 (e.ownerDocument = this), 12854 t && this.removeChild(t), 12855 Wa(e) && (this.documentElement = e)); 12856 }, 12857 importNode: function (e, t) { 12858 return (function e(t, i, s) { 12859 var r; 12860 switch (i.nodeType) { 12861 case 1: 12862 (r = i.cloneNode(!1)).ownerDocument = t; 12863 case 11: 12864 break; 12865 case 2: 12866 s = !0; 12867 } 12868 r = r || i.cloneNode(!1); 12869 r.ownerDocument = t; 12870 r.parentNode = null; 12871 if (s) for (var n = i.firstChild; n; ) (r.appendChild(e(t, n, s)), (n = n.nextSibling)); 12872 return r; 12873 })(this, e, t); 12874 }, 12875 getElementById: function (t) { 12876 var i = null; 12877 return ( 12878 qa(this.documentElement, function (e) { 12879 if (1 == e.nodeType && e.getAttribute('id') == t) return ((i = e), !0); 12880 }), 12881 i 12882 ); 12883 }, 12884 getElementsByClassName: function (a) { 12885 var o = ka(a);
12886 return new La(this, function (r) { 12887 var n = []; 12888 return ( 12889 0 < o.length && 12890 qa(r.documentElement, function (e) { 12891 var t, i, s; 12892 e !== r && 12893 1 === e.nodeType && 12894 (t = e.getAttribute('class')) && 12895 ((i = a === t) || 12896 ((t = ka(t)), 12897 (i = o.every( 12898 ((s = t), 12899 function (e) { 12900 return s && -1 !== s.indexOf(e); 12901 }) 12902 ))), 12903 i) && 12904 n.push(e); 12905 }), 12906 n 12907 ); 12908 }); 12909 }, 12910 createElement: function (e) { 12911 var t = new eo(); 12912 return ( 12913 (t.ownerDocument = this), 12914 (t.nodeName = e), 12915 (t.tagName = e), 12916 (t.localName = e), 12917 (t.childNodes = new Pa()), 12918 ((t.attributes = new Ra())._ownerElement = t) 12919 ); 12920 }, 12921 createDocumentFragment: function () { 12922 var e = new uo(); 12923 return ((e.ownerDocument = this), (e.childNodes = new Pa()), e); 12924 }, 12925 createTextNode: function (e) { 12926 var t = new so(); 12927 return ((t.ownerDocument = this), t.appendData(e), t); 12928 }, 12929 createComment: function (e) { 12930 var t = new ro(); 12931 return ((t.ownerDocument = this), t.appendData(e), t); 12932 }, 12933 createCDATASection: function (e) { 12934 var t = new no(); 12935 return ((t.ownerDocument = this), t.appendData(e), t); 12936 }, 12937 createProcessingInstruction: function (e, t) { 12938 var i = new co(); 12939 return ( 12940 (i.ownerDocument = this), 12941 (i.tagName = i.nodeName = i.target = e), 12942 (i.nodeValue = i.data = t), 12943 i 12944 ); 12945 }, 12946 createAttribute: function (e) { 12947 var t = new to(); 12948 return ( 12949 (t.ownerDocument = this), 12950 (t.name = e), 12951 (t.nodeName = e), 12952 (t.localName = e), 12953 (t.specified = !0), 12954 t 12955 ); 12956 }, 12957 createEntityReference: function (e) { 12958 var t = new ho(); 12959 return ((t.ownerDocument = this), (t.nodeName = e), t); 12960 }, 12961 createElementNS: function (e, t) { 12962 var i = new eo(), 12963 s = t.split(':'), 12964 r = (i.attributes = new Ra()); 12965 return ( 12966 (i.childNodes = new Pa()), 12967 (i.ownerDocument = this), 12968 (i.nodeName = t), 12969 (i.tagName = t), 12970 (i.namespaceURI = e), 12971 2 == s.length ? ((i.prefix = s[0]), (i.localName = s[1])) : (i.localName = t), 12972 (r._ownerElement = i) 12973 ); 12974 }, 12975 createAttributeNS: function (e, t) { 12976 var i = new to(), 12977 s = t.split(':'); 12978 return ( 12979 (i.ownerDocument = this), 12980 (i.nodeName = t), 12981 (i.name = t), 12982 (i.namespaceURI = e), 12983 (i.specified = !0), 12984 2 == s.length ? ((i.prefix = s[0]), (i.localName = s[1])) : (i.localName = t), 12985 i 12986 ); 12987 } 12988 }), 12989 xa(ja, x), 12990 (ja.prototype.getElementsByTagName = (eo.prototype = { 12991 nodeType: 1, 12992 hasAttribute: function (e) { 12993 return null != this.getAttributeNode(e); 12994 }, 12995 getAttribute: function (e) { 12996 e = this.getAttributeNode(e); 12997 return (e && e.value) || ''; 12998 }, 12999 getAttributeNode: function (e) { 13000 return this.attributes.getNamedItem(e); 13001 }, 13002 setAttribute: function (e, t) { 13003 e = this.ownerDocument.createAttribute(e); 13004 ((e.value = e.nodeValue = '' + t), this.setAttributeNode(e)); 13005 }, 13006 removeAttribute: function (e) { 13007 e = this.getAttributeNode(e); 13008 e && this.removeAttributeNode(e); 13009 }, 13010 appendChild: function (e) { 13011 return 11 === e.nodeType 13012 ? this.insertBefore(e, null) 13013 : ((t = this), 13014 (e = e).parentNode && e.parentNode.removeChild(e), 13015 (e.parentNode = t), 13016 (e.previousSibling = t.lastChild), 13017 (e.nextSibling = null), 13018 e.previousSibling ? (e.previousSibling.nextSibling = e) : (t.firstChild = e), 13019 (t.lastChild = e), 13020 Ha(t.ownerDocument, t, e), 13021 e); 13022 var t; 13023 }, 13024 setAttributeNode: function (e) { 13025 return this.attributes.setNamedItem(e); 13026 }, 13027 setAttributeNodeNS: function (e) { 13028 return this.attributes.setNamedItemNS(e); 13029 }, 13030 removeAttributeNode: function (e) { 13031 return this.attributes.removeNamedItem(e.nodeName); 13032 }, 13033 removeAttributeNS: function (e, t) { 13034 e = this.getAttributeNodeNS(e, t); 13035 e && this.removeAttributeNode(e); 13036 }, 13037 hasAttributeNS: function (e, t) { 13038 return null != this.getAttributeNodeNS(e, t); 13039 }, 13040 getAttributeNS: function (e, t) { 13041 e = this.getAttributeNodeNS(e, t); 13042 return (e && e.value) || ''; 13043 }, 13044 setAttributeNS: function (e, t, i) { 13045 e = this.ownerDocument.createAttributeNS(e, t); 13046 ((e.value = e.nodeValue = '' + i), this.setAttributeNode(e)); 13047 }, 13048 getAttributeNodeNS: function (e, t) { 13049 return this.attributes.getNamedItemNS(e, t); 13050 }, 13051 getElementsByTagName: function (s) {
13052 return new La(this, function (t) { 13053 var i = []; 13054 return ( 13055 qa(t, function (e) { 13056 e === t || 1 != e.nodeType || ('*' !== s && e.tagName != s) || i.push(e); 13057 }), 13058 i 13059 ); 13060 }); 13061 }, 13062 getElementsByTagNameNS: function (s, r) { 13063 return new La(this, function (t) { 13064 var i = []; 13065 return ( 13066 qa(t, function (e) { 13067 e === t || 13068 1 !== e.nodeType || 13069 ('*' !== s && e.namespaceURI !== s) || 13070 ('*' !== r && e.localName != r) || 13071 i.push(e); 13072 }), 13073 i 13074 ); 13075 }); 13076 } 13077 }).getElementsByTagName), 13078 (ja.prototype.getElementsByTagNameNS = eo.prototype.getElementsByTagNameNS), 13079 xa(eo, x), 13080 (to.prototype.nodeType = 2), 13081 xa(to, x), 13082 (io.prototype = { 13083 data: '', 13084 substringData: function (e, t) { 13085 return this.data.substring(e, e + t); 13086 }, 13087 appendData: function (e) { 13088 ((e = this.data + e), (this.nodeValue = this.data = e), (this.length = e.length)); 13089 }, 13090 insertData: function (e, t) { 13091 this.replaceData(e, 0, t); 13092 }, 13093 appendChild: function (e) { 13094 throw new Error(k[Aa]); 13095 }, 13096 deleteData: function (e, t) { 13097 this.replaceData(e, t, ''); 13098 }, 13099 replaceData: function (e, t, i) { 13100 var s = this.data.substring(0, e), 13101 e = this.data.substring(e + t); 13102 ((this.nodeValue = this.data = i = s + i + e), (this.length = i.length)); 13103 } 13104 }), 13105 xa(io, x), 13106 (so.prototype = { 13107 nodeName: '#text', 13108 nodeType: 3, 13109 splitText: function (e) { 13110 var t = (i = this.data).substring(e), 13111 i = i.substring(0, e), 13112 e = 13113 ((this.data = this.nodeValue = i), 13114 (this.length = i.length), 13115 this.ownerDocument.createTextNode(t)); 13116 return (this.parentNode && this.parentNode.insertBefore(e, this.nextSibling), e); 13117 } 13118 }), 13119 xa(so, io), 13120 (ro.prototype = { nodeName: '#comment', nodeType: 8 }), 13121 xa(ro, io), 13122 (no.prototype = { nodeName: '#cdata-section', nodeType: 4 }), 13123 xa(no, io), 13124 (ao.prototype.nodeType = 10), 13125 xa(ao, x), 13126 (oo.prototype.nodeType = 12), 13127 xa(oo, x), 13128 (lo.prototype.nodeType = 6), 13129 xa(lo, x), 13130 (ho.prototype.nodeType = 5), 13131 xa(ho, x), 13132 (uo.prototype.nodeName = '#document-fragment'), 13133 (uo.prototype.nodeType = 11), 13134 xa(uo, x), 13135 (co.prototype.nodeType = 7), 13136 xa(co, x), 13137 (po.prototype.serializeToString = function (e, t, i) { 13138 return mo.call(e, t, i); 13139 }), 13140 (x.prototype.toString = mo)); 13141 try { 13142 Object.defineProperty && 13143 (Object.defineProperty(La.prototype, 'length', { 13144 get: function () { 13145 return (Oa(this), this.$$length); 13146 } 13147 }), 13148 Object.defineProperty(x.prototype, 'textContent', { 13149 get: function () { 13150 return (function e(t) { 13151 switch (t.nodeType) { 13152 case 1: 13153 case 11: 13154 var i = []; 13155 for (t = t.firstChild; t; ) 13156 (7 !== t.nodeType && 8 !== t.nodeType && i.push(e(t)), (t = t.nextSibling)); 13157 return i.join(''); 13158 default: 13159 return t.nodeValue; 13160 } 13161 })(this); 13162 }, 13163 set: function (e) { 13164 switch (this.nodeType) { 13165 case 1: 13166 case 11: 13167 for (; this.firstChild; ) this.removeChild(this.firstChild); 13168 (e || String(e)) && this.appendChild(this.ownerDocument.createTextNode(e)); 13169 break; 13170 default: 13171 ((this.data = e), (this.value = e), (this.nodeValue = e)); 13172 } 13173 } 13174 }), 13175 (_o = function (e, t, i) { 13176 e['$$' + t] = i; 13177 })); 13178 } catch (e) {} 13179 var Kr = { 13180 DocumentType: ao, 13181 DOMException: I, 13182 DOMImplementation: Ba, 13183 Element: eo, 13184 Node: x, 13185 NodeList: Pa, 13186 XMLSerializer: po 13187 }, 13188 vo = bi(function (e, t) { 13189 var i = Ta.freeze; 13190 ((t.XML_ENTITIES = i({ amp: '&', apos: "'", gt: '>', lt: '<', quot: '"' })), 13191 (t.HTML_ENTITIES = i({ 13192 Aacute: 'Ã', 13193 aacute: 'á', 13194 Abreve: 'Ä', 13195 abreve: 'Ä', 13196 ac: 'â¾', 13197 acd: 'â¿', 13198 acE: 'â¾Ì³', 13199 Acirc: 'Ã', 13200 acirc: 'â', 13201 acute: '´', 13202 Acy: 'Ð', 13203 acy: 'а', 13204 AElig: 'Ã', 13205 aelig: 'æ', 13206 af: 'â¡', 13207 Afr: 'ð', 13208 afr: 'ð', 13209 Agrave: 'Ã', 13210 agrave: 'à ', 13211 alefsym: 'âµ', 13212 aleph: 'âµ', 13213 Alpha: 'Î', 13214 alpha: 'α', 13215 Amacr: 'Ä', 13216 amacr: 'Ä', 13217 amalg: '⨿', 13218 AMP: '&', 13219 amp: '&', 13220 And: 'â©', 13221 and: 'â§', 13222 andand: 'â©', 13223 andd: 'â©', 13224 andslope: 'â©', 13225 andv: 'â©', 13226 ang: 'â ', 13227 ange: '⦤', 13228 angle: 'â ', 13229 angmsd: 'â¡', 13230 angmsdaa: '⦨', 13231 angmsdab: '⦩', 13232 angmsdac: '⦪', 13233 angmsdad: '⦫', 13234 angmsdae: '⦬', 13235 angmsdaf: 'â¦', 13236 angmsdag: '⦮', 13237 angmsdah: '⦯', 13238 angrt: 'â', 13239 angrtvb: 'â¾', 13240 angrtvbd: 'â¦', 13241 angsph: 'â¢', 13242 angst: 'à ', 13243 angzarr: 'â¼', 13244 Aogon: 'Ä', 13245 aogon: 'Ä ', 13246 Aopf: 'ð¸', 13247 aopf: 'ð', 13248 ap: 'â', 13249 apacir: '⩯', 13250 apE: 'â©°', 13251 ape: 'â', 13252 apid: 'â', 13253 apos: "'", 13254 ApplyFunction: 'â¡', 13255 approx: 'â', 13256 approxeq: 'â', 13257 Aring: 'à ', 13258 aring: 'Ã¥', 13259 Ascr: 'ð', 13260 ascr: 'ð¶', 13261 Assign: 'â', 13262 ast: '*', 13263 asymp: 'â', 13264 asympeq: 'â', 13265 Atilde: 'Ã', 13266 atilde: 'ã', 13267 Auml: 'Ã', 13268 auml: 'ä', 13269 awconint: 'â³', 13270 awint: 'â¨', 13271 backcong: 'â', 13272 backepsilon: '϶', 13273 backprime: 'âµ', 13274 backsim: 'â½', 13275 backsimeq: 'â', 13276 Backslash: 'â', 13277 Barv: 'â«§', 13278 barvee: 'â½', 13279 Barwed: 'â', 13280 barwed: 'â ', 13281 barwedge: 'â ', 13282 bbrk: 'âµ', 13283 bbrktbrk: 'â¶', 13284 bcong: 'â', 13285 Bcy: 'Ð', 13286 bcy: 'б', 13287 bdquo: 'â', 13288 becaus: 'âµ', 13289 Because: 'âµ', 13290 because: 'âµ', 13291 bemptyv: '⦰', 13292 bepsi: '϶', 13293 bernou: 'â¬', 13294 Bernoullis: 'â¬', 13295 Beta: 'Î', 13296 beta: 'β', 13297 beth: 'â¶', 13298 between: 'â¬', 13299 Bfr: 'ð ', 13300 bfr: 'ð', 13301 bigcap: 'â', 13302 bigcirc: 'â¯', 13303 bigcup: 'â', 13304 bigodot: 'â¨', 13305 bigoplus: 'â¨', 13306 bigotimes: 'â¨', 13307 bigsqcup: 'â¨', 13308 bigstar: 'â ', 13309 bigtriangledown: 'â½', 13310 bigtriangleup: 'â³', 13311 biguplus: 'â¨', 13312 bigvee: 'â', 13313 bigwedge: 'â', 13314 bkarow: 'â¤', 13315 blacklozenge: 'â§«', 13316 blacksquare: 'âª', 13317 blacktriangle: 'â´', 13318 blacktriangledown: 'â¾', 13319 blacktriangleleft: 'â', 13320 blacktriangleright: 'â¸', 13321 blank: 'â£', 13322 blk12: 'â', 13323 blk14: 'â', 13324 blk34: 'â', 13325 block: 'â', 13326 bne: '=â¥', 13327 bnequiv: 'â¡â¥', 13328 bNot: 'â«', 13329 bnot: 'â', 13330 Bopf: 'ð¹', 13331 bopf: 'ð', 13332 bot: 'â¥', 13333 bottom: 'â¥', 13334 bowtie: 'â', 13335 boxbox: 'â§', 13336 boxDL: 'â', 13337 boxDl: 'â', 13338 boxdL: 'â', 13339 boxdl: 'â', 13340 boxDR: 'â', 13341 boxDr: 'â', 13342 boxdR: 'â', 13343 boxdr: 'â', 13344 boxH: 'â', 13345 boxh: 'â', 13346 boxHD: 'â¦', 13347 boxHd: 'â¤', 13348 boxhD: 'â¥', 13349 boxhd: 'â¬', 13350 boxHU: 'â©', 13351 boxHu: 'â§', 13352 boxhU: 'â¨', 13353 boxhu: 'â´', 13354 boxminus: 'â', 13355 boxplus: 'â', 13356 boxtimes: 'â ', 13357 boxUL: 'â', 13358 boxUl: 'â', 13359 boxuL: 'â', 13360 boxul: 'â', 13361 boxUR: 'â', 13362 boxUr: 'â', 13363 boxuR: 'â', 13364 boxur: 'â', 13365 boxV: 'â', 13366 boxv: 'â', 13367 boxVH: 'â¬', 13368 boxVh: 'â«', 13369 boxvH: 'âª', 13370 boxvh: 'â¼', 13371 boxVL: 'â£', 13372 boxVl: 'â¢', 13373 boxvL: 'â¡', 13374 boxvl: 'â¤', 13375 boxVR: 'â ', 13376 boxVr: 'â', 13377 boxvR: 'â', 13378 boxvr: 'â', 13379 bprime: 'âµ', 13380 Breve: 'Ë', 13381 breve: 'Ë', 13382 brvbar: '¦', 13383 Bscr: 'â¬', 13384 bscr: 'ð·', 13385 bsemi: 'â', 13386 bsim: 'â½', 13387 bsime: 'â', 13388 bsol: '\\', 13389 bsolb: 'â§ ', 13390 bsolhsub: 'â', 13391 bull: 'â¢', 13392 bullet: 'â¢', 13393 bump: 'â', 13394 bumpE: '⪮', 13395 bumpe: 'â', 13396 Bumpeq: 'â', 13397 bumpeq: 'â', 13398 Cacute: 'Ä', 13399 cacute: 'Ä', 13400 Cap: 'â', 13401 cap: 'â©', 13402 capand: 'â©', 13403 capbrcup: 'â©', 13404 capcap: 'â©', 13405 capcup: 'â©', 13406 capdot: 'â©', 13407 CapitalDifferentialD: 'â ', 13408 caps: 'â©ï¸', 13409 caret: 'â', 13410 caron: 'Ë', 13411 Cayleys: 'â', 13412 ccaps: 'â©', 13413 Ccaron: 'Ä', 13414 ccaron: 'Ä', 13415 Ccedil: 'Ã', 13416 ccedil: 'ç', 13417 Ccirc: 'Ä', 13418 ccirc: 'Ä', 13419 Cconint: 'â°', 13420 ccups: 'â©', 13421 ccupssm: 'â©', 13422 Cdot: 'Ä', 13423 cdot: 'Ä', 13424 cedil: '¸', 13425 Cedilla: '¸', 13426 cemptyv: '⦲', 13427 cent: '¢', 13428 CenterDot: '·', 13429 centerdot: '·', 13430 Cfr: 'â', 13431 cfr: 'ð ', 13432 CHcy: 'Ч', 13433 chcy: 'Ñ', 13434 check: 'â', 13435 checkmark: 'â', 13436 Chi: 'Χ', 13437 chi: 'Ï', 13438 cir: 'â', 13439 circ: 'Ë', 13440 circeq: 'â', 13441 circlearrowleft: 'âº', 13442 circlearrowright: 'â»', 13443 circledast: 'â', 13444 circledcirc: 'â', 13445 circleddash: 'â', 13446 CircleDot: 'â', 13447 circledR: '®', 13448 circledS: 'â', 13449 CircleMinus: 'â', 13450 CirclePlus: 'â', 13451 CircleTimes: 'â', 13452 cirE: 'â§', 13453 cire: 'â', 13454 cirfnint: 'â¨', 13455 cirmid: '⫯', 13456 cirscir: 'â§', 13457 ClockwiseContourIntegral: 'â²', 13458 CloseCurlyDoubleQuote: 'â', 13459 CloseCurlyQuote: 'â', 13460 clubs: 'â£', 13461 clubsuit: 'â£', 13462 Colon: 'â·', 13463 colon: ':', 13464 Colone: 'â©´', 13465 colone: 'â', 13466 coloneq: 'â', 13467 comma: ',', 13468 commat: '@', 13469 comp: 'â', 13470 compfn: 'â', 13471 complement: 'â', 13472 complexes: 'â', 13473 cong: 'â ', 13474 congdot: 'â©', 13475 Congruent: 'â¡', 13476 Conint: 'â¯', 13477 conint: 'â®', 13478 ContourIntegral: 'â®', 13479 Copf: 'â', 13480 copf: 'ð', 13481 coprod: 'â', 13482 Coproduct: 'â', 13483 COPY: '©', 13484 copy: '©', 13485 copysr: 'â', 13486 CounterClockwiseContourIntegral: 'â³', 13487 crarr: 'âµ', 13488 Cross: '⨯', 13489 cross: 'â', 13490 Cscr: 'ð', 13491 cscr: 'ð¸', 13492 csub: 'â«', 13493 csube: 'â«', 13494 csup: 'â«', 13495 csupe: 'â«', 13496 ctdot: 'â¯', 13497 cudarrl: '⤸', 13498 cudarrr: '⤵', 13499 cuepr: 'â', 13500 cuesc: 'â', 13501 cularr: 'â¶', 13502 cularrp: '⤽', 13503 Cup: 'â', 13504 cup: 'âª', 13505 cupbrcap: 'â©', 13506 CupCap: 'â', 13507 cupcap: 'â©', 13508 cupcup: 'â©', 13509 cupdot: 'â', 13510 cupor: 'â© ', 13511 cups: 'âªï¸', 13512 curarr: 'â·', 13513 curarrm: '⤼', 13514 curlyeqprec: 'â', 13515 curlyeqsucc: 'â', 13516 curlyvee: 'â', 13517 curlywedge: 'â', 13518 curren: '¤', 13519 curvearrowleft: 'â¶', 13520 curvearrowright: 'â·', 13521 cuvee: 'â', 13522 cuwed: 'â', 13523 cwconint: 'â²', 13524 cwint: 'â±', 13525 cylcty: 'â', 13526 Dagger: 'â¡', 13527 dagger: 'â ', 13528 daleth: 'â¸', 13529 Darr: 'â¡', 13530 dArr: 'â', 13531 darr: 'â', 13532 dash: 'â', 13533 Dashv: '⫤', 13534 dashv: 'â£', 13535 dbkarow: 'â¤', 13536 dblac: 'Ë', 13537 Dcaron: 'Ä', 13538 dcaron: 'Ä', 13539 Dcy: 'Ð', 13540 dcy: 'д', 13541 DD: 'â ', 13542 dd: 'â ', 13543 ddagger: 'â¡', 13544 ddarr: 'â', 13545 DDotrahd: 'â¤', 13546 ddotseq: 'â©·', 13547 deg: '°', 13548 Del: 'â', 13549 Delta: 'Î', 13550 delta: 'δ', 13551 demptyv: '⦱', 13552 dfisht: '⥿', 13553 Dfr: 'ð', 13554 dfr: 'ð¡', 13555 dHar: '⥥', 13556 dharl: 'â', 13557 dharr: 'â', 13558 DiacriticalAcute: '´', 13559 DiacriticalDot: 'Ë', 13560 DiacriticalDoubleAcute: 'Ë', 13561 DiacriticalGrave: '`', 13562 DiacriticalTilde: 'Ë', 13563 diam: 'â', 13564 Diamond: 'â', 13565 diamond: 'â', 13566 diamondsuit: 'â¦', 13567 diams: 'â¦', 13568 die: '¨', 13569 DifferentialD: 'â ', 13570 digamma: 'Ï', 13571 disin: 'â²', 13572 div: '÷', 13573 divide: '÷', 13574 divideontimes: 'â', 13575 divonx: 'â', 13576 DJcy: 'Ð', 13577 djcy: 'Ñ', 13578 dlcorn: 'â', 13579 dlcrop: 'â', 13580 dollar: '$', 13581 Dopf: 'ð»', 13582 dopf: 'ð', 13583 Dot: '¨', 13584 dot: 'Ë', 13585 DotDot: 'â', 13586 doteq: 'â', 13587 doteqdot: 'â', 13588 DotEqual: 'â', 13589 dotminus: 'â¸', 13590 dotplus: 'â', 13591 dotsquare: 'â¡', 13592 doublebarwedge: 'â', 13593 DoubleContourIntegral: 'â¯', 13594 DoubleDot: '¨', 13595 DoubleDownArrow: 'â', 13596 DoubleLeftArrow: 'â', 13597 DoubleLeftRightArrow: 'â', 13598 DoubleLeftTee: '⫤', 13599 DoubleLongLeftArrow: 'â¸', 13600 DoubleLongLeftRightArrow: 'âº', 13601 DoubleLongRightArrow: 'â¹', 13602 DoubleRightArrow: 'â', 13603 DoubleRightTee: 'â¨', 13604 DoubleUpArrow: 'â', 13605 DoubleUpDownArrow: 'â', 13606 DoubleVerticalBar: 'â¥', 13607 DownArrow: 'â', 13608 Downarrow: 'â', 13609 downarrow: 'â', 13610 DownArrowBar: 'â¤', 13611 DownArrowUpArrow: 'âµ', 13612 DownBreve: 'Ì', 13613 downdownarrows: 'â', 13614 downharpoonleft: 'â',
13615 downharpoonright: 'â', 13616 DownLeftRightVector: 'â¥', 13617 DownLeftTeeVector: 'â¥', 13618 DownLeftVector: 'â½', 13619 DownLeftVectorBar: 'â¥', 13620 DownRightTeeVector: 'â¥', 13621 DownRightVector: 'â', 13622 DownRightVectorBar: 'â¥', 13623 DownTee: 'â¤', 13624 DownTeeArrow: 'â§', 13625 drbkarow: 'â¤', 13626 drcorn: 'â', 13627 drcrop: 'â', 13628 Dscr: 'ð', 13629 dscr: 'ð¹', 13630 DScy: 'Ð ', 13631 dscy: 'Ñ', 13632 dsol: 'â§¶', 13633 Dstrok: 'Ä', 13634 dstrok: 'Ä', 13635 dtdot: 'â±', 13636 dtri: 'â¿', 13637 dtrif: 'â¾', 13638 duarr: 'âµ', 13639 duhar: '⥯', 13640 dwangle: '⦦', 13641 DZcy: 'Ð', 13642 dzcy: 'Ñ', 13643 dzigrarr: 'â¿', 13644 Eacute: 'Ã', 13645 eacute: 'é', 13646 easter: 'â©®', 13647 Ecaron: 'Ä', 13648 ecaron: 'Ä', 13649 ecir: 'â', 13650 Ecirc: 'Ã', 13651 ecirc: 'ê', 13652 ecolon: 'â', 13653 Ecy: 'Ð', 13654 ecy: 'Ñ', 13655 eDDot: 'â©·', 13656 Edot: 'Ä', 13657 eDot: 'â', 13658 edot: 'Ä', 13659 ee: 'â ', 13660 efDot: 'â', 13661 Efr: 'ð', 13662 efr: 'ð¢', 13663 eg: 'âª', 13664 Egrave: 'Ã', 13665 egrave: 'è', 13666 egs: 'âª', 13667 egsdot: 'âª', 13668 el: 'âª', 13669 Element: 'â', 13670 elinters: 'â§', 13671 ell: 'â', 13672 els: 'âª', 13673 elsdot: 'âª', 13674 Emacr: 'Ä', 13675 emacr: 'Ä', 13676 empty: 'â ', 13677 emptyset: 'â ', 13678 EmptySmallSquare: 'â»', 13679 emptyv: 'â ', 13680 EmptyVerySmallSquare: 'â«', 13681 emsp: 'â', 13682 emsp13: 'â', 13683 emsp14: 'â ', 13684 ENG: 'Å', 13685 eng: 'Å', 13686 ensp: 'â', 13687 Eogon: 'Ä', 13688 eogon: 'Ä', 13689 Eopf: 'ð¼', 13690 eopf: 'ð', 13691 epar: 'â', 13692 eparsl: 'â§£', 13693 eplus: '⩱', 13694 epsi: 'ε', 13695 Epsilon: 'Î', 13696 epsilon: 'ε', 13697 epsiv: 'ϵ', 13698 eqcirc: 'â', 13699 eqcolon: 'â', 13700 eqsim: 'â', 13701 eqslantgtr: 'âª', 13702 eqslantless: 'âª', 13703 Equal: '⩵', 13704 equals: '=', 13705 EqualTilde: 'â', 13706 equest: 'â', 13707 Equilibrium: 'â', 13708 equiv: 'â¡', 13709 equivDD: '⩸', 13710 eqvparsl: 'â§¥', 13711 erarr: '⥱', 13712 erDot: 'â', 13713 Escr: 'â°', 13714 escr: 'â¯', 13715 esdot: 'â', 13716 Esim: '⩳', 13717 esim: 'â', 13718 Eta: 'Î', 13719 eta: 'η', 13720 ETH: 'Ã', 13721 eth: 'ð', 13722 Euml: 'Ã', 13723 euml: 'ë', 13724 euro: 'â¬', 13725 excl: '!', 13726 exist: 'â', 13727 Exists: 'â', 13728 expectation: 'â°', 13729 ExponentialE: 'â ', 13730 exponentiale: 'â ', 13731 fallingdotseq: 'â', 13732 Fcy: 'Ф', 13733 fcy: 'Ñ', 13734 female: 'â', 13735 ffilig: 'ï¬', 13736 fflig: 'ï¬', 13737 ffllig: 'ï¬', 13738 Ffr: 'ð', 13739 ffr: 'ð£', 13740 filig: 'ï¬', 13741 FilledSmallSquare: 'â¼', 13742 FilledVerySmallSquare: 'âª', 13743 fjlig: 'fj', 13744 flat: 'â', 13745 fllig: 'ï¬', 13746 fltns: 'â±', 13747 fnof: 'Æ', 13748 Fopf: 'ð½', 13749 fopf: 'ð', 13750 ForAll: 'â', 13751 forall: 'â', 13752 fork: 'â', 13753 forkv: 'â«', 13754 Fouriertrf: 'â±', 13755 fpartint: 'â¨', 13756 frac12: '½', 13757 frac13: 'â ', 13758 frac14: '¼', 13759 frac15: 'â ', 13760 frac16: 'â ', 13761 frac18: 'â ', 13762 frac23: 'â ', 13763 frac25: 'â ', 13764 frac34: '¾', 13765 frac35: 'â ', 13766 frac38: 'â ', 13767 frac45: 'â ', 13768 frac56: 'â ', 13769 frac58: 'â ', 13770 frac78: 'â ', 13771 frasl: 'â', 13772 frown: 'â¢', 13773 Fscr: 'â±', 13774 fscr: 'ð»', 13775 gacute: 'ǵ', 13776 Gamma: 'Î', 13777 gamma: 'γ', 13778 Gammad: 'Ï', 13779 gammad: 'Ï', 13780 gap: 'âª', 13781 Gbreve: 'Ä', 13782 gbreve: 'Ä', 13783 Gcedil: 'Ä¢',
13784 Gcirc: 'Ä', 13785 gcirc: 'Ä', 13786 Gcy: 'Ð', 13787 gcy: 'г', 13788 Gdot: 'Ä ', 13789 gdot: 'Ä¡', 13790 gE: 'â§', 13791 ge: 'â¥', 13792 gEl: 'âª', 13793 gel: 'â', 13794 geq: 'â¥', 13795 geqq: 'â§', 13796 geqslant: '⩾', 13797 ges: '⩾', 13798 gescc: '⪩', 13799 gesdot: 'âª', 13800 gesdoto: 'âª', 13801 gesdotol: 'âª', 13802 gesl: 'âï¸', 13803 gesles: 'âª', 13804 Gfr: 'ð', 13805 gfr: 'ð¤', 13806 Gg: 'â', 13807 gg: 'â«', 13808 ggg: 'â', 13809 gimel: 'â·', 13810 GJcy: 'Ð', 13811 gjcy: 'Ñ', 13812 gl: 'â·', 13813 gla: '⪥', 13814 glE: 'âª', 13815 glj: '⪤', 13816 gnap: 'âª', 13817 gnapprox: 'âª', 13818 gnE: 'â©', 13819 gne: 'âª', 13820 gneq: 'âª', 13821 gneqq: 'â©', 13822 gnsim: 'â§', 13823 Gopf: 'ð¾', 13824 gopf: 'ð', 13825 grave: '`', 13826 GreaterEqual: 'â¥', 13827 GreaterEqualLess: 'â', 13828 GreaterFullEqual: 'â§', 13829 GreaterGreater: '⪢', 13830 GreaterLess: 'â·', 13831 GreaterSlantEqual: '⩾', 13832 GreaterTilde: 'â³', 13833 Gscr: 'ð¢', 13834 gscr: 'â', 13835 gsim: 'â³', 13836 gsime: 'âª', 13837 gsiml: 'âª', 13838 Gt: 'â«', 13839 GT: '>', 13840 gt: '>', 13841 gtcc: '⪧', 13842 gtcir: '⩺', 13843 gtdot: 'â', 13844 gtlPar: 'â¦', 13845 gtquest: '⩼', 13846 gtrapprox: 'âª', 13847 gtrarr: '⥸', 13848 gtrdot: 'â', 13849 gtreqless: 'â', 13850 gtreqqless: 'âª', 13851 gtrless: 'â·', 13852 gtrsim: 'â³', 13853 gvertneqq: 'â©ï¸', 13854 gvnE: 'â©ï¸', 13855 Hacek: 'Ë', 13856 hairsp: 'â', 13857 half: '½', 13858 hamilt: 'â', 13859 HARDcy: 'Ъ', 13860 hardcy: 'Ñ', 13861 hArr: 'â', 13862 harr: 'â', 13863 harrcir: 'â¥', 13864 harrw: 'â', 13865 Hat: '^', 13866 hbar: 'â', 13867 Hcirc: 'Ĥ', 13868 hcirc: 'Ä¥', 13869 hearts: 'â¥', 13870 heartsuit: 'â¥', 13871 hellip: 'â¦', 13872 hercon: 'â¹', 13873 Hfr: 'â', 13874 hfr: 'ð¥', 13875 HilbertSpace: 'â', 13876 hksearow: '⤥', 13877 hkswarow: '⤦', 13878 hoarr: 'â¿', 13879 homtht: 'â»', 13880 hookleftarrow: 'â©', 13881 hookrightarrow: 'âª', 13882 Hopf: 'â', 13883 hopf: 'ð', 13884 horbar: 'â', 13885 HorizontalLine: 'â', 13886 Hscr: 'â', 13887 hscr: 'ð½', 13888 hslash: 'â', 13889 Hstrok: 'Ħ', 13890 hstrok: 'ħ', 13891 HumpDownHump: 'â', 13892 HumpEqual: 'â', 13893 hybull: 'â', 13894 hyphen: 'â', 13895 Iacute: 'Ã', 13896 iacute: 'Ã', 13897 ic: 'â£', 13898 Icirc: 'Ã', 13899 icirc: 'î', 13900 Icy: 'Ð', 13901 icy: 'и', 13902 Idot: 'İ', 13903 IEcy: 'Ð', 13904 iecy: 'е', 13905 iexcl: '¡', 13906 iff: 'â', 13907 Ifr: 'â', 13908 ifr: 'ð¦', 13909 Igrave: 'Ã', 13910 igrave: 'ì', 13911 ii: 'â ', 13912 iiiint: 'â¨', 13913 iiint: 'â', 13914 iinfin: 'â§', 13915 iiota: 'â©', 13916 IJlig: 'IJ', 13917 ijlig: 'ij', 13918 Im: 'â', 13919 Imacr: 'Ī', 13920 imacr: 'Ä«', 13921 image: 'â', 13922 ImaginaryI: 'â ', 13923 imagline: 'â', 13924 imagpart: 'â', 13925 imath: 'ı', 13926 imof: 'â·', 13927 imped: 'Ƶ', 13928 Implies: 'â', 13929 in: 'â', 13930 incare: 'â ', 13931 infin: 'â', 13932 infintie: 'â§', 13933 inodot: 'ı', 13934 Int: 'â¬', 13935 int: 'â«', 13936 intcal: 'âº', 13937 integers: 'â¤', 13938 Integral: 'â«', 13939 intercal: 'âº', 13940 Intersection: 'â', 13941 intlarhk: 'â¨', 13942 intprod: '⨼', 13943 InvisibleComma: 'â£', 13944 InvisibleTimes: 'â¢', 13945 IOcy: 'Ð', 13946 iocy: 'Ñ', 13947 Iogon: 'Ä®', 13948 iogon: 'į', 13949 Iopf: 'ð', 13950 iopf: 'ð', 13951 Iota: 'Î', 13952 iota: 'ι', 13953 iprod: '⨼', 13954 iquest: '¿', 13955 Iscr: 'â', 13956 iscr: 'ð¾', 13957 isin: 'â', 13958 isindot: 'âµ', 13959 isinE: 'â¹', 13960 isins: 'â´', 13961 isinsv: 'â³',
13962 isinv: 'â', 13963 it: 'â¢', 13964 Itilde: 'Ĩ', 13965 itilde: 'Ä©', 13966 Iukcy: 'Ð', 13967 iukcy: 'Ñ', 13968 Iuml: 'Ã', 13969 iuml: 'ï', 13970 Jcirc: 'Ä´', 13971 jcirc: 'ĵ', 13972 Jcy: 'Ð', 13973 jcy: 'й', 13974 Jfr: 'ð', 13975 jfr: 'ð§', 13976 jmath: 'È·', 13977 Jopf: 'ð', 13978 jopf: 'ð', 13979 Jscr: 'ð¥', 13980 jscr: 'ð¿', 13981 Jsercy: 'Ð', 13982 jsercy: 'Ñ', 13983 Jukcy: 'Ð', 13984 jukcy: 'Ñ', 13985 Kappa: 'Î', 13986 kappa: 'κ', 13987 kappav: 'ϰ', 13988 Kcedil: 'Ķ', 13989 kcedil: 'Ä·', 13990 Kcy: 'Ð', 13991 kcy: 'к', 13992 Kfr: 'ð', 13993 kfr: 'ð¨', 13994 kgreen: 'ĸ', 13995 KHcy: 'Ð¥', 13996 khcy: 'Ñ ', 13997 KJcy: 'Ð', 13998 kjcy: 'Ñ', 13999 Kopf: 'ð', 14000 kopf: 'ð', 14001 Kscr: 'ð¦', 14002 kscr: 'ð', 14003 lAarr: 'â', 14004 Lacute: 'Ĺ', 14005 lacute: 'ĺ', 14006 laemptyv: '⦴', 14007 lagran: 'â', 14008 Lambda: 'Î', 14009 lambda: 'λ', 14010 Lang: 'âª', 14011 lang: 'â¨', 14012 langd: 'â¦', 14013 langle: 'â¨', 14014 lap: '⪠', 14015 Laplacetrf: 'â', 14016 laquo: '«', 14017 Larr: 'â', 14018 lArr: 'â', 14019 larr: 'â', 14020 larrb: 'â¤', 14021 larrbfs: 'â¤', 14022 larrfs: 'â¤', 14023 larrhk: 'â©', 14024 larrlp: 'â«', 14025 larrpl: '⤹', 14026 larrsim: '⥳', 14027 larrtl: 'â¢', 14028 lat: '⪫', 14029 lAtail: 'â¤', 14030 latail: 'â¤', 14031 late: 'âª', 14032 lates: 'âªï¸', 14033 lBarr: 'â¤', 14034 lbarr: 'â¤', 14035 lbbrk: 'â²', 14036 lbrace: '{', 14037 lbrack: '[', 14038 lbrke: 'â¦', 14039 lbrksld: 'â¦', 14040 lbrkslu: 'â¦', 14041 Lcaron: 'Ľ', 14042 lcaron: 'ľ', 14043 Lcedil: 'Ä»', 14044 lcedil: 'ļ', 14045 lceil: 'â', 14046 lcub: '{', 14047 Lcy: 'Ð', 14048 lcy: 'л', 14049 ldca: '⤶', 14050 ldquo: 'â', 14051 ldquor: 'â', 14052 ldrdhar: '⥧', 14053 ldrushar: 'â¥', 14054 ldsh: 'â²', 14055 lE: 'â¦', 14056 le: 'â¤', 14057 LeftAngleBracket: 'â¨', 14058 LeftArrow: 'â', 14059 Leftarrow: 'â', 14060 leftarrow: 'â', 14061 LeftArrowBar: 'â¤', 14062 LeftArrowRightArrow: 'â', 14063 leftarrowtail: 'â¢', 14064 LeftCeiling: 'â', 14065 LeftDoubleBracket: 'â¦', 14066 LeftDownTeeVector: '⥡', 14067 LeftDownVector: 'â', 14068 LeftDownVectorBar: 'â¥', 14069 LeftFloor: 'â', 14070 leftharpoondown: 'â½', 14071 leftharpoonup: 'â¼', 14072 leftleftarrows: 'â', 14073 LeftRightArrow: 'â', 14074 Leftrightarrow: 'â', 14075 leftrightarrow: 'â', 14076 leftrightarrows: 'â', 14077 leftrightharpoons: 'â', 14078 leftrightsquigarrow: 'â', 14079 LeftRightVector: 'â¥', 14080 LeftTee: 'â£', 14081 LeftTeeArrow: 'â¤', 14082 LeftTeeVector: 'â¥', 14083 leftthreetimes: 'â', 14084 LeftTriangle: 'â²', 14085 LeftTriangleBar: 'â§', 14086 LeftTriangleEqual: 'â´', 14087 LeftUpDownVector: 'â¥', 14088 LeftUpTeeVector: '⥠', 14089 LeftUpVector: 'â¿', 14090 LeftUpVectorBar: 'â¥', 14091 LeftVector: 'â¼', 14092 LeftVectorBar: 'â¥', 14093 lEg: 'âª', 14094 leg: 'â', 14095 leq: 'â¤', 14096 leqq: 'â¦', 14097 leqslant: '⩽', 14098 les: '⩽', 14099 lescc: '⪨', 14100 lesdot: 'â©¿', 14101 lesdoto: 'âª', 14102 lesdotor: 'âª', 14103 lesg: 'âï¸', 14104 lesges: 'âª', 14105 lessapprox: '⪠', 14106 lessdot: 'â', 14107 lesseqgtr: 'â', 14108 lesseqqgtr: 'âª', 14109 LessEqualGreater: 'â', 14110 LessFullEqual: 'â¦', 14111 LessGreater: 'â¶', 14112 lessgtr: 'â¶', 14113 LessLess: '⪡', 14114 lesssim: 'â²', 14115 LessSlantEqual: '⩽', 14116 LessTilde: 'â²', 14117 lfisht: '⥼', 14118 lfloor: 'â', 14119 Lfr: 'ð', 14120 lfr: 'ð©', 14121 lg: 'â¶', 14122 lgE: 'âª', 14123 lHar: '⥢', 14124 lhard: 'â½', 14125 lharu: 'â¼', 14126 lharul: '⥪', 14127 lhblk: 'â', 14128 LJcy: 'Ð', 14129 ljcy: 'Ñ', 14130 Ll: 'â', 14131 ll: 'âª', 14132 llarr: 'â', 14133 llcorner: 'â', 14134 Lleftarrow: 'â', 14135 llhard: '⥫', 14136 lltri: 'âº', 14137 Lmidot: 'Ä¿', 14138 lmidot: 'Å', 14139 lmoust: 'â°', 14140 lmoustache: 'â°', 14141 lnap: 'âª', 14142 lnapprox: 'âª', 14143 lnE: 'â¨', 14144 lne: 'âª', 14145 lneq: 'âª', 14146 lneqq: 'â¨', 14147 lnsim: 'â¦', 14148 loang: 'â¬', 14149 loarr: 'â½', 14150 lobrk: 'â¦', 14151 LongLeftArrow: 'âµ', 14152 Longleftarrow: 'â¸', 14153 longleftarrow: 'âµ', 14154 LongLeftRightArrow: 'â·', 14155 Longleftrightarrow: 'âº', 14156 longleftrightarrow: 'â·', 14157 longmapsto: 'â¼', 14158 LongRightArrow: 'â¶', 14159 Longrightarrow: 'â¹', 14160 longrightarrow: 'â¶', 14161 looparrowleft: 'â«', 14162 looparrowright: 'â¬', 14163 lopar: '⦠', 14164 Lopf: 'ð', 14165 lopf: 'ð', 14166 loplus: 'â¨', 14167 lotimes: '⨴', 14168 lowast: 'â', 14169 lowbar: '_', 14170 LowerLeftArrow: 'â', 14171 LowerRightArrow: 'â', 14172 loz: 'â', 14173 lozenge: 'â', 14174 lozf: 'â§«', 14175 lpar: '(', 14176 lparlt: 'â¦', 14177 lrarr: 'â', 14178 lrcorner: 'â', 14179 lrhar: 'â', 14180 lrhard: 'â¥', 14181 lrm: 'â', 14182 lrtri: 'â¿', 14183 lsaquo: 'â¹', 14184 Lscr: 'â', 14185 lscr: 'ð', 14186 Lsh: 'â°', 14187 lsh: 'â°', 14188 lsim: 'â²', 14189 lsime: 'âª', 14190 lsimg: 'âª', 14191 lsqb: '[', 14192 lsquo: 'â', 14193 lsquor: 'â', 14194 Lstrok: 'Å', 14195 lstrok: 'Å', 14196 Lt: 'âª', 14197 LT: '<', 14198 lt: '<', 14199 ltcc: '⪦', 14200 ltcir: '⩹', 14201 ltdot: 'â', 14202 lthree: 'â', 14203 ltimes: 'â', 14204 ltlarr: '⥶', 14205 ltquest: 'â©»', 14206 ltri: 'â', 14207 ltrie: 'â´', 14208 ltrif: 'â', 14209 ltrPar: 'â¦', 14210 lurdshar: 'â¥', 14211 luruhar: '⥦', 14212 lvertneqq: 'â¨ï¸', 14213 lvnE: 'â¨ï¸', 14214 macr: '¯', 14215 male: 'â', 14216 malt: 'â ', 14217 maltese: 'â ', 14218 Map: '⤠', 14219 map: 'â¦', 14220 mapsto: 'â¦', 14221 mapstodown: 'â§', 14222 mapstoleft: 'â¤', 14223 mapstoup: 'â¥', 14224 marker: 'â®', 14225 mcomma: '⨩', 14226 Mcy: 'Ð', 14227 mcy: 'м', 14228 mdash: 'â', 14229 mDDot: 'âº', 14230 measuredangle: 'â¡', 14231 MediumSpace: 'â', 14232 Mellintrf: 'â³', 14233 Mfr: 'ð', 14234 mfr: 'ðª', 14235 mho: 'â§', 14236 micro: 'µ', 14237 mid: 'â£', 14238 midast: '*', 14239 midcir: 'â«°', 14240 middot: '·', 14241 minus: 'â', 14242 minusb: 'â', 14243 minusd: 'â¸', 14244 minusdu: '⨪', 14245 MinusPlus: 'â', 14246 mlcp: 'â«', 14247 mldr: 'â¦', 14248 mnplus: 'â', 14249 models: 'â§', 14250 Mopf: 'ð', 14251 mopf: 'ð', 14252 mp: 'â', 14253 Mscr: 'â³', 14254 mscr: 'ð', 14255 mstpos: 'â¾', 14256 Mu: 'Î', 14257 mu: 'μ', 14258 multimap: 'â¸', 14259 mumap: 'â¸', 14260 nabla: 'â', 14261 Nacute: 'Å', 14262 nacute: 'Å', 14263 nang: 'â â', 14264 nap: 'â', 14265 napE: '⩰̸', 14266 napid: 'â̸', 14267 napos: 'Å', 14268 napprox: 'â', 14269 natur: 'â®', 14270 natural: 'â®', 14271 naturals: 'â', 14272 nbsp: ' ', 14273 nbump: 'â̸', 14274 nbumpe: 'â̸', 14275 ncap: 'â©', 14276 Ncaron: 'Å', 14277 ncaron: 'Å',
14278 Ncedil: 'Å ', 14279 ncedil: 'Å', 14280 ncong: 'â', 14281 ncongdot: 'â©Ì¸', 14282 ncup: 'â©', 14283 Ncy: 'Ð', 14284 ncy: 'н', 14285 ndash: 'â', 14286 ne: 'â ', 14287 nearhk: '⤤', 14288 neArr: 'â', 14289 nearr: 'â', 14290 nearrow: 'â', 14291 nedot: 'â̸', 14292 NegativeMediumSpace: 'â', 14293 NegativeThickSpace: 'â', 14294 NegativeThinSpace: 'â', 14295 NegativeVeryThinSpace: 'â', 14296 nequiv: 'â¢', 14297 nesear: '⤨', 14298 nesim: 'â̸', 14299 NestedGreaterGreater: 'â«', 14300 NestedLessLess: 'âª', 14301 NewLine: '\n', 14302 nexist: 'â', 14303 nexists: 'â', 14304 Nfr: 'ð', 14305 nfr: 'ð«', 14306 ngE: 'â§Ì¸', 14307 nge: 'â±', 14308 ngeq: 'â±', 14309 ngeqq: 'â§Ì¸', 14310 ngeqslant: '⩾̸', 14311 nges: '⩾̸', 14312 nGg: 'â̸', 14313 ngsim: 'âµ', 14314 nGt: 'â«â', 14315 ngt: 'â¯', 14316 ngtr: 'â¯', 14317 nGtv: 'â«Ì¸', 14318 nhArr: 'â', 14319 nharr: 'â®', 14320 nhpar: '⫲', 14321 ni: 'â', 14322 nis: 'â¼', 14323 nisd: 'âº', 14324 niv: 'â', 14325 NJcy: 'Ð', 14326 njcy: 'Ñ', 14327 nlArr: 'â', 14328 nlarr: 'â', 14329 nldr: 'â¥', 14330 nlE: 'â¦Ì¸', 14331 nle: 'â°', 14332 nLeftarrow: 'â', 14333 nleftarrow: 'â', 14334 nLeftrightarrow: 'â', 14335 nleftrightarrow: 'â®', 14336 nleq: 'â°', 14337 nleqq: 'â¦Ì¸', 14338 nleqslant: '⩽̸', 14339 nles: '⩽̸', 14340 nless: 'â®', 14341 nLl: 'â̸', 14342 nlsim: 'â´', 14343 nLt: 'âªâ', 14344 nlt: 'â®', 14345 nltri: 'âª', 14346 nltrie: 'â¬', 14347 nLtv: 'âªÌ¸', 14348 nmid: 'â¤', 14349 NoBreak: 'â ', 14350 NonBreakingSpace: ' ', 14351 Nopf: 'â', 14352 nopf: 'ð', 14353 Not: '⫬', 14354 not: '¬', 14355 NotCongruent: 'â¢', 14356 NotCupCap: 'â', 14357 NotDoubleVerticalBar: 'â¦', 14358 NotElement: 'â', 14359 NotEqual: 'â ', 14360 NotEqualTilde: 'â̸', 14361 NotExists: 'â', 14362 NotGreater: 'â¯', 14363 NotGreaterEqual: 'â±', 14364 NotGreaterFullEqual: 'â§Ì¸', 14365 NotGreaterGreater: 'â«Ì¸', 14366 NotGreaterLess: 'â¹', 14367 NotGreaterSlantEqual: '⩾̸', 14368 NotGreaterTilde: 'âµ', 14369 NotHumpDownHump: 'â̸', 14370 NotHumpEqual: 'â̸', 14371 notin: 'â', 14372 notindot: 'âµÌ¸', 14373 notinE: 'â¹Ì¸', 14374 notinva: 'â', 14375 notinvb: 'â·', 14376 notinvc: 'â¶', 14377 NotLeftTriangle: 'âª', 14378 NotLeftTriangleBar: 'â§Ì¸', 14379 NotLeftTriangleEqual: 'â¬', 14380 NotLess: 'â®', 14381 NotLessEqual: 'â°', 14382 NotLessGreater: 'â¸', 14383 NotLessLess: 'âªÌ¸', 14384 NotLessSlantEqual: '⩽̸', 14385 NotLessTilde: 'â´', 14386 NotNestedGreaterGreater: '⪢̸', 14387 NotNestedLessLess: '⪡̸', 14388 notni: 'â', 14389 notniva: 'â', 14390 notnivb: 'â¾', 14391 notnivc: 'â½', 14392 NotPrecedes: 'â', 14393 NotPrecedesEqual: '⪯̸', 14394 NotPrecedesSlantEqual: 'â ', 14395 NotReverseElement: 'â', 14396 NotRightTriangle: 'â«', 14397 NotRightTriangleBar: 'â§Ì¸', 14398 NotRightTriangleEqual: 'â', 14399 NotSquareSubset: 'â̸', 14400 NotSquareSubsetEqual: 'â¢', 14401 NotSquareSuperset: 'â̸', 14402 NotSquareSupersetEqual: 'â£', 14403 NotSubset: 'ââ', 14404 NotSubsetEqual: 'â', 14405 NotSucceeds: 'â', 14406 NotSucceedsEqual: '⪰̸', 14407 NotSucceedsSlantEqual: 'â¡', 14408 NotSucceedsTilde: 'â¿Ì¸', 14409 NotSuperset: 'ââ', 14410 NotSupersetEqual: 'â', 14411 NotTilde: 'â', 14412 NotTildeEqual: 'â', 14413 NotTildeFullEqual: 'â', 14414 NotTildeTilde: 'â', 14415 NotVerticalBar: 'â¤', 14416 npar: 'â¦', 14417 nparallel: 'â¦', 14418 nparsl: '⫽â¥', 14419 npart: 'â̸', 14420 npolint: 'â¨', 14421 npr: 'â', 14422 nprcue: 'â ', 14423 npre: '⪯̸', 14424 nprec: 'â', 14425 npreceq: '⪯̸', 14426 nrArr: 'â', 14427 nrarr: 'â', 14428 nrarrc: '⤳̸', 14429 nrarrw: 'â̸', 14430 nRightarrow: 'â', 14431 nrightarrow: 'â', 14432 nrtri: 'â«', 14433 nrtrie: 'â', 14434 nsc: 'â', 14435 nsccue: 'â¡', 14436 nsce: '⪰̸', 14437 Nscr: 'ð©', 14438 nscr: 'ð', 14439 nshortmid: 'â¤', 14440 nshortparallel: 'â¦', 14441 nsim: 'â', 14442 nsime: 'â', 14443 nsimeq: 'â', 14444 nsmid: 'â¤', 14445 nspar: 'â¦', 14446 nsqsube: 'â¢', 14447 nsqsupe: 'â£', 14448 nsub: 'â', 14449 nsubE: '⫠̸', 14450 nsube: 'â', 14451 nsubset: 'ââ', 14452 nsubseteq: 'â', 14453 nsubseteqq: '⫠̸', 14454 nsucc: 'â', 14455 nsucceq: '⪰̸', 14456 nsup: 'â ', 14457 nsupE: 'â«Ì¸', 14458 nsupe: 'â', 14459 nsupset: 'ââ', 14460 nsupseteq: 'â', 14461 nsupseteqq: 'â«Ì¸', 14462 ntgl: 'â¹', 14463 Ntilde: 'Ã', 14464 ntilde: 'ñ', 14465 ntlg: 'â¸', 14466 ntriangleleft: 'âª', 14467 ntrianglelefteq: 'â¬', 14468 ntriangleright: 'â«', 14469 ntrianglerighteq: 'â', 14470 Nu: 'Î', 14471 nu: 'ν', 14472 num: '#', 14473 numero: 'â', 14474 numsp: 'â', 14475 nvap: 'ââ', 14476 nVDash: 'â¯', 14477 nVdash: 'â®', 14478 nvDash: 'â', 14479 nvdash: 'â¬', 14480 nvge: 'â¥â', 14481 nvgt: '>â', 14482 nvHarr: 'â¤', 14483 nvinfin: 'â§', 14484 nvlArr: 'â¤', 14485 nvle: 'â¤â', 14486 nvlt: '<â', 14487 nvltrie: 'â´â', 14488 nvrArr: 'â¤', 14489 nvrtrie: 'âµâ', 14490 nvsim: 'â¼â', 14491 nwarhk: '⤣', 14492 nwArr: 'â', 14493 nwarr: 'â', 14494 nwarrow: 'â', 14495 nwnear: '⤧', 14496 Oacute: 'Ã', 14497 oacute: 'ó', 14498 oast: 'â', 14499 ocir: 'â', 14500 Ocirc: 'Ã', 14501 ocirc: 'ô', 14502 Ocy: 'Ð', 14503 ocy: 'о', 14504 odash: 'â', 14505 Odblac: 'Å', 14506 odblac: 'Å', 14507 odiv: '⨸', 14508 odot: 'â', 14509 odsold: '⦼', 14510 OElig: 'Å', 14511 oelig: 'Å', 14512 ofcir: '⦿', 14513 Ofr: 'ð', 14514 ofr: 'ð¬', 14515 ogon: 'Ë', 14516 Ograve: 'Ã', 14517 ograve: 'ò', 14518 ogt: 'â§', 14519 ohbar: '⦵', 14520 ohm: 'Ω', 14521 oint: 'â®', 14522 olarr: 'âº', 14523 olcir: '⦾', 14524 olcross: '⦻', 14525 oline: 'â¾', 14526 olt: 'â§', 14527 Omacr: 'Å', 14528 omacr: 'Å', 14529 Omega: 'Ω', 14530 omega: 'Ï', 14531 Omicron: 'Î', 14532 omicron: 'ο', 14533 omid: '⦶', 14534 ominus: 'â', 14535 Oopf: 'ð', 14536 oopf: 'ð ', 14537 opar: '⦷', 14538 OpenCurlyDoubleQuote: 'â', 14539 OpenCurlyQuote: 'â', 14540 operp: '⦹', 14541 oplus: 'â', 14542 Or: 'â©', 14543 or: 'â¨', 14544 orarr: 'â»', 14545 ord: 'â©', 14546 order: 'â´', 14547 orderof: 'â´', 14548 ordf: 'ª', 14549 ordm: 'º', 14550 origof: 'â¶', 14551 oror: 'â©', 14552 orslope: 'â©', 14553 orv: 'â©', 14554 oS: 'â', 14555 Oscr: 'ðª', 14556 oscr: 'â´', 14557 Oslash: 'Ã', 14558 oslash: 'ø', 14559 osol: 'â', 14560 Otilde: 'Ã', 14561 otilde: 'õ', 14562 Otimes: '⨷', 14563 otimes: 'â', 14564 otimesas: '⨶', 14565 Ouml: 'Ã', 14566 ouml: 'ö', 14567 ovbar: 'â½', 14568 OverBar: 'â¾', 14569 OverBrace: 'â', 14570 OverBracket: 'â´', 14571 OverParenthesis: 'â', 14572 par: 'â¥', 14573 para: '¶', 14574 parallel: 'â¥', 14575 parsim: '⫳', 14576 parsl: '⫽', 14577 part: 'â',
14578 PartialD: 'â', 14579 Pcy: 'Ð', 14580 pcy: 'п', 14581 percnt: '%', 14582 period: '.', 14583 permil: 'â°', 14584 perp: 'â¥', 14585 pertenk: 'â±', 14586 Pfr: 'ð', 14587 pfr: 'ð', 14588 Phi: 'Φ', 14589 phi: 'Ï', 14590 phiv: 'Ï', 14591 phmmat: 'â³', 14592 phone: 'â', 14593 Pi: 'Î ', 14594 pi: 'Ï', 14595 pitchfork: 'â', 14596 piv: 'Ï', 14597 planck: 'â', 14598 planckh: 'â', 14599 plankv: 'â', 14600 plus: '+', 14601 plusacir: '⨣', 14602 plusb: 'â', 14603 pluscir: '⨢', 14604 plusdo: 'â', 14605 plusdu: '⨥', 14606 pluse: '⩲', 14607 PlusMinus: '±', 14608 plusmn: '±', 14609 plussim: '⨦', 14610 plustwo: '⨧', 14611 pm: '±', 14612 Poincareplane: 'â', 14613 pointint: 'â¨', 14614 Popf: 'â', 14615 popf: 'ð¡', 14616 pound: '£', 14617 Pr: '⪻', 14618 pr: 'âº', 14619 prap: '⪷', 14620 prcue: 'â¼', 14621 prE: '⪳', 14622 pre: '⪯', 14623 prec: 'âº', 14624 precapprox: '⪷', 14625 preccurlyeq: 'â¼', 14626 Precedes: 'âº', 14627 PrecedesEqual: '⪯', 14628 PrecedesSlantEqual: 'â¼', 14629 PrecedesTilde: 'â¾', 14630 preceq: '⪯', 14631 precnapprox: '⪹', 14632 precneqq: '⪵', 14633 precnsim: 'â¨', 14634 precsim: 'â¾', 14635 Prime: 'â³', 14636 prime: 'â²', 14637 primes: 'â', 14638 prnap: '⪹', 14639 prnE: '⪵', 14640 prnsim: 'â¨', 14641 prod: 'â', 14642 Product: 'â', 14643 profalar: 'â®', 14644 profline: 'â', 14645 profsurf: 'â', 14646 prop: 'â', 14647 Proportion: 'â·', 14648 Proportional: 'â', 14649 propto: 'â', 14650 prsim: 'â¾', 14651 prurel: 'â°', 14652 Pscr: 'ð«', 14653 pscr: 'ð ', 14654 Psi: 'Ψ', 14655 psi: 'Ï', 14656 puncsp: 'â', 14657 Qfr: 'ð', 14658 qfr: 'ð®', 14659 qint: 'â¨', 14660 Qopf: 'â', 14661 qopf: 'ð¢', 14662 qprime: 'â', 14663 Qscr: 'ð¬', 14664 qscr: 'ð', 14665 quaternions: 'â', 14666 quatint: 'â¨', 14667 quest: '?', 14668 questeq: 'â', 14669 QUOT: '"', 14670 quot: '"', 14671 rAarr: 'â', 14672 race: 'â½Ì±', 14673 Racute: 'Å', 14674 racute: 'Å', 14675 radic: 'â', 14676 raemptyv: '⦳', 14677 Rang: 'â«', 14678 rang: 'â©', 14679 rangd: 'â¦', 14680 range: '⦥', 14681 rangle: 'â©', 14682 raquo: '»', 14683 Rarr: 'â ', 14684 rArr: 'â', 14685 rarr: 'â', 14686 rarrap: '⥵', 14687 rarrb: 'â¥', 14688 rarrbfs: '⤠', 14689 rarrc: '⤳', 14690 rarrfs: 'â¤', 14691 rarrhk: 'âª', 14692 rarrlp: 'â¬', 14693 rarrpl: '⥠', 14694 rarrsim: '⥴', 14695 Rarrtl: 'â¤', 14696 rarrtl: 'â£', 14697 rarrw: 'â', 14698 rAtail: 'â¤', 14699 ratail: 'â¤', 14700 ratio: 'â¶', 14701 rationals: 'â', 14702 RBarr: 'â¤', 14703 rBarr: 'â¤', 14704 rbarr: 'â¤', 14705 rbbrk: 'â³', 14706 rbrace: '}', 14707 rbrack: ']', 14708 rbrke: 'â¦', 14709 rbrksld: 'â¦', 14710 rbrkslu: 'â¦', 14711 Rcaron: 'Å', 14712 rcaron: 'Å', 14713 Rcedil: 'Å', 14714 rcedil: 'Å', 14715 rceil: 'â', 14716 rcub: '}', 14717 Rcy: 'Ð ', 14718 rcy: 'Ñ', 14719 rdca: '⤷', 14720 rdldhar: '⥩', 14721 rdquo: 'â', 14722 rdquor: 'â', 14723 rdsh: 'â³', 14724 Re: 'â', 14725 real: 'â', 14726 realine: 'â', 14727 realpart: 'â', 14728 reals: 'â', 14729 rect: 'â', 14730 REG: '®', 14731 reg: '®', 14732 ReverseElement: 'â', 14733 ReverseEquilibrium: 'â', 14734 ReverseUpEquilibrium: '⥯', 14735 rfisht: '⥽', 14736 rfloor: 'â', 14737 Rfr: 'â', 14738 rfr: 'ð¯', 14739 rHar: '⥤', 14740 rhard: 'â', 14741 rharu: 'â', 14742 rharul: '⥬', 14743 Rho: 'Ρ', 14744 rho: 'Ï', 14745 rhov: 'ϱ', 14746 RightAngleBracket: 'â©', 14747 RightArrow: 'â', 14748 Rightarrow: 'â', 14749 rightarrow: 'â', 14750 RightArrowBar: 'â¥', 14751 RightArrowLeftArrow: 'â', 14752 rightarrowtail: 'â£', 14753 RightCeiling: 'â', 14754 RightDoubleBracket: 'â§', 14755 RightDownTeeVector: 'â¥', 14756 RightDownVector: 'â', 14757 RightDownVectorBar: 'â¥', 14758 RightFloor: 'â', 14759 rightharpoondown: 'â', 14760 rightharpoonup: 'â', 14761 rightleftarrows: 'â', 14762 rightleftharpoons: 'â', 14763 rightrightarrows: 'â', 14764 rightsquigarrow: 'â', 14765 RightTee: 'â¢', 14766 RightTeeArrow: 'â¦', 14767 RightTeeVector: 'â¥', 14768 rightthreetimes: 'â', 14769 RightTriangle: 'â³', 14770 RightTriangleBar: 'â§', 14771 RightTriangleEqual: 'âµ', 14772 RightUpDownVector: 'â¥', 14773 RightUpTeeVector: 'â¥', 14774 RightUpVector: 'â¾', 14775 RightUpVectorBar: 'â¥', 14776 RightVector: 'â', 14777 RightVectorBar: 'â¥', 14778 ring: 'Ë', 14779 risingdotseq: 'â', 14780 rlarr: 'â', 14781 rlhar: 'â', 14782 rlm: 'â', 14783 rmoust: 'â±', 14784 rmoustache: 'â±', 14785 rnmid: 'â«®', 14786 roang: 'â', 14787 roarr: 'â¾', 14788 robrk: 'â§', 14789 ropar: 'â¦', 14790 Ropf: 'â', 14791 ropf: 'ð£', 14792 roplus: '⨮', 14793 rotimes: '⨵', 14794 RoundImplies: '⥰', 14795 rpar: ')', 14796 rpargt: 'â¦', 14797 rppolint: 'â¨', 14798 rrarr: 'â', 14799 Rrightarrow: 'â', 14800 rsaquo: 'âº', 14801 Rscr: 'â', 14802 rscr: 'ð', 14803 Rsh: 'â±', 14804 rsh: 'â±', 14805 rsqb: ']', 14806 rsquo: 'â', 14807 rsquor: 'â', 14808 rthree: 'â', 14809 rtimes: 'â', 14810 rtri: 'â¹', 14811 rtrie: 'âµ', 14812 rtrif: 'â¸', 14813 rtriltri: 'â§', 14814 RuleDelayed: 'â§´', 14815 ruluhar: '⥨', 14816 rx: 'â', 14817 Sacute: 'Å', 14818 sacute: 'Å', 14819 sbquo: 'â', 14820 Sc: '⪼', 14821 sc: 'â»', 14822 scap: '⪸', 14823 Scaron: 'Å ', 14824 scaron: 'Å¡', 14825 sccue: 'â½', 14826 scE: '⪴', 14827 sce: '⪰',
14828 Scedil: 'Å', 14829 scedil: 'Å', 14830 Scirc: 'Å', 14831 scirc: 'Å', 14832 scnap: '⪺', 14833 scnE: '⪶', 14834 scnsim: 'â©', 14835 scpolint: 'â¨', 14836 scsim: 'â¿', 14837 Scy: 'С', 14838 scy: 'Ñ', 14839 sdot: 'â ', 14840 sdotb: 'â¡', 14841 sdote: '⩦', 14842 searhk: '⤥', 14843 seArr: 'â', 14844 searr: 'â', 14845 searrow: 'â', 14846 sect: '§', 14847 semi: ';', 14848 seswar: '⤩', 14849 setminus: 'â', 14850 setmn: 'â', 14851 sext: 'â¶', 14852 Sfr: 'ð', 14853 sfr: 'ð°', 14854 sfrown: 'â¢', 14855 sharp: 'â¯', 14856 SHCHcy: 'Щ', 14857 shchcy: 'Ñ', 14858 SHcy: 'Ш', 14859 shcy: 'Ñ', 14860 ShortDownArrow: 'â', 14861 ShortLeftArrow: 'â', 14862 shortmid: 'â£', 14863 shortparallel: 'â¥', 14864 ShortRightArrow: 'â', 14865 ShortUpArrow: 'â', 14866 shy: 'Â', 14867 Sigma: 'Σ', 14868 sigma: 'Ï', 14869 sigmaf: 'Ï', 14870 sigmav: 'Ï', 14871 sim: 'â¼', 14872 simdot: '⩪', 14873 sime: 'â', 14874 simeq: 'â', 14875 simg: 'âª', 14876 simgE: '⪠', 14877 siml: 'âª', 14878 simlE: 'âª', 14879 simne: 'â', 14880 simplus: '⨤', 14881 simrarr: '⥲', 14882 slarr: 'â', 14883 SmallCircle: 'â', 14884 smallsetminus: 'â', 14885 smashp: '⨳', 14886 smeparsl: '⧤', 14887 smid: 'â£', 14888 smile: 'â£', 14889 smt: '⪪', 14890 smte: '⪬', 14891 smtes: '⪬ï¸', 14892 SOFTcy: 'Ь', 14893 softcy: 'Ñ', 14894 sol: '/', 14895 solb: 'â§', 14896 solbar: 'â¿', 14897 Sopf: 'ð', 14898 sopf: 'ð¤', 14899 spades: 'â ', 14900 spadesuit: 'â ', 14901 spar: 'â¥', 14902 sqcap: 'â', 14903 sqcaps: 'âï¸', 14904 sqcup: 'â', 14905 sqcups: 'âï¸', 14906 Sqrt: 'â', 14907 sqsub: 'â', 14908 sqsube: 'â', 14909 sqsubset: 'â', 14910 sqsubseteq: 'â', 14911 sqsup: 'â', 14912 sqsupe: 'â', 14913 sqsupset: 'â', 14914 sqsupseteq: 'â', 14915 squ: 'â¡', 14916 Square: 'â¡', 14917 square: 'â¡', 14918 SquareIntersection: 'â', 14919 SquareSubset: 'â', 14920 SquareSubsetEqual: 'â', 14921 SquareSuperset: 'â', 14922 SquareSupersetEqual: 'â', 14923 SquareUnion: 'â', 14924 squarf: 'âª', 14925 squf: 'âª', 14926 srarr: 'â', 14927 Sscr: 'ð®', 14928 sscr: 'ð', 14929 ssetmn: 'â', 14930 ssmile: 'â£', 14931 sstarf: 'â', 14932 Star: 'â', 14933 star: 'â', 14934 starf: 'â ', 14935 straightepsilon: 'ϵ', 14936 straightphi: 'Ï', 14937 strns: '¯', 14938 Sub: 'â', 14939 sub: 'â', 14940 subdot: '⪽', 14941 subE: 'â« ', 14942 sube: 'â', 14943 subedot: 'â«', 14944 submult: 'â«', 14945 subnE: 'â«', 14946 subne: 'â', 14947 subplus: '⪿', 14948 subrarr: '⥹', 14949 Subset: 'â', 14950 subset: 'â', 14951 subseteq: 'â', 14952 subseteqq: 'â« ', 14953 SubsetEqual: 'â', 14954 subsetneq: 'â', 14955 subsetneqq: 'â«', 14956 subsim: 'â«', 14957 subsub: 'â«', 14958 subsup: 'â«', 14959 succ: 'â»', 14960 succapprox: '⪸', 14961 succcurlyeq: 'â½', 14962 Succeeds: 'â»', 14963 SucceedsEqual: '⪰', 14964 SucceedsSlantEqual: 'â½', 14965 SucceedsTilde: 'â¿', 14966 succeq: '⪰', 14967 succnapprox: '⪺', 14968 succneqq: '⪶', 14969 succnsim: 'â©', 14970 succsim: 'â¿', 14971 SuchThat: 'â', 14972 Sum: 'â', 14973 sum: 'â', 14974 sung: 'âª', 14975 Sup: 'â', 14976 sup: 'â', 14977 sup1: '¹', 14978 sup2: '²', 14979 sup3: '³', 14980 supdot: '⪾', 14981 supdsub: 'â«', 14982 supE: 'â«', 14983 supe: 'â', 14984 supedot: 'â«', 14985 Superset: 'â', 14986 SupersetEqual: 'â', 14987 suphsol: 'â', 14988 suphsub: 'â«', 14989 suplarr: '⥻', 14990 supmult: 'â«', 14991 supnE: 'â«', 14992 supne: 'â', 14993 supplus: 'â«', 14994 Supset: 'â', 14995 supset: 'â', 14996 supseteq: 'â', 14997 supseteqq: 'â«', 14998 supsetneq: 'â', 14999 supsetneqq: 'â«', 15000 supsim: 'â«', 15001 supsub: 'â«', 15002 supsup: 'â«', 15003 swarhk: '⤦', 15004 swArr: 'â', 15005 swarr: 'â', 15006 swarrow: 'â', 15007 swnwar: '⤪', 15008 szlig: 'Ã', 15009 Tab: '\t', 15010 target: 'â', 15011 Tau: 'Τ', 15012 tau: 'Ï', 15013 tbrk: 'â´', 15014 Tcaron: 'Ť', 15015 tcaron: 'Å¥', 15016 Tcedil: 'Å¢', 15017 tcedil: 'Å£', 15018 Tcy: 'Т', 15019 tcy: 'Ñ', 15020 tdot: 'â', 15021 telrec: 'â', 15022 Tfr: 'ð', 15023 tfr: 'ð±',
15024 there4: 'â´', 15025 Therefore: 'â´', 15026 therefore: 'â´', 15027 Theta: 'Î', 15028 theta: 'θ', 15029 thetasym: 'Ï', 15030 thetav: 'Ï', 15031 thickapprox: 'â', 15032 thicksim: 'â¼', 15033 ThickSpace: 'ââ', 15034 thinsp: 'â', 15035 ThinSpace: 'â', 15036 thkap: 'â', 15037 thksim: 'â¼', 15038 THORN: 'Ã', 15039 thorn: 'þ', 15040 Tilde: 'â¼', 15041 tilde: 'Ë', 15042 TildeEqual: 'â', 15043 TildeFullEqual: 'â ', 15044 TildeTilde: 'â', 15045 times: 'Ã', 15046 timesb: 'â ', 15047 timesbar: '⨱', 15048 timesd: '⨰', 15049 tint: 'â', 15050 toea: '⤨', 15051 top: 'â¤', 15052 topbot: 'â¶', 15053 topcir: '⫱', 15054 Topf: 'ð', 15055 topf: 'ð¥', 15056 topfork: 'â«', 15057 tosa: '⤩', 15058 tprime: 'â´', 15059 TRADE: 'â¢', 15060 trade: 'â¢', 15061 triangle: 'âµ', 15062 triangledown: 'â¿', 15063 triangleleft: 'â', 15064 trianglelefteq: 'â´', 15065 triangleq: 'â', 15066 triangleright: 'â¹', 15067 trianglerighteq: 'âµ', 15068 tridot: 'â¬', 15069 trie: 'â', 15070 triminus: '⨺', 15071 TripleDot: 'â', 15072 triplus: '⨹', 15073 trisb: 'â§', 15074 tritime: '⨻', 15075 trpezium: 'â¢', 15076 Tscr: 'ð¯', 15077 tscr: 'ð', 15078 TScy: 'Ц', 15079 tscy: 'Ñ', 15080 TSHcy: 'Ð', 15081 tshcy: 'Ñ', 15082 Tstrok: 'Ŧ', 15083 tstrok: 'ŧ', 15084 twixt: 'â¬', 15085 twoheadleftarrow: 'â', 15086 twoheadrightarrow: 'â ', 15087 Uacute: 'Ã', 15088 uacute: 'ú', 15089 Uarr: 'â', 15090 uArr: 'â', 15091 uarr: 'â', 15092 Uarrocir: 'â¥', 15093 Ubrcy: 'Ð', 15094 ubrcy: 'Ñ', 15095 Ubreve: 'Ŭ', 15096 ubreve: 'Å', 15097 Ucirc: 'Ã', 15098 ucirc: 'û', 15099 Ucy: 'У', 15100 ucy: 'Ñ', 15101 udarr: 'â ', 15102 Udblac: 'Ű', 15103 udblac: 'ű', 15104 udhar: '⥮', 15105 ufisht: '⥾', 15106 Ufr: 'ð', 15107 ufr: 'ð²', 15108 Ugrave: 'Ã', 15109 ugrave: 'ù', 15110 uHar: '⥣', 15111 uharl: 'â¿', 15112 uharr: 'â¾', 15113 uhblk: 'â', 15114 ulcorn: 'â', 15115 ulcorner: 'â', 15116 ulcrop: 'â', 15117 ultri: 'â¸', 15118 Umacr: 'Ū', 15119 umacr: 'Å«', 15120 uml: '¨', 15121 UnderBar: '_', 15122 UnderBrace: 'â', 15123 UnderBracket: 'âµ', 15124 UnderParenthesis: 'â', 15125 Union: 'â', 15126 UnionPlus: 'â', 15127 Uogon: 'Ų', 15128 uogon: 'ų', 15129 Uopf: 'ð', 15130 uopf: 'ð¦', 15131 UpArrow: 'â', 15132 Uparrow: 'â', 15133 uparrow: 'â', 15134 UpArrowBar: 'â¤', 15135 UpArrowDownArrow: 'â ', 15136 UpDownArrow: 'â', 15137 Updownarrow: 'â', 15138 updownarrow: 'â', 15139 UpEquilibrium: '⥮', 15140 upharpoonleft: 'â¿', 15141 upharpoonright: 'â¾', 15142 uplus: 'â', 15143 UpperLeftArrow: 'â', 15144 UpperRightArrow: 'â', 15145 Upsi: 'Ï', 15146 upsi: 'Ï ', 15147 upsih: 'Ï', 15148 Upsilon: 'Î¥', 15149 upsilon: 'Ï ', 15150 UpTee: 'â¥', 15151 UpTeeArrow: 'â¥', 15152 upuparrows: 'â', 15153 urcorn: 'â', 15154 urcorner: 'â', 15155 urcrop: 'â', 15156 Uring: 'Å®', 15157 uring: 'ů', 15158 urtri: 'â¹', 15159 Uscr: 'ð°', 15160 uscr: 'ð', 15161 utdot: 'â°', 15162 Utilde: 'Ũ', 15163 utilde: 'Å©', 15164 utri: 'âµ', 15165 utrif: 'â´', 15166 uuarr: 'â', 15167 Uuml: 'Ã', 15168 uuml: 'ü', 15169 uwangle: '⦧', 15170 vangrt: 'â¦', 15171 varepsilon: 'ϵ', 15172 varkappa: 'ϰ', 15173 varnothing: 'â ', 15174 varphi: 'Ï', 15175 varpi: 'Ï', 15176 varpropto: 'â', 15177 vArr: 'â', 15178 varr: 'â', 15179 varrho: 'ϱ', 15180 varsigma: 'Ï', 15181 varsubsetneq: 'âï¸', 15182 varsubsetneqq: 'â«ï¸', 15183 varsupsetneq: 'âï¸', 15184 varsupsetneqq: 'â«ï¸', 15185 vartheta: 'Ï', 15186 vartriangleleft: 'â²', 15187 vartriangleright: 'â³', 15188 Vbar: 'â««', 15189 vBar: '⫨', 15190 vBarv: 'â«©', 15191 Vcy: 'Ð', 15192 vcy: 'в', 15193 VDash: 'â«', 15194 Vdash: 'â©', 15195 vDash: 'â¨', 15196 vdash: 'â¢', 15197 Vdashl: '⫦', 15198 Vee: 'â', 15199 vee: 'â¨', 15200 veebar: 'â»', 15201 veeeq: 'â', 15202 vellip: 'â®', 15203 Verbar: 'â', 15204 verbar: '|', 15205 Vert: 'â', 15206 vert: '|', 15207 VerticalBar: 'â£', 15208 VerticalLine: '|', 15209 VerticalSeparator: 'â', 15210 VerticalTilde: 'â', 15211 VeryThinSpace: 'â', 15212 Vfr: 'ð', 15213 vfr: 'ð³', 15214 vltri: 'â²', 15215 vnsub: 'ââ', 15216 vnsup: 'ââ', 15217 Vopf: 'ð', 15218 vopf: 'ð§', 15219 vprop: 'â', 15220 vrtri: 'â³', 15221 Vscr: 'ð±', 15222 vscr: 'ð', 15223 vsubnE: 'â«ï¸', 15224 vsubne: 'âï¸', 15225 vsupnE: 'â«ï¸', 15226 vsupne: 'âï¸', 15227 Vvdash: 'âª', 15228 vzigzag: 'â¦', 15229 Wcirc: 'Å´', 15230 wcirc: 'ŵ', 15231 wedbar: 'â©', 15232 Wedge: 'â', 15233 wedge: 'â§', 15234 wedgeq: 'â', 15235 weierp: 'â', 15236 Wfr: 'ð', 15237 wfr: 'ð´', 15238 Wopf: 'ð', 15239 wopf: 'ð¨', 15240 wp: 'â', 15241 wr: 'â', 15242 wreath: 'â', 15243 Wscr: 'ð²', 15244 wscr: 'ð', 15245 xcap: 'â', 15246 xcirc: 'â¯', 15247 xcup: 'â', 15248 xdtri: 'â½', 15249 Xfr: 'ð', 15250 xfr: 'ðµ', 15251 xhArr: 'âº', 15252 xharr: 'â·', 15253 Xi: 'Î', 15254 xi: 'ξ', 15255 xlArr: 'â¸', 15256 xlarr: 'âµ', 15257 xmap: 'â¼', 15258 xnis: 'â»', 15259 xodot: 'â¨', 15260 Xopf: 'ð', 15261 xopf: 'ð©', 15262 xoplus: 'â¨', 15263 xotime: 'â¨', 15264 xrArr: 'â¹', 15265 xrarr: 'â¶', 15266 Xscr: 'ð³', 15267 xscr: 'ð', 15268 xsqcup: 'â¨', 15269 xuplus: 'â¨', 15270 xutri: 'â³', 15271 xvee: 'â', 15272 xwedge: 'â', 15273 Yacute: 'Ã', 15274 yacute: 'ý', 15275 YAcy: 'Я', 15276 yacy: 'Ñ', 15277 Ycirc: 'Ŷ', 15278 ycirc: 'Å·', 15279 Ycy: 'Ы', 15280 ycy: 'Ñ', 15281 yen: 'Â¥', 15282 Yfr: 'ð', 15283 yfr: 'ð¶', 15284 YIcy: 'Ð', 15285 yicy: 'Ñ', 15286 Yopf: 'ð', 15287 yopf: 'ðª', 15288 Yscr: 'ð´', 15289 yscr: 'ð', 15290 YUcy: 'Ю', 15291 yucy: 'Ñ', 15292 Yuml: 'Ÿ', 15293 yuml: 'ÿ', 15294 Zacute: 'Ź', 15295 zacute: 'ź', 15296 Zcaron: 'Ž', 15297 zcaron: 'ž', 15298 Zcy: 'Ð', 15299 zcy: 'з', 15300 Zdot: 'Å»', 15301 zdot: 'ż', 15302 zeetrf: 'â¨', 15303 ZeroWidthSpace: 'â', 15304 Zeta: 'Î', 15305 zeta: 'ζ', 15306 Zfr: 'â¨', 15307 zfr: 'ð·', 15308 ZHcy: 'Ð', 15309 zhcy: 'ж', 15310 zigrarr: 'â', 15311 Zopf: 'â¤', 15312 zopf: 'ð«', 15313 Zscr: 'ðµ', 15314 zscr: 'ð', 15315 zwj: 'â', 15316 zwnj: 'â' 15317 })), 15318 (t.entityMap = t.HTML_ENTITIES)); 15319 }), 15320 bo = (vo.XML_ENTITIES, Ta.NAMESPACE), 15321 tn = 15322 /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, 15323 en = new RegExp( 15324 '[\\-\\.0-9' + tn.source.slice(1, -1) + '\\u00B7\\u0300-\\u036F\\u203F-\\u2040]' 15325 ), 15326 To = new RegExp('^' + tn.source + en.source + '*(?::' + tn.source + en.source + '*)?$'), 15327 So = 0, 15328 wo = 1, 15329 Eo = 2, 15330 Co = 3, 15331 ko = 4, 15332 Io = 5, 15333 xo = 6, 15334 Ao = 7; 15335 function Do(e, t) { 15336 ((this.message = e), 15337 (this.locator = t), 15338 Error.captureStackTrace && Error.captureStackTrace(this, Do)); 15339 } 15340 function Po() {} 15341 function Lo(e, t) { 15342 return ((t.lineNumber = e.lineNumber), (t.columnNumber = e.columnNumber), t); 15343 } 15344 function Oo(e, t, i) { 15345 for (var s = e.tagName, r = null, n = e.length; n--; ) { 15346 var a = e[n], 15347 o = a.qName, 15348 l = a.value, 15349 o = 15350 0 < (h = o.indexOf(':')) 15351 ? ((d = a.prefix = o.slice(0, h)), (u = o.slice(h + 1)), 'xmlns' === d && u) 15352 : ((d = null), 'xmlns' === (u = o) && ''); 15353 ((a.localName = u), 15354 !1 !== o && 15355 (null == r && ((r = {}), Ro(i, (i = {}))), 15356 (i[o] = r[o] = l), 15357 (a.uri = bo.XMLNS), 15358 t.startPrefixMapping(o, l))); 15359 } 15360 for (var d, n = e.length; n--; ) 15361 (d = (a = e[n]).prefix) && 15362 ('xml' === d && (a.uri = bo.XML), 'xmlns' !== d) && 15363 (a.uri = i[d || '']); 15364 var h, 15365 u = 15366 0 < (h = s.indexOf(':')) 15367 ? ((d = e.prefix = s.slice(0, h)), (e.localName = s.slice(h + 1))) 15368 : ((d = null), (e.localName = s)), 15369 c = (e.uri = i[d || '']); 15370 if ((t.startElement(c, u, s, e), !e.closed)) 15371 return ((e.currentNSMap = i), (e.localNSMap = r), 1); 15372 if ((t.endElement(c, u, s), r)) 15373 for (d in r) Object.prototype.hasOwnProperty.call(r, d) && t.endPrefixMapping(d); 15374 } 15375 function Ro(e, t) { 15376 for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); 15377 } 15378 function No() { 15379 this.attributeNames = {}; 15380 } 15381 (((Do.prototype = new Error()).name = Do.name), 15382 (Po.prototype = { 15383 parse: function (e, t, i) { 15384 var s = this.domBuilder; 15385 (s.startDocument(), 15386 Ro(t, (t = {})), 15387 (function (i, e, s, r, n) { 15388 function a(e) { 15389 var t = e.slice(1, -1); 15390 return Object.hasOwnProperty.call(s, t) 15391 ? s[t] 15392 : '#' === t.charAt(0) 15393 ? 65535 < (t = parseInt(t.substr(1).replace('x', '0x'))) 15394 ? ((t -= 65536), String.fromCharCode(55296 + (t >> 10), 56320 + (1023 & t))) 15395 : String.fromCharCode(t)
15396 : (n.error('entity not found:' + e), e); 15397 } 15398 function t(e) { 15399 var t; 15400 m < e && 15401 ((t = i.substring(m, e).replace(/&#?\w+;/g, a)), 15402 u && o(m), 15403 r.characters(t, 0, e - m), 15404 (m = e)); 15405 } 15406 function o(e, t) { 15407 for (; d <= e && (t = h.exec(i)); ) 15408 ((l = t.index), (d = l + t[0].length), u.lineNumber++); 15409 u.columnNumber = e - l + 1; 15410 } 15411 var l = 0, 15412 d = 0, 15413 h = /.*(?:\r\n?|\n)|.*$/g, 15414 u = r.locator, 15415 c = [{ currentNSMap: e }], 15416 p = {}, 15417 m = 0; 15418 for (;;) { 15419 try { 15420 var g, 15421 f, 15422 y = i.indexOf('<', m); 15423 if (y < 0) 15424 return ( 15425 i.substr(m).match(/^\s*$/) || 15426 ((g = r.doc), 15427 (f = g.createTextNode(i.substr(m))), 15428 g.appendChild(f), 15429 (r.currentElement = f)) 15430 ); 15431 switch ((m < y && t(y), i.charAt(y + 1))) { 15432 case '/': 15433 var _ = i.indexOf('>', y + 3), 15434 v = i.substring(y + 2, _).replace(/[ \t\n\r]+$/g, ''), 15435 b = c.pop(), 15436 T = 15437 (_ < 0 15438 ? ((v = i.substring(y + 2).replace(/[\s<].*/, '')), 15439 n.error('end tag name: ' + v + ' is not complete:' + b.tagName), 15440 (_ = y + 1 + v.length)) 15441 : v.match(/\s</) && 15442 ((v = v.replace(/[\s<].*/, '')), 15443 n.error('end tag name: ' + v + ' maybe not complete'), 15444 (_ = y + 1 + v.length)), 15445 b.localNSMap), 15446 S = b.tagName == v; 15447 if (S || (b.tagName && b.tagName.toLowerCase() == v.toLowerCase())) { 15448 if ((r.endElement(b.uri, b.localName, v), T)) 15449 for (var w in T) 15450 Object.prototype.hasOwnProperty.call(T, w) && r.endPrefixMapping(w); 15451 S || 15452 n.fatalError( 15453 'end tag name: ' + 15454 v + 15455 ' is not match the current start tagName:' + 15456 b.tagName 15457 ); 15458 } else c.push(b); 15459 _++; 15460 break; 15461 case '?': 15462 (u && o(y), 15463 (_ = (function (e, t, i) { 15464 var s = e.indexOf('?>', t); 15465 if (s) { 15466 e = e.substring(t, s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/); 15467 if (e) return (e[0].length, i.processingInstruction(e[1], e[2]), s + 2); 15468 } 15469 return -1; 15470 })(i, y, r))); 15471 break; 15472 case '!': 15473 (u && o(y), 15474 (_ = (function (e, t, i, s) { 15475 { 15476 if ('-' === e.charAt(t + 2)) 15477 return '-' === e.charAt(t + 3) 15478 ? ((n = e.indexOf('--\x3e', t + 4)), 15479 t < n 15480 ? (i.comment(e, t + 4, n - t - 4), n + 3) 15481 : (s.error('Unclosed comment'), -1)) 15482 : -1; 15483 if ('CDATA[' == e.substr(t + 3, 6)) 15484 return ( 15485 (n = e.indexOf(']]>', t + 9)), 15486 i.startCDATA(), 15487 i.characters(e, t + 9, n - t - 9), 15488 i.endCDATA(), 15489 n + 3 15490 ); 15491 var r, 15492 s = (function (e, t) { 15493 var i, 15494 s = [], 15495 r = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g; 15496 ((r.lastIndex = t), r.exec(e)); 15497 for (; (i = r.exec(e)); ) if ((s.push(i), i[1])) return s; 15498 })(e, t), 15499 n = s.length; 15500 if (1 < n && /!doctype/i.test(s[0][0])) 15501 return ( 15502 (e = s[1][0]), 15503 (r = t = !1), 15504 3 < n && 15505 (/^public$/i.test(s[2][0]) 15506 ? ((t = s[3][0]), (r = 4 < n && s[4][0])) 15507 : /^system$/i.test(s[2][0]) && (r = s[3][0])), 15508 (s = s[n - 1]), 15509 i.startDTD(e, t, r), 15510 i.endDTD(), 15511 s.index + s[0].length 15512 ); 15513 } 15514 return -1; 15515 })(i, y, r, n))); 15516 break; 15517 default: 15518 u && o(y); 15519 var E = new No(), 15520 C = c[c.length - 1].currentNSMap, 15521 _ = (function (e, t, s, i, r, n) { 15522 function a(e, t, i) { 15523 (s.attributeNames.hasOwnProperty(e) && 15524 n.fatalError('Attribute ' + e + ' redefined'), 15525 s.addValue(e, t.replace(/[\t\n\r]/g, ' ').replace(/&#?\w+;/g, r), i)); 15526 } 15527 var o, 15528 l = ++t, 15529 d = So; 15530 for (;;) { 15531 var h = e.charAt(l); 15532 switch (h) { 15533 case '=': 15534 if (d === wo) o = e.slice(t, l); 15535 else if (d !== Eo) 15536 throw new Error('attribute equal must after attrName'); 15537 d = Co; 15538 break;
15539 case "'": 15540 case '"': 15541 if (d === Co || d === wo) { 15542 if ( 15543 (d === wo && 15544 (n.warning('attribute value must after "="'), 15545 (o = e.slice(t, l))), 15546 (t = l + 1), 15547 !(0 < (l = e.indexOf(h, t)))) 15548 ) 15549 throw new Error("attribute value no end '" + h + "' match"); 15550 ((u = e.slice(t, l)), a(o, u, t - 1)); 15551 } else { 15552 if (d != ko) throw new Error('attribute value must after "="'); 15553 ((u = e.slice(t, l)), 15554 a(o, u, t), 15555 n.warning('attribute "' + o + '" missed start quot(' + h + ')!!'), 15556 (t = l + 1)); 15557 } 15558 d = Io; 15559 break; 15560 case '/': 15561 switch (d) { 15562 case So: 15563 s.setTagName(e.slice(t, l)); 15564 case Io: 15565 case xo: 15566 case Ao: 15567 ((d = Ao), (s.closed = !0)); 15568 case ko: 15569 case wo: 15570 break; 15571 case Eo: 15572 s.closed = !0; 15573 break; 15574 default: 15575 throw new Error("attribute invalid close char('/')"); 15576 } 15577 break; 15578 case '': 15579 return ( 15580 n.error('unexpected end of input'), 15581 d == So && s.setTagName(e.slice(t, l)), 15582 l 15583 ); 15584 case '>': 15585 switch (d) { 15586 case So: 15587 s.setTagName(e.slice(t, l)); 15588 case Io: 15589 case xo: 15590 case Ao: 15591 break; 15592 case ko: 15593 case wo: 15594 '/' === (u = e.slice(t, l)).slice(-1) && 15595 ((s.closed = !0), (u = u.slice(0, -1))); 15596 case Eo: 15597 (d === Eo && (u = o), 15598 d == ko 15599 ? (n.warning('attribute "' + u + '" missed quot(")!'), 15600 a(o, u, t)) 15601 : ((bo.isHTML(i['']) && 15602 u.match(/^(?:disabled|checked|selected)$/i)) || 15603 n.warning( 15604 'attribute "' + 15605 u + 15606 '" missed value!! "' + 15607 u + 15608 '" instead!!' 15609 ), 15610 a(u, u, t))); 15611 break; 15612 case Co: 15613 throw new Error('attribute value missed!!'); 15614 } 15615 return l; 15616 case 'Â': 15617 h = ' '; 15618 default: 15619 if (h <= ' ') 15620 switch (d) { 15621 case So: 15622 (s.setTagName(e.slice(t, l)), (d = xo)); 15623 break; 15624 case wo: 15625 ((o = e.slice(t, l)), (d = Eo)); 15626 break; 15627 case ko: 15628 var u = e.slice(t, l); 15629 (n.warning('attribute "' + u + '" missed quot(")!!'), 15630 a(o, u, t)); 15631 case Io: 15632 d = xo; 15633 } 15634 else 15635 switch (d) { 15636 case Eo: 15637 (s.tagName, 15638 (bo.isHTML(i['']) && 15639 o.match(/^(?:disabled|checked|selected)$/i)) || 15640 n.warning( 15641 'attribute "' + 15642 o + 15643 '" missed value!! "' + 15644 o + 15645 '" instead2!!' 15646 ), 15647 a(o, o, t), 15648 (t = l),
15649 (d = wo)); 15650 break; 15651 case Io: 15652 n.warning('attribute space is required"' + o + '"!!'); 15653 case xo: 15654 ((d = wo), (t = l)); 15655 break; 15656 case Co: 15657 ((d = ko), (t = l)); 15658 break; 15659 case Ao: 15660 throw new Error( 15661 "elements closed character '/' and '>' must be connected to" 15662 ); 15663 } 15664 } 15665 l++; 15666 } 15667 })(i, y, E, C, a, n), 15668 k = E.length; 15669 if ( 15670 (!E.closed && 15671 (function (e, t, i, s) { 15672 var r = s[i]; 15673 null == r && 15674 ((r = e.lastIndexOf('</' + i + '>')) < t && 15675 (r = e.lastIndexOf('</' + i)), 15676 (s[i] = r)); 15677 return r < t; 15678 })(i, _, E.tagName, p) && 15679 ((E.closed = !0), s.nbsp || n.warning('unclosed xml attribute')), 15680 u && k) 15681 ) { 15682 for (var I = Lo(u, {}), x = 0; x < k; x++) { 15683 var A = E[x]; 15684 (o(A.offset), (A.locator = Lo(u, {}))); 15685 } 15686 ((r.locator = I), Oo(E, r, C) && c.push(E), (r.locator = u)); 15687 } else Oo(E, r, C) && c.push(E); 15688 bo.isHTML(E.uri) && !E.closed 15689 ? (_ = (function (e, t, i, s, r) { 15690 if (/^(?:script|textarea)$/i.test(i)) { 15691 var n = e.indexOf('</' + i + '>', t), 15692 e = e.substring(t + 1, n); 15693 if (/[&<]/.test(e)) 15694 return ( 15695 /^script$/i.test(i) 15696 ? r.characters(e, 0, e.length) 15697 : ((e = e.replace(/&#?\w+;/g, s)), r.characters(e, 0, e.length)), 15698 n 15699 ); 15700 } 15701 return t + 1; 15702 })(i, _, E.tagName, a, r)) 15703 : _++; 15704 } 15705 } catch (e) { 15706 if (e instanceof Do) throw e; 15707 (n.error('element parse error: ' + e), (_ = -1)); 15708 } 15709 m < _ ? (m = _) : t(Math.max(y, m) + 1); 15710 } 15711 })(e, t, i, s, this.errorHandler), 15712 s.endDocument()); 15713 } 15714 }), 15715 (No.prototype = { 15716 setTagName: function (e) { 15717 if (!To.test(e)) throw new Error('invalid tagName:' + e); 15718 this.tagName = e; 15719 }, 15720 addValue: function (e, t, i) { 15721 if (!To.test(e)) throw new Error('invalid attribute:' + e); 15722 ((this.attributeNames[e] = this.length), 15723 (this[this.length++] = { qName: e, value: t, offset: i })); 15724 }, 15725 length: 0, 15726 getLocalName: function (e) { 15727 return this[e].localName; 15728 }, 15729 getLocator: function (e) { 15730 return this[e].locator; 15731 }, 15732 getQName: function (e) { 15733 return this[e].qName; 15734 }, 15735 getURI: function (e) { 15736 return this[e].uri; 15737 }, 15738 getValue: function (e) { 15739 return this[e].value; 15740 } 15741 })); 15742 var Zr = { XMLReader: Po, ParseError: Do }, 15743 Mo = Kr.DOMImplementation, 15744 Uo = Ta.NAMESPACE, 15745 Bo = Zr.ParseError, 15746 Fo = Zr.XMLReader; 15747 function qo(e) { 15748 return e.replace(/\r[\n\u0085]/g, '\n').replace(/[\r\u0085\u2028]/g, '\n'); 15749 } 15750 function jo(e) { 15751 this.options = e || { locator: {} }; 15752 } 15753 function Vo() { 15754 this.cdata = !1; 15755 } 15756 function Ho(e, t) { 15757 ((t.lineNumber = e.lineNumber), (t.columnNumber = e.columnNumber)); 15758 } 15759 function zo(e) { 15760 if (e) 15761 return '\n@' + (e.systemId || '') + '#[line:' + e.lineNumber + ',col:' + e.columnNumber + ']'; 15762 } 15763 function $o(e, t, i) { 15764 return 'string' == typeof e 15765 ? e.substr(t, i) 15766 : e.length >= t + i || t 15767 ? new java.lang.String(e, t, i) + '' 15768 : e; 15769 } 15770 function Wo(e, t) { 15771 (e.currentElement || e.doc).appendChild(t); 15772 } 15773 ((jo.prototype.parseFromString = function (e, t) { 15774 var i = this.options, 15775 s = new Fo(), 15776 r = i.domBuilder || new Vo(), 15777 n = i.errorHandler, 15778 a = i.locator, 15779 o = i.xmlns || {}, 15780 t = /\/x?html?$/.test(t), 15781 l = t ? vo.HTML_ENTITIES : vo.XML_ENTITIES, 15782 n = 15783 (a && r.setDocumentLocator(a), 15784 (s.errorHandler = (function (s, e, r) { 15785 if (!s) { 15786 if (e instanceof Vo) return e; 15787 s = e; 15788 } 15789 var n = {}, 15790 a = s instanceof Function; 15791 function t(t) { 15792 var i = s[t]; 15793 (!i && 15794 a && 15795 (i = 15796 2 == s.length 15797 ? function (e) { 15798 s(t, e); 15799 } 15800 : s), 15801 (n[t] = i 15802 ? function (e) { 15803 i('[xmldom ' + t + ']\t' + e + zo(r)); 15804 } 15805 : function () {})); 15806 } 15807 return ((r = r || {}), t('warning'), t('error'), t('fatalError'), n); 15808 })(n, r, a)), 15809 (s.domBuilder = i.domBuilder || r), 15810 t && (o[''] = Uo.HTML), 15811 (o.xml = o.xml || Uo.XML), 15812 i.normalizeLineEndings || qo); 15813 return ( 15814 e && 'string' == typeof e ? s.parse(n(e), o, l) : s.errorHandler.error('invalid doc source'), 15815 r.doc 15816 ); 15817 }), 15818 (Vo.prototype = { 15819 startDocument: function () { 15820 ((this.doc = new Mo().createDocument(null, null, null)), 15821 this.locator && (this.doc.documentURI = this.locator.systemId)); 15822 }, 15823 startElement: function (e, t, i, s) { 15824 var r = this.doc, 15825 n = r.createElementNS(e, i || t), 15826 a = s.length; 15827 (Wo(this, n), (this.currentElement = n), this.locator && Ho(this.locator, n)); 15828 for (var o = 0; o < a; o++) { 15829 var e = s.getURI(o), 15830 l = s.getValue(o), 15831 i = s.getQName(o), 15832 d = r.createAttributeNS(e, i); 15833 (this.locator && Ho(s.getLocator(o), d), 15834 (d.value = d.nodeValue = l), 15835 n.setAttributeNode(d)); 15836 } 15837 }, 15838 endElement: function (e, t, i) { 15839 var s = this.currentElement; 15840 (s.tagName, (this.currentElement = s.parentNode)); 15841 }, 15842 startPrefixMapping: function (e, t) {}, 15843 endPrefixMapping: function (e) {}, 15844 processingInstruction: function (e, t) { 15845 e = this.doc.createProcessingInstruction(e, t); 15846 (this.locator && Ho(this.locator, e), Wo(this, e)); 15847 }, 15848 ignorableWhitespace: function (e, t, i) {}, 15849 characters: function (e, t, i) { 15850 var s; 15851 (e = $o.apply(this, arguments)) && 15852 ((s = this.cdata ? this.doc.createCDATASection(e) : this.doc.createTextNode(e)), 15853 this.currentElement 15854 ? this.currentElement.appendChild(s) 15855 : /^\s*$/.test(e) && this.doc.appendChild(s), 15856 this.locator) && 15857 Ho(this.locator, s); 15858 }, 15859 skippedEntity: function (e) {}, 15860 endDocument: function () { 15861 this.doc.normalize(); 15862 }, 15863 setDocumentLocator: function (e) { 15864 (this.locator = e) && (e.lineNumber = 0); 15865 }, 15866 comment: function (e, t, i) { 15867 e = $o.apply(this, arguments); 15868 e = this.doc.createComment(e); 15869 (this.locator && Ho(this.locator, e), Wo(this, e)); 15870 }, 15871 startCDATA: function () { 15872 this.cdata = !0; 15873 }, 15874 endCDATA: function () { 15875 this.cdata = !1; 15876 }, 15877 startDTD: function (e, t, i) { 15878 var s = this.doc.implementation; 15879 s && 15880 s.createDocumentType && 15881 ((s = s.createDocumentType(e, t, i)), 15882 this.locator && Ho(this.locator, s), 15883 Wo(this, s), 15884 (this.doc.doctype = s)); 15885 }, 15886 warning: function (e) {}, 15887 error: function (e) {}, 15888 fatalError: function (e) { 15889 throw new Bo(e, this.locator); 15890 } 15891 }), 15892 'endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl'.replace( 15893 /\w+/g, 15894 function (e) { 15895 Vo.prototype[e] = function () { 15896 return null; 15897 }; 15898 } 15899 )); 15900 var Go = { __DOMHandler: Vo, normalizeLineEndings: qo, DOMParser: jo }.DOMParser;
15901 /*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */ 15902 let Xo = (e) => !!e && 'object' == typeof e, 15903 A = (...e) => 15904 e.reduce( 15905 (t, i) => ( 15906 'object' == typeof i && 15907 Object.keys(i).forEach((e) => { 15908 Array.isArray(t[e]) && Array.isArray(i[e]) 15909 ? (t[e] = t[e].concat(i[e])) 15910 : Xo(t[e]) && Xo(i[e]) 15911 ? (t[e] = A(t[e], i[e])) 15912 : (t[e] = i[e]); 15913 }), 15914 t 15915 ), 15916 {} 15917 ), 15918 Ko = (t) => Object.keys(t).map((e) => t[e]), 15919 Yo = (t, i) => { 15920 var s = []; 15921 for (let e = t; e < i; e++) s.push(e); 15922 return s; 15923 }, 15924 Qo = (e) => e.reduce((e, t) => e.concat(t), []), 15925 Jo = (t) => { 15926 if (!t.length) return []; 15927 var i = []; 15928 for (let e = 0; e < t.length; e++) i.push(t[e]); 15929 return i; 15930 }, 15931 Zo = (e, s) => e.reduce((e, t, i) => (t[s] && e.push(i), e), []), 15932 el = (e, i) => 15933 Ko( 15934 e.reduce( 15935 (t, e) => ( 15936 e.forEach((e) => { 15937 t[i(e)] = e; 15938 }), 15939 t 15940 ), 15941 {} 15942 ) 15943 ); 15944 var tl = { 15945 INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD', 15946 INVALID_NUMBER_OF_CONTENT_STEERING: 'INVALID_NUMBER_OF_CONTENT_STEERING', 15947 DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST', 15948 DASH_INVALID_XML: 'DASH_INVALID_XML', 15949 NO_BASE_URL: 'NO_BASE_URL', 15950 MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION', 15951 SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED', 15952 UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME' 15953 }; 15954 let il = ({ baseUrl: s = '', source: r = '', range: n = '', indexRange: a = '' }) => { 15955 s = { uri: r, resolvedUri: Bn(s || '', r) }; 15956 if (n || a) { 15957 r = (n || a).split('-'); 15958 let e = window.BigInt ? window.BigInt(r[0]) : parseInt(r[0], 10), 15959 t = window.BigInt ? window.BigInt(r[1]) : parseInt(r[1], 10); 15960 (e < Number.MAX_SAFE_INTEGER && 'bigint' == typeof e && (e = Number(e)), 15961 t < Number.MAX_SAFE_INTEGER && 'bigint' == typeof t && (t = Number(t))); 15962 let i; 15963 ('bigint' == 15964 typeof (i = 15965 'bigint' == typeof t || 'bigint' == typeof e 15966 ? window.BigInt(t) - window.BigInt(e) + window.BigInt(1) 15967 : t - e + 1) && 15968 i < Number.MAX_SAFE_INTEGER && 15969 (i = Number(i)), 15970 (s.byterange = { length: i, offset: e })); 15971 } 15972 return s; 15973 }, 15974 sl = (e) => { 15975 let t; 15976 return ( 15977 (t = 15978 'bigint' == typeof e.offset || 'bigint' == typeof e.length 15979 ? window.BigInt(e.offset) + window.BigInt(e.length) - window.BigInt(1) 15980 : e.offset + e.length - 1), 15981 e.offset + '-' + t 15982 ); 15983 }, 15984 rl = (e) => (e && 'number' != typeof e && (e = parseInt(e, 10)), isNaN(e) ? null : e), 15985 nl = { 15986 static(e) { 15987 var { duration: t, timescale: i = 1, sourceDuration: s, periodDuration: r } = e, 15988 e = rl(e.endNumber), 15989 t = t / i; 15990 return 'number' == typeof e 15991 ? { start: 0, end: e } 15992 : 'number' == typeof r 15993 ? { start: 0, end: r / t } 15994 : { start: 0, end: s / t }; 15995 }, 15996 dynamic(e) { 15997 var { 15998 NOW: t, 15999 clientOffset: i, 16000 availabilityStartTime: s, 16001 timescale: r = 1, 16002 duration: n, 16003 periodStart: a = 0, 16004 minimumUpdatePeriod: o = 0, 16005 timeShiftBufferDepth: l = 1 / 0 16006 } = e, 16007 e = rl(e.endNumber), 16008 t = (t + i) / 1e3, 16009 i = s + a, 16010 s = Math.ceil(((t + o - i) * r) / n), 16011 a = Math.floor(((t - i - l) * r) / n), 16012 o = Math.floor(((t - i) * r) / n); 16013 return { start: Math.max(0, a), end: 'number' == typeof e ? e : Math.min(s, o) }; 16014 } 16015 }, 16016 al = (n) => (e) => { 16017 var { duration: t, timescale: i = 1, periodStart: s, startNumber: r = 1 } = n; 16018 return { number: r + e, duration: t / i, timeline: s, time: e * t }; 16019 }, 16020 ol = (e) => { 16021 var { type: t, duration: i, timescale: s = 1, periodDuration: r, sourceDuration: n } = e, 16022 { start: a, end: o } = nl[t](e), 16023 a = Yo(a, o).map(al(e)); 16024 return ( 16025 'static' === t && 16026 (a[(o = a.length - 1)].duration = ('number' == typeof r ? r : n) - (i / s) * o), 16027 a 16028 ); 16029 }, 16030 ll = (e) => { 16031 var { 16032 baseUrl: t, 16033 initialization: i = {}, 16034 sourceDuration: s, 16035 indexRange: r = '', 16036 periodStart: n, 16037 presentationTime: a, 16038 number: o = 0, 16039 duration: l 16040 } = e; 16041 if (t) 16042 return ( 16043 (i = il({ baseUrl: t, source: i.sourceURL, range: i.range })), 16044 ((t = il({ baseUrl: t, source: t, indexRange: r })).map = i), 16045 l 16046 ? (r = ol(e)).length && ((t.duration = r[0].duration), (t.timeline = r[0].timeline)) 16047 : s && ((t.duration = s), (t.timeline = n)), 16048 (t.presentationTime = a || n), 16049 (t.number = o), 16050 [t] 16051 ); 16052 throw new Error(tl.NO_BASE_URL); 16053 }, 16054 dl = (e, i, s) => { 16055 var r = e.sidx.map || null, 16056 n = e.sidx.duration, 16057 a = e.timeline || 0, 16058 t = e.sidx.byterange, 16059 t = t.offset + t.length, 16060 o = i.timescale, 16061 l = i.references.filter((e) => 1 !== e.referenceType), 16062 d = [], 16063 h = e.endList ? 'static' : 'dynamic', 16064 u = e.sidx.timeline; 16065 let c = u, 16066 p = e.mediaSequence || 0, 16067 m; 16068 m = 'bigint' == typeof i.firstOffset ? window.BigInt(t) + i.firstOffset : t + i.firstOffset; 16069 for (let t = 0; t < l.length; t++) { 16070 var g = i.references[t], 16071 f = g.referencedSize, 16072 g = g.subsegmentDuration; 16073 let e; 16074 e = 'bigint' == typeof m ? m + window.BigInt(f) - window.BigInt(1) : m + f - 1; 16075 var y = m + '-' + e, 16076 y = { 16077 baseUrl: s, 16078 timescale: o, 16079 timeline: a, 16080 periodStart: u, 16081 presentationTime: c, 16082 number: p, 16083 duration: g, 16084 sourceDuration: n, 16085 indexRange: y, 16086 type: h 16087 }, 16088 y = ll(y)[0]; 16089 (r && (y.map = r), 16090 d.push(y), 16091 'bigint' == typeof m ? (m += window.BigInt(f)) : (m += f), 16092 (c += g / o), 16093 p++); 16094 } 16095 return ((e.segments = d), e); 16096 }, 16097 hl = ['AUDIO', 'SUBTITLES'], 16098 ul = 1 / 60, 16099 cl = (e) => el(e, ({ timeline: e }) => e).sort((e, t) => (e.timeline > t.timeline ? 1 : -1)), 16100 pl = (t, i) => { 16101 for (let e = 0; e < t.length; e++) if (t[e].attributes.NAME === i) return t[e]; 16102 return null; 16103 }, 16104 ml = (e) => { 16105 let r = []; 16106 return ( 16107 ya(e, hl, (e, t, i, s) => { 16108 r = r.concat(e.playlists || []); 16109 }), 16110 r 16111 ); 16112 }, 16113 gl = ({ playlist: i, mediaSequence: e }) => { 16114 ((i.mediaSequence = e),
16115 i.segments.forEach((e, t) => { 16116 e.number = i.mediaSequence + t; 16117 })); 16118 }, 16119 fl = ({ oldPlaylists: t, newPlaylists: e, timelineStarts: r }) => { 16120 e.forEach((i) => { 16121 i.discontinuitySequence = r.findIndex(function ({ timeline: e }) { 16122 return e === i.timeline; 16123 }); 16124 var e = pl(t, i.attributes.NAME); 16125 if (e && !i.sidx) { 16126 let t = i.segments[0]; 16127 var s = e.segments.findIndex(function (e) { 16128 return Math.abs(e.presentationTime - t.presentationTime) < ul; 16129 }); 16130 -1 === s 16131 ? (gl({ playlist: i, mediaSequence: e.mediaSequence + e.segments.length }), 16132 (i.segments[0].discontinuity = !0), 16133 i.discontinuityStarts.unshift(0), 16134 ((!e.segments.length && i.timeline > e.timeline) || 16135 (e.segments.length && i.timeline > e.segments[e.segments.length - 1].timeline)) && 16136 i.discontinuitySequence--) 16137 : (e.segments[s].discontinuity && 16138 !t.discontinuity && 16139 ((t.discontinuity = !0), 16140 i.discontinuityStarts.unshift(0), 16141 i.discontinuitySequence--), 16142 gl({ playlist: i, mediaSequence: e.segments[s].number })); 16143 } 16144 }); 16145 }, 16146 yl = ({ oldManifest: e, newManifest: t }) => { 16147 var i = e.playlists.concat(ml(e)), 16148 s = t.playlists.concat(ml(t)); 16149 return ( 16150 (t.timelineStarts = cl([e.timelineStarts, t.timelineStarts])), 16151 fl({ oldPlaylists: i, newPlaylists: s, timelineStarts: t.timelineStarts }), 16152 t 16153 ); 16154 }, 16155 _l = (e) => e && e.uri + '-' + sl(e.byterange), 16156 vl = (e) => { 16157 e = e.reduce(function (e, t) { 16158 return ( 16159 e[t.attributes.baseUrl] || (e[t.attributes.baseUrl] = []), 16160 e[t.attributes.baseUrl].push(t), 16161 e 16162 ); 16163 }, {}); 16164 let t = []; 16165 return ( 16166 Object.values(e).forEach((e) => { 16167 e = Ko( 16168 e.reduce((e, t) => { 16169 var i = t.attributes.id + (t.attributes.lang || ''); 16170 return ( 16171 e[i] 16172 ? (t.segments && 16173 (t.segments[0] && (t.segments[0].discontinuity = !0), 16174 e[i].segments.push(...t.segments)), 16175 t.attributes.contentProtection && 16176 (e[i].attributes.contentProtection = t.attributes.contentProtection)) 16177 : ((e[i] = t), (e[i].attributes.timelineStarts = [])), 16178 e[i].attributes.timelineStarts.push({ 16179 start: t.attributes.periodStart, 16180 timeline: t.attributes.periodStart 16181 }), 16182 e 16183 ); 16184 }, {}) 16185 ); 16186 t = t.concat(e); 16187 }), 16188 t.map((e) => ((e.discontinuityStarts = Zo(e.segments || [], 'discontinuity')), e)) 16189 ); 16190 }, 16191 bl = (e, t) => { 16192 var i = _l(e.sidx), 16193 t = i && t[i] && t[i].sidx; 16194 return (t && dl(e, t, e.sidx.resolvedUri), e); 16195 }, 16196 Tl = (e, t = {}) => { 16197 if (Object.keys(t).length) for (var i in e) e[i] = bl(e[i], t); 16198 return e; 16199 }, 16200 Sl = ( 16201 { 16202 attributes: e, 16203 segments: t, 16204 sidx: i, 16205 mediaSequence: s, 16206 discontinuitySequence: r, 16207 discontinuityStarts: n 16208 }, 16209 a 16210 ) => { 16211 r = { 16212 attributes: { NAME: e.id, BANDWIDTH: e.bandwidth, CODECS: e.codecs, 'PROGRAM-ID': 1 }, 16213 uri: '', 16214 endList: 'static' === e.type, 16215 timeline: e.periodStart, 16216 resolvedUri: e.baseUrl || '', 16217 targetDuration: e.duration, 16218 discontinuitySequence: r, 16219 discontinuityStarts: n, 16220 timelineStarts: e.timelineStarts, 16221 mediaSequence: s, 16222 segments: t 16223 }; 16224 return ( 16225 e.contentProtection && (r.contentProtection = e.contentProtection), 16226 e.serviceLocation && (r.attributes.serviceLocation = e.serviceLocation), 16227 i && (r.sidx = i), 16228 a && ((r.attributes.AUDIO = 'audio'), (r.attributes.SUBTITLES = 'subs')), 16229 r 16230 ); 16231 }, 16232 wl = ({ 16233 attributes: e, 16234 segments: t, 16235 mediaSequence: i, 16236 discontinuityStarts: s, 16237 discontinuitySequence: r 16238 }) => { 16239 'undefined' == typeof t && 16240 ((t = [ 16241 { 16242 uri: e.baseUrl, 16243 timeline: e.periodStart, 16244 resolvedUri: e.baseUrl || '', 16245 duration: e.sourceDuration, 16246 number: 0 16247 } 16248 ]), 16249 (e.duration = e.sourceDuration));
16250 var n = { NAME: e.id, BANDWIDTH: e.bandwidth, 'PROGRAM-ID': 1 }, 16251 n = 16252 (e.codecs && (n.CODECS = e.codecs), 16253 { 16254 attributes: n, 16255 uri: '', 16256 endList: 'static' === e.type, 16257 timeline: e.periodStart, 16258 resolvedUri: e.baseUrl || '', 16259 targetDuration: e.duration, 16260 timelineStarts: e.timelineStarts, 16261 discontinuityStarts: s, 16262 discontinuitySequence: r, 16263 mediaSequence: i, 16264 segments: t 16265 }); 16266 return (e.serviceLocation && (n.attributes.serviceLocation = e.serviceLocation), n); 16267 }, 16268 El = (e, n = {}, a = !1) => { 16269 let o; 16270 e = e.reduce((e, t) => { 16271 var i = (t.attributes.role && t.attributes.role.value) || '', 16272 s = t.attributes.lang || ''; 16273 let r = t.attributes.label || 'main'; 16274 e[(r = s && !t.attributes.label ? t.attributes.lang + (i ? ` (${i})` : '') : r)] || 16275 (e[r] = { language: s, autoselect: !0, default: 'main' === i, playlists: [], uri: '' }); 16276 s = bl(Sl(t, a), n); 16277 return ( 16278 e[r].playlists.push(s), 16279 'undefined' == typeof o && 'main' === i && ((o = t).default = !0), 16280 e 16281 ); 16282 }, {}); 16283 return (o || (e[Object.keys(e)[0]].default = !0), e); 16284 }, 16285 Cl = (e, r = {}) => 16286 e.reduce((e, t) => { 16287 var i = t.attributes.label || t.attributes.lang || 'text', 16288 s = t.attributes.lang || 'und'; 16289 return ( 16290 e[i] || (e[i] = { language: s, default: !1, autoselect: !1, playlists: [], uri: '' }), 16291 e[i].playlists.push(bl(wl(t), r)), 16292 e 16293 ); 16294 }, {}), 16295 kl = (e) => 16296 e.reduce( 16297 (s, e) => ( 16298 e && 16299 e.forEach((e) => { 16300 var { channel: t, language: i } = e; 16301 ((s[i] = { autoselect: !1, default: !1, instreamId: t, language: i }), 16302 e.hasOwnProperty('aspectRatio') && (s[i].aspectRatio = e.aspectRatio), 16303 e.hasOwnProperty('easyReader') && (s[i].easyReader = e.easyReader), 16304 e.hasOwnProperty('3D') && (s[i]['3D'] = e['3D'])); 16305 }), 16306 s 16307 ), 16308 {} 16309 ), 16310 Il = ({ attributes: e, segments: t, sidx: i, discontinuityStarts: s }) => { 16311 s = { 16312 attributes: { 16313 NAME: e.id, 16314 AUDIO: 'audio', 16315 SUBTITLES: 'subs', 16316 RESOLUTION: { width: e.width, height: e.height }, 16317 CODECS: e.codecs, 16318 BANDWIDTH: e.bandwidth, 16319 'PROGRAM-ID': 1 16320 }, 16321 uri: '', 16322 endList: 'static' === e.type, 16323 timeline: e.periodStart, 16324 resolvedUri: e.baseUrl || '', 16325 targetDuration: e.duration, 16326 discontinuityStarts: s, 16327 timelineStarts: e.timelineStarts, 16328 segments: t 16329 }; 16330 return ( 16331 e.frameRate && (s.attributes['FRAME-RATE'] = e.frameRate), 16332 e.contentProtection && (s.contentProtection = e.contentProtection), 16333 e.serviceLocation && (s.attributes.serviceLocation = e.serviceLocation), 16334 i && (s.sidx = i), 16335 s 16336 ); 16337 }, 16338 xl = ({ attributes: e }) => 16339 'video/mp4' === e.mimeType || 'video/webm' === e.mimeType || 'video' === e.contentType, 16340 Al = ({ attributes: e }) => 16341 'audio/mp4' === e.mimeType || 'audio/webm' === e.mimeType || 'audio' === e.contentType, 16342 Dl = ({ attributes: e }) => 'text/vtt' === e.mimeType || 'text' === e.contentType, 16343 Pl = (e, i) => { 16344 e.forEach((t) => { 16345 ((t.mediaSequence = 0), 16346 (t.discontinuitySequence = i.findIndex(function ({ timeline: e }) { 16347 return e === t.timeline; 16348 })), 16349 t.segments && 16350 t.segments.forEach((e, t) => { 16351 e.number = t; 16352 })); 16353 }); 16354 }, 16355 Ll = (i) => 16356 i 16357 ? Object.keys(i).reduce((e, t) => { 16358 t = i[t]; 16359 return e.concat(t.playlists); 16360 }, []) 16361 : [], 16362 Ol = ({ 16363 dashPlaylists: e, 16364 locations: t, 16365 contentSteering: i, 16366 sidxMapping: s = {}, 16367 previousManifest: r, 16368 eventStream: n 16369 }) => { 16370 var a, o, l, d, h, u, c; 16371 return e.length 16372 ? (({ 16373 sourceDuration: d, 16374 type: u, 16375 suggestedPresentationDelay: c, 16376 minimumUpdatePeriod: h 16377 } = e[0].attributes), 16378 (a = vl(e.filter(xl)).map(Il)), 16379 (o = vl(e.filter(Al))), 16380 (l = vl(e.filter(Dl))), 16381 (e = e.map((e) =>
16381 e.attributes.captionServices).filter(Boolean)), 16382 (d = { 16383 allowCache: !0, 16384 discontinuityStarts: [], 16385 segments: [], 16386 endList: !0, 16387 mediaGroups: { AUDIO: {}, VIDEO: {}, 'CLOSED-CAPTIONS': {}, SUBTITLES: {} }, 16388 uri: '', 16389 duration: d, 16390 playlists: Tl(a, s) 16391 }), 16392 0 <= h && (d.minimumUpdatePeriod = 1e3 * h), 16393 t && (d.locations = t), 16394 i && (d.contentSteering = i), 16395 'dynamic' === u && (d.suggestedPresentationDelay = c), 16396 n && 0 < n.length && (d.eventStream = n), 16397 (h = 0 === d.playlists.length), 16398 (t = o.length ? El(o, s, h) : null), 16399 (i = l.length ? Cl(l, s) : null), 16400 (c = (u = a.concat(Ll(t), Ll(i))).map(({ timelineStarts: e }) => e)), 16401 (d.timelineStarts = cl(c)), 16402 Pl(u, d.timelineStarts), 16403 t && (d.mediaGroups.AUDIO.audio = t), 16404 i && (d.mediaGroups.SUBTITLES.subs = i), 16405 e.length && (d.mediaGroups['CLOSED-CAPTIONS'].cc = kl(e)), 16406 r ? yl({ oldManifest: r, newManifest: d }) : d) 16407 : {}; 16408 }, 16409 Rl = (e, t, i) => { 16410 var { 16411 NOW: e, 16412 clientOffset: s, 16413 availabilityStartTime: r, 16414 timescale: n = 1, 16415 periodStart: a = 0, 16416 minimumUpdatePeriod: o = 0 16417 } = e; 16418 return Math.ceil((((e + s) / 1e3 + o - (r + a)) * n - t) / i); 16419 }, 16420 Nl = (s, r) => { 16421 var { 16422 type: n, 16423 minimumUpdatePeriod: a = 0, 16424 media: o = '', 16425 sourceDuration: l, 16426 timescale: d = 1, 16427 startNumber: h = 1, 16428 periodStart: u 16429 } = s, 16430 c = []; 16431 let p = -1; 16432 for (let i = 0; i < r.length; i++) { 16433 var m = r[i], 16434 g = m.d, 16435 f = m.r || 0, 16436 m = m.t || 0; 16437 (p < 0 && (p = m), m && m > p && (p = m)); 16438 let e; 16439 e = 16440 f < 0 16441 ? (m = i + 1) === r.length 16442 ? 'dynamic' === n && 0 < a && 0 < o.indexOf('$Number$') 16443 ? Rl(s, p, g) 16444 : (l * d - p) / g 16445 : (r[m].t - p) / g 16446 : f + 1; 16447 var y = h + c.length + e; 16448 let t = h + c.length; 16449 for (; t < y; ) 16450 (c.push({ number: t, duration: g / d, time: p, timeline: u }), (p += g), t++); 16451 } 16452 return c; 16453 }, 16454 Ml = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g, 16455 Ul = (r) => (e, t, i, s) => { 16456 return '$$' === e 16457 ? '$' 16458 : 'undefined' == typeof r[t] 16459 ? e 16460 : ((e = '' + r[t]), 16461 'RepresentationID' === t || (s = i ? parseInt(s, 10) : 1) <= e.length 16462 ? e 16463 : new Array(s - e.length + 1).join('0') + e); 16464 }, 16465 Bl = (e, t) => e.replace(Ml, Ul(t)), 16466 Fl = (e, t) => 16467 e.duration || t 16468 ? e.duration 16469 ? ol(e) 16470 : Nl(e, t) 16471 : [ 16472 { 16473 number: e.startNumber || 1, 16474 duration: e.sourceDuration, 16475 time: 0, 16476 timeline: e.periodStart 16477 } 16478 ], 16479 ql = (s, e) => { 16480 let r = { RepresentationID: s.id, Bandwidth: s.bandwidth || 0 }; 16481 var { initialization: t = { sourceURL: '', range: '' } } = s; 16482 let n = il({ baseUrl: s.baseUrl, source: Bl(t.sourceURL, r), range: t.range }); 16483 return Fl(s, e).map((e) => { 16484 ((r.Number = e.number), (r.Time = e.time)); 16485 var t = Bl(s.media || '', r), 16486 i = s.timescale || 1, 16487 i = s.periodStart + (e.time - (s.presentationTimeOffset || 0)) / i; 16488 return { 16489 uri: t, 16490 timeline: e.timeline, 16491 duration: e.duration, 16492 resolvedUri: Bn(s.baseUrl || '', t), 16493 map: n, 16494 number: e.number, 16495 presentationTime: i 16496 }; 16497 }); 16498 }, 16499 jl = (e, t) => { 16500 var { baseUrl: e, initialization: i = {} } = e, 16501 i = il({ baseUrl: e, source: i.sourceURL, range: i.range }), 16502 e = il({ baseUrl: e, source: t.media, range: t.mediaRange }); 16503 return ((e.map = i), e); 16504 }, 16505 Vl = (r, e) => { 16506 let { duration: t, segmentUrls: i = [], periodStart: n } = r; 16507 if ((!t && !e) || (t && e)) throw new Error(tl.SEGMENT_TIME_UNSPECIFIED); 16508 let a = i.map((e) => jl(r, e)), 16509 s; 16510 return ( 16511 t && (s = ol(r)), 16512 (s = e ? Nl(r, e) : s) 16513 .map((e, t) => { 16514 var i, s; 16515 if (a[t]) 16516 return ( 16517 (t = a[t]), 16518 (i = r.timescale || 1), 16519 (s = r.presentationTimeOffset || 0), 16520 (t.timeline = e.timeline), 16521 (t.duration = e.duration), 16522 (t.number = e.number), 16523 (t.presentationTime = n + (e.time - s) / i), 16524 t 16525 ); 16526 }) 16527 .filter((e) => e) 16528 ); 16529 }, 16530 Hl = ({ attributes: e, segmentInfo: t }) => { 16531 let i, s; 16532 t.template 16533 ? ((s = ql), (i = A(e, t.template))) 16534 : t.base 16535 ? ((s = ll), (i = A(e, t.base))) 16536 : t.list && ((s = Vl), (i = A(e, t.list))); 16537 var r, 16538 n, 16539 a, 16540 e = { attributes: e }; 16541 return ( 16542 s && 16543 ((r = s(i, t.segmentTimeline)), 16544 i.duration 16545 ? (({ duration: n, timescale: a = 1 } = i), (i.duration = n / a)) 16546 : r.length 16547 ? (i.duration = r.reduce((e, t) => Math.max(e, Math.ceil(t.duration)), 0)) 16548 : (i.duration = 0), 16549 (e.attributes = i), 16550 (e.segments = r), 16551 t.base) && 16552 i.indexRange && 16553 ((e.sidx = r[0]), (e.segments = [])), 16554 e 16555 ); 16556 }, 16557 zl = (e) => e.map(Hl), 16558 D = (e, t) => Jo(e.childNodes).filter(({ tagName: e }) => e === t), 16559 $l = (e) => e.textContent.trim(), 16560 Wl = (e) => { 16561 var t, 16562 i, 16563 s, 16564 r, 16565 n, 16566 e = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e); 16567 return e 16568 ? (([e, t, i, s, r, n] = e.slice(1)), 16569 31536e3 * parseFloat(e || 0) + 16570 2592e3 * parseFloat(t || 0) + 16571 86400 * parseFloat(i || 0) + 16572 3600 * parseFloat(s || 0) +
16573 60 * parseFloat(r || 0) + 16574 parseFloat(n || 0)) 16575 : 0; 16576 }, 16577 Gl = { 16578 mediaPresentationDuration(e) { 16579 return Wl(e); 16580 }, 16581 availabilityStartTime(e) { 16582 return ( 16583 /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test((e = e)) && (e += 'Z'), 16584 Date.parse(e) / 1e3 16585 ); 16586 }, 16587 minimumUpdatePeriod(e) { 16588 return Wl(e); 16589 }, 16590 suggestedPresentationDelay(e) { 16591 return Wl(e); 16592 }, 16593 type(e) { 16594 return e; 16595 }, 16596 timeShiftBufferDepth(e) { 16597 return Wl(e); 16598 }, 16599 start(e) { 16600 return Wl(e); 16601 }, 16602 width(e) { 16603 return parseInt(e, 10); 16604 }, 16605 height(e) { 16606 return parseInt(e, 10); 16607 }, 16608 bandwidth(e) { 16609 return parseInt(e, 10); 16610 }, 16611 frameRate(e) { 16612 return parseFloat(e.split('/').reduce((e, t) => e / t)); 16613 }, 16614 startNumber(e) { 16615 return parseInt(e, 10); 16616 }, 16617 timescale(e) { 16618 return parseInt(e, 10); 16619 }, 16620 presentationTimeOffset(e) { 16621 return parseInt(e, 10); 16622 }, 16623 duration(e) { 16624 var t = parseInt(e, 10); 16625 return isNaN(t) ? Wl(e) : t; 16626 }, 16627 d(e) { 16628 return parseInt(e, 10); 16629 }, 16630 t(e) { 16631 return parseInt(e, 10); 16632 }, 16633 r(e) { 16634 return parseInt(e, 10); 16635 }, 16636 presentationTime(e) { 16637 return parseInt(e, 10); 16638 }, 16639 DEFAULT(e) { 16640 return e; 16641 } 16642 }, 16643 P = (e) => 16644 e && e.attributes 16645 ? Jo(e.attributes).reduce((e, t) => { 16646 var i = Gl[t.name] || Gl.DEFAULT; 16647 return ((e[t.name] = i(t.value)), e); 16648 }, {}) 16649 : {}, 16650 Xl = { 16651 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey', 16652 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha', 16653 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready', 16654 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime', 16655 'urn:mpeg:dash:mp4protection:2011': 'mp4protection' 16656 }, 16657 Kl = (e, t) => 16658 t.length 16659 ? Qo( 16660 e.map(function (s) { 16661 return t.map(function (e) { 16662 var t = $l(e), 16663 i = Bn(s.baseUrl, t), 16664 e = A(P(e), { baseUrl: i }); 16665 return ( 16666 i !== t && 16667 !e.serviceLocation && 16668 s.serviceLocation && 16669 (e.serviceLocation = s.serviceLocation), 16670 e 16671 ); 16672 }); 16673 }) 16674 ) 16675 : e, 16676 Yl = (e) => { 16677 var t = D(e, 'SegmentTemplate')[0], 16678 i = D(e, 'SegmentList')[0], 16679 s = i && D(i, 'SegmentURL').map((e) => A({ tag: 'SegmentURL' }, P(e))), 16680 e = D(e, 'SegmentBase')[0], 16681 r = i || t, 16682 r = r && D(r, 'SegmentTimeline')[0], 16683 n = i || e || t, 16684 n = n && D(n, 'Initialization')[0], 16685 t = t && P(t); 16686 t && n 16687 ? (t.initialization = n && P(n)) 16688 : t && t.initialization && (t.initialization = { sourceURL: t.initialization }); 16689 let a = { 16690 template: t, 16691 segmentTimeline: r && D(r, 'S').map((e) => P(e)), 16692 list: i && A(P(i), { segmentUrls: s, initialization: P(n) }), 16693 base: e && A(P(e), { initialization: P(n) }) 16694 }; 16695 return ( 16696 Object.keys(a).forEach((e) => { 16697 a[e] || delete a[e]; 16698 }), 16699 a 16700 ); 16701 }, 16702 Ql = (r, n, a) => (e) => { 16703 var t = D(e, 'BaseURL'), 16704 t = Kl(n, t); 16705 let i = A(r, P(e)), 16706 s = Yl(e); 16707 return t.map((e) => ({ segmentInfo: A(a, s), attributes: A(i, e) })); 16708 }, 16709 Jl = (e) => 16710 e.reduce((e, t) => { 16711 var i = P(t), 16712 s = (i.schemeIdUri && (i.schemeIdUri = i.schemeIdUri.toLowerCase()), Xl[i.schemeIdUri]); 16713 return ( 16714 s && 16715 ((e[s] = { attributes: i }), (i = D(t, 'cenc:pssh')[0])) && 16716 ((t = $l(i)), (e[s].pssh = t && Fn(t))), 16717 e 16718 ); 16719 }, {}), 16720 Zl = (e) => {
16721 return 'urn:scte:dash:cc:cea-608:2015' === e.schemeIdUri 16722 ? ('string' != typeof e.value ? [] : e.value.split(';')).map((e) => { 16723 let t, i; 16724 return ( 16725 (i = e), 16726 /^CC\d=/.test(e) ? ([t, i] = e.split('=')) : /^CC\d$/.test(e) && (t = e), 16727 { channel: t, language: i } 16728 ); 16729 }) 16730 : 'urn:scte:dash:cc:cea-708:2015' === e.schemeIdUri 16731 ? ('string' != typeof e.value ? [] : e.value.split(';')).map((e) => { 16732 let i = { channel: void 0, language: void 0, aspectRatio: 1, easyReader: 0, '3D': 0 }; 16733 var t, s; 16734 return ( 16735 /=/.test(e) 16736 ? (([t, s = ''] = e.split('=')), 16737 (i.channel = t), 16738 (i.language = e), 16739 s.split(',').forEach((e) => { 16740 var [e, t] = e.split(':'); 16741 'lang' === e 16742 ? (i.language = t) 16743 : 'er' === e 16744 ? (i.easyReader = Number(t)) 16745 : 'war' === e 16746 ? (i.aspectRatio = Number(t)) 16747 : '3D' === e && (i['3D'] = Number(t)); 16748 })) 16749 : (i.language = e), 16750 i.channel && (i.channel = 'SERVICE' + i.channel), 16751 i 16752 ); 16753 }) 16754 : void 0; 16755 }, 16756 ed = (o) => 16757 Qo( 16758 D(o.node, 'EventStream').map((e) => { 16759 let n = P(e), 16760 a = n.schemeIdUri; 16761 return D(e, 'Event').map((e) => { 16762 var t = P(e), 16763 i = t.presentationTime || 0, 16764 s = n.timescale || 1, 16765 r = t.duration || 0, 16766 i = i / s + o.attributes.start; 16767 return { 16768 schemeIdUri: a, 16769 value: n.value, 16770 id: t.id, 16771 start: i, 16772 end: i + r / s, 16773 messageData: $l(e) || t.messageData, 16774 contentEncoding: n.contentEncoding, 16775 presentationTimeOffset: n.presentationTimeOffset || 0 16776 }; 16777 }); 16778 }) 16779 ), 16780 td = (n, a, o) => (e) => { 16781 var t = P(e), 16782 i = Kl(a, D(e, 'BaseURL')), 16783 s = D(e, 'Role')[0], 16784 s = { role: P(s) }; 16785 let r = A(n, t, s); 16786 ((t = D(e, 'Accessibility')[0]), 16787 (s = Zl(P(t))), 16788 s && (r = A(r, { captionServices: s })), 16789 (t = D(e, 'Label')[0]), 16790 t && 16791 t.childNodes.length && 16792 ((s = t.childNodes[0].nodeValue.trim()), (r = A(r, { label: s }))), 16793 (t = Jl(D(e, 'ContentProtection'))), 16794 Object.keys(t).length && (r = A(r, { contentProtection: t })), 16795 (s = Yl(e)), 16796 (t = D(e, 'Representation')), 16797 (e = A(o, s))); 16798 return Qo(t.map(Ql(r, i, e))); 16799 }, 16800 id = (n, a) => (e, t) => { 16801 var i = Kl(a, D(e.node, 'BaseURL')), 16802 s = A(n, { periodStart: e.attributes.start }), 16803 r = 16804 ('number' == typeof e.attributes.duration && (s.periodDuration = e.attributes.duration), 16805 D(e.node, 'AdaptationSet')), 16806 e = Yl(e.node); 16807 return Qo(r.map(td(s, i, e))); 16808 }, 16809 sd = (e, t) => { 16810 return ( 16811 1 < e.length && 16812 t({ 16813 type: 'warn', 16814 message: 'The MPD manifest should contain no more than one ContentSteering tag' 16815 }), 16816 e.length 16817 ? (((t = A({ serverURL: $l(e[0]) }, P(e[0]))).queryBeforeStart = 16818 'true' === t.queryBeforeStart), 16819 t) 16820 : null 16821 ); 16822 }, 16823 rd = ({ attributes: e, priorPeriodAttributes: t, mpdType: i }) => 16824 'number' == typeof e.start 16825 ? e.start 16826 : t && 'number' == typeof t.start && 'number' == typeof t.duration 16827 ? t.start + t.duration 16828 : t || 'static' !== i 16829 ? null 16830 : 0, 16831 nd = (e, t = {}) => { 16832 var { 16833 manifestUri: t = '', 16834 NOW: i = Date.now(), 16835 clientOffset: s = 0, 16836 eventHandler: r = function () {} 16837 } = t, 16838 n = D(e, 'Period');
16839 if (!n.length) throw new Error(tl.INVALID_NUMBER_OF_PERIOD); 16840 var a = D(e, 'Location'); 16841 let o = P(e); 16842 ((t = Kl([{ baseUrl: t }], D(e, 'BaseURL'))), (e = D(e, 'ContentSteering'))); 16843 ((o.type = o.type || 'static'), 16844 (o.sourceDuration = o.mediaPresentationDuration || 0), 16845 (o.NOW = i), 16846 (o.clientOffset = s), 16847 a.length && (o.locations = a.map($l))); 16848 let l = []; 16849 return ( 16850 n.forEach((e, t) => { 16851 var i = P(e), 16852 t = l[t - 1]; 16853 ((i.start = rd({ 16854 attributes: i, 16855 priorPeriodAttributes: t ? t.attributes : null, 16856 mpdType: o.type 16857 })), 16858 l.push({ node: e, attributes: i })); 16859 }), 16860 { 16861 locations: o.locations, 16862 contentSteeringInfo: sd(e, r), 16863 representationInfo: Qo(l.map(id(o, t))), 16864 eventStream: Qo(l.map(ed)) 16865 } 16866 ); 16867 }, 16868 ad = (e) => { 16869 if ('' === e) throw new Error(tl.DASH_EMPTY_MANIFEST); 16870 var t, 16871 i = new Go(); 16872 let s; 16873 try { 16874 ((t = i.parseFromString(e, 'application/xml')), 16875 (s = t && 'MPD' === t.documentElement.tagName ? t.documentElement : null)); 16876 } catch (e) {} 16877 if (!s || (s && 0 < s.getElementsByTagName('parsererror').length)) 16878 throw new Error(tl.DASH_INVALID_XML); 16879 return s; 16880 }, 16881 od = (e) => 16882 ((e) => { 16883 e = D(e, 'UTCTiming')[0]; 16884 if (!e) return null; 16885 var t = P(e); 16886 switch (t.schemeIdUri) { 16887 case 'urn:mpeg:dash:utc:http-head:2014': 16888 case 'urn:mpeg:dash:utc:http-head:2012': 16889 t.method = 'HEAD'; 16890 break; 16891 case 'urn:mpeg:dash:utc:http-xsdate:2014': 16892 case 'urn:mpeg:dash:utc:http-iso:2014': 16893 case 'urn:mpeg:dash:utc:http-xsdate:2012': 16894 case 'urn:mpeg:dash:utc:http-iso:2012': 16895 t.method = 'GET'; 16896 break; 16897 case 'urn:mpeg:dash:utc:direct:2014': 16898 case 'urn:mpeg:dash:utc:direct:2012': 16899 ((t.method = 'DIRECT'), (t.value = Date.parse(t.value))); 16900 break; 16901 default: 16902 throw new Error(tl.UNSUPPORTED_UTC_TIMING_SCHEME); 16903 } 16904 return t; 16905 })(ad(e)); 16906 function ld(e, t) { 16907 var i, s, r; 16908 return ( 16909 void 0 === t && (t = 0), 16910 (e = S(e)).length - t < 10 || !C(e, gd, { offset: t }) 16911 ? t 16912 : ((t += 16913 (void 0 === (s = t) && (s = 0), 16914 (r = (i = S((i = e)))[s + 5]), 16915 (i = (i[s + 6] << 21) | (i[s + 7] << 14) | (i[s + 8] << 7) | i[s + 9]), 16916 (16 & r) >> 4 ? 20 + i : 10 + i)), 16917 ld(e, t)) 16918 ); 16919 } 16920 function dd(e, t, i) { 16921 var s; 16922 return i >= t.length 16923 ? t.length 16924 : ((s = Sd(t, i, !1)), 16925 C(e.bytes, s.bytes) 16926 ? i 16927 : dd(e, t, i + (e = Sd(t, i + s.length)).length + e.value + s.length)); 16928 } 16929 function hd(e, t) { 16930 ((i = t), 16931 (t = Array.isArray(i) 16932 ? i.map(function (e) { 16933 return wd(e); 16934 }) 16935 : [wd(i)]), 16936 (e = S(e))); 16937 var i, 16938 s = []; 16939 if (t.length) 16940 for (var r = 0; r < e.length; ) { 16941 var n = Sd(e, r, !1), 16942 a = Sd(e, r + n.length), 16943 o = r + n.length + a.length, 16944 l = 16945 (127 === a.value && ((a.value = dd(n, e, o)), a.value !== e.length) && (a.value -= o), 16946 o + a.value > e.length ? e.length : o + a.value), 16947 o = e.subarray(o, l); 16948 (C(t[0], n.bytes) && (1 === t.length ? s.push(o) : (s = s.concat(hd(o, t.slice(1))))), 16949 (r += n.length + a.length + o.length)); 16950 } 16951 return s; 16952 } 16953 function ud(e, t, i, s) { 16954 (void 0 === s && (s = 1 / 0), (e = S(e)), (i = [].concat(i))); 16955 for (var r, n = 0, a = 0; n < e.length && (a < s || r); ) { 16956 var o = void 0; 16957 if ((C(e.subarray(n), Ed) ? (o = 4) : C(e.subarray(n), Cd) && (o = 3), o)) { 16958 if ((a++, r)) return Id(e.subarray(r, n)); 16959 var l = void 0; 16960 ('h264' === t ? (l = 31 & e[n + o]) : 'h265' === t && (l = (e[n + o] >> 1) & 63), 16961 -1 !== i.indexOf(l) && (r = n + o), 16962 (n += o + ('h264' === t ? 1 : 2))); 16963 } else n++; 16964 } 16965 return e.subarray(0, 0); 16966 } 16967 var cd = Math.pow(2, 32), 16968 pd = function (e) { 16969 var t, 16970 e = new DataView(e.buffer, e.byteOffset, e.byteLength); 16971 return e.getBigUint64 16972 ? (t = e.getBigUint64(0)) < Number.MAX_SAFE_INTEGER 16973 ? Number(t) 16974 : t 16975 : e.getUint32(0) * cd + e.getUint32(4); 16976 }, 16977 md = function (e) { 16978 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 16979 i = { 16980 version: e[0], 16981 flags: new Uint8Array(e.subarray(1, 4)), 16982 references: [], 16983 referenceId: t.getUint32(4), 16984 timescale: t.getUint32(8) 16985 }, 16986 s = 12, 16987 r = 16988 (0 === i.version 16989 ? ((i.earliestPresentationTime = t.getUint32(s)), 16990 (i.firstOffset = t.getUint32(s + 4)), 16991 (s += 8)) 16992 : ((i.earliestPresentationTime = pd(e.subarray(s))), 16993 (i.firstOffset = pd(e.subarray(s + 8))), 16994 (s += 16)), 16995 t.getUint16((s += 2))); 16996 for (s += 2; 0 < r; s += 12, r--) 16997 i.references.push({ 16998 referenceType: (128 & e[s]) >>> 7, 16999 referencedSize: 2147483647 & t.getUint32(s), 17000 subsegmentDuration: t.getUint32(s + 4), 17001 startsWithSap: !!(128 & e[s + 8]), 17002 sapType: (112 & e[s + 8]) >>> 4, 17003 sapDeltaTime: 268435455 & t.getUint32(s + 8) 17004 }); 17005 return i; 17006 }, 17007 gd = S([73, 68, 51]), 17008 fd = function (e) { 17009 return 'string' == typeof e ? fa(e) : e; 17010 }, 17011 yd = function (e) { 17012 return Array.isArray(e) 17013 ? e.map(function (e) { 17014 return fd(e); 17015 }) 17016 : [fd(e)]; 17017 }, 17018 _d = function e(t, i, s) { 17019 (void 0 === s && (s = !1), (i = yd(i)), (t = S(t))); 17020 var r = []; 17021 if (i.length) 17022 for (var n = 0; n < t.length; ) { 17023 var a = ((t[n] << 24) | (t[n + 1] << 16) | (t[n + 2] << 8) | t[n + 3]) >>> 0, 17024 o = t.subarray(n + 4, n + 8); 17025 if (0 == a) break; 17026 a = n + a; 17027 if (a > t.length) { 17028 if (s) break; 17029 a = t.length; 17030 } 17031 var l = t.subarray(n + 8, a); 17032 (C(o, i[0]) && (1 === i.length ? r.push(l) : r.push.apply(r, e(l, i.slice(1), s))), 17033 (n = a)); 17034 } 17035 return r; 17036 }, 17037 vd = { 17038 EBML: S([26, 69, 223, 163]), 17039 DocType: S([66, 130]), 17040 Segment: S([24, 83, 128, 103]),
17041 SegmentInfo: S([21, 73, 169, 102]), 17042 Tracks: S([22, 84, 174, 107]), 17043 Track: S([174]), 17044 TrackNumber: S([215]), 17045 DefaultDuration: S([35, 227, 131]), 17046 TrackEntry: S([174]), 17047 TrackType: S([131]), 17048 FlagDefault: S([136]), 17049 CodecID: S([134]), 17050 CodecPrivate: S([99, 162]), 17051 VideoTrack: S([224]), 17052 AudioTrack: S([225]), 17053 Cluster: S([31, 67, 182, 117]), 17054 Timestamp: S([231]), 17055 TimestampScale: S([42, 215, 177]), 17056 BlockGroup: S([160]), 17057 BlockDuration: S([155]), 17058 Block: S([161]), 17059 SimpleBlock: S([163]) 17060 }, 17061 bd = [128, 64, 32, 16, 8, 4, 2, 1], 17062 Td = function (e) { 17063 for (var t = 1, i = 0; i < bd.length && !(e & bd[i]); i++) t++; 17064 return t; 17065 }, 17066 Sd = function (e, t, i, s) { 17067 (void 0 === i && (i = !0), void 0 === s && (s = !1)); 17068 var r = Td(e[t]), 17069 n = e.subarray(t, t + r); 17070 return ( 17071 i && ((n = Array.prototype.slice.call(e, t, t + r))[0] ^= bd[r - 1]), 17072 { length: r, value: ma(n, { signed: s }), bytes: n } 17073 ); 17074 }, 17075 wd = function e(t) { 17076 return 'string' == typeof t ? t.match(/.{1,2}/g).map(e) : 'number' == typeof t ? ga(t) : t; 17077 }, 17078 Ed = S([0, 0, 0, 1]), 17079 Cd = S([0, 0, 1]), 17080 kd = S([0, 0, 3]), 17081 Id = function (e) { 17082 for (var t = [], i = 1; i < e.length - 2; ) 17083 (C(e.subarray(i, i + 3), kd) && (t.push(i + 2), i++), i++); 17084 if (0 === t.length) return e; 17085 for (var s = e.length - t.length, r = new Uint8Array(s), n = 0, i = 0; i < s; n++, i++) 17086 (n === t[0] && (n++, t.shift()), (r[i] = e[n])); 17087 return r; 17088 }, 17089 xd = { 17090 webm: S([119, 101, 98, 109]), 17091 matroska: S([109, 97, 116, 114, 111, 115, 107, 97]), 17092 flac: S([102, 76, 97, 67]), 17093 ogg: S([79, 103, 103, 83]), 17094 ac3: S([11, 119]), 17095 riff: S([82, 73, 70, 70]), 17096 avi: S([65, 86, 73]), 17097 wav: S([87, 65, 86, 69]), 17098 '3gp': S([102, 116, 121, 112, 51, 103]), 17099 mp4: S([102, 116, 121, 112]), 17100 fmp4: S([115, 116, 121, 112]), 17101 mov: S([102, 116, 121, 112, 113, 116]), 17102 moov: S([109, 111, 111, 118]), 17103 moof: S([109, 111, 111, 102]) 17104 }, 17105 Ad = { 17106 aac: function (e) { 17107 var t = ld(e); 17108 return C(e, [255, 16], { offset: t, mask: [255, 22] }); 17109 }, 17110 mp3: function (e) { 17111 var t = ld(e); 17112 return C(e, [255, 2], { offset: t, mask: [255, 6] }); 17113 }, 17114 webm: function (e) { 17115 e = hd(e, [vd.EBML, vd.DocType])[0]; 17116 return C(e, xd.webm); 17117 }, 17118 mkv: function (e) { 17119 e = hd(e, [vd.EBML, vd.DocType])[0]; 17120 return C(e, xd.matroska); 17121 }, 17122 mp4: function (e) { 17123 return ( 17124 !Ad['3gp'](e) && 17125 !Ad.mov(e) && 17126 (!!( 17127 C(e, xd.mp4, { offset: 4 }) || 17128 C(e, xd.fmp4, { offset: 4 }) || 17129 C(e, xd.moof, { offset: 4 }) || 17130 C(e, xd.moov, { offset: 4 }) 17131 ) || 17132 void 0) 17133 ); 17134 }, 17135 mov: function (e) { 17136 return C(e, xd.mov, { offset: 4 }); 17137 }, 17138 '3gp': function (e) { 17139 return C(e, xd['3gp'], { offset: 4 }); 17140 }, 17141 ac3: function (e) { 17142 var t = ld(e); 17143 return C(e, xd.ac3, { offset: t }); 17144 }, 17145 ts: function (e) { 17146 if (e.length < 189 && 1 <= e.length) return 71 === e[0]; 17147 for (var t = 0; t + 188 < e.length && t < 188; ) { 17148 if (71 === e[t] && 71 === e[t + 188]) return !0; 17149 t += 1; 17150 } 17151 return !1; 17152 }, 17153 flac: function (e) { 17154 var t = ld(e); 17155 return C(e, xd.flac, { offset: t }); 17156 }, 17157 ogg: function (e) { 17158 return C(e, xd.ogg); 17159 }, 17160 avi: function (e) { 17161 return C(e, xd.riff) && C(e, xd.avi, { offset: 8 }); 17162 }, 17163 wav: function (e) { 17164 return C(e, xd.riff) && C(e, xd.wav, { offset: 8 }); 17165 }, 17166 h264: function (e) { 17167 return ud(e, 'h264', 7, 3).length; 17168 }, 17169 h265: function (e) { 17170 return ud(e, 'h265', [32, 33], 3).length; 17171 } 17172 }, 17173 Dd = Object.keys(Ad) 17174 .filter(function (e) { 17175 return 'ts' !== e && 'h264' !== e && 'h265' !== e; 17176 }) 17177 .concat(['ts', 'h264', 'h265']), 17178 Pd =
17179 (Dd.forEach(function (e) { 17180 var t = Ad[e]; 17181 Ad[e] = function (e) { 17182 return t(S(e)); 17183 }; 17184 }), 17185 Ad), 17186 Ld = function (e) { 17187 e = S(e); 17188 for (var t = 0; t < Dd.length; t++) { 17189 var i = Dd[t]; 17190 if (Pd[i](e)) return i; 17191 } 17192 return ''; 17193 }, 17194 Od = function (e) { 17195 return 0 < _d(e, ['moof']).length; 17196 }, 17197 Rd = 9e4; 17198 /*! @name @videojs/http-streaming @version 3.16.0 @license Apache-2.0 */ 17199 let Nd = Bn, 17200 Md = (e, t) => (t && t.responseURL && e !== t.responseURL ? t.responseURL : e), 17201 Ud = (e) => (E.log.debug ? E.log.debug.bind(E, 'VHS:', e + ' >') : function () {}); 17202 function L(...e) { 17203 var t = E.obj || E; 17204 return (t.merge || t.mergeOptions).apply(t, e); 17205 } 17206 function O(...e) { 17207 var t = E.time || E; 17208 return (t.createTimeRanges || t.createTimeRanges).apply(t, e); 17209 } 17210 function Bd(e, i) { 17211 return Wd(e, function (e, t) { 17212 return e - $d <= i && t + $d >= i; 17213 }); 17214 } 17215 function Fd(e, t) { 17216 return Wd(e, function (e) { 17217 return e - zd >= t; 17218 }); 17219 } 17220 function qd(e) { 17221 if (e && e.length && e.end) return e.end(e.length - 1); 17222 } 17223 function jd(t, i) { 17224 let s = 0; 17225 if (t && t.length) 17226 for (let e = 0; e < t.length; e++) { 17227 var r = t.start(e), 17228 n = t.end(e); 17229 n < i || (s += r < i && i <= n ? n - i : n - r); 17230 } 17231 return s; 17232 } 17233 function Vd({ defaultDuration: t, durationList: i, startIndex: s, endIndex: r }) { 17234 let n = 0; 17235 if ((r < s && ([s, r] = [r, s]), s < 0)) { 17236 for (let e = s; e < Math.min(0, r); e++) n += t; 17237 s = 0; 17238 } 17239 for (let e = s; e < r; e++) n += i[e].duration; 17240 return n; 17241 } 17242 function Hd(e, t, i, s) { 17243 if (!e || !e.segments) return null; 17244 if (e.endList) return sh(e); 17245 if (null === t) return null; 17246 t = t || 0; 17247 let r = ih(e, e.mediaSequence + e.segments.length, t); 17248 return (i && ((s = 'number' == typeof s ? s : Zd(null, e)), (r -= s)), Math.max(0, r)); 17249 } 17250 let zd = 1 / 30, 17251 $d = 3 * zd, 17252 Wd = function (e, t) { 17253 var i = []; 17254 let s; 17255 if (e && e.length) 17256 for (s = 0; s < e.length; s++) t(e.start(s), e.end(s)) && i.push([e.start(s), e.end(s)]); 17257 return O(i); 17258 }, 17259 Gd = (t) => { 17260 var i = []; 17261 if (!t || !t.length) return ''; 17262 for (let e = 0; e < t.length; e++) i.push(t.start(e) + ' => ' + t.end(e)); 17263 return i.join(', '); 17264 }, 17265 Xd = (t) => { 17266 var i = []; 17267 for (let e = 0; e < t.length; e++) i.push({ start: t.start(e), end: t.end(e) }); 17268 return i; 17269 }, 17270 Kd = (t, e) => { 17271 if (!e.preload) return e.duration; 17272 let i = 0; 17273 return ( 17274 (e.parts || []).forEach(function (e) { 17275 i += e.duration; 17276 }), 17277 (e.preloadHints || []).forEach(function (e) { 17278 'PART' === e.type && (i += t.partTargetDuration); 17279 }), 17280 i 17281 ); 17282 }, 17283 Yd = (e) => 17284 (e.segments || []).reduce( 17285 (i, s, r) => ( 17286 s.parts 17287 ? s.parts.forEach(function (e, t) { 17288 i.push({ 17289 duration: e.duration, 17290 segmentIndex: r, 17291 partIndex: t, 17292 part: e, 17293 segment: s 17294 }); 17295 }) 17296 : i.push({ 17297 duration: s.duration, 17298 segmentIndex: r, 17299 partIndex: null, 17300 segment: s, 17301 part: null 17302 }), 17303 i 17304 ), 17305 [] 17306 ), 17307 Qd = (e) => { 17308 e = e.segments && e.segments.length && e.segments[e.segments.length - 1]; 17309 return (e && e.parts) || []; 17310 }, 17311 Jd = ({ preloadSegment: e }) => { 17312 var t; 17313 if (e) 17314 return ( 17315 ({ parts: e, preloadHints: t } = e), 17316 (t || []).reduce((e, t) => e + ('PART' === t.type ? 1 : 0), 0) + 17317 (e && e.length ? e.length : 0) 17318 ); 17319 }, 17320 Zd = (e, t) => { 17321 return t.endList 17322 ? 0 17323 : e && e.suggestedPresentationDelay 17324 ? e.suggestedPresentationDelay 17325 : (e = 0 < Qd(t).length) && t.serverControl && t.serverControl.partHoldBack 17326 ? t.serverControl.partHoldBack 17327 : e && t.partTargetDuration 17328 ? 3 * t.partTargetDuration 17329 : t.serverControl && t.serverControl.holdBack 17330 ? t.serverControl.holdBack 17331 : t.targetDuration 17332 ? 3 * t.targetDuration 17333 : 0; 17334 }, 17335 eh = function (e, t) { 17336 let i = 0, 17337 s = t - e.mediaSequence, 17338 r = e.segments[s]; 17339 if (r) { 17340 if ('undefined' != typeof r.start) return { result: r.start, precise: !0 }; 17341 if ('undefined' != typeof r.end) return { result: r.end - r.duration, precise: !0 }; 17342 } 17343 for (; s--; ) { 17344 if ('undefined' != typeof (r = e.segments[s]).end) 17345 return { result: i + r.end, precise: !0 }; 17346 if (((i += Kd(e, r)), 'undefined' != typeof r.start)) 17347 return { result: i + r.start, precise: !0 }; 17348 } 17349 return { result: i, precise: !1 }; 17350 }, 17351 th = function (e, t) { 17352 let i = 0; 17353 var s; 17354 let r = t - e.mediaSequence; 17355 for (; r < e.segments.length; r++) { 17356 if ('undefined' != typeof (s = e.segments[r]).start) 17357 return { result: s.start - i, precise: !0 }; 17358 if (((i += Kd(e, s)), 'undefined' != typeof s.end)) 17359 return { result: s.end - i, precise: !0 }; 17360 }
17361 return { result: -1, precise: !1 }; 17362 }, 17363 ih = function (e, t, i) { 17364 var s; 17365 return (t = 'undefined' == typeof t ? e.mediaSequence + e.segments.length : t) < 17366 e.mediaSequence 17367 ? 0 17368 : (s = eh(e, t)).precise 17369 ? s.result 17370 : (e = th(e, t)).precise 17371 ? e.result 17372 : s.result + i; 17373 }, 17374 sh = function (e, t, i) { 17375 if (!e) return 0; 17376 if (('number' != typeof i && (i = 0), 'undefined' == typeof t)) { 17377 if (e.totalDuration) return e.totalDuration; 17378 if (!e.endList) return window.Infinity; 17379 } 17380 return ih(e, t, i); 17381 }; 17382 function rh(e) { 17383 return e.excludeUntil && e.excludeUntil > Date.now(); 17384 } 17385 function nh(e) { 17386 return e.excludeUntil && e.excludeUntil === 1 / 0; 17387 } 17388 function ah(e) { 17389 var t = rh(e); 17390 return !e.disabled && !t; 17391 } 17392 function oh(e, t) { 17393 return t.attributes && t.attributes[e]; 17394 } 17395 function lh(e, t) { 17396 var i, 17397 s = (e && e.mediaGroups && e.mediaGroups.AUDIO) || {}; 17398 let r = !1; 17399 for (i in s) { 17400 for (var n in s[i]) if ((r = t(s[i][n]))) break; 17401 if (r) break; 17402 } 17403 return !!r; 17404 } 17405 let dh = (e, t) => { 17406 if (1 === e.playlists.length) return !0; 17407 let i = t.attributes.BANDWIDTH || Number.MAX_VALUE; 17408 return 0 === e.playlists.filter((e) => !!ah(e) && (e.attributes.BANDWIDTH || 0) < i).length; 17409 }, 17410 hh = (e, t) => 17411 !( 17412 (!e && !t) || 17413 (!e && t) || 17414 (e && !t) || 17415 (e !== t && 17416 (!e.id || !t.id || e.id !== t.id) && 17417 (!e.resolvedUri || !t.resolvedUri || e.resolvedUri !== t.resolvedUri) && 17418 (!e.uri || !t.uri || e.uri !== t.uri)) 17419 ), 17420 uh = (i) => { 17421 if (!i || !i.playlists || !i.playlists.length) 17422 return lh(i, (e) => (e.playlists && e.playlists.length) || e.uri); 17423 for (let e = 0; e < i.playlists.length; e++) { 17424 let t = i.playlists[e]; 17425 var s = t.attributes && t.attributes.CODECS; 17426 if (!s || !s.split(',').every((e) => Kn(e))) { 17427 s = lh(i, (e) => hh(t, e)); 17428 if (!s) return !1; 17429 } 17430 } 17431 return !0; 17432 }; 17433 var ch = { 17434 liveEdgeDelay: Zd, 17435 duration: sh, 17436 seekable: function (e, t, i) { 17437 var s = t || 0; 17438 let r = Hd(e, t, !0, i); 17439 return null === r ? O() : O(s, (r = r < s ? s : r)); 17440 }, 17441 getMediaInfoForTime: function ({ 17442 playlist: t, 17443 currentTime: i, 17444 startingSegmentIndex: s, 17445 startingPartIndex: r, 17446 startTime: n, 17447 exactManifestTimings: a 17448 }) { 17449 let o = i - n; 17450 var l = Yd(t); 17451 let d = 0; 17452 for (let e = 0; e < l.length; e++) { 17453 var h = l[e]; 17454 if ( 17455 s === h.segmentIndex && 17456 ('number' != typeof r || 'number' != typeof h.partIndex || r === h.partIndex) 17457 ) { 17458 d = e; 17459 break; 17460 } 17461 } 17462 if (o < 0) { 17463 if (0 < d) 17464 for (let e = d - 1; 0 <= e; e--) { 17465 var u = l[e]; 17466 if (((o += u.duration), a)) { 17467 if (o < 0) continue; 17468 } else if (o + zd <= 0) continue; 17469 return { 17470 partIndex: u.partIndex, 17471 segmentIndex: u.segmentIndex, 17472 startTime: 17473 n - 17474 Vd({ 17475 defaultDuration: t.targetDuration, 17476 durationList: l, 17477 startIndex: d, 17478 endIndex: e 17479 }) 17480 }; 17481 } 17482 return { 17483 partIndex: (l[0] && l[0].partIndex) || null, 17484 segmentIndex: (l[0] && l[0].segmentIndex) || 0, 17485 startTime: i 17486 }; 17487 } 17488 if (d < 0) { 17489 for (let e = d; e < 0; e++) 17490 if ((o -= t.targetDuration) < 0) 17491 return { 17492 partIndex: (l[0] && l[0].partIndex) || null, 17493 segmentIndex: (l[0] && l[0].segmentIndex) || 0, 17494 startTime: i 17495 }; 17496 d = 0; 17497 } 17498 for (let e = d; e < l.length; e++) { 17499 var c = l[e], 17500 p = ((o -= c.duration), c.duration > zd), 17501 m = 0 === o, 17502 p = p && 0 <= o + zd; 17503 if ((!m && !p) || e === l.length - 1) { 17504 if (a) { 17505 if (0 < o) continue; 17506 } else if (0 <= o - zd) continue; 17507 return { 17508 partIndex: c.partIndex, 17509 segmentIndex: c.segmentIndex, 17510 startTime: 17511 n + 17512 Vd({ defaultDuration: t.targetDuration, durationList: l, startIndex: d, endIndex: e }) 17513 }; 17514 } 17515 } 17516 return { 17517 segmentIndex: l[l.length - 1].segmentIndex, 17518 partIndex: l[l.length - 1].partIndex, 17519 startTime: i 17520 }; 17521 }, 17522 isEnabled: ah, 17523 isDisabled: function (e) { 17524 return e.disabled; 17525 }, 17526 isExcluded: rh, 17527 isIncompatible: nh, 17528 playlistEnd: Hd, 17529 isAes: function (t) { 17530 for (let e = 0; e < t.segments.length; e++) if (t.segments[e].key) return !0; 17531 return !1; 17532 }, 17533 hasAttribute: oh, 17534 estimateSegmentRequestTime: function (e, t, i, s = 0) { 17535 return oh('BANDWIDTH', i) ? (e * i.attributes.BANDWIDTH - 8 * s) / t : NaN; 17536 }, 17537 isLowestEnabledRendition: dh, 17538 isAudioOnly: uh, 17539 playlistMatch: hh, 17540 segmentDurationWithParts: Kd 17541 }; 17542 let ph = E.log, 17543 mh = (e, t) => e + '-' + t, 17544 gh = (e, t, i) => `placeholder-uri-${e}-${t}-` + i, 17545 fh = (r, n) => { 17546 r.mediaGroups && 17547 ['AUDIO', 'SUBTITLES'].forEach((e) => { 17548 if (r.mediaGroups[e]) 17549 for (var t in r.mediaGroups[e]) 17550 for (var i in r.mediaGroups[e][t]) { 17551 var s = r.mediaGroups[e][t][i]; 17552 n(s, e, t, i); 17553 } 17554 }); 17555 }, 17556 yh = ({ playlist: e, uri: t, id: i }) => { 17557 ((e.id = i), (e.playlistErrors_ = 0), t && (e.uri = t), (e.attributes = e.attributes || {})); 17558 }, 17559 _h = (o, e, l = gh) => { 17560 o.uri = e; 17561 for (let e = 0; e < o.playlists.length; e++) { 17562 var t; 17563 o.playlists[e].uri || ((t = 'placeholder-uri-' + e), (o.playlists[e].uri = t)); 17564 } 17565 let i = uh(o); 17566 var s; 17567 (fh(o, (e, r, n, a) => { 17568 if (!e.playlists || !e.playlists.length) { 17569 if (i && 'AUDIO' === r && !e.uri) 17570 for (let e = 0; e < o.playlists.length; e++) { 17571 var t = o.playlists[e]; 17572 if (t.attributes && t.attributes.AUDIO && t.attributes.AUDIO === n) return; 17573 } 17574 e.playlists = [f({}, e)]; 17575 }
17576 e.playlists.forEach(function (e, t) { 17577 var i = l(r, n, a, e), 17578 s = mh(t, i); 17579 (e.uri 17580 ? (e.resolvedUri = e.resolvedUri || Nd(o.uri, e.uri)) 17581 : ((e.uri = 0 === t ? i : s), (e.resolvedUri = e.uri)), 17582 (e.id = e.id || s), 17583 (e.attributes = e.attributes || {}), 17584 (o.playlists[e.id] = e), 17585 (o.playlists[e.uri] = e)); 17586 }); 17587 }), 17588 ((e) => { 17589 let t = e.playlists.length; 17590 for (; t--; ) { 17591 var i = e.playlists[t]; 17592 (yh({ playlist: i, id: mh(t, i.uri) }), 17593 (i.resolvedUri = Nd(e.uri, i.uri)), 17594 (e.playlists[i.id] = i), 17595 (e.playlists[i.uri] = i).attributes.BANDWIDTH || 17596 ph.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.')); 17597 } 17598 })(o), 17599 (s = o), 17600 fh(s, (e) => { 17601 e.uri && (e.resolvedUri = Nd(s.uri, e.uri)); 17602 })); 17603 }; 17604 class vh { 17605 constructor() { 17606 ((this.offset_ = null), 17607 (this.pendingDateRanges_ = new Map()), 17608 (this.processedDateRanges_ = new Map())); 17609 } 17610 setOffset(e = []) { 17611 null === this.offset_ && 17612 e.length && 17613 (([e] = e), void 0 !== e.programDateTime) && 17614 (this.offset_ = e.programDateTime / 1e3); 17615 } 17616 setPendingDateRanges(e = []) { 17617 var t; 17618 e.length && 17619 (([t] = e), 17620 (t = t.startDate.getTime()), 17621 this.trimProcessedDateRanges_(t), 17622 (this.pendingDateRanges_ = e.reduce((e, t) => (e.set(t.id, t), e), new Map()))); 17623 } 17624 processDateRange(e) { 17625 (this.pendingDateRanges_.delete(e.id), this.processedDateRanges_.set(e.id, e)); 17626 } 17627 getDateRangesToProcess() { 17628 if (null === this.offset_) return []; 17629 let i = {}, 17630 s = []; 17631 this.pendingDateRanges_.forEach((e, t) => { 17632 this.processedDateRanges_.has(t) || 17633 ((e.startTime = e.startDate.getTime() / 1e3 - this.offset_), 17634 (e.processDateRange = () => this.processDateRange(e)), 17635 s.push(e), 17636 e.class && 17637 (i[e.class] 17638 ? ((t = i[e.class].push(e)), (e.classListIndex = t - 1)) 17639 : ((i[e.class] = [e]), (e.classListIndex = 0)))); 17640 }); 17641 for (var e of s) { 17642 var t = i[e.class] || []; 17643 e.endDate 17644 ? (e.endTime = e.endDate.getTime() / 1e3 - this.offset_) 17645 : e.endOnNext && t[e.classListIndex + 1] 17646 ? (e.endTime = t[e.classListIndex + 1].startTime) 17647 : e.duration 17648 ? (e.endTime = e.startTime + e.duration) 17649 : e.plannedDuration 17650 ? (e.endTime = e.startTime + e.plannedDuration) 17651 : (e.endTime = e.startTime); 17652 } 17653 return s; 17654 } 17655 trimProcessedDateRanges_(i) { 17656 new Map(this.processedDateRanges_).forEach((e, t) => { 17657 e.startDate.getTime() < i && this.processedDateRanges_.delete(t); 17658 }); 17659 } 17660 } 17661 let bh = ({ requestType: e, request: t, error: i, parseFailure: s }) => { 17662 var r = t.status < 200 || 299 < t.status, 17663 n = 400 <= t.status && t.status <= 499, 17664 e = { uri: t.uri, requestType: e }, 17665 r = (r && !n) || s; 17666 return ( 17667 i && n 17668 ? ((e.error = f({}, i)), (e.errorType = E.Error.NetworkRequestFailed)) 17669 : t.aborted 17670 ? (e.errorType = E.Error.NetworkRequestAborted) 17671 : t.timedout 17672 ? (e.erroType = E.Error.NetworkRequestTimeout) 17673 : r && 17674 ((n = s ? E.Error.NetworkBodyParserFailed : E.Error.NetworkBadStatus), 17675 (e.errorType = n), 17676 (e.status = t.status), 17677 (e.headers = t.headers)), 17678 e 17679 ); 17680 }; 17681 Jr = E.EventTarget; 17682 function Th(e) { 17683 var t = e.segments || [], 17684 i = e.preloadSegment; 17685 if (i && i.parts && i.parts.length) { 17686 if (i.preloadHints) 17687 for (let e = 0; e < i.preloadHints.length; e++) 17688 if ('MAP' === i.preloadHints[e].type) return t; 17689 ((i.duration = e.targetDuration), (i.preload = !0), t.push(i)); 17690 } 17691 return t; 17692 } 17693 let Sh = (t, i) => { 17694 if (!t) return i; 17695 var s = L(t, i); 17696 if ((t.preloadHints && !i.preloadHints && delete s.preloadHints, t.parts && !i.parts)) 17697 delete s.parts; 17698 else if (t.parts && i.parts) 17699 for (let e = 0; e < i.parts.length; e++) 17700 t.parts && t.parts[e] && (s.parts[e] = L(t.parts[e], i.parts[e])); 17701 return ( 17702 !t.skipped && i.skipped && (s.skipped = !1), 17703 t.preload && !i.preload && (s.preload = !1), 17704 s 17705 ); 17706 }, 17707 wh = (e, t) => { 17708 (!e.resolvedUri && e.uri && (e.resolvedUri = Nd(t, e.uri)), 17709 e.key && !e.key.resolvedUri && (e.key.resolvedUri = Nd(t, e.key.uri)), 17710 e.map && !e.map.resolvedUri && (e.map.resolvedUri = Nd(t, e.map.uri)), 17711 e.map && 17712 e.map.key && 17713 !e.map.key.resolvedUri && 17714 (e.map.key.resolvedUri = Nd(t, e.map.key.uri)), 17715 e.parts && 17716 e.parts.length &&
17717 e.parts.forEach((e) => { 17718 e.resolvedUri || (e.resolvedUri = Nd(t, e.uri)); 17719 }), 17720 e.preloadHints && 17721 e.preloadHints.length && 17722 e.preloadHints.forEach((e) => { 17723 e.resolvedUri || (e.resolvedUri = Nd(t, e.uri)); 17724 })); 17725 }, 17726 Eh = (e, t) => 17727 e === t || 17728 (e.segments && 17729 t.segments && 17730 e.segments.length === t.segments.length && 17731 e.endList === t.endList && 17732 e.mediaSequence === t.mediaSequence && 17733 e.preloadSegment === t.preloadSegment), 17734 Ch = (e, r, t = Eh) => { 17735 var i = L(e, {}), 17736 s = i.playlists[r.id]; 17737 if (!s) return null; 17738 if (t(s, r)) return null; 17739 r.segments = Th(r); 17740 let n = L(s, r); 17741 if ((n.preloadSegment && !r.preloadSegment && delete n.preloadSegment, s.segments)) { 17742 if (r.skip) { 17743 r.segments = r.segments || []; 17744 for (let e = 0; e < r.skip.skippedSegments; e++) r.segments.unshift({ skipped: !0 }); 17745 } 17746 n.segments = ((e, t, i) => { 17747 var s = e.slice(), 17748 r = t.slice(), 17749 n = ((i = i || 0), []); 17750 let a; 17751 for (let e = 0; e < r.length; e++) { 17752 var o = s[e + i], 17753 l = r[e]; 17754 o ? ((a = o.map || a), n.push(Sh(o, l))) : (a && !l.map && (l.map = a), n.push(l)); 17755 } 17756 return n; 17757 })(s.segments, r.segments, r.mediaSequence - s.mediaSequence); 17758 } 17759 n.segments.forEach((e) => { 17760 wh(e, n.resolvedUri); 17761 }); 17762 for (let e = 0; e < i.playlists.length; e++) 17763 i.playlists[e].id === r.id && (i.playlists[e] = n); 17764 return ( 17765 (i.playlists[r.id] = n), 17766 (i.playlists[r.uri] = n), 17767 fh(e, (t, e, i, s) => { 17768 if (t.playlists) 17769 for (let e = 0; e < t.playlists.length; e++) 17770 r.id === t.playlists[e].id && (t.playlists[e] = n); 17771 }), 17772 i 17773 ); 17774 }, 17775 kh = (e, t) => { 17776 var i = e.segments || [], 17777 i = i[i.length - 1], 17778 s = i && i.parts && i.parts[i.parts.length - 1], 17779 s = (s && s.duration) || (i && i.duration); 17780 return t && s ? 1e3 * s : 500 * (e.partTargetDuration || e.targetDuration || 10); 17781 }, 17782 Ih = (e, t, i) => { 17783 if (e) { 17784 let r = []; 17785 return ( 17786 e.forEach((e) => { 17787 var t, i, s; 17788 e.attributes && 17789 (({ BANDWIDTH: t, RESOLUTION: i, CODECS: s } = e.attributes), 17790 r.push({ id: e.id, bandwidth: t, resolution: i, codecs: s })); 17791 }), 17792 { type: t, isLive: i, renditions: r } 17793 ); 17794 } 17795 }; 17796 class xh extends Jr { 17797 constructor(e, t, i = {}) { 17798 if ((super(), !e)) throw new Error('A non-empty playlist URL or object is required'); 17799 this.logger_ = Ud('PlaylistLoader'); 17800 var { withCredentials: s = !1 } = i, 17801 e = 17802 ((this.src = e), 17803 (this.vhs_ = t), 17804 (this.withCredentials = s), 17805 (this.addDateRangesToTextTrack_ = i.addDateRangesToTextTrack), 17806 t.options_); 17807 ((this.customTagParsers = (e && e.customTagParsers) || []), 17808 (this.customTagMappers = (e && e.customTagMappers) || []), 17809 (this.llhls = e && e.llhls), 17810 (this.dateRangesStorage_ = new vh()), 17811 (this.state = 'HAVE_NOTHING'), 17812 (this.handleMediaupdatetimeout_ = this.handleMediaupdatetimeout_.bind(this)), 17813 this.on('mediaupdatetimeout', this.handleMediaupdatetimeout_), 17814 this.on('loadedplaylist', this.handleLoadedPlaylist_.bind(this))); 17815 } 17816 handleLoadedPlaylist_() { 17817 var e = this.media(); 17818 e && 17819 (this.dateRangesStorage_.setOffset(e.segments), 17820 this.dateRangesStorage_.setPendingDateRanges(e.dateRanges), 17821 (e = this.dateRangesStorage_.getDateRangesToProcess()).length) && 17822 this.addDateRangesToTextTrack_ && 17823 this.addDateRangesToTextTrack_(e); 17824 } 17825 handleMediaupdatetimeout_() { 17826 if ('HAVE_METADATA' === this.state) { 17827 var t = this.media(); 17828 let e = Nd(this.main.uri, t.uri); 17829 (this.llhls && 17830 (e = ((e, t) => { 17831 if (!t.endList && t.serverControl) { 17832 let i = {}; 17833 if (t.serverControl.canBlockReload) { 17834 var s, 17835 r = t.preloadSegment; 17836 let e = t.mediaSequence + t.segments.length; 17837 (r && 17838 ((r = r.parts || []), 17839 -1 < (s = Jd(t) - 1) && s != r.length - 1 && (i._HLS_part = s), 17840 -1 < s || r.length) && 17841 e--, 17842 (i._HLS_msn = e)); 17843 } 17844 if ( 17845 (t.serverControl && 17846 t.serverControl.canSkipUntil && 17847 (i._HLS_skip = t.serverControl.canSkipDateranges ? 'v2' : 'YES'), 17848 Object.keys(i).length) 17849 ) { 17850 let t = new window.URL(e); 17851 (['_HLS_skip', '_HLS_msn', '_HLS_part'].forEach(function (e) { 17852 i.hasOwnProperty(e) && t.searchParams.set(e, i[e]); 17853 }), 17854 (e = t.toString())); 17855 } 17856 } 17857 return e; 17858 })(e, t)), 17859 (this.state = 'HAVE_CURRENT_METADATA'), 17860 (this.request = this.vhs_.xhr( 17861 { uri: e, withCredentials: this.withCredentials, requestType: 'hls-playlist' }, 17862 (e, t) => { 17863 if (this.request) 17864 return e 17865 ? this.playlistRequestError(this.request, this.media(), 'HAVE_METADATA') 17866 : void this.haveMetadata({ 17867 playlistString: this.request.responseText, 17868 url: this.media().uri, 17869 id: this.media().id 17870 }); 17871 } 17872 ))); 17873 } 17874 } 17875 playlistRequestError(e, t, i) { 17876 var { uri: t, id: s } = t; 17877 ((this.request = null),
17878 i && (this.state = i), 17879 (this.error = { 17880 playlist: this.main.playlists[s], 17881 status: e.status, 17882 message: `HLS playlist request error at URL: ${t}.`, 17883 responseText: e.responseText, 17884 code: 500 <= e.status ? 4 : 2, 17885 metadata: bh({ requestType: e.requestType, request: e, error: e.error }) 17886 }), 17887 this.trigger('error')); 17888 } 17889 parseManifest_({ url: t, manifestString: e }) { 17890 try { 17891 return (({ 17892 onwarn: t, 17893 oninfo: e, 17894 manifestString: i, 17895 customTagParsers: s = [], 17896 customTagMappers: r = [], 17897 llhls: n 17898 }) => { 17899 let a = new Xn(), 17900 o = 17901 (t && a.on('warn', t), 17902 e && a.on('info', e), 17903 s.forEach((e) => a.addParser(e)), 17904 r.forEach((e) => a.addTagMapper(e)), 17905 a.push(i), 17906 a.end(), 17907 a.manifest); 17908 if ( 17909 (n || 17910 ([ 17911 'preloadSegment', 17912 'skip', 17913 'serverControl', 17914 'renditionReports', 17915 'partInf', 17916 'partTargetDuration' 17917 ].forEach(function (e) { 17918 o.hasOwnProperty(e) && delete o[e]; 17919 }), 17920 o.segments && 17921 o.segments.forEach(function (t) { 17922 ['parts', 'preloadHints'].forEach(function (e) { 17923 t.hasOwnProperty(e) && delete t[e]; 17924 }); 17925 })), 17926 !o.targetDuration) 17927 ) { 17928 let e = 10; 17929 (o.segments && 17930 o.segments.length && 17931 (e = o.segments.reduce((e, t) => Math.max(e, t.duration), 0)), 17932 t && t({ message: 'manifest has no targetDuration defaulting to ' + e }), 17933 (o.targetDuration = e)); 17934 } 17935 e = Qd(o); 17936 return ( 17937 e.length && 17938 !o.partTargetDuration && 17939 ((s = e.reduce((e, t) => Math.max(e, t.duration), 0)), 17940 t && 17941 (t({ message: 'manifest has no partTargetDuration defaulting to ' + s }), 17942 ph.error( 17943 'LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.' 17944 )), 17945 (o.partTargetDuration = s)), 17946 o 17947 ); 17948 })({ 17949 onwarn: ({ message: e }) => this.logger_(`m3u8-parser warn for ${t}: ` + e), 17950 oninfo: ({ message: e }) => this.logger_(`m3u8-parser info for ${t}: ` + e), 17951 manifestString: e, 17952 customTagParsers: this.customTagParsers, 17953 customTagMappers: this.customTagMappers, 17954 llhls: this.llhls 17955 }); 17956 } catch (e) { 17957 ((this.error = e), 17958 (this.error.metadata = { errorType: E.Error.StreamingHlsPlaylistParserError, error: e })); 17959 } 17960 } 17961 haveMetadata({ playlistString: e, playlistObject: t, url: i, id: s }) { 17962 ((this.request = null), (this.state = 'HAVE_METADATA')); 17963 var r = { playlistInfo: { type: 'media', uri: i } }, 17964 t = 17965 (this.trigger({ type: 'playlistparsestart', metadata: r }), 17966 t || this.parseManifest_({ url: i, manifestString: e })), 17967 e = ((t.lastRequest = Date.now()), yh({ playlist: t, uri: i, id: s }), Ch(this.main, t)); 17968 ((this.targetDuration = t.partTargetDuration || t.targetDuration), 17969 (this.pendingMedia_ = null), 17970 e 17971 ? ((this.main = e), (this.media_ = this.main.playlists[s])) 17972 : this.trigger('playlistunchanged'), 17973 this.updateMediaUpdateTimeout_(kh(this.media(), !!e)), 17974 (r.parsedPlaylist = Ih(this.main.playlists, r.playlistInfo.type, !this.media_.endList)), 17975 this.trigger({ type: 'playlistparsecomplete', metadata: r }), 17976 this.trigger('loadedplaylist')); 17977 } 17978 dispose() { 17979 (this.trigger('dispose'), 17980 this.stopRequest(), 17981 window.clearTimeout(this.mediaUpdateTimeout), 17982 window.clearTimeout(this.finalRenditionTimeout), 17983 (this.dateRangesStorage_ = new vh()), 17984 this.off()); 17985 } 17986 stopRequest() { 17987 var e; 17988 this.request && 17989 ((e = this.request), (this.request = null), (e.onreadystatechange = null), e.abort()); 17990 } 17991 media(r, e) { 17992 if (!r) return this.media_; 17993 if ('HAVE_NOTHING' === this.state) 17994 throw new Error('Cannot switch media playlist from ' + this.state); 17995 if ('string' == typeof r) { 17996 if (!this.main.playlists[r]) throw new Error('Unknown playlist URI: ' + r); 17997 r = this.main.playlists[r]; 17998 } 17999 if ((window.clearTimeout(this.finalRenditionTimeout), e)) 18000 ((e = ((r.partTargetDuration || r.targetDuration) / 2) * 1e3 || 5e3), 18001 (this.finalRenditionTimeout = window.setTimeout(this.media.bind(this, r, !1), e))); 18002 else { 18003 let s = this.state; 18004 var e = !this.media_ || r.id !== this.media_.id, 18005 t = this.main.playlists[r.id]; 18006 if ((t && t.endList) || (r.endList && r.segments.length)) 18007 (this.request && 18008 ((this.request.onreadystatechange = null), this.request.abort(), (this.request = null)), 18009 (this.state = 'HAVE_METADATA'), 18010 (this.media_ = r), 18011 e && 18012 (this.trigger('mediachanging'), 18013 'HAVE_MAIN_MANIFEST' === s 18014 ? this.trigger('loadedmetadata') 18015 : this.trigger('mediachange'))); 18016 else if ((this.updateMediaUpdateTimeout_(kh(r, !0)), e)) { 18017 if (((this.state = 'SWITCHING_MEDIA'), this.request)) { 18018 if (r.resolvedUri === this.request.url) return; 18019 ((this.request.onreadystatechange = null), this.request.abort(), (this.request = null)); 18020 } 18021 this.media_ && this.trigger('mediachanging'); 18022 let i = { playlistInfo: { type: 'media', uri: (this.pendingMedia_ = r).uri } }; 18023 (this.trigger({ type: 'playlistrequeststart', metadata: i }), 18024 (this.request = this.vhs_.xhr( 18025 { 18026 uri: r.resolvedUri, 18027 withCredentials: this.withCredentials, 18028 requestType: 'hls-playlist' 18029 }, 18030 (e, t) => { 18031 if (this.request) { 18032 if (((r.lastRequest = Date.now()), (r.resolvedUri = Md(r.resolvedUri, t)), e)) 18033 return this.playlistRequestError(this.request, r, s); 18034 (this.trigger({ type: 'playlistrequestcomplete', metadata: i }), 18035 this.haveMetadata({ playlistString: t.responseText, url: r.uri, id: r.id }), 18036 'HAVE_MAIN_MANIFEST' === s 18037 ? this.trigger('loadedmetadata') 18038 : this.trigger('mediachange')); 18039 } 18040 } 18041 ))); 18042 } 18043 } 18044 } 18045 pause() { 18046 (this.mediaUpdateTimeout && 18047 (window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null)), 18048 this.stopRequest(), 18049 'HAVE_NOTHING' === this.state && (this.started = !1), 18050 'SWITCHING_MEDIA' === this.state 18051 ? this.media_ 18052 ? (this.state = 'HAVE_METADATA') 18053 : (this.state = 'HAVE_MAIN_MANIFEST') 18054 : 'HAVE_CURRENT_METADATA' === this.state && (this.state = 'HAVE_METADATA')); 18055 } 18056 load(e) { 18057 this.mediaUpdateTimeout && 18058 (window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null)); 18059 var t = this.media(); 18060 e 18061 ? ((e = t ? ((t.partTargetDuration || t.targetDuration) / 2) * 1e3 : 5e3), 18062 (this.mediaUpdateTimeout = window.setTimeout(() => { 18063 ((this.mediaUpdateTimeout = null), this.load()); 18064 }, e))) 18065 : this.started 18066 ? t && !t.endList 18067 ? this.trigger('mediaupdatetimeout') 18068 : this.trigger('loadedplaylist') 18069 : this.start(); 18070 } 18071 updateMediaUpdateTimeout_(e) { 18072 (this.mediaUpdateTimeout && 18073 (window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null)), 18074 this.media() && 18075 !this.media().endList && 18076 (this.mediaUpdateTimeout = window.setTimeout(() => { 18077 ((this.mediaUpdateTimeout = null),
18078 this.trigger('mediaupdatetimeout'), 18079 this.updateMediaUpdateTimeout_(e)); 18080 }, e))); 18081 } 18082 start() { 18083 if (((this.started = !0), 'object' == typeof this.src)) 18084 (this.src.uri || (this.src.uri = window.location.href), 18085 (this.src.resolvedUri = this.src.uri), 18086 setTimeout(() => { 18087 this.setupInitialPlaylist(this.src); 18088 }, 0)); 18089 else { 18090 let i = { playlistInfo: { type: 'multivariant', uri: this.src } }; 18091 (this.trigger({ type: 'playlistrequeststart', metadata: i }), 18092 (this.request = this.vhs_.xhr( 18093 { uri: this.src, withCredentials: this.withCredentials, requestType: 'hls-playlist' }, 18094 (e, t) => { 18095 if (this.request) { 18096 if (((this.request = null), e)) 18097 return ( 18098 (this.error = { 18099 status: t.status, 18100 message: `HLS playlist request error at URL: ${this.src}.`, 18101 responseText: t.responseText, 18102 code: 2, 18103 metadata: bh({ requestType: t.requestType, request: t, error: e }) 18104 }), 18105 'HAVE_NOTHING' === this.state && (this.started = !1), 18106 this.trigger('error') 18107 ); 18108 (this.trigger({ type: 'playlistrequestcomplete', metadata: i }), 18109 (this.src = Md(this.src, t)), 18110 this.trigger({ type: 'playlistparsestart', metadata: i })); 18111 e = this.parseManifest_({ manifestString: t.responseText, url: this.src }); 18112 ((i.parsedPlaylist = Ih(e.playlists, i.playlistInfo.type, !1)), 18113 this.trigger({ type: 'playlistparsecomplete', metadata: i }), 18114 this.setupInitialPlaylist(e)); 18115 } 18116 } 18117 ))); 18118 } 18119 } 18120 srcUri() { 18121 return 'string' == typeof this.src ? this.src : this.src.uri; 18122 } 18123 setupInitialPlaylist(e) { 18124 var t, i, s, r; 18125 ((this.state = 'HAVE_MAIN_MANIFEST'), 18126 e.playlists 18127 ? ((this.main = e), 18128 _h(this.main, this.srcUri()),
18129 e.playlists.forEach((t) => { 18130 ((t.segments = Th(t)), 18131 t.segments.forEach((e) => { 18132 wh(e, t.resolvedUri); 18133 })); 18134 }), 18135 this.trigger('loadedplaylist'), 18136 this.request || this.media(this.main.playlists[0])) 18137 : ((t = this.srcUri() || window.location.href), 18138 (this.main = 18139 ((i = t), 18140 (s = mh(0, i)), 18141 ((r = { 18142 mediaGroups: { AUDIO: {}, VIDEO: {}, 'CLOSED-CAPTIONS': {}, SUBTITLES: {} }, 18143 uri: window.location.href, 18144 resolvedUri: window.location.href, 18145 playlists: [{ uri: i, id: s, resolvedUri: i, attributes: {} }] 18146 }).playlists[s] = r.playlists[0]), 18147 (r.playlists[i] = r.playlists[0]), 18148 r)), 18149 this.haveMetadata({ playlistObject: e, url: t, id: this.main.playlists[0].id }), 18150 this.trigger('loadedmetadata'))); 18151 } 18152 updateOrDeleteClone(e, t) { 18153 var i = this.main, 18154 s = e.ID; 18155 let r = i.playlists.length; 18156 for (; r--; ) { 18157 var n, 18158 a, 18159 o, 18160 l, 18161 d, 18162 h = i.playlists[r]; 18163 h.attributes['PATHWAY-ID'] === s && 18164 ((n = h.resolvedUri), 18165 (a = h.id), 18166 t 18167 ? ((o = this.createCloneURI_(h.resolvedUri, e)), 18168 (l = mh(s, o)), 18169 (d = this.createCloneAttributes_(s, h.attributes)), 18170 (h = this.createClonePlaylist_(h, l, e, d)), 18171 (i.playlists[r] = h), 18172 (i.playlists[l] = h), 18173 (i.playlists[o] = h)) 18174 : i.playlists.splice(r, 1), 18175 delete i.playlists[a], 18176 delete i.playlists[n]); 18177 } 18178 this.updateOrDeleteCloneMedia(e, t); 18179 } 18180 updateOrDeleteCloneMedia(e, t) { 18181 let s = this.main, 18182 r = e.ID; 18183 (['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach((e) => { 18184 if (s.mediaGroups[e] && s.mediaGroups[e][r]) 18185 for (var t in s.mediaGroups[e]) 18186 if (t === r) { 18187 for (var i in s.mediaGroups[e][t])
18188 s.mediaGroups[e][t][i].playlists.forEach((e, t) => { 18189 var e = s.playlists[e.id], 18190 i = e.id, 18191 e = e.resolvedUri; 18192 (delete s.playlists[i], delete s.playlists[e]); 18193 }); 18194 delete s.mediaGroups[e][t]; 18195 } 18196 }), 18197 t && this.createClonedMediaGroups_(e)); 18198 } 18199 addClonePathway(e, t = {}) { 18200 var i = this.main, 18201 s = i.playlists.length, 18202 r = this.createCloneURI_(t.resolvedUri, e), 18203 n = mh(e.ID, r), 18204 a = this.createCloneAttributes_(e.ID, t.attributes), 18205 t = this.createClonePlaylist_(t, n, e, a); 18206 ((i.playlists[s] = t), 18207 (i.playlists[n] = t), 18208 (i.playlists[r] = t), 18209 this.createClonedMediaGroups_(e)); 18210 } 18211 createClonedMediaGroups_(l) { 18212 let d = l.ID, 18213 s = l['BASE-ID'], 18214 h = this.main; 18215 ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach((o) => { 18216 if (h.mediaGroups[o] && !h.mediaGroups[o][d]) 18217 for (var e in h.mediaGroups[o]) 18218 if (e === s) { 18219 h.mediaGroups[o][d] = {}; 18220 for (let a in h.mediaGroups[o][e]) { 18221 var t = h.mediaGroups[o][e][a]; 18222 h.mediaGroups[o][d][a] = f({}, t); 18223 let n = h.mediaGroups[o][d][a]; 18224 var i = this.createCloneURI_(t.resolvedUri, l); 18225 ((n.resolvedUri = i), 18226 (n.uri = i), 18227 (n.playlists = []),
18228 t.playlists.forEach((e, t) => { 18229 var i, 18230 s = h.playlists[e.id], 18231 r = gh(o, d, a), 18232 r = mh(d, r); 18233 (s && 18234 !h.playlists[r] && 18235 ((i = (s = this.createClonePlaylist_(s, r, l)).resolvedUri), 18236 (h.playlists[r] = s), 18237 (h.playlists[i] = s)), 18238 (n.playlists[t] = this.createClonePlaylist_(e, r, l))); 18239 })); 18240 } 18241 } 18242 }); 18243 } 18244 createClonePlaylist_(e, t, i, s) { 18245 ((i = this.createCloneURI_(e.resolvedUri, i)), (i = { resolvedUri: i, uri: i, id: t })); 18246 return (e.segments && (i.segments = []), s && (i.attributes = s), L(e, i)); 18247 } 18248 createCloneURI_(e, t) { 18249 var i, 18250 s = new URL(e), 18251 r = ((s.hostname = t['URI-REPLACEMENT'].HOST), t['URI-REPLACEMENT'].PARAMS); 18252 for (i of Object.keys(r)) s.searchParams.set(i, r[i]); 18253 return s.href; 18254 } 18255 createCloneAttributes_(t, i) { 18256 let s = { 'PATHWAY-ID': t }; 18257 return ( 18258 ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach((e) => { 18259 i[e] && (s[e] = t); 18260 }), 18261 s 18262 ); 18263 } 18264 getKeyIdSet(e) { 18265 if (e.contentProtection) { 18266 var t, 18267 i = new Set(); 18268 for (t in e.contentProtection) { 18269 var s = e.contentProtection[t].attributes.keyId; 18270 s && i.add(s.toLowerCase()); 18271 } 18272 return i; 18273 } 18274 } 18275 } 18276 function Ah(e, t, i, s) { 18277 var r = 'arraybuffer' === e.responseType ? e.response : e.responseText; 18278 (!t && 18279 r && 18280 ((e.responseTime = Date.now()), 18281 (e.roundTripTime = e.responseTime - e.requestTime), 18282 (e.bytesReceived = r.byteLength || r.length), 18283 e.bandwidth || (e.bandwidth = Math.floor((e.bytesReceived / e.roundTripTime) * 8 * 1e3))), 18284 i.headers && (e.responseHeaders = i.headers), 18285 t && 'ETIMEDOUT' === t.code && (e.timedout = !0), 18286 s( 18287 (t = 18288 t || e.aborted || 200 === i.statusCode || 206 === i.statusCode || 0 === i.statusCode 18289 ? t 18290 : new Error('XHR Failed with a response of: ' + (e && (r || e.responseText)))), 18291 e 18292 )); 18293 } 18294 function Dh() { 18295 function d(e, a) { 18296 e = L({ timeout: 45e3 }, e); 18297 var t = d.beforeRequest || E.Vhs.xhr.beforeRequest, 18298 i = d._requestCallbackSet || E.Vhs.xhr._requestCallbackSet || new Set(); 18299 let o = d._responseCallbackSet || E.Vhs.xhr._responseCallbackSet; 18300 t && 18301 'function' == typeof t && 18302 (E.log.warn('beforeRequest is deprecated, use onRequest instead.'), i.add(t)); 18303 var s = (!0 === E.Vhs.xhr.original ? E : E.Vhs).xhr, 18304 r = ((e, i) => { 18305 if (e && e.size) { 18306 let t = i; 18307 return ( 18308 e.forEach((e) => { 18309 t = e(t); 18310 }), 18311 t 18312 ); 18313 } 18314 })(i, e); 18315 i.delete(t); 18316 let l = s(r || e, function (e, t) { 18317 var i, s, r, n; 18318 return ( 18319 (i = o), 18320 (s = l), 18321 (r = e), 18322 (n = t), 18323 i && 18324 i.size && 18325 i.forEach((e) => { 18326 e(s, r, n); 18327 }), 18328 Ah(l, e, t, a) 18329 ); 18330 }), 18331 n = l.abort; 18332 return ( 18333 (l.abort = function () { 18334 return ((l.aborted = !0), n.apply(l, arguments)); 18335 }), 18336 (l.uri = e.uri), 18337 (l.requestType = e.requestType), 18338 (l.requestTime = Date.now()), 18339 l 18340 ); 18341 } 18342 return ((d.original = !0), d); 18343 } 18344 function Ph(e) { 18345 var t = {}; 18346 return ( 18347 e.byterange && 18348 (t.Range = (function (e) { 18349 let t; 18350 return ( 18351 'bytes=' + 18352 e.offset + 18353 '-' + 18354 (t = 18355 'bigint' == typeof e.offset || 'bigint' == typeof e.length 18356 ? window.BigInt(e.offset) + window.BigInt(e.length) - window.BigInt(1) 18357 : e.offset + e.length - 1) 18358 ); 18359 })(e.byterange)), 18360 t 18361 ); 18362 } 18363 function Lh(e, t) { 18364 return ((e = e.toString(16)), '00'.substring(0, 2 - e.length) + e + (t % 2 ? ' ' : '')); 18365 } 18366 function Oh(e) { 18367 return 32 <= e && e < 126 ? String.fromCharCode(e) : '.'; 18368 } 18369 function Rh(e) { 18370 var t = e.byterange || { length: 1 / 0, offset: 0 }; 18371 return [t.length, t.offset, e.resolvedUri].join(','); 18372 } 18373 function Nh(e) { 18374 return e.resolvedUri; 18375 } 18376 let Mh = function (i) { 18377 let s = {}; 18378 return (
18379 Object.keys(i).forEach((e) => { 18380 var t = i[e]; 18381 ca(t) 18382 ? (s[e] = { bytes: t.buffer, byteOffset: t.byteOffset, byteLength: t.byteLength }) 18383 : (s[e] = t); 18384 }), 18385 s 18386 ); 18387 }, 18388 Uh = (e) => { 18389 var t, 18390 i, 18391 s = Array.prototype.slice.call(e); 18392 let r = ''; 18393 for (let e = 0; e < s.length / 16; e++) 18394 ((t = s 18395 .slice(16 * e, 16 * e + 16) 18396 .map(Lh) 18397 .join('')), 18398 (i = s 18399 .slice(16 * e, 16 * e + 16) 18400 .map(Oh) 18401 .join('')), 18402 (r += t + ' ' + i + '\n')); 18403 return r; 18404 }; 18405 Qr = Object.freeze({ 18406 __proto__: null, 18407 createTransferableMessage: Mh, 18408 initSegmentId: Rh, 18409 segmentKeyId: Nh, 18410 hexDump: Uh, 18411 tagDump: ({ bytes: e }) => Uh(e), 18412 textRanges: (e) => { 18413 let t = '', 18414 i; 18415 for (i = 0; i < e.length; i++) t += ((s = e), (r = i), s.start(r) + '-' + s.end(r) + ' '); 18416 var s, r; 18417 return t; 18418 } 18419 }); 18420 let Bh = 0.25, 18421 Fh = (e) => 18422 e.transmuxedPresentationEnd - e.transmuxedPresentationStart - e.transmuxerPrependedSeconds, 18423 qh = ({ playlist: e, time: t = void 0, callback: i }) => { 18424 var s, r; 18425 if (i) 18426 return e && void 0 !== t 18427 ? (e = ((t, i) => { 18428 if (!i || !i.segments || 0 === i.segments.length) return null; 18429 let s = 0, 18430 r; 18431 for ( 18432 let e = 0; 18433 e < i.segments.length && 18434 ((r = i.segments[e]), 18435 !( 18436 t <= 18437 (s = r.videoTimingInfo 18438 ? r.videoTimingInfo.transmuxedPresentationEnd 18439 : s + r.duration) 18440 )); 18441 e++ 18442 ); 18443 var e = i.segments[i.segments.length - 1]; 18444 if (e.videoTimingInfo && e.videoTimingInfo.transmuxedPresentationEnd < t) return null; 18445 if (t > s) { 18446 if (t > s + e.duration * Bh) return null; 18447 r = e; 18448 } 18449 return { 18450 segment: r, 18451 estimatedStart: r.videoTimingInfo 18452 ? r.videoTimingInfo.transmuxedPresentationStart 18453 : s - r.duration, 18454 type: r.videoTimingInfo ? 'accurate' : 'estimate' 18455 }; 18456 })(t, e)) 18457 ? 'estimate' === e.type 18458 ? i({ 18459 message: 18460 'Accurate programTime could not be determined. Please seek to e.seekTime and try again', 18461 seekTime: e.estimatedStart 18462 }) 18463 : ((s = { mediaSeconds: t }), 18464 (t = t), 18465 (r = (e = e.segment).dateTimeObject 18466 ? ((r = e.videoTimingInfo.transmuxerPrependedSeconds), 18467 (t = t - (e.videoTimingInfo.transmuxedPresentationStart + r)), 18468 new Date(e.dateTimeObject.getTime() + 1e3 * t)) 18469 : null) && (s.programDateTime = r.toISOString()), 18470 i(null, s)) 18471 : i({ message: 'valid programTime was not found' }) 18472 : i({ message: 'getProgramTime: playlist and time must be provided' }); 18473 throw new Error('getProgramTime: callback must be provided'); 18474 }, 18475 jh = ({ 18476 programTime: e, 18477 playlist: t, 18478 retryCount: i = 2, 18479 seekTo: s, 18480 pauseAfterSeek: r = !0, 18481 tech: n, 18482 callback: a 18483 }) => { 18484 var o, l, d; 18485 if (a) 18486 return 'undefined' != typeof e && t && s 18487 ? t.endList || n.hasStarted_ 18488 ? ((t) => { 18489 if (!t.segments || 0 === t.segments.length) return !1; 18490 for (let e = 0; e < t.segments.length; e++) 18491 if (!t.segments[e].dateTimeObject) return !1; 18492 return !0; 18493 })(t) 18494 ? (d = ((e, t) => { 18495 let i; 18496 try { 18497 i = new Date(e); 18498 } catch (e) { 18499 return null; 18500 } 18501 if (!t || !t.segments || 0 === t.segments.length) return null; 18502 let s = t.segments[0]; 18503 if (i < new Date(s.dateTimeObject)) return null; 18504 for (let e = 0; e < t.segments.length - 1; e++) { 18505 s = t.segments[e]; 18506 var r = new Date(t.segments[e + 1].dateTimeObject); 18507 if (i < r) break; 18508 } 18509 var e = t.segments[t.segments.length - 1], 18510 n = e.dateTimeObject, 18511 a = e.videoTimingInfo ? Fh(e.videoTimingInfo) : e.duration + e.duration * Bh, 18512 a = new Date(n.getTime() + 1e3 * a); 18513 return i > a 18514 ? null 18515 : { 18516 segment: (s = i > new Date(n) ? e : s), 18517 estimatedStart: s.videoTimingInfo 18518 ? s.videoTimingInfo.transmuxedPresentationStart 18519 : ch.duration(t, t.mediaSequence + t.segments.indexOf(s)), 18520 type: s.videoTimingInfo ? 'accurate' : 'estimate' 18521 }; 18522 })(e, t)) 18523 ? ((l = ((e, t) => { 18524 let i, s; 18525 try { 18526 ((i = new Date(e)), (s = new Date(t))); 18527 } catch (e) {} 18528 e = i.getTime(); 18529 return (s.getTime() - e) / 1e3; 18530 })((o = d.segment).dateTimeObject, e)),
18531 'estimate' === d.type 18532 ? 0 === i 18533 ? a({ message: e + ' is not buffered yet. Try again' }) 18534 : (s(d.estimatedStart + l), 18535 void n.one('seeked', () => { 18536 jh({ 18537 programTime: e, 18538 playlist: t, 18539 retryCount: i - 1, 18540 seekTo: s, 18541 pauseAfterSeek: r, 18542 tech: n, 18543 callback: a 18544 }); 18545 })) 18546 : ((d = o.start + l), 18547 n.one('seeked', () => a(null, n.currentTime())), 18548 r && n.pause(), 18549 void s(d))) 18550 : a({ message: e + ' was not found in the stream' }) 18551 : a({ 18552 message: 'programDateTime tags must be provided in the manifest ' + t.resolvedUri 18553 }) 18554 : a({ message: 'player must be playing a live stream to start buffering' }) 18555 : a({ message: 'seekToProgramTime: programTime, seekTo and playlist must be provided' }); 18556 throw new Error('seekToProgramTime: callback must be provided'); 18557 }, 18558 Vh = (e, t) => { 18559 if (4 === e.readyState) return t(); 18560 }, 18561 Hh = (e, t, r, s) => { 18562 function n(e, t, i, s) { 18563 return (t.abort(), (l = !0), r(e, t, i, s)); 18564 } 18565 function i(e, t) { 18566 var i; 18567 if (!l) 18568 return e 18569 ? ((e.metadata = bh({ requestType: s, request: t, error: e })), n(e, t, '', a)) 18570 : ((i = t.responseText.substring((a && a.byteLength) || 0, t.responseText.length)), 18571 (a = (function () { 18572 for (var e, t, i, s = arguments.length, r = new Array(s), n = 0; n < s; n++) 18573 r[n] = arguments[n]; 18574 return (r = r.filter(function (e) { 18575 return e && (e.byteLength || e.length) && 'string' != typeof e; 18576 })).length <= 1 18577 ? S(r[0]) 18578 : ((e = r.reduce(function (e, t, i) { 18579 return e + (t.byteLength || t.length); 18580 }, 0)), 18581 (t = new Uint8Array(e)), 18582 (i = 0), 18583 r.forEach(function (e) { 18584 ((e = S(e)), t.set(e, i), (i += e.byteLength)); 18585 }), 18586 t); 18587 })(a, fa(i, !0))), 18588 (o = o || ld(a)), 18589 a.length < 10 || 18590 (o && a.length < o + 2) || 18591 ('ts' === (i = Ld(a)) && a.length < 188) || 18592 (!i && a.length < 376) 18593 ? Vh(t, () => n(e, t, '', a)) 18594 : n(null, t, i, a)); 18595 } 18596 let a = [], 18597 o, 18598 l = !1; 18599 let d = t( 18600 { 18601 uri: e, 18602 beforeSend(e) { 18603 (e.overrideMimeType('text/plain; charset=x-user-defined'), 18604 e.addEventListener('progress', function ({}) { 18605 return Ah(e, null, { statusCode: e.status }, i); 18606 })); 18607 } 18608 }, 18609 function (e, t) { 18610 return Ah(d, e, t, i); 18611 } 18612 ); 18613 return d; 18614 }; 18615 e = E.EventTarget; 18616 function zh(t, i) { 18617 if (!Eh(t, i)) return !1; 18618 if (t.sidx && i.sidx && (t.sidx.offset !== i.sidx.offset || t.sidx.length !== i.sidx.length)) 18619 return !1; 18620 if ((!t.sidx && i.sidx) || (t.sidx && !i.sidx)) return !1; 18621 if ((t.segments && !i.segments) || (!t.segments && i.segments)) return !1; 18622 if (t.segments || i.segments) 18623 for (let e = 0; e < t.segments.length; e++) { 18624 var s = t.segments[e], 18625 r = i.segments[e]; 18626 if (s.uri !== r.uri) return !1; 18627 if (s.byterange || r.byterange) { 18628 ((s = s.byterange), (r = r.byterange)); 18629 if ((s && !r) || (!s && r)) return !1; 18630 if (s.offset !== r.offset || s.length !== r.length) return !1; 18631 } 18632 } 18633 return !0; 18634 } 18635 let $h = (e, t, i, s) => { 18636 return `placeholder-uri-${e}-${t}-` + (s.attributes.NAME || i); 18637 }, 18638 Wh = ({ mainXml: e, srcUrl: t, clientOffset: i, sidxMapping: s, previousManifest: r }) => { 18639 ((e = e), 18640 (i = { manifestUri: t, clientOffset: i, sidxMapping: s, previousManifest: r }), 18641 (e = nd(ad(e), i)), 18642 (s = zl(e.representationInfo))); 18643 r = Ol({ 18644 dashPlaylists: s, 18645 locations: e.locations, 18646 contentSteering: e.contentSteeringInfo, 18647 sidxMapping: i.sidxMapping, 18648 previousManifest: i.previousManifest, 18649 eventStream: e.eventStream 18650 }); 18651 return (_h(r, t, $h), r); 18652 }, 18653 Gh = (e, t, i) => { 18654 let a = !0, 18655 o = L(e, { 18656 duration: t.duration, 18657 minimumUpdatePeriod: t.minimumUpdatePeriod, 18658 timelineStarts: t.timelineStarts 18659 }); 18660 for (let e = 0; e < t.playlists.length; e++) { 18661 var s = t.playlists[e], 18662 r = 18663 (s.sidx && 18664 ((r = _l(s.sidx)), i) && 18665 i[r] && 18666 i[r].sidx && 18667 dl(s, i[r].sidx, s.sidx.resolvedUri), 18668 Ch(o, s, zh)); 18669 r && ((o = r), (a = !1)); 18670 } 18671 var n, l; 18672 return (
18673 fh(t, (e, t, i, s) => { 18674 var r, n; 18675 e.playlists && 18676 e.playlists.length && 18677 ((r = e.playlists[0].id), (n = Ch(o, e.playlists[0], zh))) && 18678 (s in (o = n).mediaGroups[t][i] || (o.mediaGroups[t][i][s] = e), 18679 (o.mediaGroups[t][i][s].playlists[0] = o.playlists[r]), 18680 (a = !1)); 18681 }), 18682 (n = o), 18683 (l = t), 18684 fh(n, (e, t, i, s) => { 18685 (l.mediaGroups[t][i] && s in l.mediaGroups[t][i]) || delete n.mediaGroups[t][i][s]; 18686 }), 18687 (a = t.minimumUpdatePeriod === e.minimumUpdatePeriod && a) ? null : o 18688 ); 18689 }, 18690 Xh = (e, t) => { 18691 return ( 18692 (Boolean(!e.map && !t.map) || 18693 Boolean( 18694 e.map && 18695 t.map && 18696 e.map.byterange.offset === t.map.byterange.offset && 18697 e.map.byterange.length === t.map.byterange.length 18698 )) && 18699 e.uri === t.uri && 18700 e.byterange.offset === t.byterange.offset && 18701 e.byterange.length === t.byterange.length 18702 ); 18703 }, 18704 Kh = (e, t) => { 18705 var i, 18706 s = {}; 18707 for (i in e) { 18708 var r = e[i].sidx; 18709 if (r) { 18710 var n = _l(r); 18711 if (!t[n]) break; 18712 var a = t[n].sidxInfo; 18713 Xh(a, r) && (s[n] = t[n]); 18714 } 18715 } 18716 return s; 18717 }; 18718 class Yh extends e { 18719 constructor(e, t, i = {}, s) { 18720 (super(), (this.mainPlaylistLoader_ = s || this), s || (this.isMain_ = !0)); 18721 var { withCredentials: s = !1 } = i; 18722 if ( 18723 ((this.vhs_ = t), 18724 (this.withCredentials = s), 18725 (this.addMetadataToTextTrack = i.addMetadataToTextTrack), 18726 !e) 18727 ) 18728 throw new Error('A non-empty playlist URL or object is required'); 18729 (this.on('minimumUpdatePeriod', () => { 18730 this.refreshXml_(); 18731 }), 18732 this.on('mediaupdatetimeout', () => { 18733 this.refreshMedia_(this.media().id); 18734 }), 18735 (this.state = 'HAVE_NOTHING'), 18736 (this.loadedPlaylists_ = {}), 18737 (this.logger_ = Ud('DashPlaylistLoader')), 18738 this.isMain_ 18739 ? ((this.mainPlaylistLoader_.srcUrl = e), (this.mainPlaylistLoader_.sidxMapping_ = {})) 18740 : (this.childPlaylist_ = e)); 18741 } 18742 requestErrored_(e, t, i) { 18743 return ( 18744 !this.request || 18745 ((this.request = null), 18746 e 18747 ? ((this.error = 18748 'object' != typeof e || e instanceof Error 18749 ? { 18750 status: t.status, 18751 message: 'DASH request error at URL: ' + t.uri, 18752 response: t.response, 18753 code: 2, 18754 metadata: e.metadata 18755 } 18756 : e), 18757 i && (this.state = i), 18758 this.trigger('error'), 18759 !0) 18760 : void 0) 18761 ); 18762 } 18763 addSidxSegments_(l, r, n) { 18764 let d = l.sidx && _l(l.sidx); 18765 if (l.sidx && d && !this.mainPlaylistLoader_.sidxMapping_[d]) { 18766 let a = Md(l.sidx.resolvedUri), 18767 o = (t, i) => { 18768 if (!this.requestErrored_(t, i, r)) { 18769 var t = this.mainPlaylistLoader_.sidxMapping_, 18770 s = i.requestType; 18771 let e; 18772 try { 18773 e = md(S(i.response).subarray(8)); 18774 } catch (e) { 18775 return ( 18776 (e.metadata = bh({ requestType: s, request: i, parseFailure: !0 })), 18777 void this.requestErrored_(e, i, r) 18778 ); 18779 } 18780 return ((t[d] = { sidxInfo: l.sidx, sidx: e }), dl(l, e, l.sidx.resolvedUri), n(!0)); 18781 } 18782 }; 18783 this.request = Hh( 18784 a, 18785 this.vhs_.xhr, 18786 (e, t, i, s) => { 18787 var r, n; 18788 return e 18789 ? o(e, t) 18790 : i && 'mp4' === i 18791 ? (({ offset: r, length: n } = l.sidx.byterange), 18792 s.length >= n + r 18793 ? o(e, { response: s.subarray(r, r + n), status: t.status, uri: t.uri }) 18794 : void (this.request = this.vhs_.xhr( 18795 { 18796 uri: a, 18797 responseType: 'arraybuffer', 18798 requestType: 'dash-sidx', 18799 headers: Ph({ byterange: l.sidx.byterange }) 18800 }, 18801 o 18802 ))) 18803 : ((e = i || 'unknown'), 18804 o( 18805 { 18806 status: t.status, 18807 message: `Unsupported ${e} container type for sidx segment at URL: ` + a, 18808 response: '', 18809 playlist: l, 18810 internal: !0, 18811 playlistExclusionDuration: 1 / 0, 18812 code: 2 18813 }, 18814 t 18815 )); 18816 }, 18817 'dash-sidx' 18818 ); 18819 } else this.mediaRequest_ = window.setTimeout(() => n(!1), 0); 18820 } 18821 dispose() { 18822 (this.trigger('dispose'), 18823 this.stopRequest(), 18824 (this.loadedPlaylists_ = {}), 18825 window.clearTimeout(this.minimumUpdatePeriodTimeout_), 18826 window.clearTimeout(this.mediaRequest_), 18827 window.clearTimeout(this.mediaUpdateTimeout), 18828 (this.mediaUpdateTimeout = null),
18829 (this.mediaRequest_ = null), 18830 (this.minimumUpdatePeriodTimeout_ = null), 18831 this.mainPlaylistLoader_.createMupOnMedia_ && 18832 (this.off('loadedmetadata', this.mainPlaylistLoader_.createMupOnMedia_), 18833 (this.mainPlaylistLoader_.createMupOnMedia_ = null)), 18834 this.off()); 18835 } 18836 hasPendingRequest() { 18837 return this.request || this.mediaRequest_; 18838 } 18839 stopRequest() { 18840 var e; 18841 this.request && 18842 ((e = this.request), (this.request = null), (e.onreadystatechange = null), e.abort()); 18843 } 18844 media(t) { 18845 if (!t) return this.media_; 18846 if ('HAVE_NOTHING' === this.state) 18847 throw new Error('Cannot switch media playlist from ' + this.state); 18848 let i = this.state; 18849 if ('string' == typeof t) { 18850 if (!this.mainPlaylistLoader_.main.playlists[t]) 18851 throw new Error('Unknown playlist URI: ' + t); 18852 t = this.mainPlaylistLoader_.main.playlists[t]; 18853 } 18854 var e = !this.media_ || t.id !== this.media_.id; 18855 e && this.loadedPlaylists_[t.id] && this.loadedPlaylists_[t.id].endList 18856 ? ((this.state = 'HAVE_METADATA'), 18857 (this.media_ = t), 18858 e && (this.trigger('mediachanging'), this.trigger('mediachange'))) 18859 : e && 18860 (this.media_ && this.trigger('mediachanging'), 18861 this.addSidxSegments_(t, i, (e) => { 18862 this.haveMetadata({ startingState: i, playlist: t }); 18863 })); 18864 } 18865 haveMetadata({ startingState: e, playlist: t }) { 18866 ((this.state = 'HAVE_METADATA'), 18867 (this.loadedPlaylists_[t.id] = t), 18868 (this.mediaRequest_ = null), 18869 this.refreshMedia_(t.id), 18870 'HAVE_MAIN_MANIFEST' === e ? this.trigger('loadedmetadata') : this.trigger('mediachange')); 18871 } 18872 pause() { 18873 (this.mainPlaylistLoader_.createMupOnMedia_ && 18874 (this.off('loadedmetadata', this.mainPlaylistLoader_.createMupOnMedia_), 18875 (this.mainPlaylistLoader_.createMupOnMedia_ = null)), 18876 this.stopRequest(), 18877 window.clearTimeout(this.mediaUpdateTimeout), 18878 (this.mediaUpdateTimeout = null), 18879 this.isMain_ && 18880 (window.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_), 18881 (this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_ = null)), 18882 'HAVE_NOTHING' === this.state && (this.started = !1)); 18883 } 18884 load(e) { 18885 (window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null)); 18886 var t = this.media(); 18887 e 18888 ? ((e = t ? (t.targetDuration / 2) * 1e3 : 5e3), 18889 (this.mediaUpdateTimeout = window.setTimeout(() => this.load(), e))) 18890 : this.started 18891 ? t && !t.endList 18892 ? (this.isMain_ && 18893 !this.minimumUpdatePeriodTimeout_ && 18894 (this.trigger('minimumUpdatePeriod'), this.updateMinimumUpdatePeriodTimeout_()), 18895 this.trigger('mediaupdatetimeout')) 18896 : this.trigger('loadedplaylist') 18897 : this.start(); 18898 } 18899 start() { 18900 ((this.started = !0), 18901 this.isMain_ 18902 ? this.requestMain_((e, t) => { 18903 (this.haveMain_(), 18904 this.hasPendingRequest() || 18905 this.media_ || 18906 this.media(this.mainPlaylistLoader_.main.playlists[0])); 18907 }) 18908 : (this.mediaRequest_ = window.setTimeout(() => this.haveMain_(), 0))); 18909 } 18910 requestMain_(s) { 18911 let r = { manifestInfo: { uri: this.mainPlaylistLoader_.srcUrl } }; 18912 (this.trigger({ type: 'manifestrequeststart', metadata: r }), 18913 (this.request = this.vhs_.xhr( 18914 { 18915 uri: this.mainPlaylistLoader_.srcUrl, 18916 withCredentials: this.withCredentials, 18917 requestType: 'dash-manifest' 18918 }, 18919 (e, t) => { 18920 var i; 18921 if ( 18922 (e && 18923 ((i = t.requestType), (e.metadata = bh({ requestType: i, request: t, error: e }))), 18924 this.requestErrored_(e, t)) 18925 ) 18926 'HAVE_NOTHING' === this.state && (this.started = !1); 18927 else { 18928 this.trigger({ type: 'manifestrequestcomplete', metadata: r }); 18929 let e = t.responseText !== this.mainPlaylistLoader_.mainXml_; 18930 if ( 18931 ((this.mainPlaylistLoader_.mainXml_ = t.responseText), 18932 t.responseHeaders && t.responseHeaders.date 18933 ? (this.mainLoaded_ = Date.parse(t.responseHeaders.date)) 18934 : (this.mainLoaded_ = Date.now()), 18935 (this.mainPlaylistLoader_.srcUrl = Md(this.mainPlaylistLoader_.srcUrl, t)), 18936 !e) 18937 ) 18938 return s(t, e);
18939 (this.handleMain_(), this.syncClientServerClock_(() => s(t, e))); 18940 } 18941 } 18942 ))); 18943 } 18944 syncClientServerClock_(r) { 18945 let n = od(this.mainPlaylistLoader_.mainXml_); 18946 return null === n 18947 ? ((this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now()), r()) 18948 : 'DIRECT' === n.method 18949 ? ((this.mainPlaylistLoader_.clientOffset_ = n.value - Date.now()), r()) 18950 : void (this.request = this.vhs_.xhr( 18951 { 18952 uri: Nd(this.mainPlaylistLoader_.srcUrl, n.value), 18953 method: n.method, 18954 withCredentials: this.withCredentials, 18955 requestType: 'dash-clock-sync' 18956 }, 18957 (t, i) => { 18958 if (this.request) { 18959 var s; 18960 if (t) 18961 return ( 18962 (s = i.requestType), 18963 (this.error.metadata = bh({ requestType: s, request: i, error: t })), 18964 (this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now()), 18965 r() 18966 ); 18967 let e; 18968 ((e = 18969 'HEAD' === n.method 18970 ? i.responseHeaders && i.responseHeaders.date 18971 ? Date.parse(i.responseHeaders.date) 18972 : this.mainLoaded_ 18973 : Date.parse(i.responseText)), 18974 (this.mainPlaylistLoader_.clientOffset_ = e - Date.now()), 18975 r()); 18976 } 18977 } 18978 )); 18979 } 18980 haveMain_() { 18981 ((this.state = 'HAVE_MAIN_MANIFEST'), 18982 this.isMain_ 18983 ? this.trigger('loadedplaylist') 18984 : this.media_ || this.media(this.childPlaylist_)); 18985 } 18986 handleMain_() { 18987 this.mediaRequest_ = null; 18988 var e = this.mainPlaylistLoader_.main, 18989 i = { manifestInfo: { uri: this.mainPlaylistLoader_.srcUrl } }; 18990 this.trigger({ type: 'manifestparsestart', metadata: i }); 18991 let s; 18992 try { 18993 s = Wh({ 18994 mainXml: this.mainPlaylistLoader_.mainXml_, 18995 srcUrl: this.mainPlaylistLoader_.srcUrl, 18996 clientOffset: this.mainPlaylistLoader_.clientOffset_, 18997 sidxMapping: this.mainPlaylistLoader_.sidxMapping_, 18998 previousManifest: e 18999 }); 19000 } catch (e) { 19001 ((this.error = e), 19002 (this.error.metadata = { errorType: E.Error.StreamingDashManifestParserError, error: e }), 19003 this.trigger('error')); 19004 } 19005 (e && (s = Gh(e, s, this.mainPlaylistLoader_.sidxMapping_)), 19006 (this.mainPlaylistLoader_.main = s || e)); 19007 var r = this.mainPlaylistLoader_.main.locations && this.mainPlaylistLoader_.main.locations[0]; 19008 if ( 19009 (r && r !== this.mainPlaylistLoader_.srcUrl && (this.mainPlaylistLoader_.srcUrl = r), 19010 (!e || (s && s.minimumUpdatePeriod !== e.minimumUpdatePeriod)) && 19011 this.updateMinimumUpdatePeriodTimeout_(), 19012 this.addEventStreamToMetadataTrack_(s), 19013 s) 19014 ) { 19015 var { duration: r, endList: e } = s; 19016 let t = [];
19017 s.playlists.forEach((e) => { 19018 t.push({ 19019 id: e.id, 19020 bandwidth: e.attributes.BANDWIDTH, 19021 resolution: e.attributes.RESOLUTION, 19022 codecs: e.attributes.CODECS 19023 }); 19024 }); 19025 r = { duration: r, isLive: !e, renditions: t }; 19026 ((i.parsedManifest = r), this.trigger({ type: 'manifestparsecomplete', metadata: i })); 19027 } 19028 return Boolean(s); 19029 } 19030 updateMinimumUpdatePeriodTimeout_() { 19031 var e = this.mainPlaylistLoader_; 19032 (e.createMupOnMedia_ && 19033 (e.off('loadedmetadata', e.createMupOnMedia_), (e.createMupOnMedia_ = null)), 19034 e.minimumUpdatePeriodTimeout_ && 19035 (window.clearTimeout(e.minimumUpdatePeriodTimeout_), 19036 (e.minimumUpdatePeriodTimeout_ = null))); 19037 let t = e.main && e.main.minimumUpdatePeriod; 19038 (0 === t && 19039 (e.media() 19040 ? (t = 1e3 * e.media().targetDuration) 19041 : ((e.createMupOnMedia_ = e.updateMinimumUpdatePeriodTimeout_), 19042 e.one('loadedmetadata', e.createMupOnMedia_))), 19043 'number' != typeof t || t <= 0 19044 ? t < 0 && 19045 this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`) 19046 : this.createMUPTimeout_(t)); 19047 } 19048 createMUPTimeout_(e) { 19049 let t = this.mainPlaylistLoader_; 19050 t.minimumUpdatePeriodTimeout_ = window.setTimeout(() => { 19051 ((t.minimumUpdatePeriodTimeout_ = null), 19052 t.trigger('minimumUpdatePeriod'), 19053 t.createMUPTimeout_(e)); 19054 }, e); 19055 } 19056 refreshXml_() { 19057 this.requestMain_((e, t) => { 19058 t && 19059 (this.media_ && (this.media_ = this.mainPlaylistLoader_.main.playlists[this.media_.id]), 19060 (this.mainPlaylistLoader_.sidxMapping_ = ((e, r) => { 19061 let n = Kh(e.playlists, r); 19062 return ( 19063 fh(e, (e, t, i, s) => { 19064 e.playlists && e.playlists.length && ((e = e.playlists), (n = L(n, Kh(e, r)))); 19065 }), 19066 n 19067 ); 19068 })(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.sidxMapping_)), 19069 this.addSidxSegments_(this.media(), this.state, (e) => { 19070 this.refreshMedia_(this.media().id); 19071 })); 19072 }); 19073 } 19074 refreshMedia_(e) { 19075 if (!e) throw new Error('refreshMedia_ must take a media id'); 19076 this.media_ && this.isMain_ && this.handleMain_(); 19077 var t = this.mainPlaylistLoader_.main.playlists; 19078 let i = !this.media_ || this.media_ !== t[e]; 19079 if ( 19080 (i ? (this.media_ = t[e]) : this.trigger('playlistunchanged'), !this.mediaUpdateTimeout) 19081 ) { 19082 let e = () => { 19083 this.media().endList || 19084 (this.mediaUpdateTimeout = window.setTimeout( 19085 () => { 19086 (this.trigger('mediaupdatetimeout'), e()); 19087 }, 19088 kh(this.media(), Boolean(i)) 19089 )); 19090 }; 19091 e(); 19092 } 19093 this.trigger('loadedplaylist'); 19094 } 19095 addEventStreamToMetadataTrack_(e) { 19096 e && 19097 this.mainPlaylistLoader_.main.eventStream && 19098 ((e = this.mainPlaylistLoader_.main.eventStream.map((e) => ({ 19099 cueTime: e.start, 19100 frames: [{ data: e.messageData }] 19101 }))), 19102 this.addMetadataToTextTrack('EventStream', e, this.mainPlaylistLoader_.main.duration)); 19103 } 19104 getKeyIdSet(e) { 19105 if (e.contentProtection) { 19106 var t, 19107 i = new Set(); 19108 for (t in e.contentProtection) { 19109 var s = e.contentProtection[t].attributes['cenc:default_KID']; 19110 s && i.add(s.replace(/-/g, '').toLowerCase()); 19111 } 19112 return i; 19113 } 19114 } 19115 } 19116 var R = { 19117 GOAL_BUFFER_LENGTH: 30, 19118 MAX_GOAL_BUFFER_LENGTH: 60, 19119 BACK_BUFFER_LENGTH: 30, 19120 GOAL_BUFFER_LENGTH_RATE: 1, 19121 INITIAL_BANDWIDTH: 4194304, 19122 BANDWIDTH_VARIANCE: 1.2, 19123 BUFFER_LOW_WATER_LINE: 0, 19124 MAX_BUFFER_LOW_WATER_LINE: 30, 19125 EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16, 19126 BUFFER_LOW_WATER_LINE_RATE: 1, 19127 BUFFER_HIGH_WATER_LINE: 30 19128 }; 19129 function Qh(e) { 19130 return ((e.on = e.addEventListener), (e.off = e.removeEventListener), e); 19131 } 19132 let Jh = (t) => { 19133 var i = new Uint8Array(new ArrayBuffer(t.length)); 19134 for (let e = 0; e < t.length; e++) i[e] = t.charCodeAt(e); 19135 return i.buffer; 19136 }; 19137 function Zh(s) { 19138 return function () { 19139 let e = (function (t) { 19140 try { 19141 return URL.createObjectURL(new Blob([t], { type: 'application/javascript' })); 19142 } catch (e) { 19143 var i = new BlobBuilder(); 19144 return (i.append(t), URL.createObjectURL(i.getBlob())); 19145 } 19146 })(s); 19147 var t = Qh(new Worker(e)); 19148 t.objURL = e; 19149 let i = t.terminate; 19150 return ( 19151 (t.on = t.addEventListener), 19152 (t.off = t.removeEventListener), 19153 (t.terminate = function () { 19154 return (URL.revokeObjectURL(e), i.call(this)); 19155 }), 19156 t 19157 ); 19158 }; 19159 } 19160 function eu(e) { 19161 return ( 19162 `var browserWorkerPolyFill = ${Qh.toString()}; 19163` + 19164 'browserWorkerPolyFill(self);\n' + 19165 e 19166 ); 19167 } 19168 function tu(e) { 19169 return e 19170 .toString() 19171 .replace(/^function.+?{/, '') 19172 .slice(0, -1); 19173 } 19174 var iu = Zh( 19175 eu( 19176 tu(function () { 19177 function e() { 19178 this.init = function () { 19179 var n = {}; 19180 ((this.on = function (e, t) { 19181 (n[e] || (n[e] = []), (n[e] = n[e].concat(t))); 19182 }), 19183 (this.off = function (e, t) { 19184 return ( 19185 !!n[e] && 19186 ((t = n[e].indexOf(t)), (n[e] = n[e].slice()), n[e].splice(t, 1), -1 < t) 19187 ); 19188 }), 19189 (this.trigger = function (e) { 19190 var t, 19191 i, 19192 s, 19193 r = n[e]; 19194 if (r) 19195 if (2 === arguments.length) 19196 for (i = r.length, t = 0; t < i; ++t) r[t].call(this, arguments[1]); 19197 else { 19198 for (s = [], t = arguments.length, t = 1; t < arguments.length; ++t) 19199 s.push(arguments[t]); 19200 for (i = r.length, t = 0; t < i; ++t) r[t].apply(this, s); 19201 } 19202 }), 19203 (this.dispose = function () { 19204 n = {}; 19205 })); 19206 }; 19207 } 19208 var l, 19209 M, 19210 U, 19211 B, 19212 F, 19213 q, 19214 j, 19215 V, 19216 H, 19217 z, 19218 $, 19219 W, 19220 G, 19221 X, 19222 K, 19223 Y, 19224 Q, 19225 J, 19226 Z, 19227 ee, 19228 d, 19229 te, 19230 ie, 19231 se, 19232 re, 19233 ne, 19234 ae, 19235 oe, 19236 le, 19237 de, 19238 he, 19239 ue, 19240 ce, 19241 pe, 19242 me, 19243 ge, 19244 fe, 19245 ye = 19246 'undefined' != typeof globalThis 19247 ? globalThis 19248 : 'undefined' != typeof window 19249 ? window 19250 : 'undefined' != typeof global 19251 ? global 19252 : 'undefined' != typeof self 19253 ? self 19254 : {}, 19255 t = 19256 ((e.prototype.pipe = function (t) { 19257 return ( 19258 this.on('data', function (e) { 19259 t.push(e); 19260 }), 19261 this.on('done', function (e) { 19262 t.flush(e); 19263 }), 19264 this.on('partialdone', function (e) { 19265 t.partialFlush(e); 19266 }), 19267 this.on('endedtimeline', function (e) { 19268 t.endTimeline(e); 19269 }), 19270 this.on('reset', function (e) { 19271 t.reset(e); 19272 }), 19273 t 19274 ); 19275 }), 19276 (e.prototype.push = function (e) { 19277 this.trigger('data', e); 19278 }), 19279 (e.prototype.flush = function (e) { 19280 this.trigger('done', e); 19281 }), 19282 (e.prototype.partialFlush = function (e) { 19283 this.trigger('partialdone', e); 19284 }), 19285 (e.prototype.endTimeline = function (e) { 19286 this.trigger('endedtimeline', e); 19287 }), 19288 (e.prototype.reset = function (e) { 19289 this.trigger('reset', e); 19290 }), 19291 e), 19292 _e = Math.pow(2, 32), 19293 i = { 19294 getUint64: function (e) { 19295 var t, 19296 e = new DataView(e.buffer, e.byteOffset, e.byteLength); 19297 return e.getBigUint64 19298 ? (t = e.getBigUint64(0)) < Number.MAX_SAFE_INTEGER 19299 ? Number(t) 19300 : t 19301 : e.getUint32(0) * _e + e.getUint32(4); 19302 }, 19303 MAX_UINT32: _e 19304 }, 19305 ve = i.MAX_UINT32; 19306 if ( 19307 ((d = { 19308 avc1: [], 19309 avcC: [], 19310 btrt: [], 19311 dinf: [], 19312 dref: [], 19313 esds: [], 19314 ftyp: [], 19315 hdlr: [], 19316 mdat: [], 19317 mdhd: [], 19318 mdia: [], 19319 mfhd: [], 19320 minf: [], 19321 moof: [], 19322 moov: [], 19323 mp4a: [], 19324 mvex: [], 19325 mvhd: [], 19326 pasp: [], 19327 sdtp: [], 19328 smhd: [], 19329 stbl: [], 19330 stco: [], 19331 stsc: [], 19332 stsd: [], 19333 stsz: [], 19334 stts: [], 19335 styp: [], 19336 tfdt: [], 19337 tfhd: [], 19338 traf: [], 19339 trak: [], 19340 trun: [], 19341 trex: [], 19342 tkhd: [], 19343 vmhd: [] 19344 }), 19345 'undefined' != typeof Uint8Array) 19346 ) { 19347 for (var s in d) 19348 d.hasOwnProperty(s) &&
19349 (d[s] = [s.charCodeAt(0), s.charCodeAt(1), s.charCodeAt(2), s.charCodeAt(3)]); 19350 ((te = new Uint8Array([ 19351 'i'.charCodeAt(0), 19352 's'.charCodeAt(0), 19353 'o'.charCodeAt(0), 19354 'm'.charCodeAt(0) 19355 ])), 19356 (se = new Uint8Array([ 19357 'a'.charCodeAt(0), 19358 'v'.charCodeAt(0), 19359 'c'.charCodeAt(0), 19360 '1'.charCodeAt(0) 19361 ])), 19362 (ie = new Uint8Array([0, 0, 0, 1])), 19363 (Ie = new Uint8Array([ 19364 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, 19365 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0 19366 ])), 19367 (Ae = new Uint8Array([ 19368 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, 19369 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0 19370 ])), 19371 (re = { video: Ie, audio: Ae }), 19372 (oe = new Uint8Array([ 19373 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1 19374 ])), 19375 (ae = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])), 19376 (le = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])), 19377 (de = le), 19378 (he = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])), 19379 (ue = le), 19380 (ne = new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]))); 19381 } 19382 ((l = function (e) { 19383 for (var t, i = [], s = 0, r = 1; r < arguments.length; r++) i.push(arguments[r]); 19384 for (r = i.length; r--; ) s += i[r].byteLength; 19385 for ( 19386 t = new Uint8Array(s + 8), 19387 new DataView(t.buffer, t.byteOffset, t.byteLength).setUint32(0, t.byteLength), 19388 t.set(e, 4), 19389 r = 0, 19390 s = 8; 19391 r < i.length; 19392 r++ 19393 ) 19394 (t.set(i[r], s), (s += i[r].byteLength)); 19395 return t; 19396 }), 19397 (M = function () { 19398 return l(d.dinf, l(d.dref, oe)); 19399 }), 19400 (U = function (e) { 19401 return l( 19402 d.esds, 19403 new Uint8Array([ 19404 0, 19405 0, 19406 0, 19407 0, 19408 3, 19409 25, 19410 0, 19411 0, 19412 0, 19413 4, 19414 17, 19415 64, 19416 21, 19417 0, 19418 6, 19419 0, 19420 0, 19421 0, 19422 218, 19423 192, 19424 0, 19425 0, 19426 218, 19427 192, 19428 5, 19429 2, 19430 (e.audioobjecttype << 3) | (e.samplingfrequencyindex >>> 1), 19431 (e.samplingfrequencyindex << 7) | (e.channelcount << 3), 19432 6, 19433 1, 19434 2 19435 ]) 19436 ); 19437 }), 19438 (X = function (e) { 19439 return l(d.hdlr, re[e]); 19440 }), 19441 (G = function (e) { 19442 var t = new Uint8Array([ 19443 0, 19444 0, 19445 0, 19446 0, 19447 0, 19448 0, 19449 0, 19450 2, 19451 0, 19452 0, 19453 0, 19454 3, 19455 0, 19456 1, 19457 95, 19458 144, 19459 (e.duration >>> 24) & 255, 19460 (e.duration >>> 16) & 255, 19461 (e.duration >>> 8) & 255, 19462 255 & e.duration, 19463 85, 19464 196, 19465 0, 19466 0 19467 ]); 19468 return ( 19469 e.samplerate && 19470 ((t[12] = (e.samplerate >>> 24) & 255), 19471 (t[13] = (e.samplerate >>> 16) & 255), 19472 (t[14] = (e.samplerate >>> 8) & 255), 19473 (t[15] = 255 & e.samplerate)), 19474 l(d.mdhd, t) 19475 ); 19476 }), 19477 (W = function (e) { 19478 return l(d.mdia, G(e), X(e.type), q(e)); 19479 }), 19480 (F = function (e) { 19481 return l( 19482 d.mfhd, 19483 new Uint8Array([ 19484 0, 19485 0, 19486 0, 19487 0, 19488 (4278190080 & e) >> 24, 19489 (16711680 & e) >> 16, 19490 (65280 & e) >> 8, 19491 255 & e 19492 ]) 19493 ); 19494 }), 19495 (q = function (e) { 19496 return l(d.minf, 'video' === e.type ? l(d.vmhd, ne) : l(d.smhd, ae), M(), Y(e)); 19497 }),
19498 (V = function (e) { 19499 for (var t = e.length, i = []; t--; ) i[t] = Z(e[t]); 19500 return l.apply(null, [d.mvex].concat(i)); 19501 }), 19502 (H = function (e) { 19503 e = new Uint8Array([ 19504 0, 19505 0, 19506 0, 19507 0, 19508 0, 19509 0, 19510 0, 19511 1, 19512 0, 19513 0, 19514 0, 19515 2, 19516 0, 19517 1, 19518 95, 19519 144, 19520 (4278190080 & e) >> 24, 19521 (16711680 & e) >> 16, 19522 (65280 & e) >> 8, 19523 255 & e, 19524 0, 19525 1, 19526 0, 19527 0, 19528 1, 19529 0, 19530 0, 19531 0, 19532 0, 19533 0, 19534 0, 19535 0, 19536 0, 19537 0, 19538 0, 19539 0, 19540 0, 19541 1, 19542 0, 19543 0, 19544 0, 19545 0, 19546 0, 19547 0, 19548 0, 19549 0, 19550 0, 19551 0, 19552 0, 19553 0, 19554 0, 19555 0, 19556 0, 19557 1, 19558 0, 19559 0, 19560 0, 19561 0, 19562 0, 19563 0, 19564 0, 19565 0, 19566 0, 19567 0, 19568 0, 19569 0, 19570 0, 19571 0, 19572 64, 19573 0, 19574 0, 19575 0, 19576 0, 19577 0, 19578 0, 19579 0, 19580 0, 19581 0, 19582 0, 19583 0, 19584 0, 19585 0, 19586 0, 19587 0, 19588 0, 19589 0, 19590 0, 19591 0, 19592 0, 19593 0, 19594 0, 19595 0, 19596 0, 19597 0, 19598 0, 19599 0, 19600 255, 19601 255, 19602 255, 19603 255 19604 ]); 19605 return l(d.mvhd, e); 19606 }), 19607 (K = function (e) { 19608 for ( 19609 var t, i = e.samples || [], s = new Uint8Array(4 + i.length), r = 0; 19610 r < i.length; 19611 r++ 19612 ) 19613 ((t = i[r].flags), 19614 (s[r + 4] = (t.dependsOn << 4) | (t.isDependedOn << 2) | t.hasRedundancy)); 19615 return l(d.sdtp, s); 19616 }), 19617 (Y = function (e) { 19618 return l(d.stbl, Q(e), l(d.stts, ue), l(d.stsc, de), l(d.stsz, he), l(d.stco, le)); 19619 }), 19620 (Q = function (e) { 19621 return l( 19622 d.stsd, 19623 new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]), 19624 ('video' === e.type ? ce : pe)(e) 19625 ); 19626 }), 19627 (ce = function (e) { 19628 for ( 19629 var t, i, s = e.sps || [], r = e.pps || [], n = [], a = [], o = 0; 19630 o < s.length; 19631 o++ 19632 ) 19633 (n.push((65280 & s[o].byteLength) >>> 8), 19634 n.push(255 & s[o].byteLength), 19635 (n = n.concat(Array.prototype.slice.call(s[o])))); 19636 for (o = 0; o < r.length; o++) 19637 (a.push((65280 & r[o].byteLength) >>> 8), 19638 a.push(255 & r[o].byteLength), 19639 (a = a.concat(Array.prototype.slice.call(r[o])))); 19640 return ( 19641 (t = [ 19642 d.avc1, 19643 new Uint8Array([ 19644 0, 19645 0, 19646 0, 19647 0, 19648 0, 19649 0, 19650 0, 19651 1, 19652 0, 19653 0, 19654 0, 19655 0, 19656 0, 19657 0, 19658 0, 19659 0, 19660 0, 19661 0, 19662 0, 19663 0, 19664 0, 19665 0, 19666 0, 19667 0, 19668 (65280 & e.width) >> 8, 19669 255 & e.width, 19670 (65280 & e.height) >> 8, 19671 255 & e.height, 19672 0, 19673 72, 19674 0, 19675 0, 19676 0, 19677 72, 19678 0, 19679 0, 19680 0, 19681 0, 19682 0, 19683 0, 19684 0, 19685 1, 19686 19, 19687 118, 19688 105, 19689 100, 19690 101, 19691 111, 19692 106, 19693 115, 19694 45,
19695 99, 19696 111, 19697 110, 19698 116, 19699 114, 19700 105, 19701 98, 19702 45, 19703 104, 19704 108, 19705 115, 19706 0, 19707 0, 19708 0, 19709 0, 19710 0, 19711 0, 19712 0, 19713 0, 19714 0, 19715 0, 19716 0, 19717 0, 19718 0, 19719 24, 19720 17, 19721 17 19722 ]), 19723 l( 19724 d.avcC, 19725 new Uint8Array( 19726 [1, e.profileIdc, e.profileCompatibility, e.levelIdc, 255].concat( 19727 [s.length], 19728 n, 19729 [r.length], 19730 a 19731 ) 19732 ) 19733 ), 19734 l(d.btrt, new Uint8Array([0, 28, 156, 128, 0, 45, 198, 192, 0, 45, 198, 192])) 19735 ]), 19736 e.sarRatio && 19737 ((i = e.sarRatio[0]), 19738 (e = e.sarRatio[1]), 19739 t.push( 19740 l( 19741 d.pasp, 19742 new Uint8Array([ 19743 (4278190080 & i) >> 24, 19744 (16711680 & i) >> 16, 19745 (65280 & i) >> 8, 19746 255 & i, 19747 (4278190080 & e) >> 24, 19748 (16711680 & e) >> 16, 19749 (65280 & e) >> 8, 19750 255 & e 19751 ]) 19752 ) 19753 )), 19754 l.apply(null, t) 19755 ); 19756 }), 19757 (pe = function (e) { 19758 return l( 19759 d.mp4a, 19760 new Uint8Array([ 19761 0, 19762 0, 19763 0, 19764 0, 19765 0, 19766 0, 19767 0, 19768 1, 19769 0, 19770 0, 19771 0, 19772 0, 19773 0, 19774 0, 19775 0, 19776 0, 19777 (65280 & e.channelcount) >> 8, 19778 255 & e.channelcount, 19779 (65280 & e.samplesize) >> 8, 19780 255 & e.samplesize, 19781 0, 19782 0, 19783 0, 19784 0, 19785 (65280 & e.samplerate) >> 8, 19786 255 & e.samplerate, 19787 0, 19788 0 19789 ]), 19790 U(e) 19791 ); 19792 }), 19793 ($ = function (e) { 19794 e = new Uint8Array([ 19795 0, 19796 0, 19797 0, 19798 7, 19799 0, 19800 0, 19801 0, 19802 0, 19803 0, 19804 0, 19805 0, 19806 0, 19807 (4278190080 & e.id) >> 24, 19808 (16711680 & e.id) >> 16,
19809 (65280 & e.id) >> 8, 19810 255 & e.id, 19811 0, 19812 0, 19813 0, 19814 0, 19815 (4278190080 & e.duration) >> 24, 19816 (16711680 & e.duration) >> 16, 19817 (65280 & e.duration) >> 8, 19818 255 & e.duration, 19819 0, 19820 0, 19821 0, 19822 0, 19823 0, 19824 0, 19825 0, 19826 0, 19827 0, 19828 0, 19829 0, 19830 0, 19831 1, 19832 0, 19833 0, 19834 0, 19835 0, 19836 1, 19837 0, 19838 0, 19839 0, 19840 0, 19841 0, 19842 0, 19843 0, 19844 0, 19845 0, 19846 0, 19847 0, 19848 0, 19849 0, 19850 0, 19851 0, 19852 1, 19853 0, 19854 0, 19855 0, 19856 0, 19857 0, 19858 0, 19859 0, 19860 0, 19861 0, 19862 0, 19863 0, 19864 0, 19865 0, 19866 0, 19867 64, 19868 0, 19869 0, 19870 0, 19871 (65280 & e.width) >> 8, 19872 255 & e.width, 19873 0, 19874 0, 19875 (65280 & e.height) >> 8, 19876 255 & e.height, 19877 0, 19878 0 19879 ]); 19880 return l(d.tkhd, e); 19881 }), 19882 (J = function (e) { 19883 var t, 19884 i = l( 19885 d.tfhd, 19886 new Uint8Array([ 19887 0, 19888 0, 19889 0, 19890 58, 19891 (4278190080 & e.id) >> 24, 19892 (16711680 & e.id) >> 16,
19893 (65280 & e.id) >> 8, 19894 255 & e.id, 19895 0, 19896 0, 19897 0, 19898 1, 19899 0, 19900 0, 19901 0, 19902 0, 19903 0, 19904 0, 19905 0, 19906 0, 19907 0, 19908 0, 19909 0, 19910 0 19911 ]) 19912 ), 19913 s = Math.floor(e.baseMediaDecodeTime / ve), 19914 r = Math.floor(e.baseMediaDecodeTime % ve), 19915 s = l( 19916 d.tfdt, 19917 new Uint8Array([ 19918 1, 19919 0, 19920 0, 19921 0, 19922 (s >>> 24) & 255, 19923 (s >>> 16) & 255, 19924 (s >>> 8) & 255, 19925 255 & s, 19926 (r >>> 24) & 255, 19927 (r >>> 16) & 255, 19928 (r >>> 8) & 255, 19929 255 & r 19930 ]) 19931 ); 19932 return 'audio' === e.type 19933 ? ((t = ee(e, 92)), l(d.traf, i, s, t)) 19934 : ((r = K(e)), (t = ee(e, r.length + 92)), l(d.traf, i, s, t, r)); 19935 }), 19936 (z = function (e) { 19937 return ((e.duration = e.duration || 4294967295), l(d.trak, $(e), W(e))); 19938 }), 19939 (Z = function (e) { 19940 var t = new Uint8Array([ 19941 0, 19942 0, 19943 0, 19944 0, 19945 (4278190080 & e.id) >> 24, 19946 (16711680 & e.id) >> 16,
19947 (65280 & e.id) >> 8, 19948 255 & e.id, 19949 0, 19950 0, 19951 0, 19952 1, 19953 0, 19954 0, 19955 0, 19956 0, 19957 0, 19958 0, 19959 0, 19960 0, 19961 0, 19962 1, 19963 0, 19964 1 19965 ]); 19966 return ('video' !== e.type && (t[t.length - 1] = 0), l(d.trex, t)); 19967 }), 19968 (me = function (e, t) { 19969 var i = 0, 19970 s = 0, 19971 r = 0, 19972 n = 0; 19973 return ( 19974 e.length && 19975 (void 0 !== e[0].duration && (i = 1), 19976 void 0 !== e[0].size && (s = 2), 19977 void 0 !== e[0].flags && (r = 4), 19978 void 0 !== e[0].compositionTimeOffset) && 19979 (n = 8), 19980 [ 19981 0, 19982 0, 19983 i | s | r | n, 19984 1, 19985 (4278190080 & e.length) >>> 24, 19986 (16711680 & e.length) >>> 16, 19987 (65280 & e.length) >>> 8, 19988 255 & e.length, 19989 (4278190080 & t) >>> 24, 19990 (16711680 & t) >>> 16, 19991 (65280 & t) >>> 8, 19992 255 & t 19993 ] 19994 ); 19995 }), 19996 (ge = function (e, t) { 19997 var i, 19998 s, 19999 r, 20000 n, 20001 a = e.samples || []; 20002 for ( 20003 t += 20 + 16 * a.length, 20004 e = me(a, t), 20005 (s = new Uint8Array(e.length + 16 * a.length)).set(e), 20006 i = e.length, 20007 n = 0; 20008 n < a.length; 20009 n++ 20010 ) 20011 ((r = a[n]), 20012 (s[i++] = (4278190080 & r.duration) >>> 24), 20013 (s[i++] = (16711680 & r.duration) >>> 16), 20014 (s[i++] = (65280 & r.duration) >>> 8), 20015 (s[i++] = 255 & r.duration), 20016 (s[i++] = (4278190080 & r.size) >>> 24), 20017 (s[i++] = (16711680 & r.size) >>> 16), 20018 (s[i++] = (65280 & r.size) >>> 8), 20019 (s[i++] = 255 & r.size), 20020 (s[i++] = (r.flags.isLeading << 2) | r.flags.dependsOn), 20021 (s[i++] = 20022 (r.flags.isDependedOn << 6) | 20023 (r.flags.hasRedundancy << 4) | 20024 (r.flags.paddingValue << 1) | 20025 r.flags.isNonSyncSample), 20026 (s[i++] = 61440 & r.flags.degradationPriority), 20027 (s[i++] = 15 & r.flags.degradationPriority), 20028 (s[i++] = (4278190080 & r.compositionTimeOffset) >>> 24), 20029 (s[i++] = (16711680 & r.compositionTimeOffset) >>> 16), 20030 (s[i++] = (65280 & r.compositionTimeOffset) >>> 8), 20031 (s[i++] = 255 & r.compositionTimeOffset)); 20032 return l(d.trun, s); 20033 }), 20034 (fe = function (e, t) { 20035 var i, 20036 s, 20037 r, 20038 n, 20039 a = e.samples || []; 20040 for ( 20041 t += 20 + 8 * a.length, 20042 e = me(a, t), 20043 (i = new Uint8Array(e.length + 8 * a.length)).set(e), 20044 s = e.length, 20045 n = 0; 20046 n < a.length; 20047 n++ 20048 ) 20049 ((r = a[n]), 20050 (i[s++] = (4278190080 & r.duration) >>> 24), 20051 (i[s++] = (16711680 & r.duration) >>> 16), 20052 (i[s++] = (65280 & r.duration) >>> 8), 20053 (i[s++] = 255 & r.duration), 20054 (i[s++] = (4278190080 & r.size) >>> 24), 20055 (i[s++] = (16711680 & r.size) >>> 16), 20056 (i[s++] = (65280 & r.size) >>> 8), 20057 (i[s++] = 255 & r.size)); 20058 return l(d.trun, i); 20059 }), 20060 (ee = function (e, t) { 20061 return ('audio' === e.type ? fe : ge)(e, t); 20062 })); 20063 function be(e, t) { 20064 var i = xe(); 20065 return ( 20066 (i.dataOffset = t), 20067 (i.compositionTimeOffset = e.pts - e.dts), 20068 (i.duration = e.duration), 20069 (i.size = 4 * e.length), 20070 (i.size += e.byteLength), 20071 e.keyFrame && ((i.flags.dependsOn = 2), (i.flags.isNonSyncSample = 0)), 20072 i 20073 ); 20074 } 20075 function r(e) { 20076 for (var t = []; e--; ) t.push(0); 20077 return t; 20078 } 20079 function n(e) { 20080 ((e = e || {}), 20081 n.prototype.init.call(this), 20082 (this.parse708captions_ = 'boolean' != typeof e.parse708captions || e.parse708captions), 20083 (this.captionPackets_ = []),
20084 (this.ccStreams_ = [new m(0, 0), new m(0, 1), new m(1, 0), new m(1, 1)]), 20085 this.parse708captions_ && 20086 (this.cc708Stream_ = new p({ captionServices: e.captionServices })), 20087 this.reset(), 20088 this.ccStreams_.forEach(function (e) { 20089 (e.on('data', this.trigger.bind(this, 'data')), 20090 e.on('partialdone', this.trigger.bind(this, 'partialdone')), 20091 e.on('done', this.trigger.bind(this, 'done'))); 20092 }, this), 20093 this.parse708captions_ && 20094 (this.cc708Stream_.on('data', this.trigger.bind(this, 'data')), 20095 this.cc708Stream_.on('partialdone', this.trigger.bind(this, 'partialdone')), 20096 this.cc708Stream_.on('done', this.trigger.bind(this, 'done')))); 20097 } 20098 function Te(e) { 20099 return (32 <= e && e <= 127) || (160 <= e && e <= 255); 20100 } 20101 function a(e) { 20102 ((this.windowNum = e), this.reset()); 20103 } 20104 function Se(e, t, i) { 20105 ((this.serviceNum = e), 20106 (this.text = ''), 20107 (this.currentWindow = new a(-1)), 20108 (this.windows = []), 20109 (this.stream = i), 20110 'string' == typeof t && this.createTextDecoder(t)); 20111 } 20112 function we(e) { 20113 return null === e ? '' : ((e = qe[e] || e), String.fromCharCode(e)); 20114 } 20115 function o() { 20116 for (var e = [], t = je + 1; t--; ) e.push({ text: '', indent: 0, offset: 0 }); 20117 return e; 20118 } 20119 function Ee(e, t) { 20120 var i = 1; 20121 for (t < e && (i = -1); Math.abs(t - e) > $e; ) e += i * ze; 20122 return e; 20123 } 20124 function Ce(e) { 20125 var t, i; 20126 (Ce.prototype.init.call(this), 20127 (this.type_ = e || 'shared'), 20128 (this.push = function (e) { 20129 'metadata' === e.type 20130 ? this.trigger('data', e) 20131 : ('shared' !== this.type_ && e.type !== this.type_) || 20132 (void 0 === i && (i = e.dts), 20133 (e.dts = Ee(e.dts, i)), 20134 (e.pts = Ee(e.pts, i)), 20135 (t = e.dts), 20136 this.trigger('data', e)); 20137 }), 20138 (this.flush = function () { 20139 ((i = t), this.trigger('done')); 20140 }), 20141 (this.endTimeline = function () { 20142 (this.flush(), this.trigger('endedtimeline')); 20143 }), 20144 (this.discontinuity = function () { 20145 t = i = void 0; 20146 }), 20147 (this.reset = function () { 20148 (this.discontinuity(), this.trigger('reset')); 20149 })); 20150 } 20151 var ke, 20152 Ie = { 20153 ftyp: (B = function () { 20154 return l(d.ftyp, te, ie, te, se); 20155 }), 20156 mdat: function (e) { 20157 return l(d.mdat, e); 20158 }, 20159 moof: function (e, t) { 20160 for (var i = [], s = t.length; s--; ) i[s] = J(t[s]); 20161 return l.apply(null, [d.moof, F(e)].concat(i)); 20162 }, 20163 moov: (j = function (e) { 20164 for (var t = e.length, i = []; t--; ) i[t] = z(e[t]); 20165 return l.apply(null, [d.moov, H(4294967295)].concat(i).concat(V(e))); 20166 }), 20167 initSegment: function (e) { 20168 var t = B(), 20169 e = j(e), 20170 i = new Uint8Array(t.byteLength + e.byteLength); 20171 return (i.set(t), i.set(e, t.byteLength), i); 20172 } 20173 }, 20174 xe = function () { 20175 return { 20176 size: 0, 20177 flags: { 20178 isLeading: 0, 20179 dependsOn: 1, 20180 isDependedOn: 0, 20181 hasRedundancy: 0, 20182 degradationPriority: 0, 20183 isNonSyncSample: 1 20184 } 20185 }; 20186 }, 20187 Ae = { 20188 groupNalsIntoFrames: function (e) { 20189 var t, 20190 i, 20191 s = [], 20192 r = []; 20193 for ( 20194 r.byteLength = 0, r.nalCount = 0, t = s.byteLength = r.duration = 0; 20195 t < e.length; 20196 t++ 20197 ) 20198 'access_unit_delimiter_rbsp' === (i = e[t]).nalUnitType 20199 ? (s.length && 20200 ((s.duration = i.dts - s.dts), 20201 (r.byteLength += s.byteLength), 20202 (r.nalCount += s.length), 20203 (r.duration += s.duration), 20204 r.push(s)), 20205 ((s = [i]).byteLength = i.data.byteLength), 20206 (s.pts = i.pts), 20207 (s.dts = i.dts)) 20208 : ('slice_layer_without_partitioning_rbsp_idr' === i.nalUnitType && 20209 (s.keyFrame = !0), 20210 (s.duration = i.dts - s.dts), 20211 (s.byteLength += i.data.byteLength), 20212 s.push(i)); 20213 return ( 20214 r.length && 20215 (!s.duration || s.duration <= 0) && 20216 (s.duration = r[r.length - 1].duration), 20217 (r.byteLength += s.byteLength), 20218 (r.nalCount += s.length), 20219 (r.duration += s.duration), 20220 r.push(s), 20221 r 20222 ); 20223 }, 20224 groupFramesIntoGops: function (e) { 20225 var t, 20226 i, 20227 s = [], 20228 r = []; 20229 for ( 20230 s.byteLength = 0, 20231 s.nalCount = 0, 20232 s.duration = 0, 20233 s.pts = e[0].pts, 20234 s.dts = e[0].dts, 20235 r.byteLength = 0, 20236 r.nalCount = 0, 20237 r.duration = 0, 20238 r.pts = e[0].pts, 20239 r.dts = e[0].dts, 20240 t = 0; 20241 t < e.length; 20242 t++ 20243 ) 20244 (i = e[t]).keyFrame 20245 ? (s.length && 20246 (r.push(s), 20247 (r.byteLength += s.byteLength), 20248 (r.nalCount += s.nalCount), 20249 (r.duration += s.duration)), 20250 ((s = [i]).nalCount = i.length), 20251 (s.byteLength = i.byteLength), 20252 (s.pts = i.pts), 20253 (s.dts = i.dts), 20254 (s.duration = i.duration)) 20255 : ((s.duration += i.duration), 20256 (s.nalCount += i.length), 20257 (s.byteLength += i.byteLength), 20258 s.push(i)); 20259 return ( 20260 r.length && s.duration <= 0 && (s.duration = r[r.length - 1].duration), 20261 (r.byteLength += s.byteLength), 20262 (r.nalCount += s.nalCount), 20263 (r.duration += s.duration), 20264 r.push(s), 20265 r 20266 ); 20267 }, 20268 extendFirstKeyFrame: function (e) { 20269 var t; 20270 return ( 20271 !e[0][0].keyFrame && 20272 1 < e.length && 20273 ((t = e.shift()), 20274 (e.byteLength -= t.byteLength), 20275 (e.nalCount -= t.nalCount), 20276 (e[0][0].dts = t.dts), 20277 (e[0][0].pts = t.pts), 20278 (e[0][0].duration += t.duration)), 20279 e 20280 ); 20281 }, 20282 generateSampleTable: function (e, t) { 20283 for (var i, s, r, n = t || 0, a = [], o = 0; o < e.length; o++) 20284 for (s = e[o], i = 0; i < s.length; i++) 20285 ((r = s[i]), (n += (r = be(r, n)).size), a.push(r)); 20286 return a; 20287 }, 20288 concatenateNalData: function (e) { 20289 for ( 20290 var t, 20291 i, 20292 s, 20293 r, 20294 n, 20295 a = 0, 20296 o = e.byteLength, 20297 l = new Uint8Array(o + 4 * e.nalCount), 20298 d = new DataView(l.buffer), 20299 h = 0; 20300 h < e.length; 20301 h++ 20302 ) 20303 for (s = e[h], t = 0; t < s.length; t++) 20304 for (r = s[t], i = 0; i < r.length; i++) 20305 ((n = r[i]), 20306 d.setUint32(a, n.data.byteLength), 20307 l.set(n.data, (a += 4)), 20308 (a += n.data.byteLength)); 20309 return l; 20310 }, 20311 generateSampleTableForFrame: function (e, t) { 20312 var i = [], 20313 e = be(e, t || 0); 20314 return (i.push(e), i); 20315 }, 20316 concatenateNalDataForFrame: function (e) { 20317 for ( 20318 var t, 20319 i = 0, 20320 s = e.byteLength, 20321 r = new Uint8Array(s + 4 * e.length), 20322 n = new DataView(r.buffer), 20323 a = 0; 20324 a < e.length; 20325 a++ 20326 ) 20327 (n.setUint32(i, (t = e[a]).data.byteLength), 20328 r.set(t.data, (i += 4)), 20329 (i += t.data.byteLength)); 20330 return r; 20331 } 20332 }, 20333 h = [33, 16, 5, 32, 164, 27], 20334 De = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252], 20335 Pe = function (e) { 20336 return 9e4 * e; 20337 }, 20338 Le = function (e, t) { 20339 return e * t; 20340 }, 20341 Oe = function (e) { 20342 return e / 9e4; 20343 }, 20344 Re = function (e, t) { 20345 return e / t; 20346 }, 20347 u = { 20348 ONE_SECOND_IN_TS: 9e4, 20349 secondsToVideoTs: Pe, 20350 secondsToAudioTs: Le, 20351 videoTsToSeconds: Oe, 20352 audioTsToSeconds: Re, 20353 audioTsToVideoTs: function (e, t) { 20354 return (e / t) * 9e4; 20355 }, 20356 videoTsToAudioTs: function (e, t) { 20357 return (e / 9e4) * t; 20358 }, 20359 metadataTsToSeconds: function (e, t, i) { 20360 return Oe(i ? e : e - t); 20361 } 20362 }, 20363 Ne = function () { 20364 var e, i; 20365 return ( 20366 ke || 20367 ((e = { 20368 96e3: [h, [227, 64], r(154), [56]], 20369 88200: [h, [231], r(170), [56]], 20370 64e3: [h, [248, 192], r(240), [56]], 20371 48e3: [h, [255, 192], r(268), [55, 148, 128], r(54), [112]], 20372 44100: [h, [255, 192], r(268), [55, 163, 128], r(84), [112]], 20373 32e3: [h, [255, 192], r(268), [55, 234], r(226), [112]], 20374 24e3: [h, [255, 192], r(268), [55, 255, 128], r(2
2037468), [111, 112], r(126), [224]], 20375 16e3: [ 20376 h, 20377 [255, 192], 20378 r(268), 20379 [55, 255, 128], 20380 r(268), 20381 [111, 255], 20382 r(269), 20383 [223, 108], 20384 r(195), 20385 [1, 192] 20386 ], 20387 12e3: [ 20388 De, 20389 r(268), 20390 [3, 127, 248], 20391 r(268), 20392 [6, 255, 240], 20393 r(268), 20394 [13, 255, 224], 20395 r(268), 20396 [27, 253, 128], 20397 r(259), 20398 [56] 20399 ], 20400 11025: [ 20401 De, 20402 r(268), 20403 [3, 127, 248], 20404 r(268), 20405 [6, 255, 240], 20406 r(268), 20407 [13, 255, 224], 20408 r(268), 20409 [27, 255, 192], 20410 r(268), 20411 [55, 175, 128], 20412 r(108), 20413 [112] 20414 ], 20415 8e3: [De, r(268), [3, 121, 16], r(47), [7]] 20416 }), 20417 (i = e), 20418 (ke = Object.keys(i).reduce(function (e, t) { 20419 return ( 20420 (e[t] = new Uint8Array( 20421 i[t].reduce(function (e, t) { 20422 return e.concat(t); 20423 }, []) 20424 )), 20425 e 20426 ); 20427 }, {}))), 20428 ke 20429 ); 20430 }, 20431 Me = u, 20432 Pe = { 20433 prefixWithSilence: function (e, t, i, s) { 20434 var r, 20435 n, 20436 a, 20437 o, 20438 l, 20439 d = 0, 20440 h = 0; 20441 if ( 20442 t.length && 20443 ((n = Me.audioTsToVideoTs(e.baseMediaDecodeTime, e.samplerate)), 20444 (r = Math.ceil(Me.ONE_SECOND_IN_TS / (e.samplerate / 1024))), 20445 i && s && ((n = n - Math.max(i, s)), (h = (d = Math.floor(n / r)) * r)), 20446 !(d < 1 || h > Me.ONE_SECOND_IN_TS / 2)) 20447 ) { 20448 for (a = (a = Ne()[e.samplerate]) || t[0].data, o = 0; o < d; o++) 20449 ((l = t[0]), t.splice(0, 0, { data: a, dts: l.dts - r, pts: l.pts - r })); 20450 return ( 20451 (e.baseMediaDecodeTime -= Math.floor(Me.videoTsToAudioTs(h, e.samplerate))), 20452 h 20453 ); 20454 } 20455 }, 20456 trimAdtsFramesByEarliestDts: function (e, t, i) { 20457 return t.minSegmentDts >= i 20458 ? e 20459 : ((t.minSegmentDts = 1 / 0), 20460 e.filter(function (e) { 20461 return ( 20462 e.dts >= i && 20463 ((t.minSegmentDts = Math.min(t.minSegmentDts, e.dts)), 20464 (t.minSegmentPts = t.minSegmentDts), 20465 !0) 20466 ); 20467 })); 20468 }, 20469 generateSampleTable: function (e) { 20470 for (var t = [], i = 0; i < e.length; i++) 20471 t.push({ size: e[i].data.byteLength, duration: 1024 }); 20472 return t; 20473 }, 20474 concatenateFrameData: function (e) { 20475 for ( 20476 var t, 20477 i = 0, 20478 s = new Uint8Array( 20479 (function (e) { 20480 for (var t = 0, i = 0; i < e.length; i++) t += e[i].data.byteLength; 20481 return t; 20482 })(e) 20483 ), 20484 r = 0; 20485 r < e.length; 20486 r++ 20487 ) 20488 (s.set((t = e[r]).data, i), (i += t.data.byteLength)); 20489 return s; 20490 } 20491 }, 20492 Ue = u.ONE_SECOND_IN_TS, 20493 Le = { 20494 clearDtsInfo: function (e) { 20495 (delete e.minSegmentDts, 20496 delete e.maxSegmentDts, 20497 delete e.minSegmentPts, 20498 delete e.maxSegmentPts); 20499 }, 20500 calculateTrackBaseMediaDecodeTime: function (e, t) { 20501 var i = e.minSegmentDts; 20502 return ( 20503 t || (i -= e.timelineStartInfo.dts), 20504 (t = e.timelineStartInfo.baseMediaDecodeTime), 20505 (t += i), 20506 (t = Math.max(0, t)), 20507 'audio' === e.type && ((t *= e.samplerate / Ue), (t = Math.floor(t))), 20508 t 20509 ); 20510 }, 20511 collectDtsInfo: function (e, t) { 20512 ('number' == typeof t.pts && 20513 (void 0 === e.timelineStartInfo.pts && (e.timelineStartInfo.pts = t.pts), 20514 (e.minSegmentPts = 20515 void 0 === e.minSegmentPts ? t.pts : Math.min(e.minSegmentPts, t.pts)), 20516 (e.maxSegmentPts = 20517 void 0 === e.maxSegmentPts ? t.pts : Math.max(e.maxSegmentPts, t.pts))), 20518 'number' == typeof t.dts && 20519 (void 0 === e.timelineStartInfo.dts && (e.timelineStartInfo.dts = t.dts), 20520 (e.minSegmentDts = 20521 void 0 === e.minSegmentDts ? t.dts : Math.min(e.minSegmentDts, t.dts)), 20522 (e.maxSegmentDts = 20523 void 0 === e.maxSegmentDts ? t.dts : Math.max(e.maxSegmentDts, t.dts)))); 20524 } 20525 }, 20526 Re = { 20527 parseSei: function (e) { 20528 for ( 20529 var t = 0, i = { payloadType: -1, payloadSize: 0 }, s = 0, r = 0; 20530 t < e.byteLength && 128 !== e[t]; 20531 20532 ) { 20533 for (; 255 === e[t]; ) ((s += 255), t++); 20534 for (s += e[t++]; 255 === e[t]; ) ((r += 255), t++); 20535 if (((r += e[t++]), !i.payload && 4 === s)) { 20536 if ('GA94' === String.fromCharCode(e[t + 3], e[t + 4], e[t + 5], e[t + 6])) { 20537 ((i.payloadType = s), (i.payloadSize = r), (i.payload = e.subarray(t, t + r))); 20538 break; 20539 } 20540 i.payload = void 0; 20541 } 20542 ((t += r), (r = s = 0)); 20543 } 20544 return i; 20545 }, 20546 parseUserData: function (e) { 20547 return 181 !== e.payload[0] || 20548 49 != ((e.payload[1] << 8) | e.payload[2]) || 20549 'GA94' !== 20550 String.fromCharCode(e.payload[3], e.payload[4], e.payload[5], e.payload[6]) || 20551 3 !== e.payload[7] 20552 ? null 20553 : e.payload.subarray(8, e.payload.length - 1); 20554 }, 20555 parseCaptionPackets: function (e, t) { 20556 var i, 20557 s, 20558 r, 20559 n, 20560 a = []; 20561 if (64 & t[0]) 20562 for (s = 31 & t[0], i = 0; i < s; i++) 20563 ((n = { type: 3 & t[2 + (r = 3 * i)], pts: e }), 20564 4 & t[2 + r] && ((n.ccData = (t[3 + r] << 8) | t[4 + r]), a.push(n))); 20565 return a; 20566 }, 20567 discardEmulationPreventionBytes: function (e) { 20568 for (var t = e.byteLength, i = [], s = 1; s < t - 2; ) 20569 0 === e[s] && 0 === e[s + 1] && 3 === e[s + 2] ? (i.push(s + 2), (s += 2)) : s++; 20570 if (0 === i.length) return e; 20571 for (var r = t - i.length, n = new Uint8Array(r), a = 0, s = 0; s < r; a++, s++) 20572 (a === i[0] && (a++, i.shift()), (n[s] = e[a])); 20573 return n; 20574 }, 20575 USER_DATA_REGISTERED_ITU_T_T35: 4 20576 }, 20577 c = t, 20578 Be = Re, 20579 Fe = 20580 (((n.prototype = new c()).push = function (e) { 20581 var t;
20582 'sei_rbsp' === e.nalUnitType && 20583 (t = Be.parseSei(e.escapedRBSP)).payload && 20584 t.payloadType === Be.USER_DATA_REGISTERED_ITU_T_T35 && 20585 (t = Be.parseUserData(t)) && 20586 (e.dts < this.latestDts_ 20587 ? (this.ignoreNextEqualDts_ = !0) 20588 : e.dts === this.latestDts_ && this.ignoreNextEqualDts_ 20589 ? (this.numSameDts_--, this.numSameDts_ || (this.ignoreNextEqualDts_ = !1)) 20590 : ((t = Be.parseCaptionPackets(e.pts, t)), 20591 (this.captionPackets_ = this.captionPackets_.concat(t)), 20592 this.latestDts_ !== e.dts && (this.numSameDts_ = 0), 20593 this.numSameDts_++, 20594 (this.latestDts_ = e.dts))); 20595 }), 20596 (n.prototype.flushCCStreams = function (t) { 20597 this.ccStreams_.forEach(function (e) { 20598 return 'flush' === t ? e.flush() : e.partialFlush(); 20599 }, this); 20600 }), 20601 (n.prototype.flushStream = function (e) { 20602 (this.captionPackets_.length && 20603 (this.captionPackets_.forEach(function (e, t) { 20604 e.presortIndex = t; 20605 }), 20606 this.captionPackets_.sort(function (e, t) { 20607 return e.pts === t.pts ? e.presortIndex - t.presortIndex : e.pts - t.pts; 20608 }), 20609 this.captionPackets_.forEach(function (e) { 20610 e.type < 2 ? this.dispatchCea608Packet(e) : this.dispatchCea708Packet(e); 20611 }, this), 20612 (this.captionPackets_.length = 0)), 20613 this.flushCCStreams(e)); 20614 }), 20615 (n.prototype.flush = function () { 20616 return this.flushStream('flush'); 20617 }), 20618 (n.prototype.partialFlush = function () { 20619 return this.flushStream('partialFlush'); 20620 }), 20621 (n.prototype.reset = function () { 20622 ((this.latestDts_ = null), 20623 (this.ignoreNextEqualDts_ = !1), 20624 (this.numSameDts_ = 0), 20625 (this.activeCea608Channel_ = [null, null]), 20626 this.ccStreams_.forEach(function (e) { 20627 e.reset(); 20628 })); 20629 }), 20630 (n.prototype.dispatchCea608Packet = function (e) { 20631 (this.setsTextOrXDSActive(e) 20632 ? (this.activeCea608Channel_[e.type] = null) 20633 : this.setsChannel1Active(e) 20634 ? (this.activeCea608Channel_[e.type] = 0) 20635 : this.setsChannel2Active(e) && (this.activeCea608Channel_[e.type] = 1), 20636 null !== this.activeCea608Channel_[e.type] && 20637 this.ccStreams_[(e.type << 1) + this.activeCea608Channel_[e.type]].push(e)); 20638 }), 20639 (n.prototype.setsChannel1Active = function (e) { 20640 return 4096 == (30720 & e.ccData); 20641 }), 20642 (n.prototype.setsChannel2Active = function (e) { 20643 return 6144 == (30720 & e.ccData); 20644 }), 20645 (n.prototype.setsTextOrXDSActive = function (e) { 20646 return ( 20647 256 == (28928 & e.ccData) || 20648 4138 == (30974 & e.ccData) || 20649 6186 == (30974 & e.ccData) 20650 ); 20651 }), 20652 (n.prototype.dispatchCea708Packet = function (e) { 20653 this.parse708captions_ && this.cc708Stream_.push(e); 20654 }), 20655 { 20656 127: 9834, 20657 4128: 32, 20658 4129: 160, 20659 4133: 8230, 20660 4138: 352, 20661 4140: 338, 20662 4144: 9608, 20663 4145: 8216, 20664 4146: 8217, 20665 4147: 8220, 20666 4148: 8221, 20667 4149: 8226, 20668 4153: 8482, 20669 4154: 353, 20670 4156: 339, 20671 4157: 8480, 20672 4159: 376, 20673 4214: 8539, 20674 4215: 8540, 20675 4216: 8541, 20676 4217: 8542, 20677 4218: 9168, 20678 4219: 9124, 20679 4220: 9123, 20680 4221: 9135, 20681 4222: 9126, 20682 4223: 9121, 20683 4256: 12600 20684 }), 20685 p = 20686 ((a.prototype.reset = function () { 20687 (this.clearText(), 20688 (this.pendingNewLine = !1), 20689 (this.winAttr = {}), 20690 (this.penAttr = {}), 20691 (this.penLoc = {}), 20692 (this.penColor = {}), 20693 (this.visible = 0), 20694 (this.rowLock = 0), 20695 (this.columnLock = 0), 20696 (this.priority = 0), 20697 (this.relativePositioning = 0), 20698 (this.anchorVertical = 0), 20699 (this.anchorHorizontal = 0), 20700 (this.anchorPoint = 0), 20701 (this.rowCount = 1), 20702 (this.virtualRowCount = this.rowCount + 1), 20703 (this.columnCount = 41), 20704 (this.windowStyle = 0), 20705 (this.penStyle = 0)); 20706 }), 20707 (a.prototype.getText = function () { 20708 return this.rows.join('\n'); 20709 }), 20710 (a.prototype.clearText = function () { 20711 ((this.rows = ['']), (this.rowIdx = 0)); 20712 }), 20713 (a.prototype.newLine = function (e) { 20714 for ( 20715 this.rows.length >= this.virtualRowCount && 20716 'function' == typeof this.beforeRowOverflow && 20717 this.beforeRowOverflow(e), 20718 0 < this.rows.length && (this.rows.push(''), this.rowIdx++); 20719 this.rows.length > this.virtualRowCount; 20720 20721 ) 20722 (this.rows.shift(), this.rowIdx--); 20723 }), 20724 (a.prototype.isEmpty = function () { 20725 return 0 === this.rows.length || (1 === this.rows.length && '' === this.rows[0]); 20726 }), 20727 (a.prototype.addText = function (e) { 20728 this.rows[this.rowIdx] += e; 20729 }), 20730 (a.prototype.backspace = function () { 20731 var e; 20732 this.isEmpty() || 20733 ((e = this.rows[this.rowIdx]), 20734 (this.rows[this.rowIdx] = e.substr(0, e.length - 1))); 20735 }), 20736 (Se.prototype.init = function (e, t) { 20737 this.startPts = e; 20738 for (var i = 0; i < 8; i++) 20739 ((this.windows[i] = new a(i)), 20740 'function' == typeof t && (this.windows[i].beforeRowOverflow = t)); 20741 }), 20742 (Se.prototype.setCurrentWindow = function (e) { 20743 this.currentWindow = this.windows[e]; 20744 }), 20745 (Se.prototype.createTextDecoder = function (t) { 20746 if ('undefined' == typeof TextDecoder) 20747 this.stream.trigger('log', { 20748 level: 'warn', 20749 message: 'The `encoding` option is unsupported without TextDecoder support' 20750 }); 20751 else 20752 try { 20753 this.textDecoder_ = new TextDecoder(t); 20754 } catch (e) { 20755 this.stream.trigger('log', { 20756 level: 'warn', 20757 message: 'TextDecoder could not be created with ' + t + ' encoding. ' + e
20758 }); 20759 } 20760 }), 20761 function (e) { 20762 ((e = e || {}), p.prototype.init.call(this)); 20763 var t, 20764 i = this, 20765 s = e.captionServices || {}, 20766 r = {}; 20767 (Object.keys(s).forEach((e) => { 20768 ((t = s[e]), /^SERVICE/.test(e) && (r[e] = t.encoding)); 20769 }), 20770 (this.serviceEncodings = r), 20771 (this.current708Packet = null), 20772 (this.services = {}), 20773 (this.push = function (e) { 20774 ((3 === e.type || null === i.current708Packet) && i.new708Packet(), 20775 i.add708Bytes(e)); 20776 })); 20777 }), 20778 qe = 20779 ((p.prototype = new c()), 20780 (p.prototype.new708Packet = function () { 20781 (null !== this.current708Packet && this.push708Packet(), 20782 (this.current708Packet = { data: [], ptsVals: [] })); 20783 }), 20784 (p.prototype.add708Bytes = function (e) { 20785 var t = e.ccData, 20786 i = t >>> 8, 20787 t = 255 & t; 20788 (this.current708Packet.ptsVals.push(e.pts), 20789 this.current708Packet.data.push(i), 20790 this.current708Packet.data.push(t)); 20791 }), 20792 (p.prototype.push708Packet = function () { 20793 var e, 20794 t = this.current708Packet, 20795 i = t.data, 20796 s = null, 20797 r = 0, 20798 n = i[r++]; 20799 for (t.seq = n >> 6, t.sizeCode = 63 & n; r < i.length; r++) 20800 ((e = 31 & (n = i[r++])), 20801 7 === (s = n >> 5) && 0 < e && (s = i[r++]), 20802 this.pushServiceBlock(s, r, e), 20803 0 < e && (r += e - 1)); 20804 }), 20805 (p.prototype.pushServiceBlock = function (e, t, i) { 20806 for ( 20807 var s, 20808 r = t, 20809 n = this.current708Packet.data, 20810 a = (a = this.services[e]) || this.initService(e, r); 20811 r < t + i && r < n.length; 20812 r++ 20813 ) 20814 ((s = n[r]), 20815 Te(s) 20816 ? (r = this.handleText(r, a)) 20817 : 24 === s 20818 ? (r = this.multiByteCharacter(r, a)) 20819 : 16 === s 20820 ? (r = this.extendedCommands(r, a)) 20821 : 128 <= s && s <= 135 20822 ? (r = this.setCurrentWindow(r, a)) 20823 : 152 <= s && s <= 159 20824 ? (r = this.defineWindow(r, a)) 20825 : 136 === s 20826 ? (r = this.clearWindows(r, a)) 20827 : 140 === s 20828 ? (r = this.deleteWindows(r, a)) 20829 : 137 === s 20830 ? (r = this.displayWindows(r, a)) 20831 : 138 === s 20832 ? (r = this.hideWindows(r, a)) 20833 : 139 === s 20834 ? (r = this.toggleWindows(r, a)) 20835 : 151 === s 20836 ? (r = this.setWindowAttributes(r, a)) 20837 : 144 === s 20838 ? (r = this.setPenAttributes(r, a)) 20839 : 145 === s 20840 ? (r = this.setPenColor(r, a)) 20841 : 146 === s 20842 ? (r = this.setPenLocation(r, a)) 20843 : 143 === s 20844 ? (a = this.reset(r, a)) 20845 : 8 === s 20846 ? a.currentWindow.backspace() 20847 : 12 === s 20848 ? a.currentWindow.clearText() 20849 : 13 === s 20850 ? (a.currentWindow.pendingNewLine = !0) 20851 : 14 === s 20852 ? a.currentWindow.clearText() 20853 : 141 === s && r++); 20854 }), 20855 (p.prototype.extendedCommands = function (e, t) { 20856 var i = this.current708Packet.data[++e]; 20857 return (e = Te(i) ? this.handleText(e, t, { isExtended: !0 }) : e); 20858 }), 20859 (p.prototype.getPts = function (e) { 20860 return this.current708Packet.ptsVals[Math.floor(e / 2)]; 20861 }), 20862 (p.prototype.initService = function (t, e) { 20863 var i, 20864 s = 'SERVICE' + t, 20865 r = this; 20866 return ( 20867 s in this.serviceEncodings && (i = this.serviceEncodings[s]), 20868 (this.services[t] = new Se(t, i, r)), 20869 this.services[t].init(this.getPts(e), function (e) { 20870 r.flushDisplayed(e, r.services[t]); 20871 }), 20872 this.services[t] 20873 ); 20874 }), 20875 (p.prototype.handleText = function (e, t, i) { 20876 var s, 20877 r = i && i.isExtended, 20878 i = i && i.isMultiByte, 20879 n = this.current708Packet.data, 20880 a = r ? 4096 : 0, 20881 o = n[e], 20882 l = t.currentWindow; 20883 return ( 20884 i ? ((s = [o, n[e + 1]]), e++) : (s = [o]), 20885 (i = 20886 t.textDecoder_ && !r 20887 ? t.textDecoder_.decode(new Uint8Array(s)) 20888 : i 20889 ? ((n = s.map((e) => ('0' + (255 & e).toString(16)).slice(-2)).join('')), 20890 String.fromCharCode(parseInt(n, 16))) 20891 : ((t = Fe[(r = a | o)] || r), 20892 4096 & r && r === t ? '' : String.fromCharCode(t))), 20893 l.pendingNewLine && !l.isEmpty() && l.newLine(this.getPts(e)), 20894 (l.pendingNewLine = !1), 20895 l.addText(i), 20896 e 20897 ); 20898 }), 20899 (p.prototype.multiByteCharacter = function (e, t) { 20900 var i = this.current708Packet.data, 20901 s = i[e + 1]; 20902 return (e = Te(s) && Te(i[e + 2]) ? this.handleText(++e, t, { isMultiByte: !0 }) : e); 20903 }), 20904 (p.prototype.setCurrentWindow = function (e, t) { 20905 var i = this.current708Packet.data[e]; 20906 return (t.setCurrentWindow(7 & i), e); 20907 }), 20908 (p.prototype.defineWindow = function (e, t) { 20909 var i = this.current708Packet.data, 20910 s = i[e], 20911 t = (t.setCurrentWindow(7 & s), t.currentWindow), 20912 s = i[++e]; 20913 return ( 20914 (t.visible = (32 & s) >> 5), 20915 (t.rowLock = (16 & s) >> 4), 20916 (t.columnLock = (8 & s) >> 3), 20917 (t.priority = 7 & s), 20918 (s = i[++e]), 20919 (t.relativePositioning = (128 & s) >> 7), 20920 (t.anchorVertical = 127 & s), 20921 (s = i[++e]), 20922 (t.anchorHorizontal = s), 20923 (s = i[++e]), 20924 (t.anchorPoint = (240 & s) >> 4), 20925 (t.rowCount = 15 & s), 20926 (s = i[++e]), 20927 (t.columnCount = 63 & s), 20928 (s = i[++e]), 20929 (t.windowStyle = (56 & s) >> 3), 20930 (t.penStyle = 7 & s), 20931 (t.virtualRowCount = t.rowCount + 1), 20932 e 20933 ); 20934 }), 20935 (p.prototype.setWindowAttributes = function (e, t) { 20936 var i = this.current708Packet.data, 20937 t = (i[e], t.currentWindow.winAttr), 20938 s = i[++e]; 20939 return ( 20940 (t.fillOpacity = (192 & s) >> 6),
20941 (t.fillRed = (48 & s) >> 4), 20942 (t.fillGreen = (12 & s) >> 2), 20943 (t.fillBlue = 3 & s), 20944 (s = i[++e]), 20945 (t.borderType = (192 & s) >> 6), 20946 (t.borderRed = (48 & s) >> 4), 20947 (t.borderGreen = (12 & s) >> 2), 20948 (t.borderBlue = 3 & s), 20949 (s = i[++e]), 20950 (t.borderType += (128 & s) >> 5), 20951 (t.wordWrap = (64 & s) >> 6), 20952 (t.printDirection = (48 & s) >> 4), 20953 (t.scrollDirection = (12 & s) >> 2), 20954 (t.justify = 3 & s), 20955 (s = i[++e]), 20956 (t.effectSpeed = (240 & s) >> 4), 20957 (t.effectDirection = (12 & s) >> 2), 20958 (t.displayEffect = 3 & s), 20959 e 20960 ); 20961 }), 20962 (p.prototype.flushDisplayed = function (e, t) { 20963 for (var i = [], s = 0; s < 8; s++) 20964 t.windows[s].visible && !t.windows[s].isEmpty() && i.push(t.windows[s].getText()); 20965 ((t.endPts = e), (t.text = i.join('\n\n')), this.pushCaption(t), (t.startPts = e)); 20966 }), 20967 (p.prototype.pushCaption = function (e) { 20968 '' !== e.text && 20969 (this.trigger('data', { 20970 startPts: e.startPts, 20971 endPts: e.endPts, 20972 text: e.text, 20973 stream: 'cc708_' + e.serviceNum 20974 }), 20975 (e.text = ''), 20976 (e.startPts = e.endPts)); 20977 }), 20978 (p.prototype.displayWindows = function (e, t) { 20979 var i = this.current708Packet.data[++e], 20980 s = this.getPts(e); 20981 this.flushDisplayed(s, t); 20982 for (var r = 0; r < 8; r++) i & (1 << r) && (t.windows[r].visible = 1); 20983 return e; 20984 }), 20985 (p.prototype.hideWindows = function (e, t) { 20986 var i = this.current708Packet.data[++e], 20987 s = this.getPts(e); 20988 this.flushDisplayed(s, t); 20989 for (var r = 0; r < 8; r++) i & (1 << r) && (t.windows[r].visible = 0); 20990 return e; 20991 }), 20992 (p.prototype.toggleWindows = function (e, t) { 20993 var i = this.current708Packet.data[++e], 20994 s = this.getPts(e); 20995 this.flushDisplayed(s, t); 20996 for (var r = 0; r < 8; r++) i & (1 << r) && (t.windows[r].visible ^= 1); 20997 return e; 20998 }), 20999 (p.prototype.clearWindows = function (e, t) { 21000 var i = this.current708Packet.data[++e], 21001 s = this.getPts(e); 21002 this.flushDisplayed(s, t); 21003 for (var r = 0; r < 8; r++) i & (1 << r) && t.windows[r].clearText(); 21004 return e; 21005 }), 21006 (p.prototype.deleteWindows = function (e, t) { 21007 var i = this.current708Packet.data[++e], 21008 s = this.getPts(e); 21009 this.flushDisplayed(s, t); 21010 for (var r = 0; r < 8; r++) i & (1 << r) && t.windows[r].reset(); 21011 return e; 21012 }), 21013 (p.prototype.setPenAttributes = function (e, t) { 21014 var i = this.current708Packet.data, 21015 t = (i[e], t.currentWindow.penAttr), 21016 s = i[++e]; 21017 return ( 21018 (t.textTag = (240 & s) >> 4), 21019 (t.offset = (12 & s) >> 2), 21020 (t.penSize = 3 & s), 21021 (s = i[++e]), 21022 (t.italics = (128 & s) >> 7), 21023 (t.underline = (64 & s) >> 6), 21024 (t.edgeType = (56 & s) >> 3), 21025 (t.fontStyle = 7 & s), 21026 e 21027 ); 21028 }), 21029 (p.prototype.setPenColor = function (e, t) { 21030 var i = this.current708Packet.data, 21031 t = (i[e], t.currentWindow.penColor), 21032 s = i[++e]; 21033 return ( 21034 (t.fgOpacity = (192 & s) >> 6), 21035 (t.fgRed = (48 & s) >> 4), 21036 (t.fgGreen = (12 & s) >> 2), 21037 (t.fgBlue = 3 & s), 21038 (s = i[++e]), 21039 (t.bgOpacity = (192 & s) >> 6), 21040 (t.bgRed = (48 & s) >> 4), 21041 (t.bgGreen = (12 & s) >> 2), 21042 (t.bgBlue = 3 & s), 21043 (s = i[++e]), 21044 (t.edgeRed = (48 & s) >> 4), 21045 (t.edgeGreen = (12 & s) >> 2), 21046 (t.edgeBlue = 3 & s), 21047 e 21048 ); 21049 }), 21050 (p.prototype.setPenLocation = function (e, t) { 21051 var i = this.current708Packet.data, 21052 s = (i[e], t.currentWindow.penLoc); 21053 return ( 21054 (t.currentWindow.pendingNewLine = !0), 21055 (t = i[++e]), 21056 (s.row = 15 & t), 21057 (t = i[++e]), 21058 (s.column = 63 & t), 21059 e 21060 ); 21061 }), 21062 (p.prototype.reset = function (e, t) { 21063 var i = this.getPts(e); 21064 return (this.flushDisplayed(i, t), this.initService(t.serviceNum, e)); 21065 }), 21066 { 21067 42: 225, 21068 92: 233, 21069 94: 237, 21070 95: 243, 21071 96: 250, 21072 123: 231, 21073 124: 247, 21074 125: 209, 21075 126: 241, 21076 127: 9608, 21077 304: 174, 21078 305: 176, 21079 306: 189, 21080 307: 191, 21081 308: 8482, 21082 309: 162, 21083 310: 163, 21084 311: 9834, 21085 312: 224, 21086 313: 160, 21087 314: 232, 21088 315: 226, 21089 316: 234, 21090 317: 238, 21091 318: 244, 21092 319: 251, 21093 544: 193, 21094 545: 201, 21095 546: 211, 21096 547: 218, 21097 548: 220, 21098 549: 252, 21099 550: 8216, 21100 551: 161, 21101 552: 42, 21102 553: 39, 21103 554: 8212, 21104 555: 169, 21105 556: 8480, 21106 557: 8226, 21107 558: 8220, 21108 559: 8221, 21109 560: 192, 21110 561: 194, 21111 562: 199, 21112 563: 200, 21113 564: 202, 21114 565: 203, 21115 566: 235, 21116 567: 206, 21117 568: 207, 21118 569: 239, 21119 570: 212, 21120 571: 217, 21121 572: 249, 21122 573: 219, 21123 574: 171, 21124 575: 187, 21125 800: 195, 21126 801: 227, 21127 802: 205, 21128 803: 204, 21129 804: 236, 21130 805: 210, 21131 806: 242, 21132 807: 213, 21133 808: 245, 21134 809: 123, 21135 810: 125, 21136 811: 92, 21137 812: 94, 21138 813: 95, 21139 814: 124, 21140 815: 126, 21141 816: 196, 21142 817: 228, 21143 818: 214, 21144 819: 246, 21145 820: 223, 21146 821: 165, 21147 822: 164, 21148 823: 9474, 21149 824: 197, 21150 825: 229, 21151 826: 216, 21152 827: 248, 21153 828: 9484, 21154 829: 9488, 21155 830: 9492, 21156 831: 9496 21157 }), 21158 je = 14, 21159 Ve = [ 21160 4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152 21161 ], 21162 m = function (e, t) { 21163 (m.prototype.init.call(this), 21164 (this.field_ = e || 0), 21165 (this.dataChannel_ = t || 0), 21166 (this.name_ = 'CC' + (1 + ((this.field_ << 1) | this.dataChannel_))), 21167 this.setConstants(), 21168 this.reset(), 21169 (this.push = function (e) { 21170 var t, 21171 i, 21172 s, 21173 r, 21174 n = 32639 & e.ccData; 21175 n === this.lastControlCode_ 21176 ? (this.lastControlCode_ = null) 21177 : (4096 == (61440 & n) 21178 ? (this.lastControlCode_ = n) 21179 : n !== this.PADDING_ && (this.lastControlCode_ = null),
21180 (t = n >>> 8), 21181 (i = 255 & n), 21182 n !== this.PADDING_ && 21183 (n === this.RESUME_CAPTION_LOADING_ 21184 ? (this.mode_ = 'popOn') 21185 : n === this.END_OF_CAPTION_ 21186 ? ((this.mode_ = 'popOn'), 21187 this.clearFormatting(e.pts), 21188 this.flushDisplayed(e.pts), 21189 (r = this.displayed_), 21190 (this.displayed_ = this.nonDisplayed_), 21191 (this.nonDisplayed_ = r), 21192 (this.startPts_ = e.pts)) 21193 : n === this.ROLL_UP_2_ROWS_ 21194 ? ((this.rollUpRows_ = 2), this.setRollUp(e.pts)) 21195 : n === this.ROLL_UP_3_ROWS_ 21196 ? ((this.rollUpRows_ = 3), this.setRollUp(e.pts)) 21197 : n === this.ROLL_UP_4_ROWS_ 21198 ? ((this.rollUpRows_ = 4), this.setRollUp(e.pts)) 21199 : n === this.CARRIAGE_RETURN_ 21200 ? (this.clearFormatting(e.pts), 21201 this.flushDisplayed(e.pts), 21202 this.shiftRowsUp_(), 21203 (this.startPts_ = e.pts)) 21204 : n === this.BACKSPACE_ 21205 ? 'popOn' === this.mode_ 21206 ? (this.nonDisplayed_[this.row_].text = this.nonDisplayed_[ 21207 this.row_ 21208 ].text.slice(0, -1)) 21209 : (this.displayed_[this.row_].text = this.displayed_[ 21210 this.row_ 21211 ].text.slice(0, -1)) 21212 : n === this.ERASE_DISPLAYED_MEMORY_ 21213 ? (this.flushDisplayed(e.pts), (this.displayed_ = o())) 21214 : n === this.ERASE_NON_DISPLAYED_MEMORY_ 21215 ? (this.nonDisplayed_ = o()) 21216 : n === this.RESUME_DIRECT_CAPTIONING_ 21217 ? ('paintOn' !== this.mode_ && 21218 (this.flushDisplayed(e.pts), (this.displayed_ = o())), 21219 (this.mode_ = 'paintOn'), 21220 (this.startPts_ = e.pts)) 21221 : this.isSpecialCharacter(t, i) 21222 ? ((s = we((t = (3 & t) << 8) | i)), 21223 this[this.mode_](e.pts, s), 21224 this.column_++) 21225 : this.isExtCharacter(t, i) 21226 ? ('popOn' === this.mode_ 21227 ? (this.nonDisplayed_[this.row_].text = 21228 this.nonDisplayed_[this.row_].text.slice( 21229 0, 21230 -1 21231 )) 21232 : (this.displayed_[this.row_].text = 21233 this.displayed_[this.row_].text.slice(0, -1)), 21234 (s = we((t = (3 & t) << 8) | i)), 21235 this[this.mode_](e.pts, s), 21236 this.column_++) 21237 : this.isMidRowCode(t, i) 21238 ? (this.clearFormatting(e.pts), 21239 this[this.mode_](e.pts, ' '), 21240 this.column_++, 21241 14 == (14 & i) && 21242 this.addFormatting(e.pts, ['i']), 21243 1 == (1 & i) && this.addFormatting(e.pts, ['u'])) 21244 : this.isOffsetControlCode(t, i) 21245 ? ((this.nonDisplayed_[this.row_].offset = r = 21246 3 & i), 21247 (this.column_ += r)) 21248 : this.isPAC(t, i) 21249 ? ((r = Ve.indexOf(7968 & n)), 21250 'rollUp' === this.mode_ && 21251 (r - this.rollUpRows_ + 1 < 0 && 21252 (r = this.rollUpRows_ - 1), 21253 this.setRollUp(e.pts, r)), 21254 r !== this.row_ && 21255 0 <= r && 21256 r <= 14 && 21257 (this.clearFormatting(e.pts), 21258 (this.row_ = r)), 21259 1 & i && 21260 -1 === this.formatting_.indexOf('u') && 21261 this.addFormatting(e.pts, ['u']), 21262 16 == (16 & n) && 21263 ((this.column_ = 4 * (r = (14 & n) >> 1)), 21264 (this.nonDisplayed_[this.row_].indent += 21265 r)), 21266 this.isColorPAC(i) && 21267 14 == (14 & i) && 21268 this.addFormatting(e.pts, ['i'])) 21269 : this.isNormalChar(t) && 21270 (0 === i && (i = null),
21271 (s = we(t)), 21272 (s += we(i)), 21273 this[this.mode_](e.pts, s), 21274 (this.column_ += s.length)))); 21275 })); 21276 }, 21277 c = 21278 ((m.prototype = new c()), 21279 (m.prototype.flushDisplayed = function (e) { 21280 let i = (e) => { 21281 this.trigger('log', { 21282 level: 'warn', 21283 message: 'Skipping a malformed 608 caption at index ' + e + '.' 21284 }); 21285 }, 21286 s = []; 21287 (this.displayed_.forEach((e, t) => { 21288 if (e && e.text && e.text.length) { 21289 try { 21290 e.text = e.text.trim(); 21291 } catch (e) { 21292 i(t); 21293 } 21294 e.text.length && 21295 s.push({ 21296 text: e.text, 21297 line: t + 1, 21298 position: 10 + Math.min(70, 10 * e.indent) + 2.5 * e.offset 21299 }); 21300 } else null == e && i(t); 21301 }), 21302 s.length && 21303 this.trigger('data', { 21304 startPts: this.startPts_, 21305 endPts: e, 21306 content: s, 21307 stream: this.name_ 21308 })); 21309 }), 21310 (m.prototype.reset = function () { 21311 ((this.mode_ = 'popOn'), 21312 (this.topRow_ = 0), 21313 (this.startPts_ = 0), 21314 (this.displayed_ = o()), 21315 (this.nonDisplayed_ = o()), 21316 (this.lastControlCode_ = null), 21317 (this.column_ = 0), 21318 (this.row_ = je), 21319 (this.rollUpRows_ = 2), 21320 (this.formatting_ = [])); 21321 }), 21322 (m.prototype.setConstants = function () { 21323 (0 === this.dataChannel_ 21324 ? ((this.BASE_ = 16), 21325 (this.EXT_ = 17), 21326 (this.CONTROL_ = (20 | this.field_) << 8), 21327 (this.OFFSET_ = 23)) 21328 : 1 === this.dataChannel_ && 21329 ((this.BASE_ = 24), 21330 (this.EXT_ = 25), 21331 (this.CONTROL_ = (28 | this.field_) << 8), 21332 (this.OFFSET_ = 31)), 21333 (this.PADDING_ = 0), 21334 (this.RESUME_CAPTION_LOADING_ = 32 | this.CONTROL_), 21335 (this.END_OF_CAPTION_ = 47 | this.CONTROL_), 21336 (this.ROLL_UP_2_ROWS_ = 37 | this.CONTROL_), 21337 (this.ROLL_UP_3_ROWS_ = 38 | this.CONTROL_), 21338 (this.ROLL_UP_4_ROWS_ = 39 | this.CONTROL_), 21339 (this.CARRIAGE_RETURN_ = 45 | this.CONTROL_), 21340 (this.RESUME_DIRECT_CAPTIONING_ = 41 | this.CONTROL_), 21341 (this.BACKSPACE_ = 33 | this.CONTROL_), 21342 (this.ERASE_DISPLAYED_MEMORY_ = 44 | this.CONTROL_), 21343 (this.ERASE_NON_DISPLAYED_MEMORY_ = 46 | this.CONTROL_)); 21344 }), 21345 (m.prototype.isSpecialCharacter = function (e, t) { 21346 return e === this.EXT_ && 48 <= t && t <= 63; 21347 }), 21348 (m.prototype.isExtCharacter = function (e, t) { 21349 return (e === this.EXT_ + 1 || e === this.EXT_ + 2) && 32 <= t && t <= 63; 21350 }), 21351 (m.prototype.isMidRowCode = function (e, t) { 21352 return e === this.EXT_ && 32 <= t && t <= 47; 21353 }), 21354 (m.prototype.isOffsetControlCode = function (e, t) { 21355 return e === this.OFFSET_ && 33 <= t && t <= 35; 21356 }), 21357 (m.prototype.isPAC = function (e, t) { 21358 return e >= this.BASE_ && e < this.BASE_ + 8 && 64 <= t && t <= 127; 21359 }), 21360 (m.prototype.isColorPAC = function (e) { 21361 return (64 <= e && e <= 79) || (96 <= e && e <= 127); 21362 }), 21363 (m.prototype.isNormalChar = function (e) { 21364 return 32 <= e && e <= 127; 21365 }), 21366 (m.prototype.setRollUp = function (e, t) { 21367 if ( 21368 ('rollUp' !== this.mode_ && 21369 ((this.row_ = je), 21370 (this.mode_ = 'rollUp'), 21371 this.flushDisplayed(e), 21372 (this.nonDisplayed_ = o()), 21373 (this.displayed_ = o())), 21374 void 0 !== t && t !== this.row_) 21375 ) 21376 for (var i = 0; i < this.rollUpRows_; i++) 21377 ((this.displayed_[t - i] = this.displayed_[this.row_ - i]), 21378 (this.displayed_[this.row_ - i] = { text: '', indent: 0, offset: 0 })); 21379 (void 0 === t && (t = this.row_), (this.topRow_ = t - this.rollUpRows_ + 1)); 21380 }), 21381 (m.prototype.addFormatting = function (e, t) { 21382 this.formatting_ = this.formatting_.concat(t); 21383 t = t.reduce(function (e, t) { 21384 return e + '<' + t + '>'; 21385 }, ''); 21386 this[this.mode_](e, t); 21387 }), 21388 (m.prototype.clearFormatting = function (e) { 21389 var t; 21390 this.formatting_.length && 21391 ((t = this.formatting_.reverse().reduce(function (e, t) { 21392 return e + '</' + t + '>'; 21393 }, '')), 21394 (this.formatting_ = []), 21395 this[this.mode_](e, t)); 21396 }), 21397 (m.prototype.popOn = function (e, t) { 21398 var i = this.nonDisplayed_[this.row_].text; 21399 this.nonDisplayed_[this.row_].text = i += t; 21400 }), 21401 (m.prototype.rollUp = function (e, t) { 21402 var i = this.displayed_[this.row_].text; 21403 this.displayed_[this.row_].text = i += t; 21404 }), 21405 (m.prototype.shiftRowsUp_ = function () { 21406 for (var e = 0; e < this.topRow_; e++) 21407 this.displayed_[e] = { text: '', indent: 0, offset: 0 }; 21408 for (e = this.row_ + 1; e < je + 1; e++) 21409 this.displayed_[e] = { text: '', indent: 0, offset: 0 }; 21410 for (e = this.topRow_; e < this.row_; e++) 21411 this.displayed_[e] = this.displayed_[e + 1]; 21412 this.displayed_[this.row_] = { text: '', indent: 0, offset: 0 }; 21413 }), 21414 (m.prototype.paintOn = function (e, t) { 21415 var i = this.displayed_[this.row_].text; 21416 this.displayed_[this.row_].text = i += t; 21417 }), 21418 { CaptionStream: n, Cea608Stream: m, Cea708Stream: p }), 21419 He = { H264_STREAM_TYPE: 27, ADTS_STREAM_TYPE: 15, METADATA_STREAM_TYPE: 21 }, 21420 g = t, 21421 ze = 8589934592, 21422 $e = 4294967296; 21423 Ce.prototype = new g(); 21424 function We(e, t, i) { 21425 for (var s = '', r = t; r < i; r++) s += '%' + ('00' + e[r].toString(16)).slice(-2); 21426 return s; 21427 } 21428 function f(e, t, i) { 21429 return decodeURIComponent(We(e, t, i)); 21430 } 21431 function y(e, t, i) { 21432 return unescape(We(e, t, i)); 21433 } 21434 function _(e) { 21435 return (e[0] << 21) | (e[1] << 14) | (e[2] << 7) | e[3]; 21436 } 21437 var Ge, 21438 Xe, 21439 Ke, 21440 g = Ce, 21441 Ye = Ee, 21442 Qe = (e, t, i) => { 21443 if (e) for (var s = i; s < e.length; s++) if (e[s] === t) return s; 21444 return -1; 21445 }, 21446 Je = 3, 21447 Ze = { 21448 APIC: function (e) { 21449 var t, 21450 i = 1; 21451 e.data[0] !== Je || 21452 (t = Qe(e.data, 0, 1)) < 0 || 21453 ((e.mimeType = y(e.data, 1, t)), 21454 (e.pictureType = e.data[(i = t + 1)]), 21455 (t = Qe(e.data, 0, ++i)) < 0) || 21456 ((e.description = f(e.data, i, t)), 21457 (i = t + 1),
21458 '--\x3e' === e.mimeType 21459 ? (e.url = y(e.data, i, e.data.length)) 21460 : (e.pictureData = e.data.subarray(i, e.data.length))); 21461 }, 21462 'T*': function (e) { 21463 e.data[0] === Je && 21464 ((e.value = f(e.data, 1, e.data.length).replace(/\0*$/, '')), 21465 (e.values = e.value.split('\0'))); 21466 }, 21467 TXXX: function (e) { 21468 var t; 21469 e.data[0] === Je && 21470 -1 !== (t = Qe(e.data, 0, 1)) && 21471 ((e.description = f(e.data, 1, t)), 21472 (e.value = f(e.data, t + 1, e.data.length).replace(/\0*$/, '')), 21473 (e.data = e.value)); 21474 }, 21475 'W*': function (e) { 21476 e.url = y(e.data, 0, e.data.length).replace(/\0.*$/, ''); 21477 }, 21478 WXXX: function (e) { 21479 var t; 21480 e.data[0] === Je && 21481 -1 !== (t = Qe(e.data, 0, 1)) && 21482 ((e.description = f(e.data, 1, t)), 21483 (e.url = y(e.data, t + 1, e.data.length).replace(/\0.*$/, ''))); 21484 }, 21485 PRIV: function (e) { 21486 for (var t = 0; t < e.data.length; t++) 21487 if (0 === e.data[t]) { 21488 e.owner = y(e.data, 0, t); 21489 break; 21490 } 21491 ((e.privateData = e.data.subarray(t + 1)), (e.data = e.privateData)); 21492 } 21493 }, 21494 et = { 21495 parseId3Frames: function (e) { 21496 var t, 21497 i = 10, 21498 s = 0, 21499 r = []; 21500 if ( 21501 !( 21502 e.length < 10 || 21503 e[0] !== 'I'.charCodeAt(0) || 21504 e[1] !== 'D'.charCodeAt(0) || 21505 e[2] !== '3'.charCodeAt(0) 21506 ) 21507 ) { 21508 s = _(e.subarray(6, 10)); 21509 ((s += 10), 21510 64 & e[5] && 21511 ((i = (i += 4) + _(e.subarray(10, 14))), (s -= _(e.subarray(16, 20))))); 21512 do { 21513 if ((t = _(e.subarray(i + 4, i + 8))) < 1) break; 21514 var n = { 21515 id: String.fromCharCode(e[i], e[i + 1], e[i + 2], e[i + 3]), 21516 data: e.subarray(i + 10, i + t + 10) 21517 }; 21518 } while ( 21519 ((n.key = n.id), 21520 Ze[n.id] 21521 ? Ze[n.id](n) 21522 : 'T' === n.id[0] 21523 ? Ze['T*'](n) 21524 : 'W' === n.id[0] && Ze['W*'](n), 21525 r.push(n), 21526 (i = i + 10 + t) < s) 21527 ); 21528 return r; 21529 } 21530 }, 21531 parseSyncSafeInteger: _, 21532 frameParsers: Ze 21533 }, 21534 v = t, 21535 tt = He, 21536 b = et, 21537 it = function (e) { 21538 var t, 21539 i = { descriptor: e && e.descriptor }, 21540 l = 0, 21541 d = [], 21542 h = 0; 21543 if ( 21544 (it.prototype.init.call(this), 21545 (this.dispatchType = tt.METADATA_STREAM_TYPE.toString(16)), 21546 i.descriptor) 21547 ) 21548 for (t = 0; t < i.descriptor.length; t++) 21549 this.dispatchType += ('00' + i.descriptor[t].toString(16)).slice(-2); 21550 this.push = function (e) { 21551 var t, i, s, r, n, a, o; 21552 if ('timed-metadata' === e.type) 21553 if ( 21554 (e.dataAlignmentIndicator && ((h = 0), (d.length = 0)), 21555 0 === d.length && 21556 (e.data.length < 10 || 21557 e.data[0] !== 'I'.charCodeAt(0) || 21558 e.data[1] !== 'D'.charCodeAt(0) || 21559 e.data[2] !== '3'.charCodeAt(0))) 21560 ) 21561 this.trigger('log', { 21562 level: 'warn', 21563 message: 'Skipping unrecognized metadata packet' 21564 }); 21565 else if ( 21566 (d.push(e), 21567 (h += e.data.byteLength), 21568 1 === d.length && 21569 ((l = b.parseSyncSafeInteger(e.data.subarray(6, 10))), (l += 10)), 21570 !(h < l)) 21571 ) { 21572 for ( 21573 t = { data: new Uint8Array(l), frames: [], pts: d[0].pts, dts: d[0].dts }, 21574 r = 0; 21575 r < l; 21576 21577 ) 21578 (t.data.set(d[0].data.subarray(0, l - r), r), 21579 (r += d[0].data.byteLength), 21580 (h -= d[0].data.byteLength), 21581 d.shift()); 21582 ((i = 10), 21583 64 & t.data[5] && 21584 ((i = (i += 4) + b.parseSyncSafeInteger(t.data.subarray(10, 14))), 21585 (l -= b.parseSyncSafeInteger(t.data.subarray(16, 20))))); 21586 do { 21587 if ((s = b.parseSyncSafeInteger(t.data.subarray(i + 4, i + 8))) < 1) { 21588 this.trigger('log', { 21589 level: 'warn', 21590 message: 21591 'Malformed ID3 frame encountered. Skipping remaining metadata parsing.' 21592 }); 21593 break; 21594 } 21595 } while ( 21596 (((o = { 21597 id: String.fromCharCode( 21598 t.data[i], 21599 t.data[i + 1], 21600 t.data[i + 2], 21601 t.data[i + 3] 21602 ), 21603 data: t.data.subarray(i + 10, i + s + 10) 21604 }).key = o.id), 21605 b.frameParsers[o.id] 21606 ? b.frameParsers[o.id](o) 21607 : 'T' === o.id[0] 21608 ? b.frameParsers['T*'](o) 21609 : 'W' === o.id[0] && b.frameParsers['W*'](o), 21610 'com.apple.streaming.transportStreamTimestamp' === o.owner && 21611 ((a = 21612 ((1 & (n = o.data)[3]) << 30) | 21613 (n[4] << 22) | 21614 (n[5] << 14) | 21615 (n[6] << 6) | 21616 (n[7] >>> 2)), 21617 (o.timeStamp = a = (a *= 4) + (3 & n[7])), 21618 void 0 === t.pts && 21619 void 0 === t.dts && 21620 ((t.pts = o.timeStamp), (t.dts = o.timeStamp)), 21621 this.trigger('timestamp', o)), 21622 t.frames.push(o), 21623 (i = i + 10 + s) < l) 21624 ); 21625 this.trigger('data', t); 21626 } 21627 }; 21628 }, 21629 v = ((it.prototype = new v()), it), 21630 st = t, 21631 T = c, 21632 S = He, 21633 rt = function () { 21634 var r = new Uint8Array(188), 21635 n = 0; 21636 (rt.prototype.init.call(this), 21637 (this.push = function (e) { 21638 var t, 21639 i = 0, 21640 s = 188; 21641 for ( 21642 n 21643 ? ((t = new Uint8Array(e.byteLength + n)).set(r.subarray(0, n)), 21644 t.set(e, n), 21645 (n = 0)) 21646 : (t = e); 21647 s < t.byteLength; 21648 21649 ) 21650 71 === t[i] && 71 === t[s] 21651 ? (this.trigger('data', t.subarray(i, s)), (i += 188), (s += 188)) 21652 : (i++, s++); 21653 i < t.byteLength && (r.set(t.subarray(i), 0), (n = t.byteLength - i)); 21654 }), 21655 (this.flush = function () { 21656 (188 === n && 71 === r[0] && (this.trigger('data', r), (n = 0)), 21657 this.trigger('done')); 21658 }), 21659 (this.endTimeline = function () { 21660 (this.flush(), this.trigger('endedtimeline')); 21661 }), 21662 (this.reset = function () { 21663 ((n = 0), this.trigger('reset')); 21664 })); 21665 }, 21666 nt = 21667 ((rt.prototype = new st()), 21668 ((Ge = function () { 21669 var s, r, n, a; 21670 (Ge.prototype.init.call(this), 21671 ((a = this).packetsWaitingForPmt = []), 21672 (this.programMapTable = void 0), 21673 (s = function (e, t) { 21674 var i = 0; 21675 (t.payloadUnitStartIndicator && (i += e[i] + 1), 21676 ('pat' === t.type ? r : n)(e.subarray(i), t)); 21677 }), 21678 (r = function (e, t) { 21679 ((t.section_number = e[7]), 21680 (t.last_section_number = e[8]), 21681 (a.pmtPid = ((31 & e[10]) << 8) | e[11]), 21682 (t.pmtPid = a.pmtPid)); 21683 }), 21684 (n = function (e, t) { 21685 var i, s; 21686 if (1 & e[5]) { 21687 for ( 21688 a.programMapTable = { video: null, audio: null, 'timed-metadata': {} }, 21689 i = 3 + (((15 & e[1]) << 8) | e[2]) - 4, 21690 s = 12 + (((15 & e[10]) << 8) | e[11]); 21691 s < i; 21692 21693 ) { 21694 var r = e[s], 21695 n = ((31 & e[s + 1]) << 8) | e[s + 2]; 21696 (r === S.H264_STREAM_TYPE && null === a.programMapTable.video 21697 ? (a.programMapTable.video = n) 21698 : r === S.ADTS_STREAM_TYPE && null === a.programMapTable.audio 21699 ? (a.programMapTable.audio = n) 21700 : r === S.METADATA_STREAM_TYPE && 21701 (a.programMapTable['timed-metadata'][n] = r), 21702 (s += 5 + (((15 & e[s + 3]) << 8) | e[s + 4]))); 21703 } 21704 t.programMapTable = a.programMapTable; 21705 } 21706 }), 21707 (this.push = function (e) { 21708 var t = {}, 21709 i = 4; 21710 if ( 21711 ((t.payloadUnitStartIndicator = !!(64 & e[1])), 21712 (t.pid = 31 & e[1]), 21713 (t.pid <<= 8), 21714 (t.pid |= e[2]), 21715 1 < (48 & e[3]) >>> 4 && (i += e[i] + 1), 21716 0 === t.pid) 21717 ) 21718 ((t.type = 'pat'), s(e.subarray(i), t), this.trigger('data', t)); 21719 else if (t.pid === this.pmtPid) 21720 for ( 21721 t.type = 'pmt', s(e.subarray(i), t), this.trigger('data', t); 21722 this.packetsWaitingForPmt.length; 21723 21724 ) 21725 this.processPes_.apply(this, this.packetsWaitingForPmt.shift()); 21726 else 21727 void 0 === this.programMapTable
21728 ? this.packetsWaitingForPmt.push([e, i, t]) 21729 : this.processPes_(e, i, t); 21730 }), 21731 (this.processPes_ = function (e, t, i) { 21732 (i.pid === this.programMapTable.video 21733 ? (i.streamType = S.H264_STREAM_TYPE) 21734 : i.pid === this.programMapTable.audio 21735 ? (i.streamType = S.ADTS_STREAM_TYPE) 21736 : (i.streamType = this.programMapTable['timed-metadata'][i.pid]), 21737 (i.type = 'pes'), 21738 (i.data = e.subarray(t)), 21739 this.trigger('data', i)); 21740 })); 21741 }).prototype = new st()), 21742 (Ge.STREAM_TYPES = { h264: 27, adts: 15 }), 21743 ((Xe = function () { 21744 function s(e, t, i) { 21745 var s, 21746 r = new Uint8Array(e.size), 21747 n = { type: t }, 21748 a = 0, 21749 o = 0; 21750 if (e.data.length && !(e.size < 9)) { 21751 for (n.trackId = e.data[0].pid, a = 0; a < e.data.length; a++) 21752 ((s = e.data[a]), r.set(s.data, o), (o += s.data.byteLength)); 21753 (d(r, n), 21754 (t = 'video' === t || n.packetLength <= e.size), 21755 (i || t) && ((e.size = 0), (e.data.length = 0)), 21756 t && l.trigger('data', n)); 21757 } 21758 } 21759 var t, 21760 l = this, 21761 r = !1, 21762 n = { data: [], size: 0 }, 21763 a = { data: [], size: 0 }, 21764 o = { data: [], size: 0 }, 21765 d = function (e, t) { 21766 var i = (e[0] << 16) | (e[1] << 8) | e[2]; 21767 ((t.data = new Uint8Array()), 21768 1 == i && 21769 ((t.packetLength = 6 + ((e[4] << 8) | e[5])), 21770 (t.dataAlignmentIndicator = 0 != (4 & e[6])), 21771 192 & (i = e[7]) && 21772 ((t.pts = 21773 ((14 & e[9]) << 27) | 21774 ((255 & e[10]) << 20) | 21775 ((254 & e[11]) << 12) | 21776 ((255 & e[12]) << 5) | 21777 ((254 & e[13]) >>> 3)), 21778 (t.pts *= 4), 21779 (t.pts += (6 & e[13]) >>> 1), 21780 (t.dts = t.pts), 21781 64 & i) && 21782 ((t.dts = 21783 ((14 & e[14]) << 27) | 21784 ((255 & e[15]) << 20) | 21785 ((254 & e[16]) << 12) | 21786 ((255 & e[17]) << 5) | 21787 ((254 & e[18]) >>> 3)), 21788 (t.dts *= 4), 21789 (t.dts += (6 & e[18]) >>> 1)), 21790 (t.data = e.subarray(9 + e[8])))); 21791 }; 21792 (Xe.prototype.init.call(this), 21793 (this.push = function (i) { 21794 ({ 21795 pat: function () {}, 21796 pes: function () { 21797 var e, t; 21798 switch (i.streamType) { 21799 case S.H264_STREAM_TYPE: 21800 ((e = n), (t = 'video')); 21801 break; 21802 case S.ADTS_STREAM_TYPE: 21803 ((e = a), (t = 'audio')); 21804 break; 21805 case S.METADATA_STREAM_TYPE: 21806 ((e = o), (t = 'timed-metadata')); 21807 break; 21808 default: 21809 return; 21810 } 21811 (i.payloadUnitStartIndicator && s(e, t, !0), 21812 e.data.push(i), 21813 (e.size += i.data.byteLength)); 21814 }, 21815 pmt: function () { 21816 var e = { type: 'metadata', tracks: [] }; 21817 (null !== (t = i.programMapTable).video && 21818 e.tracks.push({ 21819 timelineStartInfo: { baseMediaDecodeTime: 0 }, 21820 id: +t.video, 21821 codec: 'avc', 21822 type: 'video' 21823 }), 21824 null !== t.audio && 21825 e.tracks.push({ 21826 timelineStartInfo: { baseMediaDecodeTime: 0 }, 21827 id: +t.audio, 21828 codec: 'adts', 21829 type: 'audio' 21830 }), 21831 (r = !0), 21832 l.trigger('data', e)); 21833 } 21834 })[i.type](); 21835 }), 21836 (this.reset = function () { 21837 ((n.size = 0), 21838 (n.data.length = 0), 21839 (a.size = 0), 21840 (a.data.length = 0), 21841 this.trigger('reset')); 21842 }), 21843 (this.flushStreams_ = function () { 21844 (s(n, 'video'), s(a, 'audio'), s(o, 'timed-metadata')); 21845 }), 21846 (this.flush = function () { 21847 var e; 21848 (!r && 21849 t && 21850 ((e = { type: 'metadata', tracks: [] }), 21851 null !== t.video && 21852 e.tracks.push({ 21853 timelineStartInfo: { baseMediaDecodeTime: 0 }, 21854 id: +t.video, 21855 codec: 'avc', 21856 type: 'video' 21857 }), 21858 null !== t.audio && 21859 e.tracks.push({ 21860 timelineStartInfo: { baseMediaDecodeTime: 0 }, 21861 id: +t.audio, 21862 codec: 'adts', 21863 type: 'audio' 21864 }), 21865 l.trigger('data', e)), 21866 (r = !1), 21867 this.flushStreams_(), 21868 this.trigger('done')); 21869 })); 21870 }).prototype = new st()), 21871 { 21872 PAT_PID: 0, 21873 MP2T_PACKET_LENGTH: 188, 21874 TransportPacketStream: rt,
21875 TransportParseStream: Ge, 21876 ElementaryStream: Xe, 21877 TimestampRolloverStream: g, 21878 CaptionStream: T.CaptionStream, 21879 Cea608Stream: T.Cea608Stream, 21880 Cea708Stream: T.Cea708Stream, 21881 MetadataStream: v 21882 }); 21883 for (Ke in S) S.hasOwnProperty(Ke) && (nt[Ke] = S[Ke]); 21884 var at, 21885 ot, 21886 st = nt, 21887 g = t, 21888 lt = u.ONE_SECOND_IN_TS, 21889 dt = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350], 21890 ht = function (l) { 21891 var d, 21892 h = 0; 21893 (ht.prototype.init.call(this), 21894 (this.skipWarn_ = function (e, t) { 21895 this.trigger('log', { 21896 level: 'warn', 21897 message: `adts skiping bytes ${e} to ${t} in frame ${h} outside syncword` 21898 }); 21899 }), 21900 (this.push = function (e) { 21901 var t, 21902 i, 21903 s, 21904 r, 21905 n, 21906 a, 21907 o = 0; 21908 if ((l || (h = 0), 'audio' === e.type)) { 21909 for ( 21910 d && d.length 21911 ? ((s = d), 21912 (d = new Uint8Array(s.byteLength + e.data.byteLength)).set(s), 21913 d.set(e.data, s.byteLength)) 21914 : (d = e.data); 21915 o + 7 < d.length; 21916 21917 ) 21918 if (255 !== d[o] || 240 != (246 & d[o + 1])) 21919 ('number' != typeof a && (a = o), o++); 21920 else { 21921 if ( 21922 ('number' == typeof a && (this.skipWarn_(a, o), (a = null)), 21923 (i = 2 * (1 & ~d[o + 1])), 21924 (t = ((3 & d[o + 3]) << 11) | (d[o + 4] << 3) | ((224 & d[o + 5]) >> 5)), 21925 (n = ((r = 1024 * (1 + (3 & d[o + 6]))) * lt) / dt[(60 & d[o + 2]) >>> 2]), 21926 d.byteLength - o < t) 21927 ) 21928 break; 21929 (this.trigger('data', { 21930 pts: e.pts + h * n, 21931 dts: e.dts + h * n, 21932 sampleCount: r, 21933 audioobjecttype: 1 + ((d[o + 2] >>> 6) & 3), 21934 channelcount: ((1 & d[o + 2]) << 2) | ((192 & d[o + 3]) >>> 6), 21935 samplerate: dt[(60 & d[o + 2]) >>> 2], 21936 samplingfrequencyindex: (60 & d[o + 2]) >>> 2, 21937 samplesize: 16, 21938 data: d.subarray(o + 7 + i, o + t) 21939 }), 21940 h++, 21941 (o += t)); 21942 } 21943 ('number' == typeof a && (this.skipWarn_(a, o), (a = null)), (d = d.subarray(o))); 21944 } 21945 }), 21946 (this.flush = function () { 21947 ((h = 0), this.trigger('done')); 21948 }), 21949 (this.reset = function () { 21950 ((d = void 0), this.trigger('reset')); 21951 }), 21952 (this.endTimeline = function () { 21953 ((d = void 0), this.trigger('endedtimeline')); 21954 })); 21955 }, 21956 T = ((ht.prototype = new g()), ht), 21957 v = t, 21958 ut = function (s) { 21959 var r = s.byteLength, 21960 n = 0, 21961 a = 0; 21962 ((this.length = function () { 21963 return 8 * r; 21964 }), 21965 (this.bitsAvailable = function () { 21966 return 8 * r + a; 21967 }), 21968 (this.loadWord = function () { 21969 var e = s.byteLength - r, 21970 t = new Uint8Array(4), 21971 i = Math.min(4, r); 21972 if (0 === i) throw new Error('no bytes available'); 21973 (t.set(s.subarray(e, e + i)), 21974 (n = new DataView(t.buffer).getUint32(0)), 21975 (a = 8 * i), 21976 (r -= i)); 21977 }), 21978 (this.skipBits = function (e) { 21979 var t; 21980 (e < a || ((e = (e -= a) - 8 * (t = Math.floor(e / 8))), (r -= t), this.loadWord()), 21981 (n <<= e), 21982 (a -= e)); 21983 }), 21984 (this.readBits = function (e) { 21985 var t = Math.min(a, e), 21986 i = n >>> (32 - t); 21987 return ( 21988 0 < (a -= t) ? (n <<= t) : 0 < r && this.loadWord(), 21989 0 < (t = e - t) ? (i << t) | this.readBits(t) : i 21990 ); 21991 }), 21992 (this.skipLeadingZeros = function () { 21993 for (var e = 0; e < a; ++e) 21994 if (0 != (n & (2147483648 >>>
21994 e))) return ((n <<= e), (a -= e), e); 21995 return (this.loadWord(), e + this.skipLeadingZeros()); 21996 }), 21997 (this.skipUnsignedExpGolomb = function () { 21998 this.skipBits(1 + this.skipLeadingZeros()); 21999 }), 22000 (this.skipExpGolomb = function () { 22001 this.skipBits(1 + this.skipLeadingZeros()); 22002 }), 22003 (this.readUnsignedExpGolomb = function () { 22004 var e = this.skipLeadingZeros(); 22005 return this.readBits(e + 1) - 1; 22006 }), 22007 (this.readExpGolomb = function () { 22008 var e = this.readUnsignedExpGolomb(); 22009 return 1 & e ? (1 + e) >>> 1 : -1 * (e >>> 1); 22010 }), 22011 (this.readBoolean = function () { 22012 return 1 === this.readBits(1); 22013 }), 22014 (this.readUnsignedByte = function () { 22015 return this.readBits(8); 22016 }), 22017 this.loadWord()); 22018 }, 22019 ct = function () { 22020 var s, 22021 r, 22022 n = 0; 22023 (ct.prototype.init.call(this), 22024 (this.push = function (e) { 22025 for ( 22026 var t, 22027 i = (r = r 22028 ? ((t = new Uint8Array(r.byteLength + e.data.byteLength)).set(r), 22029 t.set(e.data, r.byteLength), 22030 t) 22031 : e.data).byteLength; 22032 n < i - 3; 22033 n++ 22034 ) 22035 if (1 === r[n + 2]) { 22036 s = n + 5; 22037 break; 22038 } 22039 for (; s < i; ) 22040 switch (r[s]) { 22041 case 0: 22042 if (0 !== r[s - 1]) s += 2; 22043 else if (0 !== r[s - 2]) s++; 22044 else { 22045 for ( 22046 n + 3 !== s - 2 && this.trigger('data', r.subarray(n + 3, s - 2)); 22047 1 !== r[++s] && s < i; 22048 22049 ); 22050 ((n = s - 2), (s += 3)); 22051 } 22052 break; 22053 case 1: 22054 0 !== r[s - 1] || 0 !== r[s - 2] 22055 ? (s += 3) 22056 : (this.trigger('data', r.subarray(n + 3, s - 2)), (n = s - 2), (s += 3)); 22057 break; 22058 default: 22059 s += 3; 22060 } 22061 ((r = r.subarray(n)), (s -= n), (n = 0)); 22062 }), 22063 (this.reset = function () { 22064 ((r = null), (n = 0), this.trigger('reset')); 22065 }), 22066 (this.flush = function () { 22067 (r && 3 < r.byteLength && this.trigger('data', r.subarray(n + 3)), 22068 (r = null), 22069 (n = 0), 22070 this.trigger('done')); 22071 }), 22072 (this.endTimeline = function () { 22073 (this.flush(), this.trigger('endedtimeline')); 22074 })); 22075 }; 22076 ((ct.prototype = new v()), 22077 (ot = { 22078 100: !0, 22079 110: !0, 22080 122: !0, 22081 244: !0, 22082 44: !0, 22083 83: !0, 22084 86: !0, 22085 118: !0, 22086 128: !0, 22087 138: !0, 22088 139: !0, 22089 134: !0 22090 }), 22091 ((at = function () { 22092 var i, 22093 s, 22094 r, 22095 n, 22096 a, 22097 o, 22098 g, 22099 t = new ct(); 22100 (at.prototype.init.call(this), 22101 ((i = this).push = function (e) { 22102 'video' === e.type && ((s = e.trackId), (r = e.pts), (n = e.dts), t.push(e)); 22103 }), 22104 t.on('data', function (e) { 22105 var t = { trackId: s, pts: r, dts: n, data: e, nalUnitTypeCode: 31 & e[0] }; 22106 switch (t.nalUnitTypeCode) { 22107 case 5: 22108 t.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr'; 22109 break; 22110 case 6: 22111 ((t.nalUnitType = 'sei_rbsp'), (t.escapedRBSP = a(e.subarray(1)))); 22112 break; 22113 case 7: 22114 ((t.nalUnitType = 'seq_parameter_set_rbsp'), 22115 (t.escapedRBSP = a(e.subarray(1))), 22116 (t.config = o(t.escapedRBSP))); 22117 break; 22118 case 8: 22119 t.nalUnitType = 'pic_parameter_set_rbsp'; 22120 break; 22121 case 9: 22122 t.nalUnitType = 'access_unit_delimiter_rbsp'; 22123 } 22124 i.trigger('data', t); 22125 }), 22126 t.on('done', function () { 22127 i.trigger('done'); 22128 }), 22129 t.on('partialdone', function () { 22130 i.trigger('partialdone'); 22131 }), 22132 t.on('reset', function () { 22133 i.trigger('reset'); 22134 }), 22135 t.on('endedtimeline', function () { 22136 i.trigger('endedtimeline'); 22137 }), 22138 (this.flush = function () { 22139 t.flush(); 22140 }), 22141 (this.partialFlush = function () { 22142 t.partialFlush(); 22143 }), 22144 (this.reset = function () { 22145 t.reset(); 22146 }), 22147 (this.endTimeline = function () { 22148 t.endTimeline(); 22149 }), 22150 (g = function (e, t) { 22151 for (var i = 8, s = 8, r = 0; r < e; r++) 22152 i = 0 === (s = 0 !== s ? (i + t.readExpGolomb() + 256) % 256 : s) ? i : s; 22153 }), 22154 (a = function (e) { 22155 for (var t = e.byteLength, i = [], s = 1; s < t - 2; ) 22156 0 === e[s] && 0 === e[s + 1] && 3 === e[s + 2] ? (i.push(s + 2), (s += 2)) : s++; 22157 if (0 === i.length) return e; 22158 for (var r = t - i.length, n = new Uint8Array(r), a = 0, s = 0; s < r; a++, s++) 22159 (a === i[0] && (a++, i.shift()), (n[s] = e[a])); 22160 return n; 22161 }), 22162 (o = function (e) { 22163 var t, 22164 i, 22165 s, 22166 r, 22167 n, 22168 a, 22169 o = 0, 22170 l = 0, 22171 d = 0, 22172 h = 0, 22173 u = [1, 1], 22174 c = new ut(e), 22175 e = c.readUnsignedByte(), 22176 p = c.readUnsignedByte(), 22177 m = c.readUnsignedByte(); 22178 if ( 22179 (c.skipUnsignedExpGolomb(), 22180 ot[e] && 22181 (3 === (i = c.readUnsignedExpGolomb()) && c.skipBits(1), 22182 c.skipUnsignedExpGolomb(), 22183 c.skipUnsignedExpGolomb(), 22184 c.skipBits(1), 22185 c.readBoolean())) 22186 ) 22187 for (n = 3 !== i ? 8 : 12, a = 0; a < n; a++) 22188 c.readBoolean() && g(a < 6 ? 16 : 64, c); 22189 if ((c.skipUnsignedExpGolomb(), 0 === (i = c.readUnsignedExpGolomb()))) 22190 c.readUnsignedExpGolomb(); 22191 else if (1 === i) 22192 for ( 22193 c.skipBits(1), 22194 c.skipExpGolomb(), 22195 c.skipExpGolomb(), 22196 t = c.readUnsignedExpGolomb(), 22197 a = 0; 22198 a < t; 22199 a++ 22200 ) 22201 c.skipExpGolomb(); 22202 if ( 22203 (c.skipUnsignedExpGolomb(), 22204 c.skipBits(1), 22205 (i = c.readUnsignedExpGolomb()), 22206 (s = c.readUnsignedExpGolomb()), 22207 0 === (r = c.readBits(1)) && c.skipBits(1), 22208 c.skipBits(1), 22209 c.readBoolean() && 22210 ((o = c.readUnsignedExpGolomb()), 22211 (l = c.readUnsignedExpGolomb()), 22212 (d = c.readUnsignedExpGolomb()), 22213 (h = c.readUnsignedExpGolomb())), 22214 c.readBoolean() && c.readBoolean()) 22215 ) { 22216 switch (c.readUnsignedByte()) { 22217 case 1: 22218 u = [1, 1]; 22219 break; 22220 case 2: 22221 u = [12, 11]; 22222 break; 22223 case 3: 22224 u = [10, 11]; 22225 break; 22226 case 4: 22227 u = [16, 11]; 22228 break; 22229 case 5: 22230 u = [40, 33]; 22231 break; 22232 case 6: 22233 u = [24, 11]; 22234 break; 22235 case 7: 22236 u = [20, 11]; 22237 break; 22238 case 8: 22239 u = [32, 11]; 22240 break; 22241 case 9: 22242 u = [80, 33]; 22243 break; 22244 case 10: 22245 u = [18, 11]; 22246 break; 22247 case 11: 22248 u = [15, 11]; 22249 break; 22250 case 12: 22251 u = [64, 33]; 22252 break; 22253 case 13: 22254 u = [160, 99]; 22255 break; 22256 case 14: 22257 u = [4, 3]; 22258 break; 22259 case 15: 22260 u = [3, 2]; 22261 break; 22262 case 16: 22263 u = [2, 1]; 22264 break; 22265 case 255: 22266 u = [ 22267 (c.readUnsignedByte() << 8) | c.readUnsignedByte(), 22268 (c.readUnsignedByte() << 8) | c.readUnsignedByte() 22269 ]; 22270 } 22271 u && (u[0], u[1]); 22272 } 22273 return { 22274 profileIdc: e, 22275 levelIdc: m, 22276 profileCompatibility: p, 22277 width: 16 * (i + 1) - 2 * o - 2 * l, 22278 height: (2 - r) * (s + 1) * 16 - 2 * d - 2 * h, 22279 sarRatio: u 22280 }; 22281 })); 22282 }).prototype = new v())); 22283 function pt(e) { 22284 return (e[0] << 21) | (e[1] << 14) | (e[2] << 7) | e[3]; 22285 } 22286 var g = at, 22287 mt = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350], 22288 gt = function (e, t) { 22289 var i = 22290 0 <= (i = (e[t + 6] << 21) | (e[t + 7] << 14) | (e[t + 8] << 7) | e[t + 9]) ? i : 0; 22291 return (16 & e[t + 5]) >> 4 ? 20 + i : 10 + i; 22292 }, 22293 ft = function (e, t) { 22294 return e.length - t < 10 || 22295 e[t] !== 'I'.charCodeAt(0) || 22296 e[t + 1] !== 'D'.charCodeAt(0) || 22297 e[t + 2] !== '3'.charCodeAt(0) 22298 ? t 22299 : ((t += gt(e, t)), ft(e, t)); 22300 }, 22301 yt = function (e, t, i) { 22302 for (var s = '', r = t; r < i; r++) s += '%' + ('00' + e[r].toString(16)).slice(-2); 22303 return s; 22304 }, 22305 v = { 22306 isLikelyAacData: function (e) { 22307 var t = ft(e, 0); 22308 return ( 22309 e.length >= t + 2 && 22310 255 == (255 & e[t]) && 22311 240 == (240 & e[t + 1]) && 22312 16 == (22 & e[t + 1]) 22313 ); 22314 }, 22315 parseId3TagSize: gt, 22316 parseAdtsSize: function (e, t) { 22317 var i = (224 & e[t + 5]) >> 5; 22318 return (6144 & e[t + 3]) | (e[t + 4] << 3) | i; 22319 }, 22320 parseType: function (e, t) { 22321 return e[t] === 'I'.charCodeAt(0) && 22322 e[t + 1] === 'D'.charCodeAt(0) && 22323 e[t + 2] === '3'.charCodeAt(0) 22324 ? 'timed-metadata' 22325 : !0 & e[t] && 240 == (240 & e[t + 1]) 22326 ? 'audio' 22327 : null; 22328 }, 22329 parseSampleRate: function (e) { 22330 for (var t = 0; t + 5 < e.length; ) { 22331 if (255 === e[t] && 240 == (246 & e[t + 1])) return mt[(60 & e[t + 2]) >>> 2]; 22332 t++; 22333 } 22334 return null; 22335 }, 22336 parseAacTimestamp: function (e) { 22337 var t, 22338 i = 10; 22339 64 & e[5] && (i = (i += 4) + pt(e.subarray(10, 14))); 22340 do { 22341 if ((t = pt(e.subarray(i + 4, i + 8))) < 1) return null; 22342 if ('PRIV' === String.fromCharCode(e[i], e[i + 1], e[i + 2], e[i + 3])) 22343 for (var s, r, n = e.subarray(i + 10, i + t + 10), a = 0;
22343 a < n.byteLength; a++) 22344 if (0 === n[a]) { 22345 if ('com.apple.streaming.transportStreamTimestamp' === unescape(yt(n, 0, a))) 22346 return ( 22347 (r = 22348 ((1 & (s = n.subarray(a + 1))[3]) << 30) | 22349 (s[4] << 22) | 22350 (s[5] << 14) | 22351 (s[6] << 6) | 22352 (s[7] >>> 2)), 22353 (r *= 4) + (3 & s[7]) 22354 ); 22355 break; 22356 } 22357 } while ((i = i + 10 + t) < e.byteLength); 22358 return null; 22359 } 22360 }, 22361 _t = t, 22362 vt = v, 22363 bt = function () { 22364 var n = new Uint8Array(), 22365 a = 0; 22366 (bt.prototype.init.call(this), 22367 (this.setTimestamp = function (e) { 22368 a = e; 22369 }), 22370 (this.push = function (e) { 22371 var t, 22372 i, 22373 s = 0, 22374 r = 0; 22375 for ( 22376 n.length 22377 ? ((i = n.length), 22378 (n = new Uint8Array(e.byteLength + i)).set(n.subarray(0, i)), 22379 n.set(e, i)) 22380 : (n = e); 22381 3 <= n.length - r; 22382 22383 ) 22384 if ( 22385 n[r] === 'I'.charCodeAt(0) && 22386 n[r + 1] === 'D'.charCodeAt(0) && 22387 n[r + 2] === '3'.charCodeAt(0) 22388 ) { 22389 if (n.length - r < 10) break; 22390 if (r + (s = vt.parseId3TagSize(n, r)) > n.length) break; 22391 ((t = { type: 'timed-metadata', data: n.subarray(r, r + s) }), 22392 this.trigger('data', t), 22393 (r += s)); 22394 } else if (255 == (255 & n[r]) && 240 == (240 & n[r + 1])) { 22395 if (n.length - r < 7) break; 22396 if (r + (s = vt.parseAdtsSize(n, r)) > n.length) break; 22397 ((t = { type: 'audio', data: n.subarray(r, r + s), pts: a, dts: a }), 22398 this.trigger('data', t), 22399 (r += s)); 22400 } else r++; 22401 n = 0 < n.length - r ? n.subarray(r) : new Uint8Array(); 22402 }), 22403 (this.reset = function () { 22404 ((n = new Uint8Array()), this.trigger('reset')); 22405 }), 22406 (this.endTimeline = function () { 22407 ((n = new Uint8Array()), this.trigger('endedtimeline')); 22408 })); 22409 }; 22410 bt.prototype = new _t(); 22411 function Tt(e, t) { 22412 for (var i = Object.keys(t), s = 0; s < i.length; s++) { 22413 var r = i[s]; 22414 'headOfPipeline' !== r && t[r].on && t[r].on('log', Bt.bind(e, r)); 22415 } 22416 } 22417 function St(e, t) { 22418 var i; 22419 if (e.length === t.length) { 22420 for (i = 0; i < e.length; i++) if (e[i] !== t[i]) return; 22421 return 1; 22422 } 22423 } 22424 function wt(e, t, i, s, r, n) { 22425 return { 22426 start: { dts: e, pts: e + (i - t) }, 22427 end: { dts: e + (s - t), pts: e + (r - i) }, 22428 prependedContentDuration: n, 22429 baseMediaDecodeTime: e 22430 }; 22431 } 22432 var Et, 22433 Ct, 22434 kt, 22435 _t = t, 22436 It = Ie, 22437 xt = Ae, 22438 At = Pe, 22439 w = Le, 22440 E = st, 22441 Dt = u, 22442 Pt = T, 22443 Lt = g, 22444 Ot = bt, 22445 Rt = v.isLikelyAacData, 22446 Nt = u.ONE_SECOND_IN_TS, 22447 Mt = [ 22448 'audioobjecttype', 22449 'channelcount', 22450 'samplerate', 22451 'samplingfrequencyindex', 22452 'samplesize' 22453 ], 22454 Ut = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility', 'sarRatio'], 22455 Bt = function (e, t) { 22456 ((t.stream = e), this.trigger('log', t)); 22457 }, 22458 Ft = function (n, a) { 22459 var o = [], 22460 l = 0, 22461 d = 0, 22462 h = 1 / 0, 22463 u = (a = a || {}).firstSequenceNumber || 0; 22464 (Ft.prototype.init.call(this), 22465 (this.push = function (t) { 22466 (w.collectDtsInfo(n, t), 22467 n && 22468 Mt.forEach(function (e) { 22469 n[e] = t[e]; 22470 }), 22471 o.push(t)); 22472 }), 22473 (this.setEarliestDts = function (e) { 22474 l = e; 22475 }), 22476 (this.setVideoBaseMediaDecodeTime = function (e) { 22477 h = e; 22478 }), 22479 (this.setAudioAppendStart = function (e) { 22480 d = e; 22481 }), 22482 (this.flush = function () { 22483 var e, t, i, s, r; 22484 (0 !== o.length && 22485 ((e = At.trimAdtsFramesByEarliestDts(o, n, l)), 22486 (n.baseMediaDecodeTime = w.calculateTrackBaseMediaDecodeTime( 22487 n, 22488 a.keepOriginalTimestamps 22489 )), 22490 (r = At.prefixWithSilence(n, e, d, h)), 22491 (n.samples = At.generateSampleTable(e)), 22492 (i = It.mdat(At.concatenateFrameData(e))), 22493 (o = []), 22494 (s = It.moof(u, [n])), 22495 (t = new Uint8Array(s.byteLength + i.byteLength)), 22496 u++, 22497 t.set(s), 22498 t.set(i, s.byteLength), 22499 w.clearDtsInfo(n), 22500 (i = Math.ceil((1024 * Nt) / n.samplerate)), 22501 e.length && 22502 ((s = e.length * i), 22503 this.trigger( 22504 'segmentTimingInfo', 22505 wt( 22506 Dt.audioTsToVideoTs(n.baseMediaDecodeTime, n.samplerate), 22507 e[0].dts, 22508 e[0].pts, 22509 e[0].dts + s, 22510 e[0].pts + s, 22511 r || 0 22512 ) 22513 ), 22514 this.trigger('timingInfo', { start: e[0].pts, end: e[0].pts + s })), 22515 this.trigger('data', { track: n, boxes: t })), 22516 this.trigger('done', 'AudioSegmentStream')); 22517 }), 22518 (this.reset = function () { 22519 (w.clearDtsInfo(n), (o = []), this.trigger('reset')); 22520 })); 22521 }; 22522 ((Ft.prototype = new _t()), 22523 ((Et = function (a, n) { 22524 var t, 22525 i, 22526 o = [], 22527 d = [], 22528 l = (n = n || {}).firstSequenceNumber || 0; 22529 (Et.prototype.init.call(this), 22530 delete a.minPTS, 22531 (this.gopCache_ = []), 22532 (this.push = function (e) { 22533 (w.collectDtsInfo(a, e), 22534 'seq_parameter_set_rbsp' !== e.nalUnitType || 22535 t || 22536 ((t = e.config), 22537 (a.sps = [e.data]), 22538 Ut.forEach(function (e) { 22539 a[e] = t[e]; 22540 }, this)), 22541 'pic_parameter_set_rbsp' !== e.nalUnitType || 22542 i || 22543 ((i = e.data), (a.pps = [e.data])), 22544 o.push(e)); 22545 }), 22546 (this.flush = function () { 22547 for ( 22548 var e, t, i, s = 0; 22549 o.length && 'access_unit_delimiter_rbsp' !== o[0].nalUnitType; 22550 22551 ) 22552 o.shift(); 22553 if (0 !== o.length) { 22554 if ( 22555 ((e = xt.groupNalsIntoFrames(o)), 22556 (e = xt.groupFramesIntoGops(e))[0][0].keyFrame || 22557 ((r = this.getGopForFusion_(o[0], a)) 22558 ? ((s = r.duration), 22559 e.unshift(r), 22560 (e.byteLength += r.byteLength), 22561 (e.nalCount += r.nalCount), 22562 (e.pts = r.pts), 22563 (e.dts = r.dts), 22564 (e.duration += r.duration)) 22565 : (e = xt.extendFirstKeyFrame(e))), 22566 d.length) 22567 ) { 22568 var r = n.alignGopsAtEnd ? this.alignGopsAtEnd_(e) : this.alignGopsAtStart_(e); 22569 if (!r) 22570 return ( 22571 this.gopCache_.unshift({ gop: e.pop(), pps: a.pps, sps: a.sps }), 22572 (this.gopCache_.length = Math.min(6, this.gopCache_.length)), 22573 (o = []),
22574 this.resetStream_(), 22575 void this.trigger('done', 'VideoSegmentStream') 22576 ); 22577 (w.clearDtsInfo(a), (e = r)); 22578 } 22579 (w.collectDtsInfo(a, e), 22580 (a.samples = xt.generateSampleTable(e)), 22581 (r = It.mdat(xt.concatenateNalData(e))), 22582 (a.baseMediaDecodeTime = w.calculateTrackBaseMediaDecodeTime( 22583 a, 22584 n.keepOriginalTimestamps 22585 )), 22586 this.trigger( 22587 'processedGopsInfo', 22588 e.map(function (e) { 22589 return { pts: e.pts, dts: e.dts, byteLength: e.byteLength }; 22590 }) 22591 ), 22592 (t = e[0]), 22593 (i = e[e.length - 1]), 22594 this.trigger( 22595 'segmentTimingInfo', 22596 wt( 22597 a.baseMediaDecodeTime, 22598 t.dts, 22599 t.pts, 22600 i.dts + i.duration, 22601 i.pts + i.duration, 22602 s 22603 ) 22604 ), 22605 this.trigger('timingInfo', { 22606 start: e[0].pts, 22607 end: e[e.length - 1].pts + e[e.length - 1].duration 22608 }), 22609 this.gopCache_.unshift({ gop: e.pop(), pps: a.pps, sps: a.sps }), 22610 (this.gopCache_.length = Math.min(6, this.gopCache_.length)), 22611 (o = []), 22612 this.trigger('baseMediaDecodeTime', a.baseMediaDecodeTime), 22613 this.trigger('timelineStartInfo', a.timelineStartInfo), 22614 (t = It.moof(l, [a])), 22615 (i = new Uint8Array(t.byteLength + r.byteLength)), 22616 l++, 22617 i.set(t), 22618 i.set(r, t.byteLength), 22619 this.trigger('data', { track: a, boxes: i })); 22620 } 22621 (this.resetStream_(), this.trigger('done', 'VideoSegmentStream')); 22622 }), 22623 (this.reset = function () { 22624 (this.resetStream_(), 22625 (o = []), 22626 (this.gopCache_.length = 0), 22627 (d.length = 0), 22628 this.trigger('reset')); 22629 }), 22630 (this.resetStream_ = function () { 22631 (w.clearDtsInfo(a), (i = t = void 0)); 22632 }), 22633 (this.getGopForFusion_ = function (e) { 22634 for (var t, i, s, r = 1 / 0, n = 0; n < this.gopCache_.length; n++) 22635 ((i = (s = this.gopCache_[n]).gop), 22636 a.pps && 22637 St(a.pps[0], s.pps[0]) && 22638 a.sps && 22639 St(a.sps[0], s.sps[0]) && 22640 (i.dts < a.timelineStartInfo.dts || 22641 (-1e4 <= (i = e.dts - i.dts - i.duration) && 22642 i <= 45e3 && 22643 (!t || i < r) && 22644 ((t = s), (r = i))))); 22645 return t ? t.gop : null; 22646 }), 22647 (this.alignGopsAtStart_ = function (e) { 22648 for ( 22649 var t, i, s, r, n = e.byteLength, a = e.nalCount, o = e.duration, l = (t = 0); 22650 l < d.length && t < e.length && ((i = d[l]), (s = e[t]), i.pts !== s.pts); 22651 22652 ) 22653 i.pts < s.pts 22654 ? l++ 22655 : (t++, (n -= s.byteLength), (a -= s.nalCount), (o -= s.duration)); 22656 return 0 === t 22657 ? e 22658 : t === e.length 22659 ? null 22660 : (((r = e.slice(t)).byteLength = n), 22661 (r.duration = o), 22662 (r.nalCount = a), 22663 (r.pts = r[0].pts), 22664 (r.dts = r[0].dts), 22665 r); 22666 }), 22667 (this.alignGopsAtEnd_ = function (e) { 22668 for ( 22669 var t, i, s, r, n = d.length - 1, a = e.length - 1, o = null, l = !1; 22670 0 <= n && 0 <= a; 22671 22672 ) { 22673 if (((t = d[n]), (i = e[a]), t.pts === i.pts)) { 22674 l = !0; 22675 break; 22676 } 22677 i.pts < t.pts ? n-- : (n === d.length - 1 && (o = a), a--); 22678 } 22679 return l || null !== o 22680 ? 0 === (s = l ? a : o) 22681 ? e 22682 : ((r = (s = e.slice(s)).reduce( 22683 function (e, t) { 22684 return ( 22685 (e.byteLength += t.byteLength), 22686 (e.duration += t.duration), 22687 (e.nalCount += t.nalCount), 22688 e 22689 ); 22690 }, 22691 { byteLength: 0, duration: 0, nalCount: 0 } 22692 )), 22693 (s.byteLength = r.byteLength), 22694 (s.duration = r.duration),
22695 (s.nalCount = r.nalCount), 22696 (s.pts = s[0].pts), 22697 (s.dts = s[0].dts), 22698 s) 22699 : null; 22700 }), 22701 (this.alignGopsWith = function (e) { 22702 d = e; 22703 })); 22704 }).prototype = new _t()), 22705 (((kt = function (e, t) { 22706 ((this.numberOfTracks = 0), 22707 (this.metadataStream = t), 22708 'undefined' != typeof (e = e || {}).remux 22709 ? (this.remuxTracks = !!e.remux) 22710 : (this.remuxTracks = !0), 22711 (this.keepOriginalTimestamps = 22712 'boolean' == typeof e.keepOriginalTimestamps && e.keepOriginalTimestamps), 22713 (this.pendingTracks = []), 22714 (this.videoTrack = null), 22715 (this.pendingBoxes = []), 22716 (this.pendingCaptions = []), 22717 (this.pendingMetadata = []), 22718 (this.pendingBytes = 0), 22719 (this.emittedTracks = 0), 22720 kt.prototype.init.call(this), 22721 (this.push = function (e) { 22722 return e.content || e.text 22723 ? this.pendingCaptions.push(e) 22724 : e.frames 22725 ? this.pendingMetadata.push(e) 22726 : (this.pendingTracks.push(e.track), 22727 (this.pendingBytes += e.boxes.byteLength), 22728 'video' === e.track.type && 22729 ((this.videoTrack = e.track), this.pendingBoxes.push(e.boxes)), 22730 void ( 22731 'audio' === e.track.type && 22732 ((this.audioTrack = e.track), this.pendingBoxes.unshift(e.boxes)) 22733 )); 22734 })); 22735 }).prototype = new _t()).flush = function (e) { 22736 var t, 22737 i, 22738 s, 22739 r = 0, 22740 n = { captions: [], captionStreams: {}, metadata: [], info: {} }, 22741 a = 0; 22742 if (this.pendingTracks.length < this.numberOfTracks) { 22743 if ('VideoSegmentStream' !== e && 'AudioSegmentStream' !== e) return; 22744 if (this.remuxTracks) return; 22745 if (0 === this.pendingTracks.length) 22746 return ( 22747 this.emittedTracks++, 22748 void ( 22749 this.emittedTracks >= this.numberOfTracks && 22750 (this.trigger('done'), (this.emittedTracks = 0)) 22751 ) 22752 ); 22753 } 22754 if ( 22755 (this.videoTrack 22756 ? ((a = this.videoTrack.timelineStartInfo.pts), 22757 Ut.forEach(function (e) { 22758 n.info[e] = this.videoTrack[e]; 22759 }, this)) 22760 : this.audioTrack && 22761 ((a = this.audioTrack.timelineStartInfo.pts), 22762 Mt.forEach(function (e) { 22763 n.info[e] = this.audioTrack[e]; 22764 }, this)), 22765 this.videoTrack || this.audioTrack) 22766 ) { 22767 for ( 22768 1 === this.pendingTracks.length 22769 ? (n.type = this.pendingTracks[0].type) 22770 : (n.type = 'combined'), 22771 this.emittedTracks += this.pendingTracks.length, 22772 e = It.initSegment(this.pendingTracks), 22773 n.initSegment = new Uint8Array(e.byteLength), 22774 n.initSegment.set(e), 22775 n.data = new Uint8Array(this.pendingBytes), 22776 s = 0; 22777 s < this.pendingBoxes.length; 22778 s++ 22779 ) 22780 (n.data.set(this.pendingBoxes[s], r), (r += this.pendingBoxes[s].byteLength)); 22781 for (s = 0; s < this.pendingCaptions.length; s++) 22782 (((t = this.pendingCaptions[s]).startTime = Dt.metadataTsToSeconds( 22783 t.startPts, 22784 a, 22785 this.keepOriginalTimestamps 22786 )), 22787 (t.endTime = Dt.metadataTsToSeconds(t.endPts, a, this.keepOriginalTimestamps)), 22788 (n.captionStreams[t.stream] = !0), 22789 n.captions.push(t)); 22790 for (s = 0; s < this.pendingMetadata.length; s++) 22791 (((i = this.pendingMetadata[s]).cueTime = Dt.metadataTsToSeconds( 22792 i.pts, 22793 a, 22794 this.keepOriginalTimestamps 22795 )), 22796 n.metadata.push(i)); 22797 for ( 22798 n.metadata.dispatchType = this.metadataStream.dispatchType, 22799 this.pendingTracks.length = 0, 22800 this.videoTrack = null, 22801 this.pendingBoxes.length = 0, 22802 this.pendingCaptions.length = 0, 22803 this.pendingBytes = 0, 22804 this.pendingMetadata.length = 0, 22805 this.trigger('data', n), 22806 s = 0; 22807 s < n.captions.length; 22808 s++ 22809 ) 22810 ((t = n.captions[s]), this.trigger('caption', t)); 22811 for (s = 0; s < n.metadata.length; s++) 22812 ((i = n.metadata[s]), this.trigger('id3Frame', i)); 22813 } 22814 this.emittedTracks >= this.numberOfTracks && 22815 (this.trigger('done'), (this.emittedTracks = 0)); 22816 }), 22817 (kt.prototype.setRemux = function (e) { 22818 this.remuxTracks = e; 22819 }), 22820 ((Ct = function (s) { 22821 var r, 22822 n, 22823 a = this, 22824 i = !0; 22825 (Ct.prototype.init.call(this), 22826 (s = s || {}), 22827 (this.baseMediaDecodeTime = s.baseMediaDecodeTime || 0), 22828 (this.transmuxPipeline_ = {}), 22829 (this.setupAacPipeline = function () { 22830 var t = {}; 22831 (((this.transmuxPipeline_ = t).type = 'aac'), 22832 (t.metadataStream = new E.MetadataStream()), 22833 (t.aacStream = new Ot()), 22834 (t.audioTimestampRolloverStream = new E.TimestampRolloverStream('audio')), 22835 (t.timedMetadataTimestampRolloverStream = new E.TimestampRolloverStream( 22836 'timed-metadata' 22837 )), 22838 (t.adtsStream = new Pt()), 22839 (t.coalesceStream = new kt(s, t.metadataStream)), 22840 (t.headOfPipeline = t.aacStream), 22841 t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream), 22842 t.aacStream 22843 .pipe(t.timedMetadataTimestampRolloverStream) 22844 .pipe(t.metadataStream) 22845 .pipe(t.coalesceStream), 22846 t.metadataStream.on('timestamp', function (e) { 22847 t.aacStream.setTimestamp(e.timeStamp); 22848 }), 22849 t.aacStream.on('data', function (e) { 22850 ('timed-metadata' !== e.type && 'audio' !== e.type) || 22851 t.audioSegmentStream || 22852 ((n = n || { 22853 timelineStartInfo: { baseMediaDecodeTime: a.baseMediaDecodeTime }, 22854 codec: 'adts', 22855 type: 'audio' 22856 }), 22857 t.coalesceStream.numberOfTracks++, 22858 (t.audioSegmentStream = new Ft(n, s)),
22859 t.audioSegmentStream.on('log', a.getLogTrigger_('audioSegmentStream')), 22860 t.audioSegmentStream.on('timingInfo', a.trigger.bind(a, 'audioTimingInfo')), 22861 t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream), 22862 a.trigger('trackinfo', { hasAudio: !!n, hasVideo: !!r })); 22863 }), 22864 t.coalesceStream.on('data', this.trigger.bind(this, 'data')), 22865 t.coalesceStream.on('done', this.trigger.bind(this, 'done')), 22866 Tt(this, t)); 22867 }), 22868 (this.setupTsPipeline = function () { 22869 var i = {}; 22870 (((this.transmuxPipeline_ = i).type = 'ts'), 22871 (i.metadataStream = new E.MetadataStream()), 22872 (i.packetStream = new E.TransportPacketStream()), 22873 (i.parseStream = new E.TransportParseStream()), 22874 (i.elementaryStream = new E.ElementaryStream()), 22875 (i.timestampRolloverStream = new E.TimestampRolloverStream()), 22876 (i.adtsStream = new Pt()), 22877 (i.h264Stream = new Lt()), 22878 (i.captionStream = new E.CaptionStream(s)), 22879 (i.coalesceStream = new kt(s, i.metadataStream)), 22880 (i.headOfPipeline = i.packetStream), 22881 i.packetStream 22882 .pipe(i.parseStream) 22883 .pipe(i.elementaryStream) 22884 .pipe(i.timestampRolloverStream), 22885 i.timestampRolloverStream.pipe(i.h264Stream), 22886 i.timestampRolloverStream.pipe(i.adtsStream), 22887 i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream), 22888 i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream), 22889 i.elementaryStream.on('data', function (e) { 22890 var t; 22891 if ('metadata' === e.type) { 22892 for (t = e.tracks.length; t--; ) 22893 r || 'video' !== e.tracks[t].type 22894 ? n || 22895 'audio' !== e.tracks[t].type || 22896 ((n = e.tracks[t]).timelineStartInfo.baseMediaDecodeTime = 22897 a.baseMediaDecodeTime) 22898 : ((r = e.tracks[t]).timelineStartInfo.baseMediaDecodeTime = 22899 a.baseMediaDecodeTime); 22900 (r && 22901 !i.videoSegmentStream && 22902 (i.coalesceStream.numberOfTracks++, 22903 (i.videoSegmentStream = new Et(r, s)), 22904 i.videoSegmentStream.on('log', a.getLogTrigger_('videoSegmentStream')), 22905 i.videoSegmentStream.on('timelineStartInfo', function (e) { 22906 n && 22907 !s.keepOriginalTimestamps && 22908 ((n.timelineStartInfo = e), 22909 i.audioSegmentStream.setEarliestDts(e.dts - a.baseMediaDecodeTime)); 22910 }), 22911 i.videoSegmentStream.on('processedGopsInfo', a.trigger.bind(a, 'gopInfo')), 22912 i.videoSegmentStream.on( 22913 'segmentTimingInfo', 22914 a.trigger.bind(a, 'videoSegmentTimingInfo') 22915 ), 22916 i.videoSegmentStream.on('baseMediaDecodeTime', function (e) { 22917 n && i.audioSegmentStream.setVideoBaseMediaDecodeTime(e); 22918 }), 22919 i.videoSegmentStream.on('timingInfo', a.trigger.bind(a, 'videoTimingInfo')), 22920 i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)), 22921 n && 22922 !i.audioSegmentStream && 22923 (i.coalesceStream.numberOfTracks++, 22924 (i.audioSegmentStream = new Ft(n, s)), 22925 i.audioSegmentStream.on('log', a.getLogTrigger_('audioSegmentStream')), 22926 i.audioSegmentStream.on( 22927 'timingInfo', 22928 a.trigger.bind(a, 'audioTimingInfo') 22929 ), 22930 i.audioSegmentStream.on( 22931 'segmentTimingInfo', 22932 a.trigger.bind(a, 'audioSegmentTimingInfo') 22933 ), 22934 i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)), 22935 a.trigger('trackinfo', { hasAudio: !!n, hasVideo: !!r })); 22936 } 22937 }), 22938 i.coalesceStream.on('data', this.trigger.bind(this, 'data')), 22939 i.coalesceStream.on('id3Frame', function (e) { 22940 ((e.dispatchType = i.metadataStream.dispatchType), a.trigger('id3Frame', e)); 22941 }), 22942 i.coalesceStream.on('caption', this.trigger.bind(this, 'caption')), 22943 i.coalesceStream.on('done', this.trigger.bind(this, 'done')), 22944 Tt(this, i)); 22945 }), 22946 (this.setBaseMediaDecodeTime = function (e) { 22947 var t = this.transmuxPipeline_; 22948 (s.keepOriginalTimestamps || (this.baseMediaDecodeTime = e), 22949 n && 22950 ((n.timelineStartInfo.dts = void 0), 22951 (n.timelineStartInfo.pts = void 0), 22952 w.clearDtsInfo(n), 22953 t.audioTimestampRolloverStream) && 22954 t.audioTimestampRolloverStream.discontinuity(), 22955 r && 22956 (t.videoSegmentStream && (t.videoSegmentStream.gopCache_ = []), 22957 (r.timelineStartInfo.dts = void 0), 22958 (r.timelineStartInfo.pts = void 0), 22959 w.clearDtsInfo(r), 22960 t.captionStream.reset()), 22961 t.timestampRolloverStream && t.timestampRolloverStream.discontinuity()); 22962 }), 22963 (this.setAudioAppendStart = function (e) { 22964 n && this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e); 22965 }), 22966 (this.setRemux = function (e) { 22967 var t = this.transmuxPipeline_; 22968 ((s.remux = e), t && t.coalesceStream && t.coalesceStream.setRemux(e)); 22969 }), 22970 (this.alignGopsWith = function (e) { 22971 r && 22972 this.transmuxPipeline_.videoSegmentStream && 22973 this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e); 22974 }), 22975 (this.getLogTrigger_ = function (t) { 22976 var i = this; 22977 return function (e) { 22978 ((e.stream = t), i.trigger('log', e)); 22979 }; 22980 }), 22981 (this.push = function (e) { 22982 var t; 22983 (i && 22984 ((t = Rt(e)) && 'aac' !== this.transmuxPipeline_.type 22985 ? this.setupAacPipeline() 22986 : t || 'ts' === this.transmuxPipeline_.type || this.setupTsPipeline(), 22987 (i = !1)), 22988 this.transmuxPipeline_.headOfPipeline.push(e)); 22989 }), 22990 (this.flush = function () { 22991 ((i = !0), this.transmuxPipeline_.headOfPipeline.flush()); 22992 }), 22993 (this.endTimeline = function () { 22994 this.transmuxPipeline_.headOfPipeline.endTimeline(); 22995 }), 22996 (this.reset = function () { 22997 this.transmuxPipeline_.headOfPipeline && 22998 this.transmuxPipeline_.headOfPipeline.reset(); 22999 }), 23000 (this.resetCaptions = function () { 23001 this.transmuxPipeline_.captionStream && 23002 this.transmuxPipeline_.captionStream.reset(); 23003 })); 23004 }).prototype = new _t())); 23005 function qt(e) { 23006 var t = ''; 23007 return ( 23008 (t += String.fromCharCode(e[0])) + 23009 String.fromCharCode(e[1]) + 23010 String.fromCharCode(e[2]) + 23011 String.fromCharCode(e[3]) 23012 ); 23013 } 23014 function jt(e, t) { 23015 var i, 23016 s, 23017 r, 23018 n = []; 23019 if (!t.length) return null; 23020 for (i = 0; i < e.byteLength; ) 23021 ((s = Wt((e[i] << 24) | (e[i + 1] << 16) | (e[i + 2] << 8) | e[i + 3])), 23022 (r = Gt(e.subarray(i + 4, i + 8))), 23023 (s = 1 < s ? i + s : e.byteLength), 23024 r === t[0] && 23025 (1 === t.length 23026 ? n.push(e.subarray(i + 8, s)) 23027 : (r = jt(e.subarray(i + 8, s), t.slice(1))).length && (n = n.concat(r))), 23028 (i = s)); 23029 return n; 23030 } 23031 function Vt(e) { 23032 var t = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)) }; 23033 return ( 23034 (t.baseMediaDecodeTime = 23035 1 === t.version 23036 ? Kt(e.subarray(4)) 23037 : Xt((e[4] << 24) | (e[5] << 16) | (e[6] << 8) | e[7]
23037)), 23038 t 23039 ); 23040 } 23041 function Ht(e) { 23042 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23043 i = 23044 1 & 23045 (e = { 23046 version: e[0], 23047 flags: new Uint8Array(e.subarray(1, 4)), 23048 trackId: t.getUint32(4) 23049 }).flags[2], 23050 s = 2 & e.flags[2], 23051 r = 8 & e.flags[2], 23052 n = 16 & e.flags[2], 23053 a = 32 & e.flags[2], 23054 o = 65536 & e.flags[0], 23055 l = 131072 & e.flags[0], 23056 d = 8; 23057 return ( 23058 i && ((d += 4), (e.baseDataOffset = t.getUint32(12)), (d += 4)), 23059 s && ((e.sampleDescriptionIndex = t.getUint32(d)), (d += 4)), 23060 r && ((e.defaultSampleDuration = t.getUint32(d)), (d += 4)), 23061 n && ((e.defaultSampleSize = t.getUint32(d)), (d += 4)), 23062 a && (e.defaultSampleFlags = t.getUint32(d)), 23063 o && (e.durationIsEmpty = !0), 23064 !i && l && (e.baseDataOffsetIsMoof = !0), 23065 e 23066 ); 23067 } 23068 function zt(e) { 23069 var t, 23070 i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), samples: [] }, 23071 s = new DataView(e.buffer, e.byteOffset, e.byteLength), 23072 r = 1 & i.flags[2], 23073 n = 4 & i.flags[2], 23074 a = 1 & i.flags[1], 23075 o = 2 & i.flags[1], 23076 l = 4 & i.flags[1], 23077 d = 8 & i.flags[1], 23078 h = s.getUint32(4), 23079 u = 8; 23080 for ( 23081 r && ((i.dataOffset = s.getInt32(u)), (u += 4)), 23082 n && 23083 h && 23084 ((t = { flags: Qt(e.subarray(u, u + 4)) }), 23085 (u += 4), 23086 a && ((t.duration = s.getUint32(u)), (u += 4)), 23087 o && ((t.size = s.getUint32(u)), (u += 4)), 23088 d && 23089 ((t.compositionTimeOffset = 1 === i.version ? s.getInt32(u) : s.getUint32(u)), 23090 (u += 4)), 23091 i.samples.push(t), 23092 h--); 23093 h--; 23094 23095 ) 23096 ((t = {}), 23097 a && ((t.duration = s.getUint32(u)), (u += 4)), 23098 o && ((t.size = s.getUint32(u)), (u += 4)), 23099 l && ((t.flags = Qt(e.subarray(u, u + 4))), (u += 4)), 23100 d && 23101 ((t.compositionTimeOffset = 1 === i.version ? s.getInt32(u) : s.getUint32(u)), 23102 (u += 4)), 23103 i.samples.push(t)); 23104 return i; 23105 } 23106 function C(e) { 23107 return new Date(1e3 * e - 20828448e5); 23108 } 23109 var $t = Ct, 23110 t = function (e) { 23111 return e >>> 0; 23112 }, 23113 Pe = function (e) { 23114 return ('00' + e.toString(16)).slice(-2); 23115 }, 23116 Wt = t, 23117 Gt = qt, 23118 Xt = t, 23119 Kt = i.getUint64, 23120 Yt = i.getUint64, 23121 Qt = function (e) { 23122 return { 23123 isLeading: (12 & e[0]) >>> 2, 23124 dependsOn: 3 & e[0], 23125 isDependedOn: (192 & e[1]) >>> 6, 23126 hasRedundancy: (48 & e[1]) >>> 4, 23127 paddingValue: (14 & e[1]) >>> 1, 23128 isNonSyncSample: 1 & e[1], 23129 degradationPriority: (e[2] << 8) | e[3] 23130 }; 23131 }, 23132 Jt = i.getUint64, 23133 Zt = qt, 23134 k = { 23135 avc1: function (e) { 23136 var t = new DataView(e.buffer, e.byteOffset, e.byteLength); 23137 return { 23138 dataReferenceIndex: t.getUint16(6), 23139 width: t.getUint16(24), 23140 height: t.getUint16(26), 23141 horizresolution: t.getUint16(28) + t.getUint16(30) / 16, 23142 vertresolution: t.getUint16(32) + t.getUint16(34) / 16, 23143 frameCount: t.getUint16(40), 23144 depth: t.getUint16(74), 23145 config: I(e.subarray(78, e.byteLength)) 23146 }; 23147 }, 23148 avcC: function (e) { 23149 for ( 23150 var t, 23151 i, 23152 s = new DataView(e.buffer, e.byteOffset, e.byteLength), 23153 r = { 23154 configurationVersion: e[0], 23155 avcProfileIndication: e[1], 23156 profileCompatibility: e[2], 23157 avcLevelIndication: e[3], 23158 lengthSizeMinusOne: 3 & e[4], 23159 sps: [], 23160 pps: [] 23161 }, 23162 n = 31 & e[5], 23163 a = 6, 23164 o = 0; 23165 o < n; 23166 o++ 23167 ) 23168 ((i = s.getUint16(a)), 23169 (a += 2), 23170 r.sps.push(new Uint8Array(e.subarray(a, a + i))), 23171 (a += i)); 23172 for (t = e[a], a++, o = 0; o < t; o++) 23173 ((i = s.getUint16(a)), 23174 (a += 2), 23175 r.pps.push(new Uint8Array(e.subarray(a, a + i))), 23176 (a += i)); 23177 return r; 23178 }, 23179 btrt: function (e) { 23180 e = new DataView(e.buffer, e.byteOffset, e.byteLength); 23181 return { 23182 bufferSizeDB: e.getUint32(0), 23183 maxBitrate: e.getUint32(4), 23184 avgBitrate: e.getUint32(8) 23185 }; 23186 }, 23187 edts: function (e) { 23188 return { boxes: I(e) }; 23189 }, 23190 elst: function (e) { 23191 for ( 23192 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23193 i = { 23194 version: t.getUint8(0), 23195 flags: new Uint8Array(e.subarray(1, 4)), 23196 edits: [] 23197 }, 23198 s = t.getUint32(4), 23199 r = 8; 23200 s; 23201 s-- 23202 ) 23203 0 === i.version 23204 ? (i.edits.push({ 23205 segmentDuration: t.getUint32(r), 23206 mediaTime: t.getInt32(r + 4), 23207 mediaRate: t.getUint16(r + 8) + t.getUint16(r + 10) / 65536 23208 }), 23209 (r += 12)) 23210 : (i.edits.push({ 23211 segmentDuration: Jt(e.subarray(r)), 23212 mediaTime: Jt(e.subarray(r + 8)), 23213 mediaRate: t.getUint16(r + 16) + t.getUint16(r + 18) / 65536 23214 }), 23215 (r += 20)); 23216 return i; 23217 }, 23218 esds: function (e) { 23219 return { 23220 version: e[0], 23221 flags: new Uint8Array(e.subarray(1, 4)), 23222 esId: (e[6] << 8) | e[7], 23223 streamPriority: 31 & e[8], 23224 decoderConfig: { 23225 objectProfileIndication: e[11], 23226 streamType: (e[12] >>> 2) & 63, 23227 bufferSize: (e[13] << 16) | (e[14] << 8) | e[15], 23228 maxBitrate: (e[16] << 24) | (e[17] << 16) | (e[18] << 8) | e[19], 23229 avgBitrate: (e[20] << 24) | (e[21] << 16) | (e[22] << 8) | e[23], 23230 decoderConfigDescriptor: { 23231 tag: e[24], 23232 length: e[25], 23233 audioObjectType: (e[26] >>> 3) & 31, 23234 samplingFrequencyIndex: ((7 & e[26]) << 1) | ((e[27] >>> 7) & 1), 23235 channelConfiguration: (e[27] >>> 3) & 15 23236 } 23237 } 23238 }; 23239 }, 23240 ftyp: function (e) { 23241 for ( 23242 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23243 i = { 23244 majorBrand: Zt(e.subarray(0, 4)), 23245 minorVersion: t.getUint32(4), 23246 compatibleBrands: [] 23247 }, 23248 s = 8; 23249 s < e.byteLength; 23250 23251 ) 23252 (i.compatibleBrands.push(Zt(e.subarray(s, s + 4))), (s += 4)); 23253 return i; 23254 }, 23255 dinf: function (e) { 23256 return { boxes: I(e) }; 23257 }, 23258 dref: function (e) { 23259 return { 23260 version: e[0], 23261 flags: new Uint8Array(e.subarray(1, 4)), 23262 dataReferences: I(e.subarray(8)) 23263 }; 23264 }, 23265 hdlr: function (e) { 23266 for ( 23267 var t = { 23268 version: new DataView(e.buffer, e.byteOffset, e.byteLength).getUint8(0), 23269 flags: new Uint8Array(e.subarray(1, 4)), 23270 handlerType: Zt(e.subarray(8, 12)), 23271 name: '' 23272 }, 23273 i = 8, 23274 i = 24; 23275 i < e.byteLength; 23276 i++ 23277 ) { 23278 if (0 === e[i]) { 23279 i++; 23280 break; 23281 } 23282 t.name += String.fromCharCode(e[i]); 23283 } 23284 return ((t.name = decodeURIComponent(escape(t.name))), t); 23285 }, 23286 mdat: function (e) { 23287 return { 23288 byteLength: e.byteLength, 23289 nals: (function (e) { 23290 for ( 23291 var t, i = new DataView(e.buffer, e.byteOffset, e.byteLength), s = [], r = 0; 23292 r + 4 < e.length; 23293 r += t 23294 ) 23295 if (((t = i.getUint32(r)), (r += 4), t <= 0)) 23296 s.push("<span style='color:red;'>MALFORMED DATA</span>"); 23297 else 23298 switch (31 & e[r]) { 23299 case 1: 23300 s.push('slice_layer_without_partitioning_rbsp'); 23301 break; 23302 case 5: 23303 s.push('slice_layer_without_partitioning_rbsp_idr'); 23304 break; 23305 case 6: 23306 s.push('sei_rbsp'); 23307 break; 23308 case 7: 23309 s.push('seq_parameter_set_rbsp'); 23310 break; 23311 case 8: 23312 s.push('pic_parameter_set_rbsp'); 23313 break; 23314 case 9: 23315 s.push('access_unit_delimiter_rbsp'); 23316 break; 23317 default: 23318 s.push(('UNKNOWN NAL - ' + e[r]) & 31); 23319 } 23320 return s; 23321 })(e) 23322 }; 23323 }, 23324 mdhd: function (e) { 23325 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23326 i = 4, 23327 e = { 23328 version: t.getUint8(0), 23329 flags: new Uint8Array(e.subarray(1, 4)), 23330 language: '' 23331 }; 23332 return ( 23333 1 === e.version 23334 ? ((e.creationTime = C(t.getUint32((i += 4)))), 23335 (e.modificationTime = C(t.getUint32((i += 8)))), 23336 (e.timescale = t.getUint32((i += 4))), 23337 (e.duration = t.getUint32((i += 8)))) 23338 : ((e.creationTime = C(t.getUint32(i))), 23339 (e.modificationTime = C(t.getUint32((i += 4)))), 23340 (e.timescale = t.getUint32((i += 4))), 23341 (e.duration = t.getUint32((i += 4)))), 23342 (t = t.getUint16((i += 4))), 23343 (e.language += String.fromCharCode(96 + (t >> 10))), 23344 (e.language += String.fromCharCode(96 + ((992 & t) >> 5))), 23345 (e.language += String.fromCharCode(96 + (31 & t))), 23346 e 23347 ); 23348 }, 23349 mdia: function (e) { 23350 return { boxes: I(e) }; 23351 }, 23352 mfhd: function (e) { 23353 return { 23354 version: e[0], 23355 flags: new Uint8Array(e.subarray(1, 4)), 23356 sequenceNumber: (e[4] << 24) | (e[5] << 16) | (e[6] << 8) | e[7] 23357 }; 23358 }, 23359 minf: function (e) { 23360 return { boxes: I(e) }; 23361 }, 23362 mp4a: function (e) { 23363 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23364 t = { 23365 dataReferenceIndex: t.getUint16(6), 23366 channelcount: t.getUint16(16), 23367 samplesize: t.getUint16(18), 23368 samplerate: t.getUint16(24) + t.getUint16(26) / 65536 23369 }; 23370 return (28 < e.byteLength && (t.streamDescriptor = I(e.subarray(28))[0]), t); 23371 }, 23372 moof: function (e) { 23373 return { boxes: I(e) }; 23374 }, 23375 moov: function (e) { 23376 return { boxes: I(e) }; 23377 }, 23378 mvex: function (e) { 23379 return { boxes: I(e) }; 23380 }, 23381 mvhd: function (e) { 23382 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23383 i = 4, 23384 s = { version: t.getUint8(0), flags: new Uint8Array(e.subarray(1, 4)) }; 23385 return ( 23386 1 === s.version 23387 ? ((s.creationTime = C(t.getUint32((i += 4)))), 23388 (s.modificationTime = C(t.getUint32((i += 8)))), 23389 (s.timescale = t.getUint32((i += 4))), 23390 (s.duration = t.getUint32((i += 8)))) 23391 : ((s.creationTime = C(t.getUint32(i))), 23392 (s.modificationTime = C(t.getUint32((i += 4)))), 23393 (s.timescale = t.getUint32((i += 4))), 23394 (s.duration = t.getUint32((i += 4)))), 23395 (s.rate = t.getUint16((i += 4)) + t.getUint16(i + 2) / 16), 23396 (s.volume = t.getUint8((i += 4)) + t.getUint8(i + 1) / 8), 23397 (i = (i += 2) + 2 + 8), 23398 (s.matrix = new Uint32Array(e.subarray(i, i + 36))), 23399 (s.nextTrackId = t.getUint32((i = i + 36 + 24))), 23400 s 23401 ); 23402 }, 23403 pdin: function (e) { 23404 var t = new DataView(e.buffer, e.byteOffset, e.byteLength); 23405 return { 23406 version: t.getUint8(0), 23407 flags: new Uint8Array(e.subarray(1, 4)), 23408 rate: t.getUint32(4), 23409 initialDelay: t.getUint32(8) 23410 }; 23411 }, 23412 sdtp: function (e) { 23413 for ( 23414 var t = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), samples: [] }, 23415 i = 4; 23416 i < e.byteLength; 23417 i++ 23418 ) 23419 t.samples.push({ 23420 dependsOn: (48 & e[i]) >> 4, 23421 isDependedOn: (12 & e[i]) >> 2, 23422 hasRedundancy: 3 & e[i] 23423 }); 23424 return t; 23425 }, 23426 sidx: function (e) { 23427 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23428 i = { 23429 version: e[0], 23430 flags: new Uint8Array(e.subarray(1, 4)), 23431 references: [], 23432 referenceId: t.getUint32(4), 23433 timescale: t.getUint32(8) 23434 }, 23435 s = 12, 23436 r = 23437 (0 === i.version 23438 ? ((i.earliestPresentationTime = t.getUint32(s)), 23439 (i.firstOffset = t.getUint32(s + 4)), 23440 (s += 8)) 23441 : ((i.earliestPresentationTime = Yt(e.subarray(s))), 23442 (i.firstOffset = Yt(e.subarray(s + 8))), 23443 (s += 16)), 23444 t.getUint16((s += 2))); 23445 for (s += 2; 0 < r; s += 12, r--) 23446 i.references.push({ 23447 referenceType: (128 & e[s]) >>> 7, 23448 referencedSize: 2147483647 & t.getUint32(s), 23449 subsegmentDuration: t.getUint32(s + 4), 23450 startsWithSap: !!(128 & e[s + 8]), 23451 sapType: (112 & e[s + 8]) >>> 4, 23452 sapDeltaTime: 268435455 & t.getUint32(s + 8) 23453 }); 23454 return i; 23455 }, 23456 smhd: function (e) { 23457 return { 23458 version: e[0], 23459 flags: new Uint8Array(e.subarray(1, 4)), 23460 balance: e[4] + e[5] / 256 23461 }; 23462 }, 23463 stbl: function (e) { 23464 return { boxes: I(e) }; 23465
23465 }, 23466 ctts: function (e) { 23467 for ( 23468 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23469 i = { 23470 version: t.getUint8(0), 23471 flags: new Uint8Array(e.subarray(1, 4)), 23472 compositionOffsets: [] 23473 }, 23474 s = t.getUint32(4), 23475 r = 8; 23476 s; 23477 r += 8, s-- 23478 ) 23479 i.compositionOffsets.push({ 23480 sampleCount: t.getUint32(r), 23481 sampleOffset: t[0 === i.version ? 'getUint32' : 'getInt32'](r + 4) 23482 }); 23483 return i; 23484 }, 23485 stss: function (e) { 23486 for ( 23487 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23488 i = { 23489 version: t.getUint8(0), 23490 flags: new Uint8Array(e.subarray(1, 4)), 23491 syncSamples: [] 23492 }, 23493 s = t.getUint32(4), 23494 r = 8; 23495 s; 23496 r += 4, s-- 23497 ) 23498 i.syncSamples.push(t.getUint32(r)); 23499 return i; 23500 }, 23501 stco: function (e) { 23502 for ( 23503 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23504 i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), chunkOffsets: [] }, 23505 s = t.getUint32(4), 23506 r = 8; 23507 s; 23508 r += 4, s-- 23509 ) 23510 i.chunkOffsets.push(t.getUint32(r)); 23511 return i; 23512 }, 23513 stsc: function (e) { 23514 for ( 23515 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23516 i = t.getUint32(4), 23517 s = { 23518 version: e[0], 23519 flags: new Uint8Array(e.subarray(1, 4)), 23520 sampleToChunks: [] 23521 }, 23522 r = 8; 23523 i; 23524 r += 12, i-- 23525 ) 23526 s.sampleToChunks.push({ 23527 firstChunk: t.getUint32(r), 23528 samplesPerChunk: t.getUint32(r + 4), 23529 sampleDescriptionIndex: t.getUint32(r + 8) 23530 }); 23531 return s; 23532 }, 23533 stsd: function (e) { 23534 return { 23535 version: e[0], 23536 flags: new Uint8Array(e.subarray(1, 4)), 23537 sampleDescriptions: I(e.subarray(8)) 23538 }; 23539 }, 23540 stsz: function (e) { 23541 for ( 23542 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23543 i = { 23544 version: e[0], 23545 flags: new Uint8Array(e.subarray(1, 4)), 23546 sampleSize: t.getUint32(4), 23547 entries: [] 23548 }, 23549 s = 12; 23550 s < e.byteLength; 23551 s += 4 23552 ) 23553 i.entries.push(t.getUint32(s)); 23554 return i; 23555 }, 23556 stts: function (e) { 23557 for ( 23558 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23559 i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), timeToSamples: [] }, 23560 s = t.getUint32(4), 23561 r = 8; 23562 s; 23563 r += 8, s-- 23564 ) 23565 i.timeToSamples.push({ 23566 sampleCount: t.getUint32(r), 23567 sampleDelta: t.getUint32(r + 4) 23568 }); 23569 return i; 23570 }, 23571 styp: function (e) { 23572 return k.ftyp(e); 23573 }, 23574 tfdt: Vt, 23575 tfhd: Ht, 23576 tkhd: function (e) { 23577 var t = new DataView(e.buffer, e.byteOffset, e.byteLength), 23578 i = 4, 23579 s = { version: t.getUint8(0), flags: new Uint8Array(e.subarray(1, 4)) }; 23580 return ( 23581 1 === s.version 23582 ? ((s.creationTime = C(t.getUint32((i += 4)))), 23583 (s.modificationTime = C(t.getUint32((i += 8)))), 23584 (s.trackId = t.getUint32((i += 4))), 23585 (s.duration = t.getUint32((i = i + 4 + 8)))) 23586 : ((s.creationTime = C(t.getUint32(i))), 23587 (s.modificationTime = C(t.getUint32((i += 4)))), 23588 (s.trackId = t.getUint32((i += 4))),
23589 (s.duration = t.getUint32((i = i + 4 + 4)))), 23590 (s.layer = t.getUint16((i = i + 4 + 8))), 23591 (s.alternateGroup = t.getUint16((i += 2))), 23592 (s.volume = t.getUint8((i += 2)) + t.getUint8(i + 1) / 8), 23593 (i = i + 2 + 2), 23594 (s.matrix = new Uint32Array(e.subarray(i, i + 36))), 23595 (s.width = t.getUint16((i += 36)) + t.getUint16(i + 2) / 65536), 23596 (s.height = t.getUint16((i += 4)) + t.getUint16(i + 2) / 65536), 23597 s 23598 ); 23599 }, 23600 traf: function (e) { 23601 return { boxes: I(e) }; 23602 }, 23603 trak: function (e) { 23604 return { boxes: I(e) }; 23605 }, 23606 trex: function (e) { 23607 var t = new DataView(e.buffer, e.byteOffset, e.byteLength); 23608 return { 23609 version: e[0], 23610 flags: new Uint8Array(e.subarray(1, 4)), 23611 trackId: t.getUint32(4), 23612 defaultSampleDescriptionIndex: t.getUint32(8), 23613 defaultSampleDuration: t.getUint32(12), 23614 defaultSampleSize: t.getUint32(16), 23615 sampleDependsOn: 3 & e[20], 23616 sampleIsDependedOn: (192 & e[21]) >> 6, 23617 sampleHasRedundancy: (48 & e[21]) >> 4, 23618 samplePaddingValue: (14 & e[21]) >> 1, 23619 sampleIsDifferenceSample: !!(1 & e[21]), 23620 sampleDegradationPriority: t.getUint16(22) 23621 }; 23622 }, 23623 trun: zt, 23624 'url ': function (e) { 23625 return { version: e[0], flags: new Uint8Array(e.subarray(1, 4)) }; 23626 }, 23627 vmhd: function (e) { 23628 var t = new DataView(e.buffer, e.byteOffset, e.byteLength); 23629 return { 23630 version: e[0], 23631 flags: new Uint8Array(e.subarray(1, 4)), 23632 graphicsmode: t.getUint16(4), 23633 opcolor: new Uint16Array([t.getUint16(6), t.getUint16(8), t.getUint16(10)]) 23634 }; 23635 } 23636 }, 23637 I = function (e) { 23638 for ( 23639 var t, 23640 i, 23641 s, 23642 r, 23643 n, 23644 a = 0, 23645 o = [], 23646 l = new ArrayBuffer(e.length), 23647 d = new Uint8Array(l), 23648 h = 0; 23649 h < e.length; 23650 ++h 23651 ) 23652 d[h] = e[h]; 23653 for (t = new DataView(l); a < e.byteLength; ) 23654 ((i = t.getUint32(a)), 23655 (s = Zt(e.subarray(a + 4, a + 8))), 23656 (r = 1 < i ? a + i : e.byteLength), 23657 ((n = ( 23658 k[s] || 23659 function (e) { 23660 return { data: e }; 23661 } 23662 )(e.subarray(a + 8, r))).size = i), 23663 (n.type = s), 23664 o.push(n), 23665 (a = r)); 23666 return o; 23667 }, 23668 ei = function (e, t) { 23669 var r; 23670 return ( 23671 (t = t || 0), 23672 (r = new Array(2 * t + 1).join(' ')), 23673 e 23674 .map(function (s, e) { 23675 return ( 23676 r + 23677 s.type + 23678 '\n' + 23679 Object.keys(s) 23680 .filter(function (e) { 23681 return 'type' !== e && 'boxes' !== e; 23682 }) 23683 .map(function (e) { 23684 var t, 23685 i = r + ' ' + e + ': ', 23686 e = s[e]; 23687 return e instanceof Uint8Array || e instanceof Uint32Array 23688 ? (t = Array.prototype.slice 23689 .call(new Uint8Array(e.buffer, e.byteOffset, e.byteLength)) 23690 .map(function (e) { 23691 return ' ' + ('00' + e.toString(16)).slice(-2); 23692 }) 23693 .join('') 23694 .match(/.{1,24}/g)) 23695 ? 1 === t.length 23696 ? i + '<' + t.join('').slice(1) + '>' 23697 : i + 23698 '<\n' + 23699 t 23700 .map(function (e) { 23701 return r + ' ' + e; 23702 }) 23703 .join('\n') + 23704 '\n' + 23705 r + 23706 ' >' 23707 : i + '<>' 23708 : i + 23709 JSON.stringify(e, null, 2) 23710 .split('\n') 23711 .map(function (e, t) { 23712 return 0 === t ? e : r + ' ' + e; 23713 }) 23714 .join('\n'); 23715 }) 23716 .join('\n') + 23717 (s.boxes ? '\n' + ei(s.boxes, t + 1) : '') 23718 ); 23719 }) 23720 .join('\n') 23721 ); 23722 }, 23723 Le = { 23724 inspect: I, 23725 textify: ei, 23726 parseType: Zt, 23727 findBox: jt, 23728 parseTraf: k.traf, 23729 parseTfdt: k.tfdt, 23730 parseHdlr: k.hdlr, 23731 parseTfhd: k.tfhd, 23732 parseTrun: k.trun, 23733 parseSidx: k.sidx 23734 }, 23735 ti = function (e) { 23736 for (var t = 0, i = String.fromCharCode(e[t]), s = ''; '\0' !== i; ) 23737 ((s += i), t++, (i = String.fromCharCode(e[t]))); 23738 return (s += i); 23739 }, 23740 ii = i.getUint64, 23741 si = function (e) { 23742 return void 0 !== e || null !== e; 23743 }, 23744 st = 23745 'undefined' != typeof window 23746 ? window 23747 : 'undefined' != typeof ye 23748 ? ye 23749 : 'undefined' != typeof self 23750 ? self 23751 : {}, 23752 T = st, 23753 ri = t, 23754 ni = Pe, 23755 x = jt, 23756 A = qt, 23757 ai = { 23758 parseEmsgBox: function (e) { 23759 var t, 23760 i, 23761 s, 23762 r, 23763 n, 23764 a, 23765 o, 23766 l = 4, 23767 d = e[0], 23768 h = 23769 (0 === d 23770 ? ((l = (l += (r = ti(e.subarray(l))).length) + (n = ti(e.subarray(l))).length), 23771 (s = (h = new DataView(e.buffer)).getUint32(l)), 23772 (o = h.getUint32((l += 4))), 23773 (t = h.getUint32((l += 4))), 23774 (i = h.getUint32((l += 4))), 23775 (l += 4)) 23776 : 1 === d && 23777 ((s = (h = new DataView(e.buffer)).getUint32(l)), 23778 (a = ii(e.subarray((l += 4)))), 23779 (t = h.getUint32((l += 8))), 23780 (i = h.getUint32((l += 4))), 23781 (l = 23782 (l = (l += 4) + (r = ti(e.subarray(l))).length) + 23783 (n = ti(e.subarray(l))).length)), 23784 { 23785 scheme_id_uri: r, 23786 value: n, 23787 timescale: s || 1, 23788 presentation_time: a, 23789 presentation_time_delta: o, 23790 event_duration: t, 23791 id: i, 23792 message_data: new Uint8Array(e.subarray(l, e.byteLength)) 23793 }); 23794 return ( 23795 (n = '\0' !== (r = h).scheme_id_uri), 23796 (a = 0 === (s = d) && si(r.presentation_time_delta) && n), 23797 (o = 1 === s && si(r.presentation_time) && n), 23798 (!(1 < s) && a) || o ? h : void 0 23799 ); 23800 }, 23801 scaleTime: function (e, t, i, s) { 23802 return e || 0 === e ? e / t : s + i / t; 23803 } 23804 }, 23805 oi = Ht, 23806 li = zt, 23807 di = Vt, 23808 hi = i.getUint64, 23809 ui = T, 23810 ci = et.parseId3Frames, 23811 pi = function (e) { 23812 var t = 0 === e[0] ? 12 : 20; 23813 return ri((e[t] << 24) | (e[1 + t] << 16) | (e[2 + t] << 8) | e[3 + t]); 23814 }, 23815 mi = { 23816 findBox: x, 23817 parseType: A, 23818 timescale: function (e) { 23819 return x(e, ['moov', 'trak']).reduce(function (e, t) { 23820 var i, 23821 s, 23822 r = x(t, ['tkhd'])[0]; 23823 return r && 23824 ((i = r[0]), 23825 (r = ri( 23826 (r[(s = 0 === i ? 12 : 20)] << 24) |
23827 (r[1 + s] << 16) | 23828 (r[2 + s] << 8) | 23829 r[3 + s] 23830 )), 23831 (t = x(t, ['mdia', 'mdhd'])[0])) 23832 ? ((i = t[0]), 23833 (e[r] = ri( 23834 (t[(s = 0 === i ? 12 : 20)] << 24) | 23835 (t[1 + s] << 16) | 23836 (t[2 + s] << 8) | 23837 t[3 + s] 23838 )), 23839 e) 23840 : null; 23841 }, {}); 23842 }, 23843 startTime: function (n, e) { 23844 e = x(e, ['moof', 'traf']).reduce(function (e, t) { 23845 var i = x(t, ['tfhd'])[0], 23846 i = ri((i[4] << 24) | (i[5] << 16) | (i[6] << 8) | i[7]), 23847 i = n[i] || 9e4, 23848 t = x(t, ['tfdt'])[0], 23849 s = new DataView(t.buffer, t.byteOffset, t.byteLength), 23850 t = 1 === t[0] ? hi(t.subarray(4, 12)) : s.getUint32(4); 23851 let r; 23852 return ( 23853 'bigint' == typeof t 23854 ? (r = t / ui.BigInt(i)) 23855 : 'number' != typeof t || isNaN(t) || (r = t / i), 23856 (e = (r = r < Number.MAX_SAFE_INTEGER ? Number(r) : r) < e ? r : e) 23857 ); 23858 }, 1 / 0); 23859 return 'bigint' == typeof e || isFinite(e) ? e : 0; 23860 }, 23861 compositionStartTime: function (e, t) { 23862 var i, 23863 s, 23864 t = x(t, ['moof', 'traf']), 23865 r = 0, 23866 n = 0, 23867 t = 23868 (t && 23869 t.length && 23870 ((s = x(t[0], ['tfhd'])[0]), 23871 (a = x(t[0], ['trun'])[0]), 23872 (t = x(t[0], ['tfdt'])[0]), 23873 s && (i = oi(s).trackId), 23874 t && (r = di(t).baseMediaDecodeTime), 23875 a) && 23876 (s = li(a)).samples && 23877 s.samples.length && 23878 (n = s.samples[0].compositionTimeOffset || 0), 23879 e[i] || 9e4), 23880 a = ('bigint' == typeof r && ((n = ui.BigInt(n)), (t = ui.BigInt(t))), (r + n) / t); 23881 return (a = 'bigint' == typeof a && a < Number.MAX_SAFE_INTEGER ? Number(a) : a); 23882 }, 23883 videoTrackIds: function (e) { 23884 var e = x(e, ['moov', 'trak']), 23885 s = []; 23886 return ( 23887 e.forEach(function (e) { 23888 var t = x(e, ['mdia', 'hdlr']), 23889 i = x(e, ['tkhd']); 23890 t.forEach(function (e, t) { 23891 var e = A(e.subarray(8, 12)), 23892 t = i[t]; 23893 'vide' === e && 23894 ((t = 23895 0 === (e = new DataView(t.buffer, t.byteOffset, t.byteLength)).getUint8(0) 23896 ? e.getUint32(12) 23897 : e.getUint32(20)), 23898 s.push(t)); 23899 }); 23900 }), 23901 s 23902 ); 23903 }, 23904 tracks: function (e) { 23905 var e = x(e, ['moov', 'trak']), 23906 n = []; 23907 return ( 23908 e.forEach(function (e) { 23909 var t, 23910 i = {}, 23911 s = x(e, ['tkhd'])[0], 23912 r = 23913 (s && 23914 ((r = (s = new DataView(s.buffer, s.byteOffset, s.byteLength)).getUint8(0)), 23915 (i.id = 0 === r ? s.getUint32(12) : s.getUint32(20))), 23916 x(e, ['mdia', 'hdlr'])[0]), 23917 r = 23918 (r && 23919 ((s = A(r.subarray(8, 12))), 23920 (i.type = 'vide' === s ? 'video' : 'soun' === s ? 'audio' : s)), 23921 x(e, ['mdia', 'minf', 'stbl', 'stsd'])[0]), 23922 s = 23923 (r && 23924 ((s = r.subarray(8)), 23925 (i.codec = A(s.subarray(4, 8))), 23926 (r = x(s, [i.codec])[0])) && 23927 (/^[asm]vc[1-9]$/i.test(i.codec) 23928 ? ((t = r.subarray(78)), 23929 'avcC' === A(t.subarray(4, 8)) && 11 < t.length
23930 ? ((i.codec += '.'), 23931 (i.codec += ni(t[9])), 23932 (i.codec += ni(t[10])), 23933 (i.codec += ni(t[11]))) 23934 : (i.codec = 'avc1.4d400d')) 23935 : /^mp4[a,v]$/i.test(i.codec) 23936 ? ((t = r.subarray(28)), 23937 'esds' === A(t.subarray(4, 8)) && 20 < t.length && 0 !== t[19] 23938 ? ((i.codec += '.' + ni(t[19])), 23939 (i.codec += '.' + ni((t[20] >>> 2) & 63).replace(/^0/, ''))) 23940 : (i.codec = 'mp4a.40.2')) 23941 : (i.codec = i.codec.toLowerCase())), 23942 x(e, ['mdia', 'mdhd'])[0]); 23943 (s && (i.timescale = pi(s)), n.push(i)); 23944 }), 23945 n 23946 ); 23947 }, 23948 getTimescaleFromMediaHeader: pi, 23949 getEmsgID3: function (e, i = 0) { 23950 return x(e, ['emsg']).map((e) => { 23951 var e = ai.parseEmsgBox(new Uint8Array(e)), 23952 t = ci(e.message_data); 23953 return { 23954 cueTime: ai.scaleTime( 23955 e.presentation_time, 23956 e.timescale, 23957 e.presentation_time_delta, 23958 i 23959 ), 23960 duration: ai.scaleTime(e.event_duration, e.timescale), 23961 frames: t 23962 }; 23963 }); 23964 } 23965 }; 23966 let gi = Le.parseTrun, 23967 fi = mi.findBox; 23968 var yi = T, 23969 g = { 23970 getMdatTrafPairs: function (e) { 23971 var i = fi(e, ['moof', 'traf']), 23972 e = fi(e, ['mdat']), 23973 s = []; 23974 return ( 23975 e.forEach(function (e, t) { 23976 t = i[t]; 23977 s.push({ mdat: e, traf: t }); 23978 }), 23979 s 23980 ); 23981 }, 23982 parseSamples: function (e, t, i) { 23983 var s = t, 23984 r = i.defaultSampleDuration || 0, 23985 n = i.defaultSampleSize || 0, 23986 a = i.trackId, 23987 o = []; 23988 return ( 23989 e.forEach(function (e) { 23990 e = gi(e).samples; 23991 (e.forEach(function (e) { 23992 (void 0 === e.duration && (e.duration = r), 23993 void 0 === e.size && (e.size = n), 23994 (e.trackId = a), 23995 (e.dts = s), 23996 void 0 === e.compositionTimeOffset && (e.compositionTimeOffset = 0), 23997 'bigint' == typeof s 23998 ? ((e.pts = s + yi.BigInt(e.compositionTimeOffset)), 23999 (s += yi.BigInt(e.duration))) 24000 : ((e.pts = s + e.compositionTimeOffset), (s += e.duration))); 24001 }), 24002 (o = o.concat(e))); 24003 }), 24004 o 24005 ); 24006 } 24007 }, 24008 _i = Re.discardEmulationPreventionBytes, 24009 vi = c.CaptionStream, 24010 bi = jt, 24011 Ti = Vt, 24012 Si = Ht, 24013 { getMdatTrafPairs: wi, parseSamples: Ei } = g, 24014 Ci = function (e, t) { 24015 for (var i = e, s = 0; s < t.length; s++) { 24016 var r = t[s]; 24017 if (i < r.size) return r; 24018 i -= r.size; 24019 } 24020 return null; 24021 }, 24022 ki = function (e, t, i) { 24023 for ( 24024 var s, 24025 r, 24026 n = new DataView(e.buffer, e.byteOffset, e.byteLength), 24027 a = { logs: [], seiNals: [] }, 24028 o = 0; 24029 o + 4 < e.length; 24030 o += s 24031 ) 24032 if (((s = n.getUint32(o)), (o += 4), !(s <= 0))) 24033 switch (31 & e[o]) { 24034 case 6: 24035 var l = e.subarray(o + 1, o + 1 + s), 24036 d = Ci(o, t), 24037 l = { 24038 nalUnitType: 'sei_rbsp', 24039 size: s, 24040 data: l, 24041 escapedRBSP: _i(l), 24042 trackId: i 24043 }; 24044 if (d) ((l.pts = d.pts), (l.dts = d.dts), (r = d)); 24045 else { 24046 if (!r) { 24047 a.logs.push({ 24048 level: 'warn', 24049 message: 24050 "We've encountered a nal unit without data at " + 24051 o + 24052 ' for trackId ' + 24053 i + 24054 '. See mux.js#223.' 24055 }); 24056 break; 24057 } 24058 ((l.pts = r.pts), (l.dts = r.dts)); 24059 } 24060 a.seiNals.push(l); 24061 } 24062 return a; 24063 }, 24064 Ii = function (e, n) { 24065 var a = {}; 24066 return ( 24067 wi(e).forEach(function (e) { 24068 var t = e.mdat, 24069 e = e.traf, 24070 i = bi(e, ['tfhd']), 24071 i = Si(i[0]), 24072 s = i.trackId, 24073 r = bi(e, ['tfdt']), 24074 r = 0 < r.length ? Ti(r[0]).baseMediaDecodeTime : 0, 24075 e = bi(e, ['trun']); 24076 n === s && 24077 0 < e.length && 24078 ((e = Ei(e, r, i)), 24079 (r = ki(t, e, s)), 24080 a[s] || (a[s] = { seiNals: [], logs: [] }), 24081 (a[s].seiNals = a[s].seiNals.concat(r.seiNals)), 24082 (a[s].logs = a[s].logs.concat(r.logs))); 24083 }), 24084 a 24085 ); 24086 }, 24087 xi = function () { 24088 var t, 24089 a, 24090 o, 24091 l, 24092 d, 24093 i, 24094 s = !1; 24095 ((this.isInitialized = function () { 24096 return s; 24097 }), 24098 (this.init = function (e) { 24099 ((t = new vi()), 24100 (s = !0), 24101 (i = !!e && e.isPartial), 24102 t.on('data', function (e) { 24103 ((e.startTime = e.startPts / l), 24104 (e.endTime = e.endPts / l), 24105 d.captions.push(e),
24106 (d.captionStreams[e.stream] = !0)); 24107 }), 24108 t.on('log', function (e) { 24109 d.logs.push(e); 24110 })); 24111 }), 24112 (this.isNewInit = function (e, t) { 24113 return !( 24114 (e && 0 === e.length) || 24115 (t && 'object' == typeof t && 0 === Object.keys(t).length) || 24116 (o === e[0] && l === t[o]) 24117 ); 24118 }), 24119 (this.parse = function (e, t, i) { 24120 var s, r; 24121 if (!this.isInitialized()) return null; 24122 if (!t || !i) return null; 24123 if (this.isNewInit(t, i)) ((o = t[0]), (l = i[o])); 24124 else if (null === o || !l) return (a.push(e), null); 24125 for (; 0 < a.length; ) { 24126 var n = a.shift(); 24127 this.parse(n, t, i); 24128 } 24129 return ( 24130 (e = e), 24131 (r = l), 24132 (s = 24133 null === (s = o) 24134 ? null 24135 : { seiNals: (e = Ii(e, s)[s] || {}).seiNals, logs: e.logs, timescale: r }) && 24136 s.logs && 24137 (d.logs = d.logs.concat(s.logs)), 24138 null !== s && s.seiNals 24139 ? (this.pushNals(s.seiNals), this.flushStream(), d) 24140 : d.logs.length 24141 ? { logs: d.logs, captions: [], captionStreams: [] } 24142 : null 24143 ); 24144 }), 24145 (this.pushNals = function (e) { 24146 if (!this.isInitialized() || !e || 0 === e.length) return null; 24147 e.forEach(function (e) { 24148 t.push(e); 24149 }); 24150 }), 24151 (this.flushStream = function () { 24152 if (!this.isInitialized()) return null; 24153 i ? t.partialFlush() : t.flush(); 24154 }), 24155 (this.clearParsedCaptions = function () { 24156 ((d.captions = []), (d.captionStreams = {}), (d.logs = [])); 24157 }), 24158 (this.resetCaptionStream = function () { 24159 if (!this.isInitialized()) return null; 24160 t.reset(); 24161 }), 24162 (this.clearAllCaptions = function () { 24163 (this.clearParsedCaptions(), this.resetCaptionStream()); 24164 }), 24165 (this.reset = function () { 24166 ((a = []), 24167 (l = o = null),
24168 d 24169 ? this.clearParsedCaptions() 24170 : (d = { captions: [], captionStreams: {}, logs: [] }), 24171 this.resetCaptionStream()); 24172 }), 24173 this.reset()); 24174 }; 24175 let Ai = Le.parseTfdt, 24176 D = jt, 24177 Di = mi.getTimescaleFromMediaHeader, 24178 { parseSamples: Pi, getMdatTrafPairs: Li } = g; 24179 function Oi(e) { 24180 var t = 31 & e[1]; 24181 return (t << 8) | e[2]; 24182 } 24183 function Ri(e) { 24184 return !!(64 & e[1]); 24185 } 24186 function Ni(e) { 24187 var t = 0; 24188 return (1 < (48 & e[3]) >>> 4 && (t += e[4] + 1), t); 24189 } 24190 function Mi(e) { 24191 switch (e) { 24192 case 5: 24193 return 'slice_layer_without_partitioning_rbsp_idr'; 24194 case 6: 24195 return 'sei_rbsp'; 24196 case 7: 24197 return 'seq_parameter_set_rbsp'; 24198 case 8: 24199 return 'pic_parameter_set_rbsp'; 24200 case 9: 24201 return 'access_unit_delimiter_rbsp'; 24202 default: 24203 return null; 24204 } 24205 } 24206 var Ui = function () { 24207 let d = 9e4; 24208 ((this.init = function (e) { 24209 e = D(e, ['moov', 'trak', 'mdia', 'mdhd'])[0]; 24210 e && (d = Di(e)); 24211 }), 24212 (this.parseSegment = function (e) { 24213 let l = []; 24214 e = Li(e); 24215 let n = 0; 24216 return ( 24217 e.forEach(function (e) { 24218 let i = e.mdat; 24219 var e = e.traf, 24220 s = D(e, ['tfdt'])[0], 24221 r = D(e, ['tfhd'])[0], 24222 e = D(e, ['trun']); 24223 if ((s && ((s = Ai(s)), (n = s.baseMediaDecodeTime)), e.length && r)) { 24224 s = Pi(e, n, r); 24225 let t = 0; 24226 s.forEach(function (a) { 24227 let o = new TextDecoder('utf-8'); 24228 var e = i.slice(t, t + a.size); 24229 (D(e, ['vtte'])[0] ||
24230 D(e, ['vttc']).forEach(function (e) { 24231 var t = D(e, ['payl'])[0], 24232 e = D(e, ['sttg'])[0], 24233 i = a.pts / d, 24234 s = (a.pts + a.duration) / d; 24235 let r, n; 24236 if (t) 24237 try { 24238 r = o.decode(t); 24239 } catch (e) {} 24240 if (e) 24241 try { 24242 n = o.decode(e); 24243 } catch (e) {} 24244 a.duration && 24245 r && 24246 l.push({ cueText: r, start: i, end: s, settings: n }); 24247 }), 24248 (t += a.size)); 24249 }); 24250 } 24251 }), 24252 l 24253 ); 24254 })); 24255 }, 24256 Bi = He, 24257 Fi = He, 24258 P = Ye, 24259 L = {}, 24260 O = 24261 ((L.ts = { 24262 parseType: function (e, t) { 24263 e = Oi(e); 24264 return 0 === e ? 'pat' : e === t ? 'pmt' : t ? 'pes' : null; 24265 }, 24266 parsePat: function (e) { 24267 var t = Ri(e), 24268 i = 4 + Ni(e); 24269 return (t && (i += e[i] + 1), ((31 & e[i + 10]) << 8) | e[i + 11]); 24270 }, 24271 parsePmt: function (e) { 24272 var t = {}, 24273 i = Ri(e), 24274 s = 4 + Ni(e); 24275 if ((i && (s += e[s] + 1), 1 & e[s + 5])) { 24276 for ( 24277 var r = 3 + (((15 & e[s + 1]) << 8) | e[s + 2]) - 4, 24278 n = 12 + (((15 & e[s + 10]) << 8) | e[s + 11]); 24279 n < r; 24280 24281 ) { 24282 var a = s + n; 24283 ((t[((31 & e[a + 1]) << 8) | e[a + 2]] = e[a]), 24284 (n += 5 + (((15 & e[a + 3]) << 8) | e[a + 4]))); 24285 } 24286 return t; 24287 } 24288 }, 24289 parsePayloadUnitStartIndicator: Ri, 24290 parsePesType: function (e, t) { 24291 switch (t[Oi(e)]) { 24292 case Bi.H264_STREAM_TYPE: 24293 return 'video'; 24294 case Bi.ADTS_STREAM_TYPE: 24295 return 'audio'; 24296 case Bi.METADATA_STREAM_TYPE: 24297 return 'timed-metadata'; 24298 default: 24299 return null; 24300 } 24301 }, 24302 parsePesTime: function (e) { 24303 var t, i, s; 24304 return !Ri(e) || (t = 4 + Ni(e)) >= e.byteLength 24305 ? null 24306 : ((i = null), 24307 192 & (s = e[t + 7]) && 24308 (((i = {}).pts = 24309 ((14 & e[t + 9]) << 27) | 24310 ((255 & e[t + 10]) << 20) | 24311 ((254 & e[t + 11]) << 12) | 24312 ((255 & e[t + 12]) << 5) | 24313 ((254 & e[t + 13]) >>> 3)), 24314 (i.pts *= 4), 24315 (i.pts += (6 & e[t + 13]) >>> 1), 24316 (i.dts = i.pts), 24317 64 & s) && 24318 ((i.dts = 24319 ((14 & e[t + 14]) << 27) | 24320 ((255 & e[t + 15]) << 20) | 24321 ((254 & e[t + 16]) << 12) | 24322 ((255 & e[t + 17]) << 5) | 24323 ((254 & e[t + 18]) >>> 3)), 24324 (i.dts *= 4), 24325 (i.dts += (6 & e[t + 18]) >>> 1)), 24326 i); 24327 }, 24328 videoPacketContainsKeyFrame: function (e) { 24329 for ( 24330 var t = 4 + Ni(e), i = e.subarray(t), s = 0, r = 0, n = !1; 24331 r < i.byteLength - 3; 24332 r++ 24333 ) 24334 if (1 === i[r + 2]) { 24335 s = r + 5; 24336 break; 24337 } 24338 for (; s < i.byteLength; ) 24339 switch (i[s]) { 24340 case 0: 24341 if (0 !== i[s - 1]) s += 2; 24342 else if (0 !== i[s - 2]) s++; 24343 else { 24344 for ( 24345 r + 3 !== s - 2 && 24346 'slice_layer_without_partitioning_rbsp_idr' === Mi(31 & i[r + 3]) && 24347 (n = !0); 24348 1 !== i[++s] && s < i.length; 24349 24350 ); 24351 ((r = s - 2), (s += 3)); 24352 } 24353 break; 24354 case 1: 24355 0 !== i[s - 1] || 0 !== i[s - 2] 24356 ? (s += 3) 24357 : ('slice_layer_without_partitioning_rbsp_idr' === Mi(31 & i[r + 3]) && 24358 (n = !0),
24359 (r = s - 2), 24360 (s += 3)); 24361 break; 24362 default: 24363 s += 3; 24364 } 24365 return ( 24366 (i = i.subarray(r)), 24367 (s -= r), 24368 (r = 0), 24369 (n = 24370 i && 24371 3 < i.byteLength && 24372 'slice_layer_without_partitioning_rbsp_idr' === Mi(31 & i[r + 3]) 24373 ? !0 24374 : n) 24375 ); 24376 } 24377 }), 24378 (L.aac = v), 24379 u.ONE_SECOND_IN_TS), 24380 R = 188, 24381 N = 71, 24382 qi = function (e, t) { 24383 for (var i, s = 0, r = R; r < e.byteLength; ) 24384 if (e[s] === N && e[r] === N) { 24385 switch (((i = e.subarray(s, r)), L.ts.parseType(i, t.pid))) { 24386 case 'pat': 24387 t.pid = L.ts.parsePat(i); 24388 break; 24389 case 'pmt': 24390 var n = L.ts.parsePmt(i); 24391 ((t.table = t.table || {}), 24392 Object.keys(n).forEach(function (e) { 24393 t.table[e] = n[e]; 24394 })); 24395 } 24396 ((s += R), (r += R)); 24397 } else (s++, r++); 24398 }, 24399 ji = function (e, t, i) { 24400 for (var s, r, n, a, o = 0, l = R, d = !1; l <= e.byteLength; ) 24401 if (e[o] !== N || (e[l] !== N && l !== e.byteLength)) (o++, l++); 24402 else { 24403 if ( 24404 ((s = e.subarray(o, l)), 24405 'pes' === L.ts.parseType(s, t.pid) && 24406 ((r = L.ts.parsePesType(s, t.table)), 24407 (n = L.ts.parsePayloadUnitStartIndicator(s)), 24408 'audio' === r) && 24409 n && 24410 (a = L.ts.parsePesTime(s)) && 24411 ((a.type = 'audio'), i.audio.push(a), (d = !0)), 24412 d) 24413 ) 24414 break; 24415 ((o += R), (l += R)); 24416 } 24417 for (o = (l = e.byteLength) - R, d = !1; 0 <= o; ) 24418 if (e[o] !== N || (e[l] !== N && l !== e.byteLength)) (o--, l--); 24419 else { 24420 if ( 24421 ((s = e.subarray(o, l)), 24422 'pes' === L.ts.parseType(s, t.pid) && 24423 ((r = L.ts.parsePesType(s, t.table)), 24424 (n = L.ts.parsePayloadUnitStartIndicator(s)), 24425 'audio' === r) && 24426 n && 24427 (a = L.ts.parsePesTime(s)) && 24428 ((a.type = 'audio'), i.audio.push(a), (d = !0)), 24429 d) 24430 ) 24431 break; 24432 ((o -= R), (l -= R)); 24433 } 24434 }, 24435 Vi = function (e, t, i) { 24436 for ( 24437 var s, r, n, a, o, l, d, h, u = 0, c = R, p = !1, m = { data: [], size: 0 }; 24438 c < e.byteLength; 24439 24440 ) 24441 if (e[u] === N && e[c] === N) { 24442 if (((s = e.subarray(u, c)), 'pes' === L.ts.parseType(s, t.pid))) 24443 if ( 24444 ((r = L.ts.parsePesType(s, t.table)), 24445 (n = L.ts.parsePayloadUnitStartIndicator(s)), 24446 'video' === r && 24447 (n && 24448 !p && 24449 (a = L.ts.parsePesTime(s)) && 24450 ((a.type = 'video'), i.video.push(a), (p = !0)), 24451 !i.firstKeyFrame)) 24452 ) { 24453 if (n && 0 !== m.size) { 24454 for (o = new Uint8Array(m.size), l = 0; m.data.length; ) 24455 ((d = m.data.shift()), o.set(d, l), (l += d.byteLength)); 24456 (L.ts.videoPacketContainsKeyFrame(o) && 24457 (h = L.ts.parsePesTime(o)) && 24458 ((i.firstKeyFrame = h), (i.firstKeyFrame.type = 'video')), 24459 (m.size = 0)); 24460 } 24461 (m.data.push(s), (m.size += s.byteLength)); 24462 } 24463 if (p && i.firstKeyFrame) break; 24464 ((u += R), (c += R)); 24465 } else (u++, c++); 24466 for (u = (c = e.byteLength) - R, p = !1; 0 <= u; ) 24467 if (e[u] === N && e[c] === N) { 24468 if ( 24469 ((s = e.subarray(u, c)), 24470 'pes' === L.ts.parseType(s, t.pid) && 24471 ((r = L.ts.parsePesType(s, t.table)), 24472 (n = L.ts.parsePayloadUnitStartIndicator(s)), 24473 'video' === r) && 24474 n && 24475 (a = L.ts.parsePesTime(s)) && 24476 ((a.type = 'video'), i.video.push(a), (p = !0)), 24477 p) 24478 ) 24479 break; 24480 ((u -= R), (c -= R)); 24481 } else (u--, c--); 24482 }, 24483 Hi = function (e, t) { 24484 var i, 24485 s, 24486 r, 24487 e = ( 24488 L.aac.isLikelyAacData(e) 24489 ? function (e) { 24490 for ( 24491 var t, i, s = !1, r = 0, n = null, a = null, o = 0, l = 0; 24492 3 <= e.length - l; 24493 24494 ) { 24495 switch (L.aac.parseType(e, l)) { 24496 case 'timed-metadata': 24497 e.length - l < 10 24498 ? (s = !0) 24499 : (o = L.aac.parseId3TagSize(e, l)) > e.length 24500 ? (s = !0) 24501 : (null === a && 24502 ((t = e.subarray(l, l + o)), (a = L.aac.parseAacTimestamp(t))), 24503 (l += o)); 24504 break; 24505 case 'audio': 24506 e.length - l < 7 24507 ? (s = !0) 24508 : (o = L.aac.parseAdtsSize(e, l)) > e.length 24509 ? (s = !0) 24510 : (null === n && 24511 ((t = e.subarray(l, l + o)), (n = L.aac.parseSampleRate(t))), 24512 r++, 24513 (l += o)); 24514 break; 24515 default: 24516 l++; 24517 } 24518 if (s) return null; 24519 } 24520 return null === n || null === a 24521 ? null 24522 : { 24523 audio: [ 24524 { type: 'audio', dts: a, pts: a }, 24525 { 24526 type: 'audio', 24527 dts: a + 1024 * r * (i = O / n), 24528 pts: a + 1024 * r * i 24529 } 24530 ] 24531 }; 24532 } 24533 : function (e) { 24534 var t, 24535 i = { pid: null, table: null }, 24536 s = {}; 24537 for (t in (qi(e, i), i.table)) 24538 if (i.table.hasOwnProperty(t)) 24539 switch (i.table[t]) { 24540 case Fi.H264_STREAM_TYPE: 24541 ((s.video = []), Vi(e, i, s), 0 === s.video.length && delete s.video); 24542 break; 24543 case Fi.ADTS_STREAM_TYPE: 24544 ((s.audio = []), ji(e, i, s), 0 === s.audio.length && delete s.audio); 24545 } 24546 return s; 24547 } 24548 )(e); 24549 return e && (e.audio || e.video) 24550 ? ((t = t), 24551 (i = e).audio && 24552 i.audio.length && 24553 (('undefined' != typeof (s = t) && !isNaN(s)) || (s = i.audio[0].dts),
24554 i.audio.forEach(function (e) { 24555 ((e.dts = P(e.dts, s)), 24556 (e.pts = P(e.pts, s)), 24557 (e.dtsTime = e.dts / O), 24558 (e.ptsTime = e.pts / O)); 24559 })), 24560 i.video && 24561 i.video.length && 24562 (('undefined' != typeof (r = t) && !isNaN(r)) || (r = i.video[0].dts), 24563 i.video.forEach(function (e) { 24564 ((e.dts = P(e.dts, r)), 24565 (e.pts = P(e.pts, r)), 24566 (e.dtsTime = e.dts / O), 24567 (e.ptsTime = e.pts / O)); 24568 }), 24569 i.firstKeyFrame) && 24570 (((t = i.firstKeyFrame).dts = P(t.dts, r)), 24571 (t.pts = P(t.pts, r)), 24572 (t.dtsTime = t.dts / O), 24573 (t.ptsTime = t.pts / O)), 24574 e) 24575 : null; 24576 }; 24577 class zi { 24578 constructor(e, t) { 24579 ((this.options = t || {}), (this.self = e), this.init()); 24580 } 24581 init() { 24582 var i, e; 24583 (this.transmuxer && this.transmuxer.dispose(), 24584 (this.transmuxer = new $t(this.options)), 24585 (i = this.self), 24586 (e = this.transmuxer).on('data', function (e) { 24587 var t = e.initSegment, 24588 t = 24589 ((e.initSegment = { 24590 data: t.buffer, 24591 byteOffset: t.byteOffset, 24592 byteLength: t.byteLength 24593 }), 24594 e.data); 24595 ((e.data = t.buffer), 24596 i.postMessage( 24597 { 24598 action: 'data', 24599 segment: e, 24600 byteOffset: t.byteOffset, 24601 byteLength: t.byteLength 24602 }, 24603 [e.data] 24604 )); 24605 }), 24606 e.on('done', function (e) { 24607 i.postMessage({ action: 'done' }); 24608 }), 24609 e.on('gopInfo', function (e) { 24610 i.postMessage({ action: 'gopInfo', gopInfo: e }); 24611 }), 24612 e.on('videoSegmentTimingInfo', function (e) { 24613 var t = { 24614 start: { 24615 decode: u.videoTsToSeconds(e.start.dts), 24616 presentation: u.videoTsToSeconds(e.start.pts) 24617 }, 24618 end: { 24619 decode: u.videoTsToSeconds(e.end.dts), 24620 presentation: u.videoTsToSeconds(e.end.pts) 24621 }, 24622 baseMediaDecodeTime: u.videoTsToSeconds(e.baseMediaDecodeTime) 24623 }; 24624 (e.prependedContentDuration && 24625 (t.prependedContentDuration = u.videoTsToSeconds(e.prependedContentDuration)), 24626 i.postMessage({ action: 'videoSegmentTimingInfo', videoSegmentTimingInfo: t })); 24627 }), 24628 e.on('audioSegmentTimingInfo', function (e) { 24629 var t = { 24630 start: { 24631 decode: u.videoTsToSeconds(e.start.dts), 24632 presentation: u.videoTsToSeconds(e.start.pts) 24633 }, 24634 end: { 24635 decode: u.videoTsToSeconds(e.end.dts), 24636 presentation: u.videoTsToSeconds(e.end.pts) 24637 }, 24638 baseMediaDecodeTime: u.videoTsToSeconds(e.baseMediaDecodeTime) 24639 }; 24640 (e.prependedContentDuration && 24641 (t.prependedContentDuration = u.videoTsToSeconds(e.prependedContentDuration)), 24642 i.postMessage({ action: 'audioSegmentTimingInfo', audioSegmentTimingInfo: t })); 24643 }), 24644 e.on('id3Frame', function (e) { 24645 i.postMessage({ action: 'id3Frame', id3Frame: e }); 24646 }), 24647 e.on('caption', function (e) { 24648 i.postMessage({ action: 'caption', caption: e }); 24649 }), 24650 e.on('trackinfo', function (e) { 24651 i.postMessage({ action: 'trackinfo', trackInfo: e }); 24652 }), 24653 e.on('audioTimingInfo', function (e) { 24654 i.postMessage({ 24655 action: 'audioTimingInfo', 24656 audioTimingInfo: { 24657 start: u.videoTsToSeconds(e.start), 24658 end: u.videoTsToSeconds(e.end) 24659 } 24660 }); 24661 }), 24662 e.on('videoTimingInfo', function (e) { 24663 i.postMessage({ 24664 action: 'videoTimingInfo', 24665 videoTimingInfo: { 24666 start: u.videoTsToSeconds(e.start), 24667 end: u.videoTsToSeconds(e.end) 24668 } 24669 }); 24670 }), 24671 e.on('log', function (e) { 24672 i.postMessage({ action: 'log', log: e }); 24673 })); 24674 } 24675 pushMp4Captions(e) { 24676 this.captionParser || ((this.captionParser = new xi()), this.captionParser.init()); 24677 var t = new Uint8Array(e.data, e.byteOffset, e.byteLength), 24678 e = this.captionParser.parse(t, e.trackIds, e.timescales); 24679 this.self.postMessage( 24680 { 24681 action: 'mp4Captions', 24682 captions: (e && e.captions) || [], 24683 logs: (e && e.logs) || [], 24684 data: t.buffer 24685 }, 24686 [t.buffer] 24687 ); 24688 } 24689 initMp4WebVttParser(e) { 24690 this.webVttParser || (this.webVttParser = new Ui()); 24691 e = new Uint8Array(e.data, e.byteOffset, e.byteLength); 24692 this.webVttParser.init(e); 24693 } 24694 getMp4WebVttText(e) { 24695 this.webVttParser || (this.webVttParser = new Ui()); 24696 var e = new Uint8Array(e.data, e.byteOffset, e.byteLength), 24697 t = this.webVttParser.parseSegment(e); 24698 this.self.postMessage( 24699 { action: 'getMp4WebVttText', mp4VttCues: t || [], data: e.buffer }, 24700 [e.buffer] 24701 ); 24702 } 24703 probeMp4StartTime({ timescales: e, data: t }) { 24704 e = mi.startTime(e, t); 24705 this.self.postMessage({ action: 'probeMp4StartTime', startTime: e, data: t }, [ 24706 t.buffer 24707 ]); 24708 } 24709 probeMp4Tracks({ data: e }) { 24710 var t = mi.tracks(e); 24711 this.self.postMessage({ action: 'probeMp4Tracks', tracks: t, data: e }, [e.buffer]); 24712 } 24713 probeEmsgID3({ data: e, offset: t }) { 24714 t = mi.getEmsgID3(e, t); 24715 this.self.postMessage({ action: 'probeEmsgID3', id3Frames: t, emsgData: e }, [ 24716 e.buffer 24717 ]); 24718 } 24719 probeTs({ data: e, baseStartTime: t }) { 24720 ((t = 'number' != typeof t || isNaN(t) ? void 0 : t * u.ONE_SECOND_IN_TS), 24721 (t = Hi(e, t))); 24722 let i = null; 24723 (t && 24724 ((i = { 24725 hasVideo: (t.video && 2 === t.video.length) || !1, 24726 hasAudio: (t.audio && 2 === t.audio.length) || !1 24727 }).hasVideo && (i.videoStart = t.video[0].ptsTime), 24728 i.hasAudio) && 24729 (i.audioStart = t.audio[0].ptsTime), 24730 this.self.postMessage({ action: 'probeTs', result: i, data: e }, [e.buffer])); 24731 } 24732 clearAllMp4Captions() { 24733 this.captionParser && this.captionParser.clearAllCaptions(); 24734 } 24735 clearParsedMp4Captions() { 24736 this.captionParser && this.captionParser.clearParsedCaptions(); 24737 } 24738 push(e) { 24739 e = new Uint8Array(e.data, e.byteOffset, e.byteLength); 24740 this.transmuxer.push(e); 24741 } 24742 reset() { 24743 this.transmuxer.reset(); 24744 } 24745 setTimestampOffset(e) { 24746 e = e.timestampOffset || 0; 24747 this.transmuxer.setBaseMediaDecodeTime(Math.round(u.secondsToVideoTs(e))); 24748 } 24749 setAudioAppendStart(e) { 24750 this.transmuxer.setAudioAppendStart(Math.ceil(u.secondsToVideoTs(e.appendStart))); 24751 } 24752 setRemux(e) { 24753 this.transmuxer.setRemux(e.remux); 24754 } 24755 flush(e) { 24756 (this.transmuxer.flush(), self.postMessage({ action: 'done', type: 'transmuxed' })); 24757 } 24758 endTimeline() { 24759 (this.transmuxer.endTimeline(), 24760 self.postMessage({ action: 'endedtimeline', type: 'transmuxed' })); 24761 } 24762 alignGopsWith(e) { 24763 this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice()); 24764 } 24765 } 24766 self.onmessage = function (e) { 24767 'init' === e.data.action && e.data.options 24768 ? (this.messageHandlers = new zi(self, e.data.options)) 24769 : (this.messageHandlers || (this.messageHandlers = new zi(self)), 24770 e.data && 24771 e.data.action && 24772 'init' !== e.data.action && 24773 this.messageHandlers[e.data.action] && 24774 this.messageHandlers[e.data.action](e.data)); 24775 }; 24776 }) 24777 ) 24778 ); 24779 let su = (e, t, i) => { 24780 var { 24781 type: s, 24782 initSegment: r, 24783 captions: n,
24784 captionStreams: a, 24785 metadata: o, 24786 videoFrameDtsTime: l, 24787 videoFramePtsTime: d 24788 } = e.data.segment, 24789 t = 24790 (t.buffer.push({ captions: n, captionStreams: a, metadata: o }), 24791 e.data.segment.boxes || { data: e.data.segment.data }), 24792 n = { 24793 type: s, 24794 data: new Uint8Array(t.data, t.data.byteOffset, t.data.byteLength), 24795 initSegment: new Uint8Array(r.data, r.byteOffset, r.byteLength) 24796 }; 24797 ('undefined' != typeof l && (n.videoFrameDtsTime = l), 24798 'undefined' != typeof d && (n.videoFramePtsTime = d), 24799 i(n)); 24800 }, 24801 ru = ({ transmuxedData: e, callback: t }) => { 24802 ((e.buffer = []), t(e)); 24803 }, 24804 nu = (e, t) => { 24805 t.gopInfo = e.data.gopInfo; 24806 }, 24807 au = (t) => { 24808 let { 24809 transmuxer: i, 24810 bytes: e, 24811 audioAppendStart: s, 24812 gopsToAlignWith: r, 24813 remux: n, 24814 onData: a, 24815 onTrackInfo: o, 24816 onAudioTimingInfo: l, 24817 onVideoTimingInfo: d, 24818 onVideoSegmentTimingInfo: h, 24819 onAudioSegmentTimingInfo: u, 24820 onId3: c, 24821 onCaptions: p, 24822 onDone: m, 24823 onEndedTimeline: g, 24824 onTransmuxerLog: f, 24825 isEndOfTimeline: y, 24826 segment: _, 24827 triggerSegmentEventFn: v 24828 } = t, 24829 b = { buffer: [] }, 24830 T = y; 24831 var S, w; 24832 ((i.onmessage = (e) => { 24833 i.currentTransmux !== t || 24834 ('data' === e.data.action && su(e, b, a), 24835 'trackinfo' === e.data.action && o(e.data.trackInfo), 24836 'gopInfo' === e.data.action && nu(e, b), 24837 'audioTimingInfo' === e.data.action && l(e.data.audioTimingInfo), 24838 'videoTimingInfo' === e.data.action && d(e.data.videoTimingInfo), 24839 'videoSegmentTimingInfo' === e.data.action && h(e.data.videoSegmentTimingInfo), 24840 'audioSegmentTimingInfo' === e.data.action && u(e.data.audioSegmentTimingInfo), 24841 'id3Frame' === e.data.action && c([e.data.id3Frame], e.data.id3Frame.dispatchType), 24842 'caption' === e.data.action && p(e.data.caption), 24843 'endedtimeline' === e.data.action && ((T = !1), g()), 24844 'log' === e.data.action && f(e.data.log), 24845 'transmuxed' !== e.data.type) || 24846 T || 24847 ((i.onmessage = null), ru({ transmuxedData: b, callback: m }), ou(i)); 24848 }), 24849 (i.onerror = () => { 24850 var e = { 24851 message: 'Received an error message from the transmuxer worker', 24852 metadata: { 24853 errorType: E.Error.StreamingFailedToTransmuxSegment, 24854 segmentInfo: ec({ segment: _ }) 24855 } 24856 }; 24857 m(null, e); 24858 }), 24859 s && i.postMessage({ action: 'setAudioAppendStart', appendStart: s }), 24860 Array.isArray(r) && i.postMessage({ action: 'alignGopsWith', gopsToAlignWith: r }), 24861 'undefined' != typeof n && i.postMessage({ action: 'setRemux', remux: n }), 24862 e.byteLength && 24863 ((S = e instanceof ArrayBuffer ? e : e.buffer), 24864 (w = e instanceof ArrayBuffer ? 0 : e.byteOffset), 24865 v({ type: 'segmenttransmuxingstart', segment: _ }), 24866 i.postMessage({ action: 'push', data: S, byteOffset: w, byteLength: e.byteLength }, [S])), 24867 y && i.postMessage({ action: 'endTimeline' }), 24868 i.postMessage({ action: 'flush' })); 24869 }, 24870 ou = (e) => { 24871 ((e.currentTransmux = null), 24872 e.transmuxQueue.length && 24873 ((e.currentTransmux = e.transmuxQueue.shift()), 24874 'function' == typeof e.currentTransmux ? e.currentTransmux() : au(e.currentTransmux))); 24875 }, 24876 lu = (e, t) => { 24877 (e.postMessage({ action: t }), ou(e)); 24878 }, 24879 du = (e, t) => { 24880 t.currentTransmux 24881 ? t.transmuxQueue.push(lu.bind(null, t, e)) 24882 : ((t.currentTransmux = e), lu(t, e)); 24883 }; 24884 let hu = (e) => { 24885 e.transmuxer.currentTransmux 24886 ? e.transmuxer.transmuxQueue.push(e) 24887 : ((e.transmuxer.currentTransmux = e), au(e)); 24888 }; 24889 var uu = (e) => { 24890 du('reset', e); 24891 }, 24892 cu = 24893 (hu, 24894 (e) => { 24895 let t = new iu(), 24896 i = ((t.currentTransmux = null), (t.transmuxQueue = []), t.terminate); 24897 return ( 24898 (t.terminate = () => ( 24899 (t.currentTransmux = null),
24900 (t.transmuxQueue.length = 0), 24901 i.call(t) 24902 )), 24903 t.postMessage({ action: 'init', options: e }), 24904 t 24905 ); 24906 }); 24907 function pu(e) { 24908 let t = 0; 24909 return (e.audio && t++, e.video && t++, t); 24910 } 24911 function mu(e, t) { 24912 var i = t.attributes || {}, 24913 s = Nu( 24914 (function (e) { 24915 e = e.attributes || {}; 24916 if (e.CODECS) return na(e.CODECS); 24917 })(t) || [] 24918 ); 24919 return ( 24920 !Ru(e, t) || 24921 s.audio || 24922 ((e, t) => { 24923 if (!Ru(e, t)) return !0; 24924 var i, 24925 t = t.attributes || {}, 24926 s = e.mediaGroups.AUDIO[t.AUDIO]; 24927 for (i in s) if (!s[i].uri && !s[i].playlists) return !0; 24928 return !1; 24929 })(e, t) || 24930 ((t = Nu( 24931 (function (e, t) { 24932 if (e.mediaGroups.AUDIO && t) { 24933 var i = e.mediaGroups.AUDIO[t]; 24934 if (i) 24935 for (var s in i) { 24936 s = i[s]; 24937 if (s.default && s.playlists) return na(s.playlists[0].attributes.CODECS); 24938 } 24939 } 24940 return null; 24941 })(e, i.AUDIO) || [] 24942 )).audio && 24943 (s.audio = t.audio)), 24944 s 24945 ); 24946 } 24947 function gu(e, t) { 24948 return (e = e && window.getComputedStyle(e)) ? e[t] : ''; 24949 } 24950 function fu(e, t) { 24951 let i, s; 24952 return ( 24953 (i = (i = e.attributes.BANDWIDTH ? e.attributes.BANDWIDTH : i) || window.Number.MAX_VALUE), 24954 (s = (s = t.attributes.BANDWIDTH ? t.attributes.BANDWIDTH : s) || window.Number.MAX_VALUE), 24955 i - s 24956 ); 24957 } 24958 let yu = function (t) { 24959 let i = t.transmuxer, 24960 s = t.endAction || t.action, 24961 r = t.callback; 24962 var e, 24963 n = f({}, t, { endAction: null, transmuxer: null, callback: null }); 24964 let a = (e) => { 24965 e.data.action === s && 24966 (i.removeEventListener('message', a), 24967 e.data.data && 24968 ((e.data.data = new Uint8Array( 24969 e.data.data, 24970 t.byteOffset || 0, 24971 t.byteLength || e.data.data.byteLength 24972 )), 24973 t.data) && 24974 (t.data = e.data.data), 24975 r(e.data)); 24976 }; 24977 (i.addEventListener('message', a), 24978 t.data 24979 ? ((e = t.data instanceof ArrayBuffer), 24980 (n.byteOffset = e ? 0 : t.data.byteOffset), 24981 (n.byteLength = t.data.byteLength), 24982 (e = [e ? t.data : t.data.buffer]), 24983 i.postMessage(n, e)) 24984 : i.postMessage(n)); 24985 }, 24986 _u = { FAILURE: 2, TIMEOUT: -101, ABORTED: -102 }, 24987 vu = 'wvtt', 24988 bu = (e) => { 24989 e.forEach((e) => { 24990 e.abort(); 24991 }); 24992 }, 24993 Tu = (e) => ({ 24994 bandwidth: e.bandwidth, 24995 bytesReceived: e.bytesReceived || 0, 24996 roundTripTime: e.roundTripTime || 0 24997 }), 24998 Su = (e) => { 24999 var t = e.target, 25000 t = { bandwidth: 1 / 0, bytesReceived: 0, roundTripTime: Date.now() - t.requestTime || 0 }; 25001 return ( 25002 (t.bytesReceived = e.loaded), 25003 (t.bandwidth = Math.floor((t.bytesReceived / t.roundTripTime) * 8 * 1e3)), 25004 t 25005 ); 25006 }, 25007 wu = (e, t) => { 25008 var i = t.requestType, 25009 i = bh({ requestType: i, request: t, error: e }); 25010 return t.timedout 25011 ? { 25012 status: t.status, 25013 message: 'HLS request timed-out at URL: ' + t.uri, 25014 code: _u.TIMEOUT, 25015 xhr: t, 25016 metadata: i 25017 } 25018 : t.aborted 25019 ? { 25020 status: t.status, 25021 message: 'HLS request aborted at URL: ' + t.uri, 25022 code: _u.ABORTED, 25023 xhr: t, 25024 metadata: i 25025 } 25026 : e 25027 ? { 25028 status: t.status, 25029 message: 'HLS request errored at URL: ' + t.uri, 25030 code: _u.FAILURE, 25031 xhr: t, 25032 metadata: i 25033 } 25034 : 'arraybuffer' === t.responseType && 0 === t.response.byteLength 25035 ? { 25036 status: t.status, 25037 message: 'Empty HLS response at URL: ' + t.uri, 25038 code: _u.FAILURE, 25039 xhr: t, 25040 metadata: i 25041 } 25042 : null; 25043 }, 25044 Eu = (r, n, a, o) => (e, t) => { 25045 var i = t.response, 25046 e = wu(e, t); 25047 if (e) return a(e, r); 25048 if (16 !== i.byteLength) 25049 return a( 25050 { 25051 status: t.status, 25052 message: 'Invalid HLS key at URL: ' + t.uri, 25053 code: _u.FAILURE, 25054 xhr: t 25055 }, 25056 r 25057 ); 25058 var e = new DataView(i), 25059 s = new Uint32Array([e.getUint32(0), e.getUint32(4), e.getUint32(8), e.getUint32(12)]); 25060 for (let e = 0; e < n.length; e++) n[e].bytes = s; 25061 i = { uri: t.uri }; 25062 return (o({ type: 'segmentkeyloadcomplete', segment: r, keyInfo: i }), a(null, r)); 25063 }, 25064 Cu = (e, t) => { 25065 t === vu && e.transmuxer.postMessage({ action: 'initMp4WebVttParser', data: e.map.bytes }); 25066 }, 25067 ku = (i, e, s) => { 25068 e === vu && 25069 yu({ 25070 action: 'getMp4WebVttText', 25071 data: i.bytes, 25072 transmuxer: i.transmuxer, 25073 callback: ({ data: e, mp4VttCues: t }) => { 25074 ((i.bytes = e), s(null, i, { mp4VttCues: t })); 25075 } 25076 }); 25077 }, 25078 Iu = (i, s) => { 25079 var e, 25080 t = Ld(i.map.bytes); 25081 if ('mp4' !== t) 25082 return ( 25083 (e = i.map.resolvedUri || i.map.uri), 25084 s({ 25085 internal: !0, 25086 message: 25087 `Found unsupported ${(t = t || 'unknown')} container for initialization segment at URL: ` + 25088 e, 25089 code: _u.FAILURE, 25090 metadata: { mediaType: t } 25091 }) 25092 ); 25093 yu({ 25094 action: 'probeMp4Tracks', 25095 data: i.map.bytes, 25096 transmuxer: i.transmuxer, 25097 callback: ({ tracks: e, data: t }) => ( 25098 (i.map.bytes = t), 25099 e.forEach(function (e) { 25100 ((i.map.tracks = i.map.tracks || {}), 25101 i.map.tracks[e.type] || 25102 ('number' == typeof (i.map.tracks[e.type] = e).id && 25103 e.timescale && 25104 ((i.map.timescales = i.map.timescales || {}), 25105 (i.map.timescales[e.id] = e.timescale)), 25106 'text' === e.type && Cu(i, e.codec))); 25107 }), 25108 s(null) 25109 ) 25110 }); 25111 }, 25112 xu = ({ 25113 segment: i, 25114 bytes: t, 25115 trackInfoFn: s, 25116 timingInfoFn: e, 25117 videoSegmentTimingInfoFn: r, 25118 audioSegmentTimingInfoFn: n, 25119 id3Fn: a, 25120 captionsFn: o, 25121 isEndOfTimeline: l, 25122 endedTimelineFn: d, 25123 dataFn: h, 25124 doneFn: u, 25125 onTransmuxerLog: c, 25126 triggerSegmentEventFn: p 25127 }) => { 25128 var m = (i.map && i.map.tracks) || {}; 25129 let g = Boolean(m.audio && m.video), 25130 f = e.bind(null, i, 'audio', 'start'), 25131 y = e.bind(null, i, 'audio', 'end'), 25132 _ = e.bind(null, i, 'video', 'start'), 25133 v = e.bind(null, i, 'video', 'end'); 25134 yu({ 25135 action: 'probeTs', 25136 transmuxer: i.transmuxer, 25137 data: t, 25138 baseStartTime: i.baseStartTime, 25139 callback: (e) => { 25140 i.bytes = t = e.data; 25141 e = e.result; 25142 (e && (s(i, { hasAudio: e.hasAudio, hasVideo: e.hasVideo, isMuxed: g }), (s = null)), 25143 hu({ 25144 bytes: t, 25145 transmuxer: i.transmuxer, 25146 audioAppendStart: i.audioAppendStart, 25147 gopsToAlignWith: i.gopsToAlignWith, 25148 remux: g, 25149 onData: (e) => { 25150 ((e.type = 'combined' === e.type ? 'video' : e.type), h(i, e)); 25151 }, 25152 onTrackInfo: (e) => { 25153 s && (g && (e.isMuxed = !0), s(i, e)); 25154 }, 25155 onAudioTimingInfo: (e) => { 25156 (f && 'undefined' != typeof e.start && (f(e.start), (f = null)), 25157 y && 'undefined' != typeof e.end && y(e.end)); 25158 }, 25159 onVideoTimingInfo: (e) => { 25160 (_ && 'undefined' != typeof e.start && (_(e.start), (_ = null)), 25161 v && 'undefined' != typeof e.end && v(e.end)); 25162 }, 25163 onVideoSegmentTimingInfo: (e) => { 25164 var t = { 25165 pts: { start: e.start.presentation, end: e.end.presentation }, 25166 dts: { start: e.start.decode, end: e.end.decode } 25167 }; 25168 (p({ type: 'segmenttransmuxingtiminginfoavailable', segment: i, timingInfo: t }), 25169 r(e)); 25170 }, 25171 onAudioSegmentTimingInfo: (e) => { 25172 var t = { 25173 pts: { start: e.start.pts, end: e.end.pts }, 25174 dts: { start: e.start.dts, end: e.end.dts } 25175 }; 25176 (p({ type: 'segmenttransmuxingtiminginfoavailable', segment: i, timingInfo: t }), 25177 n(e)); 25178 }, 25179 onId3: (e, t) => { 25180 a(i, e, t); 25181 }, 25182 onCaptions: (e) => { 25183 o(i, [e]); 25184 }, 25185 isEndOfTimeline: l, 25186 onEndedTimeline: () => { 25187 d(); 25188 }, 25189 onTransmuxerLog: c, 25190 onDone: (e, t) => { 25191 u && 25192 ((e.type = 'combined' === e.type ? 'video' : e.type), 25193 p({ type: 'segmenttransmuxingcomplete', segment: i }), 25194 u(t, i, e)); 25195 }, 25196 segment: i, 25197 triggerSegmentEventFn: p 25198 })); 25199 } 25200 }); 25201 }, 25202 Au = ({ 25203 segment: n, 25204 bytes: a, 25205 trackInfoFn: e, 25206 timingInfoFn: o, 25207 videoSegmentTimingInfoFn: t, 25208 audioSegmentTimingInfoFn: i, 25209 id3Fn: l, 25210 captionsFn: d, 25211 isEndOfTimeline: s, 25212 endedTimelineFn: r, 25213 dataFn: h, 25214 doneFn: u, 25215 onTransmuxerLog: c, 25216 triggerSegmentEventFn: p 25217 }) => { 25218 let m = new Uint8Array(a); 25219 if (Od(m)) { 25220 n.isFmp4 = !0; 25221 let i = n.map.tracks; 25222 if (i.text && (!i.audio || !i.video)) 25223 return (h(n, { data: m, type: 'text' }), void ku(n, i.text.codec, u)); 25224 let s = { isFmp4: !0, hasVideo: !!i.video, hasAudio: !!i.audio }, 25225 r = 25226 (i.audio && i.audio.codec && 'enca' !== i.audio.codec && (s.audioCodec = i.audio.codec), 25227 i.video && i.video.codec && 'encv' !== i.video.codec && (s.videoCodec = i.video.codec), 25228 i.video && i.audio && (s.isMuxed = !0), 25229 e(n, s), 25230 (e, t) => { 25231 (h(n, { data: m, type: s.hasAudio && !s.isMuxed ? 'audio' : 'video' }), 25232 t && t.length && l(n, t), 25233 e && e.length && d(n, e), 25234 u(null, n, {})); 25235 }); 25236 void yu({ 25237 action: 'probeMp4StartTime', 25238 timescales: n.map.timescales, 25239 data: m, 25240 transmuxer: n.transmuxer, 25241 callback: ({ data: e, startTime: t }) => { 25242 ((a = e.buffer), 25243 (n.bytes = m = e), 25244 s.hasAudio && !s.isMuxed && o(n, 'audio', 'start', t), 25245 s.hasVideo && o(n, 'video', 'start', t), 25246 yu({ 25247 action: 'probeEmsgID3', 25248 data: m, 25249 transmuxer: n.transmuxer, 25250 offset: t, 25251 callback: ({ emsgData: e, id3Frames: t }) => { 25252 ((a = e.buffer), 25253 (n.bytes = m = e), 25254 i.video && e.byteLength && n.transmuxer 25255 ? yu({ 25256 action: 'pushMp4Captions', 25257 endAction: 'mp4Captions', 25258 transmuxer: n.transmuxer, 25259 data: m, 25260 timescales: n.map.timescales, 25261 trackIds: [i.video.id], 25262 callback: (e) => { 25263 ((a = e.data.buffer), 25264 (n.bytes = m = e.data),
25265 e.logs.forEach(function (e) { 25266 c(L(e, { stream: 'mp4CaptionParser' })); 25267 }), 25268 r(e.captions, t)); 25269 } 25270 }) 25271 : r(void 0, t)); 25272 } 25273 })); 25274 } 25275 }); 25276 } else 25277 n.transmuxer 25278 ? ('undefined' == typeof n.container && (n.container = Ld(m)), 25279 'ts' !== n.container && 'aac' !== n.container 25280 ? (e(n, { hasAudio: !1, hasVideo: !1 }), u(null, n, {})) 25281 : xu({ 25282 segment: n, 25283 bytes: a, 25284 trackInfoFn: e, 25285 timingInfoFn: o, 25286 videoSegmentTimingInfoFn: t, 25287 audioSegmentTimingInfoFn: i, 25288 id3Fn: l, 25289 captionsFn: d, 25290 isEndOfTimeline: s, 25291 endedTimelineFn: r, 25292 dataFn: h, 25293 doneFn: u, 25294 onTransmuxerLog: c, 25295 triggerSegmentEventFn: p 25296 })) 25297 : u(null, n, {}); 25298 }, 25299 Du = function ( 25300 { id: t, key: e, encryptedBytes: i, decryptionWorker: s, segment: r, doneFn: n }, 25301 a 25302 ) { 25303 let o = (e) => { 25304 e.data.source === t && 25305 (s.removeEventListener('message', o), 25306 (e = e.data.decrypted), 25307 a(new Uint8Array(e.bytes, e.byteOffset, e.byteLength))); 25308 }; 25309 ((s.onerror = () => { 25310 var e = 'An error occurred in the decryption worker', 25311 t = ec({ segment: r }), 25312 e = { 25313 message: e, 25314 metadata: { 25315 error: new Error(e), 25316 errorType: E.Error.StreamingFailedToDecryptSegment, 25317 segmentInfo: t, 25318 keyInfo: { uri: r.key.resolvedUri || r.map.key.resolvedUri } 25319 } 25320 }; 25321 n(e, r); 25322 }), 25323 s.addEventListener('message', o)); 25324 let l; 25325 ((l = e.bytes.slice ? e.bytes.slice() : new Uint32Array(Array.prototype.slice.call(e.bytes))), 25326 s.postMessage(Mh({ source: t, encrypted: i, key: l, iv: e.iv }), [i.buffer, l.buffer])); 25327 }, 25328 Pu = ({ 25329 decryptionWorker: e, 25330 segment: t, 25331 trackInfoFn: i, 25332 timingInfoFn: s, 25333 videoSegmentTimingInfoFn: r, 25334 audioSegmentTimingInfoFn: n, 25335 id3Fn: a, 25336 captionsFn: o, 25337 isEndOfTimeline: l, 25338 endedTimelineFn: d, 25339 dataFn: h, 25340 doneFn: u, 25341 onTransmuxerLog: c, 25342 triggerSegmentEventFn: p 25343 }) => { 25344 (p({ type: 'segmentdecryptionstart' }), 25345 Du( 25346 { 25347 id: t.requestId, 25348 key: t.key, 25349 encryptedBytes: t.encryptedBytes, 25350 decryptionWorker: e, 25351 segment: t, 25352 doneFn: u 25353 }, 25354 (e) => { 25355 ((t.bytes = e), 25356 p({ type: 'segmentdecryptioncomplete', segment: t }), 25357 Au({ 25358 segment: t, 25359 bytes: t.bytes, 25360 trackInfoFn: i, 25361 timingInfoFn: s, 25362 videoSegmentTimingInfoFn: r, 25363 audioSegmentTimingInfoFn: n, 25364 id3Fn: a, 25365 captionsFn: o, 25366 isEndOfTimeline: l, 25367 endedTimelineFn: d, 25368 dataFn: h, 25369 doneFn: u, 25370 onTransmuxerLog: c, 25371 triggerSegmentEventFn: p 25372 })); 25373 } 25374 )); 25375 }, 25376 Lu = ({ 25377 xhr: e, 25378 xhrOptions: t, 25379 decryptionWorker: i, 25380 segment: s, 25381 abortFn: r, 25382 progressFn: n, 25383 trackInfoFn: a, 25384 timingInfoFn: o, 25385 videoSegmentTimingInfoFn: l, 25386 audioSegmentTimingInfoFn: d, 25387 id3Fn: h, 25388 captionsFn: u, 25389 isEndOfTimeline: c, 25390 endedTimelineFn: p, 25391 dataFn: m, 25392 doneFn: g, 25393 onTransmuxerLog: f, 25394 triggerSegmentEventFn: y 25395 }) => { 25396 let _ = []; 25397 var v, 25398 b, 25399 T, 25400 S, 25401 w, 25402 E, 25403 C, 25404 k, 25405 I, 25406 i = (({ 25407 activeXhrs: s, 25408 decryptionWorker: r, 25409 trackInfoFn: n, 25410 timingInfoFn: a, 25411 videoSegmentTimingInfoFn: o, 25412 audioSegmentTimingInfoFn: l, 25413 id3Fn: d, 25414 captionsFn: h, 25415 isEndOfTimeline: u, 25416 endedTimelineFn: c, 25417 dataFn: p, 25418 doneFn: m, 25419 onTransmuxerLog: g, 25420 triggerSegmentEventFn: f 25421 }) => { 25422 let t = 0, 25423 y = !1; 25424 return (e, i) => { 25425 if (!y) { 25426 if (e) return ((y = !0), bu(s), m(e, i)); 25427 if ((t += 1) === s.length) { 25428 let t = function () { 25429 if (i.encryptedBytes) 25430 return Pu({ 25431 decryptionWorker: r, 25432 segment: i, 25433 trackInfoFn: n, 25434 timingInfoFn: a, 25435 videoSegmentTimingInfoFn: o, 25436 audioSegmentTimingInfoFn: l, 25437 id3Fn: d, 25438 captionsFn: h, 25439 isEndOfTimeline: u, 25440 endedTimelineFn: c, 25441 dataFn: p, 25442 doneFn: m, 25443 onTransmuxerLog: g, 25444 triggerSegmentEventFn: f 25445 }); 25446 Au({ 25447 segment: i, 25448 bytes: i.bytes, 25449 trackInfoFn: n, 25450 timingInfoFn: a, 25451 videoSegmentTimingInfoFn: o, 25452 audioSegmentTimingInfoFn: l, 25453 id3Fn: d, 25454 captionsFn: h, 25455 isEndOfTimeline: u, 25456 endedTimelineFn: c, 25457 dataFn: p, 25458 doneFn: m, 25459 onTransmuxerLog: g, 25460 triggerSegmentEventFn: f 25461 }); 25462 }; 25463 if ( 25464 ((i.endOfAllRequests = Date.now()), i.map && i.map.encryptedBytes && !i.map.bytes) 25465 ) 25466 return ( 25467 f({ type: 'segmentdecryptionstart', segment: i }), 25468 Du( 25469 { 25470 decryptionWorker: r, 25471 id: i.requestId + '-init', 25472 encryptedBytes: i.map.encryptedBytes, 25473 key: i.map.key, 25474 segment: i, 25475 doneFn: m 25476 }, 25477 (e) => { 25478 ((i.map.bytes = e), 25479 f({ type: 'segmentdecryptioncomplete', segment: i }), 25480 Iu(i, (e) => { 25481 if (e) return (bu(s), m(e, i)); 25482 t(); 25483 })); 25484 } 25485 ) 25486 ); 25487 t(); 25488 } 25489 } 25490 }; 25491 })({ 25492 activeXhrs: _, 25493 decryptionWorker: i, 25494 trackInfoFn: a, 25495 timingInfoFn: o, 25496 videoSegmentTimingInfoFn: l, 25497 audioSegmentTimingInfoFn: d, 25498 id3Fn: h, 25499 captionsFn: u, 25500 isEndOfTimeline: c, 25501 endedTimelineFn: p, 25502 dataFn: m, 25503 doneFn: g, 25504 onTransmuxerLog: f, 25505 triggerSegmentEventFn: y 25506 }), 25507 f = 25508 (s.key && 25509 !s.key.bytes && 25510 ((a = [s.key]), 25511 s.map && 25512 !s.map.bytes && 25513 s.map.key && 25514 s.map.key.resolvedUri === s.key.resolvedUri &&
25515 a.push(s.map.key), 25516 (o = L(t, { 25517 uri: s.key.resolvedUri, 25518 responseType: 'arraybuffer', 25519 requestType: 'segment-key' 25520 })), 25521 (l = Eu(s, a, i, y)), 25522 y({ type: 'segmentkeyloadstart', segment: s, keyInfo: { uri: s.key.resolvedUri } }), 25523 (d = e(o, l)), 25524 _.push(d)), 25525 s.map && 25526 !s.map.bytes && 25527 (!s.map.key || 25528 (s.key && s.key.resolvedUri === s.map.key.resolvedUri) || 25529 ((h = L(t, { 25530 uri: s.map.key.resolvedUri, 25531 responseType: 'arraybuffer', 25532 requestType: 'segment-key' 25533 })), 25534 (u = Eu(s, [s.map.key], i, y)), 25535 y({ 25536 type: 'segmentkeyloadstart', 25537 segment: s, 25538 keyInfo: { uri: s.map.key.resolvedUri } 25539 }), 25540 (c = e(h, u)), 25541 _.push(c)), 25542 (p = L(t, { 25543 uri: s.map.resolvedUri, 25544 responseType: 'arraybuffer', 25545 headers: Ph(s.map), 25546 requestType: 'segment-media-initialization' 25547 })), 25548 ({ 25549 segment: v, 25550 finishProcessingFn: b, 25551 triggerSegmentEventFn: T 25552 } = [{ segment: s, finishProcessingFn: i, triggerSegmentEventFn: y }][0]), 25553 (m = (e, t) => { 25554 var e = wu(e, t); 25555 return e 25556 ? b(e, v) 25557 : ((e = new Uint8Array(t.response)), 25558 T({ type: 'segmentloaded', segment: v }), 25559 v.map.key 25560 ? ((v.map.encryptedBytes = e), b(null, v)) 25561 : ((v.map.bytes = e), 25562 void Iu(v, function (e) { 25563 if (e) return ((e.xhr = t), (e.status = t.status), b(e, v)); 25564 b(null, v); 25565 }))); 25566 }), 25567 y({ type: 'segmentloadstart', segment: s }), 25568 (g = e(p, m)), 25569 _.push(g)), 25570 L(t, { 25571 uri: (s.part && s.part.resolvedUri) || s.resolvedUri, 25572 responseType: 'arraybuffer', 25573 headers: Ph(s), 25574 requestType: 'segment' 25575 })), 25576 a = 25577 (({ 25578 segment: S, 25579 finishProcessingFn: w, 25580 responseType: E, 25581 triggerSegmentEventFn: C 25582 } = [ 25583 { 25584 segment: s, 25585 finishProcessingFn: i, 25586 responseType: f.responseType, 25587 triggerSegmentEventFn: y 25588 } 25589 ][0]), 25590 (e, t) => { 25591 e = wu(e, t); 25592 if (e) return w(e, S); 25593 C({ type: 'segmentloaded', segment: S }); 25594 e = 25595 'arraybuffer' !== E && t.responseText 25596 ? Jh(t.responseText.substring(S.lastReachedChar || 0)) 25597 : t.response; 25598 return ( 25599 (S.stats = Tu(t)), 25600 S.key ? (S.encryptedBytes = new Uint8Array(e)) : (S.bytes = new Uint8Array(e)), 25601 w(null, S) 25602 ); 25603 }), 25604 o = (y({ type: 'segmentloadstart', segment: s }), e(f, a)); 25605 (o.addEventListener( 25606 'progress', 25607 (({ segment: k, progressFn: I } = [{ segment: s, progressFn: n }][0]), 25608 (e) => { 25609 var t = e.target; 25610 if (!t.aborted) 25611 return ( 25612 (k.stats = L(k.stats, Su(e))), 25613 !k.stats.firstBytesReceivedAt && 25614 k.stats.bytesReceived && 25615 (k.stats.firstBytesReceivedAt = Date.now()), 25616 I(e, k) 25617 ); 25618 }) 25619 ), 25620 _.push(o)); 25621 let x = {}; 25622 return ( 25623 _.forEach((e) => { 25624 var t, i; 25625 e.addEventListener( 25626 'loadend', 25627 (({ loadendState: t, abortFn: i } = [{ loadendState: x, abortFn: r }][0]), 25628 (e) => { 25629 e.target.aborted && i && !t.calledAbortFn && (i(), (t.calledAbortFn = !0)); 25630 }) 25631 ); 25632 }), 25633 () => bu(_) 25634 ); 25635 }, 25636 Ou = Ud('CodecUtils'), 25637 Ru = (e, t) => { 25638 t = t.attributes || {}; 25639 return e && e.mediaGroups && e.mediaGroups.AUDIO && t.AUDIO && e.mediaGroups.AUDIO[t.AUDIO]; 25640 }, 25641 Nu = function (e) { 25642 let s = {}; 25643 return ( 25644 e.forEach(({ mediaType: e, type: t, details: i }) => { 25645 ((s[e] = s[e] || []), s[e].push(ra('' + t + i))); 25646 }),
25647 Object.keys(s).forEach(function (e) { 25648 1 < s[e].length 25649 ? (Ou( 25650 `multiple ${e} codecs found as attributes: ${s[e].join(', ')}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.` 25651 ), 25652 (s[e] = null)) 25653 : (s[e] = s[e][0]); 25654 }), 25655 s 25656 ); 25657 }, 25658 Mu = Ud('PlaylistSelector'), 25659 Uu = function (e) { 25660 var t; 25661 if (e && e.playlist) 25662 return ( 25663 (t = e.playlist), 25664 JSON.stringify({ 25665 id: t.id, 25666 bandwidth: e.bandwidth, 25667 width: e.width, 25668 height: e.height, 25669 codecs: (t.attributes && t.attributes.CODECS) || '' 25670 }) 25671 ); 25672 }, 25673 Bu = function (e, s) { 25674 let r = e.slice(); 25675 e.sort(function (e, t) { 25676 var i = s(e, t); 25677 return 0 === i ? r.indexOf(e) - r.indexOf(t) : i; 25678 }); 25679 }; 25680 function Fu(l, t, d, h, u, c) { 25681 if (l) { 25682 var p = { bandwidth: t, width: d, height: h, limitRenditionByPlayerDimensions: u }; 25683 let e = l.playlists, 25684 n = 25685 (ch.isAudioOnly(l) && ((e = c.getAudioTrackPlaylists_()), (p.audioOnly = !0)), 25686 e.map((e) => { 25687 var t = e.attributes && e.attributes.RESOLUTION && e.attributes.RESOLUTION.width, 25688 i = e.attributes && e.attributes.RESOLUTION && e.attributes.RESOLUTION.height, 25689 s = e.attributes && e.attributes.BANDWIDTH; 25690 return { bandwidth: s || window.Number.MAX_VALUE, width: t, height: i, playlist: e }; 25691 })), 25692 a = 25693 (Bu(n, (e, t) => e.bandwidth - t.bandwidth), 25694 (n = n.filter((e) => !ch.isIncompatible(e.playlist))).filter((e) => 25695 ch.isEnabled(e.playlist) 25696 )); 25697 l = (a = a.length ? a : n.filter((e) => !ch.isDisabled(e.playlist))).filter( 25698 (e) => e.bandwidth * R.BANDWIDTH_VARIANCE < t 25699 ); 25700 let o = l[l.length - 1]; 25701 var m = l.filter((e) => e.bandwidth === o.bandwidth)[0]; 25702 if (!1 === u) { 25703 let t = m || a[0] || n[0]; 25704 if (t && t.playlist) { 25705 let e = m ? 'bandwidthBestRep' : 'sortedPlaylistReps'; 25706 return ( 25707 a[0] && (e = 'enabledPlaylistReps'), 25708 Mu(`choosing ${Uu(t)} using ${e} with options`, p), 25709 t.playlist 25710 ); 25711 } 25712 } else { 25713 var g, 25714 u = l.filter((e) => e.width && e.height), 25715 l = 25716 (Bu(u, (e, t) => e.width - t.width), u.filter((e) => e.width === d && e.height === h)), 25717 l = ((o = l[l.length - 1]), l.filter((e) => e.bandwidth === o.bandwidth)[0]); 25718 let t, i; 25719 l || 25720 ((g = (t = u.filter((e) => e.width > d || h < e.height)).filter( 25721 (e) => e.width === t[0].width && e.height === t[0].height 25722 )), 25723 (o = g[g.length - 1]), 25724 (i = g.filter((e) => e.bandwidth === o.bandwidth)[0])); 25725 let s, 25726 r = 25727 (c.leastPixelDiffSelector && 25728 ((g = u.map( 25729 (e) => ((e.pixelDiff = Math.abs(e.width - d) + Math.abs(e.height - h)), e) 25730 )), 25731 Bu(g, (e, t) => 25732 e.pixelDiff === t.pixelDiff ? t.bandwidth - e.bandwidth : e.pixelDiff - t.pixelDiff 25733 ), 25734 (s = g[0])), 25735 s || i || l || m || a[0] || n[0]); 25736 if (r && r.playlist) { 25737 let e = 'sortedPlaylistReps'; 25738 return ( 25739 s 25740 ? (e = 'leastPixelDiffRep') 25741 : i 25742 ? (e = 'resolutionPlusOneRep') 25743 : l 25744 ? (e = 'resolutionBestRep') 25745 : m 25746 ? (e = 'bandwidthBestRep') 25747 : a[0] && (e = 'enabledPlaylistReps'), 25748 Mu(`choosing ${Uu(r)} using ${e} with options`, p), 25749 r.playlist 25750 ); 25751 } 25752 } 25753 return (Mu('could not choose a playlist with options', p), null); 25754 } 25755 } 25756 function qu() { 25757 let e = (this.useDevicePixelRatio && window.devicePixelRatio) || 1; 25758 return ( 25759 isNaN(this.customPixelRatio) || (e = this.customPixelRatio), 25760 Fu( 25761 this.playlists.main, 25762 this.systemBandwidth, 25763 parseInt(gu(this.tech_.el(), 'width'), 10) * e, 25764 parseInt(gu(this.tech_.el(), 'height'), 10) * e, 25765 this.limitRenditionByPlayerDimensions, 25766 this.playlistController_ 25767 ) 25768 ); 25769 } 25770 function ju(e) { 25771 try { 25772 return new URL(e).pathname.split('/').slice(-2).join('/'); 25773 } catch (e) { 25774 return ''; 25775 } 25776 } 25777 function Vu(e, t, i) { 25778 let s; 25779 var r; 25780 if (i && i.cues) 25781 for (s = i.cues.length; s--; ) 25782 (r = i.cues[s]).startTime >= e && r.endTime <= t && i.removeCue(r); 25783 } 25784 let Hu = ({ inbandTextTracks: e, metadataArray: t, timestampOffset: i, videoDuration: o }) => { 25785 if (t) { 25786 let r = window.WebKitDataCue || window.VTTCue, 25787 a = e.metadataTrack_; 25788 if ( 25789 a && 25790 (t.forEach((e) => { 25791 let s = e.cueTime + i; 25792 !('number' != typeof s || window.isNaN(s) || s < 0) && 25793 s < 1 / 0 && 25794 e.frames && 25795 e.frames.length &&
25796 e.frames.forEach((e) => { 25797 var t, 25798 i = new r(s, s, e.value || e.url || e.data || ''); 25799 ((i.frame = e), 25800 (i.value = e), 25801 (t = i), 25802 Object.defineProperties(t.frame, { 25803 id: { 25804 get() { 25805 return ( 25806 E.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.'), 25807 t.value.key 25808 ); 25809 } 25810 }, 25811 value: { 25812 get() { 25813 return ( 25814 E.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.'), 25815 t.value.data 25816 ); 25817 } 25818 }, 25819 privateData: { 25820 get() { 25821 return ( 25822 E.log.warn( 25823 'cue.frame.privateData is deprecated. Use cue.value.data instead.' 25824 ), 25825 t.value.data 25826 ); 25827 } 25828 } 25829 }), 25830 a.addCue(i)); 25831 }); 25832 }), 25833 a.cues) && 25834 a.cues.length 25835 ) { 25836 var s = a.cues, 25837 l = []; 25838 for (let e = 0; e < s.length; e++) s[e] && l.push(s[e]); 25839 let r = l.reduce((e, t) => { 25840 var i = e[t.startTime] || []; 25841 return (i.push(t), (e[t.startTime] = i), e); 25842 }, {}), 25843 n = Object.keys(r).sort((e, t) => Number(e) - Number(t)); 25844 n.forEach((e, t) => { 25845 var i = r[e], 25846 e = isFinite(o) ? o : e; 25847 let s = Number(n[t + 1]) || e; 25848 i.forEach((e) => { 25849 e.endTime = s; 25850 }); 25851 }); 25852 } 25853 } 25854 }, 25855 zu = { 25856 id: 'ID', 25857 class: 'CLASS', 25858 startDate: 'START-DATE', 25859 duration: 'DURATION', 25860 endDate: 'END-DATE', 25861 endOnNext: 'END-ON-NEXT', 25862 plannedDuration: 'PLANNED-DURATION', 25863 scte35Out: 'SCTE35-OUT', 25864 scte35In: 'SCTE35-IN' 25865 }, 25866 $u = new Set([ 25867 'id', 25868 'class', 25869 'startDate', 25870 'duration', 25871 'endDate', 25872 'endOnNext', 25873 'startTime', 25874 'endTime', 25875 'processDateRange' 25876 ]), 25877 Wu = (e, t, i) => { 25878 e.metadataTrack_ || 25879 ((e.metadataTrack_ = i.addRemoteTextTrack( 25880 { kind: 'metadata', label: 'Timed Metadata' }, 25881 !1 25882 ).track), 25883 E.browser.IS_ANY_SAFARI) || 25884 (e.metadataTrack_.inBandMetadataTrackDispatchType = t); 25885 }, 25886 Gu = (e) => 'number' == typeof e && isFinite(e), 25887 Xu = (e) => { 25888 var { 25889 startOfSegment: t, 25890 duration: i, 25891 segment: s, 25892 part: r, 25893 playlist: { mediaSequence: n, id: a, segments: o = [] }, 25894 mediaIndex: l, 25895 partIndex: d, 25896 timeline: h 25897 } = e, 25898 o = o.length - 1; 25899 let u = 'mediaIndex/partIndex increment'; 25900 (e.getMediaInfoForTime 25901 ? (u = `getMediaInfoForTime (${e.getMediaInfoForTime})`) 25902 : e.isSyncRequest && (u = 'getSyncSegmentCandidate (isSyncRequest)'), 25903 e.independent && (u += ' with independent ' + e.independent)); 25904 var c = 'number' == typeof d, 25905 e = e.segment.uri ? 'segment' : 'pre-segment', 25906 p = c ? Jd({ preloadSegment: s }) - 1 : 0; 25907 return ( 25908 e + 25909 ` [${n + l}/${n + o}]` + 25910 (c ? ` part [${d}/${p}]` : '') + 25911 ` segment start/end [${s.start} => ${s.end}]` + 25912 (c ? ` part start/end [${r.start} => ${r.end}]` : '') + 25913 ` startOfSegment [${t}]` + 25914 ` duration [${i}]` + 25915 ` timeline [${h}]` + 25916 ` selected by [${u}]` + 25917 ` playlist [${a}]` 25918 ); 25919 }, 25920 Ku = (e) => e + 'TimingInfo', 25921 Yu = ({ 25922 timelineChangeController: e, 25923 currentTimeline: t, 25924 segmentTimeline: i, 25925 loaderType: s, 25926 audioDisabled: r 25927 }) => { 25928 return !( 25929 t === i || 25930 ('audio' === s 25931 ? (t = e.lastTimelineChange({ type: 'main' }
25931)) && t.to === i 25932 : 'main' !== s || !r || ((t = e.pendingTimelineChange({ type: 'audio' })) && t.to === i)) 25933 ); 25934 }, 25935 Qu = (e) => { 25936 var t, 25937 i, 25938 s, 25939 r = e.pendingSegment_; 25940 r && 25941 Yu({ 25942 timelineChangeController: e.timelineChangeController_, 25943 currentTimeline: e.currentTimeline_, 25944 segmentTimeline: r.timeline, 25945 loaderType: e.loaderType_, 25946 audioDisabled: e.audioDisabled_ 25947 }) && 25948 !!( 25949 (r = e.timelineChangeController_) && 25950 ((t = r.pendingTimelineChange({ type: 'audio' })), 25951 (r = r.pendingTimelineChange({ type: 'main' })), 25952 (s = (i = t && r) && t.to !== r.to), 25953 i) && 25954 -1 !== t.from && 25955 -1 !== r.from && 25956 s 25957 ) && 25958 ((t = (i = e).timelineChangeController_.pendingTimelineChange({ type: 'audio' })), 25959 (i = i.timelineChangeController_.pendingTimelineChange({ type: 'main' })), 25960 t && i && t.to < i.to 25961 ? e.timelineChangeController_.trigger('audioTimelineBehind') 25962 : (r = e) && (r.pause(), r.resetEverything(), r.load())); 25963 }, 25964 Ju = ({ segmentDuration: e, maxDuration: t }) => !!e && Math.round(e) > t + zd, 25965 Zu = (e, t) => { 25966 var i, s, r; 25967 return 'hls' === t && 25968 (t = ((e) => { 25969 let s = 0; 25970 return ( 25971 ['video', 'audio'].forEach(function (t) { 25972 t = e[t + 'TimingInfo']; 25973 if (t) { 25974 var { start: t, end: i } = t; 25975 let e; 25976 ('bigint' == typeof t || 'bigint' == typeof i 25977 ? (e = window.BigInt(i) - window.BigInt(t)) 25978 : 'number' == typeof t && 'number' == typeof i && (e = i - t), 25979 'undefined' != typeof e && e > s && (s = e)); 25980 } 25981 }), 25982 (s = 'bigint' == typeof s && s < Number.MAX_SAFE_INTEGER ? Number(s) : s) 25983 ); 25984 })({ audioTimingInfo: e.audioTimingInfo, videoTimingInfo: e.videoTimingInfo })) && 25985 ((i = e.playlist.targetDuration), 25986 (s = Ju({ segmentDuration: t, maxDuration: 2 * i })), 25987 (r = Ju({ segmentDuration: t, maxDuration: i })), 25988 (t = 25989 `Segment with index ${e.mediaIndex} ` + 25990 `from playlist ${e.playlist.id} ` + 25991 `has a duration of ${t} ` + 25992 `when the reported duration is ${e.duration} ` + 25993 `and the target duration is ${i}. ` + 25994 'For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1'), 25995 s || r) 25996 ? { severity: s ? 'warn' : 'info', message: t } 25997 : null; 25998 }, 25999 ec = ({ type: e, segment: t }) => { 26000 var i, s, r; 26001 if (t) 26002 return ( 26003 (i = Boolean(t.key || (t.map && t.map.ke))), 26004 (s = Boolean(t.map && !t.map.bytes)), 26005 (r = void 0 === t.startOfSegment ? t.start : t.startOfSegment), 26006 { 26007 type: e || t.type, 26008 uri: t.resolvedUri || t.uri, 26009 start: r, 26010 duration: t.duration, 26011 isEncrypted: i, 26012 isMediaInitialization: s 26013 } 26014 ); 26015 }; 26016 class tc extends E.EventTarget { 26017 constructor(e, t = 0) { 26018 if ((super(), !e)) throw new TypeError('Initialization settings are required'); 26019 if ('function' != typeof e.currentTime) 26020 throw new TypeError('No currentTime getter specified'); 26021 if (!e.mediaSource) throw new TypeError('No MediaSource specified'); 26022 ((this.bandwidth = e.bandwidth), 26023 (this.throughput = { rate: 0, count: 0 }), 26024 (this.roundTrip = NaN), 26025 this.resetStats_(), 26026 (this.mediaIndex = null), 26027 (this.partIndex = null), 26028 (this.hasPlayed_ = e.hasPlayed), 26029 (this.currentTime_ = e.currentTime), 26030 (this.seekable_ = e.seekable), 26031 (this.seeking_ = e.seeking), 26032 (this.duration_ = e.duration), 26033 (this.mediaSource_ = e.mediaSource), 26034 (this.vhs_ = e.vhs), 26035 (this.loaderType_ = e.loaderType), 26036 (this.currentMediaInfo_ = void 0), 26037 (this.startingMediaInfo_ = void 0), 26038 (this.segmentMetadataTrack_ = e.segmentMetadataTrack), 26039 (this.goalBufferLength_ = e.goalBufferLength), 26040 (this.sourceType_ = e.sourceType), 26041 (this.sourceUpdater_ = e.sourceUpdater), 26042 (this.inbandTextTracks_ = e.inbandTextTracks), 26043 (this.state_ = 'INIT'), 26044 (this.timelineChangeController_ = e.timelineChangeController), 26045 (this.shouldSaveSegmentTimingInfo_ = !0), 26046 (this.parse708captions_ = e.parse708captions), 26047 (this.useDtsForTimestampOffset_ = e.useDtsForTimestampOffset), 26048 (this.captionServices_ = e.captionServices), 26049 (this.exactManifestTimings = e.exactManifestTimings), 26050 (this.addMetadataToTextTrack = e.addMetadataToTextTrack), 26051 (this.checkBufferTimeout_ = null),
26052 (this.error_ = void 0), 26053 (this.currentTimeline_ = -1), 26054 (this.shouldForceTimestampOffsetAfterResync_ = !1), 26055 (this.pendingSegment_ = null), 26056 (this.xhrOptions_ = null), 26057 (this.pendingSegments_ = []), 26058 (this.audioDisabled_ = !1), 26059 (this.isPendingTimestampOffset_ = !1), 26060 (this.gopBuffer_ = []), 26061 (this.timeMapping_ = 0), 26062 (this.safeAppend_ = !1), 26063 (this.appendInitSegment_ = { audio: !0, video: !0 }), 26064 (this.playlistOfLastInitSegment_ = { audio: null, video: null }), 26065 (this.callQueue_ = []), 26066 (this.loadQueue_ = []), 26067 (this.metadataQueue_ = { id3: [], caption: [] }), 26068 (this.waitingOnRemove_ = !1), 26069 (this.quotaExceededErrorRetryTimeout_ = null), 26070 (this.activeInitSegmentId_ = null), 26071 (this.initSegments_ = {}), 26072 (this.cacheEncryptionKeys_ = e.cacheEncryptionKeys), 26073 (this.keyCache_ = {}), 26074 (this.decrypter_ = e.decrypter), 26075 (this.syncController_ = e.syncController), 26076 (this.syncPoint_ = { segmentIndex: 0, time: 0 }), 26077 (this.transmuxer_ = this.createTransmuxer_()), 26078 (this.triggerSyncInfoUpdate_ = () => this.trigger('syncinfoupdate')), 26079 this.syncController_.on('syncinfoupdate', this.triggerSyncInfoUpdate_), 26080 this.mediaSource_.addEventListener('sourceopen', () => { 26081 this.isEndOfStream_() || (this.ended_ = !1); 26082 }), 26083 (this.fetchAtBuffer_ = !1), 26084 (this.logger_ = Ud(`SegmentLoader[${this.loaderType_}]`)), 26085 Object.defineProperty(this, 'state', { 26086 get() { 26087 return this.state_; 26088 }, 26089 set(e) { 26090 e !== this.state_ && 26091 (this.logger_(this.state_ + ' -> ' + e), 26092 (this.state_ = e), 26093 this.trigger('statechange')); 26094 } 26095 }), 26096 this.sourceUpdater_.on('ready', () => { 26097 this.hasEnoughInfoToAppend_() ? this.processCallQueue_() : Qu(this); 26098 }), 26099 this.sourceUpdater_.on('codecschange', (e) => { 26100 this.trigger(f({ type: 'codecschange' }, e)); 26101 }), 26102 'main' === this.loaderType_ && 26103 this.timelineChangeController_.on('pendingtimelinechange', () => { 26104 this.hasEnoughInfoToAppend_() ? this.processCallQueue_() : Qu(this); 26105 }), 26106 'audio' === this.loaderType_ && 26107 this.timelineChangeController_.on('timelinechange', (e) => { 26108 (this.trigger(f({ type: 'timelinechange' }, e)), 26109 this.hasEnoughInfoToLoad_() ? this.processLoadQueue_() : Qu(this), 26110 this.hasEnoughInfoToAppend_() ? this.processCallQueue_() : Qu(this)); 26111 })); 26112 } 26113 get mediaSequenceSync_() { 26114 return this.syncController_.getMediaSequenceSync(this.loaderType_); 26115 } 26116 createTransmuxer_() { 26117 return cu({ 26118 remux: !1, 26119 alignGopsAtEnd: this.safeAppend_, 26120 keepOriginalTimestamps: !0, 26121 parse708captions: this.parse708captions_, 26122 captionServices: this.captionServices_ 26123 }); 26124 } 26125 resetStats_() { 26126 ((this.mediaBytesTransferred = 0), 26127 (this.mediaRequests = 0), 26128 (this.mediaRequestsAborted = 0), 26129 (this.mediaRequestsTimedout = 0), 26130 (this.mediaRequestsErrored = 0), 26131 (this.mediaTransferDuration = 0), 26132 (this.mediaSecondsLoaded = 0), 26133 (this.mediaAppends = 0)); 26134 } 26135 dispose() { 26136 (this.trigger('dispose'), 26137 (this.state = 'DISPOSED'), 26138 this.pause(), 26139 this.abort_(), 26140 this.transmuxer_ && this.transmuxer_.terminate(), 26141 this.resetStats_(), 26142 this.checkBufferTimeout_ && window.clearTimeout(this.checkBufferTimeout_), 26143 this.syncController_ && 26144 this.triggerSyncInfoUpdate_ && 26145 this.syncController_.off('syncinfoupdate', this.triggerSyncInfoUpdate_), 26146 this.off()); 26147 } 26148 setAudio(e) { 26149 ((this.audioDisabled_ = !e), 26150 e 26151 ? (this.appendInitSegment_.audio = !0) 26152 : this.sourceUpdater_.removeAudio(0, this.duration_())); 26153 } 26154 abort() { 26155 'WAITING' !== this.state 26156 ? this.pendingSegment_ && (this.pendingSegment_ = null) 26157 : (this.abort_(), (this.state = 'READY'), this.paused() || this.monitorBuffer_()); 26158 } 26159 abort_() { 26160 (this.pendingSegment_ && 26161 this.pendingSegment_.abortRequests && 26162 this.pendingSegment_.abortRequests(), 26163 (this.pendingSegment_ = null),
26164 (this.callQueue_ = []), 26165 (this.loadQueue_ = []), 26166 (this.metadataQueue_.id3 = []), 26167 (this.metadataQueue_.caption = []), 26168 this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_), 26169 (this.waitingOnRemove_ = !1), 26170 window.clearTimeout(this.quotaExceededErrorRetryTimeout_), 26171 (this.quotaExceededErrorRetryTimeout_ = null)); 26172 } 26173 checkForAbort_(e) { 26174 return 'APPENDING' !== this.state || this.pendingSegment_ 26175 ? !this.pendingSegment_ || this.pendingSegment_.requestId !== e 26176 : ((this.state = 'READY'), !0); 26177 } 26178 error(e) { 26179 return ( 26180 'undefined' != typeof e && (this.logger_('error occurred:', e), (this.error_ = e)), 26181 (this.pendingSegment_ = null), 26182 this.error_ 26183 ); 26184 } 26185 endOfStream() { 26186 ((this.ended_ = !0), 26187 this.transmuxer_ && uu(this.transmuxer_), 26188 (this.gopBuffer_.length = 0), 26189 this.pause(), 26190 this.trigger('ended')); 26191 } 26192 buffered_() { 26193 var e = this.getMediaInfo_(); 26194 if (!this.sourceUpdater_ || !e) return O(); 26195 if ('main' === this.loaderType_) { 26196 var { hasAudio: e, hasVideo: t, isMuxed: i } = e; 26197 if (t && e && !this.audioDisabled_ && !i) return this.sourceUpdater_.buffered(); 26198 if (t) return this.sourceUpdater_.videoBuffered(); 26199 } 26200 return this.sourceUpdater_.audioBuffered(); 26201 } 26202 initSegmentForMap(e, t = !1) { 26203 if (!e) return null; 26204 var i = Rh(e); 26205 let s = this.initSegments_[i]; 26206 return ( 26207 t && 26208 !s && 26209 e.bytes && 26210 (this.initSegments_[i] = s = 26211 { 26212 resolvedUri: e.resolvedUri, 26213 byterange: e.byterange, 26214 bytes: e.bytes, 26215 tracks: e.tracks, 26216 timescales: e.timescales 26217 }), 26218 s || e 26219 ); 26220 } 26221 segmentKey(e, t = !1) { 26222 if (!e) return null; 26223 var i = Nh(e); 26224 let s = this.keyCache_[i]; 26225 this.cacheEncryptionKeys_ && 26226 t && 26227 !s && 26228 e.bytes && 26229 (this.keyCache_[i] = s = { resolvedUri: e.resolvedUri, bytes: e.bytes }); 26230 t = { resolvedUri: (s || e).resolvedUri }; 26231 return (s && (t.bytes = s.bytes), t); 26232 } 26233 couldBeginLoading_() { 26234 return this.playlist_ && !this.paused(); 26235 } 26236 load() { 26237 if ((this.monitorBuffer_(), this.playlist_)) 26238 return 'INIT' === this.state && this.couldBeginLoading_() 26239 ? this.init_() 26240 : void ( 26241 !this.couldBeginLoading_() || 26242 ('READY' !== this.state && 'INIT' !== this.state) || 26243 (this.state = 'READY') 26244 ); 26245 } 26246 init_() { 26247 return ((this.state = 'READY'), this.resetEverything(), this.monitorBuffer_()); 26248 } 26249 playlist(t, i = {}) { 26250 if (t) { 26251 var s, 26252 r = this.playlist_, 26253 n = this.pendingSegment_; 26254 ((this.playlist_ = t), 26255 (this.xhrOptions_ = i), 26256 'INIT' === this.state && 26257 ((t.syncInfo = { mediaSequence: t.mediaSequence, time: 0 }), 26258 'main' === this.loaderType_) && 26259 this.syncController_.setDateTimeMappingForStart(t)); 26260 let e = null; 26261 if ( 26262 (r && (r.id ? (e = r.id) : r.uri && (e = r.uri)), 26263 this.logger_(`playlist update [${e} => ${t.id || t.uri}]`), 26264 this.mediaSequenceSync_ && 26265 (this.mediaSequenceSync_.update(t, this.currentTime_()), 26266 this.logger_( 26267 `Playlist update: 26268currentTime: ${this.currentTime_()} 26269bufferedEnd: ${qd(this.buffered_())} 26270`, 26271 this.mediaSequenceSync_.diagnostics 26272 )), 26273 this.trigger('syncinfoupdate'), 26274 'INIT' === this.state && this.couldBeginLoading_()) 26275 ) 26276 return this.init_(); 26277 r && r.uri === t.uri 26278 ? ((i = t.mediaSequence - r.mediaSequence), 26279 this.logger_(`live window shift [${i}]`), 26280 null !== this.mediaIndex && 26281 ((this.mediaIndex -= i), 26282 this.mediaIndex < 0 26283 ? ((this.mediaIndex = null), (this.partIndex = null)) 26284 : ((s = this.playlist_.segments[this.mediaIndex]), 26285 !this.partIndex || 26286 (s.parts && s.parts.length && s.parts[this.partIndex]) || 26287 ((s = this.mediaIndex), 26288 this.logger_( 26289 `currently processing part (index ${this.partIndex}) no longer exists.` 26290 ), 26291 this.resetLoader(), 26292 (this.mediaIndex = s)))), 26293 n && 26294 ((n.mediaIndex -= i), 26295 n.mediaIndex < 0 26296 ? ((n.mediaIndex = null), (n.partIndex = null)) 26297 : (0 <= n.mediaIndex && (n.segment = t.segments[n.mediaIndex]), 26298 0 <= n.partIndex && n.segment.parts && (n.part = n.segment.parts[n.partIndex]))), 26299 this.syncController_.saveExpiredSegmentInfo(r, t)) 26300 : (null !== this.mediaIndex && 26301 (!t.endList && 'number' == typeof t.partTargetDuration 26302 ? this.resetLoader() 26303 : this.resyncLoader()), 26304 (this.currentMediaInfo_ = void 0), 26305 this.trigger('playlistupdate')); 26306 } 26307 } 26308 pause() { 26309 this.checkBufferTimeout_ && 26310 (window.clearTimeout(this.checkBufferTimeout_), (this.checkBufferTimeout_ = null)); 26311 } 26312 paused() { 26313 return null === this.checkBufferTimeout_; 26314 } 26315 resetEverything(e) { 26316 ((this.ended_ = !1), 26317 (this.activeInitSegmentId_ = null),
26318 (this.appendInitSegment_ = { audio: !0, video: !0 }), 26319 this.resetLoader(), 26320 this.remove(0, 1 / 0, e), 26321 this.transmuxer_ && 26322 (this.transmuxer_.postMessage({ action: 'clearAllMp4Captions' }), 26323 this.transmuxer_.postMessage({ action: 'reset' }))); 26324 } 26325 resetLoader() { 26326 ((this.fetchAtBuffer_ = !1), 26327 this.mediaSequenceSync_ && this.mediaSequenceSync_.resetAppendedStatus(), 26328 this.resyncLoader()); 26329 } 26330 resyncLoader() { 26331 (this.transmuxer_ && uu(this.transmuxer_), 26332 (this.mediaIndex = null), 26333 (this.partIndex = null), 26334 (this.syncPoint_ = null), 26335 (this.isPendingTimestampOffset_ = !1)); 26336 var e = this.currentMediaInfo_ && this.currentMediaInfo_.isFmp4; 26337 ('hls' !== this.sourceType_ || e || (this.shouldForceTimestampOffsetAfterResync_ = !0), 26338 (this.callQueue_ = []), 26339 (this.loadQueue_ = []), 26340 (this.metadataQueue_.id3 = []), 26341 (this.metadataQueue_.caption = []), 26342 this.abort(), 26343 this.transmuxer_ && this.transmuxer_.postMessage({ action: 'clearParsedMp4Captions' })); 26344 } 26345 remove(t, i, s = () => {}, r = !1) { 26346 if ((i = i === 1 / 0 ? this.duration_() : i) <= t) 26347 this.logger_('skipping remove because end ${end} is <= start ${start}'); 26348 else if (this.sourceUpdater_ && this.getMediaInfo_()) { 26349 let e = 1; 26350 var n, 26351 a = () => { 26352 0 === --e && s(); 26353 }; 26354 for (n in ((!r && this.audioDisabled_) || (e++, this.sourceUpdater_.removeAudio(t, i, a)), 26355 (!r && 'main' !== this.loaderType_) || 26356 ((this.gopBuffer_ = ((t, i, e, s) => {
26357 var r = Math.ceil((i - s) * Rd), 26358 n = Math.ceil((e - s) * Rd), 26359 i = t.slice(); 26360 let a = t.length; 26361 for (; a-- && !(t[a].pts <= n); ); 26362 if (-1 !== a) { 26363 let e = a + 1; 26364 for (; e-- && !(t[e].pts <= r); ); 26365 ((e = Math.max(e, 0)), i.splice(e, a - e + 1)); 26366 } 26367 return i; 26368 })(this.gopBuffer_, t, i, this.timeMapping_)), 26369 e++, 26370 this.sourceUpdater_.removeVideo(t, i, a)), 26371 this.inbandTextTracks_)) 26372 Vu(t, i, this.inbandTextTracks_[n]); 26373 (Vu(t, i, this.segmentMetadataTrack_), a()); 26374 } else this.logger_('skipping remove because no source updater or starting media info'); 26375 } 26376 monitorBuffer_() { 26377 (this.checkBufferTimeout_ && window.clearTimeout(this.checkBufferTimeout_), 26378 (this.checkBufferTimeout_ = window.setTimeout(this.monitorBufferTick_.bind(this), 1))); 26379 } 26380 monitorBufferTick_() { 26381 ('READY' === this.state && this.fillBuffer_(), 26382 this.checkBufferTimeout_ && window.clearTimeout(this.checkBufferTimeout_), 26383 (this.checkBufferTimeout_ = window.setTimeout(this.monitorBufferTick_.bind(this), 500))); 26384 } 26385 fillBuffer_() { 26386 var e, t; 26387 this.sourceUpdater_.updating() || 26388 ((e = this.chooseNextRequest_()) && 26389 ((t = { segmentInfo: ec({ type: this.loaderType_, segment: e }) }), 26390 this.trigger({ type: 'segmentselected', metadata: t }), 26391 'number' == typeof e.timestampOffset && 26392 ((this.isPendingTimestampOffset_ = !1), 26393 this.timelineChangeController_.pendingTimelineChange({ 26394 type: this.loaderType_, 26395 from: this.currentTimeline_, 26396 to: e.timeline 26397 })), 26398 this.loadSegment_(e))); 26399 } 26400 isEndOfStream_(e = this.mediaIndex, t = this.playlist_, i = this.partIndex) { 26401 var s; 26402 return ( 26403 !(!t || !this.mediaSource_) && 26404 ((s = 'number' == typeof e && t.segments[e]), 26405 (e = e + 1 === t.segments.length), 26406 (i = !s || !s.parts || i + 1 === s.parts.length), 26407 t.endList) && 26408 'open' === this.mediaSource_.readyState && 26409 e && 26410 i 26411 ); 26412 } 26413 chooseNextRequest_() { 26414 var e = this.buffered_(), 26415 s = qd(e) || 0, 26416 e = jd(e, this.currentTime_()), 26417 r = !this.hasPlayed_() && 1 <= e, 26418 n = e >= this.goalBufferLength_(), 26419 t = this.playlist_.segments; 26420 if (!t.length || r || n) return null; 26421 this.syncPoint_ = 26422 this.syncPoint_ || 26423 this.syncController_.getSyncPoint( 26424 this.playlist_, 26425 this.duration_(), 26426 this.currentTimeline_, 26427 this.currentTime_(), 26428 this.loaderType_ 26429 ); 26430 r = { 26431 partIndex: null, 26432 mediaIndex: null, 26433 startOfSegment: null, 26434 playlist: this.playlist_, 26435 isSyncRequest: Boolean(!this.syncPoint_) 26436 }; 26437 if (r.isSyncRequest) 26438 ((r.mediaIndex = (function (t, i, s) { 26439 i = i || []; 26440 var r = []; 26441 let n = 0; 26442 for (let e = 0; e < i.length; e++) { 26443 var a = i[e]; 26444 if (t === a.timeline && (r.push(e), (n += a.duration) > s)) return e; 26445 } 26446 return 0 === r.length ? 0 : r[r.length - 1]; 26447 })(this.currentTimeline_, t, s)), 26448 this.logger_( 26449 'choose next request. Can not find sync point. Fallback to media Index: ' + r.mediaIndex 26450 )); 26451 else if (null !== this.mediaIndex) { 26452 var n = t[this.mediaIndex], 26453 a = 'number' == typeof this.partIndex ? this.partIndex : -1; 26454 ((r.startOfSegment = n.end || s), 26455 n.parts && n.parts[a + 1] 26456 ? ((r.mediaIndex = this.mediaIndex), (r.partIndex = a + 1)) 26457 : (r.mediaIndex = this.mediaIndex + 1)); 26458 } else { 26459 let e, t, i; 26460 n = this.fetchAtBuffer_ ? s : this.currentTime_(); 26461 if ( 26462 (this.mediaSequenceSync_ && 26463 this.logger_( 26464 `chooseNextRequest_ request after Quality Switch: 26465For TargetTime: ${n}. 26466CurrentTime: ${this.currentTime_()} 26467BufferedEnd: ${s} 26468Fetch At Buffer: ${this.fetchAtBuffer_} 26469`, 26470 this.mediaSequenceSync_.diagnostics 26471 ), 26472 this.mediaSequenceSync_ && this.mediaSequenceSync_.isReliable) 26473 ) {
26474 a = this.getSyncInfoFromMediaSequenceSync_(n); 26475 if (!a) 26476 return ( 26477 this.error({ 26478 message: (s = 'No sync info found while using media sequence sync'), 26479 metadata: { 26480 errorType: E.Error.StreamingFailedToSelectNextSegment, 26481 error: new Error(s) 26482 } 26483 }), 26484 this.logger_('chooseNextRequest_ - no sync info found using media sequence sync'), 26485 null 26486 ); 26487 (this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${a.start} --> ${a.end})`), 26488 (e = a.segmentIndex), 26489 (t = a.partIndex), 26490 (i = a.start)); 26491 } else { 26492 this.logger_( 26493 'chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.' 26494 ); 26495 s = ch.getMediaInfoForTime({ 26496 exactManifestTimings: this.exactManifestTimings, 26497 playlist: this.playlist_, 26498 currentTime: n, 26499 startingPartIndex: this.syncPoint_.partIndex, 26500 startingSegmentIndex: this.syncPoint_.segmentIndex, 26501 startTime: this.syncPoint_.time 26502 }); 26503 ((e = s.segmentIndex), (t = s.partIndex), (i = s.startTime)); 26504 } 26505 ((r.getMediaInfoForTime = this.fetchAtBuffer_ ? 'bufferedEnd ' + n : 'currentTime ' + n), 26506 (r.mediaIndex = e), 26507 (r.startOfSegment = i), 26508 (r.partIndex = t), 26509 this.logger_( 26510 `choose next request. Playlist switched and we have a sync point. Media Index: ${r.mediaIndex} ` 26511 )); 26512 } 26513 a = t[r.mediaIndex]; 26514 let i = a && 'number' == typeof r.partIndex && a.parts && a.parts[r.partIndex]; 26515 if (!a || ('number' == typeof r.partIndex && !i)) return null; 26516 'number' != typeof r.partIndex && a.parts && ((r.partIndex = 0), (i = a.parts[0])); 26517 ((s = 26518 (this.vhs_.playlists && 26519 this.vhs_.playlists.main && 26520 this.vhs_.playlists.main.independentSegments) || 26521 this.playlist_.independentSegments), 26522 e || 26523 !i || 26524 s || 26525 i.independent || 26526 (0 === r.partIndex 26527 ? (e = 26528 (n = t[r.mediaIndex - 1]).parts && n.parts.length && n.parts[n.parts.length - 1]) && 26529 e.independent && 26530 (--r.mediaIndex, 26531 (r.partIndex = n.parts.length - 1), 26532 (r.independent = 'previous segment')) 26533 : a.parts[r.partIndex - 1].independent && 26534 (--r.partIndex, (r.independent = 'previous part'))), 26535 (s = this.mediaSource_ && 'ended' === this.mediaSource_.readyState)); 26536 return r.mediaIndex >= t.length - 1 && s && !this.seeking_() 26537 ? null 26538 : (this.shouldForceTimestampOffsetAfterResync_ && 26539 ((this.shouldForceTimestampOffsetAfterResync_ = !1), 26540 (r.forceTimestampOffset = !0), 26541 this.logger_('choose next request. Force timestamp offset after loader resync')), 26542 this.generateSegmentInfo_(r)); 26543 } 26544 getSyncInfoFromMediaSequenceSync_(e) { 26545 var t; 26546 return this.mediaSequenceSync_ && 26547 (e !== (t = Math.max(e, this.mediaSequenceSync_.start)) && 26548 this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ` + t), 26549 (e = this.mediaSequenceSync_.getSyncInfoForTime(t))) 26550 ? e.isAppended 26551 ? (t = this.mediaSequenceSync_.getSyncInfoForTime(e.end)) 26552 ? (t.isAppended && 26553 this.logger_( 26554 'getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!' 26555 ), 26556 t) 26557 : null 26558 : e 26559 : null; 26560 } 26561 generateSegmentInfo_(e) { 26562 var { 26563 independent: e, 26564 playlist: t, 26565 mediaIndex: i, 26566 startOfSegment: s, 26567 isSyncRequest: r, 26568 partIndex: n, 26569 forceTimestampOffset: a, 26570 getMediaInfoForTime: o 26571 } = e, 26572 l = t.segments[i], 26573 d = 'number' == typeof n && l.parts[n], 26574 i = { 26575 requestId: 'segment-loader-' + Math.random(), 26576 uri: (d && d.resolvedUri) || l.resolvedUri, 26577 mediaIndex: i, 26578 partIndex: d ? n : null, 26579 isSyncRequest: r, 26580 startOfSegment: s, 26581 playlist: t, 26582 bytes: null, 26583 encryptedBytes: null, 26584 timestampOffset: null, 26585 timeline: l.timeline, 26586 duration: (d && d.duration) || l.duration, 26587 segment: l, 26588 part: d, 26589 byteLength: 0, 26590 transmuxer: this.transmuxer_, 26591 getMediaInfoForTime: o, 26592 independent: e 26593 }, 26594 n = 'undefined' != typeof a ? a : this.isPendingTimestampOffset_, 26595 r = 26596 ((i.timestampOffset = this.timestampOffsetForSegment_({ 26597 segmentTimeline: l.timeline, 26598 currentTimeline: this.currentTimeline_, 26599 startOfSegment: s, 26600 buffered: this.buffered_(), 26601 overrideCheck: n 26602 })),
26603 qd(this.sourceUpdater_.audioBuffered())); 26604 return ( 26605 'number' == typeof r && 26606 (i.audioAppendStart = r - this.sourceUpdater_.audioTimestampOffset()), 26607 this.sourceUpdater_.videoBuffered().length && 26608 (i.gopsToAlignWith = ((e, t, i) => { 26609 if ('undefined' == typeof t || null === t || !e.length) return []; 26610 var s = Math.ceil((t - i + 3) * Rd); 26611 let r; 26612 for (r = 0; r < e.length && !(e[r].pts > s); r++); 26613 return e.slice(r); 26614 })( 26615 this.gopBuffer_, 26616 this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(), 26617 this.timeMapping_ 26618 )), 26619 i 26620 ); 26621 } 26622 timestampOffsetForSegment_(e) { 26623 return ( 26624 ({ 26625 segmentTimeline: e, 26626 currentTimeline: t, 26627 startOfSegment: i, 26628 buffered: s, 26629 overrideCheck: r 26630 } = [e][0]), 26631 r || e !== t ? (!(e < t) && s.length ? s.end(s.length - 1) : i) : null 26632 ); 26633 var t, i, s, r; 26634 } 26635 earlyAbortWhenNeeded_(t) { 26636 if ( 26637 !this.vhs_.tech_.paused() && 26638 this.xhrOptions_.timeout && 26639 this.playlist_.attributes.BANDWIDTH && 26640 !(Date.now() - (t.firstBytesReceivedAt || Date.now()) < 1e3) 26641 ) { 26642 var e = this.currentTime_(), 26643 i = t.bandwidth, 26644 s = this.pendingSegment_.duration, 26645 t = ch.estimateSegmentRequestTime(s, i, this.playlist_, t.bytesReceived), 26646 r = 26647 (([r, n, a = 1] = [this.buffered_(), e, this.vhs_.tech_.playbackRate()]), 26648 ((r.length ? r.end(r.length - 1) : 0) - n) / a - 1); 26649 if (!(t <= r)) { 26650 var n = (function (e) { 26651 let { 26652 main: t, 26653 currentTime: i, 26654 bandwidth: s, 26655 duration: r, 26656 segmentDuration: n, 26657 timeUntilRebuffer: a, 26658 currentTimeline: o, 26659 syncController: l 26660 } = e; 26661 e = t.playlists.filter((e) => !ch.isIncompatible(e)); 26662 let d = e.filter(ch.isEnabled); 26663 var e = (d = d.length ? d : e.filter((e) => !ch.isDisabled(e))) 26664 .filter(ch.hasAttribute.bind(null, 'BANDWIDTH')) 26665 .map((e) => { 26666 var t = l.getSyncPoint(e, r, o, i) ? 1 : 2; 26667 return { 26668 playlist: e, 26669 rebufferingImpact: ch.estimateSegmentRequestTime(n, s, e) * t - a 26670 }; 26671 }), 26672 h = e.filter((e) => e.rebufferingImpact <= 0); 26673 return ( 26674 Bu(h, (e, t) => fu(t.playlist, e.playlist)), 26675 h.length 26676 ? h[0] 26677 : (Bu(e, (e, t) => e.rebufferingImpact - t.rebufferingImpact), e[0] || null) 26678 ); 26679 })({ 26680 main: this.vhs_.playlists.main, 26681 currentTime: e, 26682 bandwidth: i, 26683 duration: this.duration_(), 26684 segmentDuration: s, 26685 timeUntilRebuffer: r, 26686 currentTimeline: this.currentTimeline_, 26687 syncController: this.syncController_ 26688 }); 26689 if (n) { 26690 var a = t - r - n.rebufferingImpact; 26691 let e = 0.5; 26692 (r <= zd && (e = 1), 26693 !n.playlist || 26694 n.playlist.uri === this.playlist_.uri || 26695 a < e || 26696 ((this.bandwidth = n.playlist.attributes.BANDWIDTH * R.BANDWIDTH_VARIANCE + 1), 26697 this.trigger('earlyabort'))); 26698 } 26699 } 26700 } 26701 } 26702 handleAbort_(e) { 26703 (this.logger_('Aborting ' + Xu(e)), (this.mediaRequestsAborted += 1)); 26704 } 26705 handleProgress_(e, t) { 26706 (this.earlyAbortWhenNeeded_(t.stats), 26707 this.checkForAbort_(t.requestId) || this.trigger('progress')); 26708 } 26709 handleTrackInfo_(e, t) { 26710 var { hasAudio: i, hasVideo: s } = t, 26711 i = { 26712 segmentInfo: ec({ type: this.loaderType_, segment: e }), 26713 trackInfo: { hasAudio: i, hasVideo: s } 26714 }; 26715 (this.trigger({ type: 'segmenttransmuxingtrackinfoavailable', metadata: i }), 26716 this.earlyAbortWhenNeeded_(e.stats), 26717 this.checkForAbort_(e.requestId) || 26718 this.checkForIllegalMediaSwitch(t) || 26719 ((function (t, i) { 26720 if ((!t && !i) || (!t && i) || (t && !i)) return !1; 26721 if (t !== i) { 26722 var s = Object.keys(t).sort(), 26723 r = Object.keys(i).sort(); 26724 if (s.length !== r.length) return !1; 26725 for (let e = 0; e < s.length; e++) { 26726 var n = s[e]; 26727 if (n !== r[e]) return !1; 26728 if (t[n] !== i[n]) return !1; 26729 } 26730 } 26731 return !0; 26732 })(this.currentMediaInfo_, (t = t || {})) || 26733 ((this.appendInitSegment_ = { audio: !0, video: !0 }), 26734 (this.startingMediaInfo_ = t), 26735 (this.currentMediaInfo_ = t), 26736 this.logger_('trackinfo update', t), 26737 this.trigger('trackinfo')), 26738 this.checkForAbort_(e.requestId)) || 26739 ((this.pendingSegment_.trackInfo = t), 26740 this.hasEnoughInfoToAppend_() ? this.processCallQueue_() : Qu(this))); 26741 } 26742 handleTimingInfo_(e, t, i, s) { 26743 var r; 26744 (this.earlyAbortWhenNeeded_(e.stats), 26745 this.checkForAbort_(e.requestId) || 26746 (((e = this.pendingSegment_)[(r = Ku(t))] = e[r] || {}), 26747 (e[r][i] = s), 26748 this.logger_(`timinginfo: ${t} - ${i} - ` + s), 26749 this.hasEnoughInfoToAppend_() ? this.processCallQueue_() : Qu(this))); 26750 } 26751 handleCaptions_(e, t) { 26752 if ((this.earlyAbortWhenNeeded_(e.stats), !this.checkForAbort_(e.requestId))) 26753 if (0 === t.length) this.logger_('SegmentLoader received no captions from a caption event'); 26754 else if (this.pendingSegment_.hasAppendedData_) { 26755 let n = 26756 null === this.sourceUpdater_.videoTimestampOffset() 26757 ? this.sourceUpdater_.audioTimestampOffset() 26758 : this.sourceUpdater_.videoTimestampOffset(), 26759 a = {}; 26760 (t.forEach((e) => { 26761 a[e.stream] = a[e.stream] || { startTime: 1 / 0, captions: [], endTime: 0 }; 26762 var t = a[e.stream]; 26763 ((t.startTime = Math.min(t.startTime, e.startTime + n)), 26764 (t.endTime = Math.max(t.endTime, e.endTime + n)), 26765 t.captions.push(e)); 26766 }),
26767 Object.keys(a).forEach((e) => { 26768 var { startTime: t, endTime: i, captions: s } = a[e], 26769 r = this.inbandTextTracks_; 26770 (this.logger_(`adding cues from ${t} -> ${i} for ` + e), 26771 (function (r, n, a) { 26772 if (!r[a]) { 26773 n.trigger({ type: 'usage', name: 'vhs-608' }); 26774 let s = a; 26775 /^cc708_/.test(a) && (s = 'SERVICE' + a.split('_')[1]); 26776 var o = n.textTracks().getTrackById(s); 26777 if (o) r[a] = o; 26778 else { 26779 let e = a, 26780 t = a, 26781 i = !1; 26782 o = ((n.options_.vhs && n.options_.vhs.captionServices) || {})[s]; 26783 (o && ((e = o.label), (t = o.language), (i = o.default)), 26784 (r[a] = n.addRemoteTextTrack( 26785 { kind: 'captions', id: s, default: i, label: e, language: t }, 26786 !1 26787 ).track)); 26788 } 26789 } 26790 })(r, this.vhs_.tech_, e), 26791 Vu(t, i, r[e]), 26792 (function ({ inbandTextTracks: n, captionArray: e, timestampOffset: a }) { 26793 if (e) { 26794 let r = window.WebKitDataCue || window.VTTCue; 26795 e.forEach((i) => { 26796 let s = i.stream; 26797 i.content 26798 ? i.content.forEach((e) => { 26799 var t = new r(i.startTime + a, i.endTime + a, e.text); 26800 ((t.line = e.line), 26801 (t.align = 'left'), 26802 (t.position = e.position), 26803 (t.positionAlign = 'line-left'), 26804 n[s].addCue(t)); 26805 }) 26806 : n[s].addCue(new r(i.startTime + a, i.endTime + a, i.text)); 26807 }); 26808 } 26809 })({ captionArray: s, inbandTextTracks: r, timestampOffset: n })); 26810 }), 26811 this.transmuxer_ && this.transmuxer_.postMessage({ action: 'clearParsedMp4Captions' })); 26812 } else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, e, t)); 26813 } 26814 handleId3_(e, t, i) { 26815 (this.earlyAbortWhenNeeded_(e.stats), 26816 this.checkForAbort_(e.requestId) || 26817 (this.pendingSegment_.hasAppendedData_ 26818 ? this.addMetadataToTextTrack(i, t, this.duration_()) 26819 : this.metadataQueue_.id3.push(this.handleId3_.bind(this, e, t, i)))); 26820 } 26821 processMetadataQueue_() { 26822 (this.metadataQueue_.id3.forEach((e) => e()), 26823 this.metadataQueue_.caption.forEach((e) => e()), 26824 (this.metadataQueue_.id3 = []), 26825 (this.metadataQueue_.caption = [])); 26826 } 26827 processCallQueue_() { 26828 var e = this.callQueue_; 26829 ((this.callQueue_ = []), e.forEach((e) => e())); 26830 } 26831 processLoadQueue_() { 26832 var e = this.loadQueue_; 26833 ((this.loadQueue_ = []), e.forEach((e) => e())); 26834 } 26835 hasEnoughInfoToLoad_() { 26836 var e; 26837 return ( 26838 'audio' !== this.loaderType_ || 26839 !( 26840 !(e = this.pendingSegment_) || 26841 (this.getCurrentMediaInfo_() && 26842 Yu({ 26843 timelineChangeController: this.timelineChangeController_, 26844 currentTimeline: this.currentTimeline_, 26845 segmentTimeline: e.timeline, 26846 loaderType: this.loaderType_, 26847 audioDisabled: this.audioDisabled_ 26848 })) 26849 ) 26850 ); 26851 } 26852 getCurrentMediaInfo_(e = this.pendingSegment_) { 26853 return (e && e.trackInfo) || this.currentMediaInfo_; 26854 } 26855 getMediaInfo_(e = this.pendingSegment_) { 26856 return this.getCurrentMediaInfo_(e) || this.startingMediaInfo_; 26857 } 26858 getPendingSegmentPlaylist() { 26859 return this.pendingSegment_ ? this.pendingSegment_.playlist : null; 26860 } 26861 hasEnoughInfoToAppend_() { 26862 var e, t, i, s; 26863 return ( 26864 !!this.sourceUpdater_.ready() && 26865 !( 26866 this.waitingOnRemove_ || 26867 this.quotaExceededErrorRetryTimeout_ || 26868 ((e = this.pendingSegment_), (t = this.getCurrentMediaInfo_()), !e) || 26869 !t || 26870 (({ hasAudio: t, hasVideo: i, isMuxed: s } = t), i && !e.videoTimingInfo) || 26871 (t && !this.audioDisabled_ && !s && !e.audioTimingInfo) || 26872 Yu({ 26873 timelineChangeController: this.timelineChangeController_, 26874 currentTimeline: this.currentTimeline_, 26875 segmentTimeline: e.timeline, 26876 loaderType: this.loaderType_, 26877 audioDisabled: this.audioDisabled_ 26878 }) 26879 ) 26880 ); 26881 } 26882 handleData_(t, e) { 26883 if ((this.earlyAbortWhenNeeded_(t.stats), !this.checkForAbort_(t.requestId))) 26884 if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) 26885 (Qu(this), this.callQueue_.push(this.handleData_.bind(this, t, e))); 26886 else { 26887 var i = this.pendingSegment_; 26888 if ( 26889 (this.setTimeMapping_(i.timeline), 26890 this.updateMediaSecondsLoaded_(i.part || i.segment), 26891 'closed' !== this.mediaSource_.readyState) 26892 ) { 26893 if ( 26894 (t.map && ((t.map = this.initSegmentForMap(t.map, !0)), (i.segment.map = t.map)), 26895 t.key && this.segmentKey(t.key, !0), 26896 (i.isFmp4 = t.isFmp4), 26897 (i.timingInfo = i.timingInfo || {}), 26898 i.isFmp4) 26899 ) 26900 (this.trigger('fmp4'), (i.timingInfo.start = i[Ku(e.type)].start)); 26901 else { 26902 ((t = this.getCurrentMediaInfo_()), 26903 (t = 'main' === this.loaderType_ && t && t.hasVideo)); 26904 let e; 26905 (t && (e = i.videoTimingInfo.start), 26906 (i.timingInfo.start = this.trueSegmentStart_({ 26907 currentStart: i.timingInfo.start, 26908 playlist: i.playlist, 26909 mediaIndex: i.mediaIndex, 26910 currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(), 26911 useVideoTimingInfo: t, 26912 firstVideoFrameTimeForData: e, 26913 videoTimingInfo: i.videoTimingInfo, 26914 audioTimingInfo: i.audioTimingInfo 26915 }))); 26916 } 26917 if ( 26918 (this.updateAppendInitSegmentStatus(i, e.type), 26919 this.updateSourceBufferTimestampOffset_(i), 26920 i.isSyncRequest) 26921 ) { 26922 (this.updateTimingInfoEnd_(i), 26923 this.syncController_.saveSegmentTimingInfo({ 26924 segmentInfo: i, 26925 shouldSaveTimelineMapping: 'main' === this.loaderType_ 26926 })); 26927 t = this.chooseNextRequest_(); 26928 if (t.mediaIndex !== i.mediaIndex || t.partIndex !== i.partIndex) 26929 return void this.logger_('sync segment was incorrect, not appending'); 26930 this.logger_('sync segment was correct, appending'); 26931 } 26932 ((i.hasAppendedData_ = !0), this.processMetadataQueue_(), this.appendData_(i, e)); 26933 } 26934 } 26935 } 26936 updateAppendInitSegmentStatus(e, t) { 26937 ('main' !== this.loaderType_ || 26938 'number' != typeof e.timestampOffset || 26939 e.changedTimestampOffset || 26940 (this.appendInitSegment_ = { audio: !0, video: !0 }), 26941 this.playlistOfLastInitSegment_[t] !== e.playlist && (this.appendInitSegment_[t] = !0)); 26942 } 26943 getInitSegmentAndUpdateState_({ type: e, initSegment: t, map: i, playlist: s }) { 26944 if (i) { 26945 var r = Rh(i); 26946 if (this.activeInitSegmentId_ === r) return null; 26947 ((t = this.initSegmentForMap(i, !0).bytes), (this.activeInitSegmentId_ = r)); 26948 } 26949 return t && this.appendInitSegment_[e] 26950 ? ((this.playlistOfLastInitSegment_[e] = s), 26951 (this.appendInitSegment_[e] = !1), 26952 (this.activeInitSegmentId_ = null),
26953 t) 26954 : null; 26955 } 26956 handleQuotaExceededError_({ segmentInfo: e, type: t, bytes: i }, s) { 26957 var r = this.sourceUpdater_.audioBuffered(), 26958 n = this.sourceUpdater_.videoBuffered(), 26959 a = 26960 (1 < r.length && 26961 this.logger_( 26962 'On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: ' + Xd(r).join(', ') 26963 ), 26964 1 < n.length && 26965 this.logger_( 26966 'On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: ' + Xd(n).join(', ') 26967 ), 26968 r.length ? r.start(0) : 0), 26969 o = r.length ? r.end(r.length - 1) : 0, 26970 l = n.length ? n.start(0) : 0, 26971 d = n.length ? n.end(n.length - 1) : 0; 26972 o - a <= 1 && d - l <= 1 26973 ? (this.logger_( 26974 'On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. ' + 26975 `Appended byte length: ${i.byteLength}, ` + 26976 `audio buffer: ${Xd(r).join(', ')}, ` + 26977 `video buffer: ${Xd(n).join(', ')}, ` 26978 ), 26979 this.error({ 26980 message: 'Quota exceeded error with append of a single segment of content', 26981 excludeUntil: 1 / 0 26982 }), 26983 this.trigger('error')) 26984 : ((this.waitingOnRemove_ = !0), 26985 this.callQueue_.push( 26986 this.appendToSourceBuffer_.bind(this, { segmentInfo: e, type: t, bytes: i }) 26987 ), 26988 (o = this.currentTime_() - 1), 26989 this.logger_('On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ' + o), 26990 this.remove( 26991 0, 26992 o, 26993 () => { 26994 (this.logger_('On QUOTA_EXCEEDED_ERR, retrying append in 1s'), 26995 (this.waitingOnRemove_ = !1), 26996 (this.quotaExceededErrorRetryTimeout_ = window.setTimeout(() => { 26997 (this.logger_('On QUOTA_EXCEEDED_ERR, re-processing call queue'), 26998 (this.quotaExceededErrorRetryTimeout_ = null), 26999 this.processCallQueue_()); 27000 }, 1e3))); 27001 }, 27002 !0 27003 )); 27004 } 27005 handleAppendError_({ segmentInfo: e, type: t, bytes: i }, s) { 27006 s && 27007 (22 === s.code 27008 ? this.handleQuotaExceededError_({ segmentInfo: e, type: t, bytes: i }) 27009 : (this.logger_('Received non QUOTA_EXCEEDED_ERR on append', s), 27010 this.error({ 27011 message: 27012 `${t} append of ${i.length}b failed for segment ` + 27013 `#${e.mediaIndex} in playlist ` + 27014 e.playlist.id, 27015 metadata: { errorType: E.Error.StreamingFailedToAppendSegment } 27016 }), 27017 this.trigger('appenderror'))); 27018 } 27019 appendToSourceBuffer_({ segmentInfo: e, type: t, initSegment: i, data: s, bytes: r }) { 27020 if (!r) { 27021 var n = [s]; 27022 let e = s.byteLength; 27023 (i && (n.unshift(i), (e += i.byteLength)), 27024 (r = ((e) => { 27025 let t = 0, 27026 i; 27027 return ( 27028 e.bytes && 27029 ((i = new Uint8Array(e.bytes)), 27030 e.segments.forEach((e) => { 27031 (i.set(e, t), (t += e.byteLength)); 27032 })), 27033 i 27034 ); 27035 })({ bytes: e, segments: n }))); 27036 } 27037 s = { segmentInfo: ec({ type: this.loaderType_, segment: e }) }; 27038 (this.trigger({ type: 'segmentappendstart', metadata: s }), 27039 this.sourceUpdater_.appendBuffer( 27040 { segmentInfo: e, type: t, bytes: r }, 27041 this.handleAppendError_.bind(this, { segmentInfo: e, type: t, bytes: r }) 27042 )); 27043 } 27044 handleSegmentTimingInfo_(e, t, i) { 27045 this.pendingSegment_ && 27046 t === this.pendingSegment_.requestId && 27047 ((t = this.pendingSegment_.segment)[(e = e + 'TimingInfo')] || (t[e] = {}), 27048 (t[e].transmuxerPrependedSeconds = i.prependedContentDuration || 0), 27049 (t[e].transmuxedPresentationStart = i.start.presentation), 27050 (t[e].transmuxedDecodeStart = i.start.decode), 27051 (t[e].transmuxedPresentationEnd = i.end.presentation), 27052 (t[e].transmuxedDecodeEnd = i.end.decode), 27053 (t[e].baseMediaDecodeTime = i.baseMediaDecodeTime)); 27054 } 27055 appendData_(e, t) { 27056 var { type: i, data: s } = t; 27057 s && 27058 s.byteLength && 27059 (('audio' === i && this.audioDisabled_) || 27060 ((t = this.getInitSegmentAndUpdateState_({ 27061 type: i, 27062 initSegment: t.initSegment, 27063 playlist: e.playlist, 27064 map: e.isFmp4 ? e.segment.map : null 27065 })), 27066 this.appendToSourceBuffer_({ segmentInfo: e, type: i, initSegment: t, data: s }))); 27067 } 27068 loadSegment_(t) { 27069 ((this.state = 'WAITING'), 27070 (this.pendingSegment_ = t), 27071 this.trimBackBuffer_(t), 27072 'number' == typeof t.timestampOffset && 27073 this.transmuxer_ && 27074 this.transmuxer_.postMessage({ action: 'clearAllMp4Captions' }), 27075 this.hasEnoughInfoToLoad_() 27076 ? this.updateTransmuxerAndRequestSegment_(t) 27077 : (Qu(this), 27078 this.loadQueue_.push(() => { 27079 var e = f({}, t, { forceTimestampOffset: !0 }); 27080 (f(t, this.generateSegmentInfo_(e)), 27081 (this.isPendingTimestampOffset_ = !1), 27082 this.updateTransmuxerAndRequestSegment_(t)); 27083 }))); 27084 } 27085 updateTransmuxerAndRequestSegment_(s) { 27086 this.shouldUpdateTransmuxerTimestampOffset_(s.timestampOffset) && 27087 ((this.gopBuffer_.length = 0), 27088 (s.gopsToAlignWith = []), 27089 (this.timeMapping_ = 0), 27090 this.transmuxer_.postMessage({ action: 'reset' }), 27091 this.transmuxer_.postMessage({ 27092 action: 'setTimestampOffset', 27093 timestampOffset: s.timestampOffset 27094 })); 27095 var e = this.createSimplifiedSegmentObj_(s),
27096 t = this.isEndOfStream_(s.mediaIndex, s.playlist, s.partIndex), 27097 i = null !== this.mediaIndex, 27098 r = s.timeline !== this.currentTimeline_ && 0 < s.timeline, 27099 t = t || (i && r); 27100 (this.logger_( 27101 `Requesting 27102${ju(s.uri)} 27103` + Xu(s) 27104 ), 27105 e.map && 27106 !e.map.bytes && 27107 (this.logger_('going to request init segment.'), 27108 (this.appendInitSegment_ = { video: !0, audio: !0 })), 27109 (s.abortRequests = Lu({ 27110 xhr: this.vhs_.xhr, 27111 xhrOptions: this.xhrOptions_, 27112 decryptionWorker: this.decrypter_, 27113 segment: e, 27114 abortFn: this.handleAbort_.bind(this, s), 27115 progressFn: this.handleProgress_.bind(this), 27116 trackInfoFn: this.handleTrackInfo_.bind(this), 27117 timingInfoFn: this.handleTimingInfo_.bind(this), 27118 videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'video', s.requestId), 27119 audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'audio', s.requestId), 27120 captionsFn: this.handleCaptions_.bind(this), 27121 isEndOfTimeline: t, 27122 endedTimelineFn: () => { 27123 this.logger_('received endedtimeline callback'); 27124 }, 27125 id3Fn: this.handleId3_.bind(this), 27126 dataFn: this.handleData_.bind(this), 27127 doneFn: this.segmentRequestFinished_.bind(this), 27128 onTransmuxerLog: ({ message: e, level: t, stream: i }) => { 27129 this.logger_(Xu(s) + ` logged from transmuxer stream ${i} as a ${t}: ` + e); 27130 }, 27131 triggerSegmentEventFn: ({ 27132 type: e, 27133 segment: t, 27134 keyInfo: i, 27135 trackInfo: s, 27136 timingInfo: r 27137 }) => { 27138 t = { segmentInfo: ec({ segment: t }) }; 27139 (i && (t.keyInfo = i), 27140 s && (t.trackInfo = s), 27141 r && (t.timingInfo = r), 27142 this.trigger({ type: e, metadata: t })); 27143 } 27144 }))); 27145 } 27146 trimBackBuffer_(e) { 27147 var t = ((e, t, i) => { 27148 let s = t - R.BACK_BUFFER_LENGTH; 27149 return (e.length && (s = Math.max(s, e.start(0))), Math.min(t - i, s)); 27150 })(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); 27151 0 < t && this.remove(0, t); 27152 } 27153 createSimplifiedSegmentObj_(e) { 27154 var t = e.segment, 27155 i = e.part, 27156 s = e.segment.key || (e.segment.map && e.segment.map.key), 27157 r = e.segment.map && !e.segment.map.bytes, 27158 i = { 27159 resolvedUri: (i || t).resolvedUri, 27160 byterange: (i || t).byterange, 27161 requestId: e.requestId, 27162 transmuxer: e.transmuxer, 27163 audioAppendStart: e.audioAppendStart, 27164 gopsToAlignWith: e.gopsToAlignWith, 27165 part: e.part, 27166 type: this.loaderType_, 27167 start: e.startOfSegment, 27168 duration: e.duration, 27169 isEncrypted: s, 27170 isMediaInitialization: r 27171 }, 27172 s = e.playlist.segments[e.mediaIndex - 1]; 27173 return ( 27174 s && 27175 s.timeline === t.timeline && 27176 (s.videoTimingInfo 27177 ? (i.baseStartTime = s.videoTimingInfo.transmuxedDecodeEnd) 27178 : s.audioTimingInfo && (i.baseStartTime = s.audioTimingInfo.transmuxedDecodeEnd)), 27179 t.key && 27180 ((r = t.key.iv || new Uint32Array([0, 0, 0, e.mediaIndex + e.playlist.mediaSequence])), 27181 (i.key = this.segmentKey(t.key)), 27182 (i.key.iv = r)), 27183 t.map && (i.map = this.initSegmentForMap(t.map)), 27184 i 27185 ); 27186 } 27187 saveTransferStats_(e) { 27188 ((this.mediaRequests += 1), 27189 e && 27190 ((this.mediaBytesTransferred += e.bytesReceived), 27191 (this.mediaTransferDuration += e.roundTripTime))); 27192 } 27193 saveBandwidthRelatedStats_(e, t) { 27194 ((this.pendingSegment_.byteLength = t.bytesReceived), 27195 e < 1 / 60 27196 ? this.logger_( 27197 "Ignoring segment's bandwidth because its duration of " + 27198 e + 27199 ' is less than the min to record ' + 27200 1 / 60 27201 ) 27202 : ((e = { bandwidthInfo: { from: this.bandwidth, to: t.bandwidth } }), 27203 this.trigger({ type: 'bandwidthupdated', metadata: e }), 27204 (this.bandwidth = t.bandwidth), 27205 (this.roundTrip = t.roundTripTime))); 27206 } 27207 handleTimeout_() { 27208 ((this.mediaRequestsTimedout += 1), 27209 (this.bandwidth = 1), 27210 (this.roundTrip = NaN), 27211 this.trigger('bandwidthupdate'), 27212 this.trigger('timeout')); 27213 } 27214 segmentRequestFinished_(e, t, i) { 27215 if (this.callQueue_.length) 27216 this.callQueue_.push(this.segmentRequestFinished_.bind(this, e, t, i)); 27217 else if ( 27218 (this.saveTransferStats_(t.stats), 27219 this.pendingSegment_ && t.requestId === this.pendingSegment_.requestId) 27220 ) { 27221 if (e) 27222 return ( 27223 (this.pendingSegment_ = null),
27224 (this.state = 'READY'), 27225 e.code === _u.ABORTED 27226 ? void 0 27227 : (this.pause(), 27228 e.code === _u.TIMEOUT 27229 ? void this.handleTimeout_() 27230 : ((this.mediaRequestsErrored += 1), this.error(e), void this.trigger('error'))) 27231 ); 27232 e = this.pendingSegment_; 27233 (this.saveBandwidthRelatedStats_(e.duration, t.stats), 27234 (e.endOfAllRequests = t.endOfAllRequests), 27235 i.gopInfo && 27236 (this.gopBuffer_ = ((e, t, i) => { 27237 if (!t.length) return e; 27238 if (i) return t.slice(); 27239 var s = t[0].pts; 27240 let r = 0; 27241 for (r; r < e.length && !(e[r].pts >= s); r++); 27242 return e.slice(0, r).concat(t); 27243 })(this.gopBuffer_, i.gopInfo, this.safeAppend_)), 27244 (this.state = 'APPENDING'), 27245 this.trigger('appending'), 27246 this.waitForAppendsToComplete_(e)); 27247 } 27248 } 27249 setTimeMapping_(e) { 27250 e = this.syncController_.mappingForTimeline(e); 27251 null !== e && (this.timeMapping_ = e); 27252 } 27253 updateMediaSecondsLoaded_(e) { 27254 'number' == typeof e.start && 'number' == typeof e.end 27255 ? (this.mediaSecondsLoaded += e.end - e.start) 27256 : (this.mediaSecondsLoaded += e.duration); 27257 } 27258 shouldUpdateTransmuxerTimestampOffset_(e) { 27259 return ( 27260 null !== e && 27261 (('main' === this.loaderType_ && e !== this.sourceUpdater_.videoTimestampOffset()) || 27262 (!this.audioDisabled_ && e !== this.sourceUpdater_.audioTimestampOffset())) 27263 ); 27264 } 27265 trueSegmentStart_({ 27266 currentStart: e, 27267 playlist: t, 27268 mediaIndex: i, 27269 firstVideoFrameTimeForData: s, 27270 currentVideoTimestampOffset: r, 27271 useVideoTimingInfo: n, 27272 videoTimingInfo: a, 27273 audioTimingInfo: o 27274 }) { 27275 return 'undefined' != typeof e 27276 ? e 27277 : n 27278 ? ((e = t.segments[i - 1]), 27279 0 !== i && e && 'undefined' != typeof e.start && e.end === s + r ? a.start : s) 27280 : o.start; 27281 } 27282 waitForAppendsToComplete_(e) { 27283 var t, 27284 i, 27285 s = this.getCurrentMediaInfo_(e); 27286 s 27287 ? (({ hasAudio: s, hasVideo: i, isMuxed: t } = s), 27288 (i = 'main' === this.loaderType_ && i), 27289 (s = !this.audioDisabled_ && s && !t), 27290 (e.waitingOnAppends = 0), 27291 e.hasAppendedData_ 27292 ? (i && e.waitingOnAppends++, 27293 s && e.waitingOnAppends++, 27294 i && this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, e)), 27295 s && this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, e))) 27296 : (e.timingInfo || 27297 'number' != typeof e.timestampOffset || 27298 (this.isPendingTimestampOffset_ = !0), 27299 (e.timingInfo = { start: 0 }), 27300 e.waitingOnAppends++, 27301 this.isPendingTimestampOffset_ || 27302 (this.updateSourceBufferTimestampOffset_(e), this.processMetadataQueue_()), 27303 this.checkAppendsDone_(e))) 27304 : (this.error({ 27305 message: 'No starting media returned, likely due to an unsupported media format.', 27306 playlistExclusionDuration: 1 / 0 27307 }), 27308 this.trigger('error')); 27309 } 27310 checkAppendsDone_(e) { 27311 this.checkForAbort_(e.requestId) || 27312 (e.waitingOnAppends--, 0 === e.waitingOnAppends && this.handleAppendsDone_()); 27313 } 27314 checkForIllegalMediaSwitch(e) { 27315 ((i = this.loaderType_), (t = this.getCurrentMediaInfo_()), (e = e)); 27316 var t, 27317 i = 27318 'main' === i && t && e 27319 ? e.hasAudio || e.hasVideo 27320 ? t.hasVideo && !e.hasVideo 27321 ? "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest." 27322 : !t.hasVideo && e.hasVideo 27323 ? "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest." 27324 : null
27325 : 'Neither audio nor video found in segment.' 27326 : null; 27327 return ( 27328 !!i && 27329 (this.error({ message: i, playlistExclusionDuration: 1 / 0 }), this.trigger('error'), !0) 27330 ); 27331 } 27332 updateSourceBufferTimestampOffset_(t) { 27333 if ( 27334 null !== t.timestampOffset && 27335 'number' == typeof t.timingInfo.start && 27336 !t.changedTimestampOffset && 27337 'main' === this.loaderType_ 27338 ) { 27339 let e = !1; 27340 ((t.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({ 27341 videoTimingInfo: t.segment.videoTimingInfo, 27342 audioTimingInfo: t.segment.audioTimingInfo, 27343 timingInfo: t.timingInfo 27344 })), 27345 (t.changedTimestampOffset = !0), 27346 t.timestampOffset !== this.sourceUpdater_.videoTimestampOffset() && 27347 (this.sourceUpdater_.videoTimestampOffset(t.timestampOffset), (e = !0)), 27348 t.timestampOffset !== this.sourceUpdater_.audioTimestampOffset() && 27349 (this.sourceUpdater_.audioTimestampOffset(t.timestampOffset), (e = !0)), 27350 e && this.trigger('timestampoffset')); 27351 } 27352 } 27353 getSegmentStartTimeForTimestampOffsetCalculation_({ 27354 videoTimingInfo: e, 27355 audioTimingInfo: t, 27356 timingInfo: i 27357 }) { 27358 return this.useDtsForTimestampOffset_ 27359 ? e && 'number' == typeof e.transmuxedDecodeStart 27360 ? e.transmuxedDecodeStart 27361 : t && 'number' == typeof t.transmuxedDecodeStart 27362 ? t.transmuxedDecodeStart 27363 : i.start 27364 : i.start; 27365 } 27366 updateTimingInfoEnd_(e) { 27367 e.timingInfo = e.timingInfo || {}; 27368 var t = this.getMediaInfo_(), 27369 t = 27370 'main' === this.loaderType_ && t && t.hasVideo && e.videoTimingInfo 27371 ? e.videoTimingInfo 27372 : e.audioTimingInfo; 27373 t && (e.timingInfo.end = 'number' == typeof t.end ? t.end : t.start + e.duration); 27374 } 27375 handleAppendsDone_() { 27376 var e, t, i; 27377 (this.pendingSegment_ && 27378 ((e = { segmentInfo: ec({ type: this.loaderType_, segment: this.pendingSegment_ }) }), 27379 this.trigger({ type: 'appendsdone', metadata: e })), 27380 this.pendingSegment_ 27381 ? ((e = this.pendingSegment_).part && e.part.syncInfo 27382 ? e.part.syncInfo.markAppended() 27383 : e.segment.syncInfo && e.segment.syncInfo.markAppended(), 27384 this.updateTimingInfoEnd_(e), 27385 this.shouldSaveSegmentTimingInfo_ && 27386 this.syncController_.saveSegmentTimingInfo({ 27387 segmentInfo: e, 27388 shouldSaveTimelineMapping: 'main' === this.loaderType_ 27389 }), 27390 (t = Zu(e, this.sourceType_)) && 27391 ('warn' === t.severity ? E.log.warn(t.message) : this.logger_(t.message)), 27392 this.recordThroughput_(e), 27393 (this.pendingSegment_ = null), 27394 (this.state = 'READY'), 27395 e.isSyncRequest && (this.trigger('syncinfoupdate'), !e.hasAppendedData_) 27396 ? this.logger_('Throwing away un-appended sync request ' + Xu(e)) 27397 : (this.logger_('Appended ' + Xu(e)), 27398 this.addSegmentMetadataCue_(e), 27399 (this.fetchAtBuffer_ = !0), 27400 this.currentTimeline_ !== e.timeline && 27401 (this.timelineChangeController_.lastTimelineChange({ 27402 type: this.loaderType_, 27403 from: this.currentTimeline_, 27404 to: e.timeline 27405 }), 27406 'main' !== this.loaderType_ || 27407 this.audioDisabled_ || 27408 this.timelineChangeController_.lastTimelineChange({ 27409 type: 'audio', 27410 from: this.currentTimeline_, 27411 to: e.timeline 27412 })), 27413 (this.currentTimeline_ = e.timeline), 27414 this.trigger('syncinfoupdate'), 27415 (t = e.segment), 27416 (i = e.part), 27417 (t = t.end && this.currentTime_() - t.end > 3 * e.playlist.targetDuration), 27418 (i = i && i.end && this.currentTime_() - i.end > 3 * e.playlist.partTargetDuration), 27419 t || i 27420 ? (this.logger_(`bad ${t ? 'segment' : 'part'} ` + Xu(e)), this.resetEverything()) 27421 : (null !== this.mediaIndex && this.trigger('bandwidthupdate'), 27422 this.trigger('progress'), 27423 (this.mediaIndex = e.mediaIndex), 27424 (this.partIndex = e.partIndex),
27425 this.isEndOfStream_(e.mediaIndex, e.playlist, e.partIndex) && 27426 this.endOfStream(), 27427 this.trigger('appended'), 27428 e.hasAppendedData_ && this.mediaAppends++, 27429 this.paused() || this.monitorBuffer_()))) 27430 : ((this.state = 'READY'), this.paused() || this.monitorBuffer_())); 27431 } 27432 recordThroughput_(e) { 27433 var t, i; 27434 e.duration < 1 / 60 27435 ? this.logger_( 27436 "Ignoring segment's throughput because its duration of " + 27437 e.duration + 27438 ' is less than the min to record ' + 27439 1 / 60 27440 ) 27441 : ((t = this.throughput.rate), 27442 (i = Date.now() - e.endOfAllRequests + 1), 27443 (e = Math.floor((e.byteLength / i) * 8 * 1e3)), 27444 (this.throughput.rate += (e - t) / ++this.throughput.count)); 27445 } 27446 addSegmentMetadataCue_(e) { 27447 var t, i, s, r; 27448 this.segmentMetadataTrack_ && 27449 ((t = (r = e.segment).start), (i = r.end), Gu(t)) && 27450 Gu(i) && 27451 (Vu(t, i, this.segmentMetadataTrack_), 27452 (s = window.WebKitDataCue || window.VTTCue), 27453 (r = { 27454 custom: r.custom, 27455 dateTimeObject: r.dateTimeObject, 27456 dateTimeString: r.dateTimeString, 27457 programDateTime: r.programDateTime, 27458 bandwidth: e.playlist.attributes.BANDWIDTH, 27459 resolution: e.playlist.attributes.RESOLUTION, 27460 codecs: e.playlist.attributes.CODECS, 27461 byteLength: e.byteLength, 27462 uri: e.uri, 27463 timeline: e.timeline, 27464 playlist: e.playlist.id, 27465 start: t, 27466 end: i 27467 }), 27468 ((e = new s(t, i, JSON.stringify(r))).value = r), 27469 this.segmentMetadataTrack_.addCue(e)); 27470 } 27471 } 27472 function ic() {} 27473 function sc(e) { 27474 return 'string' != typeof e ? e : e.replace(/./, (e) => e.toUpperCase()); 27475 } 27476 let rc = ['video', 'audio'], 27477 nc = (e, t) => { 27478 var i = t[e + 'Buffer']; 27479 return (i && i.updating) || t.queuePending[e]; 27480 }, 27481 ac = (i, s) => { 27482 if (0 !== s.queue.length) { 27483 let e = 0, 27484 t = s.queue[e]; 27485 if ('mediaSource' === t.type) 27486 s.updating() || 27487 'closed' === s.mediaSource.readyState || 27488 (s.queue.shift(), t.action(s), t.doneFn && t.doneFn(), ac('audio', s), ac('video', s)); 27489 else if ( 27490 'mediaSource' !== i && 27491 s.ready() && 27492 'closed' !== s.mediaSource.readyState && 27493 !nc(i, s) 27494 ) { 27495 if (t.type !== i) { 27496 if ( 27497 null === 27498 (e = ((t, i) => { 27499 for (let e = 0; e < i.length; e++) { 27500 var s = i[e]; 27501 if ('mediaSource' === s.type) return null; 27502 if (s.type === t) return e; 27503 } 27504 return null; 27505 })(i, s.queue)) 27506 ) 27507 return; 27508 t = s.queue[e]; 27509 } 27510 (s.queue.splice(e, 1), 27511 (s.queuePending[i] = t).action(i, s), 27512 t.doneFn || ((s.queuePending[i] = null), ac(i, s))); 27513 } 27514 } 27515 }, 27516 oc = (e, t) => { 27517 var i = t[e + 'Buffer'], 27518 s = sc(e); 27519 i && 27520 (i.removeEventListener('updateend', t[`on${s}UpdateEnd_`]), 27521 i.removeEventListener('error', t[`on${s}Error_`]), 27522 (t.codecs[e] = null), 27523 (t[e + 'Buffer'] = null)); 27524 }, 27525 lc = (e, t) => e && t && -1 !== Array.prototype.indexOf.call(e.sourceBuffers, t), 27526 dc = { 27527 appendBuffer: (s, r, n) => (t, i) => { 27528 var e = i[t + 'Buffer']; 27529 if (lc(i.mediaSource, e)) { 27530 i.logger_(`Appending segment ${r.mediaIndex}'s ${s.length} bytes to ${t}Buffer`); 27531 try { 27532 e.appendBuffer(s); 27533 } catch (e) { 27534 (i.logger_( 27535 `Error with code ${e.code} ` + 27536 (22 === e.code ? '(QUOTA_EXCEEDED_ERR) ' : '') + 27537 `when appending segment ${r.mediaIndex} to ${t}Buffer` 27538 ), 27539 (i.queuePending[t] = null), 27540 n(e)); 27541 } 27542 } 27543 }, 27544 remove: (s, r) => (t, i) => { 27545 var e = i[t + 'Buffer']; 27546 if (lc(i.mediaSource, e)) { 27547 i.logger_(`Removing ${s} to ${r} from ${t}Buffer`); 27548 try { 27549 e.remove(s, r); 27550 } catch (e) { 27551 i.logger_(`Remove ${s} to ${r} from ${t}Buffer failed`); 27552 } 27553 } 27554 }, 27555 timestampOffset: (s) => (e, t) => { 27556 var i = t[e + 'Buffer']; 27557 lc(t.mediaSource, i) && 27558 (t.logger_(`Setting ${e}timestampOffset to ` + s), (i.timestampOffset = s)); 27559 }, 27560 callback: (i) => (e, t) => { 27561 i(); 27562 },
27563 endOfStream: (t) => (e) => { 27564 if ('open' === e.mediaSource.readyState) { 27565 e.logger_(`Calling mediaSource endOfStream(${t || ''})`); 27566 try { 27567 e.mediaSource.endOfStream(t); 27568 } catch (e) { 27569 E.log.warn('Failed to call media source endOfStream', e); 27570 } 27571 } 27572 }, 27573 duration: (t) => (e) => { 27574 e.logger_('Setting mediaSource duration to ' + t); 27575 try { 27576 e.mediaSource.duration = t; 27577 } catch (e) { 27578 E.log.warn('Failed to set media source duration', e); 27579 } 27580 }, 27581 abort: () => (t, e) => { 27582 if ('open' === e.mediaSource.readyState) { 27583 var i = e[t + 'Buffer']; 27584 if (lc(e.mediaSource, i)) { 27585 e.logger_(`calling abort on ${t}Buffer`); 27586 try { 27587 i.abort(); 27588 } catch (e) { 27589 E.log.warn(`Failed to abort on ${t}Buffer`, e); 27590 } 27591 } 27592 } 27593 }, 27594 addSourceBuffer: (s, r) => (e) => { 27595 var t = sc(s), 27596 i = aa(r), 27597 i = 27598 (e.logger_(`Adding ${s}Buffer with codec ${r} to mediaSource`), 27599 e.mediaSource.addSourceBuffer(i)); 27600 (i.addEventListener('updateend', e[`on${t}UpdateEnd_`]), 27601 i.addEventListener('error', e[`on${t}Error_`]), 27602 (e.codecs[s] = r), 27603 (e[s + 'Buffer'] = i)); 27604 }, 27605 removeSourceBuffer: (i) => (e) => { 27606 var t = e[i + 'Buffer']; 27607 if ((oc(i, e), lc(e.mediaSource, t))) { 27608 e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`); 27609 try { 27610 e.mediaSource.removeSourceBuffer(t); 27611 } catch (e) { 27612 E.log.warn(`Failed to removeSourceBuffer ${i}Buffer`, e); 27613 } 27614 } 27615 }, 27616 changeType: (o) => (t, i) => { 27617 var e = i[t + 'Buffer'], 27618 s = aa(o); 27619 if (lc(i.mediaSource, e)) { 27620 var r = o.substring(0, o.indexOf('.')), 27621 n = i.codecs[t],
27622 a = n.substring(0, n.indexOf('.')); 27623 if (a !== r) { 27624 a = { codecsChangeInfo: { from: n, to: o } }; 27625 (i.trigger({ type: 'codecschange', metadata: a }), 27626 i.logger_(`changing ${t}Buffer codec from ${n} to ` + o)); 27627 try { 27628 (e.changeType(s), (i.codecs[t] = o)); 27629 } catch (e) { 27630 ((a.errorType = E.Error.StreamingCodecsChangeError), 27631 ((a.error = e).metadata = a), 27632 (i.error_ = e), 27633 i.trigger('error'), 27634 E.log.warn(`Failed to changeType on ${t}Buffer`, e)); 27635 } 27636 } 27637 } 27638 } 27639 }, 27640 hc = ({ type: e, sourceUpdater: t, action: i, doneFn: s, name: r }) => { 27641 (t.queue.push({ type: e, action: i, doneFn: s, name: r }), ac(e, t)); 27642 }, 27643 uc = (i, s) => (e) => { 27644 var t = (function (t) { 27645 if (0 === t.length) return 'Buffered Ranges are empty'; 27646 let i = 'Buffered Ranges: \n'; 27647 for (let e = 0; e < t.length; e++) { 27648 var s = t.start(e), 27649 r = t.end(e); 27650 i += 27651 s + 27652 ` --> ${r}. Duration (${r - s}) 27653`; 27654 } 27655 return i; 27656 })(s[i + 'Buffered']()); 27657 (s.logger_(`received "updateend" event for ${i} Source Buffer: `, t), 27658 s.queuePending[i] && 27659 ((t = s.queuePending[i].doneFn), (s.queuePending[i] = null), t) && 27660 t(s[i + 'Error_']), 27661 ac(i, s)); 27662 }; 27663 class cc extends E.EventTarget { 27664 constructor(e) { 27665 (super(), 27666 (this.mediaSource = e), 27667 (this.sourceopenListener_ = () => ac('mediaSource', this)), 27668 this.mediaSource.addEventListener('sourceopen', this.sourceopenListener_), 27669 (this.logger_ = Ud('SourceUpdater')), 27670 (this.audioTimestampOffset_ = 0), 27671 (this.videoTimestampOffset_ = 0), 27672 (this.queue = []), 27673 (this.queuePending = { audio: null, video: null }), 27674 (this.delayedAudioAppendQueue_ = []), 27675 (this.videoAppendQueued_ = !1), 27676 (this.codecs = {}), 27677 (this.onVideoUpdateEnd_ = uc('video', this)), 27678 (this.onAudioUpdateEnd_ = uc('audio', this)), 27679 (this.onVideoError_ = (e) => { 27680 this.videoError_ = e; 27681 }), 27682 (this.onAudioError_ = (e) => { 27683 this.audioError_ = e; 27684 }), 27685 (this.createdSourceBuffers_ = !1), 27686 (this.initializedEme_ = !1), 27687 (this.triggeredReady_ = !1)); 27688 } 27689 initializedEme() { 27690 ((this.initializedEme_ = !0), this.triggerReady()); 27691 } 27692 hasCreatedSourceBuffers() { 27693 return this.createdSourceBuffers_; 27694 } 27695 hasInitializedAnyEme() { 27696 return this.initializedEme_; 27697 } 27698 ready() { 27699 return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme(); 27700 } 27701 createSourceBuffers(e) { 27702 this.hasCreatedSourceBuffers() || 27703 (this.addOrChangeSourceBuffers(e), 27704 (this.createdSourceBuffers_ = !0), 27705 this.trigger('createdsourcebuffers'), 27706 this.triggerReady()); 27707 } 27708 triggerReady() { 27709 this.ready() && !this.triggeredReady_ && ((this.triggeredReady_ = !0), this.trigger('ready')); 27710 } 27711 addSourceBuffer(e, t) { 27712 hc({ 27713 type: 'mediaSource', 27714 sourceUpdater: this, 27715 action: dc.addSourceBuffer(e, t), 27716 name: 'addSourceBuffer' 27717 }); 27718 } 27719 abort(e) { 27720 hc({ type: e, sourceUpdater: this, action: dc.abort(e), name: 'abort' }); 27721 } 27722 removeSourceBuffer(e) { 27723 this.canRemoveSourceBuffer() 27724 ? hc({ 27725 type: 'mediaSource', 27726 sourceUpdater: this, 27727 action: dc.removeSourceBuffer(e), 27728 name: 'removeSourceBuffer' 27729 }) 27730 : E.log.error('removeSourceBuffer is not supported!'); 27731 } 27732 canRemoveSourceBuffer() { 27733 return ( 27734 !E.browser.IS_FIREFOX && 27735 window.MediaSource && 27736 window.MediaSource.prototype && 27737 'function' == typeof window.MediaSource.prototype.removeSourceBuffer 27738 ); 27739 } 27740 static canChangeType() { 27741 return ( 27742 window.SourceBuffer && 27743 window.SourceBuffer.prototype && 27744 'function' == typeof window.SourceBuffer.prototype.changeType 27745 ); 27746 } 27747 canChangeType() { 27748 return this.constructor.canChangeType(); 27749 } 27750 changeType(e, t) { 27751 this.canChangeType() 27752 ? hc({ type: e, sourceUpdater: this, action: dc.changeType(t), name: 'changeType' }) 27753 : E.log.error('changeType is not supported!'); 27754 } 27755 addOrChangeSourceBuffers(i) { 27756 if (!i || 'object' != typeof i || 0 === Object.keys(i).length) 27757 throw new Error('Cannot addOrChangeSourceBuffers to undefined codecs');
27758 Object.keys(i).forEach((e) => { 27759 var t = i[e]; 27760 if (!this.hasCreatedSourceBuffers()) return this.addSourceBuffer(e, t); 27761 this.canChangeType() && this.changeType(e, t); 27762 }); 27763 } 27764 appendBuffer(e, t) { 27765 var { segmentInfo: i, type: s, bytes: r } = e; 27766 ((this.processedAppend_ = !0), 27767 'audio' === s && this.videoBuffer && !this.videoAppendQueued_ 27768 ? (this.delayedAudioAppendQueue_.push([e, t]), 27769 this.logger_(`delayed audio append of ${r.length} until video append`)) 27770 : ((e = t), 27771 hc({ 27772 type: s, 27773 sourceUpdater: this, 27774 action: dc.appendBuffer(r, i || { mediaIndex: -1 }, e), 27775 doneFn: t, 27776 name: 'appendBuffer' 27777 }), 27778 'video' === s && 27779 ((this.videoAppendQueued_ = !0), this.delayedAudioAppendQueue_.length) && 27780 ((r = this.delayedAudioAppendQueue_.slice()), 27781 this.logger_(`queuing delayed audio ${r.length} appendBuffers`), 27782 (this.delayedAudioAppendQueue_.length = 0), 27783 r.forEach((e) => { 27784 this.appendBuffer.apply(this, e); 27785 })))); 27786 } 27787 audioBuffered() { 27788 return (lc(this.mediaSource, this.audioBuffer) && this.audioBuffer.buffered) || O(); 27789 } 27790 videoBuffered() { 27791 return (lc(this.mediaSource, this.videoBuffer) && this.videoBuffer.buffered) || O(); 27792 } 27793 buffered() { 27794 var e = lc(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null, 27795 t = lc(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null; 27796 return t && !e 27797 ? this.audioBuffered() 27798 : e && !t 27799 ? this.videoBuffered() 27800 : (function (e, t) { 27801 let i = null, 27802 s = null, 27803 r = 0; 27804 var n = [], 27805 a = []; 27806 if (!(e && e.length && t && t.length)) return O(); 27807 let o = e.length; 27808 for (; o--; ) 27809 (n.push({ time: e.start(o), type: 'start' }), 27810 n.push({ time: e.end(o), type: 'end' })); 27811 for (o = t.length; o--; ) 27812 (n.push({ time: t.start(o), type: 'start' }), 27813 n.push({ time: t.end(o), type: 'end' })); 27814 for ( 27815 n.sort(function (e, t) { 27816 return e.time - t.time; 27817 }), 27818 o = 0; 27819 o < n.length; 27820 o++ 27821 ) 27822 ('start' === n[o].type 27823 ? 2 === ++r && (i = n[o].time) 27824 : 'end' === n[o].type && 1 === --r && (s = n[o].time), 27825 null !== i && null !== s && (a.push([i, s]), (i = null), (s = null))); 27826 return O(a); 27827 })(this.audioBuffered(), this.videoBuffered()); 27828 } 27829 setDuration(e, t = ic) { 27830 hc({ 27831 type: 'mediaSource', 27832 sourceUpdater: this, 27833 action: dc.duration(e), 27834 name: 'duration', 27835 doneFn: t 27836 }); 27837 } 27838 endOfStream(e = null, t = ic) { 27839 ('string' != typeof e && (e = void 0), 27840 hc({ 27841 type: 'mediaSource', 27842 sourceUpdater: this, 27843 action: dc.endOfStream(e), 27844 name: 'endOfStream', 27845 doneFn: t 27846 })); 27847 } 27848 removeAudio(e, t, i = ic) { 27849 this.audioBuffered().length && 0 !== this.audioBuffered().end(0) 27850 ? hc({ 27851 type: 'audio', 27852 sourceUpdater: this, 27853 action: dc.remove(e, t), 27854 doneFn: i, 27855 name: 'remove' 27856 }) 27857 : i(); 27858 } 27859 removeVideo(e, t, i = ic) { 27860 this.videoBuffered().length && 0 !== this.videoBuffered().end(0) 27861 ? hc({ 27862 type: 'video', 27863 sourceUpdater: this, 27864 action: dc.remove(e, t), 27865 doneFn: i, 27866 name: 'remove' 27867 }) 27868 : i(); 27869 } 27870 updating() { 27871 return !(!nc('audio', this) && !nc('video', this)); 27872 } 27873 audioTimestampOffset(e) { 27874 return ( 27875 'undefined' != typeof e && 27876 this.audioBuffer && 27877 this.audioTimestampOffset_ !== e && 27878 (hc({ 27879 type: 'audio', 27880 sourceUpdater: this, 27881 action: dc.timestampOffset(e), 27882 name: 'timestampOffset' 27883 }), 27884 (this.audioTimestampOffset_ = e)), 27885 this.audioTimestampOffset_ 27886 ); 27887 } 27888 videoTimestampOffset(e) { 27889 return ( 27890 'undefined' != typeof e && 27891 this.videoBuffer && 27892 this.videoTimestampOffset_ !== e && 27893 (hc({ 27894 type: 'video', 27895 sourceUpdater: this, 27896 action: dc.timestampOffset(e), 27897 name: 'timestampOffset' 27898 }), 27899 (this.videoTimestampOffset_ = e)), 27900 this.videoTimestampOffset_ 27901 ); 27902 } 27903 audioQueueCallback(e) { 27904 this.audioBuffer && 27905 hc({ type: 'audio', sourceUpdater: this, action: dc.callback(e), name: 'callback' }); 27906 } 27907 videoQueueCallback(e) { 27908 this.videoBuffer && 27909 hc({ type: 'video', sourceUpdater: this, action: dc.callback(e), name: 'callback' }); 27910 } 27911 dispose() { 27912 (this.trigger('dispose'),
27913 rc.forEach((e) => { 27914 (this.abort(e), 27915 this.canRemoveSourceBuffer() 27916 ? this.removeSourceBuffer(e) 27917 : this[e + 'QueueCallback'](() => oc(e, this))); 27918 }), 27919 (this.videoAppendQueued_ = !1), 27920 (this.delayedAudioAppendQueue_.length = 0), 27921 this.sourceopenListener_ && 27922 this.mediaSource.removeEventListener('sourceopen', this.sourceopenListener_), 27923 this.off()); 27924 } 27925 } 27926 let pc = (e) => decodeURIComponent(escape(String.fromCharCode.apply(null, e))), 27927 mc = new Uint8Array('\n\n'.split('').map((e) => e.charCodeAt(0))); 27928 class gc extends Error { 27929 constructor() { 27930 super( 27931 'Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.' 27932 ); 27933 } 27934 } 27935 class fc extends tc { 27936 constructor(e, t = {}) { 27937 (super(e, t), 27938 (this.mediaSource_ = null), 27939 (this.subtitlesTrack_ = null), 27940 (this.featuresNativeTextTracks_ = e.featuresNativeTextTracks), 27941 (this.loadVttJs = e.loadVttJs), 27942 (this.shouldSaveSegmentTimingInfo_ = !1)); 27943 } 27944 buffered_() { 27945 var e; 27946 return this.subtitlesTrack_ && this.subtitlesTrack_.cues && this.subtitlesTrack_.cues.length 27947 ? O([[(e = this.subtitlesTrack_.cues)[0].startTime, e[e.length - 1].startTime]]) 27948 : O(); 27949 } 27950 initSegmentForMap(e, t = !1) { 27951 if (!e) return null; 27952 var i = Rh(e); 27953 let s = this.initSegments_[i]; 27954 return ( 27955 t && 27956 !s && 27957 e.bytes && 27958 ((t = mc.byteLength + e.bytes.byteLength), 27959 (t = new Uint8Array(t)).set(e.bytes), 27960 t.set(mc, e.bytes.byteLength), 27961 (this.initSegments_[i] = s = 27962 { resolvedUri: e.resolvedUri, byterange: e.byterange, bytes: t })), 27963 s || e 27964 ); 27965 } 27966 couldBeginLoading_() { 27967 return this.playlist_ && this.subtitlesTrack_ && !this.paused(); 27968 } 27969 init_() { 27970 return ((this.state = 'READY'), this.resetEverything(), this.monitorBuffer_()); 27971 } 27972 track(e) { 27973 return ( 27974 'undefined' != typeof e && 27975 ((this.subtitlesTrack_ = e), 'INIT' === this.state && this.couldBeginLoading_()) && 27976 this.init_(), 27977 this.subtitlesTrack_ 27978 ); 27979 } 27980 remove(e, t) { 27981 Vu(e, t, this.subtitlesTrack_); 27982 } 27983 fillBuffer_() { 27984 var e = this.chooseNextRequest_(); 27985 e && 27986 (null === this.syncController_.timestampOffsetForTimeline(e.timeline) 27987 ? (this.syncController_.one('timestampoffset', () => { 27988 ((this.state = 'READY'), this.paused() || this.monitorBuffer_()); 27989 }), 27990 (this.state = 'WAITING_ON_TIMELINE')) 27991 : this.loadSegment_(e)); 27992 } 27993 timestampOffsetForSegment_() { 27994 return null; 27995 } 27996 chooseNextRequest_() { 27997 return this.skipEmptySegments_(super.chooseNextRequest_()); 27998 } 27999 skipEmptySegments_(e) { 28000 for (; e && e.segment.empty; ) { 28001 if (e.mediaIndex + 1 >= e.playlist.segments.length) { 28002 e = null; 28003 break; 28004 } 28005 e = this.generateSegmentInfo_({ 28006 playlist: e.playlist, 28007 mediaIndex: e.mediaIndex + 1, 28008 startOfSegment: e.startOfSegment + e.duration, 28009 isSyncRequest: e.isSyncRequest 28010 }); 28011 } 28012 return e; 28013 } 28014 stopForError(e) { 28015 (this.error(e), (this.state = 'READY'), this.pause(), this.trigger('error')); 28016 } 28017 segmentRequestFinished_(e, t, i) { 28018 if (this.subtitlesTrack_) 28019 if ((this.saveTransferStats_(t.stats), this.pendingSegment_)) 28020 if (e) 28021 (e.code === _u.TIMEOUT && this.handleTimeout_(), 28022 e.code === _u.ABORTED 28023 ? (this.mediaRequestsAborted += 1) 28024 : (this.mediaRequestsErrored += 1), 28025 this.stopForError(e)); 28026 else { 28027 var s = this.pendingSegment_, 28028 r = i.mp4VttCues && i.mp4VttCues.length, 28029 n = 28030 (r && (s.mp4VttCues = i.mp4VttCues), 28031 this.saveBandwidthRelatedStats_(s.duration, t.stats), 28032 t.key && this.segmentKey(t.key, !0), 28033 (this.state = 'APPENDING'), 28034 this.trigger('appending'), 28035 s.segment); 28036 if ( 28037 (n.map && (n.map.bytes = t.map.bytes), 28038 (s.bytes = t.bytes), 28039 'function' != typeof window.WebVTT && 'function' == typeof this.loadVttJs) 28040 ) 28041 ((this.state = 'WAITING_ON_VTTJS'), 28042 this.loadVttJs().then( 28043 () => this.segmentRequestFinished_(e, t, i), 28044 () => this.stopForError({ message: 'Error loading vtt.js' }) 28045 )); 28046 else { 28047 n.requested = !0; 28048 try { 28049 this.parseVTTCues_(s); 28050 } catch (e) { 28051 return void this.stopForError({ 28052 message: e.message, 28053 metadata: { errorType: E.Error.StreamingVttParserError, error: e } 28054 }); 28055 } 28056 (r || 28057 this.updateTimeMapping_( 28058 s, 28059 this.syncController_.timelines[s.timeline], 28060 this.playlist_ 28061 ), 28062 s.cues.length 28063 ? (s.timingInfo = { 28064 start: s.cues[0].startTime, 28065 end: s.cues[s.cues.length - 1].endTime 28066 }) 28067 : (s.timingInfo = { 28068 start: s.startOfSegment, 28069 end: s.startOfSegment + s.duration 28070 }), 28071 s.isSyncRequest 28072 ? (this.trigger('syncinfoupdate'), 28073 (this.pendingSegment_ = null),
28074 (this.state = 'READY')) 28075 : ((s.byteLength = s.bytes.byteLength), 28076 (this.mediaSecondsLoaded += n.duration), 28077 s.cues.forEach((e) => { 28078 this.subtitlesTrack_.addCue( 28079 this.featuresNativeTextTracks_ 28080 ? new window.VTTCue(e.startTime, e.endTime, e.text) 28081 : e 28082 ); 28083 }), 28084 (function (t) { 28085 var i = t.cues; 28086 if (i) { 28087 var s = {}; 28088 for (let e = i.length - 1; 0 <= e; e--) { 28089 var r = i[e], 28090 n = r.startTime + `-${r.endTime}-` + r.text; 28091 s[n] ? t.removeCue(r) : (s[n] = r); 28092 } 28093 } 28094 })(this.subtitlesTrack_), 28095 this.handleAppendsDone_())); 28096 } 28097 } 28098 else ((this.state = 'READY'), (this.mediaRequestsAborted += 1)); 28099 else this.state = 'READY'; 28100 } 28101 handleData_(e, t) { 28102 var i = e && 'vtt' === e.type, 28103 s = t && 'text' === t.type; 28104 i && s && super.handleData_(e, t); 28105 } 28106 updateTimingInfoEnd_() {} 28107 parseMp4VttCues_(r) { 28108 let n = 28109 null === this.sourceUpdater_.videoTimestampOffset() 28110 ? this.sourceUpdater_.audioTimestampOffset() 28111 : this.sourceUpdater_.videoTimestampOffset(); 28112 r.mp4VttCues.forEach((e) => { 28113 var t = e.start + n, 28114 i = e.end + n; 28115 let s = new window.VTTCue(t, i, e.cueText); 28116 (e.settings && 28117 e.settings.split(' ').forEach((e) => { 28118 var e = e.split(':'), 28119 t = e[0], 28120 e = e[1]; 28121 s[t] = isNaN(e) ? e : Number(e); 28122 }), 28123 r.cues.push(s)); 28124 }); 28125 } 28126 parseVTTCues_(t) { 28127 let i, 28128 s = !1; 28129 if ('function' != typeof window.WebVTT) throw new gc(); 28130 if (((t.cues = []), (t.timestampmap = { MPEGTS: 0, LOCAL: 0 }), t.mp4VttCues)) 28131 this.parseMp4VttCues_(t); 28132 else { 28133 'function' == typeof window.TextDecoder 28134 ? (i = new window.TextDecoder('utf8')) 28135 : ((i = window.WebVTT.StringDecoder()), (s = !0)); 28136 var r = new window.WebVTT.Parser(window, window.vttjs, i); 28137 if ( 28138 ((r.oncue = t.cues.push.bind(t.cues)), 28139 (r.ontimestampmap = (e) => { 28140 t.timestampmap = e; 28141 }), 28142 (r.onparsingerror = (e) => { 28143 E.log.warn('Error encountered when parsing cues: ' + e.message); 28144 }), 28145 t.segment.map) 28146 ) { 28147 let e = t.segment.map.bytes; 28148 (s && (e = pc(e)), r.parse(e)); 28149 } 28150 let e = t.bytes; 28151 (s && (e = pc(e)), r.parse(e), r.flush()); 28152 } 28153 } 28154 updateTimeMapping_(e, r, t) { 28155 var i = e.segment; 28156 if (r) 28157 if (e.cues.length) { 28158 var { MPEGTS: n, LOCAL: a } = e.timestampmap; 28159 let s = n / Rd - a + r.mapping; 28160 (e.cues.forEach((e) => { 28161 var t = e.endTime - e.startTime, 28162 i = this.handleRollover_(e.startTime + s, r.time); 28163 ((e.startTime = Math.max(i, 0)), (e.endTime = Math.max(i + t, 0))); 28164 }), 28165 t.syncInfo || 28166 ((n = e.cues[0].startTime), 28167 (a = e.cues[e.cues.length - 1].startTime), 28168 (t.syncInfo = { 28169 mediaSequence: t.mediaSequence + e.mediaIndex, 28170 time: Math.min(n, a - i.duration) 28171 }))); 28172 } else i.empty = !0; 28173 } 28174 handleRollover_(e, t) { 28175 if (null === t) return e; 28176 let i = e * Rd; 28177 var s = t * Rd; 28178 let r; 28179 for (r = s < i ? -8589934592 : 8589934592; 4294967296 < Math.abs(i - s); ) i += r; 28180 return i / Rd; 28181 } 28182 } 28183 class yc { 28184 constructor({ start: e, end: t, segmentIndex: i, partIndex: s = null, appended: r = !1 }) { 28185 ((this.start_ = e), 28186 (this.end_ = t), 28187 (this.segmentIndex_ = i), 28188 (this.partIndex_ = s), 28189 (this.appended_ = r)); 28190 } 28191 isInRange(e) { 28192 return e >= this.start && e < this.end; 28193 } 28194 markAppended() { 28195 this.appended_ = !0; 28196 } 28197 resetAppendedStatus() { 28198 this.appended_ = !1; 28199 } 28200 get isAppended() { 28201 return this.appended_; 28202 } 28203 get start() { 28204 return this.start_; 28205 } 28206 get end() { 28207 return this.end_; 28208 } 28209 get segmentIndex() { 28210 return this.segmentIndex_; 28211 } 28212 get partIndex() { 28213 return this.partIndex_; 28214 } 28215 } 28216 class _c { 28217 constructor(e, t = []) { 28218 ((this.segmentSyncInfo_ = e), (this.partsSyncInfo_ = t)); 28219 } 28220 get segmentSyncInfo() { 28221 return this.segmentSyncInfo_; 28222 } 28223 get partsSyncInfo() { 28224 return this.partsSyncInfo_; 28225 } 28226 get hasPartsSyncInfo() { 28227 return 0 < this.partsSyncInfo_.length; 28228 } 28229 resetAppendStatus() { 28230 (this.segmentSyncInfo_.resetAppendedStatus(), 28231 this.partsSyncInfo_.forEach((e) => e.resetAppendedStatus())); 28232 } 28233 } 28234 class vc { 28235 constructor() { 28236 ((this.storage_ = new Map()), 28237 (this.diagnostics_ = ''), 28238 (this.isReliable_ = !1), 28239 (this.start_ = -1 / 0), 28240 (this.end_ = 1 / 0)); 28241 } 28242 get start() { 28243 return this.start_; 28244 } 28245 get end() { 28246 return this.end_; 28247 } 28248 get diagnostics() { 28249 return this.diagnostics_; 28250 } 28251 get isReliable() { 28252 return this.isReliable_; 28253 } 28254 resetAppendedStatus() { 28255 this.storage_.forEach((e) => e.resetAppendStatus()); 28256 } 28257 update(e, t) { 28258 var { mediaSequence: e, segments: i } = e; 28259 if (((this.isReliable_ = this.isReliablePlaylist_(e, i)), this.isReliable_)) 28260 return this.updateStorage_(i, e, this.calculateBaseTime_(e, i, t)); 28261 } 28262 getSyncInfoForTime(e) { 28263 for (var { segmentSyncInfo: t, partsSyncInfo: i } of this.storage_.values()) 28264 if (i.length) { 28265 for (var s of i) if (s.isInRange(e)) return s; 28266 } else if (t.isInRange(e)) return t; 28267 return null; 28268 } 28269 getSyncInfoForMediaSequence(e) { 28270 return this.storage_.get(e); 28271 } 28272 updateStorage_(e, t, i) { 28273 let d = new Map(), 28274 h = '\n', 28275 u = i, 28276 c = t; 28277 ((this.start_ = u), 28278 e.forEach((e, a) => { 28279 let o = this.storage_.get(c); 28280 var t = u, 28281 i = t + e.duration, 28282 s = Boolean(o && o.segmentSyncInfo && o.segmentSyncInfo.isAppended), 28283 r = new yc({ start: t, end: i, appended: s, segmentIndex: a }); 28284 e.syncInfo = r; 28285 let l = u; 28286 var n = (e.parts || []).map((e, t) => { 28287 var i = l, 28288 s = l + e.duration, 28289 r = Boolean( 28290 o && o.partsSyncInfo && o.partsSyncInfo[t] && o.partsSyncInfo[t].isAppended 28291 ), 28292 n = new yc({ start: i, end: s, appended: r, segmentIndex: a, partIndex: t }); 28293 return ( 28294 (l = s), 28295 (h += `Media Sequence: ${c}.${t} | Range: ${i} --> ${s} | Appended: ${r} 28296`), 28297 (e.syncInfo = n) 28298 ); 28299 }); 28300 (d.set(c, new _c(r, n)), 28301 (h += `${ju(e.resolvedUri)} | Media Sequence: ${c} | Range: ${t} --> ${i} | Appended: ${s}\n`), 28302 c++, 28303 (u = i)); 28304 }), 28305 (this.end_ = u), 28306 (this.storage_ = d), 28307 (this.diagnostics_ = h)); 28308 } 28309 calculateBaseTime_(e, i, t) { 28310 if (!this.storage_.size) return 0; 28311 if (this.storage_.has(e)) return this.storage_.get(e).segmentSyncInfo.start; 28312 var s = Math.min(...this.storage_.keys()); 28313 if (e < s) { 28314 var r = s - e; 28315 let t = this.storage_.get(s).segmentSyncInfo.start; 28316 for (let e = 0; e < r; e++) { 28317 var n = i[e]; 28318 t -= n.duration; 28319 } 28320 return t; 28321 } 28322 return t; 28323 } 28324 isReliablePlaylist_(e, t) { 28325 return null != e && Array.isArray(t) && t.length; 28326 } 28327 } 28328 class bc extends vc { 28329 constructor(e) { 28330 (super(), (this.parent_ = e)); 28331 } 28332 calculateBaseTime_(e, t, i) { 28333 return this.storage_.size 28334 ? super.calculateBaseTime_(e, t, i) 28335 : (t = this.parent_.getSyncInfoForMediaSequence(e)) 28336 ? t.segmentSyncInfo.start 28337 : 0; 28338 } 28339 } 28340 let Tc = [ 28341 { 28342 name: 'VOD', 28343 run: (e, t, i, s, r) => { 28344 return i !== 1 / 0 ? { time: 0, segmentIndex: 0, partIndex: null } : null; 28345 } 28346 }, 28347 { 28348 name: 'MediaSequence', 28349 run: (e, t, i, s, r, n) => { 28350 e = e.getMediaSequenceSync(n); 28351 return e && e.isReliable && (n = e.getSyncInfoForTime(r)) 28352 ? { time: n.start, partIndex: n.partIndex, segmentIndex: n.segmentIndex } 28353 : null; 28354 } 28355 }, 28356 { 28357 name: 'ProgramDateTime', 28358 run: (t, i, e, s, r) => { 28359 if (!Object.keys(t.timelineToDatetimeMappings).length) return null; 28360 let n = null, 28361 a = null; 28362 var o = Yd(i); 28363 r = r || 0; 28364 for (let e = 0; e < o.length; e++) { 28365 var l = o[i.endList || 0 === r ? e : o.length - (e + 1)], 28366 d = l.segment, 28367 h = t.timelineToDatetimeMappings[d.timeline]; 28368 if (h && d.dateTimeObject) { 28369 let t = d.dateTimeObject.getTime() / 1e3 + h; 28370 if (d.parts && 'number' == typeof l.partIndex) 28371 for (let e = 0; e < l.partIndex; e++) t += d.parts[e].duration; 28372 h = Math.abs(r - t); 28373 if (null !== a && (0 === h || a < h)) break; 28374 ((a = h), (n = { time: t, segmentIndex: l.segmentIndex, partIndex: l.partIndex })); 28375 } 28376 } 28377 return n; 28378 } 28379 }, 28380 { 28381 name: 'Segment', 28382 run: (e, t, i, s, r) => { 28383 let n = null, 28384 a = null; 28385 r = r || 0; 28386 var o = Yd(t); 28387 for (let e = 0; e < o.length; e++) { 28388 var l = o[t.endList || 0 === r ? e : o.length - (e + 1)], 28389 d = l.segment, 28390 h = (l.part && l.part.start) || (d && d.start); 28391 if (d.timeline === s && 'undefined' != typeof h) { 28392 d = Math.abs(r - h); 28393 if (null !== a && a < d) break; 28394 (!n || null === a || a >= d) && 28395 ((a = d), (n = { time: h, segmentIndex: l.segmentIndex, partIndex: l.partIndex })); 28396 } 28397 } 28398 return n; 28399 } 28400 }, 28401 { 28402 name: 'Discontinuity', 28403 run: (i, s, e, t, r) => { 28404 let n = null; 28405 if (((r = r || 0), s.discontinuityStarts && s.discontinuityStarts.length)) { 28406 let t = null; 28407 for (let e = 0; e < s.discontinuityStarts.length; e++) { 28408 var a = s.discontinuityStarts[e], 28409 o = s.discontinuitySequence + e + 1, 28410 o = i.discontinuities[o]; 28411 if (o) { 28412 var l = Math.abs(r - o.time); 28413 if (null !== t && t < l) break; 28414 (!n || null === t || t >= l) && 28415 ((t = l), (n = { time: o.time, segmentIndex: a, partIndex: null })); 28416 } 28417 } 28418 } 28419 return n; 28420 } 28421 }, 28422 { 28423 name: 'Playlist', 28424 run: (e, t, i, s, r) => { 28425 return t.syncInfo 28426 ? { 28427 time: t.syncInfo.time, 28428 segmentIndex: t.syncInfo.mediaSequence - t.mediaSequence, 28429 partIndex: null 28430 } 28431 : null; 28432 } 28433 } 28434 ];
28435 class Sc extends E.EventTarget { 28436 constructor(e = 0) { 28437 (super(), 28438 (this.timelines = []), 28439 (this.discontinuities = []), 28440 (this.timelineToDatetimeMappings = {})); 28441 var t = new vc(), 28442 i = new bc(t), 28443 s = new bc(t); 28444 ((this.mediaSequenceStorage_ = { main: t, audio: i, vtt: s }), 28445 (this.logger_ = Ud('SyncController'))); 28446 } 28447 getMediaSequenceSync(e) { 28448 return this.mediaSequenceStorage_[e] || null; 28449 } 28450 getSyncPoint(e, t, i, s, r) { 28451 if (t !== 1 / 0) return Tc.find(({ name: e }) => 'VOD' === e).run(this, e, t); 28452 var n, 28453 t = this.runStrategies_(e, t, i, s, r); 28454 if (!t.length) return null; 28455 for (n of t) { 28456 var { syncPoint: a, strategy: o } = n, 28457 { segmentIndex: l, time: d } = a; 28458 if (!(l < 0)) { 28459 var h = d + e.segments[l].duration; 28460 if ( 28461 (this.logger_( 28462 `Strategy: ${o}. Current time: ${s}. selected segment: ${l}. Time: [${d} -> ${h}]}` 28463 ), 28464 d <= s && s < h) 28465 ) 28466 return (this.logger_('Found sync point with exact match: ', a), a); 28467 } 28468 } 28469 return this.selectSyncPoint_(t, { key: 'time', value: s }); 28470 } 28471 getExpiredTime(e, t) { 28472 return e && e.segments && (t = this.runStrategies_(e, t, e.discontinuitySequence, 0)).length 28473 ? (0 < (t = this.selectSyncPoint_(t, { key: 'segmentIndex', value: 0 })).segmentIndex && 28474 (t.time *= -1), 28475 Math.abs( 28476 t.time + 28477 Vd({ 28478 defaultDuration: e.targetDuration, 28479 durationList: e.segments, 28480 startIndex: t.segmentIndex, 28481 endIndex: 0 28482 }) 28483 )) 28484 : null; 28485 } 28486 runStrategies_(t, i, s, r, n) { 28487 var a = []; 28488 for (let e = 0; e < Tc.length; e++) { 28489 var o = Tc[e], 28490 l = o.run(this, t, i, s, r, n); 28491 l && ((l.strategy = o.name), a.push({ strategy: o.name, syncPoint: l })); 28492 } 28493 return a; 28494 } 28495 selectSyncPoint_(t, i) { 28496 let s = t[0].syncPoint, 28497 r = Math.abs(t[0].syncPoint[i.key] - i.value), 28498 n = t[0].strategy; 28499 for (let e = 1; e < t.length; e++) { 28500 var a = Math.abs(t[e].syncPoint[i.key] - i.value); 28501 a < r && ((r = a), (s = t[e].syncPoint), (n = t[e].strategy)); 28502 } 28503 return ( 28504 this.logger_( 28505 `syncPoint for [${i.key}: ${i.value}] chosen with strategy` + 28506 ` [${n}]: [time:${s.time},` + 28507 ' segmentIndex:' + 28508 s.segmentIndex + 28509 ('number' == typeof s.partIndex ? ',partIndex:' + s.partIndex : '') + 28510 ']' 28511 ), 28512 s 28513 ); 28514 } 28515 saveExpiredSegmentInfo(t, i) { 28516 var s = i.mediaSequence - t.mediaSequence; 28517 if (86400 < s) 28518 E.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`); 28519 else
28520 for (let e = s - 1; 0 <= e; e--) { 28521 var r = t.segments[e]; 28522 if (r && 'undefined' != typeof r.start) { 28523 ((i.syncInfo = { mediaSequence: t.mediaSequence + e, time: r.start }), 28524 this.logger_( 28525 `playlist refresh sync: [time:${i.syncInfo.time},` + 28526 ` mediaSequence: ${i.syncInfo.mediaSequence}]` 28527 ), 28528 this.trigger('syncinfoupdate')); 28529 break; 28530 } 28531 } 28532 } 28533 setDateTimeMappingForStart(e) { 28534 var t; 28535 ((this.timelineToDatetimeMappings = {}), 28536 e.segments && 28537 e.segments.length && 28538 e.segments[0].dateTimeObject && 28539 ((t = (e = e.segments[0]).dateTimeObject.getTime() / 1e3), 28540 (this.timelineToDatetimeMappings[e.timeline] = -t))); 28541 } 28542 saveSegmentTimingInfo({ segmentInfo: e, shouldSaveTimelineMapping: t }) { 28543 var i = this.calculateSegmentTimeMapping_(e, e.timingInfo, t), 28544 s = e.segment, 28545 i = 28546 (i && 28547 (this.saveDiscontinuitySyncInfo_(e), 28548 e.playlist.syncInfo || 28549 (e.playlist.syncInfo = { 28550 mediaSequence: e.playlist.mediaSequence + e.mediaIndex, 28551 time: s.start 28552 })), 28553 s.dateTimeObject); 28554 s.discontinuity && 28555 t && 28556 i && 28557 (this.timelineToDatetimeMappings[s.timeline] = -i.getTime() / 1e3); 28558 } 28559 timestampOffsetForTimeline(e) { 28560 return 'undefined' == typeof this.timelines[e] ? null : this.timelines[e].time; 28561 } 28562 mappingForTimeline(e) { 28563 return 'undefined' == typeof this.timelines[e] ? null : this.timelines[e].mapping; 28564 } 28565 calculateSegmentTimeMapping_(e, t, i) { 28566 var s = e.segment, 28567 r = e.part; 28568 let n = this.timelines[e.timeline], 28569 a, 28570 o; 28571 if ('number' == typeof e.timestampOffset) 28572 ((n = { time: e.startOfSegment, mapping: e.startOfSegment - t.start }), 28573 i && 28574 ((this.timelines[e.timeline] = n), 28575 this.trigger('timestampoffset'), 28576 this.logger_( 28577 `time mapping for timeline ${e.timeline}: ` + 28578 `[time: ${n.time}] [mapping: ${n.mapping}]` 28579 )), 28580 (a = e.startOfSegment)); 28581 else { 28582 if (!n) return !1; 28583 a = t.start + n.mapping; 28584 } 28585 return ( 28586 (o = t.end + n.mapping), 28587 r && ((r.start = a), (r.end = o)), 28588 (!s.start || a < s.start) && (s.start = a), 28589 (s.end = o), 28590 !0 28591 ); 28592 } 28593 saveDiscontinuitySyncInfo_(t) { 28594 var i = t.playlist, 28595 s = t.segment; 28596 if (s.discontinuity) this.discontinuities[s.timeline] = { time: s.start, accuracy: 0 }; 28597 else if (i.discontinuityStarts && i.discontinuityStarts.length) 28598 for (let e = 0; e < i.discontinuityStarts.length; e++) { 28599 var r = i.discontinuityStarts[e], 28600 n = i.discontinuitySequence + e + 1, 28601 a = r - t.mediaIndex, 28602 o = Math.abs(a); 28603 if (!this.discontinuities[n] || this.discontinuities[n].accuracy > o) { 28604 let e; 28605 ((e = 28606 a < 0 28607 ? s.start - 28608 Vd({ 28609 defaultDuration: i.targetDuration, 28610 durationList: i.segments, 28611 startIndex: t.mediaIndex, 28612 endIndex: r 28613 }) 28614 : s.end + 28615 Vd({ 28616 defaultDuration: i.targetDuration, 28617 durationList: i.segments, 28618 startIndex: t.mediaIndex + 1, 28619 endIndex: r 28620 })), 28621 (this.discontinuities[n] = { time: e, accuracy: o })); 28622 } 28623 } 28624 } 28625 dispose() { 28626 (this.trigger('dispose'), this.off()); 28627 } 28628 } 28629 class wc extends E.EventTarget { 28630 constructor() { 28631 (super(), (this.pendingTimelineChanges_ = {}), (this.lastTimelineChanges_ = {})); 28632 } 28633 clearPendingTimelineChange(e) { 28634 ((this.pendingTimelineChanges_[e] = null), this.trigger('pendingtimelinechange')); 28635 } 28636 pendingTimelineChange({ type: e, from: t, to: i }) { 28637 return ( 28638 'number' == typeof t && 28639 'number' == typeof i && 28640 ((this.pendingTimelineChanges_[e] = { type: e, from: t, to: i }), 28641 this.trigger('pendingtimelinechange')), 28642 this.pendingTimelineChanges_[e] 28643 ); 28644 } 28645 lastTimelineChange({ type: e, from: t, to: i }) { 28646 return ( 28647 'number' == typeof t && 28648 'number' == typeof i && 28649 ((this.lastTimelineChanges_[e] = { type: e, from: t, to: i }), 28650 delete this.pendingTimelineChanges_[e], 28651 this.trigger({ 28652 type: 'timelinechange', 28653 metadata: { timelineChangeInfo: { from: t, to: i } } 28654 })), 28655 this.lastTimelineChanges_[e] 28656 ); 28657 } 28658 dispose() { 28659 (this.trigger('dispose'), 28660 (this.pendingTimelineChanges_ = {}), 28661 (this.lastTimelineChanges_ = {}), 28662 this.off()); 28663 } 28664 } 28665 var Ec = Zh( 28666 eu( 28667 tu(function () { 28668 var e = (function () { 28669 function e() { 28670 this.listeners = {}; 28671 } 28672 var t = e.prototype; 28673 return ( 28674 (t.on = function (e, t) { 28675 (this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t)); 28676 }), 28677 (t.off = function (e, t) { 28678 return ( 28679 !!this.listeners[e] && 28680 ((t = this.listeners[e].indexOf(t)), 28681 (this.listeners[e] = this.listeners[e].slice(0)), 28682 this.listeners[e].splice(t, 1), 28683 -1 < t) 28684 ); 28685 }), 28686 (t.trigger = function (e) { 28687 var t = this.listeners[e]; 28688 if (t) 28689 if (2 === arguments.length) 28690 for (var i = t.length, s = 0; s < i; ++s) t[s].call(this, arguments[1]); 28691 else 28692 for ( 28693 var r = Array.prototype.slice.call(arguments, 1), n = t.length, a = 0; 28694 a < n; 28695 ++a 28696 ) 28697 t[a].apply(this, r); 28698 }), 28699 (t.dispose = function () { 28700 this.listeners = {}; 28701 }), 28702 (t.pipe = function (t) { 28703 this.on('data', function (e) { 28704 t.push(e); 28705 }); 28706 }), 28707 e 28708 ); 28709 })(); 28710 /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */ 28711 /*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */ 28712 let h = null; 28713 class g { 28714 constructor(e) { 28715 ((h = 28716 h || 28717 (function () { 28718 var e = [ 28719 [[], [], [], [], []], 28720 [[], [], [], [], []] 28721 ], 28722 t = e[0], 28723 i = e[1], 28724 s = t[4], 28725 r = i[4]; 28726 let n, a, o; 28727 var l, 28728 d, 28729 h, 28730 u, 28731 c = [], 28732 p = []; 28733 let m, g; 28734 for (n = 0; n < 256; n++) p[(c[n] = (n << 1) ^ (283 * (n >> 7))) ^ n] = n; 28735 for (a = o = 0; !s[a]; a ^= l || 1, o = p[o] || 1) 28736 for (
28737 u = ((u = o ^ (o << 1) ^ (o << 2) ^ (o << 3) ^ (o << 4)) >> 8) ^ (255 & u) ^ 99, 28738 h = c[(d = c[(l = c[(r[(s[a] = u)] = a)])])], 28739 g = (16843009 * h) ^ (65537 * d) ^ (257 * l) ^ (16843008 * a), 28740 m = (257 * c[u]) ^ (16843008 * u), 28741 n = 0; 28742 n < 4; 28743 n++ 28744 ) 28745 ((t[n][a] = m = (m << 24) ^ (m >>> 8)), (i[n][u] = g = (g << 24) ^ (g >>> 8))); 28746 for (n = 0; n < 5; n++) ((t[n] = t[n].slice(0)), (i[n] = i[n].slice(0))); 28747 return e; 28748 })()), 28749 (this._tables = [ 28750 [ 28751 h[0][0].slice(), 28752 h[0][1].slice(), 28753 h[0][2].slice(), 28754 h[0][3].slice(), 28755 h[0][4].slice() 28756 ], 28757 [ 28758 h[1][0].slice(), 28759 h[1][1].slice(), 28760 h[1][2].slice(), 28761 h[1][3].slice(), 28762 h[1][4].slice() 28763 ] 28764 ])); 28765 let t, i, s; 28766 var r = this._tables[0][4], 28767 n = this._tables[1], 28768 a = e.length; 28769 let o = 1; 28770 if (4 !== a && 6 !== a && 8 !== a) throw new Error('Invalid aes key size'); 28771 var l = e.slice(0), 28772 d = []; 28773 for (this._key = [l, d], t = a; t < 4 * a + 28; t++) 28774 ((s = l[t - 1]), 28775 (t % a == 0 || (8 === a && t % a == 4)) && 28776 ((s = 28777 (r[s >>> 24] << 24) ^ 28778 (r[(s >> 16) & 255] << 16) ^ 28779 (r[(s >> 8) & 255] << 8) ^ 28780 r[255 & s]), 28781 t % a == 0) && 28782 ((s = (s << 8) ^ (s >>> 24) ^ (o << 24)), (o = (o << 1) ^ (283 * (o >> 7)))), 28783 (l[t] = l[t - a] ^ s)); 28784 for (i = 0; t; i++, t--) 28785 ((s = l[3 & i ? t : t - 4]), 28786 t <= 4 || i < 4 28787 ? (d[i] = s) 28788 : (d[i] = 28789 n[0][r[s >>> 24]] ^ 28790 n[1][r[(s >> 16) & 255]] ^ 28791 n[2][r[(s >> 8) & 255]] ^ 28792 n[3][r[255 & s]])); 28793 } 28794 decrypt(e, t, i, s, r, n) { 28795 var a, 28796 o, 28797 l = this._key[1]; 28798 let d = e ^ l[0], 28799 h = s ^ l[1], 28800 u = i ^ l[2], 28801 c = t ^ l[3], 28802 p; 28803 var m = l.length / 4 - 2; 28804 let g, 28805 f = 4; 28806 var e = this._tables[1], 28807 y = e[0], 28808 _ = e[1], 28809 v = e[2], 28810 b = e[3], 28811 T = e[4]; 28812 for (g = 0; g < m; g++) 28813 ((p = y[d >>> 24] ^ _[(h >> 16) & 255] ^ v[(u >> 8) & 255] ^ b[255 & c] ^ l[f]), 28814 (a = y[h >>> 24] ^ _[(u >> 16) & 255] ^ v[(c >> 8) & 255] ^ b[255 & d] ^ l[f + 1]), 28815 (o = y[u >>> 24] ^ _[(c >> 16) & 255] ^ v[(d >> 8) & 255] ^ b[255 & h] ^ l[f + 2]), 28816 (c = y[c >>> 24] ^ _[(d >> 16) & 255] ^ v[(h >> 8) & 255] ^ b[255 & u] ^ l[f + 3]), 28817 (f += 4), 28818 (d = p), 28819 (h = a), 28820 (u = o)); 28821 for (g = 0; g < 4; g++) 28822 ((r[(3 & -g) + n] = 28823 (T[d >>> 24] << 24) ^ 28824 (T[(h >> 16) & 255] << 16) ^ 28825 (T[(u >> 8) & 255] << 8) ^ 28826 T[255 & c] ^ 28827 l[f++]), 28828 (p = d), 28829 (d = h), 28830 (h = u), 28831 (u = c), 28832 (c = p)); 28833 } 28834 } 28835 class l extends e { 28836 constructor() { 28837 (super(e), (this.jobs = []), (this.delay = 1), (this.timeout_ = null)); 28838 } 28839 processJob_() { 28840 (this.jobs.shift()(), 28841 this.jobs.length 28842 ? (this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay)) 28843 : (this.timeout_ = null)); 28844 } 28845 push(e) { 28846 (this.jobs.push(e), 28847 this.timeout_ || 28848 (this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay))); 28849 } 28850 } 28851 function f(e) { 28852 return (e << 24) | ((65280 & e) << 8) | ((16711680 & e) >> 8) | (e >>> 24); 28853 } 28854 class d { 28855 constructor(e, t, i, s) { 28856 var r = d.STEP, 28857 n = new Int32Array(e.buffer); 28858 let a = new Uint8Array(e.byteLength), 28859 o = 0; 28860 for ( 28861 this.asyncStream_ = new l(), 28862 this.asyncStream_.push(this.decryptChunk_(n.subarray(o, o + r), t, i, a)), 28863 o = r; 28864 o < n.length; 28865 o += r 28866 ) 28867 ((i = new Uint32Array([f(n[o - 4]), f(n[o - 3]), f(n[o - 2]), f(n[o - 1])])), 28868 this.asyncStream_.push(this.decryptChunk_(n.subarray(o, o + r), t, i, a))); 28869 this.asyncStream_.push(function () { 28870 var e; 28871 s(null, (e = a).subarray(0, e.byteLength - e[e.byteLength - 1])); 28872 }); 28873 } 28874 static get STEP() { 28875 return 32e3; 28876 } 28877 decryptChunk_(t, i, s, r) { 28878 return function () { 28879 var e = (function (e, t, i) { 28880 var s, 28881 r, 28882 n, 28883 a, 28884 o = new Int32Array(e.buffer, e.byteOffset, e.byteLength >> 2), 28885 l = new g(Array.prototype.slice.call(t)), 28886 t = new Uint8Array(e.byteLength), 28887 d = new Int32Array(t.buffer); 28888 let h, u, c, p, m; 28889 for (h = i[0], u = i[1], c = i[2], p = i[3], m = 0; m < o.length; m += 4) 28890 ((s = f(o[m])), 28891 (r = f(o[m + 1])), 28892 (n = f(o[m + 2])), 28893 (a = f(o[m + 3])), 28894 l.decrypt(s, r, n, a, d, m),
28895 (d[m] = f(d[m] ^ h)), 28896 (d[m + 1] = f(d[m + 1] ^ u)), 28897 (d[m + 2] = f(d[m + 2] ^ c)), 28898 (d[m + 3] = f(d[m + 3] ^ p)), 28899 (h = s), 28900 (u = r), 28901 (c = n), 28902 (p = a)); 28903 return t; 28904 })(t, i, s); 28905 r.set(e, t.byteOffset); 28906 }; 28907 } 28908 } 28909 var t = 28910 'undefined' != typeof globalThis 28911 ? globalThis 28912 : 'undefined' != typeof window 28913 ? window 28914 : 'undefined' != typeof global 28915 ? global 28916 : 'undefined' != typeof self 28917 ? self 28918 : {}, 28919 t = 28920 'undefined' != typeof window 28921 ? window 28922 : 'undefined' != typeof t 28923 ? t 28924 : 'undefined' != typeof self 28925 ? self 28926 : {}, 28927 t = t.BigInt || Number; 28928 (t('0x1'), 28929 t('0x100'), 28930 t('0x10000'), 28931 t('0x1000000'), 28932 t('0x100000000'), 28933 t('0x10000000000'), 28934 t('0x1000000000000'), 28935 t('0x100000000000000'), 28936 t('0x10000000000000000'), 28937 (t = new Uint16Array([65484])), 28938 (t = new Uint8Array(t.buffer, t.byteOffset, t.byteLength))[0]); 28939 function r(s) { 28940 let r = {}; 28941 return ( 28942 Object.keys(s).forEach((e) => { 28943 var t, 28944 i = s[e]; 28945 ((t = i), 28946 ( 28947 'function' === ArrayBuffer.isView 28948 ? ArrayBuffer.isView(t) 28949 : t && t.buffer instanceof ArrayBuffer 28950 ) 28951 ? (r[e] = { bytes: i.buffer, byteOffset: i.byteOffset, byteLength: i.byteLength }) 28952 : (r[e] = i)); 28953 }), 28954 r 28955 ); 28956 } 28957 self.onmessage = function (e) { 28958 let i = e.data; 28959 var e = new Uint8Array(i.encrypted.bytes, i.encrypted.byteOffset, i.encrypted.byteLength), 28960 t = new Uint32Array(i.key.bytes, i.key.byteOffset, i.key.byteLength / 4), 28961 s = new Uint32Array(i.iv.bytes, i.iv.byteOffset, i.iv.byteLength / 4); 28962 new d(e, t, s, function (e, t) { 28963 self.postMessage(r({ source: i.source, decrypted: t }), [t.buffer]); 28964 }); 28965 }; 28966 }) 28967 ) 28968 ); 28969 let Cc = (e, t) => { 28970 (e.abort(), 28971 e.pause(), 28972 t && 28973 t.activePlaylistLoader && 28974 (t.activePlaylistLoader.pause(), (t.activePlaylistLoader = null))); 28975 }, 28976 kc = (e, t) => { 28977 (t.activePlaylistLoader = e).load(); 28978 }, 28979 Ic = { 28980 AUDIO: (a, o) => () => { 28981 var { 28982 mediaTypes: { [a]: e }, 28983 excludePlaylist: t 28984 } = o, 28985 i = e.activeTrack(), 28986 s = e.activeGroup(), 28987 s = (s.filter((e) => e.default)[0] || s[0]).id, 28988 r = e.tracks[s]; 28989 if (i === r) 28990 t({ error: { message: 'Problem encountered loading the default audio track.' } }); 28991 else { 28992 for (var n in (E.log.warn( 28993 'Problem encountered loading the alternate audio track.Switching back to default.' 28994 ), 28995 e.tracks)) 28996 e.tracks[n].enabled = e.tracks[n] === r; 28997 e.onTrackChanged(); 28998 } 28999 }, 29000 SUBTITLES: (i, s) => () => { 29001 var { [i]: e } = s.mediaTypes, 29002 t = 29003 (E.log.warn('Problem encountered loading the subtitle track.Disabling subtitle track.'), 29004 e.activeTrack()); 29005 (t && (t.mode = 'disabled'), e.onTrackChanged()); 29006 } 29007 }, 29008 xc = { 29009 AUDIO: (e, t, i) => { 29010 if (!t) return; 29011 let { 29012 tech: s, 29013 requestOptions: r, 29014 segmentLoaders: { [e]: n } 29015 } = i; 29016 (t.on('loadedmetadata', () => { 29017 var e = t.media(); 29018 (n.playlist(e, r), (!s.paused() || (e.endList && 'none' !== s.preload())) && n.load()); 29019 }), 29020 t.on('loadedplaylist', () => { 29021 (n.playlist(t.media(), r), s.paused() || n.load()); 29022 }), 29023 t.on('error', Ic[e](e, i))); 29024 }, 29025 SUBTITLES: (e, t, i) => { 29026 let { 29027 tech: s, 29028 requestOptions: r, 29029 segmentLoaders: { [e]: n }, 29030 mediaTypes: { [e]: a } 29031 } = i; 29032 (t.on('loadedmetadata', () => { 29033 var e = t.media(); 29034 (n.playlist(e, r), 29035 n.track(a.activeTrack()), 29036 (!s.paused() || (e.endList && 'none' !== s.preload())) && n.load()); 29037 }), 29038 t.on('loadedplaylist', () => { 29039 (n.playlist(t.media(), r), s.paused() || n.load()); 29040 }), 29041 t.on('error', Ic[e](e, i))); 29042 } 29043 }, 29044 Ac = { 29045 AUDIO: (i, s) => { 29046 var r, 29047 n, 29048 { 29049 vhs: a, 29050 sourceType: o, 29051 segmentLoaders: { [i]: e }, 29052 requestOptions: l, 29053 main: { mediaGroups: d }, 29054 mediaTypes: { 29055 [i]: { groups: h, tracks: u, logger_: c } 29056 }, 29057 mainPlaylistLoader: p 29058 } = s, 29059 m = uh(p.main); 29060 for (r in ((d[i] && 0 !== Object.keys(d[i]).length) || 29061 ((d[i] = { main: { default: { default: !0 } } }), 29062 m && (d[i].main.default.playlists = p.main.playlists)), 29063 d[i])) 29064 for (var g in (h[r] || (h[r] = []), d[i][r])) { 29065 let e = d[i][r][g], 29066 t; 29067 ((t = m 29068 ? (c(`AUDIO group '${r}' label '${g}' is a main playlist`), 29069 (e.isMainPlaylist = !0), 29070 null) 29071 : 'vhs-json' === o && e.playlists 29072 ? new xh(e.playlists[0], a, l) 29073 : e.resolvedUri 29074 ? new xh(e.resolvedUri, a, l) 29075 : e.playlists && 'dash' === o 29076 ? new Yh(e.playlists[0], a, l, p) 29077 : null),
29078 (e = L({ id: g, playlistLoader: t }, e)), 29079 xc[i](i, e.playlistLoader, s), 29080 h[r].push(e), 29081 'undefined' == typeof u[g] && 29082 ((n = new E.AudioTrack({ 29083 id: g, 29084 kind: ((e) => { 29085 let t = e.default ? 'main' : 'alternative'; 29086 return (t = 29087 e.characteristics && 29088 0 <= e.characteristics.indexOf('public.accessibility.describes-video') 29089 ? 'main-desc' 29090 : t); 29091 })(e), 29092 enabled: !1, 29093 language: e.language, 29094 default: e.default, 29095 label: g 29096 })), 29097 (u[g] = n))); 29098 } 29099 e.on('error', Ic[i](i, s)); 29100 }, 29101 SUBTITLES: (i, s) => { 29102 var r, 29103 n, 29104 { 29105 tech: a, 29106 vhs: o, 29107 sourceType: l, 29108 segmentLoaders: { [i]: e }, 29109 requestOptions: d, 29110 main: { mediaGroups: h }, 29111 mediaTypes: { 29112 [i]: { groups: u, tracks: c } 29113 }, 29114 mainPlaylistLoader: p 29115 } = s; 29116 for (r in h[i]) 29117 for (var m in (u[r] || (u[r] = []), h[i][r])) 29118 if (o.options_.useForcedSubtitles || !h[i][r][m].forced) { 29119 let e = h[i][r][m], 29120 t; 29121 if ('hls' === l) t = new xh(e.resolvedUri, o, d); 29122 else if ('dash' === l) { 29123 if (!e.playlists.filter((e) => e.excludeUntil !== 1 / 0).length) return; 29124 t = new Yh(e.playlists[0], o, d, p); 29125 } else 29126 'vhs-json' === l && 29127 (t = new xh(e.playlists ? e.playlists[0] : e.resolvedUri, o, d)); 29128 ((e = L({ id: m, playlistLoader: t }, e)), 29129 xc[i](i, e.playlistLoader, s), 29130 u[r].push(e), 29131 'undefined' == typeof c[m] && 29132 ((n = a.addRemoteTextTrack( 29133 { 29134 id: m, 29135 kind: 'subtitles', 29136 default: e.default && e.autoselect, 29137 language: e.language, 29138 label: m 29139 }, 29140 !1 29141 ).track), 29142 (c[m] = n))); 29143 } 29144 e.on('error', Ic[i](i, s)); 29145 }, 29146 'CLOSED-CAPTIONS': (e, t) => { 29147 var i, 29148 { 29149 tech: s, 29150 main: { mediaGroups: r }, 29151 mediaTypes: { 29152 [e]: { groups: n, tracks: a } 29153 } 29154 } = t; 29155 for (i in r[e]) 29156 for (var o in (n[i] || (n[i] = []), r[e][i])) { 29157 var l = r[e][i][o]; 29158 if (/^(?:CC|SERVICE)/.test(l.instreamId)) { 29159 var d = (s.options_.vhs && s.options_.vhs.captionServices) || {}; 29160 let e = { 29161 label: o, 29162 language: l.language, 29163 instreamId: l.instreamId, 29164 default: l.default && l.autoselect 29165 }; 29166 (void 0 === (e = d[e.instreamId] ? L(e, d[e.instreamId]) : e).default && 29167 delete e.default, 29168 n[i].push(L({ id: o }, l)), 29169 'undefined' == typeof a[o] && 29170 ((d = s.addRemoteTextTrack( 29171 { 29172 id: e.instreamId, 29173 kind: 'captions', 29174 default: e.default, 29175 language: e.language, 29176 label: e.label 29177 }, 29178 !1 29179 ).track), 29180 (a[o] = d))); 29181 } 29182 } 29183 } 29184 }, 29185 Dc = (t, i) => { 29186 for (let e = 0; e < t.length; e++) { 29187 if (hh(i, t[e])) return !0; 29188 if (t[e].playlists && Dc(t[e].playlists, i)) return !0; 29189 } 29190 return !1; 29191 }, 29192 Pc = { 29193 AUDIO: (i, s) => () => { 29194 var e, 29195 { 29196 [i]: { tracks: t } 29197 } = s.mediaTypes; 29198 for (e in t) if (t[e].enabled) return t[e]; 29199 return null; 29200 }, 29201 SUBTITLES: (i, s) => () => { 29202 var e, 29203 { 29204 [i]: { tracks: t } 29205 } = s.mediaTypes; 29206 for (e in t) if ('showing' === t[e].mode || 'hidden' === t[e].mode) return t[e]; 29207 return null; 29208 } 29209 }, 29210 Lc = (n) => { 29211 ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach((e) => { 29212 Ac[e](e, n); 29213 }); 29214 let { 29215 mediaTypes: a, 29216 mainPlaylistLoader: e, 29217 tech: t, 29218 vhs: i, 29219 segmentLoaders: { AUDIO: s, main: r } 29220 } = n; 29221 ['AUDIO', 'SUBTITLES'].forEach((e) => { 29222 var o, l, d, h, i, s, u, c, t, r; 29223 ((a[e].activeGroup = 29224 ((o = e), 29225 (l = n), 29226 (t) => { 29227 var { 29228 mainPlaylistLoader: e, 29229 mediaTypes: { 29230 [o]: { groups: i } 29231 } 29232 } = l, 29233 s = e.media(); 29234 if (!s) return null; 29235 let r = null; 29236 s.attributes[o] && (r = i[s.attributes[o]]); 29237 var n = Object.keys(i); 29238 if (!r) 29239 if ('AUDIO' === o && 1 < n.length && uh(l.main)) 29240 for (let e = 0; e < n.length; e++) { 29241 var a = i[n[e]]; 29242 if (Dc(a, s)) { 29243 r = a; 29244 break; 29245 } 29246 } 29247 else i.main ? (r = i.main) : 1 === n.length && (r = i[n[0]]); 29248 return 'undefined' == typeof t 29249 ? r 29250 : (null !== t && r && r.filter((e) =>
29250 e.id === t.id)[0]) || null; 29251 })), 29252 (a[e].activeTrack = Pc[e](e, n)), 29253 (a[e].onGroupChanged = 29254 ((d = e), 29255 (h = n), 29256 () => { 29257 var { 29258 segmentLoaders: { [d]: e, main: t }, 29259 mediaTypes: { [d]: i } 29260 } = h, 29261 s = i.activeTrack(), 29262 r = i.getActiveGroup(), 29263 n = i.activePlaylistLoader, 29264 a = i.lastGroup_; 29265 (r && a && r.id === a.id) || 29266 ((i.lastGroup_ = r), 29267 (i.lastTrack_ = s), 29268 Cc(e, i), 29269 r && 29270 !r.isMainPlaylist && 29271 (r.playlistLoader 29272 ? (e.resyncLoader(), kc(r.playlistLoader, i)) 29273 : n && t.resetEverything())); 29274 })), 29275 (a[e].onGroupChanging = 29276 ((i = e), 29277 (s = n), 29278 () => { 29279 var { 29280 segmentLoaders: { [i]: e }, 29281 mediaTypes: { [i]: t } 29282 } = s; 29283 ((t.lastGroup_ = null), e.abort(), e.pause()); 29284 })), 29285 (a[e].onTrackChanged = 29286 ((u = e), 29287 (c = n), 29288 () => { 29289 var e, 29290 t, 29291 { 29292 mainPlaylistLoader: i, 29293 segmentLoaders: { [u]: s, main: r }, 29294 mediaTypes: { [u]: n } 29295 } = c, 29296 a = n.activeTrack(), 29297 o = n.getActiveGroup(), 29298 l = n.activePlaylistLoader, 29299 d = n.lastTrack_; 29300 if ( 29301 (!d || !a || d.id !== a.id) && 29302 ((n.lastGroup_ = o), (n.lastTrack_ = a), Cc(s, n), o) 29303 ) { 29304 if (o.isMainPlaylist) 29305 return !a || 29306 !d || 29307 a.id === d.id || 29308 ((t = (e = c.vhs.playlistController_).selectPlaylist()), e.media() === t) 29309 ? void 0 29310 : (n.logger_(`track change. Switching main audio from ${d.id} to ` + a.id), 29311 i.pause(), 29312 r.resetEverything(), 29313 void e.fastQualityChange_(t)); 29314 if ('AUDIO' === u) { 29315 if (!o.playlistLoader) return (r.setAudio(!0), void r.resetEverything()); 29316 (s.setAudio(!0), r.setAudio(!1)); 29317 } 29318 (l === o.playlistLoader || (s.track && s.track(a), s.resetEverything()), 29319 kc(o.playlistLoader, n)); 29320 } 29321 })), 29322 (a[e].getActiveGroup = 29323 (([t, r] = [e, n.mediaTypes]), 29324 () => { 29325 var e = r[t].activeTrack(); 29326 return e ? r[t].activeGroup(e) : null; 29327 }))); 29328 }); 29329 var o, 29330 l = a.AUDIO.activeGroup(); 29331 (l && 29332 ((l = (l.filter((e) => e.default)[0] || l[0]).id), 29333 (a.AUDIO.tracks[l].enabled = !0), 29334 a.AUDIO.onGroupChanged(), 29335 a.AUDIO.onTrackChanged(), 29336 (a.AUDIO.getActiveGroup().playlistLoader ? (r.setAudio(!1), s) : r).setAudio(!0)), 29337 e.on('mediachange', () => { 29338 ['AUDIO', 'SUBTITLES'].forEach((e) => a[e].onGroupChanged()); 29339 }), 29340 e.on('mediachanging', () => { 29341 ['AUDIO', 'SUBTITLES'].forEach((e) => a[e].onGroupChanging()); 29342 })); 29343 let d = () => { 29344 (a.AUDIO.onTrackChanged(), t.trigger({ type: 'usage', name: 'vhs-audio-change' })); 29345 }; 29346 for (o in (t.audioTracks().addEventListener('change', d), 29347 t.remoteTextTracks().addEventListener('change', a.SUBTITLES.onTrackChanged), 29348 i.on('dispose', () => { 29349 (t.audioTracks().removeEventListener('change', d), 29350 t.remoteTextTracks().removeEventListener('change', a.SUBTITLES.onTrackChanged)); 29351 }), 29352 t.clearTracks('audio'), 29353 a.AUDIO.tracks)) 29354 t.audioTracks().addTrack(a.AUDIO.tracks[o]); 29355 }; 29356 class Oc { 29357 constructor() { 29358 ((this.priority_ = []), (this.pathwayClones_ = new Map())); 29359 } 29360 set version(e) { 29361 1 === e && (this.version_ = e); 29362 } 29363 set ttl(e) { 29364 this.ttl_ = e || 300; 29365 } 29366 set reloadUri(e) { 29367 e && (this.reloadUri_ = Nd(this.reloadUri_, e)); 29368 } 29369 set priority(e) { 29370 e && e.length && (this.priority_ = e); 29371 } 29372 set pathwayClones(e) { 29373 e && e.length && (this.pathwayClones_ = new Map(e.map((e) => [e.ID, e]))); 29374 } 29375 get version() { 29376 return this.version_; 29377 } 29378 get ttl() { 29379 return this.ttl_; 29380 } 29381 get reloadUri() { 29382 return this.reloadUri_; 29383 } 29384 get priority() { 29385 return this.priority_; 29386 } 29387 get pathwayClones() { 29388 return this.pathwayClones_; 29389 } 29390 }
29391 class Rc extends E.EventTarget { 29392 constructor(e, t) { 29393 (super(), 29394 (this.currentPathway = null), 29395 (this.defaultPathway = null), 29396 (this.queryBeforeStart = !1), 29397 (this.availablePathways_ = new Set()), 29398 (this.steeringManifest = new Oc()), 29399 (this.proxyServerUrl_ = null), 29400 (this.manifestType_ = null), 29401 (this.ttlTimeout_ = null), 29402 (this.request_ = null), 29403 (this.currentPathwayClones = new Map()), 29404 (this.nextPathwayClones = new Map()), 29405 (this.excludedSteeringManifestURLs = new Set()), 29406 (this.logger_ = Ud('Content Steering')), 29407 (this.xhr_ = e), 29408 (this.getBandwidth_ = t)); 29409 } 29410 assignTagProperties(e, t) { 29411 this.manifestType_ = t.serverUri ? 'HLS' : 'DASH'; 29412 var i = t.serverUri || t.serverURL; 29413 i 29414 ? i.startsWith('data:') 29415 ? this.decodeDataUriManifest_(i.substring(i.indexOf(',') + 1)) 29416 : ((this.steeringManifest.reloadUri = Nd(e, i)), 29417 (this.defaultPathway = t.pathwayId || t.defaultServiceLocation), 29418 (this.queryBeforeStart = t.queryBeforeStart), 29419 (this.proxyServerUrl_ = t.proxyServerURL), 29420 this.defaultPathway && !this.queryBeforeStart && this.trigger('content-steering')) 29421 : (this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`), 29422 this.trigger('error')); 29423 } 29424 requestSteeringManifest(e) { 29425 var t = this.steeringManifest.reloadUri; 29426 if (t) { 29427 let r = e ? t : this.getRequestURI(t); 29428 if (r) { 29429 let s = { contentSteeringInfo: { uri: r } }; 29430 (this.trigger({ type: 'contentsteeringloadstart', metadata: s }), 29431 (this.request_ = this.xhr_( 29432 { uri: r, requestType: 'content-steering-manifest' }, 29433 (e, t) => { 29434 if (e) 29435 return 410 === t.status 29436 ? (this.logger_(`manifest request 410 ${e}.`), 29437 this.logger_( 29438 `There will be no more content steering requests to ${r} this session.` 29439 ), 29440 void this.excludedSteeringManifestURLs.add(r)) 29441 : 429 === t.status 29442 ? ((t = t.responseHeaders['retry-after']), 29443 this.logger_(`manifest request 429 ${e}.`), 29444 this.logger_(`content steering will retry in ${t} seconds.`), 29445 void this.startTTLTimeout_(parseInt(t, 10))) 29446 : (this.logger_(`manifest failed to load ${e}.`), 29447 void this.startTTLTimeout_()); 29448 this.trigger({ type: 'contentsteeringloadcomplete', metadata: s }); 29449 let i; 29450 try { 29451 i = JSON.parse(this.request_.responseText); 29452 } catch (e) { 29453 t = { errorType: E.Error.StreamingContentSteeringParserError, error: e }; 29454 this.trigger({ type: 'error', metadata: t }); 29455 } 29456 this.assignSteeringProperties_(i); 29457 e = { 29458 contentSteeringInfo: s.contentSteeringInfo, 29459 contentSteeringManifest: { 29460 version: this.steeringManifest.version, 29461 reloadUri: this.steeringManifest.reloadUri, 29462 priority: this.steeringManifest.priority 29463 } 29464 }; 29465 (this.trigger({ type: 'contentsteeringparsed', metadata: e }), 29466 this.startTTLTimeout_()); 29467 } 29468 ))); 29469 } else 29470 (this.logger_('No valid content steering manifest URIs. Stopping content steering.'), 29471 this.trigger('error'), 29472 this.dispose()); 29473 } 29474 } 29475 setProxyServerUrl_(e) { 29476 var e = new window.URL(e), 29477 t = new window.URL(this.proxyServerUrl_); 29478 return ( 29479 t.searchParams.set('url', encodeURI(e.toString())), 29480 this.setSteeringParams_(t.toString()) 29481 ); 29482 } 29483 decodeDataUriManifest_(e) { 29484 e = JSON.parse(window.atob(e)); 29485 this.assignSteeringProperties_(e); 29486 } 29487 setSteeringParams_(e) { 29488 var t, 29489 e = new window.URL(e), 29490 i = this.getPathway(), 29491 s = this.getBandwidth_(); 29492 return ( 29493 i && ((t = `_${this.manifestType_}_pathway`), e.searchParams.set(t, i)), 29494 s && ((t = `_${this.manifestType_}_throughput`), e.searchParams.set(t, s)), 29495 e.toString() 29496 ); 29497 } 29498 assignSteeringProperties_(e) { 29499 var t; 29500 ((this.steeringManifest.version = e.VERSION), 29501 this.steeringManifest.version 29502 ? ((this.steeringManifest.ttl = e.TTL), 29503 (this.steeringManifest.reloadUri = e['RELOAD-URI']), 29504 (this.steeringManifest.priority = 29505 e['PATHWAY-PRIORITY'] || e['SERVICE-LOCATION-PRIORITY']), 29506 (this.steeringManifest.pathwayClones = e['PATHWAY-CLONES']), 29507 (this.nextPathwayClones = this.steeringManifest.pathwayClones), 29508 this.availablePathways_.size || 29509 (this.logger_(
29510 'There are no available pathways for content steering. Ending content steering.' 29511 ), 29512 this.trigger('error'), 29513 this.dispose()), 29514 (t = ((e) => { 29515 for (var t of e) if (this.availablePathways_.has(t)) return t; 29516 return [...this.availablePathways_][0]; 29517 })(this.steeringManifest.priority)), 29518 this.currentPathway !== t && 29519 ((this.currentPathway = t), this.trigger('content-steering'))) 29520 : (this.logger_(`manifest version is ${e.VERSION}, which is not supported.`), 29521 this.trigger('error'))); 29522 } 29523 getPathway() { 29524 return this.currentPathway || this.defaultPathway; 29525 } 29526 getRequestURI(e) { 29527 if (!e) return null; 29528 var t = (e) => this.excludedSteeringManifestURLs.has(e); 29529 if (this.proxyServerUrl_) { 29530 var i = this.setProxyServerUrl_(e); 29531 if (!t(i)) return i; 29532 } 29533 i = this.setSteeringParams_(e); 29534 return t(i) ? null : i; 29535 } 29536 startTTLTimeout_(e = this.steeringManifest.ttl) { 29537 this.ttlTimeout_ = window.setTimeout(() => { 29538 this.requestSteeringManifest(); 29539 }, 1e3 * e); 29540 } 29541 clearTTLTimeout_() { 29542 (window.clearTimeout(this.ttlTimeout_), (this.ttlTimeout_ = null)); 29543 } 29544 abort() { 29545 (this.request_ && this.request_.abort(), (this.request_ = null)); 29546 } 29547 dispose() { 29548 (this.off('content-steering'), 29549 this.off('error'), 29550 this.abort(), 29551 this.clearTTLTimeout_(), 29552 (this.currentPathway = null), 29553 (this.defaultPathway = null), 29554 (this.queryBeforeStart = null), 29555 (this.proxyServerUrl_ = null), 29556 (this.manifestType_ = null), 29557 (this.ttlTimeout_ = null), 29558 (this.request_ = null), 29559 (this.excludedSteeringManifestURLs = new Set()), 29560 (this.availablePathways_ = new Set()), 29561 (this.steeringManifest = new Oc())); 29562 } 29563 addAvailablePathway(e) { 29564 e && this.availablePathways_.add(e); 29565 } 29566 clearAvailablePathways() { 29567 this.availablePathways_.clear(); 29568 } 29569 excludePathway(e) { 29570 return this.availablePathways_.delete(e); 29571 } 29572 didDASHTagChange(e, t) { 29573 return ( 29574 (!t && this.steeringManifest.reloadUri) || 29575 (t && 29576 (Nd(e, t.serverURL) !== this.steeringManifest.reloadUri || 29577 t.defaultServiceLocation !== this.defaultPathway || 29578 t.queryBeforeStart !== this.queryBeforeStart || 29579 t.proxyServerURL !== this.proxyServerUrl_)) 29580 ); 29581 } 29582 getAvailablePathways() { 29583 return this.availablePathways_; 29584 } 29585 } 29586 let Nc, 29587 Mc = [ 29588 'mediaRequests', 29589 'mediaRequestsAborted', 29590 'mediaRequestsTimedout', 29591 'mediaRequestsErrored', 29592 'mediaTransferDuration', 29593 'mediaBytesTransferred', 29594 'mediaAppends' 29595 ]; 29596 class Uc extends E.EventTarget { 29597 constructor(e) { 29598 super(); 29599 let { 29600 src: t, 29601 withCredentials: i, 29602 tech: r, 29603 bandwidth: s, 29604 externVhs: n, 29605 useCueTags: a, 29606 playlistExclusionDuration: o, 29607 enableLowInitialPlaylist: l, 29608 sourceType: d, 29609 cacheEncryptionKeys: h, 29610 bufferBasedABR: u, 29611 leastPixelDiffSelector: c, 29612 captionServices: p, 29613 experimentalUseMMS: m 29614 } = e; 29615 if (!t) throw new Error('A non-empty playlist URL or JSON manifest string is required'); 29616 let g = e.maxPlaylistRetries; 29617 ((null !== g && 'undefined' != typeof g) || (g = 1 / 0), 29618 (Nc = n), 29619 (this.bufferBasedABR = Boolean(u)), 29620 (this.leastPixelDiffSelector = Boolean(c)), 29621 (this.withCredentials = i), 29622 (this.tech_ = r), 29623 (this.vhs_ = r.vhs), 29624 (this.player_ = e.player_), 29625 (this.sourceType_ = d), 29626 (this.useCueTags_ = a), 29627 (this.playlistExclusionDuration = o), 29628 (this.maxPlaylistRetries = g), 29629 (this.enableLowInitialPlaylist = l), 29630 this.useCueTags_ && 29631 ((this.cueTagsTrack_ = this.tech_.addTextTrack('metadata', 'ad-cues')), 29632 (this.cueTagsTrack_.inBandMetadataTrackDispatchType = '')), 29633 (this.requestOptions_ = { withCredentials: i, maxPlaylistRetries: g, timeout: null }), 29634 this.on('error', this.pauseLoading), 29635 (this.mediaTypes_ = (() => { 29636 let t = {}; 29637 return ( 29638 ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach((e) => { 29639 t[e] = { 29640 groups: {}, 29641 tracks: {}, 29642 activePlaylistLoader: null, 29643 activeGroup: ic, 29644 activeTrack: ic, 29645 getActiveGroup: ic, 29646 onGroupChanged: ic, 29647 onTrackChanged: ic, 29648 lastTrack_: null, 29649 logger_: Ud(`MediaGroups[${e}]`) 29650 }; 29651 }), 29652 t 29653 ); 29654 })()), 29655 m && window.ManagedMediaSource 29656 ? ((this.tech_.el_.disableRemotePlayback = !0), 29657 (this.mediaSource = new window.ManagedMediaSource()), 29658 E.log('Using ManagedMediaSource')) 29659 : window.MediaSource && (this.mediaSource = new window.MediaSource()), 29660 (this.handleDurationChange_ = this.handleDurationChange_.bind(this)), 29661 (this.handleSourceOpen_ = this.handleSourceOpen_.bind(this)), 29662 (this.handleSourceEnded_ = this.handleSourceEnded_.bind(this)), 29663 (this.load = this.load.bind(this)), 29664 (this.pause = this.pause.bind(this)), 29665 this.mediaSource.addEventListener('durationchange', this.handleDurationChange_), 29666 this.mediaSource.addEventListener('sourceopen', this.handleSourceOpen_), 29667 this.mediaSource.addEventListener('sourceended', this.handleSourceEnded_), 29668 this.mediaSource.addEventListener('startstreaming', this.load), 29669 this.mediaSource.addEventListener('endstreaming', this.pause), 29670 (this.seekable_ = O()), 29671 (this.hasPlayed_ = !1), 29672 (this.syncController_ = new Sc(e)), 29673 (this.segmentMetadataTrack_ = r.addRemoteTextTrack( 29674 { kind: 'metadata', label: 'segment-metadata' }, 29675 !1 29676 ).track), 29677 (this.decrypter_ = new Ec()), 29678 (this.sourceUpdater_ = new cc(this.mediaSource)), 29679 (this.inbandTextTracks_ = {}), 29680 (this.timelineChangeController_ = new wc()), 29681 (this.keyStatusMap_ = new Map())); 29682 var f = { 29683 vhs: this.vhs_, 29684 parse708captions: e.parse708captions, 29685 useDtsForTimestampOffset: e.useDtsForTimestampOffset, 29686 captionServices: p, 29687 mediaSource: this.mediaSource, 29688 currentTime: this.tech_.currentTime.bind(this.tech_), 29689 seekable: () => this.seekable(), 29690 seeking: () => this.tech_.seeking(), 29691 duration: () => this.duration(), 29692 hasPlayed: () => this.hasPlayed_, 29693 goalBufferLength: () => this.goalBufferLength(), 29694 bandwidth: s, 29695 syncController: this.syncController_, 29696 decrypter: this.decrypter_, 29697 sourceType: this.sourceType_, 29698 inbandTextTracks: this.inbandTextTracks_, 29699 cacheEncryptionKeys: h, 29700 sourceUpdater: this.sourceUpdater_, 29701 timelineChangeController: this.timelineChangeController_, 29702 exactManifestTimings: e.exactManifestTimings, 29703 addMetadataToTextTrack: this.addMetadataToTextTrack.bind(this) 29704 }, 29705 f = 29706 ((this.mainPlaylistLoader_ = 29707 'dash' === this.sourceType_ 29708 ? new Yh( 29709 t, 29710 this.vhs_, 29711 L(this.requestOptions_, { 29712 addMetadataToTextTrack: this.addMetadataToTextTrack.bind(this) 29713 }) 29714 ) 29715 : new xh( 29716 t, 29717 this.vhs_, 29718 L(this.requestOptions_, { 29719 addDateRangesToTextTrack: this.addDateRangesToTextTrack_.bind(this) 29720 }) 29721 )), 29722 this.setupMainPlaylistLoaderListeners_(), 29723 (this.mainSegmentLoader_ = new tc( 29724 L(f, { segmentMetadataTrack: this.segmentMetadataTrack_, loaderType: 'main' }), 29725 e 29726 )), 29727 (this.audioSegmentLoader_ = new tc(L(f, { loaderType: 'audio' }), e)), 29728 (this.subtitleSegmentLoader_ = new fc( 29729 L(f, { 29730 loaderType: 'vtt', 29731 featuresNativeTextTracks: this.tech_.featuresNativeTextTracks, 29732 loadVttJs: () => 29733 new Promise((e, t) => { 29734 function i() { 29735 (r.off('vttjserror', s), e()); 29736 } 29737 function s() { 29738 (r.off('vttjsloaded', i), t()); 29739 } 29740 (r.one('vttjsloaded', i), r.one('vttjserror', s), r.addWebVttScript_()); 29741 }) 29742 }), 29743 e 29744 )), 29745 (this.contentSteeringController_ = new Rc( 29746 this.vhs_.xhr, 29747 () => this.mainSegmentLoader_.bandwidth 29748 )), 29749 this.setupSegmentLoaderListeners_(), 29750 this.bufferBasedABR && 29751 (this.mainPlaylistLoader_.one('loadedplaylist', () => this.startABRTimer_()), 29752 this.tech_.on('pause', () => this.stopABRTimer_()), 29753 this.tech_.on('play', () => this.startABRTimer_())), 29754 Mc.forEach((e) => { 29755 this[e + '_'] = function (e) { 29756 return this.audioSegmentLoader_[e] + this.mainSegmentLoader_[e]; 29757 }.bind(this, e); 29758 }), 29759 (this.logger_ = Ud('pc')), 29760 (this.triggeredFmp4Usage = !1), 29761 'none' === this.tech_.preload() 29762 ? ((this.loadOnPlay_ = () => { 29763 ((this.loadOnPlay_ = null), this.mainPlaylistLoader_.load()); 29764 }), 29765 this.tech_.one('play', this.loadOnPlay_)) 29766 : this.mainPlaylistLoader_.load(), 29767 (this.timeToLoadedData__ = -1), 29768 (this.mainAppendsToLoadedData__ = -1), 29769 (this.audioAppendsToLoadedData__ = -1), 29770 'none' === this.tech_.preload() ? 'play' : 'loadstart'); 29771 this.tech_.one(f, () => { 29772 let e = Date.now(); 29773 this.tech_.one('loadeddata', () => { 29774 ((this.timeToLoadedData__ = Date.now() - e), 29775 (this.mainAppendsToLoadedData__ = this.mainSegmentLoader_.mediaAppends), 29776 (this.audioAppendsToLoadedData__ = this.audioSegmentLoader_.mediaAppends)); 29777 }); 29778 }); 29779 } 29780 mainAppendsToLoadedData_() { 29781 return this.mainAppendsToLoadedData__; 29782 } 29783 audioAppendsToLoadedData_() { 29784 return this.audioAppendsToLoadedData__; 29785 } 29786 appendsToLoadedData_() { 29787 var e = this.mainAppendsToLoadedData_(), 29788 t = this.audioAppendsToLoadedData_(); 29789 return -1 === e || -1 === t ? -1 : e + t; 29790 } 29791 timeToLoadedData_() { 29792 return this.timeToLoadedData__; 29793 } 29794 checkABR_(e = 'abr') { 29795 var t = this.selectPlaylist(); 29796 t && this.shouldSwitchToMedia_(t) && this.switchMedia_(t, e); 29797 } 29798 switchMedia_(e, t, i) { 29799 var s = this.media(), 29800 s = s && (s.id || s.uri), 29801 r = e && (e.id || e.uri); 29802 (s && 29803 s !== r && 29804 (this.logger_(`switch media ${s} -> ${r} from ` + t), 29805 (s = { 29806 renditionInfo: { 29807 id: r, 29808 bandwidth: e.attributes.BANDWIDTH, 29809 resolution: e.attributes.RESOLUTION, 29810 codecs: e.attributes.CODECS 29811 }, 29812 cause: t 29813 }), 29814 this.trigger({ type: 'renditionselected', metadata: s }), 29815 this.tech_.trigger({ type: 'usage', name: 'vhs-rendition-change-' + t })), 29816 this.mainPlaylistLoader_.media(e, i)); 29817 } 29818 switchMediaForDASHContentSteering_() { 29819 ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach((e) => { 29820 var t = this.mediaTypes_[e], 29821 t = t ? t.activeGroup() : null; 29822 let i = this.contentSteeringController_.getPathway(); 29823 t && 29824 i && 29825 (t = (t.length ? t[0] : t).playlists.filter((e) => e.attributes.serviceLocation === i)) 29826 .length && 29827 this.mediaTypes_[e].activePlaylistLoader.media(t[0]); 29828 }); 29829 } 29830 startABRTimer_() { 29831 (this.stopABRTimer_(), (this.abrTimer_ = window.setInterval(() => this.checkABR_(), 250))); 29832 } 29833 stopABRTimer_() { 29834 (this.tech_.scrubbing && this.tech_.scrubbing()) || 29835 (window.clearInterval(this.abrTimer_), (this.abrTimer_ = null)); 29836 } 29837 getAudioTrackPlaylists_() { 29838 var t = this.main(), 29839 e = (t && t.playlists) || []; 29840 if (!t || !t.mediaGroups || !t.mediaGroups.AUDIO) return e; 29841 var i = t.mediaGroups.AUDIO, 29842 s = Object.keys(i); 29843 let r; 29844 if (Object.keys(this.mediaTypes_.AUDIO.groups).length) 29845 r = this.mediaTypes_.AUDIO.activeTrack(); 29846 else { 29847 var n, 29848 a = i.main || (s.length && i[s[0]]); 29849 for (n in a) 29850 if (a[n].default) { 29851 r = { label: n }; 29852 break; 29853 } 29854 } 29855 if (!r) return e; 29856 var o, 29857 l = []; 29858 for (o in i) 29859 if (i[o][r.label]) { 29860 var d = i[o][r.label]; 29861 if (d.playlists && d.playlists.length) l.push.apply(l, d.playlists); 29862 else if (d.uri) l.push(d); 29863 else if (t.playlists.length) 29864 for (let e = 0; e < t.playlists.length; e++) { 29865 var h = t.playlists[e]; 29866 h.attributes && h.attributes.AUDIO && h.attributes.AUDIO === o && l.push(h); 29867 } 29868 } 29869 return l.length ? l : e; 29870 } 29871 setupMainPlaylistLoaderListeners_() { 29872 (this.mainPlaylistLoader_.on('loadedmetadata', () => { 29873 var e = this.mainPlaylistLoader_.media(), 29874 t = 1.5 * e.targetDuration * 1e3; 29875 (dh(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media()) 29876 ? (this.requestOptions_.timeout = 0) 29877 : (this.requestOptions_.timeout = t), 29878 e.endList && 29879 'none' !== this.tech_.preload() && 29880 (this.mainSegmentLoader_.playlist(e, this.requestOptions_), 29881 this.mainSegmentLoader_.load()), 29882 Lc({ 29883 sourceType: this.sourceType_, 29884 segmentLoaders: { 29885 AUDIO: this.audioSegmentLoader_, 29886 SUBTITLES: this.subtitleSegmentLoader_, 29887 main: this.mainSegmentLoader_ 29888 }, 29889 tech: this.tech_, 29890 requestOptions: this.requestOptions_, 29891 mainPlaylistLoader: this.mainPlaylistLoader_, 29892 vhs: this.vhs_, 29893 main: this.main(), 29894 mediaTypes: this.mediaTypes_, 29895 excludePlaylist: this.excludePlaylist.bind(this) 29896 }), 29897 this.triggerPresenceUsage_(this.main(), e), 29898 this.setupFirstPlay(), 29899 !this.mediaTypes_.AUDIO.activePlaylistLoader || 29900 this.mediaTypes_.AUDIO.activePlaylistLoader.media() 29901 ? this.trigger('selectedinitialmedia') 29902 : this.mediaTypes_.AUDIO.activePlaylistLoader.one('loadedmetadata', () => { 29903 this.trigger('selectedinitialmedia'); 29904 })); 29905 }), 29906 this.mainPlaylistLoader_.on('loadedplaylist', () => { 29907 this.loadOnPlay_ && this.tech_.off('play', this.loadOnPlay_); 29908 let t = this.mainPlaylistLoader_.media(); 29909 if (!t) { 29910 (this.attachContentSteeringListeners_(),
29911 this.initContentSteeringController_(), 29912 this.excludeUnsupportedVariants_()); 29913 let e; 29914 if ( 29915 !(e = 29916 (e = this.enableLowInitialPlaylist ? this.selectInitialPlaylist() : e) || 29917 this.selectPlaylist()) || 29918 !this.shouldSwitchToMedia_(e) 29919 ) 29920 return; 29921 if ( 29922 ((this.initialMedia_ = e), 29923 this.switchMedia_(this.initialMedia_, 'initial'), 29924 !('vhs-json' === this.sourceType_ && this.initialMedia_.segments)) 29925 ) 29926 return; 29927 t = this.initialMedia_; 29928 } 29929 this.handleUpdatedMediaPlaylist(t); 29930 }), 29931 this.mainPlaylistLoader_.on('error', () => { 29932 var e = this.mainPlaylistLoader_.error; 29933 this.excludePlaylist({ playlistToExclude: e.playlist, error: e }); 29934 }), 29935 this.mainPlaylistLoader_.on('mediachanging', () => { 29936 (this.mainSegmentLoader_.abort(), this.mainSegmentLoader_.pause()); 29937 }), 29938 this.mainPlaylistLoader_.on('mediachange', () => { 29939 var e = this.mainPlaylistLoader_.media(), 29940 t = 1.5 * e.targetDuration * 1e3; 29941 (dh(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media()) 29942 ? (this.requestOptions_.timeout = 0) 29943 : (this.requestOptions_.timeout = t), 29944 'dash' === this.sourceType_ && this.mainPlaylistLoader_.load(), 29945 this.mainSegmentLoader_.pause(), 29946 this.mainSegmentLoader_.playlist(e, this.requestOptions_), 29947 this.waitingForFastQualityPlaylistReceived_ 29948 ? this.runFastQualitySwitch_() 29949 : this.mainSegmentLoader_.load(), 29950 this.tech_.trigger({ type: 'mediachange', bubbles: !0 })); 29951 }), 29952 this.mainPlaylistLoader_.on('playlistunchanged', () => { 29953 var e = this.mainPlaylistLoader_.media(); 29954 'playlist-unchanged' !== e.lastExcludeReason_ && 29955 this.stuckAtPlaylistEnd_(e) && 29956 (this.excludePlaylist({ 29957 error: { message: 'Playlist no longer updating.', reason: 'playlist-unchanged' } 29958 }), 29959 this.tech_.trigger('playliststuck')); 29960 }), 29961 this.mainPlaylistLoader_.on('renditiondisabled', () => { 29962 this.tech_.trigger({ type: 'usage', name: 'vhs-rendition-disabled' }); 29963 }), 29964 this.mainPlaylistLoader_.on('renditionenabled', () => { 29965 this.tech_.trigger({ type: 'usage', name: 'vhs-rendition-enabled' }); 29966 })); 29967 [ 29968 'manifestrequeststart', 29969 'manifestrequestcomplete', 29970 'manifestparsestart', 29971 'manifestparsecomplete', 29972 'playlistrequeststart', 29973 'playlistrequestcomplete', 29974 'playlistparsestart', 29975 'playlistparsecomplete', 29976 'renditiondisabled', 29977 'renditionenabled' 29978 ].forEach((e) => { 29979 this.mainPlaylistLoader_.on(e, (e) => { 29980 this.player_.trigger(f({}, e)); 29981 }); 29982 }); 29983 } 29984 handleUpdatedMediaPlaylist(e) { 29985 (this.useCueTags_ && this.updateAdCues_(e), 29986 this.mainSegmentLoader_.pause(), 29987 this.mainSegmentLoader_.playlist(e, this.requestOptions_), 29988 this.waitingForFastQualityPlaylistReceived_ && this.runFastQualitySwitch_(), 29989 this.updateDuration(!e.endList), 29990 this.tech_.paused() || 29991 (this.mainSegmentLoader_.load(), 29992 this.audioSegmentLoader_ && this.audioSegmentLoader_.load())); 29993 } 29994 triggerPresenceUsage_(e, t) { 29995 var i = e.mediaGroups || {}; 29996 let s = !0; 29997 var r, 29998 e = Object.keys(i.AUDIO); 29999 for (r in i.AUDIO) for (var n in i.AUDIO[r]) i.AUDIO[r][n].uri || (s = !1); 30000 (s && this.tech_.trigger({ type: 'usage', name: 'vhs-demuxed' }), 30001 Object.keys(i.SUBTITLES).length && 30002 this.tech_.trigger({ type: 'usage', name: 'vhs-webvtt' }), 30003 Nc.Playlist.isAes(t) && this.tech_.trigger({ type: 'usage', name: 'vhs-aes' }), 30004 e.length && 30005 1 < Object.keys(i.AUDIO[e[0]]).length && 30006 this.tech_.trigger({ type: 'usage', name: 'vhs-alternate-audio' }), 30007 this.useCueTags_ && this.tech_.trigger({ type: 'usage', name: 'vhs-playlist-cue-tags' })); 30008 } 30009 shouldSwitchToMedia_(e) { 30010 var t = this.mainPlaylistLoader_.media() || this.mainPlaylistLoader_.pen
30010dingMedia_, 30011 i = this.tech_.currentTime(), 30012 s = this.bufferLowWaterLine(), 30013 r = this.bufferHighWaterLine(); 30014 return (function ({ 30015 currentPlaylist: e, 30016 buffered: t, 30017 currentTime: i, 30018 nextPlaylist: s, 30019 bufferLowWaterLine: r, 30020 bufferHighWaterLine: n, 30021 duration: a, 30022 bufferBasedABR: o, 30023 log: l 30024 }) { 30025 if (s) { 30026 var d = `allowing switch ${(e && e.id) || 'null'} -> ` + s.id; 30027 if (!e) return (l(d + ' as current playlist is not set'), !0); 30028 if (s.id !== e.id) { 30029 var h = Boolean(Bd(t, i).length); 30030 if (!e.endList) 30031 return h || 'number' != typeof e.partTargetDuration 30032 ? (l(d + ' as current playlist is live'), !0) 30033 : (l( 30034 `not ${d} as current playlist is live llhls, but currentTime isn't in buffered.` 30035 ), 30036 !1); 30037 ((h = jd(t, i)), 30038 (t = o ? R.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : R.MAX_BUFFER_LOW_WATER_LINE)); 30039 if (a < t) return (l(d + ` as duration < max low water line (${a} < ${t})`), !0); 30040 ((i = s.attributes.BANDWIDTH), (a = e.attributes.BANDWIDTH)); 30041 if (i < a && (!o || h < n)) { 30042 let e = d + ` as next bandwidth < current bandwidth (${i} < ${a})`; 30043 return ( 30044 o && (e += ` and forwardBuffer < bufferHighWaterLine (${h} < ${n})`), 30045 l(e), 30046 !0 30047 ); 30048 } 30049 if ((!o || a < i) && r <= h) { 30050 let e = d + ` as forwardBuffer >= bufferLowWaterLine (${h} >= ${r})`; 30051 return ( 30052 o && (e += ` and next bandwidth > current bandwidth (${i} > ${a})`), 30053 l(e), 30054 !0 30055 ); 30056 } 30057 l(`not ${d} as no switching criteria met`); 30058 } 30059 } else E.log.warn('We received no playlist to switch to. Please check your stream.'); 30060 return !1; 30061 })({ 30062 buffered: this.tech_.buffered(), 30063 currentTime: i, 30064 currentPlaylist: t, 30065 nextPlaylist: e, 30066 bufferLowWaterLine: s, 30067 bufferHighWaterLine: r, 30068 duration: this.duration(), 30069 bufferBasedABR: this.bufferBasedABR, 30070 log: this.logger_ 30071 }); 30072 } 30073 setupSegmentLoaderListeners_() { 30074 (this.mainSegmentLoader_.on('bandwidthupdate', () => { 30075 (this.checkABR_('bandwidthupdate'), this.tech_.trigger('bandwidthupdate')); 30076 }), 30077 this.mainSegmentLoader_.on('timeout', () => { 30078 this.bufferBasedABR && this.mainSegmentLoader_.load(); 30079 }), 30080 this.bufferBasedABR || 30081 this.mainSegmentLoader_.on('progress', () => { 30082 this.trigger('progress'); 30083 }), 30084 this.mainSegmentLoader_.on('error', () => { 30085 var e = this.mainSegmentLoader_.error(); 30086 this.excludePlaylist({ playlistToExclude: e.playlist, error: e }); 30087 }), 30088 this.mainSegmentLoader_.on('appenderror', () => { 30089 ((this.error = this.mainSegmentLoader_.error_), this.trigger('error')); 30090 }), 30091 this.mainSegmentLoader_.on('syncinfoupdate', () => { 30092 this.onSyncInfoUpdate_(); 30093 }), 30094 this.mainSegmentLoader_.on('timestampoffset', () => { 30095 this.tech_.trigger({ type: 'usage', name: 'vhs-timestamp-offset' }); 30096 }), 30097 this.audioSegmentLoader_.on('syncinfoupdate', () => { 30098 this.onSyncInfoUpdate_(); 30099 }), 30100 this.audioSegmentLoader_.on('appenderror', () => { 30101 ((this.error = this.audioSegmentLoader_.error_), this.trigger('error')); 30102 }), 30103 this.mainSegmentLoader_.on('ended', () => { 30104 (this.logger_('main segment loader ended'), this.onEndOf
30104Stream()); 30105 }), 30106 this.timelineChangeController_.on('audioTimelineBehind', () => { 30107 var e = this.audioSegmentLoader_.pendingSegment_; 30108 e && 30109 e.segment && 30110 e.segment.syncInfo && 30111 ((e = e.segment.syncInfo.end + 0.01), this.tech_.setCurrentTime(e)); 30112 }), 30113 this.mainSegmentLoader_.on('earlyabort', (e) => { 30114 this.bufferBasedABR || 30115 (this.delegateLoaders_('all', ['abort']), 30116 this.excludePlaylist({ 30117 error: { 30118 message: 30119 "Aborted early because there isn't enough bandwidth to complete the request without rebuffering." 30120 }, 30121 playlistExclusionDuration: 10 30122 })); 30123 })); 30124 var e = () => { 30125 if (!this.sourceUpdater_.hasCreatedSourceBuffers()) return this.tryToCreateSourceBuffers_(); 30126 var e = this.getCodecsOrExclude_(); 30127 e && this.sourceUpdater_.addOrChangeSourceBuffers(e); 30128 }; 30129 (this.mainSegmentLoader_.on('trackinfo', e), 30130 this.audioSegmentLoader_.on('trackinfo', e), 30131 this.mainSegmentLoader_.on('fmp4', () => { 30132 this.triggeredFmp4Usage || 30133 (this.tech_.trigger({ type: 'usage', name: 'vhs-fmp4' }), 30134 (this.triggeredFmp4Usage = !0)); 30135 }), 30136 this.audioSegmentLoader_.on('fmp4', () => { 30137 this.triggeredFmp4Usage || 30138 (this.tech_.trigger({ type: 'usage', name: 'vhs-fmp4' }), 30139 (this.triggeredFmp4Usage = !0)); 30140 }), 30141 this.audioSegmentLoader_.on('ended', () => { 30142 (this.logger_('audioSegmentLoader ended'), this.onEndOf
30142Stream()); 30143 })); 30144 [ 30145 'segmentselected', 30146 'segmentloadstart', 30147 'segmentloaded', 30148 'segmentkeyloadstart', 30149 'segmentkeyloadcomplete', 30150 'segmentdecryptionstart', 30151 'segmentdecryptioncomplete', 30152 'segmenttransmuxingstart', 30153 'segmenttransmuxingcomplete', 30154 'segmenttransmuxingtrackinfoavailable', 30155 'segmenttransmuxingtiminginfoavailable', 30156 'segmentappendstart', 30157 'appendsdone', 30158 'bandwidthupdated', 30159 'timelinechange', 30160 'codecschange' 30161 ].forEach((e) => { 30162 (this.mainSegmentLoader_.on(e, (e) => { 30163 this.player_.trigger(f({}, e)); 30164 }), 30165 this.audioSegmentLoader_.on(e, (e) => { 30166 this.player_.trigger(f({}, e)); 30167 }), 30168 this.subtitleSegmentLoader_.on(e, (e) => { 30169 this.player_.trigger(f({}, e)); 30170 })); 30171 }); 30172 } 30173 mediaSecondsLoaded_() { 30174 return Math.max( 30175 this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded 30176 ); 30177 } 30178 load() { 30179 (this.mainSegmentLoader_.load(), 30180 this.mediaTypes_.AUDIO.activePlaylistLoader && this.audioSegmentLoader_.load(), 30181 this.mediaTypes_.SUBTITLES.activePlaylistLoader && this.subtitleSegmentLoader_.load()); 30182 } 30183 pause() { 30184 (this.mainSegmentLoader_.pause(), 30185 this.mediaTypes_.AUDIO.activePlaylistLoader && this.audioSegmentLoader_.pause(), 30186 this.mediaTypes_.SUBTITLES.activePlaylistLoader && this.subtitleSegmentLoader_.pause()); 30187 } 30188 fastQualityChange_(e = this.selectPlaylist()) { 30189 e && e === this.mainPlaylistLoader_.media() 30190 ? this.logger_('skipping fastQualityChange because new media is same as old') 30191 : (this.switchMedia_(e, 'fast-quality'), 30192 (this.waitingForFastQualityPlaylistReceived_ = !0)); 30193 } 30194 runFastQualitySwitch_() { 30195 ((this.waitingForFastQualityPlaylistReceived_ = !1), 30196 this.mainSegmentLoader_.pause(), 30197 this.mainSegmentLoader_.resetEverything(() => { 30198 this.mainSegmentLoader_.load(); 30199 })); 30200 } 30201 play() { 30202 var e; 30203 if (!this.setupFirstPlay()) 30204 return ( 30205 this.tech_.ended() && this.tech_.setCurrentTime(0), 30206 this.hasPlayed_ && this.load(), 30207 (e = this.tech_.seekable()), 30208 this.tech_.duration() === 1 / 0 && this.tech_.currentTime() < e.start(0) 30209 ? this.tech_.setCurrentTime(e.end(e.length - 1)) 30210 : void 0 30211 ); 30212 } 30213 setupFirstPlay() { 30214 var t = this.mainPlaylistLoader_.media(); 30215 if (!t || this.tech_.paused() || this.hasPlayed_) return !1; 30216 if (!t.endList || t.start) { 30217 var i = this.seekable(); 30218 if (!i.length) return !1; 30219 var s = i.end(0); 30220 let e = s; 30221 (t.start && 30222 ((t = t.start.timeOffset), (e = t < 0 ? Math.max(s + t, i.start(0)) : Math.min(s, t))), 30223 this.trigger('firstplay'), 30224 this.tech_.setCurrentTime(e)); 30225 } 30226 return ((this.hasPlayed_ = !0), this.load(), !0); 30227 } 30228 handleSourceOpen_() { 30229 var e; 30230 (this.tryToCreateSourceBuffers_(), 30231 this.tech_.autoplay() && 30232 'undefined' != typeof (e = this.tech_.play()) && 30233 'function' == typeof e.then && 30234 e.then(null, (e) => {}), 30235 this.trigger('sourceopen')); 30236 } 30237 handleSourceEnded_() { 30238 var e, t; 30239 this.inbandTextTracks_.metadataTrack_ && 30240 (e = this.inbandTextTracks_.metadataTrack_.cues) && 30241 e.length && 30242 ((t = this.duration()), 30243 (e[e.length - 1].endTime = isNaN(t) || Math.abs(t) === 1 / 0 ? Number.MAX_VALUE : t)); 30244 } 30245 handleDurationChange_() { 30246 this.tech_.trigger('durationchange'); 30247 } 30248 onEndOfStream() { 30249 let e = this.mainSegmentLoader_.ended_; 30250 var t; 30251 (this.mediaTypes_.AUDIO.activePlaylistLoader && 30252 ((t = this.mainSegmentLoader_.getCurrentMediaInfo_()), 30253 (e = ((t && !t.hasVideo) || e) && this.audioSegmentLoader_.ended_)), 30254 e && (this.stopABRTimer_(), this.sourceUpdater_.endOfStream())); 30255 } 30256 stuckAtPlaylistEnd_(e) { 30257 var t, i; 30258 return ( 30259 !!this.seekable().length && 30260 null !== (t = this.syncController_.getExpiredTime(e, this.duration())) && 30261 ((e = Nc.Playlist.playlistEnd(e, t)), 30262 (t = this.tech_.currentTime()), 30263 (i = this.tech_.buffered()).length 30264 ? (i = i.end(i.length - 1)) - t <= $d && e - i <= $d 30265 : e - t <= $d) 30266 ); 30267 } 30268 excludePlaylist({ 30269 playlistToExclude: s = this.mainPlaylistLoader_.media(), 30270 error: t = {}, 30271 playlistExclusionDuration: i 30272 }) { 30273 if ( 30274 ((s = s || this.mainPlaylistLoader_.media()), 30275 (i = i || t.playlistExclusionDuration || this.playlistExclusionDuration), 30276 s) 30277 ) { 30278 s.playlistErrors_++; 30279 var r = this.mainPlaylistLoader_.main.playlists, 30280 n = r.filter(ah), 30281 n = 1 === n.length && n[0] === s; 30282 if (1 === r.length && i !== 1 / 0) 30283 return ( 30284 E.log.warn( 30285 `Problem encountered with playlist ${s.id}. ` + 30286 'Trying again since it is the only playlist.' 30287 ), 30288 this.tech_.trigger('retryplaylist'), 30289 this.mainPlaylistLoader_.load(n) 30290 ); 30291 if (n) { 30292 if (this.main().contentSteering) { 30293 let e = this.pathwayAttribute_(s); 30294 var a = 1e3 * this.contentSteeringController_.steeringManifest.ttl; 30295 return ( 30296 this.contentSteeringController_.excludePathway(e), 30297 this.excludeThenChangePathway_(), 30298 void setTimeout(() => { 30299 this.contentSteeringController_.addAvailablePathway(e); 30300 }, a) 30301 ); 30302 } 30303 let i = !1; 30304 (r.forEach((e) => { 30305 var t; 30306 e !== s && 30307 'undefined' != typeof (t = e.excludeUntil) && 30308 t !== 1 / 0 && 30309 ((i = !0), delete e.excludeUntil); 30310 }), 30311 i && 30312 (E.log.warn( 30313 'Removing other playlists from the exclusion list because the last rendition is about to be excluded.' 30314 ), 30315 this.tech_.trigger('retryplaylist'))); 30316 } 30317 let e; 30318 ((e = s.playlistErrors_ > this.maxPlaylistRetries ? 1 / 0 : Date.now() + 1e3 * i), 30319 (s.excludeUntil = e), 30320 t.reason && (s.lastExcludeReason_ = t.reason), 30321 this.tech_.trigger('excludeplaylist'), 30322 this.tech_.trigger({ type: 'usage', name: 'vhs-rendition-excluded' })); 30323 a = this.selectPlaylist(); 30324 if (a) 30325 return ( 30326 (t.internal ? this.logger_ : E.log.warn)( 30327 `${t.internal ? 'Internal problem' : 'Problem'} encountered with playlist ${s.id}.` + 30328 (t.message ? ' ' + t.message : '') + 30329 ` Switching to playlist ${a.id}.` 30330 ), 30331 a.attributes.AUDIO !== s.attributes.AUDIO && 30332 this.delegateLoaders_('audio', ['abort', 'pause']), 30333 a.attributes.SUBTITLES !== s.attributes.SUBTITLES && 30334 this.delegateLoaders_('subtitle', ['abort', 'pause']), 30335 this.delegateLoaders_('main', ['abort', 'pause']), 30336 (r = (a.targetDuration / 2) * 1e3 || 5e3), 30337 (i = 'number' == typeof a.lastRequest && Date.now() - a.lastRequest <= r), 30338 this.switchMedia_(a, 'exclude', n || i) 30339 ); 30340 ((this.error = 'Playback cannot continue. No available working or supported playlists.'), 30341 this.trigger('error')); 30342 } else 30343 ((this.error = t), 30344 'open' !== this.mediaSource.readyState 30345 ? this.trigger('error') 30346 : this.sourceUpdater_.endOfStream('network')); 30347 } 30348 pauseLoading() { 30349 (this.delegateLoaders_('all', ['abort', 'pause']), this.stopABRTimer_()); 30350 } 30351 delegateLoaders_(i, e) { 30352 let s = []; 30353 var t = 'all' === i, 30354 r = ((!t && 'main' !== i) || s.push(this.mainPlaylistLoader_), []); 30355 ((!t && 'audio' !== i) || r.push('AUDIO'), 30356 (!t && 'subtitle' !== i) || (r.push('CLOSED-CAPTIONS'), r.push('SUBTITLES')), 30357 r.forEach((e) => { 30358 e = this.mediaTypes_[e] && this.mediaTypes_[e].activePlaylistLoader; 30359 e && s.push(e); 30360 }), 30361 ['main', 'audio', 'subtitle'].forEach((e) => { 30362 var t = this[e + 'SegmentLoader_']; 30363 !t || (i !== e && 'all' !== i) || s.push(t); 30364 }),
30365 s.forEach((t) => 30366 e.forEach((e) => { 30367 'function' == typeof t[e] && t[e](); 30368 }) 30369 )); 30370 } 30371 setCurrentTime(e) { 30372 var t = Bd(this.tech_.buffered(), e); 30373 return this.mainPlaylistLoader_ && 30374 this.mainPlaylistLoader_.media() && 30375 this.mainPlaylistLoader_.media().segments 30376 ? t && t.length 30377 ? e 30378 : (this.mainSegmentLoader_.pause(), 30379 this.mainSegmentLoader_.resetEverything(), 30380 this.mediaTypes_.AUDIO.activePlaylistLoader && 30381 (this.audioSegmentLoader_.pause(), this.audioSegmentLoader_.resetEverything()), 30382 this.mediaTypes_.SUBTITLES.activePlaylistLoader && 30383 (this.subtitleSegmentLoader_.pause(), this.subtitleSegmentLoader_.resetEverything()), 30384 void this.load()) 30385 : 0; 30386 } 30387 duration() { 30388 var e; 30389 return this.mainPlaylistLoader_ && (e = this.mainPlaylistLoader_.media()) 30390 ? e.endList 30391 ? this.mediaSource 30392 ? this.mediaSource.duration 30393 : Nc.Playlist.duration(e) 30394 : 1 / 0 30395 : 0; 30396 } 30397 seekable() { 30398 return this.seekable_; 30399 } 30400 getSeekableRange_(e, t) { 30401 var i, 30402 s, 30403 e = e.media(); 30404 return e 30405 ? (t = this.syncController_.getMediaSequenceSync(t)) && t.isReliable 30406 ? ((s = t.start), 30407 (t = t.end), 30408 !isFinite(s) || 30409 !isFinite(t) || 30410 ((i = Nc.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main, e)), 30411 (t = Math.max(0, t - i)) < s) 30412 ? null 30413 : O([[s, t]])) 30414 : null !== (i = this.syncController_.getExpiredTime(e, this.duration())) && 30415 (s = Nc.Playlist.seekable( 30416 e, 30417 i, 30418 Nc.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main, e) 30419 )).length 30420 ? s 30421 : null 30422 : null; 30423 } 30424 computeFinalSeekable_(e, t) { 30425 var i, s, r; 30426 return !t || 30427 ((i = e.start(0)), (s = e.end(0)), (r = t.start(0)), (t = t.end(0)), s < r) || 30428 t < i 30429 ? e 30430 : O([[Math.max(i, r), Math.min(s, t)]]); 30431 } 30432 onSyncInfoUpdate_() { 30433 if (this.mainPlaylistLoader_) { 30434 var t, 30435 i = this.getSeekableRange_(this.mainPlaylistLoader_, 'main'); 30436 if (i) { 30437 let e; 30438 (this.mediaTypes_.AUDIO.activePlaylistLoader && 30439 !(e = this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader, 'audio'))) || 30440 ((t = this.seekable_), 30441 (this.seekable_ = this.computeFinalSeekable_(i, e)), 30442 !this.seekable_) || 30443 (t && 30444 t.length && 30445 this.seekable_.length && 30446 t.start(0) === this.seekable_.start(0) && 30447 t.end(0) === this.seekable_.end(0)) || 30448 (this.logger_(`seekable updated [${Gd(this.seekable_)}]`), 30449 (i = { seekableRanges: this.seekable_ }), 30450 this.trigger({ type: 'seekablerangeschanged', metadata: i }), 30451 this.tech_.trigger('seekablechanged')); 30452 } 30453 } 30454 } 30455 updateDuration(t) { 30456 if ( 30457 (this.updateDuration_ && 30458 (this.mediaSource.removeEventListener('sourceopen', this.updateDuration_), 30459 (this.updateDuration_ = null)), 30460 'open' !== this.mediaSource.readyState) 30461 ) 30462 ((this.updateDuration_ = this.updateDuration.bind(this, t)), 30463 this.mediaSource.addEventListener('sourceopen', this.updateDuration_)); 30464 else { 30465 if (t) 30466 return (t = this.seekable()).length 30467 ? void ( 30468 (isNaN(this.mediaSource.duration) || 30469 this.mediaSource.duration < t.end(t.length - 1)) && 30470 this.sourceUpdater_.setDuration(t.end(t.length - 1)) 30471 ) 30472 : void 0; 30473 t = this.tech_.buffered(); 30474 let e = Nc.Playlist.duration(this.mainPlaylistLoader_.media()); 30475 (0 < t.length && (e = Math.max(e, t.end(t.length - 1))), 30476 this.mediaSource.duration !== e && this.sourceUpdater_.setDuration(e)); 30477 } 30478 } 30479 dispose() { 30480 (this.trigger('dispose'), 30481 this.decrypter_.terminate(), 30482 this.mainPlaylistLoader_.dispose(), 30483 this.mainSegmentLoader_.dispose(), 30484 this.contentSteeringController_.dispose(), 30485 this.keyStatusMap_.clear(), 30486 this.loadOnPlay_ && this.tech_.off('play', this.loadOnPlay_), 30487 ['AUDIO', 'SUBTITLES'].forEach((e) => { 30488 var t, 30489 i = this.mediaTypes_[e].groups; 30490 for (t in i) 30491 i[t].forEach((e) => { 30492 e.playlistLoader && e.playlistLoader.dispose(); 30493 }); 30494 }), 30495 this.audioSegmentLoader_.dispose(), 30496 this.subtitleSegmentLoader_.dispose(), 30497 this.sourceUpdater_.dispose(), 30498 this.timelineChangeController_.dispose(), 30499 this.stopABRTimer_(), 30500 this.updateDuration_ && 30501 this.mediaSource.removeEventListener('sourceopen', this.updateDuration_), 30502 this.mediaSource.removeEventListener('durationchange', this.handleDurationChange_), 30503 this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen_), 30504 this.mediaSource.removeEventListener('sourceended', this.handleSourceEnded_), 30505 this.off()); 30506 } 30507 main() { 30508 return this.mainPlaylistLoader_.main; 30509 } 30510 media() { 30511 return this.mainPlaylistLoader_.media() || this.initialMedia_; 30512 } 30513 areMediaTypesKnown_() { 30514 var e = !!this.mediaTypes_.AUDIO.activePlaylistLoader, 30515 t = !!this.mainSegmentLoader_.getCurrentMediaInfo_(), 30516 e = !e || !!this.audioSegmentLoader_.getCurrentMediaInfo_(); 30517 return t && e; 30518 } 30519 getCodecsOrExclude_() { 30520 let n = { 30521 main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {}, 30522 audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {} 30523 }, 30524 i = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media(); 30525 n.video = n.main; 30526 var e = mu(this.main(), i); 30527 let a = {}; 30528 var t = !!this.mediaTypes_.AUDIO.activePlaylistLoader; 30529 if ( 30530 (n.main.hasVideo && (a.video = e.video || n.main.videoCodec || 'avc1.4d400d'), 30531 n.main.isMuxed && (a.video += ',' + (e.audio || n.main.audioCodec || oa)), 30532 ((n.main.hasAudio && !n.main.isMuxed) || n.audio.hasAudio || t) && 30533 ((a.audio = e.audio || n.main.audioCodec || n.audio.audioCodec || oa), 30534 (n.audio.isFmp4 = (n.main.hasAudio && !n.main.isMuxed ? n.main : n.audio).isFmp4)), 30535 a.audio || a.video) 30536 ) { 30537 let s = {}, 30538 r; 30539 if ( 30540 (['video', 'audio'].forEach(function (e) { 30541 var t, i; 30542 a.hasOwnProperty(e) && 30543 ((t = n[e].isFmp4), (i = a[e]), !(t ? Qn : Jn)(i)) && 30544 ((t = n[e].isFmp4 ? 'browser' : 'muxer'), 30545 (s[t] = s[t] || []), 30546 s[t].push(a[e]), 30547 'audio' === e && (r = t)); 30548 }), 30549 t && r && i.attributes.AUDIO) 30550 ) { 30551 let t = i.attributes.AUDIO;
30552 (this.main().playlists.forEach((e) => { 30553 (e.attributes && e.attributes.AUDIO) === t && e !== i && (e.excludeUntil = 1 / 0); 30554 }), 30555 this.logger_( 30556 `excluding audio group ${t} as ${r} does not support codec(s): "${a.audio}"` 30557 )); 30558 } 30559 if (!Object.keys(s).length) { 30560 if ( 30561 this.sourceUpdater_.hasCreatedSourceBuffers() && 30562 !this.sourceUpdater_.canChangeType() 30563 ) { 30564 let s = []; 30565 if ( 30566 (['video', 'audio'].forEach((e) => { 30567 var t = (na(this.sourceUpdater_.codecs[e] || '')[0] || {}).type, 30568 i = (na(a[e] || '')[0] || {}).type; 30569 t && 30570 i && 30571 t.toLowerCase() !== i.toLowerCase() && 30572 s.push(`"${this.sourceUpdater_.codecs[e]}" -> "${a[e]}"`); 30573 }), 30574 s.length) 30575 ) 30576 return void this.excludePlaylist({ 30577 playlistToExclude: i, 30578 error: { message: `Codec switching not supported: ${s.join(', ')}.`, internal: !0 }, 30579 playlistExclusionDuration: 1 / 0 30580 }); 30581 } 30582 return a; 30583 } 30584 ((e = 30585 Object.keys(s).reduce( 30586 (e, t) => ( 30587 e && (e += ', '), 30588 (e += `${t} does not support codec(s): "${s[t].join(',')}"`) 30589 ), 30590 '' 30591 ) + '.'), 30592 this.excludePlaylist({ 30593 playlistToExclude: i, 30594 error: { internal: !0, message: e }, 30595 playlistExclusionDuration: 1 / 0 30596 })); 30597 } else 30598 this.excludePlaylist({ 30599 playlistToExclude: i, 30600 error: { message: 'Could not determine codecs for playlist.' }, 30601 playlistExclusionDuration: 1 / 0 30602 }); 30603 } 30604 tryToCreateSourceBuffers_() { 30605 var e; 30606 'open' !== this.mediaSource.readyState || 30607 this.sourceUpdater_.hasCreatedSourceBuffers() || 30608 (this.areMediaTypesKnown_() && 30609 (e = this.getCodecsOrExclude_()) && 30610 (this.sourceUpdater_.createSourceBuffers(e), 30611 (e = [e.video, e.audio].filter(Boolean).join(',')), 30612 this.excludeIncompatibleVariants_(e))); 30613 } 30614 excludeUnsupportedVariants_() { 30615 let s = this.main().playlists, 30616 r = []; 30617 Object.keys(s).forEach((e) => { 30618 var t, 30619 i, 30620 e = s[e]; 30621 -1 === r.indexOf(e.id) && 30622 (r.push(e.id), 30623 (i = []), 30624 !(t = mu(this.main, e)).audio || 30625 Jn(t.audio) || 30626 Qn(t.audio) || 30627 i.push('audio codec ' + t.audio), 30628 !t.video || Jn(t.video) || Qn(t.video) || i.push('video codec ' + t.video), 30629 t.text && 'stpp.ttml.im1t' === t.text && i.push('text codec ' + t.text), 30630 i.length) && 30631 ((e.excludeUntil = 1 / 0), 30632 this.logger_(`excluding ${e.id} for unsupported: ` + i.join(', '))); 30633 }); 30634 } 30635 excludeIncompatibleVariants_(e) { 30636 let r = [], 30637 n = this.main().playlists; 30638 e = Nu(na(e)); 30639 let a = pu(e), 30640 o = (e.video && na(e.video)[0]) || null, 30641 l = (e.audio && na(e.audio)[0]) || null; 30642 Object.keys(n).forEach((e) => { 30643 var t, 30644 i, 30645 s, 30646 e = n[e]; 30647 -1 === r.indexOf(e.id) && 30648 e.excludeUntil !== 1 / 0 && 30649 (r.push(e.id), 30650 (t = []), 30651 (s = mu(this.mainPlaylistLoader_.main, e)), 30652 (i = pu(s)), 30653 s.audio || s.video) && 30654 (i !== a && t.push(`codec count "${i}" !== "${a}"`), 30655 this.sourceUpdater_.canChangeType() || 30656 ((i = (s.video && na(s.video)[0]) || null), 30657 (s = (s.audio && na(s.audio)[0]) || null), 30658 i && 30659 o && 30660 i.type.toLowerCase() !== o.type.toLowerCase() && 30661 t.push(`video codec "${i.type}" !== "${o.type}"`), 30662 s && 30663 l && 30664 s.type.toLowerCase() !== l.type.toLowerCase() && 30665 t.push(`audio codec "${s.type}" !== "${l.type}"`)), 30666 t.length) && 30667 ((e.excludeUntil = 1 / 0), this.logger_(`excluding ${e.id}: ` + t.join(' && '))); 30668 }); 30669 } 30670 updateAdCues_(e) { 30671 let t = 0; 30672 var i = this.seekable(); 30673 (i.length && (t = i.start(0)), 30674 (function (s, r, e = 0) { 30675 if (s.segments) { 30676 let t = e, 30677 i; 30678 for (let e = 0; e < s.segments.length; e++) { 30679 var n, 30680 a, 30681 o = s.segments[e]; 30682 if ( 30683 (i = 30684 i || 30685 (function (e, t) { 30686 var i = e.cues; 30687 for (let e = 0; e < i.length; e++) { 30688 var s = i[e]; 30689 if (t >= s.adStartTime && t <= s.adEndTime) return s; 30690 } 30691 return null; 30692 })(r, t + o.duration / 2)) 30693 ) {
30694 if ('cueIn' in o) { 30695 ((i.endTime = t), (i.adEndTime = t), (t += o.duration), (i = null)); 30696 continue; 30697 } 30698 if (t < i.endTime) { 30699 t += o.duration; 30700 continue; 30701 } 30702 i.endTime += o.duration; 30703 } else 30704 ('cueOut' in o && 30705 (((i = new window.VTTCue(t, t + o.duration, o.cueOut)).adStartTime = t), 30706 (i.adEndTime = t + parseFloat(o.cueOut)), 30707 r.addCue(i)), 30708 'cueOutCont' in o && 30709 (([n, a] = o.cueOutCont.split('/').map(parseFloat)), 30710 ((i = new window.VTTCue(t, t + o.duration, '')).adStartTime = t - n), 30711 (i.adEndTime = i.adStartTime + a), 30712 r.addCue(i))); 30713 t += o.duration; 30714 } 30715 } 30716 })(e, this.cueTagsTrack_, t)); 30717 } 30718 goalBufferLength() { 30719 var e = this.tech_.currentTime(), 30720 t = R.GOAL_BUFFER_LENGTH, 30721 i = R.GOAL_BUFFER_LENGTH_RATE, 30722 s = Math.max(t, R.MAX_GOAL_BUFFER_LENGTH); 30723 return Math.min(t + e * i, s); 30724 } 30725 bufferLowWaterLine() { 30726 var e = this.tech_.currentTime(), 30727 t = R.BUFFER_LOW_WATER_LINE, 30728 i = R.BUFFER_LOW_WATER_LINE_RATE, 30729 s = Math.max(t, R.MAX_BUFFER_LOW_WATER_LINE), 30730 r = Math.max(t, R.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE); 30731 return Math.min(t + e * i, this.bufferBasedABR ? r : s); 30732 } 30733 bufferHighWaterLine() { 30734 return R.BUFFER_HIGH_WATER_LINE; 30735 } 30736 addDateRangesToTextTrack_(e) { 30737 (Wu(this.inbandTextTracks_, 'com.apple.streaming', this.tech_), 30738 (({ inbandTextTracks: e, dateRanges: t }) => { 30739 let r = e.metadataTrack_; 30740 if (r) { 30741 let s = window.WebKitDataCue || window.VTTCue; 30742 t.forEach((e) => { 30743 for (var t of Object.keys(e)) { 30744 var i; 30745 $u.has(t) || 30746 (((i = new s(e.startTime, e.endTime, '')).id = e.id), 30747 (i.type = 'com.apple.quicktime.HLS'), 30748 (i.value = { key: zu[t], data: e[t] }), 30749 ('scte35Out' !== t && 'scte35In' !== t) || 30750 (i.value.data = new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer), 30751 r.addCue(i)); 30752 } 30753 e.processDateRange(); 30754 }); 30755 } 30756 })({ inbandTextTracks: this.inbandTextTracks_, dateRanges: e })); 30757 } 30758 addMetadataToTextTrack(e, t, i) { 30759 var s = this.sourceUpdater_.videoBuffer 30760 ? this.sourceUpdater_.videoTimestampOffset() 30761 : this.sourceUpdater_.audioTimestampOffset(); 30762 (Wu(this.inbandTextTracks_, e, this.tech_), 30763 Hu({ 30764 inbandTextTracks: this.inbandTextTracks_, 30765 metadataArray: t, 30766 timestampOffset: s, 30767 videoDuration: i 30768 })); 30769 } 30770 pathwayAttribute_(e) { 30771 return e.attributes['PATHWAY-ID'] || e.attributes.serviceLocation; 30772 } 30773 initContentSteeringController_() { 30774 var e = this.main(); 30775 if (e.contentSteering) { 30776 for (var t of e.playlists) 30777 this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t)); 30778 (this.contentSteeringController_.assignTagProperties(e.uri, e.contentSteering), 30779 this.contentSteeringController_.queryBeforeStart 30780 ? this.contentSteeringController_.requestSteeringManifest(!0) 30781 : this.tech_.one('canplay', () => { 30782 this.contentSteeringController_.requestSteeringManifest(); 30783 })); 30784 } 30785 } 30786 resetContentSteeringController_() { 30787 (this.contentSteeringController_.clearAvailablePathways(), 30788 this.contentSteeringController_.dispose(), 30789 this.initContentSteeringController_()); 30790 } 30791 attachContentSteeringListeners_() { 30792 this.contentSteeringController_.on( 30793 'content-steering', 30794 this.excludeThenChangePathway_.bind(this) 30795 ); 30796 (['contentsteeringloadstart', 'contentsteeringloadcomplete', 'contentsteeringparsed'].forEach( 30797 (e) => { 30798 this.contentSteeringController_.on(e, (e) => { 30799 this.trigger(f({}, e)); 30800 }); 30801 } 30802 ), 30803 'dash' === this.sourceType_ && 30804 this.mainPlaylistLoader_.on('loadedplaylist', () => { 30805 let r = this.main(); 30806 (this.contentSteeringController_.didDASHTagChange(r.uri, r.contentSteering) || 30807 (() => { 30808 var e, 30809 t = this.contentSteeringController_.getAvailablePathways(), 30810 i = []; 30811 for (e of r.playlists) { 30812 var s = e.attributes.serviceLocation; 30813 if (s && (i.push(s), !t.has(s))) return !0; 30814 } 30815 return !(i.length || !t.size); 30816 })()) &&
30817 this.resetContentSteeringController_(); 30818 })); 30819 } 30820 excludeThenChangePathway_() { 30821 let a = this.contentSteeringController_.getPathway(); 30822 if (a) { 30823 this.handlePathwayClones_(); 30824 let s = this.main().playlists, 30825 r = new Set(), 30826 n = !1; 30827 (Object.keys(s).forEach((e) => { 30828 var e = s[e], 30829 t = this.pathwayAttribute_(e), 30830 t = t && a !== t, 30831 i = 30832 (e.excludeUntil === 1 / 0 && 30833 'content-steering' === e.lastExcludeReason_ && 30834 !t && 30835 (delete e.excludeUntil, delete e.lastExcludeReason_, (n = !0)), 30836 !e.excludeUntil && e.excludeUntil !== 1 / 0); 30837 !r.has(e.id) && 30838 t && 30839 i && 30840 (r.add(e.id), 30841 (e.excludeUntil = 1 / 0), 30842 (e.lastExcludeReason_ = 'content-steering'), 30843 this.logger_(`excluding ${e.id} for ` + e.lastExcludeReason_)); 30844 }), 30845 'DASH' === this.contentSteeringController_.manifestType_ && 30846 Object.keys(this.mediaTypes_).forEach((e) => { 30847 var e = this.mediaTypes_[e]; 30848 e.activePlaylistLoader && 30849 (e = e.activePlaylistLoader.media_) && 30850 e.attributes.serviceLocation !== a && 30851 (n = !0); 30852 }), 30853 n && this.changeSegmentPathway_()); 30854 } 30855 } 30856 handlePathwayClones_() { 30857 var i = this.main().playlists, 30858 s = this.contentSteeringController_.currentPathwayClones, 30859 r = this.contentSteeringController_.nextPathwayClones; 30860 if ((s && s.size) || (r && r.size)) { 30861 for (var [e, t] of s.entries()) 30862 r.get(e) || 30863 (this.mainPlaylistLoader_.updateOrDeleteClone(t), 30864 this.contentSteeringController_.excludePathway(e)); 30865 for (let [e, t] of r.entries()) { 30866 var n = s.get(e); 30867 n 30868 ? this.equalPathwayClones_(n, t) || 30869 (this.mainPlaylistLoader_.updateOrDeleteClone(t, !0), 30870 this.contentSteeringController_.addAvailablePathway(e)) 30871 : (i 30872 .filter((e) => e.attributes['PATHWAY-ID'] === t['BASE-ID']) 30873 .forEach((e) => { 30874 this.mainPlaylistLoader_.addClonePathway(t, e); 30875 }), 30876 this.contentSteeringController_.addAvailablePathway(e)); 30877 } 30878 this.contentSteeringController_.currentPathwayClones = new Map( 30879 JSON.parse(JSON.stringify([...r])) 30880 ); 30881 } 30882 } 30883 equalPathwayClones_(e, t) { 30884 if ( 30885 e['BASE-ID'] !== t['BASE-ID'] || 30886 e.ID !== t.ID || 30887 e['URI-REPLACEMENT'].HOST !== t['URI-REPLACEMENT'].HOST 30888 ) 30889 return !1; 30890 var i, 30891 s, 30892 r = e['URI-REPLACEMENT'].PARAMS, 30893 n = t['URI-REPLACEMENT'].PARAMS; 30894 for (i in r) if (r[i] !== n[i]) return !1; 30895 for (s in n) if (r[s] !== n[s]) return !1; 30896 return !0; 30897 } 30898 changeSegmentPathway_() { 30899 var e = this.selectPlaylist(); 30900 (this.pauseLoading(), 30901 'DASH' === this.contentSteeringController_.manifestType_ && 30902 this.switchMediaForDASHContentSteering_(), 30903 this.switchMedia_(e, 'content-steering')); 30904 } 30905 excludeNonUsablePlaylistsByKeyId_() { 30906 if (this.mainPlaylistLoader_ && this.mainPlaylistLoader_.main) { 30907 let r = 0, 30908 n = 'non-usable';
30909 (this.mainPlaylistLoader_.main.playlists.forEach((s) => { 30910 var e = this.mainPlaylistLoader_.getKeyIdSet(s); 30911 e && 30912 e.size && 30913 e.forEach((e) => { 30914 var t = 'usable', 30915 t = this.keyStatusMap_.has(e) && this.keyStatusMap_.get(e) === t, 30916 i = s.lastExcludeReason_ === n && s.excludeUntil === 1 / 0; 30917 t 30918 ? i && 30919 (delete s.excludeUntil, 30920 delete s.lastExcludeReason_, 30921 this.logger_(`enabling playlist ${s.id} because key ID ${e} is usable`)) 30922 : (s.excludeUntil !== 1 / 0 && 30923 s.lastExcludeReason_ !== n && 30924 ((s.excludeUntil = 1 / 0), 30925 (s.lastExcludeReason_ = n), 30926 this.logger_( 30927 `excluding playlist ${s.id} because the key ID ${e} doesn't exist in the keyStatusMap or is not usable` 30928 )), 30929 r++); 30930 }); 30931 }), 30932 r >= this.mainPlaylistLoader_.main.playlists.length &&
30933 this.mainPlaylistLoader_.main.playlists.forEach((e) => { 30934 var t = 30935 e && 30936 e.attributes && 30937 e.attributes.RESOLUTION && 30938 e.attributes.RESOLUTION.height < 720, 30939 i = e.excludeUntil === 1 / 0 && e.lastExcludeReason_ === n; 30940 t && 30941 i && 30942 (delete e.excludeUntil, 30943 E.log.warn( 30944 `enabling non-HD playlist ${e.id} because all playlists were excluded due to ${n} key IDs` 30945 )); 30946 })); 30947 } 30948 } 30949 addKeyStatus_(e, t) { 30950 e = ( 30951 'string' == typeof e 30952 ? e 30953 : ((e) => { 30954 e = new Uint8Array(e); 30955 return Array.from(e) 30956 .map((e) => e.toString(16).padStart(2, '0')) 30957 .join(''); 30958 })(e) 30959 ) 30960 .slice(0, 32) 30961 .toLowerCase(); 30962 (this.logger_(`KeyStatus '${t}' with key ID ${e} added to the keyStatusMap`), 30963 this.keyStatusMap_.set(e, t)); 30964 } 30965 updatePlaylistByKeyStatus(e, t) { 30966 (this.addKeyStatus_(e, t), 30967 this.waitingForFastQualityPlaylistReceived_ || this.excludeNonUsableThenChangePlaylist_(), 30968 this.mainPlaylistLoader_.off( 30969 'loadedplaylist', 30970 this.excludeNonUsableThenChangePlaylist_.bind(this) 30971 ), 30972 this.mainPlaylistLoader_.on( 30973 'loadedplaylist', 30974 this.excludeNonUsableThenChangePlaylist_.bind(this) 30975 )); 30976 } 30977 excludeNonUsableThenChangePlaylist_() { 30978 (this.excludeNonUsablePlaylistsByKeyId_(), this.fastQualityChange_()); 30979 } 30980 } 30981 class Bc { 30982 constructor(e, t, i) { 30983 var s, 30984 n, 30985 a, 30986 o, 30987 r = e.playlistController_, 30988 l = r.fastQualityChange_.bind(r); 30989 (t.attributes && 30990 ((s = t.attributes.RESOLUTION), 30991 (this.width = s && s.width), 30992 (this.height = s && s.height), 30993 (this.bandwidth = t.attributes.BANDWIDTH), 30994 (this.frameRate = t.attributes['FRAME-RATE'])), 30995 (this.codecs = mu(r.main(), t)), 30996 (this.playlist = t), 30997 (this.id = i), 30998 (this.enabled = 30999 ((n = e.playlists), 31000 (a = t.id), 31001 (o = l), 31002 (e) => { 31003 var t = n.main.playlists[a], 31004 i = nh(t), 31005 s = ah(t); 31006 if ('undefined' == typeof e) return s; 31007 e ? delete t.disabled : (t.disabled = !0); 31008 var r = { 31009 renditionInfo: { 31010 id: a, 31011 bandwidth: t.attributes.BANDWIDTH, 31012 resolution: t.attributes.RESOLUTION, 31013 codecs: t.attributes.CODECS 31014 }, 31015 cause: 'fast-quality' 31016 }; 31017 return ( 31018 e === s || 31019 i || 31020 (o(t), 31021 e 31022 ? n.trigger({ type: 'renditionenabled', metadata: r }) 31023 : n.trigger({ type: 'renditiondisabled', metadata: r })), 31024 e 31025 ); 31026 }))); 31027 } 31028 } 31029 let Fc = ['seeking', 'seeked', 'pause', 'playing', 'error']; 31030 class qc extends E.EventTarget { 31031 constructor(e) { 31032 (super(), 31033 (this.playlistController_ = e.playlistController), 31034 (this.tech_ = e.tech), 31035 (this.seekable = e.seekable), 31036 (this.allowSeeksWithinUnsafeLiveWindow = e.allowSeeksWithinUnsafeLiveWindow), 31037 (this.liveRangeSafeTimeDelta = e.liveRangeSafeTimeDelta), 31038 (this.media = e.media), 31039 (this.playedRanges_ = []), 31040 (this.consecutiveUpdates = 0), 31041 (this.lastRecordedTime = null), 31042 (this.checkCurrentTimeTimeout_ = null), 31043 (this.logger_ = Ud('PlaybackWatcher')), 31044 this.logger_('initialize')); 31045 let t = () => this.monitorCurrentTime_(), 31046 i = () => this.monitorCurrentTime_(), 31047 s = () => this.techWaiting_(), 31048 r = () => this.resetTimeUpdate_(), 31049 n = this.playlistController_, 31050 a = ['main', 'subtitle', 'audio'], 31051 o = {}, 31052 l = 31053 (a.forEach((e) => { 31054 ((o[e] = { 31055 reset: () => this.resetSegmentDownloads_(e), 31056 updateend: () => this.checkSegmentDownloads_(e) 31057 }), 31058 n[e + 'SegmentLoader_'].on('appendsdone', o[e].updateend), 31059 n[e + 'SegmentLoader_'].on('playlistupdate', o[e].reset), 31060 this.tech_.on(['seeked', 'seeking'], o[e].reset)); 31061 }), 31062 (t) => { 31063 ['main', 'audio'].forEach((e) => { 31064 n[e + 'SegmentLoader_'][t]('appended', this.seekingAppendCheck_); 31065 }); 31066 }); 31067 ((this.seekingAppendCheck_ = () => { 31068 this.fixesBadSeeks_() && 31069 ((this.consecutiveUpdates = 0), 31070 (this.lastRecordedTime = this.tech_.currentTime()), 31071 l('off')); 31072 }), 31073 (this.clearSeekingAppendCheck_ = () => l('off')), 31074 (this.watchForBadSeeking_ = () => { 31075 (this.clearSeekingAppendCheck_(), l('on')); 31076 }), 31077 this.tech_.on('seeked', this.clearSeekingAppendCheck_), 31078 this.tech_.on('seeking', this.watchForBadSeeking_), 31079 this.tech_.on('waiting', s), 31080 this.tech_.on(Fc, r), 31081 this.tech_.on('canplay', i), 31082 this.tech_.one('play', t), 31083 (this.dispose = () => { 31084 (this.clearSeekingAppendCheck_(), 31085 this.logger_('dispose'), 31086 this.tech_.off('waiting', s), 31087 this.tech_.off(Fc, r), 31088 this.tech_.off('canplay', i), 31089 this.tech_.off('play', t), 31090 this.tech_.off('seeking', this.watchForBadSeeking_), 31091 this.tech_.off('seeked', this.clearSeekingAppendCheck_), 31092 a.forEach((e) => { 31093 (n[e + 'SegmentLoader_'].off('appendsdone', o[e].updateend), 31094 n[e + 'SegmentLoader_'].off('playlistupdate', o[e].reset), 31095 this.tech_.off(['seeked', 'seeking'], o[e].reset)); 31096 }), 31097 this.checkCurrentTimeTimeout_ && window.clearTimeout(this.checkCurrentTimeTimeout_), 31098 this.resetTimeUpdate_()); 31099 })); 31100 } 31101 monitorCurrentTime_() { 31102 (this.checkCurrentTime_(), 31103 this.checkCurrentTimeTimeout_ && window.clearTimeout(this.checkCurrentTimeTimeout_), 31104 (this.checkCurrentTimeTimeout_ = window.setTimeout( 31105 this.monitorCurrentTime_.bind(this), 31106 250 31107 ))); 31108 } 31109 resetSegmentDownloads_(e) { 31110 var t = this.playlistController_[e + 'SegmentLoader_']; 31111 (0 < this[e + 'StalledDownloads_'] && 31112 this.logger_(`resetting possible stalled download count for ${e} loader`), 31113 (this[e + 'StalledDownloads_'] = 0), 31114 (this[e + 'Buffered_'] = t.buffered_())); 31115 } 31116 checkSegmentDownloads_(e) { 31117 var t = this.playlistController_, 31118 i = t[e + 'SegmentLoader_'], 31119 s = i.buffered_(), 31120 r = (function (t, i) { 31121 if (t !== i) { 31122 if ((!t && i) || (!i && t)) return !0; 31123 if (t.length !== i.length) return !0; 31124 for (let e = 0; e < t.length; e++) 31125 if (t.start(e) !== i.start(e) || t.end(e) !== i.end(e)) return !0; 31126 } 31127 return !1; 31128 })(this[e + 'Buffered_'], s); 31129 ((this[e + 'Buffered_'] = s), 31130 r 31131 ? (t.trigger({ type: 'bufferedrangeschanged', metadata: { bufferedRanges: s } }), 31132 this.resetSegmentDownloads_(e)) 31133 : (this[e + 'StalledDownloads_']++, 31134 this.logger_( 31135 `found #${this[e + 'StalledDownloads_']} ${e} appends that did not increase buffer (possible stalled download)`, 31136 { playlistId: i.playlist_ && i.playlist_.id, buffered: Xd(s) } 31137 ), 31138 this[e + 'StalledDownloads_'] < 10 || 31139 (this.logger_(e + ' loader stalled download exclusion'), 31140 this.resetSegmentDownloads_(e), 31141 this.tech_.trigger({ type: 'usage', name: `vhs-${e}-download-exclusion` }), 31142 'subtitle' !== e && 31143 t.excludePlaylist({ 31144 error: { message: `Excessive ${e} segment downloading detected.` }, 31145 playlistExclusionDuration: 1 / 0 31146 })))); 31147 } 31148 checkCurrentTime_() { 31149 var e, t; 31150 if (!this.tech_.paused() && !this.tech_.seeking()) 31151 return ( 31152 (e = this.tech_.currentTime()), 31153 (t = this.tech_.buffered()), 31154 this.lastRecordedTime === e && (!t.length || e + $d >= t.end(t.length - 1)) 31155 ? this.techWaiting_() 31156 : void (5 <= this.consecutiveUpdates && e === this.lastRecordedTime 31157 ? (this.consecutiveUpdates++, this.waiting_()) 31158 : e === this.lastRecordedTime 31159 ? this.consecutiveUpdates++ 31160 : (this.playedRanges_.push(O([this.lastRecordedTime, e])), 31161 (t = { playedRanges: this.playedRanges_ }), 31162 this.playlistController_.trigger({ type: 'playedrangeschanged', metadata: t }), 31163 (this.consecutiveUpdates = 0), 31164 (this.lastRecordedTime = e))) 31165 ); 31166 } 31167 resetTimeUpdate_() { 31168 this.consecutiveUpdates = 0; 31169 } 31170 fixesBadSeeks_() { 31171 if (!this.tech_.seeking()) return !1; 31172 var e = this.seekable(), 31173 t = this.tech_.currentTime(); 31174 let i; 31175 if ( 31176 (this.afterSeekableWindow_(e, t, this.media(), this.allowSeeksWithinUnsafeLiveWindow) && 31177 ((s = e.end(e.length - 1)), (i = s)), 31178 this.beforeSeekableWindow_(e, t) && ((s = e.start(0)), (i = s + (s === e.end(0) ? 0 : $d))), 31179 'undefined' != typeof i) 31180 ) 31181 this.logger_( 31182 `Trying to seek outside of seekable at time ${t} with ` + 31183 `seekable range ${Gd(e)}. Seeking to ` + 31184 i + 31185 '.' 31186 ); 31187 else { 31188 var s = this.playlistController_.sourceUpdater_, 31189 e = this.tech_.buffered(), 31190 r = s.audioBuffer ? s.audioBuffered() : null, 31191 s = s.videoBuffer ? s.videoBuffered() : null, 31192 n = this.media(), 31193 a = n.partTargetDuration || 2 * (n.targetDuration - zd), 31194 o = [r, s]; 31195 for (let e = 0; e < o.length; e++) if (o[e]) if (jd(o[e], t) < a) return !1; 31196 if (0 === (n = Fd(e, t)).length) return !1; 31197 ((i = n.start(0) + $d), 31198 this.logger_( 31199 `Buffered region starts (${n.start(0)}) ` + 31200 ` just beyond seek point (${t}). Seeking to ${i}.` 31201 )); 31202 } 31203 return (this.tech_.setCurrentTime(i), !0); 31204 } 31205 waiting_() { 31206 var e, t; 31207 this.techWaiting_() || 31208 ((e = this.tech_.currentTime()), 31209 (t = this.tech_.buffered()), 31210 (t = Bd(t, e)).length && 31211 e + 3 <= t.end(0) && 31212 (this.resetTimeUpdate_(), 31213 this.tech_.setCurrentTime(e), 31214 this.logger_( 31215 `Stopped at ${e} while inside a buffered region ` + 31216 `[${t.start(0)} -> ${t.end(0)}]. Attempting to resume ` + 31217 'playback by seeking to the current time.' 31218 ), 31219 this.tech_.trigger({ type: 'usage', name: 'vhs-unknown-waiting' }))); 31220 } 31221 techWaiting_() { 31222 var e, 31223 t = this.seekable(), 31224 i = this.tech_.currentTime(); 31225 return ( 31226 !!this.tech_.seeking() || 31227 (this.beforeSeekableWindow_(t, i) 31228 ? ((t = t.end(t.length - 1)), 31229 this.logger_( 31230 `Fell out of live window at time ${i}. Seeking to ` + 'live point (seekable end) ' + t 31231 ), 31232 this.resetTimeUpdate_(), 31233 this.tech_.setCurrentTime(t), 31234 this.tech_.trigger({ type: 'usage', name: 'vhs-live-resync' }), 31235 !0) 31236 : ((t = this.tech_.vhs.playlistController_.sourceUpdater_), 31237 (e = this.tech_.buffered()), 31238 this.videoUnderflow_({ 31239 audioBuffered: t.audioBuffered(), 31240 videoBuffered: t.videoBuffered(), 31241 currentTime: i 31242 }) 31243 ? (this.resetTimeUpdate_(), 31244 this.tech_.setCurrentTime(i), 31245 this.tech_.trigger({ type: 'usage', name: 'vhs-video-underflow' }), 31246 !0) 31247 : 0 < (t = Fd(e, i)).length && 31248 (this.logger_(`Stopped at ${i} and seeking to ` + t.start(0)), 31249 this.resetTimeUpdate_(), 31250 this.skipTheGap_(i), 31251 !0))) 31252 ); 31253 } 31254 afterSeekableWindow_(e, t, i, s = !1) { 31255 if (!e.length) return !1; 31256 let r = e.end(e.length - 1) + $d; 31257 var n = !i.endList; 31258 return ( 31259 t > 31260 (r = 31261 n && ('number' == typeof i.partTargetDuration || s) 31262 ? e.end(e.length - 1) + 3 * i.targetDuration 31263 : r) 31264 ); 31265 } 31266 beforeSeekableWindow_(e, t) { 31267 return !!(e.length && 0 < e.start(0) && t < e.start(0) - this.liveRangeSafeTimeDelta); 31268 } 31269 videoUnderflow_({ videoBuffered: t, audioBuffered: i, currentTime: s }) { 31270 if (t) { 31271 let e; 31272 var r, n; 31273 return ( 31274 t.length && i.length 31275 ? ((r = Bd(t, s - 3)), 31276 (n = Bd(t, s)), 31277 (i = Bd(i, s)).length && 31278 !n.length && 31279 r.length && 31280 (e = { start: r.end(0), end: i.end(0) })) 31281 : Fd(t, s).length || (e = this.gapFromVideoUnderflow_(t, s)), 31282 !!e && 31283 (this.logger_( 31284 `Encountered a gap in video from ${e.start} to ${e.end}. ` + 31285 'Seeking to current time ' + 31286 s 31287 ), 31288 !0) 31289 ); 31290 } 31291 } 31292 skipTheGap_(e) { 31293 var t = this.tech_.buffered(), 31294 i = this.tech_.currentTime(), 31295 t = Fd(t, i); 31296 (this.resetTimeUpdate_(), 31297 0 !== t.length && 31298 i === e && 31299 (this.logger_( 31300 'skipTheGap_:', 31301 'currentTime:', 31302 i, 31303 'scheduled currentTime:', 31304 e, 31305 'nextRange start:', 31306 t.start(0) 31307 ), 31308 this.tech_.setCurrentTime(t.start(0) + zd), 31309 (e = { gapInfo: { from: i, to: t.start(0) } }), 31310 this.playlistController_.trigger({ type: 'gapjumped', metadata: e }), 31311 this.tech_.trigger({ type: 'usage', name: 'vhs-gap-skip' }))); 31312 } 31313 gapFromVideoUnderflow_(e, t) { 31314 var i = (function (t) { 31315 if (t.length < 2) return O(); 31316 var i = []; 31317 for (let e = 1; e < t.length; e++) { 31318 var s = t.end(e - 1), 31319 r = t.start(e); 31320 i.push([s, r]); 31321 } 31322 return O(i); 31323 })(e); 31324 for (let e = 0; e < i.length; e++) { 31325 var s = i.start(e), 31326 r = i.end(e); 31327 if (t - s < 4 && 2 < t - s) return { start: s, end: r }; 31328 } 31329 return null; 31330 } 31331 } 31332 let jc = { 31333 errorInterval: 30, 31334 getSource(e) { 31335 return e( 31336 this.tech({ IWillNotUseThisInPlugins: !0 }).currentSource_ || this.currentSource() 31337 ); 31338 } 31339 }, 31340 Vc = function (t, e) { 31341 function i(e) { 31342 null != e && 31343 ((a = (t.duration() !== 1 / 0 && t.currentTime()) || 0), 31344 t.one('loadedmetadata', l), 31345 t.src(e), 31346 t.trigger({ type: 'usage', name: 'vhs-error-reload' }), 31347 t.play()); 31348 } 31349 function s() { 31350 if (Date.now() - n < 1e3 * o.errorInterval) 31351 t.trigger({ type: 'usage', name: 'vhs-error-reload-canceled' }); 31352 else { 31353 if (o.getSource && 'function' == typeof o.getSource) 31354 return ((n = Date.now()), o.getSource.call(t, i)); 31355 E.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!'); 31356 } 31357 } 31358 function r() { 31359 (t.off('loadedmetadata', l), t.off('error', s), t.off('dispose', r)); 31360 } 31361 let n = 0, 31362 a = 0, 31363 o = L(jc, e), 31364 l = 31365 (t.ready(() => { 31366 t.trigger({ type: 'usage', name: 'vhs-error-reload-initialized' }); 31367 }), 31368 function () { 31369 a && t.currentTime(a); 31370 }); 31371 (t.on('error', s), 31372 t.on('dispose', r), 31373 (t.reloadSourceOnError = function (e) { 31374 (r(), Vc(t, e)); 31375 })); 31376 }; 31377 function Hc(t, e) { 31378 var i = e.media(); 31379 let s = -1; 31380 for (let e = 0; e < t.length; e++) 31381 if (t[e].id === i.id) { 31382 s = e; 31383 break; 31384 } 31385 ((t.selectedIndex_ = s), t.trigger({ selectedIndex: s, type: 'change' })); 31386 } 31387 let N = { 31388
31388 PlaylistLoader: xh, 31389 Playlist: ch, 31390 utils: Qr, 31391 STANDARD_PLAYLIST_SELECTOR: qu, 31392 INITIAL_PLAYLIST_SELECTOR: function () { 31393 var e = this.playlists.main.playlists.filter(ch.isEnabled), 31394 e = (Bu(e, (e, t) => fu(e, t)), e.filter((e) => !!mu(this.playlists.main, e).video)); 31395 return e[0] || null; 31396 }, 31397 lastBandwidthSelector: qu, 31398 movingAverageBandwidthSelector: function (t) { 31399 let i = -1, 31400 s = -1; 31401 if (t < 0 || 1 < t) 31402 throw new Error('Moving average bandwidth decay must be between 0 and 1.'); 31403 return function () { 31404 let e = (this.useDevicePixelRatio && window.devicePixelRatio) || 1; 31405 return ( 31406 isNaN(this.customPixelRatio) || (e = this.customPixelRatio), 31407 i < 0 && ((i = this.systemBandwidth), (s = this.systemBandwidth)), 31408 0 < this.systemBandwidth && 31409 this.systemBandwidth !== s && 31410 ((i = t * this.systemBandwidth + (1 - t) * i), (s = this.systemBandwidth)), 31411 Fu( 31412 this.playlists.main, 31413 i, 31414 parseInt(gu(this.tech_.el(), 'width'), 10) * e, 31415 parseInt(gu(this.tech_.el(), 'height'), 10) * e, 31416 this.limitRenditionByPlayerDimensions, 31417 this.playlistController_ 31418 ) 31419 ); 31420 }; 31421 }, 31422 comparePlaylistBandwidth: fu, 31423 comparePlaylistResolution: function (e, t) { 31424 let i, s; 31425 return ( 31426 (i = 31427 (i = 31428 e.attributes.RESOLUTION && e.attributes.RESOLUTION.width 31429 ? e.attributes.RESOLUTION.width 31430 : i) || window.Number.MAX_VALUE), 31431 (s = 31432 (s = 31433 t.attributes.RESOLUTION && t.attributes.RESOLUTION.width 31434 ? t.attributes.RESOLUTION.width 31435 : s) || window.Number.MAX_VALUE), 31436 i === s && e.attributes.BANDWIDTH && t.attributes.BANDWIDTH 31437 ? e.attributes.BANDWIDTH - t.attributes.BANDWIDTH 31438 : i - s 31439 ); 31440 }, 31441 xhr: Dh() 31442 }, 31443 zc = 31444 (Object.keys(R).forEach((t) => { 31445 Object.defineProperty(N, t, { 31446 get() { 31447 return ( 31448 E.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`), 31449 R[t] 31450 ); 31451 }, 31452 set(e) { 31453 (E.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`), 31454 'number' != typeof e || e < 0 31455 ? E.log.warn(`value of Vhs.${t} must be greater than or equal to 0`) 31456 : (R[t] = e)); 31457 } 31458 }); 31459 }), 31460 'videojs-vhs'), 31461 $c = 31462 ((N.canPlaySource = function () { 31463 return E.log.warn( 31464 "VHS is no longer a tech. Please remove it from your player's techOrder." 31465 ); 31466 }), 31467 ({ player: s, sourceKeySystems: e, audioMedia: t, mainPlaylists: i }) => { 31468 if (!s.eme.initializeMediaKeys) return Promise.resolve(); 31469 var r, 31470 t = t ? i.concat([t]) : i, 31471 t = 31472 ((i = t), 31473 (r = Object.keys(e)), 31474 i.reduce((e, s) => { 31475 var t; 31476 return ( 31477 s.contentProtection && 31478 ((t = r.reduce((e, t) => { 31479 var i = s.contentProtection[t]; 31480 return (i && i.pssh && (e[t] = { pssh: i.pssh }), e); 31481 }, {})), 31482 Object.keys(t).length) && 31483 e.push(t), 31484 e 31485 ); 31486 }, [])); 31487 let n = [], 31488 a = []; 31489 return ( 31490 t.forEach((e) => { 31491 (a.push( 31492 new Promise((e, t) => { 31493 s.tech_.one('keysessioncreated', e); 31494 }) 31495 ), 31496 n.push( 31497 new Promise((t, i) => { 31498 s.eme.initializeMediaKeys({ keySystems: e }, (e) => { 31499 e ? i(e) : t(); 31500 }); 31501 }) 31502 )); 31503 }), 31504 Promise.race([Promise.all(n), Promise.race(a)]) 31505 ); 31506 }), 31507 Wc = ({ player: e, sourceKeySystems: t, media: i, audioMedia: s }) => { 31508 t = ((e, t, i) => { 31509 if (!e) return e; 31510 let s = {}; 31511 (t && t.attributes && t.attributes.CODECS && (s = Nu(na(t.attributes.CODECS))), 31512 i && i.attributes && i.attributes.CODECS && (s.audio = i.attributes.CODECS)); 31513 var r, 31514 n = aa(s.video), 31515 a = aa(s.audio), 31516 o = {}; 31517 for (r in e) 31518 ((o[r] = {}), 31519 a && (o[r].audioContentType = a), 31520 n && (o[r].videoContentType = n), 31521 t.contentProtection && 31522 t.contentProtection[r] && 31523 t.contentProtection[r].pssh && 31524 (o[r].pssh = t.contentProtection[r].pssh), 31525 'string' == typeof e[r] && (o[r].url = e[r])); 31526 return L(e, o); 31527 })(t, i, s); 31528 return !( 31529 !t || 31530 ((e.currentSource().keySystems = t) && 31531 !e.eme && 31532 (E.log.warn('DRM encrypted source cannot be decrypted without a DRM plugin'), 1)) 31533 ); 31534 }, 31535 Gc = () => { 31536 if (!window.localStorage) return null; 31537 var e = window.localStorage.getItem(zc); 31538 if (!e) return null;
31539 try { 31540 return JSON.parse(e); 31541 } catch (e) { 31542 return null; 31543 } 31544 }, 31545 Xc = (e, t) => { 31546 (e._requestCallbackSet || (e._requestCallbackSet = new Set()), e._requestCallbackSet.add(t)); 31547 }, 31548 Kc = (e, t) => { 31549 (e._responseCallbackSet || (e._responseCallbackSet = new Set()), 31550 e._responseCallbackSet.add(t)); 31551 }, 31552 Yc = (e, t) => { 31553 e._requestCallbackSet && 31554 (e._requestCallbackSet.delete(t), 31555 e._requestCallbackSet.size || delete e._requestCallbackSet); 31556 }, 31557 Qc = (e, t) => { 31558 e._responseCallbackSet && 31559 (e._responseCallbackSet.delete(t), 31560 e._responseCallbackSet.size || delete e._responseCallbackSet); 31561 }; 31562 ((N.supportsNativeHls = (function () { 31563 if (!document || !document.createElement) return !1; 31564 let t = document.createElement('video'); 31565 return ( 31566 !!E.getTech('Html5').isSupported() && 31567 [ 31568 'application/vnd.apple.mpegurl', 31569 'audio/mpegurl', 31570 'audio/x-mpegurl', 31571 'application/x-mpegurl', 31572 'video/x-mpegurl', 31573 'video/mpegurl', 31574 'application/mpegurl' 31575 ].some(function (e) { 31576 return /maybe|probably/i.test(t.canPlayType(e)); 31577 }) 31578 ); 31579 })()), 31580 (N.supportsNativeDash = 31581 !!(document && document.createElement && E.getTech('Html5').isSupported()) && 31582 /maybe|probably/i.test(document.createElement('video').canPlayType('application/dash+xml'))), 31583 (N.supportsTypeNatively = (e) => 31584 'hls' === e ? N.supportsNativeHls : 'dash' === e && N.supportsNativeDash), 31585 (N.isSupported = function () { 31586 return E.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder."); 31587 }), 31588 (N.xhr.onRequest = function (e) { 31589 Xc(N.xhr, e); 31590 }), 31591 (N.xhr.onResponse = function (e) { 31592 Kc(N.xhr, e); 31593 }), 31594 (N.xhr.offRequest = function (e) { 31595 Yc(N.xhr, e); 31596 }), 31597 (N.xhr.offResponse = function (e) { 31598 Qc(N.xhr, e); 31599 })); 31600 t = E.getComponent('Component'); 31601 class Jc extends t { 31602 constructor(e, t, i) { 31603 if ( 31604 (super(t, i.vhs), 31605 'number' == typeof i.initialBandwidth && (this.options_.bandwidth = i.initialBandwidth), 31606 (this.logger_ = Ud('VhsHandler')), 31607 t.options_ && 31608 t.options_.playerId && 31609 ((i = E.getPlayer(t.options_.playerId)), (this.player_ = i)), 31610 (this.tech_ = t), 31611 (this.source_ = e), 31612 (this.stats = {}), 31613 (this.ignoreNextSeekingEvent_ = !1), 31614 this.setOptions_(), 31615 this.options_.overrideNative && t.overrideNativeAudioTracks && t.overrideNativeVideoTracks) 31616 ) 31617 (t.overrideNativeAudioTracks(!0), t.overrideNativeVideoTracks(!0)); 31618 else if ( 31619 this.options_.overrideNative && 31620 (t.featuresNativeVideoTracks || t.featuresNativeAudioTracks) 31621 ) 31622 throw new Error('Overriding native VHS requires emulated tracks. See https://git.io/vMpjB'); 31623 (this.on( 31624 document, 31625 ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], 31626 (e) => { 31627 var t = 31628 document.fullscreenElement || 31629 document.webkitFullscreenElement || 31630 document.mozFullScreenElement || 31631 document.msFullscreenElement; 31632 t && t.contains(this.tech_.el()) 31633 ? this.playlistController_.fastQualityChange_() 31634 : this.playlistController_.checkABR_(); 31635 } 31636 ), 31637 this.on(this.tech_, 'seeking', function () { 31638 this.ignoreNextSeekingEvent_ 31639 ? (this.ignoreNextSeekingEvent_ = !1) 31640 : this.setCurrentTime(this.tech_.currentTime()); 31641 }), 31642 this.on(this.tech_, 'error', function () { 31643 this.tech_.error() && this.playlistController_ && this.playlistController_.pauseLoading(); 31644 }), 31645 this.on(this.tech_, 'play', this.play)); 31646 } 31647 setOptions_(e = {}) { 31648 ((this.options_ = L(this.options_, e)), 31649 (this.options_.withCredentials = this.options_.withCredentials || !1), 31650 (this.options_.limitRenditionByPlayerDimensions = 31651 !1 !== this.options_.limitRenditionByPlayerDimensions), 31652 (this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || !1), 31653 (this.options_.useBandwidthFromLocalStorage = 31654 'undefined' != typeof this.source_.useBandwidthFromLocalStorage 31655 ? this.source_.useBandwidthFromLocalStorage 31656 : this.options_.useBandwidthFromLocalStorage || !1), 31657 (this.options_.useForcedSubtitles = this.options_.useForcedSubtitles || !1), 31658 (this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || !1), 31659 (this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || !1), 31660 (this.options_.customTagParsers = this.options_.customTagParsers || []), 31661 (this.options_.customTagMappers = this.options_.customTagMappers || []), 31662 (this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || !1),
31663 (this.options_.llhls = !1 !== this.options_.llhls), 31664 (this.options_.bufferBasedABR = this.options_.bufferBasedABR || !1), 31665 'number' != typeof this.options_.playlistExclusionDuration && 31666 (this.options_.playlistExclusionDuration = 60), 31667 'number' != typeof this.options_.bandwidth && 31668 this.options_.useBandwidthFromLocalStorage && 31669 ((e = Gc()) && 31670 e.bandwidth && 31671 ((this.options_.bandwidth = e.bandwidth), 31672 this.tech_.trigger({ type: 'usage', name: 'vhs-bandwidth-from-local-storage' })), 31673 e) && 31674 e.throughput && 31675 ((this.options_.throughput = e.throughput), 31676 this.tech_.trigger({ type: 'usage', name: 'vhs-throughput-from-local-storage' })), 31677 'number' != typeof this.options_.bandwidth && 31678 (this.options_.bandwidth = R.INITIAL_BANDWIDTH), 31679 (this.options_.enableLowInitialPlaylist = 31680 this.options_.enableLowInitialPlaylist && 31681 this.options_.bandwidth === R.INITIAL_BANDWIDTH), 31682 [ 31683 'withCredentials', 31684 'useDevicePixelRatio', 31685 'customPixelRatio', 31686 'limitRenditionByPlayerDimensions', 31687 'bandwidth', 31688 'customTagParsers', 31689 'customTagMappers', 31690 'cacheEncryptionKeys', 31691 'playlistSelector', 31692 'initialPlaylistSelector', 31693 'bufferBasedABR', 31694 'liveRangeSafeTimeDelta', 31695 'llhls', 31696 'useForcedSubtitles', 31697 'useNetworkInformationApi', 31698 'useDtsForTimestampOffset', 31699 'exactManifestTimings', 31700 'leastPixelDiffSelector' 31701 ].forEach((e) => { 31702 'undefined' != typeof this.source_[e] && (this.options_[e] = this.source_[e]); 31703 }), 31704 (this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions), 31705 (this.useDevicePixelRatio = this.options_.useDevicePixelRatio)); 31706 e = this.options_.customPixelRatio; 31707 'number' == typeof e && 0 <= e && (this.customPixelRatio = e); 31708 } 31709 setOptions(e = {}) { 31710 this.setOptions_(e); 31711 } 31712 src(e, t) { 31713 e && 31714 (this.setOptions_(), 31715 (this.options_.src = 31716 0 === 31717 (e = this.source_.src).toLowerCase().indexOf('data:application/vnd.videojs.vhs+json,') 31718 ? JSON.parse(e.substring(e.indexOf(',') + 1)) 31719 : e), 31720 (this.options_.tech = this.tech_), 31721 (this.options_.externVhs = N), 31722 (this.options_.sourceType = Zn(t)), 31723 (this.options_.seekTo = (e) => { 31724 this.tech_.setCurrentTime(e); 31725 }), 31726 (this.options_.player_ = this.player_), 31727 (this.playlistController_ = new Uc(this.options_)), 31728 (e = L({ liveRangeSafeTimeDelta: $d }, this.options_, { 31729 seekable: () => this.seekable(), 31730 media: () => this.playlistController_.media(), 31731 playlistController: this.playlistController_ 31732 })), 31733 (this.playbackWatcher_ = new qc(e)), 31734 this.attachStreamingEventListeners_(), 31735 this.playlistController_.on('error', () => { 31736 var e = E.players[this.tech_.options_.playerId]; 31737 let t = this.playlistController_.error; 31738 ('object' != typeof t || t.code 31739 ? 'string' == typeof t && (t = { message: t, code: 3 }) 31740 : (t.code = 3), 31741 e.error(t)); 31742 }), 31743 (t = this.options_.bufferBasedABR 31744 ? N.movingAverageBandwidthSelector(0.55) 31745 : N.STANDARD_PLAYLIST_SELECTOR), 31746 (this.playlistController_.selectPlaylist = (this.selectPlaylist || t).bind(this)), 31747 (this.playlistController_.selectInitialPlaylist = N.INITIAL_PLAYLIST_SELECTOR.bind(this)), 31748 (this.playlists = this.playlistController_.mainPlaylistLoader_), 31749 (this.mediaSource = this.playlistController_.mediaSource), 31750 Object.defineProperties(this, { 31751 selectPlaylist: { 31752 get() { 31753 return this.playlistController_.selectPlaylist; 31754 }, 31755 set(e) { 31756 this.playlistController_.selectPlaylist = e.bind(this); 31757 } 31758 }, 31759 throughput: { 31760 get() { 31761 return this.playlistController_.mainSegmentLoader_.throughput.rate; 31762 }, 31763 set(e) { 31764 ((this.playlistController_.mainSegmentLoader_.throughput.rate = e), 31765 (this.playlistController_.mainSegmentLoader_.throughput.count = 1)); 31766 } 31767 }, 31768 bandwidth: { 31769 get() { 31770 let e = this.playlistController_.mainSegmentLoader_.bandwidth; 31771 var t = 31772 window.navigator.connection || 31773 window.navigator.mozConnection || 31774 window.navigator.webkitConnection; 31775 return ( 31776 this.options_.useNetworkInformationApi && 31777 t && 31778 ((t = 1e3 * t.downlink * 1e3), (e = 1e7 <= t && 1e7 <= e ? Math.max(e, t) : t)), 31779 e 31780 ); 31781 }, 31782 set(e) { 31783 ((this.playlistController_.mainSegmentLoader_.bandwidth = e), 31784 (this.playlistController_.mainSegmentLoader_.throughput = { rate: 0, count: 0 })); 31785 } 31786 }, 31787 systemBandwidth: { 31788 get() { 31789 var e = 1 / (this.bandwidth || 1); 31790 let t; 31791 return ((t = 0 < this.throughput ? 1 / this.throughput : 0), Math.floor(1 / (e + t))); 31792 }, 31793 set() { 31794 E.log.error('The "systemBandwidth" property is read-only'); 31795 } 31796 } 31797 }), 31798 this.options_.bandwidth && (this.bandwidth = this.options_.bandwidth), 31799 this.options_.throughput && (this.throughput = this.options_.throughput), 31800 Object.defineProperties(this.stats, { 31801 bandwidth: { get: () => this.bandwidth || 0, enumerable: !0 },
vendor: 5,220 bytes, lines 31802-31921
31802 mediaRequests: { 31803 get: () => this.playlistController_.mediaRequests_() || 0, 31804 enumerable: !0 31805 }, 31806 mediaRequestsAborted: { 31807 get: () => this.playlistController_.mediaRequestsAborted_() || 0, 31808 enumerable: !0 31809 }, 31810 mediaRequestsTimedout: { 31811 get: () => this.playlistController_.mediaRequestsTimedout_() || 0, 31812 enumerable: !0 31813 }, 31814 mediaRequestsErrored: { 31815 get: () => this.playlistController_.mediaRequestsErrored_() || 0, 31816 enumerable: !0 31817 }, 31818 mediaTransferDuration: { 31819 get: () => this.playlistController_.mediaTransferDuration_() || 0, 31820 enumerable: !0 31821 }, 31822 mediaBytesTransferred: { 31823 get: () => this.playlistController_.mediaBytesTransferred_() || 0, 31824 enumerable: !0 31825 }, 31826 mediaSecondsLoaded: { 31827 get: () => this.playlistController_.mediaSecondsLoaded_() || 0, 31828 enumerable: !0 31829 }, 31830 mediaAppends: { 31831 get: () => this.playlistController_.mediaAppends_() || 0, 31832 enumerable: !0 31833 }, 31834 mainAppendsToLoadedData: { 31835 get: () => this.playlistController_.mainAppendsToLoadedData_() || 0, 31836 enumerable: !0 31837 }, 31838 audioAppendsToLoadedData: { 31839 get: () => this.playlistController_.audioAppendsToLoadedData_() || 0, 31840 enumerable: !0 31841 }, 31842 appendsToLoadedData: { 31843 get: () => this.playlistController_.appendsToLoadedData_() || 0, 31844 enumerable: !0 31845 }, 31846 timeToLoadedData: { 31847 get: () => this.playlistController_.timeToLoadedData_() || 0, 31848 enumerable: !0 31849 }, 31850 buffered: { get: () => Xd(this.tech_.buffered()), enumerable: !0 }, 31851 currentTime: { get: () => this.tech_.currentTime(), enumerable: !0 }, 31852 currentSource: { get: () => this.tech_.currentSource_, enumerable: !0 }, 31853 currentTech: { get: () => this.tech_.name_, enumerable: !0 }, 31854 duration: { get: () => this.tech_.duration(), enumerable: !0 }, 31855 main: { get: () => this.playlists.main, enumerable: !0 }, 31856 playerDimensions: { get: () => this.tech_.currentDimensions(), enumerable: !0 }, 31857 seekable: { get: () => Xd(this.tech_.seekable()), enumerable: !0 }, 31858 timestamp: { get: () => Date.now(), enumerable: !0 }, 31859 videoPlaybackQuality: { get: () => this.tech_.getVideoPlaybackQuality(), enumerable: !0 } 31860 }), 31861 this.tech_.one( 31862 'canplay', 31863 this.playlistController_.setupFirstPlay.bind(this.playlistController_) 31864 ), 31865 this.tech_.on('bandwidthupdate', () => { 31866 if (this.options_.useBandwidthFromLocalStorage) { 31867 var e = { bandwidth: this.bandwidth, throughput: Math.round(this.throughput) }; 31868 if (window.localStorage) { 31869 var t = (t = Gc()) ? L(t, e) : e; 31870 try { 31871 window.localStorage.setItem(zc, JSON.stringify(t)); 31872 } catch (e) { 31873 return; 31874 } 31875 } 31876 } 31877 }), 31878 this.playlistController_.on('selectedinitialmedia', () => { 31879 var i; 31880 (i = this).representations = () => { 31881 var e = i.playlistController_.main(), 31882 e = uh(e) ? i.playlistController_.getAudioTrackPlaylists_() : e.playlists; 31883 return e ? e.filter((e) => !nh(e)).map((e, t) => new Bc(i, e, e.id)) : []; 31884 }; 31885 }), 31886 this.playlistController_.sourceUpdater_.on('createdsourcebuffers', () => { 31887 this.setupEme_(); 31888 }), 31889 this.on(this.playlistController_, 'progress', function () { 31890 this.tech_.trigger('progress'); 31891 }), 31892 this.on(this.playlistController_, 'firstplay', function () { 31893 this.ignoreNextSeekingEvent_ = !0; 31894 }), 31895 this.setupQualityLevels_(), 31896 this.tech_.el()) && 31897 ((this.mediaSourceUrl_ = window.URL.createObjectURL(this.playlistController_.mediaSource)), 31898 (E.browser.IS_ANY_SAFARI || E.browser.IS_IOS) && 31899 this.options_.overrideNative && 31900 'hls' === this.options_.sourceType && 31901 'function' == typeof this.tech_.addSourceElement 31902 ? (this.tech_.addSourceElement(this.mediaSourceUrl_), 31903 this.tech_.addSourceElement(this.source_.src)) 31904 : this.tech_.src(this.mediaSourceUrl_)); 31905 } 31906 createKeySessions_() { 31907 var e = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader; 31908 (this.logger_('waiting for EME key session creation'), 31909 $c({ 31910 player: this.player_, 31911 sourceKeySystems: this.source_.keySystems, 31912 audioMedia: e && e.media(), 31913 mainPlaylists: this.playlists.main.playlists 31914 }) 31915 .then(() => { 31916 (this.logger_('created EME key session'), 31917 this.playlistController_.sourceUpdater_.initializedEme()); 31918 }) 31919 .catch((e) => { 31920 (this.logger_('error while creating EME key session', e), 31921 this.player_.error({ message: 'Failed to initialize media ke
31921ys for EME', code: 3 })); 31922 })); 31923 } 31924 handleWaitingForKey_() { 31925 (this.logger_('waitingforkey fired, attempting to create any new key sessions'), 31926 this.createKeySessions_()); 31927 } 31928 setupEme_() { 31929 var e = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader, 31930 e = Wc({ 31931 player: this.player_, 31932 sourceKeySystems: this.source_.keySystems, 31933 media: this.playlists.media(), 31934 audioMedia: e && e.media() 31935 }); 31936 (this.player_.tech_.on('keystatuschange', (e) => { 31937 this.playlistController_.updatePlaylistByKeyStatus(e.keyId, e.status); 31938 }), 31939 (this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this)), 31940 this.player_.tech_.on('waitingforkey', this.handleWaitingForKey_), 31941 e ? this.createKeySessions_() : this.playlistController_.sourceUpdater_.initializedEme()); 31942 } 31943 setupQualityLevels_() { 31944 var e = E.players[this.tech_.options_.playerId]; 31945 e && 31946 e.qualityLevels && 31947 !this.qualityLevels_ && 31948 ((this.qualityLevels_ = e.qualityLevels()), 31949 this.playlistController_.on('selectedinitialmedia', () => { 31950 var t, e; 31951 ((t = this.qualityLevels_), 31952 (e = this).representations().forEach((e) => { 31953 t.addQualityLevel(e); 31954 }), 31955 Hc(t, e.playlists)); 31956 }), 31957 this.playlists.on('mediachange', () => { 31958 Hc(this.qualityLevels_, this.playlists); 31959 })); 31960 } 31961 static version() { 31962 return { 31963 '@videojs/http-streaming': '3.16.0', 31964 'mux.js': '7.1.0', 31965 'mpd-parser': '1.3.1', 31966 'm3u8-parser': '7.2.0', 31967 'aes-decrypter': '4.0.2' 31968 }; 31969 } 31970 version() { 31971 return this.constructor.version(); 31972 } 31973 canChangeType() { 31974 return cc.canChangeType(); 31975 } 31976 play() { 31977 this.playlistController_.play(); 31978 } 31979 setCurrentTime(e) { 31980 this.playlistController_.setCurrentTime(e); 31981 } 31982 duration() { 31983 return this.playlistController_.duration(); 31984 } 31985 seekable() { 31986 return this.playlistController_.seekable(); 31987 } 31988 dispose() { 31989 (this.playbackWatcher_ && this.playbackWatcher_.dispose(), 31990 this.playlistController_ && this.playlistController_.dispose(), 31991 this.qualityLevels_ && this.qualityLevels_.dispose(), 31992 this.tech_ && this.tech_.vhs && delete this.tech_.vhs, 31993 this.mediaSourceUrl_ && 31994 window.URL.revokeObjectURL && 31995 (window.URL.revokeObjectURL(this.mediaSourceUrl_), (this.mediaSourceUrl_ = null)), 31996 this.tech_ && this.tech_.off('waitingforkey', this.handleWaitingForKey_), 31997 super.dispose()); 31998 } 31999 convertToProgramTime(e, t) { 32000 return qh({ playlist: this.playlistController_.media(), time: e, callback: t }); 32001 } 32002 seekToProgramTime(e, t, i = !0, s = 2) { 32003 return jh({ 32004 programTime: e, 32005 playlist: this.playlistController_.media(), 32006 retryCount: s, 32007 pauseAfterSeek: i, 32008 seekTo: this.options_.seekTo, 32009 tech: this.options_.tech, 32010 callback: t 32011 }); 32012 } 32013 setupXhrHooks_() { 32014 ((this.xhr.onRequest = (e) => { 32015 Xc(this.xhr, e); 32016 }), 32017 (this.xhr.onResponse = (e) => { 32018 Kc(this.xhr, e); 32019 }), 32020 (this.xhr.offRequest = (e) => { 32021 Yc(this.xhr, e); 32022 }), 32023 (this.xhr.offResponse = (e) => { 32024 Qc(this.xhr, e); 32025 }), 32026 this.player_.trigger('xhr-hooks-ready')); 32027 } 32028 attachStreamingEventListeners_() { 32029 ([ 32030 'seekablerangeschanged', 32031 'bufferedrangeschanged', 32032 'contentsteeringloadstart', 32033 'contentsteeringloadcomplete', 32034 'contentsteeringparsed' 32035 ].forEach((e) => { 32036 this.playlistController_.on(e, (e) => { 32037 this.player_.trigger(f({}, e)); 32038 }); 32039 }), 32040 ['gapjumped', 'playedrangeschanged'].forEach((e) => { 32041 this.playbackWatcher_.on(e, (e) => { 32042 this.player_.trigger(f({}, e)); 32043 }); 32044 })); 32045 } 32046 } 32047 let Zc = { 32048 name: 'videojs-http-streaming', 32049 VERSION: '3.16.0', 32050 canHandleSource(e, t = {}) { 32051 t = L(E.options, t); 32052 return ( 32053 !(!t.vhs.experimentalUseMMS && !Qn('avc1.4d400d,mp4a.40.2', !1)) && 32054 Zc.canPlayType(e.type, t) 32055 ); 32056 }, 32057 handleSource(e, t, i = {}) { 32058 i = L(E.options, i); 32059 return ( 32060 (t.vhs = new Jc(e, t, i)), 32061 (t.vhs.xhr = Dh()), 32062 t.vhs.setupXhrHooks_(), 32063 t.vhs.src(e.src, e.type), 32064 t.vhs 32065 ); 32066 }, 32067 canPlayType(e, t) { 32068 e = Zn(e); 32069 return e && ((t = Zc.getOverrideNative(t)), !N.supportsTypeNatively(e) || t) ? 'maybe' : ''; 32070 }, 32071 getOverrideNative(e = {}) { 32072 var { vhs: e = {} } = e, 32073 t = !(E.browser.IS_ANY_SAFARI || E.browser.IS_IOS), 32074 { overrideNative: e = t } = e; 32075 return e; 32076 } 32077 }; 32078 return ( 32079 Qn('avc1.4d400d,mp4a.40.2', !0) && E.getTech('Html5').registerSourceHandler(Zc, 0), 32080 (E.VhsHandler = Jc), 32081 (E.VhsSourceHandler = Zc), 32082 (E.Vhs = N), 32083 E.use || E.registerComponent('Vhs', N), 32084 (E.options.vhs = E.options.vhs || {}), 32085 (E.getPlugin && E.getPlugin('reloadSourceOnError')) || 32086 E.registerPlugin('reloadSourceOnError', function (e) { 32087 Vc(this, e); 32088 }), 32089 E 32090 ); 32091});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.