@castlabs/prestoplay 6.13.0 → 6.14.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 +42 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -6
- package/cjs/cl.cast.js +111 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +528 -518
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +60 -58
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +265 -274
- package/cjs/cl.muxdata.js +15 -14
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +70 -70
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +441 -431
- package/cl.crypto.js +8 -8
- package/cl.dash.js +68 -68
- package/cl.externs.js +60 -58
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +236 -239
- package/cl.muxdata.js +13 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- 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.youbora.js +15 -15
- package/clpp.styles.css +2 -0
- package/package.json +4 -4
- package/typings.d.ts +93 -50
package/cl.core.js
CHANGED
|
@@ -1,300 +1,307 @@
|
|
|
1
|
-
let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,ka,ma,qa,ra,ta,ua,va,wa,
|
|
2
|
-
Yi
|
|
3
|
-
|
|
4
|
-
ma="CHECKSUM";_.na="CODECS";_.oa="Cannot retrieve buffer information due to platform limitations";_.pa="CastlabsPlayer";qa="Content-Length";ra="Content-Type";_.sa="Could not find configured DRM environment.";ta="DRM licenses loaded";ua="DRMtoday";va="DRMtodayOnboard";wa="Destroying player";_.xa="Disable track type ";_.ya="EXT-X-BYTERANGE";_.za="EXT-X-DATERANGE";_.Aa="EXT-X-DISCONTINUITY";_.Ba="EXT-X-DISCONTINUITY-SEQUENCE";_.Ca="EXT-X-ENDLIST";_.Da="EXT-X-KEY";_.Ea="EXT-X-MAP";
|
|
5
|
-
_.Ga="EXT-X-PART-INF";_.Ha="EXT-X-PLAYLIST-TYPE";_.
|
|
6
|
-
_.cb="
|
|
7
|
-
_.sb="
|
|
8
|
-
|
|
9
|
-
_.gc="ad-
|
|
10
|
-
_.p="audio";_.
|
|
11
|
-
cd="clpp-visible";_.
|
|
12
|
-
_.wd="
|
|
13
|
-
|
|
14
|
-
_.Be="
|
|
15
|
-
Ye="primary-before-load";
|
|
16
|
-
_.Bf="timeupdate";_.
|
|
17
|
-
fg="webkitneedkey";_.
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
_.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
1,
|
|
84
|
-
_.
|
|
85
|
-
a.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
(b.
|
|
97
|
-
_.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
_.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
_.
|
|
108
|
-
_.
|
|
109
|
-
_.
|
|
110
|
-
_.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
_.
|
|
114
|
-
|
|
115
|
-
_.
|
|
116
|
-
|
|
117
|
-
_.
|
|
118
|
-
|
|
119
|
-
_.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
1
|
+
let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,ka,ma,qa,ra,ta,ua,va,wa,Oa,Ta,Va,Wa,Xa,Ya,ab,fb,gb,ib,jb,kb,lb,mb,nb,ob,qb,tb,yb,Bb,Cb,Db,Gb,Ib,Mb,Nb,Pb,Qb,Sb,uc,Ac,Ic,Pc,Qc,Wc,Xc,Yc,$c,ad,cd,dd,ed,gd,hd,id,jd,kd,ld,td,wd,Cd,Dd,Ed,Fd,Hd,Kd,Ld,Nd,Sd,ce,de,fe,ge,me,Ee,Le,Ne,Oe,Pe,Qe,Re,Se,We,Xe,Ye,Ze,$e,af,bf,cf,gf,jf,tf,wf,Cf,Jf,Kf,bg,fg,gg,hg,ig,jg,lg,mg,ng,og,pg,qg,tg,ug,zg,wg,Hg,Ig,Mg,Og,Wg,fh,gh,$g,ch,ih,kh,jh,oh,ph,qh,th,uh,wh,xh,Bh,Dh,Fh,zh,Hh,Mh,Oh,Nh,Ph,Qh,Rh,Uh,Vh,Yh,xi,Bi,Ci,Di,Ei,Fi,Hi,Ii,Ji,Ki,Ni,Qi,Wi,Xi,aj,cj,
|
|
2
|
+
Yi,$i,bj,dj,ej,fj,hj,ij,pj,vj,wj,Aj,Fj,Hj,Ej,Rj,Kj,Jj,ck,dk,fk,gk,hk,ik,jk,kk,mk,lk,nk,ok,rk,sk,tk,ek,vk,xk,zk,Bk,Dk,Ik,Jk,Kk,Lk,Mk,Nk,Ok,Pk,Qk,Rk,Sk,Yk,hl,jl,pl,tl,vl,Cl,Pl,yl,Kl,Ul,Wl,Xl,hm,im,pm,sm,tm,vm,xm,ym,zm,qm,wm,Am,Bm,Cm,Dm,Em,Fm,Lm,Qm,Sm,Um,Tm,Wm,Om,cn,$m,bn,an,Rm,dn,en,fn,mn,nn,on,rn,vn,wn,yn,tn,sn,Gn,Hn,Ln,Kn,Nn,Pn,Qn,Mn,Sn,Tn,Un,Zn,eo,fo,go,ko,lo,jo,mo,io,ho,oo,qo,so,to,uo,vo,wo,xo,yo,zo,Ao,Bo,Fo,Jo,Lo,No,Oo,Qo,Xo,Ro,So,Yo,Vo,Zo,$o,cp,gp,hp,kp,mp,np,lp,ip,bp,fp,dp,ep,qp,rp,sp,tp,up,
|
|
3
|
+
wp,yp,zp,Bp,Dp,Fp,xp,Gp,Hp,Cp,Ep,Ip,Jp,Op,Qp,Pp,Rp,Sp,Tp,Up,Lp,Wp,Mp,Kp,aq,eq,fq,mq,nq,oq,rq,pq,qq,sq,tq,uq,vq,wq,xq,yq,zq,Aq,Bq,Dq,Eq,Fq,Hq,Jq,Oq,Pq,Qq,Sq,Tq,Uq,Wq,Xq,Vq,$q,cr,br,ar,dr,gr,kr,jr,pr,rg,sg;_.aa=" is registered.";ba=" is unsupported on this platform.";ca=" to a log level. Falling back to default!";_.da="6.14.1";_.fa="AdaptationSet";_.ha="Already destroyed. No-op";_.ia="Already released. No-op";_.ja="Autoplay is not allowed due to browser policy.";ka="Autoplay should not be used for preloaded streams. ";
|
|
4
|
+
_.la="BANDWIDTH";ma="CHECKSUM";_.na="CODECS";_.oa="Cannot retrieve buffer information due to platform limitations";_.pa="CastlabsPlayer";qa="Content-Length";ra="Content-Type";_.sa="Could not find configured DRM environment.";ta="DRM licenses loaded";ua="DRMtoday";va="DRMtodayOnboard";wa="Destroying player";_.xa="Disable track type ";_.ya="EXT-X-BYTERANGE";_.za="EXT-X-DATERANGE";_.Aa="EXT-X-DISCONTINUITY";_.Ba="EXT-X-DISCONTINUITY-SEQUENCE";_.Ca="EXT-X-ENDLIST";_.Da="EXT-X-KEY";_.Ea="EXT-X-MAP";
|
|
5
|
+
_.Fa="EXT-X-MEDIA-SEQUENCE";_.Ga="EXT-X-PART-INF";_.Ha="EXT-X-PLAYLIST-TYPE";_.Ja="EXT-X-PRELOAD-HINT";_.Ka="EXT-X-PROGRAM-DATE-TIME";_.La="EXT-X-SERVER-CONTROL";_.Na="EXT-X-TARGETDURATION";Oa="Error while decoding string!";_.Pa="Error while fetching license!";_.Qa="FairPlay Certificate URL is not defined";_.Ra="FairPlay License URL is not defined";_.Sa="GROUP-ID";Ta="HW_SECURE_ALL";Va="HW_SECURE_CRYPTO";Wa="HW_SECURE_DECODE";Xa="HeaderDrm";Ya="InvalidStateError";_.$a="LANGUAGE";ab="License verification failed: ";
|
|
6
|
+
_.cb="Loading player with configuration";_.db="MaxHeight";_.eb="MaxWidth";fb="Missing media element";gb="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";ib="No event provided!";jb="No items in the playlist";kb="No sources provided!";lb="No track data attached to the event, unable to add track!";mb="Not a persistent session.";nb="NotAllowedError";ob="NotSupportedError";_.pb="PlayReady License URL is not defined";qb="Player not ready yet.";_.rb="Player sources";
|
|
7
|
+
_.sb="Please make sure ";tb="Preloading is not supported by this player.";_.ub="QualityLevel";_.vb="RESOLUTION";_.wb="Releasing player with source";_.xb="Representation";yb="STANDARD";_.zb="SW_SECURE_CRYPTO";_.Ab="SW_SECURE_DECODE";Bb="Session is closed";Cb="Signature Verification failed";Db="Skipping Session creation. License for init data was already requested in ";_.Eb="SmoothStreamingMedia";_.Fb="TYPE";Gb="The index is not in the allowed range.";_.Hb="URI";Ib="Unable to translate ";_.Jb="Unhandled/ignored event";
|
|
8
|
+
_.Kb="Unregistering listeners";Mb="Unsupported keySystem";Nb="Using VTTCue polyfill from 3 argument TextTrackCue.";_.Ob="VIDEO";Pb="Wait for preloading to finish";Qb="WebkitEmeManager.MediaKeySession.load";_.Rb="Widevine License URL is not defined";Sb="Will create EME Manager: ";_.Tb="X-ASSET-LIST";_.Ub="X-ASSET-URI";_.Vb="X-PLAYOUT-LIMIT";_.Wb="X-RESUME-OFFSET";_.Xb="ad-break-started";_.Zb="ad-break-stopped";_.$b="ad-buffering";_.ac="ad-clicked";_.bc="ad-completed";_.cc="ad-first-quartile";
|
|
9
|
+
_.dc="ad-impression";_.ec="ad-loaded";_.fc="ad-midpoint";_.gc="ad-paused";_.hc="ad-progress";_.ic="ad-resumed";_.jc="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";uc="application/mp4";_.vc='application/mp4; codecs\x3d"stpp"';_.wc='application/mp4; codecs\x3d"wvtt"';_.yc="application/ttml+xml";
|
|
10
|
+
_.zc="application/vnd.ms-sstr+xml";Ac="application/x-www-form-urlencoded";_.p="audio";_.Ec="audio/aac";_.Fc="audio/ac3";_.Gc="audio/eac3";_.Hc="audio/mp4";Ic='audio/mp4;codecs\x3d"mp4a.40.2"';_.Jc="audiobufferchanged";_.Kc="autoplaynotallowed";_.Lc="bitratechanged";_.Mc="boolean";_.Nc="bufferingended";_.Oc="bufferingstarted";Pc="canplay";Qc="canplaythrough";_.Rc="castingstarted";_.Sc="caststatuschanged";_.Tc="cdn-switch-success";_.Uc="cenc";_.Vc="center";Wc="certificate-request";Xc="change";Yc="chrome";
|
|
11
|
+
_.Zc="clpp-fill";$c="clpp-hidden";ad="clpp-mc-playlist";cd="clpp-mc-playlist-item";dd="clpp-mc-playlist-video-el";ed="clpp-visible";_.fd="clpp.cast.CastSender";gd="clpp.drm.HeaderDrm";hd="clpp.drm.eme.AppleEmeManager";id="clpp.interstitial.Player";jd="clpp.native.Player";kd="clpp.plist.McPlaylist";ld="clpp.utils.Platform";_.md="codecs";_.nd="column-reverse";_.od="com.adobe.primetime";_.pd="com.apple.fps";_.qd="com.apple.hls.interstitial";_.sd="com.microsoft.playready";td="com.microsoft.playready.recommendation";
|
|
12
|
+
_.ud="com.widevine.alpha";_.vd="config.drm.customData is not defined";wd="controls";_.xd="cuechange";_.yd="decoder";_.zd="destroy()";_.Ad="disabled";_.Bd="div";Cd="drm.mediaKeys.end";Dd="drm.mediaKeys.start";Ed="drm.onPlay.end";Fd="drm.onPlay.start";_.Gd="drmexpirationupdate";Hd="drmrenewalstarted";_.Id="drmsessionpersisted";_.Jd="drmsessionupdate";Kd="drmtoday";Ld="durationchange";_.Md="ec-3";Nd="encrypted";_.Od="end";_.Pd="ended";_.Qd="error";_.Rd="forced";Sd="fullscreenElement";_.Td="function";
|
|
13
|
+
_.Ud="height";_.Vd="hidden";_.Wd="html";_.Yd="image";_.Zd="internal-error";ce="itemchange";de="keystatuseschange";_.ee="left";fe="license-renewal";ge="license-request";_.he="line-left";_.ie="line-right";_.je="live-turned-static";_.ke="loadeddata";_.le="loadedmetadata";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";_.xe="none";_.r="number";_.ye="object";_.ze="onBitrateChanged()";
|
|
14
|
+
_.Ae="onPlayerError()";_.Be="onPlayerWillDestroy";_.Ce="onPlayerWillRelease";_.De="onStateChanged()";Ee="online-status-changed";_.Fe="optional";_.Ge="org.w3.clearkey";_.He="output-restricted";_.Ie="pause";_.Je="persistent";_.Ke="persistent-license";Le="picture-in-picture";_.Me="play";Ne="player.afterLoad.end";Oe="player.afterLoad.start";Pe="player.beforeLoad.end";Qe="player.beforeLoad.start";Re="player.load.end";Se="player.load.start";_.Te="playing";_.Ue="playlist-item-changed";_.Ve="playlist-modified";
|
|
15
|
+
We="playlist.next.end";Xe="playlist.next.start";Ye="preload-aborted";Ze="preload-failed";$e="preloaded";af="preloading";bf="primary-before-load";cf="primary-content";_.df="progress";_.ef="px";_.ff="ratechange";gf="released";_.hf="releasing";jf="removetrack";_.kf="required";_.lf="resize";_.mf="right";_.nf="seeked";_.of="seeking";_.pf="showing";_.qf="simid-creative-started";_.rf="simid-creative-stopped";_.sf="sinf";tf="stalled";_.uf="start";_.vf="statechanged";wf="status-pending";_.xf="stbl";_.yf="string";
|
|
16
|
+
_.zf="stsd";_.Af="style";_.Bf="subtitles-htmlcue";Cf="temporary";_.Df="text/vtt";_.Ef="text/xml";_.Ff="timeupdate";_.Gf="trak";_.Hf="ttml-xml";_.If="und";Jf="unknown";Kf="update";_.Lf="urn:scte:scte35";_.Mf="urn:scte:scte35:2014";_.Of="user-seeked";_.Pf="user-seeking";_.Qf="value";_.Vf="vertical-lr";_.Wf="vertical-rl";_.u="video";_.Xf="video/mp2t";_.Yf="video/mp4";_.Zf="videobufferchanged";_.$f="videotrackchanged";_.ag="vimond-response";bg="visibilitychange";_.cg="vtt-xml";_.dg="waiting";_.eg="waitingforkey";
|
|
17
|
+
fg="webkit-org.w3.clearkey";gg="webkitkeyadded";hg="webkitkeyerror";ig="webkitkeymessage";jg="webkitneedkey";_.kg="width";lg="x-dt-csl-tracking-token";mg="x-dt-follow-up-token";ng="x-dt-resp-code";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)}};
|
|
18
|
+
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})}};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())})};_.w=function(a){return ug(a())};
|
|
19
|
+
_.x=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};_.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};_.Ag=function(a){for(const b in a)if(void 0!==a[b])return!0;return!1};
|
|
20
|
+
zg=function(a,b,c){const d=c+1;if(_.z(a)||!_.Bg(a))a={};for(const e in b)c=b[e],wg(c)||_.z(c)||_.Cg(c)||c instanceof Element?a[e]=c:_.Bg(c)&&c.buffer&&c.buffer instanceof ArrayBuffer&&_.Cg(c.subarray)?a[e]=c.subarray(0):c instanceof Array?a[e]=zg([],c,d):!_.z(c)&&_.Dg(c)&&20>d&&(a[e]=zg(a[e],c,d));return a};wg=function(a){a=typeof a;return a===_.yf||a===_.r||a===_.Mc};_.z=function(a){return null===a||"undefined"===typeof a};_.Bg=function(a){return typeof a===_.ye};
|
|
21
|
+
_.Cg=function(a){return typeof a===_.Td};_.Eg=function(a){return typeof a===_.yf};_.Fg=function(a){return typeof a===_.r};_.Dg=function(a){if(_.z(a)||!_.Bg(a))return!1;a=Object.getPrototypeOf(a);return a===Object.prototype||null===a};
|
|
22
|
+
_.Gg=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||!_.Bg(a)||!_.Bg(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};
|
|
23
|
+
Hg=function(a){return(Number.hasOwnProperty("isNaN")?Number.isNaN:b=>b!==b)(a)};Ig=function(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b};_.Jg=function(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};Mg=function(a){return a&&0<=Kg[a]?Kg[a]:Lg};Og=function(a){if(!a)return _.B("clpp.log",Ib+a+ca),-1;const b=Ng[a.toUpperCase()];return void 0===b?(_.B("clpp.log",Ib+a+ca),-1):b};_.Qg=function(a){Pg.info.apply(Pg,arguments)};_.Rg=function(a){Pg.debug.apply(Pg,arguments)};
|
|
24
|
+
_.B=function(a){Pg.warn.apply(Pg,arguments)};_.Sg=function(a){Pg.error.apply(Pg,arguments)};_.Vg=function(a){if(a){var b=a.a();b in _.Tg?_.Ug.warn("Player-Factory '"+b+"' already registered"):(_.Tg[b]=a,_.Ug.info("Registered Player-Factory: '"+b+"'"))}};_.Xg=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)Wg(b[c]);a.a.clear()};_.Yg=function(a,b,c,d){const e=f=>{for(const g of c)a.off(b,g,e);d(f)};for(const f of c)a.on(b,f,e)};
|
|
25
|
+
Wg=function(a){a.target.removeEventListener(a.type,a.a,a.f);a.target=null;a.a=null};
|
|
26
|
+
fh=function(a,b){a.h.debug("onMetadata_()");b.mode=_.Vd;const c=[];let d=!0;const e=f=>{for(var g of c)if(f.startTime===g.startTime&&f.endTime===g.endTime)return g;g={schemeIdUri:"",value:"",startTime:0,endTime:0,id:"",type:_.Zg,eventElement:null};a.o&&d&&"SCTE35-IN"===f.value.key&&0<f.startTime?(g.startTime=0,g.endTime=f.startTime):(g.startTime=f.startTime,g.endTime=f.endTime);d=!1;c.push(g);return c[c.length-1]};if(b.cues){for(const f of b.cues){if($g(a,f))continue;const g=e(f);switch(f.value.key){case "SCTE35-IN":case "SCTE35-OUT":g.schemeIdUri=
|
|
27
|
+
_.Mf;g.type=_.ah;break;case "X-CUSTOM-ID":g.id=f.value.data}}for(const f of c)a.m.trigger(new _.C(_.bh,{detail:f}));Array.prototype.push.apply(a.g,c);ch(a,c,b);a.f.off(b,_.xd);a.f.on(b,_.xd,f=>{f=f.target.activeCues;f=f.length?$g(a,f[0]):a.a;var g;if(g=f){{g=f;const h=a.m.getPosition();g=g.startTime<=h&&h<g.endTime}}if(g)a.a=f,a.m.trigger(new _.C(_.dh,{detail:f}));else{if(f=a.a)f=a.a,g=a.m.getPosition(),f=f.endTime<=g;f&&(f=a.a,a.a=null,a.m.trigger(new _.C(_.eh,{detail:f})))}})}};
|
|
28
|
+
gh=function(a,b){a.j=b;a.l=a.j.textTracks;a.f.on(a.l,_.nc,c=>{c=c.track;c.kind===_.re&&fh(a,c)})};$g=function(a,b){for(const c of a.g)if(b.startTime===c.startTime&&b.endTime===c.endTime)return c;return null};ch=function(a,b,c){if(a.o){for(;0<c.cues.length;)c.removeCue(c.cues[0]);b.forEach(function(d){c.addCue(new DataCue(d.startTime,d.endTime,{key:"SCTE35-OUT",data:null}))})}};_.hh=function(a){return Array.isArray(a)?a:[a]};
|
|
29
|
+
ih=function(a,b){return a===b?!0:a.length===b.length&&a.every((c,d)=>c===b[d])};kh=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 jh(a,b)&&jh(b,a)};jh=function(a,b){const c=new Set(a);return b.every(d=>c.has(d))};_.lh=function(a,b={}){if(b.Me){const c=[];for(const d of a)c.some(e=>b.Me(d,e))||c.push(d);return c}return Array.from((new Set(a)).values())};
|
|
30
|
+
oh=function(a,b){b=b.track;b.kind!==_.re&&(b.mode===_.pf&&(b.mode=_.Vd),a.a.on(b,_.xd,c=>{c=c.target||c.srcElement;c.mode=_.Vd;c.activeCues&&(c=Array.from(c.activeCues).map(a.o),a.l.append(c,[]))}))};ph=function(a,b,c,d){a=`${a===_.F?"FATAL":"RECOVERABLE"} Clpp-Error [Category ${b} - Code ${c}]`;if(_.Eg(d))a+=": "+d;else if(null!=d&&void 0!=d)if(null!=d.message&&void 0!=d.message)a+=": "+d.message,delete d.message;else try{a+=": "+JSON.stringify(d)}catch(e){}return a};
|
|
31
|
+
qh=function(a,b){const c=b||ih;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)}};_.rh=function(a){return null!=a};th=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}throw new sh("No non-null, non-undefined value found");};uh=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}};
|
|
32
|
+
_.vh=function(a){var b;a instanceof _.vh?(wh(this,a.Ya),this.kc=a.kc,this.Ja=a.Ja,xh(this,a.Ec),this.ya=a.ya,_.yh(this,zh(a.a)),this.Zb=a.Zb):a&&(b=String(a).match(Ah))?(wh(this,b[1]||"",!0),this.kc=Bh(b[2]||""),this.Ja=Bh(b[3]||"",!0),xh(this,b[4]),this.ya=Bh(b[5]||"",!0),_.yh(this,b[6]||"",!0),this.Zb=Bh(b[7]||"")):this.a=new _.Ch(null)};wh=function(a,b,c){a.Ya=c?Bh(b,!0):b;a.Ya&&(a.Ya=a.Ya.replace(/:$/,""))};
|
|
33
|
+
xh=function(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Ec=b}else a.Ec=null};_.yh=function(a,b,c){b instanceof _.Ch?a.a=b:(c||(b=Dh(b,Eh)),a.a=new _.Ch(b))};Bh=function(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""};Dh=function(a,b,c){return typeof a===_.yf?(a=encodeURI(a).replace(b,Fh),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null};Fh=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};_.Ch=function(a){this.f=a||null};
|
|
34
|
+
zh=function(a){var b=new _.Ch;b.f=a.f;if(a.a){var c={},d;for(d in a.a)c[d]=a.a[d].concat();b.a=c;b.g=a.g}return b};Hh=function(a,b){const c=Gh[a];for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a===_.G?"":null};_.I=function(a,b,c,d){d=void 0===d?{}:d;a=a.getAttribute(b);if(!a&&d.required)throw new _.H(_.F,4,4023,`Required attribute missing: ${b}`);return a?a.value:c||null};
|
|
35
|
+
_.Jh=function(a){var b=(a||"").split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Ih.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a};_.Kh=function(a,b){a=_.Jh(a);b=_.Jh(b);return a.split("-")[0]==b.split("-")[0]};_.Lh=function(a,b){for(const c of a)if(!b(c))return!1;return!0};Mh=function*(a){for(let b=0;b<a;b++)yield b};
|
|
36
|
+
Oh=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(Nh(a)==Nh(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;const c=_.J(a);b=_.J(b);for(const d of Mh(a.byteLength))if(c[d]!=b[d])return!1;return!0};Nh=function(a){return a instanceof ArrayBuffer?a:a.buffer};_.J=function(a,b=0,c=Infinity){return Ph(a,b,c,Uint8Array)};
|
|
37
|
+
Ph=function(a,b,c,d){const e=d.BYTES_PER_ELEMENT||1,f=Nh(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)};Qh=function(a,b=0,c=Infinity){return Ph(a,b,c,Uint16Array)};Rh=function(a,b=0,c=Infinity){return Ph(a,b,c,Uint32Array)};_.Sh=function(a,b=0,c=Infinity){return Ph(a,b,c,Int32Array)};_.Th=function(a,b=0,c=Infinity){return Ph(a,b,c,DataView)};
|
|
38
|
+
Uh=function(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer};Vh=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
|
+
_.Wh=function(a){if(!a)return"";a=_.J(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(Oa);return a}a=escape(Vh(a));try{return decodeURIComponent(a)}catch(b){throw Error(Oa);}};
|
|
40
|
+
Yh=function(a,b,c){if(!a)return"";if(!c&&0!==a.byteLength%2)throw Xh.error("Data has an incorrect length, must be even."),Error("Data does not seem to be UTF-16 encoded!");c=_.J(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(_.J(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 Vh(c)};
|
|
41
|
+
_.Zh=function(a,b){if(_.Eg(a))return a;let c="";b=!!b;const d=_.J(a);239==d[0]&&187==d[1]&&191==d[2]?c=_.Wh(d):254==d[0]&&255==d[1]?c=Yh(d.subarray(2),!1):255==d[0]&&254==d[1]&&(c=Yh(d.subarray(2),!0));const e=function(f,g){return f.byteLength<=g||32<=f[g]&&126>=f[g]}.bind(null,d);Xh.debug("Unable to find byte-order-mark, making an educated guess.");0==d[0]&&0==d[2]?c=Yh(a,!1):0==d[1]&&0==d[3]?c=Yh(a,!0):e(0)&&e(1)&&e(2)&&e(3)&&(c=_.Wh(a));if(c)return b&&(c=escape(c)),c;throw Error("Unable to detect text encoding");
|
|
42
|
+
};_.$h=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=Rh(d):2===c?e=Qh(d):e=_.J(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(Hg(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""}};_.ii=function(a){a=a.replace(/<[^>]+>/gi,"");hi.innerHTML=a;a=hi.textContent;return a=a.replace(/<[^>]+>/gi,"")};_.ki=function(a,b){b=void 0==b?!0:b;a=_.ji(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")};
|
|
45
|
+
_.ji=function(a){a=Vh(_.J(a));return btoa(a)};_.li=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};_.mi=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};_.ni=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};
|
|
46
|
+
_.oi=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};_.pi=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};
|
|
47
|
+
_.qi=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};
|
|
48
|
+
_.ui=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new _.H(_.F,4,4016,{invalidTag:b});b=c[1];var d=c[2];c=[];let e;if(d){d=new _.ri(d);var f;(f=_.qi(d,/^([^,=]+)(?:,|$)/g))&&(e=f[1]);const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.qi(d,g);)c.push(new _.si(f[1],f[2]||f[3]))}return new _.ti(a,b,c,e)};_.wi=function(){return{maxAttempts:1,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0,fatalStatusCodes:[...vi]}};
|
|
49
|
+
xi=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||[...vi]};
|
|
50
|
+
_.zi=function(a,b){_.Eg(a)&&(a={uris:[a]});Array.isArray(a)&&(a={uris:a});const c={uris:a.uris||[],type:a.type||_.yi,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||
|
|
51
|
+
[],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:[...vi],requestStartTimestamp:null};a.keyInfo&&(c.keyInfo=a.keyInfo);b&&xi(c,b);return c};
|
|
52
|
+
_.Ai=function(a,b,c,d,e,f,g,h){e&&(d=e);e={uri:d,data:b||new ArrayBuffer(0),headers:a,status:c,fromCache:!!a["x-shaka-from-cache"],timeMs:g,responseStartMs:h,request:f};if(200<=c&&299>=c&&202!==c)return e;g=null;try{g=_.Zh(b,!0)}catch(k){}_.Rg("HTTP error text:",g);throw new _.H(0<=(f.fatalStatusCodes||[]).indexOf(c)?_.F:1,1,1001,{url:d,status:c,responseText:g,headers:a,request:f,response:e});};
|
|
53
|
+
Bi=function(a,b){b=parseInt(b,10);Number.isNaN(b)&&(b=-1);a.bytesTotal=b;a.bytesLoaded=0;a.bytesRemaining=b};Ci=function(a,b,c){0<a.bytesRemaining&&(a.bytesRemaining-=b);a.bytesLoaded+=b;if(a.onProgress)a.onProgress(b,c)};Di=function(a,b,c){if(0>=a)return Promise.resolve();const d=8*c/a-b/1E3;return 0<d?new Promise(e=>{setTimeout(e,1E3*d)}):Promise.resolve()};
|
|
54
|
+
Ei=function(a,b,c){try{const d=a(b);if(d&&d.P&&d.abort)return c.resolve(d.P),()=>d.abort();c.resolve(d);return()=>Promise.resolve(d).then(()=>{}).catch(()=>{})}catch(d){return c.reject(d),()=>Promise.resolve()}};Fi=function(a,b){a.P.then(()=>b(!0),()=>b(!1));return a};_.Gi=function(a,b){a.a.push(Fi(b,()=>{{var c=a.a;const d=c.indexOf(b);-1<d&&c.splice(d,1)}}))};Hi=function(a,b){return _.w(function*(){const c=yield a.fetch(b);return _.Wh(c.data).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")})};
|
|
55
|
+
Ii=function(a,b){return _.w(function*(){const c=yield Hi(a,b);try{const d=JSON.parse(c);if(null==d||typeof d!==_.ye)throw Error("Not an object");return d}catch(d){throw new sh("Failed to parse JSON response","json-failed");}})};Ji=function(a,b,c,d){d=void 0===d?"HEAD":d;return _.w(function*(){if(!navigator.onLine)return!1;if(b){const e=_.zi(b,c);e.method=d;c||(e.timeout=5E3);e.headers["cache-control"]="no-cache";try{yield a.fetch(e).P}catch(f){if(1002===f.code||1003===f.code)return!1}}return!0})};
|
|
56
|
+
Ki=function(a){return`@@scheme:${a.scheme||""}`+`@@value:${a.value}`+`@@id:${a.id||""}@@type:${a.type||""}`+`@@protocol:${a.protocol||""}`};_.Li=function(a){return a&&a!==_.If?a:null};
|
|
57
|
+
Ni=function(a){if(!a)throw new _.H(_.F,3,3101,`Invalid track type: ${a}`);if(!_.Eg(a))throw new _.H(_.F,3,3101,`Invalid track type: ${a}. Track type must be a string!`);switch(a.toLowerCase()){case _.K:return _.K;case _.L:return _.L;case _.M:return _.M;case Mi:return Mi}throw new _.H(_.F,3,3101,`Unknown track type: ${a}.`);};
|
|
58
|
+
Qi=function(a,b){a=Ni(a);const c=_.Li(b.kind);let d=b.id;d||(d=String(_.Oi++));a=new _.Pi(d,c===_.re?Mi:a);a.kind=c;a.label=_.Li(b.label);a.language=_.Li(b.language);a.originalLanguage=b.originalLanguage||a.language;return a};_.Ri=function(a){return`${a.scheme}//`+`${a.a}${a.port?":"+a.port:""}${a.path}${a.g}${a.f}`};
|
|
59
|
+
_.Si=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)},""):""};_.Ti=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};
|
|
60
|
+
Wi=function(a,b){return a.startsWith("http:://")||a.startsWith("https:://")?a:(new URL(a,b)).toString()};Xi=function(a,b){return _.w(function*(){const c=_.zi(b);return yield Hi(a.f,c)})};aj=function(a,b,c){return _.w(function*(){const {mimeType:d,renditions:e}=yield Yi(a,b,c),f=new _.Pi("dummy",_.M),g=e.map((h,k)=>{k=new _.Zi(`R${k}`,f);k.bandwidth=h.bandwidth;k.Ic=h.Ic;k.codec=h.codec;k.width=h.width;k.height=h.height;return k});$i(g);return{renditions:g,mimeType:d||void 0}})};
|
|
61
|
+
cj=function(a){a=a.split("\n").filter(c=>c.trim().startsWith("#EXT-X-MEDIA:")).map(c=>bj(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};Yi=function(a,b,c){return _.w(function*(){const d=dj(b),e=ej(b,c);return{mimeType:yield fj(a,e,d[0]?d[0].codec:null),renditions:d}})};
|
|
62
|
+
$i=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.");};bj=function(a){const b=_.ui(0,a);a=d=>(d=b.getAttribute(d))?d.value:void 0;var c=a(_.Fb);c=null!=c?{AUDIO:_.L,VIDEO:_.M,SUBTITLES:_.K}[c]:void 0;return{type:c,groupId:a(_.Sa),name:a("NAME"),language:a(_.$a),nh:a("AUTOSELECT"),default:a("DEFAULT"),uh:a("FORCED"),Le:a("CHARACTERISTICS"),uri:a(_.Hb)}};
|
|
63
|
+
dj=function(a){return a.split("\n").filter(b=>b.trim().startsWith("#EXT-X-STREAM-INF:")).map(b=>{var c=_.ui(0,b);if(c.getAttribute(_.Ob))throw Error("Playlist contains alternative video streams.");var d=_.I(c,_.vb);b=d?Number(d.split("x")[0]):null;d=d?Number(d.split("x")[1]):null;var e=_.I(c,_.la);e=e?Number(e):null;var f=_.I(c,"AVERAGE-BANDWIDTH");f=f?Number(f):null;c=_.I(c,_.na);c=_.gj(_.u,c?c.split(","):[]);return b={bandwidth:e,Ic:f,codec:c,width:b,height:d,mimeType:null}})};
|
|
64
|
+
ej=function(a,b){return(a=a.split("\n").filter(c=>c.trim().endsWith(".m3u8"))[0])?Wi(a,b):null};fj=function(a,b,c){return _.w(function*(){if(!b||!c)return null;var d=yield Xi(a,b);d=[hj(d,b),ij(d,b)].filter(Boolean);return _.jj(d,_.u,c)})};hj=function(a,b){return(a=a.split("\n").find(c=>!c.startsWith("#")&&0<c.trim().length))?Wi(a,b):null};ij=function(a,b){a=a.split("\n").find(c=>c.startsWith("#EXT-X-MAP:"));return a?(a=_.I(_.ui(0,a),_.Hb))?Wi(a,b):null:null};
|
|
65
|
+
_.lj=function(a,b,c){for(const d of _.kj)if(d.probe(b,c))return d.create(a);return null};_.mj=function(a){a=_.kj.indexOf(a);0<=a&&_.kj.splice(a,1)};pj=function(a,b){var c=nj;oj.set(`${a.toLowerCase().split(";")[0]}-${c}`,{priority:c,plugin:b})};_.tj=function(a,b){var c=[qj,rj,sj,nj];for(const d of c)if(c=oj.get(`${a.toLowerCase().split(";")[0]}-${d}`)){const e=c.plugin(),f=e.isSupported(a,b);e.destroy();if(f)return c.plugin}return null};_.uj=function(a,b){b&&(a+=';codecs\x3d"'+b+'"');return a};
|
|
66
|
+
vj=function(a){a=a.split(/ *; */);a.shift();return(a=a.find(b=>b.startsWith("codecs\x3d")))?a.split("\x3d")[1].replace(/^"|"$/g,"").split(/ *, */).join(","):""};wj=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};
|
|
67
|
+
Aj=function(){if(xj)return xj;yj||(yj=new _.zj(()=>{xj=null}));(xj=document.querySelector(_.u)||document.querySelector(_.p))||(xj=document.createElement(_.u));yj.ca(1);return xj};_.Bj=function(){return!!navigator.userAgent.match(/Edge?\//)};_.Cj=function(a){return(navigator.userAgent||"").includes(a)};_.Dj=function(a){return _.Cj("Tizen"+(a?" "+String(a):""))};
|
|
68
|
+
Fj=function(a){const b={major:-1,name:Jf};if(!a)return b;var c=a.replace(/_/g,".");b.name=c;c=c.split(".");1<=c.length&&(b.major=Ej(a,c[0]));2<=c.length&&(b.minor=Ej(a,c[1]));3<=c.length&&(b.patch=Ej(a,c[2]));4<=c.length&&(b.build=Ej(a,c[3]));return b};_.Gj=function(){return _.Cj("Web0S")};_.Ij=function(){return _.Gj()&&79===Hj().major};
|
|
69
|
+
Hj=function(){const a=Jj();const b=["ie","edge","opera","firefox","safari",Yc];var c=Kj();const d=Lj[c];for(let e=0,f=b.length;e<f;e++)if(c=d[b[e]]&&a.match(d[b[e]]))return Fj(c[1]);return Fj("")};_.Mj=function(){return _.Cj("CrKey")};_.Nj=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!_.Dj()};_.Oj=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:_.Nj()&&1<navigator.maxTouchPoints};_.Pj=function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)};
|
|
70
|
+
Ej=function(a,b){try{return parseInt(b,10)}catch(c){Qj.warn("Unable to parse version number for '"+b+"' from '"+a+"'")}return-1};Rj=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};
|
|
71
|
+
Kj=function(){const a=Jj();if(!a)return Sj;var b=a.match(/^.+?(?=\))/);if(!b)return Sj;b=b[0];if(Rj(b,["iphone","ipad"]))return Tj;if(Rj(b,["android"]))return Uj;if(Rj(b,["macintosh"]))return Vj;if(Rj(b,["windows nt"]))return Wj;if(Rj(b,["tizen"]))return Xj;if(Rj(b,["web0s"]))return Yj;if(Rj(b,["linux"]))return Zj;Qj.warn("Unable to identify OS from user agent: "+a);return Sj};Jj=function(){let a=window.navigator.userAgent;return a=a.toLowerCase()};
|
|
72
|
+
_.bk=function(){var a=Kj();var b=Kj();var c=Lj[b];if(c){c=Jj().match(c.os_version)[1];c=Fj(c);if(b===Wj)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=Fj("");a:{c=Jj();const e=["ie","edge","opera","firefox","safari",Yc];var d=Kj();d=Lj[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=ak}return{os:a,osVersion:b,browser:c,browserVersion:Hj()}};
|
|
73
|
+
ck=function(a,b,c){return a.type!==c?!1:void 0!==b.id&&null!==b.id&&""!==b.id?a.id===b.id:_.Gg(a,{kind:_.Li(b.kind),language:_.Li(b.language),label:_.Li(b.label)},["kind","language","label"])};dk=function(a){return a.enabled||a.selected||a.mode===_.pf||a.mode===_.Vd};fk=function(a,b,c){return ek(a)&&b===_.M&&!!c.enableHlsVideoTrackInfo};
|
|
74
|
+
gk=function(a,b,c){return _.w(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.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})))})};hk=function(a,b,c){return ek(a)&&(b===_.L||b===_.K)&&!!c.enableMetadata};
|
|
75
|
+
ik=function(a,b,c){return _.w(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.Bc&&(d=d.Bc.get(`${b.type}:${b.label}`))&&d.Le&&(b.accessibility=d.Le.split(",").map(e=>e.trim()).map(e=>({value:e,type:b.type,protocol:"HLS"}))))})};jk=function(a,b){return a.g.filter(c=>c.type===b)};kk=function(a){(a=a.m.getTextDisplayer())&&a.remove(0,Infinity)};mk=function(a,b){if(a=lk(a,b))a=Array.from(a),b===_.K&&(a=a.filter(c=>c.kind!==_.re));return a};
|
|
76
|
+
lk=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 _.L:return a.audioTracks;case _.M:return a.videoTracks;case _.K:return a.textTracks;default:return null}};nk=function(a,b){return(a=a.a.get(b)||null)&&a.renditions[0]};ok=function(a,b){return(a=a.l.get(b))&&a.renditions[0]};
|
|
77
|
+
rk=function(a,b,c){const d=mk(a,b);if(c){if(void 0===a.g.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.h.debug("Activate track type "+b+" with ID: "+c.id);if(d){a.l.set(b,c);let f;var e=!0;let g=!1;switch(b){case _.K:f="mode";e=_.pf;g=_.Ad;break;case _.L:f="enabled";break;case _.M:f="selected"}if(f)for(const h of d)h[f]=ck(c,h,c.type)?e:g}}else if(a.h.debug(_.xa+b),a.a.get(b)&&d&&b===_.K){for(e of d)e.mode=
|
|
78
|
+
_.Ad;a.a.set(b,null)}b===_.L?a.m.trigger(new _.C(_.pk)):b===_.K&&a.m.trigger(new _.C(_.qk))};sk=function(a,b,c){if(a.m){var d=a.m.getSurface().getMedia();if(d){var 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.I.push(e)}}};
|
|
79
|
+
tk=function(a,b){return _.w(function*(){var c=a.m.getConfiguration(),d=_.lj(c,b.mimeType,_.Df);if(d){c=_.zi(b.url);var e=yield a.m.getNetworkEngine().fetch(c).P;e&&e.data&&(c="External_"+`${a.G++}`,a.o[c]=b,d=d.a(_.J(e.data)),d={url:URL.createObjectURL(new Blob([d])),kind:b.kind,language:b.language,label:b.label,mimeType:_.Df},sk(a,d,c))}else a.h.warn("Track MIME type is not supported",b)})};ek=function(a){a=a.m.getLoadedSource();return!(!a||a.type!==_.uk&&!a.url.endsWith(".m3u8"))&&_.Nj()};
|
|
80
|
+
vk=function(a,b,c){c=_.hh(c).filter(e=>e);a.h.info("Find preferred tracks for",b,c);const d=jk(a,b);c.some(e=>{const f=_.Jh(e);return(e=d.find(g=>{g=_.Jh(g.language||"");return _.Kh(f,g)}))?(a.h.info("Will select track with id",e.id),rk(a,b,e),!0):!1})};xk=function(a){return a.name===nb&&wk.some(b=>a.message.startsWith(b))};
|
|
81
|
+
_.Ak=function(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&_.Oj()&&(a=360);const b=_.wi();b.maxAttempts=3;a={source:"",license:yk,viewerId:void 0,autoplay:void 0,pauseWhenInBackground:!1,manifest:{attemptParameters:_.wi(),availabilityWindowOverride:NaN,clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,autoCorrectDrift:!0,timeline:{version:1}},abr:{enabled:!0,defaultBandwidthEstimate:1E3,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,useSwitchIntervalForInitialSwitch:!1,
|
|
82
|
+
restrictions:zk(a),useCmsd:!1},drm:null,enableHtmlCue:!0,preferredAudioLanguage:"",preferredTextLanguage:"",preferredAudioRole:_.ne,preferredTextRole:"",preferredAudioChannelCount:2,preferredAudioCodec:[],preferredVideoCodec:[],preferSpatialAudio:!1,preferForcedSubtitles:!1,volume:null,startTime:null,loop:!1,lowLatencyMode:!1,suggestedPresentationDelay:void 0,muted:void 0,forceWaitForTracks:!1,streaming:{attemptParameters:b,bufferingGoal:10,rebufferingGoal:2,bufferBehind:30,ignoreTextStreamFailures:!1,
|
|
83
|
+
alwaysStreamText:!1,relativeTextTimestamp:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,disableAudioTracks:!1,disableVideoTracks:!1,smallGapLimit:.5,jumpLargeGaps:!0,durationBackoff:1,maxSegmentToMediaOffset:1,forceNativeTS:!1,preferNativeHlsOnSafari:!0,safeSeekOffset:5,stallEnabled:!0,stallThreshold:3,stallSkip:.5,bufferLimitUpdateInterval:.5,overridePasp:!1,enableLiveEdgeChasing:!1,chasingRate:1.15,startChasingAt:5,stopChasingAt:2,chaseJumpDistance:10,patchEdgeWhenMixedContent:!1,ignoreDrift:!1,
|
|
84
|
+
disableFragmentSupport:!1,disableMergedFragments:!1,ignoreManagedMediaSourceStreamingHints:!1},restrictions:zk(),tizen:{sideStreamText:_.Dj(2)},safari:{enableHlsVideoTrackInfo:!1,enableMetadata:!1},trickPlay:{speedUpMode:_.yd,preferTrickPlayTracks:!0}};if(_.Cj("Edge/")||_.Dj())a.streaming.gapDetectionThreshold=.5;_.Gj()&&(a.streaming.stallEnabled=!1);_.Ij()&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=1,a.streaming.gapDetectionThreshold=.02);_.Dj()&&(a.streaming.stallEnabled=
|
|
85
|
+
!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};zk=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}};
|
|
86
|
+
_.Ck=function(...a){if(!a)return _.Ak();var b=[_.Ak()];let c=!1;for(let d of a)null!==d&&void 0!==d&&(_.Eg(d)&&(d={source:d}),d.lowLatencyMode&&!c&&(b.push({streaming:{rebufferingGoal:.1,bufferLimitUpdateInterval:.01,ignoreDrift:!0,attemptParameters:{maxAttempts:3,baseDelay:250,backoffFactor:1}},abr:{bandwidthUpgradeTarget:.6,bandwidthDowngradeTarget:.95},manifest:{lowLatencyMode:!0}}),c=!0),b.push(d),null!=d.suggestedPresentationDelay&&b.push({manifest:{suggestedPresentationDelay:d.suggestedPresentationDelay}}));
|
|
87
|
+
a=_.xg.apply(null,b);_.Eg(a.volume)&&(""===""+a.volume?a.volume=null:a.volume=Number(a.volume));if(!_.z(a.volume)&&(!_.Fg(a.volume)||Hg(a.volume)))throw new _.H(_.F,7,7100,"config.volume is not a number");if(!_.z(a.preferredTextLanguage)&&!_.Eg(a.preferredTextLanguage)&&!Array.isArray(a.preferredTextLanguage))throw new _.H(_.F,7,7100,"config.preferredTextLanguage is not a string or an array");if(!_.z(a.preferredAudioLanguage)&&!_.Eg(a.preferredAudioLanguage)&&!Array.isArray(a.preferredAudioLanguage))throw new _.H(_.F,
|
|
88
|
+
7,7100,"config.preferredAudioLanguage is not a string or an array");if(!_.z(a.preferredAudioCodec)&&!_.Eg(a.preferredAudioCodec)&&!Array.isArray(a.preferredAudioCodec))throw new _.H(_.F,7,7100,"config.preferredAudioCodec is not a string or an array");if(!_.z(a.preferredVideoCodec)&&!_.Eg(a.preferredVideoCodec)&&!Array.isArray(a.preferredVideoCodec))throw new _.H(_.F,7,7100,"config.preferredVideoCodec is not a string or an array");if(!_.z(a.drm)){if(a.drm.env&&!_.Eg(a.drm.env))throw new _.H(_.F,7,
|
|
89
|
+
7100,"config.drm.env is not a string");if(a.drm.offlineId&&!_.Eg(a.drm.offlineId))throw new _.H(_.F,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(!_.Fg(b.bufferingGoal)||Hg(b.bufferingGoal))throw new _.H(_.F,7,7100,"config.streaming.bufferingGoal is not a number");if(!_.Fg(b.rebufferingGoal)||
|
|
90
|
+
Hg(b.rebufferingGoal))throw new _.H(_.F,7,7100,"config.streaming.rebufferingGoal is not a number");if(b.rebufferingGoal>b.bufferingGoal)throw new _.H(_.F,7,7100,"config.streaming.rebufferingGoal must be \x3e\x3d bufferingGoal");if(!_.Fg(b.bufferBehind)||Hg(b.bufferBehind))throw new _.H(_.F,7,7100,"config.streaming.bufferBehind is not a number");if(!_.Fg(b.smallGapLimit)||Hg(b.smallGapLimit))throw new _.H(_.F,7,7100,"config.streaming.smallGapLimit is not a number");if(!_.Fg(b.durationBackoff)||Hg(b.durationBackoff))throw new _.H(_.F,
|
|
91
|
+
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 _.H(_.F,7,7100,"Invalid value for |manifest.availabilityWindowOverride|");Bk(a.restrictions);Bk(a.abr.restrictions);a.abr.initialRestrictions&&Bk(a.abr.initialRestrictions)}return a};
|
|
92
|
+
Bk=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);
|
|
93
|
+
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 _.H(_.F,7,7100,"Restrictions contain NaN");};Dk=function(a){return typeof a===_.ye&&!Array.isArray(a)&&"source"in a};_.Fk=function(a){return _.Ek.get(a)||null};
|
|
94
|
+
_.Hk=function(a){_.Ek.get(a.id())?Gk.warn("Component already in use."):_.Ek.set(a.id(),a)};Ik=function(a){return Array.from(_.Ek.values()).find(b=>b instanceof a)||null};Jk=function(a){for(const b of _.Ek.values())a(b)};Kk=function(a){Jk(b=>{b.o(a)})};Lk=function(a){Jk(b=>{b.g(a)})};Mk=function(){Jk(()=>{})};Nk=function(){Jk(()=>{})};Ok=function(a){if(null!==Ik(a))return null;a=new a;a.f();_.Hk(a);Gk.info("Installed component:",a.id());return a};
|
|
95
|
+
Pk=function(a){if(a=Ik(a))a.a(),_.Ek.delete(a.id()),Gk.info("Uninstalled component:",a.id())};Qk=function(a){return _.ci(a,_.pd)||_.ci(a,_.sd)};Rk=function(a,b){3===b.type&&(a.f&&(a.h.debug("Attaching tracking token"),b.headers[lg]=a.f),a.a&&(b.headers[mg]=a.a))};
|
|
96
|
+
Sk=function(a,b){return b.request&&3===b.request.type&&(a.f=b.headers[lg],a.a=b.headers[mg],b=b.headers["x-dt-csl-renewal-info"],a.f&&a.h.debug("Loaded tracking token "+a.f),a.a&&a.h.debug("Loaded followup token "+a.a),b)?(a=JSON.parse(_.Wh(_.li(b))),{delay:a.renewalPeriod,kh:{maxAttempts:a.retryCount,baseDelay:1E3*a.retryPeriod,backoffFactor:1,fuzzFactor:0,timeout:0}}):null};_.Uk=function(a){_.Tk[a.I]=a};
|
|
97
|
+
_.Wk=function(a){const b={attemptParameters:_.wi(),enforceSingleSession:!1,delayLicenseRequestUntilPlayed:!1,enableSessionCacheForSkd:!1,ignoreUnrecognizedInitData:!0,Sa:{}};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!==a.ignoreUnrecognizedInitData&&
|
|
98
|
+
(b.ignoreUnrecognizedInitData=!!a.ignoreUnrecognizedInitData),a.env)){const c=_.Tk[a.env]||null;if(!c)throw _.Rg(_.sa,_.sb+a.env+_.aa),new _.H(_.F,6,6015,`DRM environment '${a.env}' is missing.`);b.Sa=_.Vk(c,a.customData)||{};_.ci(a.env.toLowerCase(),Kd)&&(b.enforceSingleSession=!0)}return b};Yk=function(a){a=Xk[a];if(!a)return null;const b=_.bk();return b.os===Uj&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};
|
|
99
|
+
_.Vk=function(a,b){const c={};var d=b?b.widevineVideoRobustness:void 0,e=b?b.widevineAudioRobustness:void 0;const f=b?b.serverCertificate:void 0;var g=a.f[_.ud];if(g){var h=g.licenseUrl;d=uh(d,g.videoRobustness);e=uh(e,g.audioRobustness);var k=g.modifiers,l=th(b?b.widevineDistinctiveIdentifierRequired:void 0,g.distinctiveIdentifierRequired,!1),m=th(b?b.widevinePersistentStateRequired:void 0,g.persistentStateRequired,!1);g=void 0===f?g.serverCertificate:null===f?null:typeof f===_.yf?Yk(f):f;c[_.ud]=
|
|
100
|
+
{licenseUrl:h,videoRobustness:d,audioRobustness:e,modifiers:k,distinctiveIdentifierRequired:l,persistentStateRequired:m,serverCertificate:g}}(g=a.f[_.pd])&&(c[_.pd]={licenseUrl:g.licenseUrl,certificateUrl:g.certificateUrl,modifiers:g.modifiers});h=b?b.playReadyVideoRobustness:void 0;b=b?b.playReadyAudioRobustness:void 0;(g=a.f[_.sd])&&(c[_.sd]={licenseUrl:g.licenseUrl,videoRobustness:h||g.videoRobustness,audioRobustness:b||g.audioRobustness,individualizationServer:g.individualizationServer,useLegacySystem:g.useLegacySystem,
|
|
101
|
+
modifiers:g.modifiers});return c};_.Zk=function(){throw new _.H(_.F,3,3E3);};_.$k=function(a,b,c){const d=c||0;c=b.byteLength-d;const e=_.J(a.f.buffer);b=_.J(b.buffer,d,c);try{e.set(b,a.a),a.a+=c}catch(f){_.Zk()}};_.N=function(a,b){try{a.f.setUint32(a.a,b,a.g),a.a+=4}catch(c){_.Zk()}};_.al=function(a){return a.a<a.f.byteLength};_.bl=function(){throw new _.H(_.F,3,3E3,"Buffer read out of bounds.");};_.dl=function(a){try{const b=a.f.getUint8(a.a);a.a+=1;return b}catch(b){_.bl()}};
|
|
102
|
+
_.el=function(a){try{const b=a.f.getUint16(a.a,a.g);a.a+=2;return b}catch(b){_.bl()}};_.P=function(a){try{const b=a.f.getUint32(a.a,a.g);a.a+=4;return b}catch(b){_.bl()}};_.fl=function(a){try{const b=a.f.getInt32(a.a,a.g);a.a+=4;return b}catch(b){_.bl()}};_.gl=function(a){let b=0,c=0;try{!0===a.g?(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){_.bl()}if(2097151<c)throw new _.H(_.F,3,3001);a.a+=8;return c*Math.pow(2,32)+b};
|
|
103
|
+
hl=function(a,b){const c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=_.dl(a);return c};_.il=function(a,b){a.a+b>a.f.byteLength&&_.bl();var c=a.a+a.f.byteOffset;c=a.f.buffer.slice(c,c+b);a.a+=b;return _.J(c)};jl=function(a){let b=0;for(let c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};_.kl=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};_.ll=function(a){for(;_.al(a.reader)&&!a.parser.a;)a.parser.xd(a.start+a.headerSize,a.reader,a.partialOkay)};
|
|
104
|
+
_.ml=function(a){for(let b=_.P(a.reader);0<b&&!a.parser.a;--b)a.parser.xd(a.start+a.headerSize,a.reader,a.partialOkay)};_.nl=function(a){return b=>{const c=b.reader.Ca()-b.reader.getPosition();a(_.il(b.reader,c))}};_.ol=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};pl=function(a){let b="";try{b=_.Zh(a)}catch(c){}return b};_.rl=function(a){a=pl(a);let b="";a.length&&(b=(new _.ql(a)).a);return b};
|
|
105
|
+
tl=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.Wh(a)),d=_.li(c.sinf[0]);(new _.sl).L(_.sf,_.ll).L("schi",_.ll).L("tenc",e=>{e.reader.skip(6);_.dl(e.reader)&&(e.reader.skip(1),b=_.ni(_.il(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
|
|
106
|
+
vl=function(a,b,c){if(!c||!c.byteLength)throw new _.H(_.F,6,6102);let d;typeof b===_.yf?d=_.ai(b,!0):d=b;a=_.ai(pl(a),!0);b=new _.ul(12+a.byteLength+d.byteLength+c.byteLength,!0);_.N(b,a.byteLength);_.$k(b,_.J(a));_.N(b,d.byteLength);_.$k(b,_.J(d));_.N(b,c.byteLength);_.$k(b,_.J(c));return _.J(b.buffer)};_.wl=function(a){var b=_.J(a.body);b=_.ki(b);a.headers[ra]=Ac;a.body=_.$h("spc\x3d"+b).buffer};
|
|
107
|
+
_.xl=function(a){let b;try{b=_.Wh(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=Uh(_.li(b))};Cl=function(a,b){b=yl(b);if(a==_.ud)return b+zl;if(a==_.sd)return b+Al;if(a==_.pd)return b+Bl;throw Error("Unknown DRM Key-System '"+a+"'. Can not infer license URL!");};
|
|
108
|
+
_.Il=function(a,b,c,d){d=void 0===d?!0:d;c=a.drm;c&&c.env.startsWith(ua)?c.customData&&(_.Hl(b,a),a=b.uris[0],d&&c.customData.assetId&&(a+="?assetId\x3d"+encodeURI(`${c.customData.assetId}`),c.customData.variantId&&(a+="\x26variantId\x3d"+encodeURI(`${c.customData.variantId}`)),b.uris[0]=a)):Gl.warn(gb)};
|
|
109
|
+
_.Jl=function(a,b){try{const c=_.J(b.data),d=JSON.parse(String.fromCharCode.apply(null,c));Gl.debug("Widevine License response",d);const e=atob(d.license),f=new Uint8Array(e.length);for(a=0;a<e.length;++a)f[a]=e.charCodeAt(a);b.data=f.buffer}catch(c){Gl.debug("Unable to parse DRMtoday response JSON, assuming the response contained raw data")}};
|
|
110
|
+
_.Ll=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.Il(a,b,c,!1);b.headers[ra]=Ac;c={spc:_.ji(b.body)};if((a=a.drm)&&a.env.startsWith(va)&&d){a={};var e=_.Ti((new _.ql(Kl(d))).f);d=e.keyId;if(e=e.assetId)Gl.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(Gl.info("Applying keyId from HLS manifest."),a.keyId=d);d=a;d.keyId&&(Gl.info("Adding keyID to FPS payload:",d.keyId),c.keyId=d.keyId);d.assetId&&(Gl.info("Adding assetID to FPS payload:",d.assetId),c.assetId=d.assetId)}b.body=
|
|
111
|
+
_.bi(_.Si(c,!0))};_.Ml=function(a,b){Gl.debug("Clearing response data");200===b.status&&(a=_.Wh(b.data).trim(),"\x3cckc\x3e"===a.substr(0,5)&&"\x3c/ckc\x3e"===a.substr(-6)&&(a=a.slice(5,-6)),b.data=_.li(a).buffer)};
|
|
112
|
+
_.Nl=function(a,b,c){b=pl(b);c=c&&c.customData?c.customData:{};b=new _.ql(Kl(b));const d=_.Ti(b.f);if(a&&a.drm&&a.drm.customData){var e=a.drm.customData;a=e.assetId;e=e.variantId;a&&_.ei(`${a}`)&&(d.assetId=a,Gl.debug("Using assetId from the configuration instead of the value from the HLS manifest."));e&&_.ei(`${e}`)&&(d.variantId=e,Gl.info("Using variantId from the configuration instead of the value from the HLS manifest."))}d.keyId?(a=["keyId"],Gl.debug("KeyId found in FPS SKD. Removing other parameters")):
|
|
113
|
+
a=["assetId","variantId"];b.f=_.Si(d,!1,a);"/"!==b.path||b.j.includes(`${b.a}/`)||(b.path="");b=_.Ri(b);return c.fpsContentId=b};_.Ol=function(a,b){a=a.drm;if(!a||!a.env.startsWith(ua))Gl.warn(gb);else if(a.customData&&a.customData.merchant&&!a.env.startsWith(va)){const c=new _.vh(b.uris[0]);let d=c.ya;d.endsWith("/")||(d+="/");d+=a.customData.merchant;c.ya=d;b.uris[0]=c.toString()}};Pl=function(a,b,c){_.Il(a,b,c);a=a.drm;a=!(!a||!a.offlineId);c=new _.vh(b.uris[0]);c.a.add(_.Je,a);b.uris[0]=c.toString()};
|
|
114
|
+
yl=function(a){if(a===Ql)return"https://lic.drmtoday.com";if(a===Rl)return"https://lic.staging.drmtoday.com";if(a===Sl)return"https://lic.test.drmtoday.com";throw Error("Unknown DRMtoday environment '"+a+"'. Can not infer DRMtoday base URL!");};Kl=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};
|
|
115
|
+
_.Hl=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.Ag(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers["x-dt-auth-token"]=b)}};Ul=function(a){const b={},c=a?a[ng]:void 0;a=Tl[a?a[ng]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};
|
|
116
|
+
Wl=function(a,b=0){_.Qg("Registering EME Factory: "+a.a());a={priority:b,Hb:a};for(let c=0;c<Vl.length;++c)if(Vl[c].priority<b){Vl.splice(c,0,a);return}Vl.push(a)};Xl=function(a){if(a){const {Hb:b}=Vl.find(({Hb:c})=>c.a()===a);if(b&&b.isSupported())return _.Qg(Sb+b.a()),b.create();_.Qg("Cannot create selected EME manager. Choosing by priority list.")}for(const {Hb:b}of Vl)if(b.isSupported())return _.Qg(Sb+b.a()),b.create();throw Error("Missing EME managers");};
|
|
117
|
+
_.Zl=function(a,b){a=_.Yl(a,b);return 1!=a.length?null:a[0]};_.Yl=function(a,b){return Array.prototype.filter.call(a.childNodes,c=>c instanceof Element&&c.tagName==b)};_.$l=function(a){return Array.prototype.every.call(a.childNodes,b=>b.nodeType==Node.TEXT_NODE||b.nodeType==Node.CDATA_SECTION_NODE)?a.textContent.trim():null};
|
|
118
|
+
_.am=function(a,b){const c=new DOMParser;let d=null,e=null;try{e=c.parseFromString(a,_.Ef)}catch(f){}e&&e.documentElement.tagName==b&&(d=e.documentElement);return d&&0<d.getElementsByTagName("parsererror").length?null:d};_.dm=function(a){var b=_.mi(a);b=parseInt(b.byteLength,10).toString(16);b=_.mi("12"+b+a);return new bm(cm,a,b)};
|
|
119
|
+
_.fm=function(a){const b=new _.em(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.P(b);var c=_.P(b);c=_.kl(c);var d=_.P(b);const e=d>>>24;d&=16777215;var f=_.il(b,16);f=_.ni(f);if(0<e){var g=_.P(b);b.skip(16*g)}g=_.P(b);const h=()=>{let t=_.dl(b),v=(t&127)>>>0,y=7;for(;128<=t&&28>=y;)t=_.dl(b),v=(v|(t&(28>y?127:15))<<y)>>>0,y+=7;return 28<y?-1:v},k=t=>{switch(t){case 0:do if(!_.al(b))throw Error("not enough data to skip!");while(_.dl(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
|
|
120
|
+
break;case 3:for(;4!==(t=h()&7);)k(t);break;case 5:b.skip(4);break;default:throw Error("invalid wire type "+t);}},l=[];let m=null;for(;_.al(b);){var n=h(),q=n&7;n>>>=3;if(2===q){q=h();if(0>q)throw Error(`unable to read length of field ${n}`);q=hl(b,q);2===n?l.push(q):4===n&&(m=q)}else k(q)}_.Rg("Parsed WV PSSH Box","size",a,"name",c,"version",e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.ji(m):"","keyIds",l.map(t=>_.ni(t)));return 0<l.length?_.dm(_.ni(l[0])):null};
|
|
121
|
+
_.gm=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=_.J(a);a.set(b,0);return a};
|
|
122
|
+
_.lm=function(a){a:{var b=new _.em(new DataView(a.buffer),!0);_.P(b);for(_.el(b);_.al(b);)if(1===_.el(b)){var c=_.el(b);b=_.il(b,c);break a}b=null}b||(b=a);a=Yh(b,!0);c=_.am(a,"WRMHEADER");a=c.getAttribute("version");var d=_.Zl(c,"DATA");c=(c=_.Zl(d,"LA_URL"))?_.$l(c):"";var e;if(e=_.Zl(d,"KID"))if(e=_.$l(e)){var f=_.Zl(d,ma);e={value:e,Jd:f?f.textContent.trim():null}}else e=null;else e=null;d=e?[e]:(e=hm(d))?[e]:(d=im(d))?d:null;const {value:g="",Jd:h}=d&&d[0]||{};d=_.li(g);d=_.gm(d);d=_.ni(d);return new _.jm(_.km,
|
|
123
|
+
d,c,b,a,h)};hm=function(a){a=_.Zl(a,"PROTECTINFO");if(!a)return null;var b=_.Zl(a,"KID");if(!b)return null;a=b.getAttribute("VALUE");if(!a)return null;const c=b.getAttribute(ma);b=b.getAttribute("ALGID");return{value:a,Jd:c,Of:b}};
|
|
124
|
+
im=function(a){a=_.Zl(a,"PROTECTINFO");if(!a)return null;a=_.Zl(a,"KIDS");if(!a)return null;var b=_.Yl(a,"KID");if(!b.length)return null;a=[];for(const c of b)if(b=c.getAttribute("VALUE")){const d=c.getAttribute(ma),e=c.getAttribute("ALGID");a.push({value:b,Jd:d,Of:e})}return a.length?a:null};_.nm=function(a){mm&&performance.mark(a)};_.om=function(a,b,c){mm&&performance.measure(a,b,c)};
|
|
125
|
+
pm=function(a){return _.w(function*(){const b=new Promise(c=>{(new _.zj(c)).ca(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.B("Timeout waiting for session close")})};_.rm=function(a){return qm(a)?_.sd:a};sm=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};
|
|
126
|
+
tm=function(a,b){if(a.keySystem){var c=_.rm(a.keySystem);b=b[c];c===_.Ge&&a.licenseServerUri||(b&&(a.licenseServerUri=b.licenseUrl||""),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=
|
|
127
|
+
b.serverCertificate||null)))}};_.um=function(a,b){b=_.uj(a.mimeType,b||a.codecs);if(_.tj(b,a.type)){a=a.type;var c=_.tj(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};vm=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};xm=function(a){return(a.audioCapabilities||[]).some(wm)||(a.videoCapabilities||[]).some(wm)};
|
|
128
|
+
ym=function(a,b){a=_.rl(b);_.Rg("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
|
|
129
|
+
zm=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&"APPLE"===h){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.Cg(k)||(k=ym);let l="";try{l=k(b,c,g)}catch(m){throw new _.H(_.F,6,6103);}if(!l.length)throw new _.H(_.F,6,6101,"Content ID is an empty string");c=vl(c,l,a)}return c};qm=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
|
|
130
|
+
wm=function(a){return null!=a.robustness&&""!==a.robustness};Am=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.oi(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])}};
|
|
131
|
+
Bm=function(a){var b=a.j;const c=a.W;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"==d)&&a.T(new _.H(_.F,6,6014));a.D.ke(_.Jg(c));a.o||a.h.info(ta);a.o=!0;a.B=!1};Cm=function(a){a.f.forEach((b,c)=>{const d=b.ee;let e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.D.je(c.sessionId,e),b.ee=e)})};
|
|
132
|
+
Dm=function(a){return _.w(function*(){a.w.release();a.w=null;a.K.release();a.K=null;a.o=!1;a.B=!1;a.F.reject();a.Z.stop();a.Z=null;a.U.stop();a.U=null;const b=Array.from(a.f.keys());for(const c of a.f.values())c.pc&&c.pc.stop();a.f.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.w(function*(){a.h.debug("Closing session",c.sessionId);try{yield pm(c)}catch(d){a.h.warn("Error while closing session",d)}}))));if(a.A){try{yield a.l.g(null)}catch(c){a.h.warn("Error while resetting media keys",
|
|
133
|
+
c)}a.A=null}a.l=null;a.a=null;a.H.clear();a.G=null;a.J=[];a.g=null;a.T=null;a.D=null;a.O=0;a.M=null})};_.Hm=function(a,b){const c=b.some(e=>0<e.drmInfos.length);if(!c){var d=Ig(a.g.Sa);sm(b,d)}if(d=Em(a))for(const e of b)e.drmInfos=[d];for(const e of b)for(const f of e.drmInfos)tm(f,a.g.Sa);b=Fm(a,b);if(!b.size)return a.R=!0,Promise.resolve();_.nm(Dd);a=_.Gm(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.nm(Cd);_.om("DRM queryMediaKeys_()",Dd,Cd)})};
|
|
134
|
+
_.Jm=function(a,b,c){c=void 0===c?[]:c;a.I=Im;a.J=c;a.C=0<c.length;a.h.debug("Using Persisted Licenses: "+a.C);a.g&&a.g.enableSessionCacheForSkd&&a.h.info("Enabled session cache for SKD license requests");return _.Hm(a,b)};
|
|
135
|
+
_.Gm=function(a,b){if(1==b.size&&b.has(""))return Promise.reject(new _.H(_.F,6,6E3));null===a.l&&(a.l=Xl(a.g.emeApi));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.Km;const e=(h,k,l)=>{k.drmInfos.some(m=>!!m.licenseServerUri)==h&&(d=d.catch(()=>{if(a.ra)return null;if(l===_.sd){if(_.Bj()&&!a.g.Sa[l].useLegacySystem)return k.label=td,a.l.a(td,[k]).catch(()=>{a.h.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");
|
|
136
|
+
k.label=_.sd;vm(k);return a.l.a(l,[k])});vm(k)}return a.l.a(l,[k]).catch(m=>{a:{if(l===_.ud&&xm(k)){const n=_.bk();if(xm(k)&&n.os===Uj&&n.browser===Yc){a.h.warn("requestMediaKeySystemAccess() failed",m);a.h.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");vm(k);m=a.l.a(l,[k]);break a}}throw m;}return m})}))};let f=a.g.preferredDrmSystem;if(!f){var g=_.bk();if(g.os===Wj&&10<=g.osVersion.major&&"edge"===g.browser)f=_.sd;else if("safari"===
|
|
137
|
+
g.browser)f=_.pd;else if(g.browser===Yc||"firefox"===g.browser)f=_.ud}f&&(g=b.get(f))&&(e(!0,g,f),e(!1,g,f));for(const h of[!0,!1])b.forEach((k,l)=>{l!==f&&e(h,k,l)});d=d.catch(h=>{throw new _.H(_.F,6,6001,null,h);});d=d.then(h=>{if(a.ra)return null;a.H.clear();var k=h.getConfiguration();a.h.info("Got MediaKeySystemAccess with configuration",k);var l=k.audioCapabilities||[];k=k.videoCapabilities||[];for(var m of l)a.H.add(m.contentType.toLowerCase());for(var n of k)a.H.add(n.contentType.toLowerCase());
|
|
138
|
+
{l=h.keySystem;m=b.get(_.rm(h.keySystem));n=[];k=[];const q=[],t=[];Am(m.drmInfos,n,k,q,t);1<k.length&&_.B("Multiple unique server certificates found! Only the first will be used.");1<n.length&&_.B("Multiple unique license server URIs found! Only the first will be used.");l={keySystem:l,licenseServerUri:n[0],distinctiveIdentifierRequired:m.distinctiveIdentifier==_.kf,persistentStateRequired:m.persistentState==_.kf,audioRobustness:m.audioCapabilities?m.audioCapabilities[0].robustness:"",videoRobustness:m.videoCapabilities?
|
|
139
|
+
m.videoCapabilities[0].robustness:"",serverCertificate:k[0],initData:q,keyIds:t,periodId:null}}a.a=l;if(!a.a.licenseServerUri)throw new _.H(_.F,6,6012,a.a.keySystem);return h.createMediaKeys()}).then(h=>{a.ra||(a.h.info("Created MediaKeys for key system",a.a.keySystem),a.G=h,a.R=!0)}).catch(h=>{if(!a.ra){a.a=null;a.H.clear();if(h instanceof _.H)throw h;throw new _.H(_.F,6,6002,{browserError:h.message});}});c.reject();return d};
|
|
140
|
+
Em=function(a){a=Ig(a.g.Sa[_.Ge]||{});if(0==a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.mi(f);e=_.mi(e);e={kty:"oct",kid:_.ki(f,!1),k:_.ki(e,!1)};b.push(e);c.push(e.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:_.$h(d),initDataType:"keyids"}];return{keySystem:_.Ge,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
|
|
138
141
|
keyIds:[],periodId:null}};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
_.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
_.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
a.h.debug("
|
|
154
|
-
|
|
142
|
+
Fm=function(a,b){var c=new Set;for(var d of b)for(var e of d.drmInfos)tm(e,a.g.Sa),c.add(e);d=a.C?_.kf:_.Fe;e=a.C?[_.Ke]:[Cf];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.Uc],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.Fe,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.um(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.Dj()&&(h=_.um(b,_.Md));const k=c?_.um(c):"";let l=null;c&&"ac-3"===
|
|
143
|
+
c.codecs.toLowerCase()&&_.Dj()&&(l=_.um(c,_.Md));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(q=>q.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.kf);m.persistentStateRequired&&(n.persistentState=_.kf);b&&_.hh(m.audioRobustness).forEach(q=>{const t={robustness:q||"",contentType:g};n.audioCapabilities.find(v=>v.robustness===t.robustness&&v.contentType===t.contentType)||
|
|
144
|
+
n.audioCapabilities.push(t);h&&n.audioCapabilities.push({robustness:q||"",contentType:h})});c&&_.hh(m.videoRobustness).forEach(q=>{const t={robustness:q||"",contentType:k};n.videoCapabilities.find(v=>v.robustness===t.robustness&&v.contentType===t.contentType)||n.videoCapabilities.push(t);l&&n.videoCapabilities.push({robustness:q||"",contentType:l})})}}return a};
|
|
145
|
+
Lm=function(a){return _.w(function*(){if(!a.l.o())if(a.M)yield a.M;else try{a.M=a.l.g(a.G),yield a.M}catch(b){a.ra||a.T(new _.H(_.F,6,6003,b.message,b))}})};
|
|
146
|
+
_.Pm=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.C||a.I!==Im)){var e=a.keySystem();if(!e.startsWith(_.pd)&&b===_.Uc){const f=new Mm(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.A.webkitCurrentPlaybackTargetIsWireless||
|
|
147
|
+
_.Dj(2)||a.keySystem().startsWith(_.pd)||!_.Nm(a,d,c,!0))&&Om(a,d,null,b,c)}};Qm=function(a,b){return _.w(function*(){a.h.info(`Handle encrypted event for type ${b.initDataType}`);yield Lm(a);b.initData&&_.Pm(a,b.initDataType,_.J(b.initData))})};Sm=function(a){return _.w(function*(){_.nm(Fd);const b=a.V.map(c=>Rm(a,c));a.ba=!0;a.V=[];yield Promise.all(b);_.nm(Ed);_.om("drm.onPlay",Fd,Ed)})};
|
|
148
|
+
Um=function(a){const b=a.keySystem(),c=a.g.Sa[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return Tm(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.zi([d],a.g.attemptParameters);f.type=3;f.licenseRequestType=Wc;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.h.debug("Fetching certificate");return a.D.mb.fetch(f).P}).then(f=>{a.a.serverCertificate=_.J(f.data)}).catch(f=>{var g=
|
|
149
|
+
f.data.headers;g=Object.assign({message:"Error while fetching certificate!",url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},Ul(g));throw new _.H(_.F,6,6100,g,f);})};
|
|
150
|
+
_.Vm=function(a){return _.w(function*(){if(a.G&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.G.setServerCertificate(a.a.serverCertificate);void 0===b||b||a.h.debug("Server certificates are not supported by the key system. The server certificate has been ignored.")}catch(b){throw new _.H(_.F,6,6004,{browserError:b.message});}})};
|
|
151
|
+
_.Ym=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.Dj(2);if(a.g.enforceSingleSession&&!a.keySystem().startsWith(_.pd)){const e=a.f.values();for(const f of e)_.oi(c.initData,f.initData)?(a.h.info("Skipping Session creation. Existing init data in single session mode!"),d=!1):f.periodId===c.periodId&&(a.h.info("Skipping Session creation. Merging init data for period in single session mode "+`for Key ID ${c.keyId}.`),Wm(c.initData,f)||(f.nd.push(c.initData),c.keyId&&!f.Ta.includes(c.keyId)&&
|
|
152
|
+
f.Ta.push(c.keyId),a.j.get(c.keyId)||a.j.set(c.keyId,wf)),d=!1)}!d||a.C&&a.I===Im||(_.Nm(a,c.keyId,c.initData)&&(d=!1),d&&(a.h.info("Request new media key session on create"),Om(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.J)_.Xm(a,c);b.length||a.J.length||(a.o||a.h.info(ta),a.o=!0,a.B=!1,a.F.resolve());return a.F};
|
|
153
|
+
_.Zm=function(a,b){if(!a.G)return _.Yg(a.w,b,[Nd,"msneedkey",jg,"needkey"],()=>{a.T(new _.H(_.F,6,6010))}),Promise.resolve();a.A=b;a.l.l(b);a.w.one(a.A,_.Me,()=>Sm(a));a.w.on(a.A,_.eg,e=>{const f=a.B;a.B=!a.o;!f&&a.B&&(a.h.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()!==yb||a.J.length)d=Lm(a);c=Promise.resolve();_.Gj()&&38===Hj().major||(a.a&&a.a.keySystem!==_.Ge&&!a.a.serverCertificate&&(c=Um(a)),
|
|
154
|
+
c=c.then(()=>_.Vm(a)));return Promise.all([d,c]).then(()=>{a.ra||(_.Ym(a),a.w.on(a.A,Nd,e=>Qm(a,e)))}).catch(e=>{if(!a.ra){if(6004===e.code&&a.a&&a.a.keySystem===_.ud&&1>a.O&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.h.warn("Detected invalid widevine server certificate!. Retrying"),a.T(new _.H(1,6,6004)),a.a.serverCertificate=null,a.O++,_.Zm(a,b);1<=a.O&&a.h.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
|
|
155
|
+
Tm=function(a,b){return _.w(function*(){const c=a.D.xc();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
|
|
156
|
+
_.Xm=function(a,b){let c;try{a.h.debug("Attempting to load an offline session",b),c=a.G.createSession(_.Ke)}catch(e){const f=new _.H(_.F,6,6005,{browserError:e.message});a.T(f);return Promise.reject(f)}a.w.on(c,_.qe,a.oa.bind(a));a.w.on(c,de,a.fa.bind(a));const d={initData:null,loaded:!1,ee:Infinity,ob:null,Fa:new _.Km,periodId:null,nd:[],keyId:null,Ta:[],initDataType:null,Yb:null,sessionContext:{ldlDelay:0,customData:{}}};d.Fa.catch(()=>{});a.f.set(c,d);return c.load(b).then(e=>{if(a.ra)return null;
|
|
157
|
+
a.h.debug("Loaded offline session",b,e);if(!e)return a.f.delete(c),a.T(new _.H(_.F,6,6013)),null;d.loaded=!0;$m(a)&&(a.o||a.h.info(ta),a.o=!0,a.B=!1,a.F.resolve());return c},e=>{a.ra||(a.f.delete(c),a.T(new _.H(_.F,6,6005,{browserError:e.message})))})};Wm=function(a,b){if(!a)return!1;for(let c=0;c<b.nd.length;c++)if(_.oi(a,b.nd[c]))return!0;return!1};
|
|
158
|
+
_.Nm=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.f.keys()){const f=a.f.get(e);if(_.oi(c,f.initData))return b?f.Ta.includes(b)?d&&a.h.info("Skipping Session creation. "+`License for init data with Key ID ${b} was already `+`requested in Session: '${e.sessionId}'. `):(f.Ta.push(b),a.j.get(b)||a.j.set(b,wf),d&&a.h.info(Db+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.h.info(Db+`Session: '${e.sessionId}'`),!0;if(Wm(c,f))return d&&a.h.info("Skipping Session creation. License for init data was already requested [extra]"),
|
|
155
159
|
!0}return!1};
|
|
156
|
-
|
|
157
|
-
if(h&&m.keyId===h){a.h.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(t){a.h.warn("Unable to close session",t)}k=!1}}if(k){a.h.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.C?_.
|
|
158
|
-
|
|
159
|
-
_.
|
|
160
|
-
error:t,extended:v},t))}})}else a.h.warn("Empty init data")})};
|
|
161
|
-
|
|
162
|
-
_.
|
|
163
|
-
|
|
164
|
-
const h=_.
|
|
165
|
-
_.
|
|
166
|
-
{_
|
|
167
|
-
{a.
|
|
168
|
-
url:m.data.url,status:m.data.status,response:m.data.response},n?{headers:n}:{},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
_.
|
|
173
|
-
|
|
174
|
-
_
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
b.type+" for "+a.url):
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
uri:b.url},d.error))})).ca(g))});
|
|
190
|
-
()=>{const g=new _.H(_.
|
|
191
|
-
_.
|
|
192
|
-
_
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
_.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
(d=new _.
|
|
210
|
-
_.
|
|
211
|
-
a.setSourceIndex(d);if(a.f.pauseWhenInBackground)a.
|
|
212
|
-
_.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
(a.h.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
a.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
160
|
+
Om=function(a,b,c,d,e,f,g){f=void 0===f?null:f;g=void 0===g?!1:g;_.w(function*(){if(e.length){var h=b;if(!h)try{h=an(a,d,e,f)}catch(t){if(a.h.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:t,initDataType:d,initData:e}),a.g.ignoreUnrecognizedInitData)return}if(!g&&bn(a,h,d,e)){var k=!0;if("skd"===d&&!a.g.enableSessionCacheForSkd)for(var l of a.f.keys()){var m=a.f.get(l);
|
|
161
|
+
if(h&&m.keyId===h){a.h.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(t){a.h.warn("Unable to close session",t)}k=!1}}if(k){a.h.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.C?_.Ke:Cf;var q=a.G.createSession(n);a.h.info(`Created new ${n} session for Key ID: '${h}'. `+`Init data type: ${d}.`)}catch(t){a.T(new _.H(_.F,6,6005,{browserError:t.message}));return}a.w.on(q,_.qe,a.oa.bind(a));a.w.on(q,de,a.fa.bind(a));k={Yb:f,nd:[],initData:e,initDataType:d,keyId:h,
|
|
162
|
+
Ta:h?[h]:[],loaded:!1,ee:Infinity,periodId:c,ob:null,Fa:new _.Km,sessionContext:{ldlDelay:0,customData:{}}};k.Fa.catch(()=>{});f&&(l=a.f.get(f),k.sessionContext=l.sessionContext);a.f.set(q,k);h&&!a.j.get(h)&&a.j.set(h,wf);if(e)for(l=0;l<a.a.initData.length;l++)m=a.a.initData[l],m.keyId&&!k.Ta.includes(m.keyId)&&_.oi(m.initData,e)&&(k.keyId||(k.keyId=m.keyId),k.Ta.push(m.keyId),a.j.get(m.keyId)||a.j.set(m.keyId,wf));l=a.D.getConfiguration();m=a.keySystem();m=a.g.Sa[m];n=(n=m.modifiers)&&n.transformInitData;
|
|
163
|
+
_.Cg(n)||(n=zm);try{e=n({playerConfig:l,initData:e,initDataType:d,drmInfo:a.a,drmSystemConfig:m,sessionContext:k.sessionContext,emeApi:a.l.f()})}catch(t){h=t;t instanceof _.H||(h=new _.H(_.F,6,6016,t));k.Fa&&k.Fa.reject(t);a.T(h);return}a.h.info(`Generate License Request for key ID: '${h}'`);q.generateRequest(d,e.buffer).catch(t=>{if(!a.ra){var v=null;t.errorCode&&t.errorCode.systemCode&&(v=t.errorCode.systemCode,0>v&&(v+=Math.pow(2,32)),v="0x"+v.toString(16));a.T(new _.H(_.F,6,6006,{browserError:t.message,
|
|
164
|
+
error:t,extended:v},t))}})}else a.h.warn("Empty init data")})};cn=function(a){let b=Infinity;a=a.f.keys();for(const c of a)isNaN(c.expiration)||(b=Math.min(b,c.expiration));return b};$m=function(a){a=a.f.values();return _.Lh(a,b=>b.loaded)};bn=function(a,b,c,d){if(!b&&c!==_.sf)return!1;d=b||tl(d);for(const e of a.f.values())if(b&&e.keyId===b||b&&e.Ta.includes(b)||c===_.sf&&(e.keyId||tl(e.initData))===d)return!0;return!1};
|
|
165
|
+
an=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.g.Sa[f];f=a.D.getConfiguration();g=g&&g.modifiers&&g.modifiers.extractContentId;_.Cg(g)||(g=ym);try{var h={ldlDelay:0,customData:{}};e&&(h=a.f.get(e).sessionContext);var k=g(f,c,h);a.h.debug(`Extracted Content ID '${k}' from SKD`);var l=k;break a}catch(m){a.h.warn("Unable to extract Content ID from SKD",m)}l=""}return l}if(b===_.sf)return tl(c)||"";if(b===_.Uc){l=a.keySystem();try{if(l.match(/^com\.widevine\.alpha/)){const m=
|
|
166
|
+
_.fm(c);if(m)return m.a}else if(qm(l)){{f=new _.em(new DataView(c.buffer,c.byteOffset,c.byteLength),!1);g=_.P(f);const m=_.P(f);h=_.kl(m);const n=_.P(f);c=n>>>24;k=n&16777215;const q=_.il(f,16),t=_.ni(q);if(0<c){const D=_.P(f);f.skip(16*D)}const v=_.P(f),y=_.il(f,v),A=_.lm(y);_.Rg("Parsed PR PSSH Box","size",g,"name",h,"version",c,"flags",k,"size",v,"systemId",t,"keyId",A.a);e=A}if(e)return e.a}}catch(m){throw a.h.warn("Unable to extract Key ID from PSSH data.",{error:m,keySystem:l}),m;}}return""};
|
|
167
|
+
Rm=function(a,b){const c=b.target,d=a.f.get(c);var e=a.keySystem();let f=!1;e.match(/^com\.widevine\.alpha/)&&b.message&&2===b.message.byteLength?(f=!0,a.h.info("WV Server certificate request for "+`SID:'${c.sessionId} `+`from msg '${b.messageType}'`)):a.h.info("License request for "+`SID:'${c.sessionId}'/KID:'${d.keyId}' `+`from msg '${b.messageType}'`);let g=a.a.licenseServerUri;e=a.g.Sa[e];"individualization-request"===b.messageType&&e&&e.individualizationServer&&(g=e.individualizationServer);
|
|
168
|
+
const h=_.zi([g],a.g.attemptParameters);h.type=3;h.body=b.message;h.method="POST";h.licenseRequestType=b.messageType===ge&&d.Yb?fe:f?Wc:b.messageType;h.sessionId=c.sessionId;if(h.licenseRequestType===fe)a.D.onEvent(new _.C(Hd));qm(a.a.keySystem)&&dn(a,h);Rk(a.K,h);const k=Math.floor(b.timeStamp),l=Date.now();return en(a,h,d.sessionContext).then(()=>{_.nm(`drm.license.req.${k}.start`);a.h.debug("Sending DRM license request to",g,h);return a.D.mb.fetch(h).P}).then(m=>{_.nm(`drm.license.req.${k}.end`);
|
|
169
|
+
_.om(`drm.license.req.${k}`,`drm.license.req.${k}.start`,`drm.license.req.${k}.end`);if(a.ra)return Promise.reject();const n=Date.now()-l;var q=fn(a,m);let t="";q&&(t=` RID:${q}`);q=m&&m.data?m.data.byteLength:-1;f?a.h.info("WV Server certificate response for "+`SID:'${c.sessionId}' `+`${q} bytes `+`in ${n}ms${t}`):a.h.info("License response for "+`SID:'${c.sessionId}'/`+`KID:'${d.keyId}' `+`${q} bytes `+`in ${n}ms${t}`);const v=Sk(a.K,m);_.nm(`drm.sess.update.${k}.start`);return c.update(m.data).then(()=>
|
|
170
|
+
{_.nm(`drm.sess.update.${k}.end`);_.om(`drm.sess.update.${k}`,`drm.sess.update.${k}.start`,`drm.sess.update.${k}.end`);if(!f){var y=cn(a),A=v?Date.now()+1E3*v.delay:Number.NaN;y=new _.C(_.Jd,{keySystem:a.keySystem(),expirationTime:y,expectedRenewalTime:A});a.D.onEvent(y);d&&(d.ob&&d.ob.resolve(),d.Yb&&(y=d.Yb,a.h.info(`Closing expired session '${y.sessionId}'`),pm(y).catch(()=>{a.h.warn("Unable to close expired session in time")}),(y=a.f.get(d.Yb))&&y.pc&&y.pc.stop(),a.f.delete(d.Yb),d.Yb=null),(new _.zj(()=>
|
|
171
|
+
{a.ra||(d.loaded=!0,d.Fa&&d.Fa.resolve(),$m(a)&&(a.o||a.h.info(ta),a.o=!0,a.B=!1,a.F.resolve()))})).ca(5),null!==d.initData&&(0<d.sessionContext.ldlDelay||v&&Qk(a.keySystem()))&&(y=new _.zj(()=>{!a.ra&&a.K&&(a.h.info("Updating CSL Sessions"),qm(a.keySystem())?Om(a,d.keyId,d.periodId,d.initDataType,d.initData,c,!0):a.keySystem().startsWith(_.pd)&&c.update(_.$h("renew")))}),d.pc=y,y.ca(v?v.delay:d.sessionContext.ldlDelay)))}})},m=>_.w(function*(){if(!a.ra){var n=m.data.headers;n=Object.assign({message:_.Pa,
|
|
172
|
+
url:m.data.url,status:m.data.status,response:m.data.response},n?{headers:n}:{},Ul(n));n=new _.H(_.F,6,6007,n,m);a.T(n);d&&d.ob&&d.ob.reject(n);d&&d.Fa&&d.Fa.reject(n)}})).catch(m=>{a.ra||(m===Bb?a.h.info("Ignore update for closed sessions"):(m=new _.H(_.F,6,6008,{browserError:m.message}),a.T(m),d&&d.ob&&d.ob.reject(m),d&&d.Fa&&d.Fa.reject(m)))})};
|
|
173
|
+
dn=function(a,b){var c=Yh(b.body,!0,!0);if(c.includes("PlayReadyKeyMessage")){a.h.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(_.Qf).textContent;b.body=_.li(a.querySelector("Challenge").textContent).buffer}else a.h.debug("PlayReady request is already unwrapped."),b.headers[ra]="text/xml; charset\x3dutf-8"};
|
|
174
|
+
en=function(a,b,c){return _.w(function*(){const d=a.D.getConfiguration();yield Tm(a,d);const e=a.keySystem();var f=a.g.Sa[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=>_.wl(k));h?b.responseModifiers.push(k=>h(d,k,c)):e.startsWith(_.pd)&&b.responseModifiers.push(k=>_.xl(k))})};
|
|
175
|
+
fn=function(a,b){if(!b||!b.headers)return"";if(b=b.headers["x-dt-li"])try{return JSON.parse(_.Wh(_.li(b))).ti}catch(c){a.h.warn("Unable to parse DRMtoday Request ID",c)}return""};_.jn=function(a,b){a&&b&&(_.gn.set(a,b),_.hn.info(`Registered TextDisplayerFactory: '${a}'`))};
|
|
176
|
+
_.kn=function(a,b){b=b.find(c=>(c=_.gn.get(c))?c.isSupported(a):!1);if(null==b)return _.hn.warn("Subtitles may not work as expected. No compatible text displayer found for this platform."),null;_.hn.info(`Chosen the text displayer: ${b}`);return _.gn.get(b)};_.ln=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})}}};
|
|
177
|
+
mn=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};nn=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};on=function(a){return a.a.map(b=>_.yg(b))};
|
|
178
|
+
_.pn=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:[]}};rn=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=qn.value().get(b),c.one(a,b,d))};
|
|
179
|
+
vn=function(a){a.h.debug("Start watching for video events for "+a.m.namespace());const b=a.m,c=d=>sn(a,d.type);a.a.on(b,_.Pd,()=>{a.g||(a.j=!1,tn(a,_.un))});a.a.on(b,Pc,c);a.a.on(b,_.Te,()=>{a.F=!0;a.j=!1;sn(a,_.Te)});a.a.on(b,_.Ie,()=>{a.F=!1;a.j=!1;sn(a,_.Ie)});a.a.on(b,_.Ff,c);a.a.on(b,_.ff,c);a.a.on(b,_.nf,d=>{a.g=!1;a.j=!1;sn(a,d.type)});a.a.on(b,_.of,d=>{a.g=!0;sn(a,d.type)});a.a.on(b,tf,c);a.a.on(b,_.dg,()=>{a.j=!0;sn(a,_.dg)});a.a.on(b,_.Qd,d=>a.T(d));a.a.on(b,_.le,c);a.a.on(b,Qc,()=>{a.C=
|
|
180
|
+
!0;sn(a,Qc)});a.a.on(b,_.Pf,d=>{a.g=!0;sn(a,d.type)});a.a.on(b,_.Of,d=>{a.g=!1;a.j=!1;sn(a,d.type)})};wn=function(a,b){return Object.keys(b)[a]};yn=function(a,b){const c={type:_.vf};b===_.Oc||b===_.Nc?(c.reason=a.w,b===_.Oc?c.timeSinceLastStateChangeMS=a.H:c.bufferedTimeMS=a.B):(a.f===_.xn&&(c.reason=a.w),a.A===_.xn&&(c.reason=a.w,c.bufferedTimeMS=a.B),c.currentState=a.f,c.previousState=a.A,c.timeSinceLastStateChangeMS=a.H);return c};
|
|
181
|
+
tn=function(a,b){if(a.f===b)return!1;var c=Date.now();const d=a.f===_.xn;a.A=a.f;a.f=b;a.A===_.un&&(a.I=c,a.o=0);a.o||(a.o=a.I||c);a.H=c-a.o;a.o=c;b===_.xn?(a.K=a.o,a.w=a.g?1:2,a.h.info("Buffering started. Reason: "+wn(a.w-1,_.zn)),b=yn(a,_.Oc),a.Rb(_.Oc,b)):d&&(a.B=a.o-a.K,a.h.info("Buffering finished. Reason: "+wn(a.w-1,_.zn)+". Buffering time: "+a.B+" ms"),b=yn(a,_.Nc),a.Rb(_.Nc,b));b=wn(a.A,_.An);c=wn(a.f,_.An);a.h.info(`Player state change: ${b} -> ${c}`);a.Rb(_.vf,yn(a,""));return!0};
|
|
182
|
+
sn=function(a,b){if(a.f===_.Bn)a.h.warn("Player is in error state, aborting any further state checks");else{var c=a.m.isPaused(),d=a.m?a.m.isEnded():!1;if(d)a.g||(a.j=!1,tn(a,_.un));else if(b!==_.Ff){var e=a.m.getPosition();e=null!==e&&void 0!==e&&0<=e?a.m.getBufferInfo().Ia(e,!0):-1;a.G=e;e=a.m.getSurface().getMedia();a.l=e?e.readyState:null;a.J=a.m.getPlaybackRate()||1;e=typeof a.l===_.r&&2>a.l&&2===e.networkState;var f=typeof a.l===_.r&&0>=a.G&&a.f===_.Cn,g=typeof a.l===_.r&&2>=a.l&&a.j;e=a.g||
|
|
183
|
+
f||e||g;!a.M||a.m.isLive()||a.f!==_.xn||e||(f=b===_.nf&&4===a.l,(g=a.A===_.Dn)&&!a.C?e=!0:g||a.C||f||(e=!0));f=!1;e?f=tn(a,_.xn):c?f=tn(a,_.En):a.F&&(f=tn(a,_.Fn));f&&(a.C=!1);a.h.debug("Video state check for event "+b+":: seeking: "+a.g+", waiting: "+a.j+", playing: "+a.F+", paused: "+c+", readyState: "+a.l+", rate: "+a.J+", buffer: "+a.G+", ended: "+d+". Changed state: "+f+", Current state: "+wn(a.f,_.An))}}};
|
|
184
|
+
Gn=function(a){a=(new _.vh(a)).ya;if(!a)return null;a=a.toUpperCase();return _.di(a,".MPD")?_.tc:_.di(a,".M3U8")?_.uk:_.di(a,".MP4")?_.Yf:_.di(a,"MANIFEST")||_.di(a,".ISM")?_.zc:null};_.In=function(a){let b;Dk(a)?b=a.source:b=a;Array.isArray(b)||(b=[b]);b=b.filter(c=>typeof c===_.yf||"url"in c);a=[];for(let c=0;c<b.length;c++){const d=Hn(b[c]);d&&a.push(d)}return a};
|
|
185
|
+
Hn=function(a){let b=null;_.Eg(a)&&(a={url:a});typeof a===_.ye&&!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!==_.yf||(b.name=a.name),_.z(a.Eb)||typeof a.Eb!==_.yf||(b.Eb=a.Eb),_.z(a.audioMimeType)||typeof a.audioMimeType!==_.yf||(b.audioMimeType=a.audioMimeType));b&&!b.type&&(b.type=Gn(a.url),b.type?Jn.debug("Detect media type "+
|
|
186
|
+
b.type+" for "+a.url):Jn.warn("Unable to detect media type for "+a.url));return b};Ln=function(a){return a.w?Kn():new Promise(b=>{if(a.a){const c=a.a;a.g.off(c,_.Qd);a.g.off(c,_.lf);a.a=null}b()})};Kn=function(){return Promise.reject(new _.H(_.F,7,7E3))};
|
|
187
|
+
Nn=function(a,b){return a.w?Kn():new Promise(c=>{a.a||(a.g.on(b,_.Qd,()=>{{const d=Mn(a);if(d)a.onError(d)}}),a.g.on(b,_.lf,()=>{const d=b.videoWidth,e=b.videoHeight,f=a.getTrackManager();f&&0<d&&0<e&&(f.w={width:d,height:e});a.trigger(new _.C(_.Lc,{detail:{width:d,height:e}}))}),a.a=b);c()})};
|
|
188
|
+
Pn=function(a){return _.w(function*(){if(a.w)return Kn();var b=a.ea[a.getSourceIndex()];if(!a.configuration.drm||!1===b.drmProtected)return a.log.debug("No DRM configuration present.","Skipping DRM engine initialization"),Promise.resolve();b=_.Wk(a.configuration.drm);a.log.debug("Drm configuration: ",b);const c=a.getNetworkEngine();a.o=new _.On({mb:c,onError:d=>a.onError(d),ke:()=>{},je:(d,e)=>{a.trigger(new _.C(_.Gd,{expirationTime:e}))},onEvent:d=>{d instanceof _.C?a.dispatchEvent(d):a.log.debug(_.Jb,
|
|
189
|
+
d.type)},getConfiguration:()=>a.getConfiguration(),xc:()=>a.xc()});a.o.g=b;yield _.Jm(a.o,[{id:0,language:_.If,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,wa:0,mimeType:_.Yf,codecs:"",encrypted:!0,keyId:null,language:_.If,originalLanguage:_.If,label:null,type:_.u,primary:!1,frameRate:void 0,zh:void 0,
|
|
190
|
+
trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,lh:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}]);yield _.Zm(a.o,a.a);return Promise.resolve()})};Qn=function(a,b){rn(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.g,()=>{a.getState()!==_.Bn&&a.seek(b).catch(c=>{a.log.warn("Error while seeking to start position.",c)})})};
|
|
191
|
+
Mn=function(a){if(null===a.ea||!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 _.H(_.F,3,3016,{code:b,th:c,message:a.a.error.message})};
|
|
192
|
+
Sn=function(a){if(a.w)return new _.Rn(Kn(),()=>{});const b=a.ea[a.getSourceIndex()],c=a.configuration.startTime||null,d=a.a,e=a.H;c&&Qn(a,c);if(d.preload!==_.xe)a.g.one(d,_.le,()=>{const g=Date.now()/1E3-e;a.f.A=g;a.log.debug("Time to load: ",g)});d.src=b.url;(_.Dj()||_.Gj())&&d.load();const f=new _.Km;a.g.one(d,tf,()=>{const g=a.getConfiguration().manifest.attemptParameters.timeout||30;a.C||(a.C=(new _.zj(()=>{f.reject(new _.H(_.F,3,3100,{message:`Unable to load media source successfully from ${b.url}`,
|
|
193
|
+
uri:b.url},d.error))})).ca(g))});rn(d,a.configuration.forceWaitForTracks?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_METADATA,a.g,()=>f.resolve());d.error?f.reject(Mn(a)):d.preload===_.xe&&(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.g.one(d,_.Qd,()=>{f.reject(Mn(a))});return new _.Rn(f,
|
|
194
|
+
()=>{const g=new _.H(_.F,7,7001);f.reject(g);return Promise.resolve()})};Tn=function(a,b){rn(b,HTMLMediaElement.HAVE_CURRENT_DATA,a.g,()=>{if(a.isLive()&&a.getState()!==_.Bn){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)}))}})};
|
|
195
|
+
Un=function(a,b){let c=!1;a.g.on(b,_.of,()=>{c=b.paused});a.g.on(b,_.nf,()=>{.2>b.duration-b.currentTime&&b.paused&&!c&&(a.log.warn("Player was auto-paused during seek to the end, auto-resuming."),b.play())})};_.Xn=function(a){a&&(0<=Vn.indexOf(a)?Wn.warn(`Factory '${a.name()}' is already registered`):(Vn.push(a),Wn.info(`Factory ${a.name()}' has been registered.`)))};Zn=function(a,b){let c=Vn.find(d=>d.isSupported(a,b));c||(c=new Yn);Wn.info(`Chosen ads: ${c.name()}`);return c};
|
|
196
|
+
_.$n=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};_.ao=function(a,b){a.classList.add(b)};_.bo=function(a,b){if(a&&typeof b===_.ye)for(const c in b)a.style[c]=b[c]};_.co=function(a){return document.createElement(a)};
|
|
197
|
+
eo=function(a,b){const c=new MutationObserver(()=>{const d=Array.from(a.g.values());jh(Array.from(b.classList),Array.from(d))||b.classList.add(...d)});c.observe(b,{attributes:!0,attributeFilter:["class"]});return c};fo=function(a,b){a.a&&0!==b.length&&(a.a.classList.add(b),a.g.add(b))};
|
|
198
|
+
go=function(a,b,c){(_.Gj()&&53===Hj().major||_.Gj()&&68===Hj().major||_.Ij())&&!b.hasAttribute(wd)&&(b.style.opacity="0",b.setAttribute(wd,""),a.j.one(b,Ld,()=>{b.removeAttribute(wd);b.style.opacity="1";c&&(c.style.opacity="1")}))};
|
|
199
|
+
ko=function(a){a.a.on(window,"offline",()=>{ho(a,!1)});a.a.on(window,"online",()=>{a.f||io(a)});a.a.on(a.m,tf,()=>jo(a));a.a.on(a.m,"suspend",()=>jo(a));a.a.on(a.m,_.dg,()=>jo(a));a.a.on(a.m,_.Te,()=>{a.f||io(a)});a.a.on(a.m,_.df,()=>{a.f||io(a)});a.a.on(a.m,_.vf,()=>{switch(a.m.getState()){case _.xn:jo(a);break;default:jo(a)}})};lo=function(a){a.g&&(a.g.stop(),a.g=null)};jo=function(a){a.f&&io(a)};
|
|
200
|
+
mo=function(a){return _.w(function*(){var b=a.m.getConfiguration().connectivityCheck;b&&a.m&&(b=yield Ji(a.j,b.url,b.attemptParameters,b.method),ho(a,b))})};io=function(a){a.m.getConfiguration().connectivityCheck&&(lo(a),a.g=(new _.zj(()=>mo(a))).ca(5))};ho=function(a,b){lo(a);a.f!==b&&(a.f=b,a.m&&a.m.getConfiguration().connectivityCheck&&a.m.trigger(new _.C(Ee,{online:a.f})))};oo=function(){for(let a=0;a<no.length;++a)no[a].nc()};
|
|
201
|
+
_.po=function(a,b){b=b||0;a={priority:b,nc:a};for(let c=0;c<no.length;c++)if(no[c].priority<b){no.splice(c,0,a);return}no.push(a)};qo=function(a,b){a.onError(b);a.release().then(()=>a.destroy())};so=function(a){if(!a.a){var b=a.license.split(".");if(3!==b.length)throw Error("Expected to find 3 data sections in JWT raw data");b=new ro(b[0],b[1],b[2]);a.a=b}return a.a};
|
|
202
|
+
to=function(a){switch((a.ea[0]||{src:"",type:""}).type){case _.tc:a="dash";break;case _.zc:a="ss";break;case _.uk:a="hls";break;case _.Yf:a="mp4";break;default:a=""}return a};uo=function(a){return a.viewerId?a.viewerId:(a=a.drm||null)&&a.customData&&a.customData.userId?`${a.customData.userId}`:""};vo=function(a){return(a=a.drm||null)&&a.customData&&a.customData.assetId?`${a.customData.assetId}`:""};
|
|
203
|
+
wo=function(a){return(a=a.drm||null)&&a.customData&&a.customData.sessionId?`${a.customData.sessionId}`:""};xo=function(a){a=a.drmInfo;return(new _.vh(a&&a.licenseServerUri||"")).Ja};yo=function(a){const b=a.configuration;let c="no";b.drm&&!_.Gg(b.drm,{})&&(c="custom",b.drm.env&&b.drm.env.toLowerCase().startsWith(Kd)||xo(a).endsWith("drmtoday.com"))&&(c=Kd);return c};zo=function(a){a=a.drmInfo;let b="";if(a)switch(a.keySystem){case _.ud:b="wv";break;case _.sd:b="pr";break;case _.pd:b="fps"}return b};
|
|
204
|
+
Ao=function(a){a=a.drmInfo;let b=!1;a&&(b=a.persistentStateRequired);return b.toString()};Bo=function(a){a=a.drmInfo;let b="";if(a)switch(a.videoRobustness){case Wa:case Ta:b="L1";break;case Va:b="L2";break;case _.Ab:case _.zb:b="L3"}return b};
|
|
205
|
+
Fo=function(a,b){const c="ie"===_.bk().browser;var d=b.configuration;const e=[...Array.from(_.Ek.keys()),...b.Jg];b={"CL-KEY":a.license,"CL-LOCATION":window.location.href,"CL-SDK-VERSION":_.da,"CL-USER-ID":uo(d),"CL-ASSET-ID":vo(d),"CL-SESSION-ID":wo(d),"CL-PLAYBACK-TYPE":b.isLive?Co:Do,"CL-CONTENT-TYPE":to(b),"CL-PLUGINS":e.join(" "),"CL-DRM":yo(b),"CL-DRM-CDM":zo(b),"CL-DRM-SEC-LEVEL":Bo(b),"CL-DRM-OFFLINE":Ao(b),"CL-DRM-IP":xo(b)};c&&(d=window.localStorage.getItem("cl_et"))&&(b["CL-ETAG"]=d);d=
|
|
206
|
+
_.zi(["https://downloads.castlabs.com/r/register/"]);d.method="GET";d.headers=b;return(new _.Eo).fetch(d).P.then(f=>{200===f.status&&c&&window.localStorage.setItem("cl_et",f.headers.etag);return Promise.resolve()}).catch(f=>{a:{var g=so(a);f=f.data;var h=f.status;if(g.a&&g.a.ilv)g=Promise.resolve();else{switch(h){case 403:case 404:g=7101;var k="castLabs Player license is invalid";if(403===h){h=k;k="";try{k=JSON.parse(decodeURIComponent(f.responseText)).message}catch(l){}f=k;f=h+(": "+f)}else f=k+
|
|
207
|
+
"!";k=f;break;case 412:g=7103;k="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:g=Promise.resolve();break a}a.h.error(ab+k);g=Promise.reject(new _.H(_.F,7,g,k))}}return g})};_.Ho=function(a){a&&(0<=Go.indexOf(a)||Go.push(a))};Jo=function(a,b){a.w=new Io(b);a.w.verify().catch(c=>{setTimeout(()=>{a.h.error(ab+c);a.trigger(new _.C(_.Qd,{detail:new _.H(_.F,7,7101)}));a.destroy()},1E3)})};
|
|
208
|
+
Lo=function(a,b){a.H=b;for(const c of a.H)(b=c.id())&&(a.I[b]=c);_.Ko(a,"onPlayerCreated")};_.Mo=function(a,b){b!==a.a&&(a.a&&(a.a.removeDelegate(a),a.a.destroy()),a.a=b,a.a&&(a.a.init(a.g,a.f),a.a.setNetworkEngine(a.getNetworkEngine()),a.a.addDelegate(a)))};
|
|
209
|
+
No=function(a,b){_.w(function*(){a.g.getMedia()||a.g.getCastElement();a.w||(a.w=new Io(a.f.license));try{a.h.debug("Verifying license remotely"),yield Fo(a.w,b),a.h.debug("License verified remotely")}catch(c){a.h.debug("License rejected by remote",c),setTimeout(qo,1E3,{release:a.release.bind(a),destroy:a.destroy.bind(a),onError:a.onError.bind(a)},c)}})};_.Ko=function(a,b,...c){if(!a.O)return Promise.resolve();const d=a.H.map(e=>e[b].call(e,a,...c)).filter(e=>e instanceof Promise);return Promise.all(d)};
|
|
210
|
+
Oo=function(a){return _.w(function*(){if(a.F)return a.h.debug("The player is already released. No-op"),new Promise(b=>b());a.J.off(document,bg);a.trigger(new _.C(_.hf));a.g&&a.g.release();a.j&&(yield a.j.dispose(),a.j=null);if(a.a){let b=null;const c=a.a.on(_.vf,d=>{b=d});return _.Ko(a,_.Ce).then(()=>{a.a.removeDelegate(a);return Promise.all([a.a.release(),a.A.release()])}).then(()=>{a.h.debug("Releasing player completed");b&&(a.h.debug("Re-post state change event after release"),a.trigger(b))}).finally(()=>
|
|
211
|
+
{a.a.off(_.vf,c);a.trigger(new _.C(gf))})}a.trigger(new _.C(gf));return new Promise(b=>b())})};
|
|
212
|
+
Qo=function(a,b,c){return new Promise((d,e)=>{var f;if(b){var g=f=null;for(var h=0;h<b.length;h++);h=Object.values(_.Tg);for(let k=0;k<b.length;k++)for(let l=0;l<h.length;l++){const m={Hb:h[l],confidence:h[l].canPlay(b[k],c)};if(null===f||f.confidence<m.confidence)f=m,g=k}f&&typeof g===_.r&&0<f.confidence?(_.Ug.debug("Player Factory '"+f.Hb.a()+"' can play",b[g]),f=new Po(f.Hb,g)):(_.Ug.error("No compatible Player Factory found for sources:",b),f=null)}else f=null;f?(e=f.Hb.create(),d({player:e,sourceIndex:f.sourceIndex})):
|
|
213
|
+
(d=new _.C(_.Qd,{detail:new _.H(_.F,7,7003)}),a.trigger(d),e(d))})};
|
|
214
|
+
_.To=function(a,b){return _.w(function*(){_.nm(Qe);if(a.C)throw Error("Player is already destroyed.");if(!a.g)throw Error("No surface associated with this player!");yield a.release();if(!b)throw new _.H(_.F,7,7003,kb);a.o=_.In(b);a.f=_.Ck(a.K,Dk(b)?b:{},{source:a.o});if(0===a.o.length)throw new _.H(_.F,7,7003,kb);a.F=!1;let c;var d=0;if(a.G||2!==(a.a?a.a.canPlay(a.o[0],a.f):0))d=yield Qo(a,a.o,a.f),c=d.player,d=d.sourceIndex,a.G=!1;c?_.Mo(a,c):a.a.addDelegate(a);Ro(a);a.a&&a.a.setCdnErrorCallback(a.B);
|
|
215
|
+
So(a,a.f);a.a&&a.a.setSourceIndex(d);if(a.f.pauseWhenInBackground)a.J.on(document,bg,()=>{document.hidden?(a.h.debug("Player is hidden: pausing..."),a.pause()):(a.h.debug("Player is visible: resuming..."),a.play())});Lk(a);yield _.Ko(a,"onContentWillLoad",a.f.source[d]);_.nm(Pe);_.om("player.beforeLoad",Qe,Pe)})};_.Uo=function(a){return _.w(function*(){a.g.getMedia()||a.g.getCastElement();a.trigger(new _.C(me));yield Promise.all([a.a.load(a.f),a.j.load()])})};
|
|
216
|
+
_.Wo=function(a){return _.w(function*(){_.nm(Oe);No(a,{configuration:a.getConfiguration(),ea:a.Ye(),drmInfo:a.getDrmInfo(),Jg:Object.keys(a.I),isLive:a.isLive()});Vo(a);Mk();yield _.Ko(a,"onContentLoaded");a.f.autoplay&&(yield a.play());_.nm(Ne);_.om("player.afterLoad",Oe,Ne)})};Xo=function(a){return _.w(function*(){if(a.a){var b=a.a;b.rf?(a.trigger(new _.C(me)),yield b.rf(),yield _.Wo(a)):a.h.warn(tb)}else a.h.warn(qb)})};
|
|
217
|
+
Ro=function(a){a.a&&a.a.setDrmCustomDataModifier(b=>_.w(function*(){a.sc&&a.Ld&&(a.Ld=!1,yield a.sc(b))}))};So=function(a,b){a.j=Zn(a,b).create(a)};
|
|
218
|
+
Yo=function(a){const b=_.hh(a.f.preferredTextLanguage).filter(f=>f),c=a.f.preferForcedSubtitles,d=a.getTrackManager().ga().filter(f=>c?f.kind===_.Rd:f.kind!==_.Rd);if(0===d.length)c&&a.h.warn("Forced subtitles are configured to be preferred, but no forced subtitles are available.");else{if(c&&0===b.length){var e=a.getTrackManager().ja();e&&e.language?(e=_.Jh(e.language||""),b.push(e)):(e=a.getTrackManager().Ea())&&e.language&&(e=_.Jh(e.language||""),b.push(e));0===b.length&&a.h.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=>
|
|
219
|
+
{const g=_.Jh(f);if(f=d.find(h=>{h=_.Jh(h.language||"");return _.Kh(h,g)}))return a.getTrackManager().Ha(f),!0;c&&a.h.warn("Forced subtitles are configured to be preferred, but no forced subtitles match the preferred languages: ",b);return!1})}};Vo=function(a){_.w(function*(){const b=[];if(a.f.remoteTextTracks)for(const c of a.f.remoteTextTracks)b.push(a.getTrackManager().addTextTrack(c));yield Promise.all(b);Yo(a)})};
|
|
220
|
+
Zo=function(a,b){const c=document.getElementById(a);if(!c)throw Error("Anchor element not found");c.classList.add(ad);return Array.from({length:3}).map(()=>{const d=document.createElement(_.u);d.classList.add(dd);const e=document.createElement(_.Bd);e.classList.add(cd);e.appendChild(d);c.appendChild(e);return new Q(d,b)})};
|
|
221
|
+
$o=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.h.info(`Show video element .${b}`),d.classList.add(ed)):(a.h.info(`Hide video element .${b}`),d.classList.remove(ed)),a.A&&a.A(d,c))};cp=function(a,b){return _.w(function*(){const c=yield a.w.get();a.f=b;b.role=ap;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();$o(a,c,!0);yield c.load(b.config);bp(a,b);b.config.autoplay||(yield c.play())})};
|
|
222
|
+
gp=function(a){_.w(function*(){if(0===a.a)yield dp(a);else if(a.a===a.g.length-1)yield ep(a);else{const b=[a.a-1,a.a+1];a.h.info(`Preload items (indices: ${b})`);yield Promise.all(b.map(c=>fp(a,c)))}})};
|
|
223
|
+
hp=function(a,b){return _.w(function*(){if(b.player){if(b.state===af){a.h.info(Pb);try{yield b.preloadPromise}catch(c){}}a.f=b;b.role=ap;$o(a,b.player,!0);b.state===$e?(_.nm(Xe),a.o.preloadMedia?yield b.player.play():yield Xo(b.player),_.nm(We),_.om("playlist.next",Xe,We)):b.state===Ze&&(yield b.player.load(b.config));bp(a,b);b.config.autoplay||(yield b.player.play())}})};
|
|
224
|
+
kp=function(a,b){return _.w(function*(){a.h.info(`Stop current playback (index: ${b.index})`);b.player.pause();$o(a,b.player,!1);yield ip(a,b);b.player=null;b.videoEl=null;b.role=jp})};mp=function(a){return Promise.all(Array.from(a.l.keys()).map(b=>lp(a,b)))};np=function(a){return _.w(function*(){yield a.w.destroy();const b=document.getElementById(a.o.anchorId);b&&(b.classList.remove(ad),b.innerHTML="")})};
|
|
225
|
+
lp=function(a,b){return _.w(function*(){const c=a.l.get(b);c&&(a.h.info(`Stop preloading item (index: ${b})`),c.player&&(yield ip(a,c)),a.l.delete(b))})};ip=function(a,b){return _.w(function*(){b.disposers.forEach(c=>c());b.disposers=[];b.player&&(yield a.w.release(b.player))})};bp=function(a,b){if(a.o.autoplayNext){const c=()=>{a.h.info("Automatically transition to next item");a.pf()};b.player.on(_.Pd,c);const d=b.player;b.disposers.push(()=>{d.off(_.Pd,c)})}};
|
|
226
|
+
fp=function(a,b){return _.w(function*(){const c=yield a.w.get(),d=a.g[b];d.player=c;d.videoEl=c.getSurface().getMedia();d.role=jp;d.state=af;a.trigger(new _.C(Kf));try{a.l.set(b,d),a.o.preloadMedia?(d.config.autoplay&&(a.h.warn(ka+`Force disabling autoplay (index: ${b})`),d.config.autoplay=!1),d.preloadPromise=c.load(d.config)):d.preloadPromise=c.preload(d.config),yield d.preloadPromise,d.state=$e,a.trigger(new _.C(Kf))}catch(e){7001===e.code?(a.h.info(`Preload aborted (index: ${b})`),d.state=Ye):
|
|
227
|
+
(a.h.warn(`Preload failed (index: ${b})`,e),a.trigger(new _.C(_.Qd,{detail:e})),d.state=Ze),a.trigger(new _.C(Kf))}})};dp=function(a){return _.w(function*(){const b=a.a+1;a.h.info(`Preload following item (index: ${b})`);yield fp(a,b)})};ep=function(a){return _.w(function*(){const b=a.a-1;a.h.info(`Preload preceding item (index: ${b})`);yield fp(a,b)})};
|
|
228
|
+
_.pp=function(a){if(op.has(a))return op.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);op.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),op.set(a,b),b):!1};qp=function(a,b){b=b.replace(/mp2t/i,"mp4");a==_.p&&(b=b.replace(_.u,_.p));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};
|
|
229
|
+
rp=function(a,b,c){a.classList.add(ad);return Array.from({length:b}).map(()=>{const d=document.createElement(_.u);d.classList.add(dd);const e=document.createElement(_.Bd);e.classList.add(cd);e.appendChild(d);a.appendChild(e);return new Q(d,c)})};
|
|
230
|
+
sp=function(a,b,c){if(!a.A){var d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.h.info(`Show video element .${b}`),d.classList.add(ed),d.classList.remove("clpp-hide")):(a.h.info(`Hide video element .${b}`),d.classList.remove(ed),d.classList.add("clpp-hide")),a.w&&a.w(d,c))}};tp=function(a){return _.w(function*(){const b=a.a;b&&("loaded"!==b.state&&(yield b.Wc),yield b.player.play(),b.state=_.Te,b.gc&&b.gc())})};up=function(a,b){a.A=b;const c=a.a&&a.a.player;c&&sp(a,c,!b)};
|
|
231
|
+
wp=function(a,b){return _.w(function*(){if(b.player){if(b.state===af){a.h.info(Pb);try{yield b.preloadPromise}catch(c){}}a.a=b;b.role=vp;sp(a,b.player,!0);b.state="loading";b.state===$e?yield b.player.play():b.state===Ze&&(yield b.player.load(b.config));b.config.autoplay||(yield b.player.play());b.state=_.Te}})};yp=function(a,b){return _.w(function*(){yield xp(a,b);b.config.autoplay||(yield b.player.play());b.state=_.Te})};
|
|
232
|
+
zp=function(a,b){const c=b.transition;if(c){if(c.fc){const d=c.fc,e=()=>{a.h.info(`Transition onEnded to (ID: ${d})`);a.play(d)};b.player.on(_.Pd,e);b.disposers.push(()=>{b.player.off(_.Pd,e)})}if(c.ff){const d=e=>{const f=c.ff.find(g=>g.cueId===e.detail.id);f&&(a.h.info(`Transition onCue to (ID: ${f.itemId})`),a.play(f.itemId))};b.player.on(_.dh,d);b.disposers.push(()=>{b.player.off(_.dh,d)})}if(c.lf){const d=c.lf,e=()=>{b.player.getPosition()>=d.position&&(a.h.info(`Transition onPosition to (ID: ${d.itemId})`),
|
|
233
|
+
a.play(d.itemId))};b.player.on(_.Ff,e);b.disposers.push(()=>{b.player.off(_.Ff,e)})}}};Bp=function(a,b){return _.w(function*(){a.h.info(`Stop current playback (ID: ${b.id})`);b.disposers.forEach(d=>d());b.disposers=[];const c=b.player;b.player=null;b.videoEl=null;b.role=Ap;c.pause();yield a.l.release(c);sp(a,c,!1)})};Dp=function(a){return Promise.all(Array.from(a.f.keys()).map(b=>Cp(a,b)))};
|
|
234
|
+
Fp=function(a,b){_.w(function*(){if(0!==b.length){a.h.info(`Preload items (IDs: ${b})`);var c=a.j.filter(d=>b.includes(d.id))||[];yield Promise.all(c.map(d=>Ep(a,d)))}})};xp=function(a,b){return _.w(function*(){const c=yield a.l.get();a.a=b;b.role=vp;a.a.player=c;a.a.videoEl=c.getSurface().getMedia();sp(a,c,!0);b.primary&&a.trigger(new _.C(bf,{detail:{player:c}}));b.state="loading";b.Wc=yield c.load(b.config);b.state="loaded"})};
|
|
235
|
+
Gp=function(a){return _.w(function*(){yield a.l.destroy();const b=a.o.anchorEl;b&&(b.classList.remove(ad),b.innerHTML="")})};Hp=function(a){a.a&&(a.a.disposers.forEach(b=>b()),a.a.disposers=[],zp(a,a.a),Dp(a),Fp(a,a.a.next))};Cp=function(a,b){return _.w(function*(){const c=a.f.get(b);c&&(a.h.info(`Stop preloading item (ID: ${b})`),c.player&&(yield a.l.release(c.player)),a.f.delete(b))})};
|
|
236
|
+
Ep=function(a,b){return _.w(function*(){const c=b.id,d=yield a.l.get();b.player=d;b.videoEl=d.getSurface().getMedia();b.role=Ap;b.state=af;a.trigger(new _.C(Kf));try{a.f.set(c,b),b.config.autoplay&&(a.h.warn(ka+`Force disabling autoplay (ID: ${c})`),b.config.autoplay=!1),b.primary&&a.trigger(new _.C(bf,{detail:{player:d}})),b.preloadPromise=d.load(b.config),yield b.preloadPromise,b.state=$e,a.trigger(new _.C(Kf))}catch(e){7001===e.code?(a.h.info(`Preload aborted (ID: ${c})`),b.state=Ye):(a.h.warn(`Preload failed (ID: ${c})`,
|
|
237
|
+
e),a.trigger(new _.C(_.Qd,{detail:e})),b.state=Ze),a.trigger(new _.C(Kf))}})};Ip=function(a){return a&&a.ASSETS&&Array.isArray(a.ASSETS)?a.ASSETS.every(b=>typeof b.URI===_.yf&&typeof b.DURATION===_.r):!1};Jp=function(a){a.g.forEach(b=>b());a.g=[]};
|
|
238
|
+
Op=function(a,b){const c=()=>_.w(function*(){var e=b.getPosition();if(e=Kp(a,e))a.h.info(`Interstitial ${e.cueId} coming up `+`at ${e.startTime} s`),(yield Lp(a,e))&&Mp(a,e,b)});b.addEventListener(_.Ff,c);a.g.push(()=>{b.removeEventListener(_.Ff,c)});const d=()=>{a.trigger(new _.C(Np))};b.on(_.Pd,d);a.g.push(()=>{b.off(_.Pd,d)})};
|
|
239
|
+
Qp=function(a,b,c){return _.w(function*(){if(b.source){a.a.dd([{id:cf,primary:!0,config:_.yg(b),next:[]}]);yield a.a.load(cf);var d=a.a.ub();d&&d.pd()?(d=Array.from(d.pd().cues()),Pp(a,d,c)||(up(a.a,!1),c||(yield tp(a.a)))):a.h.error("Failed to get cue timeline after load")}else a.h.error("Config must be of type cl.api.PlayerConfiguration")})};
|
|
240
|
+
Pp=function(a,b,c){var d=b.filter(f=>f.schemeIdUri===_.qd&&f.Pa);a.h.info("Interstitial cues found",d);if(!Rp(a,d))return!1;b=d.find(f=>f.startTime<a.f.prerollMarginSec);const e=d.filter(f=>f.startTime<a.f.resolutionOffsetSec&&!(f.startTime<a.f.prerollMarginSec));d=d.filter(f=>!(f.startTime<a.f.resolutionOffsetSec));b&&Sp(a,b,c);0<e.length&&e.forEach(f=>Tp(a,f));d.forEach(f=>Up(a,f));a.trigger(new _.C(Vp,{detail:a.Oc()}));return!!b};
|
|
241
|
+
Rp=function(a,b){const c=b.sort((g,h)=>g.startTime-h.startTime),d=a.f.resolutionOffsetSec,e=[];for(let g=0;g<c.length-1;g++){const h=c[g],k=c[g+1];k&&k.startTime-h.endTime<d&&e.push(`Interstitials ${h.id} and ${k.id} `+`are too close to each other (less than ${d} s).`);k&&k.startTime<=h.endTime&&e.push(`Interstitials ${h.id} and ${k.id} `+"overlap.")}const f=[];b.forEach(g=>{const h=g.Pa[_.Ub],k=g.Pa[_.Vb];g.Pa[_.Tb]||h?null!=k&&1>k&&a.h.warn(`Interstitial cue ${g.id} is invalid `+"X-PLAYOUT-LIMIT is less than 1 s.",
|
|
235
242
|
g):f.push(`Interstitial cue ${g.id} is invalid `+"it contains neither X-ASSET-LIST nor X-ASSET-URI.")});0<f.length?a.h.error("Invalid interstitials, all interstitials will "+`be skipped. ${f.join(" ")}`):0<e.length&&a.h.warn("Unsupported format of interstitials, playback may not "+`behave correctly. ${e.join(" ")}`);return 0===f.length};
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
b.startTime}],b.state=
|
|
241
|
-
|
|
242
|
-
resumePosition:b.resumePosition,itemCount:e.length,playoutLimit:b.playoutLimit}}))}}};
|
|
243
|
-
|
|
244
|
-
podOrder:g+1,podCount:b.Aa.length}}))}});if(null!=b.playoutLimit){const f=b.playoutLimit;a.h.info(`Playout limit for ${b.cueId} is `+`${f} s`);e=e.filter(k=>k.
|
|
245
|
-
e[0]);a.trigger(new _.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
!0);c=_
|
|
249
|
-
|
|
250
|
-
c.sessionId))&&c.ready()}),a.f.on(b,a.g+"keyerror",c=>{var d=
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
a.f=null}})).ca(.01)}return a.f}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
_.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
const q={};for(const t of n)n=t.split(": "),q[n[0].toLowerCase()]=n.slice(1).join(": ");try{const t=
|
|
263
|
-
for(var q of n)n=q.split(": "),t[n[0].toLowerCase()]=n.slice(1).join(": ")}q=_.
|
|
264
|
-
7001,{url:b,request:a}));return Promise.resolve()}}};
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
c(!1,k))&&(h=e)}}return h.then(()=>
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
let b=0,c=0,d=0;return a.g.then(e=>{const f=e.request;f.currentAttempt+=1;b=f.currentAttempt;c=f.maxAttempts;d=f.uris.length;return e.P}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.H){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
b.onProgress)}else{const q=e.body.getReader();f=yield
|
|
277
|
-
|
|
278
|
-
_.
|
|
279
|
-
_.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.a=null};c.prototype.j=function(g){this.g(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.g)}};b.prototype.C=function(g){if(g===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.F(g);else{a:switch(typeof g){case _.
|
|
283
|
-
b.prototype.B=function(g){var h=void 0;try{h=g.then}catch(k){this.g(k);return}typeof h==_.
|
|
284
|
-
g.fd(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(q,t){return typeof q==_.
|
|
285
|
-
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=
|
|
286
|
-
|
|
287
|
-
_.
|
|
288
|
-
_.R=class{constructor(a){(this.tag=a)&&void 0===
|
|
289
|
-
arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of
|
|
290
|
-
this.tag?new _.R(this.tag+"."+a):new _.R(a):this}};_.
|
|
291
|
-
_.
|
|
292
|
-
|
|
293
|
-
a.payloadType}};_.
|
|
294
|
-
_.
|
|
295
|
-
_.
|
|
296
|
-
_.
|
|
297
|
-
_.
|
|
243
|
+
Sp=function(a,b,c){_.w(function*(){const d=Up(a,b),e=yield Lp(a,d),f=d.Aa?d.Aa.length:0;e&&0<f?Wp(a,d,c):(e?a.h.warn("Preroll interstitial has no assets, skipping"):a.h.error("Preroll interstitial failed, skipping"),up(a.a,!1),c||(yield tp(a.a)))})};
|
|
244
|
+
Tp=function(a,b){return _.w(function*(){const c=Up(a,b);a.h.info(`Interstitial ${c.cueId} coming up `+`at ${c.startTime} s`);if(yield Lp(a,c)){const e=a.a.getCurrentItem();if(!e)a.h.error("Cannot schedule interstitial "+`${c.cueId}, no primary content not found in `+"playlist");else if(e.player){var d=e.player;e.state===_.Te?Mp(a,c,d):e.gc=()=>{Mp(a,c,d)}}}})};
|
|
245
|
+
Up=function(a,b){{const c=b.Pa[_.Wb];b={cueId:b.id,startTime:b.startTime,endTime:b.endTime,state:Xp,Ce:b.Pa[_.Tb],De:b.Pa[_.Ub],Aa:null,resumePosition:null==c?b.endTime:b.startTime+c,playoutLimit:b.Pa[_.Vb]}}a.j.push(b);return b};
|
|
246
|
+
Lp=function(a,b){return _.w(function*(){b.state=Yp;const c={id:b.cueId,startTime:b.startTime,endTime:b.endTime,resumePosition:b.resumePosition,itemCount:-1,playoutLimit:b.playoutLimit};a.trigger(new _.C(Zp,{detail:c}));if(b.Ce)try{a.h.info(`Load X-ASSET-LIST for ${b.cueId}`),a.trigger(new _.C($p,{detail:c})),b.Aa=yield aq(a,b.Ce),b.state=bq,c.itemCount=b.Aa.length}catch(d){a.h.error("Failed to load X-ASSET-LIST",d),b.state=cq}finally{a.trigger(new _.C(dq,{detail:c}))}else b.De?(b.Aa=[{URI:b.De,DURATION:b.endTime-
|
|
247
|
+
b.startTime}],b.state=bq):b.state=cq;return b.state===bq})};Wp=function(a,b,c){_.w(function*(){const d=a.a.getCurrentItem();if(d){var e=eq(a,b,"preroll");a.a.dd(e);fq(a,d,b,e,!0);Hp(a.a);b.state=bq;c?yield a.a.load(e[0].id):yield a.a.play(e[0].id);up(a.a,!1)}})};
|
|
248
|
+
Mp=function(a,b,c){if(b.Aa)if(0===b.Aa.length){const g=()=>{c.seek(b.resumePosition)};c.on(_.dh,g);a.g.push(()=>{c.off(_.dh,g)});a.h.info(`Interstitial ${b.cueId} scheduled to `+"be skipped")}else{var d=a.a.getCurrentItem();if(d){var e=eq(a,b);a.a.dd(e);var f=e[0].id;fq(a,d,b,e,!1);d.next=[f];d.transition={ff:[{cueId:b.cueId,itemId:f}]};Hp(a.a);b.state=bq;a.h.info(`Interstitial ${b.cueId} scheduled for `+`${b.startTime} s`);a.trigger(new _.C(gq,{detail:{id:b.cueId,startTime:b.startTime,endTime:b.endTime,
|
|
249
|
+
resumePosition:b.resumePosition,itemCount:e.length,playoutLimit:b.playoutLimit}}))}}};Kp=function(a,b){return a.j.find(c=>{const d=c.startTime-b;return c.state===Xp&&0<d&&d<=a.f.resolutionOffsetSec})||null};aq=function(a,b){return _.w(function*(){var c=a.a.ub();if(!c)throw Error("No player found");c=c.getNetworkEngine();const d=_.zi(b);c=yield Ii(c,d);if(!Ip(c))throw new sh("Invalid X-ASSET-LIST list response");return Promise.resolve(c.ASSETS)})};
|
|
250
|
+
eq=function(a,b,c){c=void 0===c?"":c;let d=0,e=b.Aa.map((f,g)=>{const h=`${b.cueId}-${g}`;g=g===b.Aa.length-1?cf:`${b.cueId}-${g+1}`;d+=f.DURATION;f={id:h,config:{source:{url:f.URI,type:_.uk}},next:[g],transition:{fc:g},duration:f.DURATION,Ne:d,vh:b.cueId};return a.f.interstitialAssetConverter?a.f.interstitialAssetConverter(f):f});e.forEach((f,g)=>{f.gc=()=>{a.h.info(`Playing interstitial asset ${f.id}`,f);a.trigger(new _.C(hq,{detail:{id:f.id,podId:b.cueId,uri:f.config.source.url,duration:f.duration,
|
|
251
|
+
podOrder:g+1,podCount:b.Aa.length}}))}});if(null!=b.playoutLimit){const f=b.playoutLimit;a.h.info(`Playout limit for ${b.cueId} is `+`${f} s`);e=e.filter(k=>k.Ne-k.duration<=f);const g=e[e.length-1],h=Math.abs(g.Ne-f);1>h?g.transition.fc=cf:(g.transition.fc=void 0,g.transition.lf={position:g.duration-h,itemId:cf});g.next=[cf]}e[0].gc=()=>{a.h.info(`Playing interstitial ${c} ${b.cueId} with `+`${b.Aa.length} assets and will resume primary `+`content at ${b.resumePosition} s.`,e);a.h.info(`Playing interstitial asset ${e[0].id}`,
|
|
252
|
+
e[0]);a.trigger(new _.C(iq,{detail:{id:b.cueId,startTime:b.startTime,endTime:b.endTime,resumePosition:b.resumePosition,itemCount:e.length,playoutLimit:b.playoutLimit}}));a.trigger(new _.C(hq,{detail:{id:e[0].id,podId:b.cueId,uri:b.Aa[0].URI,duration:b.Aa[0].DURATION,podOrder:1,podCount:b.Aa.length}}))};return e};
|
|
253
|
+
fq=function(a,b,c,d,e){b.gc=()=>{a.h.info("Resuming primary content at "+`${b.config.startTime} s.`);a.trigger(new _.C(jq,{detail:{id:c.cueId}}));c.state=kq;a.a.removeItems(d.map(f=>f.id));b.next=[];e&&a.trigger(new _.C(lq))};b.config.startTime=c.resumePosition};mq=function(a,b){a.size=void 0===b?0:1;a.h.debug("Setting key status to",b);a.a=b};
|
|
254
|
+
nq=function(a,b){a.f=b;_.Xg(a.a);if(!b)return Promise.resolve();a.a.on(b,Nd,c=>{_.Rg("AppleEmeManager.cancelNativeMediaEncryptedEvent_",c);"MediaEncryptedEvent"in window&&c instanceof MediaEncryptedEvent&&(a.h.info("Cancel native MediaEncryptedEvent when using Apple-prefixed EME"),c.stopImmediatePropagation())});a.a.on(b,jg,c=>{{a.h.debug("Handle webkitNeedKey event");c=_.J(c.initData);if(_.Th(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=Yh(c.subarray(4),
|
|
255
|
+
!0);c=_.$h(c);const d=new Event(Nd);d.initDataType="skd";d.initData=Uh(c);a.f.dispatchEvent(d)}});rn(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.g));return Promise.resolve()};oq=function(a,b){mq(a.keyStatuses,b);b=new _.C(de);a.dispatchEvent(b)};
|
|
256
|
+
rq=function(a,b){a.a=b;_.Xg(a.f);b&&(a.f.on(b,a.g+"needkey",c=>{{const d=new Event(Nd);d.initDataType=_.Uc;d.initData=Uh(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.g+"keymessage",c=>{{const e=pq(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.C(_.qe,{messageType:d?ge:fe,message:c.message});d=e;_.Rg("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.Sg("Session not found",c.sessionId)}}),a.f.on(b,a.g+"keyadded",c=>{(c=pq(a,
|
|
257
|
+
c.sessionId))&&c.ready()}),a.f.on(b,a.g+"keyerror",c=>{var d=pq(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?qq(d,_.He):1===e?qq(d,"expired"):qq(d,_.Zd))}}}))};
|
|
258
|
+
pq=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};qq=function(a,b){mq(a.keyStatuses,b);b=new _.C(de);a.dispatchEvent(b)};sq=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
|
|
259
|
+
tq=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===_.Ke)if(c)d=_.J(_.$h("LOAD_SESSION|"+c));else{const f=_.$h("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.J(b),f.byteLength);d=g}else d=_.J(b)}catch(f){return Promise.reject(f)}a.f=new _.Km;const e=sq(a,"generateKeyRequest");try{a.j[e](a.g,d)}catch(f){if(f.name!==Ya)return a.f=null,Promise.reject(f);(new _.zj(()=>{try{a.j[e](a.g,d)}catch(g){a.f.reject(g),
|
|
260
|
+
a.f=null}})).ca(.01)}return a.f};uq=function(a,b,c){if(a.a)a.a.then(()=>uq(a,b,c)).catch(()=>uq(a,b,c));else{a.a=b;if(a.g===fg){var d=_.Wh(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=_.li(e.keys[0].k);e=_.li(e.keys[0].kid)}else d=_.J(c),e=null;var f=sq(a,"addKey");try{a.j[f](a.g,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
|
|
261
|
+
vq=function(a){const b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();let c;typeof Event===_.Td?c=new Event(b,a):(c=document.createEvent("Event"),c.initEvent(b,a.bubbles,a.cancelable));a.target.dispatchEvent(c)};wq=function(a){a=a.target;if(a.webkitPresentationMode===Le){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)};
|
|
262
|
+
xq=function(){return this.webkitSupportsPresentationMode(Le)?(this.webkitSetPresentationMode(Le),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))};yq=function(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))};
|
|
263
|
+
zq=function(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}};Aq=function(a,b,c){return new window.TextTrackCue(a,b,c)};Bq=function(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)};Dq=function(a,b,c){if("input"===a)switch(this.type){case "range":a=Xc}Cq.call(this,a,b,c)};Eq=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()};
|
|
264
|
+
Fq=function(a){return Eq()-a.a};Hq=function(a){const b=new Gq;b.a=a.a;return b};_.Iq=function(a){const b=[];for(const c of a)for(const d of c.variants)b.push(d);return b};_.Kq=function(a,b,c,d){return _.w(function*(){try{return new (yield Jq(a,b,c,d))}catch(e){throw e.a(_.F),e;}})};
|
|
265
|
+
Jq=function(a,b,c,d){return _.w(function*(){if(d){var e=_.Lq[d.toLowerCase()];if(e)return e;_.B("Could not determine manifest type using MIME type ",d)}if(e=_.Mq(a)){const f=_.Nq[e];if(f)return f;_.B("Could not determine manifest type for extension ",e)}else _.B("Could not find extension for ",a);if(!d&&(d=yield Oq(a,b,c))){if(e=_.Lq[d])return e;_.B("Could not determine manifest type using MIME type",d)}throw new _.H(_.F,4,4E3,{url:a});})};
|
|
266
|
+
_.Mq=function(a){a=(new _.vh(a)).ya.split("/").pop().split(".");return 1==a.length?"":a.pop().toLowerCase()};Oq=function(a,b,c){return _.w(function*(){var d=_.zi(a);xi(d,c);d.type=1;d.method="HEAD";return(d=(yield b.fetch(d).P).headers["content-type"])?d.toLowerCase():""})};Pq=function(a,b){var c=a.f+b.byteLength;if(a.a.byteLength<c){let d=a.a.byteLength;for(;d<c;)d*=2;c=new Uint8Array(d);c.set(a.a);a.a=c}a.a.set(b,a.f);a.f+=b.byteLength};
|
|
267
|
+
Qq=function(a,b,c){return b.read().then(({done:d,value:e})=>{null!=e&&(Pq(a,e),Ci(c,e.byteLength,Fq(a.g)),a.g.a=Eq());return d?(d=a.a.buffer,a.a.byteLength!==a.f&&(d=d.slice(0,a.f)),Promise.resolve(d)):Promise.resolve().then(()=>Qq(a,b,c))})};
|
|
268
|
+
Sq=function(a){const b=a.uris[a.uriIndex],c=new Rq,d=new Gq,e=Hq(d);let f=0,g;const h=new _.Km;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(m){m=m.target;m.readyState>=XMLHttpRequest.LOADING&&0===f&&(g=Fq(e));m.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!k&&(m=m.getResponseHeader(qa),Bi(a,m),k=!0)};c.onload=function(m){m=m.target;var n=(m.getAllResponseHeaders()||"").trim().split("\r\n");
|
|
269
|
+
const q={};for(const t of n)n=t.split(": "),q[n[0].toLowerCase()]=n.slice(1).join(": ");try{const t=Fq(e);l||Ci(a,m.response?m.response.length:0,t);const v=_.Ai(q,m.response,m.status,b,m.responseURL,a,t,g);a.rateLimitBps?Di(a.rateLimitBps,Fq(e),a.bytesLoaded).then(()=>{h.resolve(v)}):h.resolve(v)}catch(t){h.reject(t)}};c.onerror=function(m){m=m.target;if(0>=m.status)h.reject(new _.H(1,1,1002,{url:b,request:a,status:m.status}));else{var n=m.getAllResponseHeaders();const t={};if(n){n=n.trim().split("\r\n");
|
|
270
|
+
for(var q of n)n=q.split(": "),t[n[0].toLowerCase()]=n.slice(1).join(": ")}q=_.Ai(t,m.response,m.status,b,m.responseURL,a,Fq(e),g);h.resolve(q)}};c.ontimeout=function(){h.reject(new _.H(1,1,1003,{url:b,request:a}))};c.onprogress=function(m){const n=Fq(d);d.a=Eq();if(100<n||m.lengthComputable&&m.loaded===m.total)Ci(a,m.loaded-f,n),f=m.loaded,l=!0};for(const m in a.headers)c.setRequestHeader(m.toLowerCase(),a.headers[m]);c.send(a.body);return{P:h,request:a,abort:()=>{c.abort();h.reject(new _.H(1,1,
|
|
271
|
+
7001,{url:b,request:a}));return Promise.resolve()}}};Tq=function(a){let b=null;a.g!==a.f&&(b={start:a.g,end:a.f,length:a.f-a.g,data:new DataView(a.j.a.buffer,a.g,a.f-a.g),count:-1});return b};Uq=function(a,b){{var c=a.j;const d=c.f+b.byteLength;if(d>c.a.byteLength){const e=c.a;c.a=new Uint8Array(Math.max(Math.ceil(c.a.buffer.byteLength*c.g),d));c.a.set(e)}c.a.set(b,c.f);c.f+=b.byteLength}a.a=a.g;a.f=a.j.f;a.l=new DataView(a.j.a.buffer,0,a.j.f)};
|
|
272
|
+
Wq=function(a){if(0<=a.o&&a.f<a.o)return null;let b=Vq(a);for(;null!==b;){if(b.name===_.oe){const c={start:a.g,end:b.end,length:b.end-a.g,data:new DataView(a.j.a.buffer,a.g,b.end-a.g),count:1};a.g=b.end;return c}b=Vq(a)}return null};
|
|
273
|
+
Xq=function(a,b,c,d){return b.read().then(e=>{var {done:f,value:g}=e;d&&g&&(d(g.byteLength,Fq(a.w)),a.w.a=Eq());if(f)return e=Tq(a),(e=c(!0,e))?e.then(()=>a.j.a.buffer):Promise.resolve(a.j.a.buffer);let h=Promise.resolve();if(null!=g){Uq(a,g);var k=Wq(a);for(e=[];k;)e.push(k),k=Wq(a);if(!a.A)e.forEach(l=>{h=h.then(()=>c(!1,l))});else if(0<e.length){k=e[0];if(1<e.length){k=e[0];const l=e[e.length-1],m=l.end-k.start;k={start:k.start,end:l.end,length:m,data:new DataView(a.j.a.buffer,k.start,m),count:e.length}}(e=
|
|
274
|
+
c(!1,k))&&(h=e)}}return h.then(()=>Xq(a,b,c,d))})};
|
|
275
|
+
Vq=function(a){const b=a.a;if(a.a+4>=a.f)return a.a=a.f,null;var c=$q(a);if(a.a+4>=a.f)return a.a=a.f,null;var d=$q(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.l.getUint32(a.a,!1),e=a.l.getUint32(a.a+4,!1)}catch(g){throw new _.H(_.F,3,3E3);}if(2097151<f)throw new _.H(_.F,3,3E3);a.a+=8;c=f*Math.pow(2,32)+e}}c=b+c;a.o=c;return a.f>=c?(a.a=c,{name:d,start:b,end:c}):null};
|
|
276
|
+
$q=function(a){const b=a.l.getUint32(a.a,!1);a.a+=4;return b};
|
|
277
|
+
cr=function(a){a.g=a.B.then(e=>{a.j=e.request;e.request.uriIndex=e.request.currentAttempt%e.request.uris.length;if(0<e.request.currentAttempt){-1===a.f&&(a.f=ar(e.request.baseDelay,1E3));const f=a.f*(1+(2*Math.random()-1)*ar(e.request.fuzzFactor,.5));a.f*=ar(e.request.backoffFactor,2);if(0<f)return(new Promise((g,h)=>{a.l=h;br(a,()=>{g(e.plugin(e.request))},f)})).catch(g=>{if(!a.a)throw g;})}if(a.a)throw new _.H(1,1,7001,{url:e.request.uris[e.request.uriIndex],request:e.request});return e.plugin(e.request)});
|
|
278
|
+
let b=0,c=0,d=0;return a.g.then(e=>{const f=e.request;f.currentAttempt+=1;b=f.currentAttempt;c=f.maxAttempts;d=f.uris.length;return e.P}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.H){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return cr(a);g&&e.a(_.F);a.w.reject(e)}else a.w.reject(e)})};br=function(a,b,c){a.o=setTimeout(b,c)};ar=function(a,b){return null===a||void 0===a?b:a};
|
|
279
|
+
dr=function(a){var b=a.split("\x3d");const c=b[0];b=b[1];if(!c)throw new sh("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 sh(`Parsing CMSD, not recognized value type of ${a}`);};
|
|
280
|
+
gr=function(a){return b=>{if(a.a){a:{b=b.headers;for(const [d,e]of Object.entries(b))if("cmsd-dynamic"===d.toLowerCase()){b=e;break a}b=null}if(b){try{const d=new Map,e=b.split(";");for(b=0;b<e.length;b++){const {key:f,value:g}=dr(e[b]);Object.values(er).includes(f)&&d.set(f,g)}var c=d}catch(d){fr.error("CmsdManager parseCmsdDynamicHeader_ failed:",d),c=null}a.f=c}}}};
|
|
281
|
+
kr=function(a){var b=new hr;for(const e in a.headers)b.append(e.toLowerCase(),a.headers[e]);const c=new ir,d={Jc:!1,Af:!1};b={P:jr(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.Jc||(d.Jc=!0,c.abort());return Promise.resolve()}};if(a=a.timeout){const e=window.setTimeout(()=>{d.Af=!0;c.abort()},a);b.P=b.P.finally(()=>{window.clearTimeout(e)})}return b};
|
|
282
|
+
jr=function(a,b,c,d){return _.w(function*(){let e,f,g;const h=new Gq,k=Hq(h);try{e=yield lr(a,c);g=Fq(h);const m=e.headers.get(qa);Bi(b,m);const n=m?parseInt(m,10):0;if(b.onFragment&&!b.disableFragmentSupport&&2===b.type){const q=e.body.getReader();f=yield Xq(new mr(n,!b.disableMergedFragments),q,(t,v)=>{if(d.Jc)return null;v&&v.data&&(Ci(b,v.data.byteLength,Fq(h)),h.a=Eq());return b.onFragment&&v?b.rateLimitBps?Di(b.rateLimitBps,Fq(k),b.bytesLoaded).then(()=>b.onFragment(v)):b.onFragment(v):null},
|
|
283
|
+
b.onProgress)}else{const q=e.body.getReader();f=yield Qq(new nr(n),q,b);b.rateLimitBps&&(yield Di(b.rateLimitBps,Fq(k),f.byteLength))}}catch(m){if(d.Jc)throw new _.H(1,1,7001,{url:a,request:b});if(d.Af)throw new _.H(1,1,1003,{url:a,request:b});_.Sg("Error while fetching data:",m);throw new _.H(1,1,1002,{url:a,error:m,request:b,status:-1},m);}const l={};e.headers.forEach((m,n)=>{l[n.trim()]=m});if(d.Jc)throw new _.H(1,1,7001,{url:a,request:b});return _.Ai(l,f,e.status,a,e.url,b,Fq(k),g)})};
|
|
284
|
+
pr=function(a){try{const b=a.uris[a.uriIndex],c=_.or(b);return{P:Promise.resolve({uri:b,data:c.data,request:a,headers:{"content-type":c.contentType}}),request:a,abort:()=>Promise.resolve()}}catch(b){return{P:Promise.reject(b),request:a,abort:()=>Promise.resolve()}}};
|
|
285
|
+
_.or=function(a){var b=a.split(":");if(2>b.length||"data"!==b[0])throw _.Sg("Bad data URI, failed to parse scheme"),new _.H(_.F,1,1004,{uri:a});b=b.slice(1).join(":").split(",");if(2>b.length)throw _.Sg("Bad data URI, failed to extract encoding and MIME type"),new _.H(_.F,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?_.li(a).buffer:_.$h(a).buffer,contentType:c}};
|
|
286
|
+
_.rr=function(a,b){a=_.uj(a.split(";")[0],vj(a));_.qr[a]=b};_.sr=function(a){a=_.uj(a.split(";")[0],vj(a));return _.qr[a]||null};_.tr=function(a){a=_.uj(a.split(";")[0],vj(a));delete _.qr[a]};_.yr=function(a){if(!a.w)return null;const b=a.H;switch(a.w){case ur:return`-2px -2px 0 ${b}, -1px -1px 0 ${b}`;case vr:return`2px 2px 0 ${b}, 1px 1px 0 ${b}`;case wr:return`-1px 0 ${b}, 0 1px ${b}, 1px 0 ${b}, `+`0 -1px ${b}`;case xr:return`2px 2px 3px ${b}, 2px 2px 4px ${b}, `+`2px 2px 5px ${b}`;default:return _.xe}};
|
|
287
|
+
rg="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;sg=typeof Object.defineProperties==_.Td?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
|
|
288
|
+
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.g(function(){h.l()})}this.a.push(g)};var e=rg.setTimeout;c.prototype.g=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=
|
|
289
|
+
g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.a=null};c.prototype.j=function(g){this.g(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.g)}};b.prototype.C=function(g){if(g===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.F(g);else{a:switch(typeof g){case _.ye:var h=null!=g;break a;case _.Td:h=!0;break a;default:h=!1}h?this.B(g):this.o(g)}};
|
|
290
|
+
b.prototype.B=function(g){var h=void 0;try{h=g.then}catch(k){this.g(k);return}typeof h==_.Td?this.G(h,g):this.o(g)};b.prototype.g=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();
|
|
291
|
+
g.fd(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(q,t){return typeof q==_.Td?function(v){try{l(q(v))}catch(y){m(y)}}:t}var l,m,n=new b(function(q,t){l=q;m=t});this.fd(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.fd=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: "+
|
|
292
|
+
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).fd(h,k)})};b.all=function(g){var h=qg(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){q[v]=y;t--;0==t&&l(q)}}var q=[],t=0;do q.push(void 0),t++,d(k.value).fd(n(q.length-1),m),k=h.next();while(!k.done)})};return b});var vg=this||self;
|
|
293
|
+
vg.a=!0;_.x("clpp.utils.obj.cloneItem",_.yg);_.x("clpp.utils.obj.merge",_.xg);var Ng={DEFAULT:-1,NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};_.x("clpp.log.Level",Ng);var Lg=3,Kg={},zr=[];_.x("clpp.log.getLoggers",function(){return _.yg(Kg)});_.x("clpp.log.addInterceptor",function(a){a&&zr.push(a)});_.x("clpp.log.removeInterceptor",function(a){a&&(a=zr.indexOf(a),0<=a&&zr.splice(a,1))});_.x("clpp.log.getTagLevel",Mg);_.x("clpp.log.hasTagLevel",function(a){return void 0===a?!1:0<=Kg[a]});_.x("clpp.log.setTagLevel",function(a,b){a&&(_.Eg(b)&&(b=Og(b)),Kg[a]=b)});
|
|
294
|
+
_.x("clpp.log.setLogLevel",function(a){-1===a&&(a=3);_.Eg(a)&&(a=Og(a));Lg=a});_.x("clpp.log.getLogLevel",function(){return Lg});
|
|
295
|
+
_.R=class{constructor(a){(this.tag=a)&&void 0===Kg[a]&&(Kg[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=Mg(this.tag);if(0<=d){if(d<c)return}else if(Lg<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,
|
|
296
|
+
arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of zr)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)}Yf(a){return a?
|
|
297
|
+
this.tag?new _.R(this.tag+"."+a):new _.R(a):this}};_.x("clpp.log.Logger",_.R);_.R.prototype.createChild=_.R.prototype.Yf;_.R.prototype.error=_.R.prototype.error;_.R.prototype.warn=_.R.prototype.warn;_.R.prototype.debug=_.R.prototype.debug;_.R.prototype.info=_.R.prototype.info;_.R.prototype.log=_.R.prototype.log;var Pg=new _.R("clpp");_.x("clpp.log.info",_.Qg);_.x("clpp.log.debug",_.Rg);_.x("clpp.log.warn",_.B);_.x("clpp.log.error",_.Sg);(function(){const a=console.assert;a?a.bind||(console.assert=function(){a.apply(console,arguments)}):console.assert=function(){}})();var Po;Po=class{constructor(a,b){this.Hb=a;this.sourceIndex=b}};_.Ug=new _.R("clpp.players");_.Tg={};_.Ar=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 Br,Cr;Br=class{constructor(a,b,c,d){this.f=a;this.nc=b;this.a=c;this.Ng=!!d}Rb(a){try{this.nc.handleEvent?this.nc.handleEvent(a):this.nc.call(this.a,a)}catch(b){_.Sg("clpp","Uncaught exception in event handler for event '"+this.f+"'",b,b?b.message:null,b?b.stack:null)}}};
|
|
298
|
+
_.C=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.f=this.a=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}stopImmediatePropagation(){this.f=!0}stopPropagation(){}};
|
|
299
|
+
Cr=class{constructor(a){this.a=new _.Ar;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].Rb(a),b[c].Ng&&this.a.remove(a.type,b[c]),!a||!a.f);c++);}on(a,b,c){this.a.push(a,new Br(a,b,c||this.f));return b}one(a,b,c){this.a.push(a,new Br(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].nc===b&&(d=this.a.remove(a,c[e])||d);return d}clear(){this.a.clear()}};var Dr;_.Er=class{constructor(){this.a=new _.Ar}release(){_.Xg(this)}on(a,b,c,d=!1){a=new Dr(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||(Wg(f),this.a.remove(b,f))}}};Dr=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 Fr=class{constructor(a){this.m=a;this.o=a.getConfiguration().streaming.addMissingTimelineCues||!1;this.j=null;this.f=new _.Er;this.a=this.l=null;this.g=[];this.h=new _.R("clpp.native.Metadata")}release(){this.f.release();this.g=[];this.a=null}destroy(){const a=this;return _.w(function*(){a.release();a.l=null;a.j=null})}getTimelineCues(){return this.g}};_.Mr=class{constructor(a,b,c,d){d=void 0===d?_.Gr:d;this.startTime=a;this.endTime=b;this.payload=c;this.payloadType=d;this.positionAlign=this.position=null;this.size=100;this.textAlign=_.Hr;this.writingMode=_.Ir;this.lineInterpretation=_.Jr;this.line=null;this.lineAlign=_.Kr;this.direction=Lr;this.region=null;this.cssClassList=[];this.id=this.backgroundImage="";this.containerRows=null}md(a){return this.payload===a.payload&&this.startTime===a.startTime&&this.endTime===a.endTime&&this.payloadType===
|
|
300
|
+
a.payloadType}};_.x("clpp.text.Cue",_.Mr);_.Mr.positionAlign={LEFT:_.he,RIGHT:_.ie,CENTER:_.Vc,AUTO:"auto"};_.Gr="text";_.Mr.payloadType={TEXT:_.Gr,VTT_XML:_.cg,TTML_XML:_.Hf};_.Hr=_.Vc;_.Nr={LEFT:_.ee,RIGHT:_.mf,CENTER:_.Hr,START:_.ee,END:_.mf};_.Mr.textAlign=_.Nr;var Lr="ltr";_.Mr.direction={HORIZONTAL_LEFT_TO_RIGHT:Lr,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};_.Ir="horizontal-tb";_.Mr.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.Ir,VERTICAL_LEFT_TO_RIGHT:_.Vf,VERTICAL_RIGHT_TO_LEFT:_.Wf};_.Jr=0;
|
|
301
|
+
_.Mr.lineInterpretation={LINE_NUMBER:_.Jr,PERCENTAGE:1};_.Kr=_.uf;_.Or={CENTER:_.Vc,START:_.Kr,END:_.Od};_.Mr.lineAlign=_.Or;_.Rr=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=_.Pr;this.scroll=Qr;this.cssClassList=[];this.writingMode=this.displayAlign=null}};_.x("clpp.text.CueRegion",_.Rr);_.Pr=1;_.Rr.units={PX:0,PERCENTAGE:_.Pr,LINES:2};var Qr="";
|
|
302
|
+
_.Rr.scrollMode={NONE:Qr,UP:"up"};_.Rr.displayAlign={BEFORE:"flex-end",CENTER:_.Vc,AFTER:"flex-start"};_.Rr.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.nd,VERTICAL_LEFT_TO_RIGHT:"row-reverse",VERTICAL_RIGHT_TO_LEFT:"row"};var Sr=class{constructor(a){this.m=a;this.l=a.getTextDisplayer();this.f=this.g=null;this.a=new _.Er;this.j=!1;this.h=new _.R("clpp.native.CueHandler")}destroy(){this.a.release();this.j=!1;this.l=this.a=this.g=this.f=null;return Promise.resolve()}start(a){this.j?this.h.warn("Already started. Ignoring request..."):(this.j=!0,this.g=a,this.f=this.g.textTracks,this.a.on(this.f,_.nc,b=>oh(this,b)),this.a.on(this.f,Xc,()=>{{const b=this.f;for(let c=0;c<b.length;c++){const d=b[c];d.mode===_.pf&&(d.mode=
|
|
303
|
+
_.Vd)}}}))}o(a){const b=new _.Mr(a.startTime,a.endTime,a.text,_.cg);if(_.Eg(a.vertical))switch(a.vertical){case "lr":b.writingMode=_.Vf;break;case "rl":b.writingMode=_.Wf}_.Fg(a.size)&&(b.size=a.size);if(_.Eg(a.align))switch(a.align){case _.ee:case _.uf:b.textAlign=_.ee;break;case _.Vc:b.textAlign=_.Hr;break;case _.mf:case _.Od:b.textAlign=_.mf}_.Fg(a.position)&&(b.position=a.position);if(_.Eg(a.positionAlign))switch(a.positionAlign){case _.he:b.positionAlign=_.he;break;case _.Vc:b.positionAlign=
|
|
304
|
+
_.Vc;break;case _.ie:b.positionAlign=_.ie}_.Fg(a.line)&&(b.line=a.line);if(_.Eg(a.lineAlign))switch(a.lineAlign){case _.uf:b.lineAlign=_.Kr;break;case _.Vc:b.lineAlign=_.Vc;break;case _.Od:b.lineAlign=_.Od}typeof a.snapToLines===_.Mc&&(b.lineInterpretation=a.snapToLines?_.Jr:1);return b}};_.H=class extends Error{constructor(a,b,c,d,e){super(ph(a,b,c,d));this.severity=a;this.category=b;this.code=c;this.data=!d||_.Eg(d)?{}:d;this.cause=void 0===e?null:e;this.f=!1;Error.captureStackTrace&&Error.captureStackTrace(this,_.H)}a(a){this.severity!==a&&(this.severity=a,this.message=ph(this.severity,this.category,this.code,this.data))}toString(){let a=this.message;this.cause&&(a+=`\n Caused by ${this.cause}`);return a}};_.x("clpp.Error",_.H);_.F=2;_.H.Severity={RECOVERABLE:1,FATAL:_.F};
|
|
298
305
|
_.H.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,PLUGIN:9,ADS:10};
|
|
299
306
|
_.H.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_MODIFIER_ERROR:1006,RESPONSE_MODIFIER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,FETCH_OR_APPEND_ERROR:2010,INVALID_MP4:2011,
|
|
300
307
|
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,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,
|
|
@@ -304,62 +311,63 @@ DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_
|
|
|
304
311
|
HLS_DISCONTINUITY_NOT_SUPPORTED:4045,HLS_UNSUPPORTED_FEATURE:4046,HLS_INCOMPATIBLE_PLAYLIST_UPDATE:4047,INVALID_STREAMS_CHOSEN:5005,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,
|
|
305
312
|
EXPIRED:6014,REQUESTED_DRM_ENVIRONMENT_UNAVAILABLE:6015,INIT_DATA_TRANSFORM_ERROR:6016,CERTIFICATE_REQUEST_FAILED:6100,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,NO_VIDEO_ELEMENT:7002,CANNOT_LOAD_SOURCE:7003,MEDIA_ELEMENT_NOT_FOUND:7004,INVALID_MEDIA_ELEMENT:7005,INVALID_CONTAINER_ELEMENT:7006,INVALID_CONFIGURATION:7100,
|
|
306
313
|
INVALID_LICENSE:7101,NO_ELEMENT:7102,USER_ID_NOT_PROVIDED:7103,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,
|
|
307
|
-
VIMOND_SESSION_ERROR:9201,MUXDATA_INVALID_CONFIGURATION:9300,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};var
|
|
308
|
-
|
|
309
|
-
".."==h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.ya=d:c=""!==a.a.toString();c?_.
|
|
310
|
-
_.
|
|
311
|
-
_.
|
|
312
|
-
_
|
|
313
|
-
"cs"],["dan","da"],["deu","de"],[_.
|
|
314
|
+
VIMOND_SESSION_ERROR:9201,MUXDATA_INVALID_CONFIGURATION:9300,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};var sh=class extends Error{constructor(a,b){super(a);this.code=b}};var Ah=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;og=_.vh.prototype;og.Ya="";og.kc="";og.Ja="";og.Ec=null;og.ya="";og.Zb="";og.toString=function(){var a=[],b=this.Ya;b&&a.push(Dh(b,Tr,!0),":");if(b=this.Ja){a.push("//");var c=this.kc;c&&a.push(Dh(c,Tr,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Ec;null!=b&&a.push(":",String(b))}if(b=this.ya)this.Ja&&"/"!=b.charAt(0)&&a.push("/"),a.push(Dh(b,"/"==b.charAt(0)?Ur:Vr,!0));(b=this.a.toString())&&a.push("?",b);(b=this.Zb)&&a.push("#",Dh(b,Wr));return a.join("")};
|
|
315
|
+
og.resolve=function(a){var b=new _.vh(this);"data"===b.Ya&&(b=new _.vh);var c=!!a.Ya;c?wh(b,a.Ya):c=!!a.kc;c?b.kc=a.kc:c=!!a.Ja;c?b.Ja=a.Ja:c=null!=a.Ec;var d=a.ya;if(c)xh(b,a.Ec);else if(c=!!a.ya){if("/"!=d.charAt(0))if(this.Ja&&!this.ya)d="/"+d;else{var e=b.ya.lastIndexOf("/");-1!=e&&(d=b.ya.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];"."==h?e&&g==d.length&&f.push(""):
|
|
316
|
+
".."==h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.ya=d:c=""!==a.a.toString();c?_.yh(b,zh(a.a)):c=!!a.Zb;c&&(b.Zb=a.Zb);return b};var Tr=/[#\/\?@]/g,Vr=/[#\?:]/g,Ur=/[#\?]/g,Eh=/[#\?@]/g,Wr=/#/g;_.Ch.prototype.a=null;_.Ch.prototype.g=null;
|
|
317
|
+
_.Ch.prototype.add=function(a,b){if(!this.a&&(this.a={},this.g=0,this.f))for(var c=this.f.split("\x26"),d=0;d<c.length;d++){var e=c[d].indexOf("\x3d"),f=null;if(0<=e){var g=c[d].substring(0,e);f=c[d].substring(e+1)}else g=c[d];g=decodeURIComponent(g.replace(/\+/g," "));f=f||"";this.add(g,decodeURIComponent(f.replace(/\+/g," ")))}this.f=null;(c=this.a.hasOwnProperty(a)&&this.a[a])||(this.a[a]=c=[]);c.push(b);null!==this.g&&this.g++;return this};
|
|
318
|
+
_.Ch.prototype.toString=function(){if(this.f)return this.f;if(!this.a)return"";var a=[],b;for(b in this.a)for(var c=encodeURIComponent(b),d=this.a[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="\x3d"+encodeURIComponent(d[e]));a.push(f)}return this.f=a.join("\x26")};var Gh;_.G="text";_.Xr=1/15;Gh={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/]};Gh[_.G]=[/^vtt$/,/^wvtt/,/^stpp/];var Yr;Yr={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]};_.gj=(a,b)=>{const c=Yr[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===_.G?"":null};_.Zr={text:{mp4:uc,m4s:uc,m4i:uc,cmft:uc,vtt:_.Df,ttml:_.yc},video:{mp4:_.Yf,m4s:_.Yf,m4i:_.Yf,m4v:_.Yf,cmfv:_.Yf,ts:_.Xf},audio:{mp4:_.Hc,m4s:_.Hc,m4i:_.Hc,m4a:_.Hc,cmfa:_.Hc,ts:_.Xf,aac:_.Ec,ec3:_.Gc,ac3:_.Fc},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}};_.jj=(a,b,c)=>a.map(d=>{d=_.$r(d)||"";return d=(d=_.Zr[b][d])?d:b===_.G?c&&"vtt"!==c?uc:_.Df:null}).filter(Boolean)[0]||null;
|
|
319
|
+
_.$r=a=>{a=(new _.vh(a)).ya.split(".");return 1>=a.length?null:a.pop()};_.ti=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}};_.si=class{constructor(a,b){this.name=a;this.value=b}};var Ih=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",
|
|
320
|
+
"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",
|
|
314
321
|
"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",
|
|
315
322
|
"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",
|
|
316
323
|
"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",
|
|
317
|
-
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var
|
|
318
|
-
_.
|
|
319
|
-
_.
|
|
320
|
-
b!==a)}
|
|
321
|
-
{if(e.a)throw new _.H(_.
|
|
322
|
-
g?{url:g.request.uris[g.request.uriIndex],request:g.request}:null);};h();const k=f(g)||g;h();return k}).catch(g=>{if(g instanceof _.H&&g.data&&g.data.response){const h=f(g.data.response);if(h&&h.then)return h.then(()=>Promise.reject(g))}return Promise.reject(g)}).catch(g=>{if(g instanceof _.H)throw g;throw new _.H(_.
|
|
323
|
-
_.
|
|
324
|
-
_.
|
|
325
|
-
|
|
326
|
-
_.
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
_.S.prototype.
|
|
330
|
-
_.S.prototype.
|
|
331
|
-
var
|
|
324
|
+
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var as=class{};_.x("clpp.utils.BufferUtils",as);as.toArrayBuffer=Uh;as.toDataView=_.Th;as.toInt32Array=_.Sh;as.toUint32Array=Rh;as.toUint16Array=Qh;as.toUint8Array=_.J;as.equal=Oh;var Xh=new _.R("clpp.utils.strings");_.x("clpp.utils.strings.fromUtf8",_.Wh);_.x("clpp.utils.strings.fromBytesAutoDetect",_.Zh);_.x("clpp.utils.strings.toUtf8",_.$h);_.x("clpp.utils.strings.toUtf16",_.ai);_.x("clpp.utils.strings.toByteArray",_.bi);_.x("clpp.utils.strings.startsWith",_.ci);_.x("clpp.utils.strings.endsWith",_.di);_.x("clpp.utils.strings.bitrateToString",_.gi);
|
|
325
|
+
_.x("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)))});
|
|
326
|
+
_.x("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 hi=document.createElement("span");var bs=class{};_.x("clpp.utils.Uint8ArrayUtils",bs);bs.toStandardBase64=_.ji;bs.concat=_.pi;bs.equal=_.oi;bs.toHex=_.ni;bs.fromHex=_.mi;bs.fromBase64=_.li;bs.toBase64Url=_.ki;_.cs=new _.R("clpp.hls.Utils");_.ri=class{constructor(a){this.f=a;this.a=0}};_.ds=new Set([_.Ba,_.Ca,"EXT-X-I-FRAMES-ONLY",_.Fa,_.Ga,_.Ha,_.La,_.Na]);_.es=new Set(["EXTINF",_.ya,_.Aa,_.Da,_.Ea,_.Ka]);_.fs=new Set(["EXT-X-PART",_.Ja]);_.gs=new Set([_.za]);var vi=[403,401];_.x("clpp.net.DEFAULT_FATAL_STATUS_CODES",vi);_.x("clpp.net.makeRequest",_.zi);_.yi=6;_.x("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.yi});_.Km=class{constructor(){let a,b;const c=new Promise((d,e)=>{a=d;b=e});c.resolve=a;c.reject=b;return c}resolve(){}reject(){}};_.Rn=class{constructor(a,b){this.P=a;this.A=b;this.a=!1}abort(){this.a=!0;return this.A()}hd(a,b){const c=new _.Km;let d=()=>{c.reject(new _.H(_.F,7,7001));return this.abort()};this.P.then(e=>{this.a?c.reject(new _.H(_.F,7,7001)):a?d=Ei(a,e,c):c.resolve(e)},e=>{b?d=Ei(b,e,c):c.reject(e)});return new _.Rn(c,()=>d())}};_.Rn.aborted=function(){const a=Promise.reject(new _.H(_.F,7,7001));a.catch(()=>{});return new _.Rn(a,()=>Promise.resolve())};_.Rn.prototype.chain=_.Rn.prototype.hd;_.hs=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.P.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.Eo=class{constructor(){this.f=[];this.g=[];this.o=!1;this.l=new _.hs;this.a={};this.j=0;this.a.data=pr;!window.fetch||!window.AbortController||_.Dj(6)||_.Gj()&&68<_.bk().browserVersion.major?(this.a.http=Sq,this.a.https=Sq):(this.a.http=kr,this.a.https=kr)}Vg(a){0<a?_.B("Rate limit set to "+a+"bps"):_.B("Rate limit disabled");this.j=a}release(){return this.l.destroy()}destroy(){this.o=!0;this.f=[];this.g=[];return this.l.destroy()}Be(a){this.f.push(a)}Hc(a){this.g.push(a)}tf(a){this.f=this.f.filter(b=>
|
|
327
|
+
b!==a)}yd(a){this.g=this.g.filter(b=>b!==a)}fetch(a){if(this.o)return new is(Promise.reject(new _.H(1,1,7001,{url:a.uris[a.uriIndex],request:a})));this.j&&0<this.j&&(a.rateLimitBps=this.j);var b=[];for(const f of this.f)b.push(f);if(a.requestModifiers)for(const f of a.requestModifiers)b.push(f);a.requestModifiers=b;b=[];for(var c of this.g)b.push(c);if(a.responseModifiers)for(var d of a.responseModifiers)b.push(d);a.responseModifiers=b;let e;d=c=new _.Km;try{for(const f of a.requestModifiers)d=d.then(g=>
|
|
328
|
+
{if(e.a)throw new _.H(_.F,1,7001,g?{url:g.uris[g.uriIndex],request:g}:null);return f(g)||g}).catch(g=>{if(g instanceof _.H)throw g;throw new _.H(_.F,1,1006,null,g);});d=d.then(f=>{var g=new _.vh(f.uris[f.uriIndex]);var h=g.Ya;h||(h=location.protocol,h=h.slice(0,-1),wh(g,h),f.uris[f.uriIndex]=g.toString());h=this.a[h];if(!h)throw new _.H(_.F,1,1E3,{url:g.toString()});g=h;return{request:f,plugin:g}});e=new is(d);for(const f of a.responseModifiers)e.then(g=>{const h=()=>{if(e.a)throw new _.H(_.F,1,7001,
|
|
329
|
+
g?{url:g.request.uris[g.request.uriIndex],request:g.request}:null);};h();const k=f(g)||g;h();return k}).catch(g=>{if(g instanceof _.H&&g.data&&g.data.response){const h=f(g.data.response);if(h&&h.then)return h.then(()=>Promise.reject(g))}return Promise.reject(g)}).catch(g=>{if(g instanceof _.H)throw g;throw new _.H(_.F,1,1007,null,g);});_.Gi(this.l,e);c.resolve(a);return e}catch(f){return new is(Promise.reject(f))}}};_.x("clpp.net.NetworkEngine",_.Eo);_.Eo.prototype.fetch=_.Eo.prototype.fetch;
|
|
330
|
+
_.Eo.prototype.removeResponseModifier=_.Eo.prototype.yd;_.Eo.prototype.removeRequestModifier=_.Eo.prototype.tf;_.Eo.prototype.addResponseModifier=_.Eo.prototype.Hc;_.Eo.prototype.addRequestModifier=_.Eo.prototype.Be;_.Eo.prototype.setRateLimit=_.Eo.prototype.Vg;var Mi;
|
|
331
|
+
_.Pi=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=[]}md(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&&kh(this.roles,
|
|
332
|
+
a.roles)&&kh(this.accessibility,a.accessibility,Ki)}toString(){return`Track type: ${this.type} id: ${this.id}
|
|
333
|
+
renditions size: ${this.renditions.length}`}};_.x("clpp.Track",_.Pi);_.Pi.prototype.toString=_.Pi.prototype.toString;_.Zi=class{constructor(a,b){this.track=b;this.id=a;this.originalId=this.drm=this.drmInfo=this.codec=this.Ic=this.bandwidth=this.height=this.width=null}};_.x("clpp.Rendition",_.Zi);_.Oi=1;_.M=_.u;_.L=_.p;_.K="text";Mi=_.re;_.js={VIDEO:_.M,AUDIO:_.L,TEXT:_.K,METADATA:Mi};_.Pi.Type=_.js;_.ql=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;
|
|
334
|
+
_.ci(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.g=b.hash}};_.x("clpp.utils.url.queryString",_.Si);var ks=class{constructor(a){this.f=a;this.h=new _.R("clpp.native.hls.HlsMetadataParser");this.a=qh(this.g.bind(this),(b,c)=>b[0]===c[0]&&b[1].enableHlsVideoTrackInfo===c[1].enableHlsVideoTrackInfo&&b[1].enableMetadata===c[1].enableMetadata)}g(a,b){const c=this;return _.w(function*(){let d=null;try{d=yield Xi(c,a)}catch(f){return c.h.warn("Failed to fetch playlist in order metadata from HLS playlist.",f.message),Promise.resolve({})}const e={};try{if(b.enableHlsVideoTrackInfo){const f=yield aj(c,d,
|
|
335
|
+
a);e.renditions=f.renditions;e.mimeType=f.mimeType}}catch(f){c.h.warn("Failed to parse video metadata from HLS playlist.",f.message)}try{const f=yield cj(d);e.Bc=f}catch(f){c.h.warn("Failed to parse metadata from HLS playlist.",f.message)}return e})}};_.kj=[];_.S=class{Hd(){return!0}gg(a){return this.getVideoTracks().find(b=>_.Gg(b,a,a&&Object.keys(a)))}cg(a){return this.getAudioTracks().find(b=>_.Gg(b,a,a&&Object.keys(a)))}eg(a){return this.ga().find(b=>_.Gg(b,a,a&&Object.keys(a)))}fg(a){return this.getVideoTracks().flatMap(b=>b.renditions).find(b=>_.Gg(b,a,a&&Object.keys(a)))}bg(a){return this.getAudioTracks().flatMap(b=>b.renditions).find(b=>_.Gg(b,a,a&&Object.keys(a)))}dg(a){return this.ga().flatMap(b=>b.renditions).find(b=>_.Gg(b,a,a&&Object.keys(a)))}};
|
|
336
|
+
_.x("clpp.TrackManager",_.S);_.S.prototype.isAbrEnabled=_.S.prototype.ma;_.S.prototype.addTextTrack=_.S.prototype.addTextTrack;_.S.prototype.findTextRendition=_.S.prototype.dg;_.S.prototype.findAudioRendition=_.S.prototype.bg;_.S.prototype.findVideoRendition=_.S.prototype.fg;_.S.prototype.findTextTrack=_.S.prototype.eg;_.S.prototype.findAudioTrack=_.S.prototype.cg;_.S.prototype.findVideoTrack=_.S.prototype.gg;_.S.prototype.setTextRendition=_.S.prototype.$a;_.S.prototype.setAudioRendition=_.S.prototype.Za;
|
|
337
|
+
_.S.prototype.setVideoRendition=_.S.prototype.Ra;_.S.prototype.setTextTrack=_.S.prototype.Ha;_.S.prototype.setAudioTrack=_.S.prototype.ta;_.S.prototype.setVideoTrack=_.S.prototype.ab;_.S.prototype.getTextTrack=_.S.prototype.qa;_.S.prototype.getAudioTrack=_.S.prototype.ja;_.S.prototype.getVideoTrack=_.S.prototype.Ea;_.S.prototype.getLoadingTextRendition=_.S.prototype.ib;_.S.prototype.getLoadingAudioRendition=_.S.prototype.hb;_.S.prototype.getLoadingVideoRendition=_.S.prototype.Va;
|
|
338
|
+
_.S.prototype.getTextRendition=_.S.prototype.Da;_.S.prototype.getAudioRendition=_.S.prototype.Ka;_.S.prototype.getVideoRendition=_.S.prototype.ka;_.S.prototype.getTextTracks=_.S.prototype.ga;_.S.prototype.getAudioTracks=_.S.prototype.getAudioTracks;_.S.prototype.getVideoTracks=_.S.prototype.getVideoTracks;_.S.prototype.canSelectVideoTracks=_.S.prototype.Hd;var oj=new Map,nj=1,sj=2,rj=3,qj=4;_.ls=(new Map).set(_.md,_.md).set("frameRate","framerate").set("bandwidth","bitrate").set(_.kg,_.kg).set(_.Ud,_.Ud).set("channelsCount","channels");_.ms=class{constructor(a){this.f=a;this.a=null}ca(a){return wj(this,a,!1)}bb(a){return wj(this,a,!0)}stop(){this.a&&(this.a(),this.a=null)}};_.zj=class{constructor(a){this.f=a;this.a=null}ve(){this.stop();this.f();return this}ca(a){this.stop();this.a=(new _.ms(()=>{this.f()})).ca(a);return this}bb(a){this.stop();this.a=(new _.ms(()=>{this.f()})).bb(a);return this}stop(){this.a&&(this.a.stop(),this.a=null)}};_.x("clpp.utils.Timer",_.zj);_.zj.prototype.stop=_.zj.prototype.stop;_.zj.prototype.tickEvery=_.zj.prototype.bb;_.zj.prototype.tickAfter=_.zj.prototype.ca;_.zj.prototype.tickNow=_.zj.prototype.ve;var ns=class{};_.x(ld,ns);ns.getInfo=_.bk;
|
|
339
|
+
var yj=null,xj=null,Qj=new _.R(ld),Uj="android",Tj="ios",Zj="linux",Vj="osx",Wj="windows",Xj="tizen",Yj="webos",Sj=Jf,ak=Jf,Lj={windows:{os_version:/windows\s+?nt\s([\d.]+)/i,ie:/windows\s+?nt.+?trident\/[\d.]+.*rv:([\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,
|
|
332
340
|
chrome:/macintosh.+?chrome\/([\d._]+)/i,firefox:/macintosh.+?firefox\/([\d._]+)/i,opera:/macintosh.+?opr\/([\d._]+)/i},unknown:{ie:/.+?trident\/([\d.]+)/i,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,
|
|
333
341
|
chrome:/.+?CriOS\/([\d._]+)/i,firefox:/.+?FxiOS\/([\d._]+)/i,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},
|
|
334
|
-
webos:{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}};var T=class extends _.S{constructor(){super();this.h=new _.R("clpp.native.TrackManager");this.m=null;this.f=new _.
|
|
335
|
-
b){const c=this;return _.
|
|
336
|
-
c.a.set(a,k));c.h.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.
|
|
337
|
-
g&&(e?f():t&&1!==v||f())}catch(n){c.h.error("Error while converting track data",n)}}}else c.h.warn(
|
|
338
|
-
this.g.find(e=>
|
|
339
|
-
_.
|
|
340
|
-
null}
|
|
341
|
-
b.o[c]=a;
|
|
342
|
-
T.prototype.setAudioRendition=T.prototype.
|
|
343
|
-
T.prototype.getTextRendition=T.prototype.
|
|
344
|
-
1)}
|
|
345
|
-
"";for(let b=0;b<this.length;b++)0<b&&(a+=" "),a+=`${this.start(b).toFixed(3)}-${this.end(b).toFixed(3)}`;return a}};_.
|
|
346
|
-
_.
|
|
347
|
-
_.
|
|
348
|
-
_.
|
|
349
|
-
_.
|
|
350
|
-
_.
|
|
351
|
-
_.
|
|
352
|
-
this.
|
|
353
|
-
{name:b.name||"",message:b.message||"",stack:b.stack||""};
|
|
354
|
-
a}setCdnErrorCallback(a){this.
|
|
355
|
-
Promise.reject();const d=a-b;return.1>=Math.abs(d)?(this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=()=>{this.trigger(new _.
|
|
356
|
-
D=y&&t;q=v||n&&D||A&&q;this.log.debug("Checking seeking state after "+l.type+" event. Seek completed:",q,"Current Time:",m,"Target Time:",a,"Native Event:",v,"Time reached",n,"Timeupdate:",A,"Progress:",y,"ReadyState:",t,"Progress Ready:",D);q?(this.
|
|
357
|
-
else this.
|
|
358
|
-
b?_.
|
|
359
|
-
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.
|
|
360
|
-
void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.uc=a}getSourceIndex(){return this.uc}getLoadedSource(){return this.
|
|
361
|
-
else{let e="";switch(a.type){case _.
|
|
362
|
-
e);this.
|
|
342
|
+
webos:{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}};var T=class extends _.S{constructor(){super();this.h=new _.R("clpp.native.TrackManager");this.m=null;this.f=new _.Er;this.g=[];this.G=0;this.o={};this.I=[];this.a=new Map;this.w=null;this.l=new Map;this.A=!0;this.O=this.B.bind(this,_.K);this.U=this.F.bind(this,_.K);this.R=this.C.bind(this,_.K);this.V=this.B.bind(this,_.M);this.Z=this.F.bind(this,_.M);this.W=this.C.bind(this,_.M);this.J=this.B.bind(this,_.L);this.M=this.F.bind(this,_.L);this.K=this.C.bind(this,_.L);this.j=null}Hd(){return!_.Nj()}B(a,
|
|
343
|
+
b){const c=this;return _.w(function*(){if(b){var d=b.track;if(d){var e=a===_.M,f=a===_.K,g=a===_.L||e,h=b.target,k=c.g.find(n=>ck(n,d,a));if(k)c.h.warn("Track from event already exists",d,k);else{var l=Qi(a,d),m=dk(d);if(f){if(d.kind===_.re)return;let n;void 0!==d.id?n=c.o[d.id]:n=Object.values(c.o).find(q=>ck(l,q,a));l.kind&&"captions"===l.kind&&(l.mimeType=_.sc);n&&(l.src=n.url,l.mimeType=n.mimeType)}else if(k=c.g.find(n=>n.type===a&&_.Gg(n,l,["kind","label","language"]))){k.id=d.id;m&&(c.h.debug(`Setting native ${a} track active`),
|
|
344
|
+
c.a.set(a,k));c.h.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.Zi(l.id,l));c.g.push(l);const n=c.m.getConfiguration().safari;fk(c,a,n)?yield gk(c,l,n):hk(c,a,n)&&(yield ik(c,l,n));c.h.debug(a+" Track added",l);c.m.trigger(new _.C(_.os));const q=jk(c,a).length,t=!(!h||!h.length),v=h&&h.length||0;f=()=>{c.h.debug(`Setting native ${a} track active. `+`Native track active: ${m}. `+`Number of tracks: ${q}`,d);c.a.set(a,l)};m?f():1===q&&
|
|
345
|
+
g&&(e?f():t&&1!==v||f())}catch(n){c.h.error("Error while converting track data",n)}}}else c.h.warn(lb)}else c.h.warn(ib)})}F(a,b){if(b){var c=b.track;c?a===_.K&&c.kind!==_.re&&(b=this.g.find(d=>ck(d,c,a)))&&(this.g.splice(this.g.indexOf(b),1),(this.a.get(a)||null)===b&&(this.a.set(a,null),kk(this)),this.h.debug(a+" Track removed, id: ",b.id)):this.h.warn(lb)}else this.h.warn(ib)}C(a,b){this.h.debug(a+" Track changed",b);a===_.K&&kk(this);const c=mk(this,a);if(c)for(let d=0;d<c.length;++d)if(dk(c[d])){if(b=
|
|
346
|
+
this.g.find(e=>ck(e,c[d],a)))this.a.set(a,b),this.h.debug("Track change detected, id:",b.id),b===this.l.get(a)&&this.l.set(a,null),a===_.L?this.m.trigger(new _.C(_.pk)):a===_.K&&this.m.trigger(new _.C(_.qk));break}}initialize(a){this.m=a;this.j=new ks(a.getNetworkEngine())}load(){this.A=!1;var a=lk(this,_.K);a&&(this.f.on(a,_.nc,this.O),this.f.on(a,jf,this.U),this.f.on(a,Xc,this.R));if(a=lk(this,_.L))this.f.on(a,_.nc,this.J),this.f.on(a,jf,this.M),this.f.on(a,Xc,this.K);if(a=lk(this,_.M))this.f.on(a,
|
|
347
|
+
_.nc,this.V),this.f.on(a,jf,this.Z),this.f.on(a,Xc,this.W);this.f.one(this.m,Qc,this.H.bind(this))}release(){this.A=!0;this.g=[];this.o={};this.a.clear();this.l.clear();this.f.release()}destroy(){this.release();this.m=null}getVideoTracks(){return jk(this,_.M)}getAudioTracks(){return jk(this,_.L)}ga(){return jk(this,_.K)}ka(){const a=this.a.get(_.M)||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]||
|
|
348
|
+
null}Ka(){return nk(this,_.L)}Da(){return nk(this,_.K)}Va(){return ok(this,_.M)}hb(){return ok(this,_.L)}ib(){return ok(this,_.K)}Ea(){return this.a.get(_.M)||null}ja(){return this.a.get(_.L)||null}qa(){return this.a.get(_.K)||null}ab(a){rk(this,_.M,a)}ta(a){rk(this,_.L,a)}Ha(a){rk(this,_.K,a)}Ra(a){rk(this,_.M,a&&a.track)}Za(a){rk(this,_.L,a&&a.track)}$a(a){rk(this,_.K,a&&a.track)}addTextTrack(a){const b=this;return _.w(function*(){if(a.mimeType.match(/text\/vtt/)){const c="External_"+`${b.G++}`;
|
|
349
|
+
b.o[c]=a;sk(b,a,c)}else yield tk(b,a)})}ma(){return 1>=this.getVideoTracks().flatMap(a=>a.renditions).length}H(){const a=this;return _.w(function*(){const b=a.m.getConfiguration();vk(a,_.L,b.preferredAudioLanguage);if(!mk(a,_.K).some(c=>dk(c))){const c=lk(a,_.K);yield new Promise(d=>{a.f.one(c,Xc,d);(new _.zj(d)).ca(1)})}a.A||vk(a,_.K,b.preferredTextLanguage)})}};T.prototype.isAbrEnabled=T.prototype.ma;T.prototype.addTextTrack=T.prototype.addTextTrack;T.prototype.setTextRendition=T.prototype.$a;
|
|
350
|
+
T.prototype.setAudioRendition=T.prototype.Za;T.prototype.setVideoRendition=T.prototype.Ra;T.prototype.setTextTrack=T.prototype.Ha;T.prototype.setAudioTrack=T.prototype.ta;T.prototype.setVideoTrack=T.prototype.ab;T.prototype.getTextTrack=T.prototype.qa;T.prototype.getAudioTrack=T.prototype.ja;T.prototype.getVideoTrack=T.prototype.Ea;T.prototype.getLoadingTextRendition=T.prototype.ib;T.prototype.getLoadingAudioRendition=T.prototype.hb;T.prototype.getLoadingVideoRendition=T.prototype.Va;
|
|
351
|
+
T.prototype.getTextRendition=T.prototype.Da;T.prototype.getAudioRendition=T.prototype.Ka;T.prototype.getVideoRendition=T.prototype.ka;T.prototype.getTextTracks=T.prototype.ga;T.prototype.getAudioTracks=T.prototype.getAudioTracks;T.prototype.getVideoTracks=T.prototype.getVideoTracks;T.prototype.canSelectVideoTracks=T.prototype.Hd;_.ps=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(Gb);}end(a){if(this.f)return this.f.end(a);if(a<this.a.length)return this.a[a].end;throw Error(Gb);}rb(){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)}Ba(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:this.end(this.length-
|
|
352
|
+
1)}cc(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}Ia(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.Ba(),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=
|
|
353
|
+
"";for(let b=0;b<this.length;b++)0<b&&(a+=" "),a+=`${this.start(b).toFixed(3)}-${this.end(b).toFixed(3)}`;return a}};_.x("clpp.BufferInfo",_.ps);_.ps.prototype.bufferedAheadOf=_.ps.prototype.Ia;_.ps.prototype.isBuffered=_.ps.prototype.cc;_.ps.prototype.bufferEnd=_.ps.prototype.Ba;_.ps.prototype.bufferStart=_.ps.prototype.rb;_.ps.prototype.end=_.ps.prototype.end;_.ps.prototype.start=_.ps.prototype.start;_.qs=class{constructor(){this.Nc=new Cr(this);this.Lc=[]}addEventListener(a,b){this.on(a,b)}removeEventListener(a,b){this.off(a,b)}on(a,b,c){return this.Nc.on(a,b,c)}one(a,b,c){return this.Nc.one(a,b,c)}off(a,b){return this.Nc.off(a,b)}addDelegate(a){a&&(0<=this.Lc.indexOf(a)||this.Lc.push(a))}dispatchEvent(a){this.trigger(a);return a.defaultPrevented}removeDelegate(a){a&&(a=this.Lc.indexOf(a),0<=a&&this.Lc.splice(a,1))}trigger(a){this.Nc.trigger(a);for(const b of this.Lc)b.dispatchEvent(a)}};
|
|
354
|
+
_.qs.prototype.off=_.qs.prototype.off;_.qs.prototype.one=_.qs.prototype.one;_.qs.prototype.on=_.qs.prototype.on;_.qs.prototype.removeEventListener=_.qs.prototype.removeEventListener;_.qs.prototype.addEventListener=_.qs.prototype.addEventListener;_.x("clpp.events.ERROR",_.Qd);_.x("clpp.events.LOADEDMETADATA",_.le);_.x("clpp.events.BUFFERING_ENDED",_.Nc);_.x("clpp.events.BUFFERING_STARTED",_.Oc);_.x("clpp.events.STATE_CHANGED",_.vf);_.pk="audiotrackchanged";_.x("clpp.events.AUDIO_TRACK_CHANGED",_.pk);_.qk="texttrackchanged";_.x("clpp.events.TEXT_TRACK_CHANGED",_.qk);_.x("clpp.events.VIDEO_TRACK_CHANGED",_.$f);_.x("clpp.events.BITRATE_CHANGED",_.Lc);_.os="tracksadded";_.x("clpp.events.TRACKS_ADDED",_.os);_.x("clpp.events.LOAD_START",me);
|
|
355
|
+
_.x("clpp.events.RELEASING",_.hf);_.x("clpp.events.RELEASED",gf);_.x("clpp.events.DESTROYING","destroying");_.x("clpp.events.DESTROYED","destroyed");_.x("clpp.events.VIDEO_BUFFER_CHANGED",_.Zf);_.x("clpp.events.AUDIO_BUFFER_CHANGED",_.Jc);_.x("clpp.events.DOWNLOAD_TRACE","downloadtrace");_.x("clpp.events.DRM_SESSION_UPDATE",_.Jd);_.x("clpp.events.DRM_SESSION_PERSISTED",_.Id);_.x("clpp.events.DRM_RENEWAL_STARTED",Hd);_.x("clpp.events.DRM_EXPIRATION_UPDATE",_.Gd);
|
|
356
|
+
_.x("clpp.events.AUTOPLAY_NOT_ALLOWED",_.Kc);_.x("clpp.events.PLAY",_.Me);_.x("clpp.events.SEEKING",_.of);_.x("clpp.events.SEEKED",_.nf);_.x("clpp.events.USER_SEEKING",_.Pf);_.x("clpp.events.USER_SEEKED",_.Of);_.zn={SEEKING:1,NO_DATA:2};_.x("clpp.events.BufferingReasons",_.zn);_.x("clpp.events.ADS_TIMELINE_CHANGED",_.oc);_.x("clpp.events.AD_LOADED",_.ec);_.x("clpp.events.AD_BREAK_STARTED",_.Xb);_.x("clpp.events.AD_STARTED",_.kc);_.x("clpp.events.AD_BUFFERING",_.$b);_.x("clpp.events.AD_PROGRESS",_.hc);
|
|
357
|
+
_.x("clpp.events.AD_FIRST_QUARTILE",_.cc);_.x("clpp.events.AD_MIDPOINT",_.fc);_.x("clpp.events.AD_THIRD_QUARTILE",_.mc);_.x("clpp.events.AD_PAUSED",_.gc);_.x("clpp.events.AD_RESUMED",_.ic);_.x("clpp.events.AD_SKIPPED",_.jc);_.x("clpp.events.AD_CLICKED",_.ac);_.x("clpp.events.AD_IMPRESSION",_.dc);_.x("clpp.events.AD_COMPLETED",_.bc);_.x("clpp.events.AD_STOPPED",_.lc);_.x("clpp.events.AD_BREAK_STOPPED",_.Zb);_.x("clpp.events.SIMID_CREATIVE_STARTED",_.qf);_.x("clpp.events.SIMID_CREATIVE_STOPPED",_.rf);
|
|
358
|
+
_.x("clpp.events.CASTING_STARTED",_.Rc);_.x("clpp.events.CASTING_ENDED","castingended");_.x("clpp.events.CAST_STATUS_CHANGED",_.Sc);_.x("clpp.events.AIRPLAY_STATUS_CHANGED",_.rc);_.x("clpp.events.AIRPLAY_CASTING_STARTED",_.qc);_.x("clpp.events.AIRPLAY_CASTING_ENDED",_.pc);_.bh="timeline-cue-added";_.x("clpp.events.TIMELINE_CUE_ADDED",_.bh);_.dh="timeline-cue-enter";_.x("clpp.events.TIMELINE_CUE_ENTER",_.dh);_.eh="timeline-cue-exit";_.x("clpp.events.TIMELINE_CUE_EXIT",_.eh);
|
|
359
|
+
_.x("clpp.events.MPD_TYPE_CHANGED",_.ve);_.x("clpp.events.LIVE_TURNED_STATIC",_.je);_.x("clpp.events.VIMOND_RESPONSE",_.ag);_.x("clpp.events.PLAYLIST_ITEM_CHANGED",_.Ue);_.x("clpp.events.PLAYLIST_MODIFIED",_.Ve);_.x("clpp.events.CDN_SWITCH_SUCCESS",_.Tc);_.x("clpp.events.ONLINE_STATUS_CHANGED",Ee);var wk=["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"];_.x("clpp.version",_.da);_.x("clpp.name",_.pa);_.uk="application/x-mpegurl";_.x("clpp.Type",{DASH:_.tc,HLS:_.uk,SMOOTH_STREAMING:_.zc,MP4:_.Yf});_.ah="scte35";_.Zg=Jf;_.x("clpp.TimelineCueType",{SCTE35:_.ah,DASH_CALLBACK:_.we,HLS_DATERANGE:"hls-daterange",UNKNOWN:_.Zg});_.x("clpp.SpeedUpMode",{DECODER:_.yd,SEEK:"seek"});var rs=class{};_.x("clpp.utils.PlayerConfiguration",rs);rs.create=_.Ck;var ss=["abort",Pc,Qc,Ld,"emptied",Nd,_.Pd,_.Qd,"interruptbegin","interruptend",_.ke,_.le,me,"mozaudioavailable",_.Ie,_.Me,_.Te,_.df,_.ff,_.nf,_.of,tf,"suspend",_.Ff,"volumechange",_.dg,_.eg,_.lf,jg,ig,gg,hg];_.ts=class extends _.qs{constructor(a){super();this.log=new _.R(a);this.configuration=this.qc=_.Ak();this.ea=this.A=null;this.Vb=this.Wd=!1;this.Gf=new _.R("clpp.video.events");this.qb=null;this.uc=-1;this.Nf=this.Lf.bind(this);this.Vd=new _.Eo;this.M=new _.Er;this.oc=this.sc=this.K=null}init(a,b){this.configuration=this.qc=b;this.A=a;this.log.info("Initializing Player surface");a=this.A.getMedia();this.log.info("Attaching media element listeners");for(const c of ss)this.M.on(a,c,this.Nf,c!==_.Qd);
|
|
360
|
+
this.qb||(this.qb=this.sf());this.qb.initialize(this);this.A.showMediaElement()}release(){this.K&&(this.K.destroy(),this.K=null);return Promise.resolve()}destroy(){this.M.release();return this.Vd.release()}canPlay(a,b){return _.Tg[this.namespace()].canPlay(a,b)}play(){if(!this.ea)return Promise.reject("No sources specified yet. You need to load content before calling play.");const a=this.A.getMedia().play();return Promise.resolve(a).catch(b=>{this.log.info("Caught play promise exception",b);const c=
|
|
361
|
+
{name:b.name||"",message:b.message||"",stack:b.stack||""};xk(c)?(this.trigger(new _.C(_.Kc)),this.log.warn(_.ja)):c.name===nb&&this.log.warn('Unrecognized "NotAllowedError" on play(). '+`${b.name}: ${b.message}`);throw b;})}pause(){return this.ea?new Promise((a,b)=>{const c=this.getState();if(c!==_.xn&&c!==_.un&&c!==_.Fn&&c!==_.En)b();else if(this.A.getMedia().pause(),this.getState()===_.Fn)this.M.one(this,_.vf,()=>{a()});else a()}):Promise.reject("No sources specified yet. You need to load content before calling pause.")}isPaused(){return this.A.getMedia().paused}isEnded(){return this.A.getMedia().ended}getConfiguration(){return this.configuration}setDrmCustomDataModifier(a){this.sc=
|
|
362
|
+
a}setCdnErrorCallback(a){this.oc=a}xc(){return this.sc}getSurface(){return this.A}getBufferInfo(a){const b=this.getSurface().getMedia();return new _.ps(b?b.buffered:void 0,a)}getPosition(){const a=this.A.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.getPosition();if(void 0===a||null===a||typeof a!==_.r||a===b)return Promise.resolve();const c=this.A.getMedia();if(!c)return this.log.warn("No media element available, can not set current time!"),
|
|
363
|
+
Promise.reject();const d=a-b;return.1>=Math.abs(d)?(this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=()=>{this.trigger(new _.C(_.Pf));this.M.on(c,_.nf,h);this.M.on(c,_.Ff,h);this.M.on(c,_.df,h);this.log.info("Seeking to "+a+". Delta "+d);this.Vb=this.Wd=!0;c.currentTime=a},h=l=>{const m=this.getPosition(),n=.1>=Math.abs(a-m);var q=.25<m-a;const t=c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,v=l.type===_.nf,y=l.type===_.df,A=l.type===_.Ff,
|
|
364
|
+
D=y&&t;q=v||n&&D||A&&q;this.log.debug("Checking seeking state after "+l.type+" event. Seek completed:",q,"Current Time:",m,"Target Time:",a,"Native Event:",v,"Time reached",n,"Timeupdate:",A,"Progress:",y,"ReadyState:",t,"Progress Ready:",D);q?(this.Vb=this.Wd=!1,this.M.off(c,_.nf,h),this.M.off(c,_.Ff,h),this.M.off(c,_.df,h),this.Ff(),this.trigger(new _.C(_.Of)),e()):y&&b===m&&(this.log.debug("Seek seemed to have been ignored. Trying again"),c.currentTime=a)},k=()=>{if(c.readyState>HTMLMediaElement.HAVE_NOTHING)g();
|
|
365
|
+
else this.M.one(c,_.le,g)};this.getState()===_.Cn?(this.log.debug("Player is in IDLE state. Postpone seek."),this.M.one(this,_.vf,()=>{switch(this.getState()){case _.xn:case _.Fn:case _.En:this.log.debug("Valid seek state reached.");k();break;default:this.log.warn("Invalid seek target state. Aborting seek"),f()}})):k()})}getVolume(){const a=this.A.getMedia();if(a)return a.volume;this.log.warn("No media element available, can not report volume!");return null}setVolume(a){const b=this.A.getMedia();
|
|
366
|
+
b?_.Fg(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
|
|
367
|
+
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.A.getMedia().muted}setMuted(a){const b=this.A.getMedia();typeof a===_.Mc&&(b.muted=a)}getDuration(){return this.ea?this.A.getMedia().duration:-1}getTrackManager(){return this.qb}getPlaybackRate(){const a=this.A.getMedia();return a&&a.playbackRate||1}setPlaybackRate(a){const b=this.A.getMedia();
|
|
368
|
+
void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.uc=a}getSourceIndex(){return this.uc}getLoadedSource(){return this.ea&&-1!==this.uc?this.ea[this.uc]:null}getPeriods(){return[]}getNetworkEngine(){return this.Vd}setNetworkEngine(a){this.Vd=a}getTextDisplayer(){return this.K}getTimelineCues(){return[]}resetAbr(){}Lf(a){var b=this.getSurface().getMedia();const c=this.getPosition();let d="Received Video Element Event: '"+a.type+"' with playhead at: "+c;if(a.type===_.Ff||a.type===_.df)this.Gf.debug(d);
|
|
369
|
+
else{let e="";switch(a.type){case _.ff:e=`Rate: ${this.getPlaybackRate()}`;break;case Ld:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.Me:case _.Te:case "suspend":case _.dg:case tf:case _.of:case _.nf:case _.Ff:case _.df:case Pc:case Qc:b=this.getBufferInfo().Ia(c);e=`State ${this.getSurface().getMedia().readyState} `+`Buffer: ${b}`;break;case _.lf:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=". "+
|
|
370
|
+
e);this.Gf.info(d)}a.type!==_.Qd&&this.trigger(new _.C(a.type,{detail:a}))}Ff(){}};_.ts.prototype.getTextDisplayer=_.ts.prototype.getTextDisplayer;_.ts.prototype.setNetworkEngine=_.ts.prototype.setNetworkEngine;_.ts.prototype.getNetworkEngine=_.ts.prototype.getNetworkEngine;var Gk;Gk=new _.R("clpp.Components");_.Ek=new Map;_.x("clpp.install",function(a){Ok(a)});_.x("clpp.uninstall",function(a){Pk(a)});var us=class{constructor(){this.a=this.f=null;this.h=new _.R("clpp.drm.csl")}release(){this.a=this.f=null}};_.x("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.zb,SW_SECURE_DECODE:_.Ab,HW_SECURE_CRYPTO:Va,HW_SECURE_DECODE:Wa,HW_SECURE_ALL:Ta});_.x("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.x("clpp.drm.KeySystem",{NONE:_.xe,CLEAR_KEY:_.Ge,WIDEVINE:_.ud,PLAYREADY:_.sd,FAIRPLAY:_.pd,PRIMETIME:_.od});_.Tk={};_.x("clpp.drm.registerDrmEnvironment",_.Uk);var Xk={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,
|
|
363
371
|
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,
|
|
364
372
|
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,
|
|
365
373
|
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,
|
|
@@ -373,94 +381,96 @@ e);this.Ff.info(d)}a.type!==_.Nd&&this.trigger(new _.F(a.type,{detail:a}))}Ef(){
|
|
|
373
381
|
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,
|
|
374
382
|
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,
|
|
375
383
|
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,
|
|
376
|
-
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]};_
|
|
377
|
-
_.
|
|
378
|
-
this.f[f];if(h){let m=null;var k=null;this.g[f]==
|
|
379
|
-
_.
|
|
380
|
-
var
|
|
381
|
-
43E3:"General Fairplay error",44E3:"General OMA error",44001:"OMA Device registration failed",45E3:"General CDRM error",45001:"CDRM Device registration failed",6E4:"CSL",60001:"CSL - INVALID",60100:"CSL - Denied by Stream Limiting",7E4:"General Output Protection",70001:"All keys filtered by EOP settings",8E4:"TAKE DOWN",80001:"TAKE DOWN - Denied by Take Down",9E4:"General GBL error",90001:"License delivery prohibited in your region"},
|
|
382
|
-
|
|
383
|
-
for(const a of Object.keys(
|
|
384
|
-
extractContentId:_.
|
|
385
|
-
a.reader.Ca()&&_.
|
|
386
|
-
_.
|
|
387
|
-
null}destroy(){const a=this;return _.
|
|
388
|
-
b.sessionId);const c=this.f.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f==_.
|
|
389
|
-
this.h.info(`Key status global keys: ${e}`);this.j.set(f,e);c&&!c.keyId&&this.f.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.
|
|
390
|
-
_.
|
|
391
|
-
a.f&&(a.f=new _.
|
|
392
|
-
b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}detach(){}getTrackManager(){return this.
|
|
393
|
-
a)
|
|
394
|
-
b.configuration.startTime&&
|
|
395
|
-
null):a.getTime()/1E3}return null}getSeekRange(){var a=this.getSurface().getMedia();if(a&&a.src){a=a.seekable;if(a.length)return this.
|
|
396
|
-
b=Number(c.totalVideoFrames),a.l=Number(c.droppedVideoFrames),a.j=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.
|
|
397
|
-
_.
|
|
398
|
-
HTMLMediaElement))throw new _.H(_.
|
|
399
|
-
a):this.h.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),_.
|
|
400
|
-
|
|
401
|
-
this.h.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&&_.
|
|
402
|
-
|
|
403
|
-
g("Web Crypto API is not supported"):f()})}};var
|
|
404
|
-
this.
|
|
405
|
-
void 0===this.f.autoplay&&(this.f.autoplay=!0,this.h.debug("Setting autoplay in configuration since it was specified in the video element"))));a=[];for(const d of
|
|
406
|
-
void 0===a&&(a=null);return a}getSurface(){return this.g}getConfiguration(){return _.
|
|
407
|
-
|
|
408
|
-
new _.H(_.
|
|
409
|
-
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 _.
|
|
410
|
-
this.a?this.a.seek(a):Promise.reject("delegate does not exist")}getPresentationStartTime(){return this.a?this.a.getPresentationStartTime():null}getSeekRange(){return this.a?this.a.getSeekRange():{start:0,end:0}}
|
|
411
|
-
this.a.
|
|
412
|
-
this.a.
|
|
413
|
-
Q.prototype.
|
|
414
|
-
Q.prototype.
|
|
415
|
-
Q.prototype.
|
|
416
|
-
Q.prototype.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
d;}finally{a.j=!1,b&&
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
U.prototype.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
this.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
384
|
+
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]};_.vs=class{constructor(a){this.I=a;this.f={}}Ma(a,b){this.f[a]=b}};_.x("clpp.drm.DrmEnvironment",_.vs);_.vs.prototype.setDrmSystem=_.vs.prototype.Ma;_.ul=class{constructor(a,b){b=void 0===b?!1:b;this.f=_.Fg(a)?new DataView(new ArrayBuffer(a),0,a):a;this.a=0;this.g=b;this.buffer=this.f.buffer}getPosition(){return this.a}Ca(){return this.f.byteLength}seek(a){(0>a||a>=this.f.byteLength)&&_.Zk();this.a=a}};_.em=class{constructor(a,b){this.f=a;this.g=void 0===b?!0:b;this.a=0}getPosition(){return this.a}Ca(){return this.f.byteLength}skip(a){this.a+a>this.f.byteLength&&_.bl();this.a+=a}seek(a){if(0>a||a>=this.f.byteLength)throw _.bl();this.a=a}};
|
|
385
|
+
_.x("clpp.utils.dataview.DataViewReader",_.em);_.sl=class{constructor(){this.g=[];this.f=[];this.a=!1;this.h=new _.R("clpp.mp4")}L(a,b){a=jl(a);this.g[a]=ws;this.f[a]=b;return this}$(a,b){a=jl(a);this.g[a]=xs;this.f[a]=b;return this}stop(){this.a=!0}parse(a,b){a=_.J(a);a=new _.em(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);for(this.a=!1;_.al(a)&&!this.a;)this.xd(0,a,b)}xd(a,b,c){const d=b.getPosition();let e=_.P(b);var f=_.P(b);let g=!1;this.h.debug("Parsing MP4 box",_.kl(f));switch(e){case 0:e=b.Ca()-d;break;case 1:e=_.gl(b),g=!0}const h=
|
|
386
|
+
this.f[f];if(h){let m=null;var k=null;this.g[f]==xs&&(k=_.P(b),m=k>>>24,k&=16777215);f=b.getPosition()-d;var l=d+e;c&&l>b.Ca()&&(l=b.Ca());l-=b.getPosition();b=0<l?_.il(b,l):new Uint8Array(0);b=new _.em(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.Ca()-b.getPosition()),b.skip(a)}};_.x("clpp.utils.Mp4Parser",_.sl);_.sl.typeToString=_.kl;
|
|
387
|
+
_.sl.allData=_.nl;_.sl.sampleDescription=_.ml;_.sl.children=_.ll;_.sl.prototype.parseNext=_.sl.prototype.xd;_.sl.prototype.parse=_.sl.prototype.parse;_.sl.prototype.stop=_.sl.prototype.stop;_.sl.prototype.fullBox=_.sl.prototype.$;_.sl.prototype.box=_.sl.prototype.L;_.sl.headerSize=_.ol;var ws=0,xs=1;var ys=class{};_.x("clpp.utils.FairplayUtils",ys);ys.parseFairPlayResponse=_.xl;ys.formatFairPlayRequest=_.wl;ys.createFairplayPayload=vl;ys.extractContentId=_.rl;ys.extractExtXKeyUri=pl;var Gl=new _.R("clpp.drm.DrmToday"),Ql="PRODUCTION",Rl="STAGING",Sl="TEST",zs={PRODUCTION:Ql,STAGING:Rl,TEST:Sl};_.x("clpp.drm.DrmToday.Environment",zs);_.x("clpp.drm.DrmToday.WidevineCertificates",{V1_PROD:"V1_PROD",V1_STAGING:"V1_STAGING",V2:"V2"});
|
|
388
|
+
var zl="/license-proxy-widevine/cenc/",Al="/license-proxy-headerauth/drmtoday/RightsManager.asmx",Bl="/license-server-fairplay/",Tl={"00000":"Success","01000":"General Internal Error","02000":"General Request Error","03000":"General Request Authentication Error",3E4:"General DRM error",4E4:"General Widevine Modular error",40001:"Widevine Device Certificate Revocation (wv 127)",40002:"Widevine Device Certificate Revocation - Permanently (wv 175)",41E3:"General Widevine Classic error",42E3:"General Playready error",
|
|
389
|
+
43E3:"General Fairplay error",44E3:"General OMA error",44001:"OMA Device registration failed",45E3:"General CDRM error",45001:"CDRM Device registration failed",6E4:"CSL",60001:"CSL - INVALID",60100:"CSL - Denied by Stream Limiting",7E4:"General Output Protection",70001:"All keys filtered by EOP settings",8E4:"TAKE DOWN",80001:"TAKE DOWN - Denied by Take Down",9E4:"General GBL error",90001:"License delivery prohibited in your region"},As=[Ta,Wa,Va,_.Ab,_.zb],Bs=[_.Ab,_.zb],Cs=["3000","2000","150"],
|
|
390
|
+
Ds=["2000","150"];
|
|
391
|
+
for(const a of Object.keys(zs)){let b=ua;a!==Ql&&(b+=`_${a}`);const c=new _.vs(b);let d=null;switch(a){case Ql:d=Yk("V1_PROD");break;case Rl:d=Yk("V2");break;case Sl:d=null}c.Ma(_.ud,{licenseUrl:Cl(_.ud,a),videoRobustness:As,audioRobustness:Bs,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:d,modifiers:{licenseRequest:_.Il,licenseResponse:_.Jl}});c.Ma(_.pd,{licenseUrl:Cl(_.pd,a),certificateUrl:yl(a)+"/license-server-fairplay/cert/",modifiers:{licenseRequest:_.Ll,licenseResponse:_.Ml,
|
|
392
|
+
extractContentId:_.Nl,certificateRequest:_.Ol}});c.Ma(_.sd,{licenseUrl:Cl(_.sd,a),videoRobustness:Cs,audioRobustness:Ds,modifiers:{licenseRequest:Pl}});_.Uk(c)};var Es=class{};_.x("clpp.drm.eme.EmeFactory",Es);var Vl=[];Es.Apis={STANDARD:yb,APPLE:"APPLE",WEBKIT:"WEBKIT",NOP:"NOP"};var cm,Fs,bm;_.km=[154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149];cm=[237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237];Fs=class{constructor(a,b,c){this.j=new Uint8Array(a);this.a=b;this.f=c}};bm=class extends Fs{};_.jm=class extends Fs{constructor(a,b,c,d,e,f){f=void 0===f?null:f;super(a,b,d);this.version=e;this.g=c;this.l=f}};var mm=!!(performance&&performance.mark&&performance.measure);var Mm=class{constructor(a){this.f=[];this.g=[];this.a=[];8<=a.byteLength&&(new _.sl).$("pssh",this.j.bind(this)).parse(a.buffer);0==this.a.length&&_.B("No pssh box found!")}j(a){if(1<a.version)_.B("Unrecognized PSSH version found!");else{var b=_.ni(_.il(a.reader,16)),c=[];if(0<a.version){var d=_.P(a.reader);for(let e=0;e<d;++e){const f=_.ni(_.il(a.reader,16));c.push(f)}}d=_.P(a.reader);a.reader.skip(d);this.g.push.apply(this.g,c);this.f.push(b);this.a.push({start:a.start,end:a.start+a.size-1});a.reader.getPosition()!=
|
|
393
|
+
a.reader.Ca()&&_.B("Mismatch between box size and data size!")}}};var Im,Gs;
|
|
394
|
+
_.On=class{constructor(a){this.D=a;this.H=new Set;this.A=this.G=this.l=null;this.R=!1;this.a=null;this.I=Gs;this.w=new _.Er;this.K=new us;this.f=new Map;this.J=[];this.F=new _.Km;this.g=null;this.T=b=>{this.o=!0;this.B=!1;this.F.reject(b);a.onError(b)};this.j=new Map;this.W=new Map;this.U=new _.zj(()=>Bm(this));this.ra=!1;this.aa=new _.Km;this.C=!1;this.V=[];this.ba=!1;this.O=0;this.h=new _.R("clpp.drm.DrmEngine");this.Z=(new _.zj(()=>{Cm(this)})).bb(1);this.F.catch(()=>{});this.o=this.B=!1;this.M=
|
|
395
|
+
null}destroy(){const a=this;return _.w(function*(){a.ra?yield a.aa:(a.ra=!0,yield Dm(a),a.aa.resolve())})}keySystem(){return this.a?_.rm(this.a.keySystem):""}getDrmInfo(){return this.a}oa(a){const b=this;return _.w(function*(){if(!b.C||b.I!==Im){var c=Math.floor(a.timeStamp),d=`drm.msg.${c}.start`,e=`drm.msg.${c}.end`;_.nm(d);!b.g.delayLicenseRequestUntilPlayed||b.A&&!b.A.paused||b.ba?yield Rm(b,a):b.V.push(a);_.nm(e);_.om(`drm.sess.msg.${c}`,d,e)}})}fa(a){const b=a.target;this.h.info("Key status changed for session",
|
|
396
|
+
b.sessionId);const c=this.f.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f==_.yf){var g=f;f=e;e=g}if(qm(this.a.keySystem)&&16===f.byteLength&&_.Bj()){g=_.Th(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!==wf&&(c.loaded=!0);c&&c.Fa&&c.Fa.resolve();"expired"===e&&(d=!0);f=_.J(f);let h=_.ni(f);"00"===h&&c&&c.keyId?h=c.keyId:this.a.keySystem.startsWith(_.pd)&&16!==f.byteLength&&(h=Vh(f));(f=h||"")?this.h.info(`Key status for Key ID '${h}': ${e}`):
|
|
397
|
+
this.h.info(`Key status global keys: ${e}`);this.j.set(f,e);c&&!c.keyId&&this.f.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.Ta.forEach(e=>{this.j.get(e)===wf&&(this.h.warn(`Key status for Key ID '${e}': 'output-restricted'`),this.j.set(e,_.He))});for(a=0;a<this.a.initData.length;a++){const e=this.a.initData[a];e.keyId&&this.j.get(e.keyId)===wf&&_.oi(e.initData,c.initData)&&(this.h.warn(`Key status for Key ID '${e.keyId}': 'output-restricted'`),this.j.set(e.keyId,
|
|
398
|
+
_.He))}a=b.expiration-Date.now();(0>a||d&&1E3>a)&&c&&!c.ob&&(this.h.debug("Session has expired",b.sessionId),(a=this.f.get(b))&&a.pc&&a.pc.stop(),this.f.delete(b),b.close().catch(()=>{}));$m(this)&&(this.F.resolve(),1!==this.f.size||d?this.U.ca(.5):Bm(this))}};Im=0;Gs=3;_.gn=new Map;_.hn=new _.R("clpp.text");var Hs=class{constructor(){this.a=null;this.f=[]}};var Is=class{constructor(){this.g=this.f=this.j=null;this.a=[]}};_.Js=class{constructor(){this.f=this.o=this.A=this.C=this.j=this.l=this.g=this.w=NaN;this.a=new Hs;this.B=new Is}getStats(){return{width:this.w,height:this.g,streamBandwidth:this.o,decodedFrames:this.j,droppedFrames:this.l,corruptedFrames:this.C,estimatedBandwidth:this.f,loadLatency:this.A,playTime:mn(this.a,_.Fn),pauseTime:mn(this.a,_.En),bufferingTime:mn(this.a,_.xn),stateHistory:nn(this.a),switchHistory:on(this.B)}}};_.Ks=class{constructor(a){this.f=a;this.a=void 0}value(){void 0==this.a&&(this.a=this.f());return this.a}};var qn=new _.Ks(()=>new Map([[HTMLMediaElement.HAVE_METADATA,_.le],[HTMLMediaElement.HAVE_CURRENT_DATA,_.ke],[HTMLMediaElement.HAVE_FUTURE_DATA,Pc],[HTMLMediaElement.HAVE_ENOUGH_DATA,Qc]]));var Ms=class{constructor(a){this.h=new _.R("clpp.StateManager");this.m=a;this.a=new _.Er;this.f=_.Cn;this.A=_.Ls;this.H=0;this.w=-1;this.K=this.o=this.I=this.B=0;this.j=this.g=this.F=!1;this.G=0;this.l=null;this.J=0;this.M=_.Nj();this.C=!1;this.I=Date.now();vn(this)}Rb(a,b){this.m&&this.m.trigger(new _.C(a,{detail:b}))}getState(){return yn(this,"")}T(a){(a=a&&a.detail)&&a.severity&&a.severity===_.F&&tn(this,_.Bn)}destroy(){this.h.debug("Stop watching for video events for "+this.m.namespace());this.a.release()}};_.x("clpp.utils.media.detectType",Gn);var Jn=new _.R("clpp.sources");var Ns=class extends _.ts{constructor(){super(jd);this.w=this.G=!1;this.l=this.B=this.o=this.a=this.j=null;this.g=new _.Er;this.F=this.C=this.f=this.H=null}init(a,b){super.init(a,b);this.j=new Ms(this);tn(this.j,_.Cn)}namespace(){return jd}unload(){const a=this;return _.w(function*(){if(a.ea){a.log.debug(_.wb,a.ea);a.C&&(a.C.stop(),a.C=null);const b=a.getTrackManager();b&&b.release();a.B&&(a.B.destroy(),a.B=null);a.K&&(a.K.destroy(),a.K=null);a.l&&a.l.release();a.o&&(a.o.destroy(),a.o=null);_.Xg(a.g);
|
|
399
|
+
a.f&&(a.f=new _.Js);a.F=null;a.ea=null;a.G=!1;a.a&&(a.a.removeAttribute("src"),a.a.load());yield Ln(a)}})}release(){return super.release().then(()=>this.unload()).then(()=>{this.j&&tn(this.j,_.Cn)})}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(wa);const a=this.getTrackManager();a&&a.destroy();this.l&&(this.l.destroy().catch(b=>{this.log.warn("Error while disposing metadata handler",
|
|
400
|
+
b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}detach(){}getTrackManager(){return this.qb}load(a){const b=this;return _.w(function*(){if(b.w)return Kn();if(!b.getSurface()||!b.getSurface().getMedia())return Promise.reject("No surface or no media element in surface");const c=b.A.getMedia();b.H=Date.now()/1E3;b.f=new _.Js;b.g.on(b,_.vf,()=>{b.f&&_.ln(b.f.a,b.getState())});tn(b.j,_.Dn);b.ea=_.In(a);b.configuration=_.Ck(b.qc,
|
|
401
|
+
a);b.log.debug(_.cb,b.configuration);b.log.debug(_.rb,b.ea);const d=_.kn(b.configuration,[_.Wd,"native"]);b.K=d.create(b);b.K.setTextVisibility(!0);b.configuration.enableHtmlCue&&_.Fk(_.Bf)&&!_.Pj()&&(b.B=new Sr(b),b.B.start(c));b.l?b.l.release():b.l=new Fr(b);gh(b.l,c);b.getTrackManager().load();c.loop=!!b.configuration.loop;_.z(b.configuration.volume)||b.setVolume(b.configuration.volume);_.z(b.configuration.muted)||b.setMuted(b.configuration.muted);b.g.one(c,Pc,()=>{b.trigger(new _.C(_.os))});null==
|
|
402
|
+
b.configuration.startTime&&Tn(b,c);_.Nj()&&Un(b,c);try{yield Nn(b,c),yield Pn(b),yield Sn(b).P}catch(e){b.G=!1,b.onError(e)}})}onError(a){this.G||(a.severity===_.F&&null!==this.j&&tn(this.j,_.Bn),this.trigger(new _.C(_.Qd,{detail:a})))}sf(){return new T}getState(){return null!==this.j?this.j.getState().currentState:_.Ls}getPresentationStartTime(){if(this.a&&this.a.getStartDate&&this.isLive()){const a=this.a.getStartDate();return isNaN(a.getTime())?(this.log.warn("EXT-X-PROGRAM-DATETIME required to get presentation start time as Date!"),
|
|
403
|
+
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 _.pn();this.f&&_.ln(this.f.a,this.getState());var a=this.a,b=this.f,c=a.videoHeight;b.w=a.videoWidth;b.g=c;a.getVideoPlaybackQuality&&(c=a.getVideoPlaybackQuality(),a=this.f,
|
|
404
|
+
b=Number(c.totalVideoFrames),a.l=Number(c.droppedVideoFrames),a.j=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.ka())a.bandwidth&&(this.f.o=a.bandwidth),a.Ic&&(this.f.f=a.Ic);return this.f.getStats()}getTimelineCues(){return this.l?this.l.getTimelineCues():[]}};
|
|
405
|
+
_.Vg(new class{a(){return jd}canPlay(a,b){a=a.type||"";const c=a===_.tc,d=a===_.zc,e=a===_.uk;var f;_.Mj()||c||d||e&&!_.Nj()?f=0:f=""!==Aj().canPlayType(a)?e&&_.Nj()&&(window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported)&&!b.streaming.preferNativeHlsOnSafari?1:2:0;return f}create(){return new Ns}});_.x("clpp.ads.PodType",{PREROLL:0,MIDROLL:1,POSTROLL:2});_.x("clpp.ads.Technology",{CLIENT_SIDE:0,SERVER_SIDE:1});_.x("clpp.ads.ErrorType",{LOAD:0,PLAY:1,OTHER:2});var Wn=new _.R("clpp.ads"),Vn=[];_.x("clpp.utils.dom.createHTMLElement",_.co);var Os=class{constructor(a){this.a=null;this.g=new Set;this.f=null;this.set(a||null)}set(a){this.g.clear();this.f&&(this.f.disconnect(),this.f=null);if(this.a=a)this.f=eo(this,a)}get(){return this.a}};var Rs=class{constructor(a,b){this.h=new _.R("clpp.PlayerSurface");this.w=_.xg(Ps,b);this.f=new Os;this.g=null;this.a=new Os;this.l=Qs;Qs+=1;this.o=`clpp-video-${this.l}`;this.j=new _.Er;if(null==a)throw new _.H(_.F,7,7102,"No Media element was provided");if(!(a instanceof Element||(a=document.getElementById(a),a)))throw new _.H(_.F,7,7004,"Media element not found");b=this.w;this.h.debug("Initializing Player Surface on ",a);if("cast-media-player"===a.tagName.toLowerCase())this.g=a;else{if(!(a instanceof
|
|
406
|
+
HTMLMediaElement))throw new _.H(_.F,7,7005,"Media element is not instance of HTMLMediaElement");if(!a.hasAttribute("crossorigin")){var c=b.crossorigin;this.h.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 _.H(_.F,7,7006,"Container element is not a direct parent of media element");d=b.containerEl}else{c=document.createElement(_.Bd);a.parentNode?a.parentNode.replaceChild(c,
|
|
407
|
+
a):this.h.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),_.ao(c,f);c.style.cssText=a.style.cssText;a.removeAttribute(_.Af);for(d of[_.kg,_.Ud])f=a.getAttribute(d),f=parseInt(f,10),isNaN(f)||(c.style[d]=`${f}px`),_.Dj()||a.removeAttribute(d);c.appendChild(a);d=c}d&&(this.a.set(d),fo(this.a,"clpp-container"),
|
|
408
|
+
fo(this.a,this.o),fo(this.f,_.Zc),fo(this.f,"clpp-video"));b.webOSStartupPatch&&go(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.g}isFullscreen(){return!!document.fullscreenElement}hideMediaElement(){const a=this.getMedia();a?_.ao(a,$c):this.h.debug("No media element available that could be hidden")}showMediaElement(){const a=this.getMedia();a?a.classList.remove($c):
|
|
409
|
+
this.h.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&&_.ao(a,_.Zc);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){_.ao(a,$c)}show(a){a.classList.remove($c)}release(){this.j.release()}};
|
|
410
|
+
Rs.prototype.removeElementFromContainer=Rs.prototype.removeElementFromContainer;Rs.prototype.addElementToContainer=Rs.prototype.addElementToContainer;Rs.prototype.getCastElement=Rs.prototype.getCastElement;Rs.prototype.getContainer=Rs.prototype.getContainer;Rs.prototype.getMedia=Rs.prototype.getMedia;var Ps={disableContainer:!1,webOSStartupPatch:!0,crossorigin:"anonymous",containerEl:null},Qs=1;var Ss=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.a=new _.Er;this.g=null;this.f=!0;ko(this)}release(){this.a.release();lo(this);this.m=null}};_.x("clpp.polyfill.installAll",oo);var no=[];_.x("clpp.polyfill.register",_.po);var ro=class{constructor(a,b,c){this.g=a;this.f=b;JSON.parse(_.Wh(_.li(a)));this.a=JSON.parse(_.Wh(_.li(b)));this.j=c}verify(a,b){const c={kty:"RSA",n:a.n,e:a.e},d=this.g+"."+this.f,e=this.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=_.$h(d),n=_.li(e);return h.verify(k,l,n.buffer,m.buffer)}).then(function(l){l?f():g(Cb)}).catch(g)}else b?
|
|
411
|
+
g("Web Crypto API is not supported"):f()})}};var Ts={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},yk="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var Io=class{constructor(a){this.license=a;this.a=null;this.h=new _.R("clpp.utils.LicenseKey")}verify(){return(new Promise((a,b)=>{try{const c=so(this);a(c)}catch(c){b()}})).then(a=>a.verify(Ts)).catch(a=>{if(a&&a!==Cb){{var b=window.location.href;const c=new _.vh(b);b=c.Ya||c.Ja?c:new _.vh("//"+b)}if(/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^localhost)/.test(b.Ja))return Promise.resolve()}throw a;})}},Do="vod",Co="live";var Q=class extends _.qs{constructor(a,b,c){super();oo();this.h=new _.R("clpp.Player");if(!a)throw new _.H(_.F,7,7102);this.J=new _.Er;this.f=this.K=b||_.Ak();this.l=null;void 0===this.f.license&&(this.f.license=yk,this.h.warn("You are using the embedded demo license!"));if(!this.f.license)throw this.h.error("You provided null or empty string as your license. Please check your license configuration."),new _.H(_.F,7,7101,"No license provided in configuration!");this.g=new Rs(a,c);this.a=this.w=null;
|
|
412
|
+
this.A=new _.Eo;this.j=null;this.H=[];this.O=!0;this.I={};this.o=null;this.F=!0;this.G=this.C=!1;this.B=this.sc=null;this.Ld=!1;this.R=new Ss(this);this.on(_.vf,()=>{this.getState()===_.Bn&&(this.a?this.a.unload():Promise.resolve())});this.on(_.qc,this.M.bind(this));this.on(_.pc,this.M.bind(this));Jo(this,this.f.license);this.g.getMedia()&&(a=this.g.getMedia(),a.hasAttribute("autoplay")&&(a.removeAttribute("autoplay"),this.h.debug("Removed autoplay attribute from video element. Auto play will be handled by configuration."),
|
|
413
|
+
void 0===this.f.autoplay&&(this.f.autoplay=!0,this.h.debug("Setting autoplay in configuration since it was specified in the video element"))));a=[];for(const d of Go)try{const e=d.create(this.f);e&&a.push(e)}catch(e){this.h.error("Error while creating player plugin",e)}Lo(this,a);Kk(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 _.C(_.Qd,{detail:a}),this.trigger(a)}$b(a){a=this.I[a];
|
|
414
|
+
void 0===a&&(a=null);return a}getSurface(){return this.g}getConfiguration(){return _.yg(this.f)}getDrmInfo(){return this.a?this.a.getDrmInfo():null}detach(){return this.a?this.a.detach():Promise.resolve()}release(){if(null!=this.l)return this.h.info("Player release already in progress"),this.l;this.h.debug("Releasing player");this.l=Oo(this);return this.l.finally(()=>{this.h.debug("Player released");this.l=null})}destroy(){if(this.C)return this.h.debug("The player is already destroyed. No-op"),new Promise(a=>
|
|
415
|
+
a());this.C=!0;return this.release().then(()=>{this.h.debug(wa);this.trigger(new _.C("destroying"));return _.Ko(this,_.Be)}).then(()=>{this.a&&this.a.removeDelegate(this);this.Nc.clear();this.R.release();if(this.a)return this.a.destroy()}).then(()=>this.A.destroy()).then(()=>{Nk();this.a=null;this.trigger(new _.C("destroyed"))})}load(a){const b=this;return _.w(function*(){try{_.nm(Se),b.O=!0,yield _.To(b,a),yield _.Uo(b),yield _.Wo(b),_.nm(Re),_.om("player.load",Se,Re)}catch(c){if(b.l)throw b.h.info("Load interrupted while a player release is pending"),
|
|
416
|
+
new _.H(_.F,7,7E3);throw c;}})}preload(a){const b=this;return _.w(function*(){yield _.To(b,a);if(b.a){var c=b.a;c.preload?yield c.preload(b.f):b.h.warn(tb)}else b.h.warn(qb)})}use(a){(a=Ok(a))&&a.o(this)}remove(a){return(this.getState()<=_.Cn||this.F)&&null!==Ik(a)?(Pk(a),this.G=!0):!1}play(){return this.a?this.j&&this.a.namespace()!==_.fd?this.j.start(this.a):this.a.play():Promise.reject("No player initialized. You need to load content before calling play.")}pause(){return this.a?this.a.pause():
|
|
417
|
+
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 _.ps}getState(){return this.a?this.a.getState():_.Cn}getPeriods(){return this.a?this.a.getPeriods():[]}isEnded(){return this.a&&this.a.isEnded()||!1}isPaused(){return this.a&&this.a.isPaused()||!1}getPosition(){return this.a?this.a.getPosition():0}seek(a){return this.getState()===_.Bn?Promise.reject("Cannot seek in current state."):
|
|
418
|
+
this.a?this.a.seek(a):Promise.reject("delegate does not exist")}getPresentationStartTime(){return this.a?this.a.getPresentationStartTime():null}getSeekRange(){return this.a?this.a.getSeekRange():{start:0,end:0}}yc(){const a=this.a;return a&&a.yc?a.yc():null}getVolume(){return this.a?this.a.getVolume():null}setVolume(a){this.a&&this.a.setVolume(a)}getDuration(){return this.a?this.a.getDuration():-1}getAdsManager(){return this.j}namespace(){return this.a&&this.a.namespace()||"Undefined"}getPlaybackRate(){return this.a?
|
|
419
|
+
this.a.getPlaybackRate():1}setPlaybackRate(a,b){this.a&&this.a.setPlaybackRate(a,b)}isMuted(){return this.a&&this.a.isMuted()||!1}setMuted(a){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}Ye(){return Object.freeze(this.o)}getLoadedSource(){return this.a&&this.a.getLoadedSource()}getTimelineCues(){return this.a?
|
|
420
|
+
this.a.getTimelineCues():[]}pd(){return this.a?this.a.pd():null}resetAbr(){this.a&&this.a.resetAbr()}setDrmCustomDataModifier(a){this.sc=a;Ro(this)}setCdnErrorCallback(a){this.B=a;this.a&&this.a.setCdnErrorCallback(this.B)}M(){this.Ld=!0}};_.x("clpp.Player",Q);Q.registerPlugin=_.Ho;Q.prototype.setCdnErrorCallback=Q.prototype.setCdnErrorCallback;Q.prototype.setDrmCustomDataModifier=Q.prototype.setDrmCustomDataModifier;Q.prototype.resetAbr=Q.prototype.resetAbr;Q.prototype.getTimelineCues=Q.prototype.getTimelineCues;
|
|
421
|
+
Q.prototype.getLoadedSource=Q.prototype.getLoadedSource;Q.prototype.getSources=Q.prototype.Ye;Q.prototype.getStats=Q.prototype.getStats;Q.prototype.isLive=Q.prototype.isLive;Q.prototype.getTextDisplayer=Q.prototype.getTextDisplayer;Q.prototype.setNetworkEngine=Q.prototype.setNetworkEngine;Q.prototype.getNetworkEngine=Q.prototype.getNetworkEngine;Q.prototype.isMuted=Q.prototype.isMuted;Q.prototype.setPlaybackRate=Q.prototype.setPlaybackRate;Q.prototype.getPlaybackRate=Q.prototype.getPlaybackRate;
|
|
422
|
+
Q.prototype.namespace=Q.prototype.namespace;Q.prototype.getAdsManager=Q.prototype.getAdsManager;Q.prototype.getDuration=Q.prototype.getDuration;Q.prototype.setVolume=Q.prototype.setVolume;Q.prototype.getVolume=Q.prototype.getVolume;Q.prototype.getTimelineOffset=Q.prototype.yc;Q.prototype.getSeekRange=Q.prototype.getSeekRange;Q.prototype.getPresentationStartTime=Q.prototype.getPresentationStartTime;Q.prototype.seek=Q.prototype.seek;Q.prototype.getPosition=Q.prototype.getPosition;
|
|
423
|
+
Q.prototype.isPaused=Q.prototype.isPaused;Q.prototype.isEnded=Q.prototype.isEnded;Q.prototype.getState=Q.prototype.getState;Q.prototype.getBufferInfo=Q.prototype.getBufferInfo;Q.prototype.getTrackManager=Q.prototype.getTrackManager;Q.prototype.pause=Q.prototype.pause;Q.prototype.play=Q.prototype.play;Q.prototype.remove=Q.prototype.remove;Q.prototype.use=Q.prototype.use;Q.prototype.load=Q.prototype.load;Q.prototype.destroy=Q.prototype.destroy;Q.prototype.release=Q.prototype.release;
|
|
424
|
+
Q.prototype.getDrmInfo=Q.prototype.getDrmInfo;Q.prototype.getConfiguration=Q.prototype.getConfiguration;Q.prototype.getSurface=Q.prototype.getSurface;Q.prototype.getPlugin=Q.prototype.$b;Q.prototype.off=Q.prototype.off;Q.prototype.one=Q.prototype.one;Q.prototype.on=Q.prototype.on;_.Cn=0;_.Dn=1;_.xn=2;_.Fn=3;_.En=4;_.un=5;_.Bn=6;_.Ls=7;_.An={IDLE:_.Cn,PREPARING:_.Dn,BUFFERING:_.xn,PLAYING:_.Fn,PAUSED:_.En,ENDED:_.un,ERROR:_.Bn,UNSET:_.Ls};Q.State=_.An;var Go=[];var Us=class{constructor(a){this.a=a.map(b=>({videoId:b.getSurface().getMedia().id,player:b,ed:!0,ready:Promise.resolve()}));this.h=new _.R("clpp.plist.PlayerPool")}has(){return this.a.some(a=>a.ed)}get(){const a=this;return _.w(function*(){const b=a.a.find(c=>c.ed);if(!b)throw Error("No available players in the pool");b.ed=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.ed=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.h.error("Failed to unload player",
|
|
425
|
+
d)}).then(c)});return b.ready}destroy(){const a=this;return _.w(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};var Vs=class extends _.qs{constructor(a){super();this.o=_.xg({transition:_.Ie,preloadMedia:!1},a);this.g=[];this.a=0;const b=Zo(a.anchorId,this.o.config);this.w=new Us(b);this.f=null;this.j=!1;this.l=new Map;this.A=a.toggleVisible;this.h=new _.R(kd);this.w.a.forEach(c=>$o(this,c.player,!1))}Pc(){return this.f}ub(){return this.f?this.f.player:null}Ve(){return this.l.get(this.a+1)||null}We(){return this.l.get(this.a-1)||null}Qd(){return[this.We(),this.Ve()].filter(Boolean)}Sg(a){if(0<this.g.length)throw Error("Cannot re-set items in the playlist");
|
|
426
|
+
this.h.info("Set items",a);this.g=a.map((b,c)=>({config:b,index:c,preloadPromise:Promise.resolve(),disposers:[]}))}Rg(a){if(0===this.g.length)throw Error(jb);if(0>a||a>this.g.length-1)throw Error("Index out of bounds");this.a=a}Ac(){return this.a<this.g.length-1}$e(){return 0<this.a}Hg(){const a=this;return _.w(function*(){if(a.j)a.h.warn("Cannot play first item while busy");else if(0===a.g.length)a.h.warn(jb);else{a.j=!0;a.h.info(`First (index: ${a.a})`);var b=a.g[a.a];try{a.h.info(`First loading (index: ${a.a})`),
|
|
427
|
+
yield cp(a,b),a.h.info(`First playing (index: ${a.a})`)}catch(c){throw a.h.error(`First failed (index: ${a.a})`),c;}finally{a.j=!1,gp(a)}}})}pf(){const a=this;return _.w(function*(){if(a.j)a.h.warn("Cannot play next item while busy");else if(a.Ac()){a.j=!0;a.a+=1;a.h.info(`Next (index: ${a.a})`);var b=a.f;a.o.transition===_.Ie&&b.player.pause();lp(a,a.a+-2);a.l.delete(a.a);var c=a.g[a.a];try{a.h.info(`Next loading (index: ${a.a})`),yield hp(a,c),a.h.info(`Next playing (index: ${a.a})`)}catch(d){throw a.h.error(`Next failed (index: ${a.a})`),
|
|
428
|
+
d;}finally{a.j=!1,b&&kp(a,b),gp(a)}}else a.h.warn("There are no more items in the playlist")})}Ig(){const a=this;return _.w(function*(){if(a.j)a.h.warn("Cannot play previous item while busy");else if(a.$e()){a.j=!0;--a.a;a.h.info(`Previous (index: ${a.a})`);var b=a.f;a.o.transition===_.Ie&&b.player.pause();lp(a,a.a+2);a.l.delete(a.a);var c=a.g[a.a];try{a.h.info(`Previous loading (index: ${a.a})`),yield hp(a,c),a.h.info(`Previous playing (index: ${a.a})`)}catch(d){throw a.h.error(`Previous failed (index: ${a.a})`),
|
|
429
|
+
d;}finally{a.j=!1,b&&kp(a,b),gp(a)}}else a.h.warn("There are no more previous items in the playlist")})}destroy(){const a=this;return _.w(function*(){a.h.info("Destroy");yield Promise.all([mp(a),a.f?kp(a,a.f):Promise.resolve()]);yield np(a)})}};_.x(kd,Vs);Vs.prototype.destroy=Vs.prototype.destroy;Vs.prototype.playPrev=Vs.prototype.Ig;Vs.prototype.playNext=Vs.prototype.pf;Vs.prototype.playFirst=Vs.prototype.Hg;Vs.prototype.hasPrev=Vs.prototype.$e;Vs.prototype.hasNext=Vs.prototype.Ac;
|
|
430
|
+
Vs.prototype.setIndex=Vs.prototype.Rg;Vs.prototype.setItems=Vs.prototype.Sg;Vs.prototype.getPreloading=Vs.prototype.Qd;Vs.prototype.getPrev=Vs.prototype.We;Vs.prototype.getNext=Vs.prototype.Ve;Vs.prototype.getCurrentPlayer=Vs.prototype.ub;Vs.prototype.getCurrent=Vs.prototype.Pc;var jp="preload",ap=_.ne;var op=new Map;var Ys=class{constructor(a){this.w=a;this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0,remux:!1});this.f=null;this.o=[];this.l=[];this.g=[];this.j=!1;this.a.on("data",b=>{{this.g=b.captions;const c=new Uint8Array(b.data.byteLength+b.initSegment.byteLength);c.set(b.initSegment,0);c.set(b.data,b.initSegment.byteLength);b.type===Ws?this.o.push(c):b.type===Xs&&this.l.push(c)}});this.a.on("done",()=>{{const b={video:_.pi(...this.o),captions:this.g,audio:_.pi(...this.l)};this.f.resolve(b);this.j=
|
|
431
|
+
!1}})}destroy(){this.a&&this.a.dispose();this.a=null;return Promise.resolve()}isSupported(a,b){const c="mp2t"==a.toLowerCase().split(";")[0].split("/")[1],d=a.toLowerCase().split(";")[0]==_.Ec;if(!window.muxjs||!c&&!d)return!1;if(d)return _.pp(Ic);if(b)return _.pp(qp(b,a));b=qp(_.p,a);a=qp(_.u,a);return _.pp(b)||_.pp(a)}isMuxed(a,b){return 1<this.demuxMimeTypes(a,b).size}demuxMimeTypes(a,b){const c=new Map;c.set(a,b);try{const d=b.split(";")[0],e=vj(b).split(","),f=new Map,g=Hh(_.p,e),h=Hh(_.u,e);
|
|
432
|
+
g&&f.set(_.p,this.convertCodecs(_.p,_.uj(d,g)));h&&f.set(_.u,this.convertCodecs(_.u,_.uj(d,h)));return f}catch(d){return c}}convertCodecs(a,b){return b.toLowerCase().split(";")[0]==_.Ec?Ic:"mp2t"==b.toLowerCase().split(";")[0].split("/")[1]?qp(a,b):b}getOriginalMimeType(){return this.w}transmux(a){this.j=!0;this.f=new _.Km;this.o=[];this.l=[];this.g=[];a=_.J(a);this.a.push(a);this.a.flush();this.j&&this.f.reject(new _.H(_.F,3,3018));return this.f}};pj(_.Ec,()=>new Ys(_.Ec));pj(_.Xf,()=>new Ys(_.Xf));
|
|
433
|
+
var Xs=_.p,Ws=_.u;var Zs=class extends _.qs{constructor(a){super();this.o=_.xg({zg:2},a);this.j=[];const b=rp(a.anchorEl,this.o.zg+1,this.o.$f);this.l=new Us(b);this.a=null;this.g=!1;this.f=new Map;this.A=!1;this.w=a.toggleVisible;this.h=new _.R("clpp.interstitial.MultiController");this.l.a.forEach(c=>sp(this,c.player,!1))}getCurrentItem(){return this.a}ub(){return this.a?this.a.player:null}Qd(){return Array.from(this.f.values())}dd(a){this.h.info("Add items",a);this.j=this.j.concat(a.map(b=>Object.assign({},b,{state:"idle",
|
|
434
|
+
disposers:[],preloadPromise:Promise.resolve(),Wc:Promise.resolve()})))}removeItems(a){this.h.info("Remove items",a);a?this.j=this.j.filter(b=>!a.includes(b.id)):this.j=[]}Ac(){return 0<this.f.size}play(a){const b=this;return _.w(function*(){if(b.g)b.h.warn(`Cannot play item while busy (ID: ${a})`);else{var c=b.getItem(a);if(c){b.h.info(`Play item (ID: ${a})`);b.g=!0;var d=b.a;d&&d.player.pause();var e=b.f.has(a);e&&b.f.delete(a);try{b.h.info(`Item loading (ID: ${a})`),e?yield wp(b,c):yield yp(b,c),
|
|
435
|
+
c.gc&&c.gc(),b.trigger(new _.C(ce,{detail:c})),zp(b,c),b.h.info(`Item playing (ID: ${a})`)}catch(f){throw b.h.error(`Item failed (ID: ${a})`),f;}finally{b.g=!1,d&&Bp(b,d),Dp(b),Fp(b,c.next)}}else b.h.warn(`Item not found (ID: ${a})`)}})}load(a){const b=this;return _.w(function*(){if(b.g)b.h.warn(`Cannot load item while busy (ID: ${a})`);else{var c=b.getItem(a);if(c){b.h.info(`Load item (ID: ${a})`);b.g=!0;var d=b.a;d&&d.player.pause();var e=b.f.has(a);e&&b.f.delete(a);try{b.h.info(`Item loading (ID: ${a})`),
|
|
436
|
+
e?b.h.error("Loading preloaded items is not supported"):yield xp(b,c),b.trigger(new _.C(ce,{detail:c})),zp(b,c),b.h.info(`Item loaded (ID: ${a})`)}catch(f){throw b.h.error(`Item failed (ID: ${a})`),f;}finally{b.g=!1,d&&Bp(b,d),Dp(b),Fp(b,c.next)}}else b.h.warn(`Item not found (ID: ${a})`)}})}getItem(a){return this.j.find(b=>b.id===a)||null}release(){const a=this;return _.w(function*(){yield Promise.all([Dp(a),a.a?Bp(a,a.a):Promise.resolve()]);a.a=null;a.g=!1;a.removeItems();up(a,!0)})}destroy(){const a=
|
|
437
|
+
this;return _.w(function*(){a.h.info("Destroy");yield a.release();yield Gp(a)})}};Zs.prototype.destroy=Zs.prototype.destroy;Zs.prototype.release=Zs.prototype.release;Zs.prototype.getItem=Zs.prototype.getItem;Zs.prototype.load=Zs.prototype.load;Zs.prototype.play=Zs.prototype.play;Zs.prototype.hasNext=Zs.prototype.Ac;Zs.prototype.removeItems=Zs.prototype.removeItems;Zs.prototype.addItems=Zs.prototype.dd;Zs.prototype.getPreloading=Zs.prototype.Qd;Zs.prototype.getCurrentPlayer=Zs.prototype.ub;
|
|
438
|
+
Zs.prototype.getCurrentItem=Zs.prototype.getCurrentItem;var Ap="preload",vp=_.ne;var ct=class extends _.qs{constructor(a){super();this.f=_.xg({prerollMarginSec:.5,resolutionOffsetSec:35},a);this.h=new _.R(id);this.l=null;this.a=new Zs({$f:this.f.config,anchorEl:a.anchorEl,preloadMedia:!0});up(this.a,!0);this.a.on(ce,b=>{const c=b.detail;c.primary&&(this.l=c.player.getDuration());this.trigger(new _.C($s,b));Jp(this);c.primary&&Op(this,c.player)});this.g=[];this.a.on(bf,b=>{this.trigger(new _.C(at,{detail:{player:b.detail.player}}))});this.j=[]}load(a){const b=this;return _.w(function*(){yield Qp(b,
|
|
439
|
+
a,!1);b.trigger(new _.C(bt));b.a.getCurrentItem().primary&&b.trigger(new _.C(lq))})}Oc(){const a=this.l;return a?this.j.map(b=>({cueId:b.cueId,startTime:b.startTime,endTime:b.endTime,primaryDuration:a})):[]}yg(a){const b=this;return _.w(function*(){yield Qp(b,a,!0)})}unload(){const a=this;return _.w(function*(){yield a.a.release();a.j=[]})}destroy(){const a=this;return _.w(function*(){yield a.a.destroy()})}ah(){const a=this;return _.w(function*(){yield tp(a.a);a.trigger(new _.C(bt));a.a.getCurrentItem().primary&&
|
|
440
|
+
a.trigger(new _.C(lq))})}getPosition(){const a=this.a.ub();return a?a.getPosition():null}ub(){return this.a.ub()}getCurrentItem(){return this.a.getCurrentItem()}};_.x(id,ct);ct.prototype.getCurrentItem=ct.prototype.getCurrentItem;ct.prototype.getCurrentPlayer=ct.prototype.ub;ct.prototype.getPosition=ct.prototype.getPosition;ct.prototype.unpause=ct.prototype.ah;ct.prototype.destroy=ct.prototype.destroy;ct.prototype.unload=ct.prototype.unload;ct.prototype.loadPaused=ct.prototype.yg;
|
|
441
|
+
ct.prototype.getCues=ct.prototype.Oc;ct.prototype.load=ct.prototype.load;var Xp="new",Yp="preparing",bq="ready",kq="completed",cq="failed",Zp="interstitial-preload-started",$p="x-asset-list-request-started",dq="x-asset-list-request-ended",gq="interstitial-scheduled",iq="interstitial-started",jq="interstitial-ended",hq="interstitial-item-started",at="primary-player-changed",$s="item-changed",bt="playback-started",lq="primary-started",Np="primary-ended",Vp="cues-changed";var U=class{sb(){}tb(){}zb(){}getId(){}getCreativeId(){}getApiFramework(){}getAdSystem(){}getAdvertiserName(){}getTitle(){}getDuration(){}getSkipTimeOffset(){}dc(){}Ib(){}getMediaUrl(){}wb(){}vb(){}jb(){}Wa(){}getPodIndex(){}Jb(){}Kb(){}yb(){}getWrapperAdIds(){}getWrapperAdSystems(){}getWrapperCreativeIds(){}};_.x("clpp.ads.IAd",U);U.prototype.getWrapperCreativeIds=U.prototype.getWrapperCreativeIds;U.prototype.getWrapperAdSystems=U.prototype.getWrapperAdSystems;U.prototype.getWrapperAdIds=U.prototype.getWrapperAdIds;
|
|
442
|
+
U.prototype.getSequenceLength=U.prototype.yb;U.prototype.getPositionInSequence=U.prototype.Kb;U.prototype.getPodTimeOffset=U.prototype.Jb;U.prototype.getPodIndex=U.prototype.getPodIndex;U.prototype.getPodType=U.prototype.Wa;U.prototype.getMediaBitrate=U.prototype.jb;U.prototype.getMediaHeight=U.prototype.vb;U.prototype.getMediaWidth=U.prototype.wb;U.prototype.getMediaUrl=U.prototype.getMediaUrl;U.prototype.getClickThroughUrl=U.prototype.Ib;U.prototype.isBumper=U.prototype.dc;
|
|
443
|
+
U.prototype.getSkipTimeOffset=U.prototype.getSkipTimeOffset;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.getCreativeId=U.prototype.getCreativeId;U.prototype.getId=U.prototype.getId;U.prototype.getTechnology=U.prototype.zb;U.prototype.getAdManagerVersion=U.prototype.tb;
|
|
444
|
+
U.prototype.getAdManagerName=U.prototype.sb;var dt=class{name(){}isSupported(){}create(){}};_.x("clpp.ads.IAdsManagerFactory",dt);dt.prototype.create=dt.prototype.create;dt.prototype.isSupported=dt.prototype.isSupported;dt.prototype.name=dt.prototype.name;var et=class{load(){}start(){}resume(){}pause(){}skip(){}getVolume(){}setVolume(){}getPosition(){}dispose(){}};_.x("clpp.ads.IAdsManager",et);et.prototype.getPosition=et.prototype.getPosition;et.prototype.setVolume=et.prototype.setVolume;et.prototype.getVolume=et.prototype.getVolume;et.prototype.skip=et.prototype.skip;et.prototype.pause=et.prototype.pause;et.prototype.resume=et.prototype.resume;var ft=class{load(){return Promise.resolve()}start(a){return a.play()}resume(){}pause(){}skip(){}getVolume(){return 1}setVolume(){}getPosition(){return-1}dispose(){return _.w(function*(){})}};ft.prototype.dispose=ft.prototype.dispose;ft.prototype.getPosition=ft.prototype.getPosition;ft.prototype.setVolume=ft.prototype.setVolume;ft.prototype.getVolume=ft.prototype.getVolume;ft.prototype.skip=ft.prototype.skip;ft.prototype.pause=ft.prototype.pause;ft.prototype.resume=ft.prototype.resume;
|
|
445
|
+
ft.prototype.start=ft.prototype.start;ft.prototype.load=ft.prototype.load;var Yn=class{name(){return"clpp.ads.NopAdsManagerFactory"}isSupported(){return!0}create(){return new ft}};Yn.prototype.create=Yn.prototype.create;Yn.prototype.isSupported=Yn.prototype.isSupported;Yn.prototype.name=Yn.prototype.name;var gt=class{getCuePoints(){}Lb(){}kb(){}};_.x("clpp.ads.IAdsTimeline",gt);gt.prototype.hasPostroll=gt.prototype.kb;gt.prototype.hasPreroll=gt.prototype.Lb;gt.prototype.getCuePoints=gt.prototype.getCuePoints;_.ht=class{f(){}a(){}g(){}o(){}};var it=class{constructor(){this.j=null;this.h=new _.R("clpp.drm.eme.StandardEmeManager")}l(a){this.j=a}g(a){return this.j?this.j.setMediaKeys(a):Promise.reject(fb)}o(){return this.j&&this.j.mediaKeys}a(a,b){this.h.debug("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=>{c.message&&(c=Error(`${c.message} (keySystem: ${a})`));return Promise.reject(c)})}f(){return yb}};
|
|
446
|
+
Wl(new class{a(){return yb}isSupported(){return!!(window.MediaKeys&&navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)}create(){return new it}},1E3);var kt=class{constructor(){this.size=0;this.a=void 0;this.h=new _.R("clpp.drm.eme.MediaKeyStatusMap")}getStatus(){return this.a}forEach(a){this.a&&a(this.a,jt.value())}get(a){if(this.has(a))return this.a}has(a){const b=jt.value();return this.a&&Oh(a,b)?!0:!1}entries(){}keys(){}values(){}},jt=new _.Ks(()=>Uh(new Uint8Array([0])));var lt=class{l(){}g(a){_.Rg("NopEmeManager.setMediaKeys");return null===a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}o(){return null}a(){_.Rg("NopEmeManager.requestMediaKeySystemAccess");return Promise.reject(Error("The key system specified is not supported."))}f(){return"NOP"}};Wl(new class{a(){return"NOP"}isSupported(){return!0}create(){return new lt}},-1);var nt=class{constructor(){this.j=this.w=null}l(a){this.w=a}g(a){const b=this.j;b&&b!==a&&nq(b,null);return(this.j=a)?nq(a,this.w):Promise.resolve()}o(){return this.j}a(a,b){_.Rg("AppleEmeManager.requestMediaKeySystemAccess");try{const c=new mt(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}f(){return"APPLE"}},mt=class{constructor(a,b){this.keySystem=a;if(a.startsWith(_.pd))for(var c of b){a:{a=c;if(a.persistentState===_.kf){a=null;break a}b={audioCapabilities:[],videoCapabilities:[],
|
|
447
|
+
persistentState:_.Fe,distinctiveIdentifier:_.Fe,initDataTypes:a.initDataTypes,sessionTypes:[Cf],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),
|
|
448
|
+
e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.Yf));a=e?b:null}if(a){this.a=a;return}}c=Error(Mb);c.name=ob;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new ot(this.keySystem);return Promise.resolve(a)}getConfiguration(){_.Rg("AppleEmeManager.MediaKeySystemAccess.getConfiguration");return this.a}},ot=class{constructor(a){this.f=null;this.g=new WebKitMediaKeys(a);this.a=new _.Er;this.j=0;this.h=new _.R(hd);this.h.info("Created Media Keys for "+a)}createSession(a){a=
|
|
449
|
+
void 0===a?Cf:a;this.h.debug("Creating Apple MediaKeys Session");if(a!==Cf)throw new TypeError("Session type "+a+ba);return new pt(this.g,`__session_${this.j++}`)}setServerCertificate(){this.h.debug("AppleEmeManager.MediaKeys.setServerCertificate");return Promise.resolve(!1)}},pt=class extends _.qs{constructor(a,b){super();this.a=null;this.o=a;this.f=this.g=null;this.j=new _.Er;this.sessionId=b;this.expiration=NaN;this.closed=new _.Km;this.l=!1;this.keyStatuses=new kt;this.h=new _.R(hd)}generateRequest(a,
|
|
450
|
+
b){if(this.l)return Promise.reject(Bb);this.h.debug("generateRequest");this.g=new _.Km;try{const c=this.o.createSession(_.Yf,_.J(b));this.a=c;this.sessionId=c.sessionId||this.sessionId||"";this.j.on(c,ig,d=>{{const e=this.keyStatuses.getStatus();this.h.debug(`Received Key Message in ${this.sessionId}`);this.g&&(this.g.resolve(),this.g=null);d=new _.C(_.qe,{messageType:void 0===e||e===wf?ge:fe,message:Uh(d.message.buffer)});this.dispatchEvent(d)}});this.j.on(c,gg,d=>{this.h.debug("onWebkitKeyAdded_",
|
|
451
|
+
d);this.f&&(oq(this,"usable"),this.f.resolve(),this.f=null)});this.j.on(c,hg,()=>{var d=this.keyStatuses.getStatus();if(this.a&&this.a&&this.a.error&&this.a.error.code===WebKitMediaKeyError.MEDIA_KEYERR_DOMAIN&&d===wf)this.h.warn(`Ignoring webkit key error for session ${this.sessionId}`);else if(this.h.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.g)this.g.reject(d),
|
|
452
|
+
this.g=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:oq(this,"output-not-allowed");break;default:oq(this,_.Zd)}});oq(this,wf)}catch(c){this.g.reject(c)}return this.g}load(){this.h.debug("load");return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){if(this.l)return Promise.reject(Bb);this.h.debug(Kf);this.f=new _.Km;try{this.a.update(_.J(a))}catch(b){this.f.reject(b)}return this.f}close(){if(this.l)return this.closed;
|
|
453
|
+
this.h.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.Xg(this.j)}catch(a){this.closed.reject(a)}return this.closed}remove(){this.h.debug("remove");return Promise.reject(Error("MediaKeySession is only applicable for persistent licenses, which are not supported on this platform"))}};Wl(new class{a(){return"APPLE"}isSupported(){return!!window.WebKitMediaKeys}create(){return new nt}},1100);var rt=class{constructor(){this.w=this.j=null;this.A="";HTMLMediaElement.prototype.webkitGenerateKeyRequest&&(this.A="webkit")}l(a){this.j=a}g(a){_.Rg("WebkitEmeManager.setMediaKeys");if(!this.j)return Promise.reject(fb);const b=this.w;b&&b!==a&&rq(b,null);(this.w=a)&&rq(a,this.j);return Promise.resolve()}o(){return this.w}a(a,b){_.Rg("WebkitEmeManager.requestMediaKeySystemAccess");try{if(this.j)var c=this.j;else{var d=document.getElementsByTagName(_.u);c=d.length?d[0]:document.createElement(_.u)}const e=
|
|
454
|
+
new qt(this.A,c,a,b);return Promise.resolve(e)}catch(e){return Promise.reject(e)}}f(){return"WEBKIT"}},qt=class{constructor(a,b,c,d){this.g=a;this.a=this.keySystem=c;a=!1;c===_.Ge&&(this.a=fg,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,
|
|
455
|
+
this.a)&&(f.push(k),e=!0));h||(e=b.canPlayType(_.Yf,this.a)||b.canPlayType("video/webm",this.a));g.persistentState!==_.kf||a||(e=!1);if(e){this.f=g;return}}b=Mb;if(c===_.Ge||c===_.ud)b="None of the requested configurations were supported.";c=Error(b);c.name=ob;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){return Promise.resolve(new st(this.g,this.a))}getConfiguration(){return this.f}},st=class{constructor(a,b){this.g=a;this.o=b;this.a=null;this.f=new _.Er;this.j=[];this.l=new Map}createSession(a=
|
|
456
|
+
Cf){if(a!==Cf&&a!==_.Ke)throw new TypeError("Session type "+a+ba);if(!this.a)throw a=Error("Media element is missing."),a.name=Ya,a.code=DOMException.INVALID_STATE_ERR,a;this.a.src||(this.a.src="about:blank");a=new tt(this.g,this.a,this.o,a);this.j.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}},tt=class extends _.qs{constructor(a,b,c,d){super();this.w=a;this.j=b;this.o=!1;this.a=this.f=null;this.g=c;this.l=d;this.sessionId="";this.expiration=NaN;this.closed=new _.Km;this.keyStatuses=
|
|
457
|
+
new kt}ready(){_.Rg("WebkitEmeManager.MediaKeySession.ready");qq(this,"usable");this.a&&this.a.resolve();this.a=null}generateRequest(a,b){_.Rg("WebkitEmeManager.MediaKeySession.generateRequest");return tq(this,b,null)}load(a){_.Rg(Qb);return this.l===_.Ke?tq(this,null,a):Promise.reject(Error(mb))}update(a){_.Rg(Qb);const b=new _.Km;uq(this,b,a);return b}close(){_.Rg("WebkitEmeManager.MediaKeySession.close");if(this.l!==_.Ke){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),
|
|
458
|
+
this.closed;const a=sq(this,"cancelKeyRequest");try{this.j[a](this.g,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){_.Rg("WebkitEmeManager.MediaKeySession.remove");return this.l!==_.Ke?Promise.reject(Error(mb)):this.close()}};Wl(new class{a(){return"WEBKIT"}isSupported(){return!(!HTMLMediaElement.prototype.webkitGenerateKeyRequest&&!HTMLMediaElement.prototype.generateKeyRequest)}create(){return new rt}});var wt=class extends _.vs{constructor(a,b,c,d,e){super(Xa);this.l=a;this.j=b;this.g=c;this.a=d;this.o=e;this.h=new _.R(gd);_.fi(this.l)?this.h.warn(_.Rb):this.Ma(_.ud,{licenseUrl:this.l,videoRobustness:[_.Ab,void 0],audioRobustness:[_.zb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.Yc.bind(this)}});_.fi(this.j)?this.h.warn(_.pb):this.Ma(_.sd,{licenseUrl:this.j,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.Yc.bind(this)}});
|
|
459
|
+
_.fi(this.g)?this.h.warn(_.Ra):_.fi(this.a)?this.h.warn(_.Qa):this.Ma(_.pd,{licenseUrl:this.g,certificateUrl:this.a,modifiers:{licenseRequest:this.hf.bind(this),licenseResponse:this.jf.bind(this),certificateRequest:this.Yc.bind(this),extractContentId:this.Qe.bind(this)}})}Yc(a,b){a=a.drm.customData.headers||{};for(const c of Object.keys(a))b.headers[c]=a[c]}Qe(a,b){a=pl(b);switch(this.o){case ut:return a;case vt:return(new _.ql(a)).a;default:throw Error("Unknown content ID strategy");}}hf(a,b){b.headers[ra]=
|
|
460
|
+
Ac;this.Yc(a,b);a={spc:_.ji(b.body)};b.body=_.bi(_.Si(a,!0))}jf(a,b){a=_.Wh(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=_.li(a).buffer}};_.x(gd,wt);wt.prototype.onFairPlayLicenseResponse=wt.prototype.jf;wt.prototype.onFairPlayLicenseRequest=wt.prototype.hf;wt.prototype.extractFairPlayContentId=wt.prototype.Qe;wt.prototype.onLicenseRequest=wt.prototype.Yc;wt.prototype.constructor=wt.prototype.constructor;wt.NAME=Xa;
|
|
461
|
+
var vt="hostname",ut="full-skd";wt.FairPlayContentIdStrategy={HOSTNAME:vt,FULL_SKD:ut};_.x("clpp.drm.HeaderDrmComponent",class extends _.ht{g(a){a=a.getConfiguration();if(a.drm&&a.drm&&a.drm.env===Xa){a=a.drm.customData;if(!a)throw new _.H(_.F,7,7100,_.vd);a=new wt(a.widevineLicenseUrl,a.playReadyLicenseUrl,a.fairPlayLicenseUrl,a.fairPlayCertificateUrl,a.fairPlayContentIdStrategy||ut);_.Uk(a)}}a(){delete _.Tk.HeaderDrm}id(){return"headerdrm"}});_.po(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=_.J(c);a=new Uint8Array(this,a,b-a);d.set(a);return c})});_.po(function(){_.Rg("mathRound.install")});_.po(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;Sd in document||(Object.defineProperty(document,Sd,{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",
|
|
462
|
+
{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",vq);document.addEventListener("webkitfullscreenerror",vq);document.addEventListener("mozfullscreenchange",vq);document.addEventListener("mozfullscreenerror",vq);document.addEventListener("MSFullscreenChange",vq);document.addEventListener("MSFullscreenError",vq)}});_.po(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(_.Rg("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=xq,document.exitPictureInPicture=yq,document.addEventListener("webkitpresentationmodechanged",wq,!0))}});_.po(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=zq)}});_.po(function(){if(window.VTTCue)_.Qg("Using native VTTCue.");else if(window.TextTrackCue){var a=TextTrackCue.length;if(3===a)_.Qg(Nb),window.VTTCue=Aq;else if(6===a)_.Qg("Using VTTCue polyfill from 6 argument TextTrackCue."),window.VTTCue=Bq;else{try{var b=!!Aq(1,2,"")}catch(c){b=!1}b&&(_.Qg(Nb),window.VTTCue=Aq)}}else _.Sg("VTTCue not available.")});var Cq;_.po(function(){_.Rg("InputEvent.install");_.Cj("Trident/")&&HTMLInputElement.prototype.addEventListener!==Dq&&(_.Qg("Patching input event support on IE."),Cq=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Dq)});_.po(function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:()=>navigator.language?[navigator.language]:["en"]})});_.po(function(){_.Rg("VideoPlayPromise.install");if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}});var Gq=class{constructor(){this.a=Eq()}};var xt=class{constructor(a,b){b=void 0===b?2:b;this.a=new Uint8Array(a);this.g=b;this.f=0}};_.yt=class{constructor(a,b,c){this.g=a;this.j=b;this.f=c||this.g.getMedia();this.a=null}start(){this.a=new ResizeObserver(a=>{a=a[0];this.j(a.contentRect.width,a.contentRect.height,this.g.isFullscreen())});this.f&&this.a.observe(this.f)}stop(){this.a&&(this.a.disconnect(),this.a=null)}};var zt;_.At=class{constructor(){this.a=new Blob([zt],{type:_.Yf})}canPlay(a){var b=document.createElement(_.u);b.setAttribute("playsinline","playsinline");a&&(b.muted=!0,b.setAttribute("muted","muted"));b.src=URL.createObjectURL(this.a);const c=new _.Km;b=b.play();const d=(new _.zj(()=>{d.stop();c.resolve(a)})).ca(.25);void 0!==b?b.then(()=>{d.stop();c.resolve(!0)}).catch(e=>{e&&e.message&&e.message===ob?(d.stop(),c.resolve(!0)):(d.stop(),c.resolve(!1))}):(d.stop(),c.resolve(!0));return c}};
|
|
463
|
+
zt=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,
|
|
454
464
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
|
|
455
465
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
|
|
456
466
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
|
|
457
467
|
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,
|
|
458
468
|
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,
|
|
459
|
-
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]);_.
|
|
460
|
-
_.
|
|
461
|
-
a;this.g()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.g()}};_.
|
|
462
|
-
_.
|
|
463
|
-
_.
|
|
464
|
-
|
|
465
|
-
_.
|
|
466
|
-
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()}};
|
|
469
|
+
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]);_.Bt=new _.R("clpp.media.TimestampParser");_.Lq={};_.Nq={};var nr=class{constructor(a){this.a=new Uint8Array(a||65536);this.f=0;this.g=new Gq}};var Rq=window.XMLHttpRequest;var mr=class{constructor(a,b){a=void 0===a?1E6:a;b=void 0===b?!0:b;this.j=new xt(a);this.length=a;this.A=b;this.f=this.a=this.g=0;this.l=null;this.o=-1;this.w=new Gq}};var is=class extends _.Rn{constructor(a){super(new _.Km,()=>Promise.resolve());this.B=a;this.g=null;this.w=this.P;this.f=-1;this.j=this.l=this.o=null;cr(this)}then(a,b){this.P=this.P.then(a,b);return this}catch(a){this.P=this.P.catch(a);return this}abort(){if(this.a)return Promise.resolve();this.a=!0;return this.g.then(a=>{this.o&&clearTimeout(this.o);this.l&&this.l();return a.abort()}).catch(()=>{})}};_.Dt=class{constructor(a){this.a=!1;this.g=a;this.j=gr(this);this.g.Hc(this.j);this.f=null}enabled(){return this.a}Ue(){return this.a&&this.f&&this.f.has(Ct)?1E3*this.f.get(Ct):null}release(){this.f=null;this.a=!1;this.g.yd(this.j)}};_.Dt.prototype.getEstimatedThroughput=_.Dt.prototype.Ue;var Ct="etp",er={ih:Ct},fr=new _.R("clpp.net.CmsdManager");var lr=window.fetch,ir=window.AbortController,hr=window.Headers;_.qr={};_.Ft=class{constructor(a){a=a.getConfiguration();a=_.yg(a.textStyle||a.textstyle||{});this.K=typeof a.backgroundColor===_.yf?a.backgroundColor:null;this.U=typeof a.windowColor===_.yf?a.windowColor:null;this.O=typeof a.fontColor===_.yf?a.fontColor:null;this.R=typeof a.fontFamily===_.yf?a.fontFamily:null;this.I=typeof a.fontSize===_.yf?a.fontSize:null;this.C=typeof a.fontSizePercent===_.r?a.fontSizePercent:null;this.H=typeof a.edgeColor===_.yf?a.edgeColor:"rgba(0, 0, 0, 1)";this.w=null;typeof a.edgeType===
|
|
470
|
+
_.yf&&(this.w=a.edgeType)}getBackgroundColor(){return this.K}setBackgroundColor(a){this.K=a;this.g()}getWindowColor(){return this.U}setWindowColor(a){this.U=a;this.g()}getFontFamily(){return this.R}setFontFamily(a){this.R=a;this.g()}getFontColor(){return this.O}setFontColor(a){this.O=a;this.g()}getFontSize(){return this.I}setFontSize(a){this.I=a;this.g()}getFontSizePercent(){return null===this.C?Et:this.C}setFontSizePercent(a){this.C=a;this.g()}getEdgeColor(){return this.H}setEdgeColor(a){this.H=
|
|
471
|
+
a;this.g()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.g()}};_.Ft.prototype.setEdgeType=_.Ft.prototype.setEdgeType;_.Ft.prototype.getEdgeType=_.Ft.prototype.getEdgeType;_.Ft.prototype.setEdgeColor=_.Ft.prototype.setEdgeColor;_.Ft.prototype.getEdgeColor=_.Ft.prototype.getEdgeColor;_.Ft.prototype.setFontSizePercent=_.Ft.prototype.setFontSizePercent;_.Ft.prototype.getFontSizePercent=_.Ft.prototype.getFontSizePercent;_.Ft.prototype.setFontSize=_.Ft.prototype.setFontSize;
|
|
472
|
+
_.Ft.prototype.getFontSize=_.Ft.prototype.getFontSize;_.Ft.prototype.setFontColor=_.Ft.prototype.setFontColor;_.Ft.prototype.getFontColor=_.Ft.prototype.getFontColor;_.Ft.prototype.setFontFamily=_.Ft.prototype.setFontFamily;_.Ft.prototype.getFontFamily=_.Ft.prototype.getFontFamily;_.Ft.prototype.setWindowColor=_.Ft.prototype.setWindowColor;_.Ft.prototype.getWindowColor=_.Ft.prototype.getWindowColor;_.Ft.prototype.setBackgroundColor=_.Ft.prototype.setBackgroundColor;
|
|
473
|
+
_.Ft.prototype.getBackgroundColor=_.Ft.prototype.getBackgroundColor;var Et=1/15;var ur="raised",vr="depressed",xr="dropshadow",wr="uniform";_.x("clpp.text.EdgeType",{NONE:_.xe,RAISED:ur,DEPRESSED:vr,DROP_SHADOW:xr,UNIFORM:wr});_.rr(uc,class{constructor(a){this.f=a;this.a=null;this.h=new _.R("clpp.text.Mp4TextParser")}parseInit(a){let b;try{const c=_.sr(_.vc);c?(b=new c(this.f),b.parseInit(a)):this.h.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=_.sr(_.wc);c?(b=new c(this.f),b.parseInit(a)):this.h.warn("The clpp.vtt.Mp4VttParser class is not available. Please register the vtt component first.")}catch(c){b=null}if(b)this.a=
|
|
474
|
+
b;else throw new _.H(_.F,2,2011);}}parseMedia(a,b){if(!this.a)throw new _.H(_.F,2,2011);return this.a.parseMedia(a,b)}});var Gt;
|
|
475
|
+
_.Ht=class extends _.Ft{constructor(a){super(a);this.o=a.getSurface().getMedia();this.f=`clpp-video-${Gt++}`;this.j=document.createElement(_.Af);this.l=this.A=!1;_.ao(this.o,this.f);document.head.appendChild(this.j);this.g()}append(){}remove(){return!0}isTextVisible(){return this.A}setTextVisibility(a){this.A=a}g(){if(!this.l){var a={"background-color":this.getBackgroundColor(),color:this.getFontColor(),"font-family":this.getFontFamily(),"font-size":this.getFontSize(),"text-shadow":_.yr(this)},b=
|
|
476
|
+
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()}};Gt=0;_.jn("native",new class{isSupported(){return!0}create(a){return new _.Ht(a)}});_.It=class{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;
|