@castlabs/prestoplay 6.2.7 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +110 -106
- package/cjs/cl.conviva.js +33 -32
- package/cjs/cl.core.js +395 -383
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +69 -68
- package/cjs/cl.externs.js +98 -47
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +44 -43
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +32 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +250 -255
- package/cjs/cl.muxdata.js +12 -11
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -5
- package/cjs/cl.smooth.js +70 -70
- package/cjs/cl.thumbnails.js +22 -22
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +26 -26
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +19 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +86 -82
- package/cl.conviva.js +27 -27
- package/cl.core.js +346 -334
- package/cl.crypto.js +8 -8
- package/cl.dash.js +63 -62
- package/cl.externs.js +98 -47
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +37 -36
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -24
- package/cl.ima.js +16 -16
- package/cl.mse.js +220 -224
- package/cl.muxdata.js +8 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -4
- package/cl.smooth.js +57 -57
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +21 -21
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +1 -1
package/cl.crypto.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
var c=_.
|
|
3
|
-
this.j;const h=b[0],k=b[1],l=b[2];b=b[3];const m=new Uint32Array(256);let n=0,q=0,
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var AH=function(a){a=_.jg(a);const b=new Uint32Array(4);for(let c=0;4>c;c++)b[c]=a.getUint32(4*c);return b},CH=function(a,b,c){return _.v(function*(){let d=new ArrayBuffer(0);try{d=yield BH(a,c.url)}catch(e){return a.m.debug("Could not fetch key"),a.l.onError(new _.G(1,7,7104,null,e)),b}try{return yield a.h.importKey(d),yield a.h.decrypt(b,c.iv)}catch(e){return a.m.warn("Could not decrypt segment data!",e),a.l.onError(new _.G(1,3,3103,null,e)),b}})},BH=function(a,b){return _.v(function*(){if(a.o[b])return a.o[b];
|
|
2
|
+
var c=_.Cg(b);c=yield a.j.fetch(c).O;return a.o[b]=c.data})},DH=class{constructor(){this.A=[0,1,2,4,8,16,32,64,128,27,54];this.B=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.j=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.w=new Uint32Array(256);this.m=new Uint32Array(256);this.o=new Uint32Array(0);this.g=this.a=this.h=this.f=null;{const c=this.w,d=this.m;var a=this.B;const e=a[0],f=a[1],g=a[2];a=a[3];var b=
|
|
3
|
+
this.j;const h=b[0],k=b[1],l=b[2];b=b[3];const m=new Uint32Array(256);let n=0,q=0,r;for(r=0;256>r;r++)m[r]=128>r?r<<1:r<<1^283;for(r=0;256>r;r++){let w=q^q<<1^q<<2^q<<3^q<<4;w=w>>>8^w&255^99;c[n]=w;d[w]=n;const C=m[n],A=m[C],E=m[A];let D=257*m[w]^16843008*w;e[n]=D<<24|D>>>8;f[n]=D<<16|D>>>16;g[n]=D<<8|D>>>24;a[n]=D;D=16843009*E^65537*A^257*C^16843008*n;h[w]=D<<24|D>>>8;k[w]=D<<16|D>>>16;l[w]=D<<8|D>>>24;b[w]=D;n?(n=C^m[m[m[E^C]]],q^=m[m[q]]):n=q=1}}}importKey(a){a=AH(a);for(var b=!0,c=0;c<a.length&&
|
|
4
4
|
b;)b=a[c]===this.o[c],c++;if(b)return new Promise(m=>m());this.o=a;this.a=a.length;if(4!==this.a&&6!==this.a&&8!==this.a)throw Error("Invalid aes key size\x3d"+this.a);this.g=4*(this.a+7);this.f=new Uint32Array(this.g);this.h=new Uint32Array(this.g);b=this.w;const d=this.A;var e=this.j;c=e[0];const f=e[1],g=e[2],h=e[3];let k=0,l=0;for(e=0;e<this.g;e++)e<this.a?k=this.f[e]=a[e]:(l=k,0===e%this.a?(l=l<<8|l>>>24,l=b[l>>>24]<<24|b[l>>>16&255]<<16|b[l>>>8&255]<<8|b[l&255],l^=d[e/this.a|0]<<24):6<this.a&&
|
|
5
|
-
4===e%this.a&&(l=b[l>>>24]<<24|b[l>>>16&255]<<16|b[l>>>8&255]<<8|b[l&255]),k=(this.f[e-this.a]^l)>>>0,this.f[e]=k);for(a=0;a<this.g;a++)e=this.g-a,l=a&3?this.f[e]:this.f[e-4],this.h[a]=4>a||4>=e?l:c[b[l>>>24]]^f[b[l>>>16&255]]^g[b[l>>>8&255]]^h[b[l&255]],this.h[a]>>>=0;return new Promise(m=>m())}decrypt(a,b){let c=0;const d=this.a+6,e=this.h,f=this.m;var g=this.j;const h=g[0],k=g[1],l=g[2];g=g[3];var m=
|
|
6
|
-
|
|
7
|
-
f[
|
|
8
|
-
this.o=null;return new Promise(a=>a())}C(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24}};var
|
|
9
|
-
this.j.
|
|
5
|
+
4===e%this.a&&(l=b[l>>>24]<<24|b[l>>>16&255]<<16|b[l>>>8&255]<<8|b[l&255]),k=(this.f[e-this.a]^l)>>>0,this.f[e]=k);for(a=0;a<this.g;a++)e=this.g-a,l=a&3?this.f[e]:this.f[e-4],this.h[a]=4>a||4>=e?l:c[b[l>>>24]]^f[b[l>>>16&255]]^g[b[l>>>8&255]]^h[b[l&255]],this.h[a]>>>=0;return new Promise(m=>m())}decrypt(a,b){let c=0;const d=this.a+6,e=this.h,f=this.m;var g=this.j;const h=g[0],k=g[1],l=g[2];g=g[3];var m=AH(b);b=m[0];let n=m[1],q=m[2];m=m[3];a=_.ig(a);const r=new Int32Array(a.length);let w,C,A;let E,
|
|
6
|
+
D,na,$a,tf,xe,Cd,bb,Sg;const Xc=this.C.bind(this);for(;c<a.length;){$a=Xc(a[c]);tf=Xc(a[c+1]);xe=Xc(a[c+2]);Cd=Xc(a[c+3]);E=$a^e[0];D=Cd^e[1];na=xe^e[2];var ta=tf^e[3];bb=4;for(Sg=1;Sg<d;Sg++)w=h[E>>>24]^k[D>>16&255]^l[na>>8&255]^g[ta&255]^e[bb],C=h[D>>>24]^k[na>>16&255]^l[ta>>8&255]^g[E&255]^e[bb+1],A=h[na>>>24]^k[ta>>16&255]^l[E>>8&255]^g[D&255]^e[bb+2],ta=h[ta>>>24]^k[E>>16&255]^l[D>>8&255]^g[na&255]^e[bb+3],E=w,D=C,na=A,bb+=4;w=f[E>>>24]<<24^f[D>>16&255]<<16^f[na>>8&255]<<8^f[ta&255]^e[bb];C=
|
|
7
|
+
f[D>>>24]<<24^f[na>>16&255]<<16^f[ta>>8&255]<<8^f[E&255]^e[bb+1];A=f[na>>>24]<<24^f[ta>>16&255]<<16^f[E>>8&255]<<8^f[D&255]^e[bb+2];ta=f[ta>>>24]<<24^f[E>>16&255]<<16^f[D>>8&255]<<8^f[na&255]^e[bb+3];bb+=3;r[c]=Xc(w^b);r[c+1]=Xc(ta^n);r[c+2]=Xc(A^q);r[c+3]=Xc(C^m);b=$a;n=tf;q=xe;m=Cd;c+=4}return new Promise(hb=>{{var Ja=r.buffer;const ab=Ja.byteLength,dc=ab&&(new DataView(Ja)).getUint8(ab-1);Ja=dc?Ja.slice(0,ab-dc):Ja}hb(Ja)})}destroy(){this.A=this.h=this.f=this.j=this.B=this.m=this.w=this.g=this.a=
|
|
8
|
+
this.o=null;return new Promise(a=>a())}C(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24}};var EH=class{constructor(){this.a=null}importKey(a){const b=this;return _.v(function*(){b.a=yield crypto.subtle.importKey("raw",a,{name:"AES-CBC"},!1,["decrypt"])})}decrypt(a,b){const c=this;return _.v(function*(){return yield crypto.subtle.decrypt({name:"AES-CBC",iv:b},c.a,a)})}destroy(){this.a=null;return new Promise(a=>a())}};_.x("clpp.crypto.CryptoComponent",class extends _.So{constructor(){super();this.j=this.l=null;this.w=this.A.bind(this);this.o={};this.h=null;this.m=new _.O("clpp.crypto")}f(a){this.l=a}a(){this.l=null}g(){if(window.crypto&&crypto.subtle){var a=crypto.subtle.decrypt;a=typeof crypto.subtle.importKey===_.Vc&&typeof a===_.Vc}else a=!1;a?this.h=new EH:(this.m.warn("No WebCrypto APIs found. Will fallback to software AES"),this.h=new DH);this.j=this.l.getNetworkEngine();this.j.Wc(this.w)}release(){this.j&&
|
|
9
|
+
this.j.Jd(this.w);this.h&&(this.h.destroy(),this.h=null);this.j=null;this.o={}}id(){return"crypto"}A(a){const b=this;return _.v(function*(){const c=a.request||null;c&&2===c.type&&c.keyInfo&&a.data&&(b.m.debug("Decrypt data"),a.data=yield CH(b,a.data,c.keyInfo));return a})}});};f.call(g, window);
|
package/cl.dash.js
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(g,h,k,l)=>{if("$$"==g)return"$";let m=f[h];if(null==m)return _.z("URL template does not have an available substitution ","for identifier",'"'+h+'":',a),g;"RepresentationID"==
|
|
7
|
-
break;case "o":g=m.toString(8);break;case "x":g=m.toString(16);break;case "X":g=m.toString(16).toUpperCase();break;default:g=m.toString()}k=window.parseInt(k,10)||1;return Array(Math.max(0,k-g.length)+1).join("0")+g})},
|
|
8
|
-
d;var l=e,m=a.da.duration||Infinity;h=_.
|
|
9
|
-
'time exceeds the next "S" element\'s start time:',
|
|
10
|
-
e/d||0;a=
|
|
11
|
-
a.attributes[l];m.namespaceURI==
|
|
12
|
-
q=l.getAttribute(n);a.setAttribute(n,q)}return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
a.P
|
|
19
|
-
|
|
20
|
-
w=yield Promise.all(w);var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
a.P.id,null,a.bandwidth||null,null);d=_.
|
|
24
|
-
g,a.da.start),b=new _.
|
|
25
|
-
|
|
26
|
-
n*d;let w=
|
|
27
|
-
0,null,b.
|
|
28
|
-
if(!f.pa&&!
|
|
29
|
-
f,a.da.start),d=new _.
|
|
30
|
-
"segment URLs do not match, truncating",d.
|
|
31
|
-
|
|
32
|
-
a
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(a.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
b.
|
|
55
|
-
b.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
b.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Yz="Channel parsing failure! Ignoring scheme and value",Zz="ContentProtection",$z="EssentialProperty",aA="Failed to parse UTCTiming tags.",bA="Missing \x3cms:pro/\x3e node in ContentProtection element",cA="No UTCTiming elements found.",dA="SegmentBase does not contain sufficient segment information:",eA="SegmentList does not contain sufficient segment information:",fA="SegmentTemplate does not contain sufficient segment information:",gA="SegmentTimeline",hA='The last "S" element cannot have a negative repeat',
|
|
2
|
+
iA="application",jA="duration",kA="http://www.w3.org/1999/xlink",lA='ignoring the last "S" element.',mA='ignoring the remaining "S" elements.',nA="presentationTimeOffset",oA="schemeIdUri",pA="static",qA="timescale",rA="urn:microsoft:playready",sA="urn:mpeg:cenc:2013",tA="urn:mpeg:dash:utc:http-head:2014",uA="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",vA="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",wA=function(a){return new _.pl(Promise.reject(a),()=>Promise.resolve())},xA=function(a){return new _.pl(Promise.all(a.map(b=>
|
|
3
|
+
b.O)),()=>Promise.all(a.map(b=>b.abort())))},yA=function(a,b,c){return Array.prototype.filter.call(a.childNodes,d=>d instanceof Element&&d.localName==c&&d.namespaceURI==b)},zA=function(a,b,c){a=yA(a,b,c);return 1!=a.length?null:a[0]},AA=function(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null},BA=function(a,b,c,d=null){let e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e},CA=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);
|
|
4
|
+
return isNaN(a)?null:Math.floor(a/1E3)},DA=function(a){if(!a)return null;const b=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(a);if(!b)return _.z("Invalid duration string:",a),null;a=31536E3*Number(b[1]||null)+2592E3*Number(b[2]||null)+86400*Number(b[3]||null)+3600*Number(b[4]||null)+60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null},EA=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;
|
|
5
|
+
b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null},FA=function(a){a=Number(a);return 0===a%1?a:null},GA=function(a){a=Number(a);return 0===a%1&&0<a?a:null},HA=function(a){a=Number(a);return 0===a%1&&0<=a?a:null},IA=function(a){let b;a=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(a)?null:a},JA=function(a,b){try{const c=_.mg(a);return _.Ej(c,b)}catch(c){return null}},KA=function(a,b){return a.reduce(((c,d,e)=>d.catch(c.bind(null,e))).bind(null,b),Promise.reject())},
|
|
6
|
+
LA=function(a){var b=void 0===b?1024:b;if(!(a instanceof Uint8Array))return"";if(typeof b!==_.p||0>=b)b=1024;return(a.byteLength>b?a.subarray(0,b):a).toString()},MA=function(a,b,c,d,e){const f={RepresentationID:b,Number:c,Bandwidth:d,Time:e};return a.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(g,h,k,l)=>{if("$$"==g)return"$";let m=f[h];if(null==m)return _.z("URL template does not have an available substitution ","for identifier",'"'+h+'":',a),g;"RepresentationID"==
|
|
7
|
+
h&&k&&(_.z("URL template should not contain a width specifier for identifier",'"RepresentationID":',a),k=void 0);"Time"==h&&(m=Math.round(m));switch(l){case void 0:case "d":case "i":case "u":g=m.toString();break;case "o":g=m.toString(8);break;case "x":g=m.toString(16);break;case "X":g=m.toString(16).toUpperCase();break;default:g=m.toString()}k=window.parseInt(k,10)||1;return Array(Math.max(0,k-g.length)+1).join("0")+g})},PA=function(a,b){var c=NA(a,b,qA);let d=1;c&&(d=GA(c)||1);c=NA(a,b,jA);(c=GA(c||
|
|
8
|
+
""))&&(c/=d);let e=0;a.Vb||(e=Number(NA(a,b,nA))||0);var f=NA(a,b,"startNumber");let g=HA(f||"");if(null==f||null==g)g=1;f=NA(a,b,"endNumber");f=null!==f?HA(f||""):null;var h=OA(a,b,gA),k=null;if(h){{k=d;var l=e,m=a.da.duration||Infinity;h=_.Bj(h,"S");const C=[];var n=0;for(let A=0;A<h.length;++A){var q=h[A],r=BA(q,"t",HA);const E=BA(q,"d",HA);var w=BA(q,"r",FA);null!=r&&(r-=l);if(!E){_.z('"S" element must have a duration:',mA,q);break}r=null!=r?r:n;w=w||0;if(0>w)if(A+1<h.length){w=BA(h[A+1],"t",
|
|
9
|
+
HA);if(null==w){_.z('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:',mA,q);break}else if(r>=w){_.z('An "S" element cannot have a negative repeat if its start ','time exceeds the next "S" element\'s start time:',mA,q);break}w=Math.ceil((w-r)/E)-1}else{if(Infinity==m){_.z(hA,"if the Period has an infinite duration:",lA,q);break}else if(r/k>=m){_.z(hA,"if its start time exceeds the Period's duration:",lA,q);break}w=Math.ceil((m*k-r)/E)-1}0<C.length&&
|
|
10
|
+
r!=n&&(Math.abs((r-n)/k)>=_.Co&&_.z("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",q),C[C.length-1].end=r/k);for(q=0;q<=w;++q)n=r+E,C.push({start:r/k,end:n/k,Ef:r}),r=n}k=C}}l=e/d||0;a=NA(a,b,"availabilityTimeOffset");b=Number(a||"");b=isNaN(b)?null:b;if(null==a||null==b)b=0;return{timescale:d,pa:c,ac:g,dd:f,Gb:l,Td:e,timeline:k,Xc:b}},NA=function(a,b,c){return[b(a.P),b(a.oa),b(a.sa)].filter(_.Ik).map(d=>d.getAttribute(c)).reduce((d,e)=>d||e)},OA=function(a,b,
|
|
11
|
+
c){return[b(a.P),b(a.oa),b(a.sa)].filter(_.Ik).map(d=>_.Cj(d,c)).reduce((d,e)=>d||e)},RA=function(a,b,c,d,e,f){const g=AA(a,kA,"href"),h=AA(a,kA,"actuate")||"onRequest";for(let l=0;l<a.attributes.length;l++){const m=a.attributes[l];m.namespaceURI==kA&&(a.removeAttributeNS(m.namespaceURI,m.localName),--l)}if(5<=f)return wA(new _.G(_.F,4,4028));if("onLoad"!=h)return wA(new _.G(_.F,4,4027));const k=_.Ft([d],[g]);d=_.Cg(k,b);d.type=1;return e.fetch(d).Ec(l=>{l=JA(l.data,a.tagName);if(!l)return wA(new _.G(_.F,
|
|
12
|
+
4,4001,{uri:g}));for(;a.childNodes.length;)a.removeChild(a.childNodes[0]);for(;l.childNodes.length;){var m=l.childNodes[0];l.removeChild(m);a.appendChild(m)}for(m=0;m<l.attributes.length;m++){const n=l.attributes[m].nodeName,q=l.getAttribute(n);a.setAttribute(n,q)}return QA(a,b,c,k[0],e,f+1)})},QA=function(a,b,c,d,e,f=0){if(AA(a,kA,"href")){var g=RA(a,b,c,d,e,f);c&&(g=g.Ec(void 0,()=>QA(a,b,c,d,e,f)));return g}g=[];for(let h=0;h<a.childNodes.length;h++){const k=a.childNodes[h];k instanceof Element&&
|
|
13
|
+
("urn:mpeg:dash:resolve-to-zero:2013"==AA(k,kA,"href")?(a.removeChild(k),--h):k.tagName!=gA&&g.push(QA(k,b,c,d,e,f)))}return xA(g).Ec(()=>a)},TA=function(a,b,c,d){let e;var f=(new _.$i).X("sidx",g=>{e=SA(b,d,c,g)});a&&f.parse(a);if(e)return e;{f=`${b}-${b+a.byteLength-1}`;const g=c[0];a=_.K(a);_.Ef('Invalid box type. Expected "sidx", but received:',a,"from:",g,"byte range:",f);throw new _.G(_.F,3,3004,{url:g,Pf:f,size:a.byteLength,cg:LA(a)});}},SA=function(a,b,c,d){const e=[];d.G.skip(4);const f=
|
|
14
|
+
_.M(d.G);if(0==f)throw _.Ef("Invalid timescale."),new _.G(_.F,3,3005);if(0==d.version){var g=_.M(d.G);var h=_.M(d.G)}else g=_.Mi(d.G),h=_.Mi(d.G);d.G.skip(2);const k=_.Ki(d.G);a=a+d.size+h;for(h=0;h<k;h++){var l=_.M(d.G);const m=(l&2147483648)>>>31;l&=2147483647;const n=_.M(d.G);d.G.skip(4);if(1==m)throw _.Ef("Hierarchical SIDXs are not supported."),new _.G(_.F,3,3006);e.push(new _.Yt(e.length,g/f-b,(g+n)/f-b,()=>c,a,a+l-1,b));g+=n;a+=l}d.Ma.stop();return e},UA=function(a){var b=_.Ji(a.a);let c;for(c=
|
|
15
|
+
1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new _.G(_.F,3,3002);const d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=_.Ji(a.a);return d},XA=function(a){var b=UA(a);if(7<b.length)throw new _.G(_.F,3,3002);var c=0;for(var d=0;d<b.length;d++)c=256*c+b[d];b=c;c=UA(a);a:{for(e of VA)if(_.ti(c,new Uint8Array(e))){var e=!0;break a}e=!1}if(e)c=a.f.byteLength-a.a.getPosition();else{if(8==c.length&&c[1]&224)throw new _.G(_.F,3,3001);e=c[0]&(1<<8-c.length)-1;for(d=1;d<c.length;d++)e=256*e+c[d];c=e}c=a.a.getPosition()+
|
|
16
|
+
c<=a.f.byteLength?c:a.f.byteLength-a.a.getPosition();e=new DataView(a.f.buffer,a.f.byteOffset+a.a.getPosition(),c);a.a.skip(c);return new WA(b,e)},YA=function(a){if(8<a.a.byteLength)throw new _.G(_.F,3,3002);if(8==a.a.byteLength&&a.a.getUint8(0)&224)throw new _.G(_.F,3,3001);let b=0;for(let c=0;c<a.a.byteLength;c++){const d=a.a.getUint8(c);b=256*b+d}return b},aB=function(a,b,c,d,e,f){const g=[],h=()=>e;a=new ZA(a.a);let k=null,l=null;for(;_.Hi(a.a);){var m=XA(a);if(187==m.id){var n=$A(m);n&&(m=c*
|
|
17
|
+
n.Ff,n=b+n.uf,null!=k&&g.push(new _.Yt(g.length,k-f,m-f,h,l,n-1,f)),k=m,l=n)}}null!=k&&g.push(new _.Yt(g.length,k-f,d-f,h,l,null,f));return g},$A=function(a){var b=new ZA(a.a);a=XA(b);if(179!=a.id)throw _.z("Not a CueTime element."),new _.G(_.F,3,3013);a=YA(a);b=XA(b);if(183!=b.id)throw _.z("Not a CueTrackPositions element."),new _.G(_.F,3,3012);b=new ZA(b.a);let c=0;for(;_.Hi(b.a);){const d=XA(b);if(241==d.id){c=YA(d);break}}return{Ff:a,uf:c}},bB=function(a,b){b=OA(a,b,"Initialization");if(!b)return null;
|
|
18
|
+
let c=a.P.Ia;var d=b.getAttribute("sourceURL");d&&(c=_.Ft(a.P.Ia,[d]));a=0;d=null;if(b=BA(b,"range",EA))a=b.start,d=b.end;return new _.ny(()=>c,a,d)},eB=function(a,b){var c=Number(NA(a,cB,nA))||0,d=NA(a,cB,qA),e=1;d&&(e=GA(d)||1);d=c/e||0;c=bB(a,cB);{e=a.P.mimeType.split("/")[1];if(a.P.contentType!=_.t&&e!=_.rd&&"webm"!=e)throw _.Ef("SegmentBase specifies an unsupported container type.",a.P),new _.G(_.F,4,4006);if("webm"==e&&!c)throw _.Ef(dA,"the SegmentBase uses a WebM container,","but does not contain an Initialization element.",
|
|
19
|
+
a.P),new _.G(_.F,4,4005);const g=OA(a,cB,"RepresentationIndex");var f=NA(a,cB,"indexRange");let h=a.P.Ia;f=EA(f||"");if(g){const k=g.getAttribute("sourceURL");k&&(h=_.Ft(a.P.Ia,[k]));f=BA(g,"range",EA,f)}if(!f)throw _.Ef(dA,"the SegmentBase does not contain @indexRange","or a RepresentationIndex element.",a.P),new _.G(_.F,4,4002);a=dB(a,b,c,h,f.start,f.end,e,d)}return{createSegmentIndex:a.createSegmentIndex,findSegmentPosition:a.findSegmentPosition,getSegmentReference:a.getSegmentReference,adjustSegmentDurations:a.adjustSegmentDurations,
|
|
20
|
+
getDuration:a.getDuration,initSegmentReference:c}},cB=function(a){return a.Bc},dB=function(a,b,c,d,e,f,g,h){const k=a.presentationTimeline,l=!a.ic||!a.da.od,m=a.da.start,n=a.da.duration;let q=b,r=null;return{createSegmentIndex:function(){return _.v(function*(){var w=[q(d,e,f),"webm"==g?q(c.La(),c.Fa,c.wa):null];q=null;w=yield Promise.all(w);var C=w[0];const A=w[1]||null;C=g==_.rd?TA(C,e,d,h):(new fB).parse(C,A,d,h);_.Rt(k,C,m);r=new _.py(C);l&&_.au(r,n);return w})},findSegmentPosition:function(w){return r.h(w)},
|
|
21
|
+
getSegmentReference:function(w){return r.get(w)},adjustSegmentDurations:function(w,C){return r.f(w,C)},getDuration:function(){return r.getDuration()}}},kB=function(a,b,c,d){const e=gB(a);{var f=PA(a,hB);var g=NA(a,hB,"media");const h=NA(a,hB,"index");f={pa:f.pa,timescale:f.timescale,ac:f.ac,dd:f.dd,Gb:f.Gb,Td:f.Td,timeline:f.timeline,ud:g,vc:h,Xc:f.Xc}}g=f.vc?1:0;g+=f.timeline?1:0;g+=f.pa?1:0;if(0==g)throw _.Ef("SegmentTemplate does not contain any segment information:","the SegmentTemplate must contain either an index URL template",
|
|
22
|
+
"a SegmentTimeline, or a segment duration.",a.P),new _.G(_.F,4,4002);1!=g&&(_.z("SegmentTemplate contains multiple segment information sources:","the SegmentTemplate should only contain an index URL template,","a SegmentTimeline or a segment duration.",a.P),f.vc?(_.Cf("Using the index URL template by default."),f.timeline=null):_.Cf("Using the SegmentTimeline by default."),f.pa=null);if(!f.vc&&!f.ud)throw _.Ef(fA,"the SegmentTemplate's media URL template is missing.",a.P),new _.G(_.F,4,4002);if(f.vc){c=
|
|
23
|
+
a.P.mimeType.split("/")[1];if(c!=_.rd&&"webm"!=c)throw _.Ef("SegmentTemplate specifies an unsupported container type.",a.P),new _.G(_.F,4,4006);if("webm"==c&&!e)throw _.Ef(fA,"the SegmentTemplate uses a WebM container,","but does not contain an initialization URL template.",a.P),new _.G(_.F,4,4005);d=MA(f.vc,a.P.id,null,a.bandwidth||null,null);d=_.Ft(a.P.Ia,[d]);a=dB(a,b,e,d,0,null,c,f.Gb)}else f.pa?(d||(c=a.presentationTimeline,c.o=Math.max(c.o,f.Xc),c.A.debug("notifyAvailabilityTimeOffset: maxAvailabilityTimeOffset\x3d"+
|
|
24
|
+
c.o),_.St(a.presentationTimeline,f.pa),_.Qt(a.presentationTimeline,a.da.start)),a=iB(a,f)):(d=b=null,a.sa.id&&a.P.id&&(d=a.sa.id+","+a.P.id,b=c[d]),g=jB(a,f),f=!a.ic||!a.da.od,b?(f&&_.au(new _.py(g),a.da.duration),_.Zt(b,g),c=_.Ut(a.presentationTimeline),_.$t(b,c-a.da.start)):(_.Rt(a.presentationTimeline,g,a.da.start),b=new _.py(g),d&&a.ic&&(c[d]=b)),f&&_.au(b,a.da.duration),a={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.h.bind(b),getSegmentReference:b.get.bind(b),adjustSegmentDurations:b.f.bind(b),
|
|
25
|
+
getDuration:b.getDuration.bind(b)});return{createSegmentIndex:a.createSegmentIndex,findSegmentPosition:a.findSegmentPosition,getSegmentReference:a.getSegmentReference,adjustSegmentDurations:a.adjustSegmentDurations,getDuration:a.getDuration,initSegmentReference:e}},gB=function(a){const b=NA(a,hB,"initialization");if(!b)return null;const c=a.P.id,d=a.bandwidth||null,e=a.P.Ia;return new _.ny(function(){const f=MA(b,c,null,d,null);return _.Ft(e,[f])},0,null)},iB=function(a,b){const c=a.da.duration,d=
|
|
26
|
+
b.pa,e=b.ac,f=b.dd,g=b.timescale,h=b.ud,k=a.bandwidth||null,l=a.P.id,m=a.P.Ia;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(n){return 0>n||c&&n>=c?null:Math.floor(n/d)},getSegmentReference:function(n){const q=n+e;if(null!==f&&q>f)return null;const r=n*d;let w=r+d;c&&(w=Math.min(w,c));return 0>w||c&&r>=c?null:new _.Yt(n,r,w,function(){const C=MA(h,l,q,k,r*g);return _.Ft(m,[C])},0,null,b.Gb)},adjustSegmentDurations:function(){},getDuration:function(){return c}}},
|
|
27
|
+
jB=function(a,b){const c=[];for(let d=0;d<b.timeline.length;d++){const e=d+b.ac;c.push(new _.Yt(e,b.timeline[d].start,b.timeline[d].end,function(f,g,h,k,l,m){f=MA(f,g,l,h,m);return _.Ft(k,[f]).map(n=>n.toString())}.bind(null,b.ud,a.P.id,a.bandwidth||null,a.P.Ia,e,b.timeline[d].Ef+b.Td),0,null,b.Gb))}return c},hB=function(a){return a.Zb},oB=function(a,b){const c=bB(a,lB);{var d=mB(a),e=PA(a,lB);var f=e.ac;0==f&&(_.z("SegmentList@startNumber must be \x3e 0"),f=1);let g=0;e.pa?g=e.pa*(f-1):e.timeline&&
|
|
28
|
+
0<e.timeline.length&&(g=e.timeline[0].start);f={pa:e.pa,startTime:g,ac:f,Gb:e.Gb,timeline:e.timeline,Wb:d}}if(!f.pa&&!f.timeline&&1<f.Wb.length)throw _.z(eA,"the SegmentList specifies multiple segments,","but does not specify a segment duration or timeline.",a.P),new _.G(_.F,4,4002);if(!f.pa&&!a.da.duration&&!f.timeline&&1==f.Wb.length)throw _.z(eA,"the SegmentList specifies one segment,","but does not specify a segment duration, period duration,","or timeline.",a.P),new _.G(_.F,4,4002);if(f.timeline&&
|
|
29
|
+
0==f.timeline.length)throw _.z(eA,"the SegmentList has an empty timeline.",a.P),new _.G(_.F,4,4002);e=d=null;a.sa.id&&a.P.id&&(e=a.sa.id+","+a.P.id,d=b[e]);f=nB(a.da.duration,f.ac,a.P.Ia,f);d?(_.Zt(d,f),b=_.Ut(a.presentationTimeline),_.$t(d,b-a.da.start)):(_.Rt(a.presentationTimeline,f,a.da.start),d=new _.py(f),e&&a.ic&&(b[e]=d));a.ic&&a.da.od||_.au(d,a.da.duration);return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:d.h.bind(d),getSegmentReference:d.get.bind(d),adjustSegmentDurations:d.f.bind(d),
|
|
30
|
+
getDuration:d.getDuration.bind(d),initSegmentReference:c}},lB=function(a){return a.Hb},nB=function(a,b,c,d){let e=d.Wb.length;d.timeline&&d.timeline.length!=d.Wb.length&&(e=Math.min(d.timeline.length,d.Wb.length),_.z("The number of items in the segment timeline and the number of","segment URLs do not match, truncating",d.Wb.length,"to",e));const f=[];var g=d.startTime;for(let h=0;h<e;h++){const k=d.Wb[h],l=_.Ft(c,[k.mf]);let m;m=null!=d.pa?g+d.pa:d.timeline?d.timeline[h].end:g+a;f.push(new _.Yt(h+
|
|
31
|
+
b,g,m,()=>l,k.start,k.end,d.Gb));g=m}return f},mB=function(a){return[a.P.Hb,a.oa.Hb,a.sa.Hb].filter(_.Ik).map(b=>_.Bj(b,"SegmentURL")).reduce((b,c)=>0<b.length?b:c).map(b=>{b.getAttribute("indexRange")&&!a.nd&&(a.nd=!0,_.z("We do not support the SegmentURL@indexRange attribute on SegmentList. We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate."));const c=b.getAttribute("media");b=BA(b,"mediaRange",EA,{start:0,end:null});return{mf:c,start:b.start,end:b.end}})},
|
|
32
|
+
qB=function(a,b,c){c=c.map(e=>({scheme:e.getAttribute(oA),value:e.getAttribute(_.Ce)}));const d=a.f.clockSyncUri;!c.length&&d&&(a.a.info("No UTCTiming elements found, falling back on clockSyncUri from config to synchronize clocks."),c.push({scheme:tA,value:d}));return 0===c.length?(a.a.warn(cA),Promise.reject(Error(cA))):KA(c,e=>{const f=e.scheme;e=e.value;switch(f){case tA:case "urn:mpeg:dash:utc:http-head:2012":return pB(a,b,e,"HEAD");case "urn:mpeg:dash:utc:http-xsdate:2014":case "urn:mpeg:dash:utc:http-iso:2014":case "urn:mpeg:dash:utc:http-xsdate:2012":case "urn:mpeg:dash:utc:http-iso:2012":return pB(a,
|
|
33
|
+
b,e,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":{const g=Date.parse(e);return isNaN(g)?(a.a.warn(`Invalid date for scheme ${f}, `+`value: ${e}`),Promise.reject()):Promise.resolve(g-Date.now())}case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":return a.a.warn("NTP UTCTiming scheme is not supported"),Promise.reject();default:return a.a.warn("Unrecognized scheme in UTCTiming element",f),Promise.reject()}}).catch(()=>
|
|
34
|
+
{a.a.warn(aA);return Promise.reject(Error(aA))})},rB=function(a,b,c,d){return _.v(function*(){const e=_.Bj(b,"UTCTiming");try{const f=yield qB(a,c,e);d.w=f;a.a.info("Clock synchronized. The difference between server and "+`client clock was ${f} ms.`)}catch(f){a.a.warn("Failed to synchronize clocks. This content may not play on clients with bad clocks!")}return d})},pB=function(a,b,c,d){return _.v(function*(){var e=_.Ft(b,[c]);e=yield a.g(e,d);if("HEAD"==d){if(!e.headers||!e.headers.date)throw a.a.warn("UTC timing response is missing",
|
|
35
|
+
"expected date header"),Error("Date HTTP header missing.");e=e.headers.date}else e=_.mg(e.data);e=Date.parse(e);if(isNaN(e))throw a.a.warn("Unable to parse date from UTC timing response"),Error("Date value invalid.");return e-Date.now()})},tB=function(a,b){return a.find(c=>sB.get(c.sb)===b)},uB=function(a){const b=zA(a.node,rA,"pro");if(!b)return _.z(bA,a),null;a=_.qi(b.textContent);a=_.Nj(a);a=_.Hj(a.a);return{keyId:null,sb:vA,node:document.createElement("null"),init:[{initData:_.nt(a),initDataType:_.nc,
|
|
36
|
+
keyId:null}]}},vB=function(a,b){b=void 0===b?"4.0.0.0":b;const c=zA(a.node,sA,"pssh");if(!c)return _.z("Missing \x3ccenc:pssh/\x3e node in ContentProtection element",a),null;a=_.qi(c.textContent);a=_.Jj(a);if(!a)return _.z("Unable to parse WV PSSH data. Can not create PR data!"),null;b=_.ot(b,a.a);return{keyId:null,sb:uA,node:document.createElement("null"),init:[{initData:_.nt(b),initDataType:_.nc,keyId:null}]}},wB=function(a,b){const c=zA(a.node,rA,"pro");if(!c)return _.z(bA,a),null;a=_.qi(c.textContent);
|
|
37
|
+
a=_.Nj(a);return a.version!==b&&(_.Df(`Parsing from ${a.version} to ${b}.`),a=_.pt(a,b))?{keyId:null,sb:uA,node:document.createElement("null"),init:[{initData:_.nt(a),initDataType:_.nc,keyId:null}]}:null},zB=function(a,b,c,d){const e=xB(a);let f=null;a=[];let g=[];const h=tB(e,_.Dc),k=tB(e,_.Cc);if(k&&d){var l=wB(k,d);l&&(e[e.indexOf(k)]=l)}k&&!h&&(l=uB(k))&&e.push(l);h&&!k&&(d=vB(h,d||void 0))&&e.push(d);d=new Set(e.map(m=>m.keyId));d.delete(null);if(1<d.size)throw new _.G(_.F,4,4010);b||(g=e.filter(m=>
|
|
38
|
+
"urn:mpeg:dash:mp4protection:2011"==m.sb?(f=m.init||f,!1):!0),g.length&&(a=yB(f,g,c),0==a.length&&(a=[_.Gt(_.vd,f,c)])));if(e.length&&(b||!g.length)){a=[];for(const m of sB.values())m!=_.Fd&&a.push(_.Gt(m,f,c))}if(b=Array.from(d)[0]||null)for(const m of a)for(const n of m.initData)n.keyId=b;return{ce:b,Tf:f,drmInfos:a,fe:!0}},xB=function(a){const b=[];for(const c of a)(a=AB(c))&&b.push(a);return b},yB=function(a,b,c){const d=[];for(const f of b){var e=sB.get(f.sb);if(e){b=_.Gt(e,f.init||a,c);if(e=
|
|
39
|
+
BB.get(e))b.licenseServerUri=e(f);d.push(b)}}return d},CB=function(a,b,c,d,e){const f=zB(a,c,d,e);if(b.fe){a=1==b.drmInfos.length&&!b.drmInfos[0].keySystem;c=0==f.drmInfos.length;if(0==b.drmInfos.length||a&&!c)b.drmInfos=f.drmInfos;b.fe=!1}else if(0<f.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(g=>f.drmInfos.some(h=>h.keySystem==g.keySystem)),0==b.drmInfos.length))throw new _.G(_.F,4,4008);return f.ce||b.ce},AB=function(a){let b=a.getAttribute(oA),c=AA(a,sA,"default_KID");const d=yA(a,sA,"pssh").map(_.Dj);
|
|
40
|
+
if(!b)return _.Ef("Missing required schemeIdUri attribute on","ContentProtection element",a),null;b=b.toLowerCase();if(c&&(c=c.replace(/-/g,"").toLowerCase(),c.includes(" ")))throw new _.G(_.F,4,4009);let e=[];try{e=d.map(f=>({initDataType:_.nc,initData:_.qi(f),keyId:null}))}catch(f){throw new _.G(_.F,4,4007);}return{node:a,sb:b,keyId:c,init:0<e.length?e:null}},DB=function(a,b){return _.fu(_.Og(a,b))?_.t:a.split("/")[0]},GB=function(a){_.v(function*(){a.g.debug(_.Zs);let b=0;try{b=yield EB(a)}catch(c){if(a.a&&
|
|
41
|
+
c.a&&(a.a.onError(c),c.severity===_.F))return}a.a&&FB(a,b)})},EB=function(a){return _.v(function*(){var b=_.Cg(a.j,a.f.attemptParameters);b.type=1;var c=Date.now();b=a.a.networkingEngine.fetch(b);_.ih(a.m,b);b=yield b.O;if(!a.a)return 0;b.uri&&!a.j.includes(b.uri)&&a.j.unshift(b.uri);yield HB(a,b.data,b.uri);c=(Date.now()-c)/1E3;_.Nt(a.F,1,c);return c})},FB=function(a,b){0>a.A||a.w.$(Math.max(3,a.A-b,_.Ot(a.F)))},HB=function(a,b,c){return _.v(function*(){var d=JA(b,"MPD");if(!d)throw new _.G(_.F,
|
|
42
|
+
4,4001,c);d=QA(d,a.f.attemptParameters,a.f.xlinkFailGracefully,c,a.a.networkingEngine);_.ih(a.m,d);d=yield d.O;return IB(a,d,c)})},IB=function(a,b,c){return _.v(function*(){var d=[c],e=_.Bj(b,"Location").map(_.Dj).filter(_.Ik);0<e.length&&(d=_.Ft(d,e),a.j=d);e=_.Bj(b,"BaseURL").map(_.Dj);var f=_.Ft(d,e);d=BA(b,"minBufferTime",DA,0);a.A=BA(b,"minimumUpdatePeriod",DA,-1);var g=BA(b,"availabilityStartTime",CA);e=BA(b,"timeShiftBufferDepth",DA);var h=BA(b,"suggestedPresentationDelay",DA);const k=BA(b,
|
|
43
|
+
"maxSegmentDuration",DA);let l=b.getAttribute("type")||pA;"dynamic"===l&&(a.B=l,a.I=g);const m=l===pA&&"dynamic"===a.B;m&&(a.g.info("MPD dynamic to static transition."),l=a.B,g=a.I);if(a.h)g=a.h.presentationTimeline;else if(g=new _.oy(g,null!=h?h:3*d,!!a.f.autoCorrectDrift),"dynamic"===l&&(g=yield rB(a.H,b,f,g),!a.a))return;{h={ic:l!=pA,Vb:m,presentationTimeline:g,sa:null,da:null,oa:null,P:null,bandwidth:0,nd:!1};var n=BA(b,"mediaPresentationDuration",DA);const A=[];var q=0;const E=_.Bj(b,"Period");
|
|
44
|
+
for(let D=0;D<E.length;D++){var r=E[D];q=BA(r,_.fe,DA,q);var w=BA(r,jA,DA);let na=null;if(D!=E.length-1){var C=BA(E[D+1],_.fe,DA);null!=C&&(na=C-q)}else null!=n&&(na=n-q);C=_.Co;na&&w&&Math.abs(na-w)>C&&a.g.warn("There is a gap/overlap between Periods",r);null==na&&(na=w);r=JB(a,h,f,{start:q,duration:na,node:r,od:null==na||D==E.length-1});A.push(r);w=h.sa.id;a.C.includes(w)||(a.C.push(w),a.h&&(a.a.filterNewPeriod(r),a.h.periods.push(r)));if(null==na){D!=E.length-1&&a.g.warn("Skipping Period",D+1,
|
|
45
|
+
"and any subsequent Periods:","Period",D+1,"does not have a valid start time.",A[D+1]);q=null;break}q+=na}null==a.h&&a.a.filterAllPeriods(A);null!=n?(q!=n&&a.g.warn("@mediaPresentationDuration does not match the total duration of ","all Periods."),f={periods:A,duration:n,de:!1}):f={periods:A,duration:q,de:!0}}h=f.duration;n=f.periods;g.f=l==pA;if(m&&!g.Vb())a.a.onEvent(new _.B(_.sd));g.B=m;l!=pA&&(m||f.de)||g.Ib(h||Infinity);g.isLive()&&a.f.availabilityWindowOverride&&!isNaN(a.f.availabilityWindowOverride)&&
|
|
46
|
+
(e=a.f.availabilityWindowOverride);null==e&&(e=Infinity);g.Yb=e;_.St(g,k||1);g.isLive();a.h||(a.h={presentationTimeline:g,periods:n,offlineSessionIds:[],minBufferTime:d||0})})},JB=function(a,b,c,d){b.sa=KB(a,d.node,null,c);b.da=d;b.sa.id||(a.g.info("No Period ID given for Period with start time "+d.start+", Assigning a default"),b.sa.id="__clpp_period_"+d.start);c=_.Bj(d.node,"EventStream");for(var e of c)LB(a,d.start,d.duration,e);e=_.Bj(d.node,_.ea).map(r=>MB(a,b,r)).filter(_.Ik);if(b.ic){c=[];
|
|
47
|
+
for(var f of e)for(var g of f.xf)c.push(g);if(c.length!=(new Set(c)).size)throw new _.G(_.F,4,4018);}f=e.filter(r=>!r.Sd);g=e.filter(r=>r.Sd);for(var h of g){g=h.streams[0];e=h.Sd;for(var k of f)if(k.id==e)for(var l of k.streams)l.trickModeVideo=g}k=NB(f,_.u);l=NB(f,_.Vb);if(!k.length&&!l.length)throw new _.G(_.F,4,4004);l.length||(l=[null]);k.length||(k=[null]);h=[];for(var m of l)for(var n of k)OB(a,m,n,h);n=[...NB(f,_.t),...NB(f,_.it)];m=[];for(var q of n)m.push.apply(m,q.streams);q=NB(f,_.$c);
|
|
48
|
+
n=[];for(const r of q)n.push.apply(n,r.streams);return{startTime:d.start,textStreams:m,thumbStreams:n,variants:h}},KB=function(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,xd:null};d=d||c.Ia;const e=_.Bj(b,"BaseURL").map(_.Dj);let f=b.getAttribute("contentType")||c.contentType;const g=b.getAttribute(_.od)||c.mimeType,h=b.getAttribute(_.yc)||c.codecs,k=BA(b,"frameRate",IA)||c.frameRate;var l=_.Bj(b,"InbandEventStream");var m=c.emsgSchemeIdUris.slice();for(var n of l)l=
|
|
49
|
+
n.getAttribute(oA),m.includes(l)||m.push(l);n=_.Bj(b,"AudioChannelConfiguration");a=PB(a,n)||c.xd;f||(f=DB(g,h));return{Ia:_.Ft(d,e),Bc:_.Cj(b,"SegmentBase")||c.Bc,Hb:_.Cj(b,"SegmentList")||c.Hb,Zb:_.Cj(b,"SegmentTemplate")||c.Zb,width:BA(b,_.Te,HA)||c.width,height:BA(b,_.Yc,HA)||c.height,contentType:f,mimeType:g,codecs:h,frameRate:k,emsgSchemeIdUris:m,id:b.getAttribute("id"),xd:a}},LB=function(a,b,c,d){const e=d.getAttribute(oA)||"",f=d.getAttribute(_.Ce)||"",g=BA(d,qA,HA)||1;for(const k of _.Bj(d,
|
|
50
|
+
"Event")){d=BA(k,"presentationTime",HA)||0;var h=BA(k,jA,HA)||0;d=d/g+b;h=d+h/g;null!=c&&(d=Math.min(d,b+c),h=Math.min(h,b+c));let l=_.Lf;e.startsWith(_.we)?l=_.Nf:"urn:mpeg:dash:event:callback:2015"===e&&(l=_.td);const m={schemeIdUri:e,value:f,startTime:d,endTime:h,id:k.getAttribute("id")||"",type:l,eventElement:k};m.type===_.td&&(m.Qc=()=>{if(m.eventElement){var n=m.eventElement.getAttribute("messageData")||"";n&&n.startsWith("http")&&(n=_.Cg(n),n.type=_.Bg,a.a.networkingEngine.fetch(n))}});a.a.onTimelineCueAdded(m)}},
|
|
51
|
+
MB=function(a,b,c){b.oa=KB(a,c,b.sa,null);let d=!1;var e=_.Bj(c,"Role");const f=e.map(D=>D.getAttribute(_.Ce)).filter(_.Ik);let g=null;var h=_.Bj(c,"Label").map(D=>D.textContent).filter(_.Ik);h&&0<h.length&&(g=h[h.length-1]);let k=void 0;(h=b.oa.contentType==_.t)&&(k=_.it);for(var l of e)if(e=l.getAttribute(oA),null==e||"urn:mpeg:dash:role:2011"===e||"urn:mpeg:dash:role"===e)switch(e=l.getAttribute(_.Ce),e){case "main":d=!0;break;case "caption":case _.it:k=e}var m=_.Bj(c,$z);l=null;e=!1;for(var n of m)"http://dashif.org/guidelines/trickmode"==
|
|
52
|
+
n.getAttribute(oA)?l=n.getAttribute(_.Ce):e=!0;n=_.Bj(c,"Accessibility");const q=new Map;for(var r of n)if(n=r.getAttribute(oA),"urn:scte:dash:cc:cea-608:2015"==n||"urn:scte:dash:cc:cea-708:2015"==n)if(n=1,m=r.getAttribute(_.Ce),null!=m)for(const D of m.split(";")){if(D.includes("\x3d")){var w=D.split("\x3d");m=w[0].startsWith("CC")?w[0]:"CC"+w[0];w=w[1].split(",")[0].split(":").pop()}else m="CC"+n,n+=2,w=D;q.set(m,_.Mg(w))}else q.set("CC1",_.ue);if(e)return null;r=_.Bj(c,Zz);const C=zB(r,a.f.ignoreDrmInfo,
|
|
53
|
+
b.sa.id,a.f.playreadyVersion||null),A=_.Mg(c.getAttribute("lang")||_.ue);null==g&&(g=c.getAttribute("label"));r=_.Bj(c,_.Xa);c=r.map(D=>QB(a,b,C,k,A,g,d,f,q,D)).filter(D=>!!D);if(0==c.length){if(h)return null;throw new _.G(_.F,4,4003);}if(!b.oa.contentType||b.oa.contentType==iA){b.oa.contentType=DB(c[0].mimeType,c[0].codecs);for(var E of c)E.type=b.oa.contentType}for(const D of c)for(const na of C.drmInfos)D.keyId&&na.keyIds.push(D.keyId);E=r.map(D=>D.getAttribute("id")).filter(_.Ik);return{id:b.oa.id||
|
|
54
|
+
"__fake__"+a.o++,contentType:b.oa.contentType,language:A,td:d,streams:c,drmInfos:C.drmInfos,Sd:l,xf:E}},NB=function(a,b){return a.filter(c=>c.contentType==b)},OB=function(a,b,c,d){if(b||c)if(b&&c){var e=b.drmInfos;var f=c.drmInfos;if(e.length&&f.length?0<_.Ct(e,f).length:1){f=_.Ct(b.drmInfos,c.drmInfos);for(var g of b.streams)for(const h of c.streams)e=(h.bandwidth||0)+(g.bandwidth||0),e={id:a.o++,language:b.language,primary:b.td||c.td,audio:g,video:h,bandwidth:e,drmInfos:f,allowedByApplication:!0,
|
|
55
|
+
allowedByKeySystem:!0},d.push(e)}}else{g=b||c;for(f of g.streams)e=f.bandwidth||0,e={id:a.o++,language:g.language||_.ue,primary:g.td,audio:b?f:null,video:c?f:null,bandwidth:e,drmInfos:g.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},d.push(e)}},QB=function(a,b,c,d,e,f,g,h,k,l){b.P=KB(a,l,b.oa,null);if(!RB(a,b.P))return a.g.warn("Skipping Representation",b.P),null;b.bandwidth=BA(l,"bandwidth",GA)||0;let m;var n=b.P.contentType,q=n==_.t||n==iA,r=n==_.$c;try{if(n=(w,C,A)=>SB(a,w,C,A),b.P.Bc)m=
|
|
56
|
+
eB(b,n);else if(b.P.Hb)m=oB(b,a.D);else if(b.P.Zb)m=kB(b,n,a.D,!!a.h);else{const w=b.P.Ia,C=b.da.duration||0;m={createSegmentIndex:()=>Promise.resolve(),findSegmentPosition:A=>0<=A&&A<C?1:null,getSegmentReference:A=>1!=A?null:new _.Yt(1,0,C,()=>w,0,null,0),adjustSegmentDurations:()=>{},getDuration:()=>C,initSegmentReference:null}}}catch(w){if(q&&4002==w.code)return null;throw w;}q=_.Bj(l,Zz);q=CB(q,c,a.f.ignoreDrmInfo,b.sa.id,a.f.playreadyVersion||null);n=void 0;r&&(r=(r=(l=_.Cj(l,$z))&&l.getAttribute(oA))||
|
|
57
|
+
"",TB.includes(r)&&(l=(l=l.getAttribute(_.Ce))&&l.split("x").map(w=>parseInt(w,10)))&&2==l.length&&(m.horizontalTiles=l[0],m.verticalTiles=l[1],b.oa.Zb&&(l=m.horizontalTiles*m.verticalTiles,n=(n=BA(b.oa.Zb,jA,HA)||0)?n/l:void 0)));return{id:a.o++,originalId:b.P.id,createSegmentIndex:m.createSegmentIndex,findSegmentPosition:m.findSegmentPosition,getSegmentReference:m.getSegmentReference,initSegmentReference:m.initSegmentReference,adjustSegmentDurations:m.adjustSegmentDurations,getDuration:m.getDuration,
|
|
58
|
+
mimeType:b.P.mimeType,codecs:b.P.codecs,frameRate:b.P.frameRate,bandwidth:b.bandwidth,width:b.P.width,height:b.P.height,kind:d,encrypted:0<c.drmInfos.length,keyId:q,language:e,label:f,type:b.oa.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.P.emsgSchemeIdUris,roles:h,channelsCount:b.P.xd,closedCaptions:k,horizontalTiles:m.horizontalTiles,verticalTiles:m.verticalTiles,durationPerTile:n}},RB=function(a,b){let c;c=b.Bc?1:0;c+=b.Hb?1:0;c+=b.Zb?1:0;if(0==c){if(b.contentType==_.t||b.contentType==
|
|
59
|
+
iA)return!0;a.g.warn("Representation does not contain a segment information source:","the Representation must contain one of SegmentBase, SegmentList,",'SegmentTemplate, or explicitly indicate that it is "text".',b);return!1}1!=c&&(a.g.warn("Representation contains multiple segment information sources:","the Representation should only contain one of SegmentBase,","SegmentList, or SegmentTemplate.",b),b.Bc?(a.g.info("Using SegmentBase by default."),b.Hb=null):a.g.info("Using SegmentList by default."),
|
|
60
|
+
b.Zb=null);return!0},SB=function(a,b,c,d){return _.v(function*(){var e=_.Pt(b,c,d,a.f.attemptParameters);e.type=2;e=a.a.networkingEngine.fetch(e);_.ih(a.m,e);return(yield e.O).data})},PB=function(a,b){for(const d of b){b=d.getAttribute(oA);if(!b)continue;const e=d.getAttribute(_.Ce);if(e)switch(b){case "urn:mpeg:dash:outputChannelPositionList:2012":return e.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":var c=
|
|
61
|
+
parseInt(e,10);if(!c){a.g.warn(Yz,b,e);continue}return c;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":c=parseInt(e,16);if(!c){a.g.warn(Yz,b,e);continue}for(a=0;c;)c&1&&++a,c>>=1;return a;default:a.g.warn("Unrecognized audio channel scheme:",b,e)}}return null},TB=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];var ZA=class{constructor(a){this.f=a;this.a=new _.Ij(a,!1)}},VA=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]],WA=class{constructor(a,b){this.id=a;this.a=b}};var fB=class{parse(a,b,c,d){var e;b=new ZA(new DataView(b));if(440786851!=XA(b).id)throw _.Ef("Not an EBML element."),new _.G(_.F,3,3008);var f=XA(b);if(408125543!=f.id)throw _.Ef("Not a Segment element."),new _.G(_.F,3,3009);b=f.a.byteOffset;f=new ZA(f.a);for(e=null;_.Hi(f.a);){var g=XA(f);if(357149030==g.id){e=g;break}}if(!e)throw _.Ef("Not an Info element."),new _.G(_.F,3,3010);e=new ZA(e.a);g=1E6;for(f=null;_.Hi(e.a);){const h=XA(e);if(2807729==h.id)g=YA(h);else if(17545==h.id)if(f=h,4==f.a.byteLength)f=
|
|
62
|
+
f.a.getFloat32(0);else if(8==f.a.byteLength)f=f.a.getFloat64(0);else throw new _.G(_.F,3,3003);}if(null==f)throw new _.G(_.F,3,3011);e=g/=1E9;f*=g;a=XA(new ZA(new DataView(a)));if(475249515!=a.id)throw _.Ef("Not a Cues element."),new _.G(_.F,3,3007);return aB(a,b,e,f,c,d)}};var UB=class{constructor(a,b){this.a=a;this.g=b;this.f={clockSyncUri:void 0}}};var sB=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",_.Fd).set(vA,_.Dc).set(uA,_.Cc).set("urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95",_.Cc).set("urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2",_.Bc).set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb",_.Ac),BB=(new Map).set(_.Dc,function(a){return(a=zA(a.node,"urn:microsoft","laurl"))?a.getAttribute("licenseUrl")||"":""}).set(_.Cc,function(a){a=zA(a.node,rA,"pro");if(!a)return"";a=_.qi(a.textContent);return _.Nj(a).g||""});var VB=class{constructor(){this.a=this.f=null;this.j=[];this.h=null;this.C=[];this.o=1;this.D={};this.A=0;this.F=new _.my(5);this.w=new _.zh(()=>{GB(this)});this.m=new _.bo;this.g=new _.O("clpp.dash.DashParser");this.B=null;this.H=new UB(this.g,(a,b)=>{a=_.Cg(a,this.f.attemptParameters);a.type=5;a.method=b;b=this.a.networkingEngine.fetch(a);_.ih(this.m,b);return b.O});this.I=null}configure(a){this.f=a;this.H.f={clockSyncUri:a.clockSyncUri}}start(a,b){const c=this;return _.v(function*(){c.j=[a];c.a=
|
|
63
|
+
b;const d=yield EB(c);c.a&&FB(c,d);if(!c.a)throw new _.G(_.F,7,7001);return c.h})}stop(){this.f=this.a=null;this.j=[];this.h=null;this.C=[];this.D={};null!=this.w&&(this.w.stop(),this.w=null);return this.m.destroy()}update(){EB(this).catch(a=>{if(this.a&&a)this.a.onError(a)})}onExpirationUpdated(){}};_.x("clpp.dash.DashComponent",class extends _.So{constructor(){super()}f(){_.Vm.mpd=VB;_.Tm[_.Nb]=VB}a(){_.du("mpd");_.eu(_.Nb)}g(){}release(){}id(){return"dash"}});};f.call(g, window);
|