@castlabs/prestoplay 6.16.1-beta.3 → 6.16.1-beta.4

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 CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  ## Changes
8
8
 
9
+ * Fix docs of `clpp.Player.setMuted()` API.
9
10
  * Fix handling of empty attribute values in HLS.
10
11
  * Upgrade supported version of `youboralib` to 6.8.57. Please upgrade to this version (e.g. `npm i youboralib@6.8.57`).
11
12
  * Fix a corner case with HLS VOD streams in which `EXT-X-DATE-RANGE` tags are
package/cjs/cl.core.js CHANGED
@@ -2,7 +2,7 @@
2
2
  (function(window){var ba,da,ea,fa,ha,ia,ra,ua,xa,ya,Ba,Ea,Fa,Ha,Ja,Na,Sa,Ta,Wa,Ya,Za,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,vb,wb,Ab,Bb,Cb,Db,Eb,Fb,Gb,Ib,Jb,Mb,Pb,Rb,Vb,Zb,$b,ac,bc,cc,fc,hc,kc,lc,oc,qc,tc,uc,vc,wc,xc,Wc,ad,hd,od,pd,wd,xd,yd,Ad,Bd,Cd,Dd,Ed,Gd,Id,Jd,Kd,Ld,Md,Rd,Td,Wd,be,ce,de,ee,ge,he,je,me,ne,pe,ue,Be,Ce,Ee,Fe,Le,df,lf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,Af,Bf,Cf,Df,Ef,Ff,Hf,If,Mf,Of,fg,ig,pg,wg,xg,Mg,Rg,Sg,Tg,Ug,Vg,Xg,Yg,Zg,ah,bh,fh,jh,lh,kh,mh,nh,oh,ph,th,wh,uh,vh,xh,zh,Ah,Eh,Hh,Mh,Qh,Sh,Th,Yh,Wh,Zh,
3
3
  ai,$h,ci,gi,ki,mi,li,yi,zi,Ai,Ci,Ei,Fi,Hi,Ii,Mi,Oi,Qi,Ki,Si,gj,jj,nj,pj,qj,tj,oj,kj,uj,Bj,Hj,Lj,Mj,Nj,Qj,Rj,bk,ck,dk,jk,lk,mk,uk,vk,yk,Ak,zk,xk,Bk,wk,Ek,Ck,Dk,Fk,Gk,Nk,Wk,Yk,jl,ll,ml,nl,xl,ol,Al,Cl,El,Fl,Dl,Hl,Il,Bl,Jl,Kl,Ll,Ml,Nl,Rl,Sl,Tl,Ul,Ol,Yl,Zl,am,cm,em,km,lm,mm,nm,om,pm,qm,rm,sm,tm,um,vm,Bm,Nm,Tm,Wm,Xm,Zm,$m,gn,ln,mn,rn,xn,yn,An,Bn,In,Jn,On,Pn,Wn,bo,lo,no,po,to,uo,yo,jo,ho,Lo,wo,Mo,Oo,No,To,So,Qo,Ro,Yn,oo,Po,Zn,Ko,go,Go,Ho,Wo,Jo,io,ao,ap,cp,dp,ep,fp,kp,op,pp,rp,vp,Ap,np,Bp,Cp,Fp,Ip,Jp,Lp,
4
4
  Mp,Hp,Gp,Np,Op,Pp,Qp,Vp,$p,aq,bq,fq,eq,hq,gq,jq,kq,lq,mq,iq,oq,qq,rq,sq,tq,uq,vq,wq,xq,zq,Aq,Bq,Cq,yq,Fq,X,Gq,Kq,Iq,Lq,Oq,Nq,Mq,Pq,Rq,Wq,Vq,Sq,Yq,Zq,$q,cr,dr,br,ar,er,hr,jr,ir,mr,kr,pr,qr,or,sr,tr,ur,rr,gr,vr,fr,yr,zr,Cr,Dr,Er,Fr,Ir,Gr,Jr,Lr,Nr,Mr,Pr,Hr,Qr,Br,Rr,Ar,Xr,$r,Zr,ds,bs,cs,Ur,Vr,as,ks,gs,hs,is,ss,ts,qs,As,Sr,Yr,Es,Fs,Gs,Hs,Up,Is,Ks,Ls,Ms,Ns,Os,Ps,Qs,Rs,Ss,Ts,Us,Vs,Ws,Xs,Ys,Zs,bt,$s,ct,et,ft,at,dt,gt,ht,it,jt,kt,lt,mt,nt,ot,pt,rt,tt,ut,vt,st,xt,yt,Et,Jt,Kt,Mt,Lt,Yj,Ot,Rt,Qt,St,Tt,Pt,Vt,Wt,
5
- Ut,Xt,Yt,$t,Zj,eu,Uj,su,vu,dh,xu;_.aa=" - ";ba=" coming up at ";_.ca=" is registered.";da=" is unsupported on this platform.";ea=" to a log level. Falling back to default!";fa="': 'output-restricted'";ha="() is ongoing!";ia=".start";_.ja="6.16.1-beta.3";_.ka="AdaptationSet";_.la="Already destroyed. No-op";_.ma="Already released. No-op";_.na="Autoplay is not allowed due to browser policy.";_.oa="BANDWIDTH";_.qa="BASIC";ra="CHECKSUM";_.sa="CLOSED-CAPTIONS";_.ta="CODECS";ua="Can not set volume to ";
5
+ Ut,Xt,Yt,$t,Zj,eu,Uj,su,vu,dh,xu;_.aa=" - ";ba=" coming up at ";_.ca=" is registered.";da=" is unsupported on this platform.";ea=" to a log level. Falling back to default!";fa="': 'output-restricted'";ha="() is ongoing!";ia=".start";_.ja="6.16.1-beta.4";_.ka="AdaptationSet";_.la="Already destroyed. No-op";_.ma="Already released. No-op";_.na="Autoplay is not allowed due to browser policy.";_.oa="BANDWIDTH";_.qa="BASIC";ra="CHECKSUM";_.sa="CLOSED-CAPTIONS";_.ta="CODECS";ua="Can not set volume to ";
6
6
  _.va="Cannot retrieve buffer information due to platform limitations";_.wa="CastlabsPlayer";xa="Content-Length";ya="Content-Type";_.za="Could not find configured DRM environment.";_.Aa="DRM environment '";Ba="DRM licenses loaded";Ea="DRMtoday";Fa="DRMtodayOnboard";_.Ga="DURATION";Ha="Destroying player";_.Ia="Disable track type ";Ja="EXT-X-BYTERANGE";_.Ka="EXT-X-DATERANGE";_.La="EXT-X-DISCONTINUITY";_.Ma="EXT-X-DISCONTINUITY-SEQUENCE";Na="EXT-X-ENDLIST";_.Oa="EXT-X-KEY";_.Pa="EXT-X-MAP";_.Ra="EXT-X-MEDIA-SEQUENCE";
7
7
  Sa="EXT-X-PART-INF";Ta="EXT-X-PLAYLIST-TYPE";_.Ua="EXT-X-PRELOAD-HINT";_.Va="EXT-X-PROGRAM-DATE-TIME";Wa="EXT-X-SERVER-CONTROL";_.Xa="EXT-X-STREAM-INF";Ya="EXT-X-TARGETDURATION";Za="Error while decoding string!";_.bb="Error while fetching license!";_.cb="FairPlay Certificate URL is not defined";_.db="FairPlay License URL is not defined";_.eb="GROUP-ID";gb="HW_SECURE_ALL";hb="HW_SECURE_CRYPTO";ib="HW_SECURE_DECODE";jb="HeaderDrm";kb="Hide video element .";lb="Interstitial ";mb="Interstitial cue ";
8
8
  nb="Interstitials ";ob="Invalid track type: ";pb="InvalidStateError";qb="Item failed (ID: ";rb="Item loading (ID: ";sb="Item not found (ID: ";tb="Key status for Key ID '";_.ub="LANGUAGE";vb="License verification failed: ";wb="Load interrupted while a player release is pending";_.xb="Loading player with configuration";_.yb="MaxHeight";_.zb="MaxWidth";Ab="Missing media element";Bb="No drmtoday configuration found in player configuration. Unable to modify the DRM license request!";Cb="No event provided!";
@@ -525,10 +525,11 @@ _.u.seek=function(a){return this.getState()===_.wp?Promise.reject("Cannot seek i
525
525
  _.u.getDuration=function(){return this.a?this.a.getDuration():-1};_.u.getAdsManager=function(){return this.j};_.u.namespace=function(){return this.a&&this.a.namespace()||"Undefined"};_.u.getPlaybackRate=function(){return this.a?this.a.getPlaybackRate():1};_.u.setPlaybackRate=function(a,b){this.a&&this.a.setPlaybackRate(a,b)};_.u.isMuted=function(){return this.a&&this.a.isMuted()||!1};_.u.setMuted=function(a){this.a&&this.a.setMuted(a)};_.u.getNetworkEngine=function(){return this.G};
526
526
  _.u.setNetworkEngine=function(a){this.G=a};_.u.getTextDisplayer=function(){return this.a&&this.a.getTextDisplayer()};_.u.isLive=function(){return!!this.a&&this.a.isLive()};_.u.getStats=function(){return this.a?this.a.getStats():null};_.u.Lh=function(){return Object.freeze(this.ja)};_.u.getLoadedSource=function(){return this.a&&this.a.getLoadedSource()};_.u.getTimelineCues=function(){return this.a?this.a.getTimelineCues():[]};_.u.Je=function(){return this.a?this.a.Je():null};
527
527
  _.u.resetAbr=function(){this.a&&this.a.resetAbr()};_.u.setDrmCustomDataModifier=function(a){this.gd=a;Sq(this)};_.u.setCdnErrorCallback=function(a){this.J=a;this.a&&this.a.setCdnErrorCallback(this.J)};_.u.di=function(){this.Gf=!0};_.J("clpp.Player",X);X.registerPlugin=_.Xq;X.prototype.setCdnErrorCallback=X.prototype.setCdnErrorCallback;X.prototype.setDrmCustomDataModifier=X.prototype.setDrmCustomDataModifier;X.prototype.resetAbr=X.prototype.resetAbr;X.prototype.getTimelineCues=X.prototype.getTimelineCues;
528
- X.prototype.getLoadedSource=X.prototype.getLoadedSource;X.prototype.getSources=X.prototype.Lh;X.prototype.getStats=X.prototype.getStats;X.prototype.isLive=X.prototype.isLive;X.prototype.getTextDisplayer=X.prototype.getTextDisplayer;X.prototype.setNetworkEngine=X.prototype.setNetworkEngine;X.prototype.getNetworkEngine=X.prototype.getNetworkEngine;X.prototype.isMuted=X.prototype.isMuted;X.prototype.setPlaybackRate=X.prototype.setPlaybackRate;X.prototype.getPlaybackRate=X.prototype.getPlaybackRate;
529
- X.prototype.namespace=X.prototype.namespace;X.prototype.getAdsManager=X.prototype.getAdsManager;X.prototype.getDuration=X.prototype.getDuration;X.prototype.setVolume=X.prototype.setVolume;X.prototype.getVolume=X.prototype.getVolume;X.prototype.getTimelineOffset=X.prototype.Ac;X.prototype.getSeekRange=X.prototype.getSeekRange;X.prototype.getPresentationStartTime=X.prototype.getPresentationStartTime;X.prototype.seek=X.prototype.seek;X.prototype.getPosition=X.prototype.getPosition;
530
- X.prototype.isPaused=X.prototype.isPaused;X.prototype.isEnded=X.prototype.isEnded;X.prototype.getState=X.prototype.getState;X.prototype.getBufferInfo=X.prototype.getBufferInfo;X.prototype.getTrackManager=X.prototype.getTrackManager;X.prototype.pause=X.prototype.pause;X.prototype.play=X.prototype.play;X.prototype.remove=X.prototype.remove;X.prototype.use=X.prototype.use;X.prototype.load=X.prototype.load;X.prototype.destroy=X.prototype.destroy;X.prototype.release=X.prototype.release;
531
- X.prototype.getDrmInfo=X.prototype.getDrmInfo;X.prototype.getConfiguration=X.prototype.getConfiguration;X.prototype.getSurface=X.prototype.getSurface;X.prototype.getPlugin=X.prototype.yc;X.prototype.off=X.prototype.off;X.prototype.one=X.prototype.one;X.prototype.on=X.prototype.on;_.lp=0;_.xp=1;_.qp=2;_.zp=3;_.yp=4;_.sp=5;_.wp=6;_.mp=7;_.up={IDLE:_.lp,PREPARING:_.xp,BUFFERING:_.qp,PLAYING:_.zp,PAUSED:_.yp,ENDED:_.sp,ERROR:_.wp,UNSET:_.mp};X.State=_.up;var Hq=[];_.x(Yq,X);_.u=Yq.prototype;
528
+ X.prototype.getLoadedSource=X.prototype.getLoadedSource;X.prototype.getSources=X.prototype.Lh;X.prototype.getStats=X.prototype.getStats;X.prototype.isLive=X.prototype.isLive;X.prototype.getTextDisplayer=X.prototype.getTextDisplayer;X.prototype.setNetworkEngine=X.prototype.setNetworkEngine;X.prototype.getNetworkEngine=X.prototype.getNetworkEngine;X.prototype.setMuted=X.prototype.setMuted;X.prototype.isMuted=X.prototype.isMuted;X.prototype.setPlaybackRate=X.prototype.setPlaybackRate;
529
+ X.prototype.getPlaybackRate=X.prototype.getPlaybackRate;X.prototype.namespace=X.prototype.namespace;X.prototype.getAdsManager=X.prototype.getAdsManager;X.prototype.getDuration=X.prototype.getDuration;X.prototype.setVolume=X.prototype.setVolume;X.prototype.getVolume=X.prototype.getVolume;X.prototype.getTimelineOffset=X.prototype.Ac;X.prototype.getSeekRange=X.prototype.getSeekRange;X.prototype.getPresentationStartTime=X.prototype.getPresentationStartTime;X.prototype.seek=X.prototype.seek;
530
+ X.prototype.getPosition=X.prototype.getPosition;X.prototype.isPaused=X.prototype.isPaused;X.prototype.isEnded=X.prototype.isEnded;X.prototype.getState=X.prototype.getState;X.prototype.getBufferInfo=X.prototype.getBufferInfo;X.prototype.getTrackManager=X.prototype.getTrackManager;X.prototype.pause=X.prototype.pause;X.prototype.play=X.prototype.play;X.prototype.remove=X.prototype.remove;X.prototype.use=X.prototype.use;X.prototype.load=X.prototype.load;X.prototype.destroy=X.prototype.destroy;
531
+ X.prototype.release=X.prototype.release;X.prototype.getDrmInfo=X.prototype.getDrmInfo;X.prototype.getConfiguration=X.prototype.getConfiguration;X.prototype.getSurface=X.prototype.getSurface;X.prototype.getPlugin=X.prototype.yc;X.prototype.off=X.prototype.off;X.prototype.one=X.prototype.one;X.prototype.on=X.prototype.on;_.lp=0;_.xp=1;_.qp=2;_.zp=3;_.yp=4;_.sp=5;_.wp=6;_.mp=7;_.up={IDLE:_.lp,PREPARING:_.xp,BUFFERING:_.qp,PLAYING:_.zp,PAUSED:_.yp,ENDED:_.sp,ERROR:_.wp,UNSET:_.mp};X.State=_.up;
532
+ var Hq=[];_.x(Yq,X);_.u=Yq.prototype;
532
533
  _.u.open=function(a,b){var c=this,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){if(c.w)throw new _.P(_.Q,7,7008,"Cannot call open() while "+c.w+ha);if(0!==a)throw new _.P(_.Q,7,7007,"The index parameter only supports the value of 0.");if(0===b.length)throw new _.P(_.Q,7,7003,Eb);if(b.some(function(p){return!p.id||!p.source}))throw new _.P(_.Q,7,7100,"Some config is missing required properties `id` or `source`!");d=new Set(b.map(function(p){return p.id}));if(d.size!==b.length)throw new _.P(_.Q,7,
533
534
  7100,"Some config contains a non-unique property `id`!");if(e=b[0].playlist){f=e.timeline;g=["flat","basic"];if(f&&!g.includes(f))throw new _.P(_.Q,7,7100,"Unsupported `playlist.timeline` config value!");h=e.startTime;if(null!=h&&(typeof h!==_.k||0>h))throw new _.P(_.Q,7,7100,"Invalid `playlist.startTime` config value!");l=e.endTime;if(null!=l&&(typeof l!==_.k||0>l||null!=h&&l<=h))throw new _.P(_.Q,7,7100,"Invalid `playlist.endTime` config value!");m=e.content;if("DVR"===m&&!l)throw new _.P(_.Q,7,
534
535
  7100,"`playlist.endTime` config value is required for DVR content!");}ph(n);Zq(c);c.w="open";return _.y(n,cr(c,b),4)}2!=n.a&&(c.C=0,c.o=b,c.W=!0,$q(c,b[0].playlist||{}));_.rh(n);c.w=null;return _.sh(n,0)})};
package/cjs/cl.externs.js CHANGED
@@ -358,6 +358,12 @@ clpp.Player.prototype.setCdnErrorCallback = function(callback) {
358
358
  */
359
359
  clpp.Player.prototype.setDrmCustomDataModifier = function(modifier) {
360
360
  };
361
+ /**
362
+ * @param {boolean} muted
363
+ * @return {undefined}
364
+ */
365
+ clpp.Player.prototype.setMuted = function(muted) {
366
+ };
361
367
  /**
362
368
  * @param {!clpp.net.NetworkEngine} engine
363
369
  * @return {undefined}
package/cjs/cl.youbora.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var f=function(window){var Cv='" event to Youbora',Dv='Reporting "',Ev="clpp.npaw.YouboraPlugin",Fv="content.isLive",Gv=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Hv=function(a,b,c,d){b=Gv(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.se;b.severity===_.Q?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
3
3
  b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Dv+a+'" to Youbora',b.code,b));return b},Iv=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Uh;d.g=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.h=!1;d.registerListeners();d.C=!1;return d}_.x(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();
4
4
  if(c&&(c=c.qa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.l(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.l().streamBandwidth};b.prototype.getThroughput=function(){return this.l().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
5
- b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Ta())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.16.1-beta.3-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.hg,this.L.bind(this)),this.a.on(this.m,_.se,this.H.bind(this)),
5
+ b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Ta())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.16.1-beta.4-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.hg,this.L.bind(this)),this.a.on(this.m,_.se,this.H.bind(this)),
6
6
  this.a.on(this.m,_.Bg,this.J.bind(this)),this.a.on(this.m,_.Ag,this.I.bind(this)),this.a.on(this.m,_.Pc,this.D.bind(this)),this.a.on(this.m,_.rd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.jc);_.Xh(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.C=!0};b.prototype.l=function(){return this.m.getStats()||_.hp()};b.prototype.o=function(){return!!this.m.getConfiguration().autoplay};b.prototype.L=function(c){c=c.detail;this.j("state change",
7
7
  c);if(c)switch(c.currentState){case _.xp:this.o()&&this.f();break;case _.zp:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.yp:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.lp:this.fireBufferEnd();this.fireStop();break;case _.sp:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.qp:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
8
8
  (this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Ud)?"Widevine":c.startsWith(_.Qd)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.ff)?"ClearKey":c.startsWith(_.Pd)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Hv(c,this.m,this.g,this))&&c.severity===_.Q&&(this.h=!0)};
@@ -10,7 +10,7 @@ b.prototype.J=function(){this.m.isEnded()||(this.j(_.$f),this.f(),this.fireSeekB
10
10
  youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Uh;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.x(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.Rb(),this.a.Qb(),this.a.Db()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Db()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();
11
11
  return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.qb()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",
12
12
  d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.Sb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
13
- function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.16.1-beta.3-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
13
+ function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.16.1-beta.4-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
14
14
  function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Pc,this.W.bind(this)),this.f.on(this.m,_.Lc,this.T.bind(this)),this.f.on(this.m,_.Hc,this.L.bind(this)),this.f.on(this.m,_.Jc,this.M.bind(this)),this.f.on(this.m,_.Cc,this.I.bind(this)),this.f.on(this.m,_.Dc,this.o.bind(this,1)),this.f.on(this.m,_.Gc,this.o.bind(this,2)),this.f.on(this.m,_.Nc,this.o.bind(this,3)),this.f.on(this.m,_.Bc,this.H.bind(this)),this.f.on(this.m,_.Kc,this.P.bind(this)),this.f.on(this.m,
15
15
  _.se,this.J.bind(this)),this.f.on(this.m,_.yc,this.C.bind(this)),this.f.on(this.m,_.zc,this.D.bind(this)),this.f.on(this.m,_.Ac,this.G.bind(this)),this.f.on(this.m,_.Ic,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Xh(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.W=function(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.T=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();
16
16
  this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.L=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.M=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h("ad buffering ended"),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");
package/cl.airplay.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var gW=class extends _.nu{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Os(()=>{this.m.play().catch(()=>{})});this.h=new _.ds}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
- !0;break;case "not-available":this.f=!1}this.m.trigger(new _.D(_.wc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.vc:_.uc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Un)this.l?this.m.play().catch(()=>{}):this.o.ia(.01);this.m.trigger(new _.D(a))}Bb(){return this.j}Zd(){return this.f}ph(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",gW);gW.prototype.showCastMenu=gW.prototype.ph;
2
+ !0;break;case "not-available":this.f=!1}this.m.trigger(new _.C(_.wc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.vc:_.uc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Un)this.l?this.m.play().catch(()=>{}):this.o.ia(.01);this.m.trigger(new _.C(a))}Bb(){return this.j}Zd(){return this.f}ph(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",gW);gW.prototype.showCastMenu=gW.prototype.ph;
3
3
  gW.prototype.canCast=gW.prototype.Zd;gW.prototype.isCasting=gW.prototype.Bb;gW.Id="airplay";_.Wo(new class{create(){return new gW}});};f.call(g, window);
package/cl.cast.js CHANGED
@@ -3,17 +3,17 @@ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(windo
3
3
  null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.Aj(d,a.mimeType,g);f&&g&&(h=_.Oi(a.url),(h=yield c.fetch(h).O)&&h.data&&(e=f.a(_.J(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},PU=function(a,b){let c,d;if(window.chrome&&chrome.cast&&chrome.cast.media)c=chrome.cast.media.HlsSegmentFormat,d=chrome.cast.media.HlsVideoSegmentFormat;else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,
4
4
  d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.gg:return d.FMP4;case _.fg:return b===_.M?d.MPEG2_TS:c.TS;case _.Fc:return c.AAC;case _.Gc:return c.AC3;case _.Hc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Ic:return c.FMP4}},RU=function(a){a=void 0===a?QU:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.H(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;
5
5
  b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},SU=function(a,b){return a.h.filter(c=>c.type===b)},UU=function(a,b){const c=TU(a);return SU(a,b).find(d=>c.includes(d.id))||null},WU=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.K){const e=a.za();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);
6
- d.editTracksInfo(c,()=>{a.f[b]=null;VU(a,b)},e=>{a.f[b]=null;a.g.debug(zU,e)})}else b===_.K&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{VU(a,b)},e=>{a.g.debug(zU,e)}))},TU=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(b=>b.toString())},VU=function(a,b){b===_.L?a.a.trigger(new _.D(_.Fk)):b===_.K&&a.a.trigger(new _.D(_.Gk))},ZU=function(a){if(a)for(const b of XU)YU(b)},YU=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&
6
+ d.editTracksInfo(c,()=>{a.f[b]=null;VU(a,b)},e=>{a.f[b]=null;a.g.debug(zU,e)})}else b===_.K&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{VU(a,b)},e=>{a.g.debug(zU,e)}))},TU=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(b=>b.toString())},VU=function(a,b){b===_.L?a.a.trigger(new _.C(_.Fk)):b===_.K&&a.a.trigger(new _.C(_.Gk))},ZU=function(a){if(a)for(const b of XU)YU(b)},YU=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&
7
7
  cast.framework&&cast.framework.CastContext&&a.T.length){a.w=!0;a.o.Me();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.T;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.N);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.aa);$U&&a.o.ia(.02)}},aV=function(a){return _.x(function*(){XU.delete(a);if(a.w){a.w=!1;var b=
8
8
  cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.N);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.aa)}b=[];a.f&&(b.push(a.f.destroy()),a.f=null);a.j&&(b.push(a.j.destroy()),a.j=null);yield Promise.all(b);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.S=null;a.Y=null})},bV=function(a){return _.x(function*(){a.Bb()||(yield cast.framework.CastContext.getInstance().requestSession())})},dV=function(a,b,c){c=
9
9
  void 0===c?0:c;return _.x(function*(){var d=a.f.za();d&&d.language&&(a.h.preferredTextLanguage=d.language);(d=a.f.na())&&d.language&&(a.h.preferredAudioLanguage=d.language);yield cV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Ae:a.getPresentationStartTime(),autoplay:b,fb:a.h})})},cV=function(a,b){return _.x(function*(){var c=chrome.cast.media.StreamType;yield bV(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
10
10
  b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=PU(b.Ob,_.M);e.hlsSegmentFormat=PU(c,_.L);b.fb&&(a.M&&(c=yield Promise.resolve(a.M(b.fb)))&&(b.fb=c),a.h=b.fb,a.D=_.Xn(a.h),a.C=a.D.findIndex(k=>k.url===b.source.url),b.fb.remoteTextTracks&&(c=yield Promise.all(b.fb.remoteTextTracks.map(a.Ea.bind(a))),e.tracks=c.filter(k=>k),b.fb.remoteTextTracks=void 0),delete b.fb.autoplay,b.fb.startTime=null,e.customData={playerConfiguration:MU(b.fb)});c=a.vb()||{};
11
11
  var f=eV(c.metadataType),g;typeof b.Ae===_.t&&(g={metadataType:f,sectionStartAbsoluteTime:b.Ae});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=fV(c);if(g=gV(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);typeof b.autoplay===_.Oc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.t&&(e.currentTime=b.currentTime);yield d.loadMedia(e)}})},gV=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(hV);for(const d of c){const [e,f]=d;
12
12
  if(f===b){b=e;break a}}b=null}if(!b)return null;b=RU(hV[b]);return Object.assign(b,a)},eV=function(a){var b=void 0===b?QU:b;return Object.values(hV).includes(a)?a:b},fV=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},jV=function(a,b){iV(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.X);b.addMessageListener(IU,a.R)},kV=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.t?null:a):a=
13
- null;a=null===a?null:a+b;return null===a?b:a},iV=function(a,b){a.a=b;a.a&&(a.H.release(),a.G=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.G=new cast.framework.RemotePlayerController(a.l),a.H.on(a.G,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.ga.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.D(_.le)))},nV=function(a){return new lV(a.h,()=>{a.trigger(new _.D(_.Xc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-
14
- 1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.ff&&(d.preferredAudioLanguage=c.ff);c.Sf&&(d.preferredTextLanguage=c.Sf);_.ap(a.f,null);a.trigger(new _.D("castingended"));a.j(b,d)}},()=>mV(a))},mV=function(a){return _.x(function*(){a.trigger(new _.D(_.Wc));a.f.a!==a.a&&a.f&&a.a&&(yield a.f.release(),_.ap(a.f,a.a))})},qV=function(a,b,c){return _.x(function*(){var d=b.adTagUrl;if(d)try{oV=!1;const e=_.Oi(d),f=yield c.fetch(e).O;if(f&&f.data){const g=_.ki(f.data),h=(new DOMParser).parseFromString(g,
13
+ null;a=null===a?null:a+b;return null===a?b:a},iV=function(a,b){a.a=b;a.a&&(a.H.release(),a.G=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.G=new cast.framework.RemotePlayerController(a.l),a.H.on(a.G,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.ga.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.C(_.le)))},nV=function(a){return new lV(a.h,()=>{a.trigger(new _.C(_.Xc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-
14
+ 1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.ff&&(d.preferredAudioLanguage=c.ff);c.Sf&&(d.preferredTextLanguage=c.Sf);_.ap(a.f,null);a.trigger(new _.C("castingended"));a.j(b,d)}},()=>mV(a))},mV=function(a){return _.x(function*(){a.trigger(new _.C(_.Wc));a.f.a!==a.a&&a.f&&a.a&&(yield a.f.release(),_.ap(a.f,a.a))})},qV=function(a,b,c){return _.x(function*(){var d=b.adTagUrl;if(d)try{oV=!1;const e=_.Oi(d),f=yield c.fetch(e).O;if(f&&f.data){const g=_.ki(f.data),h=(new DOMParser).parseFromString(g,
15
15
  _.Sf);if(h.getElementsByTagName("vmap:VMAP").length)_.B("VMAP detected."),a.vmapAdsRequest=pV(g);else if(h.getElementsByTagName("VAST").length){_.B("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=pV(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else _.B("Unsupported schema."),oV=!0}}catch(e){_.B("Failed to fetch an ad",e),oV=!0}})},pV=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=
16
- a;return b},rV=function(a,b){b=new _.H(1,10,10003,{errorType:b});a.m.onError(b)},sV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},uV=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=tV(a,c))&&(d={ad:c});a.m.trigger(new _.D(b,d))}},tV=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Mf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===
16
+ a;return b},rV=function(a,b){b=new _.H(1,10,10003,{errorType:b});a.m.onError(b)},sV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},uV=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=tV(a,c))&&(d={ad:c});a.m.trigger(new _.C(b,d))}},tV=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Mf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===
17
17
  _.Mf&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>g.breakClipIds.includes(d.id))||null),e&&(f=a.a.getBreaks().filter(g=>0<=g.position).sort((g,h)=>g.position-h.position).findIndex(g=>g===e)));c=new Z(d,e,b.index,b.total,f)}return c},vV=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},wV=function(a){const b=
18
18
  a.dashTimedMetadata;let c=_.$f;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Zf)?_.ph:_.nh,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},xV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},zV=function(a){a.a=xV().getTextTracksManager();const b=a.a.getTracks();a.j=yV(_.K,b)},yV=function(a,b){const c=[];for(const d of b)b=new _.dj(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||
19
19
  null,b.language=d.language||null,b.originalLanguage=d.language||null,b.label=d.name||null,b.src=d.trackContentId||null,b.mimeType=d.trackContentType||null,d.customData&&(b.mimeType=d.customData.mimeType||b.mimeType,b.src=d.customData.url||b.src),b.renditions.push(new _.lj(b.id,b)),c.push(b);return c},AV=function(a,b,c,d){c=_.wh(c).filter(g=>g);var e=!1;let f=[];b===_.L?f=a.getAudioTracks():b===_.K&&(f=a.ma());if(c=c.find(g=>{const h=_.Yh(g);return f.some(k=>{k=_.Yh(k.language||"");return _.Zh(h,k)})})){const g=
@@ -21,45 +21,45 @@ _.Yh(c);c=f.filter(h=>{h=_.Yh(h.language||"");return _.Zh(g,h)});f=c.length?c:f;
21
21
  if(a&&a.drm){var d=a.drm,e=_.ml(d);if(e){var f=[_.wd];_.Xn(a)[0].type!==_.Dc&&f.unshift(_.yd);d.preferredDrmSystem===_.wd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.hb[g];h?(c=g===_.yd?cast.framework.ContentProtection.WIDEVINE:g===_.wd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},CV(b,h,a,c),DV(b,h,a,c)):c()}else c()}else c()},CV=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=e=>{const f=
22
22
  _.Oi({method:"POST",uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},DV=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.x(function*(){const g=_.Pi(Object.assign({},f.headers),e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.J(g.data)}):
23
23
  a.licenseHandler=void 0},HV=function(){return FV||(FV=new GV)},IV=function(){return cast.framework.CastReceiverContext.getInstance()},KV=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=IV();var {hlsVideoSegmentFormat:d}=IV().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.gg:_.fg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");b=b.split(/\n+/m);d=[];let e=0;for(;e<b.length;){const f=b[e].trim();if(b[e].startsWith("#EXT-X-STREAM-INF")){const g=
24
- JV(f,_.pa),h=JV(f,_.Ab);let [k,l]=[];h&&([k,l]=h.split("x").map(m=>+m));if(!a.canDisplayType(c,g,k,l)){e+=2;continue}}d.push(f);++e}return d.join("\n")},JV=function(a,b){let c;b+="\x3d";let d=a.indexOf(b);0<=d&&(c=a.substring(d+b.length),c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},MV=function(a,b){let c=null;const d=LV(a);d&&(c={ad:d});a.f.trigger(new _.D(b,c))},LV=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;
24
+ JV(f,_.pa),h=JV(f,_.Ab);let [k,l]=[];h&&([k,l]=h.split("x").map(m=>+m));if(!a.canDisplayType(c,g,k,l)){e+=2;continue}}d.push(f);++e}return d.join("\n")},JV=function(a,b){let c;b+="\x3d";let d=a.indexOf(b);0<=d&&(c=a.substring(d+b.length),c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},MV=function(a,b){let c=null;const d=LV(a);d&&(c={ad:d});a.f.trigger(new _.C(b,c))},LV=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;
25
25
  let c=null,d=null,e,f;const g=a.a.currentBreakClipNumber;b.breaks&&(c=b.breaks.find(h=>h.id===a.a.breakId)||null)&&(e=c.breakClipIds.length,f=0>=c.position?c.position:b.breaks.filter(h=>0<=h.position).sort((h,k)=>h.position-k.position).findIndex(h=>h===c));b.breakClips&&(d=b.breakClips.find(h=>h.id===a.a.breakClipId)||null);b=new Z(d,c,g,e,f)}return b},NV=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.h=_.Rn;this.o=_.mt;this.j=2;this.D=Date.now();this.C=-1}release(){this.a(_.Rn)}destroy(){this.l=
26
- this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===_.E&&this.a(_.Qn)}a(a){if(a!==this.h)if(this.h===_.Qn&&a!==_.Rn)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.h;this.h=a;this.h===_.Mn?(this.C=b,this.player.trigger(new _.D(_.Qc,{detail:{bufferedTimeMS:-1,reason:this.j}}))):this.o===_.Mn&&this.player.trigger(new _.D(_.Pc,{detail:{bufferedTimeMS:b-this.C,reason:this.j}}));a={currentState:this.h,previousState:this.o,
27
- timeSinceLastStateChangeMS:b-this.D};this.D=b;this.l&&_.An(this.l,this.h);this.player.trigger(new _.D(_.Jf,{detail:a}))}}};_.z("clpp.cast.CastUtils",class{});var QU=0,hV={GENERIC:QU,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};var OV=class extends NV{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.ob.bind(this)}init(){const a=this.player,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.l)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.x(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.l;b&&b.isPlayingBreak||super.a(a)}ob(){if(this.f&&
26
+ this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===_.E&&this.a(_.Qn)}a(a){if(a!==this.h)if(this.h===_.Qn&&a!==_.Rn)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.h;this.h=a;this.h===_.Mn?(this.C=b,this.player.trigger(new _.C(_.Qc,{detail:{bufferedTimeMS:-1,reason:this.j}}))):this.o===_.Mn&&this.player.trigger(new _.C(_.Pc,{detail:{bufferedTimeMS:b-this.C,reason:this.j}}));a={currentState:this.h,previousState:this.o,
27
+ timeSinceLastStateChangeMS:b-this.D};this.D=b;this.l&&_.An(this.l,this.h);this.player.trigger(new _.C(_.Jf,{detail:a}))}}};_.z("clpp.cast.CastUtils",class{});var QU=0,hV={GENERIC:QU,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};var OV=class extends NV{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.ob.bind(this)}init(){const a=this.player,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.l)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.x(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.l;b&&b.isPlayingBreak||super.a(a)}ob(){if(this.f&&
28
28
  this.w&&!this.w.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.a(_.Jn);break;case chrome.cast.media.IdleReason.ERROR:this.a(_.Qn);break;default:this.a(_.Rn)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(_.Un);break;case chrome.cast.media.PlayerState.PAUSED:this.a(_.Tn);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(_.Mn)}}};var PV=class extends _.T{constructor(){super();this.g=new _.S("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}}initialize(a){this.a=a}release(){this.h=[];this.f={}}load(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(b=>{switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.M;break;case chrome.cast.media.TrackType.AUDIO:c=_.L;break;case chrome.cast.media.TrackType.TEXT:c=_.K}c=new _.dj(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
29
- c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;b.customData&&(c.src=b.customData.url||c.src,c.mimeType=b.customData.mimeType||c.mimeType);c.renditions.push(new _.lj(c.id,c));return c}):[],this.a.trigger(new _.D(_.Qs)))}destroy(){this.a=null}getVideoTracks(){return SU(this,_.M)}getAudioTracks(){return SU(this,_.L)}ma(){return SU(this,_.K)}oa(){const a=this.Ra();return a?a.renditions[0]:null}Xa(){const a=this.na();return a?a.renditions[0]:null}Pa(){const a=this.za();return a?a.renditions[0]:
29
+ c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;b.customData&&(c.src=b.customData.url||c.src,c.mimeType=b.customData.mimeType||c.mimeType);c.renditions.push(new _.lj(c.id,c));return c}):[],this.a.trigger(new _.C(_.Qs)))}destroy(){this.a=null}getVideoTracks(){return SU(this,_.M)}getAudioTracks(){return SU(this,_.L)}ma(){return SU(this,_.K)}oa(){const a=this.Ra();return a?a.renditions[0]:null}Xa(){const a=this.na();return a?a.renditions[0]:null}Pa(){const a=this.za();return a?a.renditions[0]:
30
30
  null}kb(){return this.f[_.M]||null}wb(){return this.f[_.L]||null}xb(){return this.f[_.K]||null}Ra(){return UU(this,_.M)}na(){return UU(this,_.L)}za(){return UU(this,_.K)}sb(a){WU(this,_.M,a)}Da(a){WU(this,_.L,a)}Ta(a){WU(this,_.K,a)}gb(a){this.sb(a&&a.track)}qb(a){this.Da(a&&a.track)}rb(a){this.Ta(a&&a.track)}addTextTrack(){return _.x(function*(){})}ua(){return!0}};PV.prototype.isAbrEnabled=PV.prototype.ua;PV.prototype.addTextTrack=PV.prototype.addTextTrack;PV.prototype.setTextRendition=PV.prototype.rb;
31
31
  PV.prototype.setAudioRendition=PV.prototype.qb;PV.prototype.setVideoRendition=PV.prototype.gb;PV.prototype.setTextTrack=PV.prototype.Ta;PV.prototype.setAudioTrack=PV.prototype.Da;PV.prototype.setVideoTrack=PV.prototype.sb;PV.prototype.getTextTrack=PV.prototype.za;PV.prototype.getAudioTrack=PV.prototype.na;PV.prototype.getVideoTrack=PV.prototype.Ra;PV.prototype.getLoadingTextRendition=PV.prototype.xb;PV.prototype.getLoadingAudioRendition=PV.prototype.wb;PV.prototype.getLoadingVideoRendition=PV.prototype.kb;
32
32
  PV.prototype.getTextRendition=PV.prototype.Pa;PV.prototype.getAudioRendition=PV.prototype.Xa;PV.prototype.getVideoRendition=PV.prototype.oa;PV.prototype.getTextTracks=PV.prototype.ma;PV.prototype.getAudioTracks=PV.prototype.getAudioTracks;PV.prototype.getVideoTracks=PV.prototype.getVideoTracks;var lV=class extends _.Ss{constructor(a,b,c,d){super();this.g=new _.S(_.jd);this.T=a;this.o=new _.Pj(b);this.S=c;this.Y=d;this.h=this.I=_.Qk();this.D=[];this.C=0;this.K=new _.To;this.G=this.l=this.a=null;this.A=this.w=!1;this.Z="";this.da=1E6;this.f=new PV;this.f.initialize(this);this.j=new OV(this);this.H=new _.ds;this.J=null;this.F=new Set;this.N=this.Ua.bind(this);this.aa=this.Na.bind(this);this.X=this.Ma.bind(this);this.R=this.Va.bind(this);this.M=null;window.cast||Object.defineProperty(window,
33
33
  "cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{ZU(!0)},0)}});YU(this);XU.add(this)}init(a,b){this.h=this.I=b}unload(){return new Promise((a,b)=>{this.f&&this.f.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)})}release(){return this.unload().then(()=>{this.j&&this.j.release()})}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.pb)}appendLoad(){return Promise.reject(_.pb)}seekWith(){return Promise.reject(_.pb)}destroy(){return _.x(function*(){})}sd(a){this.M=
34
34
  a}oc(){return this.w}Bb(){return this.A}je(){return this.Z}sendMessage(a,b){const c=this;return _.x(function*(){let d;const e=cast.framework.CastContext.getInstance().getCurrentSession();if(e)try{yield e.sendMessage(a,MU(b))}catch(f){d=new _.H(1,8,8E3,{detailedErrorCode:f})}else d=new _.H(1,8,8004,void 0);if(d)c.onError(d)})}cast(){const a=this;return _.x(function*(){if(!a.oc())throw a.g.warn(DU),new _.H(1,8,8001,void 0);if(!$U)throw a.g.warn(BU),new _.H(1,8,8002,void 0);if(a.Bb())throw a.g.warn("Already casting"),
35
35
  new _.H(1,8,8003,void 0);try{yield bV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.H(1,8,8E3,c);}})}ge(){this.Bb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Xd&&this.F.add(a)}removeMessageListener(a){typeof a===_.Xd&&this.F.delete(a)}play(){return this.isEnded()?dV(this,!0):new Promise((a,b)=>{if(!this.a)return b(AU);this.a.play(null,
36
- a,b)})}pause(){return new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(AU);this.a.pause(null,a,b)})}isPaused(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED}isEnded(){return this.getState()===_.Jn}seek(a){return this.isEnded()?dV(this,!1,a):new Promise((b,c)=>{this.a||c(AU);this.l.isPlayingBreak&&c(yU);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.D(_.bg));this.a.seek(d,()=>{this.trigger(new _.D(_.ag));b()},c)})}getPosition(){return this.getMediaPosition()}getMediaPosition(){return this.a&&
36
+ a,b)})}pause(){return new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(AU);this.a.pause(null,a,b)})}isPaused(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED}isEnded(){return this.getState()===_.Jn}seek(a){return this.isEnded()?dV(this,!1,a):new Promise((b,c)=>{this.a||c(AU);this.l.isPlayingBreak&&c(yU);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.C(_.bg));this.a.seek(d,()=>{this.trigger(new _.C(_.ag));b()},c)})}getPosition(){return this.getMediaPosition()}getMediaPosition(){return this.a&&
37
37
  this.a.getEstimatedTime()||0}getDuration(){return this.getMediaDuration()}getMediaDuration(){if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.t?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.a&&this.a.playbackRate||0}setPlaybackRate(a){this.a&&0<a&&this.sendMessage(KU,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.a&&
38
38
  this.a.volume.level}setVolume(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.a&&this.a.volume.muted}setMuted(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))}getPresentationStartTime(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;const a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.t?null:1E-8===a?0:a}getSeekRange(){let a=
39
39
  {start:0,end:this.getDuration()};if(this.isLive()){const b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.t&&typeof b.end===_.t&&(a={start:b.start,end:b.end})}return a}getState(){return this.j?this.j.getState():_.mt}getStats(){return this.a&&this.a.customData&&this.a.customData.stats?NU(this.a.customData.stats):_.En()}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.x(function*(){if(b.oc())if($U){b.D=_.Xn(a);b.h=_.Sk(b.I,a);var c=b.D[b.C];yield cV(b,{source:c,
40
40
  isLive:c.isLive,autoplay:b.h.autoplay,fb:b.h,Ob:c.Ob,audioMimeType:c.audioMimeType})}else b.g.warn(BU);else b.g.warn(DU)})}getBufferInfo(){return new _.Rs}getTrackManager(){return this.f}getConfiguration(){return this.h}getSurface(){return null}setNetworkEngine(a){this.K=a}getNetworkEngine(){return this.K}getSourceIndex(){return this.C}setSourceIndex(a){this.C=a}getLoadedSource(){return this.D[this.C]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}resetAbr(){this.g.warn(CU)}onError(a){if(a&&
41
- (this.trigger(new _.D(_.q,{detail:a})),this.j))this.j.onError(a)}namespace(){return _.jd}canPlay(){return this.oc()?2:0}vb(){return this.J}uc(a){this.J=gV(a)}be(){this.J=null}He(a){const b=this.vb()||{};a={metadataType:eV(b.metadataType),title:a};this.uc(Object.assign({},b,a))}Fe(a){const b=this.vb()||{},c=eV(b.metadataType);a=new chrome.cast.Image(a);this.uc(Object.assign({},b,{metadataType:c,images:[a]}))}Ee(a){const b=this.vb()||{};this.uc(Object.assign({},b,{metadataType:3,artist:a}))}Ge(a){const b=
41
+ (this.trigger(new _.C(_.q,{detail:a})),this.j))this.j.onError(a)}namespace(){return _.jd}canPlay(){return this.oc()?2:0}vb(){return this.J}uc(a){this.J=gV(a)}be(){this.J=null}He(a){const b=this.vb()||{};a={metadataType:eV(b.metadataType),title:a};this.uc(Object.assign({},b,a))}Fe(a){const b=this.vb()||{},c=eV(b.metadataType);a=new chrome.cast.Image(a);this.uc(Object.assign({},b,{metadataType:c,images:[a]}))}Ee(a){const b=this.vb()||{};this.uc(Object.assign({},b,{metadataType:3,artist:a}))}Ge(a){const b=
42
42
  this.vb()||{};a={metadataType:eV(b.metadataType),releaseDate:a};this.uc(Object.assign({},b,a))}Ua(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;$U=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.Z=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Me()}Na(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;jV(this,a.session);break;
43
43
  case cast.framework.SessionState.SESSION_RESUMED:this.Bb()||(this.A=!0,jV(this,a.session),this.Y());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Bb()&&this.a){const d=this.a.media;var b=this.f.na(),c=this.f.za();b=b&&b.language||void 0;c=c&&c.language||void 0;this.S(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:kV(this),Sf:c,ff:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.X);a.session.removeMessageListener(IU,
44
- this.R);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}}Ma(a){this.g.debug("New media session",a.mediaSession);iV(this,a.mediaSession)}Va(a,b){if(a===IU&&0<this.F.size){const c=NU(b);this.F.forEach(d=>d(c))}}ga(){this.trigger(new _.D(_.Tf))}Ea(a){const b=this;return _.x(function*(){let c=null;const d=yield OU(a,[_.Rf,_.Cc],b.K,b.h);d&&(c=new chrome.cast.media.Track(b.da++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=
44
+ this.R);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}}Ma(a){this.g.debug("New media session",a.mediaSession);iV(this,a.mediaSession)}Va(a,b){if(a===IU&&0<this.F.size){const c=NU(b);this.F.forEach(d=>d(c))}}ga(){this.trigger(new _.C(_.Tf))}Ea(a){const b=this;return _.x(function*(){let c=null;const d=yield OU(a,[_.Rf,_.Cc],b.K,b.h);d&&(c=new chrome.cast.media.Track(b.da++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=
45
45
  d.mimeType,c.customData={mimeType:a.mimeType,url:a.url});return c})}getTextDisplayer(){return null}};lV.prototype.getTextDisplayer=lV.prototype.getTextDisplayer;lV.prototype.getNetworkEngine=lV.prototype.getNetworkEngine;lV.prototype.setNetworkEngine=lV.prototype.setNetworkEngine;var $U=!1,XU=new Set;window.__onGCastApiAvailable=ZU;var QV=class extends _.Ss{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.Xd?c:(d,e)=>{this.f&&d!==_.Jn&&d!==_.Rn&&this.f.load(e)};this.a=nV(this);this.g=new _.S(FU);this.f&&this.forwardEventsTo(this.f)}destroy(){const a=this;return _.x(function*(){a.a&&(yield aV(a.a),a.a=null);a.f&&a.stopForwardingEventsTo(a.f)})}Zd(){return!!this.a&&this.a.oc()&&$U}Bb(){return!!this.a&&this.a.Bb()}je(){return this.a?this.a.je():""}sd(a){this.a&&this.a.sd(a)}cast(a){const b=this;return _.x(function*(){if(b.a)try{if(yield b.a.cast(),
46
46
  b.f&&b.a){{let d=null;const e=b.f.getLoadedSource();if(e){const f=b.f.getTrackManager(),g=f.getVideoTracks()[0];let h,k;g&&g.mimeType&&(h=g.mimeType);const l=b.f.getConfiguration(),m=f.na();m&&(m.mimeType&&(k=m.mimeType),m.language&&(l.preferredAudioLanguage=m.language),m.roles.length&&(l.preferredAudioRole=m.roles[0]));const n=f.za();n&&(n.language&&(l.preferredTextLanguage=n.language),n.roles.length&&(l.preferredTextRole=n.roles[0]));const r=e&&typeof e.isLive===_.Oc?e.isLive:b.f.isLive();d={source:e,
47
- isLive:r,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Ae:b.f.getPresentationStartTime(),Ob:h,audioMimeType:k,fb:l}}var c=d}yield mV(b);b.a&&(c&&(c.autoplay=!b.f.isPaused()),a?yield b.f.load(a):b.a.a||(yield cV(b.a,c)))}}catch(d){b.g.error("Error while trying to cast",d),c=new _.D(_.q,{detail:d}),b.trigger(c)}})}ge(){this.a&&this.a.ge()}lg(a){const b=this;return _.x(function*(){a!==b.h&&(b.h=a,b.a&&(yield aV(b.a)),b.a=nV(b))})}sendMessage(a){const b=this;return _.x(function*(){b.a?
47
+ isLive:r,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Ae:b.f.getPresentationStartTime(),Ob:h,audioMimeType:k,fb:l}}var c=d}yield mV(b);b.a&&(c&&(c.autoplay=!b.f.isPaused()),a?yield b.f.load(a):b.a.a||(yield cV(b.a,c)))}}catch(d){b.g.error("Error while trying to cast",d),c=new _.C(_.q,{detail:d}),b.trigger(c)}})}ge(){this.a&&this.a.ge()}lg(a){const b=this;return _.x(function*(){a!==b.h&&(b.h=a,b.a&&(yield aV(b.a)),b.a=nV(b))})}sendMessage(a){const b=this;return _.x(function*(){b.a?
48
48
  yield b.a.sendMessage(IU,a):b.g.warn(EU)})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(EU)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(EU)}vb(){return this.a&&this.a.vb()}uc(a){this.a&&this.a.uc(a)}be(){this.a&&this.a.be()}He(a){this.a&&this.a.He(a)}Fe(a){this.a&&this.a.Fe(a)}Ee(a){this.a&&this.a.Ee(a)}Ge(a){this.a&&this.a.Ge(a)}};_.z(FU,QV);QV.prototype.setContentReleaseDate=QV.prototype.Ge;QV.prototype.setContentArtist=QV.prototype.Ee;
49
49
  QV.prototype.setContentImage=QV.prototype.Fe;QV.prototype.setContentTitle=QV.prototype.He;QV.prototype.clearContentMetadata=QV.prototype.be;QV.prototype.setContentMetadata=QV.prototype.uc;QV.prototype.getContentMetadata=QV.prototype.vb;QV.prototype.removeMessageListener=QV.prototype.removeMessageListener;QV.prototype.addMessageListener=QV.prototype.addMessageListener;QV.prototype.sendMessage=QV.prototype.sendMessage;QV.prototype.changeReceiverId=QV.prototype.lg;QV.prototype.forceDisconnect=QV.prototype.ge;
50
50
  QV.prototype.cast=QV.prototype.cast;QV.prototype.setPlayerConfigInterceptor=QV.prototype.sd;QV.prototype.getReceiverName=QV.prototype.je;QV.prototype.isCasting=QV.prototype.Bb;QV.prototype.canCast=QV.prototype.Zd;QV.prototype.destroy=QV.prototype.destroy;var RV=class extends NV{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.Z.bind(this);this.w=this.Y.bind(this);this.K=this.X.bind(this);this.J=this.T.bind(this);this.M=this.da.bind(this);this.G=this.aa.bind(this);this.F=this.W.bind(this);this.f=this.N.bind(this)}init(){const a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,
51
51
  this.H);b.addEventListener(a.MEDIA_FINISHED,this.A);b.addEventListener(a.BUFFERING,this.w);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.M);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.F);b.addEventListener(a.BITRATE_CHANGED,this.f)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.x(function*(){const c=cast.framework.events.EventType,d=cast.framework.CastReceiverContext.getInstance().getPlayerManager();
52
- d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.M);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.D(_.Qe));this.a(_.Un)}R(){this.a(_.Tn)}Z(){this.a(_.Jn)}Y(a){a.isBuffering?
53
- this.a(_.Mn):(a=this.player.isPaused()?_.Tn:_.Un,this.a(a))}X(){this.j=1;this.player.trigger(new _.D(_.bg))}T(){this.player.trigger(new _.D(_.ag))}da(){this.j=2}aa(){this.a(_.Sn)}N(a){const b=this.player.getStats();this.player.trigger(new _.D(_.Mc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}W(a){a=new _.H(_.E,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.D(_.q,{detail:a}));this.a(_.Qn)}};var Z=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.j=typeof c===_.t?c:1;this.l=typeof d===_.t?d:1;this.h=typeof e===_.t?e:0}Gb(){return"Google Cast Framework"}Hb(){return cast.framework.VERSION}Mb(){return 0}getId(){return""}getCreativeId(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getSkipTimeOffset(){return this.a.whenSkippable||0}pc(){return!1}Xb(){return this.a.clickThroughUrl||
52
+ d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.M);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.C(_.Qe));this.a(_.Un)}R(){this.a(_.Tn)}Z(){this.a(_.Jn)}Y(a){a.isBuffering?
53
+ this.a(_.Mn):(a=this.player.isPaused()?_.Tn:_.Un,this.a(a))}X(){this.j=1;this.player.trigger(new _.C(_.bg))}T(){this.player.trigger(new _.C(_.ag))}da(){this.j=2}aa(){this.a(_.Sn)}N(a){const b=this.player.getStats();this.player.trigger(new _.C(_.Mc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}W(a){a=new _.H(_.E,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.C(_.q,{detail:a}));this.a(_.Qn)}};var Z=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.j=typeof c===_.t?c:1;this.l=typeof d===_.t?d:1;this.h=typeof e===_.t?e:0}Gb(){return"Google Cast Framework"}Hb(){return cast.framework.VERSION}Mb(){return 0}getId(){return""}getCreativeId(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getSkipTimeOffset(){return this.a.whenSkippable||0}pc(){return!1}Xb(){return this.a.clickThroughUrl||
54
54
  null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}Kb(){return 0}Jb(){return 0}yb(){return 0}lb(){switch(this.Yb()){case 0:return 0;case -1:return 2;default:return 1}}getPodIndex(){return this.h}Yb(){return this.f.position}Zb(){return this.j}Lb(){return this.l}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}};Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;
55
55
  Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.Lb;Z.prototype.getPositionInSequence=Z.prototype.Zb;Z.prototype.getPodTimeOffset=Z.prototype.Yb;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.lb;Z.prototype.getMediaBitrate=Z.prototype.yb;Z.prototype.getMediaHeight=Z.prototype.Jb;Z.prototype.getMediaWidth=Z.prototype.Kb;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.Xb;
56
56
  Z.prototype.isBumper=Z.prototype.pc;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.Mb;
57
57
  Z.prototype.getAdManagerVersion=Z.prototype.Hb;Z.prototype.getAdManagerName=Z.prototype.Gb;var SV=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}$b(){return!!this.a.find(a=>0===a.position)}Ab(){return!!this.a.find(a=>-1===a.position)}};SV.prototype.hasPostroll=SV.prototype.Ab;SV.prototype.hasPreroll=SV.prototype.$b;SV.prototype.getCuePoints=SV.prototype.getCuePoints;var TV=class{constructor(a){this.m=a;this.a=null;this.h=this.j.bind(this);this.f=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];sV().addEventListener(this.f,
58
58
  this.h)}load(){const a=this;return _.x(function*(){oV&&(oV=!1,rV(a,0))})}start(){return _.x(function*(){sV().play()})}resume(){-1!==this.getPosition()&&sV().play()}pause(){-1!==this.getPosition()&&sV().pause()}skip(){}getVolume(){return this.m.getVolume()||0}setVolume(a){this.m.setVolume(a)}getPosition(){const a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.t?a:-1}dispose(){const a=this;return _.x(function*(){sV().removeEventListener(a.f,a.h)})}j(a){const b=cast.framework.events.EndedReason;
59
- switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=sV().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.D(_.tc,{adsTimeline:new SV(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:uV(this,_.ic,a);break;case cast.framework.events.EventType.BREAK_STARTED:uV(this,_.bc,a);break;case cast.framework.events.EventType.BREAK_ENDED:uV(this,_.cc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:uV(this,_.pc,a);
59
+ switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=sV().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.C(_.tc,{adsTimeline:new SV(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:uV(this,_.ic,a);break;case cast.framework.events.EventType.BREAK_STARTED:uV(this,_.bc,a);break;case cast.framework.events.EventType.BREAK_ENDED:uV(this,_.cc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:uV(this,_.pc,a);
60
60
  break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(uV(this,_.oc,a),uV(this,_.qc,a)):a.endedReason===b.STOPPED?uV(this,_.qc,a):a.endedReason===b.END_OF_STREAM?(uV(this,_.fc,a),uV(this,_.qc,a)):a.endedReason===b.ERROR&&rV(this,1);break;case cast.framework.events.EventType.PLAYING:uV(this,_.nc,a);break;case cast.framework.events.EventType.PAUSE:uV(this,_.lc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?uV(this,_.dc,a):uV(this,_.nc,a)}}};
61
61
  TV.prototype.getPosition=TV.prototype.getPosition;TV.prototype.setVolume=TV.prototype.setVolume;TV.prototype.getVolume=TV.prototype.getVolume;TV.prototype.skip=TV.prototype.skip;TV.prototype.pause=TV.prototype.pause;TV.prototype.resume=TV.prototype.resume;var oV=!1;var UV=class{constructor(a){this.dc=a;this.a=this.f.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(vV(),this.a)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(vV(),this.a)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>wV(a))}f(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=
62
- _.qh;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.sh;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.th}b&&this.dc(new _.D(b,{detail:wV(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.dc(new _.D(_.qh,{detail:b}))}};var VV=class extends _.T{constructor(){super();this.g=new _.S("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.w.bind(this);this.a=this.f=null}initialize(a){this.m=a;xV().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}release(){this.h=[];this.j=[];this.a=this.f=null}load(){}destroy(){this.m=null;xV().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}ma(){return this.j}oa(){return null}Xa(){const a=
62
+ _.qh;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.sh;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.th}b&&this.dc(new _.C(b,{detail:wV(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.dc(new _.C(_.qh,{detail:b}))}};var VV=class extends _.T{constructor(){super();this.g=new _.S("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.w.bind(this);this.a=this.f=null}initialize(a){this.m=a;xV().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}release(){this.h=[];this.j=[];this.a=this.f=null}load(){}destroy(){this.m=null;xV().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}ma(){return this.j}oa(){return null}Xa(){const a=
63
63
  this.na();return a&&a.renditions[0]}Pa(){const a=this.za();return a&&a.renditions[0]}kb(){return null}wb(){return null}xb(){return null}Ra(){return null}na(){let a=null;if(this.f){let b=this.f.getActiveId();typeof b===_.t&&(b=b.toString(),a=this.getAudioTracks().find(c=>c.id===b)||null)}return a}za(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.t&&(b=b.toString(),a=this.ma().find(c=>c.id===b)||null)}return a}sb(){this.g.warn("Video tracks unavailable on Cast")}Da(a){a&&this.f&&
64
64
  this.f.setActiveById(+a.id)}Ta(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}gb(){this.g.warn("Video renditions unavailable on Cast")}qb(a){this.Da(a&&a.track)}rb(a){this.Ta(a&&a.track)}addTextTrack(a){const b=this;return _.x(function*(){var c=b.m.getConfiguration();if((c=yield OU(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c))&&b.a){const d=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);d.isInband=!1;d.language=
65
65
  c.language;d.name=c.label;d.subtype=c.kind;d.trackContentId=c.url;d.trackContentType=c.mimeType;d.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([d]),zV(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}ua(){return!0}w(){this.f=xV().getAudioTracksManager();var a=this.f.getTracks();this.h=yV(_.L,a);zV(this);a=this.m.getConfiguration();AV(this,_.L,a.preferredAudioLanguage,a.preferredAudioRole);AV(this,_.K,a.preferredTextLanguage,a.preferredTextRole)}};VV.prototype.isAbrEnabled=VV.prototype.ua;
@@ -71,7 +71,7 @@ BV().getDurationSec();return typeof a===_.t?-1===a?Infinity:a:-1}getPlaybackRate
71
71
  null}getLoadedSource(){const a=BV().getMediaInformation();if(a){var b=BV().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,Lh:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return BV().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=BV().getLiveSeekableRange();
72
72
  b&&typeof b.start===_.t&&typeof b.end===_.t&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():_.mt}getStats(){var a=_.En();if(this.f){a=BV().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.o=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.w=a.width||NaN;b.h=c;b=this.f;c=typeof a.decodedFrames===_.t?a.decodedFrames:NaN;b.l=typeof a.droppedFrames===_.t?a.droppedFrames:NaN;b.j=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=
73
73
  this;return _.x(function*(){b.f=new _.kt;b.a.l=b.f.a;b.A=_.Xn(a);b.h=_.Sk(b.w,a);if(b.D)b.D=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.t&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:MU(b.h),local:!0};yield BV().load(d)}})}getBufferInfo(){this.g.warn(_.qa);return new _.Rs}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.C}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.pb)}appendLoad(){return Promise.reject(_.pb)}seekWith(){return Promise.reject(_.pb)}setNetworkEngine(a){this.F=
74
- a}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return GU}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}resetAbr(){this.g.warn(CU)}onError(a){a=new _.D(_.q,{detail:a});this.trigger(a)}canPlay(){return _.ck()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=MU(this.getStats());var b=BV(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.t&&c.startAbsoluteTime!==
74
+ a}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return GU}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}resetAbr(){this.g.warn(CU)}onError(a){a=new _.C(_.q,{detail:a});this.trigger(a)}canPlay(){return _.ck()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=MU(this.getStats());var b=BV(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.t&&c.startAbsoluteTime!==
75
75
  b&&(this.g.info("Syncing startAbsoluteTime."+`Old value: ${c.startAbsoluteTime}, `+`new value: ${b}`),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));{c=cast.framework.messages.StreamType;b=a.media;var d=!!b;const e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&(!e||e&&f)){d=BV().getStartAbsoluteTime();if(typeof d===_.t){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;
76
76
  a=Object.assign({},a,{media:b})}}return a}G(a,b){let c=null;a.media.customData&&(c=NU(a.media.customData.playerConfiguration));(a=c?c.abr:null)&&typeof a.defaultBandwidthEstimate===_.t?b.initialBandwidth=a.defaultBandwidthEstimate:b.initialBandwidth=void 0;EV(c,b);return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};WV.prototype.getTextDisplayer=WV.prototype.getTextDisplayer;WV.prototype.getNetworkEngine=WV.prototype.getNetworkEngine;
77
77
  WV.prototype.setNetworkEngine=WV.prototype.setNetworkEngine;var GV=class{constructor(){this.a=!1;this.g=new _.S(HU);this.f=this.m=null;this.h=new Set;this.A=this.G.bind(this);this.w=this.C.bind(this);this.j=null;this.o=new _.ds;this.l=null}init(a){a&&(this.f=new WV,_.ap(a,this.f),this.m=a,this.o.on(window,"unload",()=>{const b=this;return _.x(function*(){b.m&&b.m.getState()!==_.Rn&&(yield LU(b.m))})}))}start(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=IV(),b=IV().getPlayerManager(),c=new cast.framework.CastReceiverOptions;
@@ -85,5 +85,5 @@ d.url,c.media.contentType=d.type,d.Ob&&(c.media.hlsVideoSegmentFormat=PU(d.Ob,_.
85
85
  c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.t||typeof c!==_.t||typeof d!==_.t||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.t&&b>=a&&b<=c&&this.m.seek(b))}_.np(this.m)}}C(a){if(0<this.h.size){const b=NU(a.data);this.h.forEach(c=>c(b))}}};_.z(HU,GV);GV.prototype.getContentMetadata=GV.prototype.vb;GV.prototype.isApiReady=GV.prototype.oc;GV.prototype.sendMessage=GV.prototype.sendMessage;GV.prototype.removeMessageListener=GV.prototype.removeMessageListener;
86
86
  GV.prototype.addMessageListener=GV.prototype.addMessageListener;GV.prototype.off=GV.prototype.off;GV.prototype.on=GV.prototype.on;GV.prototype.setLoadRequestDataInterceptor=GV.prototype.mh;GV.prototype.setPlayerConfigInterceptor=GV.prototype.sd;GV.prototype.stop=GV.prototype.stop;GV.prototype.start=GV.prototype.start;GV.prototype.init=GV.prototype.init;GV.getInstance=HV;var FV=null;var XV=class{constructor(a){this.f=a;this.a=null;this.h=new _.ds;this.j=[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]}load(){const a=this;return _.x(function*(){a.a=a.f.l;if(a.a){const b=a.a.controller,c=a.l.bind(a);for(const d of a.j)a.h.on(b,d,c)}})}start(){return _.x(function*(){})}resume(){this.a&&
87
87
  this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()}pause(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.f.a;a&&this.f.sendMessage(KU,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})}getVolume(){return this.f.getVolume()||0}setVolume(a){this.f.setVolume(a)}getPosition(){let a=-1;var b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.t&&(a=b));return a}dispose(){const a=this;
88
- return _.x(function*(){a.h.release()})}l(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.D(_.tc,{adsTimeline:new SV(a.breaks)})));break;case "isPlayingBreak":a.value?MV(this,_.bc):(MV(this,_.fc),MV(this,_.qc),MV(this,_.cc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(MV(this,_.fc),MV(this,_.qc)),MV(this,_.pc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?MV(this,_.lc):MV(this,_.nc))}}};XV.prototype.getPosition=XV.prototype.getPosition;
88
+ return _.x(function*(){a.h.release()})}l(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.C(_.tc,{adsTimeline:new SV(a.breaks)})));break;case "isPlayingBreak":a.value?MV(this,_.bc):(MV(this,_.fc),MV(this,_.qc),MV(this,_.cc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(MV(this,_.fc),MV(this,_.qc)),MV(this,_.pc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?MV(this,_.lc):MV(this,_.nc))}}};XV.prototype.getPosition=XV.prototype.getPosition;
89
89
  XV.prototype.setVolume=XV.prototype.setVolume;XV.prototype.getVolume=XV.prototype.getVolume;XV.prototype.skip=XV.prototype.skip;XV.prototype.pause=XV.prototype.pause;XV.prototype.resume=XV.prototype.resume;var YV=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}isSupported(a,b){return a.namespace()!==_.jd?!1:!(!b||!b.ima)}create(a){return new XV(a.a)}};YV.prototype.create=YV.prototype.create;YV.prototype.isSupported=YV.prototype.isSupported;YV.prototype.name=YV.prototype.name;_.mo(new YV);var ZV=class{name(){return"clpp.cast.ads.AdsManagerFactory"}isSupported(a,b){return HV().oc()?!(!b||!b.ima):!1}create(a){return new TV(a)}};ZV.prototype.create=ZV.prototype.create;ZV.prototype.isSupported=ZV.prototype.isSupported;ZV.prototype.name=ZV.prototype.name;_.mo(new ZV);};f.call(g, window);
package/cl.conviva.js CHANGED
@@ -24,4 +24,4 @@ a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){const b={};
24
24
  var b=a.ad;a=0===b.lb();const c=eU(b.getPodIndex());oU(this)||nU(this)||!a||pU(this);if(oU(this)){a=0===b.Mb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;let d=0;const e={};1===b.Lb()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.R;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.ck()?b.CONTENT:b.SEPARATE;this.a.reportAdBreakStarted(a,b,e);this.C=!0}else this.g.debug("Bug: should already have a valid session")}T(){this.g.debug(bU);
25
25
  oU(this)&&this.C&&(this.a.reportAdBreakEnded(),this.C=!1,this.J&&rU(this))}N(a){this.g.debug(_.Ee);if(this.o&&this.I)this.g.debug("Session ended in VPF; ignoring subsequent errors");else{var b=a.detail||null,c=b&&b.message||"Player error",d=Conviva.Constants.ErrorSeverity.WARNING;b&&b.severity&&b.severity===_.E&&(d=Conviva.Constants.ErrorSeverity.FATAL,oU(this)||pU(this));oU(this)?(this.g.debug("Report error",c,d),this.a.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.g.debug("Video Playback Failure"),
26
26
  this.I=!0,rU(this))):this.j.push({vf:this.N.bind(this),args:a})}}da(){this.g.debug("onAutoPlayBlocked()");oU(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,oU(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))}};var xU=class{constructor(){this.h=this.f=null;this.a=!1;this.g=new _.S("clpp.conviva")}onPlayerCreated(a){this.f=new wU(a,this.g)}onContentWillLoad(a,b){sU(this,a);if(this.a){var c=a.getConfiguration();c=_.Mg(c.conviva||{});try{tU(c);const d=c.enableAdInsights||!1;this.f.initialize(a,c,b);d&&(this.h=new vU(a,()=>this.f.a),this.h.initialize(c))}catch(d){d instanceof _.H?this.W(a,d):this.W(a,new _.H(1,9,9002,d,d))}}}onContentLoaded(){this.a&&qU(this.f)}onPlayerWillDestroy(){this.a&&(this.a=!1,this.f.destroy(),
27
- this.f=null,this.h&&(this.h.destroy(),this.h=null))}onPlayerWillRelease(){this.a&&(this.f.release(),this.h&&this.h.release())}id(){return"conviva"}W(a,b){a.trigger(new _.D(_.q,{detail:b}))}reportAppEvent(a,b){return this.f?this.f.reportAppEvent(a,b):!1}};_.z("clpp.conviva.ConvivaPlugin",xU);xU.prototype.reportAppEvent=xU.prototype.reportAppEvent;xU.Id="conviva";_.Wo(new class{create(){return new xU}});};f.call(g, window);
27
+ this.f=null,this.h&&(this.h.destroy(),this.h=null))}onPlayerWillRelease(){this.a&&(this.f.release(),this.h&&this.h.release())}id(){return"conviva"}W(a,b){a.trigger(new _.C(_.q,{detail:b}))}reportAppEvent(a,b){return this.f?this.f.reportAppEvent(a,b):!1}};_.z("clpp.conviva.ConvivaPlugin",xU);xU.prototype.reportAppEvent=xU.prototype.reportAppEvent;xU.Id="conviva";_.Wo(new class{create(){return new xU}});};f.call(g, window);