@castlabs/prestoplay 6.25.2-beta.7 → 6.25.2

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +105 -105
  6. package/cjs/cl.conviva.js +31 -31
  7. package/cjs/cl.core.js +329 -329
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +88 -88
  10. package/cjs/cl.externs.js +31 -31
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +291 -289
  18. package/cjs/cl.muxdata.js +9 -9
  19. package/cjs/cl.persistent.js +10 -10
  20. package/cjs/cl.playlist.js +4 -4
  21. package/cjs/cl.sessions.js +8 -8
  22. package/cjs/cl.simid.js +4 -4
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +11 -11
  25. package/cjs/cl.tizen.js +69 -69
  26. package/cjs/cl.ttml.js +3 -3
  27. package/cjs/cl.verimatrix.js +2 -2
  28. package/cjs/cl.vimond.js +8 -8
  29. package/cjs/cl.vr.js +7 -7
  30. package/cjs/cl.vtt.js +2 -2
  31. package/cjs/cl.yospace.js +2 -2
  32. package/cjs/cl.youbora.js +17 -17
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +5 -5
  36. package/cl.cast.js +84 -84
  37. package/cl.conviva.js +26 -26
  38. package/cl.core.js +178 -178
  39. package/cl.crypto.js +8 -8
  40. package/cl.dash.js +82 -82
  41. package/cl.externs.js +31 -31
  42. package/cl.freewheel.js +19 -19
  43. package/cl.hls.js +80 -80
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +17 -18
  47. package/cl.mediatailor.js +3 -3
  48. package/cl.mse.js +243 -243
  49. package/cl.muxdata.js +6 -6
  50. package/cl.persistent.js +2 -2
  51. package/cl.playlist.js +4 -4
  52. package/cl.sessions.js +2 -2
  53. package/cl.simid.js +1 -1
  54. package/cl.smooth.js +60 -60
  55. package/cl.thumbnails.js +9 -9
  56. package/cl.tizen.js +54 -54
  57. package/cl.ttml.js +2 -2
  58. package/cl.verimatrix.js +1 -1
  59. package/cl.vimond.js +3 -3
  60. package/cl.vr.js +2 -2
  61. package/cl.vtt.js +2 -2
  62. package/cl.yospace.js +2 -2
  63. package/cl.youbora.js +12 -12
  64. package/package.json +1 -1
  65. package/typings.d.ts +9 -0
package/cjs/cl.youbora.js CHANGED
@@ -3,40 +3,40 @@ var f=function(window){var Nw='" event to NPAW',Ow='" event to Youbora',Pw='Repo
3
3
  "PlayReady":a.startsWith(_.$e)?"ClearKey":a.startsWith(_.Bd)?"Primetime":a},dx=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ex=function(a,b,c,d){b=dx(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.ie;b.severity===_.O?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,
4
4
  b.message,b.metadata),c.debug(Pw+a+'" to Youbora',b.code,b));return b},fx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.gi;d.g=new _.J("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(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();if(c&&(c=c.ma())){var d=
5
5
  c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),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.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
6
- b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.La())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.2-beta.7-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.bg,this.K.bind(this)),this.a.on(this.m,_.ie,this.H.bind(this)),
7
- this.a.on(this.m,_.Cg,this.J.bind(this)),this.a.on(this.m,_.Bg,this.I.bind(this)),this.a.on(this.m,_.Cc,this.C.bind(this)),this.a.on(this.m,_.ed,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Rb);_.ki(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.sq()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",
8
- c);if(c)switch(c.currentState){case _.Fq:this.w()&&this.f();break;case _.Hq:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Gq:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.tq:this.fireBufferEnd();this.fireStop();break;case _.Aq:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.yq:this.fireBufferBegin();break;default:this.g.debug(Qw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=
6
+ b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.La())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.2-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.bg,this.K.bind(this)),this.a.on(this.m,_.ie,this.H.bind(this)),this.a.on(this.m,
7
+ _.Cg,this.J.bind(this)),this.a.on(this.m,_.Bg,this.I.bind(this)),this.a.on(this.m,_.Cc,this.C.bind(this)),this.a.on(this.m,_.ed,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Rb);_.ki(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.sq()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);
8
+ if(c)switch(c.currentState){case _.Fq:this.w()&&this.f();break;case _.Hq:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Gq:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.tq:this.fireBufferEnd();this.fireStop();break;case _.Aq:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.yq:this.fireBufferBegin();break;default:this.g.debug(Qw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=
9
9
  !1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=cx(c.keySystem))&&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=ex(c,this.m,this.g,this))&&c.severity===_.O&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.Uf),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.Tf);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",
10
- c);this.o=(c=c.adsTimeline)&&c.Pb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Pw+c+Ow].concat(_.gh(e)))};return new b(a)},gx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.gi;d.g=new _.J("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=
10
+ c);this.o=(c=c.adsTimeline)&&c.Qb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Pw+c+Ow].concat(_.gh(e)))};return new b(a)},gx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.gi;d.g=new _.J("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=
11
11
  function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.ob(),this.a.nb(),this.a.Ua()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ua()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();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=
12
12
  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.Va()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();
13
13
  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.pb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=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()};
14
- b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(ax,c);return c};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.2-beta.7-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Cc,this.T.bind(this)),this.f.on(this.m,_.yc,this.P.bind(this)),this.f.on(this.m,_.tc,this.K.bind(this)),
14
+ b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(ax,c);return c};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.2-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Cc,this.T.bind(this)),this.f.on(this.m,_.xc,this.P.bind(this)),this.f.on(this.m,_.tc,this.K.bind(this)),
15
15
  this.f.on(this.m,_.vc,this.L.bind(this)),this.f.on(this.m,_.lc,this.I.bind(this)),this.f.on(this.m,_.mc,this.o.bind(this,1)),this.f.on(this.m,_.sc,this.o.bind(this,2)),this.f.on(this.m,_.Ac,this.o.bind(this,3)),this.f.on(this.m,_.kc,this.H.bind(this)),this.f.on(this.m,_.wc,this.N.bind(this)),this.f.on(this.m,_.ie,this.J.bind(this)),this.f.on(this.m,_.hc,this.B.bind(this)),this.f.on(this.m,_.ic,this.C.bind(this)),this.f.on(this.m,_.jc,this.G.bind(this)),this.f.on(this.m,_.uc,this.w.bind(this)))};b.prototype.unregisterListeners=
16
16
  function(){_.ki(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.T=function(c){this.g.debug(Ww,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=
17
- !0;this.h(Uw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Tw),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");var c=this.a&&this.a.yb();this.g.debug(Vw,c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Sw,this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();
17
+ !0;this.h(Uw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Tw),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");var c=this.a&&this.a.zb();this.g.debug(Vw,c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Sw,this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();
18
18
  if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ex(c,this.m,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Pw+c+Ow].concat(_.gh(e)))};return new b(a)},ix=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.B=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);
19
19
  a.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.ma())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=
20
- function(){var b=this.player.getLoadedSource();return b&&b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.getPlaybackRate()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.La())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-adapter-6.25.2-beta.7-js"};
20
+ function(){var b=this.player.getLoadedSource();return b&&b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.getPlaybackRate()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.La())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-adapter-6.25.2-js"};
21
21
  a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.bg,this.K.bind(this)),b.on(this.player,_.ie,this.H.bind(this)),b.on(this.player,_.Uf,this.J.bind(this)),b.on(this.player,_.Tf,this.I.bind(this)),b.on(this.player,_.Cc,this.C.bind(this)),b.on(this.player,_.ed,this.G.bind(this)))};a.prototype.unregisterListeners=function(){hx.debug(_.Rb);_.ki(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
22
22
  this.B=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.sq()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.K=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case _.Fq:this.o()&&this.fireStart();break;case _.Hq:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.Gq:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.tq:this.fireBufferEnd();
23
23
  this.fireStop();break;case _.Aq:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.yq:this.fireBufferBegin();break;default:hx.debug(Qw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.H=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ex(b,this.player,hx,this))&&b.severity===_.O&&(this.f=!0)};a.prototype.J=function(){this.player.isEnded()||(this.l(_.Uf),this.fireSeekBegin())};a.prototype.w=function(){this.a||(this.a=new _.gi);
24
- return this.a};a.prototype.I=function(){this.l(_.Tf);this.fireSeekEnd()};a.prototype.C=function(b){hx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Pb()};a.prototype.G=function(b){hx.debug("Casting",b);this.fireCasted()};a.prototype.l=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];hx.debug.apply(hx,[Pw+b+Nw].concat(_.gh(d)))};return a},kx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||this;b.a=null;b.l=null;b.h=null;b.j=null;b.C=!1;b.o=!1;return b}
24
+ return this.a};a.prototype.I=function(){this.l(_.Tf);this.fireSeekEnd()};a.prototype.C=function(b){hx.debug("adsTimeline",b);this.h=(b=b.adsTimeline)&&b.Qb()};a.prototype.G=function(b){hx.debug("Casting",b);this.fireCasted()};a.prototype.l=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];hx.debug.apply(hx,[Pw+b+Nw].concat(_.gh(d)))};return a},kx=function(){function a(){var b=NpawPluginAdapters.ads.Ima.call(this)||this;b.a=null;b.l=null;b.h=null;b.j=null;b.C=!1;b.o=!1;return b}
25
25
  _.w(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this.a?this.a.getDuration():null};a.prototype.getRendition=function(){var b=null;this.a&&(b=this.getNpawUtils().buildRenditionString(this.a.ob(),this.a.nb(),this.a.Ua()));return b};a.prototype.getBitrate=function(){var b=null;this.a&&(b=this.a.Ua());return b};a.prototype.getPlayhead=function(){var b=null,c=this.player.getAdsManager();c&&(b=c.getPosition());return b};a.prototype.getResource=function(){var b=null;this.a&&(b=
26
26
  this.a.getMediaUrl());return b};a.prototype.getTitle=function(){var b=null;this.a&&(b=this.a.getTitle());return b};a.prototype.getProvider=function(){var b=null;this.a&&(b=this.a.getAdvertiserName());return b};a.prototype.getCreativeId=function(){var b=null;this.a&&(b=this.a.getCreativeId());return b};a.prototype.dispose=function(){this.unregisterListeners();this.C=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,c=null;if(this.a)switch(this.a.Va()){case 0:c=
27
27
  b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}jx.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=function(){return this.a&&this.a.pb()};
28
28
  a.prototype.getGivenAds=function(){return this.getExpectedAds()};a.prototype.getBreaksTime=function(){var b=this;return this.h&&this.h.getCuePoints().map(function(c){return-1===c?b.player.getDuration():c})};a.prototype.getIsFullscreen=function(){return this.player.getSurface().isFullscreen()};a.prototype.getIsVisible=function(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);jx.debug(ax,b);return b};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=
29
- function(){return"castlabs-ads-adapter-6.25.2-beta.7-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.gi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Cc,this.ca.bind(this)),b.on(this.player,_.yc,this.Y.bind(this)),b.on(this.player,_.tc,this.N.bind(this)),b.on(this.player,_.vc,this.P.bind(this)),b.on(this.player,_.lc,this.K.bind(this)),b.on(this.player,_.mc,this.w.bind(this,1)),b.on(this.player,
29
+ function(){return"castlabs-ads-adapter-6.25.2-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.gi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Cc,this.ca.bind(this)),b.on(this.player,_.xc,this.Y.bind(this)),b.on(this.player,_.tc,this.N.bind(this)),b.on(this.player,_.vc,this.P.bind(this)),b.on(this.player,_.lc,this.K.bind(this)),b.on(this.player,_.mc,this.w.bind(this,1)),b.on(this.player,
30
30
  _.sc,this.w.bind(this,2)),b.on(this.player,_.Ac,this.w.bind(this,3)),b.on(this.player,_.kc,this.J.bind(this)),b.on(this.player,_.wc,this.T.bind(this)),b.on(this.player,_.ie,this.L.bind(this)),b.on(this.player,_.hc,this.G.bind(this)),b.on(this.player,_.ic,this.H.bind(this)),b.on(this.player,_.jc,this.I.bind(this)),b.on(this.player,_.uc,this.da.bind(this)))};a.prototype.unregisterListeners=function(){_.ki(this.B())};a.prototype.ca=function(b){jx.debug(Ww,b);this.h=b.adsTimeline};a.prototype.Y=function(b){this.a=
31
31
  b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.N=function(){this.f("ad pause");this.A();this.firePause()};a.prototype.P=function(){this.f("ad resume");this.A();this.fireResume()};a.prototype.I=function(){this.o=!0;this.f(Uw);this.fireBufferBegin()};a.prototype.da=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&(this.f(Tw),this.o=!1,this.fireBufferEnd())};a.prototype.w=
32
- function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.yb();jx.debug(Vw,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Sw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})};
33
- a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ex(b,this.player,jx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];jx.debug.apply(jx,[Pw+b+Nw].concat(_.gh(d)))};return a},lx=function(){this.a=null;this.g=new _.J(Xw);this.m=null},mx=function(a,b){if(b.namespace()===_.sd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().youbora;return _.L.jg(c)?c.accountCode?_.L.R(window.NpawPlugin)||_.L.R(window.NpawPluginAdapters)?
34
- (a.g.warn("NPAW SDK not found."),b.onError(new _.N(1,9,9100)),!1):!0:(a.g.warn(Rw),b.onError(new _.N(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},nx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ox=function(){this.a=null;this.g=new _.J(Yw);this.m=null},px=function(a,b){if(b.namespace()===_.sd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.L.jg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
35
- !1;if(!c.accountCode)return a.g.warn(Rw),b.onError(new _.N(1,9,9101)),!1;if(_.L.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.N(1,9,9102)));return!0},qx=function(){};var hx=new _.J("clpp.npaw.NpawAdapter");var jx=new _.J("clpp.npaw.NpawAdsAdapter");_.w(lx,_.bw);_.r=lx.prototype;_.r.Mg=function(a){nx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ix()),this.a.registerAdsAdapterFromClass(this.m,kx())};_.r.Tl=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;mx(this,a)&&(a=a.getConfiguration().youbora,this.Mg(new NpawPlugin(a.accountCode)))};
36
- _.r.onContentWillLoad=function(a,b){if(mx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Zw]&&(d[Zw]=b.isLive);void 0===d[$w]&&(d[$w]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Mg(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=cx(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Te,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
37
- _.r.onPlayerWillDestroy=function(){nx(this);this.a.destroy()};_.r.id=function(){return bx};_.I(Xw,lx);lx.prototype.getAdsAdapter=lx.prototype.getAdsAdapter;lx.prototype.getAdapter=lx.prototype.getAdapter;lx.prototype.getNpawPlugin=lx.prototype.Tl;lx.prototype.setNpawPlugin=lx.prototype.Mg;lx.Id=bx;new _.J(Xw);_.w(ox,_.bw);_.r=ox.prototype;_.r.Ng=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(fx(this.m)),this.a.setAdsAdapter(gx(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;px(this,a)&&(a=a.getConfiguration().youbora,this.Ng(new youbora.Plugin(a)))};
38
- _.r.onContentWillLoad=function(a,b){if(px(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Zw]&&(d[Zw]=b.isLive);void 0===d[$w]&&(d[$w]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Ng(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return bx};_.I(Yw,ox);ox.prototype.getAdsAdapter=ox.prototype.getAdsAdapter;ox.prototype.getAdapter=ox.prototype.getAdapter;
39
- ox.prototype.setYouboraPlugin=ox.prototype.Ng;ox.Id=bx;qx.prototype.create=function(a){return a.youbora&&a.youbora.v7?new lx:new ox};_.Yt(new qx);};
32
+ function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.zb();jx.debug(Vw,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Sw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&this.fireStop({adPlayhead:this.l})};
33
+ a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ex(b,this.player,jx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];jx.debug.apply(jx,[Pw+b+Nw].concat(_.gh(d)))};return a},lx=function(){this.a=null;this.g=new _.J(Xw);this.m=null},mx=function(a,b){if(b.namespace()===_.sd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().youbora;return _.L.mg(c)?c.accountCode?_.L.R(window.NpawPlugin)||_.L.R(window.NpawPluginAdapters)?
34
+ (a.g.warn("NPAW SDK not found."),b.onError(new _.N(1,9,9100)),!1):!0:(a.g.warn(Rw),b.onError(new _.N(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},nx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ox=function(){this.a=null;this.g=new _.J(Yw);this.m=null},px=function(a,b){if(b.namespace()===_.sd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.L.mg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
35
+ !1;if(!c.accountCode)return a.g.warn(Rw),b.onError(new _.N(1,9,9101)),!1;if(_.L.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.N(1,9,9102)));return!0},qx=function(){};var hx=new _.J("clpp.npaw.NpawAdapter");var jx=new _.J("clpp.npaw.NpawAdsAdapter");_.w(lx,_.bw);_.r=lx.prototype;_.r.Ng=function(a){nx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ix()),this.a.registerAdsAdapterFromClass(this.m,kx())};_.r.Yl=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;mx(this,a)&&(a=a.getConfiguration().youbora,this.Ng(new NpawPlugin(a.accountCode)))};
36
+ _.r.onContentWillLoad=function(a,b){if(mx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Zw]&&(d[Zw]=b.isLive);void 0===d[$w]&&(d[$w]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Ng(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=cx(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.Te,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
37
+ _.r.onPlayerWillDestroy=function(){nx(this);this.a.destroy()};_.r.id=function(){return bx};_.I(Xw,lx);lx.prototype.getAdsAdapter=lx.prototype.getAdsAdapter;lx.prototype.getAdapter=lx.prototype.getAdapter;lx.prototype.getNpawPlugin=lx.prototype.Yl;lx.prototype.setNpawPlugin=lx.prototype.Ng;lx.Id=bx;new _.J(Xw);_.w(ox,_.bw);_.r=ox.prototype;_.r.Og=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(fx(this.m)),this.a.setAdsAdapter(gx(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;px(this,a)&&(a=a.getConfiguration().youbora,this.Og(new youbora.Plugin(a)))};
38
+ _.r.onContentWillLoad=function(a,b){if(px(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Zw]&&(d[Zw]=b.isLive);void 0===d[$w]&&(d[$w]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Og(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return bx};_.I(Yw,ox);ox.prototype.getAdsAdapter=ox.prototype.getAdsAdapter;ox.prototype.getAdapter=ox.prototype.getAdapter;
39
+ ox.prototype.setYouboraPlugin=ox.prototype.Og;ox.Id=bx;qx.prototype.create=function(a){return a.youbora&&a.youbora.v7?new lx:new ox};_.Yt(new qx);};
40
40
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
41
41
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
42
42
  else{_=this.clpp._;(f.call(g,this));}
package/cl.adobe.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var qX=function(a){a.f=new _.Nt;a.f.on(a.m,_.jg,()=>oX(a));a.f.on(a.m,_.ig,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.me,()=>pX(a));a.f.on(a.m,_.Kf,b=>{b=b.detail;switch(b.currentState){case _.Wo:a.a.length||pX(a);s.Media.play(a.a,a.m.getPosition());break;case _.Vo:case _.Po:oX(a);break;case _.Lo:case _.To:case _.Mo:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),oX(a),s.Media.close(a.a),a.a=""}})},oX=function(a){s.Media.stop(a.a,a.m.getPosition())},
2
- pX=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.qa)},rX=class extends _.Pv{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.S("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,qX(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&
3
- (this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.z("clpp.adobe.AdobeAnalyticsPlugin",rX);rX.Id="adobe";_.Ir(new class{create(){return new rX}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var rX=function(a){a.f=new _.Nt;a.f.on(a.m,_.jg,()=>pX(a));a.f.on(a.m,_.ig,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.me,()=>qX(a));a.f.on(a.m,_.Kf,b=>{b=b.detail;switch(b.currentState){case _.Wo:a.a.length||qX(a);s.Media.play(a.a,a.m.getPosition());break;case _.Vo:case _.Po:pX(a);break;case _.Lo:case _.To:case _.Mo:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),pX(a),s.Media.close(a.a),a.a=""}})},pX=function(a){s.Media.stop(a.a,a.m.getPosition())},
2
+ qX=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.qa)},sX=class extends _.Pv{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.S("clpp.adobe.AdobePlugin")}onPlayerCreated(a){var b=a.getConfiguration().adobe;(b=!b||!1!==b.enabled)?window.s&&s.Media?(this.m=a,rX(this)):this.g.warn("Adobe API not available."):this.g.debug("Adobe plugin is disabled.")}onPlayerWillDestroy(){this.f&&
3
+ (this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};_.z("clpp.adobe.AdobeAnalyticsPlugin",sX);sX.Id="adobe";_.Ir(new class{create(){return new sX}});};f.call(g, window);
package/cl.airplay.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var nX=class extends _.Pv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Ht(()=>{this.m.play().catch(()=>{})});this.h=new _.Nt}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 _.F(_.rc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.qc:_.pc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Wo)this.l?this.m.play().catch(()=>{}):this.o.ka(.01);this.m.trigger(new _.F(a))}Lb(){return this.j}te(){return this.f}Ai(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",nX);nX.prototype.showCastMenu=nX.prototype.Ai;
3
- nX.prototype.canCast=nX.prototype.te;nX.prototype.isCasting=nX.prototype.Lb;nX.Id="airplay";_.Ir(new class{create(){return new nX}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var oX=class extends _.Pv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Ht(()=>{this.m.play().catch(()=>{})});this.h=new _.Nt}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 _.F(_.rc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.qc:_.pc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Wo)this.l?this.m.play().catch(()=>{}):this.o.ka(.01);this.m.trigger(new _.F(a))}Mb(){return this.j}we(){return this.f}Ci(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",oX);oX.prototype.showCastMenu=oX.prototype.Ci;
3
+ oX.prototype.canCast=oX.prototype.we;oX.prototype.isCasting=oX.prototype.Mb;oX.Id="airplay";_.Ir(new class{create(){return new oX}});};f.call(g, window);
package/cl.broadpeak.js CHANGED
@@ -1,5 +1,5 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var gX=function(){return!window.SmartLib||!window.GenericPlayerApi},hX=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Nf&&a.h.setUUID(b))},jX=function(a,b){b=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const c in b)a.a.setCustomParameter(c,b[c]);a.o.on(a.m,_.q,a.w.bind(a));a.l=iX(a.m);
2
- a.a.attachPlayer(a.l)},kX=function(a,b){_.Dh(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},lX=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Nt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Kf,this.o.bind(this));b.on(a,_.Kc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.t&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.Po&&c.notifyStallEnd(!b.isPaused());
3
- switch(d){case _.Po:c.notifyStallStart();break;case _.Wo:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Vo:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Dh(this.a),this.a=null)}};var iX=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.Tk()}getPlayerName(){return _.qa}getVersion(){return _.ea}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var mX=class extends _.Pv{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.Nt;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(gX())return a.onError(new _.I(1,9,11E3));this.j=!0;hX(this,c);jX(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));kX(this,void 0)}else b.url=d.getURL(),
4
- this.f=new lX(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}w(a){a=a.detail;if(7003===a.code)kX(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:kX(this,SmartLib.BPDecodingError);break;case 1:kX(this,SmartLib.BPNetworkingError);break;case 6:kX(this,SmartLib.BPAccessRightError);break;default:kX(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){gX()||kX(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
5
- _.z("clpp.broadpeak.BroadpeakPlugin",mX);mX.isSdkMissing=gX;mX.Id="broadpeak";_.Ir(new class{create(){return new mX}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var hX=function(){return!window.SmartLib||!window.GenericPlayerApi},iX=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Nf&&a.h.setUUID(b))},kX=function(a,b){b=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const c in b)a.a.setCustomParameter(c,b[c]);a.o.on(a.m,_.q,a.w.bind(a));a.l=jX(a.m);
2
+ a.a.attachPlayer(a.l)},lX=function(a,b){_.Dh(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},mX=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Nt;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Kf,this.o.bind(this));b.on(a,_.Kc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.t&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.Po&&c.notifyStallEnd(!b.isPaused());
3
+ switch(d){case _.Po:c.notifyStallStart();break;case _.Wo:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Vo:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Dh(this.a),this.a=null)}};var jX=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.Tk()}getPlayerName(){return _.qa}getVersion(){return _.ea}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var nX=class extends _.Pv{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.Nt;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(hX())return a.onError(new _.I(1,9,11E3));this.j=!0;iX(this,c);kX(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.I(1,9,11001,{bpkErrorCode:e,message:d}));lX(this,void 0)}else b.url=d.getURL(),
4
+ this.f=new mX(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}w(a){a=a.detail;if(7003===a.code)lX(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:lX(this,SmartLib.BPDecodingError);break;case 1:lX(this,SmartLib.BPNetworkingError);break;case 6:lX(this,SmartLib.BPAccessRightError);break;default:lX(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){hX()||lX(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
5
+ _.z("clpp.broadpeak.BroadpeakPlugin",nX);nX.isSdkMissing=hX;nX.Id="broadpeak";_.Ir(new class{create(){return new nX}});};f.call(g, window);
package/cl.cast.js CHANGED
@@ -1,90 +1,90 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var GV="Cannot seek during ads playout.",HV="Cannot switch track",IV="Media session does not exist.",JV="No receivers available",KV="Reset ABR functionality not available on cast.",LV="SDK not yet ready",MV="Sender is destroyed.",NV="clpp.cast.CastProxy",OV="clpp.cast.Player",PV="clpp.cast.Receiver",QV="urn:x-cast:castlabs",RV="urn:x-cast:com.google.cast.media",SV=function(a){return _.x(function*(){yield _.Nr(a,_.He);yield _.Nr(a,_.Ge)})},TV=function(a){return JSON.stringify(a,(b,c)=>
2
- {if("license"!==b&&typeof c!==_.Yd){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.Ce?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.t?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},UV=function(a){if(typeof a!==_.Nf)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},VV=function(a,b,c,d){return _.x(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=
3
- null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.dk(d,a.mimeType,g);f&&g&&(h=_.mj(a.url),(h=yield c.fetch(h).T)&&h.data&&(e=f.a(_.K(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},WV=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
- d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.pg:return d.FMP4;case _.og:return b===_.N?d.MPEG2_TS:c.TS;case _.Cc:return c.AAC;case _.Dc:return c.AC3;case _.Ec:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Fc:return c.FMP4}},YV=function(a){a=void 0===a?XV:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.I(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;
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}},ZV=function(a,b){return a.h.filter(c=>c.type===b)},aW=function(a,b){const c=$V(a);return ZV(a,b).find(d=>c.includes(d.id))||null},cW=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.L){const e=a.wa();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);
6
- d.editTracksInfo(c,()=>{a.f[b]=null;bW(a,b)},e=>{a.f[b]=null;a.g.debug(HV,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{bW(a,b)},e=>{a.g.debug(HV,e)}))},$V=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(b=>b.toString())},bW=function(a,b){b===_.M?a.a.trigger(new _.F(_.Ic)):b===_.L&&a.a.trigger(new _.F(_.Uf))},fW=function(a){if(a)for(const b of dW)eW(b)},eW=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&
7
- cast.framework&&cast.framework.CastContext&&a.S.length){a.w=!0;a.o.jf();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);gW&&a.o.ka(.02)}},hW=function(a){return _.x(function*(){dW.delete(a);if(a.w){a.w=!1;var b=
8
- cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}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.R=null;a.X=null})},iW=function(a){return _.x(function*(){a.Lb()||(yield cast.framework.CastContext.getInstance().requestSession())})},kW=function(a,b,c){c=
9
- void 0===c?0:c;return _.x(function*(){var d=a.f.wa();d&&d.language&&(a.h.preferredTextLanguage=d.language);(d=a.f.qa())&&d.language&&(a.h.preferredAudioLanguage=d.language);yield jW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Te:a.getPresentationStartTime(),autoplay:b,ib:a.h})})},jW=function(a,b){return _.x(function*(){var c=chrome.cast.media.StreamType;yield iW(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
10
- b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=WV(b.Yb,_.N);e.hlsSegmentFormat=WV(c,_.M);b.ib&&(a.L&&(c=yield Promise.resolve(a.L(b.ib)))&&(b.ib=c),a.h=b.ib,a.C=_.Zo(a.h),a.B=a.C.findIndex(k=>k.url===b.source.url),b.ib.remoteTextTracks&&(c=yield Promise.all(b.ib.remoteTextTracks.map(a.za.bind(a))),e.tracks=c.filter(k=>k),b.ib.remoteTextTracks=void 0),delete b.ib.autoplay,b.ib.startTime=null,e.customData={playerConfiguration:TV(b.ib)});c=a.Db()||{};
11
- var f=lW(c.metadataType),g;typeof b.Te===_.t&&(g={metadataType:f,sectionStartAbsoluteTime:b.Te});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=mW(c);if(g=nW(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);typeof b.autoplay===_.Lc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.t&&(e.currentTime=b.currentTime);yield d.loadMedia(e)}})},nW=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(oW);for(const d of c){const [e,f]=d;
12
- if(f===b){b=e;break a}}b=null}if(!b)return null;b=YV(oW[b]);return Object.assign(b,a)},lW=function(a){var b=void 0===b?XV:b;return Object.values(oW).includes(a)?a:b},mW=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},qW=function(a,b){pW(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.V);b.addMessageListener(QV,a.P)},rW=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},pW=function(a,b){a.a=b;a.a&&(a.G.release(),a.F=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.F=new cast.framework.RemotePlayerController(a.l),a.G.on(a.F,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.ia.bind(a)),a.G.on(a.F,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.bb.bind(a)),a.j&&a.j.init(),a.trigger(new _.F(_.me)))},uW=function(a){return new sW(a.h,()=>{a.trigger(new _.F(_.Rc))},(b,c)=>{{const d=a.f.getConfiguration();
14
- d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Bf&&(d.preferredAudioLanguage=c.Bf);c.Cg&&(d.preferredTextLanguage=c.Cg);_.Pr(a.f,null);a.trigger(new _.F("castingended"));a.j(b,d)}},()=>tW(a))},tW=function(a){return _.x(function*(){a.trigger(new _.F(_.Qc));a.f.a!==a.a&&a.f&&a.a&&(yield a.f.release(),_.Pr(a.f,a.a))})},xW=function(a,b,c){return _.x(function*(){var d=b.adTagUrl;if(d)try{vW=!1;const e=
15
- _.mj(d),f=yield c.fetch(e).T;if(f&&f.data){const g=_.Ui(f.data),h=(new DOMParser).parseFromString(g,_.Tf);if(h.getElementsByTagName("vmap:VMAP").length)_.C("VMAP detected."),a.vmapAdsRequest=wW(g);else if(h.getElementsByTagName("VAST").length){_.C("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=wW(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else _.C("Unsupported schema."),vW=!0}}catch(e){_.C("Failed to fetch an ad",
16
- e),vW=!0}})},wW=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},yW=function(a,b){b=new _.I(1,10,10003,{errorType:b});a.m.onError(b)},zW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},BW=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=AW(a,c))&&(d={ad:c});a.m.trigger(new _.F(b,d))}},AW=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=
17
- null,e=null,f;typeof b.breakClipId===_.Nf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Nf&&(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},CW=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,
18
- cast.framework.events.EventType.TIMED_METADATA_EXIT]},DW=function(a){const b=a.dashTimedMetadata;let c=_.hg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.gg)?_.Ph:_.eg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},EW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},GW=function(a){a.a=EW().getTextTracksManager();const b=a.a.getTracks();a.j=FW(_.L,b)},FW=function(a,b){const c=[];for(const d of b)b=
19
- new _.Ij(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||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 _.Qj(b.id,b)),c.push(b);return c},HW=function(a,b,c,d){c=_.$h(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.ma());if(c=c.find(g=>{const h=
20
- _.Bi(g);return f.some(k=>{k=_.Bi(k.language||"");return _.Ci(h,k)})})){const g=_.Bi(c);c=f.filter(h=>{h=_.Bi(h.language||"");return _.Ci(g,h)});f=c.length?c:f;e=e||!!c.length}_.cj(d)&&(c=f.filter(g=>g.roles.includes(d)),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.M?a.xa(e):b===_.L&&a.Sa(e))},IW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},LW=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;
21
- b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.Tl(d);if(e){var f=[_.rd];_.Zo(a)[0].type!==_.yc&&f.unshift(_.td);d.preferredDrmSystem===_.rd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Ia[g];h?(c=g===_.td?cast.framework.ContentProtection.WIDEVINE:g===_.rd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},JW(b,h,a,c),KW(b,h,a,c)):c()}else c()}else c()},JW=
22
- function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=e=>{const f=_.mj({method:_.cb,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},KW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.x(function*(){const g=_.qj(Object.assign({},f.headers),
23
- e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.K(g.data)}):a.licenseHandler=void 0},OW=function(){return MW||(MW=new NW)},PW=function(){return cast.framework.CastReceiverContext.getInstance()},QW=function(){const a=PW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},RW=function(a,b){const c=PW().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,PW().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},
24
- TW=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=PW();var {hlsVideoSegmentFormat:d}=PW().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.pg:_.og;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=SW(f,_.oa),h=SW(f,_.kb);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);
25
- ++e}return d.join("\n")},SW=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},VW=function(a,b){let c=null;const d=UW(a);d&&(c={ad:d});a.f.trigger(new _.F(b,c))},UW=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;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=
26
- 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},WW=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.h=_.To;this.o=_.hv;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(_.To)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var HV="Cannot seek during ads playout.",IV="Cannot switch track",JV="Media session does not exist.",KV="No receivers available",LV="Reset ABR functionality not available on cast.",MV="SDK not yet ready",NV="Sender is destroyed.",OV="clpp.cast.CastProxy",PV="clpp.cast.Player",QV="clpp.cast.Receiver",RV="urn:x-cast:castlabs",SV="urn:x-cast:com.google.cast.media",TV=function(a){return _.x(function*(){yield _.Nr(a,_.He);yield _.Nr(a,_.Ge)})},UV=function(a){return JSON.stringify(a,(b,c)=>
2
+ {if("license"!==b&&typeof c!==_.Yd){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.Ce?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.t?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},VV=function(a){if(typeof a!==_.Nf)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},WV=function(a,b,c,d){return _.x(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=
3
+ null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.dk(d,a.mimeType,g);f&&g&&(h=_.mj(a.url),(h=yield c.fetch(h).T)&&h.data&&(e=f.a(_.K(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},XV=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
+ d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.pg:return d.FMP4;case _.og:return b===_.N?d.MPEG2_TS:c.TS;case _.Ac:return c.AAC;case _.Dc:return c.AC3;case _.Ec:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Fc:return c.FMP4}},ZV=function(a){a=void 0===a?YV:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.I(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;
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}},$V=function(a,b){return a.h.filter(c=>c.type===b)},bW=function(a,b){const c=aW(a);return $V(a,b).find(d=>c.includes(d.id))||null},dW=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.L){const e=a.wa();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);
6
+ d.editTracksInfo(c,()=>{a.f[b]=null;cW(a,b)},e=>{a.f[b]=null;a.g.debug(IV,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{cW(a,b)},e=>{a.g.debug(IV,e)}))},aW=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(b=>b.toString())},cW=function(a,b){b===_.M?a.a.trigger(new _.F(_.Ic)):b===_.L&&a.a.trigger(new _.F(_.Uf))},gW=function(a){if(a)for(const b of eW)fW(b)},fW=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&
7
+ cast.framework&&cast.framework.CastContext&&a.S.length){a.w=!0;a.o.kf();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);hW&&a.o.ka(.02)}},iW=function(a){return _.x(function*(){eW.delete(a);if(a.w){a.w=!1;var b=
8
+ cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}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.R=null;a.X=null})},jW=function(a){return _.x(function*(){a.Mb()||(yield cast.framework.CastContext.getInstance().requestSession())})},lW=function(a,b,c){c=
9
+ void 0===c?0:c;return _.x(function*(){var d=a.f.wa();d&&d.language&&(a.h.preferredTextLanguage=d.language);(d=a.f.qa())&&d.language&&(a.h.preferredAudioLanguage=d.language);yield kW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Ve:a.getPresentationStartTime(),autoplay:b,ib:a.h})})},kW=function(a,b){return _.x(function*(){var c=chrome.cast.media.StreamType;yield jW(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
10
+ b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=XV(b.Zb,_.N);e.hlsSegmentFormat=XV(c,_.M);b.ib&&(a.L&&(c=yield Promise.resolve(a.L(b.ib)))&&(b.ib=c),a.h=b.ib,a.C=_.Zo(a.h),a.B=a.C.findIndex(k=>k.url===b.source.url),b.ib.remoteTextTracks&&(c=yield Promise.all(b.ib.remoteTextTracks.map(a.za.bind(a))),e.tracks=c.filter(k=>k),b.ib.remoteTextTracks=void 0),delete b.ib.autoplay,b.ib.startTime=null,e.customData={playerConfiguration:UV(b.ib)});c=a.Eb()||{};
11
+ var f=mW(c.metadataType),g;typeof b.Ve===_.t&&(g={metadataType:f,sectionStartAbsoluteTime:b.Ve});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=nW(c);if(g=oW(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);typeof b.autoplay===_.Lc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.t&&(e.currentTime=b.currentTime);yield d.loadMedia(e)}})},oW=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(pW);for(const d of c){const [e,f]=d;
12
+ if(f===b){b=e;break a}}b=null}if(!b)return null;b=ZV(pW[b]);return Object.assign(b,a)},mW=function(a){var b=void 0===b?YV:b;return Object.values(pW).includes(a)?a:b},nW=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},rW=function(a,b){qW(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.V);b.addMessageListener(RV,a.P)},sW=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},qW=function(a,b){a.a=b;a.a&&(a.G.release(),a.F=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.F=new cast.framework.RemotePlayerController(a.l),a.G.on(a.F,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.ia.bind(a)),a.G.on(a.F,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.bb.bind(a)),a.j&&a.j.init(),a.trigger(new _.F(_.me)))},vW=function(a){return new tW(a.h,()=>{a.trigger(new _.F(_.Rc))},(b,c)=>{{const d=a.f.getConfiguration();
14
+ d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Ef&&(d.preferredAudioLanguage=c.Ef);c.Fg&&(d.preferredTextLanguage=c.Fg);_.Pr(a.f,null);a.trigger(new _.F("castingended"));a.j(b,d)}},()=>uW(a))},uW=function(a){return _.x(function*(){a.trigger(new _.F(_.Qc));a.f.a!==a.a&&a.f&&a.a&&(yield a.f.release(),_.Pr(a.f,a.a))})},yW=function(a,b,c){return _.x(function*(){var d=b.adTagUrl;if(d)try{wW=!1;const e=
15
+ _.mj(d),f=yield c.fetch(e).T;if(f&&f.data){const g=_.Ui(f.data),h=(new DOMParser).parseFromString(g,_.Tf);if(h.getElementsByTagName("vmap:VMAP").length)_.C("VMAP detected."),a.vmapAdsRequest=xW(g);else if(h.getElementsByTagName("VAST").length){_.C("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=xW(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else _.C("Unsupported schema."),wW=!0}}catch(e){_.C("Failed to fetch an ad",
16
+ e),wW=!0}})},xW=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},zW=function(a,b){b=new _.I(1,10,10003,{errorType:b});a.m.onError(b)},AW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},CW=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=BW(a,c))&&(d={ad:c});a.m.trigger(new _.F(b,d))}},BW=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=
17
+ null,e=null,f;typeof b.breakClipId===_.Nf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Nf&&(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},DW=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,
18
+ cast.framework.events.EventType.TIMED_METADATA_EXIT]},EW=function(a){const b=a.dashTimedMetadata;let c=_.hg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.gg)?_.Ph:_.eg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},FW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},HW=function(a){a.a=FW().getTextTracksManager();const b=a.a.getTracks();a.j=GW(_.L,b)},GW=function(a,b){const c=[];for(const d of b)b=
19
+ new _.Ij(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||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 _.Qj(b.id,b)),c.push(b);return c},IW=function(a,b,c,d){c=_.$h(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.ma());if(c=c.find(g=>{const h=
20
+ _.Bi(g);return f.some(k=>{k=_.Bi(k.language||"");return _.Ci(h,k)})})){const g=_.Bi(c);c=f.filter(h=>{h=_.Bi(h.language||"");return _.Ci(g,h)});f=c.length?c:f;e=e||!!c.length}_.cj(d)&&(c=f.filter(g=>g.roles.includes(d)),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.M?a.xa(e):b===_.L&&a.Sa(e))},JW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},MW=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;
21
+ b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.Tl(d);if(e){var f=[_.rd];_.Zo(a)[0].type!==_.yc&&f.unshift(_.td);d.preferredDrmSystem===_.rd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Ia[g];h?(c=g===_.td?cast.framework.ContentProtection.WIDEVINE:g===_.rd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},KW(b,h,a,c),LW(b,h,a,c)):c()}else c()}else c()},KW=
22
+ function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=e=>{const f=_.mj({method:_.cb,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},LW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.x(function*(){const g=_.qj(Object.assign({},f.headers),
23
+ e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.K(g.data)}):a.licenseHandler=void 0},PW=function(){return NW||(NW=new OW)},QW=function(){return cast.framework.CastReceiverContext.getInstance()},RW=function(){const a=QW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},SW=function(a,b){const c=QW().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,QW().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},
24
+ UW=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=QW();var {hlsVideoSegmentFormat:d}=QW().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.pg:_.og;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=TW(f,_.oa),h=TW(f,_.kb);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);
25
+ ++e}return d.join("\n")},TW=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},WW=function(a,b){let c=null;const d=VW(a);d&&(c={ad:d});a.f.trigger(new _.F(b,c))},VW=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;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=
26
+ 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},XW=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.h=_.To;this.o=_.hv;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(_.To)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===
27
27
  _.G&&this.a(_.Mo)}a(a){if(a!==this.h)if(this.h===_.Mo&&a!==_.To)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===_.Po?(this.B=b,this.player.trigger(new _.F(_.Nc,{detail:{bufferedTimeMS:-1,reason:this.j}}))):this.o===_.Po&&this.player.trigger(new _.F(_.Mc,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.h,previousState:this.o,timeSinceLastStateChangeMS:b-this.C};this.C=b;this.l&&_.Eo(this.l,this.h);this.player.trigger(new _.F(_.Kf,
28
- {detail:a}))}}};_.z("clpp.cast.CastUtils",class{});var XV=0,oW={GENERIC:XV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};var XW=class extends WW{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.Ub.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)}Ub(){if(this.f&&
29
- 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(_.Lo);break;case chrome.cast.media.IdleReason.ERROR:this.a(_.Mo);break;default:this.a(_.To)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(_.Wo);break;case chrome.cast.media.PlayerState.PAUSED:this.a(_.Vo);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(_.Po)}}};var YW=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=_.N;break;case chrome.cast.media.TrackType.AUDIO:c=_.M;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.Ij(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
30
- 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 _.Qj(c.id,c));return c}):[],this.a.trigger(new _.F(_.$f)))}destroy(){this.a=null}getVideoTracks(){return ZV(this,_.N)}getAudioTracks(){return ZV(this,_.M)}ma(){return ZV(this,_.L)}na(){const a=this.Ea();return a?a.renditions[0]:null}Ma(){const a=this.qa();return a?a.renditions[0]:null}Qa(){const a=this.wa();return a?a.renditions[0]:
31
- null}rb(){return this.f[_.N]||null}Eb(){return this.f[_.M]||null}Fb(){return this.f[_.L]||null}Ea(){return aW(this,_.N)}qa(){return aW(this,_.M)}wa(){return aW(this,_.L)}zb(a){cW(this,_.N,a)}xa(a){cW(this,_.M,a)}Sa(a){cW(this,_.L,a)}jb(a){this.zb(a&&a.track)}xb(a){this.xa(a&&a.track)}yb(a){this.Sa(a&&a.track)}addTextTrack(){return _.x(function*(){})}ta(){return!0}};YW.prototype.isAbrEnabled=YW.prototype.ta;YW.prototype.addTextTrack=YW.prototype.addTextTrack;YW.prototype.setTextRendition=YW.prototype.yb;
32
- YW.prototype.setAudioRendition=YW.prototype.xb;YW.prototype.setVideoRendition=YW.prototype.jb;YW.prototype.setTextTrack=YW.prototype.Sa;YW.prototype.setAudioTrack=YW.prototype.xa;YW.prototype.setVideoTrack=YW.prototype.zb;YW.prototype.getTextTrack=YW.prototype.wa;YW.prototype.getAudioTrack=YW.prototype.qa;YW.prototype.getVideoTrack=YW.prototype.Ea;YW.prototype.getLoadingTextRendition=YW.prototype.Fb;YW.prototype.getLoadingAudioRendition=YW.prototype.Eb;YW.prototype.getLoadingVideoRendition=YW.prototype.rb;
33
- YW.prototype.getTextRendition=YW.prototype.Qa;YW.prototype.getAudioRendition=YW.prototype.Ma;YW.prototype.getVideoRendition=YW.prototype.na;YW.prototype.getTextTracks=YW.prototype.ma;YW.prototype.getAudioTracks=YW.prototype.getAudioTracks;YW.prototype.getVideoTracks=YW.prototype.getVideoTracks;var sW=class extends _.su{constructor(a,b,c,d){super();this.g=new _.S(_.dd);this.S=a;this.o=new _.rk(b);this.R=c;this.X=d;this.h=this.I=_.rl();this.C=[];this.B=0;this.K=new _.zr;this.F=this.l=this.a=null;this.A=this.w=!1;this.ba="";this.fa=1E6;this.f=new YW;this.f.initialize(this);this.j=new XW(this);this.G=new _.Nt;this.J=null;this.H=new Set;this.M=this.Ja.bind(this);this.da=this.Cb.bind(this);this.V=this.Bb.bind(this);this.P=this.Ua.bind(this);this.L=null;window.cast||Object.defineProperty(window,
34
- "cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{fW(!0)},0)}});eW(this);dW.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(_.Za)}appendLoad(){return Promise.reject(_.Za)}seekWith(){return Promise.reject(_.Za)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.x(function*(){})}Bd(a){this.L=
35
- a}wc(){return this.w}Lb(){return this.A}Be(){return this.ba}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,TV(b))}catch(f){d=new _.I(1,8,8E3,{detailedErrorCode:f})}else d=new _.I(1,8,8004,void 0);if(d)c.onError(d)})}cast(){const a=this;return _.x(function*(){if(!a.wc())throw a.g.warn(LV),new _.I(1,8,8001,void 0);if(!gW)throw a.g.warn(JV),new _.I(1,8,8002,void 0);if(a.Lb())throw a.g.warn("Already casting"),
36
- new _.I(1,8,8003,void 0);try{yield iW(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 _.I(1,8,8E3,c);}})}Ae(){this.Lb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Yd&&this.H.add(a)}removeMessageListener(a){typeof a===_.Yd&&this.H.delete(a)}play(){return this.isEnded()?kW(this,!0):new Promise((a,b)=>{if(!this.a)return b(IV);this.a.play(null,
37
- a,b)})}pause(){return new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(IV);this.a.pause(null,a,b)})}isPaused(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED}isEnded(){return this.getState()===_.Lo}seek(a){return this.isEnded()?kW(this,!1,a):new Promise((b,c)=>{this.a||c(IV);this.l.isPlayingBreak&&c(GV);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.F(_.jg));this.a.seek(d,()=>{this.trigger(new _.F(_.ig));b()},c)})}getPosition(){return this.getMediaPosition()}getMediaPosition(){return this.a&&
38
- 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(RV,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.a&&
28
+ {detail:a}))}}};_.z("clpp.cast.CastUtils",class{});var YV=0,pW={GENERIC:YV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};var YW=class extends XW{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.Vb.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)}Vb(){if(this.f&&
29
+ 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(_.Lo);break;case chrome.cast.media.IdleReason.ERROR:this.a(_.Mo);break;default:this.a(_.To)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(_.Wo);break;case chrome.cast.media.PlayerState.PAUSED:this.a(_.Vo);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(_.Po)}}};var ZW=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=_.N;break;case chrome.cast.media.TrackType.AUDIO:c=_.M;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.Ij(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
30
+ 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 _.Qj(c.id,c));return c}):[],this.a.trigger(new _.F(_.$f)))}destroy(){this.a=null}getVideoTracks(){return $V(this,_.N)}getAudioTracks(){return $V(this,_.M)}ma(){return $V(this,_.L)}na(){const a=this.Ea();return a?a.renditions[0]:null}Ma(){const a=this.qa();return a?a.renditions[0]:null}Qa(){const a=this.wa();return a?a.renditions[0]:
31
+ null}rb(){return this.f[_.N]||null}Fb(){return this.f[_.M]||null}Gb(){return this.f[_.L]||null}Ea(){return bW(this,_.N)}qa(){return bW(this,_.M)}wa(){return bW(this,_.L)}Ab(a){dW(this,_.N,a)}xa(a){dW(this,_.M,a)}Sa(a){dW(this,_.L,a)}jb(a){this.Ab(a&&a.track)}yb(a){this.xa(a&&a.track)}zb(a){this.Sa(a&&a.track)}addTextTrack(){return _.x(function*(){})}ta(){return!0}};ZW.prototype.isAbrEnabled=ZW.prototype.ta;ZW.prototype.addTextTrack=ZW.prototype.addTextTrack;ZW.prototype.setTextRendition=ZW.prototype.zb;
32
+ ZW.prototype.setAudioRendition=ZW.prototype.yb;ZW.prototype.setVideoRendition=ZW.prototype.jb;ZW.prototype.setTextTrack=ZW.prototype.Sa;ZW.prototype.setAudioTrack=ZW.prototype.xa;ZW.prototype.setVideoTrack=ZW.prototype.Ab;ZW.prototype.getTextTrack=ZW.prototype.wa;ZW.prototype.getAudioTrack=ZW.prototype.qa;ZW.prototype.getVideoTrack=ZW.prototype.Ea;ZW.prototype.getLoadingTextRendition=ZW.prototype.Gb;ZW.prototype.getLoadingAudioRendition=ZW.prototype.Fb;ZW.prototype.getLoadingVideoRendition=ZW.prototype.rb;
33
+ ZW.prototype.getTextRendition=ZW.prototype.Qa;ZW.prototype.getAudioRendition=ZW.prototype.Ma;ZW.prototype.getVideoRendition=ZW.prototype.na;ZW.prototype.getTextTracks=ZW.prototype.ma;ZW.prototype.getAudioTracks=ZW.prototype.getAudioTracks;ZW.prototype.getVideoTracks=ZW.prototype.getVideoTracks;var tW=class extends _.su{constructor(a,b,c,d){super();this.g=new _.S(_.dd);this.S=a;this.o=new _.rk(b);this.R=c;this.X=d;this.h=this.I=_.rl();this.C=[];this.B=0;this.K=new _.zr;this.F=this.l=this.a=null;this.A=this.w=!1;this.ba="";this.fa=1E6;this.f=new ZW;this.f.initialize(this);this.j=new YW(this);this.G=new _.Nt;this.J=null;this.H=new Set;this.M=this.Ja.bind(this);this.da=this.Db.bind(this);this.V=this.Cb.bind(this);this.P=this.Ua.bind(this);this.L=null;window.cast||Object.defineProperty(window,
34
+ "cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{gW(!0)},0)}});fW(this);eW.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(_.Za)}appendLoad(){return Promise.reject(_.Za)}seekWith(){return Promise.reject(_.Za)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.x(function*(){})}Cd(a){this.L=
35
+ a}xc(){return this.w}Mb(){return this.A}Ee(){return this.ba}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,UV(b))}catch(f){d=new _.I(1,8,8E3,{detailedErrorCode:f})}else d=new _.I(1,8,8004,void 0);if(d)c.onError(d)})}cast(){const a=this;return _.x(function*(){if(!a.xc())throw a.g.warn(MV),new _.I(1,8,8001,void 0);if(!hW)throw a.g.warn(KV),new _.I(1,8,8002,void 0);if(a.Mb())throw a.g.warn("Already casting"),
36
+ new _.I(1,8,8003,void 0);try{yield jW(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 _.I(1,8,8E3,c);}})}De(){this.Mb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Yd&&this.H.add(a)}removeMessageListener(a){typeof a===_.Yd&&this.H.delete(a)}play(){return this.isEnded()?lW(this,!0):new Promise((a,b)=>{if(!this.a)return b(JV);this.a.play(null,
37
+ a,b)})}pause(){return new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(JV);this.a.pause(null,a,b)})}isPaused(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED}isEnded(){return this.getState()===_.Lo}seek(a){return this.isEnded()?lW(this,!1,a):new Promise((b,c)=>{this.a||c(JV);this.l.isPlayingBreak&&c(HV);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.F(_.jg));this.a.seek(d,()=>{this.trigger(new _.F(_.ig));b()},c)})}getPosition(){return this.getMediaPosition()}getMediaPosition(){return this.a&&
38
+ 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(SV,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.a&&
39
39
  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=
40
- {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():_.hv}getStats(){return this.a&&this.a.customData&&this.a.customData.stats?UV(this.a.customData.stats):_.Io()}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.x(function*(){if(b.wc())if(gW){b.C=_.Zo(a);b.h=_.tl(b.I,a);var c=b.C[b.B];yield jW(b,{source:c,
41
- isLive:c.isLive,autoplay:b.h.autoplay,ib:b.h,Yb:c.Yb,audioMimeType:c.audioMimeType})}else b.g.warn(JV);else b.g.warn(LV)})}getBufferInfo(){return new _.ru}getTrackManager(){return this.f}getConfiguration(){return this.h}getSurface(){return null}setNetworkEngine(a){this.K=a}getNetworkEngine(){return this.K}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(KV)}onError(a){if(a&&
42
- (this.trigger(new _.F(_.q,{detail:a})),this.j))this.j.onError(a)}namespace(){return _.dd}canPlay(){return this.wc()?2:0}Db(){return this.J}Xb(a){this.J=nW(a)}we(){this.J=null}df(a){const b=this.Db()||{};a={metadataType:lW(b.metadataType),title:a};this.Xb(Object.assign({},b,a))}bf(a){const b=this.Db()||{},c=lW(b.metadataType);a=new chrome.cast.Image(a);this.Xb(Object.assign({},b,{metadataType:c,images:[a]}))}af(a){const b=this.Db()||{};this.Xb(Object.assign({},b,{metadataType:3,artist:a}))}cf(a){const b=
43
- this.Db()||{};a={metadataType:lW(b.metadataType),releaseDate:a};this.Xb(Object.assign({},b,a))}Ja(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;gW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ba=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.jf()}Cb(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;qW(this,a.session);break;
44
- case cast.framework.SessionState.SESSION_RESUMED:this.Lb()||(this.A=!0,qW(this,a.session),this.X());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Lb()&&this.a){const d=this.a.media;var b=this.f.qa(),c=this.f.wa();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:rW(this),Cg:c,Bf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.V);a.session.removeMessageListener(QV,
45
- this.P);this.A=!1;this.a=null;this.G.release();this.l=this.F=null}}Bb(a){this.g.debug("New media session",a.mediaSession);pW(this,a.mediaSession)}bb(a){a.value&&a.value.tracks&&this.f&&this.f.load()}Ua(a,b){if(a===QV&&0<this.H.size){const c=UV(b);this.H.forEach(d=>d(c))}}ia(){this.trigger(new _.F(_.Zf))}za(a){const b=this;return _.x(function*(){let c=null;const d=yield VV(a,[_.Sf,_.xc],b.K,b.h);d&&(c=new chrome.cast.media.Track(b.fa++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=
46
- d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url});return c})}getTextDisplayer(){return null}},gW=!1,dW=new Set;window.__onGCastApiAvailable=fW;var ZW=class extends _.su{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.Yd?c:this.l;this.a=uW(this);this.g=new _.S(NV);this.f&&this.forwardEventsTo(this.f)}destroy(){const a=this;return _.x(function*(){a.a&&(yield hW(a.a),a.a=null);a.f&&a.stopForwardingEventsTo(a.f)})}l(a,b){this.f&&a!==_.Lo&&a!==_.To&&(delete b.license,this.f.load(b))}te(){return!!this.a&&this.a.wc()&&gW}Lb(){return!!this.a&&this.a.Lb()}Be(){return this.a?this.a.Be():""}Bd(a){this.a&&this.a.Bd(a)}cast(a){const b=
40
+ {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():_.hv}getStats(){return this.a&&this.a.customData&&this.a.customData.stats?VV(this.a.customData.stats):_.Io()}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.x(function*(){if(b.xc())if(hW){b.C=_.Zo(a);b.h=_.tl(b.I,a);var c=b.C[b.B];yield kW(b,{source:c,
41
+ isLive:c.isLive,autoplay:b.h.autoplay,ib:b.h,Zb:c.Zb,audioMimeType:c.audioMimeType})}else b.g.warn(KV);else b.g.warn(MV)})}getBufferInfo(){return new _.ru}getTrackManager(){return this.f}getConfiguration(){return this.h}getSurface(){return null}setNetworkEngine(a){this.K=a}getNetworkEngine(){return this.K}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(LV)}onError(a){if(a&&
42
+ (this.trigger(new _.F(_.q,{detail:a})),this.j))this.j.onError(a)}namespace(){return _.dd}canPlay(){return this.xc()?2:0}Eb(){return this.J}Yb(a){this.J=oW(a)}ze(){this.J=null}ef(a){const b=this.Eb()||{};a={metadataType:mW(b.metadataType),title:a};this.Yb(Object.assign({},b,a))}cf(a){const b=this.Eb()||{},c=mW(b.metadataType);a=new chrome.cast.Image(a);this.Yb(Object.assign({},b,{metadataType:c,images:[a]}))}bf(a){const b=this.Eb()||{};this.Yb(Object.assign({},b,{metadataType:3,artist:a}))}df(a){const b=
43
+ this.Eb()||{};a={metadataType:mW(b.metadataType),releaseDate:a};this.Yb(Object.assign({},b,a))}Ja(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;hW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ba=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.kf()}Db(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;rW(this,a.session);break;
44
+ case cast.framework.SessionState.SESSION_RESUMED:this.Mb()||(this.A=!0,rW(this,a.session),this.X());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Mb()&&this.a){const d=this.a.media;var b=this.f.qa(),c=this.f.wa();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:sW(this),Fg:c,Ef:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.V);a.session.removeMessageListener(RV,
45
+ this.P);this.A=!1;this.a=null;this.G.release();this.l=this.F=null}}Cb(a){this.g.debug("New media session",a.mediaSession);qW(this,a.mediaSession)}bb(a){a.value&&a.value.tracks&&this.f&&this.f.load()}Ua(a,b){if(a===RV&&0<this.H.size){const c=VV(b);this.H.forEach(d=>d(c))}}ia(){this.trigger(new _.F(_.Zf))}za(a){const b=this;return _.x(function*(){let c=null;const d=yield WV(a,[_.Sf,_.xc],b.K,b.h);d&&(c=new chrome.cast.media.Track(b.fa++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=
46
+ d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url});return c})}getTextDisplayer(){return null}},hW=!1,eW=new Set;window.__onGCastApiAvailable=gW;var $W=class extends _.su{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.Yd?c:this.l;this.a=vW(this);this.g=new _.S(OV);this.f&&this.forwardEventsTo(this.f)}destroy(){const a=this;return _.x(function*(){a.a&&(yield iW(a.a),a.a=null);a.f&&a.stopForwardingEventsTo(a.f)})}l(a,b){this.f&&a!==_.Lo&&a!==_.To&&(delete b.license,this.f.load(b))}we(){return!!this.a&&this.a.xc()&&hW}Mb(){return!!this.a&&this.a.Mb()}Ee(){return this.a?this.a.Ee():""}Cd(a){this.a&&this.a.Cd(a)}cast(a){const b=
47
47
  this;return _.x(function*(){if(b.a)try{if(yield b.a.cast(),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.qa();m&&(m.mimeType&&(k=m.mimeType),m.language&&(l.preferredAudioLanguage=m.language),m.roles.length&&(l.preferredAudioRole=m.roles[0]));const n=f.wa();n&&(n.language&&(l.preferredTextLanguage=n.language),n.roles.length&&(l.preferredTextRole=n.roles[0]));const r=
48
- e&&typeof e.isLive===_.Lc?e.isLive:b.f.isLive();d={source:e,isLive:r,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Te:b.f.getPresentationStartTime(),Yb:h,audioMimeType:k,ib:l}}var c=d}yield tW(b);b.a&&(c&&(c.autoplay=!b.f.isPaused()),a?yield b.f.load(a):b.a.a||(yield jW(b.a,c)))}}catch(d){b.g.error("Error while trying to cast",d),c=new _.F(_.q,{detail:d}),b.trigger(c)}})}Ae(){this.a&&this.a.Ae()}fh(a){const b=this;return _.x(function*(){a!==b.h&&(b.h=a,b.a&&(yield hW(b.a)),
49
- b.a=uW(b))})}sendMessage(a){const b=this;return _.x(function*(){b.a?yield b.a.sendMessage(QV,a):b.g.warn(MV)})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(MV)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(MV)}Db(){return this.a&&this.a.Db()}Xb(a){this.a&&this.a.Xb(a)}we(){this.a&&this.a.we()}df(a){this.a&&this.a.df(a)}bf(a){this.a&&this.a.bf(a)}af(a){this.a&&this.a.af(a)}cf(a){this.a&&this.a.cf(a)}};_.z(NV,ZW);
50
- ZW.prototype.setContentReleaseDate=ZW.prototype.cf;ZW.prototype.setContentArtist=ZW.prototype.af;ZW.prototype.setContentImage=ZW.prototype.bf;ZW.prototype.setContentTitle=ZW.prototype.df;ZW.prototype.clearContentMetadata=ZW.prototype.we;ZW.prototype.setContentMetadata=ZW.prototype.Xb;ZW.prototype.getContentMetadata=ZW.prototype.Db;ZW.prototype.removeMessageListener=ZW.prototype.removeMessageListener;ZW.prototype.addMessageListener=ZW.prototype.addMessageListener;ZW.prototype.sendMessage=ZW.prototype.sendMessage;
51
- ZW.prototype.changeReceiverId=ZW.prototype.fh;ZW.prototype.forceDisconnect=ZW.prototype.Ae;ZW.prototype.cast=ZW.prototype.cast;ZW.prototype.setPlayerConfigInterceptor=ZW.prototype.Bd;ZW.prototype.getReceiverName=ZW.prototype.Be;ZW.prototype.isCasting=ZW.prototype.Lb;ZW.prototype.canCast=ZW.prototype.te;ZW.prototype.destroy=ZW.prototype.destroy;var $W=class extends WW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.da.bind(this);this.w=this.ba.bind(this);this.K=this.X.bind(this);this.J=this.V.bind(this);this.L=this.ia.bind(this);this.G=this.fa.bind(this);this.F=this.P.bind(this);this.f=this.M.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,
48
+ e&&typeof e.isLive===_.Lc?e.isLive:b.f.isLive();d={source:e,isLive:r,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Ve:b.f.getPresentationStartTime(),Zb:h,audioMimeType:k,ib:l}}var c=d}yield uW(b);b.a&&(c&&(c.autoplay=!b.f.isPaused()),a?yield b.f.load(a):b.a.a||(yield kW(b.a,c)))}}catch(d){b.g.error("Error while trying to cast",d),c=new _.F(_.q,{detail:d}),b.trigger(c)}})}De(){this.a&&this.a.De()}hh(a){const b=this;return _.x(function*(){a!==b.h&&(b.h=a,b.a&&(yield iW(b.a)),
49
+ b.a=vW(b))})}sendMessage(a){const b=this;return _.x(function*(){b.a?yield b.a.sendMessage(RV,a):b.g.warn(NV)})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(NV)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(NV)}Eb(){return this.a&&this.a.Eb()}Yb(a){this.a&&this.a.Yb(a)}ze(){this.a&&this.a.ze()}ef(a){this.a&&this.a.ef(a)}cf(a){this.a&&this.a.cf(a)}bf(a){this.a&&this.a.bf(a)}df(a){this.a&&this.a.df(a)}};_.z(OV,$W);
50
+ $W.prototype.setContentReleaseDate=$W.prototype.df;$W.prototype.setContentArtist=$W.prototype.bf;$W.prototype.setContentImage=$W.prototype.cf;$W.prototype.setContentTitle=$W.prototype.ef;$W.prototype.clearContentMetadata=$W.prototype.ze;$W.prototype.setContentMetadata=$W.prototype.Yb;$W.prototype.getContentMetadata=$W.prototype.Eb;$W.prototype.removeMessageListener=$W.prototype.removeMessageListener;$W.prototype.addMessageListener=$W.prototype.addMessageListener;$W.prototype.sendMessage=$W.prototype.sendMessage;
51
+ $W.prototype.changeReceiverId=$W.prototype.hh;$W.prototype.forceDisconnect=$W.prototype.De;$W.prototype.cast=$W.prototype.cast;$W.prototype.setPlayerConfigInterceptor=$W.prototype.Cd;$W.prototype.getReceiverName=$W.prototype.Ee;$W.prototype.isCasting=$W.prototype.Mb;$W.prototype.canCast=$W.prototype.we;$W.prototype.destroy=$W.prototype.destroy;var aX=class extends XW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.da.bind(this);this.w=this.ba.bind(this);this.K=this.X.bind(this);this.J=this.V.bind(this);this.L=this.ia.bind(this);this.G=this.fa.bind(this);this.F=this.P.bind(this);this.f=this.M.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,
52
52
  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.L);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();
53
53
  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.L);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 _.F(_.Re));this.a(_.Wo)}R(){this.a(_.Vo)}da(){this.a(_.Lo)}ba(a){a.isBuffering?
54
- this.a(_.Po):(a=this.player.isPaused()?_.Vo:_.Wo,this.a(a))}X(){this.j=1;this.player.trigger(new _.F(_.jg))}V(){this.player.trigger(new _.F(_.ig))}ia(){this.j=2}fa(){this.a(_.Uo)}M(a){const b=this.player.getStats();this.player.trigger(new _.F(_.Kc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.I(_.G,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.F(_.q,{detail:a}));this.a(_.Mo)}};var Z=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.t?c:1;this.h=typeof d===_.t?d:1;this.j=typeof e===_.t?e:0}ob(){return"Google Cast Framework"}pb(){return cast.framework.VERSION}tb(){return 0}getId(){return""}getCreativeId(){return""}Pb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||0}Sb(){return!1}qb(){return this.a.clickThroughUrl||
55
- null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}fb(){return 0}eb(){return 0}Oa(){return 0}Pa(){switch(this.Gb()){case 0:return 0;case -1:return 2;default:return 1}}getPodIndex(){return this.j}Gb(){return this.f.position}sb(){return this.l}gb(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Rb(){return null}};Z.prototype.getVideoElement=Z.prototype.Rb;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
56
- Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.gb;Z.prototype.getPositionInSequence=Z.prototype.sb;Z.prototype.getPodTimeOffset=Z.prototype.Gb;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Pa;Z.prototype.getMediaBitrate=Z.prototype.Oa;Z.prototype.getMediaHeight=Z.prototype.eb;Z.prototype.getMediaWidth=Z.prototype.fb;
57
- Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.qb;Z.prototype.isBumper=Z.prototype.Sb;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;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;
58
- Z.prototype.getSourceId=Z.prototype.Pb;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.tb;Z.prototype.getAdManagerVersion=Z.prototype.pb;Z.prototype.getAdManagerName=Z.prototype.ob;var aX=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Jb(){return!!this.a.find(a=>0===a.position)}Ib(){return!!this.a.find(a=>-1===a.position)}};aX.prototype.hasPostroll=aX.prototype.Ib;aX.prototype.hasPreroll=aX.prototype.Jb;aX.prototype.getCuePoints=aX.prototype.getCuePoints;var bX=class{constructor(a){this.m=a;this.a=null;this.j=this.l.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];zW().addEventListener(this.f,
59
- this.j)}load(){const a=this;return _.x(function*(){vW&&(vW=!1,yW(a,0))})}start(){return _.x(function*(){zW().play()})}w(){}resume(){-1!==this.getPosition()&&zW().play()}pause(){-1!==this.getPosition()&&zW().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}o(){return!0}h(){const a=this;return _.x(function*(){zW().removeEventListener(a.f,a.j)})}l(a){const b=cast.framework.events.EndedReason;
60
- switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=zW().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.F(_.oc,{adsTimeline:new aX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:BW(this,_.ac,a);break;case cast.framework.events.EventType.BREAK_STARTED:BW(this,_.Rb,a);break;case cast.framework.events.EventType.BREAK_ENDED:BW(this,_.Sb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:BW(this,_.kc,a);
61
- break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(BW(this,_.ic,a),BW(this,_.lc,a)):a.endedReason===b.STOPPED?BW(this,_.lc,a):a.endedReason===b.END_OF_STREAM?(BW(this,_.Vb,a),BW(this,_.lc,a)):a.endedReason===b.ERROR&&yW(this,1);break;case cast.framework.events.EventType.PLAYING:BW(this,_.ec,a);break;case cast.framework.events.EventType.PAUSE:BW(this,_.cc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?BW(this,_.Tb,a):BW(this,_.ec,a)}}};
62
- bX.prototype.getPosition=bX.prototype.getPosition;bX.prototype.setVolume=bX.prototype.setVolume;bX.prototype.getVolume=bX.prototype.getVolume;bX.prototype.skip=bX.prototype.skip;bX.prototype.pause=bX.prototype.pause;bX.prototype.resume=bX.prototype.resume;var vW=!1;var cX=class{constructor(a){this.Ta=a;this.a=this.f.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(CW(),this.a)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(CW(),this.a)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>DW(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=
63
- _.Vf;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Wf;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Xf}b&&this.Ta(new _.F(b,{detail:DW(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.Ta(new _.F(_.Vf,{detail:b}))}};var dX=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;EW().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;EW().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}ma(){return this.j}na(){return null}Ma(){const a=
64
- this.qa();return a&&a.renditions[0]}Qa(){const a=this.wa();return a&&a.renditions[0]}rb(){return null}Eb(){return null}Fb(){return null}Ea(){return null}qa(){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}wa(){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}zb(){this.g.warn("Video tracks unavailable on Cast")}xa(a){a&&this.f&&
65
- this.f.setActiveById(+a.id)}Sa(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}jb(){this.g.warn("Video renditions unavailable on Cast")}xb(a){this.xa(a&&a.track)}yb(a){this.Sa(a&&a.track)}addTextTrack(a){const b=this;return _.x(function*(){var c=b.m.getConfiguration();if((c=yield VV(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=
66
- 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]),GW(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}ta(){return!0}w(){this.f=EW().getAudioTracksManager();var a=this.f.getTracks();this.h=FW(_.M,a);GW(this);a=this.m.getConfiguration();HW(this,_.M,a.preferredAudioLanguage,a.preferredAudioRole);HW(this,_.L,a.preferredTextLanguage,a.preferredTextRole)}};dX.prototype.isAbrEnabled=dX.prototype.ta;
67
- dX.prototype.addTextTrack=dX.prototype.addTextTrack;dX.prototype.setTextRendition=dX.prototype.yb;dX.prototype.setAudioRendition=dX.prototype.xb;dX.prototype.setVideoRendition=dX.prototype.jb;dX.prototype.setTextTrack=dX.prototype.Sa;dX.prototype.setAudioTrack=dX.prototype.xa;dX.prototype.setVideoTrack=dX.prototype.zb;dX.prototype.getTextTrack=dX.prototype.wa;dX.prototype.getAudioTrack=dX.prototype.qa;dX.prototype.getVideoTrack=dX.prototype.Ea;dX.prototype.getLoadingTextRendition=dX.prototype.Fb;
68
- dX.prototype.getLoadingAudioRendition=dX.prototype.Eb;dX.prototype.getLoadingVideoRendition=dX.prototype.rb;dX.prototype.getTextRendition=dX.prototype.Qa;dX.prototype.getAudioRendition=dX.prototype.Ma;dX.prototype.getVideoRendition=dX.prototype.na;dX.prototype.getTextTracks=dX.prototype.ma;dX.prototype.getAudioTracks=dX.prototype.getAudioTracks;dX.prototype.getVideoTracks=dX.prototype.getVideoTracks;var eX=class extends _.su{constructor(){super();this.g=new _.S(OV);this.h=this.w=_.rl();this.A=null;this.l=-1;this.F=new _.zr;this.f=this.o=this.j=this.a=this.B=null;this.C=!1}init(a,b){this.B=a;b&&(this.h=this.w=b);a=IW();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new $W(this);this.a.init();this.j=new dX;this.j.initialize(this);this.o=new cX(c=>this.trigger(c));this.o.init()}unload(){const a=
69
- cast.framework.messages.PlayerState,b=IW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.x(function*(){a.B=null;a.w=_.rl();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){const a=IW();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");
70
- a.play();return Promise.resolve()}pause(){const a=IW();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()}isPaused(){return IW().getPlayerState()===cast.framework.messages.PlayerState.PAUSED}isEnded(){return IW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=IW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(GV);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return IW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
71
- IW().getDurationSec();return typeof a===_.t?-1===a?Infinity:a:-1}getPlaybackRate(){return IW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;IW().sendLocalMediaRequest(b)}}getVolume(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null}setVolume(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)}setMuted(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)}isMuted(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||
72
- null}getLoadedSource(){const a=IW().getMediaInformation();if(a){var b=IW().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,Yi:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return IW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=IW().getLiveSeekableRange();
73
- 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():_.hv}getStats(){var a=_.Io();if(this.f){a=IW().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.t?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.t?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=
74
- this;return _.x(function*(){b.f=new _.gv;b.a.l=b.f.a;b.A=_.Zo(a);b.h=_.tl(b.w,a);if(b.C)b.C=!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:TV(b.h),local:!0};yield IW().load(d)}})}getBufferInfo(){this.g.warn(_.pa);return new _.ru}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Za)}appendLoad(){return Promise.reject(_.Za)}seekWith(){return Promise.reject(_.Za)}setNetworkEngine(a){this.F=
75
- a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return OV}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(KV)}onError(a){a=new _.F(_.q,{detail:a});this.trigger(a)}canPlay(){return _.Ek()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=TV(this.getStats());var b=IW(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();
76
- c&&typeof b===_.t&&c.startAbsoluteTime!==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=IW().getStartAbsoluteTime();if(typeof d===_.t){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=
77
- d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=UV(a.media.customData.playerConfiguration));var d=c?c.abr||null:null,e=b;d&&typeof d.defaultBandwidthEstimate===_.t?e.initialBandwidth=d.defaultBandwidthEstimate:e.initialBandwidth=void 0;LW(c,b);d=null;a.media.customData&&(d=UV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;if(a=null!=c&&c.lowLatencyMode||
78
- a)a=Object.assign({},b.shakaConfig,{streaming:{lowLatencyMode:!0}}),b=Object.assign({},b,{shakaConfig:a});return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var NW=class{constructor(){this.a=!1;this.g=new _.S(PV);this.f=this.m=null;this.h=new Set;this.A=this.G.bind(this);this.w=this.B.bind(this);this.j=null;this.o=new _.Nt;this.l=null}init(a){a&&(this.f=new eX,_.Pr(a,this.f),this.m=a,this.o.on(window,"unload",()=>{const b=this;return _.x(function*(){b.m&&b.m.getState()!==_.To&&(yield SV(b.m))})}))}start(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=PW(),b=PW().getPlayerManager(),c=new cast.framework.CastReceiverOptions;
79
- c.customNamespaces={};c.customNamespaces[QV]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.F.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.C.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
80
- this.A);a.start(c);a.addCustomMessageListener(QV,this.w)}}stop(){if(this.a){this.a=!1;this.o.release();const a=PW();PW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(QV,this.w);a.stop();this.m=this.f=null}}Bd(a){this.j=a}wi(a){this.l=a}on(a,b){PW().addEventListener(a,b)}off(a,b){PW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.Yd&&this.h.add(a)}removeMessageListener(a){typeof a===_.Yd&&this.h.delete(a)}sendMessage(a,
81
- b){PW().sendCustomMessage(QV,b,TV(a))}wc(){return this.a}Db(){return QW()}Xb(a){RW(this,a)}Ki(a){const b=QW();let c=null;a?c=Object.assign({},b,a):c=b;RW(this,c)}F(a){a=a.trim();if(a.startsWith("#EXTM3U"))return TW(this,a);try{var b=(new DOMParser).parseFromString(a,_.Tf)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=PW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.fa);for(var f=e.length-
54
+ this.a(_.Po):(a=this.player.isPaused()?_.Vo:_.Wo,this.a(a))}X(){this.j=1;this.player.trigger(new _.F(_.jg))}V(){this.player.trigger(new _.F(_.ig))}ia(){this.j=2}fa(){this.a(_.Uo)}M(a){const b=this.player.getStats();this.player.trigger(new _.F(_.Kc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.I(_.G,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.F(_.q,{detail:a}));this.a(_.Mo)}};var Z=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.t?c:1;this.h=typeof d===_.t?d:1;this.j=typeof e===_.t?e:0}ob(){return"Google Cast Framework"}pb(){return cast.framework.VERSION}ub(){return 0}getId(){return""}getCreativeId(){return""}Qb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||0}Tb(){return!1}qb(){return this.a.clickThroughUrl||
55
+ null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}fb(){return 0}eb(){return 0}Oa(){return 0}Pa(){switch(this.Hb()){case 0:return 0;case -1:return 2;default:return 1}}getPodIndex(){return this.j}Hb(){return this.f.position}sb(){return this.l}gb(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Sb(){return null}};Z.prototype.getVideoElement=Z.prototype.Sb;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
56
+ Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.gb;Z.prototype.getPositionInSequence=Z.prototype.sb;Z.prototype.getPodTimeOffset=Z.prototype.Hb;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Pa;Z.prototype.getMediaBitrate=Z.prototype.Oa;Z.prototype.getMediaHeight=Z.prototype.eb;Z.prototype.getMediaWidth=Z.prototype.fb;
57
+ Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.qb;Z.prototype.isBumper=Z.prototype.Tb;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;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;
58
+ Z.prototype.getSourceId=Z.prototype.Qb;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.ub;Z.prototype.getAdManagerVersion=Z.prototype.pb;Z.prototype.getAdManagerName=Z.prototype.ob;var bX=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Kb(){return!!this.a.find(a=>0===a.position)}Jb(){return!!this.a.find(a=>-1===a.position)}};bX.prototype.hasPostroll=bX.prototype.Jb;bX.prototype.hasPreroll=bX.prototype.Kb;bX.prototype.getCuePoints=bX.prototype.getCuePoints;var cX=class{constructor(a){this.m=a;this.a=null;this.j=this.w.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];AW().addEventListener(this.f,
59
+ this.j)}load(){const a=this;return _.x(function*(){wW&&(wW=!1,zW(a,0))})}start(){return _.x(function*(){AW().play()})}o(){}resume(){-1!==this.getPosition()&&AW().play()}pause(){-1!==this.getPosition()&&AW().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}l(){return!0}h(){const a=this;return _.x(function*(){AW().removeEventListener(a.f,a.j)})}w(a){const b=cast.framework.events.EndedReason;
60
+ switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=AW().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.F(_.oc,{adsTimeline:new bX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:CW(this,_.ac,a);break;case cast.framework.events.EventType.BREAK_STARTED:CW(this,_.Rb,a);break;case cast.framework.events.EventType.BREAK_ENDED:CW(this,_.Sb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:CW(this,_.jc,a);
61
+ break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(CW(this,_.fc,a),CW(this,_.lc,a)):a.endedReason===b.STOPPED?CW(this,_.lc,a):a.endedReason===b.END_OF_STREAM?(CW(this,_.Vb,a),CW(this,_.lc,a)):a.endedReason===b.ERROR&&zW(this,1);break;case cast.framework.events.EventType.PLAYING:CW(this,_.ec,a);break;case cast.framework.events.EventType.PAUSE:CW(this,_.cc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?CW(this,_.Tb,a):CW(this,_.ec,a)}}};
62
+ cX.prototype.getPosition=cX.prototype.getPosition;cX.prototype.setVolume=cX.prototype.setVolume;cX.prototype.getVolume=cX.prototype.getVolume;cX.prototype.skip=cX.prototype.skip;cX.prototype.pause=cX.prototype.pause;cX.prototype.resume=cX.prototype.resume;var wW=!1;var dX=class{constructor(a){this.Ta=a;this.a=this.f.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(DW(),this.a)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(DW(),this.a)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>EW(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=
63
+ _.Vf;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Wf;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Xf}b&&this.Ta(new _.F(b,{detail:EW(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.Ta(new _.F(_.Vf,{detail:b}))}};var eX=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;FW().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;FW().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}ma(){return this.j}na(){return null}Ma(){const a=
64
+ this.qa();return a&&a.renditions[0]}Qa(){const a=this.wa();return a&&a.renditions[0]}rb(){return null}Fb(){return null}Gb(){return null}Ea(){return null}qa(){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}wa(){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}Ab(){this.g.warn("Video tracks unavailable on Cast")}xa(a){a&&this.f&&
65
+ this.f.setActiveById(+a.id)}Sa(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}jb(){this.g.warn("Video renditions unavailable on Cast")}yb(a){this.xa(a&&a.track)}zb(a){this.Sa(a&&a.track)}addTextTrack(a){const b=this;return _.x(function*(){var c=b.m.getConfiguration();if((c=yield WV(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=
66
+ 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]),HW(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}ta(){return!0}w(){this.f=FW().getAudioTracksManager();var a=this.f.getTracks();this.h=GW(_.M,a);HW(this);a=this.m.getConfiguration();IW(this,_.M,a.preferredAudioLanguage,a.preferredAudioRole);IW(this,_.L,a.preferredTextLanguage,a.preferredTextRole)}};eX.prototype.isAbrEnabled=eX.prototype.ta;
67
+ eX.prototype.addTextTrack=eX.prototype.addTextTrack;eX.prototype.setTextRendition=eX.prototype.zb;eX.prototype.setAudioRendition=eX.prototype.yb;eX.prototype.setVideoRendition=eX.prototype.jb;eX.prototype.setTextTrack=eX.prototype.Sa;eX.prototype.setAudioTrack=eX.prototype.xa;eX.prototype.setVideoTrack=eX.prototype.Ab;eX.prototype.getTextTrack=eX.prototype.wa;eX.prototype.getAudioTrack=eX.prototype.qa;eX.prototype.getVideoTrack=eX.prototype.Ea;eX.prototype.getLoadingTextRendition=eX.prototype.Gb;
68
+ eX.prototype.getLoadingAudioRendition=eX.prototype.Fb;eX.prototype.getLoadingVideoRendition=eX.prototype.rb;eX.prototype.getTextRendition=eX.prototype.Qa;eX.prototype.getAudioRendition=eX.prototype.Ma;eX.prototype.getVideoRendition=eX.prototype.na;eX.prototype.getTextTracks=eX.prototype.ma;eX.prototype.getAudioTracks=eX.prototype.getAudioTracks;eX.prototype.getVideoTracks=eX.prototype.getVideoTracks;var fX=class extends _.su{constructor(){super();this.g=new _.S(PV);this.h=this.w=_.rl();this.A=null;this.l=-1;this.F=new _.zr;this.f=this.o=this.j=this.a=this.B=null;this.C=!1}init(a,b){this.B=a;b&&(this.h=this.w=b);a=JW();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new aX(this);this.a.init();this.j=new eX;this.j.initialize(this);this.o=new dX(c=>this.trigger(c));this.o.init()}unload(){const a=
69
+ cast.framework.messages.PlayerState,b=JW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.x(function*(){a.B=null;a.w=_.rl();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){const a=JW();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");
70
+ a.play();return Promise.resolve()}pause(){const a=JW();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()}isPaused(){return JW().getPlayerState()===cast.framework.messages.PlayerState.PAUSED}isEnded(){return JW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=JW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(HV);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return JW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
71
+ JW().getDurationSec();return typeof a===_.t?-1===a?Infinity:a:-1}getPlaybackRate(){return JW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;JW().sendLocalMediaRequest(b)}}getVolume(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null}setVolume(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)}setMuted(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)}isMuted(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||
72
+ null}getLoadedSource(){const a=JW().getMediaInformation();if(a){var b=JW().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,$i:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return JW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=JW().getLiveSeekableRange();
73
+ 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():_.hv}getStats(){var a=_.Io();if(this.f){a=JW().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.t?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.t?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=
74
+ this;return _.x(function*(){b.f=new _.gv;b.a.l=b.f.a;b.A=_.Zo(a);b.h=_.tl(b.w,a);if(b.C)b.C=!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:UV(b.h),local:!0};yield JW().load(d)}})}getBufferInfo(){this.g.warn(_.pa);return new _.ru}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Za)}appendLoad(){return Promise.reject(_.Za)}seekWith(){return Promise.reject(_.Za)}setNetworkEngine(a){this.F=
75
+ a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return PV}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(LV)}onError(a){a=new _.F(_.q,{detail:a});this.trigger(a)}canPlay(){return _.Ek()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=UV(this.getStats());var b=JW(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();
76
+ c&&typeof b===_.t&&c.startAbsoluteTime!==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=JW().getStartAbsoluteTime();if(typeof d===_.t){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=
77
+ d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=VV(a.media.customData.playerConfiguration));var d=c?c.abr||null:null,e=b;d&&typeof d.defaultBandwidthEstimate===_.t?e.initialBandwidth=d.defaultBandwidthEstimate:e.initialBandwidth=void 0;MW(c,b);d=null;a.media.customData&&(d=VV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;if(a=null!=c&&c.lowLatencyMode||
78
+ a)a=Object.assign({},b.shakaConfig,{streaming:{lowLatencyMode:!0}}),b=Object.assign({},b,{shakaConfig:a});return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var OW=class{constructor(){this.a=!1;this.g=new _.S(QV);this.f=this.m=null;this.h=new Set;this.A=this.G.bind(this);this.w=this.B.bind(this);this.j=null;this.o=new _.Nt;this.l=null}init(a){a&&(this.f=new fX,_.Pr(a,this.f),this.m=a,this.o.on(window,"unload",()=>{const b=this;return _.x(function*(){b.m&&b.m.getState()!==_.To&&(yield TV(b.m))})}))}start(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=QW(),b=QW().getPlayerManager(),c=new cast.framework.CastReceiverOptions;
79
+ c.customNamespaces={};c.customNamespaces[RV]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.F.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.C.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
80
+ this.A);a.start(c);a.addCustomMessageListener(RV,this.w)}}stop(){if(this.a){this.a=!1;this.o.release();const a=QW();QW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(RV,this.w);a.stop();this.m=this.f=null}}Cd(a){this.j=a}yi(a){this.l=a}on(a,b){QW().addEventListener(a,b)}off(a,b){QW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.Yd&&this.h.add(a)}removeMessageListener(a){typeof a===_.Yd&&this.h.delete(a)}sendMessage(a,
81
+ b){QW().sendCustomMessage(RV,b,UV(a))}xc(){return this.a}Eb(){return RW()}Yb(a){SW(this,a)}Mi(a){const b=RW();let c=null;a?c=Object.assign({},b,a):c=b;SW(this,c)}F(a){a=a.trim();if(a.startsWith("#EXTM3U"))return UW(this,a);try{var b=(new DOMParser).parseFromString(a,_.Tf)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=QW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.fa);for(var f=e.length-
82
82
  1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.w||g===_.p){g=e[f].getAttribute(_.te);var h=e[f].getElementsByTagName(_.lb);for(let k=h.length-1;0<=k;--k){const l=h[k].getAttribute(_.te)||g,m=h[k].getAttribute(_.md);let n=h[k].getAttribute(_.Fg)||void 0,r=h[k].getAttribute(_.Zd)||void 0;void 0!==n&&(n=+n);void 0!==r&&(r=+r);b.canDisplayType(l,m,n,r)||e[f].removeChild(h[k])}e[f].getElementsByTagName(_.lb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.fa).length||a.removeChild(c[d])}return a=
83
- (new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.qb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=PW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.w){e=c[d].getElementsByTagName(_.jb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Qa)||void 0,h=e[f].getAttribute(_.Pa)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.pg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.jb).length||a.removeChild(c[d])}a=
84
- (new XMLSerializer).serializeToString(a)}return a}C(a){const b=this;return _.x(function*(){let c=a;var d;c.media.customData&&(d=UV(c.media.customData.playerConfiguration));if(b.m&&d){b.j&&(d=(yield Promise.resolve(b.j(d)))||d);d.ima&&(yield xW(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.t&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.$r(b.m,d),yield _.as(b.m),d=b.m.getLoadedSource(),c.media.contentId=
85
- d.url,c.media.contentType=d.type,d.Yb&&(c.media.hlsVideoSegmentFormat=WV(d.Yb,_.N)),d.audioMimeType&&(c.media.hlsSegmentFormat=WV(d.audioMimeType,_.M)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.t&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.l&&(d=yield Promise.resolve(b.l(c)))&&(c=d);return c})}G(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){var b=PW().getPlayerManager(),
86
- 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))}_.cs(this.m)}}B(a){if(0<this.h.size){const b=UV(a.data);this.h.forEach(c=>c(b))}}};_.z(PV,NW);NW.prototype.updateContentMetadata=NW.prototype.Ki;NW.prototype.setContentMetadata=NW.prototype.Xb;NW.prototype.getContentMetadata=NW.prototype.Db;NW.prototype.isApiReady=NW.prototype.wc;
87
- NW.prototype.sendMessage=NW.prototype.sendMessage;NW.prototype.removeMessageListener=NW.prototype.removeMessageListener;NW.prototype.addMessageListener=NW.prototype.addMessageListener;NW.prototype.off=NW.prototype.off;NW.prototype.on=NW.prototype.on;NW.prototype.setLoadRequestDataInterceptor=NW.prototype.wi;NW.prototype.setPlayerConfigInterceptor=NW.prototype.Bd;NW.prototype.stop=NW.prototype.stop;NW.prototype.start=NW.prototype.start;NW.prototype.init=NW.prototype.init;NW.getInstance=OW;var MW=null;var fX=class{constructor(a){this.f=a;this.a=null;this.j=new _.Nt;this.l=[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.A.bind(a);for(const d of a.l)a.j.on(b,d,c)}})}start(){return _.x(function*(){})}w(){}resume(){this.a&&
88
- 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(RV,{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}o(){return!0}h(){const a=
89
- this;return _.x(function*(){a.j.release()})}A(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.F(_.oc,{adsTimeline:new aX(a.breaks)})));break;case "isPlayingBreak":a.value?VW(this,_.Rb):(VW(this,_.Vb),VW(this,_.lc),VW(this,_.Sb));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(VW(this,_.Vb),VW(this,_.lc)),VW(this,_.kc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?VW(this,_.cc):VW(this,_.ec))}}};fX.prototype.getPosition=fX.prototype.getPosition;
90
- fX.prototype.setVolume=fX.prototype.setVolume;fX.prototype.getVolume=fX.prototype.getVolume;fX.prototype.skip=fX.prototype.skip;fX.prototype.pause=fX.prototype.pause;fX.prototype.resume=fX.prototype.resume;_.mp(new class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.dd?!1:!(!b||!b.ima)}create(a){return new fX(a.a)}});_.mp(new class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return OW().wc()?!(!b||!b.ima):!1}create(a){return new bX(a)}});};f.call(g, window);
83
+ (new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.qb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=QW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.w){e=c[d].getElementsByTagName(_.jb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Qa)||void 0,h=e[f].getAttribute(_.Pa)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.pg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.jb).length||a.removeChild(c[d])}a=
84
+ (new XMLSerializer).serializeToString(a)}return a}C(a){const b=this;return _.x(function*(){let c=a;var d;c.media.customData&&(d=VV(c.media.customData.playerConfiguration));if(b.m&&d){b.j&&(d=(yield Promise.resolve(b.j(d)))||d);d.ima&&(yield yW(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.t&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.$r(b.m,d),yield _.as(b.m),d=b.m.getLoadedSource(),c.media.contentId=
85
+ d.url,c.media.contentType=d.type,d.Zb&&(c.media.hlsVideoSegmentFormat=XV(d.Zb,_.N)),d.audioMimeType&&(c.media.hlsSegmentFormat=XV(d.audioMimeType,_.M)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.t&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.l&&(d=yield Promise.resolve(b.l(c)))&&(c=d);return c})}G(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){var b=QW().getPlayerManager(),
86
+ 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))}_.cs(this.m)}}B(a){if(0<this.h.size){const b=VV(a.data);this.h.forEach(c=>c(b))}}};_.z(QV,OW);OW.prototype.updateContentMetadata=OW.prototype.Mi;OW.prototype.setContentMetadata=OW.prototype.Yb;OW.prototype.getContentMetadata=OW.prototype.Eb;OW.prototype.isApiReady=OW.prototype.xc;
87
+ OW.prototype.sendMessage=OW.prototype.sendMessage;OW.prototype.removeMessageListener=OW.prototype.removeMessageListener;OW.prototype.addMessageListener=OW.prototype.addMessageListener;OW.prototype.off=OW.prototype.off;OW.prototype.on=OW.prototype.on;OW.prototype.setLoadRequestDataInterceptor=OW.prototype.yi;OW.prototype.setPlayerConfigInterceptor=OW.prototype.Cd;OW.prototype.stop=OW.prototype.stop;OW.prototype.start=OW.prototype.start;OW.prototype.init=OW.prototype.init;OW.getInstance=PW;var NW=null;var gX=class{constructor(a){this.f=a;this.a=null;this.j=new _.Nt;this.w=[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.A.bind(a);for(const d of a.w)a.j.on(b,d,c)}})}start(){return _.x(function*(){})}o(){}resume(){this.a&&
88
+ 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(SV,{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}l(){return!0}h(){const a=
89
+ this;return _.x(function*(){a.j.release()})}A(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.F(_.oc,{adsTimeline:new bX(a.breaks)})));break;case "isPlayingBreak":a.value?WW(this,_.Rb):(WW(this,_.Vb),WW(this,_.lc),WW(this,_.Sb));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(WW(this,_.Vb),WW(this,_.lc)),WW(this,_.jc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?WW(this,_.cc):WW(this,_.ec))}}};gX.prototype.getPosition=gX.prototype.getPosition;
90
+ gX.prototype.setVolume=gX.prototype.setVolume;gX.prototype.getVolume=gX.prototype.getVolume;gX.prototype.skip=gX.prototype.skip;gX.prototype.pause=gX.prototype.pause;gX.prototype.resume=gX.prototype.resume;_.mp(new class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.dd?!1:!(!b||!b.ima)}create(a){return new gX(a.a)}});_.mp(new class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return PW().xc()?!(!b||!b.ima):!1}create(a){return new cX(a)}});};f.call(g, window);