@castlabs/prestoplay 6.12.0 → 6.13.0

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 (62) hide show
  1. package/CHANGELOG.md +22 -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 +106 -106
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +504 -505
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +53 -50
  11. package/cjs/cl.freewheel.js +22 -22
  12. package/cjs/cl.hls.js +66 -66
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +21 -21
  16. package/cjs/cl.mse.js +269 -267
  17. package/cjs/cl.muxdata.js +14 -14
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.simid.js +15 -15
  22. package/cjs/cl.smooth.js +71 -71
  23. package/cjs/cl.thumbnails.js +26 -24
  24. package/cjs/cl.tizen.js +68 -68
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +13 -13
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +16 -16
  31. package/cjs/polyfill.min.js +26 -23
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +83 -83
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +416 -416
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +67 -67
  40. package/cl.externs.js +53 -50
  41. package/cl.freewheel.js +15 -15
  42. package/cl.hls.js +69 -69
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +15 -15
  46. package/cl.mse.js +232 -231
  47. package/cl.muxdata.js +12 -12
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +10 -10
  50. package/cl.playlist.js +5 -5
  51. package/cl.simid.js +13 -13
  52. package/cl.smooth.js +59 -59
  53. package/cl.thumbnails.js +19 -17
  54. package/cl.tizen.js +57 -57
  55. package/cl.ttml.js +22 -22
  56. package/cl.verimatrix.js +4 -4
  57. package/cl.vimond.js +8 -8
  58. package/cl.vr.js +14 -14
  59. package/cl.vtt.js +12 -12
  60. package/cl.youbora.js +13 -13
  61. package/package.json +1 -1
  62. package/typings.d.ts +82 -13
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ # 6.13.0
2
+
3
+ ## New Features
4
+
5
+ * Add configuration options `cl.api.TrickPlayConfiguration` to control the behavior of trick play.
6
+ * `trickPlay.speedUpMode` to control the mode of trick play `decoder` or `seek`
7
+ * `trickPlay.preferTrickPlayTracks` to control the default selection of trick play tracks
8
+ * `setPlaybackRate` method now accept optional `speedUpMode` parameter [clpp.Player docs](https://demo.castlabs.com/#/docs?q=clpp.Player#setPlaybackRate).
9
+ * For details refer to [trick play configuration](https://demo.castlabs.com/#/docs?q=clpp#TrickPlayConfiguration).
10
+
11
+ ## Changes
12
+
13
+ * Fix an issue where specific live/IPR DASH streams get stuck buffering at
14
+ the end of the live stream instead of properly ending.
15
+ * Fix the issue introduced in 6.11.0 that causes the player to report error `1007`
16
+ instead of `1001` in case of a network error.
17
+ * Emit recoverable error events from player in case thumbnails fail to load
18
+ or wrong configuration is used.
19
+ * Improve behavior of Trick Play:
20
+ * Improve fallback to seek mode when native trick play is not supported by platform (negatives rates, high speed trick play modes).
21
+ * Added workaround for Tizen devices, fixing situation when reverse rate played frames forward during trick play.
22
+
1
23
  # 6.12.0
2
24
 
3
25
  ## New Features
package/cjs/cl.adobe.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var OR=function(){this.m=this.f=null;this.a="";this.g=new _.K("clpp.adobe.AdobePlugin")},RR=function(a){a.f=new _.Dh;a.f.on(a.m,_.mg,function(){return PR(a)});a.f.on(a.m,_.lg,function(){s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Ee,function(){return QR(a)});a.f.on(a.m,_.Sf,function(b){b=b.detail;switch(b.currentState){case _.Ro:a.a.length||QR(a);s.Media.play(a.a,a.m.getPosition());break;case _.Qo:case _.Io:PR(a);break;case _.Ko:case _.Do:case _.Oo:a.g.info("Close session for "+a.a+" in player state "+
3
- (b.currentState+".")),PR(a),s.Media.close(a.a),a.a=""}})},QR=function(a){var b=a.m.getLoadedSource();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.m.getDuration());s.Media.open(a.a,a.m.getDuration(),_.xa)},PR=function(a){s.Media.stop(a.a,a.m.getPosition())},SR=function(){};_.w(OR,_.kt);OR.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.m=a,RR(this)):this.g.warn("Adobe API not available.")};
4
- OR.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""};OR.prototype.id=function(){return"adobe"};_.H("clpp.adobe.AdobeAnalyticsPlugin",OR);OR.Id="adobe";SR.prototype.create=function(){return new OR};_.jq(new SR);};
2
+ var f=function(window){var $R=function(){this.m=this.f=null;this.a="";this.g=new _.K("clpp.adobe.AdobePlugin")},cS=function(a){a.f=new _.Eh;a.f.on(a.m,_.ng,function(){return aS(a)});a.f.on(a.m,_.mg,function(){s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Fe,function(){return bS(a)});a.f.on(a.m,_.Tf,function(b){b=b.detail;switch(b.currentState){case _.Uo:a.a.length||bS(a);s.Media.play(a.a,a.m.getPosition());break;case _.To:case _.Lo:aS(a);break;case _.No:case _.Go:case _.Ro:a.g.info("Close session for "+a.a+" in player state "+
3
+ (b.currentState+".")),aS(a),s.Media.close(a.a),a.a=""}})},bS=function(a){var b=a.m.getLoadedSource();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.m.getDuration());s.Media.open(a.a,a.m.getDuration(),_.wa)},aS=function(a){s.Media.stop(a.a,a.m.getPosition())},dS=function(){};_.w($R,_.qt);$R.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.m=a,cS(this)):this.g.warn("Adobe API not available.")};
4
+ $R.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""};$R.prototype.id=function(){return"adobe"};_.H("clpp.adobe.AdobeAnalyticsPlugin",$R);$R.Id="adobe";dS.prototype.create=function(){return new $R};_.mq(new dS);};
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 MR=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.rk(function(){a.m.play()["catch"](function(){})});this.h=new _.Dh},NR=function(){};_.w(MR,_.kt);_.r=MR.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.r.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.el.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Fl.bind(this)))};
3
- _.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.el=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.L(_.Qc,{canCast:this.f}))};_.r.Fl=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Pc:_.Oc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Ro)this.l?this.m.play()["catch"](function(){}):this.o.aa(.01);this.m.trigger(new _.L(a))};_.r.ob=function(){return this.j};
4
- _.r.Te=function(){return this.f};_.r.nm=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.H("clpp.airplay.AirPlayPlugin",MR);MR.prototype.showCastMenu=MR.prototype.nm;MR.prototype.canCast=MR.prototype.Te;MR.prototype.isCasting=MR.prototype.ob;MR.Id="airplay";NR.prototype.create=function(){return new MR};_.jq(new NR);};
2
+ var f=function(window){var YR=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.sk(function(){a.m.play()["catch"](function(){})});this.h=new _.Eh},ZR=function(){};_.w(YR,_.qt);_.r=YR.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.r.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.cl.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Dl.bind(this)))};
3
+ _.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.cl=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.L(_.Qc,{canCast:this.f}))};_.r.Dl=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Pc:_.Oc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Uo)this.l?this.m.play()["catch"](function(){}):this.o.aa(.01);this.m.trigger(new _.L(a))};_.r.ob=function(){return this.j};
4
+ _.r.Se=function(){return this.f};_.r.mm=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.H("clpp.airplay.AirPlayPlugin",YR);YR.prototype.showCastMenu=YR.prototype.mm;YR.prototype.canCast=YR.prototype.Se;YR.prototype.isCasting=YR.prototype.ob;YR.Id="airplay";ZR.prototype.create=function(){return new YR};_.mq(new ZR);};
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 ER=function(a,b){this.m=a;this.f=b;this.a=new _.Dh;this.h=!1},FR=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.a=_.Ej();return d}_.w(b,GenericPlayerApi);b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return _.ia};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.m.isLive()?
3
- 0:1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){return 1E3*this.m.getPosition()};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};return new b(a)},GR=function(){this.j=this.f=this.a=this.h=this.m=null;this.l=new _.Dh},HR=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof f===_.Vf&&a.h.setUUID(f))},IR=function(a,
4
- b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();for(var d in c)a.a.setCustomParameter(d,c[d]);a.l.on(a.m,_.me,a.U.bind(a));a.j=FR(a.m);a.a.attachPlayer(a.j)},JR=function(a,b){_.Gh(a.l);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},KR=function(){return!window.SmartLib||!window.GenericPlayerApi},LR=function(){};_.r=ER.prototype;_.r.init=function(){var a=this.m,b=this.a;b.on(a,_.Sf,this.wi.bind(this));b.on(a,_.gd,this.si.bind(this));b.on(a,"seek",this.vi.bind(this))};
5
- _.r.si=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.r.wi=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.Io&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Io:c.notifyStallStart();break;case _.Ro:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Qo:c.notifyPause()}};_.r.vi=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.r.release=function(){this.a&&(_.Gh(this.a),this.a=null)};_.w(GR,_.kt);_.r=GR.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(KR())return a.onError(new _.P(1,9,11E3));HR(this,d);IR(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.P(1,9,11001,{bpkErrorCode:f,message:e}));JR(c,void 0)}else b.url=e.getURL(),c.f=new ER(c.m,c.j),c.f.init()})}};
6
- _.r.U=function(a){a=a.detail;if(7003===a.code)JR(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.Q)switch(a.category){case 3:JR(this,SmartLib.BPDecodingError);break;case 1:JR(this,SmartLib.BPNetworkingError);break;case 6:JR(this,SmartLib.BPAccessRightError);break;default:JR(this,SmartLib.BPUnspecifiedError)}};_.r.onPlayerWillRelease=function(){KR()||JR(this,SmartLib.BPSessionEndsNormally)};_.r.id=function(){return"broadpeak"};_.H("clpp.broadpeak.BroadpeakPlugin",GR);
7
- GR.isSdkMissing=KR;GR.Id="broadpeak";LR.prototype.create=function(){return new GR};_.jq(new LR);};
2
+ var f=function(window){var PR=function(a,b){this.m=a;this.f=b;this.a=new _.Eh;this.h=!1},QR=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.a=_.Fj();return d}_.w(b,GenericPlayerApi);b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return _.ia};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.m.isLive()?
3
+ 0:1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){return 1E3*this.m.getPosition()};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};return new b(a)},RR=function(){this.j=this.f=this.a=this.h=this.m=null;this.l=new _.Eh},SR=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof f===_.Wf&&a.h.setUUID(f))},TR=function(a,
4
+ b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();for(var d in c)a.a.setCustomParameter(d,c[d]);a.l.on(a.m,_.ne,a.U.bind(a));a.j=QR(a.m);a.a.attachPlayer(a.j)},UR=function(a,b){_.Hh(a.l);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},VR=function(){return!window.SmartLib||!window.GenericPlayerApi},WR=function(){};_.r=PR.prototype;_.r.init=function(){var a=this.m,b=this.a;b.on(a,_.Tf,this.si.bind(this));b.on(a,_.gd,this.pi.bind(this));b.on(a,"seek",this.ri.bind(this))};
5
+ _.r.pi=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.r.si=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.Lo&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Lo:c.notifyStallStart();break;case _.Uo:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.To:c.notifyPause()}};_.r.ri=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.r.release=function(){this.a&&(_.Hh(this.a),this.a=null)};_.w(RR,_.qt);_.r=RR.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(VR())return a.onError(new _.P(1,9,11E3));SR(this,d);TR(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.P(1,9,11001,{bpkErrorCode:f,message:e}));UR(c,void 0)}else b.url=e.getURL(),c.f=new PR(c.m,c.j),c.f.init()})}};
6
+ _.r.U=function(a){a=a.detail;if(7003===a.code)UR(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.Q)switch(a.category){case 3:UR(this,SmartLib.BPDecodingError);break;case 1:UR(this,SmartLib.BPNetworkingError);break;case 6:UR(this,SmartLib.BPAccessRightError);break;default:UR(this,SmartLib.BPUnspecifiedError)}};_.r.onPlayerWillRelease=function(){VR()||UR(this,SmartLib.BPSessionEndsNormally)};_.r.id=function(){return"broadpeak"};_.H("clpp.broadpeak.BroadpeakPlugin",RR);
7
+ RR.isSdkMissing=VR;RR.Id="broadpeak";WR.prototype.create=function(){return new RR};_.mq(new WR);};
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,116 +1,116 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var SP="Cannot seek during ads playout.",TP="Cannot switch track",UP="Media session does not exist.",VP="No receivers available",WP="Reset ABR functionality not available on cast.",XP="SDK not yet ready",YP="Sender is destroyed.",ZP="clpp.cast.CastProxy",$P="clpp.cast.Player",aQ="clpp.cast.Receiver",bQ="urn:x-cast:castlabs",cQ="urn:x-cast:com.google.cast.media",dQ=function(a){return _.E(function(b){return 1==b.a?_.x(b,a.uc(_.We),2):_.x(b,a.uc(_.Ve),0)})},eQ=function(a,b){this.log=new _.K(b);this.player=
3
- a;this.j=null;this.f=_.Do;this.l=_.Eo;this.h=2;this.B=Date.now();this.A=-1},fQ=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.oe){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Se?"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}})},gQ=function(a){if(typeof a!==_.Vf)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}},hQ=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.E(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=_.ok(d,a.mimeType,g);if(!f||!g)return q.F(2);l=_.qj(a.url);return _.x(q,c.fetch(l).O,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Ti(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)})},iQ=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 _.tg:return d.FMP4;case _.sg:return b===_.Pj?d.MPEG2_TS:c.TS;case _.ad:return c.AAC;case _.bd:return c.AC3;case _.cd:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.dd:return c.FMP4}},kQ=function(a){a=
6
- void 0===a?jQ:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.P(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}},lQ=function(a){eQ.call(this,a,"clpp.cast.SenderStateManager");
7
- this.o=this.a=null;this.w=this.Hb.bind(this)},mQ=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},nQ=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},pQ=function(a,b){var c=nQ(a);return oQ(a,b).find(function(d){return c.includes(d.id)})||null},oQ=function(a,b){return a.h.filter(function(c){return c.type===b})},rQ=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.S){var e=a.ta();
8
- e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;qQ(a,b)},function(f){a.f[b]=null;a.g.debug(TP,f)})}else b===_.S&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){qQ(a,b)},function(f){a.g.debug(TP,f)}))},qQ=function(a,b){b===_.T?a.a.trigger(new _.L(_.ll)):b===_.S&&a.a.trigger(new _.L(_.ml))},vQ=function(a,b,c,d){_.sl.call(this);this.g=new _.K(_.Cd);this.fa=a;this.o=new _.tk(b);this.da=c;this.oa=d;this.h=this.J=
9
- _.yl();this.D=[];this.B=0;this.M=new _.Hj;this.H=this.l=this.a=null;this.A=this.w=!1;this.pa="";this.Va=1E6;this.f=new mQ;this.f.initialize(this);this.j=new lQ(this);this.I=new _.Dh;this.K=null;this.G=new Set;this.T=this.gl.bind(this);this.Da=this.zl.bind(this);this.ia=this.ql.bind(this);this.V=this.kl.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(){sQ(!0)},0)}});tQ(this);uQ.add(this)},
10
- wQ=function(a){var b,c;return _.E(function(d){if(1==d.a)return uQ["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.Da)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.x(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.da=null;a.oa=null;_.y(d)})},BQ=function(a){if(!a)return null;
11
- a:{var b=a.metadataType;var c=Object.entries(xQ);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=kQ(xQ[b]);return Object.assign(b,a)},GQ=function(a){var b=void 0===b?jQ:b;return Object.values(xQ).includes(a)?a:b},LQ=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},tQ=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
12
- a.fa.length){a.w=!0;a.o.Sf();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.fa;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.Da);MQ&&a.o.aa(.02)}},NQ=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},PQ=function(a,b){OQ(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ia);b.addMessageListener(bQ,a.V)},OQ=function(a,b){a.a=b;a.a&&(a.I.release(),a.H=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.H=new cast.framework.RemotePlayerController(a.l),a.I.on(a.H,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.xi.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.L(_.Ee)))},QQ=function(a){return _.E(function(b){return a.ob()?
14
- b.F(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},RQ=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,D,G,F;return _.E(function(C){switch(C.a){case 1:return c=chrome.cast.media.StreamType,d=_.Tt,_.x(C,QQ(a),2);case 2:if(!b)return C["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.Lb;m=h.audioMimeType;g.hlsVideoSegmentFormat=iQ(l,d.VIDEO);
15
- g.hlsSegmentFormat=iQ(m,d.AUDIO);if(!b.Xa){C.F(3);break}if(!a.P){C.F(4);break}return _.x(C,Promise.resolve(a.P(b.Xa)),5);case 5:if(n=C.f)b.Xa=n;case 4:a.h=b.Xa;a.D=_.Vo(a.h);a.B=a.D.findIndex(function(I){return I.url===b.source.url});if(!b.Xa.remoteTextTracks){C.F(6);break}return _.x(C,Promise.all(b.Xa.remoteTextTracks.map(a.Ej.bind(a))),7);case 7:p=C.f,g.tracks=p.filter(function(I){return I}),b.Xa.remoteTextTracks=void 0;case 6:delete b.Xa.autoplay,b.Xa.startTime=null,g.customData={playerConfiguration:fQ(b.Xa)};
16
- case 3:q=a.jb()||{};t=GQ(q.metadataType);typeof b.If===_.k&&(v={metadataType:t,sectionStartAbsoluteTime:b.If});b.source.name&&(z={metadataType:t,title:b.source.name});D=LQ(q);if(G=BQ(Object.assign({},v,z,D)))g.metadata=G;F=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.hd&&(F.autoplay=b.autoplay);typeof b.currentTime===_.k&&(F.currentTime=b.currentTime);return _.x(C,f.loadMedia(F),0)}})},SQ=function(a,b,c){c=void 0===c?0:c;var d,e;return _.E(function(f){(d=a.f.ta())&&d.language&&(a.h.preferredTextLanguage=
17
- d.language);(e=a.f.sa())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.x(f,RQ(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),If:a.getPresentationStartTime(),autoplay:b,Xa:a.h}),0)})},sQ=function(a){if(a){a=_.u(uQ);for(var b=a.next();!b.done;b=a.next())tQ(b.value)}},UQ=function(a,b,c){_.sl.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.oe?c:function(e,f){d.f&&e!==_.Ko&&e!==_.Do&&d.f.load(f)};this.a=TQ(this);this.g=new _.K(ZP);this.addDelegate(this.f)},TQ=
18
- function(a){return new vQ(a.h,function(){a.trigger(new _.L(_.od))},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.dg&&(d.preferredAudioLanguage=c.dg);c.Rh&&(d.preferredTextLanguage=c.Rh);_.aq(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return VQ(a)})},VQ=function(a){var b;return _.E(function(c){if(1==c.a)return a.trigger(new _.L(_.nd)),
19
- b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.aq(a.f,a.a);_.y(c)})},WQ=function(a){eQ.call(this,a,"clpp.cast.StateManager");this.I=this.Bi.bind(this);this.H=this.Ai.bind(this);this.w=this.ml.bind(this);this.o=this.fl.bind(this);this.K=this.Di.bind(this);this.J=this.Ci.bind(this);this.M=this.Cl.bind(this);this.G=this.pl.bind(this);this.D=this.U.bind(this);this.a=this.zi.bind(this)},XQ=function(a,b,c,d,e){this.a=a;this.f=b;this.j=typeof c===_.k?c:1;this.l=typeof d===_.k?d:1;this.h=
20
- typeof e===_.k?e:0},YQ=function(a){this.a=a},$Q=function(a){this.m=a;this.a=null;this.h=this.Ei.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
- ZQ().addEventListener(this.f,this.h)},cR=function(a,b,c){var d,e,f,g,h,l,m;return _.E(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.A(n,2);aR=!1;e=_.qj(d);return _.x(n,c.fetch(e).O,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.Z(f.data),h=new DOMParser,l=h.parseFromString(g,_.cg),l.getElementsByTagName("vmap:VMAP").length)_.J("VMAP detected."),a.vmapAdsRequest=bR(g);else if(l.getElementsByTagName("VAST").length){_.J("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");
22
- p.vastAdsRequest=bR(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.J("Unsupported schema."),aR=!0;return _.$g(n,0)}m=_.B(n);_.J("Failed to fetch an ad",m);aR=!0;_.y(n)})},bR=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},ZQ=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},eR=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;
23
- (c=dR(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},fR=function(a,b){var c=new _.P(1,10,10003,{errorType:b});a.m.onError(c)},dR=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.Vf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Vf&&(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 XQ(d,e,b.index,b.total,f)}return c},gR=function(a){this.cc=a;this.a=this.f.bind(this)},hR=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]},iR=function(a){var b=a.dashTimedMetadata,c=_.kg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.jg)?
25
- _.Nh:_.Lh,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},jR=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.Xl.bind(this);this.a=this.f=null},kR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},mR=function(a){a.a=kR().getTextTracksManager();var b=a.a.getTracks();a.j=lR(_.S,b)},nR=function(a,b,c,d){c=_.Sh(c).filter(function(h){return h});
26
- var e=!1,f=[];b===_.T?f=a.getAudioTracks():b===_.S&&(f=a.ja());if(c=c.find(function(h){var l=_.Mi(h);return f.some(function(m){m=_.Mi(m.language||"");return _.Ni(l,m)})})){var g=_.Mi(c);c=f.filter(function(h){h=_.Mi(h.language||"");return _.Ni(g,h)});f=c.length?c:f;e=e||!!c.length}_.R.ue(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===_.T?a.za(e):b===_.S&&a.Ja(e))},lR=function(a,b){for(var c=[],d=_.u(b),
27
- e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Nj(e.trackId.toString(),a);f.roles=e.roles||[];f.kind=e.subtype||null;f.language=e.language||null;f.originalLanguage=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 _.Vj(f.id,f));c.push(f)}return c},oR=function(){_.sl.call(this);this.g=new _.K($P);this.h=this.w=_.yl();this.A=null;
28
- this.l=-1;this.G=new _.Hj;this.f=this.o=this.j=this.a=this.B=null;this.D=!1},pR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},sR=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=_.Wl(d);if(e){var f=[_.Pd];_.Vo(a)[0].type!==_.Yc&&f.unshift(_.Rd);d.preferredDrmSystem===_.Pd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
29
- h=e.Ya[g];h?(d=g===_.Rd?cast.framework.ContentProtection.WIDEVINE:g===_.Pd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},qR(b,h,a,d),rR(b,h,a,d)):c()}else c()}else c()},qR=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.qj({method:"POST",uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,
30
- d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},rR=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.E(function(h){return 1==h.a?(g=_.rj(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.Ti(g.data))})}:a.licenseHandler=void 0},tR=function(){this.a=!1;this.g=new _.K(aQ);this.f=this.m=null;this.h=new Set;this.A=this.ol.bind(this);
31
- this.w=this.yi.bind(this);this.j=null;this.o=new _.Dh;this.l=null},vR=function(){return uR||(uR=new tR)},wR=function(){return cast.framework.CastReceiverContext.getInstance()},yR=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=wR();c=(wR().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.tg:_.sg;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=
32
- xR(h,_.ta),m=xR(h,_.Pb),n=_.u([]),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")},xR=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},zR=function(a){this.f=a;this.a=null;this.h=new _.Dh;this.j=
33
- [cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},BR=function(a,b){var c=null,d=AR(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},AR=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})||
34
- null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position: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 XQ(d,c,e,f,g)}return b},CR=function(){},DR=function(){};_.r=eQ.prototype;_.r.release=function(){this.qa(_.Do)};_.r.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.r.getState=function(){return this.f};
35
- _.r.onError=function(a){a.severity===_.Q&&this.qa(_.Oo)};
36
- _.r.qa=function(a){if(a!==this.f)if(this.f===_.Oo&&a!==_.Do)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.l=this.f;this.f=a;this.f===_.Io?(this.A=b,this.player.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.Io&&this.player.trigger(new _.L(_.id,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.to(this.j,this.f);this.player.trigger(new _.L(_.Sf,
37
- {detail:a}))}};_.H("clpp.cast.CastUtils",function(){});var jQ=0,xQ={GENERIC:jQ,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.w(lQ,eQ);lQ.prototype.init=function(){var a=this.player,b=a.a;b&&(this.a&&this.a.removeUpdateListener(this.w),this.a=b,this.a.addUpdateListener(this.w),this.o=a.l)};lQ.prototype.destroy=function(){var a=this;return _.E(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,eQ.prototype.destroy.call(a),0)})};lQ.prototype.qa=function(a){var b=this.player.l;b&&b.isPlayingBreak||eQ.prototype.qa.call(this,a)};
38
- lQ.prototype.Hb=function(){if(this.a&&this.o&&!this.o.isPlayingBreak)switch(this.a.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.a.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.qa(_.Ko);break;case chrome.cast.media.IdleReason.ERROR:this.qa(_.Oo);break;default:this.qa(_.Do)}break;case chrome.cast.media.PlayerState.PLAYING:this.qa(_.Ro);break;case chrome.cast.media.PlayerState.PAUSED:this.qa(_.Qo);break;case chrome.cast.media.PlayerState.BUFFERING:this.qa(_.Io)}};_.w(mQ,_.U);_.r=mQ.prototype;_.r.initialize=function(a){this.a=a};_.r.release=function(){this.h=[];this.f={}};
39
- _.r.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.Pj;break;case chrome.cast.media.TrackType.AUDIO:c=_.T;break;case chrome.cast.media.TrackType.TEXT:c=_.S}c=new _.Nj(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);
40
- c.renditions.push(new _.Vj(c.id,c));return c}):[],this.a.trigger(new _.L(_.Wt)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return oQ(this,_.Pj)};_.r.getAudioTracks=function(){return oQ(this,_.T)};_.r.ja=function(){return oQ(this,_.S)};_.r.ha=function(){var a=this.Ra();return a?a.renditions[0]:null};_.r.Na=function(){var a=this.sa();return a?a.renditions[0]:null};_.r.Pa=function(){var a=this.ta();return a?a.renditions[0]:null};_.r.ab=function(){return this.f[_.Pj]||null};
41
- _.r.kb=function(){return this.f[_.T]||null};_.r.lb=function(){return this.f[_.S]||null};_.r.Ra=function(){return pQ(this,_.Pj)};_.r.sa=function(){return pQ(this,_.T)};_.r.ta=function(){return pQ(this,_.S)};_.r.gb=function(a){rQ(this,_.Pj,a)};_.r.za=function(a){rQ(this,_.T,a)};_.r.Ja=function(a){rQ(this,_.S,a)};_.r.fb=function(a){this.gb(a&&a.track)};_.r.rb=function(a){this.za(a&&a.track)};_.r.sb=function(a){this.Ja(a&&a.track)};_.r.addTextTrack=function(){return _.E(function(a){_.y(a)})};_.r.la=function(){return!0};
42
- mQ.prototype.isAbrEnabled=mQ.prototype.la;mQ.prototype.addTextTrack=mQ.prototype.addTextTrack;mQ.prototype.setTextRendition=mQ.prototype.sb;mQ.prototype.setAudioRendition=mQ.prototype.rb;mQ.prototype.setVideoRendition=mQ.prototype.fb;mQ.prototype.setTextTrack=mQ.prototype.Ja;mQ.prototype.setAudioTrack=mQ.prototype.za;mQ.prototype.setVideoTrack=mQ.prototype.gb;mQ.prototype.getTextTrack=mQ.prototype.ta;mQ.prototype.getAudioTrack=mQ.prototype.sa;mQ.prototype.getVideoTrack=mQ.prototype.Ra;
43
- mQ.prototype.getLoadingTextRendition=mQ.prototype.lb;mQ.prototype.getLoadingAudioRendition=mQ.prototype.kb;mQ.prototype.getLoadingVideoRendition=mQ.prototype.ab;mQ.prototype.getTextRendition=mQ.prototype.Pa;mQ.prototype.getAudioRendition=mQ.prototype.Na;mQ.prototype.getVideoRendition=mQ.prototype.ha;mQ.prototype.getTextTracks=mQ.prototype.ja;mQ.prototype.getAudioTracks=mQ.prototype.getAudioTracks;mQ.prototype.getVideoTracks=mQ.prototype.getVideoTracks;_.w(vQ,_.sl);_.r=vQ.prototype;_.r.init=function(a,b){this.h=this.J=b};_.r.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)})};_.r.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.r.destroy=function(){return _.E(function(a){_.y(a)})};_.r.Od=function(a){this.P=a};_.r.oc=function(){return this.w};_.r.ob=function(){return this.A};_.r.jf=function(){return this.pa};
44
- _.r.sendMessage=function(a,b){var c=this,d,e,f;return _.E(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.P(1,8,8004,void 0);g.F(2);break}_.A(g,3);return _.x(g,e.sendMessage(a,fQ(b)),5);case 5:_.$g(g,2);break;case 3:f=_.B(g),d=new _.P(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.y(g)}})};
45
- _.r.cast=function(){var a=this,b,c;return _.E(function(d){if(1==d.a){if(!a.oc())throw a.g.warn(XP),new _.P(1,8,8001,void 0);if(!MQ)throw a.g.warn(VP),new _.P(1,8,8002,void 0);if(a.ob())throw a.g.warn("Already casting"),new _.P(1,8,8003,void 0);_.A(d,2);return _.x(d,QQ(a),4)}if(2!=d.a)return _.$g(d,0);b=_.B(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.P(1,8,8E3,c);})};_.r.df=function(){this.ob()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
46
- _.r.addMessageListener=function(a){typeof a===_.oe&&this.G.add(a)};_.r.removeMessageListener=function(a){typeof a===_.oe&&this.G["delete"](a)};_.r.play=function(){var a=this;return this.isEnded()?SQ(this,!0):new Promise(function(b,c){if(!a.a)return c(UP);a.a.play(null,b,c)})};_.r.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(UP);a.a.pause(null,b,c)})};_.r.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
47
- _.r.isEnded=function(){return this.getState()===_.Ko};_.r.seek=function(a){var b=this;return this.isEnded()?SQ(this,!1,a):new Promise(function(c,d){b.a||d(UP);b.l.isPlayingBreak&&d(SP);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.mg));b.a.seek(e,function(){b.trigger(new _.L(_.lg));c()},d)})};_.r.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
48
- _.r.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};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.r.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(cQ,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
2
+ var f=function(window){var cQ="Cannot seek during ads playout.",dQ="Cannot switch track",eQ="Media session does not exist.",fQ="No receivers available",gQ="Reset ABR functionality not available on cast.",hQ="SDK not yet ready",iQ="Sender is destroyed.",jQ="clpp.cast.CastProxy",kQ="clpp.cast.Player",lQ="clpp.cast.Receiver",mQ="urn:x-cast:castlabs",nQ="urn:x-cast:com.google.cast.media",oQ=function(a){return _.E(function(b){return 1==b.a?_.x(b,a.vc(_.Xe),2):_.x(b,a.vc(_.We),0)})},pQ=function(a,b){this.log=new _.K(b);this.player=
3
+ a;this.j=null;this.f=_.Go;this.l=_.Ho;this.h=2;this.B=Date.now();this.A=-1},qQ=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.pe){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Te?"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}})},rQ=function(a){if(typeof a!==_.Wf)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}},sQ=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.E(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=_.pk(d,a.mimeType,g);if(!f||!g)return q.F(2);l=_.rj(a.url);return _.x(q,c.fetch(l).O,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Ui(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)})},tQ=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 _.ug:return d.FMP4;case _.tg:return b===_.Qj?d.MPEG2_TS:c.TS;case _.ad:return c.AAC;case _.bd:return c.AC3;case _.cd:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.dd:return c.FMP4}},vQ=function(a){a=
6
+ void 0===a?uQ:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.P(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}},wQ=function(a){pQ.call(this,a,"clpp.cast.SenderStateManager");
7
+ this.o=this.a=null;this.w=this.Hb.bind(this)},xQ=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},yQ=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},AQ=function(a,b){var c=yQ(a);return zQ(a,b).find(function(d){return c.includes(d.id)})||null},zQ=function(a,b){return a.h.filter(function(c){return c.type===b})},CQ=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.S){var e=a.ta();
8
+ e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;BQ(a,b)},function(f){a.f[b]=null;a.g.debug(dQ,f)})}else b===_.S&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){BQ(a,b)},function(f){a.g.debug(dQ,f)}))},BQ=function(a,b){b===_.T?a.a.trigger(new _.L(_.ml)):b===_.S&&a.a.trigger(new _.L(_.nl))},GQ=function(a,b,c,d){_.tl.call(this);this.g=new _.K(_.Cd);this.ea=a;this.o=new _.uk(b);this.da=c;this.oa=d;this.h=this.J=
9
+ _.zl();this.D=[];this.B=0;this.M=new _.Ij;this.H=this.l=this.a=null;this.A=this.w=!1;this.pa="";this.Ka=1E6;this.f=new xQ;this.f.initialize(this);this.j=new wQ(this);this.I=new _.Eh;this.K=null;this.G=new Set;this.T=this.el.bind(this);this.Da=this.xl.bind(this);this.ga=this.ol.bind(this);this.V=this.il.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(){DQ(!0)},0)}});EQ(this);FQ.add(this)},
10
+ HQ=function(a){var b,c;return _.E(function(d){if(1==d.a)return FQ["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.Da)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.x(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.da=null;a.oa=null;_.y(d)})},MQ=function(a){if(!a)return null;
11
+ a:{var b=a.metadataType;var c=Object.entries(IQ);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=vQ(IQ[b]);return Object.assign(b,a)},RQ=function(a){var b=void 0===b?uQ:b;return Object.values(IQ).includes(a)?a:b},WQ=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},EQ=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
12
+ a.ea.length){a.w=!0;a.o.Qf();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.ea;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.Da);XQ&&a.o.aa(.02)}},YQ=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},$Q=function(a,b){ZQ(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ga);b.addMessageListener(mQ,a.V)},ZQ=function(a,b){a.a=b;a.a&&(a.I.release(),a.H=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.H=new cast.framework.RemotePlayerController(a.l),a.I.on(a.H,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.vi.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.L(_.Fe)))},aR=function(a){return _.E(function(b){return a.ob()?
14
+ b.F(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},bR=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,D,G,F;return _.E(function(B){switch(B.a){case 1:return c=chrome.cast.media.StreamType,d=_.Zt,_.x(B,aR(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.Lb;m=h.audioMimeType;g.hlsVideoSegmentFormat=tQ(l,d.VIDEO);
15
+ g.hlsSegmentFormat=tQ(m,d.AUDIO);if(!b.Xa){B.F(3);break}if(!a.P){B.F(4);break}return _.x(B,Promise.resolve(a.P(b.Xa)),5);case 5:if(n=B.f)b.Xa=n;case 4:a.h=b.Xa;a.D=_.Yo(a.h);a.B=a.D.findIndex(function(I){return I.url===b.source.url});if(!b.Xa.remoteTextTracks){B.F(6);break}return _.x(B,Promise.all(b.Xa.remoteTextTracks.map(a.Cj.bind(a))),7);case 7:p=B.f,g.tracks=p.filter(function(I){return I}),b.Xa.remoteTextTracks=void 0;case 6:delete b.Xa.autoplay,b.Xa.startTime=null,g.customData={playerConfiguration:qQ(b.Xa)};
16
+ case 3:q=a.jb()||{};t=RQ(q.metadataType);typeof b.Gf===_.k&&(v={metadataType:t,sectionStartAbsoluteTime:b.Gf});b.source.name&&(z={metadataType:t,title:b.source.name});D=WQ(q);if(G=MQ(Object.assign({},v,z,D)))g.metadata=G;F=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.hd&&(F.autoplay=b.autoplay);typeof b.currentTime===_.k&&(F.currentTime=b.currentTime);return _.x(B,f.loadMedia(F),0)}})},cR=function(a,b,c){c=void 0===c?0:c;var d,e;return _.E(function(f){(d=a.f.ta())&&d.language&&(a.h.preferredTextLanguage=
17
+ d.language);(e=a.f.sa())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.x(f,bR(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Gf:a.getPresentationStartTime(),autoplay:b,Xa:a.h}),0)})},DQ=function(a){if(a){a=_.u(FQ);for(var b=a.next();!b.done;b=a.next())EQ(b.value)}},eR=function(a,b,c){_.tl.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.pe?c:function(e,f){d.f&&e!==_.No&&e!==_.Go&&d.f.load(f)};this.a=dR(this);this.g=new _.K(jQ);this.addDelegate(this.f)},dR=
18
+ function(a){return new GQ(a.h,function(){a.trigger(new _.L(_.od))},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.bg&&(d.preferredAudioLanguage=c.bg);c.Ph&&(d.preferredTextLanguage=c.Ph);_.dq(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return fR(a)})},fR=function(a){var b;return _.E(function(c){if(1==c.a)return a.trigger(new _.L(_.nd)),
19
+ b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.dq(a.f,a.a);_.y(c)})},gR=function(a){pQ.call(this,a,"clpp.cast.StateManager");this.I=this.zi.bind(this);this.H=this.yi.bind(this);this.w=this.kl.bind(this);this.o=this.dl.bind(this);this.K=this.Bi.bind(this);this.J=this.Ai.bind(this);this.M=this.Al.bind(this);this.G=this.nl.bind(this);this.D=this.U.bind(this);this.a=this.xi.bind(this)},hR=function(a,b,c,d,e){this.a=a;this.f=b;this.j=typeof c===_.k?c:1;this.l=typeof d===_.k?d:1;this.h=
20
+ typeof e===_.k?e:0},iR=function(a){this.a=a},kR=function(a){this.m=a;this.a=null;this.h=this.Ci.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
+ jR().addEventListener(this.f,this.h)},nR=function(a,b,c){var d,e,f,g,h,l,m;return _.E(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.A(n,2);lR=!1;e=_.rj(d);return _.x(n,c.fetch(e).O,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.Z(f.data),h=new DOMParser,l=h.parseFromString(g,_.dg),l.getElementsByTagName("vmap:VMAP").length)_.J("VMAP detected."),a.vmapAdsRequest=mR(g);else if(l.getElementsByTagName("VAST").length){_.J("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");
22
+ p.vastAdsRequest=mR(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.J("Unsupported schema."),lR=!0;return _.ah(n,0)}m=_.C(n);_.J("Failed to fetch an ad",m);lR=!0;_.y(n)})},mR=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},jR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},pR=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;
23
+ (c=oR(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},qR=function(a,b){var c=new _.P(1,10,10003,{errorType:b});a.m.onError(c)},oR=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.Wf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Wf&&(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 hR(d,e,b.index,b.total,f)}return c},rR=function(a){this.cc=a;this.a=this.f.bind(this)},sR=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]},tR=function(a){var b=a.dashTimedMetadata,c=_.lg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.kg)?
25
+ _.Oh:_.Mh,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},uR=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.Vl.bind(this);this.a=this.f=null},vR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},xR=function(a){a.a=vR().getTextTracksManager();var b=a.a.getTracks();a.j=wR(_.S,b)},yR=function(a,b,c,d){c=_.Th(c).filter(function(h){return h});
26
+ var e=!1,f=[];b===_.T?f=a.getAudioTracks():b===_.S&&(f=a.ja());if(c=c.find(function(h){var l=_.Ni(h);return f.some(function(m){m=_.Ni(m.language||"");return _.Oi(l,m)})})){var g=_.Ni(c);c=f.filter(function(h){h=_.Ni(h.language||"");return _.Oi(g,h)});f=c.length?c:f;e=e||!!c.length}_.R.te(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===_.T?a.za(e):b===_.S&&a.Ja(e))},wR=function(a,b){for(var c=[],d=_.u(b),
27
+ e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Oj(e.trackId.toString(),a);f.roles=e.roles||[];f.kind=e.subtype||null;f.language=e.language||null;f.originalLanguage=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 _.Wj(f.id,f));c.push(f)}return c},zR=function(){_.tl.call(this);this.g=new _.K(kQ);this.h=this.w=_.zl();this.A=null;
28
+ this.l=-1;this.G=new _.Ij;this.f=this.o=this.j=this.a=this.B=null;this.D=!1},AR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},DR=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=_.Xl(d);if(e){var f=[_.Pd];_.Yo(a)[0].type!==_.Yc&&f.unshift(_.Rd);d.preferredDrmSystem===_.Pd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
29
+ h=e.Ya[g];h?(d=g===_.Rd?cast.framework.ContentProtection.WIDEVINE:g===_.Pd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},BR(b,h,a,d),CR(b,h,a,d)):c()}else c()}else c()},BR=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.rj({method:"POST",uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,
30
+ d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},CR=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.E(function(h){return 1==h.a?(g=_.sj(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.Ui(g.data))})}:a.licenseHandler=void 0},ER=function(){this.a=!1;this.g=new _.K(lQ);this.f=this.m=null;this.h=new Set;this.A=this.ml.bind(this);
31
+ this.w=this.wi.bind(this);this.j=null;this.o=new _.Eh;this.l=null},GR=function(){return FR||(FR=new ER)},HR=function(){return cast.framework.CastReceiverContext.getInstance()},JR=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=HR();c=(HR().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.ug:_.tg;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=
32
+ IR(h,_.ta),m=IR(h,_.Pb),n=_.u([]),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")},IR=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},KR=function(a){this.f=a;this.a=null;this.h=new _.Eh;this.j=
33
+ [cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},MR=function(a,b){var c=null,d=LR(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},LR=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})||
34
+ null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position: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 hR(d,c,e,f,g)}return b},NR=function(){},OR=function(){};_.r=pQ.prototype;_.r.release=function(){this.qa(_.Go)};_.r.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.r.getState=function(){return this.f};
35
+ _.r.onError=function(a){a.severity===_.Q&&this.qa(_.Ro)};
36
+ _.r.qa=function(a){if(a!==this.f)if(this.f===_.Ro&&a!==_.Go)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.l=this.f;this.f=a;this.f===_.Lo?(this.A=b,this.player.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.Lo&&this.player.trigger(new _.L(_.id,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.wo(this.j,this.f);this.player.trigger(new _.L(_.Tf,
37
+ {detail:a}))}};_.H("clpp.cast.CastUtils",function(){});var uQ=0,IQ={GENERIC:uQ,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.w(wQ,pQ);wQ.prototype.init=function(){var a=this.player,b=a.a;b&&(this.a&&this.a.removeUpdateListener(this.w),this.a=b,this.a.addUpdateListener(this.w),this.o=a.l)};wQ.prototype.destroy=function(){var a=this;return _.E(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,pQ.prototype.destroy.call(a),0)})};wQ.prototype.qa=function(a){var b=this.player.l;b&&b.isPlayingBreak||pQ.prototype.qa.call(this,a)};
38
+ wQ.prototype.Hb=function(){if(this.a&&this.o&&!this.o.isPlayingBreak)switch(this.a.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.a.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.qa(_.No);break;case chrome.cast.media.IdleReason.ERROR:this.qa(_.Ro);break;default:this.qa(_.Go)}break;case chrome.cast.media.PlayerState.PLAYING:this.qa(_.Uo);break;case chrome.cast.media.PlayerState.PAUSED:this.qa(_.To);break;case chrome.cast.media.PlayerState.BUFFERING:this.qa(_.Lo)}};_.w(xQ,_.U);_.r=xQ.prototype;_.r.initialize=function(a){this.a=a};_.r.release=function(){this.h=[];this.f={}};
39
+ _.r.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.Qj;break;case chrome.cast.media.TrackType.AUDIO:c=_.T;break;case chrome.cast.media.TrackType.TEXT:c=_.S}c=new _.Oj(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);
40
+ c.renditions.push(new _.Wj(c.id,c));return c}):[],this.a.trigger(new _.L(_.bu)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return zQ(this,_.Qj)};_.r.getAudioTracks=function(){return zQ(this,_.T)};_.r.ja=function(){return zQ(this,_.S)};_.r.ia=function(){var a=this.Sa();return a?a.renditions[0]:null};_.r.Oa=function(){var a=this.sa();return a?a.renditions[0]:null};_.r.Qa=function(){var a=this.ta();return a?a.renditions[0]:null};_.r.ab=function(){return this.f[_.Qj]||null};
41
+ _.r.kb=function(){return this.f[_.T]||null};_.r.lb=function(){return this.f[_.S]||null};_.r.Sa=function(){return AQ(this,_.Qj)};_.r.sa=function(){return AQ(this,_.T)};_.r.ta=function(){return AQ(this,_.S)};_.r.gb=function(a){CQ(this,_.Qj,a)};_.r.za=function(a){CQ(this,_.T,a)};_.r.Ja=function(a){CQ(this,_.S,a)};_.r.fb=function(a){this.gb(a&&a.track)};_.r.rb=function(a){this.za(a&&a.track)};_.r.sb=function(a){this.Ja(a&&a.track)};_.r.addTextTrack=function(){return _.E(function(a){_.y(a)})};_.r.la=function(){return!0};
42
+ xQ.prototype.isAbrEnabled=xQ.prototype.la;xQ.prototype.addTextTrack=xQ.prototype.addTextTrack;xQ.prototype.setTextRendition=xQ.prototype.sb;xQ.prototype.setAudioRendition=xQ.prototype.rb;xQ.prototype.setVideoRendition=xQ.prototype.fb;xQ.prototype.setTextTrack=xQ.prototype.Ja;xQ.prototype.setAudioTrack=xQ.prototype.za;xQ.prototype.setVideoTrack=xQ.prototype.gb;xQ.prototype.getTextTrack=xQ.prototype.ta;xQ.prototype.getAudioTrack=xQ.prototype.sa;xQ.prototype.getVideoTrack=xQ.prototype.Sa;
43
+ xQ.prototype.getLoadingTextRendition=xQ.prototype.lb;xQ.prototype.getLoadingAudioRendition=xQ.prototype.kb;xQ.prototype.getLoadingVideoRendition=xQ.prototype.ab;xQ.prototype.getTextRendition=xQ.prototype.Qa;xQ.prototype.getAudioRendition=xQ.prototype.Oa;xQ.prototype.getVideoRendition=xQ.prototype.ia;xQ.prototype.getTextTracks=xQ.prototype.ja;xQ.prototype.getAudioTracks=xQ.prototype.getAudioTracks;xQ.prototype.getVideoTracks=xQ.prototype.getVideoTracks;_.w(GQ,_.tl);_.r=GQ.prototype;_.r.init=function(a,b){this.h=this.J=b};_.r.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)})};_.r.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.r.destroy=function(){return _.E(function(a){_.y(a)})};_.r.Od=function(a){this.P=a};_.r.pc=function(){return this.w};_.r.ob=function(){return this.A};_.r.gf=function(){return this.pa};
44
+ _.r.sendMessage=function(a,b){var c=this,d,e,f;return _.E(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.P(1,8,8004,void 0);g.F(2);break}_.A(g,3);return _.x(g,e.sendMessage(a,qQ(b)),5);case 5:_.ah(g,2);break;case 3:f=_.C(g),d=new _.P(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.y(g)}})};
45
+ _.r.cast=function(){var a=this,b,c;return _.E(function(d){if(1==d.a){if(!a.pc())throw a.g.warn(hQ),new _.P(1,8,8001,void 0);if(!XQ)throw a.g.warn(fQ),new _.P(1,8,8002,void 0);if(a.ob())throw a.g.warn("Already casting"),new _.P(1,8,8003,void 0);_.A(d,2);return _.x(d,aR(a),4)}if(2!=d.a)return _.ah(d,0);b=_.C(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.P(1,8,8E3,c);})};_.r.cf=function(){this.ob()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
46
+ _.r.addMessageListener=function(a){typeof a===_.pe&&this.G.add(a)};_.r.removeMessageListener=function(a){typeof a===_.pe&&this.G["delete"](a)};_.r.play=function(){var a=this;return this.isEnded()?cR(this,!0):new Promise(function(b,c){if(!a.a)return c(eQ);a.a.play(null,b,c)})};_.r.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(eQ);a.a.pause(null,b,c)})};_.r.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
47
+ _.r.isEnded=function(){return this.getState()===_.No};_.r.seek=function(a){var b=this;return this.isEnded()?cR(this,!1,a):new Promise(function(c,d){b.a||d(eQ);b.l.isPlayingBreak&&d(cQ);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.ng));b.a.seek(e,function(){b.trigger(new _.L(_.mg));c()},d)})};_.r.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
48
+ _.r.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};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.r.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(nQ,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
49
49
  _.r.getVolume=function(){return this.a&&this.a.volume.level};_.r.setVolume=function(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))};_.r.isMuted=function(){return this.a&&this.a.volume.muted};_.r.setMuted=function(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};
50
- _.r.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};_.r.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};_.r.getState=function(){return this.j?this.j.getState():_.Eo};
51
- _.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?gQ(this.a.customData.stats):_.zo()};_.r.isLive=function(){return Infinity===this.getDuration()};_.r.load=function(a){var b=this,c,d;return _.E(function(e){if(!b.oc())return b.g.warn(XP),e["return"]();if(!MQ)return b.g.warn(VP),e["return"]();b.D=_.Vo(a);_.Bl(a)&&(b.h=_.Al(b.J,a));c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,Xa:b.h,Lb:c.Lb,audioMimeType:c.audioMimeType};return _.x(e,RQ(b,d),0)})};
52
- _.r.getBufferInfo=function(){return new _.rl};_.r.getTrackManager=function(){return this.f};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.M=a};_.r.getNetworkEngine=function(){return this.M};_.r.getSourceIndex=function(){return this.B};_.r.setSourceIndex=function(a){this.B=a};_.r.getLoadedSource=function(){return this.D[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};
53
- _.r.getTimelineCues=function(){return[]};_.r.resetAbr=function(){this.g.warn(WP)};_.r.onError=function(a){if(a&&(this.trigger(new _.L(_.me,{detail:a})),this.j))this.j.onError(a)};_.r.namespace=function(){return _.Cd};_.r.canPlay=function(){return this.oc()?2:0};_.r.jb=function(){return this.K};_.r.wc=function(a){this.K=BQ(a)};_.r.We=function(){this.K=null};_.r.Nf=function(a){var b=this.jb()||{};a={metadataType:GQ(b.metadataType),title:a};this.wc(Object.assign({},b,a))};
54
- _.r.Lf=function(a){var b=this.jb()||{},c=GQ(b.metadataType);a=new chrome.cast.Image(a);this.wc(Object.assign({},b,{metadataType:c,images:[a]}))};_.r.Kf=function(a){var b=this.jb()||{};this.wc(Object.assign({},b,{metadataType:3,artist:a}))};_.r.Mf=function(a){var b=this.jb()||{};a={metadataType:GQ(b.metadataType),releaseDate:a};this.wc(Object.assign({},b,a))};
55
- _.r.gl=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;MQ=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.pa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Sf()};
56
- _.r.zl=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;PQ(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ob()||(this.A=!0,PQ(this,a.session),this.oa());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ob()&&this.a){var b=this.a.media,c=this.f.sa(),d=this.f.ta();c=c&&c.language||void 0;d=d&&d.language||void 0;this.da(this.getState(),{source:{url:b.contentId,type:b.contentType,
57
- isLive:this.isLive()},currentTime:NQ(this),Rh:d,dg:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ia);a.session.removeMessageListener(bQ,this.V);this.A=!1;this.a=null;this.I.release();this.l=this.H=null}};_.r.ql=function(a){this.g.debug("New media session",a.mediaSession);OQ(this,a.mediaSession)};_.r.kl=function(a,b){if(a===bQ&&0<this.G.size){var c=gQ(b);this.G.forEach(function(d){return d(c)})}};_.r.xi=function(){this.trigger(new _.L(_.dg))};
58
- _.r.Ej=function(a){var b=this,c,d;return _.E(function(e){if(1==e.a)return c=null,_.x(e,hQ(a,[_.bg,_.Xc],b.M,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Va++,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)})};_.r.getTextDisplayer=function(){return null};vQ.prototype.getTextDisplayer=vQ.prototype.getTextDisplayer;vQ.prototype.getNetworkEngine=vQ.prototype.getNetworkEngine;
59
- vQ.prototype.setNetworkEngine=vQ.prototype.setNetworkEngine;var MQ=!1,uQ=new Set;window.__onGCastApiAvailable=sQ;_.w(UQ,_.sl);_.r=UQ.prototype;_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return a.a?_.x(b,wQ(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.y(b)})};_.r.Te=function(){return!!this.a&&this.a.oc()&&MQ};_.r.ob=function(){return!!this.a&&this.a.ob()};_.r.jf=function(){return this.a?this.a.jf():""};_.r.Od=function(a){this.a&&this.a.Od(a)};
50
+ _.r.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};_.r.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};_.r.getState=function(){return this.j?this.j.getState():_.Ho};
51
+ _.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?rQ(this.a.customData.stats):_.Co()};_.r.isLive=function(){return Infinity===this.getDuration()};_.r.load=function(a){var b=this,c,d;return _.E(function(e){if(!b.pc())return b.g.warn(hQ),e["return"]();if(!XQ)return b.g.warn(fQ),e["return"]();b.D=_.Yo(a);_.Cl(a)&&(b.h=_.Bl(b.J,a));c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,Xa:b.h,Lb:c.Lb,audioMimeType:c.audioMimeType};return _.x(e,bR(b,d),0)})};
52
+ _.r.getBufferInfo=function(){return new _.sl};_.r.getTrackManager=function(){return this.f};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.M=a};_.r.getNetworkEngine=function(){return this.M};_.r.getSourceIndex=function(){return this.B};_.r.setSourceIndex=function(a){this.B=a};_.r.getLoadedSource=function(){return this.D[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};
53
+ _.r.getTimelineCues=function(){return[]};_.r.resetAbr=function(){this.g.warn(gQ)};_.r.onError=function(a){if(a&&(this.trigger(new _.L(_.ne,{detail:a})),this.j))this.j.onError(a)};_.r.namespace=function(){return _.Cd};_.r.canPlay=function(){return this.pc()?2:0};_.r.jb=function(){return this.K};_.r.xc=function(a){this.K=MQ(a)};_.r.Ve=function(){this.K=null};_.r.Lf=function(a){var b=this.jb()||{};a={metadataType:RQ(b.metadataType),title:a};this.xc(Object.assign({},b,a))};
54
+ _.r.Jf=function(a){var b=this.jb()||{},c=RQ(b.metadataType);a=new chrome.cast.Image(a);this.xc(Object.assign({},b,{metadataType:c,images:[a]}))};_.r.If=function(a){var b=this.jb()||{};this.xc(Object.assign({},b,{metadataType:3,artist:a}))};_.r.Kf=function(a){var b=this.jb()||{};a={metadataType:RQ(b.metadataType),releaseDate:a};this.xc(Object.assign({},b,a))};
55
+ _.r.el=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;XQ=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.pa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Qf()};
56
+ _.r.xl=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;$Q(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ob()||(this.A=!0,$Q(this,a.session),this.oa());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ob()&&this.a){var b=this.a.media,c=this.f.sa(),d=this.f.ta();c=c&&c.language||void 0;d=d&&d.language||void 0;this.da(this.getState(),{source:{url:b.contentId,type:b.contentType,
57
+ isLive:this.isLive()},currentTime:YQ(this),Ph:d,bg:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ga);a.session.removeMessageListener(mQ,this.V);this.A=!1;this.a=null;this.I.release();this.l=this.H=null}};_.r.ol=function(a){this.g.debug("New media session",a.mediaSession);ZQ(this,a.mediaSession)};_.r.il=function(a,b){if(a===mQ&&0<this.G.size){var c=rQ(b);this.G.forEach(function(d){return d(c)})}};_.r.vi=function(){this.trigger(new _.L(_.eg))};
58
+ _.r.Cj=function(a){var b=this,c,d;return _.E(function(e){if(1==e.a)return c=null,_.x(e,sQ(a,[_.cg,_.Xc],b.M,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ka++,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)})};_.r.getTextDisplayer=function(){return null};GQ.prototype.getTextDisplayer=GQ.prototype.getTextDisplayer;GQ.prototype.getNetworkEngine=GQ.prototype.getNetworkEngine;
59
+ GQ.prototype.setNetworkEngine=GQ.prototype.setNetworkEngine;var XQ=!1,FQ=new Set;window.__onGCastApiAvailable=DQ;_.w(eR,_.tl);_.r=eR.prototype;_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return a.a?_.x(b,HQ(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.y(b)})};_.r.Se=function(){return!!this.a&&this.a.pc()&&XQ};_.r.ob=function(){return!!this.a&&this.a.ob()};_.r.gf=function(){return this.a?this.a.gf():""};_.r.Od=function(a){this.a&&this.a.Od(a)};
60
60
  _.r.cast=function(a){var b=this,c,d,e;return _.E(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.A(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.sa();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.ta())l.language&&
61
- (g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.hd?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),If:b.f.getPresentationStartTime(),Lb:m,audioMimeType:p,Xa:g}}c=g;return _.x(f,VQ(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.F(7);break}return _.x(f,RQ(b.a,c),7);case 7:_.$g(f,0);break;case 2:d=_.B(f),
62
- b.g.error("Error while trying to cast",d),e=new _.L(_.me,{detail:d}),b.trigger(e),_.y(f)}})};_.r.df=function(){this.a&&this.a.df()};_.r.ri=function(a){var b=this;return _.E(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,wQ(b.a),2):c.F(2)}b.a=TQ(b);_.y(c)})};_.r.sendMessage=function(a){var b=this;return _.E(function(c){return b.a?_.x(c,b.a.sendMessage(bQ,a),0):(b.g.warn(YP),c["return"]())})};_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(YP)};
63
- _.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(YP)};_.r.jb=function(){return this.a&&this.a.jb()};_.r.wc=function(a){this.a&&this.a.wc(a)};_.r.We=function(){this.a&&this.a.We()};_.r.Nf=function(a){this.a&&this.a.Nf(a)};_.r.Lf=function(a){this.a&&this.a.Lf(a)};_.r.Kf=function(a){this.a&&this.a.Kf(a)};_.r.Mf=function(a){this.a&&this.a.Mf(a)};_.H(ZP,UQ);UQ.prototype.setContentReleaseDate=UQ.prototype.Mf;UQ.prototype.setContentArtist=UQ.prototype.Kf;
64
- UQ.prototype.setContentImage=UQ.prototype.Lf;UQ.prototype.setContentTitle=UQ.prototype.Nf;UQ.prototype.clearContentMetadata=UQ.prototype.We;UQ.prototype.setContentMetadata=UQ.prototype.wc;UQ.prototype.getContentMetadata=UQ.prototype.jb;UQ.prototype.removeMessageListener=UQ.prototype.removeMessageListener;UQ.prototype.addMessageListener=UQ.prototype.addMessageListener;UQ.prototype.sendMessage=UQ.prototype.sendMessage;UQ.prototype.changeReceiverId=UQ.prototype.ri;UQ.prototype.forceDisconnect=UQ.prototype.df;
65
- UQ.prototype.cast=UQ.prototype.cast;UQ.prototype.setPlayerConfigInterceptor=UQ.prototype.Od;UQ.prototype.getReceiverName=UQ.prototype.jf;UQ.prototype.isCasting=UQ.prototype.ob;UQ.prototype.canCast=UQ.prototype.Te;UQ.prototype.destroy=UQ.prototype.destroy;_.w(WQ,eQ);_.r=WQ.prototype;
61
+ (g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.hd?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Gf:b.f.getPresentationStartTime(),Lb:m,audioMimeType:p,Xa:g}}c=g;return _.x(f,fR(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.F(7);break}return _.x(f,bR(b.a,c),7);case 7:_.ah(f,0);break;case 2:d=_.C(f),
62
+ b.g.error("Error while trying to cast",d),e=new _.L(_.ne,{detail:d}),b.trigger(e),_.y(f)}})};_.r.cf=function(){this.a&&this.a.cf()};_.r.oi=function(a){var b=this;return _.E(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,HQ(b.a),2):c.F(2)}b.a=dR(b);_.y(c)})};_.r.sendMessage=function(a){var b=this;return _.E(function(c){return b.a?_.x(c,b.a.sendMessage(mQ,a),0):(b.g.warn(iQ),c["return"]())})};_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(iQ)};
63
+ _.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(iQ)};_.r.jb=function(){return this.a&&this.a.jb()};_.r.xc=function(a){this.a&&this.a.xc(a)};_.r.Ve=function(){this.a&&this.a.Ve()};_.r.Lf=function(a){this.a&&this.a.Lf(a)};_.r.Jf=function(a){this.a&&this.a.Jf(a)};_.r.If=function(a){this.a&&this.a.If(a)};_.r.Kf=function(a){this.a&&this.a.Kf(a)};_.H(jQ,eR);eR.prototype.setContentReleaseDate=eR.prototype.Kf;eR.prototype.setContentArtist=eR.prototype.If;
64
+ eR.prototype.setContentImage=eR.prototype.Jf;eR.prototype.setContentTitle=eR.prototype.Lf;eR.prototype.clearContentMetadata=eR.prototype.Ve;eR.prototype.setContentMetadata=eR.prototype.xc;eR.prototype.getContentMetadata=eR.prototype.jb;eR.prototype.removeMessageListener=eR.prototype.removeMessageListener;eR.prototype.addMessageListener=eR.prototype.addMessageListener;eR.prototype.sendMessage=eR.prototype.sendMessage;eR.prototype.changeReceiverId=eR.prototype.oi;eR.prototype.forceDisconnect=eR.prototype.cf;
65
+ eR.prototype.cast=eR.prototype.cast;eR.prototype.setPlayerConfigInterceptor=eR.prototype.Od;eR.prototype.getReceiverName=eR.prototype.gf;eR.prototype.isCasting=eR.prototype.ob;eR.prototype.canCast=eR.prototype.Se;eR.prototype.destroy=eR.prototype.destroy;_.w(gR,pQ);_.r=gR.prototype;
66
66
  _.r.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.G);b.addEventListener(a.ERROR,this.D);b.addEventListener(a.BITRATE_CHANGED,this.a)};
67
67
  _.r.destroy=function(){var a=this,b,c;return _.E(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.G);c.removeEventListener(b.ERROR,
68
- a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,eQ.prototype.destroy.call(a),0)})};_.r.Bi=function(){this.player.trigger(new _.L(_.ff));this.qa(_.Ro)};_.r.Ai=function(){this.qa(_.Qo)};_.r.ml=function(){this.qa(_.Ko)};_.r.fl=function(a){a.isBuffering?this.qa(_.Io):(a=this.player.isPaused()?_.Qo:_.Ro,this.qa(a))};_.r.Di=function(){this.h=1;this.player.trigger(new _.L(_.mg))};_.r.Ci=function(){this.player.trigger(new _.L(_.lg))};_.r.Cl=function(){this.h=2};_.r.pl=function(){this.qa(_.Po)};
69
- _.r.zi=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.gd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.U=function(a){a=new _.P(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.me,{detail:a}));this.qa(_.Oo)};_.r=XQ.prototype;_.r.xb=function(){return"Google Cast Framework"};_.r.yb=function(){return cast.framework.VERSION};_.r.Eb=function(){return 0};_.r.getId=function(){return""};_.r.getCreativeId=function(){return""};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return this.a.title||""};_.r.getDuration=function(){return this.a.duration||0};
70
- _.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.qc=function(){return!1};_.r.Rb=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.Bb=function(){return 0};_.r.Ab=function(){return 0};_.r.mb=function(){return 0};_.r.bb=function(){switch(this.Sb()){case 0:return 0;case -1:return 2;default:return 1}};_.r.getPodIndex=function(){return this.h};_.r.Sb=function(){return this.f.position};_.r.Tb=function(){return this.j};
71
- _.r.Db=function(){return this.l};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};XQ.prototype.getWrapperCreativeIds=XQ.prototype.getWrapperCreativeIds;XQ.prototype.getWrapperAdSystems=XQ.prototype.getWrapperAdSystems;XQ.prototype.getWrapperAdIds=XQ.prototype.getWrapperAdIds;XQ.prototype.getSequenceLength=XQ.prototype.Db;XQ.prototype.getPositionInSequence=XQ.prototype.Tb;XQ.prototype.getPodTimeOffset=XQ.prototype.Sb;
72
- XQ.prototype.getPodIndex=XQ.prototype.getPodIndex;XQ.prototype.getPodType=XQ.prototype.bb;XQ.prototype.getMediaBitrate=XQ.prototype.mb;XQ.prototype.getMediaHeight=XQ.prototype.Ab;XQ.prototype.getMediaWidth=XQ.prototype.Bb;XQ.prototype.getMediaUrl=XQ.prototype.getMediaUrl;XQ.prototype.getClickThroughUrl=XQ.prototype.Rb;XQ.prototype.isBumper=XQ.prototype.qc;XQ.prototype.getSkipTimeOffset=XQ.prototype.getSkipTimeOffset;XQ.prototype.getDuration=XQ.prototype.getDuration;XQ.prototype.getTitle=XQ.prototype.getTitle;
73
- XQ.prototype.getAdvertiserName=XQ.prototype.getAdvertiserName;XQ.prototype.getAdSystem=XQ.prototype.getAdSystem;XQ.prototype.getApiFramework=XQ.prototype.getApiFramework;XQ.prototype.getCreativeId=XQ.prototype.getCreativeId;XQ.prototype.getId=XQ.prototype.getId;XQ.prototype.getTechnology=XQ.prototype.Eb;XQ.prototype.getAdManagerVersion=XQ.prototype.yb;XQ.prototype.getAdManagerName=XQ.prototype.xb;YQ.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};YQ.prototype.Vb=function(){return!!this.a.find(function(a){return 0===a.position})};YQ.prototype.nb=function(){return!!this.a.find(function(a){return-1===a.position})};YQ.prototype.hasPostroll=YQ.prototype.nb;YQ.prototype.hasPreroll=YQ.prototype.Vb;YQ.prototype.getCuePoints=YQ.prototype.getCuePoints;_.r=$Q.prototype;_.r.load=function(){var a=this;return _.E(function(b){aR&&(aR=!1,fR(a,0));_.y(b)})};_.r.start=function(){return _.E(function(a){ZQ().play();_.y(a)})};_.r.resume=function(){-1!==this.getPosition()&&ZQ().play()};_.r.pause=function(){-1!==this.getPosition()&&ZQ().pause()};_.r.skip=function(){};_.r.getVolume=function(){return this.m.getVolume()||0};_.r.setVolume=function(a){this.m.setVolume(a)};
74
- _.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.r.dispose=function(){var a=this;return _.E(function(b){ZQ().removeEventListener(a.f,a.h);_.y(b)})};
75
- _.r.Ei=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=ZQ().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Nc,{adsTimeline:new YQ(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:eR(this,_.Cc,a);break;case cast.framework.events.EventType.BREAK_STARTED:eR(this,_.vc,a);break;case cast.framework.events.EventType.BREAK_ENDED:eR(this,_.wc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:eR(this,
76
- _.Ic,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(eR(this,_.Hc,a),eR(this,_.Jc,a)):a.endedReason===b.STOPPED?eR(this,_.Jc,a):a.endedReason===b.END_OF_STREAM?(eR(this,_.zc,a),eR(this,_.Jc,a)):a.endedReason===b.ERROR&&fR(this,1);break;case cast.framework.events.EventType.PLAYING:eR(this,_.Gc,a);break;case cast.framework.events.EventType.PAUSE:eR(this,_.Ec,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?eR(this,_.xc,a):eR(this,_.Gc,a)}};
77
- $Q.prototype.getPosition=$Q.prototype.getPosition;$Q.prototype.setVolume=$Q.prototype.setVolume;$Q.prototype.getVolume=$Q.prototype.getVolume;$Q.prototype.skip=$Q.prototype.skip;$Q.prototype.pause=$Q.prototype.pause;$Q.prototype.resume=$Q.prototype.resume;var aR=!1;gR.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(hR(),this.a)};gR.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(hR(),this.a)};gR.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return iR(a)})};
78
- gR.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=_.Oh;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Qh;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Rh}b&&this.cc(new _.L(b,{detail:iR(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.cc(new _.L(_.Oh,{detail:b.value}))};_.w(jR,_.U);_.r=jR.prototype;_.r.initialize=function(a){this.m=a;kR().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.r.load=function(){};_.r.destroy=function(){this.m=null;kR().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.ja=function(){return this.j};_.r.ha=function(){return null};
79
- _.r.Na=function(){var a=this.sa();return a&&a.renditions[0]};_.r.Pa=function(){var a=this.ta();return a&&a.renditions[0]};_.r.ab=function(){return null};_.r.kb=function(){return null};_.r.lb=function(){return null};_.r.Ra=function(){return null};_.r.sa=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};
68
+ a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,pQ.prototype.destroy.call(a),0)})};_.r.zi=function(){this.player.trigger(new _.L(_.gf));this.qa(_.Uo)};_.r.yi=function(){this.qa(_.To)};_.r.kl=function(){this.qa(_.No)};_.r.dl=function(a){a.isBuffering?this.qa(_.Lo):(a=this.player.isPaused()?_.To:_.Uo,this.qa(a))};_.r.Bi=function(){this.h=1;this.player.trigger(new _.L(_.ng))};_.r.Ai=function(){this.player.trigger(new _.L(_.mg))};_.r.Al=function(){this.h=2};_.r.nl=function(){this.qa(_.So)};
69
+ _.r.xi=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.gd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.U=function(a){a=new _.P(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.ne,{detail:a}));this.qa(_.Ro)};_.r=hR.prototype;_.r.xb=function(){return"Google Cast Framework"};_.r.yb=function(){return cast.framework.VERSION};_.r.Eb=function(){return 0};_.r.getId=function(){return""};_.r.getCreativeId=function(){return""};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return this.a.title||""};_.r.getDuration=function(){return this.a.duration||0};
70
+ _.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.rc=function(){return!1};_.r.Rb=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.Bb=function(){return 0};_.r.Ab=function(){return 0};_.r.mb=function(){return 0};_.r.bb=function(){switch(this.Sb()){case 0:return 0;case -1:return 2;default:return 1}};_.r.getPodIndex=function(){return this.h};_.r.Sb=function(){return this.f.position};_.r.Tb=function(){return this.j};
71
+ _.r.Db=function(){return this.l};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};hR.prototype.getWrapperCreativeIds=hR.prototype.getWrapperCreativeIds;hR.prototype.getWrapperAdSystems=hR.prototype.getWrapperAdSystems;hR.prototype.getWrapperAdIds=hR.prototype.getWrapperAdIds;hR.prototype.getSequenceLength=hR.prototype.Db;hR.prototype.getPositionInSequence=hR.prototype.Tb;hR.prototype.getPodTimeOffset=hR.prototype.Sb;
72
+ hR.prototype.getPodIndex=hR.prototype.getPodIndex;hR.prototype.getPodType=hR.prototype.bb;hR.prototype.getMediaBitrate=hR.prototype.mb;hR.prototype.getMediaHeight=hR.prototype.Ab;hR.prototype.getMediaWidth=hR.prototype.Bb;hR.prototype.getMediaUrl=hR.prototype.getMediaUrl;hR.prototype.getClickThroughUrl=hR.prototype.Rb;hR.prototype.isBumper=hR.prototype.rc;hR.prototype.getSkipTimeOffset=hR.prototype.getSkipTimeOffset;hR.prototype.getDuration=hR.prototype.getDuration;hR.prototype.getTitle=hR.prototype.getTitle;
73
+ hR.prototype.getAdvertiserName=hR.prototype.getAdvertiserName;hR.prototype.getAdSystem=hR.prototype.getAdSystem;hR.prototype.getApiFramework=hR.prototype.getApiFramework;hR.prototype.getCreativeId=hR.prototype.getCreativeId;hR.prototype.getId=hR.prototype.getId;hR.prototype.getTechnology=hR.prototype.Eb;hR.prototype.getAdManagerVersion=hR.prototype.yb;hR.prototype.getAdManagerName=hR.prototype.xb;iR.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};iR.prototype.Vb=function(){return!!this.a.find(function(a){return 0===a.position})};iR.prototype.nb=function(){return!!this.a.find(function(a){return-1===a.position})};iR.prototype.hasPostroll=iR.prototype.nb;iR.prototype.hasPreroll=iR.prototype.Vb;iR.prototype.getCuePoints=iR.prototype.getCuePoints;_.r=kR.prototype;_.r.load=function(){var a=this;return _.E(function(b){lR&&(lR=!1,qR(a,0));_.y(b)})};_.r.start=function(){return _.E(function(a){jR().play();_.y(a)})};_.r.resume=function(){-1!==this.getPosition()&&jR().play()};_.r.pause=function(){-1!==this.getPosition()&&jR().pause()};_.r.skip=function(){};_.r.getVolume=function(){return this.m.getVolume()||0};_.r.setVolume=function(a){this.m.setVolume(a)};
74
+ _.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.r.dispose=function(){var a=this;return _.E(function(b){jR().removeEventListener(a.f,a.h);_.y(b)})};
75
+ _.r.Ci=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=jR().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Nc,{adsTimeline:new iR(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:pR(this,_.Cc,a);break;case cast.framework.events.EventType.BREAK_STARTED:pR(this,_.vc,a);break;case cast.framework.events.EventType.BREAK_ENDED:pR(this,_.wc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:pR(this,
76
+ _.Ic,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(pR(this,_.Hc,a),pR(this,_.Jc,a)):a.endedReason===b.STOPPED?pR(this,_.Jc,a):a.endedReason===b.END_OF_STREAM?(pR(this,_.zc,a),pR(this,_.Jc,a)):a.endedReason===b.ERROR&&qR(this,1);break;case cast.framework.events.EventType.PLAYING:pR(this,_.Gc,a);break;case cast.framework.events.EventType.PAUSE:pR(this,_.Ec,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?pR(this,_.xc,a):pR(this,_.Gc,a)}};
77
+ kR.prototype.getPosition=kR.prototype.getPosition;kR.prototype.setVolume=kR.prototype.setVolume;kR.prototype.getVolume=kR.prototype.getVolume;kR.prototype.skip=kR.prototype.skip;kR.prototype.pause=kR.prototype.pause;kR.prototype.resume=kR.prototype.resume;var lR=!1;rR.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(sR(),this.a)};rR.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(sR(),this.a)};rR.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return tR(a)})};
78
+ rR.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=_.Ph;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Rh;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Sh}b&&this.cc(new _.L(b,{detail:tR(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.cc(new _.L(_.Ph,{detail:b.value}))};_.w(uR,_.U);_.r=uR.prototype;_.r.initialize=function(a){this.m=a;vR().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.r.load=function(){};_.r.destroy=function(){this.m=null;vR().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.ja=function(){return this.j};_.r.ia=function(){return null};
79
+ _.r.Oa=function(){var a=this.sa();return a&&a.renditions[0]};_.r.Qa=function(){var a=this.ta();return a&&a.renditions[0]};_.r.ab=function(){return null};_.r.kb=function(){return null};_.r.lb=function(){return null};_.r.Sa=function(){return null};_.r.sa=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};
80
80
  _.r.ta=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ja().find(function(c){return c.id===b})||null)}return a};_.r.gb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.za=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.Ja=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.fb=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.rb=function(a){this.za(a&&a.track)};
81
81
  _.r.sb=function(a){this.Ja(a&&a.track)};
82
- _.r.addTextTrack=function(a){var b=this,c,d,e;return _.E(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.x(f,hQ(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.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]),mR(b)}catch(g){throw b.g.warn("failed on track",
83
- a),g;}}_.y(f)})};_.r.la=function(){return!0};_.r.Xl=function(){this.f=kR().getAudioTracksManager();var a=this.f.getTracks();this.h=lR(_.T,a);mR(this);a=this.m.getConfiguration();nR(this,_.T,a.preferredAudioLanguage,a.preferredAudioRole);nR(this,_.S,a.preferredTextLanguage,a.preferredTextRole)};jR.prototype.isAbrEnabled=jR.prototype.la;jR.prototype.addTextTrack=jR.prototype.addTextTrack;jR.prototype.setTextRendition=jR.prototype.sb;jR.prototype.setAudioRendition=jR.prototype.rb;
84
- jR.prototype.setVideoRendition=jR.prototype.fb;jR.prototype.setTextTrack=jR.prototype.Ja;jR.prototype.setAudioTrack=jR.prototype.za;jR.prototype.setVideoTrack=jR.prototype.gb;jR.prototype.getTextTrack=jR.prototype.ta;jR.prototype.getAudioTrack=jR.prototype.sa;jR.prototype.getVideoTrack=jR.prototype.Ra;jR.prototype.getLoadingTextRendition=jR.prototype.lb;jR.prototype.getLoadingAudioRendition=jR.prototype.kb;jR.prototype.getLoadingVideoRendition=jR.prototype.ab;jR.prototype.getTextRendition=jR.prototype.Pa;
85
- jR.prototype.getAudioRendition=jR.prototype.Na;jR.prototype.getVideoRendition=jR.prototype.ha;jR.prototype.getTextTracks=jR.prototype.ja;jR.prototype.getAudioTracks=jR.prototype.getAudioTracks;jR.prototype.getVideoTracks=jR.prototype.getVideoTracks;_.w(oR,_.sl);_.r=oR.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=pR();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.rl.bind(this));d.setMediaPlaybackInfoHandler(this.fi.bind(this));this.a=new WQ(this);this.a.init();this.j=new jR;this.j.initialize(this);this.o=new gR(function(e){return c.trigger(e)});this.o.init()};
86
- _.r.unload=function(){var a=cast.framework.messages.PlayerState,b=pR();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.r.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return a.B=null,a.w=_.yl(),a.h=a.w,a.l=-1,a.A=null,a.a?_.x(b,a.a.destroy(),3):b.F(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.y(b)})};
87
- _.r.play=function(){var a=pR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.r.pause=function(){var a=pR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.r.isPaused=function(){return pR().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
88
- _.r.isEnded=function(){return pR().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=pR();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(SP);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return pR().getCurrentTimeSec()};_.r.getDuration=function(){var a=pR().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return pR().getPlaybackRate()};
89
- _.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;pR().sendLocalMediaRequest(b)}};_.r.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.r.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.r.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
90
- _.r.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.r.getLoadedSource=function(){var a=pR().getMediaInformation();if(a){var b=pR().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,an:b,name:c}}return null};_.r.getDrmInfo=function(){return null};
91
- _.r.getPresentationStartTime=function(){return pR().getStartAbsoluteTime()};_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=pR().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.a?this.a.getState():_.Eo};
92
- _.r.getStats=function(){var a=_.zo();if(this.f){a=pR().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.o=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.w=a.width||NaN;b.h=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.l=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.j=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
93
- _.r.load=function(a){var b=this,c,d;return _.E(function(e){b.f=new _.yo;b.a.j=b.f.a;b.A=_.Vo(a);_.Bl(a)&&(b.h=_.Al(b.w,a));if(b.D)return b.D=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.k&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:fQ(b.h),local:!0};return _.x(e,pR().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.va);return new _.rl};
94
- _.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.setNetworkEngine=function(a){this.G=a};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return $P};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.resetAbr=function(){this.g.warn(WP)};
95
- _.r.onError=function(a){this.trigger(new _.L(_.me,{detail:a}))};_.r.canPlay=function(){return _.zk()?2:0};
96
- _.r.rl=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=fQ(this.getStats());var b=pR(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.k&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime.Old value: "+(c.startAbsoluteTime+", new value: ")+b),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));c=cast.framework.messages.StreamType;b=a.media;var d=!!b,e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&
97
- (!e||e&&f)){d=pR().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};_.r.fi=function(a,b){var c=null;a.media.customData&&(c=gQ(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;sR(c,b);return b};
98
- _.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};oR.prototype.getTextDisplayer=oR.prototype.getTextDisplayer;oR.prototype.getNetworkEngine=oR.prototype.getNetworkEngine;oR.prototype.setNetworkEngine=oR.prototype.setNetworkEngine;_.r=tR.prototype;_.r.init=function(a){var b=this;a&&(this.f=new oR,_.aq(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.E(function(c){return b.m&&b.m.getState()!==_.Do?_.x(c,dQ(b.m),0):c.F(0)})}))};
99
- _.r.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=wR(),b=wR().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[bQ]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Kk.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=
100
- d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Ik.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(bQ,this.w)}};
101
- _.r.stop=function(){if(this.a){this.a=!1;this.o.release();var a=wR();wR().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(bQ,this.w);a.stop();this.m=this.f=null}};_.r.Od=function(a){this.j=a};_.r.lm=function(a){this.l=a};_.r.on=function(a,b){wR().addEventListener(a,b)};_.r.off=function(a,b){wR().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.oe&&this.h.add(a)};
102
- _.r.removeMessageListener=function(a){typeof a===_.oe&&this.h["delete"](a)};_.r.sendMessage=function(a,b){wR().sendCustomMessage(bQ,b,fQ(a))};_.r.oc=function(){return this.a};_.r.jb=function(){var a=wR().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
103
- _.r.Kk=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return yR(this,a);try{var b=(new DOMParser).parseFromString(a,_.cg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=wR();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ja),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.rg||g===_.$c){g=e[f].getAttribute(_.Le);for(var h=e[f].getElementsByTagName(_.Rb),l=
104
- h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Le)||g,n=h[l].getAttribute(_.Jd),p=h[l].getAttribute(_.Gg)||void 0,q=h[l].getAttribute(_.pe)||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(_.Rb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ja).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.ac)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=wR();c=a.getElementsByTagName("StreamIndex");
105
- for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.rg){e=c[d].getElementsByTagName(_.Ob);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.xb)||void 0,h=e[f].getAttribute(_.wb)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.tg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.Ob).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
106
- _.r.Ik=function(a){var b=this,c,d,e,f,g,h;return _.E(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=gQ(c.media.customData.playerConfiguration));if(!b.m||!d){l.F(2);break}if(!b.j){l.F(3);break}return _.x(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.F(5);break}return _.x(l,cR(c.media,d.ima,b.m.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.F(7);
107
- break}b.f.D=!0;return _.x(l,_.gq(b.m,d),8);case 8:return _.x(l,_.hq(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Lb&&(c.media.hlsVideoSegmentFormat=iQ(f.Lb,_.Pj)),f.audioMimeType&&(c.media.hlsSegmentFormat=iQ(f.audioMimeType,_.T));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.m.getConfiguration().autoplay);case 2:if(!b.l){l.F(10);
108
- break}return _.x(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.r.ol=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.Ak;var b=wR().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.m.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.m.seek(b))}_.dq(this.m)}};
109
- _.r.yi=function(a){if(0<this.h.size){var b=gQ(a.data);this.h.forEach(function(c){return c(b)})}};_.H(aQ,tR);tR.prototype.getContentMetadata=tR.prototype.jb;tR.prototype.isApiReady=tR.prototype.oc;tR.prototype.sendMessage=tR.prototype.sendMessage;tR.prototype.removeMessageListener=tR.prototype.removeMessageListener;tR.prototype.addMessageListener=tR.prototype.addMessageListener;tR.prototype.off=tR.prototype.off;tR.prototype.on=tR.prototype.on;tR.prototype.setLoadRequestDataInterceptor=tR.prototype.lm;
110
- tR.prototype.setPlayerConfigInterceptor=tR.prototype.Od;tR.prototype.stop=tR.prototype.stop;tR.prototype.start=tR.prototype.start;tR.prototype.init=tR.prototype.init;tR.getInstance=vR;var uR=null;_.r=zR.prototype;_.r.load=function(){var a=this,b,c,d,e,f;return _.E(function(g){a.a=a.f.l;if(a.a)for(b=a.a.controller,c=a.El.bind(a),d=_.u(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.y(g)})};_.r.start=function(){return _.E(function(a){_.y(a)})};_.r.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.r.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
111
- _.r.skip=function(){var a=this.f.a;a&&this.f.sendMessage(cQ,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.r.getVolume=function(){return this.f.getVolume()||0};_.r.setVolume=function(a){this.f.setVolume(a)};_.r.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.r.dispose=function(){var a=this;return _.E(function(b){a.h.release();_.y(b)})};
112
- _.r.El=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Nc,{adsTimeline:new YQ(a.breaks)})));break;case "isPlayingBreak":a.value?BR(this,_.vc):(BR(this,_.zc),BR(this,_.Jc),BR(this,_.wc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(BR(this,_.zc),BR(this,_.Jc)),BR(this,_.Ic));break;case "isPaused":this.a.isPlayingBreak&&(a.value?BR(this,_.Ec):BR(this,_.Gc))}};zR.prototype.getPosition=zR.prototype.getPosition;
113
- zR.prototype.setVolume=zR.prototype.setVolume;zR.prototype.getVolume=zR.prototype.getVolume;zR.prototype.skip=zR.prototype.skip;zR.prototype.pause=zR.prototype.pause;zR.prototype.resume=zR.prototype.resume;CR.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};CR.prototype.ba=function(a,b){return a.namespace()!==_.Cd?!1:!(!b||!b.ima)};CR.prototype.create=function(a){return new zR(a.a)};CR.prototype.create=CR.prototype.create;CR.prototype.isSupported=CR.prototype.ba;CR.prototype.name=CR.prototype.name;_.jp(new CR);DR.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};DR.prototype.ba=function(a,b){return vR().oc()?!(!b||!b.ima):!1};DR.prototype.create=function(a){return new $Q(a)};DR.prototype.create=DR.prototype.create;DR.prototype.isSupported=DR.prototype.ba;DR.prototype.name=DR.prototype.name;_.jp(new DR);};
82
+ _.r.addTextTrack=function(a){var b=this,c,d,e;return _.E(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.x(f,sQ(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.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]),xR(b)}catch(g){throw b.g.warn("failed on track",
83
+ a),g;}}_.y(f)})};_.r.la=function(){return!0};_.r.Vl=function(){this.f=vR().getAudioTracksManager();var a=this.f.getTracks();this.h=wR(_.T,a);xR(this);a=this.m.getConfiguration();yR(this,_.T,a.preferredAudioLanguage,a.preferredAudioRole);yR(this,_.S,a.preferredTextLanguage,a.preferredTextRole)};uR.prototype.isAbrEnabled=uR.prototype.la;uR.prototype.addTextTrack=uR.prototype.addTextTrack;uR.prototype.setTextRendition=uR.prototype.sb;uR.prototype.setAudioRendition=uR.prototype.rb;
84
+ uR.prototype.setVideoRendition=uR.prototype.fb;uR.prototype.setTextTrack=uR.prototype.Ja;uR.prototype.setAudioTrack=uR.prototype.za;uR.prototype.setVideoTrack=uR.prototype.gb;uR.prototype.getTextTrack=uR.prototype.ta;uR.prototype.getAudioTrack=uR.prototype.sa;uR.prototype.getVideoTrack=uR.prototype.Sa;uR.prototype.getLoadingTextRendition=uR.prototype.lb;uR.prototype.getLoadingAudioRendition=uR.prototype.kb;uR.prototype.getLoadingVideoRendition=uR.prototype.ab;uR.prototype.getTextRendition=uR.prototype.Qa;
85
+ uR.prototype.getAudioRendition=uR.prototype.Oa;uR.prototype.getVideoRendition=uR.prototype.ia;uR.prototype.getTextTracks=uR.prototype.ja;uR.prototype.getAudioTracks=uR.prototype.getAudioTracks;uR.prototype.getVideoTracks=uR.prototype.getVideoTracks;_.w(zR,_.tl);_.r=zR.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=AR();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.pl.bind(this));d.setMediaPlaybackInfoHandler(this.di.bind(this));this.a=new gR(this);this.a.init();this.j=new uR;this.j.initialize(this);this.o=new rR(function(e){return c.trigger(e)});this.o.init()};
86
+ _.r.unload=function(){var a=cast.framework.messages.PlayerState,b=AR();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.r.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return a.B=null,a.w=_.zl(),a.h=a.w,a.l=-1,a.A=null,a.a?_.x(b,a.a.destroy(),3):b.F(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.y(b)})};
87
+ _.r.play=function(){var a=AR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.r.pause=function(){var a=AR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.r.isPaused=function(){return AR().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
88
+ _.r.isEnded=function(){return AR().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=AR();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(cQ);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return AR().getCurrentTimeSec()};_.r.getDuration=function(){var a=AR().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return AR().getPlaybackRate()};
89
+ _.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;AR().sendLocalMediaRequest(b)}};_.r.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.r.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.r.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
90
+ _.r.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.r.getLoadedSource=function(){var a=AR().getMediaInformation();if(a){var b=AR().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,an:b,name:c}}return null};_.r.getDrmInfo=function(){return null};
91
+ _.r.getPresentationStartTime=function(){return AR().getStartAbsoluteTime()};_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=AR().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.a?this.a.getState():_.Ho};
92
+ _.r.getStats=function(){var a=_.Co();if(this.f){a=AR().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.o=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.w=a.width||NaN;b.h=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.l=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.j=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
93
+ _.r.load=function(a){var b=this,c,d;return _.E(function(e){b.f=new _.Bo;b.a.j=b.f.a;b.A=_.Yo(a);_.Cl(a)&&(b.h=_.Bl(b.w,a));if(b.D)return b.D=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.k&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:qQ(b.h),local:!0};return _.x(e,AR().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.va);return new _.sl};
94
+ _.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.setNetworkEngine=function(a){this.G=a};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return kQ};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.resetAbr=function(){this.g.warn(gQ)};
95
+ _.r.onError=function(a){this.trigger(new _.L(_.ne,{detail:a}))};_.r.canPlay=function(){return _.Ak()?2:0};
96
+ _.r.pl=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=qQ(this.getStats());var b=AR(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.k&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime.Old value: "+(c.startAbsoluteTime+", new value: ")+b),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));c=cast.framework.messages.StreamType;b=a.media;var d=!!b,e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&
97
+ (!e||e&&f)){d=AR().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};_.r.di=function(a,b){var c=null;a.media.customData&&(c=rQ(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;DR(c,b);return b};
98
+ _.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};zR.prototype.getTextDisplayer=zR.prototype.getTextDisplayer;zR.prototype.getNetworkEngine=zR.prototype.getNetworkEngine;zR.prototype.setNetworkEngine=zR.prototype.setNetworkEngine;_.r=ER.prototype;_.r.init=function(a){var b=this;a&&(this.f=new zR,_.dq(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.E(function(c){return b.m&&b.m.getState()!==_.Go?_.x(c,oQ(b.m),0):c.F(0)})}))};
99
+ _.r.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=HR(),b=HR().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[mQ]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Ik.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=
100
+ d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Gk.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(mQ,this.w)}};
101
+ _.r.stop=function(){if(this.a){this.a=!1;this.o.release();var a=HR();HR().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(mQ,this.w);a.stop();this.m=this.f=null}};_.r.Od=function(a){this.j=a};_.r.jm=function(a){this.l=a};_.r.on=function(a,b){HR().addEventListener(a,b)};_.r.off=function(a,b){HR().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.pe&&this.h.add(a)};
102
+ _.r.removeMessageListener=function(a){typeof a===_.pe&&this.h["delete"](a)};_.r.sendMessage=function(a,b){HR().sendCustomMessage(mQ,b,qQ(a))};_.r.pc=function(){return this.a};_.r.jb=function(){var a=HR().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
103
+ _.r.Ik=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return JR(this,a);try{var b=(new DOMParser).parseFromString(a,_.dg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=HR();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ja),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.sg||g===_.$c){g=e[f].getAttribute(_.Me);for(var h=e[f].getElementsByTagName(_.Rb),l=
104
+ h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Me)||g,n=h[l].getAttribute(_.Jd),p=h[l].getAttribute(_.Hg)||void 0,q=h[l].getAttribute(_.qe)||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(_.Rb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ja).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.ac)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=HR();c=a.getElementsByTagName("StreamIndex");
105
+ for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.sg){e=c[d].getElementsByTagName(_.Ob);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.xb)||void 0,h=e[f].getAttribute(_.wb)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.ug,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.Ob).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
106
+ _.r.Gk=function(a){var b=this,c,d,e,f,g,h;return _.E(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=rQ(c.media.customData.playerConfiguration));if(!b.m||!d){l.F(2);break}if(!b.j){l.F(3);break}return _.x(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.F(5);break}return _.x(l,nR(c.media,d.ima,b.m.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.F(7);
107
+ break}b.f.D=!0;return _.x(l,_.jq(b.m,d),8);case 8:return _.x(l,_.kq(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Lb&&(c.media.hlsVideoSegmentFormat=tQ(f.Lb,_.Qj)),f.audioMimeType&&(c.media.hlsSegmentFormat=tQ(f.audioMimeType,_.T));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.m.getConfiguration().autoplay);case 2:if(!b.l){l.F(10);
108
+ break}return _.x(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.r.ml=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.yk;var b=HR().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.m.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.m.seek(b))}_.gq(this.m)}};
109
+ _.r.wi=function(a){if(0<this.h.size){var b=rQ(a.data);this.h.forEach(function(c){return c(b)})}};_.H(lQ,ER);ER.prototype.getContentMetadata=ER.prototype.jb;ER.prototype.isApiReady=ER.prototype.pc;ER.prototype.sendMessage=ER.prototype.sendMessage;ER.prototype.removeMessageListener=ER.prototype.removeMessageListener;ER.prototype.addMessageListener=ER.prototype.addMessageListener;ER.prototype.off=ER.prototype.off;ER.prototype.on=ER.prototype.on;ER.prototype.setLoadRequestDataInterceptor=ER.prototype.jm;
110
+ ER.prototype.setPlayerConfigInterceptor=ER.prototype.Od;ER.prototype.stop=ER.prototype.stop;ER.prototype.start=ER.prototype.start;ER.prototype.init=ER.prototype.init;ER.getInstance=GR;var FR=null;_.r=KR.prototype;_.r.load=function(){var a=this,b,c,d,e,f;return _.E(function(g){a.a=a.f.l;if(a.a)for(b=a.a.controller,c=a.Cl.bind(a),d=_.u(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.y(g)})};_.r.start=function(){return _.E(function(a){_.y(a)})};_.r.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.r.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
111
+ _.r.skip=function(){var a=this.f.a;a&&this.f.sendMessage(nQ,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.r.getVolume=function(){return this.f.getVolume()||0};_.r.setVolume=function(a){this.f.setVolume(a)};_.r.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.r.dispose=function(){var a=this;return _.E(function(b){a.h.release();_.y(b)})};
112
+ _.r.Cl=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Nc,{adsTimeline:new iR(a.breaks)})));break;case "isPlayingBreak":a.value?MR(this,_.vc):(MR(this,_.zc),MR(this,_.Jc),MR(this,_.wc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(MR(this,_.zc),MR(this,_.Jc)),MR(this,_.Ic));break;case "isPaused":this.a.isPlayingBreak&&(a.value?MR(this,_.Ec):MR(this,_.Gc))}};KR.prototype.getPosition=KR.prototype.getPosition;
113
+ KR.prototype.setVolume=KR.prototype.setVolume;KR.prototype.getVolume=KR.prototype.getVolume;KR.prototype.skip=KR.prototype.skip;KR.prototype.pause=KR.prototype.pause;KR.prototype.resume=KR.prototype.resume;NR.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};NR.prototype.ba=function(a,b){return a.namespace()!==_.Cd?!1:!(!b||!b.ima)};NR.prototype.create=function(a){return new KR(a.a)};NR.prototype.create=NR.prototype.create;NR.prototype.isSupported=NR.prototype.ba;NR.prototype.name=NR.prototype.name;_.mp(new NR);OR.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};OR.prototype.ba=function(a,b){return GR().pc()?!(!b||!b.ima):!1};OR.prototype.create=function(a){return new kR(a)};OR.prototype.create=OR.prototype.create;OR.prototype.isSupported=OR.prototype.ba;OR.prototype.name=OR.prototype.name;_.mp(new OR);};
114
114
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
115
115
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
116
116
  else{_=this.clpp._;(f.call(g,this));}