@castlabs/prestoplay 6.2.6 → 6.2.7

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 (59) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/cjs/cl.adobe.js +3 -3
  4. package/cjs/cl.airplay.js +3 -3
  5. package/cjs/cl.broadpeak.js +6 -6
  6. package/cjs/cl.cast.js +101 -101
  7. package/cjs/cl.conviva.js +32 -32
  8. package/cjs/cl.core.js +362 -362
  9. package/cjs/cl.crypto.js +9 -9
  10. package/cjs/cl.dash.js +68 -68
  11. package/cjs/cl.externs.js +63 -32
  12. package/cjs/cl.freewheel.js +19 -19
  13. package/cjs/cl.hls.js +43 -43
  14. package/cjs/cl.hlssmpte.js +6 -6
  15. package/cjs/cl.htmlcue.js +30 -30
  16. package/cjs/cl.ima.js +18 -18
  17. package/cjs/cl.mse.js +252 -249
  18. package/cjs/cl.muxdata.js +11 -11
  19. package/cjs/cl.onboard.js +3 -3
  20. package/cjs/cl.persistent.js +13 -13
  21. package/cjs/cl.playlist.js +5 -5
  22. package/cjs/cl.smooth.js +69 -69
  23. package/cjs/cl.thumbnails.js +22 -22
  24. package/cjs/cl.tizen.js +69 -69
  25. package/cjs/cl.ttml.js +26 -26
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +12 -12
  28. package/cjs/cl.vr.js +24 -0
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +16 -16
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +78 -78
  35. package/cl.conviva.js +25 -25
  36. package/cl.core.js +172 -171
  37. package/cl.crypto.js +8 -8
  38. package/cl.dash.js +61 -61
  39. package/cl.externs.js +59 -32
  40. package/cl.freewheel.js +18 -18
  41. package/cl.hls.js +36 -36
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +24 -24
  44. package/cl.ima.js +15 -15
  45. package/cl.mse.js +223 -220
  46. package/cl.muxdata.js +9 -9
  47. package/cl.onboard.js +3 -3
  48. package/cl.persistent.js +9 -9
  49. package/cl.playlist.js +4 -4
  50. package/cl.smooth.js +57 -57
  51. package/cl.thumbnails.js +15 -15
  52. package/cl.tizen.js +55 -55
  53. package/cl.ttml.js +21 -21
  54. package/cl.verimatrix.js +4 -4
  55. package/cl.vimond.js +7 -7
  56. package/cl.vr.js +14 -0
  57. package/cl.vtt.js +7 -7
  58. package/cl.youbora.js +8 -8
  59. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 6.2.7
2
+
3
+ ## Changes
4
+
5
+ * Add `PlayerConfiguration.streaming.relativeTextTimestamp` config, which when
6
+ set to true will force text cue times to be offset by the containing media
7
+ segment start time.
8
+ * Add VR plugin for 360-degree video playback. See http://demo.castlabs.com/#/docs?q=clpp.vr.VrPlugin
9
+ for more information.
10
+ * Fix appending `merchant` name to the DRMtoday Onboard Fairplay certificate URI.
11
+ * Fixed an issue with very rapid loads where the engine will not be released properly
12
+
1
13
  # 6.2.6
2
14
 
3
15
  With this version we started to publish PRESTOplay to NPM. You can now simply integrate the
package/README.md CHANGED
@@ -20,7 +20,7 @@ Once installed, you can follow the [getting started guide](https://demo.castlabs
20
20
  example, but here is how it would look like:
21
21
 
22
22
  ```javascript
23
- import {clpp} from "@castlabs/pretoplay"
23
+ import {clpp} from "@castlabs/prestoplay"
24
24
  import "@castlabs/prestoplay/cl.mse"
25
25
  import "@castlabs/prestoplay/cl.dash"
26
26
 
package/cjs/cl.adobe.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var LK=function(){this.l=this.f=null;this.a="";this.g=new _.C("clpp.adobe.AdobePlugin")},OK=function(a){a.f=new _.Vf;a.f.on(a.l,_.Ce,function(){return MK(a)});a.f.on(a.l,_.Be,function(){s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.jd,function(){return NK(a)});a.f.on(a.l,_.he,function(b){b=b.detail;switch(b.currentState){case _.Ml:a.a.length||NK(a);s.Media.play(a.a,a.l.getPosition());break;case _.Ll:case _.Dl:MK(a);break;case _.Fl:case _.yl:case _.Jl:a.g.info("Close session for "+a.a+" in player state "+
3
- (b.currentState+".")),MK(a),s.Media.close(a.a),a.a=""}})},NK=function(a){var b=a.l.getLoadedSource();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.l.getDuration());s.Media.open(a.a,a.l.getDuration(),_.oa)},MK=function(a){s.Media.stop(a.a,a.l.getPosition())},PK=function(){};_.u(LK,_.So);LK.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.l=a,OK(this)):this.g.warn("Adobe API not available.")};
4
- LK.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""};LK.prototype.id=function(){return"adobe"};_.A("clpp.adobe.AdobeAnalyticsPlugin",LK);LK.Id="adobe";PK.prototype.create=function(){return new LK};_.fn(new PK);};
2
+ var f=function(window){var hL=function(){this.l=this.f=null;this.a="";this.g=new _.D("clpp.adobe.AdobePlugin")},kL=function(a){a.f=new _.Tf;a.f.on(a.l,_.De,function(){return iL(a)});a.f.on(a.l,_.Ce,function(){s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.jd,function(){return jL(a)});a.f.on(a.l,_.he,function(b){b=b.detail;switch(b.currentState){case _.Nl:a.a.length||jL(a);s.Media.play(a.a,a.l.getPosition());break;case _.Ml:case _.El:iL(a);break;case _.Gl:case _.zl:case _.Kl:a.g.info("Close session for "+a.a+" in player state "+
3
+ (b.currentState+".")),iL(a),s.Media.close(a.a),a.a=""}})},jL=function(a){var b=a.l.getLoadedSource();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.l.getDuration());s.Media.open(a.a,a.l.getDuration(),_.na)},iL=function(a){s.Media.stop(a.a,a.l.getPosition())},lL=function(){};_.u(hL,_.To);hL.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.l=a,kL(this)):this.g.warn("Adobe API not available.")};
4
+ hL.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""};hL.prototype.id=function(){return"adobe"};_.A("clpp.adobe.AdobeAnalyticsPlugin",hL);hL.Id="adobe";lL.prototype.create=function(){return new hL};_.gn(new lL);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.airplay.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var JK=function(){var a=this;this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.lh(function(){a.l.play()["catch"](function(){})});this.g=new _.Vf},KK=function(){};_.u(JK,_.So);_.h=JK.prototype;_.h.onPlayerCreated=function(a){this.l=a;this.a=a.getSurface().getMedia()};_.h.onContentWillLoad=function(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.Hi.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.gj.bind(this)))};
3
- _.h.onPlayerWillRelease=function(){this.m.stop();this.g.release()};_.h.id=function(){return"airplay"};_.h.Hi=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.l.trigger(new _.D(_.Ob,{canCast:this.f}))};_.h.gj=function(){var a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Nb:_.Mb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Ml)this.j?this.l.play()["catch"](function(){}):this.m.Z(.01);this.l.trigger(new _.D(a))};_.h.bb=function(){return this.h};
4
- _.h.Wd=function(){return this.f};_.h.xj=function(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.A("clpp.airplay.AirPlayPlugin",JK);JK.prototype.showCastMenu=JK.prototype.xj;JK.prototype.canCast=JK.prototype.Wd;JK.prototype.isCasting=JK.prototype.bb;JK.Id="airplay";KK.prototype.create=function(){return new JK};_.fn(new KK);};
2
+ var f=function(window){var fL=function(){var a=this;this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.lh(function(){a.l.play()["catch"](function(){})});this.g=new _.Tf},gL=function(){};_.u(fL,_.To);_.h=fL.prototype;_.h.onPlayerCreated=function(a){this.l=a;this.a=a.getSurface().getMedia()};_.h.onContentWillLoad=function(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.Mi.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.oj.bind(this)))};
3
+ _.h.onPlayerWillRelease=function(){this.m.stop();this.g.release()};_.h.id=function(){return"airplay"};_.h.Mi=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.l.trigger(new _.E(_.Ob,{canCast:this.f}))};_.h.oj=function(){var a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Nb:_.Mb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Nl)this.j?this.l.play()["catch"](function(){}):this.m.$(.01);this.l.trigger(new _.E(a))};_.h.bb=function(){return this.h};
4
+ _.h.Yd=function(){return this.f};_.h.Gj=function(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.A("clpp.airplay.AirPlayPlugin",fL);fL.prototype.showCastMenu=fL.prototype.Gj;fL.prototype.canCast=fL.prototype.Yd;fL.prototype.isCasting=fL.prototype.bb;fL.Id="airplay";gL.prototype.create=function(){return new fL};_.gn(new gL);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,10 +1,10 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var BK=function(a,b){this.l=a;this.f=b;this.a=new _.Vf;this.g=!1},CK=function(a){var b=GenericPlayerApi.call(this)||this;b.l=a;b.a=_.gi();return b},DK=function(){this.h=this.f=this.a=this.g=this.l=null;this.j=new _.Vf},EK=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.g||(a.g=SmartLib.getInstance(),a.g.init(c,d,e),typeof f===_.le&&a.g.setUUID(f))},FK=function(a,b){var c=b.customParameters||{};a.a=a.g.createStreamingSession();for(var d in c)a.a.setCustomParameter(d,
3
- c[d]);a.j.on(a.l,_.Wc,a.S.bind(a));a.h=new CK(a.l);a.a.attachPlayer(a.h)},GK=function(a,b){_.Yf(a.j);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},HK=function(){return!window.SmartLib||!window.GenericPlayerApi},IK=function(){};_.h=BK.prototype;_.h.init=function(){var a=this.l,b=this.a;b.on(a,_.he,this.Jg.bind(this));b.on(a,_.gc,this.Hg.bind(this));b.on(a,"seek",this.Ig.bind(this))};
4
- _.h.Hg=function(a){a=a.detail;typeof a.bandwidth===_.zd&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.h.Jg=function(a){var b=this.l,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.Dl&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Dl:c.notifyStallStart();break;case _.Ml:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Ll:c.notifyPause()}};_.h.Ig=function(){var a=1E3*this.l.getPosition();this.f.notifySeek(a)};_.h.release=function(){this.a&&(_.Yf(this.a),this.a=null)};_.u(CK,GenericPlayerApi);_.h=CK.prototype;_.h.getPlayerName=function(){return _.oa};_.h.getVersion=function(){return _.da};_.h.getOSName=function(){return this.a.os};_.h.getDeviceVersion=function(){return this.a.osVersion.name};_.h.getDeviceType=function(){return"browser"};_.h.getTotalDuration=function(){return this.l.isLive()?0:1E3*this.l.getDuration()};_.h.getCurrentPosition=function(){return 1E3*this.l.getPosition()};
5
- _.h.getCurrentBitrate=function(){var a=this.l.getStats();return(a?a.streamBandwidth:0)/1E3};_.u(DK,_.So);_.h=DK.prototype;_.h.onPlayerCreated=function(a){this.l=a};_.h.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(HK())return a.onError(new _.J(1,9,11E3));EK(this,d);FK(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.l.onError(new _.J(1,9,11001,{bpkErrorCode:f,message:e}));GK(c,void 0)}else b.url=e.getURL(),c.f=new BK(c.l,c.h),c.f.init()})}};
6
- _.h.S=function(a){a=a.detail;if(7003===a.code)GK(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.K)switch(a.category){case 3:GK(this,SmartLib.BPDecodingError);break;case 1:GK(this,SmartLib.BPNetworkingError);break;case 6:GK(this,SmartLib.BPAccessRightError);break;default:GK(this,SmartLib.BPUnspecifiedError)}};_.h.onPlayerWillRelease=function(){HK()||GK(this,SmartLib.BPSessionEndsNormally)};_.h.id=function(){return"broadpeak"};_.A("clpp.broadpeak.BroadpeakPlugin",DK);
7
- DK.isSdkMissing=HK;DK.Id="broadpeak";IK.prototype.create=function(){return new DK};_.fn(new IK);};
2
+ var f=function(window){var YK=function(a,b){this.l=a;this.f=b;this.a=new _.Tf;this.g=!1},ZK=function(a){var b=GenericPlayerApi.call(this)||this;b.l=a;b.a=_.hi();return b},$K=function(){this.h=this.f=this.a=this.g=this.l=null;this.j=new _.Tf},aL=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.g||(a.g=SmartLib.getInstance(),a.g.init(c,d,e),typeof f===_.le&&a.g.setUUID(f))},bL=function(a,b){var c=b.customParameters||{};a.a=a.g.createStreamingSession();for(var d in c)a.a.setCustomParameter(d,
3
+ c[d]);a.j.on(a.l,_.Vc,a.S.bind(a));a.h=new ZK(a.l);a.a.attachPlayer(a.h)},cL=function(a,b){_.Zf(a.j);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},dL=function(){return!window.SmartLib||!window.GenericPlayerApi},eL=function(){};_.h=YK.prototype;_.h.init=function(){var a=this.l,b=this.a;b.on(a,_.he,this.Mg.bind(this));b.on(a,_.fc,this.Kg.bind(this));b.on(a,"seek",this.Lg.bind(this))};
4
+ _.h.Kg=function(a){a=a.detail;typeof a.bandwidth===_.zd&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.h.Mg=function(a){var b=this.l,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.El&&c.notifyStallEnd(!b.isPaused());switch(d){case _.El:c.notifyStallStart();break;case _.Nl:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Ml:c.notifyPause()}};_.h.Lg=function(){var a=1E3*this.l.getPosition();this.f.notifySeek(a)};_.h.release=function(){this.a&&(_.Zf(this.a),this.a=null)};_.u(ZK,GenericPlayerApi);_.h=ZK.prototype;_.h.getPlayerName=function(){return _.na};_.h.getVersion=function(){return _.da};_.h.getOSName=function(){return this.a.os};_.h.getDeviceVersion=function(){return this.a.osVersion.name};_.h.getDeviceType=function(){return"browser"};_.h.getTotalDuration=function(){return this.l.isLive()?0:1E3*this.l.getDuration()};_.h.getCurrentPosition=function(){return 1E3*this.l.getPosition()};
5
+ _.h.getCurrentBitrate=function(){var a=this.l.getStats();return(a?a.streamBandwidth:0)/1E3};_.u($K,_.To);_.h=$K.prototype;_.h.onPlayerCreated=function(a){this.l=a};_.h.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(dL())return a.onError(new _.J(1,9,11E3));aL(this,d);bL(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.l.onError(new _.J(1,9,11001,{bpkErrorCode:f,message:e}));cL(c,void 0)}else b.url=e.getURL(),c.f=new YK(c.l,c.h),c.f.init()})}};
6
+ _.h.S=function(a){a=a.detail;if(7003===a.code)cL(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.K)switch(a.category){case 3:cL(this,SmartLib.BPDecodingError);break;case 1:cL(this,SmartLib.BPNetworkingError);break;case 6:cL(this,SmartLib.BPAccessRightError);break;default:cL(this,SmartLib.BPUnspecifiedError)}};_.h.onPlayerWillRelease=function(){dL()||cL(this,SmartLib.BPSessionEndsNormally)};_.h.id=function(){return"broadpeak"};_.A("clpp.broadpeak.BroadpeakPlugin",$K);
7
+ $K.isSdkMissing=dL;$K.Id="broadpeak";eL.prototype.create=function(){return new $K};_.gn(new eL);};
8
8
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
9
9
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
10
10
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.cast.js CHANGED
@@ -1,110 +1,110 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var YI="Cannot seek during ads playout.",ZI="Cannot switch track",$I="Media session does not exist.",aJ="No receivers available",bJ="Reset ABR functionality not available on cast.",cJ="SDK not yet ready",dJ="Sender is destroyed.",eJ="clpp.cast.CastProxy",fJ="clpp.cast.Player",gJ="clpp.cast.Receiver",hJ="urn:x-cast:castlabs",iJ="urn:x-cast:com.google.cast.media",jJ=function(a){return _.z(function(b){return 1==b.a?_.v(b,a.gc(_.Fd),2):_.v(b,a.gc(_.Ed),0)})},kJ=function(a,b){this.log=new _.C(b);this.a=
3
- a;this.j=null;this.g=_.yl;this.m=_.zl;this.h=2;this.B=Date.now();this.A=-1},lJ=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.Yc){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ad?"detail"===e&&(d[e]=f):e in Event||(d[e]=f)}return d}return typeof c===_.zd?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},mJ=function(a){if(typeof a!==_.le)return a;try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:
4
- "Infinity"===c?Infinity:c})}catch(b){return a}},nJ=function(a,b,c,d){var e,f,g,k,l,m,n,p;return _.z(function(q){if(1==q.a){if(b.includes(a.mimeType))return q["return"](a);g=f=e=null;for(k=0;k<b.length&&!f;)g=b[k++],f=_.ph(d,a.mimeType,g);if(!f||!g)return q.G(2);l=_.fh(a.url);return _.v(q,c.fetch(l).N,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Q(m.data)),p=URL.createObjectURL(new Blob([n])),e={url:p,kind:a.kind,language:a.language,label:a.label,mimeType:g});return q["return"](e)})},oJ=function(a,b){if(window.chrome&&
5
- chrome.cast&&chrome.cast.media){var c=chrome.cast.media.HlsSegmentFormat;var d=chrome.cast.media.HlsVideoSegmentFormat}else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.Ie:return d.FMP4;case _.He:return b===_.yg?d.MPEG2_TS:c.TS;case _.$b:return c.AAC;case _.ac:return c.AC3;case _.bc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.cc:return c.FMP4}},pJ=function(a){kJ.call(this,
6
- a,"clpp.cast.SenderStateManager");this.o=this.f=null;this.w=this.C.bind(this)},qJ=function(){this.h=new _.C("clpp.cast.SenderTrackManager");this.a=null;this.g=[];this.f={}},rJ=function(a){return(a=a.a?a.a.a:null)?a.activeTrackIds.map(function(b){return b.toString()}):[]},tJ=function(a,b){var c=rJ(a);return sJ(a,b).find(function(d){return c.includes(d.id)})||null},sJ=function(a,b){return a.g.filter(function(c){return c.type===b})},vJ=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=
7
- [+c.id];if(b!==_.L){var e=a.ia();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;uJ(a,b)},function(f){a.f[b]=null;a.h.debug(ZI,f)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){uJ(a,b)},function(f){a.h.debug(ZI,f)}))},uJ=function(a,b){b===_.N?a.a.trigger(new _.D(_.Gh)):b===_.L&&a.a.trigger(new _.D(_.Hh))},zJ=function(a,b,c,d){_.Mh.call(this);this.m=new _.C(_.wc);this.ba=a;this.w=new _.nh(b);
8
- this.$=c;this.ka=d;this.h=this.K=_.Ri();this.D=[];this.C=0;this.M=new _.ji;this.I=this.o=this.a=null;this.B=this.A=!1;this.Ga="";this.Ma=1E6;this.g=new qJ;this.g.Fb(this);this.j=new pJ(this);this.J=new _.Vf;this.f=null;this.H=new Set;this.T=this.Ki.bind(this);this.Ha=this.aj.bind(this);this.ca=this.Ui.bind(this);this.X=this.Oi.bind(this);this.P=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){wJ(!0)},
9
- 0)}});xJ(this);yJ.add(this)},AJ=function(a){var b,c;return _.z(function(d){if(1==d.a)return yJ["delete"](a),a.A&&(a.A=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Ha)),c=[],a.g&&(c.push(a.g.destroy()),a.g=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.v(d,Promise.all(c),2);a.B=!1;a.w&&(a.w.stop(),a.w=null);a.$=null;a.ka=null;_.w(d)})},
10
- xJ=function(a){if(!a.A&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.ba.length){a.A=!0;a.w.Pe();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.ba;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
11
- a.Ha);EJ&&a.w.Z(.02)}},OJ=function(a,b){JJ(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ca);b.addMessageListener(hJ,a.X)},JJ=function(a,b){b!==a.a&&(a.a=b,a.a&&(a.J.release(),a.I=null,a.o=null,a.o=new cast.framework.RemotePlayer,a.I=new cast.framework.RemotePlayerController(a.o),a.J.on(a.I,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Kg.bind(a)),a.g&&a.g.load(),a.j&&a.j.init(),a.trigger(new _.D(_.jd))))},PJ=function(a){return _.z(function(b){return a.bb()?
12
- b.G(0):_.v(b,cast.framework.CastContext.getInstance().requestSession(),0)})},QJ=function(a,b){var c,d,e,f,g,k,l,m,n,p,q;return _.z(function(r){switch(r.a){case 1:return c=chrome.cast.media.StreamType,d=_.$o,_.v(r,PJ(a),2);case 2:if(!b)return r["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);g.streamType=b.isLive?c.LIVE:c.BUFFERED;k=b;l=k.Ab;m=k.audioMimeType;g.hlsVideoSegmentFormat=oJ(l,d.VIDEO);g.hlsSegmentFormat=
13
- oJ(m,d.AUDIO);if(!b.Ja){r.G(3);break}if(!a.P){r.G(4);break}return _.v(r,Promise.resolve(a.P(b.Ja)),5);case 5:if(n=r.f)b.Ja=n;case 4:a.h=b.Ja;a.D=_.Ql(a.h);a.C=a.D.findIndex(function(x){return x.url===b.source.url});if(!b.Ja.remoteTextTracks){r.G(6);break}return _.v(r,Promise.all(b.Ja.remoteTextTracks.map(a.Ph.bind(a))),7);case 7:p=r.f,g.tracks=p.filter(function(x){return x}),b.Ja.remoteTextTracks=void 0;case 6:delete b.Ja.autoplay,b.Ja.startTime=null,g.customData={playerConfiguration:lJ(b.Ja)};case 3:return b.source.name&&
14
- a.Ed(b.source.name),a.f&&(g.metadata=a.f),q=new chrome.cast.media.LoadRequest(g),typeof b.autoplay===_.hc&&(q.autoplay=b.autoplay),typeof b.currentTime===_.zd&&(q.currentTime=b.currentTime),_.v(r,f.loadMedia(q),0)}})},RJ=function(a,b,c){c=void 0===c?0:c;var d,e;return _.z(function(f){(d=a.g.ia())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.g.ha())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.v(f,QJ(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),autoplay:b,
15
- Ja:a.h}),0)})},wJ=function(a){if(a){a=_.t(yJ);for(var b=a.next();!b.done;b=a.next())xJ(b.value)}},TJ=function(a,b,c){_.Mh.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.Yc?c:function(e,f){d.f&&e!==_.Fl&&e!==_.yl&&d.f.load(f)};this.a=SJ(this);this.g=new _.C(eJ);this.addDelegate(this.f)},SJ=function(a){return new zJ(a.h,function(){a.trigger(new _.D(_.nc))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;
16
- d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Ze&&(d.preferredAudioLanguage=c.Ze);c.hg&&(d.preferredTextLanguage=c.hg);_.Ym(a.f,null);a.trigger(new _.D("castingended"));a.j(b,d)},function(){return UJ(a)})},UJ=function(a){var b;return _.z(function(c){if(1==c.a)return a.trigger(new _.D(_.mc)),b=a.f.a,b!==a.a&&a.f&&a.a?_.v(c,a.f.release(),2):c["return"]();_.Ym(a.f,a.a);_.w(c)})},VJ=function(a){kJ.call(this,a,"clpp.cast.StateManager");this.I=this.Og.bind(this);this.H=this.Ng.bind(this);this.w=
17
- this.Qi.bind(this);this.o=this.Ii.bind(this);this.K=this.Qg.bind(this);this.J=this.Pg.bind(this);this.M=this.dj.bind(this);this.D=this.Ti.bind(this);this.C=this.S.bind(this);this.f=this.Mg.bind(this)},WJ=function(a){this.Qb=a;this.a=this.f.bind(this)},XJ=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},YJ=function(a){var b=
18
- a.dashTimedMetadata,c=_.Ae;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.ze)?_.eg:_.cg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},ZJ=function(){this.g=new _.C("clpp.cast.TrackManager");this.l=null;this.o=1E9;this.h=[];this.j=[];this.m=this.ij.bind(this);this.a=this.f=null},$J=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},bK=function(a){a.a=$J().getTextTracksManager();var b=a.a.getTracks();
19
- a.j=aK(_.L,b)},cK=function(a,b,c,d){c=_.vh(c).filter(function(k){return k});var e=!1,f=[];b===_.N?f=a.getAudioTracks():b===_.L&&(f=a.ea());if(c=c.find(function(k){var l=_.rh(k);return f.some(function(m){m=_.rh(m.language||"");return _.sh(l,m)})})){var g=_.rh(c);c=f.filter(function(k){k=_.rh(k.language||"");return _.sh(g,k)});f=c.length?c:f;e=e||!!c.length}_.Zg(d)&&(c=f.filter(function(k){return k.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),
20
- b===_.N?a.ma(e):b===_.L&&a.ua(e))},aK=function(a,b){for(var c=[],d=_.t(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.wg(e.trackId.toString(),a);f.roles=e.roles||[];f.kind=e.subtype||null;f.language=e.language||null;f.label=e.name||null;f.src=e.trackContentId||null;f.mimeType=e.trackContentType||null;e.customData&&(f.mimeType=e.customData.mimeType||f.mimeType,f.src=e.customData.url||f.src);f.renditions.push(new _.Dg(f.id,f));c.push(f)}return c},dK=function(){_.Mh.call(this);this.C=new _.C(fJ);
21
- this.g=this.o=_.Ri();this.w=null;this.j=-1;this.D=new _.ji;this.f=this.m=this.h=this.a=this.A=null;this.B=!1},eK=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},hK=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0}if(a&&a.drm){var d=a.drm,e=_.rj(d);if(e){var f=[_.Ec];_.Ql(a)[0].type!==_.Wb&&f.unshift(_.Fc);d.preferredDrmSystem===_.Ec&&f.reverse();for(var g,
22
- k;f.length&&!k;)g=f.shift(),k=e.Wa[g];k?(d=g===_.Fc?cast.framework.ContentProtection.WIDEVINE:g===_.Ec?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=k.licenseUrl,d={ldlDelay:0,customData:{}},fK(b,k,a,d),gK(b,k,a,d)):c()}else c()}else c()},fK=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.fh(e.url);e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,
23
- f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},gK=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e){e=_.gh({},e.buffer,200,"");b.modifiers.licenseResponse(c,e,d);return _.Q(e.data)}:a.licenseHandler=void 0},Z=function(a,b,c,d,e){this.a=a;this.f=b;this.h=typeof c===_.zd?c:1;this.j=typeof d===_.zd?d:1;this.g=typeof e===_.zd?e:0},iK=function(a){this.a=a},kK=function(a){this.l=a;this.a=null;
24
- this.g=this.Rg.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];jK().addEventListener(this.f,this.g)},nK=function(a,b,c){var d,
25
- e,f,g,k,l,m;return _.z(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.pf(n,2);lK=!1;e=_.fh(d);return _.v(n,c.fetch(e).N,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.Qg(f.data),k=new DOMParser,l=k.parseFromString(g,_.te),l.getElementsByTagName("vmap:VMAP").length)_.B("VMAP detected."),a.vmapAdsRequest=mK(g);else if(l.getElementsByTagName("VAST").length){_.B("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=mK(g);var q=new cast.framework.messages.Break("b1",
26
- [p.id],0);a.breakClips=[p];a.breaks=[q]}else _.B("Unsupported schema."),lK=!0;return _.qf(n,0)}m=_.rf(n);_.B("Failed to fetch an ad",m);lK=!0;_.w(n)})},mK=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},jK=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},pK=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=oK(a,c))&&(d={ad:c});a.l.trigger(new _.D(b,d))}},qK=function(a,
27
- b){var c=new _.J(1,10,10003,{errorType:b});a.l.onError(c)},oK=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.le&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.le&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,k){return g.position-k.position}).findIndex(function(g){return g===
28
- e})));c=new Z(d,e,b.index,b.total,f)}return c},rK=function(){this.a=!1;this.h=new _.C(gJ);this.f=this.l=null;this.g=new Set;this.A=this.Si.bind(this);this.w=this.Lg.bind(this);this.j=null;this.o=new _.Vf;this.m=null},tK=function(){return sK||(sK=new rK)},vK=function(a,b){a.h.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=cast.framework.CastReceiverContext.getInstance();c=d.getPlayerManager().getMediaInformation().hlsVideoSegmentFormat===c.FMP4?_.Ie:_.He;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,
29
- "\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var k=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=uK(k,_.ka),m=uK(k,"RESOLUTION"),n=_.t([]),p=n.next().value;n=n.next().value;m&&(m=_.t(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(k);++g}return f.join("\n")},uK=function(a,b){b+="\x3d";var c=a.indexOf(b);if(0<=c){var d=a.substring(c+b.length);d.startsWith('"')?(d=d.substring(1),d=d.substring(0,d.indexOf('"'))):
30
- (c=d.indexOf(","),0<=c&&(d=d.substring(0,c)))}return d},wK=function(a){this.f=a;this.a=null;this.g=new _.Vf;this.h=[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]},yK=function(a,b){var c=null,d=xK(a);d&&(c={ad:d});a.f.trigger(new _.D(b,c))},xK=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;
31
- var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(k){return k.id===a.a.breakId})||null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:b.breaks.filter(function(k){return 0<=k.position}).sort(function(k,l){return k.position-l.position}).findIndex(function(k){return k===c})}b.breakClips&&(d=b.breakClips.find(function(k){return k.id===a.a.breakClipId})||null);b=new Z(d,c,e,f,g)}return b},zK=function(){},AK=function(){};_.h=kJ.prototype;_.h.release=function(){this.ga(_.yl)};
32
- _.h.destroy=function(){this.j=this.a=null;return Promise.resolve()};_.h.getState=function(){return this.g};_.h.onError=function(a){a.severity===_.K&&this.ga(_.Jl)};
33
- _.h.ga=function(a){if(a!==this.g)if(this.g===_.Jl&&a!==_.yl)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.m=this.g;this.g=a;this.g===_.Dl?(this.A=b,this.a.trigger(new _.D(_.jc,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.m===_.Dl&&this.a.trigger(new _.D(_.ic,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.g,previousState:this.m,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.ol(this.j,this.g);this.a.trigger(new _.D(_.he,
34
- {detail:a}))}};_.A("clpp.cast.CastUtils",function(){});_.u(pJ,kJ);pJ.prototype.init=function(){var a=this.a,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.w),this.f=b,this.f.addUpdateListener(this.w),this.o=a.o)};pJ.prototype.destroy=function(){var a=this;return _.z(function(b){a.f&&(a.f.removeUpdateListener(a.w),a.f=null);return _.v(b,kJ.prototype.destroy.call(a),0)})};pJ.prototype.ga=function(a){var b=this.a.o;b&&b.isPlayingBreak||kJ.prototype.ga.call(this,a)};
35
- pJ.prototype.C=function(){if(this.f&&this.o&&!this.o.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.ga(_.Fl);break;case chrome.cast.media.IdleReason.ERROR:this.ga(_.Jl);break;default:this.ga(_.yl)}break;case chrome.cast.media.PlayerState.PLAYING:this.ga(_.Ml);break;case chrome.cast.media.PlayerState.PAUSED:this.ga(_.Ll);break;case chrome.cast.media.PlayerState.BUFFERING:this.ga(_.Dl)}};_.u(qJ,_.P);_.h=qJ.prototype;_.h.Fb=function(a){this.a=a};_.h.release=function(){this.g=[];this.f={}};
36
- _.h.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.g=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.yg;break;case chrome.cast.media.TrackType.AUDIO:c=_.N;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.wg(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;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);
37
- c.renditions.push(new _.Dg(c.id,c));return c}):[],this.a.trigger(new _.D(_.cp)))};_.h.destroy=function(){this.a=null};_.h.getVideoTracks=function(){return sJ(this,_.yg)};_.h.getAudioTracks=function(){return sJ(this,_.N)};_.h.ea=function(){return sJ(this,_.L)};_.h.fa=function(){var a=this.Ca();return a?a.renditions[0]:null};_.h.za=function(){var a=this.ha();return a?a.renditions[0]:null};_.h.Ba=function(){var a=this.ia();return a?a.renditions[0]:null};_.h.Pa=function(){return this.f[_.yg]||null};
38
- _.h.Ya=function(){return this.f[_.N]||null};_.h.Za=function(){return this.f[_.L]||null};_.h.Ca=function(){return tJ(this,_.yg)};_.h.ha=function(){return tJ(this,_.N)};_.h.ia=function(){return tJ(this,_.L)};_.h.Va=function(a){vJ(this,_.yg,a)};_.h.ma=function(a){vJ(this,_.N,a)};_.h.ua=function(a){vJ(this,_.L,a)};_.h.Ua=function(a){this.Va(a&&a.track)};_.h.gb=function(a){this.ma(a&&a.track)};_.h.hb=function(a){this.ua(a&&a.track)};_.h.addTextTrack=function(){return _.z(function(a){_.w(a)})};_.h.ja=function(){return!0};
39
- qJ.prototype.isAbrEnabled=qJ.prototype.ja;qJ.prototype.addTextTrack=qJ.prototype.addTextTrack;qJ.prototype.setTextRendition=qJ.prototype.hb;qJ.prototype.setAudioRendition=qJ.prototype.gb;qJ.prototype.setVideoRendition=qJ.prototype.Ua;qJ.prototype.setTextTrack=qJ.prototype.ua;qJ.prototype.setAudioTrack=qJ.prototype.ma;qJ.prototype.setVideoTrack=qJ.prototype.Va;qJ.prototype.getTextTrack=qJ.prototype.ia;qJ.prototype.getAudioTrack=qJ.prototype.ha;qJ.prototype.getVideoTrack=qJ.prototype.Ca;
40
- qJ.prototype.getLoadingTextRendition=qJ.prototype.Za;qJ.prototype.getLoadingAudioRendition=qJ.prototype.Ya;qJ.prototype.getLoadingVideoRendition=qJ.prototype.Pa;qJ.prototype.getTextRendition=qJ.prototype.Ba;qJ.prototype.getAudioRendition=qJ.prototype.za;qJ.prototype.getVideoRendition=qJ.prototype.fa;qJ.prototype.getTextTracks=qJ.prototype.ea;qJ.prototype.getAudioTracks=qJ.prototype.getAudioTracks;qJ.prototype.getVideoTracks=qJ.prototype.getVideoTracks;_.u(zJ,_.Mh);_.h=zJ.prototype;_.h.init=function(a,b){this.h=this.K=b};_.h.unload=function(){var a=this;return new Promise(function(b,c){a.g&&a.g.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.h.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.h.destroy=function(){return _.z(function(a){_.w(a)})};_.h.bd=function(a){this.P=a};_.h.ac=function(){return this.A};_.h.bb=function(){return this.B};_.h.he=function(){return this.Ga};
41
- _.h.sendMessage=function(a,b){var c=this,d,e,f;return _.z(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.J(1,8,8004,void 0);g.G(2);break}_.pf(g,3);return _.v(g,e.sendMessage(a,lJ(b)),5);case 5:_.qf(g,2);break;case 3:f=_.rf(g),d=new _.J(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.w(g)}})};
42
- _.h.cast=function(){var a=this,b,c;return _.z(function(d){if(1==d.a){if(!a.ac())throw a.m.warn(cJ),new _.J(1,8,8001,void 0);if(!EJ)throw a.m.warn(aJ),new _.J(1,8,8002,void 0);if(a.bb())throw a.m.warn("Already casting"),new _.J(1,8,8003,void 0);_.pf(d,2);return _.v(d,PJ(a),4)}if(2!=d.a)return _.qf(d,0);b=_.rf(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.J(1,8,8E3,c);})};
43
- _.h.ce=function(){this.bb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.h.addMessageListener=function(a){typeof a===_.Yc&&this.H.add(a)};_.h.removeMessageListener=function(a){typeof a===_.Yc&&this.H["delete"](a)};_.h.play=function(){var a=this;return this.isEnded()?RJ(this,!0):new Promise(function(b,c){if(!a.a)return c($I);a.a.play(null,b,c)})};_.h.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c($I);a.a.pause(null,b,c)})};
44
- _.h.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};_.h.isEnded=function(){return this.getState()===_.Fl};_.h.seek=function(a){var b=this;return this.isEnded()?RJ(this,!1,a):new Promise(function(c,d){b.a||d($I);b.o.isPlayingBreak&&d(YI);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.D(_.Ce));b.a.seek(e,function(){b.trigger(new _.D(_.Be));c()},d)})};_.h.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
45
- _.h.getDuration=function(){return this.a&&this.a.media&&typeof this.a.media.duration===_.zd?this.a.media.duration:0};_.h.setDrmCustomDataModifier=function(){};_.h.setCdnErrorCallback=function(){};_.h.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.h.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(iJ,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};_.h.getVolume=function(){return this.a&&this.a.volume.level};
2
+ var f=function(window){var uJ="Cannot seek during ads playout.",vJ="Cannot switch track",wJ="Media session does not exist.",xJ="No receivers available",yJ="Reset ABR functionality not available on cast.",zJ="SDK not yet ready",AJ="Sender is destroyed.",BJ="clpp.cast.CastProxy",CJ="clpp.cast.Player",DJ="clpp.cast.Receiver",EJ="urn:x-cast:castlabs",FJ="urn:x-cast:com.google.cast.media",GJ=function(a){return _.z(function(b){return 1==b.a?_.v(b,a.gc(_.Fd),2):_.v(b,a.gc(_.Ed),0)})},HJ=function(a,b){this.log=new _.D(b);this.a=
3
+ a;this.j=null;this.g=_.zl;this.m=_.Al;this.h=2;this.B=Date.now();this.A=-1},IJ=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.Yc){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ad?"detail"===e&&(d[e]=f):e in Event||(d[e]=f)}return d}return typeof c===_.zd?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},JJ=function(a){if(typeof a!==_.le)return a;try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:
4
+ "Infinity"===c?Infinity:c})}catch(b){return a}},KJ=function(a,b,c,d){var e,f,g,k,l,m,n,p;return _.z(function(q){if(1==q.a){if(b.includes(a.mimeType))return q["return"](a);g=f=e=null;for(k=0;k<b.length&&!f;)g=b[k++],f=_.qh(d,a.mimeType,g);if(!f||!g)return q.H(2);l=_.gh(a.url);return _.v(q,c.fetch(l).N,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Q(m.data)),p=URL.createObjectURL(new Blob([n])),e={url:p,kind:a.kind,language:a.language,label:a.label,mimeType:g});return q["return"](e)})},LJ=function(a,b){if(window.chrome&&
5
+ chrome.cast&&chrome.cast.media){var c=chrome.cast.media.HlsSegmentFormat;var d=chrome.cast.media.HlsVideoSegmentFormat}else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.Je:return d.FMP4;case _.Ie:return b===_.zg?d.MPEG2_TS:c.TS;case _.$b:return c.AAC;case _.ac:return c.AC3;case _.bc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.cc:return c.FMP4}},MJ=function(a){HJ.call(this,
6
+ a,"clpp.cast.SenderStateManager");this.o=this.f=null;this.w=this.C.bind(this)},NJ=function(){this.h=new _.D("clpp.cast.SenderTrackManager");this.a=null;this.g=[];this.f={}},OJ=function(a){return(a=a.a?a.a.a:null)?a.activeTrackIds.map(function(b){return b.toString()}):[]},QJ=function(a,b){var c=OJ(a);return PJ(a,b).find(function(d){return c.includes(d.id)})||null},PJ=function(a,b){return a.g.filter(function(c){return c.type===b})},SJ=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=
7
+ [+c.id];if(b!==_.L){var e=a.ja();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;RJ(a,b)},function(f){a.f[b]=null;a.h.debug(vJ,f)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){RJ(a,b)},function(f){a.h.debug(vJ,f)}))},RJ=function(a,b){b===_.N?a.a.trigger(new _.E(_.Hh)):b===_.L&&a.a.trigger(new _.E(_.Ih))},WJ=function(a,b,c,d){_.Nh.call(this);this.m=new _.D(_.wc);this.aa=a;this.w=new _.oh(b);
8
+ this.Y=c;this.ga=d;this.h=this.K=_.Si();this.D=[];this.C=0;this.L=new _.ki;this.I=this.o=this.a=null;this.B=this.A=!1;this.wa="";this.Ma=1E6;this.g=new NJ;this.g.Fb(this);this.j=new MJ(this);this.J=new _.Tf;this.f=null;this.G=new Set;this.T=this.Pi.bind(this);this.Ha=this.ij.bind(this);this.ca=this.Zi.bind(this);this.U=this.Ti.bind(this);this.O=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){TJ(!0)},
9
+ 0)}});UJ(this);VJ.add(this)},XJ=function(a){var b,c;return _.z(function(d){if(1==d.a)return VJ["delete"](a),a.A&&(a.A=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Ha)),c=[],a.g&&(c.push(a.g.destroy()),a.g=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.v(d,Promise.all(c),2);a.B=!1;a.w&&(a.w.stop(),a.w=null);a.Y=null;a.ga=null;_.w(d)})},
10
+ UJ=function(a){if(!a.A&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.aa.length){a.A=!0;a.w.Re();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.aa;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
11
+ a.Ha);aK&&a.w.$(.02)}},kK=function(a,b){fK(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ca);b.addMessageListener(EJ,a.U)},fK=function(a,b){b!==a.a&&(a.a=b,a.a&&(a.J.release(),a.I=null,a.o=null,a.o=new cast.framework.RemotePlayer,a.I=new cast.framework.RemotePlayerController(a.o),a.J.on(a.I,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Ng.bind(a)),a.g&&a.g.load(),a.j&&a.j.init(),a.trigger(new _.E(_.jd))))},lK=function(a){return _.z(function(b){return a.bb()?
12
+ b.H(0):_.v(b,cast.framework.CastContext.getInstance().requestSession(),0)})},mK=function(a,b){var c,d,e,f,g,k,l,m,n,p,q;return _.z(function(r){switch(r.a){case 1:return c=chrome.cast.media.StreamType,d=_.ap,_.v(r,lK(a),2);case 2:if(!b)return r["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);g.streamType=b.isLive?c.LIVE:c.BUFFERED;k=b;l=k.Ab;m=k.audioMimeType;g.hlsVideoSegmentFormat=LJ(l,d.VIDEO);g.hlsSegmentFormat=
13
+ LJ(m,d.AUDIO);if(!b.Ja){r.H(3);break}if(!a.O){r.H(4);break}return _.v(r,Promise.resolve(a.O(b.Ja)),5);case 5:if(n=r.f)b.Ja=n;case 4:a.h=b.Ja;a.D=_.Rl(a.h);a.C=a.D.findIndex(function(x){return x.url===b.source.url});if(!b.Ja.remoteTextTracks){r.H(6);break}return _.v(r,Promise.all(b.Ja.remoteTextTracks.map(a.Sh.bind(a))),7);case 7:p=r.f,g.tracks=p.filter(function(x){return x}),b.Ja.remoteTextTracks=void 0;case 6:delete b.Ja.autoplay,b.Ja.startTime=null,g.customData={playerConfiguration:IJ(b.Ja)};case 3:return b.source.name&&
14
+ a.Gd(b.source.name),a.f&&(g.metadata=a.f),q=new chrome.cast.media.LoadRequest(g),typeof b.autoplay===_.hc&&(q.autoplay=b.autoplay),typeof b.currentTime===_.zd&&(q.currentTime=b.currentTime),_.v(r,f.loadMedia(q),0)}})},nK=function(a,b,c){c=void 0===c?0:c;var d,e;return _.z(function(f){(d=a.g.ja())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.g.ia())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.v(f,mK(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),autoplay:b,
15
+ Ja:a.h}),0)})},TJ=function(a){if(a){a=_.t(VJ);for(var b=a.next();!b.done;b=a.next())UJ(b.value)}},pK=function(a,b,c){_.Nh.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.Yc?c:function(e,f){d.f&&e!==_.Gl&&e!==_.zl&&d.f.load(f)};this.a=oK(this);this.g=new _.D(BJ);this.addDelegate(this.f)},oK=function(a){return new WJ(a.h,function(){a.trigger(new _.E(_.nc))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;
16
+ d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.af&&(d.preferredAudioLanguage=c.af);c.jg&&(d.preferredTextLanguage=c.jg);_.Zm(a.f,null);a.trigger(new _.E("castingended"));a.j(b,d)},function(){return qK(a)})},qK=function(a){var b;return _.z(function(c){if(1==c.a)return a.trigger(new _.E(_.mc)),b=a.f.a,b!==a.a&&a.f&&a.a?_.v(c,a.f.release(),2):c["return"]();_.Zm(a.f,a.a);_.w(c)})},rK=function(a){HJ.call(this,a,"clpp.cast.StateManager");this.I=this.Rg.bind(this);this.G=this.Qg.bind(this);this.w=
17
+ this.Vi.bind(this);this.o=this.Ni.bind(this);this.K=this.Tg.bind(this);this.J=this.Sg.bind(this);this.L=this.lj.bind(this);this.D=this.Yi.bind(this);this.C=this.S.bind(this);this.f=this.Pg.bind(this)},sK=function(a){this.Qb=a;this.a=this.f.bind(this)},tK=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},uK=function(a){var b=
18
+ a.dashTimedMetadata,c=_.Be;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Ae)?_.fg:_.dg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},vK=function(){this.g=new _.D("clpp.cast.TrackManager");this.l=null;this.o=1E9;this.h=[];this.j=[];this.m=this.qj.bind(this);this.a=this.f=null},wK=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},yK=function(a){a.a=wK().getTextTracksManager();var b=a.a.getTracks();
19
+ a.j=xK(_.L,b)},zK=function(a,b,c,d){c=_.wh(c).filter(function(k){return k});var e=!1,f=[];b===_.N?f=a.getAudioTracks():b===_.L&&(f=a.ea());if(c=c.find(function(k){var l=_.sh(k);return f.some(function(m){m=_.sh(m.language||"");return _.th(l,m)})})){var g=_.sh(c);c=f.filter(function(k){k=_.sh(k.language||"");return _.th(g,k)});f=c.length?c:f;e=e||!!c.length}_.$g(d)&&(c=f.filter(function(k){return k.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),
20
+ b===_.N?a.na(e):b===_.L&&a.ua(e))},xK=function(a,b){for(var c=[],d=_.t(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.xg(e.trackId.toString(),a);f.roles=e.roles||[];f.kind=e.subtype||null;f.language=e.language||null;f.label=e.name||null;f.src=e.trackContentId||null;f.mimeType=e.trackContentType||null;e.customData&&(f.mimeType=e.customData.mimeType||f.mimeType,f.src=e.customData.url||f.src);f.renditions.push(new _.Eg(f.id,f));c.push(f)}return c},AK=function(){_.Nh.call(this);this.C=new _.D(CJ);
21
+ this.g=this.o=_.Si();this.w=null;this.j=-1;this.D=new _.ki;this.f=this.m=this.h=this.a=this.A=null;this.B=!1},BK=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},EK=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0}if(a&&a.drm){var d=a.drm,e=_.sj(d);if(e){var f=[_.Ec];_.Rl(a)[0].type!==_.Wb&&f.unshift(_.Fc);d.preferredDrmSystem===_.Ec&&f.reverse();for(var g,
22
+ k;f.length&&!k;)g=f.shift(),k=e.Wa[g];k?(d=g===_.Fc?cast.framework.ContentProtection.WIDEVINE:g===_.Ec?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=k.licenseUrl,d={ldlDelay:0,customData:{}},CK(b,k,a,d),DK(b,k,a,d)):c()}else c()}else c()},CK=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.gh(e.url);e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,
23
+ f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},DK=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e){e=_.hh({},e.buffer,200,"");b.modifiers.licenseResponse(c,e,d);return _.Q(e.data)}:a.licenseHandler=void 0},Z=function(a,b,c,d,e){this.a=a;this.f=b;this.h=typeof c===_.zd?c:1;this.j=typeof d===_.zd?d:1;this.g=typeof e===_.zd?e:0},FK=function(a){this.a=a},HK=function(a){this.l=a;this.a=null;
24
+ this.g=this.Ug.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];GK().addEventListener(this.f,this.g)},KK=function(a,b,c){var d,
25
+ e,f,g,k,l,m;return _.z(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.qf(n,2);IK=!1;e=_.gh(d);return _.v(n,c.fetch(e).N,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.Rg(f.data),k=new DOMParser,l=k.parseFromString(g,_.ue),l.getElementsByTagName("vmap:VMAP").length)_.B("VMAP detected."),a.vmapAdsRequest=JK(g);else if(l.getElementsByTagName("VAST").length){_.B("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=JK(g);var q=new cast.framework.messages.Break("b1",
26
+ [p.id],0);a.breakClips=[p];a.breaks=[q]}else _.B("Unsupported schema."),IK=!0;return _.rf(n,0)}m=_.sf(n);_.B("Failed to fetch an ad",m);IK=!0;_.w(n)})},JK=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},GK=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},MK=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=LK(a,c))&&(d={ad:c});a.l.trigger(new _.E(b,d))}},NK=function(a,
27
+ b){var c=new _.J(1,10,10003,{errorType:b});a.l.onError(c)},LK=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.le&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.le&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,k){return g.position-k.position}).findIndex(function(g){return g===
28
+ e})));c=new Z(d,e,b.index,b.total,f)}return c},OK=function(){this.a=!1;this.h=new _.D(DJ);this.f=this.l=null;this.g=new Set;this.A=this.Xi.bind(this);this.w=this.Og.bind(this);this.j=null;this.o=new _.Tf;this.m=null},QK=function(){return PK||(PK=new OK)},SK=function(a,b){a.h.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=cast.framework.CastReceiverContext.getInstance();c=d.getPlayerManager().getMediaInformation().hlsVideoSegmentFormat===c.FMP4?_.Je:_.Ie;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,
29
+ "\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var k=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=RK(k,_.ka),m=RK(k,"RESOLUTION"),n=_.t([]),p=n.next().value;n=n.next().value;m&&(m=_.t(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(k);++g}return f.join("\n")},RK=function(a,b){b+="\x3d";var c=a.indexOf(b);if(0<=c){var d=a.substring(c+b.length);d.startsWith('"')?(d=d.substring(1),d=d.substring(0,d.indexOf('"'))):
30
+ (c=d.indexOf(","),0<=c&&(d=d.substring(0,c)))}return d},TK=function(a){this.f=a;this.a=null;this.g=new _.Tf;this.h=[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]},VK=function(a,b){var c=null,d=UK(a);d&&(c={ad:d});a.f.trigger(new _.E(b,c))},UK=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;
31
+ var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(k){return k.id===a.a.breakId})||null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:b.breaks.filter(function(k){return 0<=k.position}).sort(function(k,l){return k.position-l.position}).findIndex(function(k){return k===c})}b.breakClips&&(d=b.breakClips.find(function(k){return k.id===a.a.breakClipId})||null);b=new Z(d,c,e,f,g)}return b},WK=function(){},XK=function(){};_.h=HJ.prototype;_.h.release=function(){this.ha(_.zl)};
32
+ _.h.destroy=function(){this.j=this.a=null;return Promise.resolve()};_.h.getState=function(){return this.g};_.h.onError=function(a){a.severity===_.K&&this.ha(_.Kl)};
33
+ _.h.ha=function(a){if(a!==this.g)if(this.g===_.Kl&&a!==_.zl)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.m=this.g;this.g=a;this.g===_.El?(this.A=b,this.a.trigger(new _.E(_.jc,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.m===_.El&&this.a.trigger(new _.E(_.ic,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.g,previousState:this.m,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.pl(this.j,this.g);this.a.trigger(new _.E(_.he,
34
+ {detail:a}))}};_.A("clpp.cast.CastUtils",function(){});_.u(MJ,HJ);MJ.prototype.init=function(){var a=this.a,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.w),this.f=b,this.f.addUpdateListener(this.w),this.o=a.o)};MJ.prototype.destroy=function(){var a=this;return _.z(function(b){a.f&&(a.f.removeUpdateListener(a.w),a.f=null);return _.v(b,HJ.prototype.destroy.call(a),0)})};MJ.prototype.ha=function(a){var b=this.a.o;b&&b.isPlayingBreak||HJ.prototype.ha.call(this,a)};
35
+ MJ.prototype.C=function(){if(this.f&&this.o&&!this.o.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.ha(_.Gl);break;case chrome.cast.media.IdleReason.ERROR:this.ha(_.Kl);break;default:this.ha(_.zl)}break;case chrome.cast.media.PlayerState.PLAYING:this.ha(_.Nl);break;case chrome.cast.media.PlayerState.PAUSED:this.ha(_.Ml);break;case chrome.cast.media.PlayerState.BUFFERING:this.ha(_.El)}};_.u(NJ,_.P);_.h=NJ.prototype;_.h.Fb=function(a){this.a=a};_.h.release=function(){this.g=[];this.f={}};
36
+ _.h.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.g=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.zg;break;case chrome.cast.media.TrackType.AUDIO:c=_.N;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.xg(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;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);
37
+ c.renditions.push(new _.Eg(c.id,c));return c}):[],this.a.trigger(new _.E(_.dp)))};_.h.destroy=function(){this.a=null};_.h.getVideoTracks=function(){return PJ(this,_.zg)};_.h.getAudioTracks=function(){return PJ(this,_.N)};_.h.ea=function(){return PJ(this,_.L)};_.h.fa=function(){var a=this.Da();return a?a.renditions[0]:null};_.h.Aa=function(){var a=this.ia();return a?a.renditions[0]:null};_.h.Ca=function(){var a=this.ja();return a?a.renditions[0]:null};_.h.Pa=function(){return this.f[_.zg]||null};
38
+ _.h.Ya=function(){return this.f[_.N]||null};_.h.Za=function(){return this.f[_.L]||null};_.h.Da=function(){return QJ(this,_.zg)};_.h.ia=function(){return QJ(this,_.N)};_.h.ja=function(){return QJ(this,_.L)};_.h.Va=function(a){SJ(this,_.zg,a)};_.h.na=function(a){SJ(this,_.N,a)};_.h.ua=function(a){SJ(this,_.L,a)};_.h.Ua=function(a){this.Va(a&&a.track)};_.h.gb=function(a){this.na(a&&a.track)};_.h.hb=function(a){this.ua(a&&a.track)};_.h.addTextTrack=function(){return _.z(function(a){_.w(a)})};_.h.ka=function(){return!0};
39
+ NJ.prototype.isAbrEnabled=NJ.prototype.ka;NJ.prototype.addTextTrack=NJ.prototype.addTextTrack;NJ.prototype.setTextRendition=NJ.prototype.hb;NJ.prototype.setAudioRendition=NJ.prototype.gb;NJ.prototype.setVideoRendition=NJ.prototype.Ua;NJ.prototype.setTextTrack=NJ.prototype.ua;NJ.prototype.setAudioTrack=NJ.prototype.na;NJ.prototype.setVideoTrack=NJ.prototype.Va;NJ.prototype.getTextTrack=NJ.prototype.ja;NJ.prototype.getAudioTrack=NJ.prototype.ia;NJ.prototype.getVideoTrack=NJ.prototype.Da;
40
+ NJ.prototype.getLoadingTextRendition=NJ.prototype.Za;NJ.prototype.getLoadingAudioRendition=NJ.prototype.Ya;NJ.prototype.getLoadingVideoRendition=NJ.prototype.Pa;NJ.prototype.getTextRendition=NJ.prototype.Ca;NJ.prototype.getAudioRendition=NJ.prototype.Aa;NJ.prototype.getVideoRendition=NJ.prototype.fa;NJ.prototype.getTextTracks=NJ.prototype.ea;NJ.prototype.getAudioTracks=NJ.prototype.getAudioTracks;NJ.prototype.getVideoTracks=NJ.prototype.getVideoTracks;_.u(WJ,_.Nh);_.h=WJ.prototype;_.h.init=function(a,b){this.h=this.K=b};_.h.unload=function(){var a=this;return new Promise(function(b,c){a.g&&a.g.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.h.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.h.destroy=function(){return _.z(function(a){_.w(a)})};_.h.cd=function(a){this.O=a};_.h.ac=function(){return this.A};_.h.bb=function(){return this.B};_.h.ke=function(){return this.wa};
41
+ _.h.sendMessage=function(a,b){var c=this,d,e,f;return _.z(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.J(1,8,8004,void 0);g.H(2);break}_.qf(g,3);return _.v(g,e.sendMessage(a,IJ(b)),5);case 5:_.rf(g,2);break;case 3:f=_.sf(g),d=new _.J(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.w(g)}})};
42
+ _.h.cast=function(){var a=this,b,c;return _.z(function(d){if(1==d.a){if(!a.ac())throw a.m.warn(zJ),new _.J(1,8,8001,void 0);if(!aK)throw a.m.warn(xJ),new _.J(1,8,8002,void 0);if(a.bb())throw a.m.warn("Already casting"),new _.J(1,8,8003,void 0);_.qf(d,2);return _.v(d,lK(a),4)}if(2!=d.a)return _.rf(d,0);b=_.sf(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.J(1,8,8E3,c);})};
43
+ _.h.ee=function(){this.bb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.h.addMessageListener=function(a){typeof a===_.Yc&&this.G.add(a)};_.h.removeMessageListener=function(a){typeof a===_.Yc&&this.G["delete"](a)};_.h.play=function(){var a=this;return this.isEnded()?nK(this,!0):new Promise(function(b,c){if(!a.a)return c(wJ);a.a.play(null,b,c)})};_.h.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(wJ);a.a.pause(null,b,c)})};
44
+ _.h.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};_.h.isEnded=function(){return this.getState()===_.Gl};_.h.seek=function(a){var b=this;return this.isEnded()?nK(this,!1,a):new Promise(function(c,d){b.a||d(wJ);b.o.isPlayingBreak&&d(uJ);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.E(_.De));b.a.seek(e,function(){b.trigger(new _.E(_.Ce));c()},d)})};_.h.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
45
+ _.h.getDuration=function(){return this.a&&this.a.media&&typeof this.a.media.duration===_.zd?this.a.media.duration:0};_.h.setDrmCustomDataModifier=function(){};_.h.setCdnErrorCallback=function(){};_.h.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.h.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(FJ,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};_.h.getVolume=function(){return this.a&&this.a.volume.level};
46
46
  _.h.setVolume=function(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))};_.h.isMuted=function(){return this.a&&this.a.volume.muted};_.h.setMuted=function(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};_.h.getPresentationStartTime=function(){return this.a&&this.a.media.startAbsoluteTime||0};
47
- _.h.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.zd&&typeof b.end===_.zd&&(a={start:b.start,end:b.end})}return a};_.h.getState=function(){return this.j?this.j.getState():_.zl};_.h.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?mJ(this.a.customData.stats):_.ul()};_.h.isLive=function(){return-1===this.getDuration()};
48
- _.h.load=function(a){var b=this,c,d;return _.z(function(e){if(!b.ac())return b.m.warn(cJ),e["return"]();if(!EJ)return b.m.warn(aJ),e["return"]();b.D=_.Ql(a);_.Wi(a)&&(b.h=_.Vi(b.K,a));c=b.D[b.C];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,Ja:b.h,Ab:c.Ab,audioMimeType:c.audioMimeType};return _.v(e,QJ(b,d),0)})};_.h.getBufferInfo=function(){return new _.Lh};_.h.getTrackManager=function(){return this.g};_.h.getConfiguration=function(){return this.h};_.h.getSurface=function(){return null};
49
- _.h.setNetworkEngine=function(a){this.M=a};_.h.getNetworkEngine=function(){return this.M};_.h.getSourceIndex=function(){return this.C};_.h.setSourceIndex=function(a){this.C=a};_.h.getLoadedSource=function(){return this.D[this.C]};_.h.getPeriods=function(){return[]};_.h.getDrmInfo=function(){return null};_.h.getTimelineCues=function(){return[]};_.h.resetAbr=function(){this.m.warn(bJ)};_.h.onError=function(a){if(a&&(this.trigger(new _.D(_.Wc,{detail:a})),this.j))this.j.onError(a)};_.h.namespace=function(){return _.wc};
50
- _.h.canPlay=function(){return this.ac()?2:0};_.h.Le=function(a){this.f=a};_.h.Xd=function(){this.f=null};_.h.Ed=function(a){this.f||(this.f={metadataType:chrome.cast.media.MetadataType.GENERIC});this.f.title=a};_.h.Ke=function(a){this.f||(this.f={metadataType:chrome.cast.media.MetadataType.GENERIC});this.f.images=[{url:a}]};_.h.Je=function(a){this.f||(this.f={});this.f.metadataType=chrome.cast.media.MetadataType.MUSIC_TRACK;this.f.artist=a};
51
- _.h.Me=function(a){this.f||(this.f={metadataType:chrome.cast.media.MetadataType.GENERIC});this.f.releaseDate=a};_.h.Ki=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;EJ=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.Ga=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Pe()};
52
- _.h.aj=function(a){this.m.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.B=!0;OJ(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.bb()||(this.B=!0,OJ(this,a.session),this.ka());break;case cast.framework.SessionState.SESSION_ENDED:if(this.bb()&&this.a){var b=this.a.media,c=this.g.ha(),d=this.g.ia();c=c&&c.language||void 0;d=d&&d.language||void 0;this.$(this.getState(),{source:{url:b.contentId,type:b.contentType,
53
- isLive:b.streamType===chrome.cast.media.StreamType.LIVE},currentTime:this.getPosition(),hg:d,Ze:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ca);a.session.removeMessageListener(hJ,this.X);this.B=!1;this.a=null;this.J.release();this.o=this.I=null}};_.h.Ui=function(a){this.m.debug("New media session",a.mediaSession);JJ(this,a.mediaSession)};_.h.Oi=function(a,b){if(a===hJ&&0<this.H.size){var c=mJ(b);this.H.forEach(function(d){return d(c)})}};
54
- _.h.Kg=function(a){this.trigger(new _.D(_.ue,{currentTime:a.value}))};_.h.Ph=function(a){var b=this,c,d;return _.z(function(e){if(1==e.a)return c=null,_.v(e,nJ(a,[_.se,_.Vb],b.M,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ma++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.h.getTextDisplayer=function(){return null};
55
- zJ.prototype.getTextDisplayer=zJ.prototype.getTextDisplayer;zJ.prototype.getNetworkEngine=zJ.prototype.getNetworkEngine;zJ.prototype.setNetworkEngine=zJ.prototype.setNetworkEngine;var EJ=!1,yJ=new Set;window.__onGCastApiAvailable=wJ;_.u(TJ,_.Mh);_.h=TJ.prototype;_.h.destroy=function(){var a=this;return _.z(function(b){if(1==b.a)return a.a?_.v(b,AJ(a.a),3):b.G(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.w(b)})};_.h.Wd=function(){return!!this.a&&this.a.ac()&&EJ};_.h.bb=function(){return!!this.a&&this.a.bb()};_.h.he=function(){return this.a?this.a.he():""};_.h.bd=function(a){this.a&&this.a.bd(a)};
56
- _.h.cast=function(a){var b=this,c,d,e;return _.z(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();var g=null,k=b.f.getLoadedSource();if(k){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.ha();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.ia())l.language&&(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=
57
- l.roles[0]);l=k&&typeof k.isLive===_.hc?k.isLive:b.f.isLive();g={source:k,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Ab:m,audioMimeType:p,Ja:g}}c=g;_.pf(f,2);return _.v(f,b.a.cast(),4);case 4:return b.f&&b.a?_.v(f,UJ(b),5):f["return"]();case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.v(f,b.f.load(a),7);if(b.a.a){f.G(7);break}return _.v(f,QJ(b.a,c),7);case 7:_.qf(f,0);break;case 2:d=_.rf(f),b.g.error("Error while trying to cast",
58
- d),e=new _.D(_.Wc,{detail:d}),b.trigger(e),_.w(f)}})};_.h.ce=function(){this.a&&this.a.ce()};_.h.Gg=function(a){var b=this;return _.z(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.v(c,AJ(b.a),2):c.G(2)}b.a=SJ(b);_.w(c)})};_.h.sendMessage=function(a){var b=this;return _.z(function(c){return b.a?_.v(c,b.a.sendMessage(hJ,a),0):(b.g.warn(dJ),c["return"]())})};_.h.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(dJ)};
59
- _.h.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(dJ)};_.h.Le=function(a){this.a&&this.a.Le(a)};_.h.Xd=function(){this.a&&this.a.Xd()};_.h.Ed=function(a){this.a&&this.a.Ed(a)};_.h.Ke=function(a){this.a&&this.a.Ke(a)};_.h.Je=function(a){this.a&&this.a.Je(a)};_.h.Me=function(a){this.a&&this.a.Me(a)};_.A(eJ,TJ);TJ.prototype.setContentReleaseDate=TJ.prototype.Me;TJ.prototype.setContentArtist=TJ.prototype.Je;TJ.prototype.setContentImage=TJ.prototype.Ke;
60
- TJ.prototype.setContentTitle=TJ.prototype.Ed;TJ.prototype.clearContentMetadata=TJ.prototype.Xd;TJ.prototype.setContentMetadata=TJ.prototype.Le;TJ.prototype.removeMessageListener=TJ.prototype.removeMessageListener;TJ.prototype.addMessageListener=TJ.prototype.addMessageListener;TJ.prototype.sendMessage=TJ.prototype.sendMessage;TJ.prototype.changeReceiverId=TJ.prototype.Gg;TJ.prototype.forceDisconnect=TJ.prototype.ce;TJ.prototype.cast=TJ.prototype.cast;TJ.prototype.setPlayerConfigInterceptor=TJ.prototype.bd;
61
- TJ.prototype.getReceiverName=TJ.prototype.he;TJ.prototype.isCasting=TJ.prototype.bb;TJ.prototype.canCast=TJ.prototype.Wd;TJ.prototype.destroy=TJ.prototype.destroy;_.u(VJ,kJ);_.h=VJ.prototype;
62
- _.h.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,this.H);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.M);b.addEventListener(a.PLAYER_LOADING,this.D);b.addEventListener(a.ERROR,this.C);b.addEventListener(a.BITRATE_CHANGED,this.f)};
63
- _.h.destroy=function(){var a=this,b,c;return _.z(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.I);c.removeEventListener(b.PAUSE,a.H);c.removeEventListener(b.MEDIA_FINISHED,a.w);c.removeEventListener(b.BUFFERING,a.o);c.removeEventListener(b.SEEKING,a.K);c.removeEventListener(b.SEEKED,a.J);c.removeEventListener(b.STALLED,a.M);c.removeEventListener(b.PLAYER_LOADING,a.D);c.removeEventListener(b.ERROR,
64
- a.C);c.removeEventListener(b.BITRATE_CHANGED,a.f);return _.v(d,kJ.prototype.destroy.call(a),0)})};_.h.Og=function(){this.a.trigger(new _.D(_.Pd));this.ga(_.Ml)};_.h.Ng=function(){this.ga(_.Ll)};_.h.Qi=function(){this.ga(_.Fl)};_.h.Ii=function(a){a.isBuffering?this.ga(_.Dl):(a=this.a.isPaused()?_.Ll:_.Ml,this.ga(a))};_.h.Qg=function(){this.h=1;this.a.trigger(new _.D(_.Ce))};_.h.Pg=function(){this.a.trigger(new _.D(_.Be))};_.h.dj=function(){this.h=2};_.h.Ti=function(){this.ga(_.Kl)};
65
- _.h.Mg=function(a){var b=this.a.getStats();this.a.trigger(new _.D(_.gc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.h.S=function(a){a=new _.J(_.K,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.a.trigger(new _.D(_.Wc,{detail:a}));this.ga(_.Jl)};WJ.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(XJ(),this.a)};WJ.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(XJ(),this.a)};WJ.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return YJ(a)})};
66
- WJ.prototype.f=function(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=_.fg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.hg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.ig}b&&this.Qb(new _.D(b,{detail:YJ(a.timedMetadataInfo)}))}else for(a=_.t(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Qb(new _.D(_.fg,{detail:b.value}))};_.u(ZJ,_.P);_.h=ZJ.prototype;_.h.Fb=function(a){this.l=a;$J().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.h.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.h.load=function(){};_.h.destroy=function(){this.l=null;$J().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.h.getVideoTracks=function(){return[]};_.h.getAudioTracks=function(){return this.h};_.h.ea=function(){return this.j};_.h.fa=function(){return null};
67
- _.h.za=function(){var a=this.ha();return a&&a.renditions[0]};_.h.Ba=function(){var a=this.ia();return a&&a.renditions[0]};_.h.Pa=function(){return null};_.h.Ya=function(){return null};_.h.Za=function(){return null};_.h.Ca=function(){return null};_.h.ha=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.zd&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
68
- _.h.ia=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.zd&&(b=b.toString(),a=this.ea().find(function(c){return c.id===b})||null)}return a};_.h.Va=function(){this.g.warn("Video tracks unavailable on Cast")};_.h.ma=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.h.ua=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.h.Ua=function(){this.g.warn("Video renditions unavailable on Cast")};_.h.gb=function(a){this.ma(a&&a.track)};
47
+ _.h.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.zd&&typeof b.end===_.zd&&(a={start:b.start,end:b.end})}return a};_.h.getState=function(){return this.j?this.j.getState():_.Al};_.h.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?JJ(this.a.customData.stats):_.vl()};_.h.isLive=function(){return-1===this.getDuration()};
48
+ _.h.load=function(a){var b=this,c,d;return _.z(function(e){if(!b.ac())return b.m.warn(zJ),e["return"]();if(!aK)return b.m.warn(xJ),e["return"]();b.D=_.Rl(a);_.Vi(a)&&(b.h=_.Ui(b.K,a));c=b.D[b.C];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,Ja:b.h,Ab:c.Ab,audioMimeType:c.audioMimeType};return _.v(e,mK(b,d),0)})};_.h.getBufferInfo=function(){return new _.Mh};_.h.getTrackManager=function(){return this.g};_.h.getConfiguration=function(){return this.h};_.h.getSurface=function(){return null};
49
+ _.h.setNetworkEngine=function(a){this.L=a};_.h.getNetworkEngine=function(){return this.L};_.h.getSourceIndex=function(){return this.C};_.h.setSourceIndex=function(a){this.C=a};_.h.getLoadedSource=function(){return this.D[this.C]};_.h.getPeriods=function(){return[]};_.h.getDrmInfo=function(){return null};_.h.getTimelineCues=function(){return[]};_.h.resetAbr=function(){this.m.warn(yJ)};_.h.onError=function(a){if(a&&(this.trigger(new _.E(_.Vc,{detail:a})),this.j))this.j.onError(a)};_.h.namespace=function(){return _.wc};
50
+ _.h.canPlay=function(){return this.ac()?2:0};_.h.Ne=function(a){this.f=a};_.h.Zd=function(){this.f=null};_.h.Gd=function(a){this.f||(this.f={metadataType:chrome.cast.media.MetadataType.GENERIC});this.f.title=a};_.h.Me=function(a){this.f||(this.f={metadataType:chrome.cast.media.MetadataType.GENERIC});this.f.images=[{url:a}]};_.h.Le=function(a){this.f||(this.f={});this.f.metadataType=chrome.cast.media.MetadataType.MUSIC_TRACK;this.f.artist=a};
51
+ _.h.Oe=function(a){this.f||(this.f={metadataType:chrome.cast.media.MetadataType.GENERIC});this.f.releaseDate=a};_.h.Pi=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;aK=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.wa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Re()};
52
+ _.h.ij=function(a){this.m.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.B=!0;kK(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.bb()||(this.B=!0,kK(this,a.session),this.ga());break;case cast.framework.SessionState.SESSION_ENDED:if(this.bb()&&this.a){var b=this.a.media,c=this.g.ia(),d=this.g.ja();c=c&&c.language||void 0;d=d&&d.language||void 0;this.Y(this.getState(),{source:{url:b.contentId,type:b.contentType,
53
+ isLive:b.streamType===chrome.cast.media.StreamType.LIVE},currentTime:this.getPosition(),jg:d,af:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ca);a.session.removeMessageListener(EJ,this.U);this.B=!1;this.a=null;this.J.release();this.o=this.I=null}};_.h.Zi=function(a){this.m.debug("New media session",a.mediaSession);fK(this,a.mediaSession)};_.h.Ti=function(a,b){if(a===EJ&&0<this.G.size){var c=JJ(b);this.G.forEach(function(d){return d(c)})}};
54
+ _.h.Ng=function(a){this.trigger(new _.E(_.ve,{currentTime:a.value}))};_.h.Sh=function(a){var b=this,c,d;return _.z(function(e){if(1==e.a)return c=null,_.v(e,KJ(a,[_.te,_.Vb],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ma++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.h.getTextDisplayer=function(){return null};
55
+ WJ.prototype.getTextDisplayer=WJ.prototype.getTextDisplayer;WJ.prototype.getNetworkEngine=WJ.prototype.getNetworkEngine;WJ.prototype.setNetworkEngine=WJ.prototype.setNetworkEngine;var aK=!1,VJ=new Set;window.__onGCastApiAvailable=TJ;_.u(pK,_.Nh);_.h=pK.prototype;_.h.destroy=function(){var a=this;return _.z(function(b){if(1==b.a)return a.a?_.v(b,XJ(a.a),3):b.H(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.w(b)})};_.h.Yd=function(){return!!this.a&&this.a.ac()&&aK};_.h.bb=function(){return!!this.a&&this.a.bb()};_.h.ke=function(){return this.a?this.a.ke():""};_.h.cd=function(a){this.a&&this.a.cd(a)};
56
+ _.h.cast=function(a){var b=this,c,d,e;return _.z(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();var g=null,k=b.f.getLoadedSource();if(k){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.ia();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.ja())l.language&&(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=
57
+ l.roles[0]);l=k&&typeof k.isLive===_.hc?k.isLive:b.f.isLive();g={source:k,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Ab:m,audioMimeType:p,Ja:g}}c=g;_.qf(f,2);return _.v(f,b.a.cast(),4);case 4:return b.f&&b.a?_.v(f,qK(b),5):f["return"]();case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.v(f,b.f.load(a),7);if(b.a.a){f.H(7);break}return _.v(f,mK(b.a,c),7);case 7:_.rf(f,0);break;case 2:d=_.sf(f),b.g.error("Error while trying to cast",
58
+ d),e=new _.E(_.Vc,{detail:d}),b.trigger(e),_.w(f)}})};_.h.ee=function(){this.a&&this.a.ee()};_.h.Jg=function(a){var b=this;return _.z(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.v(c,XJ(b.a),2):c.H(2)}b.a=oK(b);_.w(c)})};_.h.sendMessage=function(a){var b=this;return _.z(function(c){return b.a?_.v(c,b.a.sendMessage(EJ,a),0):(b.g.warn(AJ),c["return"]())})};_.h.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(AJ)};
59
+ _.h.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(AJ)};_.h.Ne=function(a){this.a&&this.a.Ne(a)};_.h.Zd=function(){this.a&&this.a.Zd()};_.h.Gd=function(a){this.a&&this.a.Gd(a)};_.h.Me=function(a){this.a&&this.a.Me(a)};_.h.Le=function(a){this.a&&this.a.Le(a)};_.h.Oe=function(a){this.a&&this.a.Oe(a)};_.A(BJ,pK);pK.prototype.setContentReleaseDate=pK.prototype.Oe;pK.prototype.setContentArtist=pK.prototype.Le;pK.prototype.setContentImage=pK.prototype.Me;
60
+ pK.prototype.setContentTitle=pK.prototype.Gd;pK.prototype.clearContentMetadata=pK.prototype.Zd;pK.prototype.setContentMetadata=pK.prototype.Ne;pK.prototype.removeMessageListener=pK.prototype.removeMessageListener;pK.prototype.addMessageListener=pK.prototype.addMessageListener;pK.prototype.sendMessage=pK.prototype.sendMessage;pK.prototype.changeReceiverId=pK.prototype.Jg;pK.prototype.forceDisconnect=pK.prototype.ee;pK.prototype.cast=pK.prototype.cast;pK.prototype.setPlayerConfigInterceptor=pK.prototype.cd;
61
+ pK.prototype.getReceiverName=pK.prototype.ke;pK.prototype.isCasting=pK.prototype.bb;pK.prototype.canCast=pK.prototype.Yd;pK.prototype.destroy=pK.prototype.destroy;_.u(rK,HJ);_.h=rK.prototype;
62
+ _.h.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,this.G);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.D);b.addEventListener(a.ERROR,this.C);b.addEventListener(a.BITRATE_CHANGED,this.f)};
63
+ _.h.destroy=function(){var a=this,b,c;return _.z(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.I);c.removeEventListener(b.PAUSE,a.G);c.removeEventListener(b.MEDIA_FINISHED,a.w);c.removeEventListener(b.BUFFERING,a.o);c.removeEventListener(b.SEEKING,a.K);c.removeEventListener(b.SEEKED,a.J);c.removeEventListener(b.STALLED,a.L);c.removeEventListener(b.PLAYER_LOADING,a.D);c.removeEventListener(b.ERROR,
64
+ a.C);c.removeEventListener(b.BITRATE_CHANGED,a.f);return _.v(d,HJ.prototype.destroy.call(a),0)})};_.h.Rg=function(){this.a.trigger(new _.E(_.Pd));this.ha(_.Nl)};_.h.Qg=function(){this.ha(_.Ml)};_.h.Vi=function(){this.ha(_.Gl)};_.h.Ni=function(a){a.isBuffering?this.ha(_.El):(a=this.a.isPaused()?_.Ml:_.Nl,this.ha(a))};_.h.Tg=function(){this.h=1;this.a.trigger(new _.E(_.De))};_.h.Sg=function(){this.a.trigger(new _.E(_.Ce))};_.h.lj=function(){this.h=2};_.h.Yi=function(){this.ha(_.Ll)};
65
+ _.h.Pg=function(a){var b=this.a.getStats();this.a.trigger(new _.E(_.fc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.h.S=function(a){a=new _.J(_.K,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.a.trigger(new _.E(_.Vc,{detail:a}));this.ha(_.Kl)};sK.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(tK(),this.a)};sK.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(tK(),this.a)};sK.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return uK(a)})};
66
+ sK.prototype.f=function(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=_.gg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.ig;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.jg}b&&this.Qb(new _.E(b,{detail:uK(a.timedMetadataInfo)}))}else for(a=_.t(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Qb(new _.E(_.gg,{detail:b.value}))};_.u(vK,_.P);_.h=vK.prototype;_.h.Fb=function(a){this.l=a;wK().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.h.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.h.load=function(){};_.h.destroy=function(){this.l=null;wK().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.h.getVideoTracks=function(){return[]};_.h.getAudioTracks=function(){return this.h};_.h.ea=function(){return this.j};_.h.fa=function(){return null};
67
+ _.h.Aa=function(){var a=this.ia();return a&&a.renditions[0]};_.h.Ca=function(){var a=this.ja();return a&&a.renditions[0]};_.h.Pa=function(){return null};_.h.Ya=function(){return null};_.h.Za=function(){return null};_.h.Da=function(){return null};_.h.ia=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.zd&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
68
+ _.h.ja=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.zd&&(b=b.toString(),a=this.ea().find(function(c){return c.id===b})||null)}return a};_.h.Va=function(){this.g.warn("Video tracks unavailable on Cast")};_.h.na=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.h.ua=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.h.Ua=function(){this.g.warn("Video renditions unavailable on Cast")};_.h.gb=function(a){this.na(a&&a.track)};
69
69
  _.h.hb=function(a){this.ua(a&&a.track)};
70
- _.h.addTextTrack=function(a){var b=this,c,d,e;return _.z(function(f){if(1==f.a)return c=b.l.getConfiguration(),_.v(f,nJ(a,Object.values(cast.framework.messages.CaptionMimeType),b.l.getNetworkEngine(),c),2);if((d=f.f)&&b.a){e=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);e.isInBand=!1;e.language=d.language;e.name=d.label;e.subtype=d.kind;e.trackContentId=d.url;e.trackContentType=d.mimeType;e.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([e]),bK(b)}catch(g){throw b.g.warn("failed on track",
71
- a),g;}}_.w(f)})};_.h.ja=function(){return!0};_.h.ij=function(){this.f=$J().getAudioTracksManager();var a=this.f.getTracks();this.h=aK(_.N,a);bK(this);a=this.l.getConfiguration();cK(this,_.N,a.preferredAudioLanguage,a.preferredAudioRole);cK(this,_.L,a.preferredTextLanguage,a.preferredTextRole)};ZJ.prototype.isAbrEnabled=ZJ.prototype.ja;ZJ.prototype.addTextTrack=ZJ.prototype.addTextTrack;ZJ.prototype.setTextRendition=ZJ.prototype.hb;ZJ.prototype.setAudioRendition=ZJ.prototype.gb;
72
- ZJ.prototype.setVideoRendition=ZJ.prototype.Ua;ZJ.prototype.setTextTrack=ZJ.prototype.ua;ZJ.prototype.setAudioTrack=ZJ.prototype.ma;ZJ.prototype.setVideoTrack=ZJ.prototype.Va;ZJ.prototype.getTextTrack=ZJ.prototype.ia;ZJ.prototype.getAudioTrack=ZJ.prototype.ha;ZJ.prototype.getVideoTrack=ZJ.prototype.Ca;ZJ.prototype.getLoadingTextRendition=ZJ.prototype.Za;ZJ.prototype.getLoadingAudioRendition=ZJ.prototype.Ya;ZJ.prototype.getLoadingVideoRendition=ZJ.prototype.Pa;ZJ.prototype.getTextRendition=ZJ.prototype.Ba;
73
- ZJ.prototype.getAudioRendition=ZJ.prototype.za;ZJ.prototype.getVideoRendition=ZJ.prototype.fa;ZJ.prototype.getTextTracks=ZJ.prototype.ea;ZJ.prototype.getAudioTracks=ZJ.prototype.getAudioTracks;ZJ.prototype.getVideoTracks=ZJ.prototype.getVideoTracks;_.u(dK,_.Mh);_.h=dK.prototype;_.h.init=function(a,b){var c=this;this.A=a;b&&(this.g=this.o=b);var d=eK();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.Vi.bind(this));d.setMediaPlaybackInfoHandler(this.yg.bind(this));this.a=new VJ(this);this.a.init();this.h=new ZJ;this.h.Fb(this);this.m=new WJ(function(e){return c.trigger(e)});this.m.init()};
74
- _.h.unload=function(){var a=eK();a.getPlayerState()!==cast.framework.messages.PlayerState.IDLE&&a.stop();this.h&&this.h.release();this.m&&this.m.release();this.f=null;return Promise.resolve()};_.h.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.h.destroy=function(){var a=this;return _.z(function(b){if(1==b.a)return a.A=null,a.o=_.Ri(),a.g=a.o,a.j=-1,a.w=null,a.a?_.v(b,a.a.destroy(),3):b.G(2);2!=b.a&&(a.a=null);a.h&&(a.h.destroy(),a.h=null);_.w(b)})};
75
- _.h.play=function(){var a=eK();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.h.pause=function(){var a=eK();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.h.isPaused=function(){return eK().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
76
- _.h.isEnded=function(){return eK().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.h.seek=function(a){var b=eK();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(YI);b.seek(a);return Promise.resolve()};_.h.getPosition=function(){return eK().getCurrentTimeSec()};_.h.getDuration=function(){return eK().getDurationSec()};_.h.getPlaybackRate=function(){return eK().getPlaybackRate()};
77
- _.h.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;eK().sendLocalMediaRequest(b)}};_.h.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.h.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.h.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
78
- _.h.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.h.getLoadedSource=function(){var a=eK().getMediaInformation();if(a){var b=eK().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.w&&-1!==this.j?this.w[this.j]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,ak:b,name:c}}return null};_.h.getDrmInfo=function(){return null};
79
- _.h.getPresentationStartTime=function(){var a=eK().getMediaInformation();return a?a.startAbsoluteTime||0:0};_.h.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=eK().getLiveSeekableRange();b&&typeof b.start===_.zd&&typeof b.end===_.zd&&(a={start:b.start,end:b.end})}return a};_.h.getState=function(){return this.a?this.a.getState():_.zl};
80
- _.h.getStats=function(){var a=_.ul();if(this.f){a=eK().getStats();this.f.m=a.estimatedBandwidth||NaN;this.f.A=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.j=a.width||NaN;b.f=c;b=this.f;c=typeof a.decodedFrames===_.zd?a.decodedFrames:NaN;b.h=typeof a.droppedFrames===_.zd?a.droppedFrames:NaN;b.g=c;a=this.f.getStats()}return a};_.h.isLive=function(){return-1===this.getDuration()};
81
- _.h.load=function(a){var b=this,c,d;return _.z(function(e){b.f=new _.tl;b.a.j=b.f.a;b.w=_.Ql(a);_.Wi(a)&&(b.g=_.Vi(b.o,a));if(b.B)return b.B=!1,e["return"]();c=b.w[b.j];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.g.autoplay;typeof b.g.startTime===_.zd&&(d.currentTime=b.g.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:lJ(b.g),local:!0};return _.v(e,eK().load(d),0)})};_.h.getBufferInfo=function(){this.C.warn(_.ma);return new _.Lh};
82
- _.h.getTrackManager=function(){return this.h};_.h.getConfiguration=function(){return this.g};_.h.getSurface=function(){return this.A};_.h.setNetworkEngine=function(a){this.D=a};_.h.getNetworkEngine=function(){return this.D};_.h.getSourceIndex=function(){return this.j};_.h.setSourceIndex=function(a){this.j=a};_.h.getPeriods=function(){return[]};_.h.namespace=function(){return fJ};_.h.getTimelineCues=function(){return this.m&&this.m.getTimelineCues()||[]};_.h.resetAbr=function(){this.C.warn(bJ)};
83
- _.h.onError=function(a){this.trigger(new _.D(_.Wc,{detail:a}))};_.h.canPlay=function(){return _.qi()?2:0};_.h.Vi=function(a){a.customData||(a.customData={});a.customData.stats=lJ(this.getStats());return a};_.h.yg=function(a,b){var c=null;a.media.customData&&(c=mJ(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.zd?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;hK(c,b);return b};_.h.getTextDisplayer=function(){return null};
84
- _.h.setDrmCustomDataModifier=function(){};_.h.setCdnErrorCallback=function(){};dK.prototype.getTextDisplayer=dK.prototype.getTextDisplayer;dK.prototype.getNetworkEngine=dK.prototype.getNetworkEngine;dK.prototype.setNetworkEngine=dK.prototype.setNetworkEngine;_.h=Z.prototype;_.h.mb=function(){return"Google Cast Framework"};_.h.nb=function(){return cast.framework.VERSION};_.h.sb=function(){return 0};_.h.aa=function(){return""};_.h.getCreativeId=function(){return""};_.h.getApiFramework=function(){return null};_.h.getAdSystem=function(){return""};_.h.getAdvertiserName=function(){return""};_.h.getTitle=function(){return this.a.title||""};_.h.getDuration=function(){return this.a.duration||0};_.h.getSkipTimeOffset=function(){return this.a.whenSkippable||0};
70
+ _.h.addTextTrack=function(a){var b=this,c,d,e;return _.z(function(f){if(1==f.a)return c=b.l.getConfiguration(),_.v(f,KJ(a,Object.values(cast.framework.messages.CaptionMimeType),b.l.getNetworkEngine(),c),2);if((d=f.f)&&b.a){e=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);e.isInBand=!1;e.language=d.language;e.name=d.label;e.subtype=d.kind;e.trackContentId=d.url;e.trackContentType=d.mimeType;e.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([e]),yK(b)}catch(g){throw b.g.warn("failed on track",
71
+ a),g;}}_.w(f)})};_.h.ka=function(){return!0};_.h.qj=function(){this.f=wK().getAudioTracksManager();var a=this.f.getTracks();this.h=xK(_.N,a);yK(this);a=this.l.getConfiguration();zK(this,_.N,a.preferredAudioLanguage,a.preferredAudioRole);zK(this,_.L,a.preferredTextLanguage,a.preferredTextRole)};vK.prototype.isAbrEnabled=vK.prototype.ka;vK.prototype.addTextTrack=vK.prototype.addTextTrack;vK.prototype.setTextRendition=vK.prototype.hb;vK.prototype.setAudioRendition=vK.prototype.gb;
72
+ vK.prototype.setVideoRendition=vK.prototype.Ua;vK.prototype.setTextTrack=vK.prototype.ua;vK.prototype.setAudioTrack=vK.prototype.na;vK.prototype.setVideoTrack=vK.prototype.Va;vK.prototype.getTextTrack=vK.prototype.ja;vK.prototype.getAudioTrack=vK.prototype.ia;vK.prototype.getVideoTrack=vK.prototype.Da;vK.prototype.getLoadingTextRendition=vK.prototype.Za;vK.prototype.getLoadingAudioRendition=vK.prototype.Ya;vK.prototype.getLoadingVideoRendition=vK.prototype.Pa;vK.prototype.getTextRendition=vK.prototype.Ca;
73
+ vK.prototype.getAudioRendition=vK.prototype.Aa;vK.prototype.getVideoRendition=vK.prototype.fa;vK.prototype.getTextTracks=vK.prototype.ea;vK.prototype.getAudioTracks=vK.prototype.getAudioTracks;vK.prototype.getVideoTracks=vK.prototype.getVideoTracks;_.u(AK,_.Nh);_.h=AK.prototype;_.h.init=function(a,b){var c=this;this.A=a;b&&(this.g=this.o=b);var d=BK();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.$i.bind(this));d.setMediaPlaybackInfoHandler(this.Bg.bind(this));this.a=new rK(this);this.a.init();this.h=new vK;this.h.Fb(this);this.m=new sK(function(e){return c.trigger(e)});this.m.init()};
74
+ _.h.unload=function(){var a=BK();a.getPlayerState()!==cast.framework.messages.PlayerState.IDLE&&a.stop();this.h&&this.h.release();this.m&&this.m.release();this.f=null;return Promise.resolve()};_.h.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.h.destroy=function(){var a=this;return _.z(function(b){if(1==b.a)return a.A=null,a.o=_.Si(),a.g=a.o,a.j=-1,a.w=null,a.a?_.v(b,a.a.destroy(),3):b.H(2);2!=b.a&&(a.a=null);a.h&&(a.h.destroy(),a.h=null);_.w(b)})};
75
+ _.h.play=function(){var a=BK();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.h.pause=function(){var a=BK();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.h.isPaused=function(){return BK().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
76
+ _.h.isEnded=function(){return BK().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.h.seek=function(a){var b=BK();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(uJ);b.seek(a);return Promise.resolve()};_.h.getPosition=function(){return BK().getCurrentTimeSec()};_.h.getDuration=function(){return BK().getDurationSec()};_.h.getPlaybackRate=function(){return BK().getPlaybackRate()};
77
+ _.h.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;BK().sendLocalMediaRequest(b)}};_.h.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.h.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.h.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
78
+ _.h.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.h.getLoadedSource=function(){var a=BK().getMediaInformation();if(a){var b=BK().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.w&&-1!==this.j?this.w[this.j]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,kk:b,name:c}}return null};_.h.getDrmInfo=function(){return null};
79
+ _.h.getPresentationStartTime=function(){var a=BK().getMediaInformation();return a?a.startAbsoluteTime||0:0};_.h.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=BK().getLiveSeekableRange();b&&typeof b.start===_.zd&&typeof b.end===_.zd&&(a={start:b.start,end:b.end})}return a};_.h.getState=function(){return this.a?this.a.getState():_.Al};
80
+ _.h.getStats=function(){var a=_.vl();if(this.f){a=BK().getStats();this.f.m=a.estimatedBandwidth||NaN;this.f.A=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.j=a.width||NaN;b.f=c;b=this.f;c=typeof a.decodedFrames===_.zd?a.decodedFrames:NaN;b.h=typeof a.droppedFrames===_.zd?a.droppedFrames:NaN;b.g=c;a=this.f.getStats()}return a};_.h.isLive=function(){return-1===this.getDuration()};
81
+ _.h.load=function(a){var b=this,c,d;return _.z(function(e){b.f=new _.ul;b.a.j=b.f.a;b.w=_.Rl(a);_.Vi(a)&&(b.g=_.Ui(b.o,a));if(b.B)return b.B=!1,e["return"]();c=b.w[b.j];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.g.autoplay;typeof b.g.startTime===_.zd&&(d.currentTime=b.g.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:IJ(b.g),local:!0};return _.v(e,BK().load(d),0)})};_.h.getBufferInfo=function(){this.C.warn(_.ma);return new _.Mh};
82
+ _.h.getTrackManager=function(){return this.h};_.h.getConfiguration=function(){return this.g};_.h.getSurface=function(){return this.A};_.h.setNetworkEngine=function(a){this.D=a};_.h.getNetworkEngine=function(){return this.D};_.h.getSourceIndex=function(){return this.j};_.h.setSourceIndex=function(a){this.j=a};_.h.getPeriods=function(){return[]};_.h.namespace=function(){return CJ};_.h.getTimelineCues=function(){return this.m&&this.m.getTimelineCues()||[]};_.h.resetAbr=function(){this.C.warn(yJ)};
83
+ _.h.onError=function(a){this.trigger(new _.E(_.Vc,{detail:a}))};_.h.canPlay=function(){return _.ri()?2:0};_.h.$i=function(a){a.customData||(a.customData={});a.customData.stats=IJ(this.getStats());return a};_.h.Bg=function(a,b){var c=null;a.media.customData&&(c=JJ(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.zd?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;EK(c,b);return b};_.h.getTextDisplayer=function(){return null};
84
+ _.h.setDrmCustomDataModifier=function(){};_.h.setCdnErrorCallback=function(){};AK.prototype.getTextDisplayer=AK.prototype.getTextDisplayer;AK.prototype.getNetworkEngine=AK.prototype.getNetworkEngine;AK.prototype.setNetworkEngine=AK.prototype.setNetworkEngine;_.h=Z.prototype;_.h.mb=function(){return"Google Cast Framework"};_.h.nb=function(){return cast.framework.VERSION};_.h.sb=function(){return 0};_.h.ba=function(){return""};_.h.getCreativeId=function(){return""};_.h.getApiFramework=function(){return null};_.h.getAdSystem=function(){return""};_.h.getAdvertiserName=function(){return""};_.h.getTitle=function(){return this.a.title||""};_.h.getDuration=function(){return this.a.duration||0};_.h.getSkipTimeOffset=function(){return this.a.whenSkippable||0};
85
85
  _.h.cc=function(){return!1};_.h.Hb=function(){return this.a.clickThroughUrl||null};_.h.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.h.pb=function(){return 0};_.h.ob=function(){return 0};_.h.$a=function(){return 0};_.h.Qa=function(){switch(this.Ib()){case 0:return 0;case -1:return 2;default:return 1}};_.h.getPodIndex=function(){return this.g};_.h.Ib=function(){return this.f.position};_.h.Jb=function(){return this.h};_.h.rb=function(){return this.j};
86
86
  _.h.getWrapperAdIds=function(){return[]};_.h.getWrapperAdSystems=function(){return[]};_.h.getWrapperCreativeIds=function(){return[]};Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.rb;Z.prototype.getPositionInSequence=Z.prototype.Jb;Z.prototype.getPodTimeOffset=Z.prototype.Ib;Z.prototype.getPodIndex=Z.prototype.getPodIndex;
87
87
  Z.prototype.getPodType=Z.prototype.Qa;Z.prototype.getMediaBitrate=Z.prototype.$a;Z.prototype.getMediaHeight=Z.prototype.ob;Z.prototype.getMediaWidth=Z.prototype.pb;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.Hb;Z.prototype.isBumper=Z.prototype.cc;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;
88
- Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.aa;Z.prototype.getTechnology=Z.prototype.sb;Z.prototype.getAdManagerVersion=Z.prototype.nb;Z.prototype.getAdManagerName=Z.prototype.mb;iK.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};iK.prototype.Kb=function(){return!!this.a.find(function(a){return 0===a.position})};iK.prototype.ab=function(){return!!this.a.find(function(a){return-1===a.position})};iK.prototype.hasPostroll=iK.prototype.ab;iK.prototype.hasPreroll=iK.prototype.Kb;iK.prototype.getCuePoints=iK.prototype.getCuePoints;_.h=kK.prototype;_.h.load=function(){var a=this;return _.z(function(b){lK&&(lK=!1,qK(a,0));_.w(b)})};_.h.start=function(){return _.z(function(a){jK().play();_.w(a)})};_.h.resume=function(){-1!==this.getPosition()&&jK().play()};_.h.pause=function(){-1!==this.getPosition()&&jK().pause()};_.h.skip=function(){};_.h.getVolume=function(){return this.l.getVolume()||0};_.h.setVolume=function(a){this.l.setVolume(a)};
89
- _.h.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.zd?a:-1};_.h.dispose=function(){var a=this;return _.z(function(b){jK().removeEventListener(a.f,a.g);_.w(b)})};
90
- _.h.Rg=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=jK().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.l.trigger(new _.D(_.Lb,{adsTimeline:new iK(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:pK(this,_.Ab,a);break;case cast.framework.events.EventType.BREAK_STARTED:pK(this,_.tb,a);break;case cast.framework.events.EventType.BREAK_ENDED:pK(this,_.ub,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:pK(this,
91
- _.Hb,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(pK(this,_.Gb,a),pK(this,_.Ib,a)):a.endedReason===b.STOPPED?pK(this,_.Ib,a):a.endedReason===b.END_OF_STREAM?(pK(this,_.xb,a),pK(this,_.Ib,a)):a.endedReason===b.ERROR&&qK(this,1);break;case cast.framework.events.EventType.PLAYING:pK(this,_.Fb,a);break;case cast.framework.events.EventType.PAUSE:pK(this,_.Db,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?pK(this,_.vb,a):pK(this,_.Fb,a)}};
92
- kK.prototype.getPosition=kK.prototype.getPosition;kK.prototype.setVolume=kK.prototype.setVolume;kK.prototype.getVolume=kK.prototype.getVolume;kK.prototype.skip=kK.prototype.skip;kK.prototype.pause=kK.prototype.pause;kK.prototype.resume=kK.prototype.resume;var lK=!1;_.h=rK.prototype;_.h.init=function(a){var b=this;a&&(this.f=new dK,_.Ym(a,this.f),this.l=a,this.o.on(window,"unload",function(){return _.z(function(c){return b.l&&b.l.getState()!==_.yl?_.v(c,jJ(b.l),0):c.G(0)})}))};
93
- _.h.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=cast.framework.CastReceiverContext.getInstance(),b=a.getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[hJ]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.pi.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};c.playbackConfig=d;if(d=this.l&&this.l.getSurface().getMedia())c.mediaElement=
94
- d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.oi.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(hJ,this.w)}};
95
- _.h.stop=function(){if(this.a){this.a=!1;this.o.release();var a=cast.framework.CastReceiverContext.getInstance();a.getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(hJ,this.w);a.stop();this.l=this.f=null}};_.h.bd=function(a){this.j=a};_.h.vj=function(a){this.m=a};_.h.on=function(a,b){cast.framework.CastReceiverContext.getInstance().addEventListener(a,b)};
96
- _.h.off=function(a,b){cast.framework.CastReceiverContext.getInstance().removeEventListener(a,b)};_.h.addMessageListener=function(a){typeof a===_.Yc&&this.g.add(a)};_.h.removeMessageListener=function(a){typeof a===_.Yc&&this.g["delete"](a)};_.h.sendMessage=function(a,b){cast.framework.CastReceiverContext.getInstance().sendCustomMessage(hJ,b,lJ(a))};_.h.ac=function(){return this.a};
97
- _.h.di=function(){var a=null,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager().getMediaInformation();b&&b.metadata&&(a=b.metadata);return _.H.xa(a)};
98
- _.h.pi=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return vK(this,a);try{var b=(new DOMParser).parseFromString(a,_.te)}catch(r){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.h.debug("Detected DASH, parsing");b=cast.framework.CastReceiverContext.getInstance();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.fa),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.Ge||g===_.Zb){g=e[f].getAttribute(_.pd);
99
- for(var k=e[f].getElementsByTagName(_.cb),l=k.length-1;0<=l;--l){var m=k[l].getAttribute(_.pd)||g,n=k[l].getAttribute(_.Ac),p=k[l].getAttribute(_.Ve)||void 0,q=k[l].getAttribute(_.Zc)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(k[l])}e[f].getElementsByTagName(_.cb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.fa).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.kb)[0]){a=c;this.h.debug("Detected Smooth, parsing");
100
- b=cast.framework.CastReceiverContext.getInstance();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Ge){e=c[d].getElementsByTagName(_.ab);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Oa)||void 0,k=e[f].getAttribute(_.Na)||void 0,void 0!==g&&(g=+g),void 0!==k&&(k=+k),b.canDisplayType(_.Ie,void 0,g,k)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.ab).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
101
- _.h.oi=function(a){var b=this,c,d,e,f;return _.z(function(g){switch(g.a){case 1:a.media.customData&&(c=mJ(a.media.customData.playerConfiguration));if(!b.l||!c){g.G(2);break}if(!b.j){g.G(3);break}return _.v(g,Promise.resolve(b.j(c)),4);case 4:c=(d=g.f)||c;case 3:if(!c.ima){g.G(5);break}return _.v(g,nK(a.media,c.ima,b.l.getNetworkEngine()),5);case 5:typeof c.startTime===_.zd&&c.startTime!==a.currentTime&&(a.currentTime=c.startTime);if(a.media.customData.local){g.G(7);break}b.f.B=!0;return _.v(g,_.bn(b.l,
102
- c),8);case 8:return _.v(g,_.cn(b.l),9);case 9:e=b.l.getLoadedSource(),a.media.contentId=e.url,a.media.contentType=e.type,e.Ab&&(a.media.hlsVideoSegmentFormat=oJ(e.Ab,_.yg)),e.audioMimeType&&(a.media.hlsSegmentFormat=oJ(e.audioMimeType,_.N));case 7:void 0===a.autoplay&&(a.autoplay=b.l.getConfiguration().autoplay);case 2:if(!b.m){g.G(10);break}return _.v(g,Promise.resolve(b.m(a)),11);case 11:(f=g.f)&&(a=f);case 10:return g["return"](a)}})};
103
- _.h.Si=function(a){!this.l||a.media.customData&&a.media.customData.local||_.en(this.l)};_.h.Lg=function(a){if(0<this.g.size){var b=mJ(a.data);this.g.forEach(function(c){return c(b)})}};_.A(gJ,rK);rK.prototype.getContentMetadata=rK.prototype.di;rK.prototype.isApiReady=rK.prototype.ac;rK.prototype.sendMessage=rK.prototype.sendMessage;rK.prototype.removeMessageListener=rK.prototype.removeMessageListener;rK.prototype.addMessageListener=rK.prototype.addMessageListener;rK.prototype.off=rK.prototype.off;
104
- rK.prototype.on=rK.prototype.on;rK.prototype.setLoadRequestDataInterceptor=rK.prototype.vj;rK.prototype.setPlayerConfigInterceptor=rK.prototype.bd;rK.prototype.stop=rK.prototype.stop;rK.prototype.start=rK.prototype.start;rK.prototype.init=rK.prototype.init;rK.getInstance=tK;var sK=null;_.h=wK.prototype;_.h.load=function(){var a=this,b,c,d,e,f;return _.z(function(g){a.a=a.f.o;if(a.a)for(b=a.a.controller,c=a.fj.bind(a),d=_.t(a.h),e=d.next();!e.done;e=d.next())f=e.value,a.g.on(b,f,c);_.w(g)})};_.h.start=function(){return _.z(function(a){_.w(a)})};_.h.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.h.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
105
- _.h.skip=function(){var a=this.f.a;a&&this.f.sendMessage(iJ,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.h.getVolume=function(){return this.f.getVolume()||0};_.h.setVolume=function(a){this.f.setVolume(a)};_.h.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.zd&&(a=b));return a};_.h.dispose=function(){var a=this;return _.z(function(b){a.g.release();_.w(b)})};
106
- _.h.fj=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.D(_.Lb,{adsTimeline:new iK(a.breaks)})));break;case "isPlayingBreak":a.value?yK(this,_.tb):(yK(this,_.xb),yK(this,_.Ib),yK(this,_.ub));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(yK(this,_.xb),yK(this,_.Ib)),yK(this,_.Hb));break;case "isPaused":this.a.isPlayingBreak&&(a.value?yK(this,_.Db):yK(this,_.Fb))}};wK.prototype.getPosition=wK.prototype.getPosition;
107
- wK.prototype.setVolume=wK.prototype.setVolume;wK.prototype.getVolume=wK.prototype.getVolume;wK.prototype.skip=wK.prototype.skip;wK.prototype.pause=wK.prototype.pause;wK.prototype.resume=wK.prototype.resume;zK.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};zK.prototype.V=function(a,b){return a.namespace()!==_.wc?!1:!(!b||!b.ima)};zK.prototype.create=function(a){return new wK(a.a)};zK.prototype.create=zK.prototype.create;zK.prototype.isSupported=zK.prototype.V;zK.prototype.name=zK.prototype.name;_.dm(new zK);AK.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};AK.prototype.V=function(a,b){return tK().ac()?!(!b||!b.ima):!1};AK.prototype.create=function(a){return new kK(a)};AK.prototype.create=AK.prototype.create;AK.prototype.isSupported=AK.prototype.V;AK.prototype.name=AK.prototype.name;_.dm(new AK);};
88
+ Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.ba;Z.prototype.getTechnology=Z.prototype.sb;Z.prototype.getAdManagerVersion=Z.prototype.nb;Z.prototype.getAdManagerName=Z.prototype.mb;FK.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};FK.prototype.Kb=function(){return!!this.a.find(function(a){return 0===a.position})};FK.prototype.ab=function(){return!!this.a.find(function(a){return-1===a.position})};FK.prototype.hasPostroll=FK.prototype.ab;FK.prototype.hasPreroll=FK.prototype.Kb;FK.prototype.getCuePoints=FK.prototype.getCuePoints;_.h=HK.prototype;_.h.load=function(){var a=this;return _.z(function(b){IK&&(IK=!1,NK(a,0));_.w(b)})};_.h.start=function(){return _.z(function(a){GK().play();_.w(a)})};_.h.resume=function(){-1!==this.getPosition()&&GK().play()};_.h.pause=function(){-1!==this.getPosition()&&GK().pause()};_.h.skip=function(){};_.h.getVolume=function(){return this.l.getVolume()||0};_.h.setVolume=function(a){this.l.setVolume(a)};
89
+ _.h.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.zd?a:-1};_.h.dispose=function(){var a=this;return _.z(function(b){GK().removeEventListener(a.f,a.g);_.w(b)})};
90
+ _.h.Ug=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=GK().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.l.trigger(new _.E(_.Lb,{adsTimeline:new FK(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:MK(this,_.Ab,a);break;case cast.framework.events.EventType.BREAK_STARTED:MK(this,_.tb,a);break;case cast.framework.events.EventType.BREAK_ENDED:MK(this,_.ub,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:MK(this,
91
+ _.Hb,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(MK(this,_.Gb,a),MK(this,_.Ib,a)):a.endedReason===b.STOPPED?MK(this,_.Ib,a):a.endedReason===b.END_OF_STREAM?(MK(this,_.xb,a),MK(this,_.Ib,a)):a.endedReason===b.ERROR&&NK(this,1);break;case cast.framework.events.EventType.PLAYING:MK(this,_.Fb,a);break;case cast.framework.events.EventType.PAUSE:MK(this,_.Db,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?MK(this,_.vb,a):MK(this,_.Fb,a)}};
92
+ HK.prototype.getPosition=HK.prototype.getPosition;HK.prototype.setVolume=HK.prototype.setVolume;HK.prototype.getVolume=HK.prototype.getVolume;HK.prototype.skip=HK.prototype.skip;HK.prototype.pause=HK.prototype.pause;HK.prototype.resume=HK.prototype.resume;var IK=!1;_.h=OK.prototype;_.h.init=function(a){var b=this;a&&(this.f=new AK,_.Zm(a,this.f),this.l=a,this.o.on(window,"unload",function(){return _.z(function(c){return b.l&&b.l.getState()!==_.zl?_.v(c,GJ(b.l),0):c.H(0)})}))};
93
+ _.h.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=cast.framework.CastReceiverContext.getInstance(),b=a.getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[EJ]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.ui.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};c.playbackConfig=d;if(d=this.l&&this.l.getSurface().getMedia())c.mediaElement=
94
+ d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.ti.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(EJ,this.w)}};
95
+ _.h.stop=function(){if(this.a){this.a=!1;this.o.release();var a=cast.framework.CastReceiverContext.getInstance();a.getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(EJ,this.w);a.stop();this.l=this.f=null}};_.h.cd=function(a){this.j=a};_.h.Ej=function(a){this.m=a};_.h.on=function(a,b){cast.framework.CastReceiverContext.getInstance().addEventListener(a,b)};
96
+ _.h.off=function(a,b){cast.framework.CastReceiverContext.getInstance().removeEventListener(a,b)};_.h.addMessageListener=function(a){typeof a===_.Yc&&this.g.add(a)};_.h.removeMessageListener=function(a){typeof a===_.Yc&&this.g["delete"](a)};_.h.sendMessage=function(a,b){cast.framework.CastReceiverContext.getInstance().sendCustomMessage(EJ,b,IJ(a))};_.h.ac=function(){return this.a};
97
+ _.h.hi=function(){var a=null,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager().getMediaInformation();b&&b.metadata&&(a=b.metadata);return _.H.ya(a)};
98
+ _.h.ui=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return SK(this,a);try{var b=(new DOMParser).parseFromString(a,_.ue)}catch(r){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.h.debug("Detected DASH, parsing");b=cast.framework.CastReceiverContext.getInstance();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ea),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.He||g===_.Zb){g=e[f].getAttribute(_.pd);
99
+ for(var k=e[f].getElementsByTagName(_.cb),l=k.length-1;0<=l;--l){var m=k[l].getAttribute(_.pd)||g,n=k[l].getAttribute(_.Ac),p=k[l].getAttribute(_.We)||void 0,q=k[l].getAttribute(_.Zc)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(k[l])}e[f].getElementsByTagName(_.cb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ea).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.kb)[0]){a=c;this.h.debug("Detected Smooth, parsing");
100
+ b=cast.framework.CastReceiverContext.getInstance();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.He){e=c[d].getElementsByTagName(_.ab);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Oa)||void 0,k=e[f].getAttribute(_.Ma)||void 0,void 0!==g&&(g=+g),void 0!==k&&(k=+k),b.canDisplayType(_.Je,void 0,g,k)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.ab).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
101
+ _.h.ti=function(a){var b=this,c,d,e,f;return _.z(function(g){switch(g.a){case 1:a.media.customData&&(c=JJ(a.media.customData.playerConfiguration));if(!b.l||!c){g.H(2);break}if(!b.j){g.H(3);break}return _.v(g,Promise.resolve(b.j(c)),4);case 4:c=(d=g.f)||c;case 3:if(!c.ima){g.H(5);break}return _.v(g,KK(a.media,c.ima,b.l.getNetworkEngine()),5);case 5:typeof c.startTime===_.zd&&c.startTime!==a.currentTime&&(a.currentTime=c.startTime);if(a.media.customData.local){g.H(7);break}b.f.B=!0;return _.v(g,_.cn(b.l,
102
+ c),8);case 8:return _.v(g,_.dn(b.l),9);case 9:e=b.l.getLoadedSource(),a.media.contentId=e.url,a.media.contentType=e.type,e.Ab&&(a.media.hlsVideoSegmentFormat=LJ(e.Ab,_.zg)),e.audioMimeType&&(a.media.hlsSegmentFormat=LJ(e.audioMimeType,_.N));case 7:void 0===a.autoplay&&(a.autoplay=b.l.getConfiguration().autoplay);case 2:if(!b.m){g.H(10);break}return _.v(g,Promise.resolve(b.m(a)),11);case 11:(f=g.f)&&(a=f);case 10:return g["return"](a)}})};
103
+ _.h.Xi=function(a){!this.l||a.media.customData&&a.media.customData.local||_.fn(this.l)};_.h.Og=function(a){if(0<this.g.size){var b=JJ(a.data);this.g.forEach(function(c){return c(b)})}};_.A(DJ,OK);OK.prototype.getContentMetadata=OK.prototype.hi;OK.prototype.isApiReady=OK.prototype.ac;OK.prototype.sendMessage=OK.prototype.sendMessage;OK.prototype.removeMessageListener=OK.prototype.removeMessageListener;OK.prototype.addMessageListener=OK.prototype.addMessageListener;OK.prototype.off=OK.prototype.off;
104
+ OK.prototype.on=OK.prototype.on;OK.prototype.setLoadRequestDataInterceptor=OK.prototype.Ej;OK.prototype.setPlayerConfigInterceptor=OK.prototype.cd;OK.prototype.stop=OK.prototype.stop;OK.prototype.start=OK.prototype.start;OK.prototype.init=OK.prototype.init;OK.getInstance=QK;var PK=null;_.h=TK.prototype;_.h.load=function(){var a=this,b,c,d,e,f;return _.z(function(g){a.a=a.f.o;if(a.a)for(b=a.a.controller,c=a.nj.bind(a),d=_.t(a.h),e=d.next();!e.done;e=d.next())f=e.value,a.g.on(b,f,c);_.w(g)})};_.h.start=function(){return _.z(function(a){_.w(a)})};_.h.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.h.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
105
+ _.h.skip=function(){var a=this.f.a;a&&this.f.sendMessage(FJ,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.h.getVolume=function(){return this.f.getVolume()||0};_.h.setVolume=function(a){this.f.setVolume(a)};_.h.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.zd&&(a=b));return a};_.h.dispose=function(){var a=this;return _.z(function(b){a.g.release();_.w(b)})};
106
+ _.h.nj=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.E(_.Lb,{adsTimeline:new FK(a.breaks)})));break;case "isPlayingBreak":a.value?VK(this,_.tb):(VK(this,_.xb),VK(this,_.Ib),VK(this,_.ub));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(VK(this,_.xb),VK(this,_.Ib)),VK(this,_.Hb));break;case "isPaused":this.a.isPlayingBreak&&(a.value?VK(this,_.Db):VK(this,_.Fb))}};TK.prototype.getPosition=TK.prototype.getPosition;
107
+ TK.prototype.setVolume=TK.prototype.setVolume;TK.prototype.getVolume=TK.prototype.getVolume;TK.prototype.skip=TK.prototype.skip;TK.prototype.pause=TK.prototype.pause;TK.prototype.resume=TK.prototype.resume;WK.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};WK.prototype.W=function(a,b){return a.namespace()!==_.wc?!1:!(!b||!b.ima)};WK.prototype.create=function(a){return new TK(a.a)};WK.prototype.create=WK.prototype.create;WK.prototype.isSupported=WK.prototype.W;WK.prototype.name=WK.prototype.name;_.em(new WK);XK.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};XK.prototype.W=function(a,b){return QK().ac()?!(!b||!b.ima):!1};XK.prototype.create=function(a){return new HK(a)};XK.prototype.create=XK.prototype.create;XK.prototype.isSupported=XK.prototype.W;XK.prototype.name=XK.prototype.name;_.em(new XK);};
108
108
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
109
109
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
110
110
  else{_=this.clpp._;(f.call(g,this));}