@castlabs/prestoplay 6.6.0 → 6.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +406 -406
  8. package/cjs/cl.crypto.js +8 -8
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +17 -6
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +49 -48
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +256 -257
  17. package/cjs/cl.muxdata.js +12 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -70
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +357 -356
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +66 -66
  38. package/cl.externs.js +17 -6
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +40 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +199 -200
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +2 -2
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +4 -4
  49. package/cl.smooth.js +59 -58
  50. package/cl.thumbnails.js +16 -16
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +12 -12
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +13 -13
  56. package/cl.vtt.js +11 -11
  57. package/cl.youbora.js +15 -15
  58. package/package.json +5 -1
  59. package/typings.d.ts +100 -96
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 6.6.1
2
+
3
+ ## Changes
4
+
5
+ * Fix methods `clpp.utils.Mp4Parser.children()`, `clpp.utils.Mp4Parser.sampleDescription()`
6
+ and `clpp.utils.Mp4Parser.headerSize()`.
7
+ * HLS related fixes:
8
+ * Improve MIME type detection by leveraging `#EXT-X-MAP` tags.
9
+ * Fixed issue with some Smooth Streaming playback scenarios where the timeline
10
+ was adjusted but the wrong base media decode time was used.
11
+ * Fixed minor issue with Youbora receiving consecutive buffering ended events during
12
+ ad playback. The state was tracked already internally so these events were not
13
+ reported and this has not affect on the data exposed to Youbora. It makes the internal
14
+ implementation more consistent though and is slightly more performant since we are
15
+ saving some calls.
16
+
17
+
1
18
  # 6.6.0
2
19
 
3
20
  ## New Features
package/cjs/cl.adobe.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var eN=function(){this.l=this.f=null;this.a="";this.g=new _.H("clpp.adobe.AdobePlugin")},hN=function(a){a.f=new _.eg;a.f.on(a.l,_.Ne,function(){return fN(a)});a.f.on(a.l,_.Me,function(){s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.wd,function(){return gN(a)});a.f.on(a.l,_.se,function(b){b=b.detail;switch(b.currentState){case _.kn:a.a.length||gN(a);s.Media.play(a.a,a.l.getPosition());break;case _.jn:case _.an:fN(a);break;case _.cn:case _.Wm:case _.gn:a.g.info("Close session for "+a.a+" in player state "+
3
- (b.currentState+".")),fN(a),s.Media.close(a.a),a.a=""}})},gN=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(),_.ta)},fN=function(a){s.Media.stop(a.a,a.l.getPosition())},iN=function(){};_.v(eN,_.lq);eN.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.l=a,hN(this)):this.g.warn("Adobe API not available.")};
4
- eN.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""};eN.prototype.id=function(){return"adobe"};_.C("clpp.adobe.AdobeAnalyticsPlugin",eN);eN.Id="adobe";iN.prototype.create=function(){return new eN};_.Do(new iN);};
2
+ var f=function(window){var gN=function(){this.l=this.f=null;this.a="";this.g=new _.H("clpp.adobe.AdobePlugin")},jN=function(a){a.f=new _.eg;a.f.on(a.l,_.Ne,function(){return hN(a)});a.f.on(a.l,_.Me,function(){s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.xd,function(){return iN(a)});a.f.on(a.l,_.se,function(b){b=b.detail;switch(b.currentState){case _.ln:a.a.length||iN(a);s.Media.play(a.a,a.l.getPosition());break;case _.kn:case _.bn:hN(a);break;case _.dn:case _.Xm:case _.hn:a.g.info("Close session for "+a.a+" in player state "+
3
+ (b.currentState+".")),hN(a),s.Media.close(a.a),a.a=""}})},iN=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(),_.sa)},hN=function(a){s.Media.stop(a.a,a.l.getPosition())},kN=function(){};_.v(gN,_.mq);gN.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.l=a,jN(this)):this.g.warn("Adobe API not available.")};
4
+ gN.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""};gN.prototype.id=function(){return"adobe"};_.D("clpp.adobe.AdobeAnalyticsPlugin",gN);gN.Id="adobe";kN.prototype.create=function(){return new gN};_.Eo(new kN);};
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 cN=function(){var a=this;this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.Pi(function(){a.l.play()["catch"](function(){})});this.g=new _.eg},dN=function(){};_.v(cN,_.lq);_.t=cN.prototype;_.t.onPlayerCreated=function(a){this.l=a;this.a=a.getSurface().getMedia()};_.t.onContentWillLoad=function(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.Wi.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.wj.bind(this)))};
3
- _.t.onPlayerWillRelease=function(){this.m.stop();this.g.release()};_.t.id=function(){return"airplay"};_.t.Wi=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.l.trigger(new _.J(_.$b,{canCast:this.f}))};_.t.wj=function(){var a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Zb:_.Yb;if(this.j||!this.l.isPaused()||this.l.getState()===_.kn)this.j?this.l.play()["catch"](function(){}):this.m.Z(.01);this.l.trigger(new _.J(a))};_.t.jb=function(){return this.h};
4
- _.t.ge=function(){return this.f};_.t.Pj=function(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.C("clpp.airplay.AirPlayPlugin",cN);cN.prototype.showCastMenu=cN.prototype.Pj;cN.prototype.canCast=cN.prototype.ge;cN.prototype.isCasting=cN.prototype.jb;cN.Id="airplay";dN.prototype.create=function(){return new cN};_.Do(new dN);};
2
+ var f=function(window){var eN=function(){var a=this;this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.Qi(function(){a.l.play()["catch"](function(){})});this.g=new _.eg},fN=function(){};_.v(eN,_.mq);_.t=eN.prototype;_.t.onPlayerCreated=function(a){this.l=a;this.a=a.getSurface().getMedia()};_.t.onContentWillLoad=function(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.Si.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.sj.bind(this)))};
3
+ _.t.onPlayerWillRelease=function(){this.m.stop();this.g.release()};_.t.id=function(){return"airplay"};_.t.Si=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.l.trigger(new _.J(_.ac,{canCast:this.f}))};_.t.sj=function(){var a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Zb:_.Yb;if(this.j||!this.l.isPaused()||this.l.getState()===_.ln)this.j?this.l.play()["catch"](function(){}):this.m.Z(.01);this.l.trigger(new _.J(a))};_.t.ib=function(){return this.h};
4
+ _.t.fe=function(){return this.f};_.t.Lj=function(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.D("clpp.airplay.AirPlayPlugin",eN);eN.prototype.showCastMenu=eN.prototype.Lj;eN.prototype.canCast=eN.prototype.fe;eN.prototype.isCasting=eN.prototype.ib;eN.Id="airplay";fN.prototype.create=function(){return new eN};_.Eo(new fN);};
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 VM=function(a,b){this.l=a;this.f=b;this.a=new _.eg;this.g=!1},WM=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.l=c;d.a=_.bi();return d}_.v(b,GenericPlayerApi);b.prototype.getPlayerName=function(){return _.ta};b.prototype.getVersion=function(){return _.ea};b.prototype.getOSName=function(){return this.a.os};b.prototype.getDeviceVersion=function(){return this.a.osVersion.name};b.prototype.getDeviceType=function(){return"browser"};b.prototype.getTotalDuration=function(){return this.l.isLive()?
3
- 0:1E3*this.l.getDuration()};b.prototype.getCurrentPosition=function(){return 1E3*this.l.getPosition()};b.prototype.getCurrentBitrate=function(){var c=this.l.getStats();return(c?c.streamBandwidth:0)/1E3};return new b(a)},XM=function(){this.h=this.f=this.a=this.g=this.l=null;this.j=new _.eg},YM=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===_.ve&&a.g.setUUID(f))},ZM=function(a,
4
- b){var c=b.customParameters||{};a.a=a.g.createStreamingSession();for(var d in c)a.a.setCustomParameter(d,c[d]);a.j.on(a.l,_.hd,a.U.bind(a));a.h=WM(a.l);a.a.attachPlayer(a.h)},$M=function(a,b){_.hg(a.j);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},aN=function(){return!window.SmartLib||!window.GenericPlayerApi},bN=function(){};_.t=VM.prototype;_.t.init=function(){var a=this.l,b=this.a;b.on(a,_.se,this.Rg.bind(this));b.on(a,_.rc,this.Pg.bind(this));b.on(a,"seek",this.Qg.bind(this))};
5
- _.t.Pg=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.t.Rg=function(a){var b=this.l,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.an&&c.notifyStallEnd(!b.isPaused());switch(d){case _.an:c.notifyStallStart();break;case _.kn:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.jn:c.notifyPause()}};_.t.Qg=function(){var a=1E3*this.l.getPosition();this.f.notifySeek(a)};_.t.release=function(){this.a&&(_.hg(this.a),this.a=null)};_.v(XM,_.lq);_.t=XM.prototype;_.t.onPlayerCreated=function(a){this.l=a};_.t.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(aN())return a.onError(new _.L(1,9,11E3));YM(this,d);ZM(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 _.L(1,9,11001,{bpkErrorCode:f,message:e}));$M(c,void 0)}else b.url=e.getURL(),c.f=new VM(c.l,c.h),c.f.init()})}};
6
- _.t.U=function(a){a=a.detail;if(7003===a.code)$M(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.M)switch(a.category){case 3:$M(this,SmartLib.BPDecodingError);break;case 1:$M(this,SmartLib.BPNetworkingError);break;case 6:$M(this,SmartLib.BPAccessRightError);break;default:$M(this,SmartLib.BPUnspecifiedError)}};_.t.onPlayerWillRelease=function(){aN()||$M(this,SmartLib.BPSessionEndsNormally)};_.t.id=function(){return"broadpeak"};_.C("clpp.broadpeak.BroadpeakPlugin",XM);
7
- XM.isSdkMissing=aN;XM.Id="broadpeak";bN.prototype.create=function(){return new XM};_.Do(new bN);};
2
+ var f=function(window){var XM=function(a,b){this.l=a;this.f=b;this.a=new _.eg;this.g=!1},YM=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.l=c;d.a=_.ai();return d}_.v(b,GenericPlayerApi);b.prototype.getPlayerName=function(){return _.sa};b.prototype.getVersion=function(){return _.ea};b.prototype.getOSName=function(){return this.a.os};b.prototype.getDeviceVersion=function(){return this.a.osVersion.name};b.prototype.getDeviceType=function(){return"browser"};b.prototype.getTotalDuration=function(){return this.l.isLive()?
3
+ 0:1E3*this.l.getDuration()};b.prototype.getCurrentPosition=function(){return 1E3*this.l.getPosition()};b.prototype.getCurrentBitrate=function(){var c=this.l.getStats();return(c?c.streamBandwidth:0)/1E3};return new b(a)},ZM=function(){this.h=this.f=this.a=this.g=this.l=null;this.j=new _.eg},$M=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===_.ve&&a.g.setUUID(f))},aN=function(a,
4
+ b){var c=b.customParameters||{};a.a=a.g.createStreamingSession();for(var d in c)a.a.setCustomParameter(d,c[d]);a.j.on(a.l,_.jd,a.T.bind(a));a.h=YM(a.l);a.a.attachPlayer(a.h)},bN=function(a,b){_.hg(a.j);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},cN=function(){return!window.SmartLib||!window.GenericPlayerApi},dN=function(){};_.t=XM.prototype;_.t.init=function(){var a=this.l,b=this.a;b.on(a,_.se,this.Og.bind(this));b.on(a,_.tc,this.Mg.bind(this));b.on(a,"seek",this.Ng.bind(this))};
5
+ _.t.Mg=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.t.Og=function(a){var b=this.l,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.bn&&c.notifyStallEnd(!b.isPaused());switch(d){case _.bn:c.notifyStallStart();break;case _.ln:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.kn:c.notifyPause()}};_.t.Ng=function(){var a=1E3*this.l.getPosition();this.f.notifySeek(a)};_.t.release=function(){this.a&&(_.hg(this.a),this.a=null)};_.v(ZM,_.mq);_.t=ZM.prototype;_.t.onPlayerCreated=function(a){this.l=a};_.t.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(cN())return a.onError(new _.L(1,9,11E3));$M(this,d);aN(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 _.L(1,9,11001,{bpkErrorCode:f,message:e}));bN(c,void 0)}else b.url=e.getURL(),c.f=new XM(c.l,c.h),c.f.init()})}};
6
+ _.t.T=function(a){a=a.detail;if(7003===a.code)bN(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.M)switch(a.category){case 3:bN(this,SmartLib.BPDecodingError);break;case 1:bN(this,SmartLib.BPNetworkingError);break;case 6:bN(this,SmartLib.BPAccessRightError);break;default:bN(this,SmartLib.BPUnspecifiedError)}};_.t.onPlayerWillRelease=function(){cN()||bN(this,SmartLib.BPSessionEndsNormally)};_.t.id=function(){return"broadpeak"};_.D("clpp.broadpeak.BroadpeakPlugin",ZM);
7
+ ZM.isSdkMissing=cN;ZM.Id="broadpeak";dN.prototype.create=function(){return new ZM};_.Eo(new dN);};
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,115 +1,115 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var jL="Cannot seek during ads playout.",kL="Cannot switch track",lL="Media session does not exist.",mL="No receivers available",nL="Reset ABR functionality not available on cast.",oL="SDK not yet ready",pL="Sender is destroyed.",qL="clpp.cast.CastProxy",rL="clpp.cast.Player",sL="clpp.cast.Receiver",tL="urn:x-cast:castlabs",uL="urn:x-cast:com.google.cast.media",vL=function(a){return _.B(function(b){return 1==b.a?_.x(b,a.hc(_.Od),2):_.x(b,a.hc(_.Nd),0)})},wL=function(a,b){this.log=new _.H(b);this.a=
3
- a;this.j=null;this.g=_.Wm;this.m=_.Xm;this.h=2;this.B=Date.now();this.A=-1},xL=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.jd){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Kd?"detail"===e&&(d[e]=f):e in Event||(d[e]=f)}return d}return typeof c===_.k?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},yL=function(a){if(typeof a!==_.ve)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}},zL=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.B(function(q){if(1==q.a){if(b.includes(a.mimeType))return q["return"](a);g=f=e=null;for(h=0;h<b.length&&!f;)g=b[h++],f=_.Ii(d,a.mimeType,g);if(!f||!g)return q.H(2);l=_.Oh(a.url);return _.x(q,c.fetch(l).P,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.N(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)})},AL=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 _.Te:return d.FMP4;case _.Se:return b===_.ji?d.MPEG2_TS:c.TS;case _.kc:return c.AAC;case _.lc:return c.AC3;case _.nc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.oc:return c.FMP4}},CL=function(a){a=
6
- void 0===a?BL:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.L(1,8,8001);var c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},DL=function(a){wL.call(this,a,"clpp.cast.SenderStateManager");
7
- this.o=this.f=null;this.w=this.Bb.bind(this)},EL=function(){this.h=new _.H("clpp.cast.SenderTrackManager");this.a=null;this.g=[];this.f={}},FL=function(a){return(a=a.a?a.a.a:null)?a.activeTrackIds.map(function(b){return b.toString()}):[]},HL=function(a,b){var c=FL(a);return GL(a,b).find(function(d){return c.includes(d.id)})||null},GL=function(a,b){return a.g.filter(function(c){return c.type===b})},JL=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.P){var e=a.na();
8
- e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;IL(a,b)},function(f){a.f[b]=null;a.h.debug(kL,f)})}else b===_.P&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){IL(a,b)},function(f){a.h.debug(kL,f)}))},IL=function(a,b){b===_.Q?a.a.trigger(new _.J(_.Kj)):b===_.P&&a.a.trigger(new _.J(_.Lj))},NL=function(a,b,c,d){_.Rj.call(this);this.j=new _.H(_.Hc);this.aa=a;this.o=new _.Ri(b);this.$=c;this.da=d;this.g=this.K=
9
- _.Xj();this.D=[];this.B=0;this.N=new _.ei;this.I=this.m=this.a=null;this.A=this.w=!1;this.fa="";this.Sa=1E6;this.f=new EL;this.f.initialize(this);this.h=new DL(this);this.J=new _.eg;this.L=null;this.F=new Set;this.T=this.Yi.bind(this);this.Ma=this.qj.bind(this);this.ba=this.hj.bind(this);this.V=this.bj.bind(this);this.R=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){KL(!0)},0)}});LL(this);ML.add(this)},
10
- OL=function(a){var b,c;return _.B(function(d){if(1==d.a)return ML["delete"](a),a.w&&(a.w=!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.Ma)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.h&&(c.push(a.h.destroy()),a.h=null),_.x(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.$=null;a.da=null;_.z(d)})},QL=function(a){if(!a)return null;
11
- a:{var b=a.metadataType;var c=Object.entries(PL);c=_.u(c);for(var d=c.next();!d.done;d=c.next()){d=_.u(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=CL(PL[b]);return Object.assign(b,a)},RL=function(a){var b=void 0===b?BL:b;return Object.values(PL).includes(a)?a:b},VL=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},LL=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
12
- a.aa.length){a.w=!0;a.o.bf();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,a.Ma);$L&&a.o.Z(.02)}},eM=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.k?null:a):a=
13
- null;a=null===a?null:a+b;return null===a?b:a},gM=function(a,b){fM(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ba);b.addMessageListener(tL,a.V)},fM=function(a,b){b!==a.a&&(a.a=b,a.a&&(a.J.release(),a.I=null,a.m=null,a.m=new cast.framework.RemotePlayer,a.I=new cast.framework.RemotePlayerController(a.m),a.J.on(a.I,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Sg.bind(a)),a.f&&a.f.load(),a.h&&a.h.init(),a.trigger(new _.J(_.wd))))},hM=function(a){return _.B(function(b){return a.jb()?
14
- b.H(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},iM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,y,A,E,F;return _.B(function(D){switch(D.a){case 1:return c=chrome.cast.media.StreamType,d=_.zq,_.x(D,hM(a),2);case 2:if(!b)return D["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;h=b;l=h.Eb;m=h.audioMimeType;g.hlsVideoSegmentFormat=AL(l,d.VIDEO);
15
- g.hlsSegmentFormat=AL(m,d.AUDIO);if(!b.Pa){D.H(3);break}if(!a.R){D.H(4);break}return _.x(D,Promise.resolve(a.R(b.Pa)),5);case 5:if(n=D.f)b.Pa=n;case 4:a.g=b.Pa;a.D=_.on(a.g);a.B=a.D.findIndex(function(I){return I.url===b.source.url});if(!b.Pa.remoteTextTracks){D.H(6);break}return _.x(D,Promise.all(b.Pa.remoteTextTracks.map(a.Xh.bind(a))),7);case 7:p=D.f,g.tracks=p.filter(function(I){return I}),b.Pa.remoteTextTracks=void 0;case 6:delete b.Pa.autoplay,b.Pa.startTime=null,g.customData={playerConfiguration:xL(b.Pa)};
16
- case 3:q=a.eb()||{};r=RL(q.metadataType);typeof b.Se===_.k&&(w={metadataType:r,sectionStartAbsoluteTime:b.Se});b.source.name&&(y={metadataType:r,title:b.source.name});A=VL(q);if(E=QL(Object.assign({},w,y,A)))g.metadata=E;F=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.sc&&(F.autoplay=b.autoplay);typeof b.currentTime===_.k&&(F.currentTime=b.currentTime);return _.x(D,f.loadMedia(F),0)}})},jM=function(a,b,c){c=void 0===c?0:c;var d,e;return _.B(function(f){(d=a.f.na())&&d.language&&(a.g.preferredTextLanguage=
17
- d.language);(e=a.f.ma())&&e.language&&(a.g.preferredAudioLanguage=e.language);return _.x(f,iM(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Se:a.getPresentationStartTime(),autoplay:b,Pa:a.g}),0)})},KL=function(a){if(a){a=_.u(ML);for(var b=a.next();!b.done;b=a.next())LL(b.value)}},lM=function(a,b,c){_.Rj.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.jd?c:function(e,f){d.f&&e!==_.cn&&e!==_.Wm&&d.f.load(f)};this.a=kM(this);this.g=new _.H(qL);this.addDelegate(this.f)},kM=
18
- function(a){return new NL(a.h,function(){a.trigger(new _.J(_.yc))},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;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.mf&&(d.preferredAudioLanguage=c.mf);c.yg&&(d.preferredTextLanguage=c.yg);_.vo(a.f,null);a.trigger(new _.J("castingended"));a.j(b,d)},function(){return mM(a)})},mM=function(a){var b;return _.B(function(c){if(1==c.a)return a.trigger(new _.J(_.xc)),
19
- b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.vo(a.f,a.a);_.z(c)})},nM=function(a){wL.call(this,a,"clpp.cast.StateManager");this.J=this.Wg.bind(this);this.I=this.Vg.bind(this);this.w=this.dj.bind(this);this.o=this.Xi.bind(this);this.L=this.Yg.bind(this);this.K=this.Xg.bind(this);this.N=this.tj.bind(this);this.F=this.gj.bind(this);this.D=this.U.bind(this);this.f=this.Ug.bind(this)},Z=function(a,b,c,d,e){this.a=a;this.f=b;this.h=typeof c===_.k?c:1;this.j=typeof d===_.k?d:1;this.g=
20
- typeof e===_.k?e:0},oM=function(a){this.a=a},qM=function(a){this.l=a;this.a=null;this.g=this.Zg.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];
21
- pM().addEventListener(this.f,this.g)},tM=function(a,b,c){var d,e,f,g,h,l,m;return _.B(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.zf(n,2);rM=!1;e=_.Oh(d);return _.x(n,c.fetch(e).P,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.vh(f.data),h=new DOMParser,l=h.parseFromString(g,_.Ee),l.getElementsByTagName("vmap:VMAP").length)_.G("VMAP detected."),a.vmapAdsRequest=sM(g);else if(l.getElementsByTagName("VAST").length){_.G("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");
22
- p.vastAdsRequest=sM(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.G("Unsupported schema."),rM=!0;return _.Af(n,0)}m=_.Bf(n);_.G("Failed to fetch an ad",m);rM=!0;_.z(n)})},sM=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},pM=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},vM=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;
23
- (c=uM(a,c))&&(d={ad:c});a.l.trigger(new _.J(b,d))}},wM=function(a,b){var c=new _.L(1,10,10003,{errorType:b});a.l.onError(c)},uM=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.ve&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.ve&&(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,
24
- h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new Z(d,e,b.index,b.total,f)}return c},xM=function(a){this.Ub=a;this.a=this.f.bind(this)},yM=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]},zM=function(a){var b=a.dashTimedMetadata,c=_.Le;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Ke)?
25
- _.og:_.mg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},AM=function(){this.g=new _.H("clpp.cast.TrackManager");this.l=null;this.o=1E9;this.h=[];this.j=[];this.m=this.Aj.bind(this);this.a=this.f=null},BM=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},DM=function(a){a.a=BM().getTextTracksManager();var b=a.a.getTracks();a.j=CM(_.P,b)},EM=function(a,b,c,d){c=_.Fg(c).filter(function(h){return h});
26
- var e=!1,f=[];b===_.Q?f=a.getAudioTracks():b===_.P&&(f=a.ha());if(c=c.find(function(h){var l=_.Ki(h);return f.some(function(m){m=_.Ki(m.language||"");return _.Mi(l,m)})})){var g=_.Ki(c);c=f.filter(function(h){h=_.Ki(h.language||"");return _.Mi(g,h)});f=c.length?c:f;e=e||!!c.length}_.Eh(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.Q?a.sa(e):b===_.P&&a.Ba(e))},CM=function(a,b){for(var c=[],d=_.u(b),e=
27
- d.next();!e.done;e=d.next()){e=e.value;var f=new _.hi(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 _.pi(f.id,f));c.push(f)}return c},FM=function(){_.Rj.call(this);this.A=new _.H(rL);this.g=this.o=_.Xj();this.w=null;this.j=-1;this.F=new _.ei;this.f=this.m=
28
- this.h=this.a=this.B=null;this.D=!1},GM=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},JM=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=_.wk(d);if(e){var f=[_.Qc];_.on(a)[0].type!==_.hc&&f.unshift(_.Rc);d.preferredDrmSystem===_.Qc&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Ra[g];h?(d=g===_.Rc?cast.framework.ContentProtection.WIDEVINE:
29
- g===_.Qc?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},HM(b,h,a,d),IM(b,h,a,d)):c()}else c()}else c()},HM=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.Oh({method:"POST",uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=
30
- f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},IM=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.B(function(h){return 1==h.a?(g=_.Ph(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.N(g.data))})}:a.licenseHandler=void 0},KM=function(){this.a=!1;this.h=new _.H(sL);this.f=this.l=null;this.g=new Set;this.A=this.fj.bind(this);this.w=this.Tg.bind(this);this.j=null;this.o=new _.eg;this.m=null},
31
- MM=function(){return LM||(LM=new KM)},NM=function(){return cast.framework.CastReceiverContext.getInstance()},PM=function(a,b){a.h.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=NM();c=(NM().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Te:_.Se;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var h=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=OM(h,_.pa),m=OM(h,_.jb),n=_.u([]),
32
- p=n.next().value;n=n.next().value;m&&(m=_.u(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(h);++g}return f.join("\n")},OM=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('"'))):(c=d.indexOf(","),0<=c&&(d=d.substring(0,c)))}return d},QM=function(a){this.f=a;this.a=null;this.g=new _.eg;this.h=[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,
33
- cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},SM=function(a,b){var c=null,d=RM(a);d&&(c={ad:d});a.f.trigger(new _.J(b,c))},RM=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(h){return h.id===a.a.breakId})||null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:
34
- b.breaks.filter(function(h){return 0<=h.position}).sort(function(h,l){return h.position-l.position}).findIndex(function(h){return h===c})}b.breakClips&&(d=b.breakClips.find(function(h){return h.id===a.a.breakClipId})||null);b=new Z(d,c,e,f,g)}return b},TM=function(){},UM=function(){};_.t=wL.prototype;_.t.release=function(){this.la(_.Wm)};_.t.destroy=function(){this.j=this.a=null;return Promise.resolve()};_.t.getState=function(){return this.g};_.t.onError=function(a){a.severity===_.M&&this.la(_.gn)};
35
- _.t.la=function(a){if(a!==this.g)if(this.g===_.gn&&a!==_.Wm)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===_.an?(this.A=b,this.a.trigger(new _.J(_.uc,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.m===_.an&&this.a.trigger(new _.J(_.tc,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.g,previousState:this.m,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.Mm(this.j,this.g);this.a.trigger(new _.J(_.se,
36
- {detail:a}))}};_.C("clpp.cast.CastUtils",function(){});var BL=0,PL={GENERIC:BL,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.v(DL,wL);DL.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.m)};DL.prototype.destroy=function(){var a=this;return _.B(function(b){a.f&&(a.f.removeUpdateListener(a.w),a.f=null);return _.x(b,wL.prototype.destroy.call(a),0)})};DL.prototype.la=function(a){var b=this.a.m;b&&b.isPlayingBreak||wL.prototype.la.call(this,a)};
37
- DL.prototype.Bb=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.la(_.cn);break;case chrome.cast.media.IdleReason.ERROR:this.la(_.gn);break;default:this.la(_.Wm)}break;case chrome.cast.media.PlayerState.PLAYING:this.la(_.kn);break;case chrome.cast.media.PlayerState.PAUSED:this.la(_.jn);break;case chrome.cast.media.PlayerState.BUFFERING:this.la(_.an)}};_.v(EL,_.R);_.t=EL.prototype;_.t.initialize=function(a){this.a=a};_.t.release=function(){this.g=[];this.f={}};
38
- _.t.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=_.ji;break;case chrome.cast.media.TrackType.AUDIO:c=_.Q;break;case chrome.cast.media.TrackType.TEXT:c=_.P}c=new _.hi(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);
39
- c.renditions.push(new _.pi(c.id,c));return c}):[],this.a.trigger(new _.J(_.Bq)))};_.t.destroy=function(){this.a=null};_.t.getVideoTracks=function(){return GL(this,_.ji)};_.t.getAudioTracks=function(){return GL(this,_.Q)};_.t.ha=function(){return GL(this,_.P)};_.t.ga=function(){var a=this.Ia();return a?a.renditions[0]:null};_.t.Fa=function(){var a=this.ma();return a?a.renditions[0]:null};_.t.Ga=function(){var a=this.na();return a?a.renditions[0]:null};_.t.Ua=function(){return this.f[_.ji]||null};
40
- _.t.fb=function(){return this.f[_.Q]||null};_.t.gb=function(){return this.f[_.P]||null};_.t.Ia=function(){return HL(this,_.ji)};_.t.ma=function(){return HL(this,_.Q)};_.t.na=function(){return HL(this,_.P)};_.t.ab=function(a){JL(this,_.ji,a)};_.t.sa=function(a){JL(this,_.Q,a)};_.t.Ba=function(a){JL(this,_.P,a)};_.t.$a=function(a){this.ab(a&&a.track)};_.t.mb=function(a){this.sa(a&&a.track)};_.t.nb=function(a){this.Ba(a&&a.track)};_.t.addTextTrack=function(){return _.B(function(a){_.z(a)})};_.t.ja=function(){return!0};
41
- EL.prototype.isAbrEnabled=EL.prototype.ja;EL.prototype.addTextTrack=EL.prototype.addTextTrack;EL.prototype.setTextRendition=EL.prototype.nb;EL.prototype.setAudioRendition=EL.prototype.mb;EL.prototype.setVideoRendition=EL.prototype.$a;EL.prototype.setTextTrack=EL.prototype.Ba;EL.prototype.setAudioTrack=EL.prototype.sa;EL.prototype.setVideoTrack=EL.prototype.ab;EL.prototype.getTextTrack=EL.prototype.na;EL.prototype.getAudioTrack=EL.prototype.ma;EL.prototype.getVideoTrack=EL.prototype.Ia;
42
- EL.prototype.getLoadingTextRendition=EL.prototype.gb;EL.prototype.getLoadingAudioRendition=EL.prototype.fb;EL.prototype.getLoadingVideoRendition=EL.prototype.Ua;EL.prototype.getTextRendition=EL.prototype.Ga;EL.prototype.getAudioRendition=EL.prototype.Fa;EL.prototype.getVideoRendition=EL.prototype.ga;EL.prototype.getTextTracks=EL.prototype.ha;EL.prototype.getAudioTracks=EL.prototype.getAudioTracks;EL.prototype.getVideoTracks=EL.prototype.getVideoTracks;_.v(NL,_.Rj);_.t=NL.prototype;_.t.init=function(a,b){this.g=this.K=b};_.t.unload=function(){var a=this;return new Promise(function(b,c){a.f&&a.f.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.t.release=function(){var a=this;return this.unload().then(function(){a.h&&a.h.release()})};_.t.destroy=function(){return _.B(function(a){_.z(a)})};_.t.nd=function(a){this.R=a};_.t.dc=function(){return this.w};_.t.jb=function(){return this.A};_.t.ue=function(){return this.fa};
43
- _.t.sendMessage=function(a,b){var c=this,d,e,f;return _.B(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.L(1,8,8004,void 0);g.H(2);break}_.zf(g,3);return _.x(g,e.sendMessage(a,xL(b)),5);case 5:_.Af(g,2);break;case 3:f=_.Bf(g),d=new _.L(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.z(g)}})};
44
- _.t.cast=function(){var a=this,b,c;return _.B(function(d){if(1==d.a){if(!a.dc())throw a.j.warn(oL),new _.L(1,8,8001,void 0);if(!$L)throw a.j.warn(mL),new _.L(1,8,8002,void 0);if(a.jb())throw a.j.warn("Already casting"),new _.L(1,8,8003,void 0);_.zf(d,2);return _.x(d,hM(a),4)}if(2!=d.a)return _.Af(d,0);b=_.Bf(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.L(1,8,8E3,c);})};
45
- _.t.qe=function(){this.jb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.t.addMessageListener=function(a){typeof a===_.jd&&this.F.add(a)};_.t.removeMessageListener=function(a){typeof a===_.jd&&this.F["delete"](a)};_.t.play=function(){var a=this;return this.isEnded()?jM(this,!0):new Promise(function(b,c){if(!a.a)return c(lL);a.a.play(null,b,c)})};_.t.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(lL);a.a.pause(null,b,c)})};
46
- _.t.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};_.t.isEnded=function(){return this.getState()===_.cn};_.t.seek=function(a){var b=this;return this.isEnded()?jM(this,!1,a):new Promise(function(c,d){b.a||d(lL);b.m.isPlayingBreak&&d(jL);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.J(_.Ne));b.a.seek(e,function(){b.trigger(new _.J(_.Me));c()},d)})};_.t.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
47
- _.t.getDuration=function(){if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.k?-1:-1===a?Infinity:a};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.t.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(uL,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
2
+ var f=function(window){var mL="Cannot seek during ads playout.",nL="Cannot switch track",oL="Media session does not exist.",pL="No receivers available",qL="Reset ABR functionality not available on cast.",rL="SDK not yet ready",sL="Sender is destroyed.",tL="clpp.cast.CastProxy",uL="clpp.cast.Player",vL="clpp.cast.Receiver",wL="urn:x-cast:castlabs",xL="urn:x-cast:com.google.cast.media",yL=function(a){return _.A(function(b){return 1==b.a?_.x(b,a.fc(_.Pd),2):_.x(b,a.fc(_.Od),0)})},zL=function(a,b){this.log=new _.H(b);this.a=
3
+ a;this.j=null;this.g=_.Xm;this.m=_.Ym;this.h=2;this.B=Date.now();this.A=-1},AL=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.ld){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ld?"detail"===e&&(d[e]=f):e in Event||(d[e]=f)}return d}return typeof c===_.k?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},BL=function(a){if(typeof a!==_.ve)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}},CL=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.A(function(q){if(1==q.a){if(b.includes(a.mimeType))return q["return"](a);g=f=e=null;for(h=0;h<b.length&&!f;)g=b[h++],f=_.Hi(d,a.mimeType,g);if(!f||!g)return q.G(2);l=_.Nh(a.url);return _.x(q,c.fetch(l).O,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.N(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)})},DL=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 _.Te:return d.FMP4;case _.Se:return b===_.ii?d.MPEG2_TS:c.TS;case _.mc:return c.AAC;case _.oc:return c.AC3;case _.pc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.qc:return c.FMP4}},FL=function(a){a=
6
+ void 0===a?EL:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.L(1,8,8001);var c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},GL=function(a){zL.call(this,a,"clpp.cast.SenderStateManager");
7
+ this.o=this.f=null;this.w=this.Ab.bind(this)},HL=function(){this.h=new _.H("clpp.cast.SenderTrackManager");this.a=null;this.g=[];this.f={}},IL=function(a){return(a=a.a?a.a.a:null)?a.activeTrackIds.map(function(b){return b.toString()}):[]},KL=function(a,b){var c=IL(a);return JL(a,b).find(function(d){return c.includes(d.id)})||null},JL=function(a,b){return a.g.filter(function(c){return c.type===b})},ML=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.P){var e=a.oa();
8
+ e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;LL(a,b)},function(f){a.f[b]=null;a.h.debug(nL,f)})}else b===_.P&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){LL(a,b)},function(f){a.h.debug(nL,f)}))},LL=function(a,b){b===_.Q?a.a.trigger(new _.J(_.Lj)):b===_.P&&a.a.trigger(new _.J(_.Mj))},QL=function(a,b,c,d){_.Sj.call(this);this.j=new _.H(_.Jc);this.aa=a;this.o=new _.Si(b);this.$=c;this.da=d;this.g=this.J=
9
+ _.Yj();this.D=[];this.B=0;this.M=new _.di;this.H=this.m=this.a=null;this.A=this.w=!1;this.ga="";this.Ra=1E6;this.f=new HL;this.f.initialize(this);this.h=new GL(this);this.I=new _.eg;this.K=null;this.F=new Set;this.S=this.Ui.bind(this);this.ua=this.mj.bind(this);this.ba=this.dj.bind(this);this.U=this.Yi.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(){NL(!0)},0)}});OL(this);PL.add(this)},
10
+ RL=function(a){var b,c;return _.A(function(d){if(1==d.a)return PL["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.S),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ua)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.h&&(c.push(a.h.destroy()),a.h=null),_.x(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.$=null;a.da=null;_.y(d)})},TL=function(a){if(!a)return null;
11
+ a:{var b=a.metadataType;var c=Object.entries(SL);c=_.u(c);for(var d=c.next();!d.done;d=c.next()){d=_.u(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=FL(SL[b]);return Object.assign(b,a)},UL=function(a){var b=void 0===b?EL:b;return Object.values(SL).includes(a)?a:b},XL=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},OL=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
12
+ a.aa.length){a.w=!0;a.o.af();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.S);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ua);bM&&a.o.Z(.02)}},gM=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.k?null:a):a=
13
+ null;a=null===a?null:a+b;return null===a?b:a},iM=function(a,b){hM(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ba);b.addMessageListener(wL,a.U)},hM=function(a,b){b!==a.a&&(a.a=b,a.a&&(a.I.release(),a.H=null,a.m=null,a.m=new cast.framework.RemotePlayer,a.H=new cast.framework.RemotePlayerController(a.m),a.I.on(a.H,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Pg.bind(a)),a.f&&a.f.load(),a.h&&a.h.init(),a.trigger(new _.J(_.xd))))},jM=function(a){return _.A(function(b){return a.ib()?
14
+ b.G(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},kM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,z,C,E,F;return _.A(function(B){switch(B.a){case 1:return c=chrome.cast.media.StreamType,d=_.Aq,_.x(B,jM(a),2);case 2:if(!b)return B["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;h=b;l=h.Db;m=h.audioMimeType;g.hlsVideoSegmentFormat=DL(l,d.VIDEO);
15
+ g.hlsSegmentFormat=DL(m,d.AUDIO);if(!b.Pa){B.G(3);break}if(!a.P){B.G(4);break}return _.x(B,Promise.resolve(a.P(b.Pa)),5);case 5:if(n=B.f)b.Pa=n;case 4:a.g=b.Pa;a.D=_.pn(a.g);a.B=a.D.findIndex(function(I){return I.url===b.source.url});if(!b.Pa.remoteTextTracks){B.G(6);break}return _.x(B,Promise.all(b.Pa.remoteTextTracks.map(a.Uh.bind(a))),7);case 7:p=B.f,g.tracks=p.filter(function(I){return I}),b.Pa.remoteTextTracks=void 0;case 6:delete b.Pa.autoplay,b.Pa.startTime=null,g.customData={playerConfiguration:AL(b.Pa)};
16
+ case 3:q=a.cb()||{};r=UL(q.metadataType);typeof b.Re===_.k&&(w={metadataType:r,sectionStartAbsoluteTime:b.Re});b.source.name&&(z={metadataType:r,title:b.source.name});C=XL(q);if(E=TL(Object.assign({},w,z,C)))g.metadata=E;F=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.uc&&(F.autoplay=b.autoplay);typeof b.currentTime===_.k&&(F.currentTime=b.currentTime);return _.x(B,f.loadMedia(F),0)}})},lM=function(a,b,c){c=void 0===c?0:c;var d,e;return _.A(function(f){(d=a.f.oa())&&d.language&&(a.g.preferredTextLanguage=
17
+ d.language);(e=a.f.na())&&e.language&&(a.g.preferredAudioLanguage=e.language);return _.x(f,kM(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Re:a.getPresentationStartTime(),autoplay:b,Pa:a.g}),0)})},NL=function(a){if(a){a=_.u(PL);for(var b=a.next();!b.done;b=a.next())OL(b.value)}},nM=function(a,b,c){_.Sj.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.ld?c:function(e,f){d.f&&e!==_.dn&&e!==_.Xm&&d.f.load(f)};this.a=mM(this);this.g=new _.H(tL);this.addDelegate(this.f)},mM=
18
+ function(a){return new QL(a.h,function(){a.trigger(new _.J(_.Ac))},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;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.lf&&(d.preferredAudioLanguage=c.lf);c.wg&&(d.preferredTextLanguage=c.wg);_.wo(a.f,null);a.trigger(new _.J("castingended"));a.j(b,d)},function(){return oM(a)})},oM=function(a){var b;return _.A(function(c){if(1==c.a)return a.trigger(new _.J(_.zc)),
19
+ b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.wo(a.f,a.a);_.y(c)})},pM=function(a){zL.call(this,a,"clpp.cast.StateManager");this.I=this.Tg.bind(this);this.H=this.Sg.bind(this);this.w=this.$i.bind(this);this.o=this.Ti.bind(this);this.K=this.Vg.bind(this);this.J=this.Ug.bind(this);this.M=this.pj.bind(this);this.F=this.cj.bind(this);this.D=this.T.bind(this);this.f=this.Rg.bind(this)},Z=function(a,b,c,d,e){this.a=a;this.f=b;this.h=typeof c===_.k?c:1;this.j=typeof d===_.k?d:1;this.g=
20
+ typeof e===_.k?e:0},qM=function(a){this.a=a},sM=function(a){this.l=a;this.a=null;this.g=this.Wg.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];
21
+ rM().addEventListener(this.f,this.g)},vM=function(a,b,c){var d,e,f,g,h,l,m;return _.A(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.zf(n,2);tM=!1;e=_.Nh(d);return _.x(n,c.fetch(e).O,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.vh(f.data),h=new DOMParser,l=h.parseFromString(g,_.Ee),l.getElementsByTagName("vmap:VMAP").length)_.G("VMAP detected."),a.vmapAdsRequest=uM(g);else if(l.getElementsByTagName("VAST").length){_.G("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");
22
+ p.vastAdsRequest=uM(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.G("Unsupported schema."),tM=!0;return _.Af(n,0)}m=_.Bf(n);_.G("Failed to fetch an ad",m);tM=!0;_.y(n)})},uM=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},rM=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},xM=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;
23
+ (c=wM(a,c))&&(d={ad:c});a.l.trigger(new _.J(b,d))}},yM=function(a,b){var c=new _.L(1,10,10003,{errorType:b});a.l.onError(c)},wM=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.ve&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.ve&&(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,
24
+ h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new Z(d,e,b.index,b.total,f)}return c},zM=function(a){this.Tb=a;this.a=this.f.bind(this)},AM=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]},BM=function(a){var b=a.dashTimedMetadata,c=_.Le;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Ke)?
25
+ _.og:_.mg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},CM=function(){this.g=new _.H("clpp.cast.TrackManager");this.l=null;this.o=1E9;this.h=[];this.j=[];this.m=this.wj.bind(this);this.a=this.f=null},DM=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},FM=function(a){a.a=DM().getTextTracksManager();var b=a.a.getTracks();a.j=EM(_.P,b)},GM=function(a,b,c,d){c=_.Fg(c).filter(function(h){return h});
26
+ var e=!1,f=[];b===_.Q?f=a.getAudioTracks():b===_.P&&(f=a.ia());if(c=c.find(function(h){var l=_.Ji(h);return f.some(function(m){m=_.Ji(m.language||"");return _.Ki(l,m)})})){var g=_.Ji(c);c=f.filter(function(h){h=_.Ji(h.language||"");return _.Ki(g,h)});f=c.length?c:f;e=e||!!c.length}_.Eh(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.Q?a.sa(e):b===_.P&&a.Ba(e))},EM=function(a,b){for(var c=[],d=_.u(b),e=
27
+ d.next();!e.done;e=d.next()){e=e.value;var f=new _.gi(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 _.oi(f.id,f));c.push(f)}return c},HM=function(){_.Sj.call(this);this.A=new _.H(uL);this.g=this.o=_.Yj();this.w=null;this.j=-1;this.F=new _.di;this.f=this.m=
28
+ this.h=this.a=this.B=null;this.D=!1},IM=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},LM=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=_.xk(d);if(e){var f=[_.Sc];_.pn(a)[0].type!==_.ic&&f.unshift(_.Tc);d.preferredDrmSystem===_.Sc&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Qa[g];h?(d=g===_.Tc?cast.framework.ContentProtection.WIDEVINE:
29
+ g===_.Sc?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},JM(b,h,a,d),KM(b,h,a,d)):c()}else c()}else c()},JM=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.Nh({method:"POST",uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=
30
+ f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},KM=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.A(function(h){return 1==h.a?(g=_.Oh(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.N(g.data))})}:a.licenseHandler=void 0},MM=function(){this.a=!1;this.h=new _.H(vL);this.f=this.l=null;this.g=new Set;this.A=this.bj.bind(this);this.w=this.Qg.bind(this);this.j=null;this.o=new _.eg;this.m=null},
31
+ OM=function(){return NM||(NM=new MM)},PM=function(){return cast.framework.CastReceiverContext.getInstance()},RM=function(a,b){a.h.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=PM();c=(PM().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Te:_.Se;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var h=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=QM(h,_.na),m=QM(h,_.ib),n=_.u([]),
32
+ p=n.next().value;n=n.next().value;m&&(m=_.u(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(h);++g}return f.join("\n")},QM=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('"'))):(c=d.indexOf(","),0<=c&&(d=d.substring(0,c)))}return d},SM=function(a){this.f=a;this.a=null;this.g=new _.eg;this.h=[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,
33
+ cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},UM=function(a,b){var c=null,d=TM(a);d&&(c={ad:d});a.f.trigger(new _.J(b,c))},TM=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(h){return h.id===a.a.breakId})||null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:
34
+ b.breaks.filter(function(h){return 0<=h.position}).sort(function(h,l){return h.position-l.position}).findIndex(function(h){return h===c})}b.breakClips&&(d=b.breakClips.find(function(h){return h.id===a.a.breakClipId})||null);b=new Z(d,c,e,f,g)}return b},VM=function(){},WM=function(){};_.t=zL.prototype;_.t.release=function(){this.ma(_.Xm)};_.t.destroy=function(){this.j=this.a=null;return Promise.resolve()};_.t.getState=function(){return this.g};_.t.onError=function(a){a.severity===_.M&&this.ma(_.hn)};
35
+ _.t.ma=function(a){if(a!==this.g)if(this.g===_.hn&&a!==_.Xm)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===_.bn?(this.A=b,this.a.trigger(new _.J(_.wc,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.m===_.bn&&this.a.trigger(new _.J(_.vc,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.g,previousState:this.m,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.Nm(this.j,this.g);this.a.trigger(new _.J(_.se,
36
+ {detail:a}))}};_.D("clpp.cast.CastUtils",function(){});var EL=0,SL={GENERIC:EL,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.v(GL,zL);GL.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.m)};GL.prototype.destroy=function(){var a=this;return _.A(function(b){a.f&&(a.f.removeUpdateListener(a.w),a.f=null);return _.x(b,zL.prototype.destroy.call(a),0)})};GL.prototype.ma=function(a){var b=this.a.m;b&&b.isPlayingBreak||zL.prototype.ma.call(this,a)};
37
+ GL.prototype.Ab=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.ma(_.dn);break;case chrome.cast.media.IdleReason.ERROR:this.ma(_.hn);break;default:this.ma(_.Xm)}break;case chrome.cast.media.PlayerState.PLAYING:this.ma(_.ln);break;case chrome.cast.media.PlayerState.PAUSED:this.ma(_.kn);break;case chrome.cast.media.PlayerState.BUFFERING:this.ma(_.bn)}};_.v(HL,_.R);_.t=HL.prototype;_.t.initialize=function(a){this.a=a};_.t.release=function(){this.g=[];this.f={}};
38
+ _.t.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=_.ii;break;case chrome.cast.media.TrackType.AUDIO:c=_.Q;break;case chrome.cast.media.TrackType.TEXT:c=_.P}c=new _.gi(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);
39
+ c.renditions.push(new _.oi(c.id,c));return c}):[],this.a.trigger(new _.J(_.Cq)))};_.t.destroy=function(){this.a=null};_.t.getVideoTracks=function(){return JL(this,_.ii)};_.t.getAudioTracks=function(){return JL(this,_.Q)};_.t.ia=function(){return JL(this,_.P)};_.t.ha=function(){var a=this.Ha();return a?a.renditions[0]:null};_.t.Ea=function(){var a=this.na();return a?a.renditions[0]:null};_.t.Fa=function(){var a=this.oa();return a?a.renditions[0]:null};_.t.Ta=function(){return this.f[_.ii]||null};
40
+ _.t.eb=function(){return this.f[_.Q]||null};_.t.fb=function(){return this.f[_.P]||null};_.t.Ha=function(){return KL(this,_.ii)};_.t.na=function(){return KL(this,_.Q)};_.t.oa=function(){return KL(this,_.P)};_.t.Za=function(a){ML(this,_.ii,a)};_.t.sa=function(a){ML(this,_.Q,a)};_.t.Ba=function(a){ML(this,_.P,a)};_.t.Ya=function(a){this.Za(a&&a.track)};_.t.lb=function(a){this.sa(a&&a.track)};_.t.mb=function(a){this.Ba(a&&a.track)};_.t.addTextTrack=function(){return _.A(function(a){_.y(a)})};_.t.ka=function(){return!0};
41
+ HL.prototype.isAbrEnabled=HL.prototype.ka;HL.prototype.addTextTrack=HL.prototype.addTextTrack;HL.prototype.setTextRendition=HL.prototype.mb;HL.prototype.setAudioRendition=HL.prototype.lb;HL.prototype.setVideoRendition=HL.prototype.Ya;HL.prototype.setTextTrack=HL.prototype.Ba;HL.prototype.setAudioTrack=HL.prototype.sa;HL.prototype.setVideoTrack=HL.prototype.Za;HL.prototype.getTextTrack=HL.prototype.oa;HL.prototype.getAudioTrack=HL.prototype.na;HL.prototype.getVideoTrack=HL.prototype.Ha;
42
+ HL.prototype.getLoadingTextRendition=HL.prototype.fb;HL.prototype.getLoadingAudioRendition=HL.prototype.eb;HL.prototype.getLoadingVideoRendition=HL.prototype.Ta;HL.prototype.getTextRendition=HL.prototype.Fa;HL.prototype.getAudioRendition=HL.prototype.Ea;HL.prototype.getVideoRendition=HL.prototype.ha;HL.prototype.getTextTracks=HL.prototype.ia;HL.prototype.getAudioTracks=HL.prototype.getAudioTracks;HL.prototype.getVideoTracks=HL.prototype.getVideoTracks;_.v(QL,_.Sj);_.t=QL.prototype;_.t.init=function(a,b){this.g=this.J=b};_.t.unload=function(){var a=this;return new Promise(function(b,c){a.f&&a.f.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.t.release=function(){var a=this;return this.unload().then(function(){a.h&&a.h.release()})};_.t.destroy=function(){return _.A(function(a){_.y(a)})};_.t.md=function(a){this.P=a};_.t.bc=function(){return this.w};_.t.ib=function(){return this.A};_.t.ue=function(){return this.ga};
43
+ _.t.sendMessage=function(a,b){var c=this,d,e,f;return _.A(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.L(1,8,8004,void 0);g.G(2);break}_.zf(g,3);return _.x(g,e.sendMessage(a,AL(b)),5);case 5:_.Af(g,2);break;case 3:f=_.Bf(g),d=new _.L(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.y(g)}})};
44
+ _.t.cast=function(){var a=this,b,c;return _.A(function(d){if(1==d.a){if(!a.bc())throw a.j.warn(rL),new _.L(1,8,8001,void 0);if(!bM)throw a.j.warn(pL),new _.L(1,8,8002,void 0);if(a.ib())throw a.j.warn("Already casting"),new _.L(1,8,8003,void 0);_.zf(d,2);return _.x(d,jM(a),4)}if(2!=d.a)return _.Af(d,0);b=_.Bf(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.L(1,8,8E3,c);})};
45
+ _.t.qe=function(){this.ib()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.t.addMessageListener=function(a){typeof a===_.ld&&this.F.add(a)};_.t.removeMessageListener=function(a){typeof a===_.ld&&this.F["delete"](a)};_.t.play=function(){var a=this;return this.isEnded()?lM(this,!0):new Promise(function(b,c){if(!a.a)return c(oL);a.a.play(null,b,c)})};_.t.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(oL);a.a.pause(null,b,c)})};
46
+ _.t.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};_.t.isEnded=function(){return this.getState()===_.dn};_.t.seek=function(a){var b=this;return this.isEnded()?lM(this,!1,a):new Promise(function(c,d){b.a||d(oL);b.m.isPlayingBreak&&d(mL);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.J(_.Ne));b.a.seek(e,function(){b.trigger(new _.J(_.Me));c()},d)})};_.t.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
47
+ _.t.getDuration=function(){if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.k?-1:-1===a?Infinity:a};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.t.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(xL,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
48
48
  _.t.getVolume=function(){return this.a&&this.a.volume.level};_.t.setVolume=function(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))};_.t.isMuted=function(){return this.a&&this.a.volume.muted};_.t.setMuted=function(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};
49
- _.t.getPresentationStartTime=function(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;var a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.k?null:1E-8===a?0:a};_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.t.getState=function(){return this.h?this.h.getState():_.Xm};
50
- _.t.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?yL(this.a.customData.stats):_.Sm()};_.t.isLive=function(){return Infinity===this.getDuration()};_.t.load=function(a){var b=this,c,d;return _.B(function(e){if(!b.dc())return b.j.warn(oL),e["return"]();if(!$L)return b.j.warn(mL),e["return"]();b.D=_.on(a);_.ak(a)&&(b.g=_.Zj(b.K,a));c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.g.autoplay,Pa:b.g,Eb:c.Eb,audioMimeType:c.audioMimeType};return _.x(e,iM(b,d),0)})};
51
- _.t.getBufferInfo=function(){return new _.Qj};_.t.getTrackManager=function(){return this.f};_.t.getConfiguration=function(){return this.g};_.t.getSurface=function(){return null};_.t.setNetworkEngine=function(a){this.N=a};_.t.getNetworkEngine=function(){return this.N};_.t.getSourceIndex=function(){return this.B};_.t.setSourceIndex=function(a){this.B=a};_.t.getLoadedSource=function(){return this.D[this.B]};_.t.getPeriods=function(){return[]};_.t.getDrmInfo=function(){return null};
52
- _.t.getTimelineCues=function(){return[]};_.t.resetAbr=function(){this.j.warn(nL)};_.t.onError=function(a){if(a&&(this.trigger(new _.J(_.hd,{detail:a})),this.h))this.h.onError(a)};_.t.namespace=function(){return _.Hc};_.t.canPlay=function(){return this.dc()?2:0};_.t.eb=function(){return this.L};_.t.kc=function(a){this.L=QL(a)};_.t.ke=function(){this.L=null};_.t.Ye=function(a){var b=this.eb()||{};a={metadataType:RL(b.metadataType),title:a};this.kc(Object.assign({},b,a))};
53
- _.t.We=function(a){var b=this.eb()||{},c=RL(b.metadataType);a=new chrome.cast.Image(a);this.kc(Object.assign({},b,{metadataType:c,images:[a]}))};_.t.Ve=function(a){var b=this.eb()||{};this.kc(Object.assign({},b,{metadataType:3,artist:a}))};_.t.Xe=function(a){var b=this.eb()||{};a={metadataType:RL(b.metadataType),releaseDate:a};this.kc(Object.assign({},b,a))};
54
- _.t.Yi=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;$L=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.fa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.bf()};
55
- _.t.qj=function(a){this.j.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;gM(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.jb()||(this.A=!0,gM(this,a.session),this.da());break;case cast.framework.SessionState.SESSION_ENDED:if(this.jb()&&this.a){var b=this.a.media,c=this.f.ma(),d=this.f.na();c=c&&c.language||void 0;d=d&&d.language||void 0;this.$(this.getState(),{source:{url:b.contentId,type:b.contentType,
56
- isLive:this.isLive()},currentTime:eM(this),yg:d,mf:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ba);a.session.removeMessageListener(tL,this.V);this.A=!1;this.a=null;this.J.release();this.m=this.I=null}};_.t.hj=function(a){this.j.debug("New media session",a.mediaSession);fM(this,a.mediaSession)};_.t.bj=function(a,b){if(a===tL&&0<this.F.size){var c=yL(b);this.F.forEach(function(d){return d(c)})}};_.t.Sg=function(){this.trigger(new _.J(_.Fe))};
57
- _.t.Xh=function(a){var b=this,c,d;return _.B(function(e){if(1==e.a)return c=null,_.x(e,zL(a,[_.De,_.gc],b.N,b.g),2);if(d=e.f)c=new chrome.cast.media.Track(b.Sa++,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)})};_.t.getTextDisplayer=function(){return null};NL.prototype.getTextDisplayer=NL.prototype.getTextDisplayer;NL.prototype.getNetworkEngine=NL.prototype.getNetworkEngine;
58
- NL.prototype.setNetworkEngine=NL.prototype.setNetworkEngine;var $L=!1,ML=new Set;window.__onGCastApiAvailable=KL;_.v(lM,_.Rj);_.t=lM.prototype;_.t.destroy=function(){var a=this;return _.B(function(b){if(1==b.a)return a.a?_.x(b,OL(a.a),3):b.H(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.z(b)})};_.t.ge=function(){return!!this.a&&this.a.dc()&&$L};_.t.jb=function(){return!!this.a&&this.a.jb()};_.t.ue=function(){return this.a?this.a.ue():""};_.t.nd=function(a){this.a&&this.a.nd(a)};
59
- _.t.cast=function(a){var b=this,c,d,e;return _.B(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.zf(f,2);return _.x(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.ma();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.na())l.language&&
60
- (g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.sc?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Se:b.f.getPresentationStartTime(),Eb:m,audioMimeType:p,Pa:g}}c=g;return _.x(f,mM(b),5);case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.x(f,b.f.load(a),7);if(b.a.a){f.H(7);break}return _.x(f,iM(b.a,c),7);case 7:_.Af(f,0);break;case 2:d=_.Bf(f),
61
- b.g.error("Error while trying to cast",d),e=new _.J(_.hd,{detail:d}),b.trigger(e),_.z(f)}})};_.t.qe=function(){this.a&&this.a.qe()};_.t.Og=function(a){var b=this;return _.B(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,OL(b.a),2):c.H(2)}b.a=kM(b);_.z(c)})};_.t.sendMessage=function(a){var b=this;return _.B(function(c){return b.a?_.x(c,b.a.sendMessage(tL,a),0):(b.g.warn(pL),c["return"]())})};_.t.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(pL)};
62
- _.t.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(pL)};_.t.eb=function(){return this.a&&this.a.eb()};_.t.kc=function(a){this.a&&this.a.kc(a)};_.t.ke=function(){this.a&&this.a.ke()};_.t.Ye=function(a){this.a&&this.a.Ye(a)};_.t.We=function(a){this.a&&this.a.We(a)};_.t.Ve=function(a){this.a&&this.a.Ve(a)};_.t.Xe=function(a){this.a&&this.a.Xe(a)};_.C(qL,lM);lM.prototype.setContentReleaseDate=lM.prototype.Xe;lM.prototype.setContentArtist=lM.prototype.Ve;
63
- lM.prototype.setContentImage=lM.prototype.We;lM.prototype.setContentTitle=lM.prototype.Ye;lM.prototype.clearContentMetadata=lM.prototype.ke;lM.prototype.setContentMetadata=lM.prototype.kc;lM.prototype.getContentMetadata=lM.prototype.eb;lM.prototype.removeMessageListener=lM.prototype.removeMessageListener;lM.prototype.addMessageListener=lM.prototype.addMessageListener;lM.prototype.sendMessage=lM.prototype.sendMessage;lM.prototype.changeReceiverId=lM.prototype.Og;lM.prototype.forceDisconnect=lM.prototype.qe;
64
- lM.prototype.cast=lM.prototype.cast;lM.prototype.setPlayerConfigInterceptor=lM.prototype.nd;lM.prototype.getReceiverName=lM.prototype.ue;lM.prototype.isCasting=lM.prototype.jb;lM.prototype.canCast=lM.prototype.ge;lM.prototype.destroy=lM.prototype.destroy;_.v(nM,wL);_.t=nM.prototype;
65
- _.t.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.J);b.addEventListener(a.PAUSE,this.I);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.L);b.addEventListener(a.SEEKED,this.K);b.addEventListener(a.STALLED,this.N);b.addEventListener(a.PLAYER_LOADING,this.F);b.addEventListener(a.ERROR,this.D);b.addEventListener(a.BITRATE_CHANGED,this.f)};
66
- _.t.destroy=function(){var a=this,b,c;return _.B(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.J);c.removeEventListener(b.PAUSE,a.I);c.removeEventListener(b.MEDIA_FINISHED,a.w);c.removeEventListener(b.BUFFERING,a.o);c.removeEventListener(b.SEEKING,a.L);c.removeEventListener(b.SEEKED,a.K);c.removeEventListener(b.STALLED,a.N);c.removeEventListener(b.PLAYER_LOADING,a.F);c.removeEventListener(b.ERROR,
67
- a.D);c.removeEventListener(b.BITRATE_CHANGED,a.f);return _.x(d,wL.prototype.destroy.call(a),0)})};_.t.Wg=function(){this.a.trigger(new _.J(_.Yd));this.la(_.kn)};_.t.Vg=function(){this.la(_.jn)};_.t.dj=function(){this.la(_.cn)};_.t.Xi=function(a){a.isBuffering?this.la(_.an):(a=this.a.isPaused()?_.jn:_.kn,this.la(a))};_.t.Yg=function(){this.h=1;this.a.trigger(new _.J(_.Ne))};_.t.Xg=function(){this.a.trigger(new _.J(_.Me))};_.t.tj=function(){this.h=2};_.t.gj=function(){this.la(_.hn)};
68
- _.t.Ug=function(a){var b=this.a.getStats();this.a.trigger(new _.J(_.rc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.t.U=function(a){a=new _.L(_.M,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.a.trigger(new _.J(_.hd,{detail:a}));this.la(_.gn)};_.t=Z.prototype;_.t.sb=function(){return"Google Cast Framework"};_.t.tb=function(){return cast.framework.VERSION};_.t.yb=function(){return 0};_.t.getId=function(){return""};_.t.getCreativeId=function(){return""};_.t.getApiFramework=function(){return null};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return this.a.title||""};_.t.getDuration=function(){return this.a.duration||0};
69
- _.t.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.t.fc=function(){return!1};_.t.Kb=function(){return this.a.clickThroughUrl||null};_.t.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.t.vb=function(){return 0};_.t.ub=function(){return 0};_.t.hb=function(){return 0};_.t.Va=function(){switch(this.Lb()){case 0:return 0;case -1:return 2;default:return 1}};_.t.getPodIndex=function(){return this.g};_.t.Lb=function(){return this.f.position};_.t.Mb=function(){return this.h};
70
- _.t.xb=function(){return this.j};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};_.t.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.xb;Z.prototype.getPositionInSequence=Z.prototype.Mb;Z.prototype.getPodTimeOffset=Z.prototype.Lb;
71
- Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Va;Z.prototype.getMediaBitrate=Z.prototype.hb;Z.prototype.getMediaHeight=Z.prototype.ub;Z.prototype.getMediaWidth=Z.prototype.vb;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.Kb;Z.prototype.isBumper=Z.prototype.fc;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;
72
- Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.yb;Z.prototype.getAdManagerVersion=Z.prototype.tb;Z.prototype.getAdManagerName=Z.prototype.sb;oM.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};oM.prototype.Nb=function(){return!!this.a.find(function(a){return 0===a.position})};oM.prototype.ib=function(){return!!this.a.find(function(a){return-1===a.position})};oM.prototype.hasPostroll=oM.prototype.ib;oM.prototype.hasPreroll=oM.prototype.Nb;oM.prototype.getCuePoints=oM.prototype.getCuePoints;_.t=qM.prototype;_.t.load=function(){var a=this;return _.B(function(b){rM&&(rM=!1,wM(a,0));_.z(b)})};_.t.start=function(){return _.B(function(a){pM().play();_.z(a)})};_.t.resume=function(){-1!==this.getPosition()&&pM().play()};_.t.pause=function(){-1!==this.getPosition()&&pM().pause()};_.t.skip=function(){};_.t.getVolume=function(){return this.l.getVolume()||0};_.t.setVolume=function(a){this.l.setVolume(a)};
73
- _.t.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.t.dispose=function(){var a=this;return _.B(function(b){pM().removeEventListener(a.f,a.g);_.z(b)})};
74
- _.t.Zg=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=pM().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.l.trigger(new _.J(_.Xb,{adsTimeline:new oM(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:vM(this,_.Nb,a);break;case cast.framework.events.EventType.BREAK_STARTED:vM(this,_.Gb,a);break;case cast.framework.events.EventType.BREAK_ENDED:vM(this,_.Hb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:vM(this,
75
- _.Tb,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(vM(this,_.Sb,a),vM(this,_.Ub,a)):a.endedReason===b.STOPPED?vM(this,_.Ub,a):a.endedReason===b.END_OF_STREAM?(vM(this,_.Kb,a),vM(this,_.Ub,a)):a.endedReason===b.ERROR&&wM(this,1);break;case cast.framework.events.EventType.PLAYING:vM(this,_.Rb,a);break;case cast.framework.events.EventType.PAUSE:vM(this,_.Pb,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?vM(this,_.Ib,a):vM(this,_.Rb,a)}};
76
- qM.prototype.getPosition=qM.prototype.getPosition;qM.prototype.setVolume=qM.prototype.setVolume;qM.prototype.getVolume=qM.prototype.getVolume;qM.prototype.skip=qM.prototype.skip;qM.prototype.pause=qM.prototype.pause;qM.prototype.resume=qM.prototype.resume;var rM=!1;xM.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(yM(),this.a)};xM.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(yM(),this.a)};xM.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return zM(a)})};
77
- xM.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=_.pg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.rg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.sg}b&&this.Ub(new _.J(b,{detail:zM(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Ub(new _.J(_.pg,{detail:b.value}))};_.v(AM,_.R);_.t=AM.prototype;_.t.initialize=function(a){this.l=a;BM().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.t.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.t.load=function(){};_.t.destroy=function(){this.l=null;BM().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.t.getVideoTracks=function(){return[]};_.t.getAudioTracks=function(){return this.h};_.t.ha=function(){return this.j};_.t.ga=function(){return null};
78
- _.t.Fa=function(){var a=this.ma();return a&&a.renditions[0]};_.t.Ga=function(){var a=this.na();return a&&a.renditions[0]};_.t.Ua=function(){return null};_.t.fb=function(){return null};_.t.gb=function(){return null};_.t.Ia=function(){return null};_.t.ma=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.k&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
79
- _.t.na=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ha().find(function(c){return c.id===b})||null)}return a};_.t.ab=function(){this.g.warn("Video tracks unavailable on Cast")};_.t.sa=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.t.Ba=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.t.$a=function(){this.g.warn("Video renditions unavailable on Cast")};_.t.mb=function(a){this.sa(a&&a.track)};
80
- _.t.nb=function(a){this.Ba(a&&a.track)};
81
- _.t.addTextTrack=function(a){var b=this,c,d,e;return _.B(function(f){if(1==f.a)return c=b.l.getConfiguration(),_.x(f,zL(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]),DM(b)}catch(g){throw b.g.warn("failed on track",
82
- a),g;}}_.z(f)})};_.t.ja=function(){return!0};_.t.Aj=function(){this.f=BM().getAudioTracksManager();var a=this.f.getTracks();this.h=CM(_.Q,a);DM(this);a=this.l.getConfiguration();EM(this,_.Q,a.preferredAudioLanguage,a.preferredAudioRole);EM(this,_.P,a.preferredTextLanguage,a.preferredTextRole)};AM.prototype.isAbrEnabled=AM.prototype.ja;AM.prototype.addTextTrack=AM.prototype.addTextTrack;AM.prototype.setTextRendition=AM.prototype.nb;AM.prototype.setAudioRendition=AM.prototype.mb;
83
- AM.prototype.setVideoRendition=AM.prototype.$a;AM.prototype.setTextTrack=AM.prototype.Ba;AM.prototype.setAudioTrack=AM.prototype.sa;AM.prototype.setVideoTrack=AM.prototype.ab;AM.prototype.getTextTrack=AM.prototype.na;AM.prototype.getAudioTrack=AM.prototype.ma;AM.prototype.getVideoTrack=AM.prototype.Ia;AM.prototype.getLoadingTextRendition=AM.prototype.gb;AM.prototype.getLoadingAudioRendition=AM.prototype.fb;AM.prototype.getLoadingVideoRendition=AM.prototype.Ua;AM.prototype.getTextRendition=AM.prototype.Ga;
84
- AM.prototype.getAudioRendition=AM.prototype.Fa;AM.prototype.getVideoRendition=AM.prototype.ga;AM.prototype.getTextTracks=AM.prototype.ha;AM.prototype.getAudioTracks=AM.prototype.getAudioTracks;AM.prototype.getVideoTracks=AM.prototype.getVideoTracks;_.v(FM,_.Rj);_.t=FM.prototype;_.t.init=function(a,b){var c=this;this.B=a;b&&(this.g=this.o=b);var d=GM();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.ij.bind(this));d.setMediaPlaybackInfoHandler(this.Ig.bind(this));this.a=new nM(this);this.a.init();this.h=new AM;this.h.initialize(this);this.m=new xM(function(e){return c.trigger(e)});this.m.init()};
85
- _.t.unload=function(){var a=cast.framework.messages.PlayerState,b=GM();b.getPlayerState()!==a.IDLE&&b.stop();this.h&&this.h.release();this.m&&this.m.release();this.f=null;return Promise.resolve()};_.t.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.t.destroy=function(){var a=this;return _.B(function(b){if(1==b.a)return a.B=null,a.o=_.Xj(),a.g=a.o,a.j=-1,a.w=null,a.a?_.x(b,a.a.destroy(),3):b.H(2);2!=b.a&&(a.a=null);a.h&&(a.h.destroy(),a.h=null);_.z(b)})};
86
- _.t.play=function(){var a=GM();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.t.pause=function(){var a=GM();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.t.isPaused=function(){return GM().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
87
- _.t.isEnded=function(){return GM().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.t.seek=function(a){var b=GM();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(jL);b.seek(a);return Promise.resolve()};_.t.getPosition=function(){return GM().getCurrentTimeSec()};_.t.getDuration=function(){var a=GM().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.t.getPlaybackRate=function(){return GM().getPlaybackRate()};
88
- _.t.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;GM().sendLocalMediaRequest(b)}};_.t.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.t.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.t.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
89
- _.t.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.t.getLoadedSource=function(){var a=GM().getMediaInformation();if(a){var b=GM().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,tk:b,name:c}}return null};_.t.getDrmInfo=function(){return null};
90
- _.t.getPresentationStartTime=function(){return GM().getStartAbsoluteTime()};_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=GM().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.t.getState=function(){return this.a?this.a.getState():_.Xm};
91
- _.t.getStats=function(){var a=_.Sm();if(this.f){a=GM().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.m=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.o=a.width||NaN;b.g=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.j=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.h=c;a=this.f.getStats()}return a};_.t.isLive=function(){return Infinity===this.getDuration()};
92
- _.t.load=function(a){var b=this,c,d;return _.B(function(e){b.f=new _.Rm;b.a.j=b.f.a;b.w=_.on(a);_.ak(a)&&(b.g=_.Zj(b.o,a));if(b.D)return b.D=!1,e["return"]();c=b.w[b.j];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.g.autoplay;typeof b.g.startTime===_.k&&(d.currentTime=b.g.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:xL(b.g),local:!0};return _.x(e,GM().load(d),0)})};_.t.getBufferInfo=function(){this.A.warn(_.sa);return new _.Qj};
93
- _.t.getTrackManager=function(){return this.h};_.t.getConfiguration=function(){return this.g};_.t.getSurface=function(){return this.B};_.t.setNetworkEngine=function(a){this.F=a};_.t.getNetworkEngine=function(){return this.F};_.t.getSourceIndex=function(){return this.j};_.t.setSourceIndex=function(a){this.j=a};_.t.getPeriods=function(){return[]};_.t.namespace=function(){return rL};_.t.getTimelineCues=function(){return this.m&&this.m.getTimelineCues()||[]};_.t.resetAbr=function(){this.A.warn(nL)};
94
- _.t.onError=function(a){this.trigger(new _.J(_.hd,{detail:a}))};_.t.canPlay=function(){return _.Xi()?2:0};
95
- _.t.ij=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=xL(this.getStats());var b=GM(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.k&&c.startAbsoluteTime!==b&&(this.A.info("Syncing startAbsoluteTime.Old value: "+(c.startAbsoluteTime+", new value: ")+b),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));c=cast.framework.messages.StreamType;b=a.media;var d=!!b,e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&
96
- (!e||e&&f)){d=GM().getStartAbsoluteTime();if(typeof d===_.k){b.startAbsoluteTime=d;var h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}return a};_.t.Ig=function(a,b){var c=null;a.media.customData&&(c=yL(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;JM(c,b);return b};
97
- _.t.getTextDisplayer=function(){return null};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};FM.prototype.getTextDisplayer=FM.prototype.getTextDisplayer;FM.prototype.getNetworkEngine=FM.prototype.getNetworkEngine;FM.prototype.setNetworkEngine=FM.prototype.setNetworkEngine;_.t=KM.prototype;_.t.init=function(a){var b=this;a&&(this.f=new FM,_.vo(a,this.f),this.l=a,this.o.on(window,"unload",function(){return _.B(function(c){return b.l&&b.l.getState()!==_.Wm?_.x(c,vL(b.l),0):c.H(0)})}))};
98
- _.t.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=NM(),b=NM().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[tL]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Di.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.l&&this.l.getSurface().getMedia())c.mediaElement=
99
- d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Ci.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(tL,this.w)}};
100
- _.t.stop=function(){if(this.a){this.a=!1;this.o.release();var a=NM();NM().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(tL,this.w);a.stop();this.l=this.f=null}};_.t.nd=function(a){this.j=a};_.t.Nj=function(a){this.m=a};_.t.on=function(a,b){NM().addEventListener(a,b)};_.t.off=function(a,b){NM().removeEventListener(a,b)};_.t.addMessageListener=function(a){typeof a===_.jd&&this.g.add(a)};
101
- _.t.removeMessageListener=function(a){typeof a===_.jd&&this.g["delete"](a)};_.t.sendMessage=function(a,b){NM().sendCustomMessage(tL,b,xL(a))};_.t.dc=function(){return this.a};_.t.eb=function(){var a=NM().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
102
- _.t.Di=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return PM(this,a);try{var b=(new DOMParser).parseFromString(a,_.Ee)}catch(r){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.h.debug("Detected DASH, parsing");b=NM();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ha),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.Re||g===_.jc){g=e[f].getAttribute(_.Cd);for(var h=e[f].getElementsByTagName(_.lb),l=
103
- h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Cd)||g,n=h[l].getAttribute(_.Mc),p=h[l].getAttribute(_.ff)||void 0,q=h[l].getAttribute(_.kd)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(h[l])}e[f].getElementsByTagName(_.lb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ha).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.ub)[0]){a=c;this.h.debug("Detected Smooth, parsing");b=NM();c=a.getElementsByTagName("StreamIndex");
104
- for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Re){e=c[d].getElementsByTagName(_.ib);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Wa)||void 0,h=e[f].getAttribute(_.Va)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Te,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.ib).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
105
- _.t.Ci=function(a){var b=this,c,d,e,f,g,h;return _.B(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=yL(c.media.customData.playerConfiguration));if(!b.l||!d){l.H(2);break}if(!b.j){l.H(3);break}return _.x(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.H(5);break}return _.x(l,tM(c.media,d.ima,b.l.getNetworkEngine()),5);case 5:typeof d.startTime===_.k&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.H(7);
106
- break}b.f.D=!0;return _.x(l,_.zo(b.l,d),8);case 8:return _.x(l,_.Ao(b.l),9);case 9:f=b.l.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Eb&&(c.media.hlsVideoSegmentFormat=AL(f.Eb,_.ji)),f.audioMimeType&&(c.media.hlsSegmentFormat=AL(f.audioMimeType,_.Q));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.k){var m=g.sectionStartAbsoluteTime;g.sectionStartAbsoluteTime=0===m?1E-8:m}void 0===c.autoplay&&(c.autoplay=b.l.getConfiguration().autoplay);case 2:if(!b.m){l.H(10);
107
- break}return _.x(l,Promise.resolve(b.m(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.t.fj=function(a){if(this.l&&(!a.media.customData||!a.media.customData.local)){a=_.K.yi;var b=NM().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.l.getConfiguration().startTime;typeof d!==_.k||typeof c!==_.k||typeof e!==_.k||a(e,d,c)||(b=b.getMediaTimeForAbsoluteTime(e),typeof b===_.k&&a(b,d,c)&&this.l.seek(b))}_.Co(this.l)}};
108
- _.t.Tg=function(a){if(0<this.g.size){var b=yL(a.data);this.g.forEach(function(c){return c(b)})}};_.C(sL,KM);KM.prototype.getContentMetadata=KM.prototype.eb;KM.prototype.isApiReady=KM.prototype.dc;KM.prototype.sendMessage=KM.prototype.sendMessage;KM.prototype.removeMessageListener=KM.prototype.removeMessageListener;KM.prototype.addMessageListener=KM.prototype.addMessageListener;KM.prototype.off=KM.prototype.off;KM.prototype.on=KM.prototype.on;KM.prototype.setLoadRequestDataInterceptor=KM.prototype.Nj;
109
- KM.prototype.setPlayerConfigInterceptor=KM.prototype.nd;KM.prototype.stop=KM.prototype.stop;KM.prototype.start=KM.prototype.start;KM.prototype.init=KM.prototype.init;KM.getInstance=MM;var LM=null;_.t=QM.prototype;_.t.load=function(){var a=this,b,c,d,e,f;return _.B(function(g){a.a=a.f.m;if(a.a)for(b=a.a.controller,c=a.vj.bind(a),d=_.u(a.h),e=d.next();!e.done;e=d.next())f=e.value,a.g.on(b,f,c);_.z(g)})};_.t.start=function(){return _.B(function(a){_.z(a)})};_.t.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.t.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
110
- _.t.skip=function(){var a=this.f.a;a&&this.f.sendMessage(uL,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.t.getVolume=function(){return this.f.getVolume()||0};_.t.setVolume=function(a){this.f.setVolume(a)};_.t.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.t.dispose=function(){var a=this;return _.B(function(b){a.g.release();_.z(b)})};
111
- _.t.vj=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.J(_.Xb,{adsTimeline:new oM(a.breaks)})));break;case "isPlayingBreak":a.value?SM(this,_.Gb):(SM(this,_.Kb),SM(this,_.Ub),SM(this,_.Hb));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(SM(this,_.Kb),SM(this,_.Ub)),SM(this,_.Tb));break;case "isPaused":this.a.isPlayingBreak&&(a.value?SM(this,_.Pb):SM(this,_.Rb))}};QM.prototype.getPosition=QM.prototype.getPosition;
112
- QM.prototype.setVolume=QM.prototype.setVolume;QM.prototype.getVolume=QM.prototype.getVolume;QM.prototype.skip=QM.prototype.skip;QM.prototype.pause=QM.prototype.pause;QM.prototype.resume=QM.prototype.resume;TM.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};TM.prototype.ca=function(a,b){return a.namespace()!==_.Hc?!1:!(!b||!b.ima)};TM.prototype.create=function(a){return new QM(a.a)};TM.prototype.create=TM.prototype.create;TM.prototype.isSupported=TM.prototype.ca;TM.prototype.name=TM.prototype.name;_.Dn(new TM);UM.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};UM.prototype.ca=function(a,b){return MM().dc()?!(!b||!b.ima):!1};UM.prototype.create=function(a){return new qM(a)};UM.prototype.create=UM.prototype.create;UM.prototype.isSupported=UM.prototype.ca;UM.prototype.name=UM.prototype.name;_.Dn(new UM);};
49
+ _.t.getPresentationStartTime=function(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;var a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.k?null:1E-8===a?0:a};_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.t.getState=function(){return this.h?this.h.getState():_.Ym};
50
+ _.t.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?BL(this.a.customData.stats):_.Tm()};_.t.isLive=function(){return Infinity===this.getDuration()};_.t.load=function(a){var b=this,c,d;return _.A(function(e){if(!b.bc())return b.j.warn(rL),e["return"]();if(!bM)return b.j.warn(pL),e["return"]();b.D=_.pn(a);_.bk(a)&&(b.g=_.ak(b.J,a));c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.g.autoplay,Pa:b.g,Db:c.Db,audioMimeType:c.audioMimeType};return _.x(e,kM(b,d),0)})};
51
+ _.t.getBufferInfo=function(){return new _.Rj};_.t.getTrackManager=function(){return this.f};_.t.getConfiguration=function(){return this.g};_.t.getSurface=function(){return null};_.t.setNetworkEngine=function(a){this.M=a};_.t.getNetworkEngine=function(){return this.M};_.t.getSourceIndex=function(){return this.B};_.t.setSourceIndex=function(a){this.B=a};_.t.getLoadedSource=function(){return this.D[this.B]};_.t.getPeriods=function(){return[]};_.t.getDrmInfo=function(){return null};
52
+ _.t.getTimelineCues=function(){return[]};_.t.resetAbr=function(){this.j.warn(qL)};_.t.onError=function(a){if(a&&(this.trigger(new _.J(_.jd,{detail:a})),this.h))this.h.onError(a)};_.t.namespace=function(){return _.Jc};_.t.canPlay=function(){return this.bc()?2:0};_.t.cb=function(){return this.K};_.t.ic=function(a){this.K=TL(a)};_.t.je=function(){this.K=null};_.t.Xe=function(a){var b=this.cb()||{};a={metadataType:UL(b.metadataType),title:a};this.ic(Object.assign({},b,a))};
53
+ _.t.Ve=function(a){var b=this.cb()||{},c=UL(b.metadataType);a=new chrome.cast.Image(a);this.ic(Object.assign({},b,{metadataType:c,images:[a]}))};_.t.Ue=function(a){var b=this.cb()||{};this.ic(Object.assign({},b,{metadataType:3,artist:a}))};_.t.We=function(a){var b=this.cb()||{};a={metadataType:UL(b.metadataType),releaseDate:a};this.ic(Object.assign({},b,a))};
54
+ _.t.Ui=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;bM=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ga=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.af()};
55
+ _.t.mj=function(a){this.j.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;iM(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ib()||(this.A=!0,iM(this,a.session),this.da());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ib()&&this.a){var b=this.a.media,c=this.f.na(),d=this.f.oa();c=c&&c.language||void 0;d=d&&d.language||void 0;this.$(this.getState(),{source:{url:b.contentId,type:b.contentType,
56
+ isLive:this.isLive()},currentTime:gM(this),wg:d,lf:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ba);a.session.removeMessageListener(wL,this.U);this.A=!1;this.a=null;this.I.release();this.m=this.H=null}};_.t.dj=function(a){this.j.debug("New media session",a.mediaSession);hM(this,a.mediaSession)};_.t.Yi=function(a,b){if(a===wL&&0<this.F.size){var c=BL(b);this.F.forEach(function(d){return d(c)})}};_.t.Pg=function(){this.trigger(new _.J(_.Fe))};
57
+ _.t.Uh=function(a){var b=this,c,d;return _.A(function(e){if(1==e.a)return c=null,_.x(e,CL(a,[_.De,_.hc],b.M,b.g),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ra++,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)})};_.t.getTextDisplayer=function(){return null};QL.prototype.getTextDisplayer=QL.prototype.getTextDisplayer;QL.prototype.getNetworkEngine=QL.prototype.getNetworkEngine;
58
+ QL.prototype.setNetworkEngine=QL.prototype.setNetworkEngine;var bM=!1,PL=new Set;window.__onGCastApiAvailable=NL;_.v(nM,_.Sj);_.t=nM.prototype;_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a)return a.a?_.x(b,RL(a.a),3):b.G(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.y(b)})};_.t.fe=function(){return!!this.a&&this.a.bc()&&bM};_.t.ib=function(){return!!this.a&&this.a.ib()};_.t.ue=function(){return this.a?this.a.ue():""};_.t.md=function(a){this.a&&this.a.md(a)};
59
+ _.t.cast=function(a){var b=this,c,d,e;return _.A(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.zf(f,2);return _.x(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.na();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.oa())l.language&&
60
+ (g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.uc?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Re:b.f.getPresentationStartTime(),Db:m,audioMimeType:p,Pa:g}}c=g;return _.x(f,oM(b),5);case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.x(f,b.f.load(a),7);if(b.a.a){f.G(7);break}return _.x(f,kM(b.a,c),7);case 7:_.Af(f,0);break;case 2:d=_.Bf(f),
61
+ b.g.error("Error while trying to cast",d),e=new _.J(_.jd,{detail:d}),b.trigger(e),_.y(f)}})};_.t.qe=function(){this.a&&this.a.qe()};_.t.Lg=function(a){var b=this;return _.A(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,RL(b.a),2):c.G(2)}b.a=mM(b);_.y(c)})};_.t.sendMessage=function(a){var b=this;return _.A(function(c){return b.a?_.x(c,b.a.sendMessage(wL,a),0):(b.g.warn(sL),c["return"]())})};_.t.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(sL)};
62
+ _.t.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(sL)};_.t.cb=function(){return this.a&&this.a.cb()};_.t.ic=function(a){this.a&&this.a.ic(a)};_.t.je=function(){this.a&&this.a.je()};_.t.Xe=function(a){this.a&&this.a.Xe(a)};_.t.Ve=function(a){this.a&&this.a.Ve(a)};_.t.Ue=function(a){this.a&&this.a.Ue(a)};_.t.We=function(a){this.a&&this.a.We(a)};_.D(tL,nM);nM.prototype.setContentReleaseDate=nM.prototype.We;nM.prototype.setContentArtist=nM.prototype.Ue;
63
+ nM.prototype.setContentImage=nM.prototype.Ve;nM.prototype.setContentTitle=nM.prototype.Xe;nM.prototype.clearContentMetadata=nM.prototype.je;nM.prototype.setContentMetadata=nM.prototype.ic;nM.prototype.getContentMetadata=nM.prototype.cb;nM.prototype.removeMessageListener=nM.prototype.removeMessageListener;nM.prototype.addMessageListener=nM.prototype.addMessageListener;nM.prototype.sendMessage=nM.prototype.sendMessage;nM.prototype.changeReceiverId=nM.prototype.Lg;nM.prototype.forceDisconnect=nM.prototype.qe;
64
+ nM.prototype.cast=nM.prototype.cast;nM.prototype.setPlayerConfigInterceptor=nM.prototype.md;nM.prototype.getReceiverName=nM.prototype.ue;nM.prototype.isCasting=nM.prototype.ib;nM.prototype.canCast=nM.prototype.fe;nM.prototype.destroy=nM.prototype.destroy;_.v(pM,zL);_.t=pM.prototype;
65
+ _.t.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.F);b.addEventListener(a.ERROR,this.D);b.addEventListener(a.BITRATE_CHANGED,this.f)};
66
+ _.t.destroy=function(){var a=this,b,c;return _.A(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.F);c.removeEventListener(b.ERROR,
67
+ a.D);c.removeEventListener(b.BITRATE_CHANGED,a.f);return _.x(d,zL.prototype.destroy.call(a),0)})};_.t.Tg=function(){this.a.trigger(new _.J(_.Zd));this.ma(_.ln)};_.t.Sg=function(){this.ma(_.kn)};_.t.$i=function(){this.ma(_.dn)};_.t.Ti=function(a){a.isBuffering?this.ma(_.bn):(a=this.a.isPaused()?_.kn:_.ln,this.ma(a))};_.t.Vg=function(){this.h=1;this.a.trigger(new _.J(_.Ne))};_.t.Ug=function(){this.a.trigger(new _.J(_.Me))};_.t.pj=function(){this.h=2};_.t.cj=function(){this.ma(_.jn)};
68
+ _.t.Rg=function(a){var b=this.a.getStats();this.a.trigger(new _.J(_.tc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.t.T=function(a){a=new _.L(_.M,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.a.trigger(new _.J(_.jd,{detail:a}));this.ma(_.hn)};_.t=Z.prototype;_.t.rb=function(){return"Google Cast Framework"};_.t.sb=function(){return cast.framework.VERSION};_.t.xb=function(){return 0};_.t.getId=function(){return""};_.t.getCreativeId=function(){return""};_.t.getApiFramework=function(){return null};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return this.a.title||""};_.t.getDuration=function(){return this.a.duration||0};
69
+ _.t.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.t.dc=function(){return!1};_.t.Jb=function(){return this.a.clickThroughUrl||null};_.t.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.t.ub=function(){return 0};_.t.tb=function(){return 0};_.t.gb=function(){return 0};_.t.Ua=function(){switch(this.Kb()){case 0:return 0;case -1:return 2;default:return 1}};_.t.getPodIndex=function(){return this.g};_.t.Kb=function(){return this.f.position};_.t.Lb=function(){return this.h};
70
+ _.t.wb=function(){return this.j};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};_.t.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.wb;Z.prototype.getPositionInSequence=Z.prototype.Lb;Z.prototype.getPodTimeOffset=Z.prototype.Kb;
71
+ Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Ua;Z.prototype.getMediaBitrate=Z.prototype.gb;Z.prototype.getMediaHeight=Z.prototype.tb;Z.prototype.getMediaWidth=Z.prototype.ub;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.Jb;Z.prototype.isBumper=Z.prototype.dc;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;
72
+ Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.xb;Z.prototype.getAdManagerVersion=Z.prototype.sb;Z.prototype.getAdManagerName=Z.prototype.rb;qM.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};qM.prototype.Mb=function(){return!!this.a.find(function(a){return 0===a.position})};qM.prototype.hb=function(){return!!this.a.find(function(a){return-1===a.position})};qM.prototype.hasPostroll=qM.prototype.hb;qM.prototype.hasPreroll=qM.prototype.Mb;qM.prototype.getCuePoints=qM.prototype.getCuePoints;_.t=sM.prototype;_.t.load=function(){var a=this;return _.A(function(b){tM&&(tM=!1,yM(a,0));_.y(b)})};_.t.start=function(){return _.A(function(a){rM().play();_.y(a)})};_.t.resume=function(){-1!==this.getPosition()&&rM().play()};_.t.pause=function(){-1!==this.getPosition()&&rM().pause()};_.t.skip=function(){};_.t.getVolume=function(){return this.l.getVolume()||0};_.t.setVolume=function(a){this.l.setVolume(a)};
73
+ _.t.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.t.dispose=function(){var a=this;return _.A(function(b){rM().removeEventListener(a.f,a.g);_.y(b)})};
74
+ _.t.Wg=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=rM().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.l.trigger(new _.J(_.Xb,{adsTimeline:new qM(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:xM(this,_.Nb,a);break;case cast.framework.events.EventType.BREAK_STARTED:xM(this,_.Gb,a);break;case cast.framework.events.EventType.BREAK_ENDED:xM(this,_.Hb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:xM(this,
75
+ _.Tb,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(xM(this,_.Sb,a),xM(this,_.Ub,a)):a.endedReason===b.STOPPED?xM(this,_.Ub,a):a.endedReason===b.END_OF_STREAM?(xM(this,_.Kb,a),xM(this,_.Ub,a)):a.endedReason===b.ERROR&&yM(this,1);break;case cast.framework.events.EventType.PLAYING:xM(this,_.Rb,a);break;case cast.framework.events.EventType.PAUSE:xM(this,_.Pb,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?xM(this,_.Ib,a):xM(this,_.Rb,a)}};
76
+ sM.prototype.getPosition=sM.prototype.getPosition;sM.prototype.setVolume=sM.prototype.setVolume;sM.prototype.getVolume=sM.prototype.getVolume;sM.prototype.skip=sM.prototype.skip;sM.prototype.pause=sM.prototype.pause;sM.prototype.resume=sM.prototype.resume;var tM=!1;zM.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(AM(),this.a)};zM.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(AM(),this.a)};zM.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return BM(a)})};
77
+ zM.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=_.pg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.rg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.sg}b&&this.Tb(new _.J(b,{detail:BM(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Tb(new _.J(_.pg,{detail:b.value}))};_.v(CM,_.R);_.t=CM.prototype;_.t.initialize=function(a){this.l=a;DM().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.t.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.t.load=function(){};_.t.destroy=function(){this.l=null;DM().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.t.getVideoTracks=function(){return[]};_.t.getAudioTracks=function(){return this.h};_.t.ia=function(){return this.j};_.t.ha=function(){return null};
78
+ _.t.Ea=function(){var a=this.na();return a&&a.renditions[0]};_.t.Fa=function(){var a=this.oa();return a&&a.renditions[0]};_.t.Ta=function(){return null};_.t.eb=function(){return null};_.t.fb=function(){return null};_.t.Ha=function(){return null};_.t.na=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.k&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
79
+ _.t.oa=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ia().find(function(c){return c.id===b})||null)}return a};_.t.Za=function(){this.g.warn("Video tracks unavailable on Cast")};_.t.sa=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.t.Ba=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.t.Ya=function(){this.g.warn("Video renditions unavailable on Cast")};_.t.lb=function(a){this.sa(a&&a.track)};
80
+ _.t.mb=function(a){this.Ba(a&&a.track)};
81
+ _.t.addTextTrack=function(a){var b=this,c,d,e;return _.A(function(f){if(1==f.a)return c=b.l.getConfiguration(),_.x(f,CL(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]),FM(b)}catch(g){throw b.g.warn("failed on track",
82
+ a),g;}}_.y(f)})};_.t.ka=function(){return!0};_.t.wj=function(){this.f=DM().getAudioTracksManager();var a=this.f.getTracks();this.h=EM(_.Q,a);FM(this);a=this.l.getConfiguration();GM(this,_.Q,a.preferredAudioLanguage,a.preferredAudioRole);GM(this,_.P,a.preferredTextLanguage,a.preferredTextRole)};CM.prototype.isAbrEnabled=CM.prototype.ka;CM.prototype.addTextTrack=CM.prototype.addTextTrack;CM.prototype.setTextRendition=CM.prototype.mb;CM.prototype.setAudioRendition=CM.prototype.lb;
83
+ CM.prototype.setVideoRendition=CM.prototype.Ya;CM.prototype.setTextTrack=CM.prototype.Ba;CM.prototype.setAudioTrack=CM.prototype.sa;CM.prototype.setVideoTrack=CM.prototype.Za;CM.prototype.getTextTrack=CM.prototype.oa;CM.prototype.getAudioTrack=CM.prototype.na;CM.prototype.getVideoTrack=CM.prototype.Ha;CM.prototype.getLoadingTextRendition=CM.prototype.fb;CM.prototype.getLoadingAudioRendition=CM.prototype.eb;CM.prototype.getLoadingVideoRendition=CM.prototype.Ta;CM.prototype.getTextRendition=CM.prototype.Fa;
84
+ CM.prototype.getAudioRendition=CM.prototype.Ea;CM.prototype.getVideoRendition=CM.prototype.ha;CM.prototype.getTextTracks=CM.prototype.ia;CM.prototype.getAudioTracks=CM.prototype.getAudioTracks;CM.prototype.getVideoTracks=CM.prototype.getVideoTracks;_.v(HM,_.Sj);_.t=HM.prototype;_.t.init=function(a,b){var c=this;this.B=a;b&&(this.g=this.o=b);var d=IM();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.ej.bind(this));d.setMediaPlaybackInfoHandler(this.Gg.bind(this));this.a=new pM(this);this.a.init();this.h=new CM;this.h.initialize(this);this.m=new zM(function(e){return c.trigger(e)});this.m.init()};
85
+ _.t.unload=function(){var a=cast.framework.messages.PlayerState,b=IM();b.getPlayerState()!==a.IDLE&&b.stop();this.h&&this.h.release();this.m&&this.m.release();this.f=null;return Promise.resolve()};_.t.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a)return a.B=null,a.o=_.Yj(),a.g=a.o,a.j=-1,a.w=null,a.a?_.x(b,a.a.destroy(),3):b.G(2);2!=b.a&&(a.a=null);a.h&&(a.h.destroy(),a.h=null);_.y(b)})};
86
+ _.t.play=function(){var a=IM();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.t.pause=function(){var a=IM();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.t.isPaused=function(){return IM().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
87
+ _.t.isEnded=function(){return IM().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.t.seek=function(a){var b=IM();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(mL);b.seek(a);return Promise.resolve()};_.t.getPosition=function(){return IM().getCurrentTimeSec()};_.t.getDuration=function(){var a=IM().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.t.getPlaybackRate=function(){return IM().getPlaybackRate()};
88
+ _.t.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;IM().sendLocalMediaRequest(b)}};_.t.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.t.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.t.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
89
+ _.t.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.t.getLoadedSource=function(){var a=IM().getMediaInformation();if(a){var b=IM().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,pk:b,name:c}}return null};_.t.getDrmInfo=function(){return null};
90
+ _.t.getPresentationStartTime=function(){return IM().getStartAbsoluteTime()};_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=IM().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.t.getState=function(){return this.a?this.a.getState():_.Ym};
91
+ _.t.getStats=function(){var a=_.Tm();if(this.f){a=IM().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.m=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.o=a.width||NaN;b.g=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.j=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.h=c;a=this.f.getStats()}return a};_.t.isLive=function(){return Infinity===this.getDuration()};
92
+ _.t.load=function(a){var b=this,c,d;return _.A(function(e){b.f=new _.Sm;b.a.j=b.f.a;b.w=_.pn(a);_.bk(a)&&(b.g=_.ak(b.o,a));if(b.D)return b.D=!1,e["return"]();c=b.w[b.j];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.g.autoplay;typeof b.g.startTime===_.k&&(d.currentTime=b.g.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:AL(b.g),local:!0};return _.x(e,IM().load(d),0)})};_.t.getBufferInfo=function(){this.A.warn(_.ra);return new _.Rj};
93
+ _.t.getTrackManager=function(){return this.h};_.t.getConfiguration=function(){return this.g};_.t.getSurface=function(){return this.B};_.t.setNetworkEngine=function(a){this.F=a};_.t.getNetworkEngine=function(){return this.F};_.t.getSourceIndex=function(){return this.j};_.t.setSourceIndex=function(a){this.j=a};_.t.getPeriods=function(){return[]};_.t.namespace=function(){return uL};_.t.getTimelineCues=function(){return this.m&&this.m.getTimelineCues()||[]};_.t.resetAbr=function(){this.A.warn(qL)};
94
+ _.t.onError=function(a){this.trigger(new _.J(_.jd,{detail:a}))};_.t.canPlay=function(){return _.Yi()?2:0};
95
+ _.t.ej=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=AL(this.getStats());var b=IM(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.k&&c.startAbsoluteTime!==b&&(this.A.info("Syncing startAbsoluteTime.Old value: "+(c.startAbsoluteTime+", new value: ")+b),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));c=cast.framework.messages.StreamType;b=a.media;var d=!!b,e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&
96
+ (!e||e&&f)){d=IM().getStartAbsoluteTime();if(typeof d===_.k){b.startAbsoluteTime=d;var h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}return a};_.t.Gg=function(a,b){var c=null;a.media.customData&&(c=BL(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;LM(c,b);return b};
97
+ _.t.getTextDisplayer=function(){return null};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};HM.prototype.getTextDisplayer=HM.prototype.getTextDisplayer;HM.prototype.getNetworkEngine=HM.prototype.getNetworkEngine;HM.prototype.setNetworkEngine=HM.prototype.setNetworkEngine;_.t=MM.prototype;_.t.init=function(a){var b=this;a&&(this.f=new HM,_.wo(a,this.f),this.l=a,this.o.on(window,"unload",function(){return _.A(function(c){return b.l&&b.l.getState()!==_.Xm?_.x(c,yL(b.l),0):c.G(0)})}))};
98
+ _.t.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=PM(),b=PM().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[wL]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.zi.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.l&&this.l.getSurface().getMedia())c.mediaElement=
99
+ d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.yi.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(wL,this.w)}};
100
+ _.t.stop=function(){if(this.a){this.a=!1;this.o.release();var a=PM();PM().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(wL,this.w);a.stop();this.l=this.f=null}};_.t.md=function(a){this.j=a};_.t.Jj=function(a){this.m=a};_.t.on=function(a,b){PM().addEventListener(a,b)};_.t.off=function(a,b){PM().removeEventListener(a,b)};_.t.addMessageListener=function(a){typeof a===_.ld&&this.g.add(a)};
101
+ _.t.removeMessageListener=function(a){typeof a===_.ld&&this.g["delete"](a)};_.t.sendMessage=function(a,b){PM().sendCustomMessage(wL,b,AL(a))};_.t.bc=function(){return this.a};_.t.cb=function(){var a=PM().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
102
+ _.t.zi=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return RM(this,a);try{var b=(new DOMParser).parseFromString(a,_.Ee)}catch(r){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.h.debug("Detected DASH, parsing");b=PM();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===_.Re||g===_.kc){g=e[f].getAttribute(_.Dd);for(var h=e[f].getElementsByTagName(_.kb),l=
103
+ h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Dd)||g,n=h[l].getAttribute(_.Oc),p=h[l].getAttribute(_.ff)||void 0,q=h[l].getAttribute(_.md)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(h[l])}e[f].getElementsByTagName(_.kb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.fa).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.sb)[0]){a=c;this.h.debug("Detected Smooth, parsing");b=PM();c=a.getElementsByTagName("StreamIndex");
104
+ for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Re){e=c[d].getElementsByTagName(_.hb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Wa)||void 0,h=e[f].getAttribute(_.Va)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Te,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.hb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
105
+ _.t.yi=function(a){var b=this,c,d,e,f,g,h;return _.A(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=BL(c.media.customData.playerConfiguration));if(!b.l||!d){l.G(2);break}if(!b.j){l.G(3);break}return _.x(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.G(5);break}return _.x(l,vM(c.media,d.ima,b.l.getNetworkEngine()),5);case 5:typeof d.startTime===_.k&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.G(7);
106
+ break}b.f.D=!0;return _.x(l,_.Ao(b.l,d),8);case 8:return _.x(l,_.Bo(b.l),9);case 9:f=b.l.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Db&&(c.media.hlsVideoSegmentFormat=DL(f.Db,_.ii)),f.audioMimeType&&(c.media.hlsSegmentFormat=DL(f.audioMimeType,_.Q));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.k){var m=g.sectionStartAbsoluteTime;g.sectionStartAbsoluteTime=0===m?1E-8:m}void 0===c.autoplay&&(c.autoplay=b.l.getConfiguration().autoplay);case 2:if(!b.m){l.G(10);
107
+ break}return _.x(l,Promise.resolve(b.m(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.t.bj=function(a){if(this.l&&(!a.media.customData||!a.media.customData.local)){a=_.K.si;var b=PM().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.l.getConfiguration().startTime;typeof d!==_.k||typeof c!==_.k||typeof e!==_.k||a(e,d,c)||(b=b.getMediaTimeForAbsoluteTime(e),typeof b===_.k&&a(b,d,c)&&this.l.seek(b))}_.Do(this.l)}};
108
+ _.t.Qg=function(a){if(0<this.g.size){var b=BL(a.data);this.g.forEach(function(c){return c(b)})}};_.D(vL,MM);MM.prototype.getContentMetadata=MM.prototype.cb;MM.prototype.isApiReady=MM.prototype.bc;MM.prototype.sendMessage=MM.prototype.sendMessage;MM.prototype.removeMessageListener=MM.prototype.removeMessageListener;MM.prototype.addMessageListener=MM.prototype.addMessageListener;MM.prototype.off=MM.prototype.off;MM.prototype.on=MM.prototype.on;MM.prototype.setLoadRequestDataInterceptor=MM.prototype.Jj;
109
+ MM.prototype.setPlayerConfigInterceptor=MM.prototype.md;MM.prototype.stop=MM.prototype.stop;MM.prototype.start=MM.prototype.start;MM.prototype.init=MM.prototype.init;MM.getInstance=OM;var NM=null;_.t=SM.prototype;_.t.load=function(){var a=this,b,c,d,e,f;return _.A(function(g){a.a=a.f.m;if(a.a)for(b=a.a.controller,c=a.rj.bind(a),d=_.u(a.h),e=d.next();!e.done;e=d.next())f=e.value,a.g.on(b,f,c);_.y(g)})};_.t.start=function(){return _.A(function(a){_.y(a)})};_.t.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.t.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
110
+ _.t.skip=function(){var a=this.f.a;a&&this.f.sendMessage(xL,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.t.getVolume=function(){return this.f.getVolume()||0};_.t.setVolume=function(a){this.f.setVolume(a)};_.t.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.t.dispose=function(){var a=this;return _.A(function(b){a.g.release();_.y(b)})};
111
+ _.t.rj=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.J(_.Xb,{adsTimeline:new qM(a.breaks)})));break;case "isPlayingBreak":a.value?UM(this,_.Gb):(UM(this,_.Kb),UM(this,_.Ub),UM(this,_.Hb));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(UM(this,_.Kb),UM(this,_.Ub)),UM(this,_.Tb));break;case "isPaused":this.a.isPlayingBreak&&(a.value?UM(this,_.Pb):UM(this,_.Rb))}};SM.prototype.getPosition=SM.prototype.getPosition;
112
+ SM.prototype.setVolume=SM.prototype.setVolume;SM.prototype.getVolume=SM.prototype.getVolume;SM.prototype.skip=SM.prototype.skip;SM.prototype.pause=SM.prototype.pause;SM.prototype.resume=SM.prototype.resume;VM.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};VM.prototype.ca=function(a,b){return a.namespace()!==_.Jc?!1:!(!b||!b.ima)};VM.prototype.create=function(a){return new SM(a.a)};VM.prototype.create=VM.prototype.create;VM.prototype.isSupported=VM.prototype.ca;VM.prototype.name=VM.prototype.name;_.En(new VM);WM.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};WM.prototype.ca=function(a,b){return OM().bc()?!(!b||!b.ima):!1};WM.prototype.create=function(a){return new sM(a)};WM.prototype.create=WM.prototype.create;WM.prototype.isSupported=WM.prototype.ca;WM.prototype.name=WM.prototype.name;_.En(new WM);};
113
113
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
114
114
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
115
115
  else{_=this.clpp._;(f.call(g,this));}