@castlabs/prestoplay 6.33.0 → 6.34.0-beta.1
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 +16 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +19 -19
- package/cjs/cl.cast.js +129 -129
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +633 -624
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +101 -101
- package/cjs/cl.externs.js +48 -72
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +76 -76
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +26 -26
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +357 -353
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -5
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +73 -73
- 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 +36 -36
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +100 -100
- package/cl.conviva.js +27 -27
- package/cl.core.js +510 -502
- package/cl.crypto.js +9 -9
- package/cl.dash.js +90 -90
- package/cl.externs.js +51 -63
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +20 -20
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +308 -306
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +5 -5
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +61 -61
- 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 +31 -31
- package/package.json +1 -1
- package/typings.d.ts +33 -46
package/cl.core.js
CHANGED
|
@@ -1,356 +1,367 @@
|
|
|
1
|
-
let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_.
|
|
6
|
-
_.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_.
|
|
10
|
-
_.
|
|
11
|
-
|
|
12
|
-
_.
|
|
13
|
-
_.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_.
|
|
18
|
-
_.
|
|
19
|
-
_.
|
|
20
|
-
|
|
21
|
-
_.
|
|
22
|
-
|
|
23
|
-
_.
|
|
24
|
-
_.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
_.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
a
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_.
|
|
77
|
-
|
|
78
|
-
_.
|
|
79
|
-
|
|
80
|
-
_.
|
|
81
|
-
|
|
82
|
-
yk=function(a
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
b.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
b,
|
|
120
|
-
Rl=function(a){
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
_.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
_.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
_.
|
|
139
|
-
_.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
a.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
_.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
_.
|
|
201
|
-
|
|
202
|
-
_.
|
|
203
|
-
_.hp=function(a){return b=>{const c=b.reader.Ra()-b.reader.getPosition();a(_.cp(b.reader,c))}};_.ip=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};jp=function(a){let b="";try{b=_.li(a)}catch(c){}return b};_.lp=function(a){a=jp(a);let b="";a.length&&(b=(new _.kp(a)).a);return b};
|
|
204
|
-
np=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.ii(a)),d=_.Ul(c.sinf[0]);(new _.mp).N(_.If,_.fp).N("schi",_.fp).N("tenc",e=>{e.reader.skip(6);_.Yo(e.reader)&&(e.reader.skip(1),b=_.Wl(_.cp(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
|
|
205
|
-
pp=function(a,b,c){if(!c||!c.byteLength)throw new _.I(_.D,6,6102);let d;typeof b===_.Pf?d=_.ni(b,!0):d=b;a=_.ni(jp(a),!0);b=new _.op(12+a.byteLength+d.byteLength+c.byteLength,!0);_.M(b,a.byteLength);_.Vo(b,_.G(a));_.M(b,d.byteLength);_.Vo(b,_.G(d));_.M(b,c.byteLength);_.Vo(b,_.G(c));return _.G(b.buffer)};_.qp=function(a){var b=_.G(a.body);b=_.Tl(b);a.headers[_.ta]=_.Ac;a.body=_.mi("spc\x3d"+b).buffer};
|
|
206
|
-
_.rp=function(a){let b;try{b=_.ii(a.data)}catch(c){return}b=b.trim();"\x3cckc\x3e"===b.substr(0,5)&&"\x3c/ckc\x3e"===b.substr(-6)&&(b=b.slice(5,-6));try{const c=JSON.parse(b);c.ckc&&(b=c.ckc);c.CkcMessage&&(b=c.CkcMessage);c.License&&(b=c.License)}catch(c){}a.data=gi(_.Ul(b))};
|
|
207
|
-
wp=function(a){switch(a){case sp:return"https://lic.drmtoday.com";case tp:return"https://lic.staging.drmtoday.com";case up:return"https://lic-demo.staging.drmtoday.com";case vp:return"https://lic.test.drmtoday.com";default:throw new _.ll(`Cannot infer DRMtoday base URL for environment: ${a}`);}};_.xp=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};
|
|
208
|
-
_.yp=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.bh(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers["x-dt-auth-token"]=b)}};Ap=function(a){const b={},c=a?a[Lg]:void 0;a=zp[a?a[Lg]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};
|
|
209
|
-
Cp=function(a){a=a["x-dt-li"];if(!a)return null;try{const b=JSON.parse(atob(a));a={};b.ti&&(a.requestId=b.ti);b.rpd&&(a.delay=Number(b.rpd)/1E3);return a}catch(b){return _.Bp.warn("Unable to parse DRMtoday License Info header (x-dt-li)",b),null}};_.Ep=function(a){a=Dp[a];if(!a)return null;const b=_.hj();return b.os===aj&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};Fp=function(a,b){a.size=void 0===b?0:1;a.g.debug("Setting key status to",b);a.a=b};
|
|
210
|
-
Hp=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Gp.value().get(b),c.one(a,b,d))};
|
|
211
|
-
Ip=function(a,b){a.f=b;_.Sh(a.a);if(!b)return Promise.resolve();a.a.on(b,Qd,c=>{_.th("AppleEmeManager.cancelNativeMediaEncryptedEvent_",c);"MediaEncryptedEvent"in window&&c instanceof MediaEncryptedEvent&&(a.g.info("Cancel native MediaEncryptedEvent when using Apple-prefixed EME"),c.stopImmediatePropagation())});a.a.on(b,Hg,c=>{{a.g.debug("Handle webkitNeedKey event");c=_.G(c.initData);if(_.fi(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=ki(c.subarray(4),
|
|
212
|
-
!0);c=_.mi(c);const d=new Event(Qd);d.initDataType="skd";d.initData=gi(c);a.f.dispatchEvent(d)}});Hp(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.h));return Promise.resolve()};Jp=function(a,b){Fp(a.keyStatuses,b);b=new _.H(ee);a.dispatchEvent(b)};
|
|
213
|
-
Mp=function(a,b){a.a=b;_.Sh(a.f);b&&(a.f.on(b,a.h+"needkey",c=>{{const d=new Event(Qd);d.initDataType=_.Tc;d.initData=gi(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.h+"keymessage",c=>{{const e=Kp(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.H(_.se,{messageType:d?he:ge,message:c.message});d=e;_.th("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.uh("Session not found",c.sessionId)}}),a.f.on(b,a.h+"keyadded",c=>{(c=Kp(a,
|
|
214
|
-
c.sessionId))&&c.ready()}),a.f.on(b,a.h+"keyerror",c=>{var d=Kp(a,c.sessionId);if(d){{var e=Error("EME v0.1b key error");const f=c.errorCode;f.systemCode=c.systemCode;e.errorCode=f;!c.sessionId&&d.f?(45===c.systemCode&&(e.message="Unsupported session type."),d.f.reject(e),d.f=null):c.sessionId&&d.a?(d.a.reject(e),d.a=null):(e=c.systemCode,c.errorCode.code===MediaKeyError.MEDIA_KEYERR_OUTPUT?Lp(d,_.Ne):1===e?Lp(d,"expired"):Lp(d,_.de))}}}))};
|
|
215
|
-
Kp=function(a,b){let c=a.l.get(b);return c?c:(c=a.j.shift())?(c.sessionId=b,a.l.set(b,c),c):null};Lp=function(a,b){Fp(a.keyStatuses,b);b=new _.H(ee);a.dispatchEvent(b)};Np=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
|
|
216
|
-
Op=function(a,b,c){if(a.o)return Promise.reject(Error("The session is already initialized."));a.o=!0;let d;try{if(a.l===_.Qe)if(c)d=_.G(_.mi("LOAD_SESSION|"+c));else{const f=_.mi("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.G(b),f.byteLength);d=g}else d=_.G(b)}catch(f){return Promise.reject(f)}a.f=new _.Cl;const e=Np(a,"generateKeyRequest");try{a.j[e](a.h,d)}catch(f){if(f.name!==Ia)return a.f=null,Promise.reject(f);(new _.Hi(()=>{try{a.j[e](a.h,d)}catch(g){a.f.reject(g),
|
|
217
|
-
a.f=null}})).la(.01)}return a.f};Pp=function(a,b,c){if(a.a)a.a.then(()=>Pp(a,b,c)).catch(()=>Pp(a,b,c));else{a.a=b;if(a.h===Dg){var d=_.ii(c);var e=JSON.parse(d);"oct"!==e.keys[0].kty&&(a.a.reject(Error("Response is not a valid JSON Web Key Set.")),a.a=null);d=_.Ul(e.keys[0].k);e=_.Ul(e.keys[0].kid)}else d=_.G(c),e=null;var f=Np(a,"addKey");try{a.j[f](a.h,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
|
|
218
|
-
Sp=function(a,b){var c=Qp;if(a){var d=c.find(e=>e.a()===a);if(d)return Rp.info(Fb+d.a()),d.create();Rp.info("Cannot create selected EME manager, falling back to the default.")}if(b&&(d=c.find(e=>e.a()===b)))return Rp.info(Fb+d.a()),d.create();c=c[0];if(!c)throw Error("Missing EME managers.");Rp.info(Fb+c.a());return c.create()};_.Vp=function(a){var b=_.Vl(a);b=parseInt(b.byteLength,10).toString(16);b=_.Vl("12"+b+a);return new Tp(Up,a,b)};
|
|
219
|
-
_.Xp=function(a){const b=new _.Wp(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.N(b);var c=_.N(b);c=_.ep(c);var d=_.N(b);const e=d>>>24;d&=16777215;var f=_.cp(b,16);f=_.Wl(f);if(0<e){var g=_.N(b);b.skip(16*g)}g=_.N(b);const h=()=>{let u=_.Yo(b),x=(u&127)>>>0,y=7;for(;128<=u&&28>=y;)u=_.Yo(b),x=(x|(u&(28>y?127:15))<<y)>>>0,y+=7;return 28<y?-1:x},k=u=>{switch(u){case 0:do if(!_.Wo(b))throw Error("not enough data to skip!");while(_.Yo(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
|
|
220
|
-
break;case 3:for(;4!==(u=h()&7);)k(u);break;case 5:b.skip(4);break;default:throw Error("invalid wire type "+u);}},l=[];let m=null;for(;_.Wo(b);){var n=h(),p=n&7;n>>>=3;if(2===p){p=h();if(0>p)throw Error(`unable to read length of field ${n}`);p=bp(b,p);2===n?l.push(p):4===n&&(m=p)}else k(p)}_.th("Parsed WV PSSH Box","size",a,"name",c,og,e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.Sl(m):"","keyIds",l.map(u=>_.Wl(u)));return 0<l.length?_.Vp(_.Wl(l[0])):null};
|
|
221
|
-
_.Yp=function(a){const b=[];b.push(a[3]);b.push(a[2]);b.push(a[1]);b.push(a[0]);b.push(a[5]);b.push(a[4]);b.push(a[7]);b.push(a[6]);a=_.G(a);a.set(b,0);return a};
|
|
222
|
-
_.cq=function(a){var b=_.O;a:{var c=new _.Wp(new DataView(a.buffer),!0);_.N(c);for(_.Zo(c);_.Wo(c);)if(1===_.Zo(c)){var d=_.Zo(c);c=_.cp(c,d);break a}c=null}c||(c=a);a=ki(c,!0);d=b.j(a,"WRMHEADER");a=d.getAttribute(og)||"";d=b.h(d,"DATA");var e=b.h(d,"LA_URL");b=e?b.f(e):"";var f=_.O;if(e=f.h(d,"KID"))if(e=f.f(e)){var g=f.h(d,oa);f=g?f.f(g):null;e={value:e,Ue:f}}else e=null;else e=null;d=e?[e]:(e=Zp(d))?[e]:(d=$p(d))?d:null;const {value:h="",Ue:k}=d&&d[0]||{};d=_.Ul(h);d=_.Yp(d);d=_.Wl(d);return new _.aq(_.bq,
|
|
223
|
-
d,b,c,a,k)};Zp=function(a){var b=_.O;a=b.h(a,"PROTECTINFO");if(!a)return null;var c=b.h(a,"KID");if(!c)return null;b=c.getAttribute("VALUE");if(!b)return null;a=c.getAttribute(oa);c=c.getAttribute("ALGID");return{value:b,Ue:a,wh:c}};
|
|
224
|
-
$p=function(a){var b=_.O;a=b.h(a,"PROTECTINFO");if(!a)return null;a=b.h(a,"KIDS");if(!a)return null;a=b.a(a,"KID");if(!a.length)return null;b=[];for(const c of a)if(a=c.getAttribute("VALUE")){const d=c.getAttribute(oa),e=c.getAttribute("ALGID");b.push({value:a,Ue:d,wh:e})}return b.length?b:null};dq=function(a){return _.v(function*(){const b=new Promise(c=>{(new _.Hi(c)).la(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.B("Timeout waiting for session close")})};
|
|
225
|
-
_.fq=function(a){return eq(a)?_.qd:a};gq=function(a,b){const c=[];b.forEach((d,e)=>{c.push({keySystem:e,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})});for(const d of a)d.drmInfos=c};
|
|
226
|
-
hq=function(a,b){b=b[_.fq(a.keySystem)];a.keyIds||(a.keyIds=[]);b&&(a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=b.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=b.persistentStateRequired),a.videoRobustness||(a.videoRobustness=b.videoRobustness||""),a.audioRobustness||(a.audioRobustness=b.audioRobustness||""),a.serverCertificate||(a.serverCertificate=b.serverCertificate||null))};
|
|
227
|
-
_.iq=function(a,b){b=_.Om(a.mimeType,b||a.codecs);if(_.zm(b,a.type)){a=a.type;var c=_.zm(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};jq=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};lq=function(a){return(a.audioCapabilities||[]).some(kq)||(a.videoCapabilities||[]).some(kq)};
|
|
228
|
-
mq=function(a,b){a=_.lp(b);_.th("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
|
|
229
|
-
oq=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&h===nq){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.dh(k)||(k=mq);let l="";try{l=k(b,c,g)}catch(m){throw new _.I(_.D,6,6103);}if(!l.length)throw new _.I(_.D,6,6101,"Content ID is an empty string");c=pp(c,l,a)}return c};pq=function(a){return!!a.match(/^com\.widevine\.alpha/)};eq=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
|
|
230
|
-
kq=function(a){return null!=a.robustness&&""!==a.robustness};qq=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.Xl(g,f.serverCertificate))||c.push(f.serverCertificate));if(f.initData){for(const g of f.initData)g.periodId=f.periodId;for(const g of f.initData)d.some(h=>h.keyId&&h.keyId===g.keyId&&h.periodId===g.periodId?!0:!1)||d.push(g)}if(f.keyIds)for(a=0;a<f.keyIds.length;++a)e.includes(f.keyIds[a])||e.push(f.keyIds[a])}};
|
|
231
|
-
rq=function(a){var b=a.o;const c=a.Z;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"===d)&&a.w(new _.I(_.D,6,6014));a.D.lf(_.kh(c));a.A||a.g.info(va);a.A=!0;a.F=!1};sq=function(a){a.h.forEach((b,c)=>{const d=b.gf;let e=c.expiration;isNaN(e)&&(e=Infinity);e!==d&&(a.D.kf(c.sessionId,e),b.gf=e)})};
|
|
232
|
-
tq=function(a){return _.v(function*(){a.B.release();a.B=null;a.M.release();a.M=null;a.A=!1;a.F=!1;a.H.reject();a.ca.stop();a.ca=null;a.U.stop();a.U=null;const b=Array.from(a.h.keys());for(const c of a.h.values())c.Wc&&c.Wc.stop();a.h.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.v(function*(){a.g.debug("Closing session",c.sessionId);try{yield dq(c)}catch(d){a.g.warn("Error while closing session",d)}}))));if(a.C){try{yield a.l.h(null)}catch(c){a.g.warn("Error while resetting media keys",
|
|
233
|
-
c)}a.C=null}a.l=null;a.a=null;a.J.clear();a.I=null;a.L=[];a.f=null;a.w=null;a.D=null;a.R=0;a.P=null})};_.zq=function(a,b){const c=uq(a,b),d=vq(b);for(const e of d)wq(a,e,a.f.Ka);b=xq(a,b);if(!b.size)return a.S=!0,Promise.resolve();_.qm(Dd);a=_.yq(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.qm(Cd);_.sm("DRM queryMediaKeys_()",Dd,Cd)})};
|
|
234
|
-
_.Bq=function(a,b,c){c=void 0===c?[]:c;a.K=Aq;a.L=c;a.G=0<c.length;a.g.debug("Using Persisted Licenses: "+a.G);a.f&&a.f.enableSessionCacheForSkd&&a.g.info("Enabled session cache for SKD license requests");return _.zq(a,b)};
|
|
235
|
-
_.yq=function(a,b){if(1===b.size&&b.has(""))return Promise.reject(new _.I(_.D,6,6E3));null===a.l&&(a.l=Sp(a.f.emeApi,a.lb));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.Cl;const e=_.hj(),f=(k,l,m)=>{l.drmInfos.some(n=>!!n.licenseServerUri)===k&&(d=d.catch(()=>{if(a.j)return null;if(m===_.qd){if((_.Ji()||e.os===cj&&_.Ki("Chrome")&&!_.Ji())&&!a.f.Ka[m].useLegacySystem)return l.label=rd,a.l.a(rd,
|
|
236
|
-
[l]).catch(()=>{a.g.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");l.label=_.qd;jq(l);return a.l.a(m,[l])});jq(l)}if(m===_.sd&&a.f.widevineVersion!==_.sd){const n=a.f.widevineVersion;if(!n.startsWith(_.sd))return a.g.error(`Invalid "widevineVersion" value "${n}".`),Promise.reject();const p=Object.assign({},l,{label:n,distinctiveIdentifier:_.Le,persistentState:_.Le});return a.l.a(n,[p]).catch(()=>a.l.a(m,[l]))}return a.l.a(m,[l]).catch(n=>
|
|
237
|
-
{a:{if(m===_.sd&&lq(l)){const p=_.hj();if(lq(l)&&p.os===aj&&p.browser===Xc){a.g.warn("requestMediaKeySystemAccess() failed",n);a.g.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");jq(l);n=a.l.a(m,[l]);break a}}throw n;}return n})}))};let g=a.f.preferredDrmSystem;if(!g){var h=_.hj();if(h.os===cj&&10<=h.osVersion.major&&"edge"===h.browser)g=_.qd;else if("safari"===h.browser)g=_.od;else if(h.browser===Xc||"firefox"===h.browser)g=_.sd}g&&(h=
|
|
238
|
-
b.get(g))&&(f(!0,h,g),f(!1,h,g));for(const k of[!0,!1])b.forEach((l,m)=>{m!==g&&f(k,l,m)});d=d.catch(()=>{throw new _.I(_.D,6,6001,"Failed to get MediaKeySystemAccess.");});d=d.then(k=>{if(a.j)return null;a.J.clear();var l=k.getConfiguration();a.g.info("Got MediaKeySystemAccess with configuration",l);var m=l.audioCapabilities||[];l=l.videoCapabilities||[];for(var n of m)a.J.add(n.contentType.toLowerCase());for(var p of l)a.J.add(p.contentType.toLowerCase());{m=k.keySystem;n=b.get(_.fq(k.keySystem));
|
|
239
|
-
p=[];l=[];const u=[],x=[];qq(n.drmInfos,p,l,u,x);1<l.length&&_.B("Multiple unique server certificates found! Only the first will be used.");1<p.length&&_.B("Multiple unique license server URIs found! Only the first will be used.");m={keySystem:m,licenseServerUri:p[0],distinctiveIdentifierRequired:n.distinctiveIdentifier===_.vf,persistentStateRequired:n.persistentState===_.vf,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:
|
|
240
|
-
"",serverCertificate:l[0],initData:u,keyIds:x,periodId:null}}a.a=m;if(!a.a.licenseServerUri)throw new _.I(_.D,6,6012,a.a.keySystem);return k.createMediaKeys()}).then(k=>{a.j||(a.g.info("Created MediaKeys for key system",a.a.keySystem),a.I=k,a.S=!0)}).catch(k=>{if(!a.j){a.a=null;a.J.clear();if(k instanceof _.I)throw k;throw new _.I(_.D,6,6002,{browserError:k.message});}});c.reject();return d};
|
|
241
|
-
Cq=function(a){a=jh(a.f.Ka[_.Me]||{});if(0===a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.Vl(f);e=_.Vl(e);e={kty:"oct",kid:_.Tl(f,!1),k:_.Tl(e,!1)};b.push(e);c.push(e.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:_.mi(d),initDataType:"keyids"}];return{keySystem:_.Me,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
|
|
242
|
-
keyIds:[],periodId:null}};vq=function(a){const b=[];for(const c of a)for(const d of c.drmInfos)b.push(d);return b};Dq=function(a,b){for(const c of b)""===c.licenseServerUri||a.f.Ka[c.keySystem]||(a.f.Ka[c.keySystem]={licenseUrl:""})};
|
|
243
|
-
uq=function(a,b){const c=b.some(g=>0<g.drmInfos.length);if(!c){var d=jh(a.f.Ka);gq(b,d)}d=a.f.Ka[_.od];const e=b.some(g=>g.drmInfos.some(h=>h.keySystem===_.od));if(!1!==a.f.vj&&_.Ui()&&!e&&d)for(var f of b)f.drmInfos.push({keySystem:_.od,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null});if(f=Cq(a))for(const g of b)g.drmInfos=[f];b=vq(b);Dq(a,b);for(const g of b)hq(g,
|
|
244
|
-
a.f.Ka);return c};wq=function(a,b,c){const d=_.fq(b.keySystem);c=c[d];d===_.Me&&b.licenseServerUri?a.g.debug("Using Clear Key data URI for",d):c&&c.licenseUrl?(b.licenseServerUri=c.licenseUrl,a.g.debug("Using license server URI from user-configured clpp.drm.DrmEnvironment (licenseUrl) for",d)):a.g.debug("Using license server URI from the manifest for ",d)};
|
|
245
|
-
xq=function(a,b){var c=new Set(vq(b));const d=a.G?_.vf:_.Le,e=a.G?[_.Qe]:[Tf];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.Tc],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.Le,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.iq(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.Li()&&(h=_.iq(b,_.Pd));const k=c?_.iq(c):"";let l=null;c&&"ac-3"===c.codecs.toLowerCase()&&_.Li()&&(l=_.iq(c,_.Pd));
|
|
246
|
-
for(const m of f.drmInfos){const n=a.get(m.keySystem);n.drmInfos.push(m);m.initData&&m.initData.length&&(n.initDataTypes=[...new Set(m.initData.map(p=>p.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.vf);m.persistentStateRequired&&(n.persistentState=_.vf);b&&_.Uh(m.audioRobustness).forEach(p=>{const u={robustness:p||"",contentType:g};n.audioCapabilities.find(x=>x.robustness===u.robustness&&x.contentType===u.contentType)||n.audioCapabilities.push(u);h&&n.audioCapabilities.push({robustness:p||
|
|
247
|
-
"",contentType:h})});c&&_.Uh(m.videoRobustness).forEach(p=>{const u={robustness:p||"",contentType:k};n.videoCapabilities.find(x=>x.robustness===u.robustness&&x.contentType===u.contentType)||n.videoCapabilities.push(u);l&&n.videoCapabilities.push({robustness:p||"",contentType:l})})}}return a};Eq=function(a){return _.v(function*(){if(!a.l.o())if(a.P)yield a.P;else try{a.P=a.l.h(a.I),yield a.P}catch(b){a.j||a.w(new _.I(_.D,6,6003,b.message,b))}})};
|
|
248
|
-
_.Iq=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.G||a.K!==Aq)){var e=a.keySystem();if(!e.startsWith(_.od)&&b===_.Tc){const f=new Fq(c);if(1<f.a.length&&(e={"org.w3.clearkey":"1077efecc0b24d02ace33c1e52e2fb4b","com.widevine.alpha":"edef8ba979d64acea3c827dcd51d21ed","com.microsoft.playready":"9a04f07998404286ab92e65be0885f95","com.adobe.primetime":"f239e769efa348509c16a903c6932efb"}[e]))for(let g=0;g<f.f.length;g++)if(e===f.f[g]){c=c.subarray(f.a[g].start,f.a[g].end+1);break}}(a.C.webkitCurrentPlaybackTargetIsWireless||
|
|
249
|
-
_.Li(2)||a.keySystem().startsWith(_.od)||!_.Gq(a,d,c,!0))&&Hq(a,d,null,b,c)}};Jq=function(a,b){return _.v(function*(){a.g.info(`Handle encrypted event for type ${b.initDataType}`);yield Eq(a);b.initData&&_.Iq(a,b.initDataType,_.G(b.initData))})};Lq=function(a){return _.v(function*(){_.qm(Fd);const b=a.W.map(c=>Kq(a,c));a.ia=!0;a.W=[];yield Promise.all(b);_.qm(Ed);_.sm("drm.onPlay",Fd,Ed)})};
|
|
250
|
-
Nq=function(a){const b=a.keySystem(),c=a.f.Ka[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return Mq(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.sk([d],a.f.attemptParameters);f.type=3;f.licenseRequestType=Vc;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.g.debug("Fetching certificate");return a.D.Cb.fetch(f).V}).then(f=>{a.a.serverCertificate=_.G(f.data)}).catch(f=>{var g=
|
|
251
|
-
f.data.headers;g=Object.assign({message:za,url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},Ap(g));throw new _.I(_.D,6,6100,g,f);})};
|
|
252
|
-
_.Oq=function(a){return _.v(function*(){if(a.I&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.I.setServerCertificate(a.a.serverCertificate);void 0===b||b||a.g.debug("Server certificates are not supported by the key system. The server certificate has been ignored.")}catch(b){throw new _.I(_.D,6,6004,{browserError:b.message});}})};
|
|
253
|
-
_.Rq=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.Li(2);if(a.f.enforceSingleSession&&!a.keySystem().startsWith(_.od)){const e=a.h.values();for(const f of e)_.Xl(c.initData,f.initData)?(a.g.info("Skipping Session creation. Existing init data in single session mode!"),d=!1):f.periodId===c.periodId&&(a.g.info("Skipping Session creation. Merging init data for period in single session mode "+`for Key ID ${c.keyId}.`),Pq(c.initData,f)||(f.pe.push(c.initData),c.keyId&&!f.vb.includes(c.keyId)&&
|
|
254
|
-
f.vb.push(c.keyId),a.o.get(c.keyId)||a.o.set(c.keyId,Nf)),d=!1)}!d||a.G&&a.K===Aq||(_.Gq(a,c.keyId,c.initData)&&(d=!1),d&&(a.g.info("Request new media key session on create"),Hq(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.L)_.Qq(a,c);b.length||a.L.length||(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve());return a.H};
|
|
255
|
-
_.Tq=function(a,b){if(!a.I)return Th(a.B,b,()=>{a.w(new _.I(_.D,6,6010))}),Promise.resolve();a.C=b;a.l.l(b);a.B.one(a.C,_.Se,()=>Lq(a));a.B.on(a.C,_.Cg,e=>{const f=a.F;a.F=!a.A;!f&&a.F&&(a.g.info("Waiting for DRM license key delivery"),a.D.onEvent(e))});var c=a.a.initData.find(e=>0<e.initData.length);let d=Promise.resolve();if(c||a.l.f()!==Sq||a.L.length)d=Eq(a);c=Promise.resolve();_.Oi()&&38===_.Si().major||(a.a&&a.a.keySystem!==_.Me&&!a.a.serverCertificate&&(c=Nq(a)),c=c.then(()=>_.Oq(a)));return Promise.all([d,
|
|
256
|
-
c]).then(()=>{a.j||(_.Rq(a),a.B.on(a.C,Qd,e=>Jq(a,e)))}).catch(e=>{if(!a.j){if(6004===e.code&&a.a&&a.a.keySystem===_.sd&&1>a.R&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.g.warn("Detected invalid widevine server certificate!. Retrying"),a.w(new _.I(1,6,6004)),a.a.serverCertificate=null,a.R++,_.Tq(a,b);1<=a.R&&a.g.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
|
|
257
|
-
Mq=function(a,b){return _.v(function*(){const c=a.D.bd();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
|
|
258
|
-
_.Qq=function(a,b){let c;try{a.g.debug("Attempting to load an offline session",b),c=a.I.createSession(_.Qe)}catch(e){const f=new _.I(_.D,6,6005,{browserError:e.message});a.w(f);return Promise.reject(f)}a.B.on(c,_.se,a.bb.bind(a));a.B.on(c,ee,a.ab.bind(a));const d={initData:null,loaded:!1,gf:Infinity,vc:null,rb:new _.Cl,periodId:null,pe:[],keyId:null,vb:[],initDataType:null,Cc:null,sessionContext:{ldlDelay:0,customData:{}}};d.rb.catch(()=>{});a.h.set(c,d);return c.load(b).then(e=>{if(a.j)return null;
|
|
259
|
-
a.g.debug("Loaded offline session",b,e);if(!e)return a.h.delete(c),a.w(new _.I(_.D,6,6013)),null;d.loaded=!0;Uq(a)&&(a.A||a.g.info(va),a.A=!0,a.F=!1,a.H.resolve());return c},e=>{a.j||(a.h.delete(c),a.w(new _.I(_.D,6,6005,{browserError:e.message})))})};Pq=function(a,b){if(!a)return!1;for(let c=0;c<b.pe.length;c++)if(_.Xl(a,b.pe[c]))return!0;return!1};
|
|
260
|
-
_.Gq=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.h.keys()){const f=a.h.get(e);if(_.Xl(c,f.initData))return b?f.vb.includes(b)?d&&a.g.info("Skipping Session creation. "+`License for init data with Key ID ${b} was already `+`requested in Session: '${e.sessionId}'. `):(f.vb.push(b),a.o.get(b)||a.o.set(b,Nf),d&&a.g.info(nb+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.g.info(nb+`Session: '${e.sessionId}'`),!0;if(Pq(c,f))return d&&a.g.info("Skipping Session creation. License for init data was already requested [extra]"),
|
|
1
|
+
let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,fa,ma,pa,ta,wa,xa,za,Aa,Fa,Ga,Ha,Ia,Ja,La,Ma,Ra,Ta,Ua,Va,Wa,Za,$a,db,gb,lb,ob,pb,sb,vb,zb,Ab,Bb,Eb,Fb,Jb,Kb,Nb,Rb,Yb,Zb,$b,zc,Hc,Pc,Qc,Xc,Yc,Zc,cd,dd,ed,fd,hd,id,jd,kd,ld,qd,sd,vd,Bd,Cd,Dd,Ed,Gd,Hd,Id,Ld,Nd,Pd,Vd,ce,ee,fe,me,Ie,Pe,Re,Se,Te,Ue,Ve,We,Xe,Ye,Ze,$e,ef,ff,gf,hf,jf,kf,mf,rf,tf,If,Kf,Lf,Rf,dg,gg,mg,Bg,Cg,Dg,Eg,Fg,Hg,Ig,Jg,Pg,Qg,Tg,Ug,Zg,Wg,gh,hh,jh,mh,oh,wh,xh,yh,Bh,Ch,Ah,zh,Dh,Gh,Eh,Kh,Rh,Qh,bi,Uh,Th,ni,mi,oi,pi,qi,ti,ui,xi,Ki,Ni,Mi,Li,Ti,Ui,Yi,Si,Zi,Xi,$i,aj,Vi,Wi,
|
|
2
|
+
dj,ij,jj,ej,hj,gj,fj,lj,nj,mj,rj,sj,tj,wj,xj,yj,Gj,Jj,Kj,Lj,Nj,Oj,Rj,Qj,Vj,Yj,Zj,ak,dk,ek,fk,hk,ik,vk,xk,yk,wk,zk,Bk,Ck,Dk,Fk,Ek,Hk,Ik,Rk,sk,Uk,Tk,Sk,Vk,Wk,Xk,Yk,Zk,al,bl,el,fl,il,kl,ll,pl,rl,ml,ol,ql,sl,tl,ul,wl,xl,Bl,Ml,Ol,Pl,Ql,Sl,Tl,Ul,Vl,Wl,Xl,Nl,Zl,am,bm,cm,dm,em,Rl,Yl,$l,hm,jm,mm,om,pm,qm,vm,wm,xm,ym,Am,Bm,Fm,Gm,Hm,Qm,Sm,Ym,bn,dn,gn,ln,nn,qn,sn,tn,un,xn,vn,wn,yn,zn,An,Dn,Ln,Mn,Un,Xn,Yn,$n,bo,co,eo,fo,Vn,ao,go,ho,io,jo,so,lo,to,ko,mo,no,uo,zo,Bo,Do,Co,Fo,xo,Mo,Jo,Lo,Ko,Ao,No,Oo,Po,Qo,Ro,So,
|
|
3
|
+
To,Uo,ap,bp,cp,ep,fp,jp,lp,mp,np,ip,pp,qp,rp,vp,Ap,Bp,Cp,Dp,Ep,Gp,Hp,Ip,Jp,Xp,Sp,Zp,$p,aq,cq,dq,bq,gq,hq,iq,fq,Kp,Lp,Op,Pp,Qp,Rp,Tp,Up,Vp,Wp,pq,qq,Yp,eq,rq,mq,lq,oq,jq,sq,tq,uq,vq,wq,zq,Aq,xq,Iq,Jq,Kq,Hq,Sq,yq,Lq,Mq,Nq,Oq,Pq,Qq,Rq,Uq,Cq,Tq,Dq,Bq,Eq,Vq,Wq,Yq,Zq,Xq,$q,Fq,Gq,ar,br,er,fr,gr,dr,cr,ir,kr,mr,or,pr,qr,rr,sr,tr,ur,vr,wr,xr,yr,Dr,Hr,Er,Jr,Or,Qr,Sr,Ur,Vr,Wr,Yr,gs,Zr,$r,bs,is,es,Nr,js,ms,ns,os,ks,ls,ps,qs,ts,As,Bs,Es,Gs,Hs,Fs,Cs,ss,zs,us,vs,Ks,Ps,Ts,Us,Ws,bt,ct,dt,et,ft,gt,ht,it,tt,xt,Rg,Sg;
|
|
4
|
+
_.aa=" is registered.";ba=" is unsupported on this platform.";ca=" to a log level. Falling back to default!";_.da="#text";_.ea="6.34.0-beta.1";fa="APPLE";_.ha="AdaptationSet";_.ia="Already destroyed. No-op";_.ja="Already released. No-op";_.la="Autoplay is not allowed due to browser policy.";ma="Autoplay should not be used for preloaded streams. ";_.na="BANDWIDTH";_.oa="BASIC";pa="CHECKSUM";_.qa="CODECS";_.ra="Cannot retrieve buffer information due to platform limitations";_.sa="CastlabsPlayer";
|
|
5
|
+
ta="Content-Length";_.ua="Content-Type";_.va="Could not find configured DRM environment.";wa="DRM licenses loaded";xa="Destroying player";za="Error while decoding string!";Aa="Error while fetching certificate!";_.Ba="FairPlay Certificate URL is not defined";_.Ca="FairPlay License URL is not defined";_.Ea="GROUP-ID";Fa="HW_SECURE_ALL";Ga="HW_SECURE_CRYPTO";Ha="HW_SECURE_DECODE";Ia="HeaderDrm";Ja="InvalidStateError";_.Ka="LANGUAGE";La="License verification failed: ";Ma="Load interrupted while a player release is pending";
|
|
6
|
+
_.Na="Loading player with configuration";_.Oa="MaxHeight";_.Pa="MaxWidth";Ra="Missing media element";_.Sa="NAME";Ta="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";Ua="No items in the playlist";Va="No sources provided!";Wa="Not a persistent session.";_.Ya="Not supported";Za="NotAllowedError";$a="NotSupportedError";_.ab="PLAYLIST";_.bb="POST";_.cb="PlayReady License URL is not defined";db="Player not ready yet.";_.eb="Player sources";_.fb="Please make sure ";
|
|
7
|
+
gb="Preloading is not supported by this player.";_.hb="QualityLevel";_.ib="RESOLUTION";_.kb="Representation";lb="STANDARD";_.mb="SW_SECURE_CRYPTO";_.nb="SW_SECURE_DECODE";ob="Session is closed";pb="Skipping Session creation. License for init data was already requested in ";_.qb="SmoothStreamingMedia";_.rb="TYPE";sb="The index is not in the allowed range.";_.ub="URI";vb="Unable to translate ";_.xb="Unhandled/ignored event";_.yb="Unregistering listeners";zb="Unsupported keySystem";Ab="Updating playout limit for interstitial";
|
|
8
|
+
Bb="Using VTTCue polyfill from 3 argument TextTrackCue.";_.Cb="VIDEO";_.Db="VOD";Eb="Wait for preloading to finish";Fb="WebkitEmeManager.MediaKeySession.load";_.Gb="Widevine License URL is not defined";Jb="Will create EME Manager: ";Kb="X-AD-CREATIVE-SIGNALING";_.Lb="X-ASSET-LIST";_.Mb="X-ASSET-URI";Nb="X-GROUPED-ASSET-LIST";_.Ob="X-PLAYOUT-LIMIT";_.Pb="X-RESTRICT";_.Qb="X-RESUME-OFFSET";Rb="X-TIMELINE-OCCUPIES";_.Sb="ad-break-started";_.Tb="ad-break-stopped";_.Ub="ad-buffering";_.Vb="ad-clicked";
|
|
9
|
+
_.Wb="ad-completed";_.Xb="ad-first-quartile";Yb="ad-hls-asset-list-request";Zb="ad-hls-asset-list-response";$b="ad-hls-resoled";_.ac="ad-impression";_.bc="ad-loaded";_.cc="ad-midpoint";_.dc="ad-paused";_.ec="ad-progress";_.fc="ad-resumed";_.ic="ad-skipped";_.kc="ad-started";_.lc="ad-stopped";_.mc="ad-third-quartile";_.nc="addtrack";_.oc="ads-timeline-changed";_.pc="airplay-casting-ended";_.qc="airplay-casting-started";_.rc="airplay-status-changed";_.sc="application/cea-608";_.tc="application/dash+xml";
|
|
10
|
+
_.uc="application/mp4";_.xc='application/mp4; codecs\x3d"stpp"';_.yc='application/mp4; codecs\x3d"wvtt"';zc="application/octet-stream";_.Ac="application/ttml+xml";_.Bc="application/vnd.ms-sstr+xml";_.Cc="application/x-www-form-urlencoded";_.q="audio";_.Dc="audio/aac";_.Ec="audio/ac3";_.Fc="audio/eac3";_.Gc="audio/mp4";Hc='audio/mp4;codecs\x3d"mp4a.40.2"';_.Ic="audiobufferchanged";_.Jc="audiotrackchanged";_.Kc="autoplaynotallowed";_.Lc="bitratechanged";_.Mc="boolean";_.Nc="bufferingended";_.Oc="bufferingstarted";
|
|
11
|
+
Pc="canplay";Qc="canplaythrough";_.Rc="castingstarted";_.Sc="caststatuschanged";_.Tc="castvisibilitychanged";_.Uc="cdn-switch-success";_.Vc="cenc";_.Wc="center";Xc="certificate-request";Yc="change";Zc="chrome";_.$c="clpp-fill";cd="clpp-hidden";dd="clpp-mc-playlist";ed="clpp-visible";fd="clpp.PlayerFleet";_.gd="clpp.cast.CastSender";hd="clpp.drm.HeaderDrm";id="clpp.drm.eme.AppleEmeManager";jd="clpp.native.Player";kd="clpp.playlist.McPlaylist";ld="clpp.utils.Platform";_.md="codecs";_.nd="column-reverse";
|
|
12
|
+
_.od="com.adobe.primetime";_.pd="com.apple.fps";qd="com.apple.quicktime.HLS";_.rd="com.microsoft.playready";sd="com.microsoft.playready.recommendation";_.td="com.widevine.alpha";_.ud="config.drm.customData is not defined";vd="controls";_.wd="cuechange";_.xd="decoder";_.yd="destroy()";_.zd="disabled";_.Ad="div";Bd="drm.mediaKeys.end";Cd="drm.mediaKeys.start";Dd="drm.onPlay.end";Ed="drm.onPlay.start";_.Fd="drmexpirationupdate";Gd="drmlicenserequested";Hd="drmrenewalstarted";Id="drmsessioncreated";
|
|
13
|
+
_.Jd="drmsessionpersisted";_.Kd="drmsessionupdate";Ld="drmtoday";Nd="durationchange";_.Od="ec-3";Pd="encrypted";_.Qd="end";_.Rd="ended";_.Sd="error";_.Td="estimatedThroughputKbps";_.Ud="forced";Vd="fullscreenElement";_.Wd="function";_.Xd="height";_.Yd="hidden";_.Zd="html";_.$d="https://";_.ae="image";_.be="internal-error";ce="keystatuseschange";_.de="left";ee="license-renewal";fe="license-request";_.ge="line-left";_.he="line-right";_.ie="live-turned-static";_.je="load";_.ke="loadeddata";_.le="loadedmetadata";
|
|
14
|
+
me="loadstart";_.ne="main";_.oe="mdat";_.pe="mdia";_.qe="message";_.re="metadata";_.se="mimeType";_.te="minf";_.ue="moov";_.ve="mpd-type-changed";_.we="mpeg-dash-callback-event";_.Ae="none";_.r="number";_.Be="object";_.Ce="onBitrateChanged()";_.De="onContentLoaded";_.Ee="onPlayerError()";_.Fe="onPlayerWillDestroy";_.Ge="onPlayerWillRelease";_.He="onStateChanged()";Ie="online-status-changed";_.Je="optional";_.Ke="org.w3.clearkey";_.Le="output-restricted";_.Me="pause";_.Ne="persistent";_.Oe="persistent-license";
|
|
15
|
+
Pe="picture-in-picture";_.Qe="play";Re="player.afterLoad.end";Se="player.afterLoad.start";Te="player.appendLoad.end";Ue="player.appendLoad.start";Ve="player.beforeLoad.end";We="player.beforeLoad.start";Xe="player.open.end";Ye="player.open.start";Ze="player.setupPlaylist.end";$e="player.setupPlaylist.start";_.af="playerstatechanged";_.bf="playing";_.cf="playlist-item-changed";_.df="playlist-modified";ef="playlist.next.end";ff="playlist.next.start";gf="preload-aborted";hf="preload-failed";jf="preloaded";
|
|
16
|
+
kf="preloading";_.lf="prevent";mf="primary-content";_.nf="progress";_.pf="px";_.qf="ratechange";rf="released";_.sf="releasing";tf="removetrack";_.uf="required";_.vf="resize";_.wf="right";_.xf="sc-playlist-ended";_.yf="sc-playlist-item-changed";_.zf="sc-playlist-live-turned-static";_.Af="sc-playlist-timeline-changed";_.Bf="seeked";_.Cf="seeking";_.Df="showing";_.Ef="simid-creative-started";_.Ff="simid-creative-stopped";_.Gf="sinf";_.Hf="smooth";If="stalled";_.Jf="start";Kf="statechanged";Lf="status-pending";
|
|
17
|
+
_.Mf="stbl";_.Nf="string";_.Of="stsd";_.Pf="style";_.Qf="subtitles-htmlcue";Rf="temporary";_.Sf="text";_.Tf="text/vtt";_.Uf="text/xml";_.Vf="texttrackchanged";_.Wf="timeline-cue-added";_.Xf="timeline-cue-enter";_.Yf="timeline-cue-exit";_.Zf="timeline-cues-changed";_.$f="timeupdate";_.ag="tracksadded";_.bg="trak";_.cg="ttml-xml";dg="unauthenticated";_.eg="und";_.fg="unknown";gg="update";_.hg="urn:scte:scte35";_.ig="urn:scte:scte35:2014";_.jg="user-seeked";_.kg="user-seeking";_.lg="value";mg="version";
|
|
18
|
+
_.ng="vertical-lr";_.og="vertical-rl";_.t="video";_.pg="video/mp2t";_.qg="video/mp4";_.rg="videobufferchanged";_.sg="videotrackchanged";_.tg="vimond-response";_.ug="visibilitychange";_.yg="vtt-xml";_.zg="waiting";_.Ag="waitingforkey";Bg="webkit-org.w3.clearkey";Cg="webkitkeyadded";Dg="webkitkeyerror";Eg="webkitkeymessage";Fg="webkitneedkey";_.Gg="width";Hg="x-dt-csl-tracking-token";Ig="x-dt-follow-up-token";Jg="x-dt-resp-code";_.Kg="yospace-session-ended";_.Lg="yospace-session-started";
|
|
19
|
+
_.Og=function(a){return function(){return _.Ng[a].apply(this,arguments)}};Pg=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};Qg=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:Pg(a)}};Tg=function(a,b){if(b){var c=Rg;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&Sg(c,a,{configurable:!0,writable:!0,value:b})}};
|
|
20
|
+
Ug=function(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})};_.v=function(a){return Ug(a())};_.w=function(a,b){a=a.split(".");var c=Vg;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};
|
|
21
|
+
_.Yg=function(a){return _.z(a)||Wg(a)?a:_.Xg(a)};_.Xg=function(...a){let b={};for(let c=0;c<a.length;c++)null!=a[c]&&(b=Zg(b,{merging:a[c]},1));return b.merging||null};_.$g=function(a){for(const b in a)if(void 0!==a[b])return!0;return!1};
|
|
22
|
+
Zg=function(a,b,c){const d=c+1;if(_.z(a)||!_.ah(a))a={};for(const e in b)c=b[e],Wg(c)||_.z(c)||_.bh(c)||c instanceof Element?a[e]=c:c instanceof Date?a[e]=c:_.ah(c)&&c.buffer&&c.buffer instanceof ArrayBuffer&&_.bh(c.subarray)?a[e]=c.subarray(0):c instanceof Array?a[e]=Zg([],c,d):!_.z(c)&&_.ch(c)&&20>d&&(a[e]=Zg(a[e],c,d));return a};Wg=function(a){a=typeof a;return a===_.Nf||a===_.r||a===_.Mc};_.z=function(a){return null===a||"undefined"===typeof a};_.ah=function(a){return typeof a===_.Be};
|
|
23
|
+
_.bh=function(a){return typeof a===_.Wd};_.dh=function(a){return typeof a===_.Nf};_.eh=function(a){return typeof a===_.r};_.ch=function(a){if(_.z(a)||!_.ah(a))return!1;a=Object.getPrototypeOf(a);return a===Object.prototype||null===a};
|
|
24
|
+
_.fh=function(a,b,c,d){if(a===b||null===a&&null===b||void 0===a&&void 0===b)return!0;if(null===a&&null!==b||null!==a&&null===b||void 0!==a&&void 0===b||void 0===a&&void 0!==b||!_.ah(a)||!_.ah(b))return!1;const e=c||Object.keys(a),f={};for(let g=0;g<e.length;g++){const h=e[g];if(_.z(d)||0>d.indexOf(h))if(f[h]=!0,a[h]!==b[h])return!1}if(_.z(c))for(a=Object.keys(b),b=0;b<a.length;b++)if(c=a[b],(_.z(d)||0>d.indexOf(c))&&!f[c])return!1;return!0};
|
|
25
|
+
gh=function(a){return(Number.hasOwnProperty("isNaN")?Number.isNaN:b=>b!==b)(a)};hh=function(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b};_.ih=function(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};jh=function(a,b){b=b.toLowerCase();for(const [c,d]of Object.entries(a))if(c.toLowerCase()===b)return d;return null};mh=function(a){return a&&0<=kh[a]?kh[a]:lh};
|
|
26
|
+
oh=function(a){if(!a)return _.A("clpp.log",vb+a+ca),-1;const b=nh[a.toUpperCase()];return void 0===b?(_.A("clpp.log",vb+a+ca),-1):b};_.qh=function(a){ph.info.apply(ph,arguments)};_.rh=function(a){ph.debug.apply(ph,arguments)};_.A=function(a){ph.warn.apply(ph,arguments)};_.sh=function(a){ph.error.apply(ph,arguments)};_.vh=function(a){if(a){var b=a.a();b in _.th?_.uh.warn("Player-Factory '"+b+"' already registered"):(_.th[b]=a,_.uh.info("Registered Player-Factory: '"+b+"'"))}};
|
|
27
|
+
wh=function(a){return Object.values(_.th).find(a)||null};xh=function(a,b,c){a.stop();let d=!0,e=null;a.a=()=>{c?clearInterval(e):clearTimeout(e);d=!1};const f=()=>{d&&a.f()};e=c?setInterval(f,1E3*b):setTimeout(f,1E3*b);return a};yh=function(a){return 0>=a?Promise.resolve():new Promise(b=>{setTimeout(()=>{b()},1E3*a)})};Bh=function(a,b){return _.v(function*(){yield zh(a,()=>Promise.all(Ah(a).map(b)))})};Ch=function(a,b){_.v(function*(){yield zh(a,()=>Promise.all(a.f.filter(c=>null!=c.Ra()).map(b)))})};
|
|
28
|
+
Ah=function(a){return[a.Kc,...a.f].filter(b=>null!=b)};zh=function(a,b){return _.v(function*(){a.a&&(yield a.a);a.a=b().then(()=>{a.a=null})})};Dh=function(a,b,c,d){a=`${a===_.C?"FATAL":"RECOVERABLE"} Clpp-Error [Category ${b} - Code ${c}]`;if(_.dh(d))a+=": "+d;else if(null!=d)if(null!=d.message)a+=": "+d.message,delete d.message;else try{a+=": "+JSON.stringify(d)}catch(e){}return a};
|
|
29
|
+
_.Fh=function(a){var b=a.a;var c=[];for(const d in b.a)c.push.apply(c,b.a[d]);b=c;for(c=0;c<b.length;++c)Eh(b[c]);a.a.clear()};Gh=function(a,b,c){var d=[Pd,"msneedkey",Fg,"needkey"];const e=f=>{for(const g of d)a.off(b,g,e);c(f)};for(const f of d)a.on(b,f,e)};Eh=function(a){a.target.removeEventListener(a.type,a.a,a.f);a.target=null;a.a=null};
|
|
30
|
+
Kh=function(){if(Hh)return Hh;Ih||(Ih=new _.Jh(()=>{Hh=null}));(Hh=document.querySelector(_.t)||document.querySelector(_.q))||(Hh=document.createElement(_.t));Ih.la(1);return Hh};_.Lh=function(){return!!navigator.userAgent.match(/Edge?\//)};_.Oh=function(a){return(navigator.userAgent||"").includes(a)};_.Ph=function(a){return _.Oh("Tizen"+(a?" "+String(a):""))};
|
|
31
|
+
Rh=function(a){const b={major:-1,name:_.fg};if(!a)return b;var c=a.replace(/_/g,".");b.name=c;c=c.split(".");1<=c.length&&(b.major=Qh(a,c[0]));2<=c.length&&(b.minor=Qh(a,c[1]));3<=c.length&&(b.patch=Qh(a,c[2]));4<=c.length&&(b.build=Qh(a,c[3]));return b};_.Sh=function(){return _.Oh("Web0S")};_.Wh=function(){const a=Th();const b=["ie","edge","opera","firefox","safari",Zc];var c=Uh();const d=Vh[c];for(let e=0,f=b.length;e<f;e++)if(c=d[b[e]]&&a.match(d[b[e]]))return Rh(c[1]);return Rh("")};_.Xh=function(){return _.Oh("CrKey")};
|
|
32
|
+
_.Yh=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!_.Ph()};_.Zh=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:_.Yh()&&1<navigator.maxTouchPoints};_.$h=function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)};Qh=function(a,b){try{return parseInt(b,10)}catch(c){ai.warn("Unable to parse version number for '"+b+"' from '"+a+"'")}return-1};
|
|
33
|
+
bi=function(a,b){if(!a||!b||0===b.length)return!1;for(let c=0;c<b.length;c++)if(0<=a.indexOf(b[c]))return!0;return!1};Uh=function(){const a=Th();if(!a)return ci;var b=a.match(/^.+?(?=\))/);if(!b)return ci;b=b[0];if(bi(b,["iphone","ipad"]))return di;if(bi(b,["android"]))return ei;if(bi(b,["macintosh"]))return fi;if(bi(b,["windows nt"]))return gi;if(bi(b,["tizen"]))return hi;if(bi(b,["web0s"]))return ii;if(bi(b,["linux"]))return ji;ai.warn("Unable to identify OS from user agent: "+a);return ci};
|
|
34
|
+
Th=function(){let a=window.navigator.userAgent;return a=a.toLowerCase()};
|
|
35
|
+
_.li=function(){var a=Uh();var b=Uh();var c=Vh[b];if(c){c=Th().match(c.os_version)[1];c=Rh(c);if(b===gi)if("5.1"===c.name)c.name="xp";else if("6.1"===c.name)c.name="7";else if("6.2"===c.name||"6.3"===c.name)c.name="8";b=c}else b=Rh("");a:{c=Th();const e=["ie","edge","opera","firefox","safari",Zc];var d=Uh();d=Vh[d];for(let f=0,g=e.length;f<g;f++)if(d[e[f]]&&c.match(d[e[f]])){c=e[f];break a}c=ki}return{os:a,osVersion:b,browser:c,browserVersion:_.Wh()}};
|
|
36
|
+
ni=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!==b.byteLength)return!1;if(mi(a)===mi(b)&&(a.byteOffset||0)===(b.byteOffset||0))return!0;const c=_.E(a);b=_.E(b);for(let d=0;d<a.byteLength;d++)if(c[d]!==b[d])return!1;return!0};mi=function(a){return a instanceof ArrayBuffer?a:a.buffer};_.E=function(a,b=0,c=Infinity){return oi(a,b,c,Uint8Array)};
|
|
37
|
+
oi=function(a,b,c,d){const e=d.BYTES_PER_ELEMENT||1,f=mi(a),g=(a.byteOffset||0)+a.byteLength;a=Math.max(0,Math.min((a.byteOffset||0)+b*e,g));c=Math.min(a+Math.max(c*e,0),g);a/=e;return new d(f,a,c/e-a)};pi=function(a,b=0,c=Infinity){return oi(a,b,c,Uint16Array)};qi=function(a,b=0,c=Infinity){return oi(a,b,c,Uint32Array)};_.ri=function(a,b=0,c=Infinity){return oi(a,b,c,Int32Array)};_.si=function(a,b=0,c=Infinity){return oi(a,b,c,DataView)};
|
|
38
|
+
ti=function(a){return a instanceof ArrayBuffer?a:0===a.byteOffset&&a.byteLength===a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer};ui=function(a){let b="";for(let c=0;c<a.length;c+=16E3)b+=String.fromCharCode.apply(null,a.subarray(c,c+16E3));return b};
|
|
39
|
+
_.vi=function(a){if(!a)return"";a=_.E(a);239===a[0]&&187===a[1]&&191===a[2]&&(a=a.subarray(3));if("TextDecoder"in window){a=(new TextDecoder).decode(a);if(a.includes("\ufffd"))throw Error(za);return a}a=escape(ui(a));try{return decodeURIComponent(a)}catch(b){throw Error(za);}};
|
|
40
|
+
xi=function(a,b,c){if(!a)return"";if(!c&&0!==a.byteLength%2)throw wi.error("Data has an incorrect length, must be even."),Error("Data does not seem to be UTF-16 encoded!");c=_.E(a);if(b&&255===c[0]&&254===c[1]||254===c[0]&&255===c[1])a=c.subarray(2);if(a instanceof ArrayBuffer)var d=a;else c=new Uint8Array(a.byteLength),c.set(_.E(a)),d=c.buffer;a=Math.floor(a.byteLength/2);c=new Uint16Array(a);d=new DataView(d);for(let e=0;e<a;e++)c[e]=d.getUint16(2*e,b);return ui(c)};
|
|
41
|
+
_.yi=function(a,b){if(_.dh(a))return a;let c="";b=!!b;const d=_.E(a);239===d[0]&&187===d[1]&&191===d[2]?c=_.vi(d):254===d[0]&&255===d[1]?c=xi(d.subarray(2),!1):255===d[0]&&254===d[1]&&(c=xi(d.subarray(2),!0));const e=function(f,g){return f.byteLength<=g||32<=f[g]&&126>=f[g]}.bind(null,d);wi.debug("Unable to find byte-order-mark, making an educated guess.");0===d[0]&&0===d[2]?c=xi(a,!1):0===d[1]&&0===d[3]?c=xi(a,!0):e(0)&&e(1)&&e(2)&&e(3)&&(c=_.vi(a));if(c)return b&&(c=escape(c)),c;throw Error("Unable to detect text encoding");
|
|
42
|
+
};_.zi=function(a){if("TextEncoder"in window)return(new TextEncoder).encode(a);a=encodeURIComponent(a);a=unescape(a);const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b};_.Ai=function(a,b){const c=new Uint8Array(2*a.length),d=new DataView(c.buffer);for(let e=0;e<a.length;++e)d.setUint16(2*e,a.charCodeAt(e),b);return c.buffer};
|
|
43
|
+
_.Bi=function(a,b){var c=b||1;b=a.length;const d=new ArrayBuffer(b*c);let e;4===c?e=qi(d):2===c?e=pi(d):e=_.E(d);for(c=0;c<b;c++)e[c]=a.charCodeAt(c);return d};_.Ci=function(a,b){return String.prototype.startsWith?a.startsWith(b):0===a.indexOf(b)};_.Di=function(a,b){if(String.prototype.endsWith)return a.endsWith(b);const c=a.length-b.length;a=a.lastIndexOf(b,c);return-1!==a&&a===c};_.Ei=function(a){return!!(a&&0<a.length)};_.Fi=function(a){return!a||0===a.length};
|
|
44
|
+
_.Gi=function(a){if(void 0===a||null===a||""===a)return"";try{let b=Number(a);if(gh(b))return"";a="bps";1E3<=Math.abs(b)&&(a="Kbps",b/=1E3);1E3<=Math.abs(b)&&(a="Mbps",b/=1E3);return`${b.toFixed(2).replace(/[.,]00$/,"")}${a}`}catch(b){return""}};_.Hi=function(a,b){for(const c in b)if(b[c]===a)return c;return""};_.Ji=function(a){a=a.replace(/<[^>]+>/gi,"");Ii.innerHTML=a;a=Ii.textContent;return a=a.replace(/<[^>]+>/gi,"")};
|
|
45
|
+
Ki=function(a){if(null===a||void 0===a||""===a)return null;a=Number(a);return isNaN(a)?null:a};
|
|
46
|
+
Ni=function(a){a.g.debug("Start watching for video events for "+a.m.namespace());const b=a.m,c=d=>Li(a,d.type);a.a.on(b,_.Rd,()=>{a.ga||(a.h=!1,Mi(a,11))});a.a.on(b,Pc,c);a.a.on(b,_.bf,()=>{a.B=!0;a.h=!1;Li(a,_.bf)});a.a.on(b,_.Me,()=>{a.B=!1;a.h=!1;Li(a,_.Me)});a.a.on(b,_.$f,c);a.a.on(b,_.qf,c);a.a.on(b,_.Bf,d=>{a.ga=!1;a.h=!1;Li(a,d.type)});a.a.on(b,_.Cf,d=>{a.ga=!0;Li(a,d.type)});a.a.on(b,If,c);a.a.on(b,_.zg,()=>{a.h=!0;Li(a,_.zg)});a.a.on(b,_.Sd,d=>{(d=d&&d.detail)&&d.severity&&d.severity===_.C&&
|
|
47
|
+
Mi(a,3)});a.a.on(b,_.le,c);a.a.on(b,Qc,()=>{a.A=!0;Li(a,Qc)});a.a.on(b,_.kg,d=>{a.ga=!0;Li(a,d.type)});a.a.on(b,_.jg,d=>{a.ga=!1;a.h=!1;Li(a,d.type)})};
|
|
48
|
+
Mi=function(a,b){if(a.f===b)return!1;const c=Date.now(),d=6===a.f;a.w=a.f;a.f=b;11===a.w&&(a.G=c,a.l=0);a.l||(a.l=a.G||c);a.I=c-a.l;a.l=c;6===b?(a.J=a.l,a.o=a.ga?1:2,a.g.info("Buffering started. Reason: "+_.Hi(a.o,Oi)),a.m.trigger(new _.H(_.Oc,{detail:{bufferedTimeMS:-1,reason:a.o}}))):d&&(a.C=a.l-a.J,a.g.info("Buffering finished. Reason: "+_.Hi(a.o,Oi)+". Buffering time: "+a.C+" ms"),a.m.trigger(new _.H(_.Nc,{detail:{bufferedTimeMS:a.C,reason:a.o}})));b={currentState:a.f,previousState:a.w,timeSinceLastStateChangeMS:a.I};
|
|
49
|
+
if(6===a.f||6===a.w)b.reason=a.o;a.m.trigger(new _.H(_.af,{detail:b}));return!0};
|
|
50
|
+
Li=function(a,b){if(3===a.f)a.g.warn("Player is in error state, aborting any further state checks");else{var c=a.m.isPaused(),d=a.m.isEnded();if(d)a.ga||(a.h=!1,Mi(a,11));else if(b!==_.$f){var e=a.m.getPosition();e=null!==e&&void 0!==e&&0<=e?a.m.getBufferInfo().Oa(e,!0):-1;a.F=e;e=a.m.getSurface().getMedia();a.j=e?e.readyState:null;a.H=a.m.getPlaybackRate()||1;e=typeof a.j===_.r&&a.j<Pi&&e.networkState===Qi;var f=typeof a.j===_.r&&0>=a.F&&0===a.f,g=typeof a.j===_.r&&a.j<=Pi&&a.h;e=a.ga||f||e||g;!a.K||
|
|
51
|
+
a.m.isLive()||6!==a.f||e||(f=b===_.Bf&&4===a.j,(g=2===a.w)&&!a.A?e=!0:g||a.A||f||(e=!0));f=!1;e?f=Mi(a,6):c?f=Mi(a,10):a.B&&(f=Mi(a,8));f&&(a.A=!1);a.g.debug("Video state check for event "+b+":: seeking: "+a.ga+", waiting: "+a.h+", playing: "+a.B+", paused: "+c+", readyState: "+a.j+", rate: "+a.H+", buffer: "+a.F+", ended: "+d+". Changed state: "+f+", Current state: "+_.Hi(a.f,_.Ri))}}};Ti=function(a){return Si(a).filter(b=>b.type===qd&&!b.nf)};Ui=function(a){a.forEach(b=>{b.nf=!0})};
|
|
52
|
+
Yi=function(a,b){a=a.map(c=>({startTime:c.startTime,endTime:c.endTime,key:c.value.key,value:c.value.data,yg:!1}));a=Vi(a);b&&(a=Wi(a));return new Set(Xi(a))};Si=function(a){const b=[];for(const c of a)b.push(c);return b};Zi=function(a,b){const c=a.endTime-a.startTime,d=b.endTime-b.startTime,e=a.gg||a.startTime,f=b.gg||b.startTime;return(Infinity===c&&Infinity===d||.01>Math.abs(c-d))&&.5>Math.abs(e-f)&&a.value.key===b.value.key&&a.value.data===b.value.data};
|
|
53
|
+
Xi=function(a){const b=[];for(const c of a)(a=b.find(d=>d.startTime===c.startTime&&d.endTime===c.endTime))?$i(c,a):(a=aj(c),b.push(a));return b};$i=function(a,b){if(a.key.startsWith("X-"))b.customAttributes||(b.customAttributes={}),b.customAttributes[a.key]=a.value,"X-CUSTOM-ID"===a.key&&(b.id=a.value);else if("SCTE35-OUT"===a.key||"SCTE35-IN"===a.key)b.schemeIdUri=_.ig,b.type=_.bj};
|
|
54
|
+
aj=function(a){var b=a.startTime;const c=a.endTime;b={schemeIdUri:"",value:"",startTime:b,endTime:c,id:`T${b.toFixed(2)}-${c.toFixed(2)}`,type:_.cj,eventElement:null};$i(a,b);return b};Vi=function(a){const b=new Set(a),c=new Set(a.filter(d=>"SCTE35-OUT"===d.key).map(dj));a.filter(d=>"SCTE35-IN"===d.key).forEach(d=>{c.has(dj(d))||(d.yg=!0)});return Array.from(b.values())};Wi=function(a){a.forEach(b=>{b.yg&&(b.endTime=b.startTime,b.startTime=0)});return a};dj=function(a){return`${a.startTime}-${a.endTime}`};
|
|
55
|
+
ij=function(a,b){a.g.debug("onMetadataTrackAdded_()");b.mode=_.Yd;var c=!b.cues||0===b.cues.length;if(a.m.isLive()||!c){var d=b.cues;c=Ti(d);Ui(c);a.a=Yi(c,a.l);0<a.a.size&&(ej(a,a.a),a.m.trigger(new _.H(_.Zf)));a.j.on(b,_.wd,()=>{{const l=a.m.getPosition();for(const m of a.a){var e,f=a,g=m,h=l;if(Infinity===g.endTime){if(e=!f.f.has(g)){var k=g.startTime;e=k;k+=.5;e=e<=h&&h<=k}e&&(f.f.add(g),f.m.trigger(new _.H(_.Xf,{detail:g})))}else h=g.startTime<=h&&h<=g.endTime,!h&&f.f.has(g)?(f.f.delete(g),f.m.trigger(new _.H(_.Yf,
|
|
56
|
+
{detail:g}))):h&&!f.f.has(g)&&(f.f.add(g),f.m.trigger(new _.H(_.Xf,{detail:g})))}}});a.m.isLive()&&(a.h=setInterval(()=>{if(b.cues){var e=a.m.getSeekRange().start;var f=[];for(var g of b.cues)g.endTime<e&&f.push(g);fj(a,b,f);0<f.length&&a.g.debug(`Evicted ${f.length} old cues.`);for(var h of a.a)h.endTime<e&&a.a.delete(h);e=0<f.length}else e=!1;gj(a,b);f=Ti(d);var k=Yi(f,a.l);g=new Set;h=!1;for(l of k)(k=hj(a,l))?(l.customAttributes&&(k.customAttributes=_.Xg(k.customAttributes||{},l.customAttributes)||
|
|
57
|
+
void 0),h=!0):(a.a.add(l),g.add(l));var l={vi:g,wh:0<g.size||h};const {vi:m,wh:n}=l;Ui(f);(e||n)&&a.m.trigger(new _.H(_.Zf));ej(a,m)},6E3))}};jj=function(a,b){a.j.on(b,_.nc,c=>{c=c.track;c.kind===_.re&&ij(a,c)})};ej=function(a,b){for(const c of b)a.m.trigger(new _.H(_.Wf,{detail:c}))};hj=function(a,b){return Array.from(a.a.values()).find(c=>b.startTime===c.startTime&&b.endTime===c.endTime)||null};
|
|
58
|
+
gj=function(a,b){if(b.cues){var c=Si(b.cues).filter(f=>f.type===qd),d=c.filter(f=>f.nf);c=c.filter(f=>!f.nf);var e=[];for(const f of c)for(const g of d)Zi(f,g)&&(e.push(f),g.gg=f.startTime);fj(a,b,e);0<e.length&&a.g.debug(`Removed ${e.length} duplicated cues.`)}};fj=function(a,b,c){for(const d of c)try{b.removeCue(d)}catch(e){a.g.debug("Failed to remove cue",d,e)}};_.kj=function(a){return Array.isArray(a)?a:[a]};lj=function(a,b){return a===b?!0:a.length===b.length&&a.every((c,d)=>c===b[d])};
|
|
59
|
+
nj=function(a,b,c){if(null==a&&null==b)return!0;if(null==a||null==b)return!1;a=c?a.map(c):a;b=c?b.map(c):b;return mj(a,b)&&mj(b,a)};mj=function(a,b){const c=new Set(a);return b.every(d=>c.has(d))};_.oj=function(a,b={}){if(b.dg){const c=[];for(const d of a)c.some(e=>b.dg(d,e))||c.push(d);return c}return Array.from((new Set(a)).values())};rj=function(a,b){const c=new Set(a),d=new Set(b);return{Ni:a.filter(e=>!d.has(e)),Mj:a.filter(e=>d.has(e)),th:b.filter(e=>!c.has(e))}};
|
|
60
|
+
sj=function(a,b){b=b.track;b.kind!==_.re&&(b.mode===_.Df&&(b.mode=_.Yd),a.a.on(b,_.wd,c=>{c=c.target||c.srcElement;c.mode=_.Yd;c.activeCues&&(c=Array.from(c.activeCues).map(a.o),a.l.append(c,[]))}))};tj=function(a,b){const c=b||lj;let d=null,e=null,f=!1;return function(...g){if(f&&c(g,d))return e;f=!0;d=g;return e=a(...g)}};_.uj=function(a){return null!=a};
|
|
61
|
+
wj=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}throw new _.vj("No non-null, non-undefined value found");};xj=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}};yj=function(a,b){try{return new URL(a,b)}catch(c){return null}};_.zj=function(a){return`${a.scheme}//`+`${a.a}${a.port?":"+a.port:""}${a.path}${a.h}${a.f}`};
|
|
62
|
+
_.Aj=function(a,b,c){return a?(c||Object.keys(a).sort()).reduce(function(d,e){if(!(e in a))return d;const f=a[e];let g="\x26";""===d&&(g=b?"":"?");d=d+g+encodeURIComponent(e);return d=d+"\x3d"+encodeURIComponent(void 0===f?"":f)},""):""};_.Bj=function(a){const b={};a=a||"";a=a.substring(a.indexOf("?")+1);for(const d of a.split("\x26")){var c=d.split("\x3d");a=decodeURIComponent(c[0]);c=decodeURIComponent(c[1]||"");a&&(b[a]=c)}return b};
|
|
63
|
+
_.Cj=function(a,b){if(a.startsWith("http://")||a.startsWith(_.$d))return a;let c=b;b.startsWith("//")&&(c=`${location.protocol}${c}`);b=new URL(c);b.search="";return(new URL(a,b)).toString()};_.Ej=function(a){if(!a)return null;a=(new _.Dj(a)).a.pathname.split("/");if(1>a.length)return null;a=a.pop().split(".");return 1>=a.length?null:a.pop().toLowerCase()};Gj=function(a,b){const c=Fj[a];for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a===_.I?"":null};
|
|
64
|
+
_.K=function(a,b,c,d){d=void 0===d?{}:d;a=a.getAttribute(b);if(!a&&d.required)throw new _.J(_.C,4,4023,`Required attribute missing: ${b}`);return a?a.value:c||null};_.Hj=function(a){return"com.apple.hls.interstitial"===a||"com.apple.hls.overlay"===a};_.Ij=function(a){if(!a)return!1;const b=!!a[_.Mb];a=!!a[_.Lb];return(b||a)&&!(b&&a)};Jj=function(a){return a&&a.ASSETS&&Array.isArray(a.ASSETS)?a.ASSETS.every(b=>typeof b.URI===_.Nf&&typeof b.DURATION===_.r):!1};
|
|
65
|
+
Kj=function(a){return a.Lf&&!(a.once&&a.Wg)&&[0,6].includes(a.state)};Lj=function(a){a=a.customAttributes[Kb];if(!a)return null;try{return JSON.parse(atob(a))}catch(b){return null}};Nj=function(a,b){for(let d=0;d<a.length;d++){const e=a[d];var c=d===a.length-1;c&&b===_.Mj||(c?(e.next=[mf],e.transition={Ea:mf}):(c=a[d+1].id,e.next=[c],e.transition={Ea:c}))}};
|
|
66
|
+
Oj=function(a){const b={};a=a.map(d=>d.customAttributes||{});const c=new Set;a.forEach(d=>{Object.keys(d).forEach(e=>{c.add(e)})});for(const d of c)if(d===_.Pb){const e=new Set([]);a.forEach(f=>{f[d]&&f[d].forEach(g=>e.add(g))});b[d]=Array.from(e)}else if(d===_.Qb){const e=a.reduce((f,g)=>g[d]?f+g[d]:f,0);b[d]=e}return b};
|
|
67
|
+
Rj=function(a,b){if(0===a.length)return a;const c=new Map;b===_.Pj?a.forEach(d=>{const e=c.get(d.startTime)||[];e.push(d);c.set(d.startTime,e)}):c.set(0,a);a=[];for(const d of c.values())1===d.length?a.push(d[0]):(b=Qj(d),a.push(b));return a};
|
|
68
|
+
Qj=function(a){const b=[];let c=0;a.forEach(f=>{var g=Math.max(0,f.endTime-f.startTime);c+=g;var h=f.customAttributes[_.Lb];h&&b.push({type:"list",id:f.id,customAttributes:f.customAttributes,uc:{URI:h,DURATION:0}});if(h=f.customAttributes[_.Mb])g={type:"uri",id:f.id,customAttributes:f.customAttributes,uc:{URI:h,DURATION:g}},(f=Lj(f))&&(g.uc[Kb]=f),b.push(g)});const d=Oj(a);d[Nb]={entries:b,pa:[]};const e=a[0];a=a.map(f=>f.id).join("+");return Object.assign({},e,{id:a,endTime:e.startTime+c,customAttributes:d})};
|
|
69
|
+
_.Tj=function(a){var b=(a||"").split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Sj.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a};_.Uj=function(a,b){a=_.Tj(a);b=_.Tj(b);return a.split("-")[0]===b.split("-")[0]};Vj=function(a){return a.reduce((b,c)=>b+c,0)};_.Xj=function(){return{maxAttempts:1,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0,fatalStatusCodes:[...Wj]}};
|
|
70
|
+
Yj=function(a,b){a.timeout=b.timeout;a.baseDelay=b.baseDelay;a.backoffFactor=b.backoffFactor;a.fuzzFactor=b.fuzzFactor;a.maxAttempts=b.maxAttempts;a.fatalStatusCodes=b.fatalStatusCodes||[...Wj]};Zj=function(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b};ak=function(a){const b={};if(!a)return b;for(const c of a.trim().split("\r\n"))c&&(a=c.split(": "),b[a[0].toLowerCase()]=a.slice(1).join(": "));return b};
|
|
71
|
+
_.ck=function(a,b){_.dh(a)&&(a={uris:[a]});Array.isArray(a)&&(a={uris:a});const c={uris:a.uris||[],type:a.type||_.bk,uriIndex:0,method:a.method||"GET",body:a.body||null,headers:Object.assign({},a.headers),allowCrossSiteCredentials:a.allowCrossSiteCredentials||!1,onProgress:a.onProgress||null,onFragment:a.onFragment||null,maxAttempts:a.maxAttempts||1,currentAttempt:0,baseDelay:a.baseDelay||1E3,backoffFactor:a.backoffFactor||2,fuzzFactor:a.fuzzFactor||.5,timeout:a.timeout||0,requestModifiers:a.requestModifiers||
|
|
72
|
+
[],responseModifiers:a.responseModifiers||[],startTime:a.startTime||null,endTime:a.endTime||null,contentType:a.contentType||null,licenseRequestType:a.licenseRequestType||null,sessionId:null,bytesRemaining:-1,bytesLoaded:-1,bytesTotal:-1,timescale:a.timescale||null,rateLimitBps:a.rateLimitBps||null,disableFragmentSupport:a.disableFragmentSupport||!1,disableMergedFragments:a.disableMergedFragments||!1,fatalStatusCodes:[...Wj],requestStartTimestamp:null};a.keyInfo&&(c.keyInfo=a.keyInfo);b&&Yj(c,b);return c};
|
|
73
|
+
_.gk=function(a,b,c,d,e,f,g,h){a={uri:e||d,data:b,headers:a,status:c,timeMs:g,responseStartMs:h,request:f};if(dk(c))return ek(a);throw fk(a);};dk=function(a){return 200<=a&&299>=a&&202!==a};ek=function(a){return{uri:a.uri,data:a.data||new ArrayBuffer(0),headers:a.headers,status:a.status,fromCache:!!a.headers["x-shaka-from-cache"],timeMs:a.timeMs,responseStartMs:a.responseStartMs,request:a.request}};
|
|
74
|
+
fk=function(a){a=ek(a);try{var b=_.yi(a.data,!0)}catch(e){b=null}_.rh("HTTP error text:",b);var c=a.request;c=0<=(c?c.fatalStatusCodes||[]:[]).indexOf(a.status)?_.C:1;let d=3001;null!=a.status&&(d=3E3+a.status);return new _.J(c,1,1001,{url:a.uri,status:a.status,responseText:b,headers:a.headers,request:a.request,response:a},void 0,d)};hk=function(a,b){b=null==b?-1:b;a.bytesTotal=b;a.bytesLoaded=0;a.bytesRemaining=b};
|
|
75
|
+
ik=function(a,b,c){0<a.bytesRemaining&&(a.bytesRemaining-=b,0>a.bytesRemaining&&(a.bytesTotal+=-a.bytesRemaining,a.bytesRemaining=0));a.bytesLoaded+=b;if(a.onProgress)a.onProgress(b,c)};_.kk=function(a){_.jk[a.I]=a};
|
|
76
|
+
_.mk=function(a){const b={attemptParameters:_.Xj(),enforceSingleSession:!1,delayLicenseRequestUntilPlayed:!1,enableSessionCacheForSkd:!1,ignoreUnrecognizedInitData:!0,La:{},widevineVersion:_.td};if(a&&(b.enforceSingleSession=!!a.enforceSingleSession,b.delayLicenseRequestUntilPlayed=!!a.delayLicenseRequestUntilPlayed,b.preferredDrmSystem=a.preferredDrmSystem,b.emeApi=a.emeApi,a.attemptParameters&&(b.attemptParameters=a.attemptParameters),b.enableSessionCacheForSkd=!!a.enableSessionCacheForSkd,void 0!==
|
|
77
|
+
a.ignoreUnrecognizedInitData&&(b.ignoreUnrecognizedInitData=!!a.ignoreUnrecognizedInitData),typeof a.widevineVersion===_.Nf&&0<a.widevineVersion.length&&(b.widevineVersion=a.widevineVersion),a.env)){const c=_.jk[a.env]||null;if(!c)throw _.rh(_.va,_.fb+a.env+_.aa),new _.J(_.C,6,6015,`DRM environment '${a.env}' is missing.`);b.La=_.lk(c,a.customData)||{};_.Ci(a.env.toLowerCase(),Ld)&&(b.enforceSingleSession=!0)}return b};
|
|
78
|
+
_.nk=function(a,b){b.lastIndex=a.a;b=b.exec(a.f);b=null==b?null:{position:b.index,length:b[0].length,results:b};if(a.a===a.f.length||null===b||b.position!==a.a)return null;a.a+=b.length;return b.results};
|
|
79
|
+
_.rk=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new _.J(_.C,4,4016,{invalidTag:b});b=c[1];var d=c[2];c=[];let e;if(d){d=new _.ok(d);var f;(f=_.nk(d,/^([^,=]+)(?:,|$)/g))&&f[1]&&(e=f[1].trim());const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.nk(d,g);)c.push(new _.pk(f[1],f[2]||f[3]||""))}return new _.qk(a,b,c,e)};_.tk=function(a,b){a.a.push(sk(b,()=>{{var c=a.a;const d=c.indexOf(b);-1<d&&c.splice(d,1)}}))};
|
|
80
|
+
_.uk=function(){let a,b;const c=new Promise((e,f)=>{a=e;b=f}),d=Object.assign(c,{done:!1,uf:!1,Li:!1,value:null,error:null,resolve(e){d.uf=!0;d.done=!0;d.value=e;a(e)},reject(e){d.Li=!0;d.done=!0;d.error=e;b(e)}});return d};vk=function(a,b,c){b=void 0===b?0:b;c=void 0===c?a.a-b:c;if(0>b||b>a.a)throw new RangeError(`getDataView: start ${b} out of range [0, ${a.a}]`);if(0>c||b+c>a.a)throw new RangeError(`getDataView: length ${c} out of range [0, ${a.a-b}]`);return new DataView(a.f.buffer,b,c)};
|
|
81
|
+
xk=function(a){const b=a.a;if(a.a+4>=a.f)return a.a=a.f,null;var c=wk(a);if(a.a+4>=a.f)return a.a=a.f,null;var d=wk(a);d=String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,d&255);switch(c){case 0:c=a.f-b;break;case 1:if(a.a+8>=a.f)return a.a=a.f,null;{let e,f;try{f=a.j.getUint32(a.a,!1),e=a.j.getUint32(a.a+4,!1)}catch(g){throw new _.J(_.C,3,3E3);}if(2097151<f)throw new _.J(_.C,3,3E3);a.a+=8;c=f*Math.pow(2,32)+e}}c=b+c;a.l=c;return a.f>=c?(a.a=c,{name:d,start:b,end:c}):null};
|
|
82
|
+
yk=function(a){if(0<=a.l&&a.f<a.l)return null;let b=xk(a);for(;null!==b;){if(b.name===_.oe){const c={start:a.h,end:b.end,length:b.end-a.h,data:vk(a.o,a.h,b.end-a.h),count:1};a.h=b.end;return c}b=xk(a)}return null};wk=function(a){const b=a.j.getUint32(a.a,!1);a.a+=4;return b};zk=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()};Bk=function(a){const b=new Ak;b.a=a.a;return b};
|
|
83
|
+
Ck=function(a,b){return _.v(function*(){var c=a.f;c.a=c.h;c.j=vk(c.o);c.f=c.j.byteLength;var d=yk(a.f);for(c=[];d;)c.push(d),d=yk(a.f);if(0!==c.length)if(a.j){var e=c[0];if(1<c.length){e=c[0];d=c[c.length-1];const f=d.end-e.start;e={start:e.start,end:d.end,length:f,data:vk(a.a,e.start,f),count:c.length}}(c=b(e))&&(yield c)}else for(e of c)(c=b(e))&&(yield c)})};
|
|
84
|
+
Dk=function(a,b,c,d){return _.v(function*(){const e=new Ak;for(hk(c,a.h);;){var f=yield b.read();if(f.done)break;f=f.value;a.a.append(f);const g=zk()-e.a;e.a=zk();ik(c,f.byteLength,g);d&&(yield Ck(a,d))}return a.a.get()})};
|
|
85
|
+
Fk=function(a){var b=new window.Headers;for(const e in a.headers)b.append(e.toLowerCase(),a.headers[e]);const c=new window.AbortController,d={wd:!1,$g:!1};b={V:Ek(a.uris[a.uriIndex],a,{body:a.body||void 0,headers:b,method:a.method,signal:c.signal,credentials:a.allowCrossSiteCredentials?"include":void 0},d),request:a,abort:()=>{d.wd||(d.wd=!0,c.abort());return Promise.resolve()}};if(a=a.timeout){const e=window.setTimeout(()=>{d.$g=!0;c.abort()},a);b.V=b.V.finally(()=>{window.clearTimeout(e)})}return b};
|
|
86
|
+
Ek=function(a,b,c,d){return _.v(function*(){const e=new Ak;try{_.rh("sending Fetch request",c.method,a);const g=yield window.fetch(a,c);var f=Zj(g.headers);const h={uri:g.url,data:null,headers:f,status:g.status,timeMs:0,responseStartMs:zk()-e.a,request:b};if(!dk(g.status))throw h.data=yield g.arrayBuffer(),h.timeMs=zk()-e.a,fk(h);const k=g.headers.get(ta),l=Ki(k),m=g.body.getReader(),n=new Gk(l,!b.disableMergedFragments);f=null;Hk(b,g)&&(f=p=>{if(!d.wd)return b.onFragment(p)});h.data=yield Dk(n,m,
|
|
87
|
+
b,f);if(d.wd)throw Error("Request was aborted");h.timeMs=zk()-e.a;return ek(h)}catch(g){if(d.wd)throw new _.J(1,1,7001,{url:a,request:b});if(d.$g)throw new _.J(1,1,1003,{url:a,request:b});if(g&&1001===g.code)throw g;_.sh("Error while fetching data:",g);throw new _.J(1,1,1002,{url:a,error:g,request:b,status:-1},g);}})};Hk=function(a,b){b=(b=b.headers.get(_.ua))?b.split(";")[0].trim():null;return!(b!==_.qg&&b!==_.Gc&&b!==_.uc||!a.onFragment||a.disableFragmentSupport||2!==a.type)};
|
|
88
|
+
Ik=function(a){const b=a.uris[a.uriIndex],c=new window.XMLHttpRequest,d=new Ak,e=Bk(d);let f=0,g;const h=new _.uk;c.open(a.method,b,!0);c.responseType="arraybuffer";c.timeout=a.timeout;c.withCredentials=a.allowCrossSiteCredentials;let k=!1,l=!1;c.onreadystatechange=function(){c.readyState>=XMLHttpRequest.LOADING&&0===f&&(g=zk()-e.a);if(c.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!k){const m=c.getResponseHeader(ta);hk(a,Ki(m));k=!0}};c.onload=function(){return _.v(function*(){const m=ak(c.getAllResponseHeaders());
|
|
89
|
+
try{const n=c.response,p=zk()-e.a;l||ik(a,n?n.byteLength:0,p);const u=_.gk(m,n,c.status,b,c.responseURL,a,p,g);h.resolve(u)}catch(n){h.reject(n)}})};c.onerror=function(){if(0>=c.status)h.reject(new _.J(1,1,1002,{url:b,request:a,status:c.status}));else{var m=ak(c.getAllResponseHeaders());m=_.gk(m,c.response,c.status,b,c.responseURL,a,zk()-e.a,g);h.resolve(m)}};c.ontimeout=function(){h.reject(new _.J(1,1,1003,{url:b,request:a}))};c.onprogress=function(m){const n=zk()-d.a;m.lengthComputable&&(100<n||
|
|
90
|
+
m.loaded>=m.total)&&(d.a=zk(),ik(a,m.loaded-f,n),f=m.loaded,l=!0)};for(const m in a.headers)c.setRequestHeader(m.toLowerCase(),a.headers[m]);_.rh("sending XHR request",a.method,b);c.send(a.body);return{V:h,request:a,abort:()=>{c.abort();h.reject(new _.J(1,1,7001,{url:b,request:a}));return Promise.resolve()}}};_.Kk=function(a,b=!0){a=_.Jk(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")};_.Jk=function(a){a=ui(_.E(a));return btoa(a)};
|
|
91
|
+
_.Lk=function(a){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b};_.Mk=function(a){const b=new Uint8Array(a.length/2);for(let c=0;c<a.length;c+=2)b[c/2]=window.parseInt(a.substr(c,2),16);return b};_.Nk=function(a){let b="";for(let c=0;c<a.length;++c){let d=a[c].toString(16);1===d.length&&(d="0"+d);b+=d}return b};
|
|
92
|
+
_.Ok=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.length!==b.length)return!1;for(let c=0;c<a.length;++c)if(a[c]!==b[c])return!1;return!0};_.Pk=function(a){var b=0;for(var c=0;c<arguments.length;++c)b+=arguments[c].length;b=new Uint8Array(+b);c=0;for(let d=0;d<arguments.length;++d)b.set(arguments[d],c),c+=arguments[d].length;return b};
|
|
93
|
+
Rk=function(a){try{const b=a.uris[a.uriIndex],c=_.Qk(b);return{V:Promise.resolve({uri:b,data:c.data,request:a,headers:{"content-type":c.contentType}}),request:a,abort:()=>Promise.resolve()}}catch(b){return{V:Promise.reject(b),request:a,abort:()=>Promise.resolve()}}};
|
|
94
|
+
_.Qk=function(a){var b=a.split(":");if(2>b.length||"data"!==b[0])throw _.sh("Bad data URI, failed to parse scheme"),new _.J(_.C,1,1004,{uri:a});b=b.slice(1).join(":").split(",");if(2>b.length)throw _.sh("Bad data URI, failed to extract encoding and MIME type"),new _.J(_.C,1,1004,{uri:a});var c=b[0];a=window.decodeURIComponent(b.slice(1).join(","));b=c.split(";");c=b[0];let d=!1;1<b.length&&"base64"===b[b.length-1]&&(d=!0,b.pop());return{data:d?_.Lk(a).buffer:_.zi(a).buffer,contentType:c}};
|
|
95
|
+
sk=function(a,b){a.V.then(()=>b(!0),()=>b(!1));return a};
|
|
96
|
+
Uk=function(a){a.j=a.C.then(e=>{a.f=e.request;e.request.uriIndex=e.request.currentAttempt%e.request.uris.length;if(0<e.request.currentAttempt){-1===a.h&&(a.h=Sk(e.request.baseDelay,1E3));const f=a.h*(1+(2*Math.random()-1)*Sk(e.request.fuzzFactor,.5));a.h*=Sk(e.request.backoffFactor,2);if(0<f)return(new Promise((g,h)=>{a.l=h;Tk(a,()=>{g(e.plugin(e.request))},f)})).catch(g=>{if(!a.a)throw g;})}if(a.a)throw new _.J(1,1,7001,{url:e.request.uris[e.request.uriIndex],request:e.request});return e.plugin(e.request)});
|
|
97
|
+
let b=0,c=0,d=0;return a.j.then(e=>{const f=e.request;f.currentAttempt+=1;b=f.currentAttempt;c=f.maxAttempts;d=f.uris.length;return e.V}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.J){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return e.a(1),a.A&&a.A(e),Uk(a);g&&e.a(_.C);a.w.reject(e)}else a.w.reject(e)})};Tk=function(a,b,c){a.o=setTimeout(b,c)};Sk=function(a,b){return null===a||void 0===a?b:a};
|
|
98
|
+
Vk=function(a,b){b=(void 0===b?0:b)||!window.fetch||!window.AbortController||_.Ph(6)||_.Sh()&&68<_.li().browserVersion.major?Ik:Fk;a.l.http=b;a.l.https=b};Wk=function(a,b){Vk(a,b.forceXhr)};Xk=function(a,b){a.A=b};Yk=function(a,b){return _.v(function*(){const c=yield a.fetch(b);return _.vi(c.data).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")})};
|
|
99
|
+
Zk=function(a,b){return _.v(function*(){const c=yield Yk(a,b);if(!c)return null;try{const d=JSON.parse(c);if(null==d||typeof d!==_.Be)throw Error("Not an object");return d}catch(d){throw new _.vj("Failed to parse JSON response","json-failed");}})};
|
|
100
|
+
_.dl=function(a,b,c){if(a.w)return new $k(Promise.reject(new _.J(1,1,7001,{url:b.uris[b.uriIndex],request:b})));a.j&&0<a.j&&(b.rateLimitBps=a.j);var d=[];for(var e of a.f)d.push(e);if(b.requestModifiers)for(const g of b.requestModifiers)d.push(g);b.requestModifiers=d;al(a,b);b.responseModifiers=[...a.h,...b.responseModifiers||[]];let f;e=d=new _.uk;try{const g=[{type:"public",modifiers:b.requestModifiers},{type:"internal",modifiers:a.a}];for(const h of g)for(const k of h.modifiers)e=e.then(l=>{if(f.a)throw new _.J(_.C,
|
|
101
|
+
1,7001,l?{url:l.uris[l.uriIndex],request:l}:null);return"internal"===h.type?k(l,c)||l:k(l)||l}).catch(l=>{if(l instanceof _.J)throw l;throw new _.J(_.C,1,1006,null,l);});e=e.then(h=>({request:h,plugin:bl(a,h)}));f=new $k(e,a.A);for(const h of b.responseModifiers)f.then(k=>{const l=()=>{if(f.a)throw new _.J(_.C,1,7001,k?{url:k.request.uris[k.request.uriIndex],request:k.request}:null);};l();const m=h(k)||k;l();return m}).catch(k=>{if(k instanceof _.J&&k.data&&k.data.response){const l=h(k.data.response);
|
|
102
|
+
if(l&&l.then)return l.then(()=>Promise.reject(k))}return Promise.reject(k)}).catch(k=>{if(k instanceof _.J)throw k;throw new _.J(_.C,1,1007,null,k);});_.tk(a.o,f);d.resolve(b);return f}catch(g){return new $k(Promise.reject(g))}};al=function(a,b){for(const c of a.headers){const [d,e]=c;b.headers[d]||(b.headers[d]=e)}};bl=function(a,b){b=b.uris[b.uriIndex];var c=new _.Dj(b,location.href);c=c?c.a.protocol.slice(0,-1):"";const d=a.l[c];if(!d)throw new _.J(_.C,1,1E3,{url:b});return e=>d(e)};
|
|
103
|
+
el=function(a,b,c,d){d=void 0===d?"HEAD":d;return _.v(function*(){if(!navigator.onLine)return!1;if(b){const e=_.ck(b,c);e.method=d;c||(e.timeout=5E3);e.headers["cache-control"]="no-cache";try{yield a.fetch(e).V}catch(f){if(1002===f.code||1003===f.code)return!1}}return!0})};fl=function(a){return`@@scheme:${a.scheme||""}`+`@@value:${a.value}`+`@@id:${a.id||""}@@type:${a.type||""}`+`@@protocol:${a.protocol||""}`};_.gl=function(a){return a&&a!==_.eg?a:null};
|
|
104
|
+
il=function(a){if(!a)throw new _.J(_.C,3,3101,`Invalid track type: ${a}`);if(!_.dh(a))throw new _.J(_.C,3,3101,`Invalid track type: ${a}. Track type must be a string!`);switch(a.toLowerCase()){case _.L:return _.L;case _.M:return _.M;case _.N:return _.N;case hl:return hl}throw new _.J(_.C,3,3101,`Unknown track type: ${a}.`);};
|
|
105
|
+
kl=function(a,b,c){a=il(a);const d=_.gl(c.kind);a=new _.jl(b,d===_.re?hl:a);a.kind=d;a.label=_.gl(c.label);a.language=_.gl(c.language);a.originalLanguage=c.originalLanguage||a.language;return a};ll=function(a,b){return _.v(function*(){const c=_.ck(b);return yield Yk(a.f,c)})};
|
|
106
|
+
pl=function(a,b,c){return _.v(function*(){const {mimeType:d,renditions:e}=yield ml(a,b,c),f=new _.jl("dummy",_.N),g=e.map((h,k)=>{k=new _.nl(`R${k}`,f);k.bandwidth=h.bandwidth;k.ud=h.ud;k.codec=h.codec;k.width=h.width;k.height=h.height;return k});ol(g);return{renditions:g,mimeType:d||void 0}})};
|
|
107
|
+
rl=function(a){a=a.split("\n").filter(c=>c.trim().startsWith("#EXT-X-MEDIA:")).map(c=>ql(c));const b=new Map;a.forEach(c=>{if(c.type&&c.name){const d=`${c.type}:${c.name}`;if(b.has(d))throw Error("#EXT-X-MEDIA:NAME attributes are not unique. It is impossible to map HLS metadata to Safari data structures.");b.set(d,c)}});return b};ml=function(a,b,c){return _.v(function*(){const d=sl(b),e=tl(b,c);return{mimeType:yield ul(a,e,d[0]?d[0].codec:null),renditions:d}})};
|
|
108
|
+
ol=function(a){const b=new Set;a.forEach(c=>{b.add(`${c.width}x${c.height}`)});if(b.size<a.length)throw Error("Playlist contains multiple renditions with the same resolution.");};ql=function(a){const b=_.rk(0,a);a=d=>(d=b.getAttribute(d))?d.value:void 0;var c=a(_.rb);c=null!=c?{AUDIO:_.M,VIDEO:_.N,SUBTITLES:_.L}[c]:void 0;return{type:c,groupId:a(_.Ea),name:a(_.Sa),language:a(_.Ka),xj:a("AUTOSELECT"),default:a("DEFAULT"),Ej:a("FORCED"),cg:a("CHARACTERISTICS"),uri:a(_.ub)}};
|
|
109
|
+
sl=function(a){return a.split("\n").filter(b=>b.trim().startsWith("#EXT-X-STREAM-INF:")).map(b=>{var c=_.rk(0,b);if(c.getAttribute(_.Cb))throw Error("Playlist contains alternative video streams.");var d=_.K(c,_.ib);b=d?Number(d.split("x")[0]):null;d=d?Number(d.split("x")[1]):null;var e=_.K(c,_.na);e=e?Number(e):null;var f=_.K(c,"AVERAGE-BANDWIDTH");f=f?Number(f):null;c=_.K(c,_.qa);c=_.vl(_.t,c?c.split(","):[]);return b={bandwidth:e,ud:f,codec:c,width:b,height:d,mimeType:null}})};
|
|
110
|
+
tl=function(a,b){return(a=a.split("\n").filter(c=>c.trim().endsWith(".m3u8"))[0])?_.Cj(a,b):null};ul=function(a,b,c){return _.v(function*(){if(!b||!c)return null;var d=yield ll(a,b);d=[wl(d,b),xl(d,b)].filter(Boolean);return _.yl(d,_.t,c)})};wl=function(a,b){return(a=a.split("\n").find(c=>!c.startsWith("#")&&0<c.trim().length))?_.Cj(a,b):null};xl=function(a,b){a=a.split("\n").find(c=>c.startsWith("#EXT-X-MAP:"));return a?(a=_.K(_.rk(0,a),_.ub))?_.Cj(a,b):null:null};
|
|
111
|
+
Bl=function(a,b){var c=zl;Al.set(`${a.toLowerCase().split(";")[0]}-${c}`,{priority:c,plugin:b})};_.Fl=function(a,b){var c=[Cl,Dl,El,zl];for(const d of c)if(c=Al.get(`${a.toLowerCase().split(";")[0]}-${d}`)){const e=c.plugin(),f=e.isSupported(a,b);e.destroy();if(f)return c.plugin}return null};_.Gl=function(a,b){b&&(a+=';codecs\x3d"'+b+'"');return a.replace(/\s/g,"")};_.Hl=function(a){return a.split(";")[0]};
|
|
112
|
+
_.Il=function(a){a=a.split(/\s*;\s*/);a.shift();return(a=a.find(b=>b.startsWith("codecs\x3d")))?a.split("\x3d")[1].replace(/^"|"$/g,"").split(/\s*,\s*/).join(","):""};_.Kl=function(a,b,c){for(const d of _.Jl)if(d.probe(b,c))return d.create(a);return null};_.Ll=function(a){a=_.Jl.indexOf(a);0<=a&&_.Jl.splice(a,1)};Ml=function(a){a.h=[];a.A={};a.a.clear();a.o.clear();a.f.release()};
|
|
113
|
+
Ol=function(a,b,c){const d=Nl(a,b);if(c){if(void 0===a.h.find(f=>f.id===c.id))throw Error(`Unknown track with ID ${c.id} and type ${b}`);if(c.type!==b)throw Error(`Types mismatch for track ${c.type} and arg ${b}`);a.g.debug("Activate track type "+b+" with ID: "+c.id);if(d){a.o.set(b,c);let f;var e=!0;let g=!1;switch(b){case _.L:f="mode";e=_.Df;g=_.zd;break;case _.M:f="enabled";break;case _.N:f="selected"}if(f)for(const h of d)h[f]=c.type===c.type&&c.id===h.id?e:g}}else if(a.g.debug("Disable track type "+
|
|
114
|
+
b),a.a.get(b)&&d&&b===_.L){for(e of d)e.mode=_.zd;a.a.set(b,null)}b===_.M?a.m.trigger(new _.H(_.Jc)):b===_.L&&a.m.trigger(new _.H(_.Vf))};Pl=function(a){if(0!==a.j.size){for(const b of a.j){const [c,d]=b;{const e=c;if(null===d)Ol(a,e,null);else{const f=d,g=a.h.find(h=>h.type===e&&h.language===f.language&&h.kind===f.kind&&h.label===f.label);g&&Ol(a,e,g)}}}a.j.clear()}};Ql=function(a){return a.enabled||a.selected||a.mode===_.Df||a.mode===_.Yd};Sl=function(a,b,c){return Rl(a)&&b===_.N&&!!c.enableHlsVideoTrackInfo};
|
|
115
|
+
Tl=function(a,b,c){return _.v(function*(){var d=a.m.getLoadedSource();d&&a.l&&(d=yield a.l.a(d.url,c),d.mimeType&&(b.mimeType=d.mimeType),d.renditions&&0<d.renditions.length&&(b.renditions=d.renditions,b.renditions.forEach(e=>{e.track=b})))})};Ul=function(a,b,c){return Rl(a)&&(b===_.M||b===_.L)&&!!c.enableMetadata};
|
|
116
|
+
Vl=function(a,b,c){return _.v(function*(){var d=a.m.getLoadedSource();d&&a.l&&(d=yield a.l.a(d.url,c),d.Mc&&(d=d.Mc.get(`${b.type}:${b.label}`))&&d.cg&&(b.accessibility=d.cg.split(",").map(e=>e.trim()).map(e=>({value:e,type:b.type,protocol:"HLS"}))))})};Wl=function(a,b){return a.h.filter(c=>c.type===b)};Xl=function(a){(a=a.m.getTextDisplayer())&&a.remove(0,Infinity)};Nl=function(a,b){if(a=Yl(a,b))a=Array.from(a),b===_.L&&(a=a.filter(c=>c.kind!==_.re));return a};
|
|
117
|
+
Zl=function(a){var b=Yl(a,_.L);b&&(a.f.on(b,_.nc,a.M),a.f.on(b,tf,a.R),a.f.on(b,Yc,a.P));if(b=Yl(a,_.M))a.f.on(b,_.nc,a.J),a.f.on(b,tf,a.L),a.f.on(b,Yc,a.K);if(b=Yl(a,_.N))a.f.on(b,_.nc,a.S),a.f.on(b,tf,a.W),a.f.on(b,Yc,a.U)};am=function(a){_.v(function*(){const b=a.m.getConfiguration();$l(a,_.M,b.preferredAudioLanguage);if(!Nl(a,_.L).some(c=>Ql(c))){const c=Yl(a,_.L);yield new Promise(d=>{a.f.one(c,Yc,d);(new _.Jh(d)).la(1)})}a.B||$l(a,_.L,b.preferredTextLanguage)})};
|
|
118
|
+
bm=function(a,b){return(a=a.a.get(b)||null)&&a.renditions[0]};cm=function(a,b){return(a=a.o.get(b))&&a.renditions[0]};dm=function(a,b,c,d){const e=document.createElement("track");e.id=c;e.kind=b.kind;e.srclang=b.language;b.label&&(e.label=b.label);e.src=_.Fi(b.url)?URL.createObjectURL(new Blob([])):b.url;d.appendChild(e);a.C.add(e)};
|
|
119
|
+
em=function(a,b,c){return _.v(function*(){var d=a.m.getConfiguration();if(d=_.Kl(d,b.mimeType,_.Tf)){var e=_.ck(b.url),f={objectType:b.mimeType===_.uc?"tt":"c"};(f=yield _.dl(a.m.getNetworkEngine(),e,f).V)&&f.data&&(e="External_"+`${a.I++}`,a.A[e]=b,d=d.a(_.E(f.data)),d={url:URL.createObjectURL(new Blob([d])),kind:b.kind,language:b.language,label:b.label,mimeType:_.Tf},dm(a,d,e,c))}else a.g.warn("Track MIME type is not supported",b)})};
|
|
120
|
+
Rl=function(a){a=a.m.getLoadedSource();return!(!a||a.type!==_.fm&&!a.url.endsWith(".m3u8"))&&_.Yh()};Yl=function(a,b){if(!a.m)return null;a=a.m.getSurface();if(!a)return null;a=a.getMedia();if(!a)return null;switch(b){case _.M:return a.audioTracks;case _.N:return a.videoTracks;case _.L:return a.textTracks;default:return null}};
|
|
121
|
+
$l=function(a,b,c){c=_.kj(c).filter(e=>e);a.g.info("Find preferred tracks for",b,c);const d=Wl(a,b);c.some(e=>{const f=_.Tj(e);return(e=d.find(g=>{g=_.Tj(g.language||"");return _.Uj(f,g)}))?(a.g.info("Will select track with id",e.id),Ol(a,b,e),!0):!1})};hm=function(a){return a.name===Za&&gm.some(b=>a.message.startsWith(b))};
|
|
122
|
+
_.lm=function(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&_.Zh()&&(a=360);const b=_.Xj();b.maxAttempts=3;a={source:"",license:im,viewerId:void 0,autoplay:void 0,pauseWhenInBackground:!1,ads:{hls:{enable:!0,resolutionOffsetSec:35}},manifest:{attemptParameters:_.Xj(),availabilityWindowOverride:NaN,clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,autoCorrectDrift:!0,timeline:{version:1,type:void 0}},abr:{enabled:!0,defaultBandwidthEstimate:1E3,switchInterval:8,bandwidthUpgradeTarget:.85,
|
|
123
|
+
bandwidthDowngradeTarget:.95,useSwitchIntervalForInitialSwitch:!1,restrictions:jm(a),useCmsd:!0},contentSteering:{enabled:!0,attemptParameters:_.Xj()},drm:null,cmcd:{enabled:!1,version:1,rtpMultiplier:5,deliveryMode:"headers"},enableHtmlCue:!0,preferredAudioLanguage:"",preferredTextLanguage:"",preferredAudioRole:_.ne,preferredTextRole:"",preferredAudioChannelCount:2,preferredAudioCodec:[],preferredVideoCodec:[],preferSpatialAudio:!1,preferForcedSubtitles:!1,volume:null,startTime:null,loop:!1,lowLatencyMode:!1,
|
|
124
|
+
suggestedPresentationDelay:void 0,muted:void 0,forceWaitForTracks:!1,xmlParser:_.km,streaming:{attemptParameters:b,bufferingGoal:10,rebufferingGoal:2,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,relativeTextTimestamp:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,disableAudioTracks:!1,disableVideoTracks:!1,smallGapLimit:.5,jumpLargeGaps:!0,gapTolerance:.001,durationBackoff:1,maxSegmentToMediaOffset:1,forceNativeTS:!1,preferNativeHlsOnSafari:!0,safeSeekOffset:5,stallEnabled:!0,
|
|
125
|
+
stallThreshold:3,stallSkip:.5,bufferLimitUpdateInterval:.5,overridePasp:!1,enableLiveEdgeChasing:!1,chasingRate:1.15,startChasingAt:5,stopChasingAt:2,chaseJumpDistance:10,patchEdgeWhenMixedContent:!1,ignoreDrift:!1,disableFragmentSupport:!1,disableMergedFragments:!1,ignoreManagedMediaSourceStreamingHints:!1,enableStalledSegmentAbort:!0},mediaSource:{codecSwitchingStrategy:_.lf},restrictions:jm(),tizen:{sideStreamText:_.Ph(2)},safari:{enableHlsVideoTrackInfo:!1,enableMetadata:!1},mse:{sendPlaybackSessionIdHeader:!1},
|
|
126
|
+
trickPlay:{speedUpMode:_.xd,preferTrickPlayTracks:!0},playlist:{timeline:"basic",content:_.Db,cropTimeline:!1},yospace:{enabled:!1},broadpeak:{adTracking:!1},cmsd:{enabled:!0},mediatailor:{enabled:!1,sessionConfig:{}},disableRestrictions:!1,chromecast:{useSenderAbrConfig:!1,useSenderStreamingConfig:!1}};if(_.Ph()||_.Sh())a.ads.hls.enable=!1;if(_.Oh("Edge/")||_.Ph())a.streaming.gapDetectionThreshold=.5;_.Sh()&&(a.streaming.stallEnabled=!1);_.Sh()&&79===_.Wh().major&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=
|
|
127
|
+
1,a.streaming.stallSkip=1,a.streaming.gapDetectionThreshold=.02);_.Ph()&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=0);a.vr={enable:!1,attachMouseListener:!0,fieldOfView:70,sensitivity:1,invertHorizontalControl:!1,invertVerticalControl:!1};return a};jm=function(a){a=void 0===a?Infinity:a;return{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}};
|
|
128
|
+
_.nm=function(a,b){b=void 0===b?{}:b;if(!a)return _.lm();const c=[_.lm()];let d=!1;for(let e of a)null!==e&&void 0!==e&&(_.dh(e)&&(e={source:e}),e.lowLatencyMode&&!d&&(c.push({streaming:{rebufferingGoal:.1,bufferLimitUpdateInterval:.01,attemptParameters:{maxAttempts:3,baseDelay:250,backoffFactor:1}},abr:{bandwidthUpgradeTarget:.6,bandwidthDowngradeTarget:.95},manifest:{lowLatencyMode:!0}}),d=!0),c.push(e),b.Ri||null==e.suggestedPresentationDelay||c.push({manifest:{suggestedPresentationDelay:e.suggestedPresentationDelay}}));
|
|
129
|
+
a=_.Xg.apply(null,c);_.dh(a.volume)&&(""===""+a.volume?a.volume=null:a.volume=Number(a.volume));if(!_.z(a.volume)&&(!_.eh(a.volume)||gh(a.volume)))throw new _.J(_.C,7,7100,"config.volume is not a number");if(!_.z(a.preferredTextLanguage)&&!_.dh(a.preferredTextLanguage)&&!Array.isArray(a.preferredTextLanguage))throw new _.J(_.C,7,7100,"config.preferredTextLanguage is not a string or an array");if(!_.z(a.preferredAudioLanguage)&&!_.dh(a.preferredAudioLanguage)&&!Array.isArray(a.preferredAudioLanguage))throw new _.J(_.C,
|
|
130
|
+
7,7100,"config.preferredAudioLanguage is not a string or an array");if(!_.z(a.preferredAudioCodec)&&!_.dh(a.preferredAudioCodec)&&!Array.isArray(a.preferredAudioCodec))throw new _.J(_.C,7,7100,"config.preferredAudioCodec is not a string or an array");if(!_.z(a.preferredVideoCodec)&&!_.dh(a.preferredVideoCodec)&&!Array.isArray(a.preferredVideoCodec))throw new _.J(_.C,7,7100,"config.preferredVideoCodec is not a string or an array");if(!_.z(a.drm)){if(a.drm.env&&!_.dh(a.drm.env))throw new _.J(_.C,7,
|
|
131
|
+
7100,"config.drm.env is not a string");if(a.drm.offlineId&&!_.dh(a.drm.offlineId))throw new _.J(_.C,7,7100,"config.drm.offlineId is not a string");}if(b=a.streaming){b.bufferingGoal=Number(b.bufferingGoal);b.rebufferingGoal=Number(b.rebufferingGoal);b.bufferBehind=Number(b.bufferBehind);b.smallGapLimit=Number(b.smallGapLimit);b.durationBackoff=Number(b.durationBackoff);if(!_.eh(b.bufferingGoal)||gh(b.bufferingGoal))throw new _.J(_.C,7,7100,"config.streaming.bufferingGoal is not a number");if(!_.eh(b.rebufferingGoal)||
|
|
132
|
+
gh(b.rebufferingGoal))throw new _.J(_.C,7,7100,"config.streaming.rebufferingGoal is not a number");if(b.rebufferingGoal>b.bufferingGoal)throw new _.J(_.C,7,7100,"config.streaming.rebufferingGoal must be \x3e\x3d bufferingGoal");if(!_.eh(b.bufferBehind)||gh(b.bufferBehind))throw new _.J(_.C,7,7100,"config.streaming.bufferBehind is not a number");if(!_.eh(b.smallGapLimit)||gh(b.smallGapLimit))throw new _.J(_.C,7,7100,"config.streaming.smallGapLimit is not a number");if(!_.eh(b.durationBackoff)||gh(b.durationBackoff))throw new _.J(_.C,
|
|
133
|
+
7,7100,"config.streaming.durationBackoff is not a number");b=a.manifest;if(_.z(b.availabilityWindowOverride))b.availabilityWindowOverride=NaN;else if(typeof b.availabilityWindowOverride!==_.r)throw new _.J(_.C,7,7100,"Invalid value for |manifest.availabilityWindowOverride|");mm(a.restrictions);mm(a.abr.restrictions);a.abr.initialRestrictions&&mm(a.abr.initialRestrictions)}return a};
|
|
134
|
+
mm=function(a){_.z(a.maxPixels)&&(a.maxPixels=Infinity);_.z(a.maxBandwidth)&&(a.maxBandwidth=Infinity);_.z(a.maxHeight)&&(a.maxHeight=Infinity);_.z(a.maxWidth)&&(a.maxWidth=Infinity);_.z(a.minPixels)&&(a.minPixels=0);_.z(a.minBandwidth)&&(a.minBandwidth=0);_.z(a.minHeight)&&(a.minHeight=0);_.z(a.minWidth)&&(a.minWidth=0);a.minWidth=Number(a.minWidth);a.maxWidth=Number(a.maxWidth);a.minHeight=Number(a.minHeight);a.maxHeight=Number(a.maxHeight);a.minBandwidth=Number(a.minBandwidth);a.maxBandwidth=Number(a.maxBandwidth);
|
|
135
|
+
a.minPixels=Number(a.minPixels);a.maxPixels=Number(a.maxPixels);if(Number.isNaN(a.minWidth)||Number.isNaN(a.maxWidth)||Number.isNaN(a.minHeight)||Number.isNaN(a.maxHeight)||Number.isNaN(a.minBandwidth)||Number.isNaN(a.maxBandwidth)||Number.isNaN(a.minPixels)||Number.isNaN(a.maxPixels))throw new _.J(_.C,7,7100,"Restrictions contain NaN");};om=function(a){return typeof a===_.Be&&!Array.isArray(a)&&"source"in a};
|
|
136
|
+
pm=function(a,b){return _.v(function*(){0===a.getState()&&(a.log.debug("Player is in IDLE state. Postpone seek."),yield new Promise((c,d)=>{a.L.one(a,_.af,()=>{switch(a.getState()){case 6:case 8:case 10:a.log.debug("Valid seek state reached.");c();break;default:a.log.warn("Invalid seek target state. Aborting seek"),d()}})}));b.readyState>HTMLMediaElement.HAVE_NOTHING||(yield new Promise(c=>{a.L.one(b,_.le,c)}))})};
|
|
137
|
+
qm=function(a,b,c,d,e){return new Promise(f=>{const g=h=>{const k=a.getMediaPosition(),l=.1>=Math.abs(c-k);var m=.25<k-c;const n=b.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,p=h.type===_.Bf,u=h.type===_.nf,x=h.type===_.$f,y=u&&n;m=p||l&&y||x&&m;a.log.debug("Checking seeking state after "+h.type+" event. Seek completed:",m,"Current Time:",k,"Target Time:",c,"Native Event:",p,"Time reached",l,"Timeupdate:",x,"Progress:",u,"ReadyState:",n,"Progress Ready:",y);m?(a.qf=!1,a.Jb=!1,a.L.off(b,_.Bf,g),
|
|
138
|
+
a.L.off(b,_.$f,g),a.L.off(b,_.nf,g),a.Nf(),a.trigger(new _.H(_.jg)),f()):u&&e===k&&(a.log.debug("Seek seemed to have been ignored. Trying again"),b.currentTime=c)};a.trigger(new _.H(_.kg));a.L.on(b,_.Bf,g);a.L.on(b,_.$f,g);a.L.on(b,_.nf,g);a.log.info(`Seeking to ${c}. Delta ${d}`);a.qf=!0;a.Jb=!0;b.currentTime=c})};_.sm=function(a){return _.rm.get(a)||null};_.um=function(a){_.rm.get(a.id())?tm.warn("Component already in use."):_.rm.set(a.id(),a)};
|
|
139
|
+
vm=function(a){return Array.from(_.rm.values()).find(b=>b instanceof a)||null};wm=function(a){for(const b of _.rm.values())a(b)};xm=function(a){wm(b=>{b.playerConstructed(a)})};ym=function(a){wm(b=>{b.beforeLoad(a)})};_.zm=function(a){wm(b=>{b.drmConfigurationResolved(a)})};Am=function(a){wm(b=>{b.afterLoad(a)})};Bm=function(a){if(null!==vm(a))return null;a=new a;a.install();_.um(a);tm.info("Installed component:",a.id());return a};
|
|
140
|
+
Fm=function(a){if(a=vm(a))a.uninstall(),_.rm.delete(a.id()),tm.info("Uninstalled component:",a.id())};Gm=function(a,b){3===b.type&&(a.f&&(a.g.debug("Attaching tracking token"),b.headers[Hg]=a.f),a.a&&(b.headers[Ig]=a.a))};
|
|
141
|
+
Hm=function(a,b){return b.request&&3===b.request.type&&(a.f=b.headers[Hg],a.a=b.headers[Ig],b=b.headers["x-dt-csl-renewal-info"],a.f&&a.g.debug("Loaded tracking token "+a.f),a.a&&a.g.debug("Loaded followup token "+a.a),b)?(a=JSON.parse(_.vi(_.Lk(b))),{delay:a.renewalPeriod,tj:{maxAttempts:a.retryCount,baseDelay:1E3*a.retryPeriod,backoffFactor:1,fuzzFactor:0,timeout:0}}):null};_.Im=function(){throw new _.J(_.C,3,3E3);};
|
|
142
|
+
_.Jm=function(a,b,c){const d=c||0;c=b.byteLength-d;const e=_.E(a.f.buffer);b=_.E(b.buffer,d,c);try{e.set(b,a.a),a.a+=c}catch(f){_.Im()}};_.O=function(a,b){try{a.f.setUint32(a.a,b,a.h),a.a+=4}catch(c){_.Im()}};_.Km=function(a){return a.a<a.f.byteLength};_.Lm=function(){throw new _.J(_.C,3,3E3,"Buffer read out of bounds.");};_.Mm=function(a){try{const b=a.f.getUint8(a.a);a.a+=1;return b}catch(b){_.Lm()}};_.Nm=function(a){try{const b=a.f.getUint16(a.a,a.h);a.a+=2;return b}catch(b){_.Lm()}};
|
|
143
|
+
_.P=function(a){try{const b=a.f.getUint32(a.a,a.h);a.a+=4;return b}catch(b){_.Lm()}};_.Om=function(a){try{const b=a.f.getInt32(a.a,a.h);a.a+=4;return b}catch(b){_.Lm()}};_.Pm=function(a){let b=0,c=0;try{!0===a.h?(b=a.f.getUint32(a.a,!0),c=a.f.getUint32(a.a+4,!0)):(c=a.f.getUint32(a.a,!1),b=a.f.getUint32(a.a+4,!1))}catch(d){_.Lm()}if(2097151<c)throw new _.J(_.C,3,3001);a.a+=8;return c*Math.pow(2,32)+b};Qm=function(a,b){const c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=_.Mm(a);return c};
|
|
144
|
+
_.Rm=function(a,b){a.a+b>a.f.byteLength&&_.Lm();var c=a.a+a.f.byteOffset;c=a.f.buffer.slice(c,c+b);a.a+=b;return _.E(c)};Sm=function(a){let b=0;for(let c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};_.Tm=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};_.Um=function(a){for(;_.Km(a.reader)&&!a.parser.a;)a.parser.Ce(a.start+a.headerSize,a.reader,a.partialOkay)};_.Vm=function(a){for(let b=_.P(a.reader);0<b&&!a.parser.a;--b)a.parser.Ce(a.start+a.headerSize,a.reader,a.partialOkay)};
|
|
145
|
+
_.Wm=function(a){return b=>{const c=b.reader.Sa()-b.reader.getPosition();a(_.Rm(b.reader,c))}};_.Xm=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};Ym=function(a){let b="";try{b=_.yi(a)}catch(c){}return b};_.$m=function(a){a=Ym(a);let b="";a.length&&(b=(new _.Zm(a)).a);return b};
|
|
146
|
+
bn=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.vi(a)),d=_.Lk(c.sinf[0]);(new _.an).N(_.Gf,_.Um).N("schi",_.Um).N("tenc",e=>{e.reader.skip(6);_.Mm(e.reader)&&(e.reader.skip(1),b=_.Nk(_.Rm(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
|
|
147
|
+
dn=function(a,b,c){if(!c||!c.byteLength)throw new _.J(_.C,6,6102);let d;typeof b===_.Nf?d=_.Ai(b,!0):d=b;a=_.Ai(Ym(a),!0);b=new _.cn(12+a.byteLength+d.byteLength+c.byteLength,!0);_.O(b,a.byteLength);_.Jm(b,_.E(a));_.O(b,d.byteLength);_.Jm(b,_.E(d));_.O(b,c.byteLength);_.Jm(b,_.E(c));return _.E(b.buffer)};_.en=function(a){var b=_.E(a.body);b=_.Kk(b);a.headers[_.ua]=_.Cc;a.body=_.zi("spc\x3d"+b).buffer};
|
|
148
|
+
_.fn=function(a){let b;try{b=_.vi(a.data)}catch(c){return}b=b.trim();"\x3cckc\x3e"===b.substr(0,5)&&"\x3c/ckc\x3e"===b.substr(-6)&&(b=b.slice(5,-6));try{const c=JSON.parse(b);c.ckc&&(b=c.ckc);c.CkcMessage&&(b=c.CkcMessage);c.License&&(b=c.License)}catch(c){}a.data=ti(_.Lk(b))};
|
|
149
|
+
gn=function(a){switch(a){case "PRODUCTION":return"https://lic.drmtoday.com";case "STAGING":return"https://lic.staging.drmtoday.com";case "DEMO":return"https://lic-demo.staging.drmtoday.com";case "TEST":return"https://lic.test.drmtoday.com";default:throw new _.vj(`Cannot infer DRMtoday base URL for environment: ${a}`);}};_.hn=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};
|
|
150
|
+
_.jn=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.$g(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers["x-dt-auth-token"]=b)}};ln=function(a){const b={},c=a?a[Jg]:void 0;a=kn[a?a[Jg]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};
|
|
151
|
+
nn=function(a){a=a["x-dt-li"];if(!a)return null;try{const b=JSON.parse(atob(a));a={};b.ti&&(a.requestId=b.ti);b.rpd&&(a.delay=Number(b.rpd)/1E3);return a}catch(b){return _.mn.warn("Unable to parse DRMtoday License Info header (x-dt-li)",b),null}};_.pn=function(a){a=on[a];if(!a)return null;const b=_.li();return b.os===ei&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};qn=function(a,b){a.size=void 0===b?0:1;a.g.debug("Setting key status to",b);a.a=b};
|
|
152
|
+
sn=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=rn.value().get(b),c.one(a,b,d))};
|
|
153
|
+
tn=function(a,b){a.f=b;_.Fh(a.a);if(!b)return Promise.resolve();a.a.on(b,Pd,c=>{_.rh("AppleEmeManager.cancelNativeMediaEncryptedEvent_",c);"MediaEncryptedEvent"in window&&c instanceof MediaEncryptedEvent&&(a.g.info("Cancel native MediaEncryptedEvent when using Apple-prefixed EME"),c.stopImmediatePropagation())});a.a.on(b,Fg,c=>{{a.g.debug("Handle webkitNeedKey event");c=_.E(c.initData);if(_.si(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=xi(c.subarray(4),
|
|
154
|
+
!0);c=_.zi(c);const d=new Event(Pd);d.initDataType="skd";d.initData=ti(c);a.f.dispatchEvent(d)}});sn(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.h));return Promise.resolve()};un=function(a,b){qn(a.keyStatuses,b);b=new _.H(ce);a.dispatchEvent(b)};
|
|
155
|
+
xn=function(a,b){a.a=b;_.Fh(a.f);b&&(a.f.on(b,a.h+"needkey",c=>{{const d=new Event(Pd);d.initDataType=_.Vc;d.initData=ti(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.h+"keymessage",c=>{{const e=vn(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.H(_.qe,{messageType:d?fe:ee,message:c.message});d=e;_.rh("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.sh("Session not found",c.sessionId)}}),a.f.on(b,a.h+"keyadded",c=>{(c=vn(a,
|
|
156
|
+
c.sessionId))&&c.ready()}),a.f.on(b,a.h+"keyerror",c=>{var d=vn(a,c.sessionId);if(d){{var e=Error("EME v0.1b key error");const f=c.errorCode;f.systemCode=c.systemCode;e.errorCode=f;!c.sessionId&&d.f?(45===c.systemCode&&(e.message="Unsupported session type."),d.f.reject(e),d.f=null):c.sessionId&&d.a?(d.a.reject(e),d.a=null):(e=c.systemCode,c.errorCode.code===MediaKeyError.MEDIA_KEYERR_OUTPUT?wn(d,_.Le):1===e?wn(d,"expired"):wn(d,_.be))}}}))};
|
|
157
|
+
vn=function(a,b){let c=a.l.get(b);return c?c:(c=a.j.shift())?(c.sessionId=b,a.l.set(b,c),c):null};wn=function(a,b){qn(a.keyStatuses,b);b=new _.H(ce);a.dispatchEvent(b)};yn=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
|
|
158
|
+
zn=function(a,b,c){if(a.o)return Promise.reject(Error("The session is already initialized."));a.o=!0;let d;try{if(a.l===_.Oe)if(c)d=_.E(_.zi("LOAD_SESSION|"+c));else{const f=_.zi("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.E(b),f.byteLength);d=g}else d=_.E(b)}catch(f){return Promise.reject(f)}a.f=new _.uk;const e=yn(a,"generateKeyRequest");try{a.j[e](a.h,d)}catch(f){if(f.name!==Ja)return a.f=null,Promise.reject(f);(new _.Jh(()=>{try{a.j[e](a.h,d)}catch(g){a.f.reject(g),
|
|
159
|
+
a.f=null}})).la(.01)}return a.f};An=function(a,b,c){if(a.a)a.a.then(()=>An(a,b,c)).catch(()=>An(a,b,c));else{a.a=b;if(a.h===Bg){var d=_.vi(c);var e=JSON.parse(d);"oct"!==e.keys[0].kty&&(a.a.reject(Error("Response is not a valid JSON Web Key Set.")),a.a=null);d=_.Lk(e.keys[0].k);e=_.Lk(e.keys[0].kid)}else d=_.E(c),e=null;var f=yn(a,"addKey");try{a.j[f](a.h,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
|
|
160
|
+
Dn=function(a,b){var c=Bn;if(a){var d=c.find(e=>e.a()===a);if(d)return Cn.info(Jb+d.a()),d.create();Cn.info("Cannot create selected EME manager, falling back to the default.")}if(b&&(d=c.find(e=>e.a()===b)))return Cn.info(Jb+d.a()),d.create();c=c[0];if(!c)throw Error("Missing EME managers.");Cn.info(Jb+c.a());return c.create()};_.Gn=function(a){var b=_.Mk(a);b=parseInt(b.byteLength,10).toString(16);b=_.Mk("12"+b+a);return new En(Fn,a,b)};
|
|
161
|
+
_.In=function(a){const b=new _.Hn(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.P(b);var c=_.P(b);c=_.Tm(c);var d=_.P(b);const e=d>>>24;d&=16777215;var f=_.Rm(b,16);f=_.Nk(f);if(0<e){var g=_.P(b);b.skip(16*g)}g=_.P(b);const h=()=>{let u=_.Mm(b),x=(u&127)>>>0,y=7;for(;128<=u&&28>=y;)u=_.Mm(b),x=(x|(u&(28>y?127:15))<<y)>>>0,y+=7;return 28<y?-1:x},k=u=>{switch(u){case 0:do if(!_.Km(b))throw Error("not enough data to skip!");while(_.Mm(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
|
|
162
|
+
break;case 3:for(;4!==(u=h()&7);)k(u);break;case 5:b.skip(4);break;default:throw Error("invalid wire type "+u);}},l=[];let m=null;for(;_.Km(b);){var n=h(),p=n&7;n>>>=3;if(2===p){p=h();if(0>p)throw Error(`unable to read length of field ${n}`);p=Qm(b,p);2===n?l.push(p):4===n&&(m=p)}else k(p)}_.rh("Parsed WV PSSH Box","size",a,"name",c,mg,e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.Jk(m):"","keyIds",l.map(u=>_.Nk(u)));return 0<l.length?_.Gn(_.Nk(l[0])):null};
|
|
163
|
+
_.Jn=function(a){const b=[];b.push(a[3]);b.push(a[2]);b.push(a[1]);b.push(a[0]);b.push(a[5]);b.push(a[4]);b.push(a[7]);b.push(a[6]);a=_.E(a);a.set(b,0);return a};
|
|
164
|
+
_.Pn=function(a){var b=_.Kn;a:{var c=new _.Hn(new DataView(a.buffer),!0);_.P(c);for(_.Nm(c);_.Km(c);)if(1===_.Nm(c)){var d=_.Nm(c);c=_.Rm(c,d);break a}c=null}c||(c=a);a=xi(c,!0);d=b.j(a,"WRMHEADER");a=d.getAttribute(mg)||"";d=b.h(d,"DATA");var e=b.h(d,"LA_URL");b=e?b.f(e):"";var f=_.Kn;if(e=f.h(d,"KID"))if(e=f.f(e)){var g=f.h(d,pa);f=g?f.f(g):null;e={value:e,Re:f}}else e=null;else e=null;d=e?[e]:(e=Ln(d))?[e]:(d=Mn(d))?d:null;const {value:h="",Re:k}=d&&d[0]||{};d=_.Lk(h);d=_.Jn(d);d=_.Nk(d);return new _.Nn(_.On,
|
|
165
|
+
d,b,c,a,k)};Ln=function(a){var b=_.Kn;a=b.h(a,"PROTECTINFO");if(!a)return null;var c=b.h(a,"KID");if(!c)return null;b=c.getAttribute("VALUE");if(!b)return null;a=c.getAttribute(pa);c=c.getAttribute("ALGID");return{value:b,Re:a,uh:c}};
|
|
166
|
+
Mn=function(a){var b=_.Kn;a=b.h(a,"PROTECTINFO");if(!a)return null;a=b.h(a,"KIDS");if(!a)return null;a=b.a(a,"KID");if(!a.length)return null;b=[];for(const c of a)if(a=c.getAttribute("VALUE")){const d=c.getAttribute(pa),e=c.getAttribute("ALGID");b.push({value:a,Re:d,uh:e})}return b.length?b:null};_.Rn=function(a){Qn&&performance.mark(a)};_.Tn=function(a,b,c){Qn&&(b=performance.measure(a,b,c),null!=b&&Sn.info(`Step: "${a}" took ${b.duration.toFixed(0)} ms.`))};
|
|
167
|
+
Un=function(a){return _.v(function*(){const b=new Promise(c=>{(new _.Jh(c)).la(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.A("Timeout waiting for session close")})};_.Wn=function(a){return Vn(a)?_.rd:a};Xn=function(a,b){const c=[];b.forEach((d,e)=>{c.push({keySystem:e,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})});for(const d of a)d.drmInfos=c};
|
|
168
|
+
Yn=function(a,b){b=b[_.Wn(a.keySystem)];a.keyIds||(a.keyIds=[]);b&&(a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=b.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=b.persistentStateRequired),a.videoRobustness||(a.videoRobustness=b.videoRobustness||""),a.audioRobustness||(a.audioRobustness=b.audioRobustness||""),a.serverCertificate||(a.serverCertificate=b.serverCertificate||null))};
|
|
169
|
+
_.Zn=function(a,b){b=_.Gl(a.mimeType,b||a.codecs);if(_.Fl(b,a.type)){a=a.type;var c=_.Fl(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};$n=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};bo=function(a){return(a.audioCapabilities||[]).some(ao)||(a.videoCapabilities||[]).some(ao)};
|
|
170
|
+
co=function(a,b){a=_.$m(b);_.rh("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
|
|
171
|
+
eo=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&h===fa){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.bh(k)||(k=co);let l="";try{l=k(b,c,g)}catch(m){throw new _.J(_.C,6,6103);}if(!l.length)throw new _.J(_.C,6,6101,"Content ID is an empty string");c=dn(c,l,a)}return c};fo=function(a){return!!a.match(/^com\.widevine\.alpha/)};Vn=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
|
|
172
|
+
ao=function(a){return null!=a.robustness&&""!==a.robustness};go=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.Ok(g,f.serverCertificate))||c.push(f.serverCertificate));if(f.initData){for(const g of f.initData)g.periodId=f.periodId;for(const g of f.initData)d.some(h=>h.keyId&&h.keyId===g.keyId&&h.periodId===g.periodId?!0:!1)||d.push(g)}if(f.keyIds)for(a=0;a<f.keyIds.length;++a)e.includes(f.keyIds[a])||e.push(f.keyIds[a])}};
|
|
173
|
+
ho=function(a){var b=a.o;const c=a.Z;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"===d)&&a.w(new _.J(_.C,6,6014));a.D.hf(_.ih(c));a.A||a.g.info(wa);a.A=!0;a.F=!1};io=function(a){a.h.forEach((b,c)=>{const d=b.df;let e=c.expiration;isNaN(e)&&(e=Infinity);e!==d&&(a.D.gf(c.sessionId,e),b.df=e)})};
|
|
174
|
+
jo=function(a){return _.v(function*(){a.B.release();a.B=null;a.M.release();a.M=null;a.A=!1;a.F=!1;a.H.reject();a.ca.stop();a.ca=null;a.U.stop();a.U=null;const b=Array.from(a.h.keys());for(const c of a.h.values())c.Uc&&c.Uc.stop();a.h.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.v(function*(){a.g.debug("Closing session",c.sessionId);try{yield Un(c)}catch(d){a.g.warn("Error while closing session",d)}}))));if(a.C){try{yield a.l.h(null)}catch(c){a.g.warn("Error while resetting media keys",
|
|
175
|
+
c)}a.C=null}a.l=null;a.a=null;a.J.clear();a.I=null;a.L=[];a.f=null;a.w=null;a.D=null;a.R=0;a.P=null})};_.po=function(a,b){const c=ko(a,b),d=lo(b);for(const e of d)mo(a,e,a.f.La);b=no(a,b);if(!b.size)return a.S=!0,Promise.resolve();_.Rn(Cd);a=_.oo(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.Rn(Bd);_.Tn("DRM queryMediaKeys_()",Cd,Bd)})};
|
|
176
|
+
_.ro=function(a,b,c){c=void 0===c?[]:c;a.K=qo;a.L=c;a.G=0<c.length;a.g.debug("Using Persisted Licenses: "+a.G);a.f&&a.f.enableSessionCacheForSkd&&a.g.info("Enabled session cache for SKD license requests");return _.po(a,b)};
|
|
177
|
+
_.oo=function(a,b){if(1===b.size&&b.has(""))return Promise.reject(new _.J(_.C,6,6E3));null===a.l&&(a.l=Dn(a.f.emeApi,a.lb));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.uk;const e=_.li(),f=(k,l,m)=>{l.drmInfos.some(n=>!!n.licenseServerUri)===k&&(d=d.catch(()=>{if(a.j)return null;if(m===_.rd){if((_.Lh()||e.os===gi&&_.Oh("Chrome")&&!_.Lh())&&!a.f.La[m].useLegacySystem)return l.label=sd,a.l.a(sd,
|
|
178
|
+
[l]).catch(()=>{a.g.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");l.label=_.rd;$n(l);return a.l.a(m,[l])});$n(l)}if(m===_.td&&a.f.widevineVersion!==_.td){const n=a.f.widevineVersion;if(!n.startsWith(_.td))return a.g.error(`Invalid "widevineVersion" value "${n}".`),Promise.reject();const p=Object.assign({},l,{label:n,distinctiveIdentifier:_.Je,persistentState:_.Je});return a.l.a(n,[p]).catch(()=>a.l.a(m,[l]))}return a.l.a(m,[l]).catch(n=>
|
|
179
|
+
{a:{if(m===_.td&&bo(l)){const p=_.li();if(bo(l)&&p.os===ei&&p.browser===Zc){a.g.warn("requestMediaKeySystemAccess() failed",n);a.g.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");$n(l);n=a.l.a(m,[l]);break a}}throw n;}return n})}))};let g=a.f.preferredDrmSystem;if(!g){var h=_.li();if(h.os===gi&&10<=h.osVersion.major&&"edge"===h.browser)g=_.rd;else if("safari"===h.browser)g=_.pd;else if(h.browser===Zc||"firefox"===h.browser)g=_.td}g&&(h=
|
|
180
|
+
b.get(g))&&(f(!0,h,g),f(!1,h,g));for(const k of[!0,!1])b.forEach((l,m)=>{m!==g&&f(k,l,m)});d=d.catch(()=>{throw new _.J(_.C,6,6001,"Failed to get MediaKeySystemAccess.");});d=d.then(k=>{if(a.j)return null;a.J.clear();var l=k.getConfiguration();a.g.info("Got MediaKeySystemAccess with configuration",l);var m=l.audioCapabilities||[];l=l.videoCapabilities||[];for(var n of m)a.J.add(n.contentType.toLowerCase());for(var p of l)a.J.add(p.contentType.toLowerCase());{m=k.keySystem;n=b.get(_.Wn(k.keySystem));
|
|
181
|
+
p=[];l=[];const u=[],x=[];go(n.drmInfos,p,l,u,x);1<l.length&&_.A("Multiple unique server certificates found! Only the first will be used.");1<p.length&&_.A("Multiple unique license server URIs found! Only the first will be used.");m={keySystem:m,licenseServerUri:p[0],distinctiveIdentifierRequired:n.distinctiveIdentifier===_.uf,persistentStateRequired:n.persistentState===_.uf,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:
|
|
182
|
+
"",serverCertificate:l[0],initData:u,keyIds:x,periodId:null}}a.a=m;if(!a.a.licenseServerUri)throw new _.J(_.C,6,6012,a.a.keySystem);return k.createMediaKeys()}).then(k=>{a.j||(a.g.info("Created MediaKeys for key system",a.a.keySystem),a.I=k,a.S=!0)}).catch(k=>{if(!a.j){a.a=null;a.J.clear();if(k instanceof _.J)throw k;throw new _.J(_.C,6,6002,{browserError:k.message});}});c.reject();return d};
|
|
183
|
+
so=function(a){a=hh(a.f.La[_.Ke]||{});if(0===a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.Mk(f);e=_.Mk(e);e={kty:"oct",kid:_.Kk(f,!1),k:_.Kk(e,!1)};b.push(e);c.push(e.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:_.zi(d),initDataType:"keyids"}];return{keySystem:_.Ke,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
|
|
184
|
+
keyIds:[],periodId:null}};lo=function(a){const b=[];for(const c of a)for(const d of c.drmInfos)b.push(d);return b};to=function(a,b){for(const c of b)""===c.licenseServerUri||a.f.La[c.keySystem]||(a.f.La[c.keySystem]={licenseUrl:""})};
|
|
185
|
+
ko=function(a,b){const c=b.some(g=>0<g.drmInfos.length);if(!c){var d=hh(a.f.La);Xn(b,d)}d=a.f.La[_.pd];const e=b.some(g=>g.drmInfos.some(h=>h.keySystem===_.pd));if(!1!==a.f.wj&&_.Yh()&&!e&&d)for(var f of b)f.drmInfos.push({keySystem:_.pd,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null});if(f=so(a))for(const g of b)g.drmInfos=[f];b=lo(b);to(a,b);for(const g of b)Yn(g,
|
|
186
|
+
a.f.La);return c};mo=function(a,b,c){const d=_.Wn(b.keySystem);c=c[d];d===_.Ke&&b.licenseServerUri?a.g.debug("Using Clear Key data URI for",d):c&&c.licenseUrl?(b.licenseServerUri=c.licenseUrl,a.g.debug("Using license server URI from user-configured clpp.drm.DrmEnvironment (licenseUrl) for",d)):a.g.debug("Using license server URI from the manifest for ",d)};
|
|
187
|
+
no=function(a,b){var c=new Set(lo(b));const d=a.G?_.uf:_.Je,e=a.G?[_.Oe]:[Rf];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.Vc],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.Je,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.Zn(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.Ph()&&(h=_.Zn(b,_.Od));const k=c?_.Zn(c):"";let l=null;c&&"ac-3"===c.codecs.toLowerCase()&&_.Ph()&&(l=_.Zn(c,_.Od));
|
|
188
|
+
for(const m of f.drmInfos){const n=a.get(m.keySystem);n.drmInfos.push(m);m.initData&&m.initData.length&&(n.initDataTypes=[...new Set(m.initData.map(p=>p.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.uf);m.persistentStateRequired&&(n.persistentState=_.uf);b&&_.kj(m.audioRobustness).forEach(p=>{const u={robustness:p||"",contentType:g};n.audioCapabilities.find(x=>x.robustness===u.robustness&&x.contentType===u.contentType)||n.audioCapabilities.push(u);h&&n.audioCapabilities.push({robustness:p||
|
|
189
|
+
"",contentType:h})});c&&_.kj(m.videoRobustness).forEach(p=>{const u={robustness:p||"",contentType:k};n.videoCapabilities.find(x=>x.robustness===u.robustness&&x.contentType===u.contentType)||n.videoCapabilities.push(u);l&&n.videoCapabilities.push({robustness:p||"",contentType:l})})}}return a};uo=function(a){return _.v(function*(){if(!a.l.o())if(a.P)yield a.P;else try{a.P=a.l.h(a.I),yield a.P}catch(b){a.j||a.w(new _.J(_.C,6,6003,b.message,b))}})};
|
|
190
|
+
_.yo=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.G||a.K!==qo)){var e=a.keySystem();if(!e.startsWith(_.pd)&&b===_.Vc){const f=new vo(c);if(1<f.a.length&&(e={"org.w3.clearkey":"1077efecc0b24d02ace33c1e52e2fb4b","com.widevine.alpha":"edef8ba979d64acea3c827dcd51d21ed","com.microsoft.playready":"9a04f07998404286ab92e65be0885f95","com.adobe.primetime":"f239e769efa348509c16a903c6932efb"}[e]))for(let g=0;g<f.f.length;g++)if(e===f.f[g]){c=c.subarray(f.a[g].start,f.a[g].end+1);break}}(a.C.webkitCurrentPlaybackTargetIsWireless||
|
|
191
|
+
_.Ph(2)||a.keySystem().startsWith(_.pd)||!_.wo(a,d,c,!0))&&xo(a,d,null,b,c)}};zo=function(a,b){return _.v(function*(){a.g.info(`Handle encrypted event for type ${b.initDataType}`);yield uo(a);b.initData&&_.yo(a,b.initDataType,_.E(b.initData))})};Bo=function(a){return _.v(function*(){_.Rn(Ed);const b=a.W.map(c=>Ao(a,c));a.ja=!0;a.W=[];yield Promise.all(b);_.Rn(Dd);_.Tn("drm.onPlay",Ed,Dd)})};
|
|
192
|
+
Do=function(a){const b=a.keySystem(),c=a.f.La[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return Co(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.ck([d],a.f.attemptParameters);f.type=3;f.licenseRequestType=Xc;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.g.debug("Fetching certificate");return a.D.Bb.fetch(f).V}).then(f=>{a.a.serverCertificate=_.E(f.data)}).catch(f=>{var g=
|
|
193
|
+
f.data.headers;g=Object.assign({message:Aa,url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},ln(g));throw new _.J(_.C,6,6100,g,f);})};
|
|
194
|
+
_.Eo=function(a){return _.v(function*(){if(a.I&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.I.setServerCertificate(a.a.serverCertificate);void 0===b||b||a.g.debug("Server certificates are not supported by the key system. The server certificate has been ignored.")}catch(b){throw new _.J(_.C,6,6004,{browserError:b.message});}})};
|
|
195
|
+
_.Ho=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.Ph(2);if(a.f.enforceSingleSession&&!a.keySystem().startsWith(_.pd)){const e=a.h.values();for(const f of e)_.Ok(c.initData,f.initData)?(a.g.info("Skipping Session creation. Existing init data in single session mode!"),d=!1):f.periodId===c.periodId&&(a.g.info("Skipping Session creation. Merging init data for period in single session mode "+`for Key ID ${c.keyId}.`),Fo(c.initData,f)||(f.me.push(c.initData),c.keyId&&!f.ub.includes(c.keyId)&&
|
|
196
|
+
f.ub.push(c.keyId),a.o.get(c.keyId)||a.o.set(c.keyId,Lf)),d=!1)}!d||a.G&&a.K===qo||(_.wo(a,c.keyId,c.initData)&&(d=!1),d&&(a.g.info("Request new media key session on create"),xo(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.L)_.Go(a,c);b.length||a.L.length||(a.A||a.g.info(wa),a.A=!0,a.F=!1,a.H.resolve());return a.H};
|
|
197
|
+
_.Io=function(a,b){if(!a.I)return Gh(a.B,b,()=>{a.w(new _.J(_.C,6,6010))}),Promise.resolve();a.C=b;a.l.l(b);a.B.one(a.C,_.Qe,()=>Bo(a));a.B.on(a.C,_.Ag,e=>{const f=a.F;a.F=!a.A;!f&&a.F&&(a.g.info("Waiting for DRM license key delivery"),a.D.onEvent(e))});var c=a.a.initData.find(e=>0<e.initData.length);let d=Promise.resolve();if(c||a.l.f()!==lb||a.L.length)d=uo(a);c=Promise.resolve();_.Sh()&&38===_.Wh().major||(a.a&&a.a.keySystem!==_.Ke&&!a.a.serverCertificate&&(c=Do(a)),c=c.then(()=>_.Eo(a)));return Promise.all([d,
|
|
198
|
+
c]).then(()=>{a.j||(_.Ho(a),a.B.on(a.C,Pd,e=>zo(a,e)))}).catch(e=>{if(!a.j){if(6004===e.code&&a.a&&a.a.keySystem===_.td&&1>a.R&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.g.warn("Detected invalid widevine server certificate!. Retrying"),a.w(new _.J(1,6,6004)),a.a.serverCertificate=null,a.R++,_.Io(a,b);1<=a.R&&a.g.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
|
|
199
|
+
Co=function(a,b){return _.v(function*(){const c=a.D.Zc();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
|
|
200
|
+
_.Go=function(a,b){let c;try{a.g.debug("Attempting to load an offline session",b),c=a.I.createSession(_.Oe)}catch(e){const f=new _.J(_.C,6,6005,{browserError:e.message});a.w(f);return Promise.reject(f)}a.B.on(c,_.qe,a.cb.bind(a));a.B.on(c,ce,a.bb.bind(a));const d={initData:null,loaded:!1,df:Infinity,tc:null,qb:new _.uk,periodId:null,me:[],keyId:null,ub:[],initDataType:null,Ac:null,sessionContext:{ldlDelay:0,customData:{}}};d.qb.catch(()=>{});a.h.set(c,d);return c.load(b).then(e=>{if(a.j)return null;
|
|
201
|
+
a.g.debug("Loaded offline session",b,e);if(!e)return a.h.delete(c),a.w(new _.J(_.C,6,6013)),null;d.loaded=!0;Jo(a)&&(a.A||a.g.info(wa),a.A=!0,a.F=!1,a.H.resolve());return c},e=>{a.j||(a.h.delete(c),a.w(new _.J(_.C,6,6005,{browserError:e.message})))})};Fo=function(a,b){if(!a)return!1;for(let c=0;c<b.me.length;c++)if(_.Ok(a,b.me[c]))return!0;return!1};
|
|
202
|
+
_.wo=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.h.keys()){const f=a.h.get(e);if(_.Ok(c,f.initData))return b?f.ub.includes(b)?d&&a.g.info("Skipping Session creation. "+`License for init data with Key ID ${b} was already `+`requested in Session: '${e.sessionId}'. `):(f.ub.push(b),a.o.get(b)||a.o.set(b,Lf),d&&a.g.info(pb+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.g.info(pb+`Session: '${e.sessionId}'`),!0;if(Fo(c,f))return d&&a.g.info("Skipping Session creation. License for init data was already requested [extra]"),
|
|
261
203
|
!0}return!1};
|
|
262
|
-
|
|
263
|
-
if(h&&m.keyId===h){a.g.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(u){a.g.warn("Unable to close session",u)}k=!1}}if(k){a.g.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.G?_.
|
|
264
|
-
k={
|
|
265
|
-
m=a.f.
|
|
266
|
-
a.w(new _.
|
|
267
|
-
|
|
268
|
-
_.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
(h=a.h.get(d.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
l?{headers:l}:{},
|
|
276
|
-
|
|
277
|
-
|
|
204
|
+
xo=function(a,b,c,d,e,f,g){f=void 0===f?null:f;g=void 0===g?!1:g;_.v(function*(){if(e.length){var h=b;if(!h)try{h=Ko(a,d,e,f)}catch(u){if(a.g.warn("Ignoring unrecognized init data. This may be caused by unsupported or malformed init data. Set `drm.ignoreUnrecognizedInitData \x3d false` if you want to override this behavior and use the init data after all.",{error:u,initDataType:d,initData:e}),a.f.ignoreUnrecognizedInitData)return}if(!g&&Lo(a,h,d,e)){var k=!0;if("skd"===d&&!a.f.enableSessionCacheForSkd)for(var l of a.h.keys()){var m=a.h.get(l);
|
|
205
|
+
if(h&&m.keyId===h){a.g.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(u){a.g.warn("Unable to close session",u)}k=!1}}if(k){a.g.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.G?_.Oe:Rf;var p=a.I.createSession(n);a.D.onEvent(new _.H(Id,{keySystem:a.keySystem()}));a.g.info(`Created new ${n} session for Key ID: '${h}'. `+`Init data type: ${d}.`)}catch(u){a.w(new _.J(_.C,6,6005,{browserError:u.message}));return}a.B.on(p,_.qe,a.cb.bind(a));a.B.on(p,ce,a.bb.bind(a));
|
|
206
|
+
k={Ac:f,me:[],initData:e,initDataType:d,keyId:h,ub:h?[h]:[],loaded:!1,df:Infinity,periodId:c,tc:null,qb:new _.uk,sessionContext:{ldlDelay:0,customData:{}}};k.qb.catch(()=>{});f&&(l=a.h.get(f),k.sessionContext=l.sessionContext);a.h.set(p,k);h&&!a.o.get(h)&&a.o.set(h,Lf);if(e)for(l=0;l<a.a.initData.length;l++)m=a.a.initData[l],m.keyId&&!k.ub.includes(m.keyId)&&_.Ok(m.initData,e)&&(k.keyId||(k.keyId=m.keyId),k.ub.push(m.keyId),a.o.get(m.keyId)||a.o.set(m.keyId,Lf));l=a.D.getConfiguration();m=a.keySystem();
|
|
207
|
+
m=a.f.La[m];n=(n=m.modifiers)&&n.transformInitData;_.bh(n)||(n=eo);try{e=n({playerConfig:l,initData:e,initDataType:d,drmInfo:a.a,drmSystemConfig:m,sessionContext:k.sessionContext,emeApi:a.l.f()})}catch(u){h=u;u instanceof _.J||(h=new _.J(_.C,6,6016,u));k.qb&&k.qb.reject(u);a.w(h);return}a.g.info(`Generate License Request for key ID: '${h}'`);p.generateRequest(d,e.buffer).catch(u=>{if(!a.j){var x=null;u.errorCode&&u.errorCode.systemCode&&(x=u.errorCode.systemCode,0>x&&(x+=Math.pow(2,32)),x="0x"+x.toString(16));
|
|
208
|
+
a.w(new _.J(_.C,6,6006,{browserError:u.message,error:u,extended:x},u))}})}else a.g.warn("Empty init data")})};Mo=function(a){let b=Infinity;a=a.h.keys();for(const c of a)isNaN(c.expiration)||(b=Math.min(b,c.expiration));return b};Jo=function(a){for(const b of a.h.values())if(!b.loaded)return!1;return!0};Lo=function(a,b,c,d){if(!b&&c!==_.Gf)return!1;d=b||bn(d);for(const e of a.h.values())if(b&&e.keyId===b||b&&e.ub.includes(b)||c===_.Gf&&(e.keyId||bn(e.initData))===d)return!0;return!1};
|
|
209
|
+
Ko=function(a,b,c,d){d=void 0===d?null:d;if("skd"===b){a:{var e=d;e=void 0===e?null:e;var f=a.keySystem(),g=a.f.La[f];f=a.D.getConfiguration();g=g&&g.modifiers&&g.modifiers.extractContentId;_.bh(g)||(g=co);try{var h={ldlDelay:0,customData:{}};e&&(h=a.h.get(e).sessionContext);var k=g(f,c,h);a.g.debug(`Extracted Content ID '${k}' from SKD`);var l=k;break a}catch(m){a.g.warn("Unable to extract Content ID from SKD",m)}l=""}return l}if(b===_.Gf)return bn(c)||"";if(b===_.Vc){l=a.keySystem();try{if(fo(l)){const m=
|
|
210
|
+
_.In(c);if(m)return m.a}else if(Vn(l)){{f=new _.Hn(new DataView(c.buffer,c.byteOffset,c.byteLength),!1);g=_.P(f);const m=_.P(f);h=_.Tm(m);const n=_.P(f);c=n>>>24;k=n&16777215;const p=_.Rm(f,16),u=_.Nk(p);if(0<c){const F=_.P(f);f.skip(16*F)}const x=_.P(f),y=_.Rm(f,x),B=_.Pn(y);_.rh("Parsed PR PSSH Box","size",g,"name",h,mg,c,"flags",k,"size",x,"systemId",u,"keyId",B.a);e=B}if(e)return e.a}}catch(m){throw a.g.warn("Unable to extract Key ID from PSSH data.",{error:m,keySystem:l}),m;}}return""};
|
|
211
|
+
Ao=function(a,b){return _.v(function*(){const c=b.target,d=a.h.get(c);if(d){var e=a.a.licenseServerUri;if(No(a,b))yield Oo(a,e,b,c,d);else{var f=a.Aa;if(0<f&&(a.g.info(`Delaying license request by ${f} s.`),yield yh(f),a.j))return;var g=a.keySystem(),h=a.f.La[g];"individualization-request"===b.messageType&&h&&h.individualizationServer&&(e=h.individualizationServer);var k=_.ck([e],a.f.attemptParameters);k.type=3;k.body=b.message;k.method=_.bb;fo(g)&&(k.headers[_.ua]=zc);k.licenseRequestType=b.messageType===
|
|
212
|
+
fe&&d.Ac?ee:b.messageType;k.sessionId=c.sessionId;if(k.licenseRequestType===ee)a.D.onEvent(new _.H(Hd));Vn(a.a.keySystem)&&Po(a,k);Gm(a.M,k);h=String(Math.floor(b.timeStamp));if(f=yield Qo(a,k,d,h,e,c.sessionId,b.messageType,f))if(e=Hm(a.M,f),yield Ro(a,c,f.data,d,h))h=Mo(a),a.D.onEvent(new _.H(_.Kd,{keySystem:g,expirationTime:h,expectedRenewalTime:e?Date.now()+1E3*e.delay:Number.NaN})),d.tc&&d.tc.resolve(),d.Ac&&(h=d.Ac,a.g.info(`Closing expired session '${h.sessionId}'`),Un(h).catch(()=>{a.g.warn("Unable to close expired session in time")}),
|
|
213
|
+
(h=a.h.get(d.Ac))&&h.Uc&&h.Uc.stop(),a.h.delete(d.Ac),d.Ac=null),(new _.Jh(()=>{a.j||(d.loaded=!0,d.qb&&d.qb.resolve(),Jo(a)&&(a.A||a.g.info(wa),a.A=!0,a.F=!1,a.H.resolve()))})).la(5),null!==d.initData&&(0<d.sessionContext.ldlDelay||e&&(_.Ci(g,_.pd)||_.Ci(g,_.rd)))&&(h=new _.Jh(()=>{!a.j&&a.M&&(a.g.info("Updating CSL Sessions"),Vn(g)?xo(a,d.keyId,d.periodId,d.initDataType,d.initData,c,!0):g.startsWith(_.pd)&&c.update(_.zi("renew")))}),d.Uc=h,h.la(e?e.delay:d.sessionContext.ldlDelay))}}else a.g.error(`Session metadata not found for ${c.sessionId}.`)})};
|
|
214
|
+
No=function(a,b){a=a.keySystem();return fo(a)&&b.message&&2===b.message.byteLength};Oo=function(a,b,c,d,e){return _.v(function*(){var f=_.ck([b],a.f.attemptParameters);f.type=3;f.body=c.message;f.method=_.bb;f.licenseRequestType=Xc;f.sessionId=d.sessionId;f.headers[_.ua]=zc;(f=yield So(a,f,e,b,d.sessionId,c.messageType))&&(yield Ro(a,d,f.data,e,String(Math.floor(c.timeStamp))))})};
|
|
215
|
+
Po=function(a,b){var c=xi(b.body,!0,!0);if(c.includes("PlayReadyKeyMessage")){a.g.debug("Unwrapping PlayReady request.");a=(new DOMParser).parseFromString(c,"application/xml");c=a.getElementsByTagName("HttpHeader");for(let d=0;d<c.length;++d)b.headers[c[d].querySelector("name").textContent]=c[d].querySelector(_.lg).textContent;b.body=_.Lk(a.querySelector("Challenge").textContent).buffer}else a.g.debug("PlayReady request is already unwrapped."),b.headers[_.ua]="text/xml; charset\x3dutf-8"};
|
|
216
|
+
Qo=function(a,b,c,d,e,f,g,h){return _.v(function*(){a.g.info("License request for "+`SID:'${f}'/KID:'${c.keyId}' `+`from msg '${g}'.`);yield To(a,b,c.sessionContext);a.g.debug("Sending DRM license request to",e,b);a.D.onEvent(new _.H(Gd,{delay:h}));var k=Date.now();_.Rn(`drm.license.req.${d}.start`);var l=null;try{l=yield a.D.Bb.fetch(b).V}catch(p){if(a.j)return null;l=p.data.headers;l=Object.assign({message:"Error while fetching DRM license!",url:p.data.url,status:p.data.status,response:p.data.response},
|
|
217
|
+
l?{headers:l}:{},ln(l));l=new _.J(_.C,6,6007,l,p);Uo(a,l,c);return null}_.Rn(`drm.license.req.${d}.end`);_.Tn(`drm.license.req.${d}`,`drm.license.req.${d}.start`,`drm.license.req.${d}.end`);k=Date.now()-k;const m=nn(l.headers);m&&(a.Aa=m.delay||0);let n="";m&&m.requestId&&(n=` RID:${m.requestId}`);a.g.info("License response for "+`SID:'${f}'/`+`KID:'${c.keyId}' `+`${l.data.byteLength} bytes `+`in ${k}ms${n}`);return a.j?null:l})};
|
|
218
|
+
Ro=function(a,b,c,d,e){return _.v(function*(){_.Rn(`drm.sess.update.${e}.start`);try{yield b.update(c)}catch(f){if(a.j)return!1;if(f===ob)return a.g.info("Ignore update for closed sessions"),!1;const g=new _.J(_.C,6,6008,{browserError:f.message});Uo(a,g,d);return!1}_.Rn(`drm.sess.update.${e}.end`);_.Tn(`drm.sess.update.${e}`,`drm.sess.update.${e}.start`,`drm.sess.update.${e}.end`);return a.j?!1:!0})};
|
|
219
|
+
So=function(a,b,c,d,e,f){return _.v(function*(){a.g.info("WV Server certificate request for "+`SID:'${e} from msg '${f}'.`);yield To(a,b,c.sessionContext);a.g.debug("Sending Widevine certificate request to",d,b);var g=Date.now(),h=null;try{h=yield a.D.Bb.fetch(b).V}catch(m){if(a.j)return null;h=m.data.headers;h=Object.assign({message:Aa,url:m.data.url,status:m.data.status,response:m.data.response},h?{headers:h}:{},ln(h));h=new _.J(_.C,6,6100,h,m);Uo(a,h,c);return null}g=Date.now()-g;const k=nn(h.headers);
|
|
278
220
|
let l="";k&&k.requestId&&(l=` RID:${k.requestId}`);a.g.info("WV Server certificate response for "+`SID:'${e}' `+`${h.data.byteLength} bytes `+`in ${g}ms${l}`);return a.j?null:h})};
|
|
279
|
-
|
|
280
|
-
_.
|
|
281
|
-
_.
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
a.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
()
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
(a.
|
|
323
|
-
|
|
324
|
-
_
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
g.
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
_.
|
|
353
|
-
|
|
221
|
+
To=function(a,b,c){return _.v(function*(){const d=a.D.getConfiguration();yield Co(a,d);const e=a.keySystem();var f=a.f.La[e];const g=(f=f&&f.modifiers)&&f.licenseRequest,h=f&&f.licenseResponse;g?b.requestModifiers.push(k=>g(d,k,c)):e.startsWith(_.pd)&&b.requestModifiers.push(k=>_.en(k));h?b.responseModifiers.push(k=>h(d,k,c)):e.startsWith(_.pd)&&b.responseModifiers.push(k=>_.fn(k))})};Uo=function(a,b,c){a.j||(a.w(b),c.tc&&c.tc.reject(b),c.qb&&c.qb.reject(b))};
|
|
222
|
+
_.Xo=function(a,b){a&&b&&(_.Vo.set(a,b),_.Wo.info(`Registered TextDisplayerFactory: '${a}'`))};_.Yo=function(a,b){b=b.find(c=>(c=_.Vo.get(c))?c.a(a):!1);if(null==b)return _.Wo.warn("Subtitles may not work as expected. No compatible text displayer found for this platform."),null;_.Wo.info(`Chosen the text displayer: ${b}`);return _.Vo.get(b)};
|
|
223
|
+
_.Zo=function(a){switch(a){case 0:return 0;case 2:case 4:return 1;case 6:case 5:return 2;case 7:case 8:return 3;case 9:case 10:return 4;case 11:case 1:return 5;case 3:return 6;default:return 0}};_.$o=function(a,b){if(null==a.a)a.a={timestamp:Date.now()/1E3,state:b,duration:0};else{{const c=Date.now()/1E3;a.a.duration=c-a.a.timestamp;a.a.state!==b&&(a.f.push(a.a),a.a={timestamp:c,state:b,duration:0})}}};
|
|
224
|
+
ap=function(a,b){let c=0;a.a&&a.a.state===b&&(c+=a.a.duration);for(const d of a.f)c+=d.state===b?d.duration:0;return c};bp=function(a){const b=d=>({timestamp:d.timestamp,state:d.state,duration:d.duration}),c=[];for(const d of a.f)c.push(b(d));a.a&&c.push(b(a.a));return c};cp=function(a){return a.a.map(b=>_.Yg(b))};
|
|
225
|
+
_.dp=function(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,switchHistory:[],stateHistory:[]}};ep=function(a){if(!a)return null;a=(new _.Dj(a)).a.pathname.toUpperCase();return a.endsWith(".MPD")?_.tc:a.endsWith(".M3U8")?_.fm:a.endsWith(".MP4")?_.qg:a.endsWith(".MP3")?"audio/mp3":a.endsWith("MANIFEST")||a.endsWith(".ISM")?_.Bc:null};
|
|
226
|
+
_.gp=function(a){let b;om(a)?b=a.source:b=a;Array.isArray(b)||(b=[b]);b=b.filter(c=>typeof c===_.Nf||"url"in c);a=[];for(let c=0;c<b.length;c++){const d=fp(b[c]);d&&a.push(d)}return a};
|
|
227
|
+
fp=function(a){let b=null;_.dh(a)&&(a={url:a});typeof a===_.Be&&!Array.isArray(a)&&"url"in a&&(b={url:a.url,type:a.type?a.type:null},_.z(a.drmProtected)||typeof a.drmProtected!==_.Mc||(b.drmProtected=a.drmProtected),_.z(a.isLive)||typeof a.isLive!==_.Mc||(b.isLive=a.isLive),_.z(a.name)||typeof a.name!==_.Nf||(b.name=a.name),_.z(a.videoMimeType)||typeof a.videoMimeType!==_.Nf||(b.videoMimeType=a.videoMimeType),_.z(a.audioMimeType)||typeof a.audioMimeType!==_.Nf||(b.audioMimeType=a.audioMimeType));
|
|
228
|
+
b&&!b.type&&(b.type=ep(a.url),b.type?hp.debug("Detect media type "+b.type+" for "+a.url):hp.warn("Unable to detect media type for "+a.url));return b};jp=function(a,b){if(a.w)throw new _.J(_.C,7,7E3);a.a||(a.h.on(b,_.Sd,()=>{{const c=ip(a);if(c)a.onError(c)}}),a.h.on(b,_.vf,()=>{const c=b.videoWidth,d=b.videoHeight,e=a.getTrackManager();e&&0<c&&0<d&&(e.w={width:c,height:d});a.trigger(new _.H(_.Lc,{detail:{width:c,height:d}}))}),a.a=b)};lp=function(a){const b=_.Yh()?fa:void 0;return new _.kp(a,b)};
|
|
229
|
+
mp=function(a){return _.v(function*(){if(a.w)return Promise.reject(new _.J(_.C,7,7E3));var b=a.ia[a.getSourceIndex()];if(!a.configuration.drm||!1===b.drmProtected)return a.log.debug("No DRM configuration present.","Skipping DRM engine initialization"),Promise.resolve();b=_.mk(a.configuration.drm);a.log.debug("Drm configuration: ",b);const c=a.getNetworkEngine();a.o=lp({Bb:c,onError:d=>a.onError(d),hf:()=>{},gf:(d,e)=>{a.trigger(new _.H(_.Fd,{expirationTime:e}))},onEvent:d=>{d instanceof _.H?a.dispatchEvent(d):
|
|
230
|
+
a.log.debug(_.xb,d.type)},getConfiguration:()=>a.getConfiguration(),Zc:()=>a.Zc()});a.o.f=b;yield _.ro(a.o,[{id:0,language:_.eg,primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:()=>null,getSegmentReference:()=>null,adjustSegmentDurations:()=>{},getDuration:a.getDuration.bind(a),initSegmentReference:null,Ka:0,mimeType:_.qg,codecs:"",encrypted:!0,keyId:null,language:_.eg,originalLanguage:_.eg,label:null,type:_.t,primary:!1,frameRate:void 0,
|
|
231
|
+
Ij:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,uj:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}]);yield _.Io(a.o,a.a)})};np=function(a,b){sn(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{3!==a.getState()&&a.seek(b).catch(c=>{a.log.warn("Error while seeking to start position.",c)})})};
|
|
232
|
+
ip=function(a){if(null===a.ia||!a.a.error)return null;const b=a.a.error.code;if(1===b)return null;let c=a.a.error.msExtendedCode;c&&(0>c&&(c+=Math.pow(2,32)),c=c.toString(16));return new _.J(_.C,3,3016,{code:b,Dj:c,message:a.a.error.message})};
|
|
233
|
+
pp=function(a){if(a.w)return new _.op(Promise.reject(new _.J(_.C,7,7E3)),()=>{});const b=a.ia[a.getSourceIndex()],c=a.configuration.startTime||null,d=a.a,e=a.H;c&&np(a,c);if(d.preload!==_.Ae)a.h.one(d,_.le,()=>{const g=Date.now()/1E3-e;a.f.B=g;a.log.debug("Time to load: ",g)});d.src=b.url;(_.Ph()||_.Sh())&&d.load();const f=new _.uk;a.h.one(d,If,()=>{const g=a.getConfiguration().manifest.attemptParameters.timeout||30;a.B||(a.B=(new _.Jh(()=>{f.reject(new _.J(_.C,3,3100,{message:`Unable to load media source successfully from ${b.url}`,
|
|
234
|
+
uri:b.url},d.error))})).la(g))});sn(d,a.configuration.forceWaitForTracks?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_METADATA,a.h,()=>f.resolve());d.error?f.reject(ip(a)):d.preload===_.Ae&&(a.log.warn('With \x3cvideo preload\x3d"none"\x3e, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way. Please do not use preload\x3d"none" with PRESTOplay for Web Apps.'),f.resolve());a.h.one(d,_.Sd,()=>{f.reject(ip(a))});return new _.op(f,
|
|
235
|
+
()=>{const g=new _.J(_.C,7,7001);f.reject(g);return Promise.resolve()})};qp=function(a,b){sn(b,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{if(a.isLive()&&3!==a.getState()){var c=a.getSeekRange().end,d=a.getPosition();Infinity===c||20>c-d||(a.log.warn("Detected that HLS live stream was not started from close to the live edge. Auto-fixing, seeking to seek range end."+`(position: ${d}, seek range end: ${c})`),a.seek(c).catch(e=>{a.log.warn("Error while seeking to seek range edge.",e)}))}})};
|
|
236
|
+
rp=function(a,b){let c=!1;a.h.on(b,_.Cf,()=>{c=b.paused});a.h.on(b,_.Bf,()=>{.2>b.duration-b.currentTime&&b.paused&&!c&&(a.log.warn("Player was auto-paused during seek to the end, auto-resuming."),b.play())})};_.up=function(a){0<=sp.indexOf(a)?tp.warn(`Factory '${a.name()}' is already registered`):(sp.push(a),tp.info(`Factory '${a.name()}' has been registered.`))};vp=function(a,b){const c=sp.find(d=>d.a(a,b))||null;c&&tp.info(`Chosen ads manager: ${c.name()}`);return c};
|
|
237
|
+
_.wp=function(a,b){a=document.createElement(a);for(const c in b){const d=b[c];null===d||void 0===d?a.setAttribute(c,""):a.setAttribute(c,d)}return a};_.xp=function(a,b){a.classList.add(b)};_.yp=function(a,b){if(a&&typeof b===_.Be)for(const c in b)a.style[c]=b[c]};_.zp=function(a){return document.createElement(a)};
|
|
238
|
+
Ap=function(a,b){const c=new MutationObserver(()=>{const d=Array.from(a.h.values());mj(Array.from(b.classList),Array.from(d))||b.classList.add(...d)});c.observe(b,{attributes:!0,attributeFilter:["class"]});return c};Bp=function(a,b){a.a&&0!==b.length&&(a.a.classList.add(b),a.h.add(b))};Cp=function(a,b,c){b.hasAttribute(vd)||(b.style.opacity="0",b.setAttribute(vd,""),a.j.one(b,Nd,()=>{b.removeAttribute(vd);b.style.opacity="1";c&&(c.style.opacity="1")}))};
|
|
239
|
+
Dp=function(a){if(a.Ma){let b=a.player.getDuration();a.maxDuration&&(b=Math.min(b,a.maxDuration));a.Ma.h=b}a.Ae&&a.Ae()};Ep=function(a){if(a.sideAdContainer)a=a.sideAdContainer;else if(a=a.Og.getSurface().getContainer(),!a)throw Error("Primary player does not have a container");return a};
|
|
240
|
+
Gp=function(a,b,c){return Array.from({length:2}).map((d,e)=>{var f=document.createElement(_.t);b.appendChild(f);d=a.ha.nb.create();f=new Fp(f);d.init(f,c);d.setSourceIndex(0);const g=f.getContainer();if(!g)throw Error("Failed to create player surface container element");g.classList.add("secondary");f.getMedia().classList.add(`v-${e}`);a.A.push(g);return d})};Hp=function(a){return[a.a,...a.o.a.map(b=>b.player)]};
|
|
241
|
+
Ip=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.debug(`Show video element .${b}`),d.classList.add(ed),d.classList.remove("clpp-hide")):(a.g.debug(`Hide video element .${b}`),d.classList.remove(ed),d.classList.add("clpp-hide")),a.F&&a.F(d,c))};Jp=function(a){return a.h.find(b=>!!b.primary)||null};
|
|
242
|
+
Xp=function(a,b,c){return _.v(function*(){if(a.w)a.g.warn(`Cannot ${c} item while busy (ID: ${b})`);else{var d=Kp(a,b);if(d){a.g.info(`${c} item (ID: ${b})`);a.w=!0;var e=a.f;e&&(e.player.isPaused()||(a.l?e.primary?Lp(a,e,Mp):e.player.pause():a.a.isLive()||e.player.pause()),e.primary?Lp(a,e,Mp):Lp(a,e,Np));var f=a.j.has(b);f&&a.j.delete(b);try{c===_.Qe?(e&&d.primary?yield Op(a,d):f?yield Pp(a,d):yield Qp(a,d),Dp(d)):f?a.g.error("Loading preloaded items is not supported"):yield Rp(a,d);Sp(a,d);d.primary?
|
|
243
|
+
Lp(a,d,Np):Lp(a,d,Mp);d.Ma&&Tp(a,d,d.Ma);if(d.Ea)d.player.one(_.Rd,d.Ea);e&&Up(a,e)}catch(g){a.g.error(`Item failed to ${c} (ID: ${b})`,g);if(d.primary)throw g;const h=Jp(a);h&&(a.g.warn("Ad failed, resuming primary item"),yield Op(a,h))}finally{a.w=!1,Vp(a),Wp(a,d.next)}}else a.g.warn(`Item not found (ID: ${b})`)}})};
|
|
244
|
+
Sp=function(a,b){const c=b.transition;if(c&&!c.Vg){if(c.Ea){const d=c.Ea,e=()=>{a.g.info(`Transition onEnded to (ID: ${d})`);a.play(d)};b.player.one(_.Rd,e);b.disposers.push(()=>{b.player.off(_.Rd,e)})}c.ye&&Yp(a,b,()=>{const d=a.f.Ma;d&&(b.disposers.forEach(e=>e()),b.disposers=[],a.a.trigger(new _.H(_.lc,{ad:d})),a.a.trigger(new _.H(_.Wb,{ad:d})),a.a.trigger(new _.H(_.Tb,{id:b.Yb})))});c.Vg=!0}};
|
|
245
|
+
Zp=function(a,b){return _.v(function*(){a.g.info("Crop ads by playout limit",b);var c=Jp(a),d=a.getCurrentItem();if(c&&d&&d.Ma&&null!=c.Y){var e=a.h.filter(l=>!l.primary),f=Math.max(...e.map(l=>l.vb));if(b>f)a.g.info("Playout limit is greater than ad pod duration, ignored.");else{var g=d.player.getPosition()+(d.vb-d.duration),h=e.sort((l,m)=>m.vb-l.vb)[0],k=c.Y;b<=g?(c.Y-=f-g,a.g.warn("Playout limit exceeded, immediately returning "+`to primary at ${c.Y.toFixed(1)} instead of `+`${k.toFixed(1)}`),
|
|
246
|
+
yield Xp(a,c.id,_.Qe),h.Ea&&h.Ea(),c=d.Ma,a.a.trigger(new _.H(_.lc,{ad:c})),a.a.trigger(new _.H(_.Wb,{ad:c})),a.a.trigger(new _.H(_.Tb,{id:d.Yb}))):(a.g.warn("Limiting playout of ads to",b),(d=e.find(l=>b<=l.vb&&b>=l.vb-l.duration))?(e=b-(d.vb-d.duration),d.Ma.h=e,c.Y-=f-b,a.g.info("Last ad is now ",d.Ma.gb(),"with cropped duration",e,"and primary will resume at",c.Y.toFixed(1),"instead of",k.toFixed(1)),h.Ea&&(d.Ea=h.Ea),d.transition={ye:{position:e,itemId:c.id,Y:c.Y}},Sp(a,d)):a.g.warn("Cannot find ad hit by limit"))}}})};
|
|
247
|
+
$p=function(a){return _.v(function*(){const b=a.f;b&&("loaded"!==b.state&&(yield b.jd),yield b.player.play(),b.state=_.bf,Dp(b))})};aq=function(a,b){a.g.info("Add items",b);a.h=a.h.concat(b.map(c=>Object.assign({},c,{state:"idle",disposers:[],preloadPromise:Promise.resolve(),jd:Promise.resolve()})))};
|
|
248
|
+
cq=function(a,b){return _.v(function*(){a.g.info("Remove items",b);const c=[],d=[];for(const e of a.h)b.includes(e.id)?d.push(e):c.push(e);a.h=c;yield Promise.all(d.map(e=>{e.disposers.forEach(f=>f());e.disposers=[];return bq(a,e.id)}))})};dq=function(a){return _.v(function*(){yield cq(a,a.h.map(b=>b.id))})};bq=function(a,b){return _.v(function*(){const c=a.j.get(b);c&&(a.g.info(`Stop preloading item (ID: ${b})`),c.player&&(yield eq(a,c.player)),a.j.delete(b))})};
|
|
249
|
+
gq=function(a){const b=Jp(a);b&&(b.transition=void 0,b.next=[],fq(a))};hq=function(a){return _.v(function*(){const b=a.h.filter(c=>!c.primary).map(c=>c.id);gq(a);yield cq(a,b)})};iq=function(a){_.v(function*(){const b=a.getCurrentItem(),c=b.next[0];b&&b.primary&&c&&(gq(a),yield a.play(c))})};fq=function(a){a.f&&(a.f.disposers.forEach(b=>b()),a.f.disposers=[],a.f.transition&&(a.f.transition.Vg=!1),Sp(a,a.f))};Kp=function(a,b){return a.h.find(c=>c.id===b)||null};
|
|
250
|
+
Lp=function(a,b,c){const d=b?b.Yb||null:null;a.B?(a.a.setMuted(!0),jq(a,!0)):(b.audio&&(c=b.audio),a.ha.onAudioDecision&&(c=a.ha.onAudioDecision(d)),c===Np?(a.a.setMuted(!1),jq(a,!0)):c===Mp?(a.a.setMuted(!0),jq(a,!1)):a.g.warn("Audio decision not supported",c))};
|
|
251
|
+
Op=function(a,b){return _.v(function*(){if(b.player){a.G();if(b.state===kf){a.g.info("Wait for seek to finish");try{yield b.preloadPromise}catch(c){}}a.ga=!1;b.Y&&(yield b.player.seek(b.Y,!0));a.f=b;b.role=kq;Ip(a,b.player,!0);b.state="loading";a.l?(Lp(a,b,Np),b.player.isPaused()&&(yield b.player.play())):a.a.isPaused()&&(yield b.player.play());b.state=_.bf}})};
|
|
252
|
+
Pp=function(a,b){return _.v(function*(){const c=b.player;if(c){if(b.state===kf){a.g.info(Eb);try{yield b.preloadPromise}catch(d){}}a.f=b;b.role=kq;Ip(a,c,!0);b.state===jf?yield c.play():b.state===hf&&(yield lq(a,c,b.config,b.Td));b.state=_.bf}})};Qp=function(a,b){return _.v(function*(){yield Rp(a,b);yield b.player.play();b.state=_.bf})};
|
|
253
|
+
Rp=function(a,b){return _.v(function*(){const c=yield mq(a,!!b.primary);a.f=b;b.role=kq;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();Ip(a,c,!0);b.state="loading";b.jd=lq(a,c,b.config,b.Td);yield b.jd;b.state="loaded"})};
|
|
254
|
+
Tp=function(a,b,c){const d=b.player,e=()=>{const l=d.getPosition(),m=c.getDuration();c.setPosition(l);a.a.trigger(new _.H(_.ec,{ad:c}));!c.j&&l>=m/4&&(c.j=!0,a.a.trigger(new _.H(_.Xb,{ad:c})));!c.l&&l>=m/2&&(c.l=!0,a.a.trigger(new _.H(_.cc,{ad:c})));!c.o&&l>=3*m/4&&(c.o=!0,a.a.trigger(new _.H(_.mc,{ad:c})))},f=()=>{d.isEnded()||a.a.trigger(new _.H(_.dc,{ad:c}))},g=()=>{a.a.trigger(new _.H(_.fc,{ad:c}))},h=()=>{a.a.trigger(new _.H(_.Ub,{ad:c}))},k=()=>{a.a.trigger(new _.H(_.lc,{ad:c}));a.a.trigger(new _.H(_.Wb,
|
|
255
|
+
{ad:c}));c.f===c.a&&a.a.trigger(new _.H(_.Tb,{id:b.Yb}))};d.on(_.$f,e);d.on(_.Me,f);d.on(_.bf,g);d.on(_.Oc,h);d.one(_.Rd,k);b.disposers.push(()=>{d.off(_.$f,e);d.off(_.Me,f);d.off(_.bf,g);d.off(_.Oc,h);d.off(_.Rd,k)});1===c.f&&a.a.trigger(new _.H(_.Sb,{id:b.Yb}));c.videoEl=d.getSurface().getMedia();a.a.trigger(new _.H(_.ac,{ad:c}));a.a.trigger(new _.H(_.kc,{ad:c}))};
|
|
256
|
+
Up=function(a,b){return _.v(function*(){const c=b.player;b.primary?(a.g.info("Pause primary playback"),a.l||Ip(a,c,!1)):(a.g.info(`Stop previous playback (ID: ${b.id})`),b.disposers.forEach(d=>d()),b.disposers=[],b.player=null,b.videoEl=null,b.role=nq,b.tf?(a.g.info(`Release player (ID: ${b.id}) `+`after delay ${b.tf} ms.`),yield new Promise(d=>{setTimeout(()=>_.v(function*(){yield eq(a,c);Ip(a,c,!1);a.a.trigger(new _.H("ad-hls-released"));d()}),b.tf)})):(yield eq(a,c),Ip(a,c,!1)))})};
|
|
257
|
+
Vp=function(a){Promise.all(Array.from(a.j.keys()).map(b=>bq(a,b)))};Wp=function(a,b){_.v(function*(){if(0!==b.length){a.g.info(`Preload items (IDs: ${b})`);var c=a.h.filter(d=>b.includes(d.id))||[];yield Promise.all(c.map(d=>oq(a,d)))}})};pq=function(a,b,c){c=void 0===c?!1:c;if(!a.ga&&!a.a.isLive()){var d=Jp(a);d?(d.Y=b,c&&(a.ga=!0)):a.g.error("Failed to get primary item. Cannot configure resume position.")}};qq=function(a){a.A.forEach(b=>a.C.removeChild(b));a.A=[];Ip(a,a.a,!0)};
|
|
258
|
+
Yp=function(a,b,c){const d=b.transition.ye;let e=null;d.Y&&pq(a,d.Y);const f=()=>{const k=b.player.getPosition();.5>=d.position-k&&(a.g.info("Start RAF polling"),h(),g())},g=()=>{var k=b.player.getPosition();k>=d.position?(c(),a.g.info(`Transition onPosition to (ID: ${d.itemId}), `+`playback position: ${k.toFixed(3)} s, `+`transition point: ${d.position.toFixed(3)} s. `),a.play(d.itemId),k=!0):k=!1;k?e=null:e=requestAnimationFrame(g)},h=()=>{a.g.info("Stop timeupdate polling");b.player.off(_.$f,f)};
|
|
259
|
+
a.g.info("Start timeupdate polling");b.player.on(_.$f,f);b.disposers.push(()=>{null!=e&&(a.g.info("Stop RAF polling"),cancelAnimationFrame(e),e=null)});b.disposers.push(h)};eq=function(a,b){return _.v(function*(){b!==a.a&&(yield a.o.release(b))})};rq=function(a){return _.v(function*(){a.f&&(yield Up(a,a.f),Ip(a,a.a,!0))})};mq=function(a,b){return _.v(function*(){if(b)return a.a;const c=yield a.o.get();if(!c)throw Error("No player available");return c})};
|
|
260
|
+
lq=function(a,b,c,d){return _.v(function*(){yield b.release();yield b.load(c);d&&d(b.getDuration());if(a.f&&a.f.player){const e=a.f.player.getVolume();b.setVolume(null==e?1:e);b.setMuted(a.f.player.isMuted()||!1)}})};
|
|
261
|
+
oq=function(a,b){return _.v(function*(){if(b.primary){b.state=kf;a.j.set(b.id,b);if(b.Y&&!a.l){var c=b.player;a.g.info("Preparing to resume at",b.Y);Lp(a,b,Mp);yield c.seek(b.Y,!0)}b.state=jf}else{c=b.id;var d=yield mq(a,!1);b.player=d;b.videoEl=d.getSurface().getMedia();b.role=nq;b.state=kf;try{a.j.set(c,b);b.config.autoplay&&(a.g.warn(ma+`Force disabling autoplay (ID: ${c})`),b.config.autoplay=!1);const e=a.a.getBandwidthEstimate();e&&(b.config.abr||(b.config.abr={}),b.config.abr.defaultBandwidthEstimate=
|
|
262
|
+
e);b.preloadPromise=lq(a,d,b.config,b.Td);yield b.preloadPromise;b.state=jf}catch(e){7001===e.code?(a.g.info(`Preload aborted (ID: ${c})`),b.state=gf):(a.g.warn(`Preload failed (ID: ${c})`,e),b.state=hf)}}})};jq=function(a,b){a.h.filter(c=>!c.primary&&c.player).forEach(c=>c.player.setMuted(b))};sq=function(a){return a.a.find(b=>1===b.state)||null};tq=function(a,b){const c=a.f.getPosition();b>=c||a.a.filter(d=>d.od===_.Pj&&!d.once&&d.Dg&&d.startTime>b).forEach(d=>{d.Lf=!0})};
|
|
263
|
+
uq=function(a){return a.a.find(b=>4===b.state)||null};vq=function(a,b){return a.a.find(c=>Kj(c)&&!c.ji&&c.od===_.Pj&&b>c.startTime&&b<c.endTime)||null};wq=function(a,b){const c=a.f.getPosition();return a.a.filter(d=>d.od===_.Pj&&!d.ag).sort((d,e)=>e.startTime-d.startTime).find(d=>d.startTime>c&&d.startTime<b)||null};zq=function(a,b,c){_.v(function*(){a.ga=!0;try{const d=uq(a);d&&(yield xq(a,d));a.g.info("Seek into interstitial",b.ea);yield yq(a,b)}catch(d){yield a.f.seek(c)}finally{a.ga=!1}})};
|
|
264
|
+
Aq=function(a,b,c){_.v(function*(){a.ga=!0;try{const d=uq(a);d&&(yield xq(a,d));a.g.info("Play jumped interstitial",b.ea,"resume at",c.toFixed(2));yield yq(a,b,c)}catch(d){a.g.warn("Failed to play jumped interstitial",b.ea,d),b.Jh=new Date,yield a.f.seek(c)}finally{a.ga=!1}})};xq=function(a,b){return _.v(function*(){a.g.info("Unschedule interstitial",b.ea);yield hq(a.X);b.state=0})};
|
|
265
|
+
Iq=function(a,b){const c=()=>_.v(function*(){if(!a.ga&&!a.Me){var g=b.getPosition(),h=Bq(a,g);h&&(yield Cq(a,h))&&Dq(a,h,b);if((h=Eq(a))&&0===h.state&&b.getDuration()-g<a.ha.resolutionOffsetSec&&(yield Cq(a,h)))if(h.pa&&0!==h.pa.length){if(g=a.X.getCurrentItem()){var k=Fq(a,h,_.Mj);if(0!==k.length){var l=k[0].id;g.next=[l];g.transition={Ea:l};a.g.info(`Schedule postroll interstitial ${h.ea}`);Gq(a,h,k)}}}else a.g.warn("Postroll interstitial has no assets, ignoring.")}});b.on(_.$f,c);a.h.push(()=>
|
|
266
|
+
{b.off(_.$f,c)});const d=()=>{Hq(a,!1,!0,!0)};b.on(_.Zf,d);a.h.push(()=>{b.off(_.Zf,d)});const e=()=>{a.Me=!0};b.on(_.Sb,e);a.h.push(()=>{b.off(_.Sb,e)});const f=()=>{a.Me=!1};b.on(_.Tb,f);a.h.push(()=>{b.off(_.Tb,f)})};Jq=function(a){a.h.forEach(b=>b());a.h=[]};Kq=function(a){return(a=a.X.getCurrentItem())&&!a.primary?a.player:null};
|
|
267
|
+
Hq=function(a,b,c,d){var e=Lq(a);a.g.info("Interstitial cues changed",e);var f=e;if(d){f=rj(a.a.map(p=>p.ea),e.map(p=>p.id));Mq(a,f.Ni);const n=new Set(f.th);f=e.filter(p=>n.has(p.id))}if(!Nq(a,f))return!1;const g=[],h=[],k=[];f.forEach(n=>{const p=n.customAttributes.CUE||[];p.includes(_.bb)?h.push(n):!d&&p.includes("PRE")?g.push(n):!c&&n.startTime<a.ha.Ji?g.push(n):k.push(n)});e=Rj(g,0);f=Rj(h,_.Mj);const l=Rj(k,_.Pj),m=e.concat(f,l);Oq(a,m);0<e.length&&Pq(a,e[0],b);l.forEach(n=>Qq(a,n,_.Pj));0<
|
|
268
|
+
f.length&&Qq(a,f[0],_.Mj);Rq(a,m);return 0<e.length};Sq=function(a){_.v(function*(){var b=a.X;aq(b,[{id:mf,primary:!0,config:b.a.getConfiguration(),next:[],vb:0,duration:0,Yb:null}]);var c=Jp(b);if(!c)throw Error("Failed to find primary item");b.f=c;c.role=kq;c.player=b.a;c.videoEl=c.player.getSurface().getMedia();Ip(b,c.player,!0);b=a.f;c=b.getConfiguration();a.j=Hq(a,!c.autoplay,b.isLive(),!1);if(a.j){if(b=a.X,c=b.o,c=c.a[0]?c.a[0].player:null)b.l||Ip(b,b.a,!1),Ip(b,c,!0)}else c.autoplay&&(yield $p(a.X))})};
|
|
269
|
+
yq=function(a,b,c){return _.v(function*(){if(!(yield Cq(a,b)))throw Error("Failed to bind");yield Tq(a,b,_.Pj,!1,c)})};Lq=function(a){return a.f.getTimelineCues().filter(b=>_.Hj(b.schemeIdUri)&&b.customAttributes)};Mq=function(a,b){const c=new Set(b);a.a.forEach(d=>{c.has(d.ea)&&!Kj(d)&&a.g.warn("Removing an interstitial in active state",d)});a.a=a.a.filter(d=>!c.has(d.ea))};
|
|
270
|
+
Nq=function(a,b){const c=[];b.forEach(d=>{_.Ij(d.customAttributes)||c.push(`Interstitial cue ${d.id} is invalid `+"it must contain exactly one of X-ASSET-LIST or X-ASSET-URI.")});0<c.length&&a.g.error("Invalid interstitials, all interstitials will "+`be skipped. ${c.join(" ")}`);return 0===c.length};
|
|
271
|
+
Oq=function(a,b){var c=b.sort((f,g)=>f.startTime-g.startTime);b=a.ha.resolutionOffsetSec;let d=Infinity;const e=[];for(let f=0;f<c.length-1;f++){const g=c[f],h=c[f+1];h&&(d=Math.min(d,h.startTime-g.endTime));h&&h.startTime<=g.endTime&&e.push(`Interstitials ${g.id} and ${h.id} `+"overlap.")}d<b&&(c=d/2,a.ha.resolutionOffsetSec=c,a.g.info("Interstitials are closer than configured "+`resolutionOffsetSec (${b} s) auto-reconfiguring to `+`${c} s.`));0<e.length&&a.g.warn("Unsupported format of interstitials, playback may not "+
|
|
272
|
+
`behave correctly. ${e.join(" ")}`)};Pq=function(a,b,c){_.v(function*(){var d=Qq(a,b,0);const e=yield Cq(a,d),f=d.pa?d.pa.length:0;if(e&&0<f)try{a.g.info(`Player preroll interstitial ${d.ea}`),yield Tq(a,d,0,c)}catch(g){a.g.error("Preroll interstitial failed.",g),(d=Jp(a.X))&&(yield a.X.play(d.id))}else e?a.g.warn("Preroll interstitial has no assets, skipping"):a.g.error("Preroll interstitial failed, skipping"),yield rq(a.X),c||(yield $p(a.X))})};
|
|
273
|
+
Qq=function(a,b,c){{const e=b.customAttributes[_.Mb],f=b.customAttributes[_.Lb],g=b.customAttributes[Nb],h=b.customAttributes[_.Qb],k=b.customAttributes[_.Ob],l=b.customAttributes[_.Pb]||[];b.customAttributes[Rb]||(b.customAttributes[Rb]=null==h||0<h?"RANGE":"POINT");var d=b.customAttributes["X-YOSPACE-AUDIO-PRIORITY"];d="CONTENT"===d?Np:"AD"===d?Mp:void 0;b={ea:b.id,startTime:b.startTime,endTime:b.endTime,state:0,Qf:f,Rf:e,Hd:g,pa:null,Y:null==h?null:Math.max(0,b.startTime+h),Pi:h,oc:k,od:c,ji:"POINT"===
|
|
274
|
+
b.customAttributes[Rb],Bh:!l.includes("SKIP"),ag:!l.includes("JUMP"),Xg:Lj(b),Dg:null!=h&&0>h,once:(b.customAttributes.CUE||[]).includes("ONCE"),Wg:!1,Lf:!0,customAttributes:b.customAttributes,audio:d}}a.a.push(b);return b};
|
|
275
|
+
Rq=function(a,b){_.v(function*(){const c=a.X.getCurrentItem();if(c)if(c.primary)a.a.forEach(g=>{const h=b.find(k=>k.id===g.ea);if(h){const k=h.customAttributes[_.Ob];null==g.oc&&null!=k&&(a.g.info(Ab,h.id,"Playout limit",k),g.oc=k,g.od===_.Pj&&4===g.state&&Uq(a,g))}});else{var d=b.find(g=>g.id===c.Yb);if(d){var e=d.customAttributes[_.Ob];if(null!=e){var f=a.a.find(g=>g.ea===d.id);f&&null==f.oc&&(a.g.info(Ab,d.id,"Playout limit",e),f.oc=e,yield Zp(a.X,e))}}}})};
|
|
276
|
+
Uq=function(a,b){_.v(function*(){yield xq(a,b);yield Dq(a,b,a.f)})};Cq=function(a,b){return _.v(function*(){b.state=1;if(b.Hd)yield Vq(a,b,b.Hd);else if(b.Qf)yield Wq(a,b,b.Qf);else if(b.Rf){b.pa=[{URI:b.Rf,DURATION:b.endTime-b.startTime}];var c={URI:b.pa[0].URI,DURATION:b.pa[0].DURATION};b.Xg&&(c[Kb]=b.Xg);c={ASSETS:[c]};Xq(a,new _.H($b,{id:b.ea,detail:c}));b.state=2}else b.state=3;return 2===b.state})};
|
|
277
|
+
Tq=function(a,b,c,d,e){return _.v(function*(){if(0!==b.pa.length&&a.X.getCurrentItem()){var f=Fq(a,b,c);0!==f.length&&(Gq(a,b,f),0===c&&a.f.isLive()||(null!=e?pq(a.X,e,!0):null!=b.Y&&pq(a.X,b.Y)),d?yield a.X.load(f[0].id):yield a.X.play(f[0].id))}})};
|
|
278
|
+
Dq=function(a,b,c){if(b.pa)if(0===b.pa.length){const g=()=>{c.isLive()?a.g.info("Skipping empty "+`live interstitial ${b.ea}`):null!=b.Y&&0!==b.Pi?c.seek(b.Y):a.g.info(`Empty VOD interstitial ${b.ea}, `+"continuing to next segment")};c.one(_.Xf,g);a.h.push(()=>{c.off(_.Xf,g)});a.g.info(`Schedule interstitial ${b.ea} to `+"be skipped")}else{var d=a.X.getCurrentItem();if(d){var e=Fq(a,b,_.Pj);if(0!==e.length){var f=e[0].id;null!=b.Y&&pq(a.X,b.Y);d.next=[f];d.transition={ye:{position:b.startTime,itemId:f,
|
|
279
|
+
Y:b.Y}};a.g.info(`Schedule interstitial ${b.ea} for `+`${b.startTime} s`);Gq(a,b,e)}}}};Bq=function(a,b){return a.a.find(c=>{const d=c.startTime-b;return c.od===_.Pj&&Kj(c)&&0<d&&d<=a.ha.resolutionOffsetSec})||null};Eq=function(a){return a.a.find(b=>b.od===_.Mj)||null};
|
|
280
|
+
Vq=function(a,b,c){return _.v(function*(){try{const d=[],e=c.entries,f=e.map(h=>_.v(function*(){if("list"===h.type)return(yield Yq(a,h.uc.URI)).ASSETS.map(k=>({id:h.id,customAttributes:h.customAttributes,uc:k}));if("uri"===h.type)return[{id:h.id,customAttributes:h.customAttributes,uc:h.uc}];throw new _.vj("Invalid group asset entry type");}));(yield Promise.all(f)).forEach(h=>d.push(...h));b.Hd={entries:e,pa:d};const g={ASSETS:d.map(h=>h.uc)};Zq(a,b,g)}catch(d){a.g.error(`Failed to bind grouped asset list for ${b.ea}`,
|
|
281
|
+
d),b.state=3}})};Wq=function(a,b,c){return _.v(function*(){try{a.g.info(`Load X-ASSET-LIST for ${b.ea}`);Xq(a,new _.H(Yb));const d=yield Yq(a,c);Zq(a,b,d)}catch(d){a.g.error("Failed to load X-ASSET-LIST",d),b.state=3}})};
|
|
282
|
+
Yq=function(a,b){return _.v(function*(){var c=a.X.qe();if(!c)throw Error("No player found");c=c.getNetworkEngine();const d=_.ck($q(a,b));c=yield Zk(c,d);if(null===c)return a.g.warn(`X-ASSET-LIST ${b} returned no content`),{ASSETS:[]};if(!Jj(c))throw new _.vj("Invalid X-ASSET-LIST list response");return c})};
|
|
283
|
+
Zq=function(a,b,c){b.pa=c.ASSETS;b.pa&&0!==b.pa.length||a.g.info(`Interstitial ${b.ea} has no assets, `+"will be smoothly skipped");if(null==b.Y){const d=Vj(b.pa.map(e=>e.DURATION));b.Y=b.startTime+(null==b.oc?d:Math.min(b.oc,d))}b.state=2;Xq(a,new _.H(Zb));Xq(a,new _.H($b,{id:b.ea,detail:c}))};Xq=function(a,b){a.f.trigger(b)};$q=function(a,b){return(a=a.ha.Ii)?(b=new URL(b),b.searchParams.set("_HLS_primary_id",a),b.toString()):b};
|
|
284
|
+
Fq=function(a,b,c){let d=0;const e=!!b.Hd;let f=b.pa.map((l,m)=>{let n=b.ea;e&&(n=b.Hd.pa[m].id);d+=l.DURATION;return{id:`${n}-${m}`,config:{source:{url:$q(a,l.URI),type:_.fm}},duration:l.DURATION,vb:d,Yb:n,next:[],Ma:new Q(c,m+1,b.pa.length,l.DURATION,n,b.Bh,b.customAttributes||null),audio:b.audio}});Nj(f,c);f.forEach(l=>{l.Ae=()=>{var m=l.Ma;a.g.info(`Playing ad ${`${m.f}/${m.a}`} of interstitial `+l.Yb)};l.Td=()=>{Xq(a,new _.H(_.bc,{ad:l.Ma}))}});if(null!=b.oc&&(f=ar(a,b,f),0===f.length))return[];
|
|
285
|
+
const g=f[0].Ae;f[0].Ae=()=>{b.state=5;b.Wg=!0;b.Dg&&(b.Lf=!1);a.g.info(`Playing interstitial ${b.ea} with `+`${b.pa.length} assets and will resume primary `+`content ${b.Y?`at ${b.Y.toFixed(1)} s`:"after interstitial ended"}.`);g()};const h=f[0].Td;f[0].Td=l=>{null==b.Y&&(b.Y=b.startTime+l,pq(a.X,b.Y),a.g.info("Primary content will resume at",b.Y.toFixed(1),"s"));h(l)};const k=f[f.length-1];k.Ea=()=>{b.state=6;cq(a.X,f.map(l=>l.id));c===_.Mj&&rq(a.X)};k.tf=a.ha.adReleaseDelayMs;return f};
|
|
286
|
+
Gq=function(a,b,c){aq(a.X,c);a=a.X;fq(a);a.f&&(a.f.Ma&&Tp(a,a.f,a.f.Ma),Vp(a),Wp(a,a.f.next));b.state=4};
|
|
287
|
+
ar=function(a,b,c){const d=b.oc;a.g.info(`Playout limit for ${b.ea} is `+`${d} s`);b=c[c.length-1].vb;if(d>=b)return a.g.info(`Playout limit (${d}) is`+`larger or equal to total duration: (${b}).`),c;if(0>=d)return a.g.info("Discarding all ads."),[];const e=c.filter(f=>f.vb-f.duration<=d);e.forEach(f=>{f.Ma.a=e.length});a=e[e.length-1];c=d-(a.vb-a.duration);.1>Math.abs(c-a.duration)?a.transition.Ea=mf:a.transition.ye={position:c,itemId:mf,Y:null};a.maxDuration=c;return e};
|
|
288
|
+
br=function(){try{const a=URL.createObjectURL(new Blob);URL.revokeObjectURL(a);return a.slice(a.lastIndexOf("/")+1)}catch(a){let b=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const d=(b+16*Math.random())%16|0;b=Math.floor(b/16);return("x"===c?d:d&3|8).toString(16)})}};
|
|
289
|
+
er=function(a){a.f.on(window,"offline",()=>{cr(a,!1)});a.f.on(window,"online",()=>{a.a||dr(a)});a.f.on(a.m,If,()=>{a.a&&dr(a)});a.f.on(a.m,"suspend",()=>{a.a&&dr(a)});a.f.on(a.m,_.zg,()=>{a.a&&dr(a)});a.f.on(a.m,_.bf,()=>{a.a||dr(a)});a.f.on(a.m,_.nf,()=>{a.a||dr(a)});a.f.on(a.m,_.af,b=>{b.detail&&a.a&&dr(a)})};fr=function(a){a.h&&(a.h.stop(),a.h=null)};
|
|
290
|
+
gr=function(a){return _.v(function*(){var b=a.m.getConfiguration().connectivityCheck;b&&a.m&&(b=yield el(a.j,b.url,b.attemptParameters,b.method),cr(a,b))})};dr=function(a){a.m.getConfiguration().connectivityCheck&&(fr(a),a.h=(new _.Jh(()=>gr(a))).la(5))};cr=function(a,b){fr(a);a.a!==b&&(a.a=b,a.m&&a.m.getConfiguration().connectivityCheck&&a.m.trigger(new _.H(Ie,{online:a.a})))};ir=function(){hr.forEach(a=>a())};_.jr=function(a){hr.push(a)};kr=function(a,b){a.onError(b);a.release().then(()=>a.destroy())};
|
|
291
|
+
mr=function(a){var b=lr;const c={kty:"RSA",n:b.n,e:b.e},d=a.h+"."+a.f,e=a.j;return new Promise(function(f,g){let h;try{h=window&&window.crypto&&window.crypto.subtle}catch(l){}if(h){var k={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};h.importKey("jwk",c,k,!1,["verify"]).then(function(l){const m=_.zi(d),n=_.Lk(e);return h.verify(k,l,n.buffer,m.buffer)}).then(function(l){l?f():g(new _.vj("Signature Verification failed",dg))}).catch(g)}else f()})};
|
|
292
|
+
or=function(a){if(!a.a){var b=a.f.split(".");if(3!==b.length)throw Error("Expected to find 3 data sections in JWT raw data");b=new nr(b[0],b[1],b[2]);a.a=b}return a.a};pr=function(a){return _.v(function*(){var b=or(a);try{yield mr(b)}catch(c){if(c&&c.code===dg)throw c;b=new _.Dj(window.location.href);if(!/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^localhost)/.test(b.a.hostname))throw c;}})};
|
|
293
|
+
qr=function(a){switch((a.ia[0]||{src:"",type:""}).type){case _.tc:a="dash";break;case _.Bc:a="ss";break;case _.fm:a="hls";break;case _.qg:a="mp4";break;default:a=""}return a};rr=function(a){return a.viewerId?a.viewerId:(a=a.drm||null)&&a.customData&&a.customData.userId?`${a.customData.userId}`:""};sr=function(a){return(a=a.drm||null)&&a.customData&&a.customData.assetId?`${a.customData.assetId}`:""};
|
|
294
|
+
tr=function(a){return(a=a.drm||null)&&a.customData&&a.customData.sessionId?`${a.customData.sessionId}`:""};ur=function(a){return(a=(a=a.drmInfo)&&a.licenseServerUri||"")?(new _.Dj(a)).a.hostname:""};vr=function(a){const b=a.configuration;let c="no";b.drm&&!_.fh(b.drm,{})&&(c="custom",b.drm.env&&b.drm.env.toLowerCase().startsWith(Ld)||ur(a).endsWith("drmtoday.com"))&&(c=Ld);return c};
|
|
295
|
+
wr=function(a){a=a.drmInfo;let b="";if(a)switch(a.keySystem){case _.td:b="wv";break;case _.rd:b="pr";break;case _.pd:b="fps"}return b};xr=function(a){a=a.drmInfo;let b=!1;a&&(b=a.persistentStateRequired);return b.toString()};yr=function(a){a=a.drmInfo;let b="";if(a)switch(a.videoRobustness){case Ha:case Fa:b="L1";break;case Ga:b="L2";break;case _.nb:case _.mb:b="L3"}return b};
|
|
296
|
+
Dr=function(a,b){const c=b.configuration;var d=[...Array.from(_.rm.keys()),...b.Ng];d={"CL-KEY":a.f,"CL-LOCATION":window.location.href,"CL-SDK-VERSION":_.ea,"CL-USER-ID":rr(c),"CL-ASSET-ID":sr(c),"CL-SESSION-ID":tr(c),"CL-PLAYBACK-TYPE":b.isLive?zr:Ar,"CL-CONTENT-TYPE":qr(b),"CL-PLUGINS":d.join(" "),"CL-DRM":vr(b),"CL-DRM-CDM":wr(b),"CL-DRM-SEC-LEVEL":yr(b),"CL-DRM-OFFLINE":xr(b),"CL-DRM-IP":ur(b)};Br&&Br.companionSdk&&(Br.companionSdk.name&&(d["CL-COMPANION-SDK"]=Br.companionSdk.name),Br.companionSdk.version&&
|
|
297
|
+
(d["CL-COMPANION-SDK-VERSION"]=Br.companionSdk.version));b=_.ck(["https://downloads.castlabs.com/r/register/"]);b.method="GET";b.headers=d;d=new _.Cr;Wk(d,{forceXhr:c.forceXhr});return d.fetch(b).V.catch(e=>{a:{var f=or(a);e=e.data;var g=e.status;if(f.a&&f.a.ilv)f=Promise.resolve();else{switch(g){case 403:case 404:f=7101;var h="Castlabs Player license is invalid";if(403===g){g=h;h="";try{h=JSON.parse(decodeURIComponent(e.responseText)).message}catch(k){}e=h;e=g+(": "+e)}else e=h+"!";h=e;break;case 412:f=
|
|
298
|
+
7103;h="License requires a viewer ID. It should be supplied either via the `viewerId` config or in case of DRMtoday via the `drm.customData.userID` config.";break;default:f=Promise.resolve();break a}a.g.error(La+h);f=Promise.reject(new _.J(_.C,7,f,h))}}return f})};
|
|
299
|
+
Hr=function(a){try{const b=a.split(",").map(c=>{const d={};c=c.split(";");for(let e=0;e<c.length;e++){const {key:f,value:g}=Er(c[e]);Object.keys(Fr).includes(f)&&(d[Fr[f]]=g)}return d}).filter(c=>_.$g(c));return 0<b.length?b:null}catch(b){return Gr.error("CmsdManager parseCmsdDynamicHeader_ failed:",b),null}};
|
|
300
|
+
Er=function(a){var b=a.split("\x3d");const c=b[0];b=b[1];if(!c)throw new _.vj("Parsing CMSD, missing parameter or wrong format");if(c&&!b)return{key:c,value:!0};const d=b[0];if('"'===d&&'"'===b[b.length-1])return{key:c,value:b.replaceAll(/(^")|("$)/g,"")};if(/^[-0-9]/.test(d))return{key:c,value:parseInt(b,10)};if(/^[a-zA-Z*]/.test(d))return{key:c,value:b};throw new _.vj(`Parsing CMSD, not recognized value type of ${a}`);};
|
|
301
|
+
Jr=function(a){return b=>{{var c=b.headers;let e=b=null;var d=jh(c,"cmsd-dynamic");c=jh(c,"cmsd-static");d&&(b=Hr(d),a.a=b);if(c)try{d={};const f=c.split(",");for(c=0;c<f.length;c++){const {key:g,value:h}=Er(f[c]);Object.keys(Ir).includes(g)&&(d[Ir[g]]=h)}e=_.$g(d)?d:null}catch(f){Gr.error("CmsdManager parseCmsdStaticHeader_ failed:",f),e=null}(b||e)&&a.m.trigger(new _.H("cmsd-event",{Cj:b,Oj:e}))}}};_.Lr=function(a){a&&(0<=Kr.indexOf(a)||Kr.push(a))};
|
|
302
|
+
Or=function(a){if(!a.h&&a.B&&a.a&&a.f.ads.hls.enable&&a.getTimelineCues().some(b=>_.Hj(b.schemeIdUri))){const b=new Mr;b.A(a.a,a.B,a.f.mse.sendPlaybackSessionIdHeader?a.G:null);Nr(a,b,a.f)}};Qr=function(a,b){a.J=new Pr(b);pr(a.J).catch(c=>{setTimeout(()=>{a.g.error(La+c);a.trigger(new _.H(_.Sd,{detail:new _.J(_.C,7,7101)}));a.destroy()},1E3)})};
|
|
303
|
+
_.Rr=function(a,b,c){c=void 0===c?null:c;null!=b&&b===a.a?a.a.forwardEventsTo(a):(a.a&&(a.a.stopForwardingEventsTo(a),a.a.destroy(),a.a=null,a.B=null),b&&(b.init(a.j,a.F),b.setNetworkEngine(a.getNetworkEngine()),b.forwardEventsTo(a),a.a=b,a.B=c))};
|
|
304
|
+
Sr=function(a,b){_.v(function*(){a.j.getMedia()||a.j.getCastElement();a.J||(a.J=new Pr(a.f.license));try{a.g.debug("Verifying license remotely"),yield Dr(a.J,b),a.g.debug("License verified remotely")}catch(c){a.g.debug("License rejected by remote",c),setTimeout(kr,1E3,{release:a.release.bind(a),destroy:a.destroy.bind(a),onError:a.onError.bind(a)},c)}})};_.Tr=function(a,b,...c){const d=a.W.map(e=>e[b].call(e,a,...c)).filter(e=>e instanceof Promise);return Promise.all(d)};
|
|
305
|
+
Ur=function(a){return _.v(function*(){if(a.H)a.g.debug("The player is already released. No-op");else if(a.Z.off(document,_.ug),a.trigger(new _.H(_.sf)),a.j&&a.j.release(),a.h&&(yield a.h.o(),a.h=null),a.C&&(yield a.C.release(),a.C=null),a.a){var b=null,c=a.a.on(_.af,d=>{b=d});try{yield _.Tr(a,_.Ge),a.a.stopForwardingEventsTo(a),yield Promise.all([a.a.release(),a.A.release()]),a.g.debug("Releasing player completed"),b&&(a.g.debug("Re-post player state change event after release"),a.trigger(b)),a.trigger(new _.H(rf)),
|
|
306
|
+
a.H=!0}finally{a.a.off(_.af,c)}}else a.trigger(new _.H(rf)),a.H=!0})};Vr=function(a){a.G&&(a.g.info("Playback session ended, ID:",a.G),a.G=null,a.a&&a.a.setPlaybackSessionId(null))};Wr=function(a,b){const c=wh(d=>d.f(_.ab)&&a.every(e=>2===d.canPlay(e,b)));if(!c)throw new _.J(_.C,7,7003,"No compatible player implementing playlist mode found!");return{nb:c,player:c.create(),sourceIndex:0}};
|
|
307
|
+
Yr=function(a,b,c){if(a.P===_.ab)b=Wr(b,c);else if(2!==(a.a?a.a.canPlay(b[0],c):0)||a.S){a.S=!1;if(b){var d=a=null;for(var e=0;e<b.length;e++);e=Object.values(_.th);for(let f=0;f<b.length;f++)for(let g=0;g<e.length;g++){const h={nb:e[g],confidence:e[g].canPlay(b[f],c)};if(null===a||a.confidence<h.confidence)a=h,d=f}a&&typeof d===_.r&&0<a.confidence?(_.uh.debug("Player Factory '"+a.nb.a()+"' can play",b[d]),b=new Xr(a.nb,d)):(_.uh.debug("No compatible Player Factory found for sources:",b),b=null)}else b=
|
|
308
|
+
null;if(!b)throw new _.J(_.C,7,7003,"No player factory compatible with given sources found!");c=b.nb;a=c.create();b={nb:c,player:a,sourceIndex:b.sourceIndex}}else b={nb:a.B,player:a.a,sourceIndex:0};return b};
|
|
309
|
+
_.cs=function(a,b,c){return _.v(function*(){if(a.R)throw new _.J(_.C,7,7E3,"Player is already destroyed.");if(!a.j)throw new _.J(_.C,7,7E3,"No surface associated with this player!");_.Rn(We);yield a.release();var d=c||_.gp(b);if(!b||0===d.length)throw new _.J(_.C,7,7003,Va);a.ca=d;a.f=_.nm([a.F,b,{source:d}]);Wk(a.A,a.f);a.H=!1;d=Yr(a,d,a.f);_.Rr(a,d.player,d.nb);Zr(a,a.a);a.a&&a.a.setSourceIndex(d.sourceIndex);$r(a);a.a&&a.a.setCdnErrorCallback(a.M);_.as(a,a.f);bs(a);if(a.f.pauseWhenInBackground)a.Z.on(document,
|
|
310
|
+
_.ug,()=>{document.hidden?(a.g.debug("Player is hidden: pausing..."),a.pause()):(a.g.debug("Player is visible: resuming..."),a.play())});_.zm(a.f.drm);ym(a);yield _.Tr(a,"onContentWillLoad",a.f.source[d.sourceIndex]);_.Rn(Ve);_.Tn("player.beforeLoad",We,Ve)})};_.ds=function(a){return _.v(function*(){a.j.getMedia()||a.j.getCastElement();a.trigger(new _.H(me));yield Promise.all([a.a.load(a.f),a.h?a.h.load():Promise.resolve()])})};
|
|
311
|
+
_.fs=function(a){return _.v(function*(){_.Rn(Se);Sr(a,{configuration:a.getConfiguration(),ia:a.sg(),drmInfo:a.getDrmInfo(),Ng:Object.keys(a.L),isLive:a.isLive()});es(a);Am(a);yield _.Tr(a,_.De);a.f.autoplay&&(a.h?a.h.w():1)&&(yield a.play());_.Rn(Re);_.Tn("player.afterLoad",Se,Re)})};gs=function(a){return _.v(function*(){if(a.a){var b=a.a;b.ah?(a.trigger(new _.H(me)),yield b.ah(),yield _.fs(a)):a.g.warn(gb)}else a.g.warn(db)})};
|
|
312
|
+
Zr=function(a,b){try{var c=crypto.randomUUID()}catch(d){c=br()}a.g.info("Playback session started, ID:",c);b.setPlaybackSessionId(c);a.G=c};$r=function(a){a.a&&a.a.setDrmCustomDataModifier(b=>_.v(function*(){a.Ze&&a.Wc&&(yield a.Wc(b))}))};_.as=function(a,b){b=b||a.f;var c=vp(a,b);c&&(c=c.create(a),Nr(a,c,b))};bs=function(a){a.f.cmsd.enabled&&(a.C=new hs(a),a.a.setCmsdManager(a.C))};
|
|
313
|
+
is=function(a){const b=_.kj(a.f.preferredTextLanguage).filter(f=>f),c=a.f.preferForcedSubtitles,d=a.getTrackManager().sa().filter(f=>c?f.kind===_.Ud:f.kind!==_.Ud);if(0===d.length)c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles are available.");else{if(c&&0===b.length){var e=a.getTrackManager().ra();e&&e.language?(e=_.Tj(e.language||""),b.push(e)):(e=a.getTrackManager().Ha())&&e.language&&(e=_.Tj(e.language||""),b.push(e));0===b.length&&a.g.warn("Forced subtitles are configured to be preferred, but neither the preferred text language is set, nor the audio or video track language is available to determine which forced subtitles language to select.")}b.some(f=>
|
|
314
|
+
{const g=_.Tj(f);if(f=d.find(h=>{h=_.Tj(h.language||"");return _.Uj(h,g)}))return a.getTrackManager().$a(f),!0;c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles match the preferred languages: ",b);return!1})}};es=function(a){_.v(function*(){const b=[];if(a.f.remoteTextTracks)for(const c of a.f.remoteTextTracks)b.push(a.getTrackManager().addTextTrack(c));yield Promise.all(b);is(a)})};Nr=function(a,b,c){a.h=b;b.h(null==c.volume?1:c.volume);b.setMuted(c.muted||!1)};
|
|
315
|
+
js=function(a){a.K.forEach(b=>b());a.K=[]};ms=function(a,b){return _.v(function*(){try{_.Rn($e);a.P=_.ab;const c=b.slice(1).map(d=>({config:d,ia:_.gp(d)}));yield _.cs(a,b[0]);c.forEach(d=>{ks(a,d.config,d.ia)});a.trigger(new _.H(me));yield a.a.setupPlaylist(b);yield _.fs(a);c.forEach(d=>{ls(a,d.config,d.ia)});_.Rn(Ze);_.Tn("player.setupPlaylist",$e,Ze)}catch(c){if(a.l)throw a.g.info(Ma),new _.J(_.C,7,7E3);throw c;}})};
|
|
316
|
+
ns=function(a,b){const c=d=>{a.I=a.o.findIndex(e=>e.id===d.id)};a.addEventListener(_.yf,c);a.K.push(()=>{a.removeEventListener(_.yf,c)});if(b.endTime){const d=b.endTime,e=()=>{a.getPosition()>=d&&(a.removeEventListener(_.$f,e),a.g.info("Playlist end time reached. Stopping playback."),a.trigger(new _.H(_.xf)),a.pause())};a.addEventListener(_.$f,e);a.K.push(()=>{a.removeEventListener(_.$f,e)})}};
|
|
317
|
+
os=function(a,b){return _.v(function*(){try{_.Rn(Ue);const c=_.gp(b);ks(a,b,c);yield a.a.appendLoad(b);ls(a,b,c);_.Rn(Te);_.Tn("player.appendLoad",Ue,Te)}catch(c){if(a.l)throw a.g.info(Ma),new _.J(_.C,7,7E3,{id:b.id});throw c;}})};
|
|
318
|
+
ks=function(a,b,c){if(0===c.length)throw new _.J(_.C,7,7003,{message:Va,id:b.id});if(1<c.length)throw new _.J(_.C,7,7003,{message:"Multiple sources not supported!",id:b.id,source:c});if(2!==(a.a?a.a.canPlay(c[0],a.f):0))throw new _.J(_.C,7,7003,{message:"Source not supported by the current player!",id:b.id,source:c[0]});};ls=function(a,b,c){Sr(a,{configuration:b,ia:c,drmInfo:a.getDrmInfo(),Ng:Object.keys(a.L),isLive:c[0].isLive})};
|
|
319
|
+
ps=function(a,b){const c=document.getElementById(a);if(!c)throw Error("Anchor element not found");c.classList.add(dd);return Array.from({length:3}).map(()=>{const d=document.createElement(_.t);d.classList.add("clpp-mc-playlist-video-el");const e=document.createElement(_.Ad);e.classList.add("clpp-mc-playlist-item");e.appendChild(d);c.appendChild(e);return new _.R(d,b)})};
|
|
320
|
+
qs=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.info(`Show video element .${b}`),d.classList.add(ed)):(a.g.info(`Hide video element .${b}`),d.classList.remove(ed)),a.w&&a.w(d,c))};ts=function(a,b){return _.v(function*(){const c=yield a.o.get();a.f=b;b.role=rs;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();qs(a,c,!0);yield c.open(b.config);ss(a,b);b.config.autoplay||(yield c.play())})};
|
|
321
|
+
As=function(a){_.v(function*(){if(0===a.a)yield us(a);else if(a.a===a.h.length-1)yield vs(a);else{const b=[a.a-1,a.a+1];a.g.info(`Preload items (indices: ${b})`);yield Promise.all(b.map(c=>zs(a,c)))}})};
|
|
322
|
+
Bs=function(a,b){return _.v(function*(){if(b.player){if(b.state===kf){a.g.info(Eb);try{yield b.preloadPromise}catch(c){}}a.f=b;b.role=rs;qs(a,b.player,!0);b.state===jf?(_.Rn(ff),a.ha.preloadMedia?yield b.player.play():yield gs(b.player),_.Rn(ef),_.Tn("playlist.next",ff,ef)):b.state===hf&&(yield b.player.open(b.config));ss(a,b);b.config.autoplay||(yield b.player.play())}})};
|
|
323
|
+
Es=function(a,b){return _.v(function*(){a.g.info(`Stop current playback (index: ${b.index})`);b.player.pause();qs(a,b.player,!1);yield Cs(a,b);b.player=null;b.videoEl=null;b.role=Ds})};Gs=function(a){return Promise.all(Array.from(a.l.keys()).map(b=>Fs(a,b)))};Hs=function(a){return _.v(function*(){yield a.o.destroy();const b=document.getElementById(a.ha.anchorId);b&&(b.classList.remove(dd),b.innerHTML="")})};
|
|
324
|
+
Fs=function(a,b){return _.v(function*(){const c=a.l.get(b);c&&(a.g.info(`Stop preloading item (index: ${b})`),c.player&&(yield Cs(a,c)),a.l.delete(b))})};Cs=function(a,b){return _.v(function*(){b.disposers.forEach(c=>c());b.disposers=[];b.player&&(yield a.o.release(b.player))})};ss=function(a,b){if(a.ha.autoplayNext){const c=()=>{a.g.info("Automatically transition to next item");a.Lg()};b.player.on(_.Rd,c);const d=b.player;b.disposers.push(()=>{d.off(_.Rd,c)})}};
|
|
325
|
+
zs=function(a,b){return _.v(function*(){const c=yield a.o.get(),d=a.h[b];d.player=c;d.videoEl=c.getSurface().getMedia();d.role=Ds;d.state=kf;a.trigger(new _.H(gg));try{a.l.set(b,d),a.ha.preloadMedia?(d.config.autoplay&&(a.g.warn(ma+`Force disabling autoplay (index: ${b})`),d.config.autoplay=!1),d.preloadPromise=c.open(d.config)):d.preloadPromise=c.preload(d.config),yield d.preloadPromise,d.state=jf,a.trigger(new _.H(gg))}catch(e){7001===e.code?(a.g.info(`Preload aborted (index: ${b})`),d.state=gf):
|
|
326
|
+
(a.g.warn(`Preload failed (index: ${b})`,e),a.trigger(new _.H(_.Sd,{detail:e})),d.state=hf),a.trigger(new _.H(gg))}})};us=function(a){return _.v(function*(){const b=a.a+1;a.g.info(`Preload following item (index: ${b})`);yield zs(a,b)})};vs=function(a){return _.v(function*(){const b=a.a-1;a.g.info(`Preload preceding item (index: ${b})`);yield zs(a,b)})};
|
|
327
|
+
_.Js=function(a){if(Is.has(a))return Is.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);Is.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),Is.set(a,b),b):!1};Ks=function(a,b){b=b.replace(/mp2t/i,"mp4");a===_.q&&(b=b.replace(_.t,_.q));if(a=/avc1\.(66|77|100)\.(\d+)/.exec(b)){let d="avc1.";var c=a[1];d="66"===c?d+"4200":"77"===c?d+"4d00":d+"6400";c=Number(a[2]);d+=(c>>4).toString(16);d+=(c&15).toString(16);b=b.replace(a[0],d)}return b};
|
|
328
|
+
_.Ls=function(a,b){return void 0===a?b:null===a?null:typeof a===_.Nf?_.pn(a):a};
|
|
329
|
+
_.lk=function(a,b){const c={};var d=b?b.widevineVideoRobustness:void 0;const e=b?b.widevineAudioRobustness:void 0,f=b?b.serverCertificate:void 0;let g=a.f[_.td];g&&(c[_.td]={licenseUrl:g.licenseUrl,videoRobustness:xj(d,g.videoRobustness),audioRobustness:xj(e,g.audioRobustness),modifiers:g.modifiers,distinctiveIdentifierRequired:wj(b?b.widevineDistinctiveIdentifierRequired:void 0,g.distinctiveIdentifierRequired,!1),persistentStateRequired:wj(b?b.widevinePersistentStateRequired:void 0,g.persistentStateRequired,
|
|
330
|
+
!1),serverCertificate:_.Ls(f,g.serverCertificate)});(g=a.f[_.pd])&&(c[_.pd]={licenseUrl:g.licenseUrl,certificateUrl:g.certificateUrl,modifiers:g.modifiers});d=b?b.playReadyVideoRobustness:void 0;b=b?b.playReadyAudioRobustness:void 0;(g=a.f[_.rd])&&(c[_.rd]={licenseUrl:g.licenseUrl,videoRobustness:d||g.videoRobustness,audioRobustness:b||g.audioRobustness,individualizationServer:g.individualizationServer,useLegacySystem:g.useLegacySystem,modifiers:g.modifiers});return c};
|
|
331
|
+
Ps=function(a,b){b=gn(b);switch(a){case _.td:return b+Ms;case _.rd:return b+Ns;case _.pd:return b+Os;default:throw new _.vj(`Cannot infer DRMtoday license URL for key system: ${a}`);}};
|
|
332
|
+
_.Qs=function(a,b,c){{b=Ym(b);b=new _.Zm(_.hn(b));const e=_.Bj(b.f);if(a&&a.drm&&a.drm.customData){var d=a.drm.customData;a=d.assetId;d=d.variantId;a&&_.Ei(`${a}`)&&(e.assetId=a,_.mn.debug("Using assetId from the configuration instead of the value from the HLS manifest."));d&&_.Ei(`${d}`)&&(e.variantId=d,_.mn.info("Using variantId from the configuration instead of the value from the HLS manifest."))}e.keyId?(a=["keyId"],_.mn.debug("KeyId found in FPS SKD. Removing other parameters")):a=["assetId",
|
|
333
|
+
"variantId"];b.f=_.Aj(e,!1,a);"/"!==b.path||b.j.includes(`${b.a}/`)||(b.path="");b=_.zj(b)}return(c&&c.customData?c.customData:{}).fpsContentId=b};_.Ss=function(a,b,c,d){d=void 0===d?!0:d;c=a.drm;c?c.customData&&(_.jn(b,a),a=a.drm,(void 0===d||d)&&a&&a.customData&&(c=a.customData.assetId))&&(d=b.uris[0],d+="?assetId\x3d"+encodeURIComponent(`${c}`),(a=a.customData.variantId)&&(d+="\x26variantId\x3d"+encodeURIComponent(`${a}`)),b.uris[0]=d):_.Rs.warn(Ta)};
|
|
334
|
+
Ts=function(a,b,c){_.Ss(a,b,c);a=a.drm;a=!(!a||!a.offlineId);c=new _.Dj(b.uris[0]);c.a.searchParams.set(_.Ne,a.toString());b.uris[0]=c.toString()};Us=function(a,b,c){_.Ss(a,b,c,!1);b.headers[_.ua]=_.Cc;a={spc:_.Jk(b.body)};b.body=_.Bi(_.Aj(a,!0))};_.Vs=function(a,b){200===b.status&&(a=_.vi(b.data).trim(),a.startsWith("\x3cckc\x3e")&&a.endsWith("\x3c/ckc\x3e")&&(a=a.slice(5,-6)),a=_.Lk(a).buffer,b.data=a)};
|
|
335
|
+
Ws=function(a,b){a=a.drm;if(!a)_.Rs.warn(Ta);else if(a.customData&&a.customData.merchant){const c=new _.Dj(b.uris[0]);let d=c.a.pathname;d.endsWith("/")||(d+="/");d+=a.customData.merchant;c.a.pathname=d;b.uris[0]=c.toString()}};
|
|
336
|
+
_.Xs=function(a,b){try{const d=_.E(b.data),e=JSON.parse(String.fromCharCode.apply(null,d));_.mn.debug("Widevine License response",e);const f=atob(e.license),g=new Uint8Array(f.length);for(a=0;a<f.length;++a)g[a]=f.charCodeAt(a);var c=g.buffer}catch(d){_.mn.debug("Unable to parse DRMtoday response JSON, assuming the response contained raw data"),c=null}c&&(b.data=c)};
|
|
337
|
+
bt=function(a){switch(a){case "DRMtoday":return Ys;case "DRMtoday_STAGING":return Zs;case "DRMtoday_DEMO":return $s;case "DRMtoday_TEST":return at;default:return null}};ct=function(a){const b=new Event(a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),a);a.target.dispatchEvent(b)};
|
|
338
|
+
dt=function(a){a=a.target;if(a.webkitPresentationMode===Pe){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement===a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)};et=function(){return this.webkitSupportsPresentationMode(Pe)?(this.webkitSetPresentationMode(Pe),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))};
|
|
339
|
+
ft=function(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))};gt=function(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}};ht=function(a,b,c){return new window.TextTrackCue(a,b,c)};
|
|
340
|
+
it=function(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)};_.jt=function(a){const b=[];for(const c of a)for(const d of c.variants)b.push(d);return b};_.lt=function(a,b){a=_.Gl(_.Hl(a),_.Il(a));_.kt[a]=b};_.mt=function(a){a=_.Gl(_.Hl(a),_.Il(a));return _.kt[a]||null};_.nt=function(a){a=_.Gl(_.Hl(a),_.Il(a));delete _.kt[a]};
|
|
341
|
+
_.st=function(a){if(!a.w)return null;const b=a.H;switch(a.w){case ot:return`-2px -2px 0 ${b}, -1px -1px 0 ${b}`;case pt:return`2px 2px 0 ${b}, 1px 1px 0 ${b}`;case qt:return`-1px 0 ${b}, 0 1px ${b}, 1px 0 ${b}, `+`0 -1px ${b}`;case rt:return`2px 2px 3px ${b}, 2px 2px 4px ${b}, `+`2px 2px 5px ${b}`;default:return _.Ae}};_.ut=function(a,b,c,d){return _.v(function*(){try{return new (yield tt(a,b,c,d))}catch(e){throw e.a(_.C),e;}})};
|
|
342
|
+
tt=function(a,b,c,d){return _.v(function*(){if(d){var e=_.vt[d.toLowerCase()];if(e)return e;_.A("Could not determine manifest type using MIME type ",d)}if(e=_.Ej(a)){const f=_.wt[e];if(f)return f;_.A("Could not determine manifest type for extension ",e)}else _.A("Could not find extension for ",a);if(!d&&(d=yield xt(a,b,c))){if(e=_.vt[d])return e;_.A("Could not determine manifest type using MIME type",d)}throw new _.J(_.C,4,4E3,{url:a});})};
|
|
343
|
+
xt=function(a,b,c){return _.v(function*(){var d=_.ck(a);Yj(d,c);d.type=1;d.method="HEAD";return(d=(yield b.fetch(d).V).headers["content-type"])?d.toLowerCase():""})};_.Ng=[];Rg="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;Sg=typeof Object.defineProperties==_.Wd?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
|
|
344
|
+
Tg("Promise",function(a){function b(g){this.f=0;this.l=void 0;this.a=[];var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.f=function(g){if(null==this.a){this.a=[];var h=this;this.h(function(){h.l()})}this.a.push(g)};var e=Rg.setTimeout;c.prototype.h=function(g){e(g,0)};c.prototype.l=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var k=
|
|
345
|
+
g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.a=null};c.prototype.j=function(g){this.h(function(){throw g;})};b.prototype.j=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.C),reject:g(this.h)}};b.prototype.C=function(g){if(g===this)this.h(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.F(g);else{a:switch(typeof g){case _.Be:var h=null!=g;break a;case _.Wd:h=!0;break a;default:h=!1}h?this.B(g):this.o(g)}};
|
|
346
|
+
b.prototype.B=function(g){var h=void 0;try{h=g.then}catch(k){this.h(k);return}typeof h==_.Wd?this.G(h,g):this.o(g)};b.prototype.h=function(g){this.w(2,g)};b.prototype.o=function(g){this.w(1,g)};b.prototype.w=function(g,h){if(0!=this.f)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.f);this.f=g;this.l=h;this.A()};b.prototype.A=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.f(this.a[g]);this.a=null}};var f=new c;b.prototype.F=function(g){var h=this.j();
|
|
347
|
+
g.he(h.resolve,h.reject)};b.prototype.G=function(g,h){var k=this.j();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(p,u){return typeof p==_.Wd?function(x){try{l(p(x))}catch(y){m(y)}}:u}var l,m,n=new b(function(p,u){l=p;m=u});this.he(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.he=function(g,h){function k(){switch(l.f){case 1:g(l.l);break;case 2:h(l.l);break;default:throw Error("Unexpected state: "+
|
|
348
|
+
l.f);}}var l=this;null==this.a?f.f(k):this.a.push(k)};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=Qg(g),m=l.next();!m.done;m=l.next())d(m.value).he(h,k)})};b.all=function(g){var h=Qg(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(x){return function(y){p[x]=y;u--;0==u&&l(p)}}var p=[],u=0;do p.push(void 0),u++,d(k.value).he(n(p.length-1),m),k=h.next();while(!k.done)})};return b});var Vg=this||self;
|
|
349
|
+
Vg.a=!0;_.w("clpp.utils.obj.cloneItem",_.Yg);_.w("clpp.utils.obj.merge",_.Xg);var nh={DEFAULT:-1,NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};_.w("clpp.log.Level",nh);var lh=0,kh={},yt=[];_.w("clpp.log.getLoggers",function(){return _.Yg(kh)});_.w("clpp.log.addInterceptor",function(a){a&&yt.push(a)});_.w("clpp.log.removeInterceptor",function(a){a&&(a=yt.indexOf(a),0<=a&&yt.splice(a,1))});_.w("clpp.log.getTagLevel",mh);_.w("clpp.log.hasTagLevel",function(a){return void 0===a?!1:0<=kh[a]});_.w("clpp.log.setTagLevel",function(a,b){a&&(_.dh(b)&&(b=oh(b)),kh[a]=b)});
|
|
350
|
+
_.w("clpp.log.setLogLevel",function(a){-1===a&&(a=3);_.dh(a)&&(a=oh(a));lh=a});_.w("clpp.log.getLogLevel",function(){return lh});
|
|
351
|
+
_.S=class{constructor(a){(this.tag=a)&&void 0===kh[a]&&(kh[a]=-1)}log(a,b){if(window.console){if(1<arguments.length){var c=arguments[0];Array.prototype.shift.call(arguments)}else c=3;var d=mh(this.tag);if(0<=d){if(d<c)return}else if(lh<c)return;this.tag&&Array.prototype.unshift.call(arguments,"["+this.tag+"]");d=new Date;d.toISOString&&(d=d.toISOString().substring(11).replace("Z",""),Array.prototype.unshift.call(arguments,d));4===c?console.log.apply(console,arguments):3===c?console.info.apply(console,
|
|
352
|
+
arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of yt)e.call(e,c,arguments)}}info(a){Array.prototype.unshift.call(arguments,3);this.log.apply(this,arguments)}debug(a){Array.prototype.unshift.call(arguments,4);this.log.apply(this,arguments)}warn(a){Array.prototype.unshift.call(arguments,2);this.log.apply(this,arguments)}error(a){Array.prototype.unshift.call(arguments,1);this.log.apply(this,arguments)}Fh(a){return a?
|
|
353
|
+
this.tag?new _.S(this.tag+"."+a):new _.S(a):this}};_.w("clpp.log.Logger",_.S);_.S.prototype.createChild=_.S.prototype.Fh;_.S.prototype.error=_.S.prototype.error;_.S.prototype.warn=_.S.prototype.warn;_.S.prototype.debug=_.S.prototype.debug;_.S.prototype.info=_.S.prototype.info;_.S.prototype.log=_.S.prototype.log;var ph=new _.S("clpp");_.w("clpp.log.info",_.qh);_.w("clpp.log.debug",_.rh);_.w("clpp.log.warn",_.A);_.w("clpp.log.error",_.sh);var Xr;Xr=class{constructor(a,b){this.nb=a;this.sourceIndex=b}};_.uh=new _.S("clpp.players");_.th={};_.Ri={IDLE:0,STOPPING:1,qj:2,ERROR:3,READY:4,SEEKING:5,BUFFERING:6,PLAY:7,PLAYING:8,rj:9,PAUSED:10,ENDED:11};_.w("clpp.events.ERROR",_.Sd);_.w("clpp.events.LOADEDMETADATA",_.le);_.w("clpp.events.BUFFERING_ENDED",_.Nc);_.w("clpp.events.BUFFERING_STARTED",_.Oc);_.w("clpp.events.STATE_CHANGED",Kf);_.w("clpp.events.AUDIO_TRACK_CHANGED",_.Jc);_.w("clpp.events.TEXT_TRACK_CHANGED",_.Vf);_.w("clpp.events.VIDEO_TRACK_CHANGED",_.sg);_.w("clpp.events.BITRATE_CHANGED",_.Lc);_.w("clpp.events.TRACKS_ADDED",_.ag);_.w("clpp.events.TRACKS_REMOVED","tracksremoved");_.w("clpp.events.LOAD_START",me);
|
|
354
|
+
_.w("clpp.events.RELEASING",_.sf);_.w("clpp.events.RELEASED",rf);_.w("clpp.events.DESTROYING","destroying");_.w("clpp.events.DESTROYED","destroyed");_.w("clpp.events.VIDEO_BUFFER_CHANGED",_.rg);_.w("clpp.events.AUDIO_BUFFER_CHANGED",_.Ic);_.w("clpp.events.DOWNLOAD_TRACE","downloadtrace");_.w("clpp.events.DRM_SESSION_CREATED",Id);_.w("clpp.events.DRM_SESSION_UPDATE",_.Kd);_.w("clpp.events.DRM_SESSION_PERSISTED",_.Jd);_.w("clpp.events.DRM_RENEWAL_STARTED",Hd);
|
|
355
|
+
_.w("clpp.events.DRM_EXPIRATION_UPDATE",_.Fd);_.w("clpp.events.DRM_LICENSE_REQUESTED",Gd);_.w("clpp.events.AUTOPLAY_NOT_ALLOWED",_.Kc);_.w("clpp.events.PLAY",_.Qe);_.w("clpp.events.SEEKING",_.Cf);_.w("clpp.events.SEEKED",_.Bf);_.w("clpp.events.USER_SEEKING",_.kg);_.w("clpp.events.USER_SEEKED",_.jg);var Oi={SEEKING:1,NO_DATA:2};_.w("clpp.events.BufferingReasons",Oi);_.w("clpp.events.ADS_TIMELINE_CHANGED",_.oc);_.w("clpp.events.AD_LOADED",_.bc);_.w("clpp.events.AD_BREAK_STARTED",_.Sb);
|
|
356
|
+
_.w("clpp.events.AD_STARTED",_.kc);_.w("clpp.events.AD_BUFFERING",_.Ub);_.w("clpp.events.AD_PROGRESS",_.ec);_.w("clpp.events.AD_FIRST_QUARTILE",_.Xb);_.w("clpp.events.AD_MIDPOINT",_.cc);_.w("clpp.events.AD_THIRD_QUARTILE",_.mc);_.w("clpp.events.AD_PAUSED",_.dc);_.w("clpp.events.AD_RESUMED",_.fc);_.w("clpp.events.AD_SKIPPED",_.ic);_.w("clpp.events.AD_CLICKED",_.Vb);_.w("clpp.events.AD_IMPRESSION",_.ac);_.w("clpp.events.AD_COMPLETED",_.Wb);_.w("clpp.events.AD_STOPPED",_.lc);
|
|
357
|
+
_.w("clpp.events.AD_BREAK_STOPPED",_.Tb);_.w("clpp.events.AD_HLS_ASSET_LIST_REQUEST",Yb);_.w("clpp.events.AD_HLS_ASSET_LIST_RESPONSE",Zb);_.w("clpp.events.AD_HLS_RESOLVED",$b);_.w("clpp.events.SIMID_CREATIVE_STARTED",_.Ef);_.w("clpp.events.SIMID_CREATIVE_STOPPED",_.Ff);_.w("clpp.events.CASTING_STARTED",_.Rc);_.w("clpp.events.CASTING_ENDED","castingended");_.w("clpp.events.CAST_STATUS_CHANGED",_.Sc);_.w("clpp.events.CAST_VISIBILITY_CHANGED",_.Tc);_.w("clpp.events.AIRPLAY_STATUS_CHANGED",_.rc);
|
|
358
|
+
_.w("clpp.events.AIRPLAY_CASTING_STARTED",_.qc);_.w("clpp.events.AIRPLAY_CASTING_ENDED",_.pc);_.w("clpp.events.TIMELINE_CUE_ADDED",_.Wf);_.w("clpp.events.TIMELINE_CUE_ENTER",_.Xf);_.w("clpp.events.TIMELINE_CUE_EXIT",_.Yf);_.w("clpp.events.TIMELINE_CUES_CHANGED",_.Zf);_.w("clpp.events.MPD_TYPE_CHANGED",_.ve);_.w("clpp.events.LIVE_TURNED_STATIC",_.ie);_.w("clpp.events.VIMOND_RESPONSE",_.tg);_.w("clpp.events.PLAYLIST_ITEM_CHANGED",_.cf);_.w("clpp.events.PLAYLIST_MODIFIED",_.df);
|
|
359
|
+
_.w("clpp.events.SC_PLAYLIST_TIMELINE_CHANGED",_.Af);_.w("clpp.events.SC_PLAYLIST_ITEM_CHANGED",_.yf);_.w("clpp.events.SC_PLAYLIST_ENDED",_.xf);_.w("clpp.events.SC_PLAYLIST_LIVE_TURNED_STATIC",_.zf);_.w("clpp.events.CDN_SWITCH_SUCCESS",_.Uc);_.w("clpp.events.ONLINE_STATUS_CHANGED",Ie);_.w("clpp.events.CMSD_EVENT","cmsd-event");_.w("clpp.events.YOSPACE_SESSION_STARTED",_.Lg);_.w("clpp.events.YOSPACE_SESSION_ENDED",_.Kg);_.zt=class{constructor(a){this.f=a;this.a=null}la(a){return xh(this,a,!1)}Gb(a){return xh(this,a,!0)}stop(){this.a&&(this.a(),this.a=null)}};_.Jh=class{constructor(a){this.f=a;this.a=null}Ef(){this.stop();this.f();return this}la(a){this.stop();this.a=(new _.zt(()=>{this.f()})).la(a);return this}Gb(a){this.stop();this.a=(new _.zt(()=>{this.f()})).Gb(a);return this}stop(){this.a&&(this.a.stop(),this.a=null)}};_.w("clpp.utils.Timer",_.Jh);_.Jh.prototype.stop=_.Jh.prototype.stop;_.Jh.prototype.tickEvery=_.Jh.prototype.Gb;_.Jh.prototype.tickAfter=_.Jh.prototype.la;_.Jh.prototype.tickNow=_.Jh.prototype.Ef;var At=class{constructor(){this.Kc=null;this.f=[];this.h=[];this.Xa=new _.S(fd);this.a=null;this.j=!1}load(a){const b=this;return _.v(function*(){b.Kc?yield Bh(b,c=>_.v(function*(){yield c.open(a)})):b.Xa.warn("No main player, cannot load.")})}Wi(a){this.j=a;this.Xa.info("Looping set to",a)}sh(a){this.f.push(a)}rh(a){if(this.Kc)this.Xa.warn("Main player already set.");else{this.Kc=a;var b=this.o.bind(this),c=this.w.bind(this),d=this.l.bind(this);a.on(_.af,b);a.on(_.$f,c);a.on(_.Rd,d);this.h.push(()=>
|
|
360
|
+
{a.off(_.af,b);a.off(_.$f,c);a.off(_.Rd,d)})}}clear(){this.Kc=null;this.f=[];this.h.forEach(a=>a());this.h=[]}l(){const a=this;return _.v(function*(){a.j&&(a.Xa.info("Looping playback."),yield Bh(a,b=>_.v(function*(){yield b.setPosition(0);yield b.play()})))})}o(a){this.a||(a=a.detail.currentState,8===a?(this.Xa.info("Mirroring playing."),Ch(this,b=>_.v(function*(){yield b.play()}))):[10,6,3].includes(a)&&(this.Xa.info("Mirroring paused/buffering/error."),Ch(this,b=>{const c=this;return _.v(function*(){var d=
|
|
361
|
+
Math.round(c.Kc.getPosition())-.1;yield b.setPosition(d);yield yh(.2);d=b.getPlayerState();if(8===d||6===d)yield b.pause()})})))}w(){this.a||Ch(this,a=>{const b=this;return _.v(function*(){a.isPaused()&&(yield a.play());const c=b.Kc.getPosition();var d=a.getPosition();d=c-d;const e=Math.abs(d),f=a.lc();if(!(8!==a.getPlayerState()||.05>=e)){var g=Math.abs(d);g=Math.min(Math.max(1+(.05>=g?0:g/(1>g?6:3))*Math.sign(d),.2),5);5<=e?(a.qd(1),yield a.setPosition(c)):f===g?1!==g&&b.Xa.info(`Delta ${d.toFixed(1)} s.`):
|
|
362
|
+
(1===g?b.Xa.info("Secondary caught up."):1>g?b.Xa.info("Secondary slowing down to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`):1<g&&b.Xa.info("Secondary speeding up to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`),a.qd(g))}})})}};_.w(fd,At);At.prototype.clear=At.prototype.clear;At.prototype.addMainPlayer=At.prototype.rh;At.prototype.addSecondaryPlayer=At.prototype.sh;At.prototype.setLoop=At.prototype.Wi;At.prototype.load=At.prototype.load;var Bt,T;_.J=class extends Error{constructor(a,b,c,d,e,f){super(Dh(a,b,c,d));this.severity=a;this.category=b;this.code=c;this.svtaCode=f||T.get(c)||Bt;this.data=!d||_.dh(d)?{}:d;this.cause=void 0===e?null:e;this.f=!1;Error.captureStackTrace&&Error.captureStackTrace(this,_.J)}a(a){this.severity!==a&&(this.severity=a,this.message=Dh(this.severity,this.category,this.code,this.data))}toString(){let a=this.message;this.cause&&(a+=`\n Caused by ${this.cause}`);return a}};_.w("clpp.Error",_.J);_.C=2;
|
|
363
|
+
_.J.Severity={RECOVERABLE:1,FATAL:_.C};_.J.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,PLUGIN:9,ADS:10};
|
|
364
|
+
_.J.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_MODIFIER_ERROR:1006,RESPONSE_MODIFIER_ERROR:1007,MALFORMED_TEST_URI:1008,MALFORMED_URL:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,FETCH_OR_APPEND_ERROR:2010,INVALID_MP4:2011,TEXT_PARSER_MISSING:2012,THUMBNAILS_FAILED_TO_LOAD:2013,THUMBNAIL_ERROR:2014,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,
|
|
354
365
|
EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,
|
|
355
366
|
MP4_PARSER_ERROR:3019,MEDIA_LOAD_ERROR:3100,INVALID_TRACK_TYPE:3101,MEDIA_DECRYPTION_ERROR:3103,PAUSE_FAILED:3201,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,
|
|
356
367
|
HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,SMOOTH_INVALID_MANIFEST_XML:4033,
|
|
@@ -358,70 +369,58 @@ SMOOTH_EMPTY_PRESENTATION:4034,SMOOTH_MEDIA_PROCESSING_ERROR:4035,SMOOTH_INVALID
|
|
|
358
369
|
NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,REQUESTED_DRM_ENVIRONMENT_UNAVAILABLE:6015,INIT_DATA_TRANSFORM_ERROR:6016,CERTIFICATE_REQUEST_FAILED:6100,
|
|
359
370
|
NO_CONTENT_ID:6101,SERVER_CERTIFICATE_REQUIRED:6102,EXTRACT_CONTENT_ID_MODIFIER_ERROR:6103,FAILED_TO_PERSIST_SESSION:6200,FAILED_TO_REMOVE_SESSION:6201,INVALID_SESSION_STORAGE_IMPLEMENTATION:6202,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,CANNOT_LOAD_SOURCE:7003,MEDIA_ELEMENT_NOT_FOUND:7004,INVALID_MEDIA_ELEMENT:7005,INVALID_CONTAINER_ELEMENT:7006,INVALID_ARGUMENT:7007,WRONG_ORDER_OF_OPERATIONS:7008,NOT_SUPPORTED:7009,INVALID_CONFIGURATION:7100,INVALID_LICENSE:7101,NO_ELEMENT:7102,USER_ID_NOT_PROVIDED:7103,
|
|
360
371
|
KEY_LOAD_ERROR:7104,TIZEN_INTERNAL_ERROR:7200,CAF_INTERNAL_ERROR:7300,INTERNAL_CAST_ERROR:8E3,CAST_API_NOT_READY:8001,NO_RECEIVERS_AVAILABLE:8002,ALREADY_CASTING:8003,NO_CAST_SESSION:8004,CONVIVA_SDK_NOT_LOADED:9E3,CONVIVA_INVALID_CONFIGURATION:9001,CONVIVA_RUNTIME_ERROR:9002,GL_CONTEXT_ERROR:9003,GL_SHADER_ERROR:9004,YOUBORA_SDK_MISSING:9100,YOUBORA_INVALID_CONFIGURATION:9101,YOUBORA_SDK_VERSION_NOT_SUPPORTED:9102,VIMOND_INVALID_CONFIGURATION:9200,VIMOND_SESSION_ERROR:9201,MUXDATA_INVALID_CONFIGURATION:9300,
|
|
361
|
-
MUX_SDK_MISSING:9301,MUXDATA_INIT_ERROR:9302,IMA_SDK_MISSING:1E4,IMA_INVALID_CONFIGURATION:10001,IMA_UNSUPPORTED_PLATFORM:10002,AD_ERROR:10003,SIMID_CONTAINER_MISSING:10100,BROADPEAK_SDK_MISSING:11E3,BROADPEAK_SESSION_ERROR:11001,FREEWHEEL_SDK_MISSING:12E3,FREEWHEEL_INVALID_CONFIGURATION:12001,CONTENT_TRANSFORMATION_FAILED:14E3,SESSIONS_INVALID_CONFIGURATION:15E3};_.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
_.
|
|
368
|
-
_.
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
U.prototype.getClickThroughUrl=U.prototype.Pa;U.prototype.isBumper=U.prototype.Bb;U.prototype.getSkipTimeOffset=U.prototype.getSkipTimeOffset;U.prototype.getPosition=U.prototype.getPosition;U.prototype.getDuration=U.prototype.getDuration;U.prototype.getTitle=U.prototype.getTitle;U.prototype.getAdvertiserName=U.prototype.getAdvertiserName;U.prototype.getAdSystem=U.prototype.getAdSystem;U.prototype.getApiFramework=U.prototype.getApiFramework;U.prototype.getSourceId=U.prototype.zb;
|
|
372
|
-
U.prototype.getCreativeId=U.prototype.getCreativeId;U.prototype.getId=U.prototype.getId;U.prototype.getTechnology=U.prototype.gb;U.prototype.getAdManagerVersion=U.prototype.eb;U.prototype.getAdManagerName=U.prototype.cb;var J=class{constructor(a,b,c,d,e,f,g){this.o=this.l=this.j=!1;this.F=a;this.f=b;this.a=c;this.h=d;this.w=0;this.B=`${e}:${b}`;this.G=e;this.videoEl=null;this.A=f;this.C=g||null}cb(){return""}eb(){return""}gb(){return 2}getId(){return this.B}getCreativeId(){return""}zb(){return this.G}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.h}setPosition(a){this.w=a}getPosition(){return this.w}getSkipTimeOffset(){return-1}canSeek(){return this.A}Bb(){return!1}Pa(){return null}getMediaUrl(){return null}Ta(){return 0}Sa(){return 0}Ba(){return 0}Ca(){return this.F}getPodIndex(){return 0}pb(){return 0}fb(){return this.f}Ua(){return this.a}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return this.videoEl}Zh(){return this.C}};
|
|
373
|
-
J.prototype.getCustomAttributes=J.prototype.Zh;J.prototype.getVideoElement=J.prototype.Ab;J.prototype.getWrapperCreativeIds=J.prototype.getWrapperCreativeIds;J.prototype.getWrapperAdSystems=J.prototype.getWrapperAdSystems;J.prototype.getWrapperAdIds=J.prototype.getWrapperAdIds;J.prototype.getSequenceLength=J.prototype.Ua;J.prototype.getPositionInSequence=J.prototype.fb;J.prototype.getPodTimeOffset=J.prototype.pb;J.prototype.getPodIndex=J.prototype.getPodIndex;J.prototype.getPodType=J.prototype.Ca;
|
|
374
|
-
J.prototype.getMediaBitrate=J.prototype.Ba;J.prototype.getMediaHeight=J.prototype.Sa;J.prototype.getMediaWidth=J.prototype.Ta;J.prototype.getMediaUrl=J.prototype.getMediaUrl;J.prototype.getClickThroughUrl=J.prototype.Pa;J.prototype.isBumper=J.prototype.Bb;J.prototype.canSeek=J.prototype.canSeek;J.prototype.getSkipTimeOffset=J.prototype.getSkipTimeOffset;J.prototype.getPosition=J.prototype.getPosition;J.prototype.getDuration=J.prototype.getDuration;J.prototype.getTitle=J.prototype.getTitle;
|
|
375
|
-
J.prototype.getAdvertiserName=J.prototype.getAdvertiserName;J.prototype.getAdSystem=J.prototype.getAdSystem;J.prototype.getApiFramework=J.prototype.getApiFramework;J.prototype.getSourceId=J.prototype.zb;J.prototype.getCreativeId=J.prototype.getCreativeId;J.prototype.getId=J.prototype.getId;J.prototype.getTechnology=J.prototype.gb;J.prototype.getAdManagerVersion=J.prototype.eb;J.prototype.getAdManagerName=J.prototype.cb;var Nt=class{constructor(a){this.a=a.map(b=>({ic:b.getSurface().getMedia().id,player:b,je:!0,ready:Promise.resolve()}));this.g=new _.T("clpp.playlist.PlayerPool")}has(){return this.a.some(a=>a.je)}get(){const a=this;return _.v(function*(){const b=a.a.find(c=>c.je);if(!b)throw Error("No available players in the pool");b.je=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.je=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.g.error("Failed to unload player",
|
|
376
|
-
d)}).then(c)});return b.ready}destroy(){const a=this;return _.v(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};var Ot=class{};_.w("clpp.utils.BufferUtils",Ot);Ot.toArrayBuffer=gi;Ot.toDataView=_.fi;Ot.toInt32Array=_.ei;Ot.toUint32Array=di;Ot.toUint16Array=ci;Ot.toUint8Array=_.G;Ot.equal=ai;var ji=new _.T("clpp.utils.strings");_.w("clpp.utils.strings.fromUtf8",_.ii);_.w("clpp.utils.strings.fromBytesAutoDetect",_.li);_.w("clpp.utils.strings.toUtf8",_.mi);_.w("clpp.utils.strings.toUtf16",_.ni);_.w("clpp.utils.strings.toByteArray",_.oi);_.w("clpp.utils.strings.startsWith",_.pi);_.w("clpp.utils.strings.endsWith",_.qi);_.w("clpp.utils.strings.bitrateToString",_.ti);
|
|
372
|
+
MUX_SDK_MISSING:9301,MUXDATA_INIT_ERROR:9302,IMA_SDK_MISSING:1E4,IMA_INVALID_CONFIGURATION:10001,IMA_UNSUPPORTED_PLATFORM:10002,AD_ERROR:10003,SIMID_CONTAINER_MISSING:10100,BROADPEAK_SDK_MISSING:11E3,BROADPEAK_SESSION_ERROR:11001,FREEWHEEL_SDK_MISSING:12E3,FREEWHEEL_INVALID_CONFIGURATION:12001,CONTENT_TRANSFORMATION_FAILED:14E3,SESSIONS_INVALID_CONFIGURATION:15E3};_.vj=class extends Error{constructor(a,b){super(a);this.code=b}};Bt=999;T=new Map;T.set(1E3,3E3);T.set(1002,3E3);T.set(1003,3002);
|
|
373
|
+
T.set(1004,3005);T.set(1006,9900);T.set(1007,9900);T.set(1011,3005);T.set(2E3,5001);T.set(2001,5001);T.set(2005,5001);T.set(2007,5001);T.set(2008,5001);T.set(2010,5001);T.set(2011,5001);T.set(2012,1006);T.set(2013,9900);T.set(2014,9900);T.set(3E3,2006);T.set(3001,2006);T.set(3002,2006);T.set(3003,2006);T.set(3004,2006);T.set(3005,2006);T.set(3006,2006);T.set(3007,2006);T.set(3008,2006);T.set(3009,2006);T.set(3010,2006);T.set(3011,2006);T.set(3012,2006);T.set(3013,2006);T.set(3014,2007);
|
|
374
|
+
T.set(3015,9900);T.set(3016,2007);T.set(3017,2025);T.set(3018,2021);T.set(3019,2006);T.set(3100,1001);T.set(3101,9900);T.set(3103,4020);T.set(3201,9900);T.set(4E3,2005);T.set(4001,1002);T.set(4002,1002);T.set(4003,1002);T.set(4004,1002);T.set(4005,1002);T.set(4006,1E3);T.set(4007,1002);T.set(4008,1002);T.set(4009,1004);T.set(4010,1002);T.set(4011,2011);T.set(4012,4E3);T.set(4014,1002);T.set(4015,1002);T.set(4016,1002);T.set(4017,1002);T.set(4018,1002);T.set(4020,1002);T.set(4021,1002);
|
|
375
|
+
T.set(4023,1002);T.set(4024,1002);T.set(4025,1002);T.set(4026,4008);T.set(4027,1004);T.set(4028,1002);T.set(4030,2006);T.set(4032,1004);T.set(4033,2005);T.set(4034,1002);T.set(4035,2006);T.set(4036,1002);T.set(4037,1002);T.set(4038,1002);T.set(4039,2006);T.set(4040,5E3);T.set(4041,1004);T.set(4042,2005);T.set(4043,1002);T.set(4044,1002);T.set(4045,2039);T.set(4047,2E3);T.set(4048,2E3);T.set(5005,1004);T.set(5006,2E3);T.set(6E3,4008);T.set(6001,4010);T.set(6002,4010);T.set(6003,4010);T.set(6004,4013);
|
|
376
|
+
T.set(6005,4014);T.set(6006,4021);T.set(6007,4004);T.set(6008,4016);T.set(6010,4015);T.set(6012,4E3);T.set(6013,4017);T.set(6014,4003);T.set(6015,4015);T.set(6016,4E3);T.set(6100,4013);T.set(6101,4015);T.set(6102,4013);T.set(6103,4E3);T.set(6200,4017);T.set(6201,4017);T.set(6202,4017);T.set(7E3,9900);T.set(7001,9900);T.set(7003,1004);T.set(7004,9900);T.set(7005,9900);T.set(7006,9900);T.set(7007,9900);T.set(7008,9900);T.set(7009,9900);T.set(7100,9900);T.set(7101,9900);T.set(7102,9900);T.set(7103,9900);
|
|
377
|
+
T.set(7200,9900);T.set(7300,6E3);T.set(8E3,6E3);T.set(8001,6E3);T.set(8002,6003);T.set(8003,6008);T.set(8004,6005);T.set(9E3,9900);T.set(9001,9900);T.set(9002,9900);T.set(9003,9900);T.set(9004,9900);T.set(9100,9900);T.set(9101,9900);T.set(9102,9900);T.set(9200,9900);T.set(9201,9900);T.set(9300,9900);T.set(9301,9900);T.set(9302,9900);T.set(1E4,7E3);T.set(10001,7E3);T.set(10002,7E3);T.set(10003,7E3);T.set(10100,7E3);T.set(11E3,9900);T.set(11001,9900);T.set(12E3,9900);T.set(12001,9900);T.set(14E3,4E3);_.H=class{constructor(a,b){if(b)for(const c in b)this[c]=b[c];this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.stopped=this.a=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}stopImmediatePropagation(){this.stopped=!0}stopPropagation(){}};_.Ct=class{constructor(){this.a={}}push(a,b){a in this.a?this.a[a].push(b):this.a[a]=[b]}get(a){return(a=this.a[a])?a.slice():[]}remove(a,b){a=this.a[a];if(!a)return!1;let c=!1;for(let d=0;d<a.length;++d)a[d]===b&&(a.splice(d,1),--d,c=!0);return c}clear(){this.a={}}forEach(a){for(const b in this.a)a(b,this.a[b])}};var Dt;_.Et=class{constructor(){this.a=new _.Ct}release(){_.Fh(this)}on(a,b,c,d=!1){a=new Dt(a,b,c,d);this.a.push(b,a)}one(a,b,c){const d=e=>{this.off(a,b,d);return c(e)};this.on(a,b,d)}off(a,b,c){const d=this.a.get(b)||[];for(let e=0;e<d.length;++e){const f=d[e];f.target!==a||c!==f.a&&c||(Eh(f),this.a.remove(b,f))}}};Dt=class{constructor(a,b,c,d){this.target=a;this.type=b;this.a=c;this.f=d;this.target.addEventListener(b,c,d)}};var Ft=class{};_.w(ld,Ft);Ft.getInfo=_.li;
|
|
378
|
+
var Ih=null,Hh=null,ai=new _.S(ld),ei="android",di="ios",ji="linux",fi="osx",gi="windows",hi="tizen",ii="webos",ci=_.fg,ki=_.fg,Vh={windows:{os_version:/windows\s+?nt\s([\d.]+)/i,edge:/windows\s+?nt.+?edge?\/([\d.]+)/i,chrome:/windows\s+?nt.+?chrome\/([\d.]+)/i,firefox:/windows\s+?nt.+?firefox\/([\d.]+)/i,opera:/windows\s+?nt.+?opr\/([\d.]+)/i},osx:{os_version:/macintosh.+?([\d._]+)/i,safari:/macintosh.+?version\/([\d._]+).+?safari/i,edge:/macintosh.+?edge?\/([\d._]+)/i,chrome:/macintosh.+?chrome\/([\d._]+)/i,
|
|
379
|
+
firefox:/macintosh.+?firefox\/([\d._]+)/i,opera:/macintosh.+?opr\/([\d._]+)/i},unknown:{edge:/.+?edge?\/([\d.]+)/i,safari:/.+?version\/([\d._]+).+?safari/i,chrome:/.+?chrome\/([\d._]+)/i,firefox:/.+?firefox\/([\d._]+)/i,opera:/.+?opr\/([\d._]+)/i},android:{os_version:/android.+?([\d._]+)/i,chrome:/android.+?chrome\/([\d._]+)/i,firefox:/android.+?firefox\/([\d._]+)/i,opera:/android.+?opr\/([\d._]+)/i},ios:{os_version:/(?:iPad|iPhone).+?([\d._]+)/i,chrome:/.+?CriOS\/([\d._]+)/i,firefox:/.+?FxiOS\/([\d._]+)/i,
|
|
380
|
+
safari:/.+?version\/([\d._]+).+?safari/i,opera:/.+?opr\/([\d._]+)/i},linux:{os_version:/linux.+?([\d._]+)/i,safari:/linux.+?version\/([\d._]+).+?safari/i,chrome:/linux.+?chrome\/([\d._]+)/i,firefox:/linux.+?firefox\/([\d._]+)/i,opera:/linux.+?opr\/([\d._]+)/i},tizen:{os_version:/tizen.+?([\d._]+)/i,safari:/linux.+?version\/([\d._]+).+?safari/i,chrome:/linux.+?chrome\/([\d._]+)/i,firefox:/linux.+?firefox\/([\d._]+)/i,opera:/linux.+?opr\/([\d._]+)/i},webos:{os_version:/linux.+?([\d._]+)/i,safari:/linux.+?version\/([\d._]+).+?safari/i,
|
|
381
|
+
chrome:/linux.+?chrome\/([\d._]+)/i,firefox:/linux.+?firefox\/([\d._]+)/i,opera:/linux.+?opr\/([\d._]+)/i}};var Gt=class{};_.w("clpp.utils.BufferUtils",Gt);Gt.toArrayBuffer=ti;Gt.toDataView=_.si;Gt.toInt32Array=_.ri;Gt.toUint32Array=qi;Gt.toUint16Array=pi;Gt.toUint8Array=_.E;Gt.equal=ni;var wi=new _.S("clpp.utils.strings");_.w("clpp.utils.strings.fromUtf8",_.vi);_.w("clpp.utils.strings.fromBytesAutoDetect",_.yi);_.w("clpp.utils.strings.toUtf8",_.zi);_.w("clpp.utils.strings.toUtf16",_.Ai);_.w("clpp.utils.strings.toByteArray",_.Bi);_.w("clpp.utils.strings.startsWith",_.Ci);_.w("clpp.utils.strings.endsWith",_.Di);_.w("clpp.utils.strings.bitrateToString",_.Gi);
|
|
377
382
|
_.w("clpp.utils.strings.durationToString",function(a,b="%h:%mm:%ss"){if(null===a||void 0===a)a=0;if(null===b||void 0===b)b="%h:%mm:%ss";const c=Math.floor(a/3600),d=Math.floor((a-3600*c)/60);a=Math.floor(a-3600*c-60*d);const e=(g,h)=>g.length<h?e("0"+g,h):g,f=g=>(h,k)=>e(g,k.length-1);return b.replace(/(%h+)/,f(String(c))).replace(/(%m+)/,f(String(d))).replace(/(%s+)/,f(String(a)))});
|
|
378
|
-
_.w("clpp.utils.strings.hashCode",function(a){let b=0;if(0===a.length)return b;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c),b|=0;return b});var
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
lj.prototype.removeElementFromContainer=lj.prototype.removeElementFromContainer;lj.prototype.addElementToContainer=lj.prototype.addElementToContainer;lj.prototype.getCastElement=lj.prototype.getCastElement;lj.prototype.getContainer=lj.prototype.getContainer;lj.prototype.getMedia=lj.prototype.getMedia;var St={disableContainer:!1,webOSStartupPatch:!1,crossorigin:"anonymous",containerEl:null},Tt=1;var Ut=class{constructor(a){this.ka=a;this.l=!!a.sideAdContainer;this.h=[];this.a=a.Qg;this.C=kj(a);this.A=[];const b=mj(this,this.C,this.ka.Jh);this.o=new Nt(b);this.f=null;this.w=!1;this.j=new Map;this.F=a.toggleVisible;this.g=new _.T("clpp.interstitial.MultiController");this.ga=this.B=!1;this.G=a.Di||(()=>{});nj(this).forEach(c=>oj(this,c,!1))}getCurrentItem(){return this.f}te(){return this.f?this.f.player:null}rg(){return Array.from(this.j.values())}Md(){return 0<this.j.size}play(a){return Fj(this,
|
|
388
|
-
a,_.Se)}load(a){return Fj(this,a,_.le)}release(){const a=this;return _.v(function*(){yield Promise.all([yield Mj(a),a.f?Cj(a,a.f):Promise.resolve()]);a.f=null;a.w=!1})}destroy(){const a=this;return _.v(function*(){a.g.info("Destroy");yield a.release();yield a.o.destroy();Zj(a)})}isMuted(){return this.B}},Wj="preload",Tj=_.pe,vj="primary",uj="ad";var mk=[403,401];_.w("clpp.net.DEFAULT_FATAL_STATUS_CODES",mk);_.w("clpp.net.makeRequest",_.sk);_.rk=6;_.w("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.rk,CONTENT_STEERING:7});var Vt=class extends _.Lt{constructor(a){super();this.ka=_.Zg({Li:.5},a);this.Pe=this.ga=!1;this.g=new _.T("clpp.interstitial.Player");this.f=a.player;this.f.setSeekInterceptor((b,c)=>{if(c)return!0;if(this.ga)return!1;if(c=Bk(this))return this.g.info("Seek ignored while binding interstitial",c.ea),!1;Ck(this,b);c=Ek(this);const d=Fk(this,b),e=Gk(this,b);if(c){if(d&&d!==c)return Jk(this,d,b),!1;if(e&&e!==c)return Kk(this,e,b),!1;if(b<c.startTime-this.ka.resolutionOffsetSec)return Hk(this,c),!0;if(b<
|
|
389
|
-
c.startTime)return Oj(this.X),this.g.info("Seek inside resolution area of",c.ea),!0;if(b<=c.endTime)return this.g.info("Seek into the scheduled interstitial",c.ea),Rj(this.X),!1;if(c.cg)return this.g.info("Jump over a scheduled interstitial",c.ea),Qj(this.X),c.state=ek,!0;this.g.info("Jump over a scheduled interstitial triggering it",c.ea);Rj(this.X);Yj(this.X,b,!0);return!1}return d?(Jk(this,d,b),!1):e&&!e.Lh?(Kk(this,e,b),!1):!0});this.X=new Ut({Jh:this.ka.config,Qg:a.player,preloadMedia:!0,ob:a.ob,
|
|
390
|
-
sideAdContainer:this.ka.sideAdContainer,onAudioDecision:this.ka.onAudioDecision,Di:()=>{this.g.info("Resume primary content")}});this.h=[];this.a=[];this.j=!1;Sk(this,a.player)}destroy(){const a=this;return _.v(function*(){Tk(a);a.a=[];a.j=!1;a.f.setSeekInterceptor(null);yield a.X.destroy()})}Rb(){return this.j}setMuted(a){var b=this.X;b.B=a;b.l?a?(b.a.setMuted(!0),Sj(b,!0)):(a=b.getCurrentItem(),tj(b,a,a&&a.Yb?uj:vj)):(b.a.setMuted(a),Sj(b,a))}isMuted(){return this.X.isMuted()}setVolume(a){nj(this.X).forEach(b=>
|
|
391
|
-
{b.setVolume(a)})}isLive(){const a=this.X.te();return a?a.isLive():null}},ek=0,Ak=1,il=2,jl=3,Dk=4,rl=5,fk=6;var Ln=class{constructor(){this.a=null}load(){return Promise.resolve()}j(){const a=Uk(this.a);return a?(a.play(),!1):!0}A(a,b,c){const d=a.getConfiguration();a=Object.assign({},{config:d,player:a,ob:b},d.ads.hls||{},{Ki:c});this.a=new Vt(a);bl(this.a)}setMuted(a){this.a&&this.a.setMuted(a)}isMuted(){return this.a?this.a.isMuted():!0}qb(){return null!==Uk(this.a)}ib(){const a=Uk(this.a);a&&a.pause()}isPaused(){const a=Uk(this.a);return a?a.isPaused():!1}skip(){}getAdVolume(){const a=Uk(this.a);return a?
|
|
392
|
-
a.getVolume()||0:0}h(a){this.a.setVolume(a)}getPosition(){const a=Uk(this.a);return a?a.getPosition():-1}w(){return!this.a.Rb()}o(){return this.a.destroy()}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.ib()}resume(){this.j()}};Ln.prototype.resume=Ln.prototype.resume;Ln.prototype.pause=Ln.prototype.pause;Ln.prototype.getVolume=Ln.prototype.getVolume;Ln.prototype.setVolume=Ln.prototype.setVolume;Ln.prototype.getPosition=Ln.prototype.getPosition;Ln.prototype.skip=Ln.prototype.skip;var Wt=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.a=new _.It;this.h=null;this.f=!0;wl(this)}release(){this.a.release();xl(this);this.m=null}};_.Xt=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.V.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.Cl.prototype.resolve=function(){};_.Cl.prototype.reject=function(){};var Yt;_.lm=class{constructor(a,b){{var c=[a];let f=Dl(...c);if(!f||f.protocol.includes("."))c=b?[a,b]:[a,location.href],c=(f=Dl(...c))?c:null}if(!c)throw new _.I(_.D,1,1011,{message:"The provided URL is invalid.",url:a,base:b});const [d,e]=c;this.a=new URL(d,e);this.f=a.startsWith("//")}toString(){const a=this.a.toString();return this.f?a.replace(Yt,""):a}};Yt=/^[A-Za-z]+:/;var Zt=class{constructor(a){this.f=new Uint8Array(a);this.a=0}append(a){const b=this.a+a.byteLength;if(b>this.f.byteLength){const c=this.f;this.f=new Uint8Array(Math.max(2*this.f.byteLength,b));this.f.set(c)}this.f.set(a,this.a);this.a+=a.byteLength}get(){return this.a===this.f.byteLength?this.f.buffer:this.f.buffer.slice(0,this.a)}};var $t=class{constructor(a){this.o=a;this.f=this.a=this.h=0;this.j=null;this.l=-1}};var Jl=class{constructor(){this.a=Il()}};var Pl=class{constructor(a,b){b=void 0===b?!0:b;this.a=new Zt(a||1048576);this.f=new $t(this.a);this.j=b;this.h=a}};var au=class{};_.w("clpp.utils.Uint8ArrayUtils",au);au.toStandardBase64=_.Sl;au.concat=_.Yl;au.equal=_.Xl;au.toHex=_.Wl;au.fromHex=_.Vl;au.fromBase64=_.Ul;au.toBase64Url=_.Tl;_.rs=class{constructor(a,b){this.V=a;this.B=b;this.a=!1}abort(){this.a=!0;return this.B()}};var hm=class extends _.rs{constructor(a,b){super(new _.Cl,()=>Promise.resolve());this.C=a;this.h=null;this.w=this.V;this.f=-1;this.j=this.l=this.o=null;this.A=b||null;cm(this)}then(a,b){this.V=this.V.then(a,b);return this}catch(a){this.V=this.V.catch(a);return this}abort(){if(this.a)return Promise.resolve();this.a=!0;return this.h.then(a=>{this.o&&clearTimeout(this.o);this.l&&this.l();return a.abort()}).catch(()=>{})}};_.yn=class{constructor(){this.f=[];this.a=[];this.h=[];this.w=!1;this.o=new _.Xt;this.l={};this.headers=new Map;this.j=0;this.A=null;this.l.data=$l;em(this)}$i(a){0<a?_.B("Rate limit set to "+a+"bps"):_.B("Rate limit disabled");this.j=a}release(){return this.o.destroy()}destroy(){this.w=!0;this.f=[];this.a=[];this.h=[];return this.o.destroy()}Rf(a){this.f.push(a)}vd(a){this.h.push(a)}Ug(a){this.f=this.f.filter(b=>b!==a)}Ie(a){this.h=this.h.filter(b=>b!==a)}fetch(a){let b=void 0;1===a.type&&(b={objectType:bu});
|
|
393
|
-
return _.km(this,a,b)}};_.w("clpp.net.NetworkEngine",_.yn);_.yn.prototype.fetch=_.yn.prototype.fetch;_.yn.prototype.removeResponseModifier=_.yn.prototype.Ie;_.yn.prototype.removeRequestModifier=_.yn.prototype.Ug;_.yn.prototype.addResponseModifier=_.yn.prototype.vd;_.yn.prototype.addRequestModifier=_.yn.prototype.Rf;_.yn.prototype.setRateLimit=_.yn.prototype.$i;var mm=[];var pm=!!(performance&&performance.mark&&performance.measure),rm=new _.T("clpp.perf");_.w("clpp.version",_.ea);_.w("clpp.name",_.ra);var xn=null;_.w("clpp.configure",a=>{xn=a});_.pl="application/x-mpegurl";_.w("clpp.Type",{DASH:_.rc,HLS:_.pl,SMOOTH_STREAMING:_.zc,MP4:_.sg,MP3:"audio/mp3"});_.w("clpp.TimelineCueType",{SCTE35:_.Cf,DASH_CALLBACK:_.Be,HLS_DATERANGE:_.$d,UNKNOWN:_.hg});_.w("clpp.SpeedUpMode",{DECODER:_.yd,SEEK:"seek"});_.w("clpp.CodecSwitchingStrategy",{PREVENT:_.mf,SMOOTH:_.Jf});var um=new Map,tm=1,ym=2,xm=3,wm=4;_.kp=class{constructor(a){this.j=a;this.scheme=null;const b=document.createElement("a"),c=a.match(/^(.*:)(\/\/(.*))$/);let d=!1;if(c){if(this.scheme=c[1],b.href=c[2],":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+c[3],d=!0}else{b.href=a;if(":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+a.match(/\/?\/?(.*)/)[1],d=!0;this.scheme=b.protocol}""===this.scheme&&(this.scheme=window.location.protocol);this.a=d?"":b.hostname;this.port=b.port;this.path=b.pathname;
|
|
394
|
-
_.pi(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.h=b.hash}};_.w("clpp.utils.url.queryString",_.Im);var Mm;_.K=_.Uf;_.cu=1/15;Mm={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/],video:[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]};Mm[_.K]=[/^vtt$/,/^wvtt/,/^stpp/];var bu="m";var du=class{};_.w("clpp.utils.PlayerConfiguration",du);du.create=function(...a){return _.Wm(a,{Ti:!1})};du.build=_.Wm;_.w("clpp.utils.media.detectType",Ym);var an=new _.T("clpp.sources");_.w("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.jb,SW_SECURE_DECODE:_.lb,HW_SECURE_CRYPTO:Fa,HW_SECURE_DECODE:Ga,HW_SECURE_ALL:Ea});_.w("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.w("clpp.drm.KeySystem",{NONE:_.Ce,CLEAR_KEY:_.Me,WIDEVINE:_.sd,PLAYREADY:_.qd,FAIRPLAY:_.od,PRIMETIME:_.nd});_.cn={};_.w("clpp.drm.registerDrmEnvironment",_.dn);var jn=class{constructor(a,b,c){this.h=a;this.f=b;JSON.parse(_.ii(_.Ul(a)));this.a=JSON.parse(_.ii(_.Ul(b)));this.j=c}};var gn={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},Rm="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var On=class{constructor(a){this.f=a;this.a=null;this.g=new _.T("clpp.utils.LicenseKey")}},wn="vod",vn="live";var An=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
|
|
395
|
-
"cs"],["dan","da"],["deu","de"],[_.Bd,"dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
|
|
383
|
+
_.w("clpp.utils.strings.hashCode",function(a){let b=0;if(0===a.length)return b;for(let c=0;c<a.length;c++)b=(b<<5)-b+a.charCodeAt(c),b|=0;return b});var Ii=document.createElement("span");var Ht=class{constructor(a){this.g=new _.S("clpp.native.StateManager");this.m=a;this.a=new _.Et;this.I=this.w=this.f=0;this.o=2;this.J=this.l=this.G=this.C=0;this.h=this.ga=this.B=!1;this.F=0;this.j=null;this.H=0;this.K=_.Yh();this.A=!1;this.G=Date.now();Ni(this)}getState(){return this.f}destroy(){this.g.debug("Stop watching for video events for "+this.m.namespace());this.a.release()}};var It=class{constructor(a){this.m=a;this.l=a.getConfiguration().streaming.addMissingTimelineCues||!1;this.j=new _.Et;this.f=new Set;this.a=new Set;this.h=null;this.g=new _.S("clpp.native.Metadata")}release(){this.j.release();this.a=new Set;this.f.clear();null!=this.h&&(clearInterval(this.h),this.h=null)}destroy(){const a=this;return _.v(function*(){a.release()})}getTimelineCues(){return Array.from(this.a.values()).sort((a,b)=>a.startTime-b.startTime)}};_.Pt=class{constructor(a,b,c,d){d=void 0===d?_.Jt:d;this.startTime=a;this.endTime=b;this.payload=c;this.payloadType=d;this.positionAlign=this.position=null;this.size=100;this.textAlign=_.Kt;this.writingMode=_.Lt;this.lineInterpretation=_.Mt;this.line=null;this.lineAlign=_.Nt;this.direction=Ot;this.region=null;this.cssClassList=[];this.id=this.backgroundImage="";this.containerRows=null}Xc(a){return this.payload===a.payload&&this.startTime===a.startTime&&this.endTime===a.endTime&&this.payloadType===
|
|
384
|
+
a.payloadType}};_.w("clpp.text.Cue",_.Pt);_.Pt.positionAlign={LEFT:_.ge,RIGHT:_.he,CENTER:_.Wc,AUTO:"auto"};_.Jt=_.Sf;_.Pt.payloadType={TEXT:_.Jt,VTT_XML:_.yg,TTML_XML:_.cg};_.Kt=_.Wc;_.Qt={LEFT:_.de,RIGHT:_.wf,CENTER:_.Kt,START:_.Jf,END:_.Qd};_.Pt.textAlign=_.Qt;var Ot="ltr";_.Pt.direction={HORIZONTAL_LEFT_TO_RIGHT:Ot,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};_.Lt="horizontal-tb";_.Pt.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.Lt,VERTICAL_LEFT_TO_RIGHT:_.ng,VERTICAL_RIGHT_TO_LEFT:_.og};_.Mt=0;
|
|
385
|
+
_.Pt.lineInterpretation={LINE_NUMBER:_.Mt,PERCENTAGE:1};_.Nt=_.Jf;_.Rt={CENTER:_.Wc,START:_.Nt,END:_.Qd};_.Pt.lineAlign=_.Rt;_.Ut=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=_.St;this.scroll=Tt;this.cssClassList=[];this.writingMode=this.displayAlign=null}};_.w("clpp.text.CueRegion",_.Ut);_.St=1;_.Ut.units={PX:0,PERCENTAGE:_.St,LINES:2};var Tt="";
|
|
386
|
+
_.Ut.scrollMode={NONE:Tt,UP:"up"};_.Ut.displayAlign={BEFORE:"flex-end",CENTER:_.Wc,AFTER:"flex-start"};_.Ut.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.nd,VERTICAL_LEFT_TO_RIGHT:"row-reverse",VERTICAL_RIGHT_TO_LEFT:"row"};var Vt=class{constructor(a){this.m=a;this.l=a.getTextDisplayer();this.f=this.h=null;this.a=new _.Et;this.j=!1;this.g=new _.S("clpp.native.CueHandler")}destroy(){this.a.release();this.j=!1;this.l=this.a=this.h=this.f=null;return Promise.resolve()}start(a){this.j?this.g.warn("Already started. Ignoring request..."):(this.j=!0,this.h=a,this.f=this.h.textTracks,this.a.on(this.f,_.nc,b=>sj(this,b)),this.a.on(this.f,Yc,()=>{{const b=this.f;for(let c=0;c<b.length;c++){const d=b[c];d.mode===_.Df&&(d.mode=
|
|
387
|
+
_.Yd)}}}))}o(a){const b=new _.Pt(a.startTime,a.endTime,a.text,_.yg);if(_.dh(a.vertical))switch(a.vertical){case "lr":b.writingMode=_.ng;break;case "rl":b.writingMode=_.og}_.eh(a.size)&&(b.size=a.size);if(_.dh(a.align))switch(a.align){case _.de:case _.Jf:b.textAlign=_.Jf;break;case _.Wc:b.textAlign=_.Kt;break;case _.wf:case _.Qd:b.textAlign=_.Qd}_.eh(a.position)&&(b.position=a.position);if(_.dh(a.positionAlign))switch(a.positionAlign){case _.ge:b.positionAlign=_.ge;break;case _.Wc:b.positionAlign=
|
|
388
|
+
_.Wc;break;case _.he:b.positionAlign=_.he}_.eh(a.line)&&(b.line=a.line);if(_.dh(a.lineAlign))switch(a.lineAlign){case _.Jf:b.lineAlign=_.Nt;break;case _.Wc:b.lineAlign=_.Wc;break;case _.Qd:b.lineAlign=_.Qd}typeof a.snapToLines===_.Mc&&(b.lineInterpretation=a.snapToLines?_.Mt:1);return b}};var Wt;_.Dj=class{constructor(a,b){{var c=[a];let f=yj(...c);if(!f||f.protocol.includes("."))c=b?[a,b]:[a,location.href],c=(f=yj(...c))?c:null}if(!c)throw new _.J(_.C,1,1011,{message:"The provided URL is invalid.",url:a,base:b});const [d,e]=c;this.a=new URL(d,e);this.f=a.startsWith("//")}toString(){const a=this.a.toString();return this.f?a.replace(Wt,""):a}};Wt=/^[A-Za-z]+:/;_.Zm=class{constructor(a){this.j=a;this.scheme=null;const b=document.createElement("a"),c=a.match(/^(.*:)(\/\/(.*))$/);let d=!1;if(c){if(this.scheme=c[1],b.href=c[2],":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+c[3],d=!0}else{b.href=a;if(":"===b.protocol||""===b.host&&""===b.pathname)b.href="//dummy.com/"+a.match(/\/?\/?(.*)/)[1],d=!0;this.scheme=b.protocol}""===this.scheme&&(this.scheme=window.location.protocol);this.a=d?"":b.hostname;this.port=b.port;this.path=b.pathname;
|
|
389
|
+
_.Ci(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.h=b.hash}};_.w("clpp.utils.url.queryString",_.Aj);var Fj;_.I=_.Sf;_.Xt=1/15;Fj={audio:[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/],video:[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]};Fj[_.I]=[/^vtt$/,/^wvtt/,/^stpp/];var Yt;Yt={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av0?1/],text:[/^vtt$/,/^wvtt/,/^stpp/]};_.vl=(a,b)=>{const c=Yt[a];for(let d=0;d<c.length;d++)for(let e=0;e<b.length;e++)if(c[d].test(b[e].trim()))return b[e].trim();return a===_.I?"":null};_.Zt={text:{mp4:_.uc,m4s:_.uc,m4i:_.uc,cmft:_.uc,vtt:_.Tf,ttml:_.Ac},video:{mp4:_.qg,m4s:_.qg,m4f:_.qg,m4i:_.qg,m4v:_.qg,cmfv:_.qg,ts:_.pg},audio:{mp4:_.Gc,m4s:_.Gc,m4f:_.Gc,m4i:_.Gc,m4a:_.Gc,cmfa:_.Gc,ts:_.pg,aac:_.Dc,ec3:_.Fc,ac3:_.Ec},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}};_.yl=(a,b,c)=>a.map(d=>{d=_.Ej(d)||"";return d=(d=_.Zt[b][d])?d:b===_.I?c&&"vtt"!==c?_.uc:_.Tf:null}).filter(Boolean)[0]||null;_.qk=class{constructor(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}toString(){function a(d){return d.name+"\x3d"+(isNaN(Number(d.value))?'"'+d.value+'"':d.value)}let b="#"+this.name;const c=this.attributes?this.attributes.map(a):[];this.value&&c.unshift(this.value);0<c.length&&(b+=":"+c.join(","));return b}getAttribute(a){const b=this.attributes.filter(c=>c.name===a);return b.length?b[0]:null}hasAttribute(a){return null!=this.getAttribute(a)}};
|
|
390
|
+
_.pk=class{constructor(a,b){this.name=a;this.value=b}};var Sj=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
|
|
391
|
+
"cs"],["dan","da"],["deu","de"],[_.Ad,"dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
|
|
396
392
|
"is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao",
|
|
397
393
|
"mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san",
|
|
398
394
|
"sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie",
|
|
399
|
-
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
this.a
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
_.
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
395
|
+
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var Wj=[403,401];_.w("clpp.net.DEFAULT_FATAL_STATUS_CODES",Wj);_.w("clpp.net.makeRequest",_.ck);_.bk=6;_.w("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.bk,CONTENT_STEERING:7});_.w("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.mb,SW_SECURE_DECODE:_.nb,HW_SECURE_CRYPTO:Ga,HW_SECURE_DECODE:Ha,HW_SECURE_ALL:Fa});_.w("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.w("clpp.drm.KeySystem",{NONE:_.Ae,CLEAR_KEY:_.Ke,WIDEVINE:_.td,PLAYREADY:_.rd,FAIRPLAY:_.pd,PRIMETIME:_.od});_.jk={};_.w("clpp.drm.registerDrmEnvironment",_.kk);_.$t=new _.S("clpp.hls.Utils");_.ok=class{constructor(a){this.f=a;this.a=0}};_.au=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.V.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.uk.prototype.resolve=function(){};_.uk.prototype.reject=function(){};var bu=class{constructor(a){this.f=new Uint8Array(a);this.a=0}append(a){const b=this.a+a.byteLength;if(b>this.f.byteLength){const c=this.f;this.f=new Uint8Array(Math.max(2*this.f.byteLength,b));this.f.set(c)}this.f.set(a,this.a);this.a+=a.byteLength}get(){return this.a===this.f.byteLength?this.f.buffer:this.f.buffer.slice(0,this.a)}};var cu=class{constructor(a){this.o=a;this.f=this.a=this.h=0;this.j=null;this.l=-1}};var Ak=class{constructor(){this.a=zk()}};var Gk=class{constructor(a,b){b=void 0===b?!0:b;this.a=new bu(a||1048576);this.f=new cu(this.a);this.j=b;this.h=a}};var du=class{};_.w("clpp.utils.Uint8ArrayUtils",du);du.toStandardBase64=_.Jk;du.concat=_.Pk;du.equal=_.Ok;du.toHex=_.Nk;du.fromHex=_.Mk;du.fromBase64=_.Lk;du.toBase64Url=_.Kk;_.op=class{constructor(a,b){this.V=a;this.B=b;this.a=!1}abort(){this.a=!0;return this.B()}};var $k=class extends _.op{constructor(a,b){super(new _.uk,()=>Promise.resolve());this.C=a;this.j=null;this.w=this.V;this.h=-1;this.f=this.l=this.o=null;this.A=b||null;Uk(this)}then(a,b){this.V=this.V.then(a,b);return this}catch(a){this.V=this.V.catch(a);return this}abort(){if(this.a)return Promise.resolve();this.a=!0;return this.j.then(a=>{this.o&&clearTimeout(this.o);this.l&&this.l();return a.abort()}).catch(()=>{})}};_.Cr=class{constructor(){this.f=[];this.a=[];this.h=[];this.w=!1;this.o=new _.au;this.l={};this.headers=new Map;this.j=0;this.A=null;this.l.data=Rk;Vk(this)}Yi(a){0<a?_.A("Rate limit set to "+a+"bps"):_.A("Rate limit disabled");this.j=a}release(){return this.o.destroy()}destroy(){this.w=!0;this.f=[];this.a=[];this.h=[];return this.o.destroy()}Pf(a){this.f.push(a)}td(a){this.h.push(a)}Sg(a){this.f=this.f.filter(b=>b!==a)}Fe(a){this.h=this.h.filter(b=>b!==a)}fetch(a){let b=void 0;1===a.type&&(b={objectType:eu});
|
|
396
|
+
return _.dl(this,a,b)}};_.w("clpp.net.NetworkEngine",_.Cr);_.Cr.prototype.fetch=_.Cr.prototype.fetch;_.Cr.prototype.removeResponseModifier=_.Cr.prototype.Fe;_.Cr.prototype.removeRequestModifier=_.Cr.prototype.Sg;_.Cr.prototype.addResponseModifier=_.Cr.prototype.td;_.Cr.prototype.addRequestModifier=_.Cr.prototype.Pf;_.Cr.prototype.setRateLimit=_.Cr.prototype.Yi;var hl;
|
|
397
|
+
_.jl=class{constructor(a,b){this.id=a;this.type=b;this.roles=[];this.frameRate=this.label=this.originalLanguage=this.language=this.kind=null;this.trickPlay=!1;this.channelsCount=this.src=this.mimeType=null;this.spatialAudio=!1;this.renditions=[];this.accessibility=[]}Xc(a){return this.type===a.type&&this.channelsCount===a.channelsCount&&this.frameRate===a.frameRate&&this.trickPlay===a.trickPlay&&this.kind===a.kind&&this.label===a.label&&this.language===a.language&&this.mimeType===a.mimeType&&nj(this.roles,
|
|
398
|
+
a.roles)&&nj(this.accessibility,a.accessibility,fl)}toString(){return`Track type: ${this.type} id: ${this.id}
|
|
399
|
+
renditions size: ${this.renditions.length}`}};_.w("clpp.Track",_.jl);_.jl.prototype.toString=_.jl.prototype.toString;_.nl=class{constructor(a,b){this.track=b;this.id=a;this.originalId=this.codec=this.ud=this.bandwidth=this.height=this.width=null;this.a=!1}};_.w("clpp.Rendition",_.nl);_.N=_.t;_.M=_.q;_.L=_.Sf;hl=_.re;_.fu={VIDEO:_.N,AUDIO:_.M,TEXT:_.L,METADATA:hl};_.jl.Type=_.fu;var gu=class{constructor(a){this.f=a;this.g=new _.S("clpp.native.hls.HlsMetadataParser");this.a=tj(this.h.bind(this),(b,c)=>b[0]===c[0]&&b[1].enableHlsVideoTrackInfo===c[1].enableHlsVideoTrackInfo&&b[1].enableMetadata===c[1].enableMetadata)}h(a,b){const c=this;return _.v(function*(){let d=null;try{d=yield ll(c,a)}catch(f){return c.g.warn("Failed to fetch playlist in order metadata from HLS playlist.",f.message),Promise.resolve({})}const e={};try{if(b.enableHlsVideoTrackInfo){const f=yield pl(c,d,
|
|
400
|
+
a);e.renditions=f.renditions;e.mimeType=f.mimeType}}catch(f){c.g.warn("Failed to parse video metadata from HLS playlist.",f.message)}try{const f=yield rl(d);e.Mc=f}catch(f){c.g.warn("Failed to parse metadata from HLS playlist.",f.message)}return e})}};var Al=new Map,zl=1,El=2,Dl=3,Cl=4;var eu="m";_.Jl=[];_.U=class{detach(){}Qe(){return!0}Ph(a){return this.getVideoTracks().find(b=>_.fh(b,a,a&&Object.keys(a)))}Lh(a){return this.getAudioTracks().find(b=>_.fh(b,a,a&&Object.keys(a)))}Nh(a){return this.sa().find(b=>_.fh(b,a,a&&Object.keys(a)))}Oh(a){return this.getVideoTracks().flatMap(b=>b.renditions).find(b=>_.fh(b,a,a&&Object.keys(a)))}Kh(a){return this.getAudioTracks().flatMap(b=>b.renditions).find(b=>_.fh(b,a,a&&Object.keys(a)))}Mh(a){return this.sa().flatMap(b=>b.renditions).find(b=>_.fh(b,a,a&&Object.keys(a)))}};
|
|
401
|
+
_.w("clpp.TrackManager",_.U);_.U.prototype.isAbrEnabled=_.U.prototype.va;_.U.prototype.addTextTrack=_.U.prototype.addTextTrack;_.U.prototype.findTextRendition=_.U.prototype.Mh;_.U.prototype.findAudioRendition=_.U.prototype.Kh;_.U.prototype.findVideoRendition=_.U.prototype.Oh;_.U.prototype.findTextTrack=_.U.prototype.Nh;_.U.prototype.findAudioTrack=_.U.prototype.Lh;_.U.prototype.findVideoTrack=_.U.prototype.Ph;_.U.prototype.setTextRendition=_.U.prototype.Eb;_.U.prototype.setAudioRendition=_.U.prototype.Db;
|
|
402
|
+
_.U.prototype.setVideoRendition=_.U.prototype.rb;_.U.prototype.setTextTrack=_.U.prototype.$a;_.U.prototype.setAudioTrack=_.U.prototype.za;_.U.prototype.setVideoTrack=_.U.prototype.Fb;_.U.prototype.getTextTrack=_.U.prototype.ua;_.U.prototype.getAudioTrack=_.U.prototype.ra;_.U.prototype.getVideoTrack=_.U.prototype.Ha;_.U.prototype.getLoadingTextRendition=_.U.prototype.Ob;_.U.prototype.getLoadingAudioRendition=_.U.prototype.Nb;_.U.prototype.getLoadingVideoRendition=_.U.prototype.wb;
|
|
403
|
+
_.U.prototype.getTextRendition=_.U.prototype.Wa;_.U.prototype.getAudioRendition=_.U.prototype.Pa;_.U.prototype.getVideoRendition=_.U.prototype.ta;_.U.prototype.getTextTracks=_.U.prototype.sa;_.U.prototype.getAudioTracks=_.U.prototype.getAudioTracks;_.U.prototype.getVideoTracks=_.U.prototype.getVideoTracks;_.U.prototype.canSelectVideoTracks=_.U.prototype.Qe;var hu=class extends _.U{constructor(){super();this.g=new _.S("clpp.native.TrackManager");this.m=null;this.f=new _.Et;this.h=[];this.I=0;this.A={};this.C=new Set;this.a=new Map;this.w=null;this.o=new Map;this.B=!0;this.M=this.F.bind(this,_.L);this.R=this.H.bind(this,_.L);this.P=this.G.bind(this,_.L);this.S=this.F.bind(this,_.N);this.W=this.H.bind(this,_.N);this.U=this.G.bind(this,_.N);this.J=this.F.bind(this,_.M);this.L=this.H.bind(this,_.M);this.K=this.G.bind(this,_.M);this.l=null;this.j=new Map}Qe(){return!_.Yh()}detach(){this.j.clear();
|
|
404
|
+
for(const a of this.a){const [b,c]=a;{const d=b;c?this.j.set(d,{language:c.language,kind:c.kind,label:c.label}):d===_.L&&this.j.set(d,null)}}Ml(this);this.m.trigger(new _.H("tracksremoved"))}F(a,b){const c=this;return _.v(function*(){const d=b.track,e=a===_.N;var f=a===_.L;const g=a===_.M||e,h=kl(a,d.id,d),k=Ql(d);if(f){if(d.kind===_.re)return;h.kind&&"captions"===h.kind&&(h.mimeType=_.sc);if(f=c.A[d.id])h.src=f.url,h.mimeType=f.mimeType}else if(f=c.h.find(m=>m.type===a&&_.fh(m,h,["kind","label",
|
|
405
|
+
"language"]))){f.id=d.id;k&&(c.g.debug(`Setting native ${a} track active`),c.a.set(a,f));c.g.debug("Track from event seems to already exists, flipped native track to",d);return}try{h.renditions.push(new _.nl(h.id,h));c.h.push(h);var l=c.m.getConfiguration().safari;Sl(c,a,l)?yield Tl(c,h,l):Ul(c,a,l)&&(yield Vl(c,h,l));c.g.debug(a+" Track added",h);c.m.trigger(new _.H(_.ag));const m=Wl(c,a).length,n=b.target,p=!(!n||!n.length),u=n&&n.length||0;l=()=>{c.g.debug(`Setting native ${a} track active. `+
|
|
406
|
+
`Native track active: ${k}. `+`Number of tracks: ${m}`,d);c.a.set(a,h)};k?l():1===m&&g&&(e?l():p&&1!==u||l())}catch(m){c.g.error("Error while converting track data",m)}})}H(a,b){const c=b.track;a===_.L&&c.kind!==_.re&&(b=this.h.find(d=>d.type===a&&d.id===c.id))&&(this.h.splice(this.h.indexOf(b),1),(this.a.get(a)||null)===b&&(this.a.set(a,null),Xl(this)),this.g.debug(a+" Track removed, id: ",b.id))}G(a,b){this.g.debug(a+" Track changed",b);a===_.L&&Xl(this);const c=Nl(this,a);if(c)for(let d=0;d<c.length;++d)if(Ql(c[d])){if(b=
|
|
407
|
+
this.h.find(e=>e.type===a&&e.id===c[d].id))this.a.set(a,b),this.g.debug("Track change detected, id:",b.id),b===this.o.get(a)&&this.o.set(a,null),a===_.M?this.m.trigger(new _.H(_.Jc)):a===_.L&&this.m.trigger(new _.H(_.Vf));break}}initialize(a){this.m=a;this.l=new gu(a.getNetworkEngine())}load(){this.B=!1;Zl(this);this.f.one(this.m,Qc,()=>{0===this.j.size?am(this):Pl(this)})}release(){const a=this.m.getSurface().getMedia();if(a)for(const b of this.C)a.removeChild(b);this.C.clear();this.B=!0;Ml(this)}destroy(){this.release();
|
|
408
|
+
this.j.clear();this.m=null}getVideoTracks(){return Wl(this,_.N)}getAudioTracks(){return Wl(this,_.M)}sa(){return Wl(this,_.L)}ta(){const a=this.a.get(_.N)||null;if(!a)return null;if(this.w){const b=a.renditions.find(c=>c.width===this.w.width&&c.height===this.w.height);if(b)return b}return a.renditions[0]||null}Pa(){return bm(this,_.M)}Wa(){return bm(this,_.L)}wb(){return cm(this,_.N)}Nb(){return cm(this,_.M)}Ob(){return cm(this,_.L)}Ha(){return this.a.get(_.N)||null}ra(){return this.a.get(_.M)||null}ua(){return this.a.get(_.L)||
|
|
409
|
+
null}Fb(a){Ol(this,_.N,a)}za(a){Ol(this,_.M,a)}$a(a){Ol(this,_.L,a)}rb(a){Ol(this,_.N,a&&a.track)}Db(a){Ol(this,_.M,a&&a.track)}Eb(a){Ol(this,_.L,a&&a.track)}addTextTrack(a){const b=this;return _.v(function*(){if(b.m){var c=b.m.getSurface().getMedia();if(c)if(a.mimeType.match(/text\/vtt/)){const d="External_"+`${b.I++}`;b.A[d]=a;dm(b,a,d,c)}else yield em(b,a,c)}})}va(){return 1>=this.getVideoTracks().flatMap(a=>a.renditions).length}};hu.prototype.isAbrEnabled=hu.prototype.va;
|
|
410
|
+
hu.prototype.addTextTrack=hu.prototype.addTextTrack;hu.prototype.setTextRendition=hu.prototype.Eb;hu.prototype.setAudioRendition=hu.prototype.Db;hu.prototype.setVideoRendition=hu.prototype.rb;hu.prototype.setTextTrack=hu.prototype.$a;hu.prototype.setAudioTrack=hu.prototype.za;hu.prototype.setVideoTrack=hu.prototype.Fb;hu.prototype.getTextTrack=hu.prototype.ua;hu.prototype.getAudioTrack=hu.prototype.ra;hu.prototype.getVideoTrack=hu.prototype.Ha;hu.prototype.getLoadingTextRendition=hu.prototype.Ob;
|
|
411
|
+
hu.prototype.getLoadingAudioRendition=hu.prototype.Nb;hu.prototype.getLoadingVideoRendition=hu.prototype.wb;hu.prototype.getTextRendition=hu.prototype.Wa;hu.prototype.getAudioRendition=hu.prototype.Pa;hu.prototype.getVideoRendition=hu.prototype.ta;hu.prototype.getTextTracks=hu.prototype.sa;hu.prototype.getAudioTracks=hu.prototype.getAudioTracks;hu.prototype.getVideoTracks=hu.prototype.getVideoTracks;hu.prototype.canSelectVideoTracks=hu.prototype.Qe;_.iu=class{constructor(a,b="total"){this.length=(this.f=a)?a.length:0;this.a=[];this.type=b}start(a){if(this.f)return this.f.start(a);if(a<this.a.length)return this.a[a].start;throw Error(sb);}end(a){if(this.f)return this.f.end(a);if(a<this.a.length)return this.a[a].end;throw Error(sb);}Vb(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:1===this.length&&0>this.start(0)?0:this.start(0)}Na(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:this.end(this.length-
|
|
412
|
+
1)}mc(a,b=!0,c=0){if(!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)||a>this.end(this.length-1))return!1;if(b)return c+a>=this.start(0)&&a<=this.end(this.length-1);for(b=0;b<this.length;b++)if(c+a>=this.start(b)&&a<=this.end(b))return!0;return!1}Oa(a,b=!1){if(!this.length||1===this.length&&1E-6>this.end(0)-this.start(0))return 0;let c=0;if(b)b=this.Na(),null!=b&&(c=Math.max(0,b-a));else for(b=this.length-1;0<=b&&this.end(b)>a;--b)c+=this.end(b)-Math.max(this.start(b),a);return c}toString(){let a=
|
|
413
|
+
"";for(let b=0;b<this.length;b++)0<b&&(a+=" "),a+=`${this.start(b).toFixed(3)}-${this.end(b).toFixed(3)}`;return a}};_.w("clpp.BufferInfo",_.iu);_.iu.prototype.bufferedAheadOf=_.iu.prototype.Oa;_.iu.prototype.isBuffered=_.iu.prototype.mc;_.iu.prototype.bufferEnd=_.iu.prototype.Na;_.iu.prototype.bufferStart=_.iu.prototype.Vb;_.iu.prototype.end=_.iu.prototype.end;_.iu.prototype.start=_.iu.prototype.start;var ju=class{constructor(a,b,c,d){this.h=a;this.a=b;this.f=c;this.j=!!d}trigger(a){try{this.a.handleEvent?this.a.handleEvent(a):this.a.call(this.f,a)}catch(b){_.sh("clpp","Uncaught exception in event handler for event '"+this.h+"'",b,b?b.message:null,b?b.stack:null)}}};var ku=class{constructor(a){this.a=new _.Ct;this.f=a}trigger(a){const b=this.a.get(a.type);if(b)for(let c=0;c<b.length&&(a.target=this.f,a.currentTarget=this.f,b[c].trigger(a),b[c].j&&this.a.remove(a.type,b[c]),!a||!a.stopped);c++);}on(a,b,c){this.a.push(a,new ju(a,b,c||this.f));return b}one(a,b,c){this.a.push(a,new ju(a,b,c||this.f,!0));return b}off(a,b){const c=this.a.get(a);let d=!1;if(c)for(let e=0;e<c.length;e++)c[e].a===b&&(d=this.a.remove(a,c[e])||d);return d}clear(){this.a.clear()}};_.lu=class{constructor(){this.Cd=new ku(this);this.yd=[]}addEventListener(a,b){this.on(a,b)}removeEventListener(a,b){this.off(a,b)}on(a,b,c){return this.Cd.on(a,b,c)}one(a,b,c){return this.Cd.one(a,b,c)}off(a,b){return this.Cd.off(a,b)}forwardEventsTo(a){a&&(0<=this.yd.indexOf(a)||this.yd.push(a))}dispatchEvent(a){this.trigger(a);return a.defaultPrevented}stopForwardingEventsTo(a){a&&(a=this.yd.indexOf(a),0<=a&&this.yd.splice(a,1))}trigger(a){this.Cd.trigger(a);for(const b of this.yd)b.dispatchEvent(a)}};
|
|
414
|
+
_.lu.prototype.off=_.lu.prototype.off;_.lu.prototype.one=_.lu.prototype.one;_.lu.prototype.on=_.lu.prototype.on;_.lu.prototype.removeEventListener=_.lu.prototype.removeEventListener;_.lu.prototype.addEventListener=_.lu.prototype.addEventListener;var gm=["play() failed because the user didn't interact","The play method is not allowed by the user agent","The request is not allowed by the user agent or the platform"];_.w("clpp.version",_.ea);_.w("clpp.name",_.sa);var Br=null;_.w("clpp.configure",a=>{Br=a});_.fm="application/x-mpegurl";_.w("clpp.Type",{DASH:_.tc,HLS:_.fm,SMOOTH_STREAMING:_.Bc,MP4:_.qg,MP3:"audio/mp3"});_.bj="scte35";_.cj="hls-daterange";_.w("clpp.TimelineCueType",{SCTE35:_.bj,DASH_CALLBACK:_.we,HLS_DATERANGE:_.cj,UNKNOWN:_.fg});_.w("clpp.SpeedUpMode",{DECODER:_.xd,SEEK:"seek"});_.w("clpp.CodecSwitchingStrategy",{PREVENT:_.lf,SMOOTH:_.Hf});var mu=class{};_.w("clpp.utils.PlayerConfiguration",mu);mu.create=function(...a){return _.nm(a,{Ri:!1})};mu.build=_.nm;var nu=["abort",Pc,Qc,Nd,"emptied",Pd,_.Rd,_.Sd,"interruptbegin","interruptend",_.ke,_.le,me,"mozaudioavailable",_.Me,_.Qe,_.bf,_.nf,_.qf,_.Bf,_.Cf,If,"suspend",_.$f,"volumechange",_.zg,_.Ag,_.vf,Fg,Eg,Cg,Dg],Pi=2,Qi=2;_.ou=class extends _.lu{constructor(a){super();this.log=new _.S(a);this.configuration=this.ja=_.lm();this.ia=this.C=null;this.Jb=this.qf=!1;this.Of=new _.S("clpp.video.events");this.vc=null;this.fd=-1;this.ph=this.mh.bind(this);this.Ub=new _.Cr;this.setNetworkEngine(this.Ub);this.L=new _.Et;this.pf=this.Rc=this.Wc=this.P=null}init(a,b){this.configuration=this.ja=b;this.C=a;this.log.info("Initializing Player surface");a=this.C.getMedia();this.log.info("Attaching media element listeners");for(const c of nu)this.L.on(a,
|
|
415
|
+
c,this.ph,c!==_.Sd);this.vc||(this.vc=this.dh());this.vc.initialize(this);this.C.showMediaElement()}release(){const a=this;return _.v(function*(){a.P&&(a.P.destroy(),a.P=null)})}destroy(){this.L.release();return this.Ub.release()}canPlay(a,b){return _.th[this.namespace()].canPlay(a,b)}getTimeline(){return null}setupPlaylist(){return _.v(function*(){throw new _.vj(_.Ya);})}appendLoad(){return _.v(function*(){throw new _.vj(_.Ya);})}seekWith(){return _.v(function*(){throw new _.vj(_.Ya);})}detach(){return _.v(function*(){})}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}play(){const a=
|
|
416
|
+
this;return _.v(function*(){if(!a.ia)throw new _.J(_.C,7,7003,"No sources specified yet. You need to load content before calling play.");try{yield a.C.getMedia().play()}catch(b){a.log.info("Caught play promise exception",b);const c={name:b.name||"",message:b.message||"",stack:b.stack||""};hm(c)?(a.trigger(new _.H(_.Kc)),a.log.warn(_.la)):c.name===Za&&a.log.warn('Unrecognized "NotAllowedError" on play(). '+`${b.name}: ${b.message}`);throw b;}})}pause(){const a=this;return _.v(function*(){if(!a.ia)throw new _.J(_.C,
|
|
417
|
+
7,3201,"No sources specified yet. You need to load content before calling pause.");const b=a.getState();if(6!==b&&11!==b&&8!==b&&10!==b)throw new _.J(_.C,7,3201,"The player state does not allow pause.");a.C.getMedia().pause();8===a.getState()&&(yield new Promise(c=>{a.L.one(a,_.af,()=>{c()})}))})}isPaused(){return this.C.getMedia().paused}isEnded(){return this.C.getMedia().ended}getConfiguration(){return this.configuration}setDrmCustomDataModifier(a){this.Wc=a}setCdnErrorCallback(a){this.Rc=a}Zc(){return this.Wc}getSurface(){return this.C}getBufferInfo(a){const b=
|
|
418
|
+
this.getSurface().getMedia();return new _.iu(b?b.buffered:void 0,a)}getPosition(){return this.getMediaPosition()}getMediaPosition(){const a=this.C.getMedia();if(a)return a.currentTime;this.log.warn("No media element available, can not report current time!");return 0}seek(a){const b=this;return _.v(function*(){const c=b.getMediaPosition();if(null!=a&&typeof a===_.r&&a!==c){var d=b.C.getMedia();if(!d)throw new _.vj("No media element available, can not set current time!");var e=a-c;.1>=Math.abs(e)?b.log.info(`Skip seek. Delta ${Math.abs(e)} < ${.1}`):
|
|
419
|
+
(yield pm(b,d),yield qm(b,d,a,e,c))}})}getVolume(){const a=this.C.getMedia();if(a)return a.volume;this.log.warn("No media element available, can not report volume!");return null}setVolume(a){const b=this.C.getMedia();b?_.eh(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
|
|
420
|
+
Value must be between 0 and 1.`):b.volume=a:this.log.warn("Can not set volume to "+a+". Volume must be a number"):this.log.warn("No media element available, can not set volume !")}isMuted(){return this.C.getMedia().muted}setMuted(a){const b=this.C.getMedia();typeof a===_.Mc&&(b.muted=a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.ia?this.C.getMedia().duration:-1}getTrackManager(){return this.vc}getPlaybackRate(){const a=this.C.getMedia();return a&&a.playbackRate||
|
|
421
|
+
1}setPlaybackRate(a){const b=this.C.getMedia();void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.fd=a}getSourceIndex(){return this.fd}getLoadedSource(){return this.ia&&-1!==this.fd?this.ia[this.fd]:null}getPeriods(){return[]}getNetworkEngine(){return this.Ub}setNetworkEngine(a){this.Ub=a;Xk(this.Ub,b=>{this.onError(b)})}setCmsdManager(a){this.pf=a}getTextDisplayer(){return this.P}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){}mh(a){var b=this.getSurface().getMedia();const c=
|
|
422
|
+
this.getPosition();let d="Received Video Element Event: '"+a.type+"' with playhead at: "+c;if(a.type===_.$f||a.type===_.nf)this.Of.debug(d);else{let e="";switch(a.type){case _.qf:e=`Rate: ${this.getPlaybackRate()}`;break;case Nd:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.Qe:case _.bf:case "suspend":case _.zg:case If:case _.Cf:case _.Bf:case _.$f:case _.nf:case Pc:case Qc:b=this.getBufferInfo().Oa(c);e=`State ${this.getSurface().getMedia().readyState} `+
|
|
423
|
+
`Buffer: ${b}`;break;case _.vf:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=". "+e);this.Of.info(d)}a.type!==_.Sd&&this.trigger(new _.H(a.type,{detail:a}))}Nf(){}};var tm;tm=new _.S("clpp.Components");_.rm=new Map;_.w("clpp.install",function(a){Bm(a)});_.w("clpp.uninstall",function(a){Fm(a)});var pu=class{constructor(){this.a=this.f=null;this.g=new _.S("clpp.drm.csl")}release(){this.a=this.f=null}};var on={V1_STAGING:[10,191,2,8,3,18,16,40,112,52,84,192,8,246,54,24,173,231,68,61,182,196,200,24,139,231,249,144,5,34,142,2,48,130,1,10,2,130,1,1,0,181,33,18,184,208,93,2,63,204,93,149,226,194,81,193,198,73,180,23,124,216,210,190,239,53,91,176,103,67,222,102,30,61,42,188,49,130,183,153,70,213,95,220,8,223,233,84,7,129,94,154,98,116,179,34,162,199,245,224,103,187,95,10,192,122,137,212,90,234,148,178,81,111,7,91,102,239,129,29,13,38,225,185,166,184,148,242,185,133,121,98,170,23,28,79,102,99,13,62,76,
|
|
425
424
|
96,39,24,137,127,94,30,249,182,170,245,173,77,186,42,126,20,23,109,241,52,161,211,24,91,90,33,138,192,90,76,65,240,129,239,255,128,163,160,64,197,11,9,187,199,64,238,220,216,241,77,103,90,145,152,15,146,202,125,220,100,106,6,173,173,81,1,247,74,14,73,140,192,31,0,83,43,172,33,120,80,189,144,94,144,146,54,86,183,223,239,239,66,72,103,103,243,62,246,40,61,79,66,84,171,114,88,147,144,190,229,88,8,241,214,104,8,13,69,216,147,194,188,162,247,77,96,160,192,208,160,153,60,239,1,96,71,3,51,76,54,56,19,148,
|
|
426
425
|
134,188,157,175,36,253,103,160,127,154,217,67,2,3,1,0,1,58,18,115,116,97,103,105,110,103,46,103,111,111,103,108,101,46,99,111,109,18,128,3,152,62,48,53,38,117,244,11,167,21,252,36,155,218,229,212,172,114,73,162,102,101,33,228,54,85,115,149,41,114,31,248,128,224,170,239,197,226,123,201,128,218,234,218,191,63,195,134,208,132,160,44,130,83,120,72,204,117,63,244,151,176,17,167,218,151,120,138,0,226,170,107,132,205,125,113,192,122,72,235,246,22,2,204,165,163,243,32,48,167,41,92,48,218,145,91,145,220,24,
|
|
427
426
|
185,188,149,147,184,222,139,181,15,13,237,193,41,56,184,233,224,57,205,222,24,250,130,232,27,176,50,99,15,233,85,216,90,86,108,225,84,48,11,246,212,193,189,18,105,102,53,107,40,125,101,123,24,206,99,208,239,212,95,197,38,158,151,234,177,28,181,99,229,86,67,178,111,244,159,16,156,33,1,175,202,243,91,131,47,40,143,13,157,69,150,14,37,158,133,251,93,36,219,210,207,130,118,76,93,217,191,114,126,251,233,200,97,248,105,50,31,106,222,24,144,95,77,146,249,166,218,101,54,219,132,117,135,29,22,142,135,11,178,
|
|
@@ -435,99 +434,108 @@ _.hr=class{constructor(a,b){this.name=a;this.value=b}};var xu=class{constructor(
|
|
|
435
434
|
21,58,231,13,118,215,58,166,74,44,51,103,50,120,198,197,213,64,34,105,66,115,72,235,88,51,28,238,54,93,147,140,187,28,173,50,109,5,234,155,141,29,52,234,135,38,55,103,111,116,98,171,210,13,211,129,249,70,57,64,155,151,38,8,225,188,229,3,247,234,26,46,91,211,250,252,38,87,111,205,37,108,74,168,112,74,116,191,73,170,243,167,54,36,20,23,72,67,35,181,159,241,102,250,221,22,18,92,161,54,236,172,183,214,18,160,199,92,46,171,180,211,90,64,62,144,121,201,77,74,211,17,244,49,124,244,120,116,148,234,184,79,
|
|
436
435
|
136,12,176,34,231,39,149,87,28,219,2,3,1,0,1,58,12,99,97,115,116,108,97,98,115,46,99,111,109,64,1,18,128,3,50,97,151,165,120,63,210,172,84,187,10,36,166,202,149,32,118,107,37,251,186,217,170,254,4,95,20,85,66,157,43,154,24,66,136,147,101,223,78,204,173,228,175,111,100,168,97,164,222,84,160,51,79,233,227,223,105,252,85,11,242,129,199,206,11,9,236,118,163,118,204,179,159,69,108,223,229,114,176,8,26,36,9,23,103,233,62,55,162,154,209,96,98,102,80,173,114,233,213,36,56,135,65,188,245,176,95,70,189,199,
|
|
437
436
|
143,81,72,182,124,207,225,238,28,172,144,110,89,44,12,137,51,52,239,130,117,119,15,207,200,229,142,166,8,80,79,111,255,191,70,47,189,108,75,234,184,241,119,21,255,98,167,124,132,30,239,102,113,7,132,96,39,134,123,220,209,255,110,222,35,147,0,77,125,253,129,139,66,158,126,221,13,117,113,163,143,235,9,130,180,3,133,94,152,45,199,69,168,182,95,122,82,25,203,10,99,191,186,193,238,225,224,140,156,142,171,110,26,214,32,240,6,218,138,10,47,114,133,17,1,151,43,213,223,198,210,186,81,18,50,221,84,177,180,
|
|
438
|
-
26,58,164,235,113,177,235,207,22,230,8,119,76,167,166,176,173,209,214,53,116,116,231,227,221,238,174,87,249,19,166,195,81,47,210,172,15,75,251,202,192,80,85,213,23,17,178,104,181,193,115,239,91,72,230,167,55,143,10,250,26,54,8,60,13,213,206,235,3,215,179,205,232,1,144,158,35,48,196,149,117,219,63,196,130,117,40,165,193,65,215,122,44,201,218,67,216,6,131,178,5,168,229,21,137,112,215,254,127,48,160,181,68,49,255,64,46,247,236,85,155,146,208,5,219,252,37,174,31,218,136,135,55,119,112]};_.
|
|
439
|
-
_.w("clpp.utils.dataview.DataViewReader",_.
|
|
440
|
-
this.f[f];if(h){let m=null;var k=null;this.h[f]===
|
|
441
|
-
_.
|
|
442
|
-
|
|
443
|
-
_.
|
|
444
|
-
persistentState:_.
|
|
445
|
-
e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.
|
|
446
|
-
void 0===a?
|
|
447
|
-
b){if(this.l)return Promise.reject(
|
|
448
|
-
d);this.f&&(
|
|
449
|
-
this.h=null;else if(null!==this.f)this.f.reject(d),this.f=null;else switch(this.a.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:
|
|
450
|
-
this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.
|
|
451
|
-
|
|
452
|
-
new
|
|
453
|
-
(f.push(k),e=!0));h||(e=b.canPlayType(_.
|
|
454
|
-
|
|
455
|
-
new
|
|
456
|
-
this.closed;const a=
|
|
457
|
-
b||0<d.getElementsByTagName("parsererror").length?null:a}removeChild(a,b){a.removeChild(b)}};_.
|
|
458
|
-
a.reader.getPosition()!==a.reader.
|
|
459
|
-
_.
|
|
460
|
-
this.A=this.F=!1;this.P=null}destroy(){const a=this;return _.v(function*(){a.j?yield a.da:(a.j=!0,yield
|
|
461
|
-
_.
|
|
462
|
-
this.o.set(f,e);c&&!c.keyId&&this.h.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.
|
|
463
|
-
a)&&c&&!c.
|
|
464
|
-
_.
|
|
465
|
-
a.
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
(this.
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
437
|
+
26,58,164,235,113,177,235,207,22,230,8,119,76,167,166,176,173,209,214,53,116,116,231,227,221,238,174,87,249,19,166,195,81,47,210,172,15,75,251,202,192,80,85,213,23,17,178,104,181,193,115,239,91,72,230,167,55,143,10,250,26,54,8,60,13,213,206,235,3,215,179,205,232,1,144,158,35,48,196,149,117,219,63,196,130,117,40,165,193,65,215,122,44,201,218,67,216,6,131,178,5,168,229,21,137,112,215,254,127,48,160,181,68,49,255,64,46,247,236,85,155,146,208,5,219,252,37,174,31,218,136,135,55,119,112]};_.cn=class{constructor(a,b){b=void 0===b?!1:b;this.f=_.eh(a)?new DataView(new ArrayBuffer(a),0,a):a;this.a=0;this.h=b;this.buffer=this.f.buffer}getPosition(){return this.a}Sa(){return this.f.byteLength}seek(a){(0>a||a>=this.f.byteLength)&&_.Im();this.a=a}};_.Hn=class{constructor(a,b){this.f=a;this.h=void 0===b?!0:b;this.a=0}getPosition(){return this.a}Sa(){return this.f.byteLength}skip(a){this.a+a>this.f.byteLength&&_.Lm();this.a+=a}seek(a){if(0>a||a>=this.f.byteLength)throw _.Lm();this.a=a}};
|
|
438
|
+
_.w("clpp.utils.dataview.DataViewReader",_.Hn);_.an=class{constructor(){this.h=[];this.f=[];this.a=!1;this.g=new _.S("clpp.mp4")}N(a,b){a=Sm(a);this.h[a]=qu;this.f[a]=b;return this}fa(a,b){a=Sm(a);this.h[a]=ru;this.f[a]=b;return this}stop(){this.a=!0}parse(a,b){a=_.E(a);a=new _.Hn(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);for(this.a=!1;_.Km(a)&&!this.a;)this.Ce(0,a,b)}Ce(a,b,c){const d=b.getPosition();let e=_.P(b);var f=_.P(b);let g=!1;this.g.debug("Parsing MP4 box",_.Tm(f));switch(e){case 0:e=b.Sa()-d;break;case 1:e=_.Pm(b),g=!0}const h=
|
|
439
|
+
this.f[f];if(h){let m=null;var k=null;this.h[f]===ru&&(k=_.P(b),m=k>>>24,k&=16777215);f=b.getPosition()-d;var l=d+e;c&&l>b.Sa()&&(l=b.Sa());l-=b.getPosition();b=0<l?_.Rm(b,l):new Uint8Array(0);b=new _.Hn(new DataView(b.buffer,b.byteOffset,b.byteLength),!1);h({parser:this,partialOkay:c||!1,version:m,flags:k,reader:b,size:e,start:d+a,headerSize:f,has64BitSize:g})}else a=Math.min(d+e-b.getPosition(),b.Sa()-b.getPosition()),b.skip(a)}};_.w("clpp.utils.Mp4Parser",_.an);_.an.typeToString=_.Tm;
|
|
440
|
+
_.an.allData=_.Wm;_.an.sampleDescription=_.Vm;_.an.children=_.Um;_.an.prototype.parseNext=_.an.prototype.Ce;_.an.prototype.parse=_.an.prototype.parse;_.an.prototype.stop=_.an.prototype.stop;_.an.prototype.fullBox=_.an.prototype.fa;_.an.prototype.box=_.an.prototype.N;_.an.headerSize=_.Xm;var qu=0,ru=1;var su=class{};_.w("clpp.utils.FairplayUtils",su);su.parseFairPlayResponse=_.fn;su.formatFairPlayRequest=_.en;su.createFairplayPayload=dn;su.extractContentId=_.$m;su.extractExtXKeyUri=Ym;var tu,uu,vu,wu,kn;tu=[Fa,Ha,Ga,_.nb,_.mb];uu=[Fa,Ha,Ga,_.nb,_.mb];vu=["3000","2000","150"];wu=["2000","150"];
|
|
441
|
+
kn={1001:"Internal Error",1002:"External Error",10001:"Bad request",10002:"Request read failed",10003:"Content keys not found",10101:"Request denied",10201:"Missing config",10202:"Feature disabled",20001:"Authtoken invalid",20002:"Authtoken expired",20003:"Auth callback failed",20101:"Auth denied",40001:"Device revoked (override possible)",40002:"Device permanently revoked",40003:"Invalid service certificate (unmapped)",40004:"Persistence forbidden",60001:"CSL Invalid",60100:"CSL Denied",70100:"GBL Denied"};
|
|
442
|
+
_.mn=new _.S("clpp.drm.DrmTodayUtils");_.xu=class{constructor(a){this.f=a;this.a=void 0}value(){void 0===this.a&&(this.a=this.f());return this.a}};var zu=class{constructor(){this.size=0;this.a=void 0;this.g=new _.S("clpp.drm.eme.MediaKeyStatusMap")}getStatus(){return this.a}forEach(a){this.a&&a(this.a,yu.value())}get(a){if(this.has(a))return this.a}has(a){const b=yu.value();return this.a&&ni(a,b)?!0:!1}entries(){}keys(){}values(){}},yu=new _.xu(()=>ti(new Uint8Array([0])));var rn=new _.xu(()=>new Map([[HTMLMediaElement.HAVE_METADATA,_.le],[HTMLMediaElement.HAVE_CURRENT_DATA,_.ke],[HTMLMediaElement.HAVE_FUTURE_DATA,Pc],[HTMLMediaElement.HAVE_ENOUGH_DATA,Qc]]));_.w("clpp.drm.eme.EmeFactory.Apis",{STANDARD:lb,APPLE:fa,WEBKIT:"WEBKIT",NOP:"NOP"});var Bu=class{constructor(){this.j=this.w=null}l(a){this.w=a}h(a){const b=this.j;b&&b!==a&&tn(b,null);return(this.j=a)?tn(a,this.w):Promise.resolve()}o(){return this.j}a(a,b){_.rh("AppleEmeManager.requestMediaKeySystemAccess");try{const c=new Au(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}f(){return fa}},Au=class{constructor(a,b){this.keySystem=a;if(a.startsWith(_.pd))for(var c of b){a:{a=c;if(a.persistentState===_.uf){a=null;break a}b={audioCapabilities:[],videoCapabilities:[],
|
|
443
|
+
persistentState:_.Je,distinctiveIdentifier:_.Je,initDataTypes:a.initDataTypes,sessionTypes:[Rf],label:a.label};let d=!1,e=!1;if(a.audioCapabilities)for(const f of a.audioCapabilities)f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.audioCapabilities.push(f),e=!0));if(a.videoCapabilities)for(const f of a.videoCapabilities)f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.videoCapabilities.push(f),
|
|
444
|
+
e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.qg));a=e?b:null}if(a){this.a=a;return}}c=Error(zb);c.name=$a;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new Cu(this.keySystem);return Promise.resolve(a)}getConfiguration(){_.rh("AppleEmeManager.MediaKeySystemAccess.getConfiguration");return this.a}},Cu=class{constructor(a){this.f=null;this.h=new WebKitMediaKeys(a);this.a=new _.Et;this.j=0;this.g=new _.S(id);this.g.info("Created Media Keys for "+a)}createSession(a){a=
|
|
445
|
+
void 0===a?Rf:a;this.g.debug("Creating Apple MediaKeys Session");if(a!==Rf)throw new TypeError("Session type "+a+ba);return new Du(this.h,`__session_${this.j++}`)}setServerCertificate(){this.g.debug("AppleEmeManager.MediaKeys.setServerCertificate");return Promise.resolve(!1)}},Du=class extends _.lu{constructor(a,b){super();this.a=null;this.o=a;this.f=this.h=null;this.j=new _.Et;this.sessionId=b;this.expiration=NaN;this.closed=new _.uk;this.l=!1;this.keyStatuses=new zu;this.g=new _.S(id)}generateRequest(a,
|
|
446
|
+
b){if(this.l)return Promise.reject(ob);this.g.debug("generateRequest");this.h=new _.uk;try{const c=this.o.createSession(_.qg,_.E(b));this.a=c;this.sessionId=c.sessionId||this.sessionId||"";this.j.on(c,Eg,d=>{{const e=this.keyStatuses.getStatus();this.g.debug(`Received Key Message in ${this.sessionId}`);this.h&&(this.h.resolve(),this.h=null);d=new _.H(_.qe,{messageType:void 0===e||e===Lf?fe:ee,message:ti(d.message.buffer)});this.dispatchEvent(d)}});this.j.on(c,Cg,d=>{this.g.debug("onWebkitKeyAdded_",
|
|
447
|
+
d);this.f&&(un(this,"usable"),this.f.resolve(),this.f=null)});this.j.on(c,Dg,()=>{var d=this.keyStatuses.getStatus();if(this.a&&this.a&&this.a.error&&this.a.error.code===WebKitMediaKeyError.MEDIA_KEYERR_DOMAIN&&d===Lf)this.g.warn(`Ignoring webkit key error for session ${this.sessionId}`);else if(this.g.error(`Received key error in session ${this.sessionId} `+`with code ${this.a.error.code}. `+`Session Status ${d}.`),d=Error("EME AppleEmeManager key error"),d.errorCode=this.a.error,null!==this.h)this.h.reject(d),
|
|
448
|
+
this.h=null;else if(null!==this.f)this.f.reject(d),this.f=null;else switch(this.a.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:un(this,"output-not-allowed");break;default:un(this,_.be)}});un(this,Lf)}catch(c){this.h.reject(c)}return this.h}load(){this.g.debug(_.je);return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){if(this.l)return Promise.reject(ob);this.g.debug(gg);this.f=new _.uk;try{this.a.update(_.E(a))}catch(b){this.f.reject(b)}return this.f}close(){if(this.l)return this.closed;
|
|
449
|
+
this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.Fh(this.j)}catch(a){this.closed.reject(a)}return this.closed}remove(){this.g.debug("remove");return Promise.reject(Error("MediaKeySession is only applicable for persistent licenses, which are not supported on this platform"))}},Eu=class{a(){return fa}f(){return!!window.WebKitMediaKeys}create(){return new Bu}};var Fu=class{constructor(){this.j=null;this.g=new _.S("clpp.drm.eme.StandardEmeManager")}l(a){this.j=a}h(a){return this.j?this.j.setMediaKeys(a):Promise.reject(Ra)}o(){return this.j&&this.j.mediaKeys}a(a,b){this.g.info("Requesting media key system access for",a,b.map(c=>Object.assign({},c,{drmInfos:c.drmInfos.map(()=>"_anonymous_")})));return navigator.requestMediaKeySystemAccess(a,b).catch(c=>{this.g.info("Failed to request media key system access for "+`${a}.`,c);return Promise.reject(c)})}f(){return lb}},
|
|
450
|
+
Gu=class{a(){return lb}f(){return!!(window.MediaKeys&&navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)}create(){return new Fu}};var Iu=class{constructor(){this.w=this.j=null;this.A="";HTMLMediaElement.prototype.webkitGenerateKeyRequest&&(this.A="webkit")}l(a){this.j=a}h(a){_.rh("WebkitEmeManager.setMediaKeys");if(!this.j)return Promise.reject(Ra);const b=this.w;b&&b!==a&&xn(b,null);(this.w=a)&&xn(a,this.j);return Promise.resolve()}o(){return this.w}a(a,b){_.rh("WebkitEmeManager.requestMediaKeySystemAccess");try{if(this.j)var c=this.j;else{var d=document.getElementsByTagName(_.t);c=d.length?d[0]:document.createElement(_.t)}const e=
|
|
451
|
+
new Hu(this.A,c,a,b);return Promise.resolve(e)}catch(e){return Promise.reject(e)}}f(){return"WEBKIT"}},Hu=class{constructor(a,b,c,d){this.h=a;this.a=this.keySystem=c;a=!1;c===_.Ke&&(this.a=Bg,a=!1);let e=!1;for(const g of d){d=[];var f=[];let h=!1;if(g.audioCapabilities)for(const k of g.audioCapabilities)k.contentType&&(h=!0,b.canPlayType(k.contentType.split(";")[0],this.a)&&(d.push(k),e=!0));if(g.videoCapabilities)for(const k of g.videoCapabilities)k.contentType&&(h=!0,b.canPlayType(k.contentType,
|
|
452
|
+
this.a)&&(f.push(k),e=!0));h||(e=b.canPlayType(_.qg,this.a)||b.canPlayType("video/webm",this.a));g.persistentState!==_.uf||a||(e=!1);if(e){this.f=g;return}}b=zb;if(c===_.Ke||c===_.td)b="None of the requested configurations were supported.";c=Error(b);c.name=$a;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){return Promise.resolve(new Ju(this.h,this.a))}getConfiguration(){return this.f}},Ju=class{constructor(a,b){this.h=a;this.o=b;this.a=null;this.f=new _.Et;this.j=[];this.l=new Map}createSession(a=
|
|
453
|
+
Rf){if(a!==Rf&&a!==_.Oe)throw new TypeError("Session type "+a+ba);if(!this.a)throw a=Error("Media element is missing."),a.name=Ja,a.code=DOMException.INVALID_STATE_ERR,a;this.a.src||(this.a.src="about:blank");a=new Ku(this.h,this.a,this.o,a);this.j.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}},Ku=class extends _.lu{constructor(a,b,c,d){super();this.w=a;this.j=b;this.o=!1;this.a=this.f=null;this.h=c;this.l=d;this.sessionId="";this.expiration=NaN;this.closed=new _.uk;this.keyStatuses=
|
|
454
|
+
new zu}ready(){_.rh("WebkitEmeManager.MediaKeySession.ready");wn(this,"usable");this.a&&this.a.resolve();this.a=null}generateRequest(a,b){_.rh("WebkitEmeManager.MediaKeySession.generateRequest");return zn(this,b,null)}load(a){_.rh(Fb);return this.l===_.Oe?zn(this,null,a):Promise.reject(Error(Wa))}update(a){_.rh(Fb);const b=new _.uk;An(this,b,a);return b}close(){_.rh("WebkitEmeManager.MediaKeySession.close");if(this.l!==_.Oe){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),
|
|
455
|
+
this.closed;const a=yn(this,"cancelKeyRequest");try{this.j[a](this.h,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){_.rh("WebkitEmeManager.MediaKeySession.remove");return this.l!==_.Oe?Promise.reject(Error(Wa)):this.close()}},Lu=class{a(){return"WEBKIT"}f(){return!(!HTMLMediaElement.prototype.webkitGenerateKeyRequest&&!HTMLMediaElement.prototype.generateKeyRequest)}create(){return new Iu}};var Mu=class{l(){}h(a){_.rh("NopEmeManager.setMediaKeys");return null===a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}o(){return null}a(){_.rh("NopEmeManager.requestMediaKeySystemAccess");return Promise.reject(Error("The key system specified is not supported."))}f(){return"NOP"}},Nu=class{a(){return"NOP"}f(){return!0}create(){return new Mu}};var Cn=new _.S("clpp.drm.EmeFactory"),Bn=[];_.Ou=class{h(a,b){a=this.a(a,b);return 1!==a.length?null:a[0]}a(a,b){return Array.from(a.childNodes).filter(c=>c instanceof Element&&c.tagName===b)}getAttributeNS(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null}f(a){return Array.from(a.childNodes).every(b=>b.nodeType===Node.TEXT_NODE||b.nodeType===Node.CDATA_SECTION_NODE)?a.textContent.trim():null}j(a,b){const c=new DOMParser;let d=null;try{d=c.parseFromString(a,_.Uf)}catch(e){}if(!d)return null;a=d.documentElement;return b&&a.tagName!==
|
|
456
|
+
b||0<d.getElementsByTagName("parsererror").length?null:a}removeChild(a,b){a.removeChild(b)}};_.Mg=_.Ou.prototype;_.Mg.Zd=_.Og(19);_.Mg.Ee=_.Og(17);_.Mg.te=_.Og(15);_.Mg.ue=_.Og(13);_.Mg.De=_.Og(11);_.Mg.Sc=_.Og(9);_.Mg.pe=_.Og(7);_.Mg.aa=_.Og(5);_.Mg.Cc=_.Og(3);_.Mg.Wb=_.Og(1);_.Kn=new _.Ou;_.Pu=new _.S("clpp.xml.Parser");_.km="dom";var Fn,Qu,En;_.On=[154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149];Fn=[237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237];Qu=class{constructor(a,b,c){this.j=new Uint8Array(a);this.a=b;this.f=c}};En=class extends Qu{};_.Nn=class extends Qu{constructor(a,b,c,d,e,f){f=void 0===f?null:f;super(a,b,d);this.version=e;this.h=c;this.l=f}};var Qn=!!(performance&&performance.mark&&performance.measure),Sn=new _.S("clpp.perf");var vo=class{constructor(a){this.f=[];this.h=[];this.a=[];8<=a.byteLength&&(new _.an).fa("pssh",this.j.bind(this)).parse(a.buffer);0===this.a.length&&_.A("No pssh box found!")}j(a){if(1<a.version)_.A("Unrecognized PSSH version found!");else{var b=_.Nk(_.Rm(a.reader,16)),c=[];if(0<a.version){var d=_.P(a.reader);for(let e=0;e<d;++e){const f=_.Nk(_.Rm(a.reader,16));c.push(f)}}d=_.P(a.reader);a.reader.skip(d);this.h.push.apply(this.h,c);this.f.push(b);this.a.push({start:a.start,end:a.start+a.size-1});
|
|
457
|
+
a.reader.getPosition()!==a.reader.Sa()&&_.A("Mismatch between box size and data size!")}}};var qo,Ru;
|
|
458
|
+
_.kp=class{constructor(a,b){this.D=a;this.lb=b;this.J=new Set;this.C=this.I=this.l=null;this.S=!1;this.a=null;this.K=Ru;this.B=new _.Et;this.M=new pu;this.h=new Map;this.L=[];this.H=new _.uk;this.Aa=0;this.f=null;this.w=c=>{this.A=!0;this.F=!1;this.H.reject(c);a.onError(c)};this.o=new Map;this.Z=new Map;this.U=new _.Jh(()=>ho(this));this.j=!1;this.da=new _.uk;this.G=!1;this.W=[];this.ja=!1;this.R=0;this.g=new _.S("clpp.drm.DrmEngine");this.ca=(new _.Jh(()=>{io(this)})).Gb(1);this.H.catch(()=>{});
|
|
459
|
+
this.A=this.F=!1;this.P=null}destroy(){const a=this;return _.v(function*(){a.j?yield a.da:(a.j=!0,yield jo(a),a.da.resolve())})}keySystem(){return this.a?_.Wn(this.a.keySystem):""}getDrmInfo(){return this.a}cb(a){const b=this;return _.v(function*(){b.G&&b.K===qo||(!b.f.delayLicenseRequestUntilPlayed||b.C&&!b.C.paused||b.ja?yield Ao(b,a):b.W.push(a))})}bb(a){const b=a.target;this.g.info("Key status changed for session",b.sessionId);const c=this.h.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f===
|
|
460
|
+
_.Nf){var g=f;f=e;e=g}if(Vn(this.a.keySystem)&&16===f.byteLength&&_.Lh()){g=_.si(f);const k=g.getUint32(0,!0),l=g.getUint16(4,!0),m=g.getUint16(6,!0);g.setUint32(0,k,!1);g.setUint16(4,l,!1);g.setUint16(6,m,!1)}c&&e!==Lf&&(c.loaded=!0);c&&c.qb&&c.qb.resolve();"expired"===e&&(d=!0);f=_.E(f);let h=_.Nk(f);"00"===h&&c&&c.keyId?h=c.keyId:this.a.keySystem.startsWith(_.pd)&&16!==f.byteLength&&(h=ui(f));(f=h||"")?this.g.info(`Key status for Key ID '${h}': ${e}`):this.g.info(`Key status global keys: ${e}`);
|
|
461
|
+
this.o.set(f,e);c&&!c.keyId&&this.h.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.ub.forEach(e=>{this.o.get(e)===Lf&&(this.g.warn(`Key status for Key ID '${e}': 'output-restricted'`),this.o.set(e,_.Le))});for(a=0;a<this.a.initData.length;a++){const e=this.a.initData[a];e.keyId&&this.o.get(e.keyId)===Lf&&_.Ok(e.initData,c.initData)&&(this.g.warn(`Key status for Key ID '${e.keyId}': 'output-restricted'`),this.o.set(e.keyId,_.Le))}a=b.expiration-Date.now();(0>a||d&&1E3>
|
|
462
|
+
a)&&c&&!c.tc&&(this.g.debug("Session has expired",b.sessionId),(a=this.h.get(b))&&a.Uc&&a.Uc.stop(),this.h.delete(b),b.close().catch(()=>{}));Jo(this)&&(this.H.resolve(),1!==this.h.size||d?this.U.la(.5):ho(this))}};qo=0;Ru=3;_.Vo=new Map;_.Wo=new _.S("clpp.text");var Su=class{constructor(){this.a=null;this.f=[]}};var Tu=class{constructor(){this.h=this.f=this.j=null;this.a=[]}};_.Uu=class{constructor(){this.h=this.w=this.B=this.C=this.l=this.o=this.j=this.A=NaN;this.a=new Su;this.f=new Tu}getStats(){const a=[];for(const b of bp(this.a))a.push({timestamp:b.timestamp,state:_.Zo(b.state),duration:b.duration});return{width:this.A,height:this.j,streamBandwidth:this.w,decodedFrames:this.l,droppedFrames:this.o,corruptedFrames:this.C,estimatedBandwidth:this.h,loadLatency:this.B,playTime:ap(this.a,8),pauseTime:ap(this.a,10),bufferingTime:ap(this.a,6),stateHistory:a,switchHistory:cp(this.f)}}};_.w("clpp.utils.media.detectType",ep);var hp=new _.S("clpp.sources");var Vu=class extends _.ou{constructor(){super(jd);this.w=this.G=!1;this.l=this.A=this.o=this.a=this.j=null;this.h=new _.Et;this.F=this.B=this.f=this.H=null}init(a,b){super.init(a,b);this.j=new Ht(this);Mi(this.j,0)}namespace(){return jd}unload(){const a=this;return _.v(function*(){if(a.ia){a.log.debug("Releasing player with source",a.ia);a.B&&(a.B.stop(),a.B=null);var b=a.getTrackManager();b&&b.release();a.A&&(a.A.destroy(),a.A=null);a.P&&(a.P.destroy(),a.P=null);a.l&&a.l.release();a.o&&(a.o.destroy(),
|
|
463
|
+
a.o=null);_.Fh(a.h);a.f&&(a.f=new _.Uu);a.F=null;a.ia=null;a.G=!1;a.a&&(a.a.removeAttribute("src"),a.a.load());if(a.w)throw new _.J(_.C,7,7E3);a.a&&(b=a.a,a.h.off(b,_.Sd),a.h.off(b,_.vf),a.a=null)}})}release(){return super.release().then(()=>this.unload()).then(()=>{this.j&&Mi(this.j,0)})}destroy(){if(this.w)return this.log.warn("Player is already destroyed!"),Promise.resolve();this.w=!0;return super.destroy().then(()=>this.release()).then(()=>{this.log.debug(xa);const a=this.getTrackManager();a&&
|
|
464
|
+
a.destroy();this.l&&(this.l.destroy().catch(b=>{this.log.warn("Error while disposing metadata handler",b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}getTrackManager(){return this.vc}load(a){const b=this;return _.v(function*(){if(b.w)return Promise.reject(new _.J(_.C,7,7E3));if(!b.getSurface()||!b.getSurface().getMedia())return Promise.reject("No surface or no media element in surface");const c=b.C.getMedia();b.H=Date.now()/
|
|
465
|
+
1E3;b.f=new _.Uu;b.h.on(b,_.af,()=>{b.f&&_.$o(b.f.a,b.getState())});Mi(b.j,2);b.ia=_.gp(a);b.configuration=_.nm([b.ja,a]);b.log.debug(_.Na,b.configuration);b.log.debug(_.eb,b.ia);const d=_.Yo(b.configuration,[_.Zd,"native"]);b.P=d.create(b);b.P.setTextVisibility(!0);b.configuration.enableHtmlCue&&_.sm(_.Qf)&&!_.$h()&&(b.A=new Vt(b),b.A.start(c));b.l?b.l.release():b.l=new It(b);c.textTracks&&jj(b.l,c.textTracks);b.getTrackManager().load();c.loop=!!b.configuration.loop;_.z(b.configuration.volume)||
|
|
466
|
+
b.setVolume(b.configuration.volume);_.z(b.configuration.muted)||b.setMuted(b.configuration.muted);null==b.configuration.startTime&&qp(b,c);_.Yh()&&rp(b,c);try{jp(b,c),yield mp(b),yield pp(b).V}catch(e){b.G=!1,b.onError(e)}})}onError(a){this.G||(a.severity===_.C&&null!==this.j&&Mi(this.j,3),this.trigger(new _.H(_.Sd,{detail:a})))}dh(){return new hu}getState(){return null!==this.j?this.j.getState():0}getPresentationStartTime(){if(this.a&&this.a.getStartDate&&this.isLive()){const a=this.a.getStartDate();
|
|
467
|
+
return isNaN(a.getTime())?null:a.getTime()/1E3}return null}getSeekRange(){var a=this.getSurface().getMedia();if(a&&a.src){a=a.seekable;if(a.length)return this.F=a={start:a.start(0),end:a.end(a.length-1)};if(this.F)return this.F}return{start:0,end:0}}isLive(){return this.a&&this.a.src?Infinity===this.a.duration:!1}getStats(){if(!this.f||!this.a)return _.dp();this.f&&_.$o(this.f.a,this.getState());var a=this.a,b=this.f,c=a.videoHeight;b.A=a.videoWidth;b.j=c;a.getVideoPlaybackQuality&&(c=a.getVideoPlaybackQuality(),
|
|
468
|
+
a=this.f,b=Number(c.totalVideoFrames),a.o=Number(c.droppedVideoFrames),a.l=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.ta())a.bandwidth&&(this.f.w=a.bandwidth),a.ud&&(this.f.h=a.ud);return this.f.getStats()}getTimelineCues(){return this.l?this.l.getTimelineCues():[]}getCueTimeline(){return null}},Wu=class{a(){return jd}canPlay(a,b){a=a.type||"";const c=a===_.tc,d=a===_.Bc,e=a===_.fm;var f;_.Xh()||c||d||e&&!_.Yh()?f=0:f=""!==Kh().canPlayType(a)?e&&_.Yh()&&(window.ManagedMediaSource||
|
|
469
|
+
window.MediaSource&&MediaSource.isTypeSupported)&&!b.streaming.preferNativeHlsOnSafari?1:2:0;return f}f(a){return a===_.oa}create(){return new Vu}};_.Pj=1;_.Mj=2;_.w("clpp.ads.PodType",{PREROLL:0,MIDROLL:_.Pj,POSTROLL:_.Mj});_.w("clpp.ads.Technology",{CLIENT_SIDE:0,SERVER_SIDE:1,SERVER_GUIDED:2});_.w("clpp.ads.ErrorType",{LOAD:0,PLAY:1,OTHER:2});var tp=new _.S("clpp.ads"),sp=[];var Xu=class{load(){}j(){}A(){}resume(){}pause(){}Ia(){}isPaused(){}skip(){}getVolume(){}getAdVolume(){}setVolume(){}h(){}setMuted(){}isMuted(){}pb(){}getPosition(){}o(){}w(){}};_.w("clpp.ads.IAdsManager",Xu);Xu.prototype.getPosition=Xu.prototype.getPosition;Xu.prototype.setVolume=Xu.prototype.setVolume;Xu.prototype.getVolume=Xu.prototype.getVolume;Xu.prototype.skip=Xu.prototype.skip;Xu.prototype.pause=Xu.prototype.pause;Xu.prototype.resume=Xu.prototype.resume;var V=class{eb(){}fb(){}hb(){}getId(){}getCreativeId(){}yb(){}getApiFramework(){}getAdSystem(){}getAdvertiserName(){}getTitle(){}getDuration(){}getPosition(){}getSkipTimeOffset(){}Ab(){}Qa(){}getMediaUrl(){}Ua(){}Ta(){}Ba(){}Ca(){}getPodIndex(){}ob(){}gb(){}Va(){}getWrapperAdIds(){}getWrapperAdSystems(){}getWrapperCreativeIds(){}zb(){}canSeek(){}};_.w("clpp.ads.IAd",V);V.prototype.canSeek=V.prototype.canSeek;V.prototype.getVideoElement=V.prototype.zb;V.prototype.getWrapperCreativeIds=V.prototype.getWrapperCreativeIds;
|
|
470
|
+
V.prototype.getWrapperAdSystems=V.prototype.getWrapperAdSystems;V.prototype.getWrapperAdIds=V.prototype.getWrapperAdIds;V.prototype.getSequenceLength=V.prototype.Va;V.prototype.getPositionInSequence=V.prototype.gb;V.prototype.getPodTimeOffset=V.prototype.ob;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Ca;V.prototype.getMediaBitrate=V.prototype.Ba;V.prototype.getMediaHeight=V.prototype.Ta;V.prototype.getMediaWidth=V.prototype.Ua;V.prototype.getMediaUrl=V.prototype.getMediaUrl;
|
|
471
|
+
V.prototype.getClickThroughUrl=V.prototype.Qa;V.prototype.isBumper=V.prototype.Ab;V.prototype.getSkipTimeOffset=V.prototype.getSkipTimeOffset;V.prototype.getPosition=V.prototype.getPosition;V.prototype.getDuration=V.prototype.getDuration;V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getSourceId=V.prototype.yb;
|
|
472
|
+
V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.getId;V.prototype.getTechnology=V.prototype.hb;V.prototype.getAdManagerVersion=V.prototype.fb;V.prototype.getAdManagerName=V.prototype.eb;var Q=class{constructor(a,b,c,d,e,f,g){this.o=this.l=this.j=!1;this.F=a;this.f=b;this.a=c;this.h=d;this.w=0;this.B=`${e}:${b}`;this.G=e;this.videoEl=null;this.A=f;this.C=g||null}eb(){return""}fb(){return""}hb(){return 2}getId(){return this.B}getCreativeId(){return""}yb(){return this.G}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.h}setPosition(a){this.w=a}getPosition(){return this.w}getSkipTimeOffset(){return-1}canSeek(){return this.A}Ab(){return!1}Qa(){return null}getMediaUrl(){return null}Ua(){return 0}Ta(){return 0}Ba(){return 0}Ca(){return this.F}getPodIndex(){return 0}ob(){return 0}gb(){return this.f}Va(){return this.a}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}zb(){return this.videoEl}Xh(){return this.C}};
|
|
473
|
+
Q.prototype.getCustomAttributes=Q.prototype.Xh;Q.prototype.getVideoElement=Q.prototype.zb;Q.prototype.getWrapperCreativeIds=Q.prototype.getWrapperCreativeIds;Q.prototype.getWrapperAdSystems=Q.prototype.getWrapperAdSystems;Q.prototype.getWrapperAdIds=Q.prototype.getWrapperAdIds;Q.prototype.getSequenceLength=Q.prototype.Va;Q.prototype.getPositionInSequence=Q.prototype.gb;Q.prototype.getPodTimeOffset=Q.prototype.ob;Q.prototype.getPodIndex=Q.prototype.getPodIndex;Q.prototype.getPodType=Q.prototype.Ca;
|
|
474
|
+
Q.prototype.getMediaBitrate=Q.prototype.Ba;Q.prototype.getMediaHeight=Q.prototype.Ta;Q.prototype.getMediaWidth=Q.prototype.Ua;Q.prototype.getMediaUrl=Q.prototype.getMediaUrl;Q.prototype.getClickThroughUrl=Q.prototype.Qa;Q.prototype.isBumper=Q.prototype.Ab;Q.prototype.canSeek=Q.prototype.canSeek;Q.prototype.getSkipTimeOffset=Q.prototype.getSkipTimeOffset;Q.prototype.getPosition=Q.prototype.getPosition;Q.prototype.getDuration=Q.prototype.getDuration;Q.prototype.getTitle=Q.prototype.getTitle;
|
|
475
|
+
Q.prototype.getAdvertiserName=Q.prototype.getAdvertiserName;Q.prototype.getAdSystem=Q.prototype.getAdSystem;Q.prototype.getApiFramework=Q.prototype.getApiFramework;Q.prototype.getSourceId=Q.prototype.yb;Q.prototype.getCreativeId=Q.prototype.getCreativeId;Q.prototype.getId=Q.prototype.getId;Q.prototype.getTechnology=Q.prototype.hb;Q.prototype.getAdManagerVersion=Q.prototype.fb;Q.prototype.getAdManagerName=Q.prototype.eb;var Yu=class{constructor(a){this.a=a.map(b=>({hc:b.getSurface().getMedia().id,player:b,ge:!0,ready:Promise.resolve()}));this.g=new _.S("clpp.playlist.PlayerPool")}has(){return this.a.some(a=>a.ge)}get(){const a=this;return _.v(function*(){const b=a.a.find(c=>c.ge);if(!b)throw Error("No available players in the pool");b.ge=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.ge=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.g.error("Failed to unload player",
|
|
476
|
+
d)}).then(c)});return b.ready}destroy(){const a=this;return _.v(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};_.w("clpp.utils.dom.createHTMLElement",_.zp);var Zu=class{constructor(a){this.a=null;this.h=new Set;this.f=null;this.set(a||null)}set(a){this.h.clear();this.f&&(this.f.disconnect(),this.f=null);if(this.a=a)this.f=Ap(this,a)}get(){return this.a}};var Fp=class{constructor(a,b){this.g=new _.S("clpp.PlayerSurface");this.w=_.Xg($u,b);this.f=new Zu;this.h=null;this.a=new Zu;this.l=av;av+=1;this.o=`clpp-video-${this.l}`;this.j=new _.Et;if(null==a)throw new _.J(_.C,7,7102,"No Media element was provided");if(!(a instanceof Element||(a=document.getElementById(a),a)))throw new _.J(_.C,7,7004,"Media element not found");b=this.w;this.g.debug("Initializing Player Surface on ",a);if("cast-media-player"===a.tagName.toLowerCase())this.h=a;else{if(!(a instanceof
|
|
477
|
+
HTMLMediaElement))throw new _.J(_.C,7,7005,"Media element is not instance of HTMLMediaElement");if(!a.hasAttribute("crossorigin")){var c=b.crossorigin;this.g.info("Setting media elements crossorigin to "+c);a.setAttribute("crossorigin",c)}this.f.set(a);if(b.disableContainer)var d=null;else if(b.containerEl){if(a.parentNode!==b.containerEl)throw new _.J(_.C,7,7006,"Container element is not a direct parent of media element");d=b.containerEl}else{c=document.createElement(_.Ad);a.parentNode?a.parentNode.replaceChild(c,
|
|
478
|
+
a):this.g.warn("Player Surface Element has no parent. Can not inject container. You have to manually add playerSurface.getContainer() to the DOM!");var e=[];for(let g=0;g<a.classList.length;g++)e.push(a.classList[g]);for(var f of e)a.classList.remove(f),_.xp(c,f);c.style.cssText=a.style.cssText;a.removeAttribute(_.Pf);for(d of[_.Gg,_.Xd])f=a.getAttribute(d),f=parseInt(f,10),isNaN(f)||(c.style[d]=`${f}px`),_.Ph()||a.removeAttribute(d);c.appendChild(a);d=c}d&&(this.a.set(d),Bp(this.a,"clpp-container"),
|
|
479
|
+
Bp(this.a,this.o),Bp(this.f,_.$c),Bp(this.f,"clpp-video"));b.webOSStartupPatch&&Cp(this,a,d)}}getMedia(){return this.f.get()}getContainer(){return this.a.get()}getSafeContainer(){return this.a}getId(){return this.l}getUniqueCssClass(){return this.o}getCastElement(){return this.h}isFullscreen(){return!!document.fullscreenElement}hideMediaElement(){const a=this.getMedia();a?_.xp(a,cd):this.g.debug("No media element available that could be hidden")}showMediaElement(){const a=this.getMedia();a?a.classList.remove(cd):
|
|
480
|
+
this.g.debug("No media element available that could be shown")}addElementToContainer(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;const d=this.getContainer();if(!d)throw Error("No container is available. Unable to add element");b&&_.xp(a,_.$c);c?d.insertBefore(a,d.firstElementChild):d.appendChild(a)}removeElementFromContainer(a){const b=this.getContainer();if(!b)throw Error("No container is available. Unable to remove element");b.removeChild(a)}hide(a){_.xp(a,cd)}show(a){a.classList.remove(cd)}release(){this.j.release()}};
|
|
481
|
+
Fp.prototype.removeElementFromContainer=Fp.prototype.removeElementFromContainer;Fp.prototype.addElementToContainer=Fp.prototype.addElementToContainer;Fp.prototype.getCastElement=Fp.prototype.getCastElement;Fp.prototype.getContainer=Fp.prototype.getContainer;Fp.prototype.getMedia=Fp.prototype.getMedia;var $u={disableContainer:!1,webOSStartupPatch:!1,crossorigin:"anonymous",containerEl:null},av=1;var bv=class{constructor(a){this.ha=a;this.l=!!a.sideAdContainer;this.h=[];this.a=a.Og;this.C=Ep(a);this.A=[];const b=Gp(this,this.C,this.ha.Hh);this.o=new Yu(b);this.f=null;this.w=!1;this.j=new Map;this.F=a.toggleVisible;this.g=new _.S("clpp.interstitial.MultiController");this.ga=this.B=!1;this.G=a.Bi||(()=>{});Hp(this).forEach(c=>Ip(this,c,!1))}getCurrentItem(){return this.f}qe(){return this.f?this.f.player:null}pg(){return Array.from(this.j.values())}Kd(){return 0<this.j.size}play(a){return Xp(this,
|
|
482
|
+
a,_.Qe)}load(a){return Xp(this,a,_.je)}release(){const a=this;return _.v(function*(){yield Promise.all([yield dq(a),a.f?Up(a,a.f):Promise.resolve()]);a.f=null;a.w=!1})}destroy(){const a=this;return _.v(function*(){a.g.info("Destroy");yield a.release();yield a.o.destroy();qq(a)})}isMuted(){return this.B}},nq="preload",kq=_.ne,Np="primary",Mp="ad";var cv=class extends _.lu{constructor(a){super();this.ha=_.Xg({Ji:.5},a);this.Me=this.ga=!1;this.g=new _.S("clpp.interstitial.Player");this.f=a.player;this.f.setSeekInterceptor((b,c)=>{if(c)return!0;if(this.ga)return!1;if(c=sq(this))return this.g.info("Seek ignored while binding interstitial",c.ea),!1;tq(this,b);c=uq(this);const d=vq(this,b),e=wq(this,b);if(c){if(d&&d!==c)return zq(this,d,b),!1;if(e&&e!==c)return Aq(this,e,b),!1;if(b<c.startTime-this.ha.resolutionOffsetSec)return xq(this,c),!0;if(b<
|
|
483
|
+
c.startTime)return fq(this.X),this.g.info("Seek inside resolution area of",c.ea),!0;if(b<=c.endTime)return this.g.info("Seek into the scheduled interstitial",c.ea),iq(this.X),!1;if(c.ag)return this.g.info("Jump over a scheduled interstitial",c.ea),hq(this.X),c.state=0,!0;this.g.info("Jump over a scheduled interstitial triggering it",c.ea);iq(this.X);pq(this.X,b,!0);return!1}return d?(zq(this,d,b),!1):e&&!e.Jh?(Aq(this,e,b),!1):!0});this.X=new bv({Hh:this.ha.config,Og:a.player,preloadMedia:!0,nb:a.nb,
|
|
484
|
+
sideAdContainer:this.ha.sideAdContainer,onAudioDecision:this.ha.onAudioDecision,Bi:()=>{this.g.info("Resume primary content")}});this.h=[];this.a=[];this.j=!1;Iq(this,a.player)}destroy(){const a=this;return _.v(function*(){Jq(a);a.a=[];a.j=!1;a.f.setSeekInterceptor(null);yield a.X.destroy()})}Qb(){return this.j}setMuted(a){var b=this.X;b.B=a;b.l?a?(b.a.setMuted(!0),jq(b,!0)):(a=b.getCurrentItem(),Lp(b,a,a&&a.Yb?Mp:Np)):(b.a.setMuted(a),jq(b,a))}isMuted(){return this.X.isMuted()}setVolume(a){Hp(this.X).forEach(b=>
|
|
485
|
+
{b.setVolume(a)})}Ia(){const a=Kq(this);a&&(a.pause(),this.ha.sideAdContainer&&this.f.pause())}isLive(){const a=this.X.qe();return a?a.isLive():null}};var Mr=class{constructor(){this.a=null}load(){return Promise.resolve()}j(){{var a=this.a;const b=Kq(a);b?(b.play(),a.ha.sideAdContainer&&a.f.play(),a=!1):a=!0}return a}A(a,b,c){const d=a.getConfiguration();a=Object.assign({},{config:d,player:a,nb:b},d.ads.hls||{},{Ii:c});this.a=new cv(a);Sq(this.a)}setMuted(a){this.a&&this.a.setMuted(a)}isMuted(){return this.a?this.a.isMuted():!0}pb(){return null!==Kq(this.a)}Ia(){this.a.Ia()}isPaused(){const a=Kq(this.a);return a?a.isPaused():!1}skip(){}getAdVolume(){const a=
|
|
486
|
+
Kq(this.a);return a?a.getVolume()||0:0}h(a){this.a.setVolume(a)}getPosition(){const a=Kq(this.a);return a?a.getPosition():-1}w(){return!this.a.Qb()}o(){return this.a.destroy()}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.Ia()}resume(){this.j()}};Mr.prototype.resume=Mr.prototype.resume;Mr.prototype.pause=Mr.prototype.pause;Mr.prototype.getVolume=Mr.prototype.getVolume;Mr.prototype.setVolume=Mr.prototype.setVolume;Mr.prototype.getPosition=Mr.prototype.getPosition;
|
|
487
|
+
Mr.prototype.skip=Mr.prototype.skip;var dv=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.f=new _.Et;this.h=null;this.a=!0;er(this)}release(){this.f.release();fr(this);this.m=null}};var hr=[];var nr=class{constructor(a,b,c){this.h=a;this.f=b;JSON.parse(_.vi(_.Lk(a)));this.a=JSON.parse(_.vi(_.Lk(b)));this.j=c}};var lr={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},im="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var Pr=class{constructor(a){this.f=a;this.a=null;this.g=new _.S("clpp.utils.LicenseKey")}},Ar="vod",zr="live";var hs,Fr,Ir,Gr;hs=class{constructor(a){this.m=a;this.f=a.getNetworkEngine();this.h=Jr(this);this.f.td(this.h);this.a=null}release(){this.a=null;this.f.Fe(this.h)}};_.ev="maxSuggestedBitrateKbps";Fr={du:"duress",etp:_.Td,mb:_.ev,rd:"responseDelay",rtt:"roundTripTime"};Ir={at:"availabilityTime",br:"encodedBitrateKbps",ht:"heldTime",n:"intermediaryIdentifier",nor:"nextObjectResponse",nrr:"nextRangeResponse",d:"objectDuration",ot:"objectType",su:"startup",st:"streamType",sf:"streamingFormat",v:mg};
|
|
488
|
+
Gr=new _.S("clpp.net.CmsdManager");_.R=class extends _.lu{constructor(a,b,c){super();ir();this.g=new _.S("clpp.Player");this.g.info("SDK version: 6.34.0-beta.1");if(!a)throw new _.J(_.C,7,7102);this.Z=new _.Et;this.on(_.af,d=>{if(d=d.detail){d={currentState:_.Zo(d.currentState),previousState:_.Zo(d.previousState),timeSinceLastStateChangeMS:d.timeSinceLastStateChangeMS,reason:d.reason};{const e=_.Hi(d.previousState,fv),f=_.Hi(d.currentState,fv),g=null==d.reason?"":` [${_.Hi(d.reason,Oi)}]`;this.g.info(`Player state change: ${e} -> ${f}${g}`)}this.trigger(new _.H(Kf,
|
|
489
|
+
{detail:d}))}});this.f=this.F=b||_.lm();this.l=null;void 0===this.f.license&&(this.f.license=im,this.g.warn("You are using the embedded demo license!"));if(!this.f.license)throw this.g.error("You provided null or empty string as your license. Please check your license configuration."),new _.J(_.C,7,7101,"No license provided in configuration!");this.j=new Fp(a,c);this.G=this.B=this.a=this.J=null;this.A=new _.Cr;Wk(this.A,this.f);this.h=null;this.W=[];this.L={};this.ca=null;this.H=!0;this.S=this.R=
|
|
490
|
+
!1;this.M=this.Wc=null;this.Ze=!1;this.ja=new dv(this);this.C=null;this.on(Kf,()=>{3===this.getPlayerState()&&(this.a?this.a.unload():Promise.resolve())});this.on(_.qc,()=>{this.Ze=!0});this.on(_.pc,()=>{this.Ze=!1});this.on(_.Zf,()=>Or(this));Qr(this,this.f.license);(a=this.j.getMedia())&&a.hasAttribute("autoplay")&&(a.removeAttribute("autoplay"),this.g.warn("The autoplay attribute on the video element is not supported. Use the autoplay option in player configuration instead."));a=[];for(const d of Kr)try{const e=
|
|
491
|
+
d.create(this.f);e&&a.push(e)}catch(e){this.g.error("Error while creating player plugin",e)}this.da(a);this.P=_.oa;xm(this)}on(a,b,c){return super.on(a,b,c)}one(a,b,c){return super.one(a,b,c)}off(a,b){return super.off(a,b)}onError(a){if(null!==this.a)this.a.onError(a);else a=new _.H(_.Sd,{detail:a}),this.trigger(a)}da(a){this.W=a;for(const b of this.W)(a=b.id())&&(this.L[a]=b);_.Tr(this,"onPlayerCreated")}Ed(a){a=this.L[a];void 0===a&&(a=null);return a}getSurface(){return this.j}getConfiguration(){return _.Yg(this.f)}getDrmInfo(){return this.a?
|
|
492
|
+
this.a.getDrmInfo():null}detach(){const a=this;return _.v(function*(){const b=a.getTrackManager();b&&b.detach();a.a&&(yield a.a.detach(),a.a.stopForwardingEventsTo(a))})}release(){if(null!=this.l)return this.g.info("Player release already in progress"),this.l;this.g.debug("Releasing player");this.l=Ur(this);return this.l.finally(()=>{Vr(this);this.g.debug("Player released");this.l=null})}stop(){return this.release()}destroy(){const a=this;return _.v(function*(){a.R?a.g.debug("The player is already destroyed. No-op"):
|
|
493
|
+
(a.R=!0,yield a.release(),a.g.debug(xa),a.trigger(new _.H("destroying")),yield _.Tr(a,_.Fe),a.a&&a.a.stopForwardingEventsTo(a),a.Cd.clear(),a.ja.release(),a.a&&(yield a.a.destroy()),yield a.A.destroy(),a.a=null,a.B=null,a.trigger(new _.H("destroyed")),a.g.debug("Player destroyed"))})}open(a){const b=this;return _.v(function*(){try{_.Rn(Ye);b.P=_.oa;const c=_.gp(a),d=om(a)?a:{};if(d.license)throw new _.J(_.C,7,7100,"License cannot be passed into the open method.");yield _.cs(b,d,c);yield _.ds(b);yield _.fs(b);
|
|
494
|
+
_.Rn(Xe);_.Tn("player.open",Ye,Xe)}catch(c){Vr(b);if(b.l)throw b.g.info(Ma),new _.J(_.C,7,7E3);throw c;}})}load(a){return this.open(a)}preload(a){const b=this;return _.v(function*(){yield _.cs(b,a);if(b.a){var c=b.a;c.preload?yield c.preload(b.f):b.g.warn(gb)}else b.g.warn(db)})}use(a){(a=Bm(a))&&a.playerConstructed(this)}remove(a){return 0!==this.getPlayerState()&&!this.H||null===vm(a)?!1:(Fm(a),this.S=!0)}play(){return this.a?this.h&&!this.h.j()?Promise.resolve():this.a.play():Promise.reject("No player initialized. You need to load content before calling play.")}pause(){return this.a?
|
|
495
|
+
this.h&&this.h.pb()?(this.h.Ia(),Promise.resolve()):this.a.pause():Promise.reject("No player initialized. You need to load content before calling pause.")}getTrackManager(){return this.a&&this.a.getTrackManager()}getBufferInfo(a){return this.a?this.a.getBufferInfo(a):new _.iu}getState(){return _.Zo(this.getPlayerState())}getPlayerState(){return this.a?this.a.getState():0}getPeriods(){return this.a?this.a.getPeriods():[]}isEnded(){return this.a&&this.a.isEnded()||!1}isPaused(){return this.h&&this.h.pb()?
|
|
496
|
+
this.h.isPaused():this.a?this.a.isPaused():!1}getPosition(){return this.a?this.a.getPosition():0}setPosition(a){return 3===this.getPlayerState()?Promise.reject("Cannot seek in current state."):this.a?this.a.seek(a):Promise.reject("delegate does not exist")}seek(a){return this.setPosition(a)}getPresentationStartTime(){return this.a?this.a.getPresentationStartTime():null}getSeekRange(){return this.a?this.a.getSeekRange():{start:0,end:0}}Ec(){const a=this.a;return a&&a.Ec?a.Ec():null}getVolume(){return this.a?
|
|
497
|
+
this.a.getVolume():null}setVolume(a){this.h&&this.h.h(a);this.a&&this.a.setVolume(a)}getDuration(){return this.a?this.a.getDuration():-1}getAdsManager(){return this.h}namespace(){return this.a&&this.a.namespace()||"Undefined"}pb(){return this.h?this.h.pb():!1}lc(){return this.a?this.a.getPlaybackRate():1}getPlaybackRate(){return this.lc()}qd(a,b){this.a&&this.a.setPlaybackRate(a,b)}setPlaybackRate(a,b){this.qd(a,b)}isMuted(){return this.a?!!this.a.isMuted():!1}setMuted(a){this.h&&this.h.setMuted(a);
|
|
498
|
+
this.a&&this.a.setMuted(a)}getNetworkEngine(){return this.A}setNetworkEngine(a){this.A=a}getTextDisplayer(){return this.a&&this.a.getTextDisplayer()}isLive(){return!!this.a&&this.a.isLive()}getStats(){return this.a?this.a.getStats():null}sg(){return Object.freeze(this.ca)}Ra(){return this.a&&this.a.getLoadedSource()}getLoadedSource(){return this.Ra()}getTimelineCues(){return this.a?this.a.getTimelineCues():[]}getCueTimeline(){return this.a?this.a.getCueTimeline():null}resetAbr(){this.a&&this.a.resetAbr()}setDrmCustomDataModifier(a){this.Wc=
|
|
499
|
+
a;$r(this)}setCdnErrorCallback(a){this.M=a;this.a&&this.a.setCdnErrorCallback(this.M)}};_.w("clpp.Player",_.R);_.R.registerPlugin=_.Lr;_.R.prototype.setCdnErrorCallback=_.R.prototype.setCdnErrorCallback;_.R.prototype.setDrmCustomDataModifier=_.R.prototype.setDrmCustomDataModifier;_.R.prototype.resetAbr=_.R.prototype.resetAbr;_.R.prototype.getTimelineCues=_.R.prototype.getTimelineCues;_.R.prototype.getLoadedSource=_.R.prototype.getLoadedSource;_.R.prototype.getCurrentSource=_.R.prototype.Ra;
|
|
500
|
+
_.R.prototype.getSources=_.R.prototype.sg;_.R.prototype.getStats=_.R.prototype.getStats;_.R.prototype.isLive=_.R.prototype.isLive;_.R.prototype.getTextDisplayer=_.R.prototype.getTextDisplayer;_.R.prototype.setNetworkEngine=_.R.prototype.setNetworkEngine;_.R.prototype.getNetworkEngine=_.R.prototype.getNetworkEngine;_.R.prototype.setMuted=_.R.prototype.setMuted;_.R.prototype.isMuted=_.R.prototype.isMuted;_.R.prototype.setPlaybackRate=_.R.prototype.setPlaybackRate;_.R.prototype.setRate=_.R.prototype.qd;
|
|
501
|
+
_.R.prototype.getPlaybackRate=_.R.prototype.getPlaybackRate;_.R.prototype.getRate=_.R.prototype.lc;_.R.prototype.isPlayingAd=_.R.prototype.pb;_.R.prototype.namespace=_.R.prototype.namespace;_.R.prototype.getAdsManager=_.R.prototype.getAdsManager;_.R.prototype.getDuration=_.R.prototype.getDuration;_.R.prototype.setVolume=_.R.prototype.setVolume;_.R.prototype.getVolume=_.R.prototype.getVolume;_.R.prototype.getTimelineOffset=_.R.prototype.Ec;_.R.prototype.getSeekRange=_.R.prototype.getSeekRange;
|
|
502
|
+
_.R.prototype.getPresentationStartTime=_.R.prototype.getPresentationStartTime;_.R.prototype.seek=_.R.prototype.seek;_.R.prototype.setPosition=_.R.prototype.setPosition;_.R.prototype.getPosition=_.R.prototype.getPosition;_.R.prototype.isPaused=_.R.prototype.isPaused;_.R.prototype.isEnded=_.R.prototype.isEnded;_.R.prototype.getState=_.R.prototype.getState;_.R.prototype.getBufferInfo=_.R.prototype.getBufferInfo;_.R.prototype.getTrackManager=_.R.prototype.getTrackManager;_.R.prototype.pause=_.R.prototype.pause;
|
|
503
|
+
_.R.prototype.play=_.R.prototype.play;_.R.prototype.remove=_.R.prototype.remove;_.R.prototype.use=_.R.prototype.use;_.R.prototype.load=_.R.prototype.load;_.R.prototype.open=_.R.prototype.open;_.R.prototype.destroy=_.R.prototype.destroy;_.R.prototype.stop=_.R.prototype.stop;_.R.prototype.release=_.R.prototype.release;_.R.prototype.getDrmInfo=_.R.prototype.getDrmInfo;_.R.prototype.getConfiguration=_.R.prototype.getConfiguration;_.R.prototype.getSurface=_.R.prototype.getSurface;
|
|
504
|
+
_.R.prototype.getPlugin=_.R.prototype.Ed;_.R.prototype.off=_.R.prototype.off;_.R.prototype.one=_.R.prototype.one;_.R.prototype.on=_.R.prototype.on;var fv={IDLE:0,PREPARING:1,BUFFERING:2,PLAYING:3,PAUSED:4,ENDED:5,ERROR:6,UNSET:7};_.R.State=fv;var Kr=[];var gv=class extends _.R{constructor(a,b,c){super(a,b,c);a={manifest:{timeline:{version:2},keepTimelineLive:!0},streaming:{preferNativeHlsOnSafari:!1,enableLiveEdgeChasing:!1,startAtSegmentBoundary:!1}};this.F=_.Xg(this.F,a);this.f=_.Xg(this.f,a);this.I=0;this.o=[];this.U=!1;this.w=null;this.K=[]}Ei(a,b){const c=this;return _.v(function*(){if(c.w)throw new _.J(_.C,7,7008,`Cannot call openPlaylist() while ${c.w}() is ongoing!`);if(0!==a)throw new _.J(_.C,7,7007,"The index parameter only supports the value of 0.");
|
|
505
|
+
if(0===b.length)throw new _.J(_.C,7,7003,Va);if(b.some(g=>!g.id||!g.source))throw new _.J(_.C,7,7100,"Some config is missing required properties `id` or `source`!");if((new Set(b.map(g=>g.id))).size!==b.length)throw new _.J(_.C,7,7100,"Some config contains a non-unique property `id`!");const d=b[0].playlist;if(d){var e=d.timeline,f=["flat","basic"];if(e&&!f.includes(e))throw new _.J(_.C,7,7100,"Unsupported `playlist.timeline` config value!");e=d.startTime;if(null!=e&&(typeof e!==_.r||0>e))throw new _.J(_.C,
|
|
506
|
+
7,7100,"Invalid `playlist.startTime` config value!");f=d.endTime;if(null!=f&&(typeof f!==_.r||0>f||null!=e&&f<=e))throw new _.J(_.C,7,7100,"Invalid `playlist.endTime` config value!");if("DVR"===d.content&&!f)throw new _.J(_.C,7,7100,"`playlist.endTime` config value is required for DVR content!");}try{js(c),c.w="openPlaylist",yield ms(c,b),c.I=0,c.o=b,c.U=!0,ns(c,b[0].playlist||{})}finally{c.w=null}})}qh(a){const b=this;return _.v(function*(){if(b.w)throw new _.J(_.C,7,7008,`Cannot call addItem() while ${b.w}() is ongoing!`);
|
|
507
|
+
if(!b.U)throw new _.J(_.C,7,7008,"openPlaylist() must be called before addItem()!");if(!a.id||!a.source)throw new _.J(_.C,7,7100,"The config is missing required properties `id` or `source`!");if((new Set(b.o.map(c=>c.id))).has(a.id))throw new _.J(_.C,7,7100,"A config with this `id` already exists in the playlist!");try{b.w="addItem",b.o.push(a),yield os(b,a)}finally{b.w=null}})}getCurrentItem(){return this.o[this.I]||null}getCurrentItemIndex(){return this.I}$h(){return[...this.o]}Gd(){return this.o.length}getTimeline(){return this.a?
|
|
508
|
+
this.a.getTimeline():null}seekWith(a){return this.a?this.a.seekWith(a):Promise.resolve()}release(){this.o=[];this.I=0;this.U=!1;return super.release()}destroy(){js(this);return super.destroy()}setCdnErrorCallback(){throw new _.J(1,7,7009,"CDN switching is not supported!");}da(){}};_.w("clpp.playlist.ScPlaylist",gv);gv.prototype.setCdnErrorCallback=gv.prototype.setCdnErrorCallback;gv.prototype.destroy=gv.prototype.destroy;gv.prototype.release=gv.prototype.release;gv.prototype.seekWith=gv.prototype.seekWith;
|
|
509
|
+
gv.prototype.getTimeline=gv.prototype.getTimeline;gv.prototype.getSize=gv.prototype.Gd;gv.prototype.getPlaylist=gv.prototype.$h;gv.prototype.getCurrentItemIndex=gv.prototype.getCurrentItemIndex;gv.prototype.getCurrentItem=gv.prototype.getCurrentItem;gv.prototype.addItem=gv.prototype.qh;gv.prototype.openPlaylist=gv.prototype.Ei;var hv=class extends _.lu{constructor(a){super();this.ha=_.Xg({transition:_.Me,preloadMedia:!1},a);this.h=[];this.a=0;const b=ps(a.anchorId,this.ha.config);this.o=new Yu(b);this.f=null;this.j=!1;this.l=new Map;this.w=a.toggleVisible;this.g=new _.S(kd);this.o.a.forEach(c=>qs(this,c.player,!1))}Mb(){return this.f}qe(){return this.f?this.f.player:null}og(){return this.l.get(this.a+1)||null}qg(){return this.l.get(this.a-1)||null}pg(){return[this.qg(),this.og()].filter(Boolean)}Ui(a){if(0<this.h.length)throw Error("Cannot re-set items in the playlist");
|
|
510
|
+
this.g.info("Set items",a);this.h=a.map((b,c)=>({config:b,index:c,preloadPromise:Promise.resolve(),disposers:[]}))}Ti(a){if(0===this.h.length)throw Error(Ua);if(0>a||a>this.h.length-1)throw Error("Index out of bounds");this.a=a}Kd(){return this.a<this.h.length-1}ug(){return 0<this.a}Gi(){const a=this;return _.v(function*(){if(a.j)a.g.warn("Cannot play first item while busy");else if(0===a.h.length)a.g.warn(Ua);else{a.j=!0;a.g.info(`First (index: ${a.a})`);var b=a.h[a.a];try{a.g.info(`First loading (index: ${a.a})`),
|
|
511
|
+
yield ts(a,b),a.g.info(`First playing (index: ${a.a})`)}catch(c){throw a.g.error(`First failed (index: ${a.a})`),c;}finally{a.j=!1,As(a)}}})}Lg(){const a=this;return _.v(function*(){if(a.j)a.g.warn("Cannot play next item while busy");else if(a.Kd()){a.j=!0;a.a+=1;a.g.info(`Next (index: ${a.a})`);var b=a.f;a.ha.transition===_.Me&&b.player.pause();Fs(a,a.a+-2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Next loading (index: ${a.a})`),yield Bs(a,c),a.g.info(`Next playing (index: ${a.a})`)}catch(d){throw a.g.error(`Next failed (index: ${a.a})`),
|
|
512
|
+
d;}finally{a.j=!1,b&&(yield Es(a,b)),As(a)}}else a.g.warn("There are no more items in the playlist")})}Hi(){const a=this;return _.v(function*(){if(a.j)a.g.warn("Cannot play previous item while busy");else if(a.ug()){a.j=!0;--a.a;a.g.info(`Previous (index: ${a.a})`);var b=a.f;a.ha.transition===_.Me&&b.player.pause();Fs(a,a.a+2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Previous loading (index: ${a.a})`),yield Bs(a,c),a.g.info(`Previous playing (index: ${a.a})`)}catch(d){throw a.g.error(`Previous failed (index: ${a.a})`),
|
|
513
|
+
d;}finally{a.j=!1,b&&(yield Es(a,b)),As(a)}}else a.g.warn("There are no more previous items in the playlist")})}destroy(){const a=this;return _.v(function*(){a.g.info("Destroy");yield Promise.all([Gs(a),a.f?Es(a,a.f):Promise.resolve()]);yield Hs(a)})}};_.w(kd,hv);hv.prototype.destroy=hv.prototype.destroy;hv.prototype.playPrev=hv.prototype.Hi;hv.prototype.playNext=hv.prototype.Lg;hv.prototype.playFirst=hv.prototype.Gi;hv.prototype.hasPrev=hv.prototype.ug;hv.prototype.hasNext=hv.prototype.Kd;
|
|
514
|
+
hv.prototype.setIndex=hv.prototype.Ti;hv.prototype.setItems=hv.prototype.Ui;hv.prototype.getPreloading=hv.prototype.pg;hv.prototype.getPrev=hv.prototype.qg;hv.prototype.getNext=hv.prototype.og;hv.prototype.getCurrentPlayer=hv.prototype.qe;hv.prototype.getCurrent=hv.prototype.Mb;var Ds="preload",rs=_.ne;var Is=new Map;var kv=class{constructor(a){this.h=a;this.f={keepOriginalTimestamps:!0,remux:!1};this.a=new muxjs.mp4.Transmuxer(this.f)}destroy(){this.a.dispose();this.a=null}reset(){this.a=new muxjs.mp4.Transmuxer(this.f)}isSupported(a,b){const c="mp2t"===a.toLowerCase().split(";")[0].split("/")[1],d=a.toLowerCase().split(";")[0]===_.Dc;if(!window.muxjs||!c&&!d)return!1;if(d)return _.Js(Hc);if(b)return _.Js(Ks(b,a));b=Ks(_.q,a);a=Ks(_.t,a);return _.Js(b)||_.Js(a)}isMuxed(a,b){return 1<this.demuxMimeTypes(a,b).size}demuxMimeTypes(a,
|
|
515
|
+
b){const c=new Map;c.set(a,b);try{const d=_.Hl(b),e=_.Il(b).split(","),f=new Map,g=Gj(_.q,e),h=Gj(_.t,e);g&&f.set(_.q,this.convertCodecs(_.q,_.Gl(d,g)));h&&f.set(_.t,this.convertCodecs(_.t,_.Gl(d,h)));return f}catch(d){return c}}convertCodecs(a,b){return b.toLowerCase().split(";")[0]===_.Dc?Hc:"mp2t"===b.toLowerCase().split(";")[0].split("/")[1]?Ks(a,b):b}getOriginalMimeType(){return this.h}transmux(a){const b=[],c=[];let d=[],e=null;a=_.E(a);const f=h=>{d=h.captions;const k=new Uint8Array(h.data.byteLength+
|
|
516
|
+
h.initSegment.byteLength);k.set(h.initSegment,0);k.set(h.data,h.initSegment.byteLength);h.type===iv?b.push(k):h.type===jv&&c.push(k)},g=()=>{e={video:_.Pk(...b),captions:d,audio:_.Pk(...c)}};this.a.on("data",f);this.a.on("done",g);this.a.push(a);this.a.flush();this.a.off("data",f);this.a.off("done",g);if(!e)throw new _.J(_.C,3,3018);return e}},jv=_.q,iv=_.t;var lv=class{getCuePoints(){}Qb(){}Pb(){}};_.w("clpp.ads.IAdsTimeline",lv);lv.prototype.hasPostroll=lv.prototype.Pb;lv.prototype.hasPreroll=lv.prototype.Qb;lv.prototype.getCuePoints=lv.prototype.getCuePoints;_.mv=class{install(){}uninstall(){}beforeLoad(){}drmConfigurationResolved(){}afterLoad(){}playerConstructed(){}};_.nv=class{constructor(a){this.I=a;this.f={}}jb(a,b){this.f[a]=b}};_.w("clpp.drm.DrmEnvironment",_.nv);_.nv.prototype.setDrmSystem=_.nv.prototype.jb;var Ms,Ns,Os;Ms="/license-proxy-widevine/cenc/";Ns="/license-proxy-headerauth/drmtoday/RightsManager.asmx";Os="/license-server-fairplay/";_.Rs=new _.S("clpp.drm.DrmTodayLegacyEndpointHandler");var ov=class{};_.w("clpp.drm.DrmToday",ov);var Ys="PRODUCTION",Zs="STAGING",$s="DEMO",at="TEST";ov.Environment={PRODUCTION:Ys,STAGING:Zs,DEMO:$s,TEST:at};ov.WidevineCertificates={V1_PROD:"V1_PROD",V1_STAGING:"V1_STAGING",V2:"V2"};var pv=class extends _.mv{drmConfigurationResolved(a){if(a){var b=a.env;if((b=!!b&&!!bt(b))&&!_.jk[a.env]){{b=a.env;a=bt(b);if(!a)throw new _.vj(`env not recognized as DRMtoday environment: ${b}`);b=new _.nv(b);let c=null;switch(a){case Ys:case Zs:case $s:c=_.pn("V2");break;case at:c=null}b.jb(_.td,{licenseUrl:Ps(_.td,a),videoRobustness:tu,audioRobustness:uu,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:c,modifiers:{licenseRequest:_.Ss,licenseResponse:_.Xs}});b.jb(_.pd,
|
|
517
|
+
{licenseUrl:Ps(_.pd,a),certificateUrl:gn(a)+"/license-server-fairplay/cert/",modifiers:{licenseRequest:Us,licenseResponse:_.Vs,extractContentId:_.Qs,certificateRequest:Ws}});b.jb(_.rd,{licenseUrl:Ps(_.rd,a),videoRobustness:vu,audioRobustness:wu,modifiers:{licenseRequest:Ts}});_.kk(b)}}}}id(){return Ld}};var sv=class extends _.nv{constructor(a,b,c,d,e){super(Ia);this.l=a;this.j=b;this.h=c;this.a=d;this.o=e;this.g=new _.S(hd);_.Fi(this.l)?this.g.warn(_.Gb):this.jb(_.td,{licenseUrl:this.l,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.Sd.bind(this)}});_.Fi(this.j)?this.g.warn(_.cb):this.jb(_.rd,{licenseUrl:this.j,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.Sd.bind(this)}});
|
|
518
|
+
_.Fi(this.h)?this.g.warn(_.Ca):_.Fi(this.a)?this.g.warn(_.Ba):this.jb(_.pd,{licenseUrl:this.h,certificateUrl:this.a,modifiers:{licenseRequest:this.Gg.bind(this),licenseResponse:this.Hg.bind(this),certificateRequest:this.Sd.bind(this),extractContentId:this.jg.bind(this)}})}Sd(a,b){a=a.drm.customData.headers||{};for(const c of Object.keys(a))b.headers[c]=a[c]}jg(a,b){a=Ym(b);switch(this.o){case qv:return a;case rv:return(new _.Zm(a)).a;default:throw Error("Unknown content ID strategy");}}Gg(a,b){b.headers[_.ua]=
|
|
519
|
+
_.Cc;this.Sd(a,b);a={spc:_.Jk(b.body)};b.body=_.Bi(_.Aj(a,!0))}Hg(a,b){a=_.vi(b.data).trim();const c="\x3c/ckc\x3e"===a.substr(-6);"\x3cckc\x3e"===a.substr(0,5)&&c&&(a=a.slice(5,-6));b.data=_.Lk(a).buffer}};_.w(hd,sv);sv.prototype.onFairPlayLicenseResponse=sv.prototype.Hg;sv.prototype.onFairPlayLicenseRequest=sv.prototype.Gg;sv.prototype.extractFairPlayContentId=sv.prototype.jg;sv.prototype.onLicenseRequest=sv.prototype.Sd;sv.prototype.constructor=sv.prototype.constructor;sv.NAME=Ia;
|
|
520
|
+
var rv="hostname",qv="full-skd";sv.FairPlayContentIdStrategy={HOSTNAME:rv,FULL_SKD:qv};var uv=class extends _.mv{drmConfigurationResolved(a){if(a&&a.env===Ia){a=a.customData;if(!a)throw new _.J(_.C,7,7100,_.ud);a=new sv(a.widevineLicenseUrl,a.playReadyLicenseUrl,a.fairPlayLicenseUrl,a.fairPlayCertificateUrl,a.fairPlayContentIdStrategy||qv);_.kk(a)}}uninstall(){delete _.jk.HeaderDrm}id(){return"headerdrm"}};_.w("clpp.drm.HeaderDrmComponent",uv);_.vv=class{constructor(a,b,c){this.h=a;this.j=b;this.f=c||this.h.getMedia();this.a=null}start(){this.a=new ResizeObserver(a=>{a=a[0];this.j(a.contentRect.width,a.contentRect.height,this.h.isFullscreen())});this.f&&this.a.observe(this.f)}stop(){this.a&&(this.a.disconnect(),this.a=null)}};var wv;_.xv=class{constructor(){this.a=new Blob([wv],{type:_.qg})}canPlay(a){var b=document.createElement(_.t);b.setAttribute("playsinline","playsinline");a&&(b.muted=!0,b.setAttribute("muted","muted"));b.src=URL.createObjectURL(this.a);const c=new _.uk;b=b.play();const d=(new _.Jh(()=>{d.stop();c.resolve(a)})).la(.25);void 0!==b?b.then(()=>{d.stop();c.resolve(!0)}).catch(e=>{e&&e.message&&e.message===$a?(d.stop(),c.resolve(!0)):(d.stop(),c.resolve(!1))}):(d.stop(),c.resolve(!0));return c}};
|
|
521
|
+
wv=new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
515
522
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
516
523
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,
|
|
517
524
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,
|
|
518
525
|
0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,
|
|
519
526
|
0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,
|
|
520
|
-
116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49]);_.
|
|
521
|
-
_.
|
|
522
|
-
a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.
|
|
523
|
-
_.
|
|
524
|
-
_.
|
|
525
|
-
_.
|
|
526
|
-
Object.keys(a).map(c=>null!==a[c]?`${c}:${a[c]};`:"").join("");this.j.textContent=`.${this.f}::cue {${b}}`}}destroy(){this.o.classList.remove(this.f);document.head.removeChild(this.j);this.l=!0;return Promise.resolve()}};
|
|
527
|
-
b;else throw new _.
|
|
528
|
-
_.
|
|
529
|
-
{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",
|
|
530
|
-
_.
|
|
531
|
-
_.
|
|
532
|
-
_.
|
|
533
|
-
_.
|
|
527
|
+
116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49]);_.kt={};_.zv=class{constructor(a){a=a.getConfiguration();a=_.Yg(a.textStyle||a.textstyle||{});this.K=typeof a.backgroundColor===_.Nf?a.backgroundColor:null;this.R=typeof a.windowColor===_.Nf?a.windowColor:null;this.M=typeof a.fontColor===_.Nf?a.fontColor:null;this.P=typeof a.fontFamily===_.Nf?a.fontFamily:null;this.I=typeof a.fontSize===_.Nf?a.fontSize:null;this.C=typeof a.fontSizePercent===_.r?a.fontSizePercent:null;this.H=typeof a.edgeColor===_.Nf?a.edgeColor:"rgba(0, 0, 0, 1)";this.w=null;typeof a.edgeType===
|
|
528
|
+
_.Nf&&(this.w=a.edgeType)}getBackgroundColor(){return this.K}setBackgroundColor(a){this.K=a;this.h()}getWindowColor(){return this.R}setWindowColor(a){this.R=a;this.h()}getFontFamily(){return this.P}setFontFamily(a){this.P=a;this.h()}getFontColor(){return this.M}setFontColor(a){this.M=a;this.h()}getFontSize(){return this.I}setFontSize(a){this.I=a;this.h()}getFontSizePercent(){return null===this.C?yv:this.C}setFontSizePercent(a){this.C=a;this.h()}getEdgeColor(){return this.H}setEdgeColor(a){this.H=
|
|
529
|
+
a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.zv.prototype.setEdgeType=_.zv.prototype.setEdgeType;_.zv.prototype.getEdgeType=_.zv.prototype.getEdgeType;_.zv.prototype.setEdgeColor=_.zv.prototype.setEdgeColor;_.zv.prototype.getEdgeColor=_.zv.prototype.getEdgeColor;_.zv.prototype.setFontSizePercent=_.zv.prototype.setFontSizePercent;_.zv.prototype.getFontSizePercent=_.zv.prototype.getFontSizePercent;_.zv.prototype.setFontSize=_.zv.prototype.setFontSize;
|
|
530
|
+
_.zv.prototype.getFontSize=_.zv.prototype.getFontSize;_.zv.prototype.setFontColor=_.zv.prototype.setFontColor;_.zv.prototype.getFontColor=_.zv.prototype.getFontColor;_.zv.prototype.setFontFamily=_.zv.prototype.setFontFamily;_.zv.prototype.getFontFamily=_.zv.prototype.getFontFamily;_.zv.prototype.setWindowColor=_.zv.prototype.setWindowColor;_.zv.prototype.getWindowColor=_.zv.prototype.getWindowColor;_.zv.prototype.setBackgroundColor=_.zv.prototype.setBackgroundColor;
|
|
531
|
+
_.zv.prototype.getBackgroundColor=_.zv.prototype.getBackgroundColor;var yv=1/15;var Av;
|
|
532
|
+
_.Bv=class extends _.zv{constructor(a){super(a);this.o=a.getSurface().getMedia();this.f=`clpp-video-${Av++}`;this.j=document.createElement(_.Pf);this.l=this.A=!1;_.xp(this.o,this.f);document.head.appendChild(this.j);this.h()}append(){}remove(){return!0}isTextVisible(){return this.A}setTextVisibility(a){this.A=a}h(){if(!this.l){var a={"background-color":this.getBackgroundColor(),color:this.getFontColor(),"font-family":this.getFontFamily(),"font-size":this.getFontSize(),"text-shadow":_.st(this)},b=
|
|
533
|
+
Object.keys(a).map(c=>null!==a[c]?`${c}:${a[c]};`:"").join("");this.j.textContent=`.${this.f}::cue {${b}}`}}destroy(){this.o.classList.remove(this.f);document.head.removeChild(this.j);this.l=!0;return Promise.resolve()}};Av=0;var Cv=class{a(){return!0}create(a){return new _.Bv(a)}};var Dv=class{constructor(a){this.f=a;this.a=null;this.g=new _.S("clpp.text.Mp4TextParser")}parseInit(a){let b;try{const c=_.mt(_.xc);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.ttml.Mp4TtmlParser class is not available. Please register the ttml component first.")}catch(c){b=null}if(b)this.a=b;else{try{const c=_.mt(_.yc);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.vtt.Mp4VttParser class is not available. Please register the vtt component first.")}catch(c){b=null}if(b)this.a=
|
|
534
|
+
b;else throw new _.J(_.C,2,2011);}}parseMedia(a,b){if(!this.a)throw new _.J(_.C,2,2011);return this.a.parseMedia(a,b)}};_.jr(function(){ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(a,b){b=void 0!==b?b:this.byteLength;a=Math.floor(a);b=Math.floor(b);0>a&&(a+=this.byteLength);0>b&&(b+=this.byteLength);a=Math.min(Math.max(0,a),this.byteLength);b=Math.min(Math.max(0,b),this.byteLength);if(0>=b-a)return new ArrayBuffer(0);const c=new ArrayBuffer(b-a),d=_.E(c);a=new Uint8Array(this,a,b-a);d.set(a);return c})});
|
|
535
|
+
_.jr(function(){if(window.Document){var a=Element.prototype;a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||a.webkitRequestFullscreen;a=Document.prototype;a.exitFullscreen=a.exitFullscreen||a.mozCancelFullScreen||a.msExitFullscreen||a.webkitExitFullscreen;Vd in document||(Object.defineProperty(document,Vd,{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",
|
|
536
|
+
{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",ct);document.addEventListener("webkitfullscreenerror",ct);document.addEventListener("mozfullscreenchange",ct);document.addEventListener("mozfullscreenerror",ct);document.addEventListener("MSFullscreenChange",ct);document.addEventListener("MSFullscreenError",ct)}});
|
|
537
|
+
_.jr(function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:()=>navigator.language?[navigator.language]:["en"]})});_.jr(function(){_.rh("mathRound.install")});
|
|
538
|
+
_.jr(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(_.rh("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=et,document.exitPictureInPicture=ft,document.addEventListener("webkitpresentationmodechanged",dt,!0))}});
|
|
539
|
+
_.jr(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=gt)}});_.jr(function(){_.rh("VideoPlayPromise.install");if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}});
|
|
540
|
+
_.jr(function(){if(window.VTTCue)_.qh("Using native VTTCue.");else if(window.TextTrackCue){var a=TextTrackCue.length;if(3===a)_.qh(Bb),window.VTTCue=ht;else if(6===a)_.qh("Using VTTCue polyfill from 6 argument TextTrackCue."),window.VTTCue=it;else{try{var b=!!ht(1,2,"")}catch(c){b=!1}b&&(_.qh(Bb),window.VTTCue=ht)}}else _.sh("VTTCue not available.")});_.vh(new Wu);_.lt(_.uc,Dv);_.Xo("native",new Cv);Bl(_.Dc,()=>new kv(_.Dc));Bl(_.pg,()=>new kv(_.pg));Bm(pv);Bm(uv);
|
|
541
|
+
Bn=[new Gu,new Eu,new Lu,new Nu].filter(a=>a.f());_.Ev=class{constructor(a,b,c,d){this.id=a;this.f=b;this.a=c;this.h=d}getDuration(){return this.a}getId(){return this.id}Xb(){return this.f}Nd(){return this.h}Xc(a){return this.getId()===a.getId()&&this.Xb()===a.Xb()&&this.getDuration()===a.getDuration()&&this.Nd()===a.Nd()}};_.w("clpp.media.TimelineWindow",_.Ev);_.Ev.prototype.isDynamic=_.Ev.prototype.Nd;_.Ev.prototype.getStart=_.Ev.prototype.Xb;_.Ev.prototype.getId=_.Ev.prototype.getId;_.Ev.prototype.getDuration=_.Ev.prototype.getDuration;_.Fv=new _.S("clpp.media.TimestampParser");_.Gv=class{constructor(){this.a=[];this.f=-1;this.h=null}bi(a){return this.a[a]||null}ci(){return this.a.length}di(){return this.a}ng(){return this.a[this.f]||null}Wh(){return this.f}};_.w("clpp.media.Timeline",_.Gv);_.Gv.prototype.getCurrentWindowIndex=_.Gv.prototype.Wh;_.Gv.prototype.getCurrentWindow=_.Gv.prototype.ng;_.Gv.prototype.getWindows=_.Gv.prototype.di;_.Gv.prototype.getWindowCount=_.Gv.prototype.ci;_.Gv.prototype.getWindow=_.Gv.prototype.bi;_.vt={};_.wt={};var ot="raised",pt="depressed",rt="dropshadow",qt="uniform";_.w("clpp.text.EdgeType",{NONE:_.Ae,RAISED:ot,DEPRESSED:pt,DROP_SHADOW:rt,UNIFORM:qt});_.Hv=class{onPlayerCreated(){}onContentWillLoad(){return Promise.resolve()}onContentLoaded(){return Promise.resolve()}onPlayerWillDestroy(){}onPlayerWillRelease(){}};};f.call(g,window);g.clpp._ = _;delete window.clpp; export let clpp = g.clpp; export default clpp;
|