@castlabs/prestoplay 6.25.2 → 6.26.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 +15 -0
- package/README.md +5 -5
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +112 -112
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +601 -600
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +89 -88
- package/cjs/cl.externs.js +37 -31
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +341 -334
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +17 -17
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +38 -36
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +489 -488
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -82
- package/cl.externs.js +37 -31
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +79 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +3 -3
- package/cl.mse.js +299 -292
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- 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.yospace.js +3 -3
- package/cl.youbora.js +28 -27
- package/package.json +3 -3
- package/typings.d.ts +41 -3
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
|
-
g),b.onError(new _.I(1,7,7104,null,g)),c}try{const g=a.l?new
|
|
3
|
-
1001===g.code&&412===g.data.status&&a.g.warn("Wrong DRMtoday credentials, server responded with 412."),g;}})},
|
|
4
|
-
this.C;const e=a[0],f=a[1],g=a[2];a=a[3];var b=this.l;const h=b[0],k=b[1],l=b[2];b=b[3];const m=new Uint32Array(256);let n=0,
|
|
5
|
-
|
|
6
|
-
255],l^=d[e/this.a|0]<<24):6<this.a&&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.h;a++)e=this.h-a,l=a&3?this.f[e]:this.f[e-4],this.j[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.j[a]>>>=0;return new Promise(m=>m())}decrypt(a,b){let c=0;const d=this.a+6,e=this.j,f=this.o;var g=this.l;const h=g[0],k=g[1],l=g[2];g=g[3];var m=
|
|
7
|
-
let v,y,A;let D,E,
|
|
8
|
-
e[Pb];y=f[E>>>24]<<24^f[
|
|
9
|
-
this.a=this.w=null;return new Promise(a=>a())}F(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24}};var
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var pV=function(a){a=_.Pi(a);const b=new Uint32Array(4);for(let c=0;4>c;c++)b[c]=a.getUint32(4*c);return b},rV=function(a,b){return c=>_.x(function*(){const d=c.request||null;if(d&&2===d.type&&d.keyInfo&&c.data){const e=d.uris[0];a.g.debug("Decrypting AES-128-encrypted video segment",e);c.data=yield qV(a,b,c.data,d.keyInfo,e)}return c})},qV=function(a,b,c,d,e){return _.x(function*(){let f=new ArrayBuffer(0);try{f=yield sV(a,b,d.url)}catch(g){return a.g.warn("Could not fetch AES key",
|
|
2
|
+
g),b.onError(new _.I(1,7,7104,null,g)),c}try{const g=a.l?new tV:new uV;yield g.importKey(f);return yield g.decrypt(c,d.iv)}catch(g){return a.g.warn("Could not decrypt segment data!",e,g),b.onError(new _.I(1,3,3103,null,g)),c}})},sV=function(a,b,c){return _.x(function*(){const d=_.sj(c),e=(new _.oi(c)).Ya.endsWith(".drmtoday.com");if(e){var f=b.getConfiguration();_.Fm(d,f)}f=c+JSON.stringify(d.headers);if(a.j[f])return a.j[f];try{const g=yield b.getNetworkEngine().fetch(d).T;return a.j[f]=g.data}catch(g){throw e&&
|
|
3
|
+
1001===g.code&&412===g.data.status&&a.g.warn("Wrong DRMtoday credentials, server responded with 412."),g;}})},uV=class{constructor(){this.B=[0,1,2,4,8,16,32,64,128,27,54];this.C=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.l=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.A=new Uint32Array(256);this.o=new Uint32Array(256);this.w=new Uint32Array(0);this.h=this.a=this.j=this.f=null;{const c=this.A,d=this.o;var a=
|
|
4
|
+
this.C;const e=a[0],f=a[1],g=a[2];a=a[3];var b=this.l;const h=b[0],k=b[1],l=b[2];b=b[3];const m=new Uint32Array(256);let n=0,q=0,u;for(u=0;256>u;u++)m[u]=128>u?u<<1:u<<1^283;for(u=0;256>u;u++){let v=q^q<<1^q<<2^q<<3^q<<4;v=v>>>8^v&255^99;c[n]=v;d[v]=n;const y=m[n],A=m[y],D=m[A];let E=257*m[v]^16843008*v;e[n]=E<<24|E>>>8;f[n]=E<<16|E>>>16;g[n]=E<<8|E>>>24;a[n]=E;E=16843009*D^65537*A^257*y^16843008*n;h[v]=E<<24|E>>>8;k[v]=E<<16|E>>>16;l[v]=E<<8|E>>>24;b[v]=E;n?(n=y^m[m[m[D^y]]],q^=m[m[q]]):n=q=1}}}importKey(a){a=
|
|
5
|
+
pV(a);for(var b=!0,c=0;c<a.length&&b;)b=a[c]===this.w[c],c++;if(b)return new Promise(m=>m());this.w=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.h=4*(this.a+7);this.f=new Uint32Array(this.h);this.j=new Uint32Array(this.h);b=this.A;const d=this.B;var e=this.l;c=e[0];const f=e[1],g=e[2],h=e[3];let k=0,l=0;for(e=0;e<this.h;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&
|
|
6
|
+
255],l^=d[e/this.a|0]<<24):6<this.a&&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.h;a++)e=this.h-a,l=a&3?this.f[e]:this.f[e-4],this.j[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.j[a]>>>=0;return new Promise(m=>m())}decrypt(a,b){let c=0;const d=this.a+6,e=this.j,f=this.o;var g=this.l;const h=g[0],k=g[1],l=g[2];g=g[3];var m=pV(b);b=m[0];let n=m[1],q=m[2];m=m[3];a=_.Oi(a);const u=new Int32Array(a.length);
|
|
7
|
+
let v,y,A;let D,E,oa,te,ic,Ob,Xd,Pb,jc;const kc=this.F.bind(this);for(;c<a.length;){te=kc(a[c]);ic=kc(a[c+1]);Ob=kc(a[c+2]);Xd=kc(a[c+3]);D=te^e[0];E=Xd^e[1];oa=Ob^e[2];var Gb=ic^e[3];Pb=4;for(jc=1;jc<d;jc++)v=h[D>>>24]^k[E>>16&255]^l[oa>>8&255]^g[Gb&255]^e[Pb],y=h[E>>>24]^k[oa>>16&255]^l[Gb>>8&255]^g[D&255]^e[Pb+1],A=h[oa>>>24]^k[Gb>>16&255]^l[D>>8&255]^g[E&255]^e[Pb+2],Gb=h[Gb>>>24]^k[D>>16&255]^l[E>>8&255]^g[oa&255]^e[Pb+3],D=v,E=y,oa=A,Pb+=4;v=f[D>>>24]<<24^f[E>>16&255]<<16^f[oa>>8&255]<<8^f[Gb&
|
|
8
|
+
255]^e[Pb];y=f[E>>>24]<<24^f[oa>>16&255]<<16^f[Gb>>8&255]<<8^f[D&255]^e[Pb+1];A=f[oa>>>24]<<24^f[Gb>>16&255]<<16^f[D>>8&255]<<8^f[E&255]^e[Pb+2];Gb=f[Gb>>>24]<<24^f[D>>16&255]<<16^f[E>>8&255]<<8^f[oa&255]^e[Pb+3];Pb+=3;u[c]=kc(v^b);u[c+1]=kc(Gb^n);u[c+2]=kc(A^q);u[c+3]=kc(y^m);b=te;n=ic;q=Ob;m=Xd;c+=4}return new Promise(hb=>{{var ua=u.buffer;const zb=ua.byteLength,Cc=zb&&(new DataView(ua)).getUint8(zb-1);ua=Cc?ua.slice(0,zb-Cc):ua}hb(ua)})}destroy(){this.B=this.j=this.f=this.l=this.C=this.o=this.A=
|
|
9
|
+
this.h=this.a=this.w=null;return new Promise(a=>a())}F(a){return a<<24|(a&65280)<<8|(a&16711680)>>8|a>>>24}};var tV=class{constructor(){this.a=null}importKey(a){const b=this;return _.x(function*(){b.a=yield crypto.subtle.importKey("raw",a,{name:"AES-CBC"},!1,["decrypt"])})}decrypt(a,b){const c=this;return _.x(function*(){return yield crypto.subtle.decrypt({name:"AES-CBC",iv:b},c.a,a)})}destroy(){this.a=null;return new Promise(a=>a())}};_.z("clpp.crypto.CryptoComponent",class extends _.Dv{constructor(){super();this.j={};this.l=!1;this.g=new _.T("clpp.crypto")}f(){if(window.crypto&&crypto.subtle){var a=crypto.subtle.decrypt;a=typeof crypto.subtle.importKey===_.Wd&&typeof a===_.Wd}else a=!1;(this.l=a)||this.g.warn("No WebCrypto APIs found. Will fallback to software AES")}o(a){const b=rV(this,a);a.getNetworkEngine().Gc(b)}a(){this.j={}}id(){return"crypto"}});};f.call(g, window);
|
package/cl.dash.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";import './cl.mse.js';let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
b);a.g.debug("notifyAvailabilityTimeOffset: maxAvailabilityTimeOffset\x3d"+a.G)},
|
|
5
|
-
|
|
6
|
-
60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null},
|
|
7
|
-
a},
|
|
8
|
-
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})},
|
|
9
|
-
`value will be ignored. (Period ID: ${a.
|
|
10
|
-
null!=v?v:
|
|
11
|
-
|
|
12
|
-
e)=>d||e)},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
g=>{e=
|
|
16
|
-
const k=_.
|
|
17
|
-
|
|
18
|
-
return new
|
|
19
|
-
f));return g},
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function(){
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
b,e,"HEAD")
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
a
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
e
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
f){
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
parseInt(e,16);if(!c){a.g.warn(
|
|
73
|
-
_.
|
|
74
|
-
_.
|
|
75
|
-
_.
|
|
76
|
-
_.
|
|
77
|
-
_.
|
|
78
|
-
var
|
|
79
|
-
e.a.byteLength)e=e.a.getFloat32(0);else if(8===e.a.byteLength)e=e.a.getFloat64(0);else throw new _.I(_.G,3,3003);}if(null==e)throw new _.I(_.G,3,3011);f=g/=1E9;e*=g;a=
|
|
80
|
-
function(a){var b=_.
|
|
81
|
-
this;return _.x(function*(){c.o=[a];c.D=b;const d=yield
|
|
82
|
-
c.severity===_.G))return}a.D&&(a.K?yield a.stop():
|
|
1
|
+
import {clpp} from "./cl.core.js";import './cl.mse.js';let g={};const _ = clpp._;var f=function(window){'use strict';var KO="\x3cms:pro/\x3e lacks content",LO="BaseURL",MO="Channel parsing failure! Ignoring scheme and value",NO="ContentProtection",OO="EssentialProperty",PO="Failed to parse UTCTiming tags.",QO="Location",RO="Missing \x3cms:pro/\x3e node in ContentProtection element",SO="No UTCTiming elements found.",TO="SegmentBase does not contain sufficient segment information:",UO="SegmentList does not contain sufficient segment information:",VO="SegmentTemplate does not contain sufficient segment information:",
|
|
2
|
+
WO="SegmentTimeline",XO='The last "S" element cannot have a negative repeat',YO="application",ZO="duration",$O="http://dashif.org/guidelines/trickmode",aP="http://www.w3.org/1999/xlink",bP='ignoring the last "S" element.',cP='ignoring the remaining "S" elements.',dP="parse.xml",eP="presentationTimeOffset",fP="schemeIdUri",gP="static",hP="timescale",iP="urn:microsoft:playready",jP="urn:mpeg:cenc:2013",kP="urn:mpeg:dash:utc:http-head:2014",lP="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",mP="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",
|
|
3
|
+
nP=function(a,b){return _.Og[a]=b},oP=function(a,b,c){try{const d=a(b);if(d&&d.T&&d.abort)return c.resolve(d.T),()=>d.abort();c.resolve(d);return()=>Promise.resolve(d).then(()=>{}).catch(()=>{})}catch(d){return c.reject(d),()=>Promise.resolve()}},pP=function(a,b,c){const d=new _.Ij;let e=()=>{d.reject(new _.I(_.G,7,7001));return a.abort()};a.T.then(f=>{a.a?d.reject(new _.I(_.G,7,7001)):b?e=oP(b,f,d):d.resolve(f)},f=>{c?e=oP(c,f,d):d.reject(f)});return new _.jp(d,()=>e())},qP=function(a,b){a.G=Math.max(a.G,
|
|
4
|
+
b);a.g.debug("notifyAvailabilityTimeOffset: maxAvailabilityTimeOffset\x3d"+a.G)},rP=function(a,b){return a.reduce(((c,d,e)=>d.catch(c.bind(null,e))).bind(null,b),Promise.reject())},sP=function(a){return new _.jp(Promise.reject(a),()=>Promise.resolve())},tP=function(a){return new _.jp(Promise.all(a.map(b=>b.T)),()=>Promise.all(a.map(b=>b.abort())))},uP=function(a){var b=void 0===b?1024:b;if(!(a instanceof Uint8Array))return"";if(typeof b!==_.t||0>=b)b=1024;return(a.byteLength>b?a.subarray(0,b):a).toString()},
|
|
5
|
+
vP=function(a){return 1>=a?0:Math.floor(Math.random()*a)},wP=function(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:Math.floor(a/1E3)},xP=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 _.C("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)+
|
|
6
|
+
60*Number(b[5]||null)+Number(b[6]||null);return isFinite(a)?a:null},yP=function(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null},zP=function(a){a=Number(a);return 0===a%1?a:null},AP=function(a){a=Number(a);return 0===a%1&&0<a?a:null},BP=function(a){a=Number(a);return 0===a%1&&0<=a?a:null},CP=function(a){let b;a=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(a)?null:
|
|
7
|
+
a},DP=function(a){return a?"true"===a.toLowerCase():!1},EP=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 _.C("URL template does not have an available substitution ","for identifier",'"'+h+'":',a),g;"RepresentationID"===h&&k&&(_.C("URL template should not contain a width specifier for identifier",'"RepresentationID":',
|
|
8
|
+
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})},HP=function(a,b){var c=FP(a,b,hP);let d=1;c&&(d=AP(c)||1);c=FP(a,b,ZO);(c=AP(c||""))&&(c/=d);let e=Number(FP(a,b,eP))||0,f=e/d||0;a.Th&&null!=a.xd&&a.xd!==f&&(_.C("The stream is non-compliant with the DASH spec. The value of `presentationTimeOffset` has changed during the transition from dynamic to static manifest, which is not allowed. The last "+
|
|
9
|
+
`value will be ignored. (Period ID: ${a.Ha.id}, `+`Representation ID: ${a.O.id})`),e=a.xd*d,f=a.xd);var g=FP(a,b,"startNumber");let h=BP(g||"");if(null==g||null==h)h=1;g=FP(a,b,"endNumber");g=null!==g?BP(g||""):null;var k=GP(a,b,WO),l=null;if(k){{l=d;var m=e,n=a.Ba.duration||Infinity;const A=_.Q;k=A.a(k,"S");const D=[];var q=0;for(let E=0;E<k.length;++E){var u=k[E],v=A.$(u,"t",BP);const oa=A.$(u,"d",BP);var y=A.$(u,"r",zP);null!=v&&(v-=m);if(!oa){_.C('"S" element must have a duration:',cP,u);break}v=
|
|
10
|
+
null!=v?v:q;y=y||0;if(0>y)if(E+1<k.length){y=A.$(k[E+1],"t",BP);if(null==y){_.C('An "S" element cannot have a negative repeat','if the next "S" element does not have a valid start time:',cP,u);break}else if(v>=y){_.C('An "S" element cannot have a negative repeat if its start ','time exceeds the next "S" element\'s start time:',cP,u);break}y=Math.ceil((y-v)/oa)-1}else{if(Infinity===n){_.C(XO,"if the Period has an infinite duration:",bP,u);break}else if(v/l>=n){_.C(XO,"if its start time exceeds the Period's duration:",
|
|
11
|
+
bP,u);break}y=Math.ceil((n*l-v)/oa)-1}0<D.length&&v!==q&&(Math.abs((v-q)/l)>=_.ju&&_.C("SegmentTimeline contains a large gap/overlap:","the content may have errors in it.",u),D[D.length-1].end=v/l);for(u=0;u<=y;++u)q=v+oa,D.push({start:v/l,end:q/l,Li:v}),v=q}l=D}}a=FP(a,b,"availabilityTimeOffset");b=Number(a||"");b=isNaN(b)?null:b;if(null==a||null==b)b=0;return{timescale:d,Ia:c,Cc:h,Ee:g,Nb:f,qf:e,timeline:l,ve:b}},FP=function(a,b,c){return[b(a.O),b(a.wa),b(a.Ha)].filter(_.ki).map(d=>d.getAttribute(c)).reduce((d,
|
|
12
|
+
e)=>d||e)},GP=function(a,b,c){return[b(a.O),b(a.wa),b(a.Ha)].filter(_.ki).map(d=>_.Q.h(d,c)).reduce((d,e)=>d||e)},JP=function(a,b,c,d,e,f){const g=_.Q,h=g.getAttributeNS(a,aP,"href"),k=g.getAttributeNS(a,aP,"actuate")||"onRequest";g.ne(a,aP);if(5<=f)return sP(new _.I(_.G,4,4028));if("onLoad"!==k)return sP(new _.I(_.G,4,4027));const l=_.tC([d],[h]);d=_.sj(l,b);d.type=1;return pP(e.fetch(d),m=>{m=_.Si(m.data);m=g.j(m,a.tagName);if(!m)return sP(new _.I(_.G,4,4001,{uri:h}));g.me(a);g.be(m,a);g.ae(m,a);
|
|
13
|
+
return IP(a,b,c,l[0],e,f+1)})},IP=function(a,b,c,d,e,f){f=void 0===f?0:f;var g=_.Q;if(g.getAttributeNS(a,aP,"href"))return g=JP(a,b,c,d,e,f),c&&(g=pP(g,void 0,()=>IP(a,b,c,d,e,f))),g;const h=[],k=g.Td(a);for(const l of k)"urn:mpeg:dash:resolve-to-zero:2013"===g.getAttributeNS(l,aP,"href")?g.removeChild(a,l):l.tagName!==WO&&h.push(IP(l,b,c,d,e,f));return pP(tP(h),()=>a)},KP=function(a,b,c){const d=a.Ba.duration;var e=a.Ba.jg;if(!a.De)return e=new _.BJ(b),_.YC(e,d),e;{var f=a.Ha;const g=a.O;f=f&&f.id&&
|
|
14
|
+
g&&g.id?`${f.id},${g.id}`:null}if(!a.kg||null==c[f])return a=new _.BJ(b),e||_.YC(a,d),c[f]=a;c=c[f];e||_.YC(new _.BJ(b),d);_.xD(c,b);_.yD(c,_.nD(a.presentationTimeline)-a.Ba.start);return c},LP=function(a,b){var c=a.presentationTimeline,d=[...b.a];c.l||0===d.length||(c.I=Math.floor(Math.max(c.I||0,d[d.length-1].endTime+a.Ba.start)));a.kg||_.kD(a.presentationTimeline,[...b.a],a.Ba.start)},MP=function(a){return""===a.id?`${a.schemeIdUri}:${a.startTime}:${a.endTime}`:a.id},NP=function(a,b,c,d,e){return _.x(function*(){const f=
|
|
15
|
+
_.bD(a,b,c,e);f.type=2;return(yield d.fetch(f)).data})},PP=function(a,b,c,d){let e;var f=(new _.tm).ea("sidx",g=>{e=OP(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);_.th('Invalid box type. Expected "sidx", but received:',a,"from:",g,"byte range:",f);throw new _.I(_.G,3,3004,{url:g,Xi:f,size:a.byteLength,mj:uP(a)});}},OP=function(a,b,c,d){const e=[];d.reader.skip(4);const f=_.P(d.reader);if(0===f)throw _.th("Invalid timescale."),new _.I(_.G,3,3005);if(0===
|
|
16
|
+
d.version){var g=_.P(d.reader);var h=_.P(d.reader)}else g=_.hm(d.reader),h=_.hm(d.reader);d.reader.skip(2);const k=_.fm(d.reader);a=a+d.size+h;for(h=0;h<k;h++){var l=_.P(d.reader);const m=(l&2147483648)>>>31;l&=2147483647;const n=_.P(d.reader);d.reader.skip(4);if(1===m)throw _.th("Hierarchical SIDXs are not supported."),new _.I(_.G,3,3006);e.push(new _.wD(e.length,g/f-b,(g+n)/f-b,()=>c,a,a+l-1,b));g+=n;a+=l}d.parser.stop();return e},QP=function(a){var b=_.em(a.a);let c;for(c=1;8>=c&&!(b&1<<8-c);c++);
|
|
17
|
+
if(8<c)throw new _.I(_.G,3,3002);const d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=_.em(a.a);return d},TP=function(a){var b=QP(a);if(7<b.length)throw new _.I(_.G,3,3002);var c=0;for(var d=0;d<b.length;d++)c=256*c+b[d];b=c;c=QP(a);a:{for(e of RP)if(_.Rl(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 _.I(_.G,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()+c<=a.f.byteLength?
|
|
18
|
+
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 SP(b,e)},UP=function(a){if(8<a.a.byteLength)throw new _.I(_.G,3,3002);if(8===a.a.byteLength&&a.a.getUint8(0)&224)throw new _.I(_.G,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},XP=function(a,b,c,d,e,f){const g=[],h=()=>e;a=new VP(a.a);let k=null,l=null;for(;_.cm(a.a);){var m=TP(a);if(187===m.id){var n=WP(m);n&&(m=c*n.Mi,n=b+n.mi,null!=
|
|
19
|
+
k&&g.push(new _.wD(g.length,k-f,m-f,h,l,n-1,f)),k=m,l=n)}}null!=k&&g.push(new _.wD(g.length,k-f,d-f,h,l,null,f));return g},WP=function(a){var b=new VP(a.a);a=TP(b);if(179!==a.id)throw _.C("Not a CueTime element."),new _.I(_.G,3,3013);a=UP(a);b=TP(b);if(183!==b.id)throw _.C("Not a CueTrackPositions element."),new _.I(_.G,3,3012);b=new VP(b.a);let c=0;for(;_.cm(b.a);){const d=TP(b);if(241===d.id){c=UP(d);break}}return{Mi:a,mi:c}},YP=function(a,b){var c=GP(a,b,"Initialization");if(!c)return null;let d=
|
|
20
|
+
a.O.na;b=()=>"";const e=c.getAttribute("sourceURL")||void 0;e&&(d=_.tC(a.O.na,[e]),b=()=>e);let f=0,g=null;if(c=_.Q.$(c,"range",yP))f=c.start,g=c.end;return new _.wJ(()=>d,f,g,null,null,b,a.O.La)},ZP=function(a){return a.Fd},aQ=function(a,b,c,d,e,f,g){const h=a.presentationTimeline,k=!a.De||!a.Ba.jg,l=a.Ba.start,m=a.Ba.duration;let n=null;return{createSegmentIndex:function(q,u){return _.x(function*(){var v=[NP(c,d,e,q,u),"webm"===f?NP(b.Ea(),b.ma,b.ja,q,u):null];v=yield Promise.all(v);var y=v[0];
|
|
21
|
+
const A=v[1]||null;y="mp4"===f?PP(y,d,c,g):(new $P).parse(y,A,c,g);_.kD(h,y,l);n=new _.BJ(y);k&&_.YC(n,m);return v})},findSegmentPosition:function(q){return n.f(q)},getSegmentReference:function(q){return n.get(q)},adjustSegmentDurations:function(q,u){return n.h(q,u)},getDuration:function(){return null!=m?m:n.getDuration()},getLastSegmentEndTime:()=>m}},hQ=function(a,b,c){const d=bQ(a),e=cQ(a);dQ(a,e);let f=null;if(e.td)a.presentationTimeline.B=null,f=eQ(a,d,e);else if(e.Ia)c||(a.presentationTimeline.B=
|
|
22
|
+
null,qP(a.presentationTimeline,e.ve),_.lD(a.presentationTimeline,e.Ia),_.iD(a.presentationTimeline,a.Ba.start)),f=fQ(a,e);else{c=gQ(a,e);const g=KP(a,c,b);LP(a,g);f={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:g.f.bind(g),getSegmentReference:g.get.bind(g),adjustSegmentDurations:g.h.bind(g),getDuration:g.getDuration.bind(g),getLastSegmentEndTime:()=>_.vD(g)}}return{createSegmentIndex:f.createSegmentIndex,findSegmentPosition:f.findSegmentPosition,getSegmentReference:f.getSegmentReference,
|
|
23
|
+
adjustSegmentDurations:f.adjustSegmentDurations,getDuration:f.getDuration,initSegmentReference:d,getLastSegmentEndTime:f.getLastSegmentEndTime,Ca:e.Nb}},bQ=function(a){const b=FP(a,iQ,"initialization");if(!b)return null;const c=a.O.id,d=a.bandwidth||null,e=a.O.na,f=()=>EP(b,c,null,d,null);return new _.wJ(function(){const g=f();return _.tC(e,[g])},0,null,null,null,f,a.O.La)},cQ=function(a){const b=HP(a,iQ),c=FP(a,iQ,"media");a=FP(a,iQ,"index");return{Ia:b.Ia,timescale:b.timescale,Cc:b.Cc,Ee:b.Ee,Nb:b.Nb,
|
|
24
|
+
qf:b.qf,timeline:b.timeline,Me:c,td:a,ve:b.ve}},dQ=function(a,b){let c;c=b.td?1:0;c+=b.timeline?1:0;c+=b.Ia?1:0;if(0===c)throw _.th("SegmentTemplate does not contain any segment information:","the SegmentTemplate must contain either an index URL template","a SegmentTimeline, or a segment duration.",a.O),new _.I(_.G,4,4002);1!==c&&(_.C("SegmentTemplate contains multiple segment information sources:","the SegmentTemplate should only contain an index URL template,","a SegmentTimeline or a segment duration.",
|
|
25
|
+
a.O),b.td?(_.rh("Using the index URL template by default."),b.timeline=null):_.rh("Using the SegmentTimeline by default."),b.Ia=null);if(!b.td&&!b.Me)throw _.th(VO,"the SegmentTemplate's media URL template is missing.",a.O),new _.I(_.G,4,4002);},eQ=function(a,b,c){const d=a.O.mimeType.split("/")[1];if("mp4"!==d&&"webm"!==d)throw _.th("SegmentTemplate specifies an unsupported container type.",a.O),new _.I(_.G,4,4006);if("webm"===d&&!b)throw _.th(VO,"the SegmentTemplate uses a WebM container,","but does not contain an initialization URL template.",
|
|
26
|
+
a.O),new _.I(_.G,4,4005);var e=EP(c.td,a.O.id,null,a.bandwidth||null,null);e=_.tC(a.O.na,[e]);return aQ(a,b,e,0,null,d,c.Nb)},fQ=function(a,b){const c=b.Me,d=a.Ba.duration,e=b.Ia,f=b.Cc,g=b.Ee,h=b.timescale,k=a.bandwidth||null,l=a.O.id,m=a.O.na,n=a.O.La;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(q){return 0>q||d&&q>=d?null:Math.floor(q/e)},getSegmentReference:function(q){const u=q+f;if(null!==g&&u>g)return null;const v=q*e;let y=v+e;d&&(y=Math.min(y,d));if(0>
|
|
27
|
+
y||d&&v>=d)return null;const A=()=>EP(c,l,u,k,v*h);return new _.wD(q,v,y,function(){const D=A();return _.tC(m,[D])},0,null,b.Nb,null,null,null,null,null,null,null,null,A,n)},adjustSegmentDurations:()=>{},getDuration:()=>d,getLastSegmentEndTime:()=>d}},gQ=function(a,b){const c=b.Me,d=b.timeline;if(0===d.length)return[];const e=[],f=a.O.id,g=a.bandwidth||null,h=a.O.na;a=a.O.La;for(let k=0;k<d.length;k++){const l=k+b.Cc,m=d[k].Li+b.qf,n=()=>EP(c,f,l,g,m);e.push(new _.wD(l,d[k].start,d[k].end,()=>{const q=
|
|
28
|
+
n();return _.tC(h,[q])},0,null,b.Nb,null,null,null,null,null,null,null,null,n,a))}return e},iQ=function(a){return a.hc},nQ=function(a,b){const c=YP(a,jQ),d=kQ(a);lQ(a,d);const e=mQ(a.Ba.duration,d.Cc,a.O.na,a.O.La,d),f=KP(a,e,b);LP(a,f);return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:f.f.bind(f),getSegmentReference:f.get.bind(f),adjustSegmentDurations:f.h.bind(f),getDuration:f.getDuration.bind(f),initSegmentReference:c,getLastSegmentEndTime:()=>_.vD(f),Ca:d.Nb}},jQ=function(a){return a.gc},
|
|
29
|
+
kQ=function(a){const b=oQ(a);a=HP(a,jQ);let c=a.Cc;0===c&&(_.C("SegmentList@startNumber must be \x3e 0"),c=1);let d=0;a.Ia?d=a.Ia*(c-1):a.timeline&&0<a.timeline.length&&(d=a.timeline[0].start);return{Ia:a.Ia,startTime:d,Cc:c,Nb:a.Nb,timeline:a.timeline,Ac:b}},lQ=function(a,b){if(!b.Ia&&!b.timeline&&1<b.Ac.length)throw _.C(UO,"the SegmentList specifies multiple segments,","but does not specify a segment duration or timeline.",a.O),new _.I(_.G,4,4002);if(!b.Ia&&!a.Ba.duration&&!b.timeline&&1===b.Ac.length)throw _.C(UO,
|
|
30
|
+
"the SegmentList specifies one segment,","but does not specify a segment duration, period duration,","or timeline.",a.O),new _.I(_.G,4,4002);if(b.timeline&&0===b.timeline.length)throw _.C(UO,"the SegmentList has an empty timeline.",a.O),new _.I(_.G,4,4002);},mQ=function(a,b,c,d,e){let f=e.Ac.length;e.timeline&&e.timeline.length!==e.Ac.length&&(f=Math.min(e.timeline.length,e.Ac.length),_.C("The number of items in the segment timeline and the number of","segment URLs do not match, truncating",e.Ac.length,
|
|
31
|
+
"to",f));const g=[];var h=e.startTime;for(let k=0;k<f;k++){const l=e.Ac[k],m=_.tC(c,[l.mg]);let n;n=null!=e.Ia?h+e.Ia:e.timeline?e.timeline[k].end:h+a;g.push(new _.wD(k+b,h,n,()=>m,l.start,l.end,e.Nb,null,null,null,null,null,null,null,null,()=>l.mg,d));h=n}return g},oQ=function(a){return[a.O.gc,a.wa.gc,a.Ha.gc].filter(_.ki).map(b=>_.Q.a(b,"SegmentURL")).reduce((b,c)=>0<b.length?b:c).map(b=>{b.getAttribute("indexRange")&&!a.Ie&&(a.Ie=!0,_.C("We do not support the SegmentURL@indexRange attribute on SegmentList. We only use the SegmentList@duration attribute or SegmentTimeline, which must be accurate."));
|
|
32
|
+
const c=b.getAttribute("media");b=_.Q.$(b,"mediaRange",yP,{start:0,end:null});return{mg:c,start:b.start,end:b.end}})},qQ=function(a,b,c){c=c.map(e=>({scheme:e.getAttribute(fP),value:e.getAttribute(_.mg)}));const d=a.a.clockSyncUri;!c.length&&d&&(a.g.info("No UTCTiming elements found, falling back on clockSyncUri from config to synchronize clocks."),c.push({scheme:kP,value:d}));return 0===c.length?(a.g.warn(SO),Promise.reject(Error(SO))):rP(c,e=>{const f=e.scheme;e=e.value;switch(f){case kP:case "urn:mpeg:dash:utc:http-head:2012":return pQ(a,
|
|
33
|
+
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 pQ(a,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.g.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.g.warn("NTP UTCTiming scheme is not supported"),
|
|
34
|
+
Promise.reject();default:return a.g.warn("Unrecognized scheme in UTCTiming element",f),Promise.reject()}}).catch(()=>{a.g.warn(PO);return Promise.reject(Error(PO))})},rQ=function(a,b,c,d){return _.x(function*(){const e=_.Q.a(b,"UTCTiming");try{const f=yield qQ(a,c,e);d.H=f;a.g.info("Clock synchronized. The difference between server and "+`client clock was ${f} ms.`)}catch(f){a.g.warn("Failed to synchronize clocks. This content may not play on clients with bad clocks!")}return d})},pQ=function(a,b,
|
|
35
|
+
c,d){return _.x(function*(){var e=_.tC(b,[c]);e=yield a.f(e,d);if("HEAD"===d){if(!e.headers||!e.headers.date)throw a.g.warn("UTC timing response is missing","expected date header"),Error("Date HTTP header missing.");e=e.headers.date}else e=_.Si(e.data);e=Date.parse(e);if(isNaN(e))throw a.g.warn("Unable to parse date from UTC timing response"),Error("Date value invalid.");return e-Date.now()})},tQ=function(a,b){return a.find(c=>sQ.get(c.Xb)===b)},vQ=function(a){const b=_.Q;var c=b.Pb(a.node,iP,"pro");
|
|
36
|
+
if(!c)return uQ.warn(RO,a),null;c=b.f(c);if(!c)return uQ.warn(KO,a),null;a=_.Ol(c);a=_.wn(a);a=_.on(a.a);return{keyId:null,Xb:mP,node:b.Jc(),init:[{initData:_.gC(a),initDataType:_.Uc,keyId:null}]}},wQ=function(a,b){b=void 0===b?"4.0.0.0":b;const c=_.Q;a=c.Pb(a.node,jP,"pssh");if(!a)return null;a=c.f(a);if(!a)return null;a=_.Ol(a);a=_.qn(a);return a?(b=_.hC(b,a.a))?{keyId:null,Xb:lP,node:c.Jc(),init:[{initData:_.gC(b),initDataType:_.Uc,keyId:null}]}:null:(_.C("Unable to parse WV PSSH data. Can not create PR data!"),
|
|
37
|
+
null)},xQ=function(a,b){const c=_.Q;var d=c.Pb(a.node,iP,"pro");if(!d)return _.C(RO,a),null;d=c.f(d);if(!d)return _.C(KO,a),null;a=_.Ol(d);a=_.wn(a);return a.version!==b&&(_.sh(`Parsing from ${a.version} to ${b}.`),a=_.iC(a,b))?{keyId:null,Xb:lP,node:c.Jc(),init:[{initData:_.gC(a),initDataType:_.Uc,keyId:null}]}:null},AQ=function(a,b,c,d){const e=yQ(a);let f=null;a=[];let g=[];const h=tQ(e,_.td),k=tQ(e,_.rd);if(k&&d){var l=xQ(k,d);l&&(e[e.indexOf(k)]=l)}k&&!h&&(l=vQ(k))&&e.push(l);h&&!k&&(d=wQ(h,
|
|
38
|
+
d||void 0))&&e.push(d);d=new Set(e.map(m=>m.keyId));d.delete(null);if(1<d.size)throw new _.I(_.G,4,4010);b||(g=e.filter(m=>"urn:mpeg:dash:mp4protection:2011"===m.Xb?(f=m.init||f,!1):!0),g.length&&(a=zQ(f,g,c),0===a.length&&(a=[_.uC(_.De,f,c)])));if(e.length&&(b||!g.length)){a=[];for(const m of sQ.values())m!==_.Ne&&a.push(_.uC(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{dd:b,$i:f,drmInfos:a,Vf:!0}},yQ=function(a){const b=[];for(const c of a)(a=BQ(c))&&
|
|
39
|
+
b.push(a);return b},zQ=function(a,b,c){const d=[];for(const f of b){var e=sQ.get(f.Xb);if(e){b=_.uC(e,f.init||a,c);if(e=CQ.get(e))(e=e(f))?(b.licenseServerUri=e.licenseUrl,b.licenseServerUriOrigin=e.origin):b.licenseServerUri="";d.push(b)}}return d},DQ=function(a,b,c,d,e){const f=AQ(a,c,d,e);if(b.Vf){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.dd=f.dd||b.dd;b.Vf=!1}else if(0<f.drmInfos.length&&(b.drmInfos=b.drmInfos.filter(g=>
|
|
40
|
+
f.drmInfos.some(h=>h.keySystem===g.keySystem)),0===b.drmInfos.length))throw new _.I(_.G,4,4008);return f.dd||b.dd},EQ=function(a){const b=_.Q;a=b.sc(a.node,"https://dashif.org/CPS","Laurl").map(c=>b.f(c)).filter(Boolean);return 0===a.length?null:1===a.length?a[0]:a[vP(a.length)]},BQ=function(a){const b=_.Q;let c=a.getAttribute(fP),d=b.getAttributeNS(a,jP,"default_KID");const e=b.sc(a,jP,"pssh").map(b.f),f=b.Pb(a,iP,"pro");if(!c)return _.th("Missing required schemeIdUri attribute on","ContentProtection element",
|
|
41
|
+
a),null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new _.I(_.G,4,4009);let g=[];try{if(g=e.map(h=>({initDataType:_.Uc,initData:_.Ol(h),keyId:null})),0===g.length&&f&&b.f(f))try{const h=b.f(f),k=_.Ol(h),l=_.wn(k);g.push({initDataType:_.Uc,initData:_.gC(l),keyId:null})}catch(h){_.C("Unable to parse ms:pro payload",h),g=[]}}catch(h){throw new _.I(_.G,4,4007);}return{node:a,Xb:c,keyId:d,init:0<g.length?g:null}},FQ=function(a,b,c){if(a.length){c=c||`${"__clpp_baseUriCollection_"}
|
|
42
|
+
${b.length}`;const d=[];a.forEach(e=>{const f=e.getAttribute("serviceLocation");e=_.Q.f(e);f&&e&&d.push({serviceLocationId:f,uri:e,params:{}})});if(d.length)return a=new _.gE(c,d),b.push(a),a}return null},HQ=function(a,b){a=GQ(a).filter(c=>c.getLastSegmentEndTime).map(c=>c.getLastSegmentEndTime());0<a.length&&(a=Math.min(...a),_.jD(b.presentationTimeline,a+b.Ba.start))},IQ=function(a,b){return _.oE(_.rk(a,b))?_.H:a.split("/")[0]},GQ=function(a){const b=new Set;a.forEach(c=>{c.variants.forEach(d=>
|
|
43
|
+
{d.audio&&b.add(d.audio);d.video&&b.add(d.video)})});return Array.from(b)},KQ=function(a){return _.x(function*(){var b=a.w?_.hE(a.w,QO):null;var c=[];b&&(c=_.ZD(b,""));0===c.length&&(c=a.o);var d=_.sj(c,a.a.attemptParameters);d.type=1;c=Date.now();d=a.D.networkingEngine.fetch(d);_.Bj(a.A,d);var e=yield d.T;if(!a.D)return 0;b||e.uri&&!a.o.includes(e.uri)&&a.o.unshift(e.uri);d=null!=a.f;const f=yield JQ(a,e.data,e.uri);f.manifest.contentSteering&&(a.w=yield a.D.onContentSteeringInfoFound(f.manifest.contentSteering));
|
|
44
|
+
if(a.w&&b){0!==e.request.uriIndex&&_.iE(a.w,b.na[0].serviceLocationId);var g=e.request,h=e.timeMs;e=e.data.byteLength;h&&e&&(b=_.fE(a.w,b.na[g.uriIndex].serviceLocationId),_.XD(b.we,h,e),b.Dd=!0)}b=(Date.now()-c)/1E3;_.$C(a.I,1,b);if(d&&a.D.onUpdate)a.D.onUpdate(f.manifest);if(f.Ki){if(a.D.onTurnedStatic)a.D.onTurnedStatic();a.D.onEvent(new _.F(_.Be))}return b})},LQ=function(a,b){0>a.l||a.B.la(Math.max(3,a.l-b,_.aD(a.I)))},JQ=function(a,b,c){return _.x(function*(){var d=_.Si(b);_.yn(dP);d=_.Q.j(d,
|
|
45
|
+
"MPD");_.yn("parse.xml.end");_.An(dP,dP,"parse.xml.end");if(!d)throw new _.I(_.G,4,4001,c);d=IP(d,a.a.attemptParameters,a.a.xlinkFailGracefully,c,a.D.networkingEngine);_.Bj(a.A,d);d=yield d.T;return MQ(a,d,c)})},MQ=function(a,b,c){return _.x(function*(){var d=_.Q;const e=[];var f=[c],g=d.a(b,QO),h=g.map(d.f).filter(_.ki);0<h.length&&(f=_.tC(f,h),a.o=f,FQ(g,e,QO));g=d.a(b,LO);h=g.map(d.f);var k=_.tC(f,h);FQ(g,e,LO);f=b.getAttribute("type")||gP;a.l=d.$(b,"minimumUpdatePeriod",xP,-1);f===gP&&0<=a.l&&
|
|
46
|
+
(a.g.warn("Invalid manifest - a static manifest should not contain the `minimumUpdatePeriod` attribute. The attribute will be ignored."),a.l=-1,a.B.stop());g=d.$(b,"maxSegmentDuration",xP);if(d=f===gP&&"dynamic"===a.C)a.g.info("MPD dynamic to static transition."),f="dynamic";h=f===gP;var l="dynamic"===f;if(a.f)var m=a.f.presentationTimeline;else{var n=_.Q;m=a.a.timeline||{};var q=n.$(b,"suggestedPresentationDelay",xP),u=n.$(b,"minBufferTime",xP,0);q=null!=a.a.suggestedPresentationDelay?a.a.suggestedPresentationDelay:
|
|
47
|
+
a.a.lowLatencyMode?0:null!=q?q:3*u;n=n.$(b,"availabilityStartTime",wP);m=new _.AJ(m,n,q,h,!!a.a.autoCorrectDrift,!!a.a.lowLatencyMode);m=h?m:rQ(a.J,b,k,m)}m=yield m;n=_.Q.$(b,"timeShiftBufferDepth",xP);n=l&&a.a.availabilityWindowOverride&&!isNaN(a.a.availabilityWindowOverride)?a.a.availabilityWindowOverride:null===n?Infinity:n;m.A=n;if(!a.D)throw new _.I(_.G,7,7001);n={De:l,kg:null!=a.f,presentationTimeline:m,Ha:null,Ba:null,wa:null,O:null,bandwidth:0,Ie:!1,Th:d,ic:null,xd:null};k=NQ(a,n,k,e,b);q=
|
|
48
|
+
k.duration;l=k.periods;d&&(HQ(l,n),m.C=!0);if(h||!d&&!k.Sf)m.f=q||Infinity;if(2===a.a.timeline.version){h=q;n=l[0].startTime;if(null==h||Infinity===h)h=OQ(l);_.cD(m.a,n,n+h)}_.lD(m,g||1);m.isLive();if(!a.f){a.f={presentationTimeline:m,periods:l,minBufferTime:0,cues:[]};a:{l=_.Q;if(m=l.h(b,"ContentSteering"))if(g=m.getAttribute("defaultServiceLocation")||"",h=l.f(m)){l=l.$(m,"queryBeforeStart",DP,!1);g={manifestType:_.uc,contentSteeringServerUri:h,defaultServiceLocation:g,queryBeforeStart:l||!1,baseUriCollections:[]};
|
|
49
|
+
break a}g=null}g&&(a.f.contentSteering=g,a.f.contentSteering.baseUriCollections=e)}a.f.cues=k.cues;a.C=f;return{manifest:a.f,Ki:d}})},NQ=function(a,b,c,d,e){const f=_.Q,g=f.$(e,"mediaPresentationDuration",xP),h=a.f?a.f.periods[a.f.periods.length-1]||null:null;var k=[];const l=[];var m=0;e=f.a(e,"Period");for(let v=0;v<e.length;v++){var n=e[v];m=f.$(n,_.Lf,xP,m);var q=f.$(n,ZO,xP);let y=null;if(v!==e.length-1){var u=f.$(e[v+1],_.Lf,xP);null!=u&&(y=u-m)}else null!=g&&(y=g-m);u=_.ju;y&&q&&Math.abs(y-
|
|
50
|
+
q)>u&&a.g.warn("There is a gap/overlap between Periods",n);null==y&&(y=q);n=PQ(a,b,c,d,{start:m,duration:y,node:n,jg:null==y||v===e.length-1});q=n.Ha;l.push(q);k=k.concat(n.cues);a.G.includes(q.id)||(a.G.push(q.id),a.f&&(a.D.filterNewPeriod(q),a.f.periods.push(q)));if(null==y){v!==e.length-1&&a.g.warn("Skipping Period",v+1,"and any subsequent Periods:","Period",v+1,"does not have a valid start time.",l[v+1]);m=null;break}m+=y}null==a.f&&a.D.filterAllPeriods(l);h&&(b=l.find(v=>v.id===h.id))&&(h.endTime=
|
|
51
|
+
b.endTime);k=QQ(a,k);return null!=g?(m!==g&&a.g.warn("@mediaPresentationDuration does not match the total duration of ","all Periods."),{periods:l,duration:g,Sf:!1,cues:k}):{periods:l,duration:m,Sf:!0,cues:k}},OQ=function(a){return a.map(b=>b.variants[0].video||b.variants[0].audio).reduce((b,c)=>c?c.getDuration():0+b,0)},PQ=function(a,b,c,d,e){var f=_.Q;b.Ha=RQ(a,e.node,null,c,d);b.Ba=e;c=b.Ha.id||`__clpp_period_${e.start}`;b.Ha.id||(a.g.info("No Period ID given for Period with start time "+e.start+
|
|
52
|
+
`, Assigning a default: ${c}.`),b.Ha.id=c);d=f.a(e.node,"EventStream").flatMap(A=>SQ(a,e.start,e.duration,A));f=f.a(e.node,_.fa).map(A=>TQ(a,b,A)).filter(_.ki);if(b.De){var g=[];for(var h of f)for(var k of h.pi)g.push(k);if(g.length!==(new Set(g)).size)throw new _.I(_.G,4,4018);}h=f.filter(A=>!A.nf);k=f.filter(A=>A.nf);for(var l of k){l.streams.forEach(A=>{A.trickPlay=!0});k=l.streams[0];g=l.nf;for(var m of h)if(g.includes(m.id))for(var n of m.streams)n.trickModeVideo=k}m=UQ(f,_.w);n=UQ(h,_.p);if(!m.length&&
|
|
53
|
+
!n.length)throw new _.I(_.G,4,4004);n.length||(n=[null]);m.length||(m=[null]);l=[];for(var q of n)for(var u of m)VQ(a,q,u,l);u=[...UQ(h,_.H),...UQ(h,_.$B)];q=[];for(var v of u)q.push.apply(q,v.streams);u=UQ(h,_.ce);v=[];for(var y of u)v.push.apply(v,y.streams);y=WQ(e,h);return{Ha:{id:c,configurationId:a.D.configurationId,startTime:e.start,endTime:y,textStreams:q,thumbStreams:v,variants:l},cues:d}},QQ=function(a,b){const c=new Set(b.map(MP));a.j.forEach((d,e)=>{c.has(e)||a.j.delete(e)});b.forEach(d=>
|
|
54
|
+
{const e=MP(d);a.j.has(e)||a.j.set(e,d)});return Array.from(a.j.values())},RQ=function(a,b,c,d,e){const f=_.Q;c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,Ne:null,La:e?e.find(u=>u.id===LO)||null:null};d=d||c.na;var g=f.a(b,LO);const h=g.map(f.f);e=e?FQ(g,e,b.getAttribute("id")||void 0):null;g=b.getAttribute("contentType")||c.contentType;const k=b.getAttribute(_.ve)||c.mimeType,l=b.getAttribute(_.md)||c.codecs,m=f.$(b,"frameRate",CP)||c.frameRate,n=XQ(f.a(b,"InbandEventStream"),
|
|
55
|
+
c.emsgSchemeIdUris),q=f.a(b,"AudioChannelConfiguration");a=YQ(a,q)||c.Ne;g||(g=IQ(k,l));return{na:_.tC(d,h),La:e||c.La,Fd:f.h(b,"SegmentBase")||c.Fd,gc:f.h(b,"SegmentList")||c.gc,hc:f.h(b,"SegmentTemplate")||c.hc,width:f.$(b,_.Hg,BP)||c.width,height:f.$(b,_.Zd,BP)||c.height,contentType:g,mimeType:k,codecs:l,frameRate:m,emsgSchemeIdUris:n,id:b.getAttribute("id")||"",Ne:a}},SQ=function(a,b,c,d){const e=_.Q,f=d.getAttribute(fP)||"",g=d.getAttribute(_.mg)||"",h=e.$(d,hP,BP)||1,k=e.$(d,eP,BP)||0,l=[];
|
|
56
|
+
for(const n of e.a(d,"Event")){d=e.$(n,"presentationTime",BP)||0;var m=e.$(n,ZO,BP)||0;d=b+d/h-k/h;m=d+m/h;null!=c&&(d=Math.min(d,b+c),m=Math.min(m,b+c));let q=_.gg;f.startsWith(_.ig)?q=_.Rh:"urn:mpeg:dash:event:callback:2015"===f&&(q=_.Ce);const u={configurationId:a.D.configurationId,schemeIdUri:f,value:g,startTime:d,endTime:m,id:n.getAttribute("id")||"",type:q,eventElement:e.Hd(n)};u.type===_.Ce&&(u.fe=()=>{if(u.eventElement){var v=u.eventElement.getAttribute("messageData")||"";v&&v.startsWith("http")&&
|
|
57
|
+
(v=_.sj(v),v.type=_.rj,a.D.networkingEngine.fetch(v))}});l.push(u)}return l},TQ=function(a,b,c){var d=_.Q;b.wa=RQ(a,c,b.Ha,null,null);var e=b.wa.contentType===_.H;const f=ZQ(c),{kind:g,zd:h,roles:k}=$Q(c,e);let l=null;try{l=aR(c)}catch(y){return null}const m=d.a(c,"Accessibility"),n=bR(m);var q=d.a(c,NO);const u=AQ(q,a.a.ignoreDrmInfo,b.Ha.id,a.a.playreadyVersion||null),v=c.getAttribute("lang")||_.fg;q=_.Di(v);d=d.a(c,_.mb);c=d.map(y=>cR(a,b,u,g,v,f||"",h,k,n,y)).filter(_.ki);if(0===c.length){if(e)return null;
|
|
58
|
+
throw new _.I(_.G,4,4003);}if(!b.wa.contentType||b.wa.contentType===YO){b.wa.contentType=IQ(c[0].mimeType,c[0].codecs);for(const y of c)y.type=b.wa.contentType}for(const y of c)for(const A of u.drmInfos)y.keyId&&!A.keyIds.includes(y.keyId)&&A.keyIds.push(y.keyId);c=dR(c,b.wa.contentType,m);e=d.map(y=>y.getAttribute("id")).filter(_.ki);return{id:b.wa.id||"__fake__"+a.h++,contentType:b.wa.contentType,language:q,originalLanguage:v,zd:h,streams:c,drmInfos:u.drmInfos,nf:l,pi:e}},UQ=function(a,b){return a.filter(c=>
|
|
59
|
+
c.contentType===b)},VQ=function(a,b,c,d){if(b||c)if(b&&c){if(_.AC(b.drmInfos,c.drmInfos)){var e=_.zC(b.drmInfos,c.drmInfos);for(var f of b.streams)for(const h of c.streams){var g=(h.bandwidth||0)+(f.bandwidth||0);g={id:a.h++,language:b.language,primary:b.zd||c.zd,audio:f,video:h,bandwidth:g,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0};d.push(g)}}}else{f=b||c;for(e of f.streams)g=e.bandwidth||0,g={id:a.h++,language:f.language||_.fg,primary:f.zd,audio:b?e:null,video:c?e:null,bandwidth:g,
|
|
60
|
+
drmInfos:f.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},d.push(g)}},WQ=function(a,b){return null!==a.duration?a.start+a.duration:0<b.length?(b=b.filter(c=>0<c.streams.length).map(c=>c.streams).flat().filter(c=>c.getLastSegmentEndTime).map(c=>c.getLastSegmentEndTime()),0<b.length?a.start+Math.min(...b):null):null},ZQ=function(a){let b=null;const c=_.Q.a(a,"Label").map(_.Q.f).filter(_.ki);c&&0<c.length&&(b=c[c.length-1]);null==b&&(b=a.getAttribute("label"));return b},$Q=function(a,b){let c=
|
|
61
|
+
!1;const d=_.Q.a(a,"Role");a=d.map(f=>f.getAttribute(_.mg)).filter(_.ki);let e=void 0;b&&(e=_.$B);for(const f of d)if(b=f.getAttribute(fP),null==b||"urn:mpeg:dash:role:2011"===b||"urn:mpeg:dash:role"===b)switch(b=f.getAttribute(_.mg),b){case _.pe:c=!0;break;case _.MB:case _.$B:e=b;break;case "forced-subtitle":case "forced_subtitle":case _.Ud:e=_.Ud}return{zd:c,roles:a,kind:e}},aR=function(a){var b=_.Q.a(a,OO);a=null;for(const c of b){b=c.getAttribute(fP)||"";const d=c.getAttribute(_.mg);if(b!==$O&&
|
|
62
|
+
!eR.includes(b)||void 0===d)throw new _.li("Unrecognized essential property");b===$O&&(a=d.split(" "))}return a},bR=function(a){const b=new Map;for(const e of a)if(a=e.getAttribute(fP),"urn:scte:dash:cc:cea-608:2015"===a||"urn:scte:dash:cc:cea-708:2015"===a){a=1;var c=e.getAttribute(_.mg);if(null!=c)for(const f of c.split(";")){if(f.includes("\x3d")){var d=f.split("\x3d");c=d[0].startsWith("CC")?d[0]:"CC"+d[0];d=d[1].split(",")[0].split(":").pop()}else c="CC"+a,a+=2,d=f;b.set(c,_.Di(d))}else b.set("CC1",
|
|
63
|
+
_.fg)}return b},cR=function(a,b,c,d,e,f,g,h,k,l){const m=_.Q,n=_.Di(e);b.O=RQ(a,l,b.wa,null,null);if(!fR(a,b.O))return a.g.warn("Skipping Representation",b.O),null;b.ic=`${b.Ha.id} ${b.O.id}`;b.xd=a.F.get(b.ic);b.bandwidth=m.$(l,"bandwidth",AP)||0;const q=gR(a,b);if(!q)return null;a.F.set(b.ic,q.Ca);var u=m.a(l,NO);a=DQ(u,c,a.a.ignoreDrmInfo,b.Ha.id,a.a.playreadyVersion||null);u=!1;m.a(l,"SupplementalProperty").some(v=>"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===v.getAttribute(fP)&&"JOC"===
|
|
64
|
+
v.getAttribute(_.mg))&&(b.O.mimeType="audio/eac3-joc",u=!0);l=hR(b,l);return{id:_.xJ++,originalId:b.O.id,createSegmentIndex:q.createSegmentIndex,findSegmentPosition:q.findSegmentPosition,getSegmentReference:q.getSegmentReference,initSegmentReference:q.initSegmentReference,adjustSegmentDurations:q.adjustSegmentDurations,getLastSegmentEndTime:q.getLastSegmentEndTime,getDuration:q.getDuration,segmentLookupStrategy:_.QB,mimeType:b.O.mimeType,codecs:b.O.codecs,frameRate:b.O.frameRate,bandwidth:b.bandwidth,
|
|
65
|
+
width:b.O.width,height:b.O.height,kind:d,encrypted:0<c.drmInfos.length,keyId:a,language:n,originalLanguage:e,label:f,type:b.wa.contentType,primary:g,trickModeVideo:null,emsgSchemeIdUris:b.O.emsgSchemeIdUris,roles:h,channelsCount:b.O.Ne,spatialAudio:u,closedCaptions:k,horizontalTiles:l.horizontalTiles,verticalTiles:l.verticalTiles,durationPerTile:l.durationPerTile}},dR=function(a,b,c){const d=b===_.$B?_.H:b;b=c.map(e=>({scheme:e.getAttribute(fP)||"",id:e.getAttribute("id")||void 0,value:e.getAttribute(_.mg)||
|
|
66
|
+
"",protocol:"DASH",type:d}));for(const e of a)e.accessibility=b;return a},fR=function(a,b){let c;c=b.Fd?1:0;c+=b.gc?1:0;c+=b.hc?1:0;if(0===c){if(b.contentType===_.H||b.contentType===YO)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,",
|
|
67
|
+
"SegmentList, or SegmentTemplate.",b),b.Fd?(a.g.info("Using SegmentBase by default."),b.gc=null):a.g.info("Using SegmentList by default."),b.hc=null);return!0},gR=function(a,b){var c=b.O.contentType;c=c===_.H||c===YO;try{if(b.O.Fd){{var d=Number(FP(b,ZP,eP))||0,e=FP(b,ZP,hP),f=1;e&&(f=AP(e)||1);f=d/f||0;const k=YP(b,ZP);{d=k;e=f;const l=b.O.mimeType.split("/")[1];if(b.O.contentType!==_.H&&"mp4"!==l&&"webm"!==l)throw _.th("SegmentBase specifies an unsupported container type.",b.O),new _.I(_.G,4,4006);
|
|
68
|
+
if("webm"===l&&!d)throw _.th(TO,"the SegmentBase uses a WebM container,","but does not contain an Initialization element.",b.O),new _.I(_.G,4,4005);const m=GP(b,ZP,"RepresentationIndex"),n=FP(b,ZP,"indexRange");let q=b.O.na,u=yP(n||"");if(m){const v=m.getAttribute("sourceURL");v&&(q=_.tC(b.O.na,[v]));u=_.Q.$(m,"range",yP,u)}if(!u)throw _.th(TO,"the SegmentBase does not contain @indexRange","or a RepresentationIndex element.",b.O),new _.I(_.G,4,4002);b.presentationTimeline.B=null;var g=aQ(b,d,q,u.start,
|
|
69
|
+
u.end,l,e)}var h={createSegmentIndex:g.createSegmentIndex,findSegmentPosition:g.findSegmentPosition,getSegmentReference:g.getSegmentReference,adjustSegmentDurations:g.adjustSegmentDurations,getDuration:g.getDuration,initSegmentReference:k,getLastSegmentEndTime:g.getLastSegmentEndTime,Ca:f}}}else h=b.O.gc?nQ(b,a.H):b.O.hc?hQ(b,a.H,!!a.f):iR(b);return h}catch(k){if(c&&4002===k.code)return a.g.debug("Ignoring DASH_NO_SEGMENT_INFO error in a text stream",k),null;throw k;}},hR=function(a,b){const c={};
|
|
70
|
+
if(a.O.contentType===_.ce){var d=(b=_.Q.h(b,OO))&&b.getAttribute(fP);d=d||"";jR.includes(d)&&(b=_.yC(b.getAttribute(_.mg)||""))&&(c.horizontalTiles=b.nd,c.verticalTiles=b.Kd,a.wa.hc&&(d=_.Q.$(a.wa.hc,ZO,BP)||0,a=_.Q.$(a.wa.hc,hP,BP)||1,a=d/a))&&(c.durationPerTile=a/b.Hi)}return c},iR=function(a){const b=a.O.na,c=a.Ba.duration||0,d=()=>c;return{createSegmentIndex:()=>Promise.resolve(),findSegmentPosition:e=>0<=e&&e<c?1:null,getSegmentReference:e=>1!==e?null:new _.wD(1,0,c,()=>b,0,null,0,null,null,
|
|
71
|
+
null,null,null,null,null,null,()=>"",a.O.La),adjustSegmentDurations:()=>{},getDuration:d,getLastSegmentEndTime:d,verticalTiles:void 0,horizontalTiles:void 0,initSegmentReference:null,Ca:0}},XQ=function(a,b){b=b.slice();for(const c of a)(a=c.getAttribute(fP))&&!b.includes(a)&&b.push(a);return b},YQ=function(a,b){for(const d of b){b=d.getAttribute(fP);if(!b)continue;const e=d.getAttribute(_.mg);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=
|
|
72
|
+
parseInt(e,10);if(!c){a.g.warn(MO,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(MO,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};_.dv.prototype.Hd=nP(19,function(a){return a});
|
|
73
|
+
_.MC.prototype.Hd=nP(18,function(a){const b=Array.from(a.a.entries()).map(([d,e])=>`xmlns:${e}="${d}"`).join(" "),c=(new DOMParser).parseFromString(`<?xml version="1.0"?><${a.tagName} `+`${b}/>`,_.Vf).childNodes[0];Object.keys(a.attributes).forEach(d=>{c.setAttribute(d,a.attributes[d])});a.childNodes.forEach(d=>{d.tagName===_.da?c.textContent+=d.textContent:c.appendChild(this.Hd(d))});return c});
|
|
74
|
+
_.dv.prototype.ne=nP(17,function(a,b){Array.from(a.attributes).forEach(c=>{c.namespaceURI===b&&a.removeAttributeNS(c.namespaceURI,c.localName)})});_.MC.prototype.ne=nP(16,function(a,b){if(b=a.a.get(b)){var c=`${b}:`;Object.keys(a.attributes).forEach(d=>{d.startsWith(c)&&delete a.attributes[d]})}});_.dv.prototype.ae=nP(15,function(a,b){for(const c of a.attributes)b.setAttributeNS(c.namespaceURI,c.nodeName,c.value)});
|
|
75
|
+
_.MC.prototype.ae=nP(14,function(a,b){Object.keys(a.attributes).forEach(c=>{b.attributes[c]=a.attributes[c]})});_.dv.prototype.be=nP(13,function(a,b){Array.from(a.childNodes).forEach(c=>{a.removeChild(c);b.appendChild(c)})});_.MC.prototype.be=nP(12,function(a,b){b.childNodes.push(...a.childNodes);a.childNodes=[]});_.dv.prototype.me=nP(11,function(a){Array.from(a.childNodes).forEach(b=>{a.removeChild(b)})});_.MC.prototype.me=nP(10,function(a){a.childNodes=[]});_.dv.prototype.Jc=nP(9,function(){return document.createElement("null")});
|
|
76
|
+
_.MC.prototype.Jc=nP(8,function(){return new _.KC("NULL",null,{},[],null,null,new Map)});_.dv.prototype.Td=nP(7,function(a){return Array.from(a.childNodes).filter(b=>b instanceof Element)});_.MC.prototype.Td=nP(6,function(a){return a.childNodes});_.dv.prototype.$=nP(5,function(a,b,c,d=null){let e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});_.MC.prototype.$=nP(4,function(a,b,c,d=null){let e=null;a=a.getAttribute(b);null!=a&&(e=c(a));return null==e?d:e});
|
|
77
|
+
_.dv.prototype.sc=nP(3,function(a,b,c){return Array.from(a.childNodes).filter(d=>d instanceof Element&&d.localName===c&&d.namespaceURI===b)});_.MC.prototype.sc=nP(2,function(a,b,c){b=a.a.get(b);if(!b)return[];const d=`${b}:${c}`;return a.childNodes.filter(e=>e.tagName===d)});_.dv.prototype.Pb=nP(1,function(a,b,c){a=this.sc(a,b,c);return 1!==a.length?null:a[0]});_.MC.prototype.Pb=nP(0,function(a,b,c){a=this.sc(a,b,c);return 1!==a.length?null:a[0]});
|
|
78
|
+
var jR=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],eR=["urn:mpeg:mpegB:cicp:ColourPrimaries","urn:mpeg:mpegB:cicp:MatrixCoefficients","urn:mpeg:mpegB:cicp:TransferCharacteristics"];var VP=class{constructor(a){this.f=a;this.a=new _.pn(a,!1)}},RP=[[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]],SP=class{constructor(a,b){this.id=a;this.a=b}};var $P=class{parse(a,b,c,d){var e;b=new VP(new DataView(b));if(440786851!==TP(b).id)throw _.th("Not an EBML element."),new _.I(_.G,3,3008);var f=TP(b);if(408125543!==f.id)throw _.th("Not a Segment element."),new _.I(_.G,3,3009);b=f.a.byteOffset;f=new VP(f.a);for(e=null;_.cm(f.a);){var g=TP(f);if(357149030===g.id){e=g;break}}if(!e)throw _.th("Not an Info element."),new _.I(_.G,3,3010);f=new VP(e.a);g=1E6;for(e=null;_.cm(f.a);){const h=TP(f);if(2807729===h.id)g=UP(h);else if(17545===h.id)if(e=h,4===
|
|
79
|
+
e.a.byteLength)e=e.a.getFloat32(0);else if(8===e.a.byteLength)e=e.a.getFloat64(0);else throw new _.I(_.G,3,3003);}if(null==e)throw new _.I(_.G,3,3011);f=g/=1E9;e*=g;a=TP(new VP(new DataView(a)));if(475249515!==a.id)throw _.th("Not a Cues element."),new _.I(_.G,3,3007);return XP(a,b,f,e,c,d)}};var kR=class{constructor(a,b){this.g=a;this.f=b;this.a={clockSyncUri:void 0}}};var sQ=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",_.Ne).set(mP,_.td).set(lP,_.rd).set("urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95",_.rd).set("urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2",_.pd).set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb",_.od),CQ=(new Map).set(_.td,function(a){const b=EQ(a);if(b)return{licenseUrl:b,origin:_.PB};if(a=_.Q.Pb(a.node,"urn:microsoft","laurl"))if(a=a.getAttribute("licenseUrl"))return{licenseUrl:a,origin:"ms:laurl"};return null}).set(_.rd,
|
|
80
|
+
function(a){var b=_.Q;const c=EQ(a);if(c)return{licenseUrl:c,origin:_.PB};a=b.Pb(a.node,iP,"pro");if(!a)return null;b=b.f(a);if(!b)return null;b=_.Ol(b);return(b=_.wn(b).h)?{licenseUrl:b,origin:"mspr:pro"}:null}),uQ=new _.T("clpp.dash.ContentProtection");var lR=class{constructor(){this.D=this.a=null;this.o=[];this.f=null;this.G=[];this.h=1;this.H={};this.l=0;this.I=new _.yJ(5);this.B=new _.wk(()=>{this.Vb()});this.A=new _.pu;this.j=new Map;this.g=new _.T("clpp.dash.DashParser");this.C=null;this.J=new kR(this.g,(a,b)=>{a=_.sj(a,this.a.attemptParameters);a.type=5;a.method=b;b=this.D.networkingEngine.fetch(a);_.Bj(this.A,b);return b.T});this.F=new Map;this.K=!1;this.w=null}configure(a){this.a=a;this.J.a={clockSyncUri:a.clockSyncUri}}start(a,b){const c=
|
|
81
|
+
this;return _.x(function*(){c.o=[a];c.D=b;const d=yield KQ(c);c.D&&LQ(c,d);if(!c.D)throw new _.I(_.G,7,7001);return c.f})}requestStop(){this.K=!0}stop(){this.a=this.D=null;this.o=[];this.f=null;this.G=[];this.H={};this.C=null;this.l=-1;this.B.stop();this.F.clear();this.j.clear();return this.A.destroy()}update(){KQ(this).catch(a=>{if(this.D&&a)this.D.onError(a)})}setCurrentVariant(){}Vb(){const a=this;return _.x(function*(){a.g.debug(_.GB);let b=0;try{b=yield KQ(a)}catch(c){if(a.D&&c.a&&(a.D.onError(c),
|
|
82
|
+
c.severity===_.G))return}a.D&&(a.K?yield a.stop():LQ(a,b))})}loadVariant(a){return _.x(function*(){return a})}loadTextStream(a,b){const c=this;return _.x(function*(){let d;const e=c.f.periods.find(f=>f.id===b);e&&(d=e.textStreams.find(f=>f.id===a)||null);if(!d)throw new _.li(`Could not load text stream with id: ${a}`);return d})}};_.z("clpp.dash.DashComponent",class extends _.Dv{f(){_.dt.mpd=lR;_.bt[_.uc]=lR}a(){_.VD("mpd");_.WD(_.uc)}id(){return"dash"}});};f.call(g, window);
|