@castlabs/prestoplay 6.23.1 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +116 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +607 -591
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +88 -86
- package/cjs/cl.externs.js +105 -54
- package/cjs/cl.freewheel.js +25 -24
- package/cjs/cl.hls.js +77 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mse.js +352 -342
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +15 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- 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 +491 -478
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -80
- package/cl.externs.js +105 -54
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +79 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +18 -17
- package/cl.mse.js +310 -306
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +60 -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.yospace.js +3 -3
- package/cl.youbora.js +28 -28
- package/package.json +1 -1
- package/typings.d.ts +54 -25
package/cl.core.js
CHANGED
|
@@ -1,339 +1,357 @@
|
|
|
1
|
-
let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,ka,na,sa,ta,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
_.da="#text";_.ea="6.
|
|
5
|
-
wa="
|
|
6
|
-
_.
|
|
7
|
-
kb="No sources provided!";
|
|
8
|
-
Fb="Skipping Session creation. License for init data was already requested in ";_.
|
|
9
|
-
Xb="X-AD-CREATIVE-SIGNALING";_
|
|
10
|
-
_.zc="addtrack";_.
|
|
11
|
-
_.Rc="
|
|
12
|
-
qd="clpp
|
|
13
|
-
_.Kd="
|
|
14
|
-
_.
|
|
15
|
-
_.Oe="
|
|
16
|
-
|
|
17
|
-
_.Jf="
|
|
18
|
-
_.
|
|
19
|
-
_.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Ih=function(a,b){a=a.
|
|
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
|
-
[],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:[...
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
_.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
7100,"config.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
{
|
|
110
|
-
modifiers:g
|
|
111
|
-
_.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
_.
|
|
118
|
-
_.
|
|
119
|
-
_.
|
|
120
|
-
_.
|
|
121
|
-
_.
|
|
122
|
-
a
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
_.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
_.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
_.
|
|
165
|
-
|
|
166
|
-
f.
|
|
167
|
-
|
|
168
|
-
_.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
a.g.debug("
|
|
175
|
-
|
|
1
|
+
let g={}; let _ = {};let f=function(window){'use strict';var ba,ca,ka,na,sa,ta,wa,xa,ya,za,Qa,Ra,Va,Wa,Xa,Ya,Za,ab,bb,fb,hb,jb,kb,lb,mb,nb,pb,qb,ub,yb,Fb,Gb,Jb,Lb,Qb,Rb,Sb,Vb,Wb,Yb,Zb,ic,pc,qc,rc,Lc,Qc,Vc,cd,ed,md,nd,od,qd,rd,sd,td,vd,wd,xd,yd,zd,Ad,Gd,Id,Nd,Td,Ud,Vd,Wd,Yd,ae,be,ee,fe,he,me,te,ve,we,Ge,Ze,ff,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,wf,xf,yf,zf,Af,Bf,Df,Hf,Jf,Yf,ag,gg,sg,vg,Eg,Mg,Qg,Rg,Sg,Tg,Ug,Wg,Xg,Yg,dh,eh,hh,ih,nh,kh,vh,wh,yh,Bh,Dh,Lh,Mh,Nh,Qh,Rh,Ph,Oh,Uh,Sh,Yh,Zh,ci,Xh,di,bi,ei,fi,$h,ai,ii,ni,oi,ji,mi,li,ki,qi,si,ri,ui,vi,wi,xi,Ai,
|
|
2
|
+
Bi,Di,Ei,Ii,Ki,Mi,Gi,Oi,Si,Zi,aj,$i,bj,cj,dj,gj,hj,kj,yj,zj,Cj,Dj,Gj,Ij,Jj,Kj,Lj,Nj,Oj,Pj,Qj,Rj,Sj,Vj,Yj,ck,dk,hk,jk,ek,gk,ik,kk,lk,mk,ok,pk,wk,Hk,Mk,Lk,Yk,Rk,Qk,jl,kl,ml,nl,ol,pl,ql,rl,tl,sl,ul,vl,wl,xl,yl,ll,Al,Cl,El,Hl,Jl,Ol,Pl,Ql,Rl,Sl,Tl,Ul,Vl,cm,dm,jm,sm,um,Am,Em,Gm,Nm,$m,Jm,Vm,fn,gn,hn,kn,ln,mn,pn,nn,on,qn,sn,tn,wn,En,Fn,Nn,Qn,Rn,Tn,Vn,Wn,Yn,On,Un,Zn,$n,ao,bo,lo,eo,mo,co,fo,go,no,so,uo,wo,vo,yo,qo,Go,Do,Fo,Eo,to,Ho,Io,Jo,Ko,Lo,Mo,No,Oo,Uo,Vo,Wo,bp,cp,ep,Zo,Yo,lp,mp,qp,sp,tp,up,pp,wp,xp,yp,
|
|
3
|
+
Cp,Hp,Ip,Jp,Kp,Lp,Mp,Op,Pp,Qp,Rp,eq,$p,gq,hq,iq,jq,Sp,Tp,Wp,Xp,Yp,Zp,aq,bq,cq,dq,rq,sq,fq,tq,pq,oq,uq,mq,qq,kq,xq,yq,zq,Aq,Bq,Eq,Fq,Mq,Nq,Oq,Lq,Vq,Pq,Qq,Rq,Sq,Tq,Uq,Cq,Dq,Gq,Hq,Iq,Xq,$q,Jq,Kq,ar,dr,hr,ir,gr,jr,fr,er,lr,nr,pr,rr,sr,tr,ur,vr,wr,xr,yr,zr,Ar,Br,Fr,Jr,Gr,Lr,Pr,Rr,Tr,Vr,Wr,Xr,Yr,$r,is,as,bs,cs,ds,ks,gs,ls,os,ps,qs,ms,ns,rs,ss,vs,zs,As,Ds,Fs,Gs,Es,Bs,us,ys,ws,xs,Js,Ks,Ls,Ms,Ns,Rs,Ss,Ts,Vs,Ws,Xs,Zs,at,ft,gt,ht,jt,kt,lt,nt,ot,mt,pt,st,rt,qt,wt,vt,Bt,fh,gh;_.aa=" is registered.";ba=" is unsupported on this platform.";
|
|
4
|
+
ca=" to a log level. Falling back to default!";_.da="#text";_.ea="6.25.0";_.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. ";_.la="BANDWIDTH";_.ma="BASIC";na="CHECKSUM";_.oa="CODECS";_.pa="Cannot retrieve buffer information due to platform limitations";_.qa="CastlabsPlayer";_.ra="Configuration is valid";sa="Content-Length";ta="Content-Type";_.ua="Could not find configured DRM environment.";
|
|
5
|
+
wa="DRM licenses loaded";xa="DRMtoday";ya="DRMtodayOnboard";za="Destroying player";_.Aa="EXT-X-BYTERANGE";_.Ba="EXT-X-DATERANGE";_.Ca="EXT-X-DEFINE";_.Da="EXT-X-DISCONTINUITY";_.Ea="EXT-X-DISCONTINUITY-SEQUENCE";_.Fa="EXT-X-ENDLIST";_.Ga="EXT-X-KEY";_.Ha="EXT-X-MAP";_.Ia="EXT-X-MEDIA-SEQUENCE";_.Ja="EXT-X-PART-INF";_.Ka="EXT-X-PLAYLIST-TYPE";_.La="EXT-X-PRELOAD-HINT";_.Ma="EXT-X-PROGRAM-DATE-TIME";_.Oa="EXT-X-SERVER-CONTROL";_.Pa="EXT-X-TARGETDURATION";Qa="Error while decoding string!";Ra="Error while fetching certificate!";
|
|
6
|
+
_.Sa="FairPlay Certificate URL is not defined";_.Ta="FairPlay License URL is not defined";_.Ua="GROUP-ID";Va="HW_SECURE_ALL";Wa="HW_SECURE_CRYPTO";Xa="HW_SECURE_DECODE";Ya="HeaderDrm";Za="InvalidStateError";_.$a="LANGUAGE";ab="License verification failed: ";bb="Load interrupted while a player release is pending";_.cb="Loading player with configuration";_.db="MaxHeight";_.eb="MaxWidth";fb="Missing media element";_.gb="NAME";hb="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";
|
|
7
|
+
jb="No event provided!";kb="No items in the playlist";lb="No sources provided!";mb="No track data attached to the event, unable to add track!";nb="Not a persistent session.";_.ob="Not supported";pb="NotAllowedError";qb="NotSupportedError";_.rb="PLAYLIST";_.sb="POST";_.tb="PlayReady License URL is not defined";ub="Player not ready yet.";_.vb="Player sources";_.xb="Please make sure ";yb="Preloading is not supported by this player.";_.zb="QualityLevel";_.Ab="RESOLUTION";_.Bb="Representation";_.Cb="SW_SECURE_CRYPTO";
|
|
8
|
+
_.Db="SW_SECURE_DECODE";Fb="Session is closed";Gb="Skipping Session creation. License for init data was already requested in ";_.Hb="SmoothStreamingMedia";_.Ib="TYPE";Jb="The index is not in the allowed range.";_.Kb="URI";Lb="Unable to translate ";_.Ob="Unhandled/ignored event";_.Pb="Unregistering listeners";Qb="Unsupported keySystem";Rb="Updating playout limit for interstitial";Sb="Using VTTCue polyfill from 3 argument TextTrackCue.";_.Tb="VIDEO";_.Ub="VOD";Vb="Wait for preloading to finish";
|
|
9
|
+
Wb="WebkitEmeManager.MediaKeySession.load";_.Xb="Widevine License URL is not defined";Yb="Will create EME Manager: ";Zb="X-AD-CREATIVE-SIGNALING";_.$b="X-ASSET-LIST";_.ac="X-ASSET-URI";_.bc="X-PLAYOUT-LIMIT";_.cc="X-RESTRICT";_.gc="X-RESUME-OFFSET";ic="X-TIMELINE-OCCUPIES";_.jc="ad-break-started";_.kc="ad-break-stopped";_.lc="ad-buffering";_.mc="ad-clicked";_.nc="ad-completed";_.oc="ad-first-quartile";pc="ad-hls-asset-list-request";qc="ad-hls-asset-list-response";rc="ad-hls-resoled";_.sc="ad-impression";
|
|
10
|
+
_.tc="ad-loaded";_.uc="ad-midpoint";_.vc="ad-paused";_.wc="ad-progress";_.xc="ad-resumed";_.yc="ad-skipped";_.zc="ad-started";_.Cc="ad-stopped";_.Dc="ad-third-quartile";_.Ec="addtrack";_.Fc="ads-timeline-changed";_.Gc="airplay-casting-ended";_.Hc="airplay-casting-started";_.Ic="airplay-status-changed";_.Jc="application/cea-608";_.Kc="application/dash+xml";Lc="application/mp4";_.Mc='application/mp4; codecs\x3d"stpp"';_.Nc='application/mp4; codecs\x3d"wvtt"';_.Oc="application/ttml+xml";_.Pc="application/vnd.ms-sstr+xml";
|
|
11
|
+
Qc="application/x-www-form-urlencoded";_.p="audio";_.Rc="audio/aac";_.Sc="audio/ac3";_.Tc="audio/eac3";_.Uc="audio/mp4";Vc='audio/mp4;codecs\x3d"mp4a.40.2"';_.Wc="audiobufferchanged";_.Xc="audiotrackchanged";_.Yc="autoplaynotallowed";_.Zc="bitratechanged";_.$c="boolean";_.ad="bufferingended";_.bd="bufferingstarted";cd="canplay";ed="canplaythrough";_.fd="castingstarted";_.id="caststatuschanged";_.jd="cdn-switch-success";_.kd="cenc";_.ld="center";md="certificate-request";nd="change";od="chrome";
|
|
12
|
+
_.pd="clpp-fill";qd="clpp-hidden";rd="clpp-mc-playlist";sd="clpp-visible";td="clpp.PlayerFleet";_.ud="clpp.cast.CastSender";vd="clpp.drm.HeaderDrm";wd="clpp.drm.eme.AppleEmeManager";xd="clpp.drm.eme.EmeFactory";yd="clpp.native.Player";zd="clpp.plist.McPlaylist";Ad="clpp.utils.Platform";_.Bd="codecs";_.Cd="column-reverse";_.Dd="com.adobe.primetime";_.Ed="com.apple.fps";_.Fd="com.apple.hls.interstitial";Gd="com.apple.quicktime.HLS";_.Hd="com.microsoft.playready";Id="com.microsoft.playready.recommendation";
|
|
13
|
+
_.Jd="com.widevine.alpha";_.Kd="config.drm.customData is not defined";_.Ld="content-steering-change";_.Md="content-steering-location-ban-update";Nd="controls";_.Od="cuechange";_.Pd="decoder";_.Qd="destroy()";_.Rd="disabled";_.Sd="div";Td="drm.mediaKeys.end";Ud="drm.mediaKeys.start";Vd="drm.onPlay.end";Wd="drm.onPlay.start";_.Xd="drmexpirationupdate";Yd="drmlicenserequested";ae="drmrenewalstarted";be="drmsessioncreated";_.ce="drmsessionpersisted";_.de="drmsessionupdate";ee="drmtoday";fe="durationchange";
|
|
14
|
+
_.ge="ec-3";he="encrypted";_.ie="end";_.je="ended";_.q="error";_.ke="estimatedThroughputKbps";_.le="forced";me="fullscreenElement";_.ne="function";_.oe="height";_.pe="hidden";_.qe="html";_.re="image";_.se="internal-error";te="keystatuseschange";_.ue="left";ve="license-renewal";we="license-request";_.xe="line-left";_.Be="line-right";_.Ce="live-turned-static";_.De="load";_.Ee="loadeddata";_.Fe="loadedmetadata";Ge="loadstart";_.He="main";_.Ie="mdat";_.Je="mdia";_.Ke="message";_.Le="metadata";_.Me="mimeType";
|
|
15
|
+
_.Ne="minf";_.Oe="moov";_.Pe="mpd-type-changed";_.Qe="mpeg-dash-callback-event";_.Re="none";_.t="number";_.Se="object";_.Te="onBitrateChanged()";_.Ue="onContentLoaded";_.Ve="onPlayerError()";_.We="onPlayerWillDestroy";_.Xe="onPlayerWillRelease";_.Ye="onStateChanged()";Ze="online-status-changed";_.$e="optional";_.af="org.w3.clearkey";_.bf="output-restricted";_.cf="pause";_.df="persistent";_.ef="persistent-license";ff="picture-in-picture";_.gf="play";hf="player.afterLoad.end";jf="player.afterLoad.start";
|
|
16
|
+
kf="player.appendLoad.end";lf="player.appendLoad.start";mf="player.beforeLoad.end";nf="player.beforeLoad.start";of="player.load.end";pf="player.load.start";qf="player.setupPlaylist.end";rf="player.setupPlaylist.start";_.sf="playing";_.tf="playlist-item-changed";_.uf="playlist-modified";wf="playlist.next.end";xf="playlist.next.start";yf="preload-aborted";zf="preload-failed";Af="preloaded";Bf="preloading";_.Cf="prevent";Df="primary-content";_.Ef="progress";_.Ff="px";_.Gf="ratechange";Hf="released";
|
|
17
|
+
_.If="releasing";Jf="removetrack";_.Kf="required";_.Lf="resize";_.Mf="right";_.Nf="sc-playlist-ended";_.Of="sc-playlist-item-changed";_.Pf="sc-playlist-live-turned-static";_.Qf="sc-playlist-timeline-changed";_.Rf="seeked";_.Sf="seeking";_.Tf="showing";_.Uf="simid-creative-started";_.Vf="simid-creative-stopped";_.Wf="sinf";_.Xf="smooth";Yf="stalled";_.Zf="start";_.$f="statechanged";ag="status-pending";_.bg="stbl";_.cg="string";_.dg="stsd";_.eg="style";_.fg="subtitles-htmlcue";gg="temporary";_.hg="text/vtt";
|
|
18
|
+
_.ig="text/xml";_.jg="texttrackchanged";_.kg="timeline-cue-added";_.lg="timeline-cue-enter";_.mg="timeline-cue-exit";_.ng="timeline-cues-changed";_.og="timeupdate";_.pg="tracksadded";_.qg="trak";_.rg="ttml-xml";sg="unauthenticated";_.tg="und";_.ug="unknown";vg="update";_.wg="urn:scte:scte35";_.Ag="urn:scte:scte35:2014";_.Bg="user-seeked";_.Cg="user-seeking";_.Dg="value";Eg="version";_.Fg="vertical-lr";_.Gg="vertical-rl";_.w="video";_.Hg="video/mp2t";_.Ig="video/mp4";_.Jg="videobufferchanged";
|
|
19
|
+
_.Kg="videotrackchanged";_.Lg="vimond-response";Mg="visibilitychange";_.Ng="vtt-xml";_.Og="waiting";_.Pg="waitingforkey";Qg="webkit-org.w3.clearkey";Rg="webkitkeyadded";Sg="webkitkeyerror";Tg="webkitkeymessage";Ug="webkitneedkey";_.Vg="width";Wg="x-dt-csl-tracking-token";Xg="x-dt-follow-up-token";Yg="x-dt-resp-code";_.Zg="yospace-session-ended";_.$g="yospace-session-started";_.ch=function(a){return function(){return _.bh[a].apply(this,arguments)}};
|
|
20
|
+
dh=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};eh=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:dh(a)}};hh=function(a,b){if(b){var c=fh;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&&gh(c,a,{configurable:!0,writable:!0,value:b})}};
|
|
21
|
+
ih=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())})};_.x=function(a){return ih(a())};_.z=function(a,b){a=a.split(".");var c=jh;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};
|
|
22
|
+
_.mh=function(a){return _.B(a)||kh(a)?a:_.lh(a)};_.lh=function(...a){let b={};for(let c=0;c<a.length;c++)null!=a[c]&&(b=nh(b,{merging:a[c]},1));return b.merging||null};_.oh=function(a){for(const b in a)if(void 0!==a[b])return!0;return!1};
|
|
23
|
+
nh=function(a,b,c){const d=c+1;if(_.B(a)||!_.ph(a))a={};for(const e in b)c=b[e],kh(c)||_.B(c)||_.qh(c)||c instanceof Element?a[e]=c:_.ph(c)&&c.buffer&&c.buffer instanceof ArrayBuffer&&_.qh(c.subarray)?a[e]=c.subarray(0):c instanceof Array?a[e]=nh([],c,d):!_.B(c)&&_.rh(c)&&20>d&&(a[e]=nh(a[e],c,d));return a};kh=function(a){a=typeof a;return a===_.cg||a===_.t||a===_.$c};_.B=function(a){return null===a||"undefined"===typeof a};_.ph=function(a){return typeof a===_.Se};
|
|
24
|
+
_.qh=function(a){return typeof a===_.ne};_.sh=function(a){return typeof a===_.cg};_.th=function(a){return typeof a===_.t};_.rh=function(a){if(_.B(a)||!_.ph(a))return!1;a=Object.getPrototypeOf(a);return a===Object.prototype||null===a};
|
|
25
|
+
_.uh=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||!_.ph(a)||!_.ph(b))return!1;const e=c||Object.keys(a),f={};for(let g=0;g<e.length;g++){const h=e[g];if(_.B(d)||0>d.indexOf(h))if(f[h]=!0,a[h]!==b[h])return!1}if(_.B(c))for(a=Object.keys(b),b=0;b<a.length;b++)if(c=a[b],(_.B(d)||0>d.indexOf(c))&&!f[c])return!1;return!0};
|
|
26
|
+
vh=function(a){return(Number.hasOwnProperty("isNaN")?Number.isNaN:b=>b!==b)(a)};wh=function(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b};_.xh=function(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};yh=function(a,b){b=b.toLowerCase();for(const [c,d]of Object.entries(a))if(c.toLowerCase()===b)return d;return null};Bh=function(a){return a&&0<=zh[a]?zh[a]:Ah};
|
|
27
|
+
Dh=function(a){if(!a)return _.C("clpp.log",Lb+a+ca),-1;const b=Ch[a.toUpperCase()];return void 0===b?(_.C("clpp.log",Lb+a+ca),-1):b};_.Fh=function(a){Eh.info.apply(Eh,arguments)};_.Gh=function(a){Eh.debug.apply(Eh,arguments)};_.C=function(a){Eh.warn.apply(Eh,arguments)};_.Hh=function(a){Eh.error.apply(Eh,arguments)};_.Kh=function(a){if(a){var b=a.a();b in _.Ih?_.Jh.warn("Player-Factory '"+b+"' already registered"):(_.Ih[b]=a,_.Jh.info("Registered Player-Factory: '"+b+"'"))}};
|
|
28
|
+
Lh=function(a){return Object.values(_.Ih).find(a)||null};Mh=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};Nh=function(a){return 0>=a?Promise.resolve():new Promise(b=>{setTimeout(()=>{b()},1E3*a)})};Qh=function(a,b){return _.x(function*(){yield Oh(a,()=>Promise.all(Ph(a).map(b)))})};Rh=function(a,b){_.x(function*(){yield Oh(a,()=>Promise.all(a.f.filter(c=>null!=c.getLoadedSource()).map(b)))})};
|
|
29
|
+
Ph=function(a){return[a.xc,...a.f].filter(b=>null!=b)};Oh=function(a,b){return _.x(function*(){a.a&&(yield a.a);a.a=b().then(()=>{a.a=null})})};_.Th=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)Sh(b[c]);a.a.clear()};Uh=function(a,b,c){var d=[he,"msneedkey",Ug,"needkey"];const e=f=>{for(const g of d)a.off(b,g,e);c(f)};for(const f of d)a.on(b,f,e)};Sh=function(a){a.target.removeEventListener(a.type,a.a,a.f);a.target=null;a.a=null};
|
|
30
|
+
Yh=function(a){return Xh(a).filter(b=>b.type===Gd&&!b.Re)};Zh=function(a){a.forEach(b=>{b.Re=!0})};ci=function(a,b){a=a.map(c=>({startTime:c.startTime,endTime:c.endTime,key:c.value.key,value:c.value.data,ag:!1}));a=$h(a);b&&(a=ai(a));return new Set(bi(a))};Xh=function(a){const b=[];for(const c of a)b.push(c);return b};
|
|
31
|
+
di=function(a,b){const c=a.endTime-a.startTime,d=b.endTime-b.startTime,e=a.Jf||a.startTime,f=b.Jf||b.startTime;return(Infinity===c&&Infinity===d||.01>Math.abs(c-d))&&.5>Math.abs(e-f)&&a.value.key===b.value.key&&a.value.data===b.value.data};bi=function(a){const b=[];for(const c of a)(a=b.find(d=>d.startTime===c.startTime&&d.endTime===c.endTime))?ei(c,a):(a=fi(c),b.push(a));return b};
|
|
32
|
+
ei=function(a,b){if(a.key.startsWith("X-"))b.customAttributes||(b.customAttributes={}),b.customAttributes[a.key]=a.value,"X-CUSTOM-ID"===a.key&&(b.id=a.value);else if("SCTE35-OUT"===a.key||"SCTE35-IN"===a.key)b.schemeIdUri=_.Ag,b.type=_.gi};fi=function(a){var b=a.startTime;const c=a.endTime;b={schemeIdUri:"",value:"",startTime:b,endTime:c,id:`T${b.toFixed(2)}-${c.toFixed(2)}`,type:_.hi,eventElement:null};ei(a,b);return b};
|
|
33
|
+
$h=function(a){const b=new Set(a),c=new Set(a.filter(d=>"SCTE35-OUT"===d.key).map(ii));a.filter(d=>"SCTE35-IN"===d.key).forEach(d=>{c.has(ii(d))||(d.ag=!0)});return Array.from(b.values())};ai=function(a){a.forEach(b=>{b.ag&&(b.endTime=b.startTime,b.startTime=0)});return a};ii=function(a){return`${a.startTime}-${a.endTime}`};
|
|
34
|
+
ni=function(a,b){a.g.debug("onMetadataTrackAdded_()");b.mode=_.pe;var c=!b.cues||0===b.cues.length;if(a.m.isLive()||!c){var d=b.cues;c=Yh(d);Zh(c);a.a=ci(c,a.l);0<a.a.size&&(ji(a,a.a),a.m.trigger(new _.D(_.ng)));a.j.on(b,_.Od,()=>{{const l=a.m.getPosition();for(const m of a.a){var e,f=a,g=m,h=l;if(Infinity===g.endTime){if(e=!f.f.has(g)){e=g.startTime;var k=e+.5;e=e<=h&&h<=k}e&&(f.f.add(g),f.m.trigger(new _.D(_.lg,{detail:g})))}else h=g.startTime<=h&&h<=g.endTime,!h&&f.f.has(g)?(f.f.delete(g),f.m.trigger(new _.D(_.mg,
|
|
35
|
+
{detail:g}))):h&&!f.f.has(g)&&(f.f.add(g),f.m.trigger(new _.D(_.lg,{detail:g})))}}});a.m.isLive()&&(a.h=setInterval(()=>{if(b.cues){var e=a.m.getSeekRange().start;var f=[];for(var g of b.cues)g.endTime<e&&f.push(g);ki(a,b,f);0<f.length&&a.g.debug(`Evicted ${f.length} old cues.`);for(var h of a.a)h.endTime<e&&a.a.delete(h);e=0<f.length}else e=!1;li(a,b);f=Yh(d);var k=ci(f,a.l);g=new Set;h=!1;for(l of k)(k=mi(a,l))?(l.customAttributes&&(k.customAttributes=_.lh(k.customAttributes||{},l.customAttributes)||
|
|
36
|
+
void 0),h=!0):(a.a.add(l),g.add(l));var l={Rh:g,Rg:0<g.size||h};const {Rh:m,Rg:n}=l;Zh(f);(e||n)&&a.m.trigger(new _.D(_.ng));ji(a,m)},6E3))}};oi=function(a,b){a.j.on(b,_.Ec,c=>{c=c.track;c.kind===_.Le&&ni(a,c)})};ji=function(a,b){for(const c of b)a.m.trigger(new _.D(_.kg,{detail:c}))};mi=function(a,b){return Array.from(a.a.values()).find(c=>b.startTime===c.startTime&&b.endTime===c.endTime)||null};
|
|
37
|
+
li=function(a,b){if(b.cues){var c=Xh(b.cues).filter(f=>f.type===Gd),d=c.filter(f=>f.Re);c=c.filter(f=>!f.Re);var e=[];for(const f of c)for(const g of d)di(f,g)&&(e.push(f),g.Jf=f.startTime);ki(a,b,e);0<e.length&&a.g.debug(`Removed ${e.length} duplicated cues.`)}};ki=function(a,b,c){for(const d of c)try{b.removeCue(d)}catch(e){a.g.debug("Failed to remove cue",d,e)}};_.pi=function(a){return Array.isArray(a)?a:[a]};qi=function(a,b){return a===b?!0:a.length===b.length&&a.every((c,d)=>c===b[d])};
|
|
38
|
+
si=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 ri(a,b)&&ri(b,a)};ri=function(a,b){const c=new Set(a);return b.every(d=>c.has(d))};_.ti=function(a,b={}){if(b.Hf){const c=[];for(const d of a)c.some(e=>b.Hf(d,e))||c.push(d);return c}return Array.from((new Set(a)).values())};ui=function(a,b){const c=new Set(a),d=new Set(b);return{di:a.filter(e=>!d.has(e)),$i:a.filter(e=>d.has(e)),Og:b.filter(e=>!c.has(e))}};
|
|
39
|
+
vi=function(a,b){b=b.track;b.kind!==_.Le&&(b.mode===_.Tf&&(b.mode=_.pe),a.a.on(b,_.Od,c=>{c=c.target||c.srcElement;c.mode=_.pe;c.activeCues&&(c=Array.from(c.activeCues).map(a.o),a.l.append(c,[]))}))};wi=function(a,b,c,d){a=`${a===_.F?"FATAL":"RECOVERABLE"} Clpp-Error [Category ${b} - Code ${c}]`;if(_.sh(d))a+=": "+d;else if(null!=d)if(null!=d.message)a+=": "+d.message,delete d.message;else try{a+=": "+JSON.stringify(d)}catch(e){}return a};
|
|
40
|
+
xi=function(a,b){const c=b||qi;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)}};_.yi=function(a){return null!=a};Ai=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}throw new _.zi("No non-null, non-undefined value found");};Bi=function(...a){for(let b=0;b<a.length;b++){const c=a[b];if(null!==c&&void 0!==c)return c}};
|
|
41
|
+
_.Ci=function(a){var b;a instanceof _.Ci?(Di(this,a.Ab),this.Bc=a.Bc,this.$a=a.$a,Ei(this,a.Uc),this.Ka=a.Ka,_.Fi(this,Gi(a.a)),this.sc=a.sc):a&&(b=String(a).match(Hi))?(Di(this,b[1]||"",!0),this.Bc=Ii(b[2]||""),this.$a=Ii(b[3]||"",!0),Ei(this,b[4]),this.Ka=Ii(b[5]||"",!0),_.Fi(this,b[6]||"",!0),this.sc=Ii(b[7]||"")):this.a=new _.Ji(null)};Di=function(a,b,c){a.Ab=c?Ii(b,!0):b;a.Ab&&(a.Ab=a.Ab.replace(/:$/,""))};
|
|
42
|
+
Ei=function(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Uc=b}else a.Uc=null};_.Fi=function(a,b,c){b instanceof _.Ji?a.a=b:(c||(b=Ki(b,Li)),a.a=new _.Ji(b))};Ii=function(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""};Ki=function(a,b,c){return typeof a===_.cg?(a=encodeURI(a).replace(b,Mi),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null};Mi=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};_.Ji=function(a){this.f=a||null};
|
|
43
|
+
Gi=function(a){var b=new _.Ji;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.h=a.h}return b};Oi=function(a,b){const c=Ni[a];for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a===_.H?"":null};_.J=function(a,b,c,d){d=void 0===d?{}:d;a=a.getAttribute(b);if(!a&&d.required)throw new _.I(_.F,4,4023,`Required attribute missing: ${b}`);return a?a.value:c||null};
|
|
44
|
+
_.Qi=function(a){var b=(a||"").split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Pi.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a};_.Ri=function(a,b){a=_.Qi(a);b=_.Qi(b);return a.split("-")[0]===b.split("-")[0]};Si=function(a){return a.reduce((b,c)=>b+c,0)};_.Ti=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};
|
|
45
|
+
_.Xi=function(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new _.I(_.F,4,4016,{invalidTag:b});b=c[1];var d=c[2];c=[];let e;if(d){d=new _.Ui(d);var f;(f=_.Ti(d,/^([^,=]+)(?:,|$)/g))&&f[1]&&(e=f[1].trim());const g=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;for(;f=_.Ti(d,g);)c.push(new _.Vi(f[1],f[2]||f[3]||""))}return new _.Wi(a,b,c,e)};_.Yi=function(a,b){for(const c of a)if(!b(c))return!1;return!0};Zi=function*(a){for(let b=0;b<a;b++)yield b};
|
|
46
|
+
aj=function(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!==b.byteLength)return!1;if($i(a)===$i(b)&&(a.byteOffset||0)===(b.byteOffset||0))return!0;const c=_.K(a);b=_.K(b);for(const d of Zi(a.byteLength))if(c[d]!==b[d])return!1;return!0};$i=function(a){return a instanceof ArrayBuffer?a:a.buffer};_.K=function(a,b=0,c=Infinity){return bj(a,b,c,Uint8Array)};
|
|
47
|
+
bj=function(a,b,c,d){const e=d.BYTES_PER_ELEMENT||1,f=$i(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)};cj=function(a,b=0,c=Infinity){return bj(a,b,c,Uint16Array)};dj=function(a,b=0,c=Infinity){return bj(a,b,c,Uint32Array)};_.ej=function(a,b=0,c=Infinity){return bj(a,b,c,Int32Array)};_.fj=function(a,b=0,c=Infinity){return bj(a,b,c,DataView)};
|
|
48
|
+
gj=function(a){return a instanceof ArrayBuffer?a:0===a.byteOffset&&a.byteLength===a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer};hj=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};
|
|
49
|
+
_.ij=function(a){if(!a)return"";a=_.K(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(Qa);return a}a=escape(hj(a));try{return decodeURIComponent(a)}catch(b){throw Error(Qa);}};
|
|
50
|
+
kj=function(a,b,c){if(!a)return"";if(!c&&0!==a.byteLength%2)throw jj.error("Data has an incorrect length, must be even."),Error("Data does not seem to be UTF-16 encoded!");c=_.K(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(_.K(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 hj(c)};
|
|
51
|
+
_.lj=function(a,b){if(_.sh(a))return a;let c="";b=!!b;const d=_.K(a);239===d[0]&&187===d[1]&&191===d[2]?c=_.ij(d):254===d[0]&&255===d[1]?c=kj(d.subarray(2),!1):255===d[0]&&254===d[1]&&(c=kj(d.subarray(2),!0));const e=function(f,g){return f.byteLength<=g||32<=f[g]&&126>=f[g]}.bind(null,d);jj.debug("Unable to find byte-order-mark, making an educated guess.");0===d[0]&&0===d[2]?c=kj(a,!1):0===d[1]&&0===d[3]?c=kj(a,!0):e(0)&&e(1)&&e(2)&&e(3)&&(c=_.ij(a));if(c)return b&&(c=escape(c)),c;throw Error("Unable to detect text encoding");
|
|
52
|
+
};_.mj=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};_.nj=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};
|
|
53
|
+
_.oj=function(a,b){var c=b||1;b=a.length;const d=new ArrayBuffer(b*c);let e;4===c?e=dj(d):2===c?e=cj(d):e=_.K(d);for(c=0;c<b;c++)e[c]=a.charCodeAt(c);return d};_.pj=function(a,b){return String.prototype.startsWith?a.startsWith(b):0===a.indexOf(b)};_.qj=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};_.rj=function(a){return!!(a&&0<a.length)};_.sj=function(a){return!a||0===a.length};
|
|
54
|
+
_.tj=function(a){if(void 0===a||null===a||""===a)return"";try{let b=Number(a);if(vh(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""}};_.vj=function(a){a=a.replace(/<[^>]+>/gi,"");uj.innerHTML=a;a=uj.textContent;return a=a.replace(/<[^>]+>/gi,"")};_.xj=function(){return{maxAttempts:1,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0,fatalStatusCodes:[...wj]}};
|
|
55
|
+
yj=function(a,b){a.timeout=b.timeout;a.baseDelay=b.baseDelay;a.backoffFactor=b.backoffFactor;a.fuzzFactor=b.fuzzFactor;a.maxAttempts=b.maxAttempts;a.fatalStatusCodes=b.fatalStatusCodes||[...wj]};zj=function(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b};
|
|
56
|
+
_.Bj=function(a,b){_.sh(a)&&(a={uris:[a]});Array.isArray(a)&&(a={uris:a});const c={uris:a.uris||[],type:a.type||_.Aj,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||
|
|
57
|
+
[],responseModifiers:a.responseModifiers||[],startTime:a.startTime||null,endTime:a.endTime||null,contentType:a.contentType||null,licenseRequestType:a.licenseRequestType||null,sessionId:null,bytesRemaining:-1,bytesLoaded:-1,bytesTotal:-1,timescale:a.timescale||null,rateLimitBps:a.rateLimitBps||null,disableFragmentSupport:a.disableFragmentSupport||!1,disableMergedFragments:a.disableMergedFragments||!1,fatalStatusCodes:[...wj],requestStartTimestamp:null};a.keyInfo&&(c.keyInfo=a.keyInfo);b&&yj(c,b);return c};
|
|
58
|
+
_.Hj=function(a,b,c,d,e,f,g,h){a={uri:e||d,data:b,headers:a,status:c,timeMs:g,responseStartMs:h,request:f};if(Cj(c))return Dj(a);throw Gj(a);};Cj=function(a){return 200<=a&&299>=a&&202!==a};Dj=function(a){return{uri:a.uri,data:a.data||new ArrayBuffer(0),headers:a.headers,status:a.status,fromCache:!!a.headers["x-shaka-from-cache"],timeMs:a.timeMs,responseStartMs:a.responseStartMs,request:a.request}};
|
|
59
|
+
Gj=function(a){a=Dj(a);try{var b=_.lj(a.data,!0)}catch(d){b=null}_.Gh("HTTP error text:",b);const c=a.request;return new _.I(0<=(c?c.fatalStatusCodes||[]:[]).indexOf(a.status)?_.F:1,1,1001,{url:a.uri,status:a.status,responseText:b,headers:a.headers,request:a.request,response:a})};Ij=function(a,b){b=parseInt(b,10);Number.isNaN(b)&&(b=-1);a.bytesTotal=b;a.bytesLoaded=0;a.bytesRemaining=b};Jj=function(a,b,c){0<a.bytesRemaining&&(a.bytesRemaining-=b);a.bytesLoaded+=b;if(a.onProgress)a.onProgress(b,c)};
|
|
60
|
+
Kj=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()};Lj=function(a,b){a.V.then(()=>b(!0),()=>b(!1));return a};_.Mj=function(a,b){a.a.push(Lj(b,()=>{{var c=a.a;const d=c.indexOf(b);-1<d&&c.splice(d,1)}}))};Nj=function(a,b){return _.x(function*(){const c=yield a.fetch(b);return _.ij(c.data).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")})};
|
|
61
|
+
Oj=function(a,b){return _.x(function*(){const c=yield Nj(a,b);try{const d=JSON.parse(c);if(null==d||typeof d!==_.Se)throw Error("Not an object");return d}catch(d){throw new _.zi("Failed to parse JSON response","json-failed");}})};Pj=function(a,b){for(const c of a.headers){const [d,e]=c;b.headers[d]||(b.headers[d]=e)}};
|
|
62
|
+
Qj=function(a,b){const c=new _.Ci(b.uris[b.uriIndex]);let d=c.Ab;d||(d=location.protocol,d=d.slice(0,-1),Di(c,d),b.uris[b.uriIndex]=c.toString());const e=a.a[d];if(!e)throw new _.I(_.F,1,1E3,{url:c.toString()});return f=>e(f)};Rj=function(a,b,c,d){d=void 0===d?"HEAD":d;return _.x(function*(){if(!navigator.onLine)return!1;if(b){const e=_.Bj(b,c);e.method=d;c||(e.timeout=5E3);e.headers["cache-control"]="no-cache";try{yield a.fetch(e).V}catch(f){if(1002===f.code||1003===f.code)return!1}}return!0})};
|
|
63
|
+
Sj=function(a){return`@@scheme:${a.scheme||""}`+`@@value:${a.value}`+`@@id:${a.id||""}@@type:${a.type||""}`+`@@protocol:${a.protocol||""}`};_.Tj=function(a){return a&&a!==_.tg?a:null};
|
|
64
|
+
Vj=function(a){if(!a)throw new _.I(_.F,3,3101,`Invalid track type: ${a}`);if(!_.sh(a))throw new _.I(_.F,3,3101,`Invalid track type: ${a}. Track type must be a string!`);switch(a.toLowerCase()){case _.L:return _.L;case _.M:return _.M;case _.N:return _.N;case Uj:return Uj}throw new _.I(_.F,3,3101,`Unknown track type: ${a}.`);};
|
|
65
|
+
Yj=function(a,b){a=Vj(a);const c=_.Tj(b.kind);let d=b.id;d||(d=String(_.Wj++));a=new _.Xj(d,c===_.Le?Uj:a);a.kind=c;a.label=_.Tj(b.label);a.language=_.Tj(b.language);a.originalLanguage=b.originalLanguage||a.language;return a};_.Zj=function(a){return`${a.scheme}//`+`${a.a}${a.port?":"+a.port:""}${a.path}${a.h}${a.f}`};
|
|
66
|
+
_.ak=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)},""):""};_.bk=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};
|
|
67
|
+
ck=function(a,b){return a.startsWith("http:://")||a.startsWith("https:://")?a:(new URL(a,b)).toString()};dk=function(a,b){return _.x(function*(){const c=_.Bj(b);return yield Nj(a.f,c)})};hk=function(a,b,c){return _.x(function*(){const {mimeType:d,renditions:e}=yield ek(a,b,c),f=new _.Xj("dummy",_.N),g=e.map((h,k)=>{k=new _.fk(`R${k}`,f);k.bandwidth=h.bandwidth;k.Wc=h.Wc;k.codec=h.codec;k.width=h.width;k.height=h.height;return k});gk(g);return{renditions:g,mimeType:d||void 0}})};
|
|
68
|
+
jk=function(a){a=a.split("\n").filter(c=>c.trim().startsWith("#EXT-X-MEDIA:")).map(c=>ik(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};ek=function(a,b,c){return _.x(function*(){const d=kk(b),e=lk(b,c);return{mimeType:yield mk(a,e,d[0]?d[0].codec:null),renditions:d}})};
|
|
69
|
+
gk=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.");};ik=function(a){const b=_.Xi(0,a);a=d=>(d=b.getAttribute(d))?d.value:void 0;var c=a(_.Ib);c=null!=c?{AUDIO:_.M,VIDEO:_.N,SUBTITLES:_.L}[c]:void 0;return{type:c,groupId:a(_.Ua),name:a(_.gb),language:a(_.$a),Ki:a("AUTOSELECT"),default:a("DEFAULT"),Si:a("FORCED"),Gf:a("CHARACTERISTICS"),uri:a(_.Kb)}};
|
|
70
|
+
kk=function(a){return a.split("\n").filter(b=>b.trim().startsWith("#EXT-X-STREAM-INF:")).map(b=>{var c=_.Xi(0,b);if(c.getAttribute(_.Tb))throw Error("Playlist contains alternative video streams.");var d=_.J(c,_.Ab);b=d?Number(d.split("x")[0]):null;d=d?Number(d.split("x")[1]):null;var e=_.J(c,_.la);e=e?Number(e):null;var f=_.J(c,"AVERAGE-BANDWIDTH");f=f?Number(f):null;c=_.J(c,_.oa);c=_.nk(_.w,c?c.split(","):[]);return b={bandwidth:e,Wc:f,codec:c,width:b,height:d,mimeType:null}})};
|
|
71
|
+
lk=function(a,b){return(a=a.split("\n").filter(c=>c.trim().endsWith(".m3u8"))[0])?ck(a,b):null};mk=function(a,b,c){return _.x(function*(){if(!b||!c)return null;var d=yield dk(a,b);d=[ok(d,b),pk(d,b)].filter(Boolean);return _.qk(d,_.w,c)})};ok=function(a,b){return(a=a.split("\n").find(c=>!c.startsWith("#")&&0<c.trim().length))?ck(a,b):null};pk=function(a,b){a=a.split("\n").find(c=>c.startsWith("#EXT-X-MAP:"));return a?(a=_.J(_.Xi(0,a),_.Kb))?ck(a,b):null:null};
|
|
72
|
+
_.sk=function(a,b,c){for(const d of _.rk)if(d.probe(b,c))return d.create(a);return null};_.tk=function(a){a=_.rk.indexOf(a);0<=a&&_.rk.splice(a,1)};wk=function(a,b){var c=uk;vk.set(`${a.toLowerCase().split(";")[0]}-${c}`,{priority:c,plugin:b})};_.Ak=function(a,b){var c=[xk,yk,zk,uk];for(const d of c)if(c=vk.get(`${a.toLowerCase().split(";")[0]}-${d}`)){const e=c.plugin(),f=e.isSupported(a,b);e.destroy();if(f)return c.plugin}return null};
|
|
73
|
+
_.Bk=function(a,b){b&&(a+=';codecs\x3d"'+b+'"');return a.replace(/\s/g,"")};_.Ck=function(a){return a.split(";")[0]};_.Dk=function(a){a=a.split(/\s*;\s*/);a.shift();return(a=a.find(b=>b.startsWith("codecs\x3d")))?a.split("\x3d")[1].replace(/^"|"$/g,"").split(/\s*,\s*/).join(","):""};Hk=function(){if(Ek)return Ek;Fk||(Fk=new _.Gk(()=>{Ek=null}));(Ek=document.querySelector(_.w)||document.querySelector(_.p))||(Ek=document.createElement(_.w));Fk.ia(1);return Ek};_.Ik=function(){return!!navigator.userAgent.match(/Edge?\//)};
|
|
74
|
+
_.Jk=function(a){return(navigator.userAgent||"").includes(a)};_.Kk=function(a){return _.Jk("Tizen"+(a?" "+String(a):""))};Mk=function(a){const b={major:-1,name:_.ug};if(!a)return b;var c=a.replace(/_/g,".");b.name=c;c=c.split(".");1<=c.length&&(b.major=Lk(a,c[0]));2<=c.length&&(b.minor=Lk(a,c[1]));3<=c.length&&(b.patch=Lk(a,c[2]));4<=c.length&&(b.build=Lk(a,c[3]));return b};_.Nk=function(){return _.Jk("Web0S")};_.Pk=function(){return _.Nk()&&79===_.Ok().major};
|
|
75
|
+
_.Ok=function(){const a=Qk();const b=["ie","edge","opera","firefox","safari",od];var c=Rk();const d=Sk[c];for(let e=0,f=b.length;e<f;e++)if(c=d[b[e]]&&a.match(d[b[e]]))return Mk(c[1]);return Mk("")};_.Tk=function(){return _.Jk("CrKey")};_.Uk=function(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!_.Kk()};_.Vk=function(){return/(?:iPhone|iPad|iPod|Android)/.test(navigator.userAgent)?!0:_.Uk()&&1<navigator.maxTouchPoints};_.Wk=function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)};
|
|
76
|
+
Lk=function(a,b){try{return parseInt(b,10)}catch(c){Xk.warn("Unable to parse version number for '"+b+"' from '"+a+"'")}return-1};Yk=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};
|
|
77
|
+
Rk=function(){const a=Qk();if(!a)return Zk;var b=a.match(/^.+?(?=\))/);if(!b)return Zk;b=b[0];if(Yk(b,["iphone","ipad"]))return $k;if(Yk(b,["android"]))return al;if(Yk(b,["macintosh"]))return bl;if(Yk(b,["windows nt"]))return dl;if(Yk(b,["tizen"]))return el;if(Yk(b,["web0s"]))return fl;if(Yk(b,["linux"]))return gl;Xk.warn("Unable to identify OS from user agent: "+a);return Zk};Qk=function(){let a=window.navigator.userAgent;return a=a.toLowerCase()};
|
|
78
|
+
_.il=function(){var a=Rk();var b=Rk();var c=Sk[b];if(c){c=Qk().match(c.os_version)[1];c=Mk(c);if(b===dl)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=Mk("");a:{c=Qk();const e=["ie","edge","opera","firefox","safari",od];var d=Rk();d=Sk[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=hl}return{os:a,osVersion:b,browser:c,browserVersion:_.Ok()}};
|
|
79
|
+
jl=function(a,b,c){return a.type!==c?!1:void 0!==b.id&&null!==b.id&&""!==b.id?a.id===b.id:_.uh(a,{kind:_.Tj(b.kind),language:_.Tj(b.language),label:_.Tj(b.label)},["kind","language","label"])};kl=function(a){return a.enabled||a.selected||a.mode===_.Tf||a.mode===_.pe};ml=function(a,b,c){return ll(a)&&b===_.N&&!!c.enableHlsVideoTrackInfo};
|
|
80
|
+
nl=function(a,b,c){return _.x(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})))})};ol=function(a,b,c){return ll(a)&&(b===_.M||b===_.L)&&!!c.enableMetadata};
|
|
81
|
+
pl=function(a,b,c){return _.x(function*(){var d=a.m.getLoadedSource();d&&a.j&&(d=yield a.j.a(d.url,c),d.zc&&(d=d.zc.get(`${b.type}:${b.label}`))&&d.Gf&&(b.accessibility=d.Gf.split(",").map(e=>e.trim()).map(e=>({value:e,type:b.type,protocol:"HLS"}))))})};ql=function(a,b){return a.h.filter(c=>c.type===b)};rl=function(a){(a=a.m.getTextDisplayer())&&a.remove(0,Infinity)};tl=function(a,b){if(a=sl(a,b))a=Array.from(a),b===_.L&&(a=a.filter(c=>c.kind!==_.Le));return a};
|
|
82
|
+
sl=function(a,b){if(!a.m)return null;a=a.m.getSurface();if(!a)return null;a=a.getMedia();if(!a)return null;switch(b){case _.M:return a.audioTracks;case _.N:return a.videoTracks;case _.L:return a.textTracks;default:return null}};ul=function(a,b){return(a=a.a.get(b)||null)&&a.renditions[0]};vl=function(a,b){return(a=a.l.get(b))&&a.renditions[0]};
|
|
83
|
+
wl=function(a,b,c){const d=tl(a,b);if(c){if(void 0===a.h.find(f=>f.id===c.id))throw Error(`Unknown track with ID ${c.id} and type ${b}`);if(c.type!==b)throw Error(`Types mismatch for track ${c.type} and arg ${b}`);a.g.debug("Activate track type "+b+" with ID: "+c.id);if(d){a.l.set(b,c);let f;var e=!0;let g=!1;switch(b){case _.L:f="mode";e=_.Tf;g=_.Rd;break;case _.M:f="enabled";break;case _.N:f="selected"}if(f)for(const h of d)h[f]=jl(c,h,c.type)?e:g}}else if(a.g.debug("Disable track type "+b),a.a.get(b)&&
|
|
84
|
+
d&&b===_.L){for(e of d)e.mode=_.Rd;a.a.set(b,null)}b===_.M?a.m.trigger(new _.D(_.Xc)):b===_.L&&a.m.trigger(new _.D(_.jg))};xl=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=_.sj(b.url)?URL.createObjectURL(new Blob([])):b.url;d.appendChild(e);a.I.push(e)}}};
|
|
85
|
+
yl=function(a,b){return _.x(function*(){var c=a.m.getConfiguration(),d=_.sk(c,b.mimeType,_.hg);if(d){c=_.Bj(b.url);var e=yield a.m.getNetworkEngine().fetch(c).V;e&&e.data&&(c="External_"+`${a.G++}`,a.o[c]=b,d=d.a(_.K(e.data)),d={url:URL.createObjectURL(new Blob([d])),kind:b.kind,language:b.language,label:b.label,mimeType:_.hg},xl(a,d,c))}else a.g.warn("Track MIME type is not supported",b)})};ll=function(a){a=a.m.getLoadedSource();return!(!a||a.type!==_.zl&&!a.url.endsWith(".m3u8"))&&_.Uk()};
|
|
86
|
+
Al=function(a,b,c){c=_.pi(c).filter(e=>e);a.g.info("Find preferred tracks for",b,c);const d=ql(a,b);c.some(e=>{const f=_.Qi(e);return(e=d.find(g=>{g=_.Qi(g.language||"");return _.Ri(f,g)}))?(a.g.info("Will select track with id",e.id),wl(a,b,e),!0):!1})};Cl=function(a){return a.name===pb&&Bl.some(b=>a.message.startsWith(b))};
|
|
87
|
+
_.Gl=function(){var a=Infinity;navigator.connection&&navigator.connection.saveData&&_.Vk()&&(a=360);const b=_.xj();b.maxAttempts=3;a={source:"",license:Dl,viewerId:void 0,autoplay:void 0,pauseWhenInBackground:!1,ads:{hls:{enable:!0,resolutionOffsetSec:35}},manifest:{attemptParameters:_.xj(),availabilityWindowOverride:NaN,clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,autoCorrectDrift:!0,timeline:{version:1,type:void 0}},abr:{enabled:!0,defaultBandwidthEstimate:1E3,switchInterval:8,bandwidthUpgradeTarget:.85,
|
|
88
|
+
bandwidthDowngradeTarget:.95,useSwitchIntervalForInitialSwitch:!1,restrictions:El(a),useCmsd:!0},contentSteering:{enabled:!0,attemptParameters:_.xj()},drm:null,enableHtmlCue:!0,preferredAudioLanguage:"",preferredTextLanguage:"",preferredAudioRole:_.He,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,
|
|
89
|
+
xmlParser:_.Fl,streaming:{attemptParameters:b,bufferingGoal:10,rebufferingGoal:2,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,relativeTextTimestamp:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.1,disableAudioTracks:!1,disableVideoTracks:!1,smallGapLimit:.5,jumpLargeGaps:!0,gapTolerance:.001,durationBackoff:1,maxSegmentToMediaOffset:1,forceNativeTS:!1,preferNativeHlsOnSafari:!0,safeSeekOffset:5,stallEnabled:!0,stallThreshold:3,stallSkip:.5,bufferLimitUpdateInterval:.5,overridePasp:!1,
|
|
90
|
+
enableLiveEdgeChasing:!1,chasingRate:1.15,startChasingAt:5,stopChasingAt:2,chaseJumpDistance:10,patchEdgeWhenMixedContent:!1,ignoreDrift:!1,disableFragmentSupport:!1,disableMergedFragments:!1,ignoreManagedMediaSourceStreamingHints:!1},mediaSource:{codecSwitchingStrategy:_.Cf},restrictions:El(),tizen:{sideStreamText:_.Kk(2)},safari:{enableHlsVideoTrackInfo:!1,enableMetadata:!1},mse:{sendPlaybackSessionIdHeader:!1},trickPlay:{speedUpMode:_.Pd,preferTrickPlayTracks:!0},playlist:{timeline:"basic",content:_.Ub,
|
|
91
|
+
cropTimeline:!1},yospace:{enabled:!1}};if(_.Kk()||_.Nk())a.ads.hls.enable=!1;if(_.Jk("Edge/")||_.Kk())a.streaming.gapDetectionThreshold=.5;_.Nk()&&(a.streaming.stallEnabled=!1);_.Pk()&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=1,a.streaming.gapDetectionThreshold=.02);_.Kk()&&(a.streaming.stallEnabled=!0,a.streaming.stallThreshold=1,a.streaming.stallSkip=0);a.vr={enable:!1,attachMouseListener:!0,fieldOfView:70,sensitivity:1,invertHorizontalControl:!1,invertVerticalControl:!1};
|
|
92
|
+
return a};El=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}};
|
|
93
|
+
_.Il=function(...a){if(!a)return _.Gl();var b=[_.Gl()];let c=!1;for(let d of a)null!==d&&void 0!==d&&(_.sh(d)&&(d={source:d}),d.lowLatencyMode&&!c&&(b.push({streaming:{rebufferingGoal:.1,bufferLimitUpdateInterval:.01,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}}));
|
|
94
|
+
a=_.lh.apply(null,b);_.sh(a.volume)&&(""===""+a.volume?a.volume=null:a.volume=Number(a.volume));if(!_.B(a.volume)&&(!_.th(a.volume)||vh(a.volume)))throw new _.I(_.F,7,7100,"config.volume is not a number");if(!_.B(a.preferredTextLanguage)&&!_.sh(a.preferredTextLanguage)&&!Array.isArray(a.preferredTextLanguage))throw new _.I(_.F,7,7100,"config.preferredTextLanguage is not a string or an array");if(!_.B(a.preferredAudioLanguage)&&!_.sh(a.preferredAudioLanguage)&&!Array.isArray(a.preferredAudioLanguage))throw new _.I(_.F,
|
|
95
|
+
7,7100,"config.preferredAudioLanguage is not a string or an array");if(!_.B(a.preferredAudioCodec)&&!_.sh(a.preferredAudioCodec)&&!Array.isArray(a.preferredAudioCodec))throw new _.I(_.F,7,7100,"config.preferredAudioCodec is not a string or an array");if(!_.B(a.preferredVideoCodec)&&!_.sh(a.preferredVideoCodec)&&!Array.isArray(a.preferredVideoCodec))throw new _.I(_.F,7,7100,"config.preferredVideoCodec is not a string or an array");if(!_.B(a.drm)){if(a.drm.env&&!_.sh(a.drm.env))throw new _.I(_.F,7,
|
|
96
|
+
7100,"config.drm.env is not a string");if(a.drm.offlineId&&!_.sh(a.drm.offlineId))throw new _.I(_.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(!_.th(b.bufferingGoal)||vh(b.bufferingGoal))throw new _.I(_.F,7,7100,"config.streaming.bufferingGoal is not a number");if(!_.th(b.rebufferingGoal)||
|
|
97
|
+
vh(b.rebufferingGoal))throw new _.I(_.F,7,7100,"config.streaming.rebufferingGoal is not a number");if(b.rebufferingGoal>b.bufferingGoal)throw new _.I(_.F,7,7100,"config.streaming.rebufferingGoal must be \x3e\x3d bufferingGoal");if(!_.th(b.bufferBehind)||vh(b.bufferBehind))throw new _.I(_.F,7,7100,"config.streaming.bufferBehind is not a number");if(!_.th(b.smallGapLimit)||vh(b.smallGapLimit))throw new _.I(_.F,7,7100,"config.streaming.smallGapLimit is not a number");if(!_.th(b.durationBackoff)||vh(b.durationBackoff))throw new _.I(_.F,
|
|
98
|
+
7,7100,"config.streaming.durationBackoff is not a number");b=a.manifest;if(_.B(b.availabilityWindowOverride))b.availabilityWindowOverride=NaN;else if(typeof b.availabilityWindowOverride!==_.t)throw new _.I(_.F,7,7100,"Invalid value for |manifest.availabilityWindowOverride|");Hl(a.restrictions);Hl(a.abr.restrictions);a.abr.initialRestrictions&&Hl(a.abr.initialRestrictions)}return a};
|
|
99
|
+
Hl=function(a){_.B(a.maxPixels)&&(a.maxPixels=Infinity);_.B(a.maxBandwidth)&&(a.maxBandwidth=Infinity);_.B(a.maxHeight)&&(a.maxHeight=Infinity);_.B(a.maxWidth)&&(a.maxWidth=Infinity);_.B(a.minPixels)&&(a.minPixels=0);_.B(a.minBandwidth)&&(a.minBandwidth=0);_.B(a.minHeight)&&(a.minHeight=0);_.B(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);
|
|
100
|
+
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 _.I(_.F,7,7100,"Restrictions contain NaN");};Jl=function(a){return typeof a===_.Se&&!Array.isArray(a)&&"source"in a};_.Ll=function(a){return _.Kl.get(a)||null};
|
|
101
|
+
_.Nl=function(a){_.Kl.get(a.id())?Ml.warn("Component already in use."):_.Kl.set(a.id(),a)};Ol=function(a){return Array.from(_.Kl.values()).find(b=>b instanceof a)||null};Pl=function(a){for(const b of _.Kl.values())a(b)};Ql=function(a){Pl(b=>{b.o(a)})};Rl=function(a){Pl(b=>{b.h(a)})};Sl=function(){Pl(()=>{})};Tl=function(){Pl(()=>{})};Ul=function(a){if(null!==Ol(a))return null;a=new a;a.f();_.Nl(a);Ml.info("Installed component:",a.id());return a};
|
|
102
|
+
Vl=function(a){if(a=Ol(a))a.a(),_.Kl.delete(a.id()),Ml.info("Uninstalled component:",a.id())};_.Xl=function(a,b=!0){a=_.Wl(a).replace(/\+/g,"-").replace(/\//g,"_");return b?a:a.replace(/[=]*$/,"")};_.Wl=function(a){a=hj(_.K(a));return btoa(a)};_.Yl=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};
|
|
103
|
+
_.Zl=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};_.$l=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};_.am=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};
|
|
104
|
+
_.bm=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};cm=function(a,b){3===b.type&&(a.f&&(a.g.debug("Attaching tracking token"),b.headers[Wg]=a.f),a.a&&(b.headers[Xg]=a.a))};
|
|
105
|
+
dm=function(a,b){return b.request&&3===b.request.type&&(a.f=b.headers[Wg],a.a=b.headers[Xg],b=b.headers["x-dt-csl-renewal-info"],a.f&&a.g.debug("Loaded tracking token "+a.f),a.a&&a.g.debug("Loaded followup token "+a.a),b)?(a=JSON.parse(_.ij(_.Yl(b))),{delay:a.renewalPeriod,Gi:{maxAttempts:a.retryCount,baseDelay:1E3*a.retryPeriod,backoffFactor:1,fuzzFactor:0,timeout:0}}):null};_.fm=function(a){_.em[a.I]=a};
|
|
106
|
+
_.hm=function(a){const b={attemptParameters:_.xj(),enforceSingleSession:!1,delayLicenseRequestUntilPlayed:!1,enableSessionCacheForSkd:!1,ignoreUnrecognizedInitData:!0,Na:{},widevineVersion:_.Jd};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!==
|
|
107
|
+
a.ignoreUnrecognizedInitData&&(b.ignoreUnrecognizedInitData=!!a.ignoreUnrecognizedInitData),typeof a.widevineVersion===_.cg&&0<a.widevineVersion.length&&(b.widevineVersion=a.widevineVersion),a.env)){const c=_.em[a.env]||null;if(!c)throw _.Gh(_.ua,_.xb+a.env+_.aa),new _.I(_.F,6,6015,`DRM environment '${a.env}' is missing.`);b.Na=_.gm(c,a.customData)||{};_.pj(a.env.toLowerCase(),ee)&&(b.enforceSingleSession=!0)}return b};
|
|
108
|
+
jm=function(a){a=im[a];if(!a)return null;const b=_.il();return b.os===al&&4===b.osVersion.major&&4===b.osVersion.minor?null:new Uint8Array(a)};
|
|
109
|
+
_.gm=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[_.Jd];if(g){var h=g.licenseUrl;d=Bi(d,g.videoRobustness);e=Bi(e,g.audioRobustness);var k=g.modifiers,l=Ai(b?b.widevineDistinctiveIdentifierRequired:void 0,g.distinctiveIdentifierRequired,!1),m=Ai(b?b.widevinePersistentStateRequired:void 0,g.persistentStateRequired,!1);g=void 0===f?g.serverCertificate:null===f?null:typeof f===_.cg?jm(f):f;c[_.Jd]=
|
|
110
|
+
{licenseUrl:h,videoRobustness:d,audioRobustness:e,modifiers:k,distinctiveIdentifierRequired:l,persistentStateRequired:m,serverCertificate:g}}(g=a.f[_.Ed])&&(c[_.Ed]={licenseUrl:g.licenseUrl,certificateUrl:g.certificateUrl,modifiers:g.modifiers});h=b?b.playReadyVideoRobustness:void 0;b=b?b.playReadyAudioRobustness:void 0;(g=a.f[_.Hd])&&(c[_.Hd]={licenseUrl:g.licenseUrl,videoRobustness:h||g.videoRobustness,audioRobustness:b||g.audioRobustness,individualizationServer:g.individualizationServer,useLegacySystem:g.useLegacySystem,
|
|
111
|
+
modifiers:g.modifiers});return c};_.km=function(){throw new _.I(_.F,3,3E3);};_.lm=function(a,b,c){const d=c||0;c=b.byteLength-d;const e=_.K(a.f.buffer);b=_.K(b.buffer,d,c);try{e.set(b,a.a),a.a+=c}catch(f){_.km()}};_.O=function(a,b){try{a.f.setUint32(a.a,b,a.h),a.a+=4}catch(c){_.km()}};_.mm=function(a){return a.a<a.f.byteLength};_.nm=function(){throw new _.I(_.F,3,3E3,"Buffer read out of bounds.");};_.om=function(a){try{const b=a.f.getUint8(a.a);a.a+=1;return b}catch(b){_.nm()}};
|
|
112
|
+
_.pm=function(a){try{const b=a.f.getUint16(a.a,a.h);a.a+=2;return b}catch(b){_.nm()}};_.P=function(a){try{const b=a.f.getUint32(a.a,a.h);a.a+=4;return b}catch(b){_.nm()}};_.qm=function(a){try{const b=a.f.getInt32(a.a,a.h);a.a+=4;return b}catch(b){_.nm()}};_.rm=function(a){let b=0,c=0;try{!0===a.h?(b=a.f.getUint32(a.a,!0),c=a.f.getUint32(a.a+4,!0)):(c=a.f.getUint32(a.a,!1),b=a.f.getUint32(a.a+4,!1))}catch(d){_.nm()}if(2097151<c)throw new _.I(_.F,3,3001);a.a+=8;return c*Math.pow(2,32)+b};
|
|
113
|
+
sm=function(a,b){const c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=_.om(a);return c};_.tm=function(a,b){a.a+b>a.f.byteLength&&_.nm();var c=a.a+a.f.byteOffset;c=a.f.buffer.slice(c,c+b);a.a+=b;return _.K(c)};um=function(a){let b=0;for(let c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};_.vm=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};_.wm=function(a){for(;_.mm(a.reader)&&!a.parser.a;)a.parser.ee(a.start+a.headerSize,a.reader,a.partialOkay)};
|
|
114
|
+
_.xm=function(a){for(let b=_.P(a.reader);0<b&&!a.parser.a;--b)a.parser.ee(a.start+a.headerSize,a.reader,a.partialOkay)};_.ym=function(a){return b=>{const c=b.reader.Sa()-b.reader.getPosition();a(_.tm(b.reader,c))}};_.zm=function(a){return 8+(a.has64BitSize?8:0)+(null!=a.flags?4:0)};Am=function(a){let b="";try{b=_.lj(a)}catch(c){}return b};_.Cm=function(a){a=Am(a);let b="";a.length&&(b=(new _.Bm(a)).a);return b};
|
|
115
|
+
Em=function(a){if(!a)return null;let b=null;try{const c=JSON.parse(_.ij(a)),d=_.Yl(c.sinf[0]);(new _.Dm).N(_.Wf,_.wm).N("schi",_.wm).N("tenc",e=>{e.reader.skip(6);_.om(e.reader)&&(e.reader.skip(1),b=_.$l(_.tm(e.reader,16)));e.parser.stop()}).parse(d)}catch(c){}return b};
|
|
116
|
+
Gm=function(a,b,c){if(!c||!c.byteLength)throw new _.I(_.F,6,6102);let d;typeof b===_.cg?d=_.nj(b,!0):d=b;a=_.nj(Am(a),!0);b=new _.Fm(12+a.byteLength+d.byteLength+c.byteLength,!0);_.O(b,a.byteLength);_.lm(b,_.K(a));_.O(b,d.byteLength);_.lm(b,_.K(d));_.O(b,c.byteLength);_.lm(b,_.K(c));return _.K(b.buffer)};_.Hm=function(a){var b=_.K(a.body);b=_.Xl(b);a.headers[ta]=Qc;a.body=_.mj("spc\x3d"+b).buffer};
|
|
117
|
+
_.Im=function(a){let b;try{b=_.ij(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=gj(_.Yl(b))};Nm=function(a,b){b=Jm(b);if(a===_.Jd)return b+Km;if(a===_.Hd)return b+Lm;if(a===_.Ed)return b+Mm;throw Error("Unknown DRM Key-System '"+a+"'. Can not infer license URL!");};
|
|
118
|
+
_.Tm=function(a,b,c,d){d=void 0===d?!0:d;c=a.drm;c&&c.env.startsWith(xa)?c.customData&&(_.Sm(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)):Om.warn(hb)};
|
|
119
|
+
_.Um=function(a,b){try{const c=_.K(b.data),d=JSON.parse(String.fromCharCode.apply(null,c));Om.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){Om.debug("Unable to parse DRMtoday response JSON, assuming the response contained raw data")}};
|
|
120
|
+
_.Wm=function(a,b,c){var d=c&&c.customData&&c.customData.fpsContentId;_.Tm(a,b,c,!1);b.headers[ta]=Qc;c={spc:_.Wl(b.body)};if((a=a.drm)&&a.env.startsWith(ya)&&d){a={};var e=_.bk((new _.Bm(Vm(d))).f);d=e.keyId;if(e=e.assetId)Om.info("Applying assetId from HLS manifest."),a.assetId=e;d&&(Om.info("Applying keyId from HLS manifest."),a.keyId=d);d=a;d.keyId&&(Om.info("Adding keyID to FPS payload:",d.keyId),c.keyId=d.keyId);d.assetId&&(Om.info("Adding assetID to FPS payload:",d.assetId),c.assetId=d.assetId)}b.body=
|
|
121
|
+
_.oj(_.ak(c,!0))};_.Xm=function(a,b){Om.debug("Clearing response data");200===b.status&&(a=_.ij(b.data).trim(),"\x3cckc\x3e"===a.substr(0,5)&&"\x3c/ckc\x3e"===a.substr(-6)&&(a=a.slice(5,-6)),b.data=_.Yl(a).buffer)};
|
|
122
|
+
_.Ym=function(a,b,c){b=Am(b);c=c&&c.customData?c.customData:{};b=new _.Bm(Vm(b));const d=_.bk(b.f);if(a&&a.drm&&a.drm.customData){var e=a.drm.customData;a=e.assetId;e=e.variantId;a&&_.rj(`${a}`)&&(d.assetId=a,Om.debug("Using assetId from the configuration instead of the value from the HLS manifest."));e&&_.rj(`${e}`)&&(d.variantId=e,Om.info("Using variantId from the configuration instead of the value from the HLS manifest."))}d.keyId?(a=["keyId"],Om.debug("KeyId found in FPS SKD. Removing other parameters")):
|
|
123
|
+
a=["assetId","variantId"];b.f=_.ak(d,!1,a);"/"!==b.path||b.j.includes(`${b.a}/`)||(b.path="");b=_.Zj(b);return c.fpsContentId=b};_.Zm=function(a,b){a=a.drm;if(!a||!a.env.startsWith(xa))Om.warn(hb);else if(a.customData&&a.customData.merchant&&!a.env.startsWith(ya)){const c=new _.Ci(b.uris[0]);let d=c.Ka;d.endsWith("/")||(d+="/");d+=a.customData.merchant;c.Ka=d;b.uris[0]=c.toString()}};$m=function(a,b,c){_.Tm(a,b,c);a=a.drm;a=!(!a||!a.offlineId);c=new _.Ci(b.uris[0]);c.a.add(_.df,a);b.uris[0]=c.toString()};
|
|
124
|
+
Jm=function(a){if(a===an)return"https://lic.drmtoday.com";if(a===bn)return"https://lic.staging.drmtoday.com";if(a===cn)return"https://lic-demo.staging.drmtoday.com";if(a===dn)return"https://lic.test.drmtoday.com";throw Error("Unknown DRMtoday environment '"+a+"'. Can not infer DRMtoday base URL!");};Vm=function(a){a=a.replace(/assetid/gi,"assetId");a=a.replace(/variantid/gi,"variantId");return a=a.replace(/keyid/gi,"keyId")};
|
|
125
|
+
_.Sm=function(a,b){if((b=b.drm)&&b.customData){var c={userId:b.customData.userId,sessionId:b.customData.sessionId,merchant:b.customData.merchant};_.oh(c)&&(a.headers["dt-custom-data"]=btoa(JSON.stringify(c)));(b=b.customData.authToken)&&(a.headers["x-dt-auth-token"]=b)}};fn=function(a){const b={},c=a?a[Yg]:void 0;a=en[a?a[Yg]:void 0];c&&(b.drmTodayErrorCode=c);a&&(b.drmTodayErrorMessage=a);return b};
|
|
126
|
+
gn=function(a){a=a["x-dt-li"];if(!a)return null;try{const b=JSON.parse(atob(a));a={};b.ti&&(a.requestId=b.ti);b.rpd&&(a.delay=Number(b.rpd)/1E3);return a}catch(b){return Om.warn("Unable to parse DRMtoday License Info header (x-dt-li)",b),null}};hn=function(a,b){a.size=void 0===b?0:1;a.g.debug("Setting key status to",b);a.a=b};kn=function(a,b,c,d){b===HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=jn.value().get(b),c.one(a,b,d))};
|
|
127
|
+
ln=function(a,b){a.f=b;_.Th(a.a);if(!b)return Promise.resolve();a.a.on(b,he,c=>{_.Gh("AppleEmeManager.cancelNativeMediaEncryptedEvent_",c);"MediaEncryptedEvent"in window&&c instanceof MediaEncryptedEvent&&(a.g.info("Cancel native MediaEncryptedEvent when using Apple-prefixed EME"),c.stopImmediatePropagation())});a.a.on(b,Ug,c=>{{a.g.debug("Handle webkitNeedKey event");c=_.K(c.initData);if(_.fj(c).getUint32(0,!0)+4!==c.byteLength)throw new RangeError("Malformed FairPlay init data");c=kj(c.subarray(4),
|
|
128
|
+
!0);c=_.mj(c);const d=new Event(he);d.initDataType="skd";d.initData=gj(c);a.f.dispatchEvent(d)}});kn(b,HTMLMediaElement.HAVE_METADATA,a.a,()=>b.webkitSetMediaKeys(a.h));return Promise.resolve()};mn=function(a,b){hn(a.keyStatuses,b);b=new _.D(te);a.dispatchEvent(b)};
|
|
129
|
+
pn=function(a,b){a.a=b;_.Th(a.f);b&&(a.f.on(b,a.h+"needkey",c=>{{const d=new Event(he);d.initDataType=_.kd;d.initData=gj(c.initData);a.a.dispatchEvent(d)}}),a.f.on(b,a.h+"keymessage",c=>{{const e=nn(a,c.sessionId);if(e){var d=void 0===e.keyStatuses.getStatus();c=new _.D(_.Ke,{messageType:d?we:ve,message:c.message});d=e;_.Gh("WebkitEmeManager.MediaKeySession.generated");d.f&&(d.f.resolve(),d.f=null);e.dispatchEvent(c)}else _.Hh("Session not found",c.sessionId)}}),a.f.on(b,a.h+"keyadded",c=>{(c=nn(a,
|
|
130
|
+
c.sessionId))&&c.ready()}),a.f.on(b,a.h+"keyerror",c=>{var d=nn(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?on(d,_.bf):1===e?on(d,"expired"):on(d,_.se))}}}))};
|
|
131
|
+
nn=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};on=function(a,b){hn(a.keyStatuses,b);b=new _.D(te);a.dispatchEvent(b)};qn=function(a,b){return a.w?a.w+b.charAt(0).toUpperCase()+b.slice(1):b};
|
|
132
|
+
sn=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===_.ef)if(c)d=_.K(_.mj("LOAD_SESSION|"+c));else{const f=_.mj("PERSISTENT|"),g=new Uint8Array(f.byteLength+b.byteLength);g.set(f,0);g.set(_.K(b),f.byteLength);d=g}else d=_.K(b)}catch(f){return Promise.reject(f)}a.f=new _.rn;const e=qn(a,"generateKeyRequest");try{a.j[e](a.h,d)}catch(f){if(f.name!==Za)return a.f=null,Promise.reject(f);(new _.Gk(()=>{try{a.j[e](a.h,d)}catch(g){a.f.reject(g),
|
|
133
|
+
a.f=null}})).ia(.01)}return a.f};tn=function(a,b,c){if(a.a)a.a.then(()=>tn(a,b,c)).catch(()=>tn(a,b,c));else{a.a=b;if(a.h===Qg){var d=_.ij(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=_.Yl(e.keys[0].k);e=_.Yl(e.keys[0].kid)}else d=_.K(c),e=null;var f=qn(a,"addKey");try{a.j[f](a.h,d,e,a.sessionId)}catch(g){a.a.reject(g),a.a=null}}};
|
|
134
|
+
wn=function(a,b){var c=un;if(a){var d=c.find(e=>e.a()===a);if(d)return vn.info(Yb+d.a()),d.create();vn.info("Cannot create selected EME manager, falling back to the default.")}if(b&&(d=c.find(e=>e.a()===b)))return vn.info(Yb+d.a()),d.create();c=c[0];if(!c)throw Error("Missing EME managers.");vn.info(Yb+c.a());return c.create()};_.zn=function(a){var b=_.Zl(a);b=parseInt(b.byteLength,10).toString(16);b=_.Zl("12"+b+a);return new xn(yn,a,b)};
|
|
135
|
+
_.Bn=function(a){const b=new _.An(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);a=_.P(b);var c=_.P(b);c=_.vm(c);var d=_.P(b);const e=d>>>24;d&=16777215;var f=_.tm(b,16);f=_.$l(f);if(0<e){var g=_.P(b);b.skip(16*g)}g=_.P(b);const h=()=>{let u=_.om(b),v=(u&127)>>>0,y=7;for(;128<=u&&28>=y;)u=_.om(b),v=(v|(u&(28>y?127:15))<<y)>>>0,y+=7;return 28<y?-1:v},k=u=>{switch(u){case 0:do if(!_.mm(b))throw Error("not enough data to skip!");while(_.om(b)&128);break;case 1:b.skip(8);break;case 2:b.skip(h());
|
|
136
|
+
break;case 3:for(;4!==(u=h()&7);)k(u);break;case 5:b.skip(4);break;default:throw Error("invalid wire type "+u);}},l=[];let m=null;for(;_.mm(b);){var n=h(),r=n&7;n>>>=3;if(2===r){r=h();if(0>r)throw Error(`unable to read length of field ${n}`);r=sm(b,r);2===n?l.push(r):4===n&&(m=r)}else k(r)}_.Gh("Parsed WV PSSH Box","size",a,"name",c,Eg,e,"flags",d,"size",g,"systemId",f,"contentId (base64)",m?_.Wl(m):"","keyIds",l.map(u=>_.$l(u)));return 0<l.length?_.zn(_.$l(l[0])):null};
|
|
137
|
+
_.Cn=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=_.K(a);a.set(b,0);return a};
|
|
138
|
+
_.In=function(a){var b=_.Dn;a:{var c=new _.An(new DataView(a.buffer),!0);_.P(c);for(_.pm(c);_.mm(c);)if(1===_.pm(c)){var d=_.pm(c);c=_.tm(c,d);break a}c=null}c||(c=a);a=kj(c,!0);d=b.j(a,"WRMHEADER");a=d.getAttribute(Eg)||"";d=b.h(d,"DATA");var e=b.h(d,"LA_URL");b=e?b.f(e):"";var f=_.Dn;if(e=f.h(d,"KID"))if(e=f.f(e)){var g=f.h(d,na);f=g?f.f(g):null;e={value:e,se:f}}else e=null;else e=null;d=e?[e]:(e=En(d))?[e]:(d=Fn(d))?d:null;const {value:h="",se:k}=d&&d[0]||{};d=_.Yl(h);d=_.Cn(d);d=_.$l(d);return new _.Gn(_.Hn,
|
|
139
|
+
d,b,c,a,k)};En=function(a){var b=_.Dn;a=b.h(a,"PROTECTINFO");if(!a)return null;var c=b.h(a,"KID");if(!c)return null;b=c.getAttribute("VALUE");if(!b)return null;a=c.getAttribute(na);c=c.getAttribute("ALGID");return{value:b,se:a,Pg:c}};
|
|
140
|
+
Fn=function(a){var b=_.Dn;a=b.h(a,"PROTECTINFO");if(!a)return null;a=b.h(a,"KIDS");if(!a)return null;a=b.a(a,"KID");if(!a.length)return null;b=[];for(const c of a)if(a=c.getAttribute("VALUE")){const d=c.getAttribute(na),e=c.getAttribute("ALGID");b.push({value:a,se:d,Pg:e})}return b.length?b:null};_.Kn=function(a){Jn&&performance.mark(a)};_.Mn=function(a,b,c){Jn&&(b=performance.measure(a,b,c),null!=b&&Ln.info(`Step: "${a}" took ${b.duration.toFixed(0)} ms.`))};
|
|
141
|
+
Nn=function(a){return _.x(function*(){const b=new Promise(c=>{(new _.Gk(c)).ia(1)});(yield Promise.race([a.close().then(()=>!0),b.then(()=>!1)]))||_.C("Timeout waiting for session close")})};_.Pn=function(a){return On(a)?_.Hd:a};Qn=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};
|
|
142
|
+
Rn=function(a,b){b=b[_.Pn(a.keySystem)];a.keyIds||(a.keyIds=[]);b&&(a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=b.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=b.persistentStateRequired),a.videoRobustness||(a.videoRobustness=b.videoRobustness||""),a.audioRobustness||(a.audioRobustness=b.audioRobustness||""),a.serverCertificate||(a.serverCertificate=b.serverCertificate||null))};
|
|
143
|
+
_.Sn=function(a,b){b=_.Bk(a.mimeType,b||a.codecs);if(_.Ak(b,a.type)){a=a.type;var c=_.Ak(b,a);c&&(c=c(),b=c.convertCodecs(a,b),c.destroy())}return b};Tn=function(a){for(const b of a.audioCapabilities||[])delete b.robustness;for(const b of a.videoCapabilities||[])delete b.robustness};Vn=function(a){return(a.audioCapabilities||[]).some(Un)||(a.videoCapabilities||[]).some(Un)};
|
|
144
|
+
Wn=function(a,b){a=_.Cm(b);_.Gh("Using default Content ID extractor. The hostname part from HLS #EXT-X-KEY:URI skd:// will be used.","Extracted Content ID: "+a);return a};
|
|
145
|
+
Yn=function(a){var {playerConfig:b,initData:c,initDataType:d,drmInfo:e,drmSystemConfig:f,sessionContext:g,emeApi:h}=a;if("skd"===d&&h===Xn){a=e.serverCertificate;let k=f&&f.modifiers&&f.modifiers.extractContentId;_.qh(k)||(k=Wn);let l="";try{l=k(b,c,g)}catch(m){throw new _.I(_.F,6,6103);}if(!l.length)throw new _.I(_.F,6,6101,"Content ID is an empty string");c=Gm(c,l,a)}return c};On=function(a){return!!a.match(/^com\.(microsoft|chromecast)\.playready/)};
|
|
146
|
+
Un=function(a){return null!=a.robustness&&""!==a.robustness};Zn=function(a,b,c,d,e){for(const f of a){b.includes(f.licenseServerUri)||b.push(f.licenseServerUri);f.serverCertificate&&(c.some(g=>_.am(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])}};
|
|
147
|
+
$n=function(a){var b=a.o;const c=a.Y;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>"expired"===d)&&a.w(new _.I(_.F,6,6014));a.D.Ne(_.xh(c));a.A||a.g.info(wa);a.A=!0;a.F=!1};ao=function(a){a.h.forEach((b,c)=>{const d=b.Ie;let e=c.expiration;isNaN(e)&&(e=Infinity);e!==d&&(a.D.Me(c.sessionId,e),b.Ie=e)})};
|
|
148
|
+
bo=function(a){return _.x(function*(){a.B.release();a.B=null;a.M.release();a.M=null;a.A=!1;a.F=!1;a.H.reject();a.$.stop();a.$=null;a.U.stop();a.U=null;const b=Array.from(a.h.keys());for(const c of a.h.values())c.Jc&&c.Jc.stop();a.h.clear();yield Promise.all(b.map(c=>Promise.resolve().then(()=>_.x(function*(){a.g.debug("Closing session",c.sessionId);try{yield Nn(c)}catch(d){a.g.warn("Error while closing session",d)}}))));if(a.C){try{yield a.l.h(null)}catch(c){a.g.warn("Error while resetting media keys",
|
|
149
|
+
c)}a.C=null}a.l=null;a.a=null;a.J.clear();a.I=null;a.L=[];a.f=null;a.w=null;a.D=null;a.R=0;a.O=null})};_.io=function(a,b){const c=co(a,b),d=eo(b);for(const e of d)fo(a,e,a.f.Na);b=go(a,b);if(!b.size)return a.S=!0,Promise.resolve();_.Kn(Ud);a=_.ho(a,b);return(c?a:a.catch(()=>{})).then(()=>{_.Kn(Td);_.Mn("DRM queryMediaKeys_()",Ud,Td)})};
|
|
150
|
+
_.ko=function(a,b,c){c=void 0===c?[]:c;a.K=jo;a.L=c;a.G=0<c.length;a.g.debug("Using Persisted Licenses: "+a.G);a.f&&a.f.enableSessionCacheForSkd&&a.g.info("Enabled session cache for SKD license requests");return _.io(a,b)};
|
|
151
|
+
_.ho=function(a,b){if(1===b.size&&b.has(""))return Promise.reject(new _.I(_.F,6,6E3));null===a.l&&(a.l=wn(a.f.emeApi,a.Ha));for(var c of b.values())0===c.audioCapabilities.length&&delete c.audioCapabilities,0===c.videoCapabilities.length&&delete c.videoCapabilities;let d=c=new _.rn;const e=(h,k,l)=>{k.drmInfos.some(m=>!!m.licenseServerUri)===h&&(d=d.catch(()=>{if(a.j)return null;if(l===_.Hd){if(_.Ik()&&!a.f.Na[l].useLegacySystem)return k.label=Id,a.l.a(Id,[k]).catch(()=>{a.g.warn("Unable to create com.microsoft.playready.recommendation. Falling back to com.microsoft.playready.");
|
|
152
|
+
k.label=_.Hd;Tn(k);return a.l.a(l,[k])});Tn(k)}if(l===_.Jd&&a.f.widevineVersion!==_.Jd){const m=a.f.widevineVersion;if(!m.startsWith(_.Jd))return a.g.error(`Invalid "widevineVersion" value "${m}".`),Promise.reject();const n=Object.assign({},k,{label:m,distinctiveIdentifier:_.$e,persistentState:_.$e});return a.l.a(m,[n]).catch(()=>a.l.a(l,[k]))}return a.l.a(l,[k]).catch(m=>{a:{if(l===_.Jd&&Vn(k)){const n=_.il();if(Vn(k)&&n.os===al&&n.browser===od){a.g.warn("requestMediaKeySystemAccess() failed",m);
|
|
153
|
+
a.g.warn("Will try to recover by removing the robustness attribute of videoCapabilities and audioCapabilities.");Tn(k);m=a.l.a(l,[k]);break a}}throw m;}return m})}))};let f=a.f.preferredDrmSystem;if(!f){var g=_.il();if(g.os===dl&&10<=g.osVersion.major&&"edge"===g.browser)f=_.Hd;else if("safari"===g.browser)f=_.Ed;else if(g.browser===od||"firefox"===g.browser)f=_.Jd}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(()=>{throw new _.I(_.F,6,6001,
|
|
154
|
+
"Failed to get MediaKeySystemAccess.");});d=d.then(h=>{if(a.j)return null;a.J.clear();var k=h.getConfiguration();a.g.info("Got MediaKeySystemAccess with configuration",k);var l=k.audioCapabilities||[];k=k.videoCapabilities||[];for(var m of l)a.J.add(m.contentType.toLowerCase());for(var n of k)a.J.add(n.contentType.toLowerCase());{l=h.keySystem;m=b.get(_.Pn(h.keySystem));n=[];k=[];const r=[],u=[];Zn(m.drmInfos,n,k,r,u);1<k.length&&_.C("Multiple unique server certificates found! Only the first will be used.");
|
|
155
|
+
1<n.length&&_.C("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?m.videoCapabilities[0].robustness:"",serverCertificate:k[0],initData:r,keyIds:u,periodId:null}}a.a=l;if(!a.a.licenseServerUri)throw new _.I(_.F,6,6012,a.a.keySystem);
|
|
156
|
+
return h.createMediaKeys()}).then(h=>{a.j||(a.g.info("Created MediaKeys for key system",a.a.keySystem),a.I=h,a.S=!0)}).catch(h=>{if(!a.j){a.a=null;a.J.clear();if(h instanceof _.I)throw h;throw new _.I(_.F,6,6002,{browserError:h.message});}});c.reject();return d};
|
|
157
|
+
lo=function(a){a=wh(a.f.Na[_.af]||{});if(0===a.size)return null;const b=[],c=[];a.forEach((e,f)=>{f=_.Zl(f);e=_.Zl(e);e={kty:"oct",kid:_.Xl(f,!1),k:_.Xl(e,!1)};b.push(e);c.push(e.kid)});a=JSON.stringify({keys:b});var d=JSON.stringify({kids:c});d=[{initData:_.mj(d),initDataType:"keyids"}];return{keySystem:_.af,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:d,
|
|
158
|
+
keyIds:[],periodId:null}};eo=function(a){const b=[];for(const c of a)for(const d of c.drmInfos)b.push(d);return b};mo=function(a,b){for(const c of b)""===c.licenseServerUri||a.f.Na[c.keySystem]||(a.f.Na[c.keySystem]={licenseUrl:""})};
|
|
159
|
+
co=function(a,b){const c=b.some(g=>0<g.drmInfos.length);if(!c){var d=wh(a.f.Na);Qn(b,d)}d=a.f.Na[_.Ed];const e=b.some(g=>g.drmInfos.some(h=>h.keySystem===_.Ed));if(!1!==a.f.Ji&&_.Uk()&&!e&&d)for(var f of b)f.drmInfos.push({keySystem:_.Ed,licenseServerUri:d.licenseUrl,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[],periodId:null});if(f=lo(a))for(const g of b)g.drmInfos=[f];b=eo(b);mo(a,b);for(const g of b)Rn(g,
|
|
160
|
+
a.f.Na);return c};fo=function(a,b,c){const d=_.Pn(b.keySystem);c=c[d];d===_.af&&b.licenseServerUri?a.g.debug("Using Clear Key data URI for",d):c&&c.licenseUrl?(b.licenseServerUri=c.licenseUrl,a.g.debug("Using license server URI from user-configured clpp.drm.DrmEnvironment (licenseUrl) for",d)):a.g.debug("Using license server URI from the manifest for ",d)};
|
|
161
|
+
go=function(a,b){var c=new Set(eo(b));const d=a.G?_.Kf:_.$e,e=a.G?[_.ef]:[gg];a=new Map;for(const f of c)a.set(f.keySystem,{initDataTypes:[_.kd],audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:_.$e,persistentState:d,sessionTypes:e,label:f.keySystem,drmInfos:[]});for(const f of b){b=f.audio;c=f.video;const g=b?_.Sn(b):"";let h=null;b&&"ac-3"===b.codecs.toLowerCase()&&_.Kk()&&(h=_.Sn(b,_.ge));const k=c?_.Sn(c):"";let l=null;c&&"ac-3"===c.codecs.toLowerCase()&&_.Kk()&&(l=_.Sn(c,_.ge));
|
|
162
|
+
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(r=>r.initDataType))]);m.distinctiveIdentifierRequired&&(n.distinctiveIdentifier=_.Kf);m.persistentStateRequired&&(n.persistentState=_.Kf);b&&_.pi(m.audioRobustness).forEach(r=>{const u={robustness:r||"",contentType:g};n.audioCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.audioCapabilities.push(u);h&&n.audioCapabilities.push({robustness:r||
|
|
163
|
+
"",contentType:h})});c&&_.pi(m.videoRobustness).forEach(r=>{const u={robustness:r||"",contentType:k};n.videoCapabilities.find(v=>v.robustness===u.robustness&&v.contentType===u.contentType)||n.videoCapabilities.push(u);l&&n.videoCapabilities.push({robustness:r||"",contentType:l})})}}return a};no=function(a){return _.x(function*(){if(!a.l.o())if(a.O)yield a.O;else try{a.O=a.l.h(a.I),yield a.O}catch(b){a.j||a.w(new _.I(_.F,6,6003,b.message,b))}})};
|
|
164
|
+
_.ro=function(a,b,c,d){d=void 0===d?"":d;if(c.length&&(!a.G||a.K!==jo)){var e=a.keySystem();if(!e.startsWith(_.Ed)&&b===_.kd){const f=new oo(c);if(1<f.a.length&&(e={"org.w3.clearkey":"1077efecc0b24d02ace33c1e52e2fb4b","com.widevine.alpha":"edef8ba979d64acea3c827dcd51d21ed","com.microsoft.playready":"9a04f07998404286ab92e65be0885f95","com.adobe.primetime":"f239e769efa348509c16a903c6932efb"}[e]))for(let g=0;g<f.f.length;g++)if(e===f.f[g]){c=c.subarray(f.a[g].start,f.a[g].end+1);break}}(a.C.webkitCurrentPlaybackTargetIsWireless||
|
|
165
|
+
_.Kk(2)||a.keySystem().startsWith(_.Ed)||!_.po(a,d,c,!0))&&qo(a,d,null,b,c)}};so=function(a,b){return _.x(function*(){a.g.info(`Handle encrypted event for type ${b.initDataType}`);yield no(a);b.initData&&_.ro(a,b.initDataType,_.K(b.initData))})};uo=function(a){return _.x(function*(){_.Kn(Wd);const b=a.W.map(c=>to(a,c));a.ba=!0;a.W=[];yield Promise.all(b);_.Kn(Vd);_.Mn("drm.onPlay",Wd,Vd)})};
|
|
166
|
+
wo=function(a){const b=a.keySystem(),c=a.f.Na[b],d=c.certificateUrl||"";if(""===d)return Promise.resolve();const e=a.D.getConfiguration();return vo(a,e).then(()=>{var f=c.modifiers;const g=f&&f.certificateRequest,h=f&&f.certificateResponse;f=_.Bj([d],a.f.attemptParameters);f.type=3;f.licenseRequestType=md;g&&f.requestModifiers.push(k=>g(e,k));h&&f.responseModifiers.push(k=>h(e,k));a.g.debug("Fetching certificate");return a.D.yb.fetch(f).V}).then(f=>{a.a.serverCertificate=_.K(f.data)}).catch(f=>{var g=
|
|
167
|
+
f.data.headers;g=Object.assign({message:Ra,url:f.data.url,status:f.data.status,response:f.data.response},g?{headers:g}:{},fn(g));throw new _.I(_.F,6,6100,g,f);})};
|
|
168
|
+
_.xo=function(a){return _.x(function*(){if(a.I&&a.a&&a.a.serverCertificate&&a.a.serverCertificate.length)try{const b=yield a.I.setServerCertificate(a.a.serverCertificate);void 0===b||b||a.g.debug("Server certificates are not supported by the key system. The server certificate has been ignored.")}catch(b){throw new _.I(_.F,6,6004,{browserError:b.message});}})};
|
|
169
|
+
_.Ao=function(a){const b=a.a?a.a.initData||[]:[];for(const c of b){let d=!_.Kk(2);if(a.f.enforceSingleSession&&!a.keySystem().startsWith(_.Ed)){const e=a.h.values();for(const f of e)_.am(c.initData,f.initData)?(a.g.info("Skipping Session creation. Existing init data in single session mode!"),d=!1):f.periodId===c.periodId&&(a.g.info("Skipping Session creation. Merging init data for period in single session mode "+`for Key ID ${c.keyId}.`),yo(c.initData,f)||(f.Md.push(c.initData),c.keyId&&!f.qb.includes(c.keyId)&&
|
|
170
|
+
f.qb.push(c.keyId),a.o.get(c.keyId)||a.o.set(c.keyId,ag)),d=!1)}!d||a.G&&a.K===jo||(_.po(a,c.keyId,c.initData)&&(d=!1),d&&(a.g.info("Request new media key session on create"),qo(a,c.keyId,c.periodId,c.initDataType,c.initData)))}for(const c of a.L)_.zo(a,c);b.length||a.L.length||(a.A||a.g.info(wa),a.A=!0,a.F=!1,a.H.resolve());return a.H};
|
|
171
|
+
_.Co=function(a,b){if(!a.I)return Uh(a.B,b,()=>{a.w(new _.I(_.F,6,6010))}),Promise.resolve();a.C=b;a.l.l(b);a.B.one(a.C,_.gf,()=>uo(a));a.B.on(a.C,_.Pg,e=>{const f=a.F;a.F=!a.A;!f&&a.F&&(a.g.info("Waiting for DRM license key delivery"),a.D.onEvent(e))});var c=a.a.initData.find(e=>0<e.initData.length);let d=Promise.resolve();if(c||a.l.f()!==Bo||a.L.length)d=no(a);c=Promise.resolve();_.Nk()&&38===_.Ok().major||(a.a&&a.a.keySystem!==_.af&&!a.a.serverCertificate&&(c=wo(a)),c=c.then(()=>_.xo(a)));return Promise.all([d,
|
|
172
|
+
c]).then(()=>{a.j||(_.Ao(a),a.B.on(a.C,he,e=>so(a,e)))}).catch(e=>{if(!a.j){if(6004===e.code&&a.a&&a.a.keySystem===_.Jd&&1>a.R&&a.a.serverCertificate&&a.a.serverCertificate.length)return a.g.warn("Detected invalid widevine server certificate!. Retrying"),a.w(new _.I(1,6,6004)),a.a.serverCertificate=null,a.R++,_.Co(a,b);1<=a.R&&a.g.info("Could not get valid widevine server certificate. Giving up");throw e;}})};
|
|
173
|
+
vo=function(a,b){return _.x(function*(){const c=a.D.Oc();if(c){var d=b&&b.drm&&b.drm.customData;d&&(yield c(d))}})};
|
|
174
|
+
_.zo=function(a,b){let c;try{a.g.debug("Attempting to load an offline session",b),c=a.I.createSession(_.ef)}catch(e){const f=new _.I(_.F,6,6005,{browserError:e.message});a.w(f);return Promise.reject(f)}a.B.on(c,_.Ke,a.Aa.bind(a));a.B.on(c,te,a.va.bind(a));const d={initData:null,loaded:!1,Ie:Infinity,kc:null,kb:new _.rn,periodId:null,Md:[],keyId:null,qb:[],initDataType:null,pc:null,sessionContext:{ldlDelay:0,customData:{}}};d.kb.catch(()=>{});a.h.set(c,d);return c.load(b).then(e=>{if(a.j)return null;
|
|
175
|
+
a.g.debug("Loaded offline session",b,e);if(!e)return a.h.delete(c),a.w(new _.I(_.F,6,6013)),null;d.loaded=!0;Do(a)&&(a.A||a.g.info(wa),a.A=!0,a.F=!1,a.H.resolve());return c},e=>{a.j||(a.h.delete(c),a.w(new _.I(_.F,6,6005,{browserError:e.message})))})};yo=function(a,b){if(!a)return!1;for(let c=0;c<b.Md.length;c++)if(_.am(a,b.Md[c]))return!0;return!1};
|
|
176
|
+
_.po=function(a,b,c,d){d=void 0===d?!1:d;for(const e of a.h.keys()){const f=a.h.get(e);if(_.am(c,f.initData))return b?f.qb.includes(b)?d&&a.g.info("Skipping Session creation. "+`License for init data with Key ID ${b} was already `+`requested in Session: '${e.sessionId}'. `):(f.qb.push(b),a.o.get(b)||a.o.set(b,ag),d&&a.g.info(Gb+`Session: '${e.sessionId}'`+`Adding Key ID ${b} to session meta-data.`)):d&&a.g.info(Gb+`Session: '${e.sessionId}'`),!0;if(yo(c,f))return d&&a.g.info("Skipping Session creation. License for init data was already requested [extra]"),
|
|
176
177
|
!0}return!1};
|
|
177
|
-
|
|
178
|
-
if(h&&m.keyId===h){a.g.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(u){a.g.warn("Unable to close session",u)}k=!1}}if(k){a.g.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.G?_.
|
|
179
|
-
k={
|
|
180
|
-
m=a.f.
|
|
181
|
-
a.w(new _.
|
|
182
|
-
|
|
183
|
-
_.
|
|
184
|
-
|
|
185
|
-
k.sessionId=c.sessionId;if(k.licenseRequestType===
|
|
186
|
-
(h=a.h.get(d.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
l?{headers:l}:{},
|
|
191
|
-
|
|
192
|
-
|
|
178
|
+
qo=function(a,b,c,d,e,f,g){f=void 0===f?null:f;g=void 0===g?!1:g;_.x(function*(){if(e.length){var h=b;if(!h)try{h=Eo(a,d,e,f)}catch(u){if(a.g.warn("Ignoring unrecognized init data. This may be caused by unsupported or malformed init data. Set `drm.ignoreUnrecognizedInitData \x3d false` if you want to override this behavior and use the init data after all.",{error:u,initDataType:d,initData:e}),a.f.ignoreUnrecognizedInitData)return}if(!g&&Fo(a,h,d,e)){var k=!0;if("skd"===d&&!a.f.enableSessionCacheForSkd)for(var l of a.h.keys()){var m=a.h.get(l);
|
|
179
|
+
if(h&&m.keyId===h){a.g.warn(`Close and re-open session for ${h}`);try{yield l.close()}catch(u){a.g.warn("Unable to close session",u)}k=!1}}if(k){a.g.warn(`Skip creating a new session for ${h}`);return}}try{var n=a.G?_.ef:gg;var r=a.I.createSession(n);a.D.onEvent(new _.D(be,{keySystem:a.keySystem()}));a.g.info(`Created new ${n} session for Key ID: '${h}'. `+`Init data type: ${d}.`)}catch(u){a.w(new _.I(_.F,6,6005,{browserError:u.message}));return}a.B.on(r,_.Ke,a.Aa.bind(a));a.B.on(r,te,a.va.bind(a));
|
|
180
|
+
k={pc:f,Md:[],initData:e,initDataType:d,keyId:h,qb:h?[h]:[],loaded:!1,Ie:Infinity,periodId:c,kc:null,kb:new _.rn,sessionContext:{ldlDelay:0,customData:{}}};k.kb.catch(()=>{});f&&(l=a.h.get(f),k.sessionContext=l.sessionContext);a.h.set(r,k);h&&!a.o.get(h)&&a.o.set(h,ag);if(e)for(l=0;l<a.a.initData.length;l++)m=a.a.initData[l],m.keyId&&!k.qb.includes(m.keyId)&&_.am(m.initData,e)&&(k.keyId||(k.keyId=m.keyId),k.qb.push(m.keyId),a.o.get(m.keyId)||a.o.set(m.keyId,ag));l=a.D.getConfiguration();m=a.keySystem();
|
|
181
|
+
m=a.f.Na[m];n=(n=m.modifiers)&&n.transformInitData;_.qh(n)||(n=Yn);try{e=n({playerConfig:l,initData:e,initDataType:d,drmInfo:a.a,drmSystemConfig:m,sessionContext:k.sessionContext,emeApi:a.l.f()})}catch(u){h=u;u instanceof _.I||(h=new _.I(_.F,6,6016,u));k.kb&&k.kb.reject(u);a.w(h);return}a.g.info(`Generate License Request for key ID: '${h}'`);r.generateRequest(d,e.buffer).catch(u=>{if(!a.j){var v=null;u.errorCode&&u.errorCode.systemCode&&(v=u.errorCode.systemCode,0>v&&(v+=Math.pow(2,32)),v="0x"+v.toString(16));
|
|
182
|
+
a.w(new _.I(_.F,6,6006,{browserError:u.message,error:u,extended:v},u))}})}else a.g.warn("Empty init data")})};Go=function(a){let b=Infinity;a=a.h.keys();for(const c of a)isNaN(c.expiration)||(b=Math.min(b,c.expiration));return b};Do=function(a){a=a.h.values();return _.Yi(a,b=>b.loaded)};Fo=function(a,b,c,d){if(!b&&c!==_.Wf)return!1;d=b||Em(d);for(const e of a.h.values())if(b&&e.keyId===b||b&&e.qb.includes(b)||c===_.Wf&&(e.keyId||Em(e.initData))===d)return!0;return!1};
|
|
183
|
+
Eo=function(a,b,c,d){d=void 0===d?null:d;if("skd"===b){a:{var e=d;e=void 0===e?null:e;var f=a.keySystem(),g=a.f.Na[f];f=a.D.getConfiguration();g=g&&g.modifiers&&g.modifiers.extractContentId;_.qh(g)||(g=Wn);try{var h={ldlDelay:0,customData:{}};e&&(h=a.h.get(e).sessionContext);var k=g(f,c,h);a.g.debug(`Extracted Content ID '${k}' from SKD`);var l=k;break a}catch(m){a.g.warn("Unable to extract Content ID from SKD",m)}l=""}return l}if(b===_.Wf)return Em(c)||"";if(b===_.kd){l=a.keySystem();try{if(l.match(/^com\.widevine\.alpha/)){const m=
|
|
184
|
+
_.Bn(c);if(m)return m.a}else if(On(l)){{f=new _.An(new DataView(c.buffer,c.byteOffset,c.byteLength),!1);g=_.P(f);const m=_.P(f);h=_.vm(m);const n=_.P(f);c=n>>>24;k=n&16777215;const r=_.tm(f,16),u=_.$l(r);if(0<c){const E=_.P(f);f.skip(16*E)}const v=_.P(f),y=_.tm(f,v),A=_.In(y);_.Gh("Parsed PR PSSH Box","size",g,"name",h,Eg,c,"flags",k,"size",v,"systemId",u,"keyId",A.a);e=A}if(e)return e.a}}catch(m){throw a.g.warn("Unable to extract Key ID from PSSH data.",{error:m,keySystem:l}),m;}}return""};
|
|
185
|
+
to=function(a,b){return _.x(function*(){const c=b.target,d=a.h.get(c);if(d){var e=a.a.licenseServerUri;if(Ho(a,b))yield Io(a,e,b,c,d);else{var f=a.ha;if(0<f&&(a.g.info(`Delaying license request by ${f} s.`),yield Nh(f),a.j))return;var g=a.keySystem(),h=a.f.Na[g];"individualization-request"===b.messageType&&h&&h.individualizationServer&&(e=h.individualizationServer);var k=_.Bj([e],a.f.attemptParameters);k.type=3;k.body=b.message;k.method=_.sb;k.licenseRequestType=b.messageType===we&&d.pc?ve:b.messageType;
|
|
186
|
+
k.sessionId=c.sessionId;if(k.licenseRequestType===ve)a.D.onEvent(new _.D(ae));On(a.a.keySystem)&&Jo(a,k);cm(a.M,k);h=String(Math.floor(b.timeStamp));if(f=yield Ko(a,k,d,h,e,c.sessionId,b.messageType,f))if(e=dm(a.M,f),yield Lo(a,c,f.data,d,h))h=Go(a),a.D.onEvent(new _.D(_.de,{keySystem:g,expirationTime:h,expectedRenewalTime:e?Date.now()+1E3*e.delay:Number.NaN})),d.kc&&d.kc.resolve(),d.pc&&(h=d.pc,a.g.info(`Closing expired session '${h.sessionId}'`),Nn(h).catch(()=>{a.g.warn("Unable to close expired session in time")}),
|
|
187
|
+
(h=a.h.get(d.pc))&&h.Jc&&h.Jc.stop(),a.h.delete(d.pc),d.pc=null),(new _.Gk(()=>{a.j||(d.loaded=!0,d.kb&&d.kb.resolve(),Do(a)&&(a.A||a.g.info(wa),a.A=!0,a.F=!1,a.H.resolve()))})).ia(5),null!==d.initData&&(0<d.sessionContext.ldlDelay||e&&(_.pj(g,_.Ed)||_.pj(g,_.Hd)))&&(h=new _.Gk(()=>{!a.j&&a.M&&(a.g.info("Updating CSL Sessions"),On(g)?qo(a,d.keyId,d.periodId,d.initDataType,d.initData,c,!0):g.startsWith(_.Ed)&&c.update(_.mj("renew")))}),d.Jc=h,h.ia(e?e.delay:d.sessionContext.ldlDelay))}}else a.g.error(`Session metadata not found for ${c.sessionId}.`)})};
|
|
188
|
+
Ho=function(a,b){return!!a.keySystem().match(/^com\.widevine\.alpha/)&&b.message&&2===b.message.byteLength};Io=function(a,b,c,d,e){return _.x(function*(){var f=_.Bj([b],a.f.attemptParameters);f.type=3;f.body=c.message;f.method=_.sb;f.licenseRequestType=md;f.sessionId=d.sessionId;(f=yield Mo(a,f,e,b,d.sessionId,c.messageType))&&(yield Lo(a,d,f.data,e,String(Math.floor(c.timeStamp))))})};
|
|
189
|
+
Jo=function(a,b){var c=kj(b.body,!0,!0);if(c.includes("PlayReadyKeyMessage")){a.g.debug("Unwrapping PlayReady request.");a=(new DOMParser).parseFromString(c,"application/xml");c=a.getElementsByTagName("HttpHeader");for(let d=0;d<c.length;++d)b.headers[c[d].querySelector("name").textContent]=c[d].querySelector(_.Dg).textContent;b.body=_.Yl(a.querySelector("Challenge").textContent).buffer}else a.g.debug("PlayReady request is already unwrapped."),b.headers[ta]="text/xml; charset\x3dutf-8"};
|
|
190
|
+
Ko=function(a,b,c,d,e,f,g,h){return _.x(function*(){a.g.info("License request for "+`SID:'${f}'/KID:'${c.keyId}' `+`from msg '${g}'.`);yield No(a,b,c.sessionContext);a.g.debug("Sending DRM license request to",e,b);a.D.onEvent(new _.D(Yd,{delay:h}));var k=Date.now();_.Kn(`drm.license.req.${d}.start`);var l=null;try{l=yield a.D.yb.fetch(b).V}catch(r){if(a.j)return null;l=r.data.headers;l=Object.assign({message:"Error while fetching DRM license!",url:r.data.url,status:r.data.status,response:r.data.response},
|
|
191
|
+
l?{headers:l}:{},fn(l));l=new _.I(_.F,6,6007,l,r);Oo(a,l,c);return null}_.Kn(`drm.license.req.${d}.end`);_.Mn(`drm.license.req.${d}`,`drm.license.req.${d}.start`,`drm.license.req.${d}.end`);k=Date.now()-k;const m=gn(l.headers);m&&(a.ha=m.delay||0);let n="";m&&m.requestId&&(n=` RID:${m.requestId}`);a.g.info("License response for "+`SID:'${f}'/`+`KID:'${c.keyId}' `+`${l.data.byteLength} bytes `+`in ${k}ms${n}`);return a.j?null:l})};
|
|
192
|
+
Lo=function(a,b,c,d,e){return _.x(function*(){_.Kn(`drm.sess.update.${e}.start`);try{yield b.update(c)}catch(f){if(a.j)return!1;if(f===Fb)return a.g.info("Ignore update for closed sessions"),!1;const g=new _.I(_.F,6,6008,{browserError:f.message});Oo(a,g,d);return!1}_.Kn(`drm.sess.update.${e}.end`);_.Mn(`drm.sess.update.${e}`,`drm.sess.update.${e}.start`,`drm.sess.update.${e}.end`);return a.j?!1:!0})};
|
|
193
|
+
Mo=function(a,b,c,d,e,f){return _.x(function*(){a.g.info("WV Server certificate request for "+`SID:'${e} from msg '${f}'.`);yield No(a,b,c.sessionContext);a.g.debug("Sending Widevine certificate request to",d,b);var g=Date.now(),h=null;try{h=yield a.D.yb.fetch(b).V}catch(m){if(a.j)return null;h=m.data.headers;h=Object.assign({message:Ra,url:m.data.url,status:m.data.status,response:m.data.response},h?{headers:h}:{},fn(h));h=new _.I(_.F,6,6100,h,m);Oo(a,h,c);return null}g=Date.now()-g;const k=gn(h.headers);
|
|
193
194
|
let l="";k&&k.requestId&&(l=` RID:${k.requestId}`);a.g.info("WV Server certificate response for "+`SID:'${e}' `+`${h.data.byteLength} bytes `+`in ${g}ms${l}`);return a.j?null:h})};
|
|
194
|
-
|
|
195
|
-
_.
|
|
196
|
-
_.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
f||e||g;!a.L||a.m.isLive()||a.f!==_.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
b.type+" for "+a.url):
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
()
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
{
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
b.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
"
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
b,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
_.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
(a.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
b.
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
_.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
_.
|
|
332
|
-
_.
|
|
333
|
-
_.
|
|
334
|
-
|
|
335
|
-
_.
|
|
336
|
-
_.
|
|
195
|
+
No=function(a,b,c){return _.x(function*(){const d=a.D.getConfiguration();yield vo(a,d);const e=a.keySystem();var f=a.f.Na[e];const g=(f=f&&f.modifiers)&&f.licenseRequest,h=f&&f.licenseResponse;g?b.requestModifiers.push(k=>g(d,k,c)):e.startsWith(_.Ed)&&b.requestModifiers.push(k=>_.Hm(k));h?b.responseModifiers.push(k=>h(d,k,c)):e.startsWith(_.Ed)&&b.responseModifiers.push(k=>_.Im(k))})};Oo=function(a,b,c){a.j||(a.w(b),c.kc&&c.kc.reject(b),c.kb&&c.kb.reject(b))};
|
|
196
|
+
_.Ro=function(a,b){a&&b&&(_.Po.set(a,b),_.Qo.info(`Registered TextDisplayerFactory: '${a}'`))};_.So=function(a,b){b=b.find(c=>(c=_.Po.get(c))?c.a(a):!1);if(null==b)return _.Qo.warn("Subtitles may not work as expected. No compatible text displayer found for this platform."),null;_.Qo.info(`Chosen the text displayer: ${b}`);return _.Po.get(b)};
|
|
197
|
+
_.To=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})}}};Uo=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};Vo=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};
|
|
198
|
+
Wo=function(a){return a.a.map(b=>_.mh(b))};_.Xo=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:[]}};
|
|
199
|
+
bp=function(a){a.g.debug("Start watching for video events for "+a.m.namespace());const b=a.m,c=d=>Yo(a,d.type);a.a.on(b,_.je,()=>{a.h||(a.j=!1,Zo(a,_.$o))});a.a.on(b,cd,c);a.a.on(b,_.sf,()=>{a.F=!0;a.j=!1;Yo(a,_.sf)});a.a.on(b,_.cf,()=>{a.F=!1;a.j=!1;Yo(a,_.cf)});a.a.on(b,_.og,c);a.a.on(b,_.Gf,c);a.a.on(b,_.Rf,d=>{a.h=!1;a.j=!1;Yo(a,d.type)});a.a.on(b,_.Sf,d=>{a.h=!0;Yo(a,d.type)});a.a.on(b,Yf,c);a.a.on(b,_.Og,()=>{a.j=!0;Yo(a,_.Og)});a.a.on(b,_.q,d=>{(d=d&&d.detail)&&d.severity&&d.severity===_.F&&
|
|
200
|
+
Zo(a,_.ap)});a.a.on(b,_.Fe,c);a.a.on(b,ed,()=>{a.C=!0;Yo(a,ed)});a.a.on(b,_.Cg,d=>{a.h=!0;Yo(a,d.type)});a.a.on(b,_.Bg,d=>{a.h=!1;a.j=!1;Yo(a,d.type)})};cp=function(a,b){return Object.keys(b)[a]};ep=function(a,b){const c={type:_.$f};b===_.bd||b===_.ad?(c.reason=a.w,b===_.bd?c.timeSinceLastStateChangeMS=a.H:c.bufferedTimeMS=a.B):(a.f===_.dp&&(c.reason=a.w),a.A===_.dp&&(c.reason=a.w,c.bufferedTimeMS=a.B),c.currentState=a.f,c.previousState=a.A,c.timeSinceLastStateChangeMS=a.H);return c};
|
|
201
|
+
Zo=function(a,b){if(a.f===b)return!1;var c=Date.now();const d=a.f===_.dp;a.A=a.f;a.f=b;a.A===_.$o&&(a.I=c,a.o=0);a.o||(a.o=a.I||c);a.H=c-a.o;a.o=c;b===_.dp?(a.K=a.o,a.w=a.h?1:2,a.g.info("Buffering started. Reason: "+cp(a.w-1,_.fp)),b=ep(a,_.bd),a.Ya(_.bd,b)):d&&(a.B=a.o-a.K,a.g.info("Buffering finished. Reason: "+cp(a.w-1,_.fp)+". Buffering time: "+a.B+" ms"),b=ep(a,_.ad),a.Ya(_.ad,b));b=cp(a.A,_.gp);c=cp(a.f,_.gp);a.g.info(`Player state change: ${b} -> ${c}`);a.Ya(_.$f,ep(a,""));return!0};
|
|
202
|
+
Yo=function(a,b){if(a.f===_.ap)a.g.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.h||(a.j=!1,Zo(a,_.$o));else if(b!==_.og){var e=a.m.getPosition();e=null!==e&&void 0!==e&&0<=e?a.m.getBufferInfo().Ca(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===_.t&&2>a.l&&2===e.networkState;var f=typeof a.l===_.t&&0>=a.G&&a.f===_.hp,g=typeof a.l===_.t&&2>=a.l&&a.j;e=a.h||
|
|
203
|
+
f||e||g;!a.L||a.m.isLive()||a.f!==_.dp||e||(f=b===_.Rf&&4===a.l,(g=a.A===_.ip)&&!a.C?e=!0:g||a.C||f||(e=!0));f=!1;e?f=Zo(a,_.dp):c?f=Zo(a,_.jp):a.F&&(f=Zo(a,_.kp));f&&(a.C=!1);a.g.debug("Video state check for event "+b+":: seeking: "+a.h+", waiting: "+a.j+", playing: "+a.F+", paused: "+c+", readyState: "+a.l+", rate: "+a.J+", buffer: "+a.G+", ended: "+d+". Changed state: "+f+", Current state: "+cp(a.f,_.gp))}}};
|
|
204
|
+
lp=function(a){a=(new _.Ci(a)).Ka;if(!a)return null;a=a.toUpperCase();return _.qj(a,".MPD")?_.Kc:_.qj(a,".M3U8")?_.zl:_.qj(a,".MP4")?_.Ig:_.qj(a,".MP3")?"audio/mp3":_.qj(a,"MANIFEST")||_.qj(a,".ISM")?_.Pc:null};_.np=function(a){let b;Jl(a)?b=a.source:b=a;Array.isArray(b)||(b=[b]);b=b.filter(c=>typeof c===_.cg||"url"in c);a=[];for(let c=0;c<b.length;c++){const d=mp(b[c]);d&&a.push(d)}return a};
|
|
205
|
+
mp=function(a){let b=null;_.sh(a)&&(a={url:a});typeof a===_.Se&&!Array.isArray(a)&&"url"in a&&(b={url:a.url,type:a.type?a.type:null},_.B(a.drmProtected)||typeof a.drmProtected!==_.$c||(b.drmProtected=a.drmProtected),_.B(a.isLive)||typeof a.isLive!==_.$c||(b.isLive=a.isLive),_.B(a.name)||typeof a.name!==_.cg||(b.name=a.name),_.B(a.ac)||typeof a.ac!==_.cg||(b.ac=a.ac),_.B(a.audioMimeType)||typeof a.audioMimeType!==_.cg||(b.audioMimeType=a.audioMimeType));b&&!b.type&&(b.type=lp(a.url),b.type?op.debug("Detect media type "+
|
|
206
|
+
b.type+" for "+a.url):op.warn("Unable to detect media type for "+a.url));return b};qp=function(a,b){if(a.w)throw new _.I(_.F,7,7E3);a.a||(a.h.on(b,_.q,()=>{{const c=pp(a);if(c)a.onError(c)}}),a.h.on(b,_.Lf,()=>{const c=b.videoWidth,d=b.videoHeight,e=a.getTrackManager();e&&0<c&&0<d&&(e.w={width:c,height:d});a.trigger(new _.D(_.Zc,{detail:{width:c,height:d}}))}),a.a=b)};sp=function(a){const b=_.Uk()?Xn:void 0;return new _.rp(a,b)};
|
|
207
|
+
tp=function(a){return _.x(function*(){if(a.w)return Promise.reject(new _.I(_.F,7,7E3));var b=a.ga[a.getSourceIndex()];if(!a.configuration.drm||!1===b.drmProtected)return a.log.debug("No DRM configuration present.","Skipping DRM engine initialization"),Promise.resolve();b=_.hm(a.configuration.drm);a.log.debug("Drm configuration: ",b);const c=a.getNetworkEngine();a.o=sp({yb:c,onError:d=>a.onError(d),Ne:()=>{},Me:(d,e)=>{a.trigger(new _.D(_.Xd,{expirationTime:e}))},onEvent:d=>{d instanceof _.D?a.dispatchEvent(d):
|
|
208
|
+
a.log.debug(_.Ob,d.type)},getConfiguration:()=>a.getConfiguration(),Oc:()=>a.Oc()});a.o.f=b;yield _.ko(a.o,[{id:0,language:_.tg,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,Fa:0,mimeType:_.Ig,codecs:"",encrypted:!0,keyId:null,language:_.tg,originalLanguage:_.tg,label:null,type:_.w,primary:!1,frameRate:void 0,
|
|
209
|
+
Wi:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,Hi:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0}]);yield _.Co(a.o,a.a)})};up=function(a,b){kn(a.a,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{a.getState()!==_.ap&&a.seek(b).catch(c=>{a.log.warn("Error while seeking to start position.",c)})})};
|
|
210
|
+
pp=function(a){if(null===a.ga||!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 _.I(_.F,3,3016,{code:b,Ri:c,message:a.a.error.message})};
|
|
211
|
+
wp=function(a){if(a.w)return new _.vp(Promise.reject(new _.I(_.F,7,7E3)),()=>{});const b=a.ga[a.getSourceIndex()],c=a.configuration.startTime||null,d=a.a,e=a.H;c&&up(a,c);if(d.preload!==_.Re)a.h.one(d,_.Fe,()=>{const g=Date.now()/1E3-e;a.f.B=g;a.log.debug("Time to load: ",g)});d.src=b.url;(_.Kk()||_.Nk())&&d.load();const f=new _.rn;a.h.one(d,Yf,()=>{const g=a.getConfiguration().manifest.attemptParameters.timeout||30;a.B||(a.B=(new _.Gk(()=>{f.reject(new _.I(_.F,3,3100,{message:`Unable to load media source successfully from ${b.url}`,
|
|
212
|
+
uri:b.url},d.error))})).ia(g))});kn(d,a.configuration.forceWaitForTracks?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_METADATA,a.h,()=>f.resolve());d.error?f.reject(pp(a)):d.preload===_.Re&&(a.log.warn('With \x3cvideo preload\x3d"none"\x3e, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way. Please do not use preload\x3d"none" with PRESTOplay for Web Apps.'),f.resolve());a.h.one(d,_.q,()=>{f.reject(pp(a))});return new _.vp(f,
|
|
213
|
+
()=>{const g=new _.I(_.F,7,7001);f.reject(g);return Promise.resolve()})};xp=function(a,b){kn(b,HTMLMediaElement.HAVE_CURRENT_DATA,a.h,()=>{if(a.isLive()&&a.getState()!==_.ap){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)}))}})};
|
|
214
|
+
yp=function(a,b){let c=!1;a.h.on(b,_.Sf,()=>{c=b.paused});a.h.on(b,_.Rf,()=>{.2>b.duration-b.currentTime&&b.paused&&!c&&(a.log.warn("Player was auto-paused during seek to the end, auto-resuming."),b.play())})};_.Bp=function(a){0<=zp.indexOf(a)?Ap.warn(`Factory '${a.name()}' is already registered`):(zp.push(a),Ap.info(`Factory '${a.name()}' has been registered.`))};Cp=function(a,b){const c=zp.find(d=>d.a(a,b))||null;c&&Ap.info(`Chosen ads manager: ${c.name()}`);return c};
|
|
215
|
+
_.Dp=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};_.Ep=function(a,b){a.classList.add(b)};_.Fp=function(a,b){if(a&&typeof b===_.Se)for(const c in b)a.style[c]=b[c]};_.Gp=function(a){return document.createElement(a)};
|
|
216
|
+
Hp=function(a,b){const c=new MutationObserver(()=>{const d=Array.from(a.h.values());ri(Array.from(b.classList),Array.from(d))||b.classList.add(...d)});c.observe(b,{attributes:!0,attributeFilter:["class"]});return c};Ip=function(a,b){a.a&&0!==b.length&&(a.a.classList.add(b),a.h.add(b))};
|
|
217
|
+
Jp=function(a,b,c){(_.Nk()&&53===_.Ok().major||_.Nk()&&68===_.Ok().major||_.Pk())&&!b.hasAttribute(Nd)&&(b.style.opacity="0",b.setAttribute(Nd,""),a.j.one(b,fe,()=>{b.removeAttribute(Nd);b.style.opacity="1";c&&(c.style.opacity="1")}))};Kp=function(a){if(a.fb){let b=a.player.getDuration();a.maxDuration&&(b=Math.min(b,a.maxDuration));a.fb.a=b}a.de&&a.de()};Lp=function(a,b){return _.x(function*(){yield a.release();yield a.load(b)})};
|
|
218
|
+
Mp=function(a){if(a.sideAdContainer)a=a.sideAdContainer;else if(a=a.pg.getSurface().getContainer(),!a)throw Error("Primary player does not have a container");return a};
|
|
219
|
+
Op=function(a,b,c){return Array.from({length:2}).map((d,e)=>{var f=document.createElement(_.w);b.appendChild(f);d=a.ja.gb.create();f=new Np(f);d.init(f,c);d.setSourceIndex(0);const g=f.getContainer();if(!g)throw Error("Failed to create player surface container element");g.classList.add("secondary");f.getMedia().classList.add(`v-${e}`);a.A.push(g);return d})};Pp=function(a){return[a.a,...a.l.a.map(b=>b.player)]};
|
|
220
|
+
Qp=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.debug(`Show video element .${b}`),d.classList.add(sd),d.classList.remove("clpp-hide")):(a.g.debug(`Hide video element .${b}`),d.classList.remove(sd),d.classList.add("clpp-hide")),a.F&&a.F(d,c))};Rp=function(a){return a.h.find(b=>!!b.primary)||null};
|
|
221
|
+
eq=function(a,b,c){return _.x(function*(){if(a.w)a.g.warn(`Cannot ${c} item while busy (ID: ${b})`);else{var d=Sp(a,b);if(d){a.g.info(`${c} item (ID: ${b})`);a.w=!0;var e=a.f;e&&(e.player.isPaused()||(a.o?e.primary?Tp(a,e.Ja,Up):e.player.pause():e.player.pause()),e.primary?Tp(a,e.Ja,Up):Tp(a,e.Ja,Vp));var f=a.j.has(b);f&&a.j.delete(b);try{c===_.gf?(e&&d.primary?yield Wp(a,d):f?yield Xp(a,d):yield Yp(a,d),Kp(d)):f?a.g.error("Loading preloaded items is not supported"):yield Zp(a,d);$p(a,d);d.primary?
|
|
222
|
+
Tp(a,d.Ja,Vp):Tp(a,d.Ja,Up);d.fb&&aq(a,d,d.fb);if(d.Da)d.player.one(_.je,d.Da);d.kg&&d.kg(d.player.getDuration())}catch(g){throw a.g.error(`Item failed to ${c} (ID: ${b})`),g;}finally{a.w=!1,e&&bq(a,e),cq(a),dq(a,d.next)}}else a.g.warn(`Item not found (ID: ${b})`)}})};
|
|
223
|
+
$p=function(a,b){const c=b.transition;if(c&&!c.hi){if(c.Da){const d=c.Da,e=()=>{a.g.info(`Transition onEnded to (ID: ${d})`);a.play(d)};b.player.one(_.je,e);b.disposers.push(()=>{b.player.off(_.je,e)})}c.be&&fq(a,b,()=>{const d=a.f.fb;d&&(b.disposers.forEach(e=>e()),b.disposers=[],a.a.trigger(new _.D(_.Cc,{ad:d})),a.a.trigger(new _.D(_.nc,{ad:d})),a.a.trigger(new _.D(_.kc,{id:b.Ja})))});c.hi=!0}};
|
|
224
|
+
gq=function(a,b){return _.x(function*(){a.g.info("Crop ads by playout limit",b);var c=Rp(a),d=a.getCurrentItem();if(c&&d&&d.fb&&null!=c.X){var e=a.h.filter(l=>!l.primary),f=Math.max(...e.map(l=>l.rb));if(b>f)a.g.info("Playout limit is greater than ad pod duration, ignored.");else{var g=d.player.getPosition()+(d.rb-d.duration),h=e.sort((l,m)=>m.rb-l.rb)[0],k=c.X;b<=g?(c.X-=f-g,a.g.warn("Playout limit exceeded, immediately returning "+`to primary at ${c.X.toFixed(1)} instead of `+`${k.toFixed(1)}`),
|
|
225
|
+
yield eq(a,c.id,_.gf),h.Da&&h.Da(),c=d.fb,a.a.trigger(new _.D(_.Cc,{ad:c})),a.a.trigger(new _.D(_.nc,{ad:c})),a.a.trigger(new _.D(_.kc,{id:d.Ja}))):(a.g.warn("Limiting playout of ads to",b),(d=e.find(l=>b<=l.rb&&b>=l.rb-l.duration))?(e=b-(d.rb-d.duration),d.fb.a=e,c.X-=f-b,a.g.info("Last ad is now ",d.fb.wb(),"with cropped duration",e,"and primary will resume at",c.X.toFixed(1),"instead of",k.toFixed(1)),h.Da&&(d.Da=h.Da),d.transition={be:{position:e,itemId:c.id,X:c.X}},$p(a,d)):a.g.warn("Cannot find ad hit by limit"))}}})};
|
|
226
|
+
hq=function(a){return _.x(function*(){const b=a.f;b&&("loaded"!==b.state&&(yield b.Rc),yield b.player.play(),b.state=_.sf,Kp(b))})};iq=function(a,b){a.g.info("Add items",b);a.h=a.h.concat(b.map(c=>Object.assign({},c,{state:"idle",disposers:[],preloadPromise:Promise.resolve(),Rc:Promise.resolve()})))};jq=function(a,b){0!==a.h.length&&(b?(a.g.info("Remove items",b),a.h=a.h.filter(c=>!b.includes(c.id))):(a.g.info("Remove all items"),a.h=[]))};Sp=function(a,b){return a.h.find(c=>c.id===b)||null};
|
|
227
|
+
Tp=function(a,b,c){a.a.getConfiguration().muted||a.B?(a.a.setMuted(!0),kq(a,!0)):(a.ja.onAudioDecision&&(c=a.ja.onAudioDecision(b)),c===Vp?(a.a.setMuted(!1),kq(a,!0)):c===Up?(a.a.setMuted(!0),kq(a,!1)):a.g.warn("Audio decision not supported",c))};
|
|
228
|
+
Wp=function(a,b){return _.x(function*(){if(b.player){if(b.state===Bf){a.g.info("Wait for seek to finish");try{yield b.preloadPromise}catch(c){}}b.X&&(yield b.player.seek(b.X,!0));a.f=b;b.role=lq;Qp(a,b.player,!0);b.state="loading";a.o?Tp(a,b.Ja,Vp):yield b.player.play();b.state=_.sf}})};
|
|
229
|
+
Xp=function(a,b){return _.x(function*(){const c=b.player;if(c){if(b.state===Bf){a.g.info(Vb);try{yield b.preloadPromise}catch(d){}}a.f=b;b.role=lq;Qp(a,c,!0);b.state===Af?yield c.play():b.state===zf&&(yield Lp(c,b.config));b.state=_.sf}})};Yp=function(a,b){return _.x(function*(){yield Zp(a,b);yield b.player.play();b.state=_.sf})};
|
|
230
|
+
Zp=function(a,b){return _.x(function*(){const c=yield mq(a,!!b.primary);a.f=b;b.role=lq;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();Qp(a,c,!0);b.state="loading";b.Rc=Lp(c,b.config);yield b.Rc;b.state="loaded"})};
|
|
231
|
+
aq=function(a,b,c){const d=b.player,e=()=>{const l=d.getPosition(),m=c.getDuration();c.j=l;a.a.trigger(new _.D(_.wc,{ad:c}));!c.l&&l>=m/4&&(c.l=!0,a.a.trigger(new _.D(_.oc,{ad:c})));!c.o&&l>=m/2&&(c.o=!0,a.a.trigger(new _.D(_.uc,{ad:c})));!c.w&&l>=3*m/4&&(c.w=!0,a.a.trigger(new _.D(_.Dc,{ad:c})))},f=()=>{d.isEnded()||a.a.trigger(new _.D(_.vc,{ad:c}))},g=()=>{a.a.trigger(new _.D(_.xc,{ad:c}))},h=()=>{a.a.trigger(new _.D(_.lc,{ad:c}))},k=()=>{a.a.trigger(new _.D(_.Cc,{ad:c}));a.a.trigger(new _.D(_.nc,
|
|
232
|
+
{ad:c}));c.h===c.f&&a.a.trigger(new _.D(_.kc,{id:b.Ja}))};d.on(_.og,e);d.on(_.cf,f);d.on(_.sf,g);d.on(_.bd,h);d.one(_.je,k);b.disposers.push(()=>{d.off(_.og,e);d.off(_.cf,f);d.off(_.sf,g);d.off(_.bd,h);d.off(_.je,k)});1===c.h&&a.a.trigger(new _.D(_.jc,{id:b.Ja}));c.videoEl=d.getSurface().getMedia();a.a.trigger(new _.D(_.sc,{ad:c}));a.a.trigger(new _.D(_.zc,{ad:c}))};
|
|
233
|
+
bq=function(a,b){return _.x(function*(){const c=b.player;b.primary?(a.g.info("Pause primary playback"),a.o||Qp(a,c,!1)):(a.g.info(`Stop previous playback (ID: ${b.id})`),b.disposers.forEach(d=>d()),b.disposers=[],b.player=null,b.videoEl=null,b.role=nq,b.Ve?(a.g.info(`Release player (ID: ${b.id}) `+`after delay ${b.Ve} ms.`),yield new Promise(d=>{setTimeout(()=>_.x(function*(){yield oq(a,c);Qp(a,c,!1);a.a.trigger(new _.D("ad-hls-released"));d()}),b.Ve)})):(yield oq(a,c),Qp(a,c,!1)))})};
|
|
234
|
+
cq=function(a){return Promise.all(Array.from(a.j.keys()).map(b=>pq(a,b)))};dq=function(a,b){_.x(function*(){if(0!==b.length){a.g.info(`Preload items (IDs: ${b})`);var c=a.h.filter(d=>b.includes(d.id))||[];yield Promise.all(c.map(d=>qq(a,d)))}})};rq=function(a,b){const c=Rp(a);c?c.X=b:a.g.error("Failed to get primary item. Cannot configure resume position.")};sq=function(a){a.A.forEach(b=>a.C.removeChild(b));a.A=[];Qp(a,a.a,!0)};
|
|
235
|
+
fq=function(a,b,c){const d=b.transition.be;let e=null;d.X&&rq(a,d.X);const f=()=>{const k=b.player.getPosition();.5>=d.position-k&&(h(),g())},g=()=>{var k=b.player.getPosition();k>=d.position?(c(),a.g.info(`Transition onPosition to (ID: ${d.itemId}), `+`playback position: ${k.toFixed(3)} s, `+`transition point: ${d.position.toFixed(3)} s. `),a.play(d.itemId),k=!0):k=!1;k?e=null:e=requestAnimationFrame(g)},h=()=>{b.player.off(_.og,f)};b.player.on(_.og,f);b.disposers.push(()=>{null!=e&&(cancelAnimationFrame(e),
|
|
236
|
+
e=null)});b.disposers.push(h)};tq=function(a){a.f&&(a.f.disposers.forEach(b=>b()),a.f.disposers=[],a.f.fb&&aq(a,a.f,a.f.fb),$p(a,a.f),cq(a),dq(a,a.f.next))};pq=function(a,b){return _.x(function*(){const c=a.j.get(b);c&&(a.g.info(`Stop preloading item (ID: ${b})`),c.player&&(yield oq(a,c.player)),a.j.delete(b))})};oq=function(a,b){return _.x(function*(){b!==a.a&&(yield a.l.release(b))})};uq=function(a){return _.x(function*(){a.f&&(yield bq(a,a.f),Qp(a,a.a,!0))})};
|
|
237
|
+
mq=function(a,b){return _.x(function*(){if(b)return a.a;const c=yield a.l.get();if(!c)throw Error("No player available");return c})};
|
|
238
|
+
qq=function(a,b){return _.x(function*(){if(b.primary){b.state=Bf;a.j.set(b.id,b);if(b.X&&!a.o){var c=b.player;a.g.info("Preparing to resume at",b.X);Tp(a,b.Ja,Up);yield c.seek(b.X,!0)}b.state=Af}else{c=b.id;var d=yield mq(a,!1);b.player=d;b.videoEl=d.getSurface().getMedia();b.role=nq;b.state=Bf;try{a.j.set(c,b);b.config.autoplay&&(a.g.warn(ka+`Force disabling autoplay (ID: ${c})`),b.config.autoplay=!1);const e=a.a.getBandwidthEstimate();e&&(b.config.abr||(b.config.abr={}),b.config.abr.defaultBandwidthEstimate=
|
|
239
|
+
e);b.preloadPromise=Lp(d,b.config);yield b.preloadPromise;b.state=Af}catch(e){7001===e.code?(a.g.info(`Preload aborted (ID: ${c})`),b.state=yf):(a.g.warn(`Preload failed (ID: ${c})`,e),b.state=zf)}}})};kq=function(a,b){a.h.filter(c=>!c.primary&&c.player).forEach(c=>c.player.setMuted(b))};xq=function(a){return a.nf&&!(a.once&&a.tg)&&[vq,wq].includes(a.state)};yq=function(a){const b={URI:a.Ba[0].URI,DURATION:a.Ba[0].DURATION};a.ug&&(b[Zb]=a.ug);return{ASSETS:[b]}};
|
|
240
|
+
zq=function(a){return a&&a.ASSETS&&Array.isArray(a.ASSETS)?a.ASSETS.every(b=>typeof b.URI===_.cg&&typeof b.DURATION===_.t):!1};Aq=function(a,b){const c=a.f.getPosition();b>=c||a.a.filter(d=>1===d.td&&!d.once&&d.gg&&d.startTime>b).forEach(d=>{d.nf=!0})};Bq=function(a,b){return a.a.find(c=>!c.Hh&&1===c.td&&b>c.startTime&&b<c.endTime)||null};Eq=function(a,b,c){return _.x(function*(){if(!(yield Cq(a,b)))throw Error("Failed to bind");yield Dq(a,b,1,!1,c)})};
|
|
241
|
+
Fq=function(a,b){const c=a.f.getPosition();return a.a.filter(d=>1===d.td&&!d.Wg).sort((d,e)=>e.startTime-d.startTime).find(d=>d.startTime>c&&d.startTime<b)||null};
|
|
242
|
+
Mq=function(a,b){const c=()=>_.x(function*(){var e=b.getPosition(),f=Gq(a,e);f&&(a.g.info(`Interstitial ${f.ka} coming up `+`at ${f.startTime} s`),(yield Cq(a,f))&&Hq(a,f,b));if((f=Iq(a))&&f.state===vq&&b.getDuration()-e<a.ja.resolutionOffsetSec&&(yield Cq(a,f)))if(f.Ba&&0!==f.Ba.length){if(e=a.fa.getCurrentItem()){var g=Jq(a,f,2);if(0!==g.length){var h=g[0].id;e.next=[h];e.transition={Da:h};Kq(a,f,g);a.g.info(`Postroll interstitial ${f.ka} scheduled`)}}}else a.g.warn("Postroll interstitial has no assets, ignoring.")});
|
|
243
|
+
b.addEventListener(_.og,c);a.h.push(()=>{b.removeEventListener(_.og,c)});const d=()=>{Lq(a,!1,!0,!0)};b.addEventListener(_.ng,d);a.h.push(()=>{b.removeEventListener(_.ng,d)})};Nq=function(a){a.h.forEach(b=>b());a.h=[]};Oq=function(a){return(a=a.fa.getCurrentItem())&&!a.primary?a.player:null};
|
|
244
|
+
Lq=function(a,b,c,d){const e=Pq(a);a.g.info("Interstitial cues found",e);var f=e;if(d){f=ui(a.a.map(m=>m.ka),e.map(m=>m.id));Qq(a,f.di);const l=new Set(f.Og);f=e.filter(m=>l.has(m.id))}if(!Rq(a,f))return!1;const g=[],h=[],k=[];f.forEach(l=>{const m=l.customAttributes.CUE||[];m.includes(_.sb)?h.push(l):!d&&m.includes("PRE")?g.push(l):!c&&l.startTime<a.ja.Yh?g.push(l):k.push(l)});1<g.length?a.g.warn("Multiple preroll interstitials not supported. Will display only the 1st one."):g[0]&&Sq(a,g[0],b);k.forEach(l=>
|
|
245
|
+
Tq(a,l,1));1<h.length?a.g.warn("Multiple postroll interstitials not supported. Will display only the 1st one."):h[0]&&Tq(a,h[0],2);Uq(a,e);a.g.info("Interstitials changed",a.a);return 0<g.length};
|
|
246
|
+
Vq=function(a){_.x(function*(){var b=a.fa;iq(b,[{id:Df,primary:!0,config:b.a.getConfiguration(),next:[],rb:0,duration:0,Ja:null}]);var c=Rp(b);if(!c)throw Error("Failed to find primary item");b.f=c;c.role=lq;c.player=b.a;c.videoEl=c.player.getSurface().getMedia();Qp(b,c.player,!0);b=a.f;c=b.getConfiguration();a.j=Lq(a,!c.autoplay,b.isLive(),!1);if(a.j){if(b=a.fa,c=b.l,c=c.a[0]?c.a[0].player:null)b.o||Qp(b,b.a,!1),Qp(b,c,!0)}else c.autoplay&&(yield hq(a.fa))})};
|
|
247
|
+
Pq=function(a){return a.f.getTimelineCues().filter(b=>b.schemeIdUri===_.Fd&&b.customAttributes)};Qq=function(a,b){const c=new Set(b);a.a.forEach(d=>{c.has(d.ka)&&!xq(d)&&a.g.warn("Removing an interstitial in active state",d)});a.a=a.a.filter(d=>!c.has(d.ka))};
|
|
248
|
+
Rq=function(a,b){var c=b.sort((h,k)=>h.startTime-k.startTime);const d=a.ja.resolutionOffsetSec;let e=Infinity;const f=[];for(let h=0;h<c.length-1;h++){const k=c[h],l=c[h+1];l&&(e=Math.min(e,l.startTime-k.endTime));l&&l.startTime<=k.endTime&&f.push(`Interstitials ${k.id} and ${l.id} `+"overlap.")}e<d&&(c=e/2,a.ja.resolutionOffsetSec=c,a.g.info("Interstitials are closer than configured "+`resolutionOffsetSec (${d} s) auto-reconfiguring to `+`${c} s.`));const g=[];b.forEach(h=>{const k=h.customAttributes[_.ac];
|
|
249
|
+
h.customAttributes[_.$b]||k||g.push(`Interstitial cue ${h.id} is invalid `+"it contains neither X-ASSET-LIST nor X-ASSET-URI.")});0<g.length?a.g.error("Invalid interstitials, all interstitials will "+`be skipped. ${g.join(" ")}`):0<f.length&&a.g.warn("Unsupported format of interstitials, playback may not "+`behave correctly. ${f.join(" ")}`);return 0===g.length};
|
|
250
|
+
Sq=function(a,b,c){_.x(function*(){var d=Tq(a,b,0);const e=yield Cq(a,d),f=d.Ba?d.Ba.length:0;if(e&&0<f)try{{const h=Dq(a,d,0,c);a.g.info(`Preroll interstitial ${d.ka} scheduled`);var g=h}yield g}catch(h){a.g.error("Preroll interstitial failed.",h),(d=Rp(a.fa))&&(yield a.fa.play(d.id))}else e?a.g.warn("Preroll interstitial has no assets, skipping"):(a.g.error("Preroll interstitial failed, skipping"),yield uq(a.fa)),c||(yield hq(a.fa))})};
|
|
251
|
+
Tq=function(a,b,c){{const r=b.customAttributes[_.ac],u=b.customAttributes[_.$b],v=b.customAttributes[_.gc],y=b.customAttributes[_.bc];var d=b.customAttributes[_.cc]||[];b.customAttributes[ic]||(b.customAttributes[ic]=null==v||0<v?"RANGE":"POINT");var e=b.id,f=b.startTime,g=b.endTime,h=vq,k=null==v?null:Math.max(0,b.startTime+v),l="POINT"===b.customAttributes[ic],m=!d.includes("SKIP");d=!d.includes("JUMP");{const A=b.customAttributes[Zb];if(A)try{var n=JSON.parse(atob(A))}catch(E){n=null}else n=null}b=
|
|
252
|
+
{ka:e,startTime:f,endTime:g,state:h,vf:u,wf:r,Ba:null,X:k,fi:v,ec:y,td:c,Hh:l,Xg:m,Wg:d,ug:n,gg:null!=v&&0>v,once:(b.customAttributes.CUE||[]).includes("ONCE"),tg:!1,nf:!0}}a.a.push(b);return b};
|
|
253
|
+
Uq=function(a,b){_.x(function*(){const c=a.fa.getCurrentItem();if(c)if(c.primary)a.a.forEach(g=>{const h=b.find(k=>k.id===g.ka);if(h){const k=h.customAttributes[_.bc];null==g.ec&&null!=k&&(a.g.info(Rb,h.id,"Playout limit",k),g.ec=k)}});else{var d=b.find(g=>g.id===c.Ja);if(d){var e=d.customAttributes[_.bc];if(null!=e){var f=a.a.find(g=>g.ka===d.id);f&&null==f.ec&&(a.g.info(Rb,d.id,"Playout limit",e),f.ec=e,yield gq(a.fa,e))}}}})};
|
|
254
|
+
Cq=function(a,b){return _.x(function*(){b.state=Wq;if(b.vf)try{a.g.info(`Load X-ASSET-LIST for ${b.ka}`);a.Ya(new _.D(pc));const c=yield Xq(a,b.vf);b.Ba=c.ASSETS;b.Ba&&0!==b.Ba.length||a.g.info(`Interstitial ${b.ka} has no assets, `+"will be smoothly skipped");if(null==b.X){const d=Si(b.Ba.map(e=>e.DURATION));b.X=b.startTime+(null==b.ec?d:Math.min(b.ec,d))}b.state=Yq;a.Ya(new _.D(qc));a.Ya(new _.D(rc,{id:b.ka,detail:c}))}catch(c){a.g.error("Failed to load X-ASSET-LIST",c),b.state=Zq}else b.wf?(b.Ba=
|
|
255
|
+
[{URI:b.wf,DURATION:b.endTime-b.startTime}],a.Ya(new _.D(rc,{id:b.ka,detail:yq(b)})),b.state=Yq):b.state=Zq;return b.state===Yq})};Dq=function(a,b,c,d,e){return _.x(function*(){if(a.fa.getCurrentItem()){var f=Jq(a,b,c);if(0!==f.length){Kq(a,b,f);if(0!==c||!a.f.isLive()){const g=e||b.X;g&&rq(a.fa,g)}d?yield a.fa.load(f[0].id):yield a.fa.play(f[0].id)}}})};Gq=function(a,b){return a.a.find(c=>{const d=c.startTime-b;return 1===c.td&&xq(c)&&0<d&&d<=a.ja.resolutionOffsetSec})||null};
|
|
256
|
+
Hq=function(a,b,c){if(b.Ba)if(0===b.Ba.length){const g=()=>{c.isLive()?a.g.info("Skipping empty "+`live interstitial ${b.ka}`):null!=b.X&&0!==b.fi?c.seek(b.X):a.g.info(`Empty VOD interstitial ${b.ka}, `+"continuing to next segment")};c.one(_.lg,g);a.h.push(()=>{c.off(_.lg,g)});a.g.info(`Interstitial ${b.ka} scheduled to `+"be skipped")}else{var d=a.fa.getCurrentItem();if(d){var e=Jq(a,b,1);if(0!==e.length){var f=e[0].id;null!=b.X&&rq(a.fa,b.X);d.next=[f];d.transition={be:{position:b.startTime,itemId:f,
|
|
257
|
+
X:b.X}};Kq(a,b,e);a.g.info(`Interstitial ${b.ka} scheduled for `+`${b.startTime} s`)}}}};Iq=function(a){return a.a.find(b=>2===b.td)||null};Xq=function(a,b){return _.x(function*(){var c=a.fa.Od();if(!c)throw Error("No player found");c=c.getNetworkEngine();const d=_.Bj($q(a,b));c=yield Oj(c,d);if(!zq(c))throw new _.zi("Invalid X-ASSET-LIST list response");return c})};$q=function(a,b){return(a=a.ja.Xh)?(b=new URL(b),b.searchParams.set("_HLS_primary_id",a),b.toString()):b};
|
|
258
|
+
Jq=function(a,b,c){let d=0,e=b.Ba.map((h,k)=>{const l=`${b.ka}-${k}`;d+=h.DURATION;return{id:l,config:{source:{url:$q(a,h.URI),type:_.zl}},duration:h.DURATION,rb:d,Ja:b.ka,next:[],fb:new Q(c,k+1,b.Ba.length,h.DURATION,b.ka,b.Xg)}});e.forEach((h,k)=>{const l=k===e.length-1;l&&2===c||(l?(h.next=[Df],h.transition={Da:Df}):(k=l?Df:`${h.Ja}-${k+1}`,h.next=[k],h.transition={Da:k}))});e.forEach(h=>{h.de=()=>{a.g.info(`Playing interstitial asset ${h.id}`,h)}});if(null!=b.ec&&(e=ar(a,b,e),0===e.length))return[];
|
|
259
|
+
const f=e[0].de;e[0].de=()=>{b.tg=!0;b.gg&&(b.nf=!1);a.g.info(`Playing interstitial ${c} ${b.ka} with `+`${b.Ba.length} assets and will resume primary `+`content ${b.X?`at ${b.X.toFixed(1)} s`:"after interstitial ended"}.`,e);f()};e[0].kg=h=>{null==b.X&&(b.X=b.startTime+h,rq(a.fa,b.X),a.g.info("Primary content will resume at",b.X));b.state=br};const g=e[e.length-1];g.Da=()=>{b.state=wq;jq(a.fa,e.map(h=>h.id));2===c&&uq(a.fa)};g.Ve=a.ja.adReleaseDelayMs;return e};
|
|
260
|
+
Kq=function(a,b,c){iq(a.fa,c);tq(a.fa);b.state=cr;a.Ya(new _.D(_.tc,{detail:null}))};
|
|
261
|
+
ar=function(a,b,c){const d=b.ec;a.g.info(`Playout limit for ${b.ka} is `+`${d} s`);b=c[c.length-1].rb;if(d>=b)return a.g.info(`Playout limit (${d}) is`+`larger or equal to total duration: (${b}).`),c;if(0>=d)return a.g.info("Discarding all ads."),[];const e=c.filter(f=>f.rb-f.duration<=d);e.forEach(f=>{f.fb.f=e.length});a=e[e.length-1];c=d-(a.rb-a.duration);.1>Math.abs(c-a.duration)?a.transition.Da=Df:a.transition.be={position:c,itemId:Df,X:null};a.maxDuration=c;return e};
|
|
262
|
+
dr=function(){try{const a=URL.createObjectURL(new Blob);URL.revokeObjectURL(a);return a.slice(a.lastIndexOf("/")+1)}catch(a){let b=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,c=>{const d=(b+16*Math.random())%16|0;b=Math.floor(b/16);return("x"===c?d:d&3|8).toString(16)})}};
|
|
263
|
+
hr=function(a){a.a.on(window,"offline",()=>{er(a,!1)});a.a.on(window,"online",()=>{a.f||fr(a)});a.a.on(a.m,Yf,()=>gr(a));a.a.on(a.m,"suspend",()=>gr(a));a.a.on(a.m,_.Og,()=>gr(a));a.a.on(a.m,_.sf,()=>{a.f||fr(a)});a.a.on(a.m,_.Ef,()=>{a.f||fr(a)});a.a.on(a.m,_.$f,()=>{switch(a.m.getState()){case _.dp:gr(a);break;default:gr(a)}})};ir=function(a){a.h&&(a.h.stop(),a.h=null)};gr=function(a){a.f&&fr(a)};
|
|
264
|
+
jr=function(a){return _.x(function*(){var b=a.m.getConfiguration().connectivityCheck;b&&a.m&&(b=yield Rj(a.j,b.url,b.attemptParameters,b.method),er(a,b))})};fr=function(a){a.m.getConfiguration().connectivityCheck&&(ir(a),a.h=(new _.Gk(()=>jr(a))).ia(5))};er=function(a,b){ir(a);a.f!==b&&(a.f=b,a.m&&a.m.getConfiguration().connectivityCheck&&a.m.trigger(new _.D(Ze,{online:a.f})))};lr=function(){for(let a=0;a<kr.length;++a)kr[a].Fc()};
|
|
265
|
+
_.mr=function(a){var b=b||0;a={priority:b,Fc:a};for(let c=0;c<kr.length;c++)if(kr[c].priority<b){kr.splice(c,0,a);return}kr.push(a)};nr=function(a,b){a.onError(b);a.release().then(()=>a.destroy())};
|
|
266
|
+
pr=function(a){var b=or;const c={kty:"RSA",n:b.n,e:b.e},d=a.h+"."+a.f,e=a.j;return new Promise(function(f,g){let h;try{h=window&&window.crypto&&window.crypto.subtle}catch(l){}if(h){var k={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};h.importKey("jwk",c,k,!1,["verify"]).then(function(l){const m=_.mj(d),n=_.Yl(e);return h.verify(k,l,n.buffer,m.buffer)}).then(function(l){l?f():g(new _.zi("Signature Verification failed",sg))}).catch(g)}else f()})};
|
|
267
|
+
rr=function(a){if(!a.a){var b=a.f.split(".");if(3!==b.length)throw Error("Expected to find 3 data sections in JWT raw data");b=new qr(b[0],b[1],b[2]);a.a=b}return a.a};sr=function(a){return _.x(function*(){var b=rr(a);try{yield pr(b)}catch(c){if(c&&c.code===sg)throw c;{b=window.location.href;const d=new _.Ci(b);b=d.Ab||d.$a?d:new _.Ci("//"+b)}if(!/(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^localhost)/.test(b.$a))throw c;}})};
|
|
268
|
+
tr=function(a){switch((a.ga[0]||{src:"",type:""}).type){case _.Kc:a="dash";break;case _.Pc:a="ss";break;case _.zl:a="hls";break;case _.Ig:a="mp4";break;default:a=""}return a};ur=function(a){return a.viewerId?a.viewerId:(a=a.drm||null)&&a.customData&&a.customData.userId?`${a.customData.userId}`:""};vr=function(a){return(a=a.drm||null)&&a.customData&&a.customData.assetId?`${a.customData.assetId}`:""};
|
|
269
|
+
wr=function(a){return(a=a.drm||null)&&a.customData&&a.customData.sessionId?`${a.customData.sessionId}`:""};xr=function(a){a=a.drmInfo;return(new _.Ci(a&&a.licenseServerUri||"")).$a};yr=function(a){const b=a.configuration;let c="no";b.drm&&!_.uh(b.drm,{})&&(c="custom",b.drm.env&&b.drm.env.toLowerCase().startsWith(ee)||xr(a).endsWith("drmtoday.com"))&&(c=ee);return c};zr=function(a){a=a.drmInfo;let b="";if(a)switch(a.keySystem){case _.Jd:b="wv";break;case _.Hd:b="pr";break;case _.Ed:b="fps"}return b};
|
|
270
|
+
Ar=function(a){a=a.drmInfo;let b=!1;a&&(b=a.persistentStateRequired);return b.toString()};Br=function(a){a=a.drmInfo;let b="";if(a)switch(a.videoRobustness){case Xa:case Va:b="L1";break;case Wa:b="L2";break;case _.Db:case _.Cb:b="L3"}return b};
|
|
271
|
+
Fr=function(a,b){const c="ie"===_.il().browser;var d=b.configuration;const e=[...Array.from(_.Kl.keys()),...b.og];b={"CL-KEY":a.f,"CL-LOCATION":window.location.href,"CL-SDK-VERSION":_.ea,"CL-USER-ID":ur(d),"CL-ASSET-ID":vr(d),"CL-SESSION-ID":wr(d),"CL-PLAYBACK-TYPE":b.isLive?Cr:Dr,"CL-CONTENT-TYPE":tr(b),"CL-PLUGINS":e.join(" "),"CL-DRM":yr(b),"CL-DRM-CDM":zr(b),"CL-DRM-SEC-LEVEL":Br(b),"CL-DRM-OFFLINE":Ar(b),"CL-DRM-IP":xr(b)};c&&(d=window.localStorage.getItem("cl_et"))&&(b["CL-ETAG"]=d);d=_.Bj(["https://downloads.castlabs.com/r/register/"]);
|
|
272
|
+
d.method="GET";d.headers=b;return(new _.Er).fetch(d).V.then(f=>{200===f.status&&c&&window.localStorage.setItem("cl_et",f.headers.etag);return Promise.resolve()}).catch(f=>{a:{var g=rr(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+"!";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.";
|
|
273
|
+
break;default:g=Promise.resolve();break a}a.g.error(ab+k);g=Promise.reject(new _.I(_.F,7,g,k))}}return g})};Jr=function(a){try{const b=a.split(",").map(c=>{const d={};c=c.split(";");for(let e=0;e<c.length;e++){const {key:f,value:g}=Gr(c[e]);Object.keys(Hr).includes(f)&&(d[Hr[f]]=g)}return d}).filter(c=>_.oh(c));return 0<b.length?b:null}catch(b){return Ir.error("CmsdManager parseCmsdDynamicHeader_ failed:",b),null}};
|
|
274
|
+
Gr=function(a){var b=a.split("\x3d");const c=b[0];b=b[1];if(!c)throw new _.zi("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 _.zi(`Parsing CMSD, not recognized value type of ${a}`);};
|
|
275
|
+
Lr=function(a){return b=>{{var c=b.headers;let e=b=null;var d=yh(c,"cmsd-dynamic");c=yh(c,"cmsd-static");d&&(b=Jr(d),a.a=b);if(c)try{d={};const f=c.split(",");for(c=0;c<f.length;c++){const {key:g,value:h}=Gr(f[c]);Object.keys(Kr).includes(g)&&(d[Kr[g]]=h)}e=_.oh(d)?d:null}catch(f){Ir.error("CmsdManager parseCmsdStaticHeader_ failed:",f),e=null}(b||e)&&a.m.trigger(new _.D("cmsd-event",{Qi:b,bj:e}))}}};_.Nr=function(a){a&&(0<=Mr.indexOf(a)||Mr.push(a))};
|
|
276
|
+
Pr=function(a){if(!a.h&&a.A&&a.a&&a.f.ads.hls.enable&&a.getTimelineCues().some(b=>b.schemeIdUri===_.Fd)){const b=a.f.mse.sendPlaybackSessionIdHeader?a.G:null;a.h=new Or;a.h.w(a.a,a.A,b)}};Rr=function(a,b){a.F=new Qr(b);sr(a.F).catch(c=>{setTimeout(()=>{a.g.error(ab+c);a.trigger(new _.D(_.q,{detail:new _.I(_.F,7,7101)}));a.destroy()},1E3)})};Tr=function(a,b){a.W=b;for(const c of a.W)(b=c.id())&&(a.K[b]=c);_.Sr(a,"onPlayerCreated")};
|
|
277
|
+
_.Ur=function(a,b,c){c=void 0===c?null:c;null!=b&&b===a.a?a.a.forwardEventsTo(a):(a.a&&(a.a.stopForwardingEventsTo(a),a.a.destroy(),a.a=null,a.A=null),b&&(b.init(a.j,a.C),b.setNetworkEngine(a.getNetworkEngine()),b.forwardEventsTo(a),a.a=b,a.A=c))};
|
|
278
|
+
Vr=function(a,b){_.x(function*(){a.j.getMedia()||a.j.getCastElement();a.F||(a.F=new Qr(a.f.license));try{a.g.debug("Verifying license remotely"),yield Fr(a.F,b),a.g.debug("License verified remotely")}catch(c){a.g.debug("License rejected by remote",c),setTimeout(nr,1E3,{release:a.release.bind(a),destroy:a.destroy.bind(a),onError:a.onError.bind(a)},c)}})};_.Sr=function(a,b,...c){if(!a.Y)return Promise.resolve();const d=a.W.map(e=>e[b].call(e,a,...c)).filter(e=>e instanceof Promise);return Promise.all(d)};
|
|
279
|
+
Wr=function(a){return _.x(function*(){if(a.R)return a.g.debug("The player is already released. No-op"),new Promise(b=>b());a.$.off(document,Mg);a.trigger(new _.D(_.If));a.j&&a.j.release();a.h&&(yield a.h.h(),a.h=null);a.B&&(yield a.B.release(),a.B=null);if(a.a){let b=null;const c=a.a.on(_.$f,d=>{b=d});return _.Sr(a,_.Xe).then(()=>{a.a.stopForwardingEventsTo(a);return Promise.all([a.a.release(),a.I.release()])}).then(()=>{a.g.debug("Releasing player completed");b&&(a.g.debug("Re-post state change event after release"),
|
|
280
|
+
a.trigger(b))}).finally(()=>{a.a.off(_.$f,c);a.trigger(new _.D(Hf))})}a.trigger(new _.D(Hf));return new Promise(b=>b())})};Xr=function(a){a.G&&(a.g.info("Playback session ended, ID:",a.G),a.G=null,a.a&&a.a.setPlaybackSessionId(null))};Yr=function(a,b){const c=Lh(d=>d.f(_.rb)&&a.every(e=>2===d.canPlay(e,b)));if(!c)throw new _.I(_.F,7,7003,"No compatible player implementing playlist mode found!");return{gb:c,player:c.create(),sourceIndex:0}};
|
|
281
|
+
$r=function(a,b,c){if(a.M===_.rb)b=Yr(b,c);else if(2!==(a.a?a.a.canPlay(b[0],c):0)||a.S){a.S=!1;if(b){var d=a=null;for(var e=0;e<b.length;e++);e=Object.values(_.Ih);for(let f=0;f<b.length;f++)for(let g=0;g<e.length;g++){const h={gb:e[g],confidence:e[g].canPlay(b[f],c)};if(null===a||a.confidence<h.confidence)a=h,d=f}a&&typeof d===_.t&&0<a.confidence?(_.Jh.debug("Player Factory '"+a.gb.a()+"' can play",b[d]),b=new Zr(a.gb,d)):(_.Jh.debug("No compatible Player Factory found for sources:",b),b=null)}else b=
|
|
282
|
+
null;if(!b)throw new _.I(_.F,7,7003,"No player factory compatible with given sources found!");c=b.gb;a=c.create();b={gb:c,player:a,sourceIndex:b.sourceIndex}}else b={gb:a.A,player:a.a,sourceIndex:0};return b};
|
|
283
|
+
_.es=function(a,b,c){return _.x(function*(){if(a.O)throw new _.I(_.F,7,7E3,"Player is already destroyed.");if(!a.j)throw new _.I(_.F,7,7E3,"No surface associated with this player!");_.Kn(nf);yield a.release();var d=c||_.np(b);if(!b||0===d.length)throw new _.I(_.F,7,7003,lb);a.da=d;a.f=_.Il(a.C,b,{source:d});a.R=!1;d=$r(a,d,a.f);_.Ur(a,d.player,d.gb);as(a,a.a);a.a&&a.a.setSourceIndex(d.sourceIndex);bs(a);a.a&&a.a.setCdnErrorCallback(a.L);cs(a,a.f);ds(a);if(a.f.pauseWhenInBackground)a.$.on(document,
|
|
284
|
+
Mg,()=>{document.hidden?(a.g.debug("Player is hidden: pausing..."),a.pause()):(a.g.debug("Player is visible: resuming..."),a.play())});Rl(a);yield _.Sr(a,"onContentWillLoad",a.f.source[d.sourceIndex]);_.Kn(mf);_.Mn("player.beforeLoad",nf,mf)})};_.fs=function(a){return _.x(function*(){a.j.getMedia()||a.j.getCastElement();a.trigger(new _.D(Ge));yield Promise.all([a.a.load(a.f),a.h?a.h.load():Promise.resolve()])})};
|
|
285
|
+
_.hs=function(a){return _.x(function*(){_.Kn(jf);Vr(a,{configuration:a.getConfiguration(),ga:a.Wf(),drmInfo:a.getDrmInfo(),og:Object.keys(a.K),isLive:a.isLive()});gs(a);Sl();yield _.Sr(a,_.Ue);a.f.autoplay&&(a.h?a.h.o():1)&&(yield a.play());_.Kn(hf);_.Mn("player.afterLoad",jf,hf)})};is=function(a){return _.x(function*(){if(a.a){var b=a.a;b.zg?(a.trigger(new _.D(Ge)),yield b.zg(),yield _.hs(a)):a.g.warn(yb)}else a.g.warn(ub)})};
|
|
286
|
+
as=function(a,b){try{var c=crypto.randomUUID()}catch(d){c=dr()}a.g.info("Playback session started, ID:",c);b.setPlaybackSessionId(c);a.G=c};bs=function(a){a.a&&a.a.setDrmCustomDataModifier(b=>_.x(function*(){a.Lc&&a.ue&&(a.ue=!1,yield a.Lc(b))}))};cs=function(a,b){if(b=Cp(a,b))a.h=b.create(a)};ds=function(a){a.B=new js(a);a.a.setCmsdManager(a.B)};
|
|
287
|
+
ks=function(a){const b=_.pi(a.f.preferredTextLanguage).filter(f=>f),c=a.f.preferForcedSubtitles,d=a.getTrackManager().na().filter(f=>c?f.kind===_.le:f.kind!==_.le);if(0===d.length)c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles are available.");else{if(c&&0===b.length){var e=a.getTrackManager().ra();e&&e.language?(e=_.Qi(e.language||""),b.push(e)):(e=a.getTrackManager().Ia())&&e.language&&(e=_.Qi(e.language||""),b.push(e));0===b.length&&a.g.warn("Forced subtitles are configured to be preferred, but neither the preferred text language is set, nor the audio or video track language is available to determine which forced subtitles language to select.")}b.some(f=>
|
|
288
|
+
{const g=_.Qi(f);if(f=d.find(h=>{h=_.Qi(h.language||"");return _.Ri(h,g)}))return a.getTrackManager().Xa(f),!0;c&&a.g.warn("Forced subtitles are configured to be preferred, but no forced subtitles match the preferred languages: ",b);return!1})}};gs=function(a){_.x(function*(){const b=[];if(a.f.remoteTextTracks)for(const c of a.f.remoteTextTracks)b.push(a.getTrackManager().addTextTrack(c));yield Promise.all(b);ks(a)})};ls=function(a){a.J.forEach(b=>b());a.J=[]};
|
|
289
|
+
os=function(a,b){return _.x(function*(){try{_.Kn(rf);a.M=_.rb;a.Y=!1;const c=b.slice(1).map(d=>({config:d,ga:_.np(d)}));yield _.es(a,b[0]);c.forEach(d=>{ms(a,d.config,d.ga)});a.trigger(new _.D(Ge));yield a.a.setupPlaylist(b);yield _.hs(a);c.forEach(d=>{ns(a,d.config,d.ga)});_.Kn(qf);_.Mn("player.setupPlaylist",rf,qf)}catch(c){if(a.l)throw a.g.info(bb),new _.I(_.F,7,7E3);throw c;}})};
|
|
290
|
+
ps=function(a,b){const c=d=>{a.H=a.o.findIndex(e=>e.id===d.id)};a.addEventListener(_.Of,c);a.J.push(()=>{a.removeEventListener(_.Of,c)});if(b.endTime){const d=b.endTime,e=()=>{a.getPosition()>=d&&(a.removeEventListener(_.og,e),a.g.info("Playlist end time reached. Stopping playback."),a.trigger(new _.D(_.Nf)),a.pause())};a.addEventListener(_.og,e);a.J.push(()=>{a.removeEventListener(_.og,e)})}};
|
|
291
|
+
qs=function(a,b){return _.x(function*(){try{_.Kn(lf);const c=_.np(b);ms(a,b,c);yield a.a.appendLoad(b);ns(a,b,c);_.Kn(kf);_.Mn("player.appendLoad",lf,kf)}catch(c){if(a.l)throw a.g.info(bb),new _.I(_.F,7,7E3,{id:b.id});throw c;}})};
|
|
292
|
+
ms=function(a,b,c){if(0===c.length)throw new _.I(_.F,7,7003,{message:lb,id:b.id});if(1<c.length)throw new _.I(_.F,7,7003,{message:"Multiple sources not supported!",id:b.id,source:c});if(2!==(a.a?a.a.canPlay(c[0],a.f):0))throw new _.I(_.F,7,7003,{message:"Source not supported by the current player!",id:b.id,source:c[0]});};ns=function(a,b,c){Vr(a,{configuration:b,ga:c,drmInfo:a.getDrmInfo(),og:Object.keys(a.K),isLive:c[0].isLive})};
|
|
293
|
+
rs=function(a,b){const c=document.getElementById(a);if(!c)throw Error("Anchor element not found");c.classList.add(rd);return Array.from({length:3}).map(()=>{const d=document.createElement(_.w);d.classList.add("clpp-mc-playlist-video-el");const e=document.createElement(_.Sd);e.classList.add("clpp-mc-playlist-item");e.appendChild(d);c.appendChild(e);return new R(d,b)})};
|
|
294
|
+
ss=function(a,b,c){const d=b.getSurface().getMedia();b=b.getSurface().getUniqueCssClass();d&&(c?(a.g.info(`Show video element .${b}`),d.classList.add(sd)):(a.g.info(`Hide video element .${b}`),d.classList.remove(sd)),a.w&&a.w(d,c))};vs=function(a,b){return _.x(function*(){const c=yield a.o.get();a.f=b;b.role=ts;a.f.player=c;a.f.videoEl=c.getSurface().getMedia();ss(a,c,!0);yield c.load(b.config);us(a,b);b.config.autoplay||(yield c.play())})};
|
|
295
|
+
zs=function(a){_.x(function*(){if(0===a.a)yield ws(a);else if(a.a===a.h.length-1)yield xs(a);else{const b=[a.a-1,a.a+1];a.g.info(`Preload items (indices: ${b})`);yield Promise.all(b.map(c=>ys(a,c)))}})};
|
|
296
|
+
As=function(a,b){return _.x(function*(){if(b.player){if(b.state===Bf){a.g.info(Vb);try{yield b.preloadPromise}catch(c){}}a.f=b;b.role=ts;ss(a,b.player,!0);b.state===Af?(_.Kn(xf),a.ja.preloadMedia?yield b.player.play():yield is(b.player),_.Kn(wf),_.Mn("playlist.next",xf,wf)):b.state===zf&&(yield b.player.load(b.config));us(a,b);b.config.autoplay||(yield b.player.play())}})};
|
|
297
|
+
Ds=function(a,b){return _.x(function*(){a.g.info(`Stop current playback (index: ${b.index})`);b.player.pause();ss(a,b.player,!1);yield Bs(a,b);b.player=null;b.videoEl=null;b.role=Cs})};Fs=function(a){return Promise.all(Array.from(a.l.keys()).map(b=>Es(a,b)))};Gs=function(a){return _.x(function*(){yield a.o.destroy();const b=document.getElementById(a.ja.anchorId);b&&(b.classList.remove(rd),b.innerHTML="")})};
|
|
298
|
+
Es=function(a,b){return _.x(function*(){const c=a.l.get(b);c&&(a.g.info(`Stop preloading item (index: ${b})`),c.player&&(yield Bs(a,c)),a.l.delete(b))})};Bs=function(a,b){return _.x(function*(){b.disposers.forEach(c=>c());b.disposers=[];b.player&&(yield a.o.release(b.player))})};us=function(a,b){if(a.ja.autoplayNext){const c=()=>{a.g.info("Automatically transition to next item");a.ng()};b.player.on(_.je,c);const d=b.player;b.disposers.push(()=>{d.off(_.je,c)})}};
|
|
299
|
+
ys=function(a,b){return _.x(function*(){const c=yield a.o.get(),d=a.h[b];d.player=c;d.videoEl=c.getSurface().getMedia();d.role=Cs;d.state=Bf;a.trigger(new _.D(vg));try{a.l.set(b,d),a.ja.preloadMedia?(d.config.autoplay&&(a.g.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=Af,a.trigger(new _.D(vg))}catch(e){7001===e.code?(a.g.info(`Preload aborted (index: ${b})`),d.state=yf):
|
|
300
|
+
(a.g.warn(`Preload failed (index: ${b})`,e),a.trigger(new _.D(_.q,{detail:e})),d.state=zf),a.trigger(new _.D(vg))}})};ws=function(a){return _.x(function*(){const b=a.a+1;a.g.info(`Preload following item (index: ${b})`);yield ys(a,b)})};xs=function(a){return _.x(function*(){const b=a.a-1;a.g.info(`Preload preceding item (index: ${b})`);yield ys(a,b)})};
|
|
301
|
+
_.Is=function(a){if(Hs.has(a))return Hs.get(a);if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported(a);Hs.set(a,b);return b}return window.MediaSource?(b=MediaSource.isTypeSupported(a),Hs.set(a,b),b):!1};Js=function(a,b){b=b.replace(/mp2t/i,"mp4");a===_.p&&(b=b.replace(_.w,_.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};
|
|
302
|
+
Ks=function(a){const b=a.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();let c;typeof Event===_.ne?c=new Event(b,a):(c=document.createEvent("Event"),c.initEvent(b,a.bubbles,a.cancelable));a.target.dispatchEvent(c)};Ls=function(a){a=a.target;if(a.webkitPresentationMode===ff){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)};
|
|
303
|
+
Ms=function(){return this.webkitSupportsPresentationMode(ff)?(this.webkitSetPresentationMode(ff),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))};Ns=function(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))};
|
|
304
|
+
Rs=function(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}};Ss=function(a,b,c){return new window.TextTrackCue(a,b,c)};Ts=function(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)};Vs=function(a,b,c){if("input"===a)switch(this.type){case "range":a=nd}Us.call(this,a,b,c)};Ws=function(){return window.performance&&window.performance.now?window.performance.now():Date.now()};
|
|
305
|
+
Xs=function(a){return Ws()-a.a};Zs=function(a){const b=new Ys;b.a=a.a;return b};_.$s=function(a){const b=[];for(const c of a)for(const d of c.variants)b.push(d);return b};_.bt=function(a,b,c,d){return _.x(function*(){try{return new (yield at(a,b,c,d))}catch(e){throw e.a(_.F),e;}})};
|
|
306
|
+
at=function(a,b,c,d){return _.x(function*(){if(d){var e=_.ct[d.toLowerCase()];if(e)return e;_.C("Could not determine manifest type using MIME type ",d)}if(e=_.dt(a)){const f=_.et[e];if(f)return f;_.C("Could not determine manifest type for extension ",e)}else _.C("Could not find extension for ",a);if(!d&&(d=yield ft(a,b,c))){if(e=_.ct[d])return e;_.C("Could not determine manifest type using MIME type",d)}throw new _.I(_.F,4,4E3,{url:a});})};
|
|
307
|
+
_.dt=function(a){a=(new _.Ci(a)).Ka.split("/").pop().split(".");return 1===a.length?"":a.pop().toLowerCase()};ft=function(a,b,c){return _.x(function*(){var d=_.Bj(a);yj(d,c);d.type=1;d.method="HEAD";return(d=(yield b.fetch(d).V).headers["content-type"])?d.toLowerCase():""})};gt=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};
|
|
308
|
+
ht=function(a,b,c){return b.read().then(({done:d,value:e})=>{null!=e&&(gt(a,e),Jj(c,e.byteLength,Xs(a.h)),a.h.a=Ws());return d?(d=a.a.buffer,a.a.byteLength!==a.f&&(d=d.slice(0,a.f)),Promise.resolve(d)):Promise.resolve().then(()=>ht(a,b,c))})};
|
|
309
|
+
jt=function(a){const b=a.uris[a.uriIndex],c=new it,d=new Ys,e=Zs(d);let f=0,g;const h=new _.rn;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=Xs(e));m.readyState>=XMLHttpRequest.HEADERS_RECEIVED&&!k&&(m=m.getResponseHeader(sa),Ij(a,m),k=!0)};c.onload=function(m){m=m.target;var n=(m.getAllResponseHeaders()||"").trim().split("\r\n");
|
|
310
|
+
const r={};for(const u of n)n=u.split(": "),r[n[0].toLowerCase()]=n.slice(1).join(": ");try{const u=Xs(e);l||Jj(a,m.response?m.response.length:0,u);const v=_.Hj(r,m.response,m.status,b,m.responseURL,a,u,g);a.rateLimitBps?Kj(a.rateLimitBps,Xs(e),a.bytesLoaded).then(()=>{h.resolve(v)}):h.resolve(v)}catch(u){h.reject(u)}};c.onerror=function(m){m=m.target;if(0>=m.status)h.reject(new _.I(1,1,1002,{url:b,request:a,status:m.status}));else{var n=m.getAllResponseHeaders();const u={};if(n){n=n.trim().split("\r\n");
|
|
311
|
+
for(var r of n)n=r.split(": "),u[n[0].toLowerCase()]=n.slice(1).join(": ")}r=_.Hj(u,m.response,m.status,b,m.responseURL,a,Xs(e),g);h.resolve(r)}};c.ontimeout=function(){h.reject(new _.I(1,1,1003,{url:b,request:a}))};c.onprogress=function(m){const n=Xs(d);d.a=Ws();if(100<n||m.lengthComputable&&m.loaded===m.total)Jj(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{V:h,request:a,abort:()=>{c.abort();h.reject(new _.I(1,1,
|
|
312
|
+
7001,{url:b,request:a}));return Promise.resolve()}}};kt=function(a){let b=null;a.h!==a.f&&(b={start:a.h,end:a.f,length:a.f-a.h,data:new DataView(a.j.a.buffer,a.h,a.f-a.h),count:-1});return b};lt=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.h),d));c.a.set(e)}c.a.set(b,c.f);c.f+=b.byteLength}a.a=a.h;a.f=a.j.f;a.l=new DataView(a.j.a.buffer,0,a.j.f)};
|
|
313
|
+
nt=function(a){if(0<=a.o&&a.f<a.o)return null;let b=mt(a);for(;null!==b;){if(b.name===_.Ie){const c={start:a.h,end:b.end,length:b.end-a.h,data:new DataView(a.j.a.buffer,a.h,b.end-a.h),count:1};a.h=b.end;return c}b=mt(a)}return null};
|
|
314
|
+
ot=function(a,b,c,d){return b.read().then(e=>{var {done:f,value:g}=e;d&&g&&(d(g.byteLength,Xs(a.w)),a.w.a=Ws());if(f)return e=kt(a),(e=c(!0,e))?e.then(()=>a.j.a.buffer):Promise.resolve(a.j.a.buffer);let h=Promise.resolve();if(null!=g){lt(a,g);var k=nt(a);for(e=[];k;)e.push(k),k=nt(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=
|
|
315
|
+
c(!1,k))&&(h=e)}}return h.then(()=>ot(a,b,c,d))})};
|
|
316
|
+
mt=function(a){const b=a.a;if(a.a+4>=a.f)return a.a=a.f,null;var c=pt(a);if(a.a+4>=a.f)return a.a=a.f,null;var d=pt(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 _.I(_.F,3,3E3);}if(2097151<f)throw new _.I(_.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};
|
|
317
|
+
pt=function(a){const b=a.l.getUint32(a.a,!1);a.a+=4;return b};
|
|
318
|
+
st=function(a){a.h=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=qt(e.request.baseDelay,1E3));const f=a.f*(1+(2*Math.random()-1)*qt(e.request.fuzzFactor,.5));a.f*=qt(e.request.backoffFactor,2);if(0<f)return(new Promise((g,h)=>{a.l=h;rt(a,()=>{g(e.plugin(e.request))},f)})).catch(g=>{if(!a.a)throw g;})}if(a.a)throw new _.I(1,1,7001,{url:e.request.uris[e.request.uriIndex],request:e.request});return e.plugin(e.request)});
|
|
319
|
+
let b=0,c=0,d=0;return a.h.then(e=>{const f=e.request;f.currentAttempt+=1;b=f.currentAttempt;c=f.maxAttempts;d=f.uris.length;return e.V}).then(e=>{a.w.resolve(e)}).catch(e=>{if(e instanceof _.I){const f=b<d,g=7001!==e.code,h=b<c;if((1===e.severity||f)&&g&&h)return st(a);g&&e.a(_.F);a.w.reject(e)}else a.w.reject(e)})};rt=function(a,b,c){a.o=setTimeout(b,c)};qt=function(a,b){return null===a||void 0===a?b:a};
|
|
320
|
+
wt=function(a){var b=new tt;for(const e in a.headers)b.append(e.toLowerCase(),a.headers[e]);const c=new ut,d={Yc:!1,xg:!1};b={V:vt(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.Yc||(d.Yc=!0,c.abort());return Promise.resolve()}};if(a=a.timeout){const e=window.setTimeout(()=>{d.xg=!0;c.abort()},a);b.V=b.V.finally(()=>{window.clearTimeout(e)})}return b};
|
|
321
|
+
vt=function(a,b,c,d){return _.x(function*(){const e=new Ys,f=Zs(e);try{const g=yield xt(a,c),h=zj(g.headers),k={uri:g.url,data:null,headers:h,status:g.status,timeMs:0,responseStartMs:Xs(f),request:b};if(!Cj(g.status))throw k.data=yield g.arrayBuffer(),k.timeMs=Xs(e),Gj(k);const l=g.headers.get(sa);Ij(b,l);const m=l?parseInt(l,10):0;if(b.onFragment&&!b.disableFragmentSupport&&2===b.type){const n=g.body.getReader(),r=new yt(m,!b.disableMergedFragments);k.data=yield ot(r,n,(u,v)=>{if(d.Yc)return null;
|
|
322
|
+
v&&v.data&&(Jj(b,v.data.byteLength,Xs(f)),f.a=Ws());return b.onFragment&&v?b.rateLimitBps?Kj(b.rateLimitBps,Xs(e),b.bytesLoaded).then(()=>b.onFragment(v)):b.onFragment(v):null},b.onProgress)}else{const n=g.body.getReader(),r=yield ht(new zt(m),n,b);b.rateLimitBps&&(yield Kj(b.rateLimitBps,Xs(e),r.byteLength));k.data=r}if(d.Yc)throw Error("Request was aborted");k.timeMs=Xs(e);return Dj(k)}catch(g){if(d.Yc)throw new _.I(1,1,7001,{url:a,request:b});if(d.xg)throw new _.I(1,1,1003,{url:a,request:b});if(g&&
|
|
323
|
+
1001===g.code)throw g;_.Hh("Error while fetching data:",g);throw new _.I(1,1,1002,{url:a,error:g,request:b,status:-1},g);}})};Bt=function(a){try{const b=a.uris[a.uriIndex],c=_.At(b);return{V:Promise.resolve({uri:b,data:c.data,request:a,headers:{"content-type":c.contentType}}),request:a,abort:()=>Promise.resolve()}}catch(b){return{V:Promise.reject(b),request:a,abort:()=>Promise.resolve()}}};
|
|
324
|
+
_.At=function(a){var b=a.split(":");if(2>b.length||"data"!==b[0])throw _.Hh("Bad data URI, failed to parse scheme"),new _.I(_.F,1,1004,{uri:a});b=b.slice(1).join(":").split(",");if(2>b.length)throw _.Hh("Bad data URI, failed to extract encoding and MIME type"),new _.I(_.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?_.Yl(a).buffer:_.mj(a).buffer,contentType:c}};
|
|
325
|
+
_.Dt=function(a,b){a=_.Bk(_.Ck(a),_.Dk(a));_.Ct[a]=b};_.Et=function(a){a=_.Bk(_.Ck(a),_.Dk(a));return _.Ct[a]||null};_.Ft=function(a){a=_.Bk(_.Ck(a),_.Dk(a));delete _.Ct[a]};_.Kt=function(a){if(!a.w)return null;const b=a.H;switch(a.w){case Gt:return`-2px -2px 0 ${b}, -1px -1px 0 ${b}`;case Ht:return`2px 2px 0 ${b}, 1px 1px 0 ${b}`;case It:return`-1px 0 ${b}, 0 1px ${b}, 1px 0 ${b}, `+`0 -1px ${b}`;case Jt:return`2px 2px 3px ${b}, 2px 2px 4px ${b}, `+`2px 2px 5px ${b}`;default:return _.Re}};_.bh=[];
|
|
326
|
+
fh="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;gh=typeof Object.defineProperties==_.ne?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
|
|
327
|
+
hh("Promise",function(a){function b(g){this.f=0;this.l=void 0;this.a=[];var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.f=function(g){if(null==this.a){this.a=[];var h=this;this.h(function(){h.l()})}this.a.push(g)};var e=fh.setTimeout;c.prototype.h=function(g){e(g,0)};c.prototype.l=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var k=
|
|
328
|
+
g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.a=null};c.prototype.j=function(g){this.h(function(){throw g;})};b.prototype.j=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.C),reject:g(this.h)}};b.prototype.C=function(g){if(g===this)this.h(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.F(g);else{a:switch(typeof g){case _.Se:var h=null!=g;break a;case _.ne:h=!0;break a;default:h=!1}h?this.B(g):this.o(g)}};
|
|
329
|
+
b.prototype.B=function(g){var h=void 0;try{h=g.then}catch(k){this.h(k);return}typeof h==_.ne?this.G(h,g):this.o(g)};b.prototype.h=function(g){this.w(2,g)};b.prototype.o=function(g){this.w(1,g)};b.prototype.w=function(g,h){if(0!=this.f)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.f);this.f=g;this.l=h;this.A()};b.prototype.A=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.f(this.a[g]);this.a=null}};var f=new c;b.prototype.F=function(g){var h=this.j();
|
|
330
|
+
g.Hd(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(r,u){return typeof r==_.ne?function(v){try{l(r(v))}catch(y){m(y)}}:u}var l,m,n=new b(function(r,u){l=r;m=u});this.Hd(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Hd=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: "+
|
|
331
|
+
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=eh(g),m=l.next();!m.done;m=l.next())d(m.value).Hd(h,k)})};b.all=function(g){var h=eh(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(y){r[v]=y;u--;0==u&&l(r)}}var r=[],u=0;do r.push(void 0),u++,d(k.value).Hd(n(r.length-1),m),k=h.next();while(!k.done)})};return b});var jh=this||self;
|
|
332
|
+
jh.a=!0;_.z("clpp.utils.obj.cloneItem",_.mh);_.z("clpp.utils.obj.merge",_.lh);var Ch={DEFAULT:-1,NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4};_.z("clpp.log.Level",Ch);var Ah=0,zh={},Lt=[];_.z("clpp.log.getLoggers",function(){return _.mh(zh)});_.z("clpp.log.addInterceptor",function(a){a&&Lt.push(a)});_.z("clpp.log.removeInterceptor",function(a){a&&(a=Lt.indexOf(a),0<=a&&Lt.splice(a,1))});_.z("clpp.log.getTagLevel",Bh);_.z("clpp.log.hasTagLevel",function(a){return void 0===a?!1:0<=zh[a]});_.z("clpp.log.setTagLevel",function(a,b){a&&(_.sh(b)&&(b=Dh(b)),zh[a]=b)});
|
|
333
|
+
_.z("clpp.log.setLogLevel",function(a){-1===a&&(a=3);_.sh(a)&&(a=Dh(a));Ah=a});_.z("clpp.log.getLogLevel",function(){return Ah});
|
|
334
|
+
_.S=class{constructor(a){(this.tag=a)&&void 0===zh[a]&&(zh[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=Bh(this.tag);if(0<=d){if(d<c)return}else if(Ah<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,
|
|
335
|
+
arguments):2===c?console.warn.apply(console,arguments):1===c?console.error.apply(console,arguments):console.log.apply(console,arguments);for(const e of Lt)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)}bh(a){return a?
|
|
336
|
+
this.tag?new _.S(this.tag+"."+a):new _.S(a):this}};_.z("clpp.log.Logger",_.S);_.S.prototype.createChild=_.S.prototype.bh;_.S.prototype.error=_.S.prototype.error;_.S.prototype.warn=_.S.prototype.warn;_.S.prototype.debug=_.S.prototype.debug;_.S.prototype.info=_.S.prototype.info;_.S.prototype.log=_.S.prototype.log;var Eh=new _.S("clpp");_.z("clpp.log.info",_.Fh);_.z("clpp.log.debug",_.Gh);_.z("clpp.log.warn",_.C);_.z("clpp.log.error",_.Hh);(function(){const a=console.assert;a?a.bind||(console.assert=function(){a.apply(console,arguments)}):console.assert=function(){}})();var Zr;Zr=class{constructor(a,b){this.gb=a;this.sourceIndex=b}};_.Jh=new _.S("clpp.players");_.Ih={};_.z("clpp.events.ERROR",_.q);_.z("clpp.events.LOADEDMETADATA",_.Fe);_.z("clpp.events.BUFFERING_ENDED",_.ad);_.z("clpp.events.BUFFERING_STARTED",_.bd);_.z("clpp.events.STATE_CHANGED",_.$f);_.z("clpp.events.AUDIO_TRACK_CHANGED",_.Xc);_.z("clpp.events.TEXT_TRACK_CHANGED",_.jg);_.z("clpp.events.VIDEO_TRACK_CHANGED",_.Kg);_.z("clpp.events.BITRATE_CHANGED",_.Zc);_.z("clpp.events.TRACKS_ADDED",_.pg);_.z("clpp.events.LOAD_START",Ge);_.z("clpp.events.RELEASING",_.If);_.z("clpp.events.RELEASED",Hf);
|
|
337
|
+
_.z("clpp.events.DESTROYING","destroying");_.z("clpp.events.DESTROYED","destroyed");_.z("clpp.events.VIDEO_BUFFER_CHANGED",_.Jg);_.z("clpp.events.AUDIO_BUFFER_CHANGED",_.Wc);_.z("clpp.events.DOWNLOAD_TRACE","downloadtrace");_.z("clpp.events.DRM_SESSION_CREATED",be);_.z("clpp.events.DRM_SESSION_UPDATE",_.de);_.z("clpp.events.DRM_SESSION_PERSISTED",_.ce);_.z("clpp.events.DRM_RENEWAL_STARTED",ae);_.z("clpp.events.DRM_EXPIRATION_UPDATE",_.Xd);_.z("clpp.events.DRM_LICENSE_REQUESTED",Yd);
|
|
338
|
+
_.z("clpp.events.AUTOPLAY_NOT_ALLOWED",_.Yc);_.z("clpp.events.PLAY",_.gf);_.z("clpp.events.SEEKING",_.Sf);_.z("clpp.events.SEEKED",_.Rf);_.z("clpp.events.USER_SEEKING",_.Cg);_.z("clpp.events.USER_SEEKED",_.Bg);_.fp={SEEKING:1,NO_DATA:2};_.z("clpp.events.BufferingReasons",_.fp);_.z("clpp.events.ADS_TIMELINE_CHANGED",_.Fc);_.z("clpp.events.AD_LOADED",_.tc);_.z("clpp.events.AD_BREAK_STARTED",_.jc);_.z("clpp.events.AD_STARTED",_.zc);_.z("clpp.events.AD_BUFFERING",_.lc);_.z("clpp.events.AD_PROGRESS",_.wc);
|
|
339
|
+
_.z("clpp.events.AD_FIRST_QUARTILE",_.oc);_.z("clpp.events.AD_MIDPOINT",_.uc);_.z("clpp.events.AD_THIRD_QUARTILE",_.Dc);_.z("clpp.events.AD_PAUSED",_.vc);_.z("clpp.events.AD_RESUMED",_.xc);_.z("clpp.events.AD_SKIPPED",_.yc);_.z("clpp.events.AD_CLICKED",_.mc);_.z("clpp.events.AD_IMPRESSION",_.sc);_.z("clpp.events.AD_COMPLETED",_.nc);_.z("clpp.events.AD_STOPPED",_.Cc);_.z("clpp.events.AD_BREAK_STOPPED",_.kc);_.z("clpp.events.AD_HLS_ASSET_LIST_REQUEST",pc);
|
|
340
|
+
_.z("clpp.events.AD_HLS_ASSET_LIST_RESPONSE",qc);_.z("clpp.events.AD_HLS_RESOLVED",rc);_.z("clpp.events.SIMID_CREATIVE_STARTED",_.Uf);_.z("clpp.events.SIMID_CREATIVE_STOPPED",_.Vf);_.z("clpp.events.CASTING_STARTED",_.fd);_.z("clpp.events.CASTING_ENDED","castingended");_.z("clpp.events.CAST_STATUS_CHANGED",_.id);_.z("clpp.events.AIRPLAY_STATUS_CHANGED",_.Ic);_.z("clpp.events.AIRPLAY_CASTING_STARTED",_.Hc);_.z("clpp.events.AIRPLAY_CASTING_ENDED",_.Gc);_.z("clpp.events.TIMELINE_CUE_ADDED",_.kg);
|
|
341
|
+
_.z("clpp.events.TIMELINE_CUE_ENTER",_.lg);_.z("clpp.events.TIMELINE_CUE_EXIT",_.mg);_.z("clpp.events.TIMELINE_CUES_CHANGED",_.ng);_.z("clpp.events.MPD_TYPE_CHANGED",_.Pe);_.z("clpp.events.LIVE_TURNED_STATIC",_.Ce);_.z("clpp.events.VIMOND_RESPONSE",_.Lg);_.z("clpp.events.PLAYLIST_ITEM_CHANGED",_.tf);_.z("clpp.events.PLAYLIST_MODIFIED",_.uf);_.z("clpp.events.SC_PLAYLIST_TIMELINE_CHANGED",_.Qf);_.z("clpp.events.SC_PLAYLIST_ITEM_CHANGED",_.Of);_.z("clpp.events.SC_PLAYLIST_ENDED",_.Nf);
|
|
342
|
+
_.z("clpp.events.SC_PLAYLIST_LIVE_TURNED_STATIC",_.Pf);_.z("clpp.events.CDN_SWITCH_SUCCESS",_.jd);_.z("clpp.events.ONLINE_STATUS_CHANGED",Ze);_.z("clpp.events.CMSD_EVENT","cmsd-event");_.z("clpp.events.YOSPACE_SESSION_STARTED",_.$g);_.z("clpp.events.YOSPACE_SESSION_ENDED",_.Zg);_.z("clpp.events.CONTENT_STEERING_CHANGE",_.Ld);_.z("clpp.events.CONTENT_STEERING_LOCATION_BAN_UPDATE",_.Md);_.Mt=class{constructor(a){this.f=a;this.a=null}ia(a){return Mh(this,a,!1)}Eb(a){return Mh(this,a,!0)}stop(){this.a&&(this.a(),this.a=null)}};_.Gk=class{constructor(a){this.f=a;this.a=null}ff(){this.stop();this.f();return this}ia(a){this.stop();this.a=(new _.Mt(()=>{this.f()})).ia(a);return this}Eb(a){this.stop();this.a=(new _.Mt(()=>{this.f()})).Eb(a);return this}stop(){this.a&&(this.a.stop(),this.a=null)}};_.z("clpp.utils.Timer",_.Gk);_.Gk.prototype.stop=_.Gk.prototype.stop;_.Gk.prototype.tickEvery=_.Gk.prototype.Eb;_.Gk.prototype.tickAfter=_.Gk.prototype.ia;_.Gk.prototype.tickNow=_.Gk.prototype.ff;var Nt=class{constructor(){this.xc=null;this.f=[];this.h=[];this.Wa=new _.S(td);this.a=null;this.j=!1}load(a){const b=this;return _.x(function*(){b.xc?yield Qh(b,c=>_.x(function*(){yield c.load(a)})):b.Wa.warn("No main player, cannot load.")})}mi(a){this.j=a;this.Wa.info("Looping set to",a)}Ng(a){this.f.push(a)}Mg(a){if(this.xc)this.Wa.warn("Main player already set.");else{this.xc=a;var b=this.o.bind(this),c=this.w.bind(this),d=this.l.bind(this);a.on(_.$f,b);a.on(_.og,c);a.on(_.je,d);this.h.push(()=>
|
|
343
|
+
{a.off(_.$f,b);a.off(_.og,c);a.on(_.je,d)})}}clear(){this.xc=null;this.f=[];this.h.forEach(a=>a());this.h=[]}l(){const a=this;return _.x(function*(){a.j&&(a.Wa.info("Looping playback."),yield Qh(a,b=>_.x(function*(){yield b.seek(0);yield b.play()})))})}o(a){this.a||(a=a.detail.currentState,a===_.kp?(this.Wa.info("Mirroring playing."),Rh(this,b=>_.x(function*(){yield b.play()}))):[_.jp,_.dp,_.ap].includes(a)&&(this.Wa.info("Mirroring paused/buffering/error."),Rh(this,b=>{const c=this;return _.x(function*(){var d=
|
|
344
|
+
Math.round(c.xc.getPosition())-.1;yield b.seek(d);yield Nh(.2);d=b.getState();if(d===_.kp||d===_.dp)yield b.pause()})})))}w(){this.a||Rh(this,a=>{const b=this;return _.x(function*(){a.isPaused()&&(yield a.play());const c=b.xc.getPosition();var d=a.getPosition();d=c-d;const e=Math.abs(d),f=a.getPlaybackRate();if(!(a.getState()!==_.kp||.05>=e)){var g=Math.abs(d);g=Math.min(Math.max(1+(.05>=g?0:g/(1>g?6:3))*Math.sign(d),.2),5);5<=e?(a.setPlaybackRate(1),yield a.seek(c)):f===g?1!==g&&b.Wa.info(`Delta ${d.toFixed(1)} s.`):
|
|
345
|
+
(1===g?b.Wa.info("Secondary caught up."):1>g?b.Wa.info("Secondary slowing down to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`):1<g&&b.Wa.info("Secondary speeding up to catch up. "+`Rate: ${g.toFixed(1)}, delta: ${d.toFixed(1)} s`),a.setPlaybackRate(g))}})})}};_.z(td,Nt);Nt.prototype.clear=Nt.prototype.clear;Nt.prototype.addMainPlayer=Nt.prototype.Mg;Nt.prototype.addSecondaryPlayer=Nt.prototype.Ng;Nt.prototype.setLoop=Nt.prototype.mi;Nt.prototype.load=Nt.prototype.load;_.Ot=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={}}};var Pt,Qt;Pt=class{constructor(a,b,c,d){this.f=a;this.Fc=b;this.a=c;this.ci=!!d}Ya(a){try{this.Fc.handleEvent?this.Fc.handleEvent(a):this.Fc.call(this.a,a)}catch(b){_.Hh("clpp","Uncaught exception in event handler for event '"+this.f+"'",b,b?b.message:null,b?b.stack:null)}}};
|
|
346
|
+
_.D=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(){}};
|
|
347
|
+
Qt=class{constructor(a){this.a=new _.Ot;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].Ya(a),b[c].ci&&this.a.remove(a.type,b[c]),!a||!a.f);c++);}on(a,b,c){this.a.push(a,new Pt(a,b,c||this.f));return b}one(a,b,c){this.a.push(a,new Pt(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].Fc===b&&(d=this.a.remove(a,c[e])||d);return d}clear(){this.a.clear()}};var Rt;_.St=class{constructor(){this.a=new _.Ot}release(){_.Th(this)}on(a,b,c,d=!1){a=new Rt(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||(Sh(f),this.a.remove(b,f))}}};Rt=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 Tt=class{constructor(a){this.m=a;this.l=a.getConfiguration().streaming.addMissingTimelineCues||!1;this.j=new _.St;this.f=new Set;this.a=new Set;this.h=null;this.g=new _.S("clpp.native.Metadata")}release(){this.j.release();this.a=new Set;this.f.clear();null!=this.h&&(clearInterval(this.h),this.h=null)}destroy(){const a=this;return _.x(function*(){a.release()})}getTimelineCues(){return Array.from(this.a.values()).sort((a,b)=>a.startTime-b.startTime)}};_.$t=class{constructor(a,b,c,d){d=void 0===d?_.Ut:d;this.startTime=a;this.endTime=b;this.payload=c;this.payloadType=d;this.positionAlign=this.position=null;this.size=100;this.textAlign=_.Vt;this.writingMode=_.Wt;this.lineInterpretation=_.Xt;this.line=null;this.lineAlign=_.Yt;this.direction=Zt;this.region=null;this.cssClassList=[];this.id=this.backgroundImage="";this.containerRows=null}Mc(a){return this.payload===a.payload&&this.startTime===a.startTime&&this.endTime===a.endTime&&this.payloadType===
|
|
348
|
+
a.payloadType}};_.z("clpp.text.Cue",_.$t);_.$t.positionAlign={LEFT:_.xe,RIGHT:_.Be,CENTER:_.ld,AUTO:"auto"};_.Ut="text";_.$t.payloadType={TEXT:_.Ut,VTT_XML:_.Ng,TTML_XML:_.rg};_.Vt=_.ld;_.au={LEFT:_.ue,RIGHT:_.Mf,CENTER:_.Vt,START:_.ue,END:_.Mf};_.$t.textAlign=_.au;var Zt="ltr";_.$t.direction={HORIZONTAL_LEFT_TO_RIGHT:Zt,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};_.Wt="horizontal-tb";_.$t.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.Wt,VERTICAL_LEFT_TO_RIGHT:_.Fg,VERTICAL_RIGHT_TO_LEFT:_.Gg};_.Xt=0;
|
|
349
|
+
_.$t.lineInterpretation={LINE_NUMBER:_.Xt,PERCENTAGE:1};_.Yt=_.Zf;_.bu={CENTER:_.ld,START:_.Yt,END:_.ie};_.$t.lineAlign=_.bu;_.eu=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=_.cu;this.scroll=du;this.cssClassList=[];this.writingMode=this.displayAlign=null}};_.z("clpp.text.CueRegion",_.eu);_.cu=1;_.eu.units={PX:0,PERCENTAGE:_.cu,LINES:2};var du="";
|
|
350
|
+
_.eu.scrollMode={NONE:du,UP:"up"};_.eu.displayAlign={BEFORE:"flex-end",CENTER:_.ld,AFTER:"flex-start"};_.eu.writingMode={HORIZONTAL_TOP_TO_BOTTOM:_.Cd,VERTICAL_LEFT_TO_RIGHT:"row-reverse",VERTICAL_RIGHT_TO_LEFT:"row"};var fu=class{constructor(a){this.m=a;this.l=a.getTextDisplayer();this.f=this.h=null;this.a=new _.St;this.j=!1;this.g=new _.S("clpp.native.CueHandler")}destroy(){this.a.release();this.j=!1;this.l=this.a=this.h=this.f=null;return Promise.resolve()}start(a){this.j?this.g.warn("Already started. Ignoring request..."):(this.j=!0,this.h=a,this.f=this.h.textTracks,this.a.on(this.f,_.Ec,b=>vi(this,b)),this.a.on(this.f,nd,()=>{{const b=this.f;for(let c=0;c<b.length;c++){const d=b[c];d.mode===_.Tf&&(d.mode=
|
|
351
|
+
_.pe)}}}))}o(a){const b=new _.$t(a.startTime,a.endTime,a.text,_.Ng);if(_.sh(a.vertical))switch(a.vertical){case "lr":b.writingMode=_.Fg;break;case "rl":b.writingMode=_.Gg}_.th(a.size)&&(b.size=a.size);if(_.sh(a.align))switch(a.align){case _.ue:case _.Zf:b.textAlign=_.ue;break;case _.ld:b.textAlign=_.Vt;break;case _.Mf:case _.ie:b.textAlign=_.Mf}_.th(a.position)&&(b.position=a.position);if(_.sh(a.positionAlign))switch(a.positionAlign){case _.xe:b.positionAlign=_.xe;break;case _.ld:b.positionAlign=
|
|
352
|
+
_.ld;break;case _.Be:b.positionAlign=_.Be}_.th(a.line)&&(b.line=a.line);if(_.sh(a.lineAlign))switch(a.lineAlign){case _.Zf:b.lineAlign=_.Yt;break;case _.ld:b.lineAlign=_.ld;break;case _.ie:b.lineAlign=_.ie}typeof a.snapToLines===_.$c&&(b.lineInterpretation=a.snapToLines?_.Xt:1);return b}};_.I=class extends Error{constructor(a,b,c,d,e){super(wi(a,b,c,d));this.severity=a;this.category=b;this.code=c;this.data=!d||_.sh(d)?{}:d;this.cause=void 0===e?null:e;this.f=!1;Error.captureStackTrace&&Error.captureStackTrace(this,_.I)}a(a){this.severity!==a&&(this.severity=a,this.message=wi(this.severity,this.category,this.code,this.data))}toString(){let a=this.message;this.cause&&(a+=`\n Caused by ${this.cause}`);return a}};_.z("clpp.Error",_.I);_.F=2;_.I.Severity={RECOVERABLE:1,FATAL:_.F};
|
|
353
|
+
_.I.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,PLUGIN:9,ADS:10};
|
|
354
|
+
_.I.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,
|
|
337
355
|
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,
|
|
338
356
|
MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,MP4_PARSER_ERROR:3019,MEDIA_LOAD_ERROR:3100,INVALID_TRACK_TYPE:3101,UNKNOWN_TRACK:3102,MEDIA_DECRYPTION_ERROR:3103,PLAY_NOT_ALLOWED:3200,PAUSE_FAILED:3201,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,
|
|
339
357
|
DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,
|
|
@@ -342,65 +360,59 @@ HLS_INVALID_VALUE:4044,HLS_DISCONTINUITY_NOT_SUPPORTED:4045,HLS_UNSUPPORTED_FEAT
|
|
|
342
360
|
NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,REQUESTED_DRM_ENVIRONMENT_UNAVAILABLE:6015,INIT_DATA_TRANSFORM_ERROR:6016,CERTIFICATE_REQUEST_FAILED:6100,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,
|
|
343
361
|
INVALID_CONTAINER_ELEMENT:7006,INVALID_ARGUMENT:7007,WRONG_ORDER_OF_OPERATIONS:7008,NOT_SUPPORTED:7009,INVALID_CONFIGURATION:7100,INVALID_LICENSE:7101,NO_ELEMENT:7102,USER_ID_NOT_PROVIDED:7103,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,
|
|
344
362
|
YOUBORA_SDK_MISSING:9100,YOUBORA_INVALID_CONFIGURATION:9101,YOUBORA_SDK_VERSION_NOT_SUPPORTED:9102,VIMOND_INVALID_CONFIGURATION:9200,VIMOND_SESSION_ERROR:9201,MUXDATA_INVALID_CONFIGURATION:9300,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,
|
|
345
|
-
SESSIONS_INVALID_CONFIGURATION:15E3};_.
|
|
346
|
-
_.
|
|
347
|
-
".."==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.
|
|
348
|
-
_.
|
|
349
|
-
_.
|
|
350
|
-
_.
|
|
351
|
-
|
|
363
|
+
SESSIONS_INVALID_CONFIGURATION:15E3};_.zi=class extends Error{constructor(a,b){super(a);this.code=b}};var Hi=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;_.ah=_.Ci.prototype;_.ah.Ab="";_.ah.Bc="";_.ah.$a="";_.ah.Uc=null;_.ah.Ka="";_.ah.sc="";_.ah.toString=function(){var a=[],b=this.Ab;b&&a.push(Ki(b,gu,!0),":");if(b=this.$a){a.push("//");var c=this.Bc;c&&a.push(Ki(c,gu,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Uc;null!=b&&a.push(":",String(b))}if(b=this.Ka)this.$a&&"/"!=b.charAt(0)&&a.push("/"),a.push(Ki(b,"/"==b.charAt(0)?hu:iu,!0));(b=this.a.toString())&&a.push("?",b);(b=this.sc)&&a.push("#",Ki(b,ju));return a.join("")};
|
|
364
|
+
_.ah.resolve=function(a){var b=new _.Ci(this);"data"===b.Ab&&(b=new _.Ci);var c=!!a.Ab;c?Di(b,a.Ab):c=!!a.Bc;c?b.Bc=a.Bc:c=!!a.$a;c?b.$a=a.$a:c=null!=a.Uc;var d=a.Ka;if(c)Ei(b,a.Uc);else if(c=!!a.Ka){if("/"!=d.charAt(0))if(this.$a&&!this.Ka)d="/"+d;else{var e=b.Ka.lastIndexOf("/");-1!=e&&(d=b.Ka.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(""):
|
|
365
|
+
".."==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.Ka=d:c=""!==a.a.toString();c?_.Fi(b,Gi(a.a)):c=!!a.sc;c&&(b.sc=a.sc);return b};var gu=/[#\/\?@]/g,iu=/[#\?:]/g,hu=/[#\?]/g,Li=/[#\?@]/g,ju=/#/g;_.Ji.prototype.a=null;_.Ji.prototype.h=null;
|
|
366
|
+
_.Ji.prototype.add=function(a,b){if(!this.a&&(this.a={},this.h=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.h&&this.h++;return this};
|
|
367
|
+
_.Ji.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 Ni;_.H="text";_.ku=1/15;Ni={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/]};Ni[_.H]=[/^vtt$/,/^wvtt/,/^stpp/];var lu;lu={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av0?1/],text:[/^vtt$/,/^wvtt/,/^stpp/]};_.nk=(a,b)=>{const c=lu[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===_.H?"":null};_.mu={text:{mp4:Lc,m4s:Lc,m4i:Lc,cmft:Lc,vtt:_.hg,ttml:_.Oc},video:{mp4:_.Ig,m4s:_.Ig,m4f:_.Ig,m4i:_.Ig,m4v:_.Ig,cmfv:_.Ig,ts:_.Hg},audio:{mp4:_.Uc,m4s:_.Uc,m4f:_.Uc,m4i:_.Uc,m4a:_.Uc,cmfa:_.Uc,ts:_.Hg,aac:_.Rc,ec3:_.Tc,ac3:_.Sc},image:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",webp:"image/webp",avif:"image/avif"}};_.qk=(a,b,c)=>a.map(d=>{d=_.nu(d)||"";return d=(d=_.mu[b][d])?d:b===_.H?c&&"vtt"!==c?Lc:_.hg:null}).filter(Boolean)[0]||null;
|
|
368
|
+
_.nu=a=>{a=(new _.Ci(a)).Ka.split(".");return 1>=a.length?null:a.pop()};_.Wi=class{constructor(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=void 0===d?null:d}toString(){function a(d){return d.name+"\x3d"+(isNaN(Number(d.value))?'"'+d.value+'"':d.value)}let b="#"+this.name;const c=this.attributes?this.attributes.map(a):[];this.value&&c.unshift(this.value);0<c.length&&(b+=":"+c.join(","));return b}getAttribute(a){const b=this.attributes.filter(c=>c.name===a);return b.length?b[0]:null}hasAttribute(a){return null!=this.getAttribute(a)}};
|
|
369
|
+
_.Vi=class{constructor(a,b){this.name=a;this.value=b}};var Pi=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",
|
|
370
|
+
"cs"],["dan","da"],["deu","de"],[_.Sd,"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",
|
|
352
371
|
"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",
|
|
353
372
|
"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",
|
|
354
373
|
"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",
|
|
355
|
-
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);var
|
|
374
|
+
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);_.ou=new _.S("clpp.hls.Utils");_.Ui=class{constructor(a){this.f=a;this.a=0}};_.pu=new Set([_.Ea,_.Fa,"EXT-X-I-FRAMES-ONLY",_.Ia,_.Ja,_.Ka,_.Oa,_.Pa]);_.qu=new Set(["EXTINF",_.Aa,_.Da,_.Ga,_.Ha,_.Ma]);_.ru=new Set(["EXT-X-PART",_.La]);_.su=new Set([_.Ca]);_.tu=new Set([_.Ba]);var uu=class{};_.z("clpp.utils.BufferUtils",uu);uu.toArrayBuffer=gj;uu.toDataView=_.fj;uu.toInt32Array=_.ej;uu.toUint32Array=dj;uu.toUint16Array=cj;uu.toUint8Array=_.K;uu.equal=aj;var jj=new _.S("clpp.utils.strings");_.z("clpp.utils.strings.fromUtf8",_.ij);_.z("clpp.utils.strings.fromBytesAutoDetect",_.lj);_.z("clpp.utils.strings.toUtf8",_.mj);_.z("clpp.utils.strings.toUtf16",_.nj);_.z("clpp.utils.strings.toByteArray",_.oj);_.z("clpp.utils.strings.startsWith",_.pj);_.z("clpp.utils.strings.endsWith",_.qj);_.z("clpp.utils.strings.bitrateToString",_.tj);
|
|
356
375
|
_.z("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)))});
|
|
357
|
-
_.z("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
|
|
358
|
-
this.f.filter(b=>b!==a)}
|
|
359
|
-
d.then(g=>{if(e.a)throw new _.
|
|
360
|
-
if(h&&h.then)return h.then(()=>Promise.reject(g))}return Promise.reject(g)}).catch(g=>{if(g instanceof _.
|
|
361
|
-
_.z("clpp.net.NetworkEngine",_.
|
|
362
|
-
_.
|
|
363
|
-
a.roles)&&
|
|
364
|
-
renditions size: ${this.renditions.length}`}};_.z("clpp.Track",_.
|
|
365
|
-
_.
|
|
366
|
-
a);e.renditions=f.renditions;e.mimeType=f.mimeType}}catch(f){c.g.warn("Failed to parse video metadata from HLS playlist.",f.message)}try{const f=yield
|
|
367
|
-
_.z("clpp.TrackManager",_.T);_.T.prototype.isAbrEnabled=_.T.prototype.
|
|
368
|
-
_.T.prototype.setVideoRendition=_.T.prototype.
|
|
369
|
-
_.T.prototype.getTextRendition=_.T.prototype.
|
|
370
|
-
var
|
|
376
|
+
_.z("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 uj=document.createElement("span");var wj=[403,401];_.z("clpp.net.DEFAULT_FATAL_STATUS_CODES",wj);_.z("clpp.net.makeRequest",_.Bj);_.Aj=6;_.z("clpp.net.RequestType",{MANIFEST:1,SEGMENT:2,LICENSE:3,APP:4,TIMING:5,OTHER:_.Aj,CONTENT_STEERING:7});_.rn=class{constructor(){this.qg=this.he=this.done=!1;this.error=this.value=null;let a,b;const c=new Promise((d,e)=>{a=function(f){this.done=this.he=!0;this.value=f;d(f)};b=function(f){this.done=this.qg=!0;this.error=f;e(f)}});c.he=!1;c.done=!1;c.qg=!1;c.value=null;c.error=null;c.resolve=a;c.reject=b;return c}resolve(){}reject(){}};_.vp=class{constructor(a,b){this.V=a;this.A=b;this.a=!1}abort(){this.a=!0;return this.A()}};_.vu=class{constructor(){this.a=[]}destroy(){const a=[];for(const b of this.a)b.V.catch(()=>{}),a.push(b.abort());this.a=[];return Promise.all(a)}};_.Er=class{constructor(){this.f=[];this.h=[];this.j=[];this.w=!1;this.o=new _.vu;this.a={};this.headers=new Map;this.l=0;this.a.data=Bt;!window.fetch||!window.AbortController||_.Kk(6)||_.Nk()&&68<_.il().browserVersion.major?(this.a.http=jt,this.a.https=jt):(this.a.http=wt,this.a.https=wt)}oi(a){0<a?_.C("Rate limit set to "+a+"bps"):_.C("Rate limit disabled");this.l=a}release(){return this.o.destroy()}destroy(){this.w=!0;this.f=[];this.h=[];return this.o.destroy()}me(a){this.f.push(a)}Ec(a){this.h.push(a)}We(a){this.f=
|
|
377
|
+
this.f.filter(b=>b!==a)}vd(a){this.h=this.h.filter(b=>b!==a)}fetch(a){if(this.w)return new wu(Promise.reject(new _.I(1,1,7001,{url:a.uris[a.uriIndex],request:a})));this.l&&0<this.l&&(a.rateLimitBps=this.l);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;Pj(this,a);b=[];for(var c of this.h)b.push(c);if(a.responseModifiers)for(var d of a.responseModifiers)b.push(d);a.responseModifiers=b;let e;d=c=new _.rn;try{for(const f of a.requestModifiers)d=
|
|
378
|
+
d.then(g=>{if(e.a)throw new _.I(_.F,1,7001,g?{url:g.uris[g.uriIndex],request:g}:null);return f(g)||g}).catch(g=>{if(g instanceof _.I)throw g;throw new _.I(_.F,1,1006,null,g);});d=d.then(f=>({request:f,plugin:Qj(this,f)}));e=new wu(d);for(const f of a.responseModifiers)e.then(g=>{const h=()=>{if(e.a)throw new _.I(_.F,1,7001,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 _.I&&g.data&&g.data.response){const h=f(g.data.response);
|
|
379
|
+
if(h&&h.then)return h.then(()=>Promise.reject(g))}return Promise.reject(g)}).catch(g=>{if(g instanceof _.I)throw g;throw new _.I(_.F,1,1007,null,g);});for(const f of this.j)e.catch(g=>{g instanceof _.I&&g.data&&g.data.response||f({uri:a.uris[a.uriIndex],data:(new Uint8Array(0)).buffer,status:-1,timeMs:0,headers:{},request:a});return Promise.reject(g)}).catch(g=>{if(g instanceof _.I)throw g;throw new _.I(_.F,1,1007,null,g);});_.Mj(this.o,e);c.resolve(a);return e}catch(f){return new wu(Promise.reject(f))}}};
|
|
380
|
+
_.z("clpp.net.NetworkEngine",_.Er);_.Er.prototype.fetch=_.Er.prototype.fetch;_.Er.prototype.removeResponseModifier=_.Er.prototype.vd;_.Er.prototype.removeRequestModifier=_.Er.prototype.We;_.Er.prototype.addResponseModifier=_.Er.prototype.Ec;_.Er.prototype.addRequestModifier=_.Er.prototype.me;_.Er.prototype.setRateLimit=_.Er.prototype.oi;var Uj;
|
|
381
|
+
_.Xj=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=[]}Mc(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&&si(this.roles,
|
|
382
|
+
a.roles)&&si(this.accessibility,a.accessibility,Sj)}toString(){return`Track type: ${this.type} id: ${this.id}
|
|
383
|
+
renditions size: ${this.renditions.length}`}};_.z("clpp.Track",_.Xj);_.Xj.prototype.toString=_.Xj.prototype.toString;_.fk=class{constructor(a,b){this.track=b;this.id=a;this.originalId=this.codec=this.Wc=this.bandwidth=this.height=this.width=null;this.a=!1}};_.z("clpp.Rendition",_.fk);_.Wj=1;_.N=_.w;_.M=_.p;_.L="text";Uj=_.Le;_.xu={VIDEO:_.N,AUDIO:_.M,TEXT:_.L,METADATA:Uj};_.Xj.Type=_.xu;_.Bm=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;
|
|
384
|
+
_.pj(this.path,"/")||(this.path="/"+this.path);this.f=b.search;this.h=b.hash}};_.z("clpp.utils.url.queryString",_.ak);var yu=class{constructor(a){this.f=a;this.g=new _.S("clpp.native.hls.HlsMetadataParser");this.a=xi(this.h.bind(this),(b,c)=>b[0]===c[0]&&b[1].enableHlsVideoTrackInfo===c[1].enableHlsVideoTrackInfo&&b[1].enableMetadata===c[1].enableMetadata)}h(a,b){const c=this;return _.x(function*(){let d=null;try{d=yield dk(c,a)}catch(f){return c.g.warn("Failed to fetch playlist in order metadata from HLS playlist.",f.message),Promise.resolve({})}const e={};try{if(b.enableHlsVideoTrackInfo){const f=yield hk(c,d,
|
|
385
|
+
a);e.renditions=f.renditions;e.mimeType=f.mimeType}}catch(f){c.g.warn("Failed to parse video metadata from HLS playlist.",f.message)}try{const f=yield jk(d);e.zc=f}catch(f){c.g.warn("Failed to parse metadata from HLS playlist.",f.message)}return e})}};_.rk=[];_.T=class{re(){return!0}mh(a){return this.getVideoTracks().find(b=>_.uh(b,a,a&&Object.keys(a)))}ih(a){return this.getAudioTracks().find(b=>_.uh(b,a,a&&Object.keys(a)))}kh(a){return this.na().find(b=>_.uh(b,a,a&&Object.keys(a)))}lh(a){return this.getVideoTracks().flatMap(b=>b.renditions).find(b=>_.uh(b,a,a&&Object.keys(a)))}hh(a){return this.getAudioTracks().flatMap(b=>b.renditions).find(b=>_.uh(b,a,a&&Object.keys(a)))}jh(a){return this.na().flatMap(b=>b.renditions).find(b=>_.uh(b,a,a&&Object.keys(a)))}};
|
|
386
|
+
_.z("clpp.TrackManager",_.T);_.T.prototype.isAbrEnabled=_.T.prototype.ua;_.T.prototype.addTextTrack=_.T.prototype.addTextTrack;_.T.prototype.findTextRendition=_.T.prototype.jh;_.T.prototype.findAudioRendition=_.T.prototype.hh;_.T.prototype.findVideoRendition=_.T.prototype.lh;_.T.prototype.findTextTrack=_.T.prototype.kh;_.T.prototype.findAudioTrack=_.T.prototype.ih;_.T.prototype.findVideoTrack=_.T.prototype.mh;_.T.prototype.setTextRendition=_.T.prototype.Cb;_.T.prototype.setAudioRendition=_.T.prototype.Bb;
|
|
387
|
+
_.T.prototype.setVideoRendition=_.T.prototype.nb;_.T.prototype.setTextTrack=_.T.prototype.Xa;_.T.prototype.setAudioTrack=_.T.prototype.ya;_.T.prototype.setVideoTrack=_.T.prototype.Db;_.T.prototype.getTextTrack=_.T.prototype.xa;_.T.prototype.getAudioTrack=_.T.prototype.ra;_.T.prototype.getVideoTrack=_.T.prototype.Ia;_.T.prototype.getLoadingTextRendition=_.T.prototype.Hb;_.T.prototype.getLoadingAudioRendition=_.T.prototype.Gb;_.T.prototype.getLoadingVideoRendition=_.T.prototype.vb;
|
|
388
|
+
_.T.prototype.getTextRendition=_.T.prototype.Va;_.T.prototype.getAudioRendition=_.T.prototype.Ra;_.T.prototype.getVideoRendition=_.T.prototype.oa;_.T.prototype.getTextTracks=_.T.prototype.na;_.T.prototype.getAudioTracks=_.T.prototype.getAudioTracks;_.T.prototype.getVideoTracks=_.T.prototype.getVideoTracks;_.T.prototype.canSelectVideoTracks=_.T.prototype.re;var vk=new Map,uk=1,zk=2,yk=3,xk=4;_.zu=(new Map).set(_.Bd,_.Bd).set("frameRate","framerate").set("bandwidth","bitrate").set(_.Vg,_.Vg).set(_.oe,_.oe).set("channelsCount","channels");var Au=class{};_.z(Ad,Au);Au.getInfo=_.il;
|
|
389
|
+
var Fk=null,Ek=null,Xk=new _.S(Ad),al="android",$k="ios",gl="linux",bl="osx",dl="windows",el="tizen",fl="webos",Zk=_.ug,hl=_.ug,Sk={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,
|
|
371
390
|
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,
|
|
372
391
|
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},
|
|
373
|
-
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 U=class extends _.T{constructor(){super();this.g=new _.S("clpp.native.TrackManager");this.m=null;this.f=new _.
|
|
374
|
-
b){const c=this;return _.x(function*(){if(b){var d=b.track;if(d){var e=a===_.N,f=a===_.L,g=a===_.M||e,h=b.target,k=c.h.find(n=>
|
|
375
|
-
c.a.set(a,k));c.g.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.
|
|
376
|
-
g&&(e?f():u&&1!==v||f())}catch(n){c.g.error("Error while converting track data",n)}}}else c.g.warn(
|
|
377
|
-
this.h.find(e=>
|
|
378
|
-
_.
|
|
379
|
-
null}
|
|
380
|
-
b.o[c]=a;
|
|
381
|
-
U.prototype.setAudioRendition=U.prototype.
|
|
382
|
-
U.prototype.getTextRendition=U.prototype.
|
|
383
|
-
1)}
|
|
384
|
-
"";for(let b=0;b<this.length;b++)0<b&&(a+=" "),a+=`${this.start(b).toFixed(3)}-${this.end(b).toFixed(3)}`;return a}};_.z("clpp.BufferInfo",_.
|
|
385
|
-
_.
|
|
386
|
-
_.
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
_.
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
(this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=()=>{this.trigger(new _.E(_.lg));this.L.on(c,_.Jf,h);this.L.on(c,_.bg,h);this.L.on(c,_.wf,h);this.log.info("Seeking to "+a+". Delta "+d);this.cd=this.Ne=!0;c.currentTime=a},h=l=>{const m=this.getMediaPosition(),n=.1>=Math.abs(a-m);var q=.25<m-a;const u=c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,v=l.type===_.Jf,y=l.type===_.wf,A=l.type===_.bg,D=y&&u;q=v||n&&D||A&&q;this.log.debug("Checking seeking state after "+
|
|
398
|
-
l.type+" event. Seek completed:",q,"Current Time:",m,"Target Time:",a,"Native Event:",v,"Time reached",n,"Timeupdate:",A,"Progress:",y,"ReadyState:",u,"Progress Ready:",D);q?(this.cd=this.Ne=!1,this.L.off(c,_.Jf,h),this.L.off(c,_.bg,h),this.L.off(c,_.wf,h),this.kf(),this.trigger(new _.E(_.kg)),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();else this.L.one(c,_.xe,g)};this.getState()===_.Yo?
|
|
399
|
-
(this.log.debug("Player is in IDLE state. Postpone seek."),this.L.one(this,_.Sf,()=>{switch(this.getState()){case _.Uo:case _.ap:case _.$o: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.C.getMedia();if(a)return a.volume;this.log.warn("No media element available, can not report volume!");return null}setVolume(a){const b=this.C.getMedia();b?_.gh(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
|
|
400
|
-
Value must be between 0 and 1.`):b.volume=a:this.log.warn("Can not set volume to "+a+". Volume must be a number"):this.log.warn("No media element available, can not set volume !")}isMuted(){return this.C.getMedia().muted}setMuted(a){const b=this.C.getMedia();typeof a===_.Uc&&(b.muted=a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.ea?this.C.getMedia().duration:-1}getTrackManager(){return this.ib}getPlaybackRate(){const a=this.C.getMedia();return a&&a.playbackRate||
|
|
401
|
-
1}setPlaybackRate(a){const b=this.C.getMedia();void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.Jd=a}getSourceIndex(){return this.Jd}getLoadedSource(){return this.ea&&-1!==this.Jd?this.ea[this.Jd]:null}getPeriods(){return[]}getNetworkEngine(){return this.Ie}setNetworkEngine(a){this.Ie=a}setCmsdManager(a){this.Ae=a}getTextDisplayer(){return this.O}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){}zg(a){var b=this.getSurface().getMedia();const c=this.getPosition();let d="Received Video Element Event: '"+
|
|
402
|
-
a.type+"' with playhead at: "+c;if(a.type===_.bg||a.type===_.wf)this.lf.debug(d);else{let e="";switch(a.type){case _.yf:e=`Rate: ${this.getPlaybackRate()}`;break;case Yd:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.Ze:case _.kf:case "suspend":case _.Bg:case Qf:case _.Kf:case _.Jf:case _.bg:case _.wf:case Xc:case Yc:b=this.getBufferInfo().Ca(c);e=`State ${this.getSurface().getMedia().readyState} `+`Buffer: ${b}`;
|
|
403
|
-
break;case _.Df:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=". "+e);this.lf.info(d)}a.type!==_.r&&this.trigger(new _.E(a.type,{detail:a}))}kf(){}};var Kl;Kl=new _.S("clpp.Components");_.Il=new Map;_.z("clpp.install",function(a){Sl(a)});_.z("clpp.uninstall",function(a){Tl(a)});var nu=class{constructor(){this.a=this.f=null;this.g=new _.S("clpp.drm.csl")}release(){this.a=this.f=null}};_.z("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.Bb,SW_SECURE_DECODE:_.Cb,HW_SECURE_CRYPTO:Va,HW_SECURE_DECODE:Wa,HW_SECURE_ALL:Ua});_.z("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.z("clpp.drm.KeySystem",{NONE:_.Je,CLEAR_KEY:_.Te,WIDEVINE:_.Cd,PLAYREADY:_.Ad,FAIRPLAY:_.wd,PRIMETIME:_.vd});_.Wl={};_.z("clpp.drm.registerDrmEnvironment",_.Xl);var $l={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,
|
|
392
|
+
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 U=class extends _.T{constructor(){super();this.g=new _.S("clpp.native.TrackManager");this.m=null;this.f=new _.St;this.h=[];this.G=0;this.o={};this.I=[];this.a=new Map;this.w=null;this.l=new Map;this.A=!0;this.M=this.B.bind(this,_.L);this.R=this.F.bind(this,_.L);this.O=this.C.bind(this,_.L);this.S=this.B.bind(this,_.N);this.W=this.F.bind(this,_.N);this.U=this.C.bind(this,_.N);this.J=this.B.bind(this,_.M);this.L=this.F.bind(this,_.M);this.K=this.C.bind(this,_.M);this.j=null}re(){return!_.Uk()}B(a,
|
|
393
|
+
b){const c=this;return _.x(function*(){if(b){var d=b.track;if(d){var e=a===_.N,f=a===_.L,g=a===_.M||e,h=b.target,k=c.h.find(n=>jl(n,d,a));if(k)c.g.warn("Track from event already exists",d,k);else{var l=Yj(a,d),m=kl(d);if(f){if(d.kind===_.Le)return;let n;void 0!==d.id?n=c.o[d.id]:n=Object.values(c.o).find(r=>jl(l,r,a));l.kind&&"captions"===l.kind&&(l.mimeType=_.Jc);n&&(l.src=n.url,l.mimeType=n.mimeType)}else if(k=c.h.find(n=>n.type===a&&_.uh(n,l,["kind","label","language"]))){k.id=d.id;m&&(c.g.debug(`Setting native ${a} track active`),
|
|
394
|
+
c.a.set(a,k));c.g.debug("Track from event seems to already exists, flipped native track to",d);return}try{l.renditions.push(new _.fk(l.id,l));c.h.push(l);const n=c.m.getConfiguration().safari;ml(c,a,n)?yield nl(c,l,n):ol(c,a,n)&&(yield pl(c,l,n));c.g.debug(a+" Track added",l);c.m.trigger(new _.D(_.pg));const r=ql(c,a).length,u=!(!h||!h.length),v=h&&h.length||0;f=()=>{c.g.debug(`Setting native ${a} track active. `+`Native track active: ${m}. `+`Number of tracks: ${r}`,d);c.a.set(a,l)};m?f():1===r&&
|
|
395
|
+
g&&(e?f():u&&1!==v||f())}catch(n){c.g.error("Error while converting track data",n)}}}else c.g.warn(mb)}else c.g.warn(jb)})}F(a,b){if(b){var c=b.track;c?a===_.L&&c.kind!==_.Le&&(b=this.h.find(d=>jl(d,c,a)))&&(this.h.splice(this.h.indexOf(b),1),(this.a.get(a)||null)===b&&(this.a.set(a,null),rl(this)),this.g.debug(a+" Track removed, id: ",b.id)):this.g.warn(mb)}else this.g.warn(jb)}C(a,b){this.g.debug(a+" Track changed",b);a===_.L&&rl(this);const c=tl(this,a);if(c)for(let d=0;d<c.length;++d)if(kl(c[d])){if(b=
|
|
396
|
+
this.h.find(e=>jl(e,c[d],a)))this.a.set(a,b),this.g.debug("Track change detected, id:",b.id),b===this.l.get(a)&&this.l.set(a,null),a===_.M?this.m.trigger(new _.D(_.Xc)):a===_.L&&this.m.trigger(new _.D(_.jg));break}}initialize(a){this.m=a;this.j=new yu(a.getNetworkEngine())}load(){this.A=!1;var a=sl(this,_.L);a&&(this.f.on(a,_.Ec,this.M),this.f.on(a,Jf,this.R),this.f.on(a,nd,this.O));if(a=sl(this,_.M))this.f.on(a,_.Ec,this.J),this.f.on(a,Jf,this.L),this.f.on(a,nd,this.K);if(a=sl(this,_.N))this.f.on(a,
|
|
397
|
+
_.Ec,this.S),this.f.on(a,Jf,this.W),this.f.on(a,nd,this.U);this.f.one(this.m,ed,this.H.bind(this))}release(){this.A=!0;this.h=[];this.o={};this.a.clear();this.l.clear();this.f.release()}destroy(){this.release();this.m=null}getVideoTracks(){return ql(this,_.N)}getAudioTracks(){return ql(this,_.M)}na(){return ql(this,_.L)}oa(){const a=this.a.get(_.N)||null;if(!a)return null;if(this.w){const b=a.renditions.find(c=>c.width===this.w.width&&c.height===this.w.height);if(b)return b}return a.renditions[0]||
|
|
398
|
+
null}Ra(){return ul(this,_.M)}Va(){return ul(this,_.L)}vb(){return vl(this,_.N)}Gb(){return vl(this,_.M)}Hb(){return vl(this,_.L)}Ia(){return this.a.get(_.N)||null}ra(){return this.a.get(_.M)||null}xa(){return this.a.get(_.L)||null}Db(a){wl(this,_.N,a)}ya(a){wl(this,_.M,a)}Xa(a){wl(this,_.L,a)}nb(a){wl(this,_.N,a&&a.track)}Bb(a){wl(this,_.M,a&&a.track)}Cb(a){wl(this,_.L,a&&a.track)}addTextTrack(a){const b=this;return _.x(function*(){if(a.mimeType.match(/text\/vtt/)){const c="External_"+`${b.G++}`;
|
|
399
|
+
b.o[c]=a;xl(b,a,c)}else yield yl(b,a)})}ua(){return 1>=this.getVideoTracks().flatMap(a=>a.renditions).length}H(){const a=this;return _.x(function*(){const b=a.m.getConfiguration();Al(a,_.M,b.preferredAudioLanguage);if(!tl(a,_.L).some(c=>kl(c))){const c=sl(a,_.L);yield new Promise(d=>{a.f.one(c,nd,d);(new _.Gk(d)).ia(1)})}a.A||Al(a,_.L,b.preferredTextLanguage)})}};U.prototype.isAbrEnabled=U.prototype.ua;U.prototype.addTextTrack=U.prototype.addTextTrack;U.prototype.setTextRendition=U.prototype.Cb;
|
|
400
|
+
U.prototype.setAudioRendition=U.prototype.Bb;U.prototype.setVideoRendition=U.prototype.nb;U.prototype.setTextTrack=U.prototype.Xa;U.prototype.setAudioTrack=U.prototype.ya;U.prototype.setVideoTrack=U.prototype.Db;U.prototype.getTextTrack=U.prototype.xa;U.prototype.getAudioTrack=U.prototype.ra;U.prototype.getVideoTrack=U.prototype.Ia;U.prototype.getLoadingTextRendition=U.prototype.Hb;U.prototype.getLoadingAudioRendition=U.prototype.Gb;U.prototype.getLoadingVideoRendition=U.prototype.vb;
|
|
401
|
+
U.prototype.getTextRendition=U.prototype.Va;U.prototype.getAudioRendition=U.prototype.Ra;U.prototype.getVideoRendition=U.prototype.oa;U.prototype.getTextTracks=U.prototype.na;U.prototype.getAudioTracks=U.prototype.getAudioTracks;U.prototype.getVideoTracks=U.prototype.getVideoTracks;U.prototype.canSelectVideoTracks=U.prototype.re;_.Bu=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(Jb);}end(a){if(this.f)return this.f.end(a);if(a<this.a.length)return this.a[a].end;throw Error(Jb);}Qa(){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)}ma(){return!this.length||1===this.length&&1E-6>this.end(0)-this.start(0)?null:this.end(this.length-
|
|
402
|
+
1)}Mb(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}Ca(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.ma(),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=
|
|
403
|
+
"";for(let b=0;b<this.length;b++)0<b&&(a+=" "),a+=`${this.start(b).toFixed(3)}-${this.end(b).toFixed(3)}`;return a}};_.z("clpp.BufferInfo",_.Bu);_.Bu.prototype.bufferedAheadOf=_.Bu.prototype.Ca;_.Bu.prototype.isBuffered=_.Bu.prototype.Mb;_.Bu.prototype.bufferEnd=_.Bu.prototype.ma;_.Bu.prototype.bufferStart=_.Bu.prototype.Qa;_.Bu.prototype.end=_.Bu.prototype.end;_.Bu.prototype.start=_.Bu.prototype.start;_.Cu=class{constructor(){this.cd=new Qt(this);this.$c=[]}addEventListener(a,b){this.on(a,b)}removeEventListener(a,b){this.off(a,b)}on(a,b,c){return this.cd.on(a,b,c)}one(a,b,c){return this.cd.one(a,b,c)}off(a,b){return this.cd.off(a,b)}forwardEventsTo(a){a&&(0<=this.$c.indexOf(a)||this.$c.push(a))}dispatchEvent(a){this.trigger(a);return a.defaultPrevented}stopForwardingEventsTo(a){a&&(a=this.$c.indexOf(a),0<=a&&this.$c.splice(a,1))}trigger(a){this.cd.trigger(a);for(const b of this.$c)b.dispatchEvent(a)}};
|
|
404
|
+
_.Cu.prototype.off=_.Cu.prototype.off;_.Cu.prototype.one=_.Cu.prototype.one;_.Cu.prototype.on=_.Cu.prototype.on;_.Cu.prototype.removeEventListener=_.Cu.prototype.removeEventListener;_.Cu.prototype.addEventListener=_.Cu.prototype.addEventListener;var Bl=["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"];_.z("clpp.version",_.ea);_.z("clpp.name",_.qa);_.zl="application/x-mpegurl";_.z("clpp.Type",{DASH:_.Kc,HLS:_.zl,SMOOTH_STREAMING:_.Pc,MP4:_.Ig,MP3:"audio/mp3"});_.gi="scte35";_.hi="hls-daterange";_.z("clpp.TimelineCueType",{SCTE35:_.gi,DASH_CALLBACK:_.Qe,HLS_DATERANGE:_.hi,UNKNOWN:_.ug});_.z("clpp.SpeedUpMode",{DECODER:_.Pd,SEEK:"seek"});_.z("clpp.CodecSwitchingStrategy",{PREVENT:_.Cf,SMOOTH:_.Xf});var Du=class{};_.z("clpp.utils.PlayerConfiguration",Du);Du.create=_.Il;var Eu=["abort",cd,ed,fe,"emptied",he,_.je,_.q,"interruptbegin","interruptend",_.Ee,_.Fe,Ge,"mozaudioavailable",_.cf,_.gf,_.sf,_.Ef,_.Gf,_.Rf,_.Sf,Yf,"suspend",_.og,"volumechange",_.Og,_.Pg,_.Lf,Ug,Tg,Rg,Sg];_.Fu=class extends _.Cu{constructor(a){super();this.log=new _.S(a);this.configuration=this.ba=_.Gl();this.ga=this.F=null;this.jd=this.Se=!1;this.uf=new _.S("clpp.video.events");this.pb=null;this.Rd=-1;this.Kg=this.Hg.bind(this);this.Oe=new _.Er;this.M=new _.St;this.He=this.Gc=this.Lc=this.O=null}init(a,b){this.configuration=this.ba=b;this.F=a;this.log.info("Initializing Player surface");a=this.F.getMedia();this.log.info("Attaching media element listeners");for(const c of Eu)this.M.on(a,c,this.Kg,
|
|
405
|
+
c!==_.q);this.pb||(this.pb=this.Ag());this.pb.initialize(this);this.F.showMediaElement()}release(){this.O&&(this.O.destroy(),this.O=null);return Promise.resolve()}destroy(){this.M.release();return this.Oe.release()}canPlay(a,b){return _.Ih[this.namespace()].canPlay(a,b)}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.ob)}appendLoad(){return Promise.reject(_.ob)}seekWith(){return Promise.reject(_.ob)}detach(){return Promise.resolve()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}play(){if(!this.ga)return Promise.reject("No sources specified yet. You need to load content before calling play.");
|
|
406
|
+
const a=this.F.getMedia().play();return Promise.resolve(a).catch(b=>{this.log.info("Caught play promise exception",b);const c={name:b.name||"",message:b.message||"",stack:b.stack||""};Cl(c)?(this.trigger(new _.D(_.Yc)),this.log.warn(_.ja)):c.name===pb&&this.log.warn('Unrecognized "NotAllowedError" on play(). '+`${b.name}: ${b.message}`);throw b;})}pause(){return this.ga?new Promise((a,b)=>{const c=this.getState();if(c!==_.dp&&c!==_.$o&&c!==_.kp&&c!==_.jp)b(new _.I(_.F,7,3201,"The player state does not allow pause."));
|
|
407
|
+
else if(this.F.getMedia().pause(),this.getState()===_.kp)this.M.one(this,_.$f,()=>{a()});else a()}):Promise.reject(new _.I(_.F,7,3201,"No sources specified yet. You need to load content before calling pause."))}isPaused(){return this.F.getMedia().paused}isEnded(){return this.F.getMedia().ended}getConfiguration(){return this.configuration}setDrmCustomDataModifier(a){this.Lc=a}setCdnErrorCallback(a){this.Gc=a}Oc(){return this.Lc}getSurface(){return this.F}getBufferInfo(a){const b=this.getSurface().getMedia();
|
|
408
|
+
return new _.Bu(b?b.buffered:void 0,a)}getPosition(){return this.getMediaPosition()}getMediaPosition(){const a=this.F.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.getMediaPosition();if(void 0===a||null===a||typeof a!==_.t||a===b)return Promise.resolve();const c=this.F.getMedia();if(!c)return this.log.warn("No media element available, can not set current time!"),Promise.reject();const d=a-b;return.1>=Math.abs(d)?
|
|
409
|
+
(this.log.info("Skip seek. Delta "+Math.abs(d)+" \x3c 0.1"),Promise.resolve()):new Promise((e,f)=>{const g=()=>{this.trigger(new _.D(_.Cg));this.M.on(c,_.Rf,h);this.M.on(c,_.og,h);this.M.on(c,_.Ef,h);this.log.info("Seeking to "+a+". Delta "+d);this.jd=this.Se=!0;c.currentTime=a},h=l=>{const m=this.getMediaPosition(),n=.1>=Math.abs(a-m);var r=.25<m-a;const u=c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA,v=l.type===_.Rf,y=l.type===_.Ef,A=l.type===_.og,E=y&&u;r=v||n&&E||A&&r;this.log.debug("Checking seeking state after "+
|
|
410
|
+
l.type+" event. Seek completed:",r,"Current Time:",m,"Target Time:",a,"Native Event:",v,"Time reached",n,"Timeupdate:",A,"Progress:",y,"ReadyState:",u,"Progress Ready:",E);r?(this.jd=this.Se=!1,this.M.off(c,_.Rf,h),this.M.off(c,_.og,h),this.M.off(c,_.Ef,h),this.tf(),this.trigger(new _.D(_.Bg)),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();else this.M.one(c,_.Fe,g)};this.getState()===_.hp?
|
|
411
|
+
(this.log.debug("Player is in IDLE state. Postpone seek."),this.M.one(this,_.$f,()=>{switch(this.getState()){case _.dp:case _.kp:case _.jp: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.F.getMedia();if(a)return a.volume;this.log.warn("No media element available, can not report volume!");return null}setVolume(a){const b=this.F.getMedia();b?_.th(a)?0>a||1<a?this.log.warn(`Can not set volume to ${a}.
|
|
412
|
+
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.F.getMedia().muted}setMuted(a){const b=this.F.getMedia();typeof a===_.$c&&(b.muted=a)}getDuration(){return this.getMediaDuration()}getMediaDuration(){return this.ga?this.F.getMedia().duration:-1}getTrackManager(){return this.pb}getPlaybackRate(){const a=this.F.getMedia();return a&&a.playbackRate||
|
|
413
|
+
1}setPlaybackRate(a){const b=this.F.getMedia();void 0!==a&&b&&(b.playbackRate=a)}setSourceIndex(a){this.Rd=a}getSourceIndex(){return this.Rd}getLoadedSource(){return this.ga&&-1!==this.Rd?this.ga[this.Rd]:null}getPeriods(){return[]}getNetworkEngine(){return this.Oe}setNetworkEngine(a){this.Oe=a}setCmsdManager(a){this.He=a}getTextDisplayer(){return this.O}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){}Hg(a){var b=this.getSurface().getMedia();const c=this.getPosition();let d="Received Video Element Event: '"+
|
|
414
|
+
a.type+"' with playhead at: "+c;if(a.type===_.og||a.type===_.Ef)this.uf.debug(d);else{let e="";switch(a.type){case _.Gf:e=`Rate: ${this.getPlaybackRate()}`;break;case fe:e=`Duration: ${this.getDuration()}`;break;case "volumechange":e=`Volume: ${this.getVolume()} Muted: ${this.isMuted()}`;break;case _.gf:case _.sf:case "suspend":case _.Og:case Yf:case _.Sf:case _.Rf:case _.og:case _.Ef:case cd:case ed:b=this.getBufferInfo().Ca(c);e=`State ${this.getSurface().getMedia().readyState} `+`Buffer: ${b}`;
|
|
415
|
+
break;case _.Lf:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=". "+e);this.uf.info(d)}a.type!==_.q&&this.trigger(new _.D(a.type,{detail:a}))}tf(){}};var Ml;Ml=new _.S("clpp.Components");_.Kl=new Map;_.z("clpp.install",function(a){Ul(a)});_.z("clpp.uninstall",function(a){Vl(a)});var Gu=class{};_.z("clpp.utils.Uint8ArrayUtils",Gu);Gu.toStandardBase64=_.Wl;Gu.concat=_.bm;Gu.equal=_.am;Gu.toHex=_.$l;Gu.fromHex=_.Zl;Gu.fromBase64=_.Yl;Gu.toBase64Url=_.Xl;var Hu=class{constructor(){this.a=this.f=null;this.g=new _.S("clpp.drm.csl")}release(){this.a=this.f=null}};_.z("clpp.drm.WidevineRobustnessLevel",{SW_SECURE_CRYPTO:_.Cb,SW_SECURE_DECODE:_.Db,HW_SECURE_CRYPTO:Wa,HW_SECURE_DECODE:Xa,HW_SECURE_ALL:Va});_.z("clpp.drm.PlayreadyRobustnessLevel",{SL150:"150",SL2000:"2000",SL3000:"3000"});_.z("clpp.drm.KeySystem",{NONE:_.Re,CLEAR_KEY:_.af,WIDEVINE:_.Jd,PLAYREADY:_.Hd,FAIRPLAY:_.Ed,PRIMETIME:_.Dd});_.em={};_.z("clpp.drm.registerDrmEnvironment",_.fm);var im={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,
|
|
404
416
|
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,
|
|
405
417
|
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,
|
|
406
418
|
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,
|
|
@@ -414,99 +426,100 @@ break;case _.Df:null!=b&&(e=`Size: ${b.videoWidth}x${b.videoHeight}`)}e&&(d+=".
|
|
|
414
426
|
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,
|
|
415
427
|
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,
|
|
416
428
|
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,
|
|
417
|
-
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]};_.
|
|
418
|
-
_.z("clpp.utils.dataview.DataViewReader",_.
|
|
419
|
-
this.f[f];if(h){let m=null;var k=null;this.h[f]===
|
|
420
|
-
_.
|
|
421
|
-
var
|
|
422
|
-
42E3:"General Playready error",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"},
|
|
423
|
-
|
|
424
|
-
for(const a of Object.keys(
|
|
425
|
-
extractContentId:_.
|
|
426
|
-
persistentState:_
|
|
427
|
-
e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.
|
|
428
|
-
void 0===a?
|
|
429
|
-
b){if(this.l)return Promise.reject(
|
|
430
|
-
d);this.f&&(
|
|
431
|
-
this.h=null;else if(null!==this.f)this.f.reject(d),this.f=null;else switch(this.a.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:
|
|
432
|
-
this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.
|
|
433
|
-
|
|
434
|
-
new
|
|
435
|
-
(f.push(k),e=!0));h||(e=b.canPlayType(_.
|
|
436
|
-
|
|
437
|
-
new
|
|
438
|
-
this.closed;const a=
|
|
439
|
-
b||0<d.getElementsByTagName("parsererror").length?null:a}removeChild(a,b){a.removeChild(b)}};_.
|
|
440
|
-
a.reader.getPosition()!==a.reader.
|
|
441
|
-
_.
|
|
442
|
-
this.F=!1;this.O=null}destroy(){const a=this;return _.x(function*(){a.j?yield a.da:(a.j=!0,yield
|
|
443
|
-
_.
|
|
444
|
-
this.o.set(f,e);c&&!c.keyId&&this.h.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.
|
|
445
|
-
a)&&c&&!c.
|
|
446
|
-
a.o=null);_.
|
|
447
|
-
b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}getTrackManager(){return this.
|
|
448
|
-
b.configuration);b.log.debug(_.vb,b.
|
|
449
|
-
null==b.configuration.startTime&&
|
|
450
|
-
this.getSurface().getMedia();if(a&&a.src){a=a.seekable;if(a.length)return this.
|
|
451
|
-
a.j=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.
|
|
452
|
-
_.
|
|
453
|
-
V.prototype.getWrapperAdSystems=V.prototype.getWrapperAdSystems;V.prototype.getWrapperAdIds=V.prototype.getWrapperAdIds;V.prototype.getSequenceLength=V.prototype.
|
|
454
|
-
V.prototype.getClickThroughUrl=V.prototype.
|
|
455
|
-
V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.getId;V.prototype.getTechnology=V.prototype.
|
|
456
|
-
Q.prototype.getVideoElement=Q.prototype.
|
|
457
|
-
Q.prototype.getMediaHeight=Q.prototype.
|
|
458
|
-
Q.prototype.getApiFramework=Q.prototype.getApiFramework;Q.prototype.getSourceId=Q.prototype.
|
|
459
|
-
d)}).then(c)});return b.ready}destroy(){const a=this;return _.x(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};_.z("clpp.utils.dom.createHTMLElement",_.
|
|
460
|
-
HTMLMediaElement))throw new _.
|
|
461
|
-
a):this.g.warn("Player Surface Element has no parent. Can not inject container. You have to manually add playerSurface.getContainer() to the DOM!");var e=[];for(let g=0;g<a.classList.length;g++)e.push(a.classList[g]);for(var f of e)a.classList.remove(f),_.
|
|
462
|
-
|
|
463
|
-
this.g.debug("No media element available that could be shown")}addElementToContainer(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;const d=this.getContainer();if(!d)throw Error("No container is available. Unable to add element");b&&_.
|
|
464
|
-
|
|
465
|
-
this;return _.x(function*(){yield Promise.all([
|
|
466
|
-
a.a=[];a.j=!1;
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
this.a.
|
|
476
|
-
|
|
477
|
-
this.a.
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
R.prototype.
|
|
481
|
-
R.prototype.
|
|
482
|
-
R.prototype.
|
|
483
|
-
|
|
484
|
-
7,
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
d;}finally{a.j=!1,b&&
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
429
|
+
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]};_.Iu=class{constructor(a){this.I=a;this.f={}}cb(a,b){this.f[a]=b}};_.z("clpp.drm.DrmEnvironment",_.Iu);_.Iu.prototype.setDrmSystem=_.Iu.prototype.cb;_.Fm=class{constructor(a,b){b=void 0===b?!1:b;this.f=_.th(a)?new DataView(new ArrayBuffer(a),0,a):a;this.a=0;this.h=b;this.buffer=this.f.buffer}getPosition(){return this.a}Sa(){return this.f.byteLength}seek(a){(0>a||a>=this.f.byteLength)&&_.km();this.a=a}};_.An=class{constructor(a,b){this.f=a;this.h=void 0===b?!0:b;this.a=0}getPosition(){return this.a}Sa(){return this.f.byteLength}skip(a){this.a+a>this.f.byteLength&&_.nm();this.a+=a}seek(a){if(0>a||a>=this.f.byteLength)throw _.nm();this.a=a}};
|
|
430
|
+
_.z("clpp.utils.dataview.DataViewReader",_.An);_.Dm=class{constructor(){this.h=[];this.f=[];this.a=!1;this.g=new _.S("clpp.mp4")}N(a,b){a=um(a);this.h[a]=Ju;this.f[a]=b;return this}ea(a,b){a=um(a);this.h[a]=Ku;this.f[a]=b;return this}stop(){this.a=!0}parse(a,b){a=_.K(a);a=new _.An(new DataView(a.buffer,a.byteOffset,a.byteLength),!1);for(this.a=!1;_.mm(a)&&!this.a;)this.ee(0,a,b)}ee(a,b,c){const d=b.getPosition();let e=_.P(b);var f=_.P(b);let g=!1;this.g.debug("Parsing MP4 box",_.vm(f));switch(e){case 0:e=b.Sa()-d;break;case 1:e=_.rm(b),g=!0}const h=
|
|
431
|
+
this.f[f];if(h){let m=null;var k=null;this.h[f]===Ku&&(k=_.P(b),m=k>>>24,k&=16777215);f=b.getPosition()-d;var l=d+e;c&&l>b.Sa()&&(l=b.Sa());l-=b.getPosition();b=0<l?_.tm(b,l):new Uint8Array(0);b=new _.An(new DataView(b.buffer,b.byteOffset,b.byteLength),!1);h({parser:this,partialOkay:c||!1,version:m,flags:k,reader:b,size:e,start:d+a,headerSize:f,has64BitSize:g})}else a=Math.min(d+e-b.getPosition(),b.Sa()-b.getPosition()),b.skip(a)}};_.z("clpp.utils.Mp4Parser",_.Dm);_.Dm.typeToString=_.vm;
|
|
432
|
+
_.Dm.allData=_.ym;_.Dm.sampleDescription=_.xm;_.Dm.children=_.wm;_.Dm.prototype.parseNext=_.Dm.prototype.ee;_.Dm.prototype.parse=_.Dm.prototype.parse;_.Dm.prototype.stop=_.Dm.prototype.stop;_.Dm.prototype.fullBox=_.Dm.prototype.ea;_.Dm.prototype.box=_.Dm.prototype.N;_.Dm.headerSize=_.zm;var Ju=0,Ku=1;var Lu=class{};_.z("clpp.utils.FairplayUtils",Lu);Lu.parseFairPlayResponse=_.Im;Lu.formatFairPlayRequest=_.Hm;Lu.createFairplayPayload=Gm;Lu.extractContentId=_.Cm;Lu.extractExtXKeyUri=Am;var Om=new _.S("clpp.drm.DrmToday"),an="PRODUCTION",bn="STAGING",cn="DEMO",dn="TEST",Mu={PRODUCTION:an,STAGING:bn,DEMO:cn,TEST:dn};_.z("clpp.drm.DrmToday.Environment",Mu);_.z("clpp.drm.DrmToday.WidevineCertificates",{V1_PROD:"V1_PROD",V1_STAGING:"V1_STAGING",V2:"V2"});
|
|
433
|
+
var Km="/license-proxy-widevine/cenc/",Lm="/license-proxy-headerauth/drmtoday/RightsManager.asmx",Mm="/license-server-fairplay/",en={"00000":"Success","01000":"General Internal Error","02000":"General Request Error","03000":"General Request Authentication Error",10001:"Bad Request",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",
|
|
434
|
+
42E3:"General Playready error",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"},Nu=[Va,Xa,Wa,_.Db,_.Cb],Ou=[Va,Xa,
|
|
435
|
+
Wa,_.Db,_.Cb],Pu=["3000","2000","150"],Qu=["2000","150"];
|
|
436
|
+
for(const a of Object.keys(Mu)){let b=xa;a!==an&&(b+=`_${a}`);const c=new _.Iu(b);let d=null;switch(a){case an:case bn:case cn:d=jm("V2");break;case dn:d=null}c.cb(_.Jd,{licenseUrl:Nm(_.Jd,a),videoRobustness:Nu,audioRobustness:Ou,persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:d,modifiers:{licenseRequest:_.Tm,licenseResponse:_.Um}});c.cb(_.Ed,{licenseUrl:Nm(_.Ed,a),certificateUrl:Jm(a)+"/license-server-fairplay/cert/",modifiers:{licenseRequest:_.Wm,licenseResponse:_.Xm,
|
|
437
|
+
extractContentId:_.Ym,certificateRequest:_.Zm}});c.cb(_.Hd,{licenseUrl:Nm(_.Hd,a),videoRobustness:Pu,audioRobustness:Qu,modifiers:{licenseRequest:$m}});_.fm(c)};_.Ru=class{constructor(a){this.f=a;this.a=void 0}value(){void 0===this.a&&(this.a=this.f());return this.a}};var Tu=class{constructor(){this.size=0;this.a=void 0;this.g=new _.S("clpp.drm.eme.MediaKeyStatusMap")}getStatus(){return this.a}forEach(a){this.a&&a(this.a,Su.value())}get(a){if(this.has(a))return this.a}has(a){const b=Su.value();return this.a&&aj(a,b)?!0:!1}entries(){}keys(){}values(){}},Su=new _.Ru(()=>gj(new Uint8Array([0])));var jn=new _.Ru(()=>new Map([[HTMLMediaElement.HAVE_METADATA,_.Fe],[HTMLMediaElement.HAVE_CURRENT_DATA,_.Ee],[HTMLMediaElement.HAVE_FUTURE_DATA,cd],[HTMLMediaElement.HAVE_ENOUGH_DATA,ed]]));var Vu=class{constructor(){this.j=this.w=null}l(a){this.w=a}h(a){const b=this.j;b&&b!==a&&ln(b,null);return(this.j=a)?ln(a,this.w):Promise.resolve()}o(){return this.j}a(a,b){_.Gh("AppleEmeManager.requestMediaKeySystemAccess");try{const c=new Uu(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}f(){return Xn}},Uu=class{constructor(a,b){this.keySystem=a;if(a.startsWith(_.Ed))for(var c of b){a:{a=c;if(a.persistentState===_.Kf){a=null;break a}b={audioCapabilities:[],videoCapabilities:[],
|
|
438
|
+
persistentState:_.$e,distinctiveIdentifier:_.$e,initDataTypes:a.initDataTypes,sessionTypes:[gg],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),
|
|
439
|
+
e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,_.Ig));a=e?b:null}if(a){this.a=a;return}}c=Error(Qb);c.name=qb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new Wu(this.keySystem);return Promise.resolve(a)}getConfiguration(){_.Gh("AppleEmeManager.MediaKeySystemAccess.getConfiguration");return this.a}},Wu=class{constructor(a){this.f=null;this.h=new WebKitMediaKeys(a);this.a=new _.St;this.j=0;this.g=new _.S(wd);this.g.info("Created Media Keys for "+a)}createSession(a){a=
|
|
440
|
+
void 0===a?gg:a;this.g.debug("Creating Apple MediaKeys Session");if(a!==gg)throw new TypeError("Session type "+a+ba);return new Xu(this.h,`__session_${this.j++}`)}setServerCertificate(){this.g.debug("AppleEmeManager.MediaKeys.setServerCertificate");return Promise.resolve(!1)}},Xu=class extends _.Cu{constructor(a,b){super();this.a=null;this.o=a;this.f=this.h=null;this.j=new _.St;this.sessionId=b;this.expiration=NaN;this.closed=new _.rn;this.l=!1;this.keyStatuses=new Tu;this.g=new _.S(wd)}generateRequest(a,
|
|
441
|
+
b){if(this.l)return Promise.reject(Fb);this.g.debug("generateRequest");this.h=new _.rn;try{const c=this.o.createSession(_.Ig,_.K(b));this.a=c;this.sessionId=c.sessionId||this.sessionId||"";this.j.on(c,Tg,d=>{{const e=this.keyStatuses.getStatus();this.g.debug(`Received Key Message in ${this.sessionId}`);this.h&&(this.h.resolve(),this.h=null);d=new _.D(_.Ke,{messageType:void 0===e||e===ag?we:ve,message:gj(d.message.buffer)});this.dispatchEvent(d)}});this.j.on(c,Rg,d=>{this.g.debug("onWebkitKeyAdded_",
|
|
442
|
+
d);this.f&&(mn(this,"usable"),this.f.resolve(),this.f=null)});this.j.on(c,Sg,()=>{var d=this.keyStatuses.getStatus();if(this.a&&this.a&&this.a.error&&this.a.error.code===WebKitMediaKeyError.MEDIA_KEYERR_DOMAIN&&d===ag)this.g.warn(`Ignoring webkit key error for session ${this.sessionId}`);else if(this.g.error(`Received key error in session ${this.sessionId} `+`with code ${this.a.error.code}. `+`Session Status ${d}.`),d=Error("EME AppleEmeManager key error"),d.errorCode=this.a.error,null!==this.h)this.h.reject(d),
|
|
443
|
+
this.h=null;else if(null!==this.f)this.f.reject(d),this.f=null;else switch(this.a.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:mn(this,"output-not-allowed");break;default:mn(this,_.se)}});mn(this,ag)}catch(c){this.h.reject(c)}return this.h}load(){this.g.debug(_.De);return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){if(this.l)return Promise.reject(Fb);this.g.debug(vg);this.f=new _.rn;try{this.a.update(_.K(a))}catch(b){this.f.reject(b)}return this.f}close(){if(this.l)return this.closed;
|
|
444
|
+
this.g.info(`Closing Key Session ${this.sessionId}`);this.l=!0;try{this.a.close(),this.closed.resolve(),_.Th(this.j)}catch(a){this.closed.reject(a)}return this.closed}remove(){this.g.debug("remove");return Promise.reject(Error("MediaKeySession is only applicable for persistent licenses, which are not supported on this platform"))}},Yu=class{a(){return Xn}f(){return!!window.WebKitMediaKeys}create(){return new Vu}};var Zu=class{constructor(){this.j=null;this.g=new _.S("clpp.drm.eme.StandardEmeManager")}l(a){this.j=a}h(a){return this.j?this.j.setMediaKeys(a):Promise.reject(fb)}o(){return this.j&&this.j.mediaKeys}a(a,b){this.g.info("Requesting media key system access for",a,b.map(c=>Object.assign({},c,{drmInfos:c.drmInfos.map(()=>"_anonymous_")})));return navigator.requestMediaKeySystemAccess(a,b).catch(c=>{this.g.info("Failed to request media key system access for "+`${a}.`,c);return Promise.reject(c)})}f(){return Bo}},
|
|
445
|
+
$u=class{a(){return Bo}f(){return!!(window.MediaKeys&&navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)}create(){return new Zu}};var cv=class{constructor(){this.w=this.j=null;this.A="";HTMLMediaElement.prototype.webkitGenerateKeyRequest&&(this.A="webkit")}l(a){this.j=a}h(a){_.Gh("WebkitEmeManager.setMediaKeys");if(!this.j)return Promise.reject(fb);const b=this.w;b&&b!==a&&pn(b,null);(this.w=a)&&pn(a,this.j);return Promise.resolve()}o(){return this.w}a(a,b){_.Gh("WebkitEmeManager.requestMediaKeySystemAccess");try{if(this.j)var c=this.j;else{var d=document.getElementsByTagName(_.w);c=d.length?d[0]:document.createElement(_.w)}const e=
|
|
446
|
+
new av(this.A,c,a,b);return Promise.resolve(e)}catch(e){return Promise.reject(e)}}f(){return bv}},av=class{constructor(a,b,c,d){this.h=a;this.a=this.keySystem=c;a=!1;c===_.af&&(this.a=Qg,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,this.a)&&
|
|
447
|
+
(f.push(k),e=!0));h||(e=b.canPlayType(_.Ig,this.a)||b.canPlayType("video/webm",this.a));g.persistentState!==_.Kf||a||(e=!1);if(e){this.f=g;return}}b=Qb;if(c===_.af||c===_.Jd)b="None of the requested configurations were supported.";c=Error(b);c.name=qb;c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){return Promise.resolve(new dv(this.h,this.a))}getConfiguration(){return this.f}},dv=class{constructor(a,b){this.h=a;this.o=b;this.a=null;this.f=new _.St;this.j=[];this.l=new Map}createSession(a=
|
|
448
|
+
gg){if(a!==gg&&a!==_.ef)throw new TypeError("Session type "+a+ba);if(!this.a)throw a=Error("Media element is missing."),a.name=Za,a.code=DOMException.INVALID_STATE_ERR,a;this.a.src||(this.a.src="about:blank");a=new ev(this.h,this.a,this.o,a);this.j.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}},ev=class extends _.Cu{constructor(a,b,c,d){super();this.w=a;this.j=b;this.o=!1;this.a=this.f=null;this.h=c;this.l=d;this.sessionId="";this.expiration=NaN;this.closed=new _.rn;this.keyStatuses=
|
|
449
|
+
new Tu}ready(){_.Gh("WebkitEmeManager.MediaKeySession.ready");on(this,"usable");this.a&&this.a.resolve();this.a=null}generateRequest(a,b){_.Gh("WebkitEmeManager.MediaKeySession.generateRequest");return sn(this,b,null)}load(a){_.Gh(Wb);return this.l===_.ef?sn(this,null,a):Promise.reject(Error(nb))}update(a){_.Gh(Wb);const b=new _.rn;tn(this,b,a);return b}close(){_.Gh("WebkitEmeManager.MediaKeySession.close");if(this.l!==_.ef){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),
|
|
450
|
+
this.closed;const a=qn(this,"cancelKeyRequest");try{this.j[a](this.h,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){_.Gh("WebkitEmeManager.MediaKeySession.remove");return this.l!==_.ef?Promise.reject(Error(nb)):this.close()}},fv=class{a(){return bv}f(){return!(!HTMLMediaElement.prototype.webkitGenerateKeyRequest&&!HTMLMediaElement.prototype.generateKeyRequest)}create(){return new cv}};var hv=class{l(){}h(a){_.Gh("NopEmeManager.setMediaKeys");return null===a?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}o(){return null}a(){_.Gh("NopEmeManager.requestMediaKeySystemAccess");return Promise.reject(Error("The key system specified is not supported."))}f(){return gv}},iv=class{a(){return gv}f(){return!0}create(){return new hv}};var jv=class{};_.z(xd,jv);var vn=new _.S(xd),un=[];un=[new $u,new Yu,new fv,new iv].filter(a=>a.f());var Bo="STANDARD",Xn="APPLE",bv="WEBKIT",gv="NOP";jv.Apis={STANDARD:Bo,APPLE:Xn,WEBKIT:bv,NOP:gv};_.kv=class{h(a,b){a=this.a(a,b);return 1!==a.length?null:a[0]}a(a,b){return Array.from(a.childNodes).filter(c=>c instanceof Element&&c.tagName===b)}getAttributeNS(a,b,c){return a.hasAttributeNS(b,c)?a.getAttributeNS(b,c):null}f(a){return Array.from(a.childNodes).every(b=>b.nodeType===Node.TEXT_NODE||b.nodeType===Node.CDATA_SECTION_NODE)?a.textContent.trim():null}j(a,b){const c=new DOMParser;let d=null;try{d=c.parseFromString(a,_.ig)}catch(e){}if(!d)return null;a=d.documentElement;return b&&a.tagName!==
|
|
451
|
+
b||0<d.getElementsByTagName("parsererror").length?null:a}removeChild(a,b){a.removeChild(b)}};_.ah=_.kv.prototype;_.ah.Bd=_.ch(19);_.ah.ge=_.ch(17);_.ah.Xd=_.ch(15);_.ah.Yd=_.ch(13);_.ah.fe=_.ch(11);_.ah.Hc=_.ch(9);_.ah.Nd=_.ch(7);_.ah.Z=_.ch(5);_.ah.rc=_.ch(3);_.ah.Rb=_.ch(1);_.Dn=new _.kv;_.lv=new _.S("clpp.xml.Parser");_.Fl="dom";var yn,mv,xn;_.Hn=[154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149];yn=[237,239,139,169,121,214,74,206,163,200,39,220,213,29,33,237];mv=class{constructor(a,b,c){this.j=new Uint8Array(a);this.a=b;this.f=c}};xn=class extends mv{};_.Gn=class extends mv{constructor(a,b,c,d,e,f){f=void 0===f?null:f;super(a,b,d);this.version=e;this.h=c;this.l=f}};var Jn=!!(performance&&performance.mark&&performance.measure),Ln=new _.S("clpp.perf");var oo=class{constructor(a){this.f=[];this.h=[];this.a=[];8<=a.byteLength&&(new _.Dm).ea("pssh",this.j.bind(this)).parse(a.buffer);0===this.a.length&&_.C("No pssh box found!")}j(a){if(1<a.version)_.C("Unrecognized PSSH version found!");else{var b=_.$l(_.tm(a.reader,16)),c=[];if(0<a.version){var d=_.P(a.reader);for(let e=0;e<d;++e){const f=_.$l(_.tm(a.reader,16));c.push(f)}}d=_.P(a.reader);a.reader.skip(d);this.h.push.apply(this.h,c);this.f.push(b);this.a.push({start:a.start,end:a.start+a.size-1});
|
|
452
|
+
a.reader.getPosition()!==a.reader.Sa()&&_.C("Mismatch between box size and data size!")}}};var jo,nv;
|
|
453
|
+
_.rp=class{constructor(a,b){this.D=a;this.Ha=b;this.J=new Set;this.C=this.I=this.l=null;this.S=!1;this.a=null;this.K=nv;this.B=new _.St;this.M=new Hu;this.h=new Map;this.L=[];this.H=new _.rn;this.ha=0;this.f=null;this.w=c=>{this.A=!0;this.F=!1;this.H.reject(c);a.onError(c)};this.o=new Map;this.Y=new Map;this.U=new _.Gk(()=>$n(this));this.j=!1;this.da=new _.rn;this.G=!1;this.W=[];this.ba=!1;this.R=0;this.g=new _.S("clpp.drm.DrmEngine");this.$=(new _.Gk(()=>{ao(this)})).Eb(1);this.H.catch(()=>{});this.A=
|
|
454
|
+
this.F=!1;this.O=null}destroy(){const a=this;return _.x(function*(){a.j?yield a.da:(a.j=!0,yield bo(a),a.da.resolve())})}keySystem(){return this.a?_.Pn(this.a.keySystem):""}getDrmInfo(){return this.a}Aa(a){const b=this;return _.x(function*(){b.G&&b.K===jo||(!b.f.delayLicenseRequestUntilPlayed||b.C&&!b.C.paused||b.ba?yield to(b,a):b.W.push(a))})}va(a){const b=a.target;this.g.info("Key status changed for session",b.sessionId);const c=this.h.get(b);let d=!1;b.keyStatuses.forEach((e,f)=>{if(typeof f===
|
|
455
|
+
_.cg){var g=f;f=e;e=g}if(On(this.a.keySystem)&&16===f.byteLength&&_.Ik()){g=_.fj(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!==ag&&(c.loaded=!0);c&&c.kb&&c.kb.resolve();"expired"===e&&(d=!0);f=_.K(f);let h=_.$l(f);"00"===h&&c&&c.keyId?h=c.keyId:this.a.keySystem.startsWith(_.Ed)&&16!==f.byteLength&&(h=hj(f));(f=h||"")?this.g.info(`Key status for Key ID '${h}': ${e}`):this.g.info(`Key status global keys: ${e}`);
|
|
456
|
+
this.o.set(f,e);c&&!c.keyId&&this.h.forEach((k,l)=>{l===b||k.keyId!==h||k.loaded||(k.loaded=!0)})});c&&c.loaded&&c.qb.forEach(e=>{this.o.get(e)===ag&&(this.g.warn(`Key status for Key ID '${e}': 'output-restricted'`),this.o.set(e,_.bf))});for(a=0;a<this.a.initData.length;a++){const e=this.a.initData[a];e.keyId&&this.o.get(e.keyId)===ag&&_.am(e.initData,c.initData)&&(this.g.warn(`Key status for Key ID '${e.keyId}': 'output-restricted'`),this.o.set(e.keyId,_.bf))}a=b.expiration-Date.now();(0>a||d&&1E3>
|
|
457
|
+
a)&&c&&!c.kc&&(this.g.debug("Session has expired",b.sessionId),(a=this.h.get(b))&&a.Jc&&a.Jc.stop(),this.h.delete(b),b.close().catch(()=>{}));Do(this)&&(this.H.resolve(),1!==this.h.size||d?this.U.ia(.5):$n(this))}};jo=0;nv=3;_.Po=new Map;_.Qo=new _.S("clpp.text");var ov=class{constructor(){this.a=null;this.f=[]}};var pv=class{constructor(){this.h=this.f=this.j=null;this.a=[]}};_.qv=class{constructor(){this.h=this.w=this.B=this.C=this.l=this.o=this.j=this.A=NaN;this.a=new ov;this.f=new pv}getStats(){return{width:this.A,height:this.j,streamBandwidth:this.w,decodedFrames:this.l,droppedFrames:this.o,corruptedFrames:this.C,estimatedBandwidth:this.h,loadLatency:this.B,playTime:Uo(this.a,_.kp),pauseTime:Uo(this.a,_.jp),bufferingTime:Uo(this.a,_.dp),stateHistory:Vo(this.a),switchHistory:Wo(this.f)}}};var sv=class{constructor(a){this.g=new _.S("clpp.StateManager");this.m=a;this.a=new _.St;this.f=_.hp;this.A=_.rv;this.H=0;this.w=-1;this.K=this.o=this.I=this.B=0;this.j=this.h=this.F=!1;this.G=0;this.l=null;this.J=0;this.L=_.Uk();this.C=!1;this.I=Date.now();bp(this)}Ya(a,b){this.m&&this.m.trigger(new _.D(a,{detail:b}))}getState(){return ep(this,"")}destroy(){this.g.debug("Stop watching for video events for "+this.m.namespace());this.a.release()}};_.z("clpp.utils.media.detectType",lp);var op=new _.S("clpp.sources");var uv=class extends _.Fu{constructor(){super(yd);this.w=this.G=!1;this.l=this.A=this.o=this.a=this.j=null;this.h=new _.St;this.C=this.B=this.f=this.H=null}init(a,b){super.init(a,b);this.j=new sv(this);Zo(this.j,_.hp)}namespace(){return yd}unload(){const a=this;return _.x(function*(){if(a.ga){a.log.debug("Releasing player with source",a.ga);a.B&&(a.B.stop(),a.B=null);var b=a.getTrackManager();b&&b.release();a.A&&(a.A.destroy(),a.A=null);a.O&&(a.O.destroy(),a.O=null);a.l&&a.l.release();a.o&&(a.o.destroy(),
|
|
458
|
+
a.o=null);_.Th(a.h);a.f&&(a.f=new _.qv);a.C=null;a.ga=null;a.G=!1;a.a&&(a.a.removeAttribute("src"),a.a.load());if(a.w)throw new _.I(_.F,7,7E3);a.a&&(b=a.a,a.h.off(b,_.q),a.h.off(b,_.Lf),a.a=null)}})}release(){return super.release().then(()=>this.unload()).then(()=>{this.j&&Zo(this.j,_.hp)})}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(za);const a=this.getTrackManager();
|
|
459
|
+
a&&a.destroy();this.l&&(this.l.destroy().catch(b=>{this.log.warn("Error while disposing metadata handler",b)}),this.l=null);this.j&&(this.j.destroy(),this.j=null);this.f=null})}getDrmInfo(){return this.o?this.o.getDrmInfo():null}getTrackManager(){return this.pb}load(a){const b=this;return _.x(function*(){if(b.w)return Promise.reject(new _.I(_.F,7,7E3));if(!b.getSurface()||!b.getSurface().getMedia())return Promise.reject("No surface or no media element in surface");const c=b.F.getMedia();b.H=Date.now()/
|
|
460
|
+
1E3;b.f=new _.qv;b.h.on(b,_.$f,()=>{b.f&&_.To(b.f.a,b.getState())});Zo(b.j,_.ip);b.ga=_.np(a);b.configuration=_.Il(b.ba,a);b.log.debug(_.cb,b.configuration);b.log.debug(_.vb,b.ga);const d=_.So(b.configuration,[_.qe,"native"]);b.O=d.create(b);b.O.setTextVisibility(!0);b.configuration.enableHtmlCue&&_.Ll(_.fg)&&!_.Wk()&&(b.A=new fu(b),b.A.start(c));b.l?b.l.release():b.l=new Tt(b);c.textTracks&&oi(b.l,c.textTracks);b.getTrackManager().load();c.loop=!!b.configuration.loop;_.B(b.configuration.volume)||
|
|
461
|
+
b.setVolume(b.configuration.volume);_.B(b.configuration.muted)||b.setMuted(b.configuration.muted);b.h.one(c,cd,()=>{b.trigger(new _.D(_.pg))});null==b.configuration.startTime&&xp(b,c);_.Uk()&&yp(b,c);try{qp(b,c),yield tp(b),yield wp(b).V}catch(e){b.G=!1,b.onError(e)}})}onError(a){this.G||(a.severity===_.F&&null!==this.j&&Zo(this.j,_.ap),this.trigger(new _.D(_.q,{detail:a})))}Ag(){return new U}getState(){return null!==this.j?this.j.getState().currentState:_.rv}getPresentationStartTime(){if(this.a&&
|
|
462
|
+
this.a.getStartDate&&this.isLive()){const a=this.a.getStartDate();return isNaN(a.getTime())?null:a.getTime()/1E3}return null}getSeekRange(){var a=this.getSurface().getMedia();if(a&&a.src){a=a.seekable;if(a.length)return this.C=a={start:a.start(0),end:a.end(a.length-1)};if(this.C)return this.C}return{start:0,end:0}}isLive(){return this.a&&this.a.src?Infinity===this.a.duration:!1}getStats(){if(!this.f||!this.a)return _.Xo();this.f&&_.To(this.f.a,this.getState());var a=this.a,b=this.f,c=a.videoHeight;
|
|
463
|
+
b.A=a.videoWidth;b.j=c;a.getVideoPlaybackQuality&&(c=a.getVideoPlaybackQuality(),a=this.f,b=Number(c.totalVideoFrames),a.o=Number(c.droppedVideoFrames),a.l=b,this.f.C=Number(c.corruptedVideoFrames));if(a=this.getTrackManager())if(a=a.oa())a.bandwidth&&(this.f.w=a.bandwidth),a.Wc&&(this.f.h=a.Wc);return this.f.getStats()}getTimelineCues(){return this.l?this.l.getTimelineCues():[]}getCueTimeline(){return null}};
|
|
464
|
+
_.Kh(new class{a(){return yd}canPlay(a,b){a=a.type||"";const c=a===_.Kc,d=a===_.Pc,e=a===_.zl;var f;_.Tk()||c||d||e&&!_.Uk()?f=0:f=""!==Hk().canPlayType(a)?e&&_.Uk()&&(window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported)&&!b.streaming.preferNativeHlsOnSafari?1:2:0;return f}f(a){return a===_.ma}create(){return new uv}});_.z("clpp.ads.PodType",{PREROLL:0,MIDROLL:1,POSTROLL:2});_.z("clpp.ads.Technology",{CLIENT_SIDE:0,SERVER_SIDE:1,SERVER_GUIDED:2});_.z("clpp.ads.ErrorType",{LOAD:0,PLAY:1,OTHER:2});var Ap=new _.S("clpp.ads"),zp=[];var vv=class{load(){}start(){}w(){}resume(){}pause(){}skip(){}getVolume(){}setVolume(){}getPosition(){}h(){}o(){}};_.z("clpp.ads.IAdsManager",vv);vv.prototype.getPosition=vv.prototype.getPosition;vv.prototype.setVolume=vv.prototype.setVolume;vv.prototype.getVolume=vv.prototype.getVolume;vv.prototype.skip=vv.prototype.skip;vv.prototype.pause=vv.prototype.pause;vv.prototype.resume=vv.prototype.resume;var V=class{sb(){}tb(){}xb(){}getId(){}getCreativeId(){}Sb(){}getApiFramework(){}getAdSystem(){}getAdvertiserName(){}getTitle(){}getDuration(){}getPosition(){}getSkipTimeOffset(){}Vb(){}ub(){}getMediaUrl(){}ib(){}hb(){}Ta(){}Ua(){}getPodIndex(){}Ib(){}wb(){}jb(){}getWrapperAdIds(){}getWrapperAdSystems(){}getWrapperCreativeIds(){}Ub(){}canSeek(){}};_.z("clpp.ads.IAd",V);V.prototype.canSeek=V.prototype.canSeek;V.prototype.getVideoElement=V.prototype.Ub;V.prototype.getWrapperCreativeIds=V.prototype.getWrapperCreativeIds;
|
|
465
|
+
V.prototype.getWrapperAdSystems=V.prototype.getWrapperAdSystems;V.prototype.getWrapperAdIds=V.prototype.getWrapperAdIds;V.prototype.getSequenceLength=V.prototype.jb;V.prototype.getPositionInSequence=V.prototype.wb;V.prototype.getPodTimeOffset=V.prototype.Ib;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Ua;V.prototype.getMediaBitrate=V.prototype.Ta;V.prototype.getMediaHeight=V.prototype.hb;V.prototype.getMediaWidth=V.prototype.ib;V.prototype.getMediaUrl=V.prototype.getMediaUrl;
|
|
466
|
+
V.prototype.getClickThroughUrl=V.prototype.ub;V.prototype.isBumper=V.prototype.Vb;V.prototype.getSkipTimeOffset=V.prototype.getSkipTimeOffset;V.prototype.getPosition=V.prototype.getPosition;V.prototype.getDuration=V.prototype.getDuration;V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getSourceId=V.prototype.Sb;
|
|
467
|
+
V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.getId;V.prototype.getTechnology=V.prototype.xb;V.prototype.getAdManagerVersion=V.prototype.tb;V.prototype.getAdManagerName=V.prototype.sb;var Q=class{constructor(a,b,c,d,e,f){this.w=this.o=this.l=!1;this.C=a;this.h=b;this.f=c;this.a=d;this.j=0;this.B=`${e}:${b}`;this.F=e;this.videoEl=null;this.A=f}sb(){return""}tb(){return""}xb(){return 2}getId(){return this.B}getCreativeId(){return""}Sb(){return this.F}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a}getPosition(){return this.j}getSkipTimeOffset(){return-1}canSeek(){return this.A}Vb(){return!1}ub(){return null}getMediaUrl(){return null}ib(){return 0}hb(){return 0}Ta(){return 0}Ua(){return this.C}getPodIndex(){return 0}Ib(){return 0}wb(){return this.h}jb(){return this.f}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ub(){return this.videoEl}};
|
|
468
|
+
Q.prototype.getVideoElement=Q.prototype.Ub;Q.prototype.getWrapperCreativeIds=Q.prototype.getWrapperCreativeIds;Q.prototype.getWrapperAdSystems=Q.prototype.getWrapperAdSystems;Q.prototype.getWrapperAdIds=Q.prototype.getWrapperAdIds;Q.prototype.getSequenceLength=Q.prototype.jb;Q.prototype.getPositionInSequence=Q.prototype.wb;Q.prototype.getPodTimeOffset=Q.prototype.Ib;Q.prototype.getPodIndex=Q.prototype.getPodIndex;Q.prototype.getPodType=Q.prototype.Ua;Q.prototype.getMediaBitrate=Q.prototype.Ta;
|
|
469
|
+
Q.prototype.getMediaHeight=Q.prototype.hb;Q.prototype.getMediaWidth=Q.prototype.ib;Q.prototype.getMediaUrl=Q.prototype.getMediaUrl;Q.prototype.getClickThroughUrl=Q.prototype.ub;Q.prototype.isBumper=Q.prototype.Vb;Q.prototype.canSeek=Q.prototype.canSeek;Q.prototype.getSkipTimeOffset=Q.prototype.getSkipTimeOffset;Q.prototype.getPosition=Q.prototype.getPosition;Q.prototype.getDuration=Q.prototype.getDuration;Q.prototype.getTitle=Q.prototype.getTitle;Q.prototype.getAdvertiserName=Q.prototype.getAdvertiserName;
|
|
470
|
+
Q.prototype.getAdSystem=Q.prototype.getAdSystem;Q.prototype.getApiFramework=Q.prototype.getApiFramework;Q.prototype.getSourceId=Q.prototype.Sb;Q.prototype.getCreativeId=Q.prototype.getCreativeId;Q.prototype.getId=Q.prototype.getId;Q.prototype.getTechnology=Q.prototype.xb;Q.prototype.getAdManagerVersion=Q.prototype.tb;Q.prototype.getAdManagerName=Q.prototype.sb;var wv=class{constructor(a){this.a=a.map(b=>({videoId:b.getSurface().getMedia().id,player:b,Gd:!0,ready:Promise.resolve()}));this.g=new _.S("clpp.plist.PlayerPool")}has(){return this.a.some(a=>a.Gd)}get(){const a=this;return _.x(function*(){const b=a.a.find(c=>c.Gd);if(!b)throw Error("No available players in the pool");b.Gd=!1;yield b.ready;return b.player})}release(a){const b=this.a.find(c=>c.player===a);if(!b)return Promise.resolve();b.Gd=!0;b.ready=new Promise(c=>{a.release().catch(d=>{this.g.error("Failed to unload player",
|
|
471
|
+
d)}).then(c)});return b.ready}destroy(){const a=this;return _.x(function*(){yield Promise.all(a.a.map(b=>b.player.destroy()))})}};_.z("clpp.utils.dom.createHTMLElement",_.Gp);var xv=class{constructor(a){this.a=null;this.h=new Set;this.f=null;this.set(a||null)}set(a){this.h.clear();this.f&&(this.f.disconnect(),this.f=null);if(this.a=a)this.f=Hp(this,a)}get(){return this.a}};var Np=class{constructor(a,b){this.g=new _.S("clpp.PlayerSurface");this.w=_.lh(yv,b);this.f=new xv;this.h=null;this.a=new xv;this.l=zv;zv+=1;this.o=`clpp-video-${this.l}`;this.j=new _.St;if(null==a)throw new _.I(_.F,7,7102,"No Media element was provided");if(!(a instanceof Element||(a=document.getElementById(a),a)))throw new _.I(_.F,7,7004,"Media element not found");b=this.w;this.g.debug("Initializing Player Surface on ",a);if("cast-media-player"===a.tagName.toLowerCase())this.h=a;else{if(!(a instanceof
|
|
472
|
+
HTMLMediaElement))throw new _.I(_.F,7,7005,"Media element is not instance of HTMLMediaElement");if(!a.hasAttribute("crossorigin")){var c=b.crossorigin;this.g.info("Setting media elements crossorigin to "+c);a.setAttribute("crossorigin",c)}this.f.set(a);if(b.disableContainer)var d=null;else if(b.containerEl){if(a.parentNode!==b.containerEl)throw new _.I(_.F,7,7006,"Container element is not a direct parent of media element");d=b.containerEl}else{c=document.createElement(_.Sd);a.parentNode?a.parentNode.replaceChild(c,
|
|
473
|
+
a):this.g.warn("Player Surface Element has no parent. Can not inject container. You have to manually add playerSurface.getContainer() to the DOM!");var e=[];for(let g=0;g<a.classList.length;g++)e.push(a.classList[g]);for(var f of e)a.classList.remove(f),_.Ep(c,f);c.style.cssText=a.style.cssText;a.removeAttribute(_.eg);for(d of[_.Vg,_.oe])f=a.getAttribute(d),f=parseInt(f,10),isNaN(f)||(c.style[d]=`${f}px`),_.Kk()||a.removeAttribute(d);c.appendChild(a);d=c}d&&(this.a.set(d),Ip(this.a,"clpp-container"),
|
|
474
|
+
Ip(this.a,this.o),Ip(this.f,_.pd),Ip(this.f,"clpp-video"));b.webOSStartupPatch&&Jp(this,a,d)}}getMedia(){return this.f.get()}getContainer(){return this.a.get()}getSafeContainer(){return this.a}getId(){return this.l}getUniqueCssClass(){return this.o}getCastElement(){return this.h}isFullscreen(){return!!document.fullscreenElement}hideMediaElement(){const a=this.getMedia();a?_.Ep(a,qd):this.g.debug("No media element available that could be hidden")}showMediaElement(){const a=this.getMedia();a?a.classList.remove(qd):
|
|
475
|
+
this.g.debug("No media element available that could be shown")}addElementToContainer(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;const d=this.getContainer();if(!d)throw Error("No container is available. Unable to add element");b&&_.Ep(a,_.pd);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){_.Ep(a,qd)}show(a){a.classList.remove(qd)}release(){this.j.release()}};
|
|
476
|
+
Np.prototype.removeElementFromContainer=Np.prototype.removeElementFromContainer;Np.prototype.addElementToContainer=Np.prototype.addElementToContainer;Np.prototype.getCastElement=Np.prototype.getCastElement;Np.prototype.getContainer=Np.prototype.getContainer;Np.prototype.getMedia=Np.prototype.getMedia;var yv={disableContainer:!1,webOSStartupPatch:!0,crossorigin:"anonymous",containerEl:null},zv=1;var Av=class{constructor(a){this.ja=a;this.o=!!a.sideAdContainer;this.h=[];this.a=a.pg;this.C=Mp(a);this.A=[];const b=Op(this,this.C,this.ja.eh);this.l=new wv(b);this.f=null;this.w=!1;this.j=new Map;this.F=a.toggleVisible;this.g=new _.S("clpp.interstitial.MultiController");this.B=!1;Pp(this).forEach(c=>Qp(this,c,!1))}getCurrentItem(){return this.f}Od(){return this.f?this.f.player:null}Sf(){return Array.from(this.j.values())}kd(){return 0<this.j.size}play(a){return eq(this,a,_.gf)}load(a){return eq(this,
|
|
477
|
+
a,_.De)}release(){const a=this;return _.x(function*(){yield Promise.all([cq(a),a.f?bq(a,a.f):Promise.resolve()]);a.f=null;a.w=!1;jq(a)})}destroy(){const a=this;return _.x(function*(){a.g.info("Destroy");yield a.release();yield a.l.destroy();sq(a)})}isMuted(){return this.B}},nq="preload",lq=_.He,Vp="primary",Up="ad";var Bv=class extends _.Cu{constructor(a){super();this.ja=_.lh({Yh:.5},a);this.g=new _.S("clpp.interstitial.Player");this.f=a.player;this.f.setSeekInterceptor((b,c)=>{c||Aq(this,b);if(c=Bq(this,b)){if(xq(c))return this.g.info("Seeking into an interstitial",c.ka),Eq(this,c).catch(()=>{this.f.seek(b)}),!1}else{const d=Fq(this,b);d&&!d.gh&&(this.g.info("Trigger interstitial due to jump over it",d,"will resume at",b),Eq(this,d,b).catch(()=>{d.gh=new Date;this.f.seek(b)}))}return!0});this.fa=new Av({eh:this.ja.config,
|
|
478
|
+
pg:a.player,preloadMedia:!0,gb:a.gb,sideAdContainer:this.ja.sideAdContainer,onAudioDecision:this.ja.onAudioDecision});this.h=[];this.a=[];this.j=!1;Mq(this,a.player)}destroy(){const a=this;return _.x(function*(){Nq(a);a.a=[];a.j=!1;a.f.setSeekInterceptor(null);yield a.fa.destroy()})}Lb(){return this.j}setMuted(a){var b=this.fa;(b.B=a)?(b.a.setMuted(!0),kq(b,!0)):(a=(a=b.getCurrentItem())?a.Ja:null,Tp(b,a,a?Up:Vp))}isMuted(){return this.fa.isMuted()}isLive(){const a=this.fa.Od();return a?a.isLive():
|
|
479
|
+
null}Ya(a){this.f.trigger(a)}},vq=0,Wq=1,Yq=2,Zq=3,cr=4,br=5,wq=6;var Or=class{constructor(){this.a=null}load(){return Promise.resolve()}start(){return Promise.resolve()}w(a,b,c){const d=a.getConfiguration();a=Object.assign({},{config:d,player:a,gb:b},d.ads.hls||{},{Xh:c});this.a=new Bv(a);Vq(this.a)}setMuted(a){this.a&&this.a.setMuted(a)}isMuted(){return this.a?this.a.isMuted():!0}resume(){const a=Oq(this.a);a&&a.play()}pause(){const a=Oq(this.a);a&&a.pause()}skip(){}getVolume(){const a=Oq(this.a);return a?a.getVolume()||0:0}setVolume(a){const b=Oq(this.a);if(b)return b.setVolume(a)}getPosition(){const a=
|
|
480
|
+
Oq(this.a);return a?a.getPosition():-1}o(){return!this.a.Lb()}h(){return this.a.destroy()}};Or.prototype.getPosition=Or.prototype.getPosition;Or.prototype.setVolume=Or.prototype.setVolume;Or.prototype.getVolume=Or.prototype.getVolume;Or.prototype.skip=Or.prototype.skip;Or.prototype.pause=Or.prototype.pause;Or.prototype.resume=Or.prototype.resume;var Cv=class{constructor(a){this.m=a;this.j=this.m.getNetworkEngine();this.a=new _.St;this.h=null;this.f=!0;hr(this)}release(){this.a.release();ir(this);this.m=null}};var kr=[];var qr=class{constructor(a,b,c){this.h=a;this.f=b;JSON.parse(_.ij(_.Yl(a)));this.a=JSON.parse(_.ij(_.Yl(b)));this.j=c}};var or={n:"vXdoJIQCz6sZ9pbduNukEHOR0H2dHlwuuBUAR5Ot7WLEYvav5mn63yxr6F6TIl8RHTFw2siXQhHblZH2Y89o8vhcZRFkYXo6h0igEVafu-n0w52UEcH8Cqzlb8Q7x03Qb8OcKLngSzDkwe5Y2Aix6I66RRVNLLssqyjp2n5tXs4JQmYdqY6hhpGhmBN84naeCTdcPpAYhCw8jqbTSNrJp5hjU4GVvOiUtoYCvdESV9xrOR7fPCFXhWfLtC3i1k1zVoIM7YW5qD0F676jhqkF-GmDuCHpRY2I2Cxui-ytYEVIM6_pylSIlmYLjARmv2jXz9aV_WvHLh6B8Yx0slNGCQ",e:"AQAB"},Dl="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1cmxzIjpbIjovL2Nhc3RsYWJzLmNvbSJdLCJ0eXBlIjoiV2ViIiwia2lkIjoxOTUwLCJpbHYiOmZhbHNlfQ.jzGGRcbFr_2QET-4tbMcpR5pSaj7eV7X2d1HWw_VKQpPg3zCwSZSDuqw225dIYyAYwLSiElbozbZPSArkBXOsoUm-KZRUPF4m7WG0T7Uza5G-QaQw57BbbfcSsooSpatC997kHKLMTjO71By9Olcu5ykN164nZpGQtZNzQjYag-bnUaMVI5vvhzjlvDihORQ9V_qRlEh0-mpoz6W0-36HGAbWIXWq0kxPh6inbovby-ZmFpqGrVjWOEFa55EARZXPNW9ERupW5xrrYHZdwwTpdRTY5IwEnobS85yTrLhK8Y2MV4jlQLTtQp372fKDsuU6q6_4XvmNq1SgAoKoaf41g";var Qr=class{constructor(a){this.f=a;this.a=null;this.g=new _.S("clpp.utils.LicenseKey")}},Dr="vod",Cr="live";var js,Hr,Kr,Ir;js=class{constructor(a){this.m=a;this.f=a.getNetworkEngine();this.h=Lr(this);this.f.Ec(this.h);this.a=null}release(){this.a=null;this.f.vd(this.h)}};_.Dv="maxSuggestedBitrateKbps";Hr={du:"duress",etp:_.ke,mb:_.Dv,rd:"responseDelay",rtt:"roundTripTime"};Kr={at:"availabilityTime",br:"encodedBitrateKbps",ht:"heldTime",n:"intermediaryIdentifier",nor:"nextObjectResponse",nrr:"nextRangeResponse",d:"objectDuration",ot:"objectType",su:"startup",st:"streamType",sf:"streamingFormat",v:Eg};
|
|
481
|
+
Ir=new _.S("clpp.net.CmsdManager");var R=class extends _.Cu{constructor(a,b,c){super();lr();this.g=new _.S("clpp.Player");if(!a)throw new _.I(_.F,7,7102);this.$=new _.St;this.f=this.C=b||_.Gl();this.l=null;void 0===this.f.license&&(this.f.license=Dl,this.g.warn("You are using the embedded demo license!"));if(!this.f.license)throw this.g.error("You provided null or empty string as your license. Please check your license configuration."),new _.I(_.F,7,7101,"No license provided in configuration!");this.j=new Np(a,c);this.G=this.A=this.a=
|
|
482
|
+
this.F=null;this.I=new _.Er;this.h=null;this.W=[];this.Y=!0;this.K={};this.da=null;this.R=!0;this.S=this.O=!1;this.L=this.Lc=null;this.ue=!1;this.ha=new Cv(this);this.B=null;this.on(_.$f,()=>{this.getState()===_.ap&&(this.a?this.a.unload():Promise.resolve())});this.on(_.Hc,this.ba.bind(this));this.on(_.Gc,this.ba.bind(this));this.on(_.ng,()=>Pr(this));Rr(this,this.f.license);this.j.getMedia()&&(a=this.j.getMedia(),a.hasAttribute("autoplay")&&(a.removeAttribute("autoplay"),this.g.debug("Removed autoplay attribute from video element. Auto play will be handled by configuration."),
|
|
483
|
+
void 0===this.f.autoplay&&(this.f.autoplay=!0,this.g.debug("Setting autoplay in configuration since it was specified in the video element"))));a=[];for(const d of Mr)try{const e=d.create(this.f);e&&a.push(e)}catch(e){this.g.error("Error while creating player plugin",e)}Tr(this,a);this.M=_.ma;Ql(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 _.D(_.q,{detail:a}),this.trigger(a)}fd(a){a=
|
|
484
|
+
this.K[a];void 0===a&&(a=null);return a}getSurface(){return this.j}getConfiguration(){return _.mh(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.g.info("Player release already in progress"),this.l;this.g.debug("Releasing player");this.l=Wr(this);return this.l.finally(()=>{Xr(this);this.g.debug("Player released");this.l=null})}destroy(){if(this.O)return this.g.debug("The player is already destroyed. No-op"),
|
|
485
|
+
new Promise(a=>a());this.O=!0;return this.release().then(()=>{this.g.debug(za);this.trigger(new _.D("destroying"));return _.Sr(this,_.We)}).then(()=>{this.a&&this.a.stopForwardingEventsTo(this);this.cd.clear();this.ha.release();if(this.a)return this.a.destroy()}).then(()=>this.I.destroy()).then(()=>{Tl();this.A=this.a=null;this.trigger(new _.D("destroyed"))})}load(a){const b=this;return _.x(function*(){try{_.Kn(pf);b.M=_.ma;b.Y=!0;const c=_.np(a),d=Jl(a)?a:{};if(d.license)throw new _.I(_.F,7,7100,
|
|
486
|
+
"License cannot be passed into the load method.");yield _.es(b,d,c);yield _.fs(b);yield _.hs(b);_.Kn(of);_.Mn("player.load",pf,of)}catch(c){Xr(b);if(b.l)throw b.g.info(bb),new _.I(_.F,7,7E3);throw c;}})}preload(a){const b=this;return _.x(function*(){yield _.es(b,a);if(b.a){var c=b.a;c.preload?yield c.preload(b.f):b.g.warn(yb)}else b.g.warn(ub)})}use(a){(a=Ul(a))&&a.o(this)}remove(a){return(this.getState()<=_.hp||this.R)&&null!==Ol(a)?(Vl(a),this.S=!0):!1}play(){return this.a?!this.h||this.h instanceof
|
|
487
|
+
Or||this.a.namespace()===_.ud?this.a.play():this.h.start(this.a):Promise.reject("No player initialized. You need to load content before calling play.")}pause(){return this.a?this.a.pause():Promise.reject("No player initialized. You need to load content before calling pause.")}getTrackManager(){return this.a&&this.a.getTrackManager()}getBufferInfo(a){return this.a?this.a.getBufferInfo(a):new _.Bu}getState(){return this.a?this.a.getState():_.hp}getPeriods(){return this.a?this.a.getPeriods():[]}isEnded(){return this.a&&
|
|
488
|
+
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()===_.ap?Promise.reject("Cannot seek in current state."):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}}uc(){const a=this.a;return a&&a.uc?a.uc():null}getVolume(){return this.a?this.a.getVolume():
|
|
489
|
+
null}setVolume(a){this.a&&this.a.setVolume(a)}getDuration(){return this.a?this.a.getDuration():-1}getAdsManager(){return this.h}namespace(){return this.a&&this.a.namespace()||"Undefined"}getPlaybackRate(){return this.a?this.a.getPlaybackRate():1}setPlaybackRate(a,b){this.a&&this.a.setPlaybackRate(a,b)}isMuted(){return this.h&&this.h instanceof Or?this.h.isMuted():this.a&&this.a.isMuted()||!1}setMuted(a){this.a&&this.a.setMuted(a);this.h&&this.h instanceof Or&&this.h.setMuted(a)}getNetworkEngine(){return this.I}setNetworkEngine(a){this.I=
|
|
490
|
+
a}getTextDisplayer(){return this.a&&this.a.getTextDisplayer()}isLive(){return!!this.a&&this.a.isLive()}getStats(){return this.a?this.a.getStats():null}Wf(){return Object.freeze(this.da)}getLoadedSource(){return this.a&&this.a.getLoadedSource()}getTimelineCues(){return this.a?this.a.getTimelineCues():[]}getCueTimeline(){return this.a?this.a.getCueTimeline():null}resetAbr(){this.a&&this.a.resetAbr()}setDrmCustomDataModifier(a){this.Lc=a;bs(this)}setCdnErrorCallback(a){this.L=a;this.a&&this.a.setCdnErrorCallback(this.L)}ba(){this.ue=
|
|
491
|
+
!0}};_.z("clpp.Player",R);R.registerPlugin=_.Nr;R.prototype.setCdnErrorCallback=R.prototype.setCdnErrorCallback;R.prototype.setDrmCustomDataModifier=R.prototype.setDrmCustomDataModifier;R.prototype.resetAbr=R.prototype.resetAbr;R.prototype.getTimelineCues=R.prototype.getTimelineCues;R.prototype.getLoadedSource=R.prototype.getLoadedSource;R.prototype.getSources=R.prototype.Wf;R.prototype.getStats=R.prototype.getStats;R.prototype.isLive=R.prototype.isLive;R.prototype.getTextDisplayer=R.prototype.getTextDisplayer;
|
|
492
|
+
R.prototype.setNetworkEngine=R.prototype.setNetworkEngine;R.prototype.getNetworkEngine=R.prototype.getNetworkEngine;R.prototype.setMuted=R.prototype.setMuted;R.prototype.isMuted=R.prototype.isMuted;R.prototype.setPlaybackRate=R.prototype.setPlaybackRate;R.prototype.getPlaybackRate=R.prototype.getPlaybackRate;R.prototype.namespace=R.prototype.namespace;R.prototype.getAdsManager=R.prototype.getAdsManager;R.prototype.getDuration=R.prototype.getDuration;R.prototype.setVolume=R.prototype.setVolume;
|
|
493
|
+
R.prototype.getVolume=R.prototype.getVolume;R.prototype.getTimelineOffset=R.prototype.uc;R.prototype.getSeekRange=R.prototype.getSeekRange;R.prototype.getPresentationStartTime=R.prototype.getPresentationStartTime;R.prototype.seek=R.prototype.seek;R.prototype.getPosition=R.prototype.getPosition;R.prototype.isPaused=R.prototype.isPaused;R.prototype.isEnded=R.prototype.isEnded;R.prototype.getState=R.prototype.getState;R.prototype.getBufferInfo=R.prototype.getBufferInfo;R.prototype.getTrackManager=R.prototype.getTrackManager;
|
|
494
|
+
R.prototype.pause=R.prototype.pause;R.prototype.play=R.prototype.play;R.prototype.remove=R.prototype.remove;R.prototype.use=R.prototype.use;R.prototype.load=R.prototype.load;R.prototype.destroy=R.prototype.destroy;R.prototype.release=R.prototype.release;R.prototype.getDrmInfo=R.prototype.getDrmInfo;R.prototype.getConfiguration=R.prototype.getConfiguration;R.prototype.getSurface=R.prototype.getSurface;R.prototype.getPlugin=R.prototype.fd;R.prototype.off=R.prototype.off;R.prototype.one=R.prototype.one;
|
|
495
|
+
R.prototype.on=R.prototype.on;_.hp=0;_.ip=1;_.dp=2;_.kp=3;_.jp=4;_.$o=5;_.ap=6;_.rv=7;_.gp={IDLE:_.hp,PREPARING:_.ip,BUFFERING:_.dp,PLAYING:_.kp,PAUSED:_.jp,ENDED:_.$o,ERROR:_.ap,UNSET:_.rv};R.State=_.gp;var Mr=[];var Ev=class extends R{constructor(a,b,c){super(a,b,c);a={manifest:{timeline:{version:2},keepTimelineLive:!0},streaming:{preferNativeHlsOnSafari:!1,enableLiveEdgeChasing:!1,startAtSegmentBoundary:!1}};this.C=_.lh(this.C,a);this.f=_.lh(this.f,a);this.H=0;this.o=[];this.U=!1;this.w=null;this.J=[]}open(a,b){const c=this;return _.x(function*(){if(c.w)throw new _.I(_.F,7,7008,`Cannot call open() while ${c.w}() is ongoing!`);if(0!==a)throw new _.I(_.F,7,7007,"The index parameter only supports the value of 0.");
|
|
496
|
+
if(0===b.length)throw new _.I(_.F,7,7003,lb);if(b.some(g=>!g.id||!g.source))throw new _.I(_.F,7,7100,"Some config is missing required properties `id` or `source`!");if((new Set(b.map(g=>g.id))).size!==b.length)throw new _.I(_.F,7,7100,"Some config contains a non-unique property `id`!");const d=b[0].playlist;if(d){var e=d.timeline,f=["flat","basic"];if(e&&!f.includes(e))throw new _.I(_.F,7,7100,"Unsupported `playlist.timeline` config value!");e=d.startTime;if(null!=e&&(typeof e!==_.t||0>e))throw new _.I(_.F,
|
|
497
|
+
7,7100,"Invalid `playlist.startTime` config value!");f=d.endTime;if(null!=f&&(typeof f!==_.t||0>f||null!=e&&f<=e))throw new _.I(_.F,7,7100,"Invalid `playlist.endTime` config value!");if("DVR"===d.content&&!f)throw new _.I(_.F,7,7100,"`playlist.endTime` config value is required for DVR content!");}try{ls(c),c.w="open",yield os(c,b),c.H=0,c.o=b,c.U=!0,ps(c,b[0].playlist||{})}finally{c.w=null}})}Lg(a){const b=this;return _.x(function*(){if(b.w)throw new _.I(_.F,7,7008,`Cannot call addItem() while ${b.w}() is ongoing!`);
|
|
498
|
+
if(!b.U)throw new _.I(_.F,7,7008,"open() must be called before addItem()!");if(!a.id||!a.source)throw new _.I(_.F,7,7100,"The config is missing required properties `id` or `source`!");if((new Set(b.o.map(c=>c.id))).has(a.id))throw new _.I(_.F,7,7100,"A config with this `id` already exists in the playlist!");try{b.w="addItem",b.o.push(a),yield qs(b,a)}finally{b.w=null}})}getCurrentItem(){return this.o[this.H]||null}getCurrentItemIndex(){return this.H}vh(){return[...this.o]}gd(){return this.o.length}getTimeline(){return this.a?
|
|
499
|
+
this.a.getTimeline():null}seekWith(a){return this.a?this.a.seekWith(a):Promise.resolve()}release(){this.o=[];this.H=0;this.U=!1;return super.release()}destroy(){ls(this);return super.destroy()}setCdnErrorCallback(){throw new _.I(1,7,7009,"CDN switching is not supported!");}};_.z("clpp.plist.ScPlaylist",Ev);Ev.prototype.setCdnErrorCallback=Ev.prototype.setCdnErrorCallback;Ev.prototype.destroy=Ev.prototype.destroy;Ev.prototype.release=Ev.prototype.release;Ev.prototype.seekWith=Ev.prototype.seekWith;
|
|
500
|
+
Ev.prototype.getTimeline=Ev.prototype.getTimeline;Ev.prototype.getSize=Ev.prototype.gd;Ev.prototype.getPlaylist=Ev.prototype.vh;Ev.prototype.getCurrentItemIndex=Ev.prototype.getCurrentItemIndex;Ev.prototype.getCurrentItem=Ev.prototype.getCurrentItem;Ev.prototype.addItem=Ev.prototype.Lg;Ev.prototype.open=Ev.prototype.open;var Fv=class extends _.Cu{constructor(a){super();this.ja=_.lh({transition:_.cf,preloadMedia:!1},a);this.h=[];this.a=0;const b=rs(a.anchorId,this.ja.config);this.o=new wv(b);this.f=null;this.j=!1;this.l=new Map;this.w=a.toggleVisible;this.g=new _.S(zd);this.o.a.forEach(c=>ss(this,c.player,!1))}ed(){return this.f}Od(){return this.f?this.f.player:null}Rf(){return this.l.get(this.a+1)||null}Tf(){return this.l.get(this.a-1)||null}Sf(){return[this.Tf(),this.Rf()].filter(Boolean)}ki(a){if(0<this.h.length)throw Error("Cannot re-set items in the playlist");
|
|
501
|
+
this.g.info("Set items",a);this.h=a.map((b,c)=>({config:b,index:c,preloadPromise:Promise.resolve(),disposers:[]}))}ji(a){if(0===this.h.length)throw Error(kb);if(0>a||a>this.h.length-1)throw Error("Index out of bounds");this.a=a}kd(){return this.a<this.h.length-1}Xf(){return 0<this.a}Vh(){const a=this;return _.x(function*(){if(a.j)a.g.warn("Cannot play first item while busy");else if(0===a.h.length)a.g.warn(kb);else{a.j=!0;a.g.info(`First (index: ${a.a})`);var b=a.h[a.a];try{a.g.info(`First loading (index: ${a.a})`),
|
|
502
|
+
yield vs(a,b),a.g.info(`First playing (index: ${a.a})`)}catch(c){throw a.g.error(`First failed (index: ${a.a})`),c;}finally{a.j=!1,zs(a)}}})}ng(){const a=this;return _.x(function*(){if(a.j)a.g.warn("Cannot play next item while busy");else if(a.kd()){a.j=!0;a.a+=1;a.g.info(`Next (index: ${a.a})`);var b=a.f;a.ja.transition===_.cf&&b.player.pause();Es(a,a.a+-2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Next loading (index: ${a.a})`),yield As(a,c),a.g.info(`Next playing (index: ${a.a})`)}catch(d){throw a.g.error(`Next failed (index: ${a.a})`),
|
|
503
|
+
d;}finally{a.j=!1,b&&Ds(a,b),zs(a)}}else a.g.warn("There are no more items in the playlist")})}Wh(){const a=this;return _.x(function*(){if(a.j)a.g.warn("Cannot play previous item while busy");else if(a.Xf()){a.j=!0;--a.a;a.g.info(`Previous (index: ${a.a})`);var b=a.f;a.ja.transition===_.cf&&b.player.pause();Es(a,a.a+2);a.l.delete(a.a);var c=a.h[a.a];try{a.g.info(`Previous loading (index: ${a.a})`),yield As(a,c),a.g.info(`Previous playing (index: ${a.a})`)}catch(d){throw a.g.error(`Previous failed (index: ${a.a})`),
|
|
504
|
+
d;}finally{a.j=!1,b&&Ds(a,b),zs(a)}}else a.g.warn("There are no more previous items in the playlist")})}destroy(){const a=this;return _.x(function*(){a.g.info("Destroy");yield Promise.all([Fs(a),a.f?Ds(a,a.f):Promise.resolve()]);yield Gs(a)})}};_.z(zd,Fv);Fv.prototype.destroy=Fv.prototype.destroy;Fv.prototype.playPrev=Fv.prototype.Wh;Fv.prototype.playNext=Fv.prototype.ng;Fv.prototype.playFirst=Fv.prototype.Vh;Fv.prototype.hasPrev=Fv.prototype.Xf;Fv.prototype.hasNext=Fv.prototype.kd;
|
|
505
|
+
Fv.prototype.setIndex=Fv.prototype.ji;Fv.prototype.setItems=Fv.prototype.ki;Fv.prototype.getPreloading=Fv.prototype.Sf;Fv.prototype.getPrev=Fv.prototype.Tf;Fv.prototype.getNext=Fv.prototype.Rf;Fv.prototype.getCurrentPlayer=Fv.prototype.Od;Fv.prototype.getCurrent=Fv.prototype.ed;var Cs="preload",ts=_.He;var Hs=new Map;var Iv=class{constructor(a){this.h=a;this.f={keepOriginalTimestamps:!0,remux:!1};this.a=new muxjs.mp4.Transmuxer(this.f)}destroy(){this.a.dispose();this.a=null}reset(){this.a=new muxjs.mp4.Transmuxer(this.f)}isSupported(a,b){const c="mp2t"===a.toLowerCase().split(";")[0].split("/")[1],d=a.toLowerCase().split(";")[0]===_.Rc;if(!window.muxjs||!c&&!d)return!1;if(d)return _.Is(Vc);if(b)return _.Is(Js(b,a));b=Js(_.p,a);a=Js(_.w,a);return _.Is(b)||_.Is(a)}isMuxed(a,b){return 1<this.demuxMimeTypes(a,b).size}demuxMimeTypes(a,
|
|
506
|
+
b){const c=new Map;c.set(a,b);try{const d=_.Ck(b),e=_.Dk(b).split(","),f=new Map,g=Oi(_.p,e),h=Oi(_.w,e);g&&f.set(_.p,this.convertCodecs(_.p,_.Bk(d,g)));h&&f.set(_.w,this.convertCodecs(_.w,_.Bk(d,h)));return f}catch(d){return c}}convertCodecs(a,b){return b.toLowerCase().split(";")[0]===_.Rc?Vc:"mp2t"===b.toLowerCase().split(";")[0].split("/")[1]?Js(a,b):b}getOriginalMimeType(){return this.h}transmux(a){const b=[],c=[];let d=[],e=null;a=_.K(a);const f=h=>{d=h.captions;const k=new Uint8Array(h.data.byteLength+
|
|
507
|
+
h.initSegment.byteLength);k.set(h.initSegment,0);k.set(h.data,h.initSegment.byteLength);h.type===Gv?b.push(k):h.type===Hv&&c.push(k)},g=()=>{e={video:_.bm(...b),captions:d,audio:_.bm(...c)}};this.a.on("data",f);this.a.on("done",g);this.a.push(a);this.a.flush();this.a.off("data",f);this.a.off("done",g);if(!e)throw new _.I(_.F,3,3018);return e}};wk(_.Rc,()=>new Iv(_.Rc));wk(_.Hg,()=>new Iv(_.Hg));var Hv=_.p,Gv=_.w;var Jv=class{getCuePoints(){}Lb(){}Kb(){}};_.z("clpp.ads.IAdsTimeline",Jv);Jv.prototype.hasPostroll=Jv.prototype.Kb;Jv.prototype.hasPreroll=Jv.prototype.Lb;Jv.prototype.getCuePoints=Jv.prototype.getCuePoints;_.Kv=class{f(){}a(){}h(){}o(){}};var Nv=class extends _.Iu{constructor(a,b,c,d,e){super(Ya);this.l=a;this.j=b;this.h=c;this.a=d;this.o=e;this.g=new _.S(vd);_.sj(this.l)?this.g.warn(_.Xb):this.cb(_.Jd,{licenseUrl:this.l,videoRobustness:[_.Db,void 0],audioRobustness:[_.Cb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.sd.bind(this)}});_.sj(this.j)?this.g.warn(_.tb):this.cb(_.Hd,{licenseUrl:this.j,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.sd.bind(this)}});
|
|
508
|
+
_.sj(this.h)?this.g.warn(_.Ta):_.sj(this.a)?this.g.warn(_.Sa):this.cb(_.Ed,{licenseUrl:this.h,certificateUrl:this.a,modifiers:{licenseRequest:this.ig.bind(this),licenseResponse:this.jg.bind(this),certificateRequest:this.sd.bind(this),extractContentId:this.Mf.bind(this)}})}sd(a,b){a=a.drm.customData.headers||{};for(const c of Object.keys(a))b.headers[c]=a[c]}Mf(a,b){a=Am(b);switch(this.o){case Lv:return a;case Mv:return(new _.Bm(a)).a;default:throw Error("Unknown content ID strategy");}}ig(a,b){b.headers[ta]=
|
|
509
|
+
Qc;this.sd(a,b);a={spc:_.Wl(b.body)};b.body=_.oj(_.ak(a,!0))}jg(a,b){a=_.ij(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=_.Yl(a).buffer}};_.z(vd,Nv);Nv.prototype.onFairPlayLicenseResponse=Nv.prototype.jg;Nv.prototype.onFairPlayLicenseRequest=Nv.prototype.ig;Nv.prototype.extractFairPlayContentId=Nv.prototype.Mf;Nv.prototype.onLicenseRequest=Nv.prototype.sd;Nv.prototype.constructor=Nv.prototype.constructor;Nv.NAME=Ya;
|
|
510
|
+
var Mv="hostname",Lv="full-skd";Nv.FairPlayContentIdStrategy={HOSTNAME:Mv,FULL_SKD:Lv};_.z("clpp.drm.HeaderDrmComponent",class extends _.Kv{h(a){a=a.getConfiguration();if(a.drm&&a.drm&&a.drm.env===Ya){a=a.drm.customData;if(!a)throw new _.I(_.F,7,7100,_.Kd);a=new Nv(a.widevineLicenseUrl,a.playReadyLicenseUrl,a.fairPlayLicenseUrl,a.fairPlayCertificateUrl,a.fairPlayContentIdStrategy||Lv);_.fm(a)}}a(){delete _.em.HeaderDrm}id(){return"headerdrm"}});_.mr(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=_.K(c);a=new Uint8Array(this,a,b-a);d.set(a);return c})});_.mr(function(){_.Gh("mathRound.install")});_.mr(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;me in document||(Object.defineProperty(document,me,{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",
|
|
511
|
+
{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitSupportsFullscreen||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",Ks);document.addEventListener("webkitfullscreenerror",Ks);document.addEventListener("mozfullscreenchange",Ks);document.addEventListener("mozfullscreenerror",Ks);document.addEventListener("MSFullscreenChange",Ks);document.addEventListener("MSFullscreenError",Ks)}});_.mr(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(_.Gh("PiPWebkit.install"),document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=Ms,document.exitPictureInPicture=Ns,document.addEventListener("webkitpresentationmodechanged",Ls,!0))}});_.mr(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in a&&(a.getVideoPlaybackQuality=Rs)}});_.mr(function(){if(window.VTTCue)_.Fh("Using native VTTCue.");else if(window.TextTrackCue){var a=TextTrackCue.length;if(3===a)_.Fh(Sb),window.VTTCue=Ss;else if(6===a)_.Fh("Using VTTCue polyfill from 6 argument TextTrackCue."),window.VTTCue=Ts;else{try{var b=!!Ss(1,2,"")}catch(c){b=!1}b&&(_.Fh(Sb),window.VTTCue=Ss)}}else _.Hh("VTTCue not available.")});var Us;_.mr(function(){_.Gh("InputEvent.install");_.Jk("Trident/")&&HTMLInputElement.prototype.addEventListener!==Vs&&(_.Fh("Patching input event support on IE."),Us=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Vs)});_.mr(function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:()=>navigator.language?[navigator.language]:["en"]})});_.mr(function(){_.Gh("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 Ys=class{constructor(){this.a=Ws()}};var Ov=class{constructor(a,b){b=void 0===b?2:b;this.a=new Uint8Array(a);this.h=b;this.f=0}};_.Pv=class{constructor(a,b,c){this.h=a;this.j=b;this.f=c||this.h.getMedia();this.a=null}start(){this.a=new ResizeObserver(a=>{a=a[0];this.j(a.contentRect.width,a.contentRect.height,this.h.isFullscreen())});this.f&&this.a.observe(this.f)}stop(){this.a&&(this.a.disconnect(),this.a=null)}};var Qv;_.Rv=class{constructor(){this.a=new Blob([Qv],{type:_.Ig})}canPlay(a){var b=document.createElement(_.w);b.setAttribute("playsinline","playsinline");a&&(b.muted=!0,b.setAttribute("muted","muted"));b.src=URL.createObjectURL(this.a);const c=new _.rn;b=b.play();const d=(new _.Gk(()=>{d.stop();c.resolve(a)})).ia(.25);void 0!==b?b.then(()=>{d.stop();c.resolve(!0)}).catch(e=>{e&&e.message&&e.message===qb?(d.stop(),c.resolve(!0)):(d.stop(),c.resolve(!1))}):(d.stop(),c.resolve(!0));return c}};
|
|
512
|
+
Qv=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,
|
|
500
513
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
|
|
501
514
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
|
|
502
515
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
|
|
503
516
|
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,
|
|
504
517
|
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,
|
|
505
|
-
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]);_.
|
|
506
|
-
_.
|
|
507
|
-
a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.
|
|
508
|
-
_.
|
|
509
|
-
_.
|
|
510
|
-
b;else throw new _.
|
|
511
|
-
_.
|
|
512
|
-
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()}};
|
|
518
|
+
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]);_.Sv=class{constructor(a,b,c,d){this.id=a;this.f=b;this.a=c;this.h=d}getDuration(){return this.a}getId(){return this.id}Tb(){return this.f}nd(){return this.h}Mc(a){return this.getId()===a.getId()&&this.Tb()===a.Tb()&&this.getDuration()===a.getDuration()&&this.nd()===a.nd()}};_.z("clpp.media.TimelineWindow",_.Sv);_.Sv.prototype.isDynamic=_.Sv.prototype.nd;_.Sv.prototype.getStart=_.Sv.prototype.Tb;_.Sv.prototype.getId=_.Sv.prototype.getId;_.Sv.prototype.getDuration=_.Sv.prototype.getDuration;_.Tv=new _.S("clpp.media.TimestampParser");_.Uv=class{constructor(){this.a=[];this.f=-1;this.h=null}yh(a){return this.a[a]||null}zh(){return this.a.length}Ah(){return this.a}Qf(){return this.a[this.f]||null}sh(){return this.f}};_.z("clpp.media.Timeline",_.Uv);_.Uv.prototype.getCurrentWindowIndex=_.Uv.prototype.sh;_.Uv.prototype.getCurrentWindow=_.Uv.prototype.Qf;_.Uv.prototype.getWindows=_.Uv.prototype.Ah;_.Uv.prototype.getWindowCount=_.Uv.prototype.zh;_.Uv.prototype.getWindow=_.Uv.prototype.yh;_.ct={};_.et={};var zt=class{constructor(a){this.a=new Uint8Array(a||65536);this.f=0;this.h=new Ys}};var it=window.XMLHttpRequest;var yt=class{constructor(a,b){a=void 0===a?1E6:a;b=void 0===b?!0:b;this.j=new Ov(a);this.length=a;this.A=b;this.f=this.a=this.h=0;this.l=null;this.o=-1;this.w=new Ys}};var wu=class extends _.vp{constructor(a){super(new _.rn,()=>Promise.resolve());this.B=a;this.h=null;this.w=this.V;this.f=-1;this.j=this.l=this.o=null;st(this)}then(a,b){this.V=this.V.then(a,b);return this}catch(a){this.V=this.V.catch(a);return this}abort(){if(this.a)return Promise.resolve();this.a=!0;return this.h.then(a=>{this.o&&clearTimeout(this.o);this.l&&this.l();return a.abort()}).catch(()=>{})}};var xt=window.fetch,ut=window.AbortController,tt=window.Headers;_.Ct={};_.Wv=class{constructor(a){a=a.getConfiguration();a=_.mh(a.textStyle||a.textstyle||{});this.K=typeof a.backgroundColor===_.cg?a.backgroundColor:null;this.R=typeof a.windowColor===_.cg?a.windowColor:null;this.M=typeof a.fontColor===_.cg?a.fontColor:null;this.O=typeof a.fontFamily===_.cg?a.fontFamily:null;this.I=typeof a.fontSize===_.cg?a.fontSize:null;this.C=typeof a.fontSizePercent===_.t?a.fontSizePercent:null;this.H=typeof a.edgeColor===_.cg?a.edgeColor:"rgba(0, 0, 0, 1)";this.w=null;typeof a.edgeType===
|
|
519
|
+
_.cg&&(this.w=a.edgeType)}getBackgroundColor(){return this.K}setBackgroundColor(a){this.K=a;this.h()}getWindowColor(){return this.R}setWindowColor(a){this.R=a;this.h()}getFontFamily(){return this.O}setFontFamily(a){this.O=a;this.h()}getFontColor(){return this.M}setFontColor(a){this.M=a;this.h()}getFontSize(){return this.I}setFontSize(a){this.I=a;this.h()}getFontSizePercent(){return null===this.C?Vv:this.C}setFontSizePercent(a){this.C=a;this.h()}getEdgeColor(){return this.H}setEdgeColor(a){this.H=
|
|
520
|
+
a;this.h()}getEdgeType(){return this.w}setEdgeType(a){this.w=a;this.h()}};_.Wv.prototype.setEdgeType=_.Wv.prototype.setEdgeType;_.Wv.prototype.getEdgeType=_.Wv.prototype.getEdgeType;_.Wv.prototype.setEdgeColor=_.Wv.prototype.setEdgeColor;_.Wv.prototype.getEdgeColor=_.Wv.prototype.getEdgeColor;_.Wv.prototype.setFontSizePercent=_.Wv.prototype.setFontSizePercent;_.Wv.prototype.getFontSizePercent=_.Wv.prototype.getFontSizePercent;_.Wv.prototype.setFontSize=_.Wv.prototype.setFontSize;
|
|
521
|
+
_.Wv.prototype.getFontSize=_.Wv.prototype.getFontSize;_.Wv.prototype.setFontColor=_.Wv.prototype.setFontColor;_.Wv.prototype.getFontColor=_.Wv.prototype.getFontColor;_.Wv.prototype.setFontFamily=_.Wv.prototype.setFontFamily;_.Wv.prototype.getFontFamily=_.Wv.prototype.getFontFamily;_.Wv.prototype.setWindowColor=_.Wv.prototype.setWindowColor;_.Wv.prototype.getWindowColor=_.Wv.prototype.getWindowColor;_.Wv.prototype.setBackgroundColor=_.Wv.prototype.setBackgroundColor;
|
|
522
|
+
_.Wv.prototype.getBackgroundColor=_.Wv.prototype.getBackgroundColor;var Vv=1/15;var Gt="raised",Ht="depressed",Jt="dropshadow",It="uniform";_.z("clpp.text.EdgeType",{NONE:_.Re,RAISED:Gt,DEPRESSED:Ht,DROP_SHADOW:Jt,UNIFORM:It});_.Dt(Lc,class{constructor(a){this.f=a;this.a=null;this.g=new _.S("clpp.text.Mp4TextParser")}parseInit(a){let b;try{const c=_.Et(_.Mc);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.ttml.Mp4TtmlParser class is not available. Please register the ttml component first.")}catch(c){b=null}if(b)this.a=b;else{try{const c=_.Et(_.Nc);c?(b=new c(this.f),b.parseInit(a)):this.g.warn("The clpp.vtt.Mp4VttParser class is not available. Please register the vtt component first.")}catch(c){b=null}if(b)this.a=
|
|
523
|
+
b;else throw new _.I(_.F,2,2011);}}parseMedia(a,b){if(!this.a)throw new _.I(_.F,2,2011);return this.a.parseMedia(a,b)}});var Xv;
|
|
524
|
+
_.Yv=class extends _.Wv{constructor(a){super(a);this.o=a.getSurface().getMedia();this.f=`clpp-video-${Xv++}`;this.j=document.createElement(_.eg);this.l=this.A=!1;_.Ep(this.o,this.f);document.head.appendChild(this.j);this.h()}append(){}remove(){return!0}isTextVisible(){return this.A}setTextVisibility(a){this.A=a}h(){if(!this.l){var a={"background-color":this.getBackgroundColor(),color:this.getFontColor(),"font-family":this.getFontFamily(),"font-size":this.getFontSize(),"text-shadow":_.Kt(this)},b=
|
|
525
|
+
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()}};Xv=0;_.Ro("native",new class{a(){return!0}create(a){return new _.Yv(a)}});_.Zv=class{onPlayerCreated(){}onContentWillLoad(){return Promise.resolve()}onContentLoaded(){return Promise.resolve()}onPlayerWillDestroy(){}onPlayerWillRelease(){}};};f.call(g,window);g.clpp._ = _;delete window.clpp; export let clpp = g.clpp; export default clpp;
|