@castlabs/prestoplay 6.25.0 → 6.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/cl.youbora.js CHANGED
@@ -3,7 +3,7 @@ var f=function(window){var Xw='" event to NPAW',Yw='" event to Youbora',Zw='Repo
3
3
  "PlayReady":a.startsWith(_.qf)?"ClearKey":a.startsWith(_.Rd)?"Primetime":a},nx=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ox=function(a,b,c,d){b=nx(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.Ae;b.severity===_.P?(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(Zw+a+'" to Youbora',b.code,b));return b},px=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.wi;d.g=new _.K("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.x(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.na())){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.Na())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.0-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,_.rg,this.K.bind(this)),this.a.on(this.m,_.Ae,this.H.bind(this)),this.a.on(this.m,
6
+ b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Na())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.1-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,_.rg,this.K.bind(this)),this.a.on(this.m,_.Ae,this.H.bind(this)),this.a.on(this.m,
7
7
  _.Ug,this.J.bind(this)),this.a.on(this.m,_.Tg,this.I.bind(this)),this.a.on(this.m,_.Rc,this.C.bind(this)),this.a.on(this.m,_.ud,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.fc);_.zi(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.Gq()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);
8
8
  if(c)switch(c.currentState){case _.Tq:this.w()&&this.f();break;case _.Vq:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Uq:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Hq:this.fireBufferEnd();this.fireStop();break;case _.Oq:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Mq:this.fireBufferBegin();break;default:this.g.debug($w,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=mx(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=ox(c,this.m,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.jg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.ig);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",
@@ -11,13 +11,13 @@ c);this.o=(c=c.adsTimeline)&&c.Rb()};b.prototype.G=function(c){this.g.debug("Cas
11
11
  function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.qb(),this.a.pb(),this.a.Xa()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Xa()};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.Ya()){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.rb()};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(kx,c);return c};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Rc,this.U.bind(this)),this.f.on(this.m,_.Nc,this.P.bind(this)),this.f.on(this.m,_.Jc,this.K.bind(this)),
14
+ b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug(kx,c);return c};b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return"6.25.1-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Rc,this.U.bind(this)),this.f.on(this.m,_.Nc,this.P.bind(this)),this.f.on(this.m,_.Jc,this.K.bind(this)),
15
15
  this.f.on(this.m,_.Lc,this.L.bind(this)),this.f.on(this.m,_.Bc,this.I.bind(this)),this.f.on(this.m,_.Cc,this.o.bind(this,1)),this.f.on(this.m,_.Ic,this.o.bind(this,2)),this.f.on(this.m,_.Pc,this.o.bind(this,3)),this.f.on(this.m,_.Ac,this.H.bind(this)),this.f.on(this.m,_.Mc,this.M.bind(this)),this.f.on(this.m,_.Ae,this.J.bind(this)),this.f.on(this.m,_.xc,this.B.bind(this)),this.f.on(this.m,_.yc,this.C.bind(this)),this.f.on(this.m,_.zc,this.G.bind(this)),this.f.on(this.m,_.Kc,this.w.bind(this)))};b.prototype.unregisterListeners=
16
16
  function(){_.zi(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.U=function(c){this.g.debug(fx,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
17
  !0;this.h(dx);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(cx),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.Ab();this.g.debug(ex,c);this.fireClick(c)};b.prototype.M=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(bx,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&&ox(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,[Zw+c+Yw].concat(_.vh(e)))};return new b(a)},sx=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}_.x(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.na())&&(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.Na())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-adapter-6.25.0-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.Na())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=function(){return"castlabs-adapter-6.25.1-js"};
21
21
  a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.rg,this.K.bind(this)),b.on(this.player,_.Ae,this.H.bind(this)),b.on(this.player,_.jg,this.J.bind(this)),b.on(this.player,_.ig,this.I.bind(this)),b.on(this.player,_.Rc,this.C.bind(this)),b.on(this.player,_.ud,this.G.bind(this)))};a.prototype.unregisterListeners=function(){rx.debug(_.fc);_.zi(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()||_.Gq()};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 _.Tq:this.o()&&this.fireStart();break;case _.Vq:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case _.Uq:this.o()&&this.fireStart();this.A();this.fireBufferEnd();this.firePause();break;case _.Hq:this.fireBufferEnd();
23
23
  this.fireStop();break;case _.Oq:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Mq:this.fireBufferBegin();break;default:rx.debug($w,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.H=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ox(b,this.player,rx,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.J=function(){this.player.isEnded()||(this.l(_.jg),this.fireSeekBegin())};a.prototype.w=function(){this.a||(this.a=new _.wi);
@@ -26,15 +26,15 @@ _.x(a,NpawPluginAdapters.ads.Ima);a.prototype.getDuration=function(){return this
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.Ya()){case 0:c=
27
27
  b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}tx.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.rb()};
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);tx.debug(kx,b);return b};a.prototype.getPlayerName=function(){return _.xa};a.prototype.getVersion=
29
- function(){return"castlabs-ads-adapter-6.25.0-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.wi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Rc,this.ca.bind(this)),b.on(this.player,_.Nc,this.Y.bind(this)),b.on(this.player,_.Jc,this.M.bind(this)),b.on(this.player,_.Lc,this.P.bind(this)),b.on(this.player,_.Bc,this.K.bind(this)),b.on(this.player,_.Cc,this.w.bind(this,1)),b.on(this.player,
29
+ function(){return"castlabs-ads-adapter-6.25.1-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.wi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Rc,this.ca.bind(this)),b.on(this.player,_.Nc,this.Y.bind(this)),b.on(this.player,_.Jc,this.M.bind(this)),b.on(this.player,_.Lc,this.P.bind(this)),b.on(this.player,_.Bc,this.K.bind(this)),b.on(this.player,_.Cc,this.w.bind(this,1)),b.on(this.player,
30
30
  _.Ic,this.w.bind(this,2)),b.on(this.player,_.Pc,this.w.bind(this,3)),b.on(this.player,_.Ac,this.J.bind(this)),b.on(this.player,_.Mc,this.U.bind(this)),b.on(this.player,_.Ae,this.L.bind(this)),b.on(this.player,_.xc,this.G.bind(this)),b.on(this.player,_.yc,this.H.bind(this)),b.on(this.player,_.zc,this.I.bind(this)),b.on(this.player,_.Kc,this.da.bind(this)))};a.prototype.unregisterListeners=function(){_.zi(this.B())};a.prototype.ca=function(b){tx.debug(fx,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.M=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(dx);this.fireBufferBegin()};a.prototype.da=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&(this.f(cx),this.o=!1,this.fireBufferEnd())};a.prototype.w=
32
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.Ab();tx.debug(ex,b);this.fireClick(b)};a.prototype.U=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(bx,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
33
  a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ox(b,this.player,tx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];tx.debug.apply(tx,[Zw+b+Xw].concat(_.vh(d)))};return a},vx=function(){this.a=null;this.g=new _.K(gx);this.m=null},wx=function(a,b){if(b.namespace()===_.Hd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().youbora;return _.N.pg(c)?c.accountCode?_.N.R(window.NpawPlugin)||_.N.R(window.NpawPluginAdapters)?
34
34
  (a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn(ax),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},xx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},yx=function(){this.a=null;this.g=new _.K(hx);this.m=null},zx=function(a,b){if(b.namespace()===_.Hd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.N.pg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),
35
- !1;if(!c.accountCode)return a.g.warn(ax),b.onError(new _.O(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.O(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 _.O(1,9,9102)));return!0},Ax=function(){};var rx=new _.K("clpp.npaw.NpawAdapter");var tx=new _.K("clpp.npaw.NpawAdsAdapter");_.x(vx,_.gw);_.u=vx.prototype;_.u.Sg=function(a){xx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,sx()),this.a.registerAdsAdapterFromClass(this.m,ux())};_.u.gm=function(){return this.a};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;wx(this,a)&&(a=a.getConfiguration().youbora,this.Sg(new NpawPlugin(a.accountCode)))};
35
+ !1;if(!c.accountCode)return a.g.warn(ax),b.onError(new _.O(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.O(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 _.O(1,9,9102)));return!0},Ax=function(){};var rx=new _.K("clpp.npaw.NpawAdapter");var tx=new _.K("clpp.npaw.NpawAdsAdapter");_.x(vx,_.gw);_.u=vx.prototype;_.u.Sg=function(a){xx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,sx()),this.a.registerAdsAdapterFromClass(this.m,ux())};_.u.fm=function(){return this.a};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;wx(this,a)&&(a=a.getConfiguration().youbora,this.Sg(new NpawPlugin(a.accountCode)))};
36
36
  _.u.onContentWillLoad=function(a,b){if(wx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[ix]&&(d[ix]=b.isLive);void 0===d[jx]&&(d[jx]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Sg(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.u.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=mx(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.jf,b);this.a.setAnalyticsOptions(b)};_.u.onPlayerWillRelease=function(){};
37
- _.u.onPlayerWillDestroy=function(){xx(this);this.a.destroy()};_.u.id=function(){return lx};_.J(gx,vx);vx.prototype.getAdsAdapter=vx.prototype.getAdsAdapter;vx.prototype.getAdapter=vx.prototype.getAdapter;vx.prototype.getNpawPlugin=vx.prototype.gm;vx.prototype.setNpawPlugin=vx.prototype.Sg;vx.Id=lx;new _.K(gx);_.x(yx,_.gw);_.u=yx.prototype;_.u.Tg=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(px(this.m)),this.a.setAdsAdapter(qx(this.m))};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;zx(this,a)&&(a=a.getConfiguration().youbora,this.Tg(new youbora.Plugin(a)))};
37
+ _.u.onPlayerWillDestroy=function(){xx(this);this.a.destroy()};_.u.id=function(){return lx};_.J(gx,vx);vx.prototype.getAdsAdapter=vx.prototype.getAdsAdapter;vx.prototype.getAdapter=vx.prototype.getAdapter;vx.prototype.getNpawPlugin=vx.prototype.fm;vx.prototype.setNpawPlugin=vx.prototype.Sg;vx.Id=lx;new _.K(gx);_.x(yx,_.gw);_.u=yx.prototype;_.u.Tg=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(px(this.m)),this.a.setAdsAdapter(qx(this.m))};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;zx(this,a)&&(a=a.getConfiguration().youbora,this.Tg(new youbora.Plugin(a)))};
38
38
  _.u.onContentWillLoad=function(a,b){if(zx(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[ix]&&(d[ix]=b.isLive);void 0===d[jx]&&(d[jx]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Tg(new youbora.Plugin(d));this.a.setOptions(d)}};_.u.onPlayerWillRelease=function(){};_.u.onPlayerWillDestroy=function(){};_.u.id=function(){return lx};_.J(hx,yx);yx.prototype.getAdsAdapter=yx.prototype.getAdsAdapter;yx.prototype.getAdapter=yx.prototype.getAdapter;
39
39
  yx.prototype.setYouboraPlugin=yx.prototype.Tg;yx.Id=lx;Ax.prototype.create=function(a){return a.youbora&&a.youbora.v7?new vx:new yx};_.cu(new Ax);};
40
40
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
package/cl.airplay.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var ZX=class extends _.Zv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Mt(()=>{this.m.play().catch(()=>{})});this.h=new _.St}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
- !0;break;case "not-available":this.f=!1}this.m.trigger(new _.D(_.Ic,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Hc:_.Gc;if(this.l||!this.m.isPaused()||this.m.getState()===_.kp)this.l?this.m.play().catch(()=>{}):this.o.ia(.01);this.m.trigger(new _.D(a))}Nb(){return this.j}qe(){return this.f}pi(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",ZX);ZX.prototype.showCastMenu=ZX.prototype.pi;
2
+ !0;break;case "not-available":this.f=!1}this.m.trigger(new _.D(_.Ic,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Hc:_.Gc;if(this.l||!this.m.isPaused()||this.m.getState()===_.kp)this.l?this.m.play().catch(()=>{}):this.o.ha(.01);this.m.trigger(new _.D(a))}Nb(){return this.j}qe(){return this.f}pi(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",ZX);ZX.prototype.showCastMenu=ZX.prototype.pi;
3
3
  ZX.prototype.canCast=ZX.prototype.qe;ZX.prototype.isCasting=ZX.prototype.Nb;ZX.Id="airplay";_.Nr(new class{create(){return new ZX}});};f.call(g, window);
package/cl.cast.js CHANGED
@@ -4,10 +4,10 @@ null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.sk(d,a.mimeType,g);f&&g&&(h
4
4
  d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.Ig:return d.FMP4;case _.Hg:return b===_.N?d.MPEG2_TS:c.TS;case _.Rc:return c.AAC;case _.Sc:return c.AC3;case _.Tc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Uc:return c.FMP4}},JW=function(a){a=void 0===a?IW: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
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}},KW=function(a,b){return a.h.filter(c=>c.type===b)},MW=function(a,b){const c=LW(a);return KW(a,b).find(d=>c.includes(d.id))||null},OW=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.xa();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);
6
6
  d.editTracksInfo(c,()=>{a.f[b]=null;NW(a,b)},e=>{a.f[b]=null;a.g.debug(sW,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{NW(a,b)},e=>{a.g.debug(sW,e)}))},LW=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(b=>b.toString())},NW=function(a,b){b===_.M?a.a.trigger(new _.D(_.Xc)):b===_.L&&a.a.trigger(new _.D(_.jg))},RW=function(a){if(a)for(const b of PW)QW(b)},QW=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.ff();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.$);SW&&a.o.ia(.02)}},TW=function(a){return _.x(function*(){PW.delete(a);if(a.w){a.w=!1;var b=
7
+ cast.framework&&cast.framework.CastContext&&a.S.length){a.w=!0;a.o.ff();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.$);SW&&a.o.ha(.02)}},TW=function(a){return _.x(function*(){PW.delete(a);if(a.w){a.w=!1;var b=
8
8
  cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.$)}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.W=null})},UW=function(a){return _.x(function*(){a.Nb()||(yield cast.framework.CastContext.getInstance().requestSession())})},WW=function(a,b,c){c=
9
9
  void 0===c?0:c;return _.x(function*(){var d=a.f.xa();d&&d.language&&(a.h.preferredTextLanguage=d.language);(d=a.f.ra())&&d.language&&(a.h.preferredAudioLanguage=d.language);yield VW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Qe:a.getPresentationStartTime(),autoplay:b,lb:a.h})})},VW=function(a,b){return _.x(function*(){var c=chrome.cast.media.StreamType;yield UW(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=HW(b.ac,_.N);e.hlsSegmentFormat=HW(c,_.M);b.lb&&(a.L&&(c=yield Promise.resolve(a.L(b.lb)))&&(b.lb=c),a.h=b.lb,a.C=_.np(a.h),a.B=a.C.findIndex(k=>k.url===b.source.url),b.lb.remoteTextTracks&&(c=yield Promise.all(b.lb.remoteTextTracks.map(a.ha.bind(a))),e.tracks=c.filter(k=>k),b.lb.remoteTextTracks=void 0),delete b.lb.autoplay,b.lb.startTime=null,e.customData={playerConfiguration:EW(b.lb)});c=a.Fb()||{};
10
+ b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=HW(b.ac,_.N);e.hlsSegmentFormat=HW(c,_.M);b.lb&&(a.L&&(c=yield Promise.resolve(a.L(b.lb)))&&(b.lb=c),a.h=b.lb,a.C=_.np(a.h),a.B=a.C.findIndex(k=>k.url===b.source.url),b.lb.remoteTextTracks&&(c=yield Promise.all(b.lb.remoteTextTracks.map(a.ja.bind(a))),e.tracks=c.filter(k=>k),b.lb.remoteTextTracks=void 0),delete b.lb.autoplay,b.lb.startTime=null,e.customData={playerConfiguration:EW(b.lb)});c=a.Fb()||{};
11
11
  var f=XW(c.metadataType),g;typeof b.Qe===_.t&&(g={metadataType:f,sectionStartAbsoluteTime:b.Qe});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=YW(c);if(g=ZW(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);typeof b.autoplay===_.$c&&(e.autoplay=b.autoplay);typeof b.currentTime===_.t&&(e.currentTime=b.currentTime);yield d.loadMedia(e)}})},ZW=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries($W);for(const d of c){const [e,f]=d;
12
12
  if(f===b){b=e;break a}}b=null}if(!b)return null;b=JW($W[b]);return Object.assign(b,a)},XW=function(a){var b=void 0===b?IW:b;return Object.values($W).includes(a)?a:b},YW=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},bX=function(a,b){aX(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.U);b.addMessageListener(BW,a.O)},cX=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.t?null:a):a=
13
13
  null;a=null===a?null:a+b;return null===a?b:a},aX=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.ba.bind(a)),a.G.on(a.F,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Ha.bind(a)),a.j&&a.j.init(),a.trigger(new _.D(_.Fe)))},fX=function(a){return new dX(a.h,()=>{a.trigger(new _.D(_.id))},(b,c)=>{{const d=a.f.getConfiguration();
@@ -15,7 +15,7 @@ d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime
15
15
  _.Bj(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.ij(f.data),h=(new DOMParser).parseFromString(g,_.ig);if(h.getElementsByTagName("vmap:VMAP").length)_.C("VMAP detected."),a.vmapAdsRequest=hX(g);else if(h.getElementsByTagName("VAST").length){_.C("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=hX(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else _.C("Unsupported schema."),gX=!0}}catch(e){_.C("Failed to fetch an ad",
16
16
  e),gX=!0}})},hX=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},jX=function(a,b){b=new _.I(1,10,10003,{errorType:b});a.m.onError(b)},kX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},mX=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=lX(a,c))&&(d={ad:c});a.m.trigger(new _.D(b,d))}},lX=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=
17
17
  null,e=null,f;typeof b.breakClipId===_.cg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.cg&&(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},nX=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]},oX=function(a){const b=a.dashTimedMetadata;let c=_.Ag;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.wg)?_.gi:_.ug,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},pX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},rX=function(a){a.a=pX().getTextTracksManager();const b=a.a.getTracks();a.j=qX(_.L,b)},qX=function(a,b){const c=[];for(const d of b)b=
18
+ cast.framework.events.EventType.TIMED_METADATA_EXIT]},oX=function(a){const b=a.dashTimedMetadata;let c=_.Ag;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.zg)?_.gi:_.ug,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},pX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},rX=function(a){a.a=pX().getTextTracksManager();const b=a.a.getTracks();a.j=qX(_.L,b)},qX=function(a,b){const c=[];for(const d of b)b=
19
19
  new _.Xj(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 _.fk(b.id,b)),c.push(b);return c},sX=function(a,b,c,d){c=_.pi(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.na());if(c=c.find(g=>{const h=
20
20
  _.Qi(g);return f.some(k=>{k=_.Qi(k.language||"");return _.Ri(h,k)})})){const g=_.Qi(c);c=f.filter(h=>{h=_.Qi(h.language||"");return _.Ri(g,h)});f=c.length?c:f;e=e||!!c.length}_.rj(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.ya(e):b===_.L&&a.Xa(e))},tX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},wX=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;
21
21
  b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.hm(d);if(e){var f=[_.Hd];_.np(a)[0].type!==_.Pc&&f.unshift(_.Jd);d.preferredDrmSystem===_.Hd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Na[g];h?(c=g===_.Jd?cast.framework.ContentProtection.WIDEVINE:g===_.Hd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},uX(b,h,a,c),vX(b,h,a,c)):c()}else c()}else c()},uX=
@@ -32,8 +32,8 @@ null}vb(){return this.f[_.N]||null}Gb(){return this.f[_.M]||null}Hb(){return thi
32
32
  JX.prototype.setAudioRendition=JX.prototype.Bb;JX.prototype.setVideoRendition=JX.prototype.nb;JX.prototype.setTextTrack=JX.prototype.Xa;JX.prototype.setAudioTrack=JX.prototype.ya;JX.prototype.setVideoTrack=JX.prototype.Db;JX.prototype.getTextTrack=JX.prototype.xa;JX.prototype.getAudioTrack=JX.prototype.ra;JX.prototype.getVideoTrack=JX.prototype.Ia;JX.prototype.getLoadingTextRendition=JX.prototype.Hb;JX.prototype.getLoadingAudioRendition=JX.prototype.Gb;JX.prototype.getLoadingVideoRendition=JX.prototype.vb;
33
33
  JX.prototype.getTextRendition=JX.prototype.Va;JX.prototype.getAudioRendition=JX.prototype.Ra;JX.prototype.getVideoRendition=JX.prototype.oa;JX.prototype.getTextTracks=JX.prototype.na;JX.prototype.getAudioTracks=JX.prototype.getAudioTracks;JX.prototype.getVideoTracks=JX.prototype.getVideoTracks;var dX=class extends _.Cu{constructor(a,b,c,d){super();this.g=new _.S(_.ud);this.S=a;this.o=new _.Gk(b);this.R=c;this.W=d;this.h=this.I=_.Gl();this.C=[];this.B=0;this.K=new _.Er;this.F=this.l=this.a=null;this.A=this.w=!1;this.Y="";this.da=1E6;this.f=new JX;this.f.initialize(this);this.j=new IX(this);this.G=new _.St;this.J=null;this.H=new Set;this.M=this.va.bind(this);this.$=this.Oa.bind(this);this.U=this.Za.bind(this);this.O=this.Aa.bind(this);this.L=null;window.cast||Object.defineProperty(window,
34
34
  "cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{RW(!0)},0)}});QW(this);PW.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(_.ob)}appendLoad(){return Promise.reject(_.ob)}seekWith(){return Promise.reject(_.ob)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.x(function*(){})}zd(a){this.L=
35
- a}wc(){return this.w}Nb(){return this.A}ze(){return this.Y}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,EW(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(wW),new _.I(1,8,8001,void 0);if(!SW)throw a.g.warn(uW),new _.I(1,8,8002,void 0);if(a.Nb())throw a.g.warn("Already casting"),
36
- new _.I(1,8,8003,void 0);try{yield UW(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);}})}ye(){this.Nb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.ne&&this.H.add(a)}removeMessageListener(a){typeof a===_.ne&&this.H.delete(a)}play(){return this.isEnded()?WW(this,!0):new Promise((a,b)=>{if(!this.a)return b(tW);this.a.play(null,
35
+ a}wc(){return this.w}Nb(){return this.A}ye(){return this.Y}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,EW(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(wW),new _.I(1,8,8001,void 0);if(!SW)throw a.g.warn(uW),new _.I(1,8,8002,void 0);if(a.Nb())throw a.g.warn("Already casting"),
36
+ new _.I(1,8,8003,void 0);try{yield UW(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);}})}xe(){this.Nb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.ne&&this.H.add(a)}removeMessageListener(a){typeof a===_.ne&&this.H.delete(a)}play(){return this.isEnded()?WW(this,!0):new Promise((a,b)=>{if(!this.a)return b(tW);this.a.play(null,
37
37
  a,b)})}pause(){return new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(tW);this.a.pause(null,a,b)})}isPaused(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED}isEnded(){return this.getState()===_.$o}seek(a){return this.isEnded()?WW(this,!1,a):new Promise((b,c)=>{this.a||c(tW);this.l.isPlayingBreak&&c(rW);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.D(_.Cg));this.a.seek(d,()=>{this.trigger(new _.D(_.Bg));b()},c)})}getPosition(){return this.getMediaPosition()}getMediaPosition(){return this.a&&
38
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(CW,{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=
@@ -42,13 +42,13 @@ isLive:c.isLive,autoplay:b.h.autoplay,lb:b.h,ac:c.ac,audioMimeType:c.audioMimeTy
42
42
  (this.trigger(new _.D(_.q,{detail:a})),this.j))this.j.onError(a)}namespace(){return _.ud}canPlay(){return this.wc()?2:0}Fb(){return this.J}$b(a){this.J=ZW(a)}te(){this.J=null}af(a){const b=this.Fb()||{};a={metadataType:XW(b.metadataType),title:a};this.$b(Object.assign({},b,a))}Ze(a){const b=this.Fb()||{},c=XW(b.metadataType);a=new chrome.cast.Image(a);this.$b(Object.assign({},b,{metadataType:c,images:[a]}))}Ye(a){const b=this.Fb()||{};this.$b(Object.assign({},b,{metadataType:3,artist:a}))}$e(a){const b=
43
43
  this.Fb()||{};a={metadataType:XW(b.metadataType),releaseDate:a};this.$b(Object.assign({},b,a))}va(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;SW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.Y=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.ff()}Oa(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;bX(this,a.session);break;
44
44
  case cast.framework.SessionState.SESSION_RESUMED:this.Nb()||(this.A=!0,bX(this,a.session),this.W());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Nb()&&this.a){const d=this.a.media;var b=this.f.ra(),c=this.f.xa();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:cX(this),wg:c,yf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.U);a.session.removeMessageListener(BW,
45
- this.O);this.A=!1;this.a=null;this.G.release();this.l=this.F=null}}Za(a){this.g.debug("New media session",a.mediaSession);aX(this,a.mediaSession)}Ha(a){a.value&&a.value.tracks&&this.f&&this.f.load()}Aa(a,b){if(a===BW&&0<this.H.size){const c=FW(b);this.H.forEach(d=>d(c))}}ba(){this.trigger(new _.D(_.og))}ha(a){const b=this;return _.x(function*(){let c=null;const d=yield GW(a,[_.hg,_.Oc],b.K,b.h);d&&(c=new chrome.cast.media.Track(b.da++,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}},SW=!1,PW=new Set;window.__onGCastApiAvailable=RW;var KX=class extends _.Cu{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.ne?c:this.l;this.a=fX(this);this.g=new _.S(yW);this.f&&this.forwardEventsTo(this.f)}destroy(){const a=this;return _.x(function*(){a.a&&(yield TW(a.a),a.a=null);a.f&&a.stopForwardingEventsTo(a.f)})}l(a,b){this.f&&a!==_.$o&&a!==_.hp&&(delete b.license,this.f.load(b))}qe(){return!!this.a&&this.a.wc()&&SW}Nb(){return!!this.a&&this.a.Nb()}ze(){return this.a?this.a.ze():""}zd(a){this.a&&this.a.zd(a)}cast(a){const b=
45
+ this.O);this.A=!1;this.a=null;this.G.release();this.l=this.F=null}}Za(a){this.g.debug("New media session",a.mediaSession);aX(this,a.mediaSession)}Ha(a){a.value&&a.value.tracks&&this.f&&this.f.load()}Aa(a,b){if(a===BW&&0<this.H.size){const c=FW(b);this.H.forEach(d=>d(c))}}ba(){this.trigger(new _.D(_.og))}ja(a){const b=this;return _.x(function*(){let c=null;const d=yield GW(a,[_.hg,_.Oc],b.K,b.h);d&&(c=new chrome.cast.media.Track(b.da++,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}},SW=!1,PW=new Set;window.__onGCastApiAvailable=RW;var KX=class extends _.Cu{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.ne?c:this.l;this.a=fX(this);this.g=new _.S(yW);this.f&&this.forwardEventsTo(this.f)}destroy(){const a=this;return _.x(function*(){a.a&&(yield TW(a.a),a.a=null);a.f&&a.stopForwardingEventsTo(a.f)})}l(a,b){this.f&&a!==_.$o&&a!==_.hp&&(delete b.license,this.f.load(b))}qe(){return!!this.a&&this.a.wc()&&SW}Nb(){return!!this.a&&this.a.Nb()}ye(){return this.a?this.a.ye():""}zd(a){this.a&&this.a.zd(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.ra();m&&(m.mimeType&&(k=m.mimeType),m.language&&(l.preferredAudioLanguage=m.language),m.roles.length&&(l.preferredAudioRole=m.roles[0]));const n=f.xa();n&&(n.language&&(l.preferredTextLanguage=n.language),n.roles.length&&(l.preferredTextRole=n.roles[0]));const r=
48
- e&&typeof e.isLive===_.$c?e.isLive:b.f.isLive();d={source:e,isLive:r,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Qe:b.f.getPresentationStartTime(),ac:h,audioMimeType:k,lb:l}}var c=d}yield eX(b);b.a&&(c&&(c.autoplay=!b.f.isPaused()),a?yield b.f.load(a):b.a.a||(yield VW(b.a,c)))}}catch(d){b.g.error("Error while trying to cast",d),c=new _.D(_.q,{detail:d}),b.trigger(c)}})}ye(){this.a&&this.a.ye()}$g(a){const b=this;return _.x(function*(){a!==b.h&&(b.h=a,b.a&&(yield TW(b.a)),
48
+ e&&typeof e.isLive===_.$c?e.isLive:b.f.isLive();d={source:e,isLive:r,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Qe:b.f.getPresentationStartTime(),ac:h,audioMimeType:k,lb:l}}var c=d}yield eX(b);b.a&&(c&&(c.autoplay=!b.f.isPaused()),a?yield b.f.load(a):b.a.a||(yield VW(b.a,c)))}}catch(d){b.g.error("Error while trying to cast",d),c=new _.D(_.q,{detail:d}),b.trigger(c)}})}xe(){this.a&&this.a.xe()}$g(a){const b=this;return _.x(function*(){a!==b.h&&(b.h=a,b.a&&(yield TW(b.a)),
49
49
  b.a=fX(b))})}sendMessage(a){const b=this;return _.x(function*(){b.a?yield b.a.sendMessage(BW,a):b.g.warn(xW)})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(xW)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(xW)}Fb(){return this.a&&this.a.Fb()}$b(a){this.a&&this.a.$b(a)}te(){this.a&&this.a.te()}af(a){this.a&&this.a.af(a)}Ze(a){this.a&&this.a.Ze(a)}Ye(a){this.a&&this.a.Ye(a)}$e(a){this.a&&this.a.$e(a)}};_.z(yW,KX);
50
50
  KX.prototype.setContentReleaseDate=KX.prototype.$e;KX.prototype.setContentArtist=KX.prototype.Ye;KX.prototype.setContentImage=KX.prototype.Ze;KX.prototype.setContentTitle=KX.prototype.af;KX.prototype.clearContentMetadata=KX.prototype.te;KX.prototype.setContentMetadata=KX.prototype.$b;KX.prototype.getContentMetadata=KX.prototype.Fb;KX.prototype.removeMessageListener=KX.prototype.removeMessageListener;KX.prototype.addMessageListener=KX.prototype.addMessageListener;KX.prototype.sendMessage=KX.prototype.sendMessage;
51
- KX.prototype.changeReceiverId=KX.prototype.$g;KX.prototype.forceDisconnect=KX.prototype.ye;KX.prototype.cast=KX.prototype.cast;KX.prototype.setPlayerConfigInterceptor=KX.prototype.zd;KX.prototype.getReceiverName=KX.prototype.ze;KX.prototype.isCasting=KX.prototype.Nb;KX.prototype.canCast=KX.prototype.qe;KX.prototype.destroy=KX.prototype.destroy;var LX=class extends HX{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.$.bind(this);this.w=this.Y.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ba.bind(this);this.G=this.da.bind(this);this.F=this.O.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,
51
+ KX.prototype.changeReceiverId=KX.prototype.$g;KX.prototype.forceDisconnect=KX.prototype.xe;KX.prototype.cast=KX.prototype.cast;KX.prototype.setPlayerConfigInterceptor=KX.prototype.zd;KX.prototype.getReceiverName=KX.prototype.ye;KX.prototype.isCasting=KX.prototype.Nb;KX.prototype.canCast=KX.prototype.qe;KX.prototype.destroy=KX.prototype.destroy;var LX=class extends HX{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.$.bind(this);this.w=this.Y.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ba.bind(this);this.G=this.da.bind(this);this.F=this.O.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 _.D(_.gf));this.a(_.kp)}R(){this.a(_.jp)}$(){this.a(_.$o)}Y(a){a.isBuffering?
54
54
  this.a(_.dp):(a=this.player.isPaused()?_.jp:_.kp,this.a(a))}W(){this.j=1;this.player.trigger(new _.D(_.Cg))}U(){this.player.trigger(new _.D(_.Bg))}ba(){this.j=2}da(){this.a(_.ip)}M(a){const b=this.player.getStats();this.player.trigger(new _.D(_.Zc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}O(a){a=new _.I(_.F,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.D(_.q,{detail:a}));this.a(_.ap)}};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}sb(){return"Google Cast Framework"}tb(){return cast.framework.VERSION}xb(){return 0}getId(){return""}getCreativeId(){return""}Sb(){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}Vb(){return!1}ub(){return this.a.clickThroughUrl||
@@ -58,7 +58,7 @@ Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z
58
58
  Z.prototype.getSourceId=Z.prototype.Sb;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.xb;Z.prototype.getAdManagerVersion=Z.prototype.tb;Z.prototype.getAdManagerName=Z.prototype.sb;var MX=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Lb(){return!!this.a.find(a=>0===a.position)}Kb(){return!!this.a.find(a=>-1===a.position)}};MX.prototype.hasPostroll=MX.prototype.Kb;MX.prototype.hasPreroll=MX.prototype.Lb;MX.prototype.getCuePoints=MX.prototype.getCuePoints;var NX=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];kX().addEventListener(this.f,
59
59
  this.j)}load(){const a=this;return _.x(function*(){gX&&(gX=!1,jX(a,0))})}start(){return _.x(function*(){kX().play()})}w(){}resume(){-1!==this.getPosition()&&kX().play()}pause(){-1!==this.getPosition()&&kX().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*(){kX().removeEventListener(a.f,a.j)})}l(a){const b=cast.framework.events.EndedReason;
60
60
  switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=kX().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.D(_.Fc,{adsTimeline:new MX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:mX(this,_.tc,a);break;case cast.framework.events.EventType.BREAK_STARTED:mX(this,_.jc,a);break;case cast.framework.events.EventType.BREAK_ENDED:mX(this,_.kc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:mX(this,_.zc,a);
61
- break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(mX(this,_.yc,a),mX(this,_.Cc,a)):a.endedReason===b.STOPPED?mX(this,_.Cc,a):a.endedReason===b.END_OF_STREAM?(mX(this,_.nc,a),mX(this,_.Cc,a)):a.endedReason===b.ERROR&&jX(this,1);break;case cast.framework.events.EventType.PLAYING:mX(this,_.xc,a);break;case cast.framework.events.EventType.PAUSE:mX(this,_.vc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?mX(this,_.lc,a):mX(this,_.xc,a)}}};
61
+ break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(mX(this,_.yc,a),mX(this,_.Ac,a)):a.endedReason===b.STOPPED?mX(this,_.Ac,a):a.endedReason===b.END_OF_STREAM?(mX(this,_.nc,a),mX(this,_.Ac,a)):a.endedReason===b.ERROR&&jX(this,1);break;case cast.framework.events.EventType.PLAYING:mX(this,_.xc,a);break;case cast.framework.events.EventType.PAUSE:mX(this,_.vc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?mX(this,_.lc,a):mX(this,_.xc,a)}}};
62
62
  NX.prototype.getPosition=NX.prototype.getPosition;NX.prototype.setVolume=NX.prototype.setVolume;NX.prototype.getVolume=NX.prototype.getVolume;NX.prototype.skip=NX.prototype.skip;NX.prototype.pause=NX.prototype.pause;NX.prototype.resume=NX.prototype.resume;var gX=!1;var OX=class{constructor(a){this.Ya=a;this.a=this.f.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(nX(),this.a)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(nX(),this.a)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>oX(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
63
  _.kg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.lg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.mg}b&&this.Ya(new _.D(b,{detail:oX(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.Ya(new _.D(_.kg,{detail:b}))}};var PX=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;pX().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;pX().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}na(){return this.j}oa(){return null}Ra(){const a=
64
64
  this.ra();return a&&a.renditions[0]}Va(){const a=this.xa();return a&&a.renditions[0]}vb(){return null}Gb(){return null}Hb(){return null}Ia(){return null}ra(){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}xa(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.t&&(b=b.toString(),a=this.na().find(c=>c.id===b)||null)}return a}Db(){this.g.warn("Video tracks unavailable on Cast")}ya(a){a&&this.f&&
@@ -86,5 +86,5 @@ d.url,c.media.contentType=d.type,d.ac&&(c.media.hlsVideoSegmentFormat=HW(d.ac,_.
86
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))}_.hs(this.m)}}B(a){if(0<this.h.size){const b=FW(a.data);this.h.forEach(c=>c(b))}}};_.z(AW,yX);yX.prototype.updateContentMetadata=yX.prototype.Ci;yX.prototype.setContentMetadata=yX.prototype.$b;yX.prototype.getContentMetadata=yX.prototype.Fb;yX.prototype.isApiReady=yX.prototype.wc;
87
87
  yX.prototype.sendMessage=yX.prototype.sendMessage;yX.prototype.removeMessageListener=yX.prototype.removeMessageListener;yX.prototype.addMessageListener=yX.prototype.addMessageListener;yX.prototype.off=yX.prototype.off;yX.prototype.on=yX.prototype.on;yX.prototype.setLoadRequestDataInterceptor=yX.prototype.li;yX.prototype.setPlayerConfigInterceptor=yX.prototype.zd;yX.prototype.stop=yX.prototype.stop;yX.prototype.start=yX.prototype.start;yX.prototype.init=yX.prototype.init;yX.getInstance=zX;var xX=null;var RX=class{constructor(a){this.f=a;this.a=null;this.j=new _.St;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
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(CW,{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 _.D(_.Fc,{adsTimeline:new MX(a.breaks)})));break;case "isPlayingBreak":a.value?GX(this,_.jc):(GX(this,_.nc),GX(this,_.Cc),GX(this,_.kc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(GX(this,_.nc),GX(this,_.Cc)),GX(this,_.zc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?GX(this,_.vc):GX(this,_.xc))}}};RX.prototype.getPosition=RX.prototype.getPosition;
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 _.D(_.Fc,{adsTimeline:new MX(a.breaks)})));break;case "isPlayingBreak":a.value?GX(this,_.jc):(GX(this,_.nc),GX(this,_.Ac),GX(this,_.kc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(GX(this,_.nc),GX(this,_.Ac)),GX(this,_.zc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?GX(this,_.vc):GX(this,_.xc))}}};RX.prototype.getPosition=RX.prototype.getPosition;
90
90
  RX.prototype.setVolume=RX.prototype.setVolume;RX.prototype.getVolume=RX.prototype.getVolume;RX.prototype.skip=RX.prototype.skip;RX.prototype.pause=RX.prototype.pause;RX.prototype.resume=RX.prototype.resume;_.Bp(new class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.ud?!1:!(!b||!b.ima)}create(a){return new RX(a.a)}});_.Bp(new class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return zX().wc()?!(!b||!b.ima):!1}create(a){return new NX(a)}});};f.call(g, window);
package/cl.conviva.js CHANGED
@@ -3,7 +3,7 @@ _.Nk()||_.Kk()||_.Jk("Hisense")?(c=Conviva.Constants.DeviceType.SMARTTV,d=Conviv
3
3
  c);h(Conviva.Constants.DeviceMetadata.OS_NAME,e);h(Conviva.Constants.DeviceMetadata.OS_VERSION,b);h(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||d);h(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||f);return g},WV=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},XV=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},ZV=function(a,b,c,d){const e={};e[Conviva.Constants.PLAYER_NAME]=c;e[Conviva.Constants.VIEWER_ID]=b;e[Conviva.Constants.IS_LIVE]=
4
4
  WV(!!d);e[Conviva.Constants.ASSET_NAME]=SV;a&&(e[Conviva.Constants.ASSET_NAME]=a.getTitle(),e[Conviva.Constants.STREAM_URL]=a.getMediaUrl(),e[Conviva.Constants.DURATION]=a.getDuration(),e["c3.ad.id"]=YV(a.getId()),e["c3.ad.creativeId"]=YV(a.getCreativeId()),e["c3.ad.system"]=YV(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=YV(a.getApiFramework()),e["c3.ad.advertiser"]=YV(a.getAdvertiserName()),e["c3.ad.position"]=XV(a.getPodIndex()),e["c3.ad.technology"]=0===a.xb()?Conviva.Constants.AdType.CLIENT_SIDE:
5
5
  Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=YV(a.sb()),e["c3.ad.adManagerVersion"]=YV(a.tb()),e["c3.ad.advertiserCategory"]=YV(null),e["c3.ad.advertiserId"]=YV(null),e["c3.ad.breakId"]=YV(null),e["c3.ad.campaignName"]=YV(null),e["c3.ad.category"]=YV(null),e["c3.ad.classification"]=YV(null),e["c3.ad.creativeName"]=YV(null),e["c3.ad.sequence"]=YV(a.wb()),e["c3.ad.sessionStartEvent"]=YV(null),e["c3.ad.unitName"]=YV(null),e["c3.ad.dayPart"]=YV(null),b=a.getWrapperAdIds().slice(-1)[0]||
6
- a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=YV(b),e["c3.ad.firstAdSystem"]=YV(c),e["c3.ad.firstCreativeId"]=YV(a));return e},YV=function(a){return a?""+a:"NA"},cW=function(a){a.f.on(a.m,_.jc,a.C.bind(a));a.f.on(a.m,_.kc,a.F.bind(a));a.f.on(a.m,_.zc,a.L.bind(a));a.f.on(a.m,_.wc,a.l.bind(a));a.f.on(a.m,_.vc,a.l.bind(a));a.f.on(a.m,_.xc,a.l.bind(a));a.f.on(a.m,_.lc,a.l.bind(a));a.f.on(a.m,_.Cc,a.M.bind(a));
6
+ a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=YV(b),e["c3.ad.firstAdSystem"]=YV(c),e["c3.ad.firstCreativeId"]=YV(a));return e},YV=function(a){return a?""+a:"NA"},cW=function(a){a.f.on(a.m,_.jc,a.C.bind(a));a.f.on(a.m,_.kc,a.F.bind(a));a.f.on(a.m,_.zc,a.L.bind(a));a.f.on(a.m,_.wc,a.l.bind(a));a.f.on(a.m,_.vc,a.l.bind(a));a.f.on(a.m,_.xc,a.l.bind(a));a.f.on(a.m,_.lc,a.l.bind(a));a.f.on(a.m,_.Ac,a.M.bind(a));
7
7
  a.f.on(a.m,_.yc,a.K.bind(a));a.f.on(a.m,_.mc,a.G.bind(a));a.f.on(a.m,_.sc,a.I.bind(a));a.f.on(a.m,_.tc,a.J.bind(a));a.f.on(a.m,_.oc,a.H.bind(a));a.f.on(a.m,_.uc,a.S.bind(a));a.f.on(a.m,_.Dc,a.O.bind(a));a.f.on(a.m,_.q,b=>{var c=b.detail;if(10003===c.code&&(a.g.debug("onAdError()"),!a.h)){b=Conviva.Constants.ErrorSeverity;switch(c.data.errorType){case 0:c="Ad Load Error";break;case 1:c="Ad Play Error";break;default:c=SV}null===a.a&&$V(a,null);a.a.reportAdError(c,b.FATAL);a.h=!0;a.g.debug("Ad Playback Failure");
8
8
  aW(a,bW,c)}})},aW=function(a,b,c=SV){if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case bW:a.a.reportAdFailed(c,ZV(null,a.B,a.A));break;case dW:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();a.a=null;a.j=!1}},$V=function(a,b){if(!a.o){a.h=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.R()),b){const c=ZV(b,a.B,a.A,a.m.isLive()),d=String(b.tb()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.sb();e[Conviva.Constants.FRAMEWORK_VERSION]=
9
9
  d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(c){a.g.error("Could not create ad analytics session",c)}}},eW=function(a,b){const c={};c[Conviva.Constants.LOG_LEVEL]=Conviva.Constants.LogLevel.DEBUG;b.serviceUrl&&(a.g.warn("Touchstone URL is set. Do not set this in production!"),c[Conviva.Constants.GATEWAY_URL]=b.serviceUrl.replace(/\/$/,""));Conviva.Analytics.init(b.customerKey,null,c);Conviva.Analytics.setDeviceMetadata(VV(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,