@castlabs/prestoplay 6.14.0 → 6.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +528 -520
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +50 -56
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +69 -68
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -30
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +264 -274
  17. package/cjs/cl.muxdata.js +15 -15
  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 -26
  24. package/cjs/cl.tizen.js +70 -70
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +12 -12
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +19 -19
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +88 -88
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +440 -433
  37. package/cl.crypto.js +8 -8
  38. package/cl.dash.js +68 -68
  39. package/cl.externs.js +50 -56
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +71 -69
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +236 -240
  46. package/cl.muxdata.js +13 -13
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +11 -11
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +15 -15
  60. package/clpp.styles.css +2 -0
  61. package/package.json +1 -1
  62. package/typings.d.ts +40 -33
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 6.14.1
2
+
3
+ ## Changes
4
+
5
+ * Improve error handling of the `load()` method.
6
+ * Fix an issue on Safari where the player might get paused after seeking to
7
+ the very end of the video.
8
+ * Fix an issue with the player going to ENDED state early.
9
+ * Fix an issue where Tizen devices misreport AC-3 support for encrypted content.
10
+
1
11
  # 6.14.0
2
12
 
3
13
  ## New Features
package/cjs/cl.adobe.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
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,_.og,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 _.Vo:a.a.length||bS(a);s.Media.play(a.a,a.m.getPosition());break;case _.Uo:case _.Mo:aS(a);break;case _.Oo:case _.Ho:case _.So: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,_.rt);$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};_.nq(new dS);};
2
+ var f=function(window){var wS=function(){this.m=this.f=null;this.a="";this.g=new _.K("clpp.adobe.AdobePlugin")},zS=function(a){a.f=new _.Eh;a.f.on(a.m,_.pg,function(){return xS(a)});a.f.on(a.m,_.og,function(){s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Ie,function(){return yS(a)});a.f.on(a.m,_.Vf,function(b){b=b.detail;switch(b.currentState){case _.ip:a.a.length||yS(a);s.Media.play(a.a,a.m.getPosition());break;case _.hp:case _.$o:xS(a);break;case _.bp:case _.Vo:case _.fp:a.g.info("Close session for "+a.a+" in player state "+
3
+ (b.currentState+".")),xS(a),s.Media.close(a.a),a.a=""}})},yS=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(),_.va)},xS=function(a){s.Media.stop(a.a,a.m.getPosition())},AS=function(){};_.w(wS,_.fu);wS.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.m=a,zS(this)):this.g.warn("Adobe API not available.")};
4
+ wS.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""};wS.prototype.id=function(){return"adobe"};_.I("clpp.adobe.AdobeAnalyticsPlugin",wS);wS.Id="adobe";AS.prototype.create=function(){return new wS};_.Dq(new AS);};
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 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,_.rt);_.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.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()===_.Vo)this.l?this.m.play()["catch"](function(){}):this.o.aa(.01);this.m.trigger(new _.L(a))};_.r.qb=function(){return this.j};
4
- _.r.Te=function(){return this.f};_.r.om=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.H("clpp.airplay.AirPlayPlugin",YR);YR.prototype.showCastMenu=YR.prototype.om;YR.prototype.canCast=YR.prototype.Te;YR.prototype.isCasting=YR.prototype.qb;YR.Id="airplay";ZR.prototype.create=function(){return new YR};_.nq(new ZR);};
2
+ var f=function(window){var uS=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Ek(function(){a.m.play()["catch"](function(){})});this.h=new _.Eh},vS=function(){};_.w(uS,_.fu);_.r=uS.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.fl.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Gl.bind(this)))};
3
+ _.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.fl=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.Gl=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Nc:_.Mc;if(this.l||!this.m.isPaused()||this.m.getState()===_.ip)this.l?this.m.play()["catch"](function(){}):this.o.aa(.01);this.m.trigger(new _.L(a))};_.r.qb=function(){return this.j};
4
+ _.r.Se=function(){return this.f};_.r.pm=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.I("clpp.airplay.AirPlayPlugin",uS);uS.prototype.showCastMenu=uS.prototype.pm;uS.prototype.canCast=uS.prototype.Se;uS.prototype.isCasting=uS.prototype.qb;uS.Id="airplay";vS.prototype.create=function(){return new uS};_.Dq(new vS);};
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,11 +1,11 @@
1
1
  (function(){var g={}; var _ = _ || {}
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 _.ja};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.l=this.f=this.a=this.h=this.m=null;this.o=new _.Eh;this.j=!1},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=
4
- function(a,b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var d in c)a.a.setCustomParameter(d,c[d]);a.o.on(a.m,_.ne,a.U.bind(a));a.l=QR(a.m);a.a.attachPlayer(a.l)},UR=function(a,b){_.Hh(a.o);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;
5
- _.r.init=function(){var a=this.m,b=this.a;b.on(a,_.Tf,this.vi.bind(this));b.on(a,_.gd,this.ri.bind(this));b.on(a,"seek",this.si.bind(this))};_.r.ri=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.r.vi=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.Mo&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Mo:c.notifyStallStart();break;case _.Vo:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Uo:c.notifyPause()}};
6
- _.r.si=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.r.release=function(){this.a&&(_.Hh(this.a),this.a=null)};_.w(RR,_.rt);_.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));this.j=!0;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.l),c.f.init()})}};
7
- _.r.onContentLoaded=function(){!1!==this.j&&this.a.precacheEnded()};_.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);this.j=!1};_.r.id=function(){return"broadpeak"};
8
- _.H("clpp.broadpeak.BroadpeakPlugin",RR);RR.isSdkMissing=VR;RR.Id="broadpeak";WR.prototype.create=function(){return new RR};_.nq(new WR);};
2
+ var f=function(window){var mS=function(a,b){this.m=a;this.f=b;this.a=new _.Eh;this.h=!1},nS=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.a=_.Ij();return d}_.w(b,GenericPlayerApi);b.prototype.getPlayerName=function(){return _.va};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)},oS=function(){this.l=this.f=this.a=this.h=this.m=null;this.o=new _.Eh;this.j=!1},pS=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===_.Yf&&a.h.setUUID(f))},qS=
4
+ function(a,b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var d in c)a.a.setCustomParameter(d,c[d]);a.o.on(a.m,_.pe,a.T.bind(a));a.l=nS(a.m);a.a.attachPlayer(a.l)},rS=function(a,b){_.Hh(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},sS=function(){return!window.SmartLib||!window.GenericPlayerApi},tS=function(){};_.r=mS.prototype;
5
+ _.r.init=function(){var a=this.m,b=this.a;b.on(a,_.Vf,this.xi.bind(this));b.on(a,_.hd,this.vi.bind(this));b.on(a,"seek",this.wi.bind(this))};_.r.vi=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.r.xi=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.$o&&c.notifyStallEnd(!b.isPaused());switch(d){case _.$o:c.notifyStallStart();break;case _.ip:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.hp:c.notifyPause()}};
6
+ _.r.wi=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.r.release=function(){this.a&&(_.Hh(this.a),this.a=null)};_.w(oS,_.fu);_.r=oS.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(sS())return a.onError(new _.P(1,9,11E3));this.j=!0;pS(this,d);qS(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}));rS(c,void 0)}else b.url=e.getURL(),c.f=new mS(c.m,c.l),c.f.init()})}};
7
+ _.r.onContentLoaded=function(){!1!==this.j&&this.a.precacheEnded()};_.r.T=function(a){a=a.detail;if(7003===a.code)rS(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.Q)switch(a.category){case 3:rS(this,SmartLib.BPDecodingError);break;case 1:rS(this,SmartLib.BPNetworkingError);break;case 6:rS(this,SmartLib.BPAccessRightError);break;default:rS(this,SmartLib.BPUnspecifiedError)}};_.r.onPlayerWillRelease=function(){sS()||rS(this,SmartLib.BPSessionEndsNormally);this.j=!1};_.r.id=function(){return"broadpeak"};
8
+ _.I("clpp.broadpeak.BroadpeakPlugin",oS);oS.isSdkMissing=sS;oS.Id="broadpeak";tS.prototype.create=function(){return new oS};_.Dq(new tS);};
9
9
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
10
10
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
11
11
  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 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=_.Ho;this.l=_.Io;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!==_.qe){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.ua();
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.pa=d;this.h=this.J=
9
- _.zl();this.C=[];this.B=0;this.M=new _.Kj;this.H=this.l=this.a=null;this.A=this.w=!1;this.qa="";this.Ma=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.gl.bind(this);this.Da=this.zl.bind(this);this.ha=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(){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.pa=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.Rf();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.ha);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.wi.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.qb()?
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=_.$t,_.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.C=_.Zo(a.h);a.B=a.C.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.Dj.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.lb()||{};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.ua())&&d.language&&(a.h.preferredTextLanguage=
17
- d.language);(e=a.f.ja())&&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===_.qe?c:function(e,f){d.f&&e!==_.Oo&&e!==_.Ho&&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.cg&&(d.preferredAudioLanguage=c.cg);c.Ph&&(d.preferredTextLanguage=c.Ph);_.eq(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"]();_.eq(a.f,a.a);_.y(c)})},gR=function(a){pQ.call(this,a,"clpp.cast.StateManager");this.I=this.Ai.bind(this);this.H=this.zi.bind(this);this.w=this.ml.bind(this);this.o=this.fl.bind(this);this.K=this.Ci.bind(this);this.J=this.Bi.bind(this);this.M=this.Cl.bind(this);this.G=this.pl.bind(this);this.C=this.U.bind(this);this.a=this.yi.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.Di.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.dc=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.Xl.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.fa());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.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.La(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 _.Kj;this.f=this.o=this.j=this.a=this.B=null;this.C=!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];_.Zo(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.Za[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.ol.bind(this);
31
- this.w=this.xi.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.sa(_.Ho)};_.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.sa(_.So)};
36
- _.r.sa=function(a){if(a!==this.f)if(this.f===_.So&&a!==_.Ho)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===_.Mo?(this.A=b,this.player.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.Mo&&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&&_.xo(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.sa=function(a){var b=this.player.l;b&&b.isPlayingBreak||pQ.prototype.sa.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.sa(_.Oo);break;case chrome.cast.media.IdleReason.ERROR:this.sa(_.So);break;default:this.sa(_.Ho)}break;case chrome.cast.media.PlayerState.PLAYING:this.sa(_.Vo);break;case chrome.cast.media.PlayerState.PAUSED:this.sa(_.Uo);break;case chrome.cast.media.PlayerState.BUFFERING:this.sa(_.Mo)}};_.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(_.cu)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return zQ(this,_.Qj)};_.r.getAudioTracks=function(){return zQ(this,_.T)};_.r.fa=function(){return zQ(this,_.S)};_.r.ka=function(){var a=this.Ia();return a?a.renditions[0]:null};_.r.Qa=function(){var a=this.ja();return a?a.renditions[0]:null};_.r.Ha=function(){var a=this.ua();return a?a.renditions[0]:null};_.r.bb=function(){return this.f[_.Qj]||null};
41
- _.r.mb=function(){return this.f[_.T]||null};_.r.nb=function(){return this.f[_.S]||null};_.r.Ia=function(){return AQ(this,_.Qj)};_.r.ja=function(){return AQ(this,_.T)};_.r.ua=function(){return AQ(this,_.S)};_.r.ib=function(a){CQ(this,_.Qj,a)};_.r.za=function(a){CQ(this,_.T,a)};_.r.La=function(a){CQ(this,_.S,a)};_.r.Ya=function(a){this.ib(a&&a.track)};_.r.gb=function(a){this.za(a&&a.track)};_.r.hb=function(a){this.La(a&&a.track)};_.r.addTextTrack=function(){return _.E(function(a){_.y(a)})};_.r.ma=function(){return!0};
42
- xQ.prototype.isAbrEnabled=xQ.prototype.ma;xQ.prototype.addTextTrack=xQ.prototype.addTextTrack;xQ.prototype.setTextRendition=xQ.prototype.hb;xQ.prototype.setAudioRendition=xQ.prototype.gb;xQ.prototype.setVideoRendition=xQ.prototype.Ya;xQ.prototype.setTextTrack=xQ.prototype.La;xQ.prototype.setAudioTrack=xQ.prototype.za;xQ.prototype.setVideoTrack=xQ.prototype.ib;xQ.prototype.getTextTrack=xQ.prototype.ua;xQ.prototype.getAudioTrack=xQ.prototype.ja;xQ.prototype.getVideoTrack=xQ.prototype.Ia;
43
- xQ.prototype.getLoadingTextRendition=xQ.prototype.nb;xQ.prototype.getLoadingAudioRendition=xQ.prototype.mb;xQ.prototype.getLoadingVideoRendition=xQ.prototype.bb;xQ.prototype.getTextRendition=xQ.prototype.Ha;xQ.prototype.getAudioRendition=xQ.prototype.Qa;xQ.prototype.getVideoRendition=xQ.prototype.ka;xQ.prototype.getTextTracks=xQ.prototype.fa;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.Pd=function(a){this.P=a};_.r.pc=function(){return this.w};_.r.qb=function(){return this.A};_.r.hf=function(){return this.qa};
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.qb())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.df=function(){this.qb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
46
- _.r.addMessageListener=function(a){typeof a===_.qe&&this.G.add(a)};_.r.removeMessageListener=function(a){typeof a===_.qe&&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()===_.Oo};_.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(_.og));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})};
2
+ var f=function(window){var zQ="Cannot seek during ads playout.",AQ="Cannot switch track",BQ="Media session does not exist.",CQ="No receivers available",DQ="Reset ABR functionality not available on cast.",EQ="SDK not yet ready",FQ="Sender is destroyed.",GQ="clpp.cast.CastProxy",HQ="clpp.cast.Player",IQ="clpp.cast.Receiver",JQ="urn:x-cast:castlabs",KQ="urn:x-cast:com.google.cast.media",LQ=function(a){return _.E(function(b){return 1==b.a?_.x(b,a.tc(_.Ze),2):_.x(b,a.tc(_.Ye),0)})},MQ=function(a,b){this.log=new _.K(b);this.player=
3
+ a;this.j=null;this.f=_.Vo;this.l=_.Wo;this.h=2;this.B=Date.now();this.A=-1},NQ=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.se){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ve?"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}})},OQ=function(a){if(typeof a!==_.Yf)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}},PQ=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=_.tk(d,a.mimeType,g);if(!f||!g)return q.F(2);l=_.uj(a.url);return _.x(q,c.fetch(l).O,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Xi(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)})},QQ=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 _.vg:return d.FMP4;case _.ug:return b===_.Uj?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}},SQ=function(a){a=
6
+ void 0===a?RQ: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}},TQ=function(a){MQ.call(this,a,"clpp.cast.SenderStateManager");
7
+ this.o=this.a=null;this.w=this.Hb.bind(this)},UQ=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},VQ=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},XQ=function(a,b){var c=VQ(a);return WQ(a,b).find(function(d){return c.includes(d.id)})||null},WQ=function(a,b){return a.h.filter(function(c){return c.type===b})},ZQ=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.T){var e=a.ua();
8
+ e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;YQ(a,b)},function(f){a.f[b]=null;a.g.debug(AQ,f)})}else b===_.T&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){YQ(a,b)},function(f){a.g.debug(AQ,f)}))},YQ=function(a,b){b===_.Tj?a.a.trigger(new _.L(_.yl)):b===_.T&&a.a.trigger(new _.L(_.zl))},cR=function(a,b,c,d){_.Fl.call(this);this.g=new _.K(_.Dd);this.ga=a;this.o=new _.Gk(b);this.da=c;this.pa=d;this.h=this.J=
9
+ _.Ll();this.D=[];this.B=0;this.L=new _.Nj;this.H=this.l=this.a=null;this.A=this.w=!1;this.qa="";this.Wa=1E6;this.f=new UQ;this.f.initialize(this);this.j=new TQ(this);this.I=new _.Eh;this.K=null;this.G=new Set;this.U=this.hl.bind(this);this.Da=this.Al.bind(this);this.ha=this.rl.bind(this);this.V=this.ll.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(){$Q(!0)},0)}});aR(this);bR.add(this)},
10
+ dR=function(a){var b,c;return _.E(function(d){if(1==d.a)return bR["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.U),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.pa=null;_.y(d)})},iR=function(a){if(!a)return null;
11
+ a:{var b=a.metadataType;var c=Object.entries(eR);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=SQ(eR[b]);return Object.assign(b,a)},nR=function(a){var b=void 0===b?RQ:b;return Object.values(eR).includes(a)?a:b},sR=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},aR=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
12
+ a.ga.length){a.w=!0;a.o.Rf();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.ga;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.U);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Da);tR&&a.o.aa(.02)}},uR=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},wR=function(a,b){vR(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ha);b.addMessageListener(JQ,a.V)},vR=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.yi.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.L(_.Ie)))},xR=function(a){return _.E(function(b){return a.qb()?
14
+ b.F(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},yR=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=_.yu,_.x(B,xR(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=QQ(l,d.VIDEO);
15
+ g.hlsSegmentFormat=QQ(m,d.AUDIO);if(!b.Ya){B.F(3);break}if(!a.P){B.F(4);break}return _.x(B,Promise.resolve(a.P(b.Ya)),5);case 5:if(n=B.f)b.Ya=n;case 4:a.h=b.Ya;a.D=_.mp(a.h);a.B=a.D.findIndex(function(H){return H.url===b.source.url});if(!b.Ya.remoteTextTracks){B.F(6);break}return _.x(B,Promise.all(b.Ya.remoteTextTracks.map(a.Fj.bind(a))),7);case 7:p=B.f,g.tracks=p.filter(function(H){return H}),b.Ya.remoteTextTracks=void 0;case 6:delete b.Ya.autoplay,b.Ya.startTime=null,g.customData={playerConfiguration:NQ(b.Ya)};
16
+ case 3:q=a.lb()||{};t=nR(q.metadataType);typeof b.Hf===_.k&&(v={metadataType:t,sectionStartAbsoluteTime:b.Hf});b.source.name&&(z={metadataType:t,title:b.source.name});D=sR(q);if(G=iR(Object.assign({},v,z,D)))g.metadata=G;F=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.id&&(F.autoplay=b.autoplay);typeof b.currentTime===_.k&&(F.currentTime=b.currentTime);return _.x(B,f.loadMedia(F),0)}})},zR=function(a,b,c){c=void 0===c?0:c;var d,e;return _.E(function(f){(d=a.f.ua())&&d.language&&(a.h.preferredTextLanguage=
17
+ d.language);(e=a.f.ja())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.x(f,yR(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Hf:a.getPresentationStartTime(),autoplay:b,Ya:a.h}),0)})},$Q=function(a){if(a){a=_.u(bR);for(var b=a.next();!b.done;b=a.next())aR(b.value)}},BR=function(a,b,c){_.Fl.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.se?c:function(e,f){d.f&&e!==_.bp&&e!==_.Vo&&d.f.load(f)};this.a=AR(this);this.g=new _.K(GQ);this.addDelegate(this.f)},AR=
18
+ function(a){return new cR(a.h,function(){a.trigger(new _.L(_.pd))},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.cg&&(d.preferredAudioLanguage=c.cg);c.Sh&&(d.preferredTextLanguage=c.Sh);_.sq(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return CR(a)})},CR=function(a){var b;return _.E(function(c){if(1==c.a)return a.trigger(new _.L(_.od)),
19
+ b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.sq(a.f,a.a);_.y(c)})},DR=function(a){MQ.call(this,a,"clpp.cast.StateManager");this.I=this.Ci.bind(this);this.H=this.Bi.bind(this);this.w=this.nl.bind(this);this.o=this.gl.bind(this);this.K=this.Ei.bind(this);this.J=this.Di.bind(this);this.L=this.Dl.bind(this);this.G=this.ql.bind(this);this.D=this.T.bind(this);this.a=this.Ai.bind(this)},ER=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},FR=function(a){this.a=a},HR=function(a){this.m=a;this.a=null;this.h=this.Fi.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
+ GR().addEventListener(this.f,this.h)},KR=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);IR=!1;e=_.uj(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,_.eg),l.getElementsByTagName("vmap:VMAP").length)_.J("VMAP detected."),a.vmapAdsRequest=JR(g);else if(l.getElementsByTagName("VAST").length){_.J("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");
22
+ p.vastAdsRequest=JR(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.J("Unsupported schema."),IR=!0;return _.bh(n,0)}m=_.C(n);_.J("Failed to fetch an ad",m);IR=!0;_.y(n)})},JR=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},GR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},MR=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;
23
+ (c=LR(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},NR=function(a,b){var c=new _.P(1,10,10003,{errorType:b});a.m.onError(c)},LR=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.Yf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Yf&&(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 ER(d,e,b.index,b.total,f)}return c},OR=function(a){this.dc=a;this.a=this.f.bind(this)},PR=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]},QR=function(a){var b=a.dashTimedMetadata,c=_.ng;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.mg)?
25
+ _.Oh:_.Mh,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},RR=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},SR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},UR=function(a){a.a=SR().getTextTracksManager();var b=a.a.getTracks();a.j=TR(_.T,b)},VR=function(a,b,c,d){c=_.Th(c).filter(function(h){return h});
26
+ var e=!1,f=[];b===_.Tj?f=a.getAudioTracks():b===_.T&&(f=a.ea());if(c=c.find(function(h){var l=_.Qi(h);return f.some(function(m){m=_.Qi(m.language||"");return _.Ri(l,m)})})){var g=_.Qi(c);c=f.filter(function(h){h=_.Qi(h.language||"");return _.Ri(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===_.Tj?a.za(e):b===_.T&&a.La(e))},TR=function(a,b){for(var c=[],d=_.u(b),
27
+ e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Rj(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 _.ak(f.id,f));c.push(f)}return c},WR=function(){_.Fl.call(this);this.g=new _.K(HQ);this.h=this.w=_.Ll();this.A=null;
28
+ this.l=-1;this.G=new _.Nj;this.f=this.o=this.j=this.a=this.B=null;this.D=!1},YR=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},aS=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=_.im(d);if(e){var f=[_.Qd];_.mp(a)[0].type!==_.Yc&&f.unshift(_.Sd);d.preferredDrmSystem===_.Qd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
29
+ h=e.$a[g];h?(d=g===_.Sd?cast.framework.ContentProtection.WIDEVINE:g===_.Qd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},ZR(b,h,a,d),$R(b,h,a,d)):c()}else c()}else c()},ZR=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.uj({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},$R=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.E(function(h){return 1==h.a?(g=_.vj(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.Xi(g.data))})}:a.licenseHandler=void 0},bS=function(){this.a=!1;this.g=new _.K(IQ);this.f=this.m=null;this.h=new Set;this.A=this.pl.bind(this);
31
+ this.w=this.zi.bind(this);this.j=null;this.o=new _.Eh;this.l=null},dS=function(){return cS||(cS=new bS)},eS=function(){return cast.framework.CastReceiverContext.getInstance()},gS=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=eS();c=(eS().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.vg:_.ug;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
+ fS(h,_.sa),m=fS(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")},fS=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},hS=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]},jS=function(a,b){var c=null,d=iS(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},iS=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 ER(d,c,e,f,g)}return b},kS=function(){},lS=function(){};_.r=MQ.prototype;_.r.release=function(){this.sa(_.Vo)};_.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.sa(_.fp)};
36
+ _.r.sa=function(a){if(a!==this.f)if(this.f===_.fp&&a!==_.Vo)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===_.$o?(this.A=b,this.player.trigger(new _.L(_.kd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.$o&&this.player.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.Lo(this.j,this.f);this.player.trigger(new _.L(_.Vf,
37
+ {detail:a}))}};_.I("clpp.cast.CastUtils",function(){});var RQ=0,eR={GENERIC:RQ,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.w(TQ,MQ);TQ.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)};TQ.prototype.destroy=function(){var a=this;return _.E(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,MQ.prototype.destroy.call(a),0)})};TQ.prototype.sa=function(a){var b=this.player.l;b&&b.isPlayingBreak||MQ.prototype.sa.call(this,a)};
38
+ TQ.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.sa(_.bp);break;case chrome.cast.media.IdleReason.ERROR:this.sa(_.fp);break;default:this.sa(_.Vo)}break;case chrome.cast.media.PlayerState.PLAYING:this.sa(_.ip);break;case chrome.cast.media.PlayerState.PAUSED:this.sa(_.hp);break;case chrome.cast.media.PlayerState.BUFFERING:this.sa(_.$o)}};_.w(UQ,_.U);_.r=UQ.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=_.Uj;break;case chrome.cast.media.TrackType.AUDIO:c=_.Tj;break;case chrome.cast.media.TrackType.TEXT:c=_.T}c=new _.Rj(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 _.ak(c.id,c));return c}):[],this.a.trigger(new _.L(_.Au)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return WQ(this,_.Uj)};_.r.getAudioTracks=function(){return WQ(this,_.Tj)};_.r.ea=function(){return WQ(this,_.T)};_.r.ka=function(){var a=this.Ia();return a?a.renditions[0]:null};_.r.Pa=function(){var a=this.ja();return a?a.renditions[0]:null};_.r.Ha=function(){var a=this.ua();return a?a.renditions[0]:null};_.r.cb=function(){return this.f[_.Uj]||null};
41
+ _.r.mb=function(){return this.f[_.Tj]||null};_.r.nb=function(){return this.f[_.T]||null};_.r.Ia=function(){return XQ(this,_.Uj)};_.r.ja=function(){return XQ(this,_.Tj)};_.r.ua=function(){return XQ(this,_.T)};_.r.jb=function(a){ZQ(this,_.Uj,a)};_.r.za=function(a){ZQ(this,_.Tj,a)};_.r.La=function(a){ZQ(this,_.T,a)};_.r.Za=function(a){this.jb(a&&a.track)};_.r.hb=function(a){this.za(a&&a.track)};_.r.ib=function(a){this.La(a&&a.track)};_.r.addTextTrack=function(){return _.E(function(a){_.y(a)})};
42
+ _.r.ma=function(){return!0};UQ.prototype.isAbrEnabled=UQ.prototype.ma;UQ.prototype.addTextTrack=UQ.prototype.addTextTrack;UQ.prototype.setTextRendition=UQ.prototype.ib;UQ.prototype.setAudioRendition=UQ.prototype.hb;UQ.prototype.setVideoRendition=UQ.prototype.Za;UQ.prototype.setTextTrack=UQ.prototype.La;UQ.prototype.setAudioTrack=UQ.prototype.za;UQ.prototype.setVideoTrack=UQ.prototype.jb;UQ.prototype.getTextTrack=UQ.prototype.ua;UQ.prototype.getAudioTrack=UQ.prototype.ja;
43
+ UQ.prototype.getVideoTrack=UQ.prototype.Ia;UQ.prototype.getLoadingTextRendition=UQ.prototype.nb;UQ.prototype.getLoadingAudioRendition=UQ.prototype.mb;UQ.prototype.getLoadingVideoRendition=UQ.prototype.cb;UQ.prototype.getTextRendition=UQ.prototype.Ha;UQ.prototype.getAudioRendition=UQ.prototype.Pa;UQ.prototype.getVideoRendition=UQ.prototype.ka;UQ.prototype.getTextTracks=UQ.prototype.ea;UQ.prototype.getAudioTracks=UQ.prototype.getAudioTracks;UQ.prototype.getVideoTracks=UQ.prototype.getVideoTracks;_.w(cR,_.Fl);_.r=cR.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.Qd=function(a){this.P=a};_.r.nc=function(){return this.w};_.r.qb=function(){return this.A};_.r.gf=function(){return this.qa};
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,NQ(b)),5);case 5:_.bh(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.nc())throw a.g.warn(EQ),new _.P(1,8,8001,void 0);if(!tR)throw a.g.warn(CQ),new _.P(1,8,8002,void 0);if(a.qb())throw a.g.warn("Already casting"),new _.P(1,8,8003,void 0);_.A(d,2);return _.x(d,xR(a),4)}if(2!=d.a)return _.bh(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.qb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
46
+ _.r.addMessageListener=function(a){typeof a===_.se&&this.G.add(a)};_.r.removeMessageListener=function(a){typeof a===_.se&&this.G["delete"](a)};_.r.play=function(){var a=this;return this.isEnded()?zR(this,!0):new Promise(function(b,c){if(!a.a)return c(BQ);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(BQ);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()===_.bp};_.r.seek=function(a){var b=this;return this.isEnded()?zR(this,!1,a):new Promise(function(c,d){b.a||d(BQ);b.l.isPlayingBreak&&d(zQ);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.pg));b.a.seek(e,function(){b.trigger(new _.L(_.og));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(KQ,{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():_.Io};
51
- _.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?rQ(this.a.customData.stats):_.Do()};_.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.C=_.Zo(a);_.Cl(a)&&(b.h=_.Bl(b.J,a));c=b.C[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.C[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.lb=function(){return this.K};_.r.wc=function(a){this.K=MQ(a)};_.r.We=function(){this.K=null};_.r.Mf=function(a){var b=this.lb()||{};a={metadataType:RQ(b.metadataType),title:a};this.wc(Object.assign({},b,a))};
54
- _.r.Kf=function(a){var b=this.lb()||{},c=RQ(b.metadataType);a=new chrome.cast.Image(a);this.wc(Object.assign({},b,{metadataType:c,images:[a]}))};_.r.Jf=function(a){var b=this.lb()||{};this.wc(Object.assign({},b,{metadataType:3,artist:a}))};_.r.Lf=function(a){var b=this.lb()||{};a={metadataType:RQ(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;XQ=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.qa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Rf()};
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;$Q(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.qb()||(this.A=!0,$Q(this,a.session),this.pa());break;case cast.framework.SessionState.SESSION_ENDED:if(this.qb()&&this.a){var b=this.a.media,c=this.f.ja(),d=this.f.ua();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,cg:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ha);a.session.removeMessageListener(mQ,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);ZQ(this,a.mediaSession)};_.r.kl=function(a,b){if(a===mQ&&0<this.G.size){var c=rQ(b);this.G.forEach(function(d){return d(c)})}};_.r.wi=function(){this.trigger(new _.L(_.eg))};
58
- _.r.Dj=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.Ma++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.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.Te=function(){return!!this.a&&this.a.pc()&&XQ};_.r.qb=function(){return!!this.a&&this.a.qb()};_.r.hf=function(){return this.a?this.a.hf():""};_.r.Pd=function(a){this.a&&this.a.Pd(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():_.Wo};
51
+ _.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?OQ(this.a.customData.stats):_.Ro()};_.r.isLive=function(){return Infinity===this.getDuration()};_.r.load=function(a){var b=this,c,d;return _.E(function(e){if(!b.nc())return b.g.warn(EQ),e["return"]();if(!tR)return b.g.warn(CQ),e["return"]();b.D=_.mp(a);b.h=_.Nl(b.J,a);c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,Ya:b.h,Lb:c.Lb,audioMimeType:c.audioMimeType};return _.x(e,yR(b,d),0)})};
52
+ _.r.getBufferInfo=function(){return new _.El};_.r.getTrackManager=function(){return this.f};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.L=a};_.r.getNetworkEngine=function(){return this.L};_.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(DQ)};_.r.onError=function(a){if(a&&(this.trigger(new _.L(_.pe,{detail:a})),this.j))this.j.onError(a)};_.r.namespace=function(){return _.Dd};_.r.canPlay=function(){return this.nc()?2:0};_.r.lb=function(){return this.K};_.r.uc=function(a){this.K=iR(a)};_.r.Ve=function(){this.K=null};_.r.Mf=function(a){var b=this.lb()||{};a={metadataType:nR(b.metadataType),title:a};this.uc(Object.assign({},b,a))};
54
+ _.r.Kf=function(a){var b=this.lb()||{},c=nR(b.metadataType);a=new chrome.cast.Image(a);this.uc(Object.assign({},b,{metadataType:c,images:[a]}))};_.r.Jf=function(a){var b=this.lb()||{};this.uc(Object.assign({},b,{metadataType:3,artist:a}))};_.r.Lf=function(a){var b=this.lb()||{};a={metadataType:nR(b.metadataType),releaseDate:a};this.uc(Object.assign({},b,a))};
55
+ _.r.hl=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;tR=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.qa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Rf()};
56
+ _.r.Al=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;wR(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.qb()||(this.A=!0,wR(this,a.session),this.pa());break;case cast.framework.SessionState.SESSION_ENDED:if(this.qb()&&this.a){var b=this.a.media,c=this.f.ja(),d=this.f.ua();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:uR(this),Sh:d,cg:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ha);a.session.removeMessageListener(JQ,this.V);this.A=!1;this.a=null;this.I.release();this.l=this.H=null}};_.r.rl=function(a){this.g.debug("New media session",a.mediaSession);vR(this,a.mediaSession)};_.r.ll=function(a,b){if(a===JQ&&0<this.G.size){var c=OQ(b);this.G.forEach(function(d){return d(c)})}};_.r.yi=function(){this.trigger(new _.L(_.fg))};
58
+ _.r.Fj=function(a){var b=this,c,d;return _.E(function(e){if(1==e.a)return c=null,_.x(e,PQ(a,[_.dg,_.Xc],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Wa++,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};cR.prototype.getTextDisplayer=cR.prototype.getTextDisplayer;cR.prototype.getNetworkEngine=cR.prototype.getNetworkEngine;
59
+ cR.prototype.setNetworkEngine=cR.prototype.setNetworkEngine;var tR=!1,bR=new Set;window.__onGCastApiAvailable=$Q;_.w(BR,_.Fl);_.r=BR.prototype;_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return a.a?_.x(b,dR(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.nc()&&tR};_.r.qb=function(){return!!this.a&&this.a.qb()};_.r.gf=function(){return this.a?this.a.gf():""};_.r.Qd=function(a){this.a&&this.a.Qd(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.ja();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.ua())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),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.df=function(){this.a&&this.a.df()};_.r.pi=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.lb=function(){return this.a&&this.a.lb()};_.r.wc=function(a){this.a&&this.a.wc(a)};_.r.We=function(){this.a&&this.a.We()};_.r.Mf=function(a){this.a&&this.a.Mf(a)};_.r.Kf=function(a){this.a&&this.a.Kf(a)};_.r.Jf=function(a){this.a&&this.a.Jf(a)};_.r.Lf=function(a){this.a&&this.a.Lf(a)};_.H(jQ,eR);eR.prototype.setContentReleaseDate=eR.prototype.Lf;eR.prototype.setContentArtist=eR.prototype.Jf;
64
- eR.prototype.setContentImage=eR.prototype.Kf;eR.prototype.setContentTitle=eR.prototype.Mf;eR.prototype.clearContentMetadata=eR.prototype.We;eR.prototype.setContentMetadata=eR.prototype.wc;eR.prototype.getContentMetadata=eR.prototype.lb;eR.prototype.removeMessageListener=eR.prototype.removeMessageListener;eR.prototype.addMessageListener=eR.prototype.addMessageListener;eR.prototype.sendMessage=eR.prototype.sendMessage;eR.prototype.changeReceiverId=eR.prototype.pi;eR.prototype.forceDisconnect=eR.prototype.df;
65
- eR.prototype.cast=eR.prototype.cast;eR.prototype.setPlayerConfigInterceptor=eR.prototype.Pd;eR.prototype.getReceiverName=eR.prototype.hf;eR.prototype.isCasting=eR.prototype.qb;eR.prototype.canCast=eR.prototype.Te;eR.prototype.destroy=eR.prototype.destroy;_.w(gR,pQ);_.r=gR.prototype;
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.C);b.addEventListener(a.BITRATE_CHANGED,this.a)};
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.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,pQ.prototype.destroy.call(a),0)})};_.r.Ai=function(){this.player.trigger(new _.L(_.gf));this.sa(_.Vo)};_.r.zi=function(){this.sa(_.Uo)};_.r.ml=function(){this.sa(_.Oo)};_.r.fl=function(a){a.isBuffering?this.sa(_.Mo):(a=this.player.isPaused()?_.Uo:_.Vo,this.sa(a))};_.r.Ci=function(){this.h=1;this.player.trigger(new _.L(_.og))};_.r.Bi=function(){this.player.trigger(new _.L(_.mg))};_.r.Cl=function(){this.h=2};_.r.pl=function(){this.sa(_.To)};
69
- _.r.yi=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.sa(_.So)};_.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.ob=function(){return 0};_.r.cb=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.cb;hR.prototype.getMediaBitrate=hR.prototype.ob;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.pb=function(){return!!this.a.find(function(a){return-1===a.position})};iR.prototype.hasPostroll=iR.prototype.pb;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.Di=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,_.Bc,a);break;case cast.framework.events.EventType.BREAK_STARTED:pR(this,_.uc,a);break;case cast.framework.events.EventType.BREAK_ENDED:pR(this,_.vc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:pR(this,
76
- _.Hc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(pR(this,_.Gc,a),pR(this,_.Ic,a)):a.endedReason===b.STOPPED?pR(this,_.Ic,a):a.endedReason===b.END_OF_STREAM?(pR(this,_.yc,a),pR(this,_.Ic,a)):a.endedReason===b.ERROR&&qR(this,1);break;case cast.framework.events.EventType.PLAYING:pR(this,_.Fc,a);break;case cast.framework.events.EventType.PAUSE:pR(this,_.Dc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?pR(this,_.wc,a):pR(this,_.Fc,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.dc(new _.L(b,{detail:tR(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.dc(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.fa=function(){return this.j};_.r.ka=function(){return null};
79
- _.r.Qa=function(){var a=this.ja();return a&&a.renditions[0]};_.r.Ha=function(){var a=this.ua();return a&&a.renditions[0]};_.r.bb=function(){return null};_.r.mb=function(){return null};_.r.nb=function(){return null};_.r.Ia=function(){return null};_.r.ja=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
- _.r.ua=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.fa().find(function(c){return c.id===b})||null)}return a};_.r.ib=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.za=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.La=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.Ya=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.gb=function(a){this.za(a&&a.track)};
81
- _.r.hb=function(a){this.La(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,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.ma=function(){return!0};_.r.Xl=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.ma;uR.prototype.addTextTrack=uR.prototype.addTextTrack;uR.prototype.setTextRendition=uR.prototype.hb;uR.prototype.setAudioRendition=uR.prototype.gb;
84
- uR.prototype.setVideoRendition=uR.prototype.Ya;uR.prototype.setTextTrack=uR.prototype.La;uR.prototype.setAudioTrack=uR.prototype.za;uR.prototype.setVideoTrack=uR.prototype.ib;uR.prototype.getTextTrack=uR.prototype.ua;uR.prototype.getAudioTrack=uR.prototype.ja;uR.prototype.getVideoTrack=uR.prototype.Ia;uR.prototype.getLoadingTextRendition=uR.prototype.nb;uR.prototype.getLoadingAudioRendition=uR.prototype.mb;uR.prototype.getLoadingVideoRendition=uR.prototype.bb;uR.prototype.getTextRendition=uR.prototype.Ha;
85
- uR.prototype.getAudioRendition=uR.prototype.Qa;uR.prototype.getVideoRendition=uR.prototype.ka;uR.prototype.getTextTracks=uR.prototype.fa;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.rl.bind(this));d.setMediaPlaybackInfoHandler(this.ei.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,bn: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():_.Io};
92
- _.r.getStats=function(){var a=_.Do();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 _.Co;b.a.j=b.f.a;b.A=_.Zo(a);_.Cl(a)&&(b.h=_.Bl(b.w,a));if(b.C)return b.C=!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.rl=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.ei=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,_.eq(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.E(function(c){return b.m&&b.m.getState()!==_.Ho?_.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.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(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.Pd=function(a){this.j=a};_.r.lm=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===_.qe&&this.h.add(a)};
102
- _.r.removeMessageListener=function(a){typeof a===_.qe&&this.h["delete"](a)};_.r.sendMessage=function(a,b){HR().sendCustomMessage(mQ,b,qQ(a))};_.r.pc=function(){return this.a};_.r.lb=function(){var a=HR().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
103
- _.r.Kk=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(_.ka),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(_.re)||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(_.ka).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.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=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.C=!0;return _.x(l,_.kq(b.m,d),8);case 8:return _.x(l,_.lq(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.ol=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.Ak;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))}_.hq(this.m)}};
109
- _.r.xi=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.lb;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.lm;
110
- ER.prototype.setPlayerConfigInterceptor=ER.prototype.Pd;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.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(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.El=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,_.uc):(MR(this,_.yc),MR(this,_.Ic),MR(this,_.vc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(MR(this,_.yc),MR(this,_.Ic)),MR(this,_.Hc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?MR(this,_.Dc):MR(this,_.Fc))}};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;_.np(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;_.np(new OR);};
61
+ (g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.id?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Hf:b.f.getPresentationStartTime(),Lb:m,audioMimeType:p,Ya:g}}c=g;return _.x(f,CR(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,yR(b.a,c),7);case 7:_.bh(f,0);break;case 2:d=_.C(f),
62
+ b.g.error("Error while trying to cast",d),e=new _.L(_.pe,{detail:d}),b.trigger(e),_.y(f)}})};_.r.cf=function(){this.a&&this.a.cf()};_.r.si=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,dR(b.a),2):c.F(2)}b.a=AR(b);_.y(c)})};_.r.sendMessage=function(a){var b=this;return _.E(function(c){return b.a?_.x(c,b.a.sendMessage(JQ,a),0):(b.g.warn(FQ),c["return"]())})};_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(FQ)};
63
+ _.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(FQ)};_.r.lb=function(){return this.a&&this.a.lb()};_.r.uc=function(a){this.a&&this.a.uc(a)};_.r.Ve=function(){this.a&&this.a.Ve()};_.r.Mf=function(a){this.a&&this.a.Mf(a)};_.r.Kf=function(a){this.a&&this.a.Kf(a)};_.r.Jf=function(a){this.a&&this.a.Jf(a)};_.r.Lf=function(a){this.a&&this.a.Lf(a)};_.I(GQ,BR);BR.prototype.setContentReleaseDate=BR.prototype.Lf;BR.prototype.setContentArtist=BR.prototype.Jf;
64
+ BR.prototype.setContentImage=BR.prototype.Kf;BR.prototype.setContentTitle=BR.prototype.Mf;BR.prototype.clearContentMetadata=BR.prototype.Ve;BR.prototype.setContentMetadata=BR.prototype.uc;BR.prototype.getContentMetadata=BR.prototype.lb;BR.prototype.removeMessageListener=BR.prototype.removeMessageListener;BR.prototype.addMessageListener=BR.prototype.addMessageListener;BR.prototype.sendMessage=BR.prototype.sendMessage;BR.prototype.changeReceiverId=BR.prototype.si;BR.prototype.forceDisconnect=BR.prototype.cf;
65
+ BR.prototype.cast=BR.prototype.cast;BR.prototype.setPlayerConfigInterceptor=BR.prototype.Qd;BR.prototype.getReceiverName=BR.prototype.gf;BR.prototype.isCasting=BR.prototype.qb;BR.prototype.canCast=BR.prototype.Se;BR.prototype.destroy=BR.prototype.destroy;_.w(DR,MQ);_.r=DR.prototype;
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.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.D);b.addEventListener(a.BITRATE_CHANGED,this.a)};
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.L);c.removeEventListener(b.PLAYER_LOADING,a.G);c.removeEventListener(b.ERROR,
68
+ a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,MQ.prototype.destroy.call(a),0)})};_.r.Ci=function(){this.player.trigger(new _.L(_.jf));this.sa(_.ip)};_.r.Bi=function(){this.sa(_.hp)};_.r.nl=function(){this.sa(_.bp)};_.r.gl=function(a){a.isBuffering?this.sa(_.$o):(a=this.player.isPaused()?_.hp:_.ip,this.sa(a))};_.r.Ei=function(){this.h=1;this.player.trigger(new _.L(_.pg))};_.r.Di=function(){this.player.trigger(new _.L(_.og))};_.r.Dl=function(){this.h=2};_.r.ql=function(){this.sa(_.gp)};
69
+ _.r.Ai=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.hd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.T=function(a){a=new _.P(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.pe,{detail:a}));this.sa(_.fp)};_.r=ER.prototype;_.r.yb=function(){return"Google Cast Framework"};_.r.zb=function(){return cast.framework.VERSION};_.r.Fb=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.pc=function(){return!1};_.r.Rb=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.Cb=function(){return 0};_.r.Bb=function(){return 0};_.r.ob=function(){return 0};_.r.eb=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.Eb=function(){return this.l};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};ER.prototype.getWrapperCreativeIds=ER.prototype.getWrapperCreativeIds;ER.prototype.getWrapperAdSystems=ER.prototype.getWrapperAdSystems;ER.prototype.getWrapperAdIds=ER.prototype.getWrapperAdIds;ER.prototype.getSequenceLength=ER.prototype.Eb;ER.prototype.getPositionInSequence=ER.prototype.Tb;ER.prototype.getPodTimeOffset=ER.prototype.Sb;
72
+ ER.prototype.getPodIndex=ER.prototype.getPodIndex;ER.prototype.getPodType=ER.prototype.eb;ER.prototype.getMediaBitrate=ER.prototype.ob;ER.prototype.getMediaHeight=ER.prototype.Bb;ER.prototype.getMediaWidth=ER.prototype.Cb;ER.prototype.getMediaUrl=ER.prototype.getMediaUrl;ER.prototype.getClickThroughUrl=ER.prototype.Rb;ER.prototype.isBumper=ER.prototype.pc;ER.prototype.getSkipTimeOffset=ER.prototype.getSkipTimeOffset;ER.prototype.getDuration=ER.prototype.getDuration;ER.prototype.getTitle=ER.prototype.getTitle;
73
+ ER.prototype.getAdvertiserName=ER.prototype.getAdvertiserName;ER.prototype.getAdSystem=ER.prototype.getAdSystem;ER.prototype.getApiFramework=ER.prototype.getApiFramework;ER.prototype.getCreativeId=ER.prototype.getCreativeId;ER.prototype.getId=ER.prototype.getId;ER.prototype.getTechnology=ER.prototype.Fb;ER.prototype.getAdManagerVersion=ER.prototype.zb;ER.prototype.getAdManagerName=ER.prototype.yb;FR.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};FR.prototype.Vb=function(){return!!this.a.find(function(a){return 0===a.position})};FR.prototype.pb=function(){return!!this.a.find(function(a){return-1===a.position})};FR.prototype.hasPostroll=FR.prototype.pb;FR.prototype.hasPreroll=FR.prototype.Vb;FR.prototype.getCuePoints=FR.prototype.getCuePoints;_.r=HR.prototype;_.r.load=function(){var a=this;return _.E(function(b){IR&&(IR=!1,NR(a,0));_.y(b)})};_.r.start=function(){return _.E(function(a){GR().play();_.y(a)})};_.r.resume=function(){-1!==this.getPosition()&&GR().play()};_.r.pause=function(){-1!==this.getPosition()&&GR().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){GR().removeEventListener(a.f,a.h);_.y(b)})};
75
+ _.r.Fi=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=GR().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Lc,{adsTimeline:new FR(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:MR(this,_.Bc,a);break;case cast.framework.events.EventType.BREAK_STARTED:MR(this,_.uc,a);break;case cast.framework.events.EventType.BREAK_ENDED:MR(this,_.vc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:MR(this,
76
+ _.Hc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(MR(this,_.Gc,a),MR(this,_.Ic,a)):a.endedReason===b.STOPPED?MR(this,_.Ic,a):a.endedReason===b.END_OF_STREAM?(MR(this,_.yc,a),MR(this,_.Ic,a)):a.endedReason===b.ERROR&&NR(this,1);break;case cast.framework.events.EventType.PLAYING:MR(this,_.Fc,a);break;case cast.framework.events.EventType.PAUSE:MR(this,_.Dc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?MR(this,_.wc,a):MR(this,_.Fc,a)}};
77
+ HR.prototype.getPosition=HR.prototype.getPosition;HR.prototype.setVolume=HR.prototype.setVolume;HR.prototype.getVolume=HR.prototype.getVolume;HR.prototype.skip=HR.prototype.skip;HR.prototype.pause=HR.prototype.pause;HR.prototype.resume=HR.prototype.resume;var IR=!1;OR.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(PR(),this.a)};OR.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(PR(),this.a)};OR.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return QR(a)})};
78
+ OR.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.dc(new _.L(b,{detail:QR(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.dc(new _.L(_.Ph,{detail:b.value}))};_.w(RR,_.U);_.r=RR.prototype;_.r.initialize=function(a){this.m=a;SR().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;SR().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.ea=function(){return this.j};_.r.ka=function(){return null};
79
+ _.r.Pa=function(){var a=this.ja();return a&&a.renditions[0]};_.r.Ha=function(){var a=this.ua();return a&&a.renditions[0]};_.r.cb=function(){return null};_.r.mb=function(){return null};_.r.nb=function(){return null};_.r.Ia=function(){return null};_.r.ja=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
+ _.r.ua=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ea().find(function(c){return c.id===b})||null)}return a};_.r.jb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.za=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.La=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.Za=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.hb=function(a){this.za(a&&a.track)};
81
+ _.r.ib=function(a){this.La(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,PQ(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]),UR(b)}catch(g){throw b.g.warn("failed on track",
83
+ a),g;}}_.y(f)})};_.r.ma=function(){return!0};_.r.Xl=function(){this.f=SR().getAudioTracksManager();var a=this.f.getTracks();this.h=TR(_.Tj,a);UR(this);a=this.m.getConfiguration();VR(this,_.Tj,a.preferredAudioLanguage,a.preferredAudioRole);VR(this,_.T,a.preferredTextLanguage,a.preferredTextRole)};RR.prototype.isAbrEnabled=RR.prototype.ma;RR.prototype.addTextTrack=RR.prototype.addTextTrack;RR.prototype.setTextRendition=RR.prototype.ib;RR.prototype.setAudioRendition=RR.prototype.hb;
84
+ RR.prototype.setVideoRendition=RR.prototype.Za;RR.prototype.setTextTrack=RR.prototype.La;RR.prototype.setAudioTrack=RR.prototype.za;RR.prototype.setVideoTrack=RR.prototype.jb;RR.prototype.getTextTrack=RR.prototype.ua;RR.prototype.getAudioTrack=RR.prototype.ja;RR.prototype.getVideoTrack=RR.prototype.Ia;RR.prototype.getLoadingTextRendition=RR.prototype.nb;RR.prototype.getLoadingAudioRendition=RR.prototype.mb;RR.prototype.getLoadingVideoRendition=RR.prototype.cb;RR.prototype.getTextRendition=RR.prototype.Ha;
85
+ RR.prototype.getAudioRendition=RR.prototype.Pa;RR.prototype.getVideoRendition=RR.prototype.ka;RR.prototype.getTextTracks=RR.prototype.ea;RR.prototype.getAudioTracks=RR.prototype.getAudioTracks;RR.prototype.getVideoTracks=RR.prototype.getVideoTracks;_.w(WR,_.Fl);_.r=WR.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=YR();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.sl.bind(this));d.setMediaPlaybackInfoHandler(this.gi.bind(this));this.a=new DR(this);this.a.init();this.j=new RR;this.j.initialize(this);this.o=new OR(function(e){return c.trigger(e)});this.o.init()};
86
+ _.r.unload=function(){var a=cast.framework.messages.PlayerState,b=YR();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=_.Ll(),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=YR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.r.pause=function(){var a=YR();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.r.isPaused=function(){return YR().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
88
+ _.r.isEnded=function(){return YR().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=YR();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(zQ);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return YR().getCurrentTimeSec()};_.r.getDuration=function(){var a=YR().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return YR().getPlaybackRate()};
89
+ _.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;YR().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=YR().getMediaInformation();if(a){var b=YR().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,cn:b,name:c}}return null};_.r.getDrmInfo=function(){return null};
91
+ _.r.getPresentationStartTime=function(){return YR().getStartAbsoluteTime()};_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=YR().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():_.Wo};
92
+ _.r.getStats=function(){var a=_.Ro();if(this.f){a=YR().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 _.Qo;b.a.j=b.f.a;b.A=_.mp(a);b.h=_.Nl(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:NQ(b.h),local:!0};return _.x(e,YR().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.ua);return new _.El};
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 HQ};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.resetAbr=function(){this.g.warn(DQ)};
95
+ _.r.onError=function(a){this.trigger(new _.L(_.pe,{detail:a}))};_.r.canPlay=function(){return _.Mk()?2:0};
96
+ _.r.sl=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=NQ(this.getStats());var b=YR(),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=YR().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.gi=function(a,b){var c=null;a.media.customData&&(c=OQ(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;aS(c,b);return b};
98
+ _.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};WR.prototype.getTextDisplayer=WR.prototype.getTextDisplayer;WR.prototype.getNetworkEngine=WR.prototype.getNetworkEngine;WR.prototype.setNetworkEngine=WR.prototype.setNetworkEngine;_.r=bS.prototype;_.r.init=function(a){var b=this;a&&(this.f=new WR,_.sq(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.E(function(c){return b.m&&b.m.getState()!==_.Vo?_.x(c,LQ(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=eS(),b=eS().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[JQ]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Lk.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.Jk.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(JQ,this.w)}};
101
+ _.r.stop=function(){if(this.a){this.a=!1;this.o.release();var a=eS();eS().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(JQ,this.w);a.stop();this.m=this.f=null}};_.r.Qd=function(a){this.j=a};_.r.mm=function(a){this.l=a};_.r.on=function(a,b){eS().addEventListener(a,b)};_.r.off=function(a,b){eS().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.se&&this.h.add(a)};
102
+ _.r.removeMessageListener=function(a){typeof a===_.se&&this.h["delete"](a)};_.r.sendMessage=function(a,b){eS().sendCustomMessage(JQ,b,NQ(a))};_.r.nc=function(){return this.a};_.r.lb=function(){var a=eS().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
103
+ _.r.Lk=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return gS(this,a);try{var b=(new DOMParser).parseFromString(a,_.eg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=eS();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===_.tg||g===_.$c){g=e[f].getAttribute(_.Pe);for(var h=e[f].getElementsByTagName(_.Rb),l=
104
+ h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Pe)||g,n=h[l].getAttribute(_.Kd),p=h[l].getAttribute(_.Ig)||void 0,q=h[l].getAttribute(_.te)||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=eS();c=a.getElementsByTagName("StreamIndex");
105
+ for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.tg){e=c[d].getElementsByTagName(_.Ob);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.wb)||void 0,h=e[f].getAttribute(_.vb)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.vg,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.Jk=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=OQ(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,KR(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,_.zq(b.m,d),8);case 8:return _.x(l,_.Aq(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Lb&&(c.media.hlsVideoSegmentFormat=QQ(f.Lb,_.Uj)),f.audioMimeType&&(c.media.hlsSegmentFormat=QQ(f.audioMimeType,_.Tj));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.pl=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.O.Bk;var b=eS().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))}_.wq(this.m)}};
109
+ _.r.zi=function(a){if(0<this.h.size){var b=OQ(a.data);this.h.forEach(function(c){return c(b)})}};_.I(IQ,bS);bS.prototype.getContentMetadata=bS.prototype.lb;bS.prototype.isApiReady=bS.prototype.nc;bS.prototype.sendMessage=bS.prototype.sendMessage;bS.prototype.removeMessageListener=bS.prototype.removeMessageListener;bS.prototype.addMessageListener=bS.prototype.addMessageListener;bS.prototype.off=bS.prototype.off;bS.prototype.on=bS.prototype.on;bS.prototype.setLoadRequestDataInterceptor=bS.prototype.mm;
110
+ bS.prototype.setPlayerConfigInterceptor=bS.prototype.Qd;bS.prototype.stop=bS.prototype.stop;bS.prototype.start=bS.prototype.start;bS.prototype.init=bS.prototype.init;bS.getInstance=dS;var cS=null;_.r=hS.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.Fl.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(KQ,{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.Fl=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Lc,{adsTimeline:new FR(a.breaks)})));break;case "isPlayingBreak":a.value?jS(this,_.uc):(jS(this,_.yc),jS(this,_.Ic),jS(this,_.vc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(jS(this,_.yc),jS(this,_.Ic)),jS(this,_.Hc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?jS(this,_.Dc):jS(this,_.Fc))}};hS.prototype.getPosition=hS.prototype.getPosition;
113
+ hS.prototype.setVolume=hS.prototype.setVolume;hS.prototype.getVolume=hS.prototype.getVolume;hS.prototype.skip=hS.prototype.skip;hS.prototype.pause=hS.prototype.pause;hS.prototype.resume=hS.prototype.resume;kS.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};kS.prototype.isSupported=function(a,b){return a.namespace()!==_.Dd?!1:!(!b||!b.ima)};kS.prototype.create=function(a){return new hS(a.a)};kS.prototype.create=kS.prototype.create;kS.prototype.isSupported=kS.prototype.isSupported;kS.prototype.name=kS.prototype.name;_.Cp(new kS);lS.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};lS.prototype.isSupported=function(a,b){return dS().nc()?!(!b||!b.ima):!1};lS.prototype.create=function(a){return new HR(a)};lS.prototype.create=lS.prototype.create;lS.prototype.isSupported=lS.prototype.isSupported;lS.prototype.name=lS.prototype.name;_.Cp(new lS);};
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));}