@castlabs/prestoplay 6.28.0 → 6.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +37 -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 +128 -116
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +619 -614
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +92 -89
  10. package/cjs/cl.externs.js +154 -60
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +77 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +25 -23
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +350 -349
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -4
  20. package/cjs/cl.persistent.js +15 -15
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +57 -58
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +60 -60
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +38 -38
  33. package/cjs/polyfill.min.js +2 -2
  34. package/cl.adobe.js +3 -3
  35. package/cl.airplay.js +3 -3
  36. package/cl.broadpeak.js +6 -6
  37. package/cl.cast.js +101 -92
  38. package/cl.conviva.js +27 -27
  39. package/cl.core.js +500 -496
  40. package/cl.crypto.js +9 -9
  41. package/cl.dash.js +84 -83
  42. package/cl.externs.js +150 -60
  43. package/cl.freewheel.js +19 -19
  44. package/cl.hls.js +82 -80
  45. package/cl.hlssmpte.js +5 -5
  46. package/cl.htmlcue.js +26 -26
  47. package/cl.ima.js +19 -17
  48. package/cl.mediatailor.js +2 -2
  49. package/cl.mse.js +304 -305
  50. package/cl.muxdata.js +13 -13
  51. package/cl.onboard.js +4 -4
  52. package/cl.persistent.js +11 -11
  53. package/cl.playlist.js +5 -5
  54. package/cl.simid.js +14 -14
  55. package/cl.smooth.js +60 -60
  56. package/cl.thumbnails.js +19 -19
  57. package/cl.tizen.js +56 -56
  58. package/cl.ttml.js +22 -22
  59. package/cl.verimatrix.js +4 -4
  60. package/cl.vimond.js +8 -8
  61. package/cl.vr.js +14 -14
  62. package/cl.vtt.js +12 -12
  63. package/cl.yospace.js +3 -3
  64. package/cl.youbora.js +31 -31
  65. package/package.json +1 -1
  66. package/typings.d.ts +198 -88
package/cjs/cl.cast.js CHANGED
@@ -1,122 +1,134 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var DV="Cannot seek during ads playout.",EV="Cannot switch track",FV="Media session does not exist.",GV="No receivers available",HV="Reset ABR functionality not available on cast.",IV="SDK not yet ready",JV="Sender is destroyed.",KV="clpp.cast.CastProxy",LV="clpp.cast.Player",MV="clpp.cast.Receiver",NV="urn:x-cast:castlabs",OV="urn:x-cast:com.google.cast.media",PV=function(a){return _.I(function(b){return 1==b.a?_.x(b,a.Qc(_.Xe),2):_.x(b,a.Qc(_.We),0)})},QV=function(a,b){this.log=new _.L(b);this.player=
3
- a;this.j=null;this.f=_.Wt;this.l=7;this.h=2;this.B=Date.now();this.A=-1},RV=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.ne){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Se?"detail"===e&&(d[e]=f):e in Event||(d[e]=f)}return d}return typeof c===_.k?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},SV=function(a){if(typeof a!==_.gg)return a;try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===
4
- c?Infinity:c})}catch(b){return a}},TV=function(a,b){var c=new Set(b);return Object.keys(a).reduce(function(d,e){c.has(e)&&(d[e]=a[e]);return d},{})},UV=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.I(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=_.mt(d,a.mimeType,g);if(!f||!g)return q.C(2);l=_.Mk(a.url);return _.x(q,c.fetch(l).T,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Mi(m.data)),p=URL.createObjectURL(new Blob([n])),e={url:p,kind:a.kind,
5
- language:a.language,label:a.label,mimeType:g});return q["return"](e)})},VV=function(a,b){if(window.chrome&&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 _.Og:return d.FMP4;case _.Ng:return b===_.Ts?d.MPEG2_TS:c.TS;case _.Oc:return c.AAC;case _.Pc:return c.AC3;
6
- case _.Qc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Rc:return c.FMP4}},XV=function(a){a=void 0===a?WV:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.N(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;
7
- default:return new d}},YV=function(){return Math.round(1E3*Math.random())},ZV=function(a){QV.call(this,a,"clpp.cast.SenderStateManager");this.o=this.a=null;this.w=this.dc.bind(this)},$V=function(){this.g=new _.L("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},aW=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},cW=function(a,b){var c=aW(a);return bW(a,b).find(function(d){return c.includes(d.id)})||null},bW=function(a,b){return a.h.filter(function(c){return c.type===
8
- b})},eW=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.Ss){var e=a.va();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;dW(a,b)},function(f){a.f[b]=null;a.g.debug(EV,f)})}else b===_.Ss&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){dW(a,b)},function(f){a.g.debug(EV,f)}))},dW=function(a,b){b===_.X?a.a.trigger(new _.Q(_.Uc)):b===_.Ss&&a.a.trigger(new _.Q(_.pg))},iW=function(a,
9
- b,c,d){_.yi.call(this);this.g=new _.L(_.qd);this.da=a;this.o=new _.dj(b);this.Z=c;this.ja=d;this.h=this.J=_.Dn();this.F=[];this.B=0;this.L=new _.Om;this.G=this.l=this.a=null;this.A=this.w=!1;this.ka="";this.Ia=1E6;this.f=new $V;this.f.initialize(this);this.j=new ZV(this);this.H=new _.ti;this.K=null;this.I=new Set;this.P=this.dn.bind(this);this.ya=this.zn.bind(this);this.fa=this.qn.bind(this);this.U=this.hn.bind(this);this.O=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},
10
- set:function(e){window.cast_=e;window.setTimeout(function(){fW(!0)},0)}});gW(this);hW.add(this)},jW=function(a){var b,c;return _.I(function(d){if(1==d.a)return hW["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya)),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),
11
- 2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.Z=null;a.ja=null;_.z(d)})},lW=function(a){if(!a)return null;a:{var b=a.metadataType;var c=Object.entries(kW);c=_.v(c);for(var d=c.next();!d.done;d=c.next()){d=_.v(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=XV(kW[b]);return Object.assign(b,a)},mW=function(a){var b=void 0===b?WV:b;return Object.values(kW).includes(a)?a:b},qW=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},gW=function(a){if(!a.w&&
12
- window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.da.length){a.w=!0;a.o.Tg();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.da;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya);vW&&a.o.ha(.02)}},
13
- AW=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.k?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},CW=function(a,b){BW(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.fa);b.addMessageListener(NV,a.U)},BW=function(a,b){a.a=b;a.a&&(a.H.release(),a.G=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.G=new cast.framework.RemotePlayerController(a.l),a.H.on(a.G,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,
14
- a.ik.bind(a)),a.H.on(a.G,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.pn.bind(a)),a.j&&a.j.init(),a.trigger(new _.Q(_.Ee)))},DW=function(a){return _.I(function(b){return a.Qb()?b.C(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},EW=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,B,A,C;return _.I(function(E){switch(E.a){case 1:return c=chrome.cast.media.StreamType,d=_.uw,_.x(E,DW(a),2);case 2:if(!b)return E["return"]();e=cast.framework.CastContext.getInstance();
15
- 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.ic;m=h.hb;g.hlsVideoSegmentFormat=VV(l,d.VIDEO);g.hlsSegmentFormat=VV(m,d.AUDIO);if(!b.pb){E.C(3);break}if(!a.O){E.C(4);break}return _.x(E,Promise.resolve(a.O(b.pb)),5);case 5:if(n=E.f)b.pb=n;case 4:a.h=b.pb;a.F=_.Jn(a.h);a.B=a.F.findIndex(function(D){return D.url===b.source.url});if(!b.pb.remoteTextTracks){E.C(6);break}return _.x(E,Promise.all(b.pb.remoteTextTracks.map(a.ul.bind(a))),
16
- 7);case 7:p=E.f,g.tracks=p.filter(function(D){return D}),b.pb.remoteTextTracks=void 0;case 6:delete b.pb.autoplay,b.pb.startTime=null,g.customData={playerConfiguration:RV(b.pb)};case 3:q=a.Jb()||{};t=mW(q.metadataType);typeof b.Fg===_.k&&(u={metadataType:t,sectionStartAbsoluteTime:b.Fg});b.source.name&&(y={metadataType:t,title:b.source.name});B=qW(q);if(A=lW(Object.assign({},u,y,B)))g.metadata=A;C=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.Xc&&(C.autoplay=b.autoplay);typeof b.currentTime===
17
- _.k&&(C.currentTime=b.currentTime);return _.x(E,f.loadMedia(C),0)}})},FW=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.f.va())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.f.na())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.x(f,EW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Fg:a.getPresentationStartTime(),autoplay:b,pb:a.h}),0)})},fW=function(a){if(a){a=_.v(hW);for(var b=a.next();!b.done;b=a.next())gW(b.value)}},HW=function(a,
18
- b,c){_.yi.call(this);this.f=a;this.h=b;this.j=typeof c===_.ne?c:this.ko;this.a=GW(this);this.g=new _.L(KV);this.f&&this.forwardEventsTo(this.f)},GW=function(a){return new iW(a.h,function(){a.trigger(new _.Q(_.dd))},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.oh&&(d.preferredAudioLanguage=c.oh);c.wj&&(d.preferredTextLanguage=c.wj);_.Eo(a.f,null);a.trigger(new _.Q("castingended"));
19
- a.j(b,d)},function(){return IW(a)})},IW=function(a){var b;return _.I(function(c){if(1==c.a)return a.trigger(new _.Q(_.cd)),b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.Eo(a.f,a.a);_.z(c)})},JW=function(a){QV.call(this,a,"clpp.cast.StateManager");this.I=this.nk.bind(this);this.H=this.mk.bind(this);this.w=this.kn.bind(this);this.o=this.bn.bind(this);this.K=this.qk.bind(this);this.J=this.pk.bind(this);this.L=this.Cn.bind(this);this.G=this.nn.bind(this);this.F=this.lk.bind(this);this.a=
20
- this.kk.bind(this)},KW=function(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},LW=function(a){this.a=a},NW=function(a){this.m=a;this.a=null;this.h=this.rk.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,
21
- cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];MW().addEventListener(this.f,this.h)},QW=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.F(n,2);OW=!1;e=_.Mk(d);return _.x(n,c.fetch(e).T,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.ea(f.data),h=new DOMParser,l=h.parseFromString(g,_.og),l.getElementsByTagName("vmap:VMAP").length)_.Lh("VMAP detected."),a.vmapAdsRequest=
22
- PW(g);else if(l.getElementsByTagName("VAST").length){_.Lh("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=PW(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.Lh("Unsupported schema."),OW=!0;return _.G(n,0)}m=_.H(n);_.Lh("Failed to fetch an ad",m);OW=!0;_.z(n)})},PW=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},MW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},
23
- SW=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=RW(a,c))&&(d={ad:c});a.m.trigger(new _.Q(b,d))}},TW=function(a,b){var c=new _.N(1,10,10003,{errorType:b});a.m.onError(c)},RW=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.gg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.gg&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||
24
- null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new KW(d,e,b.index,b.total,f)}return c},UW=function(a){this.Za=a;this.a=this.f.bind(this)},VW=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]},WW=function(a){var b=
25
- a.dashTimedMetadata,c=_.Fg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Eg)?_.Uf:_.Cg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},XW=function(){this.g=new _.L("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.Vn.bind(this);this.a=this.f=null},YW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},$W=function(a){a.a=YW().getTextTracksManager();var b=a.a.getTracks();
26
- a.j=ZW(_.Ss,b)},aX=function(a,b,c,d){c=_.Di(c).filter(function(h){return h});var e=!1,f=[];b===_.X?f=a.getAudioTracks():b===_.Ss&&(f=a.oa());if(c=c.find(function(h){var l=_.jo(h);return f.some(function(m){m=_.jo(m.language||"");return _.ko(l,m)})})){var g=_.jo(c);c=f.filter(function(h){h=_.jo(h.language||"");return _.ko(g,h)});f=c.length?c:f;e=e||!!c.length}_.R.pf(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",
27
- e),b===_.X?a.Ga(e):b===_.Ss&&a.Ya(e))},ZW=function(a,b){for(var c=[],d=_.v(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Qs(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 _.Zs(f.id,f));c.push(f)}return c},bX=
28
- function(){_.yi.call(this);this.g=new _.L(LV);this.h=this.w=_.Dn();this.A=null;this.l=-1;this.G=new _.Om;this.f=this.o=this.j=this.a=this.B=null;this.F=!1},cX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},dX=function(a,b){var c=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:c})},gX=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=
29
- void 0}if(a&&a.drm){var d=a.drm,e=_.Pn(d);if(e){var f=[_.Dd];_.Jn(a)[0].type!==_.Lc&&f.unshift(_.Fd);d.preferredDrmSystem===_.Dd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Oa[g];h?(d=g===_.Fd?cast.framework.ContentProtection.WIDEVINE:g===_.Dd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},eX(b,h,a,d),fX(b,h,a,d)):c()}else c()}else c()},eX=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=
30
- function(e){var f=_.Mk({method:_.qb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},fX=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.Qk(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,
31
- g,d),2)):h["return"](_.Mi(g.data))})}:a.licenseHandler=void 0},hX=function(){this.a=!1;this.g=new _.L(MV);this.f=this.m=null;this.j=new Set;this.B=this.mn.bind(this);this.A=this.jk.bind(this);this.l=null;this.w=new _.ti;this.h=this.o=null},jX=function(){return iX||(iX=new hX)},kX=function(){return cast.framework.CastReceiverContext.getInstance()},lX=function(){var a=kX().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},mX=function(a,b){var c=kX().getPlayerManager().getMediaInformation();
32
- if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;kX().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},oX=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=kX();c=(kX().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Og:_.Ng;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();
33
- if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=nX(h,_.ta),m=nX(h,_.zb),n=_.v([]),p=n.next().value;n=n.next().value;m&&(m=_.v(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")},nX=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},pX=function(a){this.f=
34
- a;this.a=null;this.h=new _.ti;this.j=[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]},rX=function(a,b){var c=null,d=qX(a);d&&(c={ad:d});a.f.trigger(new _.Q(b,c))},qX=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===
35
- a.a.breakId})||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 KW(d,c,e,f,g)}return b},sX=function(){},tX=function(){};_.r=QV.prototype;_.r.release=function(){this.Aa(_.Wt)};_.r.destroy=function(){this.j=this.player=null;return Promise.resolve()};
36
- _.r.getState=function(){return this.f};_.r.onError=function(a){a.severity===_.O&&this.Aa(_.zo)};
37
- _.r.Aa=function(a){if(a!==this.f)if(this.f===_.zo&&a!==_.Wt)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;2===this.f?(this.A=b,this.player.trigger(new _.Q(_.Zc,{detail:{bufferedTimeMS:-1,reason:this.h}}))):2===this.l&&this.player.trigger(new _.Q(_.Yc,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.Pt(this.j,this.f);this.player.trigger(new _.Q(_.dg,
38
- {detail:a}))}};var uX;_.K("clpp.cast.CastUtils",function(){});var WV=0,kW={GENERIC:WV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},vX="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),wX="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");_.w(ZV,QV);ZV.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)};ZV.prototype.destroy=function(){var a=this;return _.I(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,QV.prototype.destroy.call(a),0)})};ZV.prototype.Aa=function(a){var b=this.player.l;b&&b.isPlayingBreak||QV.prototype.Aa.call(this,a)};
39
- ZV.prototype.dc=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.Aa(5);break;case chrome.cast.media.IdleReason.ERROR:this.Aa(_.zo);break;default:this.Aa(_.Wt)}break;case chrome.cast.media.PlayerState.PLAYING:this.Aa(3);break;case chrome.cast.media.PlayerState.PAUSED:this.Aa(4);break;case chrome.cast.media.PlayerState.BUFFERING:this.Aa(2)}};_.w($V,_.ot);_.r=$V.prototype;_.r.initialize=function(a){this.a=a};_.r.release=function(){this.h=[];this.f={}};
40
- _.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=_.Ts;break;case chrome.cast.media.TrackType.AUDIO:c=_.X;break;case chrome.cast.media.TrackType.TEXT:c=_.Ss}c=new _.Qs(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);
41
- c.renditions.push(new _.Zs(c.id,c));return c}):[],this.a.trigger(new _.Q(_.vg)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return bW(this,_.Ts)};_.r.getAudioTracks=function(){return bW(this,_.X)};_.r.oa=function(){return bW(this,_.Ss)};_.r.pa=function(){var a=this.La();return a?a.renditions[0]:null};_.r.Sa=function(){var a=this.na();return a?a.renditions[0]:null};_.r.Xa=function(){var a=this.va();return a?a.renditions[0]:null};_.r.yb=function(){return this.f[_.Ts]||null};
42
- _.r.Kb=function(){return this.f[_.X]||null};_.r.Lb=function(){return this.f[_.Ss]||null};_.r.La=function(){return cW(this,_.Ts)};_.r.na=function(){return cW(this,_.X)};_.r.va=function(){return cW(this,_.Ss)};_.r.Gb=function(a){eW(this,_.Ts,a)};_.r.Ga=function(a){eW(this,_.X,a)};_.r.Ya=function(a){eW(this,_.Ss,a)};_.r.qb=function(a){this.Gb(a&&a.track)};_.r.Eb=function(a){this.Ga(a&&a.track)};_.r.Fb=function(a){this.Ya(a&&a.track)};_.r.addTextTrack=function(){return _.I(function(a){_.z(a)})};
43
- _.r.wa=function(){return!0};$V.prototype.isAbrEnabled=$V.prototype.wa;$V.prototype.addTextTrack=$V.prototype.addTextTrack;$V.prototype.setTextRendition=$V.prototype.Fb;$V.prototype.setAudioRendition=$V.prototype.Eb;$V.prototype.setVideoRendition=$V.prototype.qb;$V.prototype.setTextTrack=$V.prototype.Ya;$V.prototype.setAudioTrack=$V.prototype.Ga;$V.prototype.setVideoTrack=$V.prototype.Gb;$V.prototype.getTextTrack=$V.prototype.va;$V.prototype.getAudioTrack=$V.prototype.na;
44
- $V.prototype.getVideoTrack=$V.prototype.La;$V.prototype.getLoadingTextRendition=$V.prototype.Lb;$V.prototype.getLoadingAudioRendition=$V.prototype.Kb;$V.prototype.getLoadingVideoRendition=$V.prototype.yb;$V.prototype.getTextRendition=$V.prototype.Xa;$V.prototype.getAudioRendition=$V.prototype.Sa;$V.prototype.getVideoRendition=$V.prototype.pa;$V.prototype.getTextTracks=$V.prototype.oa;$V.prototype.getAudioTracks=$V.prototype.getAudioTracks;$V.prototype.getVideoTracks=$V.prototype.getVideoTracks;_.w(iW,_.yi);_.r=iW.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.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.mb)};_.r.appendLoad=function(){return Promise.reject(_.mb)};_.r.seekWith=function(){return Promise.reject(_.mb)};
45
- _.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.I(function(a){_.z(a)})};_.r.ze=function(a){this.O=a};_.r.Kc=function(){return this.w};_.r.Qb=function(){return this.A};_.r.lg=function(){return this.ka};
46
- _.r.sendMessage=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.N(1,8,8004,void 0);g.C(2);break}_.F(g,3);return _.x(g,e.sendMessage(a,RV(b)),5);case 5:_.G(g,2);break;case 3:f=_.H(g),d=new _.N(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.z(g)}})};
47
- _.r.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Kc())throw a.g.warn(IV),new _.N(1,8,8001,void 0);if(!vW)throw a.g.warn(GV),new _.N(1,8,8002,void 0);if(a.Qb())throw a.g.warn("Already casting"),new _.N(1,8,8003,void 0);_.F(d,2);return _.x(d,DW(a),4)}if(2!=d.a)return _.G(d,0);b=_.H(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.N(1,8,8E3,c);})};_.r.kg=function(){this.Qb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
48
- _.r.addMessageListener=function(a){typeof a===_.ne&&this.I.add(a)};_.r.removeMessageListener=function(a){typeof a===_.ne&&this.I["delete"](a)};_.r.play=function(){var a=this;return this.isEnded()?FW(this,!0):new Promise(function(b,c){if(!a.a)return c(FV);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(FV);a.a.pause(null,b,c)})};_.r.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
49
- _.r.isEnded=function(){return 5===this.getState()};_.r.seek=function(a){var b=this;return this.isEnded()?FW(this,!1,a):new Promise(function(c,d){b.a||d(FV);b.l.isPlayingBreak&&d(DV);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.Q(_.Hg));b.a.seek(e,function(){b.trigger(new _.Q(_.Gg));c()},d)})};_.r.getPosition=function(){return this.getMediaPosition()};_.r.getMediaPosition=function(){return this.a&&this.a.getEstimatedTime()||0};_.r.getDuration=function(){return this.getMediaDuration()};
50
- _.r.getMediaDuration=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(OV,{type:"SET_PLAYBACK_RATE",requestId:YV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
51
- _.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))};
52
- _.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():7};
53
- _.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?SV(this.a.customData.stats):_.Vt()};_.r.isLive=function(){return Infinity===this.getDuration()};_.r.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Kc())return b.g.warn(IV),e["return"]();if(!vW)return b.g.warn(GV),e["return"]();b.F=_.Jn(a);b.h=_.Fn([b.J,a]);c=b.F[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,pb:b.h,ic:c.ic,hb:c.hb};return _.x(e,EW(b,d),0)})};_.r.getBufferInfo=function(){return new _.bi};
54
- _.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.setCmsdManager=function(){};_.r.getLoadedSource=function(){return this.F[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};_.r.getTimelineCues=function(){return[]};
55
- _.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(HV)};_.r.onError=function(a){if(a&&(this.trigger(new _.Q(_.je,{detail:a})),this.j))this.j.onError(a)};_.r.namespace=function(){return _.qd};_.r.canPlay=function(){return this.Kc()?2:0};_.r.Jb=function(){return this.K};_.r.gc=function(a){this.K=lW(a)};_.r.cg=function(){this.K=null};_.r.Ng=function(a){var b=this.Jb()||{};a={metadataType:mW(b.metadataType),title:a};this.gc(Object.assign({},b,a))};
56
- _.r.Lg=function(a){var b=this.Jb()||{},c=mW(b.metadataType);a=new chrome.cast.Image(a);this.gc(Object.assign({},b,{metadataType:c,images:[a]}))};_.r.Kg=function(a){var b=this.Jb()||{};this.gc(Object.assign({},b,{metadataType:3,artist:a}))};_.r.Mg=function(a){var b=this.Jb()||{};a={metadataType:mW(b.metadataType),releaseDate:a};this.gc(Object.assign({},b,a))};
57
- _.r.dn=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;vW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ka=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Tg()};
58
- _.r.zn=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;CW(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Qb()||(this.A=!0,CW(this,a.session),this.ja());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Qb()&&this.a){var b=this.a.media,c=this.f.na(),d=this.f.va();c=c&&c.language||void 0;d=d&&d.language||void 0;this.Z(this.getState(),{source:{url:b.contentId,type:b.contentType,
59
- isLive:this.isLive()},currentTime:AW(this),wj:d,oh:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.fa);a.session.removeMessageListener(NV,this.U);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}};_.r.qn=function(a){this.g.debug("New media session",a.mediaSession);BW(this,a.mediaSession)};_.r.pn=function(a){a.value&&a.value.tracks&&this.f&&this.f.load()};_.r.hn=function(a,b){if(a===NV&&0<this.I.size){var c=SV(b);this.I.forEach(function(d){return d(c)})}};
60
- _.r.ik=function(){this.trigger(new _.Q(_.ug))};_.r.ul=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.x(e,UV(a,[_.ng,_.Kc],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ia++,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};var vW=!1,hW=new Set;
61
- window.__onGCastApiAvailable=fW;_.w(HW,_.yi);_.r=HW.prototype;_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.x(b,jW(a.a),3):b.C(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.z(b)})};_.r.ko=function(a,b){this.f&&5!==a&&a!==_.Wt&&(delete b.license,this.f.load(b))};_.r.$f=function(){return!!this.a&&this.a.Kc()&&vW};_.r.Qb=function(){return!!this.a&&this.a.Qb()};_.r.lg=function(){return this.a?this.a.lg():""};_.r.ze=function(a){this.a&&this.a.ze(a)};
62
- _.r.cast=function(a){var b=this,c,d,e;return _.I(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.F(f,2);return _.x(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.na();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.va())l.language&&
63
- (g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.Xc?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Fg:b.f.getPresentationStartTime(),ic:m,hb:p,pb:g}}c=g;return _.x(f,IW(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.C(7);break}return _.x(f,EW(b.a,c),7);case 7:_.G(f,0);break;case 2:d=_.H(f),b.g.error("Error while trying to cast",
64
- d),e=new _.Q(_.je,{detail:d}),b.trigger(e),_.z(f)}})};_.r.kg=function(){this.a&&this.a.kg()};_.r.ck=function(a){var b=this;return _.I(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,jW(b.a),2):c.C(2)}b.a=GW(b);_.z(c)})};_.r.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.x(c,b.a.sendMessage(NV,a),0):(b.g.warn(JV),c["return"]())})};
65
- _.r.ao=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage(OV,{type:"QUEUE_NEXT",requestId:YV(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.bo=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage(OV,{type:"QUEUE_PREV",requestId:YV(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.$n=function(a){var b=this;return _.I(function(c){return _.x(c,b.a.sendMessage(OV,{type:"QUEUE_INSERT",requestId:YV(),mediaSessionId:b.a.a.mediaSessionId,items:a}),0)})};
66
- _.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(JV)};_.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(JV)};_.r.Jb=function(){return this.a&&this.a.Jb()};_.r.gc=function(a){this.a&&this.a.gc(a)};_.r.cg=function(){this.a&&this.a.cg()};_.r.Ng=function(a){this.a&&this.a.Ng(a)};_.r.Lg=function(a){this.a&&this.a.Lg(a)};_.r.Kg=function(a){this.a&&this.a.Kg(a)};_.r.Mg=function(a){this.a&&this.a.Mg(a)};_.K(KV,HW);
67
- HW.prototype.setContentReleaseDate=HW.prototype.Mg;HW.prototype.setContentArtist=HW.prototype.Kg;HW.prototype.setContentImage=HW.prototype.Lg;HW.prototype.setContentTitle=HW.prototype.Ng;HW.prototype.clearContentMetadata=HW.prototype.cg;HW.prototype.setContentMetadata=HW.prototype.gc;HW.prototype.getContentMetadata=HW.prototype.Jb;HW.prototype.removeMessageListener=HW.prototype.removeMessageListener;HW.prototype.addMessageListener=HW.prototype.addMessageListener;HW.prototype.queueAddItems=HW.prototype.$n;
68
- HW.prototype.queuePreviousItem=HW.prototype.bo;HW.prototype.queueNextItem=HW.prototype.ao;HW.prototype.sendMessage=HW.prototype.sendMessage;HW.prototype.changeReceiverId=HW.prototype.ck;HW.prototype.forceDisconnect=HW.prototype.kg;HW.prototype.cast=HW.prototype.cast;HW.prototype.setPlayerConfigInterceptor=HW.prototype.ze;HW.prototype.getReceiverName=HW.prototype.lg;HW.prototype.isCasting=HW.prototype.Qb;HW.prototype.canCast=HW.prototype.$f;HW.prototype.destroy=HW.prototype.destroy;_.w(JW,QV);_.r=JW.prototype;
2
+ var f=function(window){var qV="Cannot seek during ads playout.",rV="Cannot switch track",sV="Media session does not exist.",tV="No receivers available",uV="QUEUE_ITEM_CHANGED",vV="Reset ABR functionality not available on cast.",wV="SDK not yet ready",xV="Sender is destroyed.",yV="clpp.cast.CastProxy",zV="clpp.cast.Player",AV="clpp.cast.Receiver",BV="urn:x-cast:castlabs",CV="urn:x-cast:castlabs:int",DV="urn:x-cast:com.google.cast.media",EV="volume control is not supported",FV=function(a){return _.I(function(b){return 1==
3
+ b.a?_.x(b,a.Uc(_.ef),2):_.x(b,a.Uc(_.df),0)})},GV=function(a,b){this.log=new _.L(b);this.player=a;this.j=null;this.f=_.eu;this.l=7;this.h=2;this.B=Date.now();this.A=-1},HV=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.ue){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.$e?"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}})},IV=function(a){if(typeof a!==_.lg)return a;
4
+ try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c})}catch(b){return a}},JV=function(a,b){var c=new Set(b);return Object.keys(a).reduce(function(d,e){c.has(e)&&(d[e]=a[e]);return d},{})},KV=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.I(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=_.vt(d,a.mimeType,g);if(!f||!g)return q.C(2);l=_.$k(a.url);return _.x(q,c.fetch(l).U,3)}2!=
5
+ q.a&&(m=q.f)&&m.data&&(n=f.a(_.Qi(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)})},LV=function(a,b){if(window.chrome&&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;
6
+ case _.Tg:return b===_.bt?d.MPEG2_TS:c.TS;case _.Tc:return c.AAC;case _.Uc:return c.AC3;case _.Vc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Wc:return c.FMP4}},NV=function(a){a=void 0===a?MV:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.O(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;
7
+ case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},OV=function(){return Math.round(1E3*Math.random())},PV=function(a){GV.call(this,a,"clpp.cast.SenderStateManager");this.o=this.a=null;this.w=this.hc.bind(this)},QV=function(){this.g=new _.L("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},RV=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},TV=function(a,b){var c=
8
+ RV(a);return SV(a,b).find(function(d){return c.includes(d.id)})||null},SV=function(a,b){return a.h.filter(function(c){return c.type===b})},VV=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.at){var e=a.xa();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;UV(a,b)},function(f){a.f[b]=null;a.g.debug(rV,f)})}else b===_.at&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){UV(a,b)},
9
+ function(f){a.g.debug(rV,f)}))},UV=function(a,b){b===_.X?a.a.trigger(new _.Q(_.Zc)):b===_.at&&a.a.trigger(new _.Q(_.ug))},ZV=function(a,b,c,d){_.Di.call(this);this.g=new _.L(_.xd);this.da=a;this.w=new _.gj(b);this.Z=c;this.ka=d;this.j=this.H=_.Mn();this.F=[];this.B=0;this.J=new _.Ym;this.a=null;this.f=!1;this.O=new _.om;this.A=!1;this.Aa="";this.Ra=1E6;this.h=new QV;this.h.initialize(this);this.l=new PV(this);this.G=new _.wi;this.I=null;this.L=new Set;this.P=this.zn.bind(this);this.Fa=this.Wn.bind(this);
10
+ this.ja=this.Mn.bind(this);this.T=this.Fn.bind(this);this.fa=this.En.bind(this);this.o=this.K=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){WV(!0)},0)}});XV(this);YV.add(this)},$V=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.G.release(),YV["delete"](a),a.f&&(a.f=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,
11
+ a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Fa)),c=[],a.h&&(c.push(a.h.destroy()),a.h=null),a.l&&(c.push(a.l.destroy()),a.l=null),_.x(d,Promise.all(c),2);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.Z=null;a.ka=null;_.z(d)})},bW=function(a){if(!a)return null;a:{var b=a.metadataType;var c=Object.entries(aW);c=_.v(c);for(var d=c.next();!d.done;d=c.next()){d=_.v(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=NV(aW[b]);return Object.assign(b,
12
+ a)},cW=function(a){var b=void 0===b?MV:b;return Object.values(aW).includes(a)?a:b},dW=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},XV=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.da.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.G.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Bk.bind(a));a.G.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,
13
+ a.Ln.bind(a));a.f=!0;a.O.resolve();a.w.ih();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.da;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Fa);eW&&a.w.ha(.02)}},fW=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==
14
+ _.k?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},hW=function(a,b){gW(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ja);b.addMessageListener(BV,a.T);b.addMessageListener(CV,a.fa)},gW=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.Q(_.Me)))},iW=function(a){return _.I(function(b){return a.Da()?b.C(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},jW=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,D,C,B,E,A;return _.I(function(J){switch(J.a){case 1:if(!a.f)return J["return"]();
15
+ c=chrome.cast.media.StreamType;d=_.yw;return _.x(J,iW(a),2);case 2:if(!b)return J["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.mc;m=h.ib;g.hlsVideoSegmentFormat=LV(l,d.VIDEO);g.hlsSegmentFormat=LV(m,d.AUDIO);if(!b.qb){J.C(3);break}if(!a.K){J.C(4);break}return _.x(J,Promise.resolve(a.K(b.qb)),5);case 5:if(n=J.f)b.qb=n;case 4:a.j=b.qb;a.F=_.Sn(a.j);a.B=a.F.findIndex(function(N){return N.url===
16
+ b.source.url});if(!b.qb.remoteTextTracks){J.C(6);break}return _.x(J,Promise.all(b.qb.remoteTextTracks.map(a.Ol.bind(a))),7);case 7:p=J.f,g.tracks=p.filter(function(N){return N}),b.qb.remoteTextTracks=void 0;case 6:delete b.qb.autoplay,b.qb.startTime=null,g.customData={playerConfiguration:HV(b.qb)};case 3:q=a.Lb()||{};t=cW(q.metadataType);typeof b.Sg===_.k&&(u={metadataType:t,sectionStartAbsoluteTime:b.Sg});b.source.name&&(y={metadataType:t,title:b.source.name});D=dW(q);if(C=bW(Object.assign({},u,
17
+ y,D)))g.metadata=C;B=new chrome.cast.media.LoadRequest(g);(E=b.queueData)&&E.items&&0<E.items.length&&(A=new chrome.cast.media.QueueData,A.items=E.items,A.startIndex=E.startIndex,B.queueData=A);typeof b.autoplay===_.bd&&(B.autoplay=b.autoplay);typeof b.currentTime===_.k&&(B.currentTime=b.currentTime);return _.x(J,f.loadMedia(B),0)}})},kW=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.h.xa())&&d.language&&(a.j.preferredTextLanguage=d.language);(e=a.h.oa())&&e.language&&(a.j.preferredAudioLanguage=
18
+ e.language);return _.x(f,jW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Sg:a.getPresentationStartTime(),autoplay:b,qb:a.j}),0)})},WV=function(a){if(a){a=_.v(YV);for(var b=a.next();!b.done;b=a.next())XV(b.value)}},mW=function(a,b,c){_.Di.call(this);this.f=a;this.h=b;this.j=typeof c===_.ue?c:this.Do;this.a=lW(this);this.g=new _.L(yV);this.f&&this.forwardEventsTo(this.f)},lW=function(a){return new ZV(a.h,function(){a.trigger(new _.Q(_.id))},function(b,c){var d=a.f.getConfiguration();
19
+ 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.Ch&&(d.preferredAudioLanguage=c.Ch);c.Oj&&(d.preferredTextLanguage=c.Oj);_.No(a.f,null);a.trigger(new _.Q("castingended"));a.j(b,d)},function(){return nW(a)})},nW=function(a){var b,c,d;return _.I(function(e){if(1==e.a){a.trigger(new _.Q(_.hd));b=a.f.a;if(b===a.a||!a.f||!a.a)return e["return"]();c=null!=a.f.getLoadedSource();return _.x(e,a.f.release(),
20
+ 2)}_.No(a.f,a.a);if(!c)return e.C(0);_.Wo(a.f);return(d=a.f.getAdsManager())?_.x(e,d.load(),0):e.C(0)})},oW=function(a){GV.call(this,a,"clpp.cast.StateManager");this.I=this.Ik.bind(this);this.H=this.Hk.bind(this);this.w=this.Hn.bind(this);this.o=this.xn.bind(this);this.K=this.Kk.bind(this);this.J=this.Jk.bind(this);this.L=this.Zn.bind(this);this.G=this.Kn.bind(this);this.F=this.Gk.bind(this);this.a=this.Fk.bind(this)},sW=function(a,b){a=void 0===a?[]:a;b=void 0===b?0:b;_.Di.call(this);this.a=a.slice();
21
+ this.f=b},xW=function(a,b){0>b||b>=a.a.length||(a.f=b,a.trigger(new _.Q(_.Cf,{item:a.Mb()})))},CW=function(a){a.trigger(new _.Q(_.Df))},EW=function(a,b,c){c=void 0===c?function(){return Promise.resolve()}:c;_.Di.call(this);var d=this;this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=function(){var e,f;return _.I(function(g){switch(g.a){case 1:if(d.f)return g["return"]();e=d.a.Mb();if(!e)return g["return"]();d.f=!0;_.F(g,2,3);return _.x(g,d.w(e),5);case 5:return _.x(g,d.m.load(Object.assign({},
22
+ e.configuration,{autoplay:!0})),3);case 3:_.Eh(g);d.f=!1;_.Fh(g);break;case 2:throw f=_.H(g),f;}})};this.l=function(){DW(d)}},DW=function(a){FW(a);var b=Math.min(a.a.le().length-1,a.a.getPosition()+1);xW(a.a,b)},FW=function(a){a.j||(a.a.on(_.Cf,a.o),a.j=!0)},GW=function(a,b,c){var d=this;this.player=a;this.Ub=new sW(c);this.Ed=new EW({load:this.player.load.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.Ub,function(){return _.I(function(e){_.z(e)})});
23
+ this.a=new mW(this.player,b,function(e,f){var g;return _.I(function(h){if(1==h.a)return g=d.Ub.getPosition(),d.Ed.vd(g),f.autoplay=!0,delete f.license,_.x(h,d.player.load(f),2);if(3!=h.a)return typeof f.currentTime!==_.k?h.C(3):_.x(h,d.player.seek(Math.max(f.currentTime-1,0)),3);d.player.play();_.z(h)})});this.f=function(e){e&&e.type===uV&&typeof e.index===_.k&&xW(d.Ub,e.index)};this.a.addMessageListener(this.f)},HW=function(a){return a.map(function(b){var c={};c.media={contentId:b.configuration.source};
24
+ c.customData={skippable:!1!==b.skippable};return c})},IW=function(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},JW=function(a){this.a=a},LW=function(a){this.m=a;this.a=null;this.h=this.Lk.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,
25
+ cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];KW().addEventListener(this.f,this.h)},PW=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.F(n,2);MW=!1;e=_.$k(d);return _.x(n,c.fetch(e).U,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.ea(f.data),h=new DOMParser,l=h.parseFromString(g,_.tg),l.getElementsByTagName("vmap:VMAP").length)NW.warn("VMAP detected."),
26
+ a.vmapAdsRequest=OW(g);else if(l.getElementsByTagName("VAST").length){NW.warn("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=OW(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else NW.warn("Unsupported schema."),MW=!0;return _.G(n,0)}m=_.H(n);NW.warn("Failed to fetch an ad",m);MW=!0;_.z(n)})},OW=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},KW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},
27
+ RW=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=QW(a,c))&&(d={ad:c});a.m.trigger(new _.Q(b,d))}},SW=function(a,b){var c=new _.O(1,10,10003,{errorType:b});a.m.onError(c)},QW=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.lg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.lg&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||
28
+ null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new IW(d,e,b.index,b.total,f)}return c},TW=function(a){this.a=a;this.f=this.h.bind(this)},UW=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]},VW=function(a){var b=
29
+ a.dashTimedMetadata,c=_.Lg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Kg)?_.Zf:_.Ig,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},WW=function(){this.g=new _.L("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.uo.bind(this);this.a=this.f=null},XW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},ZW=function(a){a.a=XW().getTextTracksManager();var b=a.a.getTracks();
30
+ a.j=YW(_.at,b)},$W=function(a,b,c,d){c=_.Ii(c).filter(function(h){return h});var e=!1,f=[];b===_.X?f=a.getAudioTracks():b===_.at&&(f=a.pa());if(c=c.find(function(h){var l=_.so(h);return f.some(function(m){m=_.so(m.language||"");return _.to(l,m)})})){var g=_.so(c);c=f.filter(function(h){h=_.so(h.language||"");return _.to(g,h)});f=c.length?c:f;e=e||!!c.length}_.R.Ef(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",
31
+ e),b===_.X?a.Ia(e):b===_.at&&a.ab(e))},YW=function(a,b){for(var c=[],d=_.v(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Zs(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 _.ht(f.id,f));c.push(f)}return c},aX=
32
+ function(){_.Di.call(this);this.g=new _.L(zV);this.h=this.w=_.Mn();this.A=null;this.l=-1;this.G=new _.Ym;this.f=this.o=this.j=this.a=this.B=null;this.F=!1},bX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},cX=function(a,b){var c=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:c})},fX=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=
33
+ void 0}if(a&&a.drm){var d=a.drm,e=_.Yn(d);if(e){var f=[_.Kd];_.Sn(a)[0].type!==_.Qc&&f.unshift(_.Md);d.preferredDrmSystem===_.Kd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Qa[g];h?(d=g===_.Md?cast.framework.ContentProtection.WIDEVINE:g===_.Kd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},dX(b,h,a,d),eX(b,h,a,d)):c()}else c()}else c()},dX=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=
34
+ function(e){var f=_.$k({method:_.rb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},eX=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.el(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,
35
+ g,d),2)):h["return"](_.Qi(g.data))})}:a.licenseHandler=void 0},gX=function(){this.a=!1;this.g=new _.L(AV);this.f=this.m=null;this.w=new Set;this.F=this.Jn.bind(this);this.B=this.Dk.bind(this);this.o=null;this.l=new _.wi;this.j=this.h=this.A=null},iX=function(){return hX||(hX=new gX)},jX=function(){return cast.framework.CastReceiverContext.getInstance()},kX=function(){var a=jX().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},lX=function(a,b){var c=jX().getPlayerManager().getMediaInformation();
36
+ if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;jX().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},nX=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=jX();c=(jX().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();
37
+ if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=mX(h,_.ua),m=mX(h,_.zb),n=_.v([]),p=n.next().value;n=n.next().value;m&&(m=_.v(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")},mX=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},oX=function(a){a=
38
+ _.v(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c={};b.customData&&_.M.Qb(b.customData)&&(c=b.customData);b.roles&&(c.roles=b.roles);b.audioTrackInfo&&(c.audioTrackInfo=b.audioTrackInfo);_.M.Qb(c)&&(b.customData=c)}},qX=function(a){this.h=a;this.a=null;this.j=new _.wi;this.f=null;pX(this)},pX=function(a){_.I(function(b){if(1==b.a)return _.x(b,a.h.O,2);a.a=a.h.o;a.j.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,a.ao.bind(a));_.z(b)})},rX=function(a,b,c){var d=null;c&&
39
+ (d={ad:c});a.h.trigger(new _.Q(b,d))},sX=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks,c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,h=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=h&&d))return null;var l=b.find(function(m){return m.id===e})||null;a=0;l&&(a=0>=l.position?l.position:b.filter(function(m){return 0<=m.position}).sort(function(m,n){return m.position-n.position}).findIndex(function(m){return m===
40
+ l}));b=c.find(function(m){return m.id===h})||null;return new IW(b,l,f,g,a)},tX=function(){},uX=function(){};_.r=GV.prototype;_.r.release=function(){this.Ca(_.eu)};_.r.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.r.getState=function(){return this.f};_.r.onError=function(a){a.severity===_.P&&this.Ca(_.Co)};
41
+ _.r.Ca=function(a){if(a!==this.f)if(this.f===_.Co&&a!==_.eu)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;2===this.f?(this.A=b,this.player.trigger(new _.Q(_.dd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):2===this.l&&this.player.trigger(new _.Q(_.cd,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.Yt(this.j,this.f);this.player.trigger(new _.Q(_.ig,
42
+ {detail:a}))}};var vX;_.K("clpp.cast.CastUtils",function(){});var MV=0,aW={GENERIC:MV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},wX="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),xX="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");_.w(PV,GV);PV.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.o)};PV.prototype.destroy=function(){var a=this;return _.I(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,GV.prototype.destroy.call(a),0)})};PV.prototype.Ca=function(a){var b=this.player.o;b&&b.isPlayingBreak||GV.prototype.Ca.call(this,a)};
43
+ PV.prototype.hc=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.Ca(5);break;case chrome.cast.media.IdleReason.ERROR:this.Ca(_.Co);break;default:this.Ca(_.eu)}break;case chrome.cast.media.PlayerState.PLAYING:this.Ca(3);break;case chrome.cast.media.PlayerState.PAUSED:this.Ca(4);break;case chrome.cast.media.PlayerState.BUFFERING:this.Ca(2)}};_.w(QV,_.xt);_.r=QV.prototype;_.r.initialize=function(a){this.a=a};_.r.release=function(){this.h=[];this.f={}};
44
+ _.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=_.bt;break;case chrome.cast.media.TrackType.AUDIO:c=_.X;break;case chrome.cast.media.TrackType.TEXT:c=_.at}c=new _.Zs(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;if(b.customData){c.src=b.customData.url||c.src;c.mimeType=b.customData.mimeType||c.mimeType;
45
+ var d=b.customData.roles;d&&(c.roles=d);if(b=b.customData.audioTrackInfo)void 0!==b.numAudioChannels&&(c.channelsCount=b.numAudioChannels),void 0!==b.spatialAudio&&(c.spatialAudio=b.spatialAudio)}c.renditions.push(new _.ht(c.id,c));return c}):[],this.a.trigger(new _.Q(_.Ag)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return SV(this,_.bt)};_.r.getAudioTracks=function(){return SV(this,_.X)};_.r.pa=function(){return SV(this,_.at)};
46
+ _.r.qa=function(){var a=this.Ma();return a?a.renditions[0]:null};_.r.Va=function(){var a=this.oa();return a?a.renditions[0]:null};_.r.$a=function(){var a=this.xa();return a?a.renditions[0]:null};_.r.zb=function(){return this.f[_.bt]||null};_.r.Nb=function(){return this.f[_.X]||null};_.r.Ob=function(){return this.f[_.at]||null};_.r.Ma=function(){return TV(this,_.bt)};_.r.oa=function(){return TV(this,_.X)};_.r.xa=function(){return TV(this,_.at)};_.r.Hb=function(a){VV(this,_.bt,a)};
47
+ _.r.Ia=function(a){VV(this,_.X,a)};_.r.ab=function(a){VV(this,_.at,a)};_.r.rb=function(a){this.Hb(a&&a.track)};_.r.Fb=function(a){this.Ia(a&&a.track)};_.r.Gb=function(a){this.ab(a&&a.track)};_.r.addTextTrack=function(){return _.I(function(a){_.z(a)})};_.r.ya=function(){return!0};QV.prototype.isAbrEnabled=QV.prototype.ya;QV.prototype.addTextTrack=QV.prototype.addTextTrack;QV.prototype.setTextRendition=QV.prototype.Gb;QV.prototype.setAudioRendition=QV.prototype.Fb;QV.prototype.setVideoRendition=QV.prototype.rb;
48
+ QV.prototype.setTextTrack=QV.prototype.ab;QV.prototype.setAudioTrack=QV.prototype.Ia;QV.prototype.setVideoTrack=QV.prototype.Hb;QV.prototype.getTextTrack=QV.prototype.xa;QV.prototype.getAudioTrack=QV.prototype.oa;QV.prototype.getVideoTrack=QV.prototype.Ma;QV.prototype.getLoadingTextRendition=QV.prototype.Ob;QV.prototype.getLoadingAudioRendition=QV.prototype.Nb;QV.prototype.getLoadingVideoRendition=QV.prototype.zb;QV.prototype.getTextRendition=QV.prototype.$a;QV.prototype.getAudioRendition=QV.prototype.Va;
49
+ QV.prototype.getVideoRendition=QV.prototype.qa;QV.prototype.getTextTracks=QV.prototype.pa;QV.prototype.getAudioTracks=QV.prototype.getAudioTracks;QV.prototype.getVideoTracks=QV.prototype.getVideoTracks;_.w(ZV,_.Di);_.r=ZV.prototype;_.r.init=function(a,b){this.j=this.H=b};_.r.unload=function(){var a=this;return this.f?new Promise(function(b,c){a.h&&a.h.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)}):Promise.resolve()};_.r.release=function(){var a=this;return this.f?this.unload().then(function(){a.l&&a.l.release()}):Promise.resolve()};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.nb)};_.r.appendLoad=function(){return Promise.reject(_.nb)};
50
+ _.r.seekWith=function(){return Promise.reject(_.nb)};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.I(function(a){_.z(a)})};_.r.Je=function(a){this.K=a};_.r.Pc=function(){return this.f};_.r.Da=function(){return this.A};_.r.xg=function(){return this.Aa};
51
+ _.r.sendMessage=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:if(!c.f)return g["return"]();e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.O(1,8,8004,void 0);g.C(2);break}_.F(g,3);return _.x(g,e.sendMessage(a,b),5);case 5:_.G(g,2);break;case 3:f=_.H(g),d=new _.O(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.z(g)}})};
52
+ _.r.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Pc())throw a.g.warn(wV),new _.O(1,8,8001,void 0);if(!eW)throw a.g.warn(tV),new _.O(1,8,8002,void 0);if(a.Da())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.F(d,2);return _.x(d,iW(a),4)}if(2!=d.a)return _.G(d,0);b=_.H(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.O(1,8,8E3,c);})};
53
+ _.r.pf=function(){this.f&&this.Da()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.r.addMessageListener=function(a){typeof a===_.ue&&this.L.add(a)};_.r.removeMessageListener=function(a){typeof a===_.ue&&this.L["delete"](a)};_.r.play=function(){var a=this;return this.f?this.isEnded()?kW(this,!0):new Promise(function(b,c){if(!a.a)return c(sV);a.a.play(null,b,c)}):Promise.resolve()};
54
+ _.r.pause=function(){var a=this;return this.f?new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(sV);a.a.pause(null,b,c)}):Promise.resolve()};_.r.isPaused=function(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1};_.r.isEnded=function(){return this.f?5===this.getState():!1};
55
+ _.r.seek=function(a){var b=this;return this.f?this.isEnded()?kW(this,!1,a):new Promise(function(c,d){b.a||d(sV);b.o.isPlayingBreak&&d(qV);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.Q(_.Ng));b.a.seek(e,function(){b.trigger(new _.Q(_.Mg));c()},d)}):Promise.resolve()};_.r.getPosition=function(){return this.f?this.getMediaPosition():0};_.r.getMediaPosition=function(){return this.f?this.a&&this.a.getEstimatedTime()||0:0};
56
+ _.r.getDuration=function(){return this.f?this.getMediaDuration():0};_.r.getMediaDuration=function(){if(!this.f)return 0;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.f?this.a&&this.a.playbackRate||0:0};
57
+ _.r.setPlaybackRate=function(a){this.f&&this.a&&0<a&&this.sendMessage(DV,{type:"SET_PLAYBACK_RATE",requestId:OV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};_.r.getVolume=function(){return this.f?this.a&&this.a.volume.level:0};_.r.setVolume=function(a){this.f&&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.f?this.a&&this.a.volume.muted:!1};
58
+ _.r.setMuted=function(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};_.r.getPresentationStartTime=function(){if(!this.f)return 0;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};
59
+ _.r.getSeekRange=function(){if(!this.f)return{start:0,end:0};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.f?this.l?this.l.getState():7:7};_.r.getStats=function(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?IV(this.a.customData.stats):_.du():_.du()};
60
+ _.r.isLive=function(){return this.f?Infinity===this.getDuration():!1};_.r.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Pc())return b.g.warn(wV),e["return"]();if(!eW)return b.g.warn(tV),e["return"]();b.F=_.Sn(a);b.j=_.On([b.H,a]);c=b.F[b.B];d={source:c,isLive:c.isLive,autoplay:b.j.autoplay,qb:b.j,mc:c.mc,ib:c.ib};return _.x(e,jW(b,d),0)})};_.r.getBufferInfo=function(){return new _.gi};_.r.getTrackManager=function(){return this.h};_.r.getConfiguration=function(){return this.j};
61
+ _.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.J=a};_.r.getNetworkEngine=function(){return this.J};_.r.getSourceIndex=function(){return this.B};_.r.setSourceIndex=function(a){this.B=a};_.r.setCmsdManager=function(){};_.r.getLoadedSource=function(){return this.F[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(vV)};
62
+ _.r.onError=function(a){if(a&&(this.trigger(new _.Q(_.qe,{detail:a})),this.l))this.l.onError(a)};_.r.namespace=function(){return _.xd};_.r.canPlay=function(){return this.Pc()?2:0};_.r.Lb=function(){return this.I};_.r.kc=function(a){this.I=bW(a)};_.r.ng=function(){this.I=null};_.r.bh=function(a){if(this.f){var b=this.Lb()||{};a={metadataType:cW(b.metadataType),title:a};this.kc(Object.assign({},b,a))}};
63
+ _.r.$g=function(a){if(this.f){var b=this.Lb()||{},c=cW(b.metadataType);a=new chrome.cast.Image(a);this.kc(Object.assign({},b,{metadataType:c,images:[a]}))}};_.r.Zg=function(a){if(this.f){var b=this.Lb()||{};this.kc(Object.assign({},b,{metadataType:3,artist:a}))}};_.r.ah=function(a){if(this.f){var b=this.Lb()||{};a={metadataType:cW(b.metadataType),releaseDate:a};this.kc(Object.assign({},b,a))}};
64
+ _.r.zn=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;eW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.Aa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.ih()};
65
+ _.r.Wn=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;hW(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Da()||(this.A=!0,hW(this,a.session),this.ka());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Da()&&this.a){var b=this.a.media,c=this.h.oa(),d=this.h.xa();c=c&&c.language||void 0;d=d&&d.language||void 0;this.Z(this.getState(),{source:{url:b.contentId,type:b.contentType,
66
+ isLive:this.isLive()},currentTime:fW(this),Oj:d,Ch:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ja);a.session.removeMessageListener(BV,this.T);a.session.removeMessageListener(CV,this.fa);this.A=!1;this.a=null}};_.r.Mn=function(a){this.g.debug("New media session",a.mediaSession);gW(this,a.mediaSession)};_.r.Ln=function(a){a.value&&a.value.tracks&&this.h&&this.h.load()};_.r.Fn=function(a,b){var c=IV(b);this.L.forEach(function(d){return d(c)})};
67
+ _.r.En=function(a,b){var c=IV(b);"event"===c.type&&c.name===_.Yg&&this.trigger(new _.Q(_.jd,{visible:!!c.visible}))};_.r.Bk=function(){this.trigger(new _.Q(_.zg))};
68
+ _.r.Ol=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.x(e,KV(a,[_.sg,_.Pc],b.J,b.j),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ra++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.r.getTextDisplayer=function(){return null};var eW=!1,YV=new Set;window.__onGCastApiAvailable=WV;_.w(mW,_.Di);_.r=mW.prototype;_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.x(b,$V(a.a),3):b.C(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.z(b)})};_.r.Do=function(a,b){this.f&&5!==a&&a!==_.eu&&(delete b.license,this.f.load(b))};_.r.kd=function(){return!!this.a&&this.a.Pc()&&eW};_.r.Da=function(){return!!this.a&&this.a.Da()};_.r.xg=function(){return this.a?this.a.xg():""};_.r.Je=function(a){this.a&&this.a.Je(a)};
69
+ _.r.cast=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:if(!c.a)return g["return"]();_.F(g,2);return _.x(g,c.a.cast(),4);case 4:if(!c.f||!c.a)return g["return"]();var h=null,l=c.f.getLoadedSource();if(l){var m=c.f.getTrackManager();h=m.getVideoTracks()[0];if(h&&h.mimeType)var n=h.mimeType;h=c.f.getConfiguration();var p=m.oa();if(p){if(p.mimeType)var q=p.mimeType;p.language&&(h.preferredAudioLanguage=p.language);p.roles.length&&(h.preferredAudioRole=p.roles[0])}if(m=m.xa())m.language&&
70
+ (h.preferredTextLanguage=m.language),m.roles.length&&(h.preferredTextRole=m.roles[0]);m=l&&typeof l.isLive===_.bd?l.isLive:c.f.isLive();h={source:l,isLive:m,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),Sg:c.f.getPresentationStartTime(),mc:n,ib:q,qb:h}}d=h;b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});return _.x(g,nW(c),5);case 5:if(!c.a)return g["return"]();d&&(d.autoplay=!c.f.isPaused());if(a)return _.x(g,c.f.load(a),7);if(c.a.a){g.C(7);break}return _.x(g,jW(c.a,
71
+ d),7);case 7:_.G(g,0);break;case 2:e=_.H(g),c.g.error("Error while trying to cast",e),f=new _.Q(_.qe,{detail:e}),c.trigger(f),_.z(g)}})};_.r.pf=function(){this.a&&this.a.pf()};_.r.vk=function(a){var b=this;return _.I(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,$V(b.a),2):c.C(2)}b.a=lW(b);_.z(c)})};_.r.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.x(c,b.a.sendMessage(BV,a),0):(b.g.warn(xV),c["return"]())})};
72
+ _.r.Bj=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage(DV,{type:"QUEUE_NEXT",requestId:OV(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Cj=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage(DV,{type:"QUEUE_PREV",requestId:OV(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Aj=function(a){var b=this;return _.I(function(c){return _.x(c,b.a.sendMessage(DV,{type:"QUEUE_INSERT",requestId:OV(),mediaSessionId:b.a.a.mediaSessionId,items:a}),0)})};
73
+ _.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(xV)};_.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(xV)};_.r.Lb=function(){return this.a&&this.a.Lb()};_.r.kc=function(a){this.a&&this.a.kc(a)};_.r.ng=function(){this.a&&this.a.ng()};_.r.bh=function(a){this.a&&this.a.bh(a)};_.r.$g=function(a){this.a&&this.a.$g(a)};_.r.Zg=function(a){this.a&&this.a.Zg(a)};_.r.ah=function(a){this.a&&this.a.ah(a)};_.K(yV,mW);
74
+ mW.prototype.setContentReleaseDate=mW.prototype.ah;mW.prototype.setContentArtist=mW.prototype.Zg;mW.prototype.setContentImage=mW.prototype.$g;mW.prototype.setContentTitle=mW.prototype.bh;mW.prototype.clearContentMetadata=mW.prototype.ng;mW.prototype.setContentMetadata=mW.prototype.kc;mW.prototype.getContentMetadata=mW.prototype.Lb;mW.prototype.removeMessageListener=mW.prototype.removeMessageListener;mW.prototype.addMessageListener=mW.prototype.addMessageListener;mW.prototype.queueAddItems=mW.prototype.Aj;
75
+ mW.prototype.queuePreviousItem=mW.prototype.Cj;mW.prototype.queueNextItem=mW.prototype.Bj;mW.prototype.sendMessage=mW.prototype.sendMessage;mW.prototype.changeReceiverId=mW.prototype.vk;mW.prototype.forceDisconnect=mW.prototype.pf;mW.prototype.cast=mW.prototype.cast;mW.prototype.setPlayerConfigInterceptor=mW.prototype.Je;mW.prototype.getReceiverName=mW.prototype.xg;mW.prototype.isCasting=mW.prototype.Da;mW.prototype.canCast=mW.prototype.kd;mW.prototype.destroy=mW.prototype.destroy;_.w(oW,GV);_.r=oW.prototype;
69
76
  _.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.F);b.addEventListener(a.BITRATE_CHANGED,this.a)};
70
77
  _.r.destroy=function(){var a=this,b,c;return _.I(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,
71
- a.F);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,QV.prototype.destroy.call(a),0)})};_.r.nk=function(){this.player.trigger(new _.Q(_.gf));this.Aa(3)};_.r.mk=function(){this.Aa(4)};_.r.kn=function(){this.Aa(5)};_.r.bn=function(a){a.isBuffering?this.Aa(2):(a=this.player.isPaused()?4:3,this.Aa(a))};_.r.qk=function(){this.h=1;this.player.trigger(new _.Q(_.Hg))};_.r.pk=function(){this.player.trigger(new _.Q(_.Gg))};_.r.Cn=function(){this.h=2};_.r.nn=function(){this.Aa(1)};
72
- _.r.kk=function(a){var b=this.player.getStats();this.player.trigger(new _.Q(_.Wc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.lk=function(a){a=new _.N(_.O,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.Q(_.je,{detail:a}));this.Aa(_.zo)};_.r=KW.prototype;_.r.vb=function(){return"Google Cast Framework"};_.r.wb=function(){return cast.framework.VERSION};_.r.Bb=function(){return 0};_.r.getId=function(){return""};_.r.getCreativeId=function(){return""};_.r.Yb=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};_.r.getPosition=function(){return 0};
73
- _.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.bc=function(){return!1};_.r.xb=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.lb=function(){return 0};_.r.kb=function(){return 0};_.r.Va=function(){return 0};_.r.Wa=function(){switch(this.Mb()){case 0:return 0;case -1:return 2;default:return 1}};_.r.getPodIndex=function(){return this.j};_.r.Mb=function(){return this.f.position};_.r.zb=function(){return this.l};
74
- _.r.nb=function(){return this.h};_.r.getWrapperAdIds=function(){return[]};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.ac=function(){return null};KW.prototype.getVideoElement=KW.prototype.ac;KW.prototype.getWrapperCreativeIds=KW.prototype.getWrapperCreativeIds;KW.prototype.getWrapperAdSystems=KW.prototype.getWrapperAdSystems;KW.prototype.canSeek=KW.prototype.canSeek;KW.prototype.getWrapperAdIds=KW.prototype.getWrapperAdIds;
75
- KW.prototype.getSequenceLength=KW.prototype.nb;KW.prototype.getPositionInSequence=KW.prototype.zb;KW.prototype.getPodTimeOffset=KW.prototype.Mb;KW.prototype.getPodIndex=KW.prototype.getPodIndex;KW.prototype.getPodType=KW.prototype.Wa;KW.prototype.getMediaBitrate=KW.prototype.Va;KW.prototype.getMediaHeight=KW.prototype.kb;KW.prototype.getMediaWidth=KW.prototype.lb;KW.prototype.getMediaUrl=KW.prototype.getMediaUrl;KW.prototype.getClickThroughUrl=KW.prototype.xb;KW.prototype.isBumper=KW.prototype.bc;
76
- KW.prototype.getSkipTimeOffset=KW.prototype.getSkipTimeOffset;KW.prototype.getPosition=KW.prototype.getPosition;KW.prototype.getDuration=KW.prototype.getDuration;KW.prototype.getTitle=KW.prototype.getTitle;KW.prototype.getAdvertiserName=KW.prototype.getAdvertiserName;KW.prototype.getAdSystem=KW.prototype.getAdSystem;KW.prototype.getApiFramework=KW.prototype.getApiFramework;KW.prototype.getSourceId=KW.prototype.Yb;KW.prototype.getCreativeId=KW.prototype.getCreativeId;KW.prototype.getId=KW.prototype.getId;
77
- KW.prototype.getTechnology=KW.prototype.Bb;KW.prototype.getAdManagerVersion=KW.prototype.wb;KW.prototype.getAdManagerName=KW.prototype.vb;LW.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};LW.prototype.Ob=function(){return!!this.a.find(function(a){return 0===a.position})};LW.prototype.Nb=function(){return!!this.a.find(function(a){return-1===a.position})};LW.prototype.hasPostroll=LW.prototype.Nb;LW.prototype.hasPreroll=LW.prototype.Ob;LW.prototype.getCuePoints=LW.prototype.getCuePoints;_.r=NW.prototype;_.r.load=function(){var a=this;return _.I(function(b){OW&&(OW=!1,TW(a,0));_.z(b)})};_.r.start=function(){return _.I(function(a){MW().play();_.z(a)})};_.r.gd=function(){};_.r.resume=function(){-1!==this.getPosition()&&MW().play()};_.r.pause=function(){-1!==this.getPosition()&&MW().pause()};_.r.skip=function(){};_.r.getVolume=function(){return this.m.getVolume()||0};_.r.setVolume=function(a){this.m.setVolume(a)};
78
- _.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.r.ed=function(){return!0};_.r.Dc=function(){var a=this;return _.I(function(b){MW().removeEventListener(a.f,a.h);_.z(b)})};
79
- _.r.rk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=MW().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.Q(_.Ac,{adsTimeline:new LW(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:SW(this,_.qc,a);break;case cast.framework.events.EventType.BREAK_STARTED:SW(this,_.fc,a);break;case cast.framework.events.EventType.BREAK_ENDED:SW(this,_.gc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:SW(this,
80
- _.wc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(SW(this,_.vc,a),SW(this,_.xc,a)):a.endedReason===b.STOPPED?SW(this,_.xc,a):a.endedReason===b.END_OF_STREAM?(SW(this,_.jc,a),SW(this,_.xc,a)):a.endedReason===b.ERROR&&TW(this,1);break;case cast.framework.events.EventType.PLAYING:SW(this,_.uc,a);break;case cast.framework.events.EventType.PAUSE:SW(this,_.sc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?SW(this,_.hc,a):SW(this,_.uc,a)}};
81
- NW.prototype.getPosition=NW.prototype.getPosition;NW.prototype.setVolume=NW.prototype.setVolume;NW.prototype.getVolume=NW.prototype.getVolume;NW.prototype.skip=NW.prototype.skip;NW.prototype.pause=NW.prototype.pause;NW.prototype.resume=NW.prototype.resume;var OW=!1;UW.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(VW(),this.a)};UW.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(VW(),this.a)};UW.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return WW(a)})};
82
- UW.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=_.qg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.rg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.sg}b&&this.Za(new _.Q(b,{detail:WW(a.timedMetadataInfo)}))}else for(a=_.v(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Za(new _.Q(_.qg,{detail:b.value}))};_.w(XW,_.ot);_.r=XW.prototype;_.r.initialize=function(a){this.m=a;YW().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;YW().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.oa=function(){return this.j};_.r.pa=function(){return null};
83
- _.r.Sa=function(){var a=this.na();return a&&a.renditions[0]};_.r.Xa=function(){var a=this.va();return a&&a.renditions[0]};_.r.yb=function(){return null};_.r.Kb=function(){return null};_.r.Lb=function(){return null};_.r.La=function(){return null};_.r.na=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.k&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
84
- _.r.va=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.oa().find(function(c){return c.id===b})||null)}return a};_.r.Gb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.Ga=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.Ya=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.qb=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.Eb=function(a){this.Ga(a&&a.track)};
85
- _.r.Fb=function(a){this.Ya(a&&a.track)};
86
- _.r.addTextTrack=function(a){var b=this,c,d,e;return _.I(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.x(f,UV(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]),$W(b)}catch(g){throw b.g.warn("failed on track",
87
- a),g;}}_.z(f)})};_.r.wa=function(){return!0};_.r.Vn=function(){this.f=YW().getAudioTracksManager();var a=this.f.getTracks();this.h=ZW(_.X,a);$W(this);a=this.m.getConfiguration();aX(this,_.X,a.preferredAudioLanguage,a.preferredAudioRole);aX(this,_.Ss,a.preferredTextLanguage,a.preferredTextRole)};XW.prototype.isAbrEnabled=XW.prototype.wa;XW.prototype.addTextTrack=XW.prototype.addTextTrack;XW.prototype.setTextRendition=XW.prototype.Fb;XW.prototype.setAudioRendition=XW.prototype.Eb;
88
- XW.prototype.setVideoRendition=XW.prototype.qb;XW.prototype.setTextTrack=XW.prototype.Ya;XW.prototype.setAudioTrack=XW.prototype.Ga;XW.prototype.setVideoTrack=XW.prototype.Gb;XW.prototype.getTextTrack=XW.prototype.va;XW.prototype.getAudioTrack=XW.prototype.na;XW.prototype.getVideoTrack=XW.prototype.La;XW.prototype.getLoadingTextRendition=XW.prototype.Lb;XW.prototype.getLoadingAudioRendition=XW.prototype.Kb;XW.prototype.getLoadingVideoRendition=XW.prototype.yb;XW.prototype.getTextRendition=XW.prototype.Xa;
89
- XW.prototype.getAudioRendition=XW.prototype.Sa;XW.prototype.getVideoRendition=XW.prototype.pa;XW.prototype.getTextTracks=XW.prototype.oa;XW.prototype.getAudioTracks=XW.prototype.getAudioTracks;XW.prototype.getVideoTracks=XW.prototype.getVideoTracks;_.w(bX,_.yi);_.r=bX.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=cX();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.rn.bind(this));d.setMediaPlaybackInfoHandler(this.Sj.bind(this));this.a=new JW(this);this.a.init();this.j=new XW;this.j.initialize(this);this.o=new UW(function(e){return c.trigger(e)});this.o.init()};
90
- _.r.unload=function(){var a=cast.framework.messages.PlayerState,b=cX();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 _.I(function(b){if(1==b.a)return a.B=null,a.w=_.Dn(),a.h=a.w,a.l=-1,a.A=null,a.a?_.x(b,a.a.destroy(),3):b.C(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.z(b)})};
91
- _.r.play=function(){var a=cX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.r.pause=function(){var a=cX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.r.isPaused=function(){return cX().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
92
- _.r.isEnded=function(){return cX().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=cX();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(DV);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return this.getMediaPosition()};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.getMediaPosition=function(){return cX().getCurrentTimeSec()};
93
- _.r.getDuration=function(){return this.getMediaDuration()};_.r.getMediaDuration=function(){var a=cX().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return cX().getPlaybackRate()};_.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;cX().sendLocalMediaRequest(b)}};_.r.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};
94
- _.r.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.r.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};_.r.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};
95
- _.r.getLoadedSource=function(){var a=cX().getMediaInformation();if(a){var b=cX().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,pp:b,name:c}}return null};_.r.getDrmInfo=function(){return null};_.r.getPresentationStartTime=function(){return cX().getStartAbsoluteTime()};
96
- _.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=cX().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():7};
97
- _.r.getStats=function(){var a=_.Vt();if(this.f){a=cX().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
98
- _.r.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.Ut;b.a.j=b.f.a;b.A=_.Jn(a);b.h=_.Fn([b.w,a]);if(b.F)return b.F=!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:RV(b.h),local:!0};return _.x(e,cX().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.va);return new _.bi};
99
- _.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.mb)};_.r.appendLoad=function(){return Promise.reject(_.mb)};_.r.seekWith=function(){return Promise.reject(_.mb)};_.r.setNetworkEngine=function(a){this.G=a};_.r.setCmsdManager=function(){};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};
100
- _.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return LV};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(HV)};_.r.onError=function(a){this.trigger(new _.Q(_.je,{detail:a}))};_.r.canPlay=function(){return _.mj()?2:0};
101
- _.r.rn=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=RV(this.getStats());var b=cX(),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&&
102
- (!e||e&&f)){d=cX().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};
103
- _.r.Sj=function(a,b){var c=null,d=b;a.media.customData&&(c=SV(a.media.customData.playerConfiguration));var e=null,f=null;a.media.customData&&(e=SV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),f=SV(a.media.customData.playerConfiguration));var g=e&&e.LiveConfiguration;g=g?0===g.liveEdgeLatencyMs:!1;e=!(!e||!e.lowLatencyMode);d=null!=f&&f.lowLatencyMode||g||e?dX(d,{streaming:{lowLatencyMode:!0}}):d;if(!c)return d;f=c.chromecast||null;e=c.abr||null;g=d;e&&typeof e.defaultBandwidthEstimate===
104
- _.k?g.initialBandwidth=e.defaultBandwidthEstimate:g.initialBandwidth=void 0;gX(c,d);e={};g=c.streaming||null;f&&f.useSenderStreamingConfig&&g&&(e.streaming=TV(g,vX));c=c.abr||null;f&&f.useSenderAbrConfig&&c&&(e.abr=TV(c,wX));_.M.pc(e)&&(d=dX(d,e));return d};_.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r=hX.prototype;_.r.init=function(a){var b=this;a&&(this.f=new bX,_.Eo(a,this.f),this.m=a,this.w.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.Wt?_.x(c,PV(b.m),0):c.C(0)})}))};
105
- _.r.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=kX(),b=kX().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[NV]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Im.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=
106
- d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;this.h&&(c.queue=this.h);b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Hm.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.B);a.start(c);a.addCustomMessageListener(NV,this.A)}};
107
- _.r.stop=function(){if(this.a){this.a=!1;this.w.release();var a=kX();kX().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.B);a.removeCustomMessageListener(NV,this.A);a.stop();this.h=this.m=this.f=null}};_.r.ze=function(a){this.l=a};_.r.so=function(a){this.o=a};_.r.on=function(a,b){kX().addEventListener(a,b)};_.r.off=function(a,b){kX().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.ne&&this.j.add(a)};
108
- _.r.removeMessageListener=function(a){typeof a===_.ne&&this.j["delete"](a)};_.r.sendMessage=function(a,b){kX().sendCustomMessage(NV,b,RV(a))};_.r.Kc=function(){return this.a};_.r.Jb=function(){return lX()};_.r.gc=function(a){mX(this,a)};_.r.Mo=function(a){var b=lX(),c=null;a?c=Object.assign({},b,a):c=b;mX(this,c)};_.r.vo=function(a){this.h=a};_.r.getQueueManager=function(){return kX().getPlayerManager().getQueueManager()};
109
- _.r.Im=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return oX(this,a);try{var b=(new DOMParser).parseFromString(a,_.og)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=kX();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===_.Mg||g===_.Nc){g=e[f].getAttribute(_.Me);for(var h=e[f].getElementsByTagName(_.Ab),l=
110
- h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Me)||g,n=h[l].getAttribute(_.yd),p=h[l].getAttribute(_.ah)||void 0,q=h[l].getAttribute(_.oe)||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(_.Ab).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ka).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Jb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=kX();c=a.getElementsByTagName("StreamIndex");
111
- for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Mg){e=c[d].getElementsByTagName(_.yb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.db)||void 0,h=e[f].getAttribute(_.cb)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Og,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.yb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
112
- _.r.Hm=function(a){var b=this,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=SV(c.media.customData.playerConfiguration));if(!b.m||!d){l.C(2);break}if(!b.l){l.C(3);break}return _.x(l,Promise.resolve(b.l(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.C(5);break}return _.x(l,QW(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.C(7);
113
- break}b.f.F=!0;return _.x(l,_.Oo(b.m,d),8);case 8:return _.x(l,_.Po(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.ic&&(c.media.hlsVideoSegmentFormat=VV(f.ic,_.Ts)),f.hb&&(c.media.hlsSegmentFormat=VV(f.hb,_.X));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.o){l.C(10);break}return _.x(l,
114
- Promise.resolve(b.o(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.r.mn=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.M.um;var b=kX().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))}_.Jo(this.m)}};
115
- _.r.jk=function(a){if(0<this.j.size){var b=SV(a.data);this.j.forEach(function(c){return c(b)})}};_.K(MV,hX);hX.prototype.getQueueManager=hX.prototype.getQueueManager;hX.prototype.setQueue=hX.prototype.vo;hX.prototype.updateContentMetadata=hX.prototype.Mo;hX.prototype.setContentMetadata=hX.prototype.gc;hX.prototype.getContentMetadata=hX.prototype.Jb;hX.prototype.isApiReady=hX.prototype.Kc;hX.prototype.sendMessage=hX.prototype.sendMessage;hX.prototype.removeMessageListener=hX.prototype.removeMessageListener;
116
- hX.prototype.addMessageListener=hX.prototype.addMessageListener;hX.prototype.off=hX.prototype.off;hX.prototype.on=hX.prototype.on;hX.prototype.setLoadRequestDataInterceptor=hX.prototype.so;hX.prototype.setPlayerConfigInterceptor=hX.prototype.ze;hX.prototype.stop=hX.prototype.stop;hX.prototype.start=hX.prototype.start;hX.prototype.init=hX.prototype.init;hX.getInstance=jX;var iX=null;_.r=pX.prototype;_.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){a.a=a.f.l;if(a.a)for(b=a.a.controller,c=a.En.bind(a),d=_.v(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.z(g)})};_.r.start=function(){return _.I(function(a){_.z(a)})};_.r.gd=function(){};_.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()};
117
- _.r.skip=function(){var a=this.f.a;a&&this.f.sendMessage(OV,{type:"SKIP_AD",requestId:YV(),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.ed=function(){return!0};_.r.Dc=function(){var a=this;return _.I(function(b){a.h.release();_.z(b)})};
118
- _.r.En=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.Q(_.Ac,{adsTimeline:new LW(a.breaks)})));break;case "isPlayingBreak":a.value?rX(this,_.fc):(rX(this,_.jc),rX(this,_.xc),rX(this,_.gc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(rX(this,_.jc),rX(this,_.xc)),rX(this,_.wc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?rX(this,_.sc):rX(this,_.uc))}};pX.prototype.getPosition=pX.prototype.getPosition;
119
- pX.prototype.setVolume=pX.prototype.setVolume;pX.prototype.getVolume=pX.prototype.getVolume;pX.prototype.skip=pX.prototype.skip;pX.prototype.pause=pX.prototype.pause;pX.prototype.resume=pX.prototype.resume;sX.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};sX.prototype.a=function(a,b){return a.namespace()!==_.qd?!1:!(!b||!b.ima)};sX.prototype.create=function(a){return new pX(a.a)};tX.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};tX.prototype.a=function(a,b){return jX().Kc()?!(!b||!b.ima):!1};tX.prototype.create=function(a){return new NW(a)};_.K("clpp.cast.createCastQueue",function(){uX=function(){return cast.framework.QueueBase.apply(this,arguments)||this};_.w(uX,cast.framework.QueueBase);uX.prototype.initialize=function(a){var b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b};return new uX});_.Zh(new sX);_.Zh(new tX);};
78
+ a.F);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,GV.prototype.destroy.call(a),0)})};_.r.Ik=function(){this.player.trigger(new _.Q(_.pf));this.Ca(3)};_.r.Hk=function(){this.Ca(4)};_.r.Hn=function(){this.Ca(5)};_.r.xn=function(a){a.isBuffering?this.Ca(2):(a=this.player.isPaused()?4:3,this.Ca(a))};_.r.Kk=function(){this.h=1;this.player.trigger(new _.Q(_.Ng))};_.r.Jk=function(){this.player.trigger(new _.Q(_.Mg))};_.r.Zn=function(){this.h=2};_.r.Kn=function(){this.Ca(1)};
79
+ _.r.Fk=function(a){var b=this.player.getStats();this.player.trigger(new _.Q(_.ad,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.Gk=function(a){a=new _.O(_.P,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.Q(_.qe,{detail:a}));this.Ca(_.Co)};_.w(sW,_.Di);_.r=sW.prototype;_.r.le=function(){return this.a};_.r.getPosition=function(){return this.f};_.r.Mb=function(){return this.a[this.f]||null};_.r.Fi=function(){return this.a[this.f+1]||null};_.r.append=function(a){this.a.push(a);CW(this)};_.r.Ki=function(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),CW(this))};_.r.remove=function(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,CW(this))};_.r.clear=function(){this.a=[];this.f=0;CW(this)};_.w(EW,_.Di);_.r=EW.prototype;_.r.start=function(){this.h||this.f||(this.h=!0,this.m.on(_.pe,this.l),FW(this),xW(this.a,this.a.getPosition()))};_.r.next=function(){var a=this.a.Mb();a&&!1===a.skippable||DW(this)};_.r.Ge=function(){var a=this.a.Mb();a&&!1===a.skippable||(FW(this),a=Math.max(0,this.a.getPosition()-1),xW(this.a,a))};_.r.vd=function(a){var b=this;return _.I(function(c){xW(b.a,a);_.z(c)})};_.r.stop=function(){this.h=!1;this.m.off(_.pe,this.l);this.a.off(_.Cf,this.o);this.j=!1};_.r=GW.prototype;_.r.Rn=function(a){return this.Ub.on(_.Cf,a)};_.r.Sn=function(a){return this.Ub.on(_.Df,a)};_.r.An=function(a){return this.player.on(_.id,a)};_.r.kd=function(){return this.a.kd()};_.r.ym=function(){return this.Ub.le()};_.r.Da=function(){return this.a.Da()};_.r.append=function(a){var b=this;return _.I(function(c){b.Ub.append(a);return b.a.Da()?_.x(c,b.a.Aj(HW([a])),0):c["return"]()})};_.r.nm=function(){return this.Ub.getPosition()};_.r.start=function(){this.Ed.start()};_.r.play=function(){this.player.play()};
80
+ _.r.pause=function(){this.player.pause()};_.r.destroy=function(){this.Ed.stop();this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()};_.r.Zo=function(){var a=this,b,c;return _.I(function(d){if(a.a.Da())return a.a.pf(),d["return"]();a.Ed.stop();b=HW(a.Ub.le());c=a.Ub.getPosition();return _.x(d,a.a.cast(void 0,{items:b,startIndex:c}),0)})};
81
+ _.r.next=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.Da()?_.x(b,a.a.Bj(),3):b.C(2):2!=b.a?b["return"]():_.x(b,a.Ed.next(),0)})};_.r.Ge=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.Da()?_.x(b,a.a.Cj(),3):b.C(2):2!=b.a?b["return"]():_.x(b,a.Ed.Ge(),0)})};_.K("clpp.cast.playlist.CastPlaylist",GW);GW.prototype.previous=GW.prototype.Ge;GW.prototype.next=GW.prototype.next;GW.prototype.toggleCast=GW.prototype.Zo;GW.prototype.destroy=GW.prototype.destroy;
82
+ GW.prototype.pause=GW.prototype.pause;GW.prototype.play=GW.prototype.play;GW.prototype.start=GW.prototype.start;GW.prototype.getCurrentIndex=GW.prototype.nm;GW.prototype.append=GW.prototype.append;GW.prototype.isCasting=GW.prototype.Da;GW.prototype.getPlaylistItems=GW.prototype.ym;GW.prototype.canCast=GW.prototype.kd;GW.prototype.onCastStatusChanged=GW.prototype.An;GW.prototype.onPlaylistModified=GW.prototype.Sn;GW.prototype.onPlaylistItemChange=GW.prototype.Rn;_.r=IW.prototype;_.r.wb=function(){return"Google Cast Framework"};_.r.xb=function(){return cast.framework.VERSION};_.r.Cb=function(){return 0};_.r.getId=function(){return this.a.id};_.r.getCreativeId=function(){return""};_.r.ac=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};_.r.getPosition=function(){return 0};
83
+ _.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.fc=function(){return!1};_.r.yb=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.nb=function(){return 0};_.r.lb=function(){return 0};_.r.Ya=function(){return 0};_.r.Za=function(){switch(this.Pb()){case 0:return 0;case -1:return 2;default:return 1}};_.r.getPodIndex=function(){return this.j};_.r.Pb=function(){return this.f.position};_.r.Ab=function(){return this.l};
84
+ _.r.ob=function(){return this.h};_.r.getWrapperAdIds=function(){return[]};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.dc=function(){return null};IW.prototype.getVideoElement=IW.prototype.dc;IW.prototype.getWrapperCreativeIds=IW.prototype.getWrapperCreativeIds;IW.prototype.getWrapperAdSystems=IW.prototype.getWrapperAdSystems;IW.prototype.canSeek=IW.prototype.canSeek;IW.prototype.getWrapperAdIds=IW.prototype.getWrapperAdIds;
85
+ IW.prototype.getSequenceLength=IW.prototype.ob;IW.prototype.getPositionInSequence=IW.prototype.Ab;IW.prototype.getPodTimeOffset=IW.prototype.Pb;IW.prototype.getPodIndex=IW.prototype.getPodIndex;IW.prototype.getPodType=IW.prototype.Za;IW.prototype.getMediaBitrate=IW.prototype.Ya;IW.prototype.getMediaHeight=IW.prototype.lb;IW.prototype.getMediaWidth=IW.prototype.nb;IW.prototype.getMediaUrl=IW.prototype.getMediaUrl;IW.prototype.getClickThroughUrl=IW.prototype.yb;IW.prototype.isBumper=IW.prototype.fc;
86
+ IW.prototype.getSkipTimeOffset=IW.prototype.getSkipTimeOffset;IW.prototype.getPosition=IW.prototype.getPosition;IW.prototype.getDuration=IW.prototype.getDuration;IW.prototype.getTitle=IW.prototype.getTitle;IW.prototype.getAdvertiserName=IW.prototype.getAdvertiserName;IW.prototype.getAdSystem=IW.prototype.getAdSystem;IW.prototype.getApiFramework=IW.prototype.getApiFramework;IW.prototype.getSourceId=IW.prototype.ac;IW.prototype.getCreativeId=IW.prototype.getCreativeId;IW.prototype.getId=IW.prototype.getId;
87
+ IW.prototype.getTechnology=IW.prototype.Cb;IW.prototype.getAdManagerVersion=IW.prototype.xb;IW.prototype.getAdManagerName=IW.prototype.wb;JW.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};JW.prototype.Sb=function(){return!!this.a.find(function(a){return 0===a.position})};JW.prototype.Rb=function(){return!!this.a.find(function(a){return-1===a.position})};JW.prototype.hasPostroll=JW.prototype.Rb;JW.prototype.hasPreroll=JW.prototype.Sb;JW.prototype.getCuePoints=JW.prototype.getCuePoints;_.r=LW.prototype;_.r.load=function(){var a=this;return _.I(function(b){MW&&(MW=!1,SW(a,0));_.z(b)})};_.r.Cd=function(){return!0};_.r.md=function(){};_.r.resume=function(){-1!==this.getPosition()&&KW().play()};_.r.pause=function(){-1!==this.getPosition()&&KW().pause()};_.r.skip=function(){};_.r.getVolume=function(){NW.warn(EV);return 0};_.r.setVolume=function(){NW.warn(EV)};_.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.r.jd=function(){return!0};
88
+ _.r.Ic=function(){var a=this;return _.I(function(b){KW().removeEventListener(a.f,a.h);_.z(b)})};
89
+ _.r.Lk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=KW().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.Q(_.Fc,{adsTimeline:new JW(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:RW(this,_.vc,a);break;case cast.framework.events.EventType.BREAK_STARTED:RW(this,_.jc,a);break;case cast.framework.events.EventType.BREAK_ENDED:RW(this,_.kc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:RW(this,
90
+ _.Bc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(RW(this,_.Ac,a),RW(this,_.Cc,a)):a.endedReason===b.STOPPED?RW(this,_.Cc,a):a.endedReason===b.END_OF_STREAM?(RW(this,_.nc,a),RW(this,_.Cc,a)):a.endedReason===b.ERROR&&SW(this,1);break;case cast.framework.events.EventType.PLAYING:RW(this,_.zc,a);break;case cast.framework.events.EventType.PAUSE:RW(this,_.xc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?RW(this,_.lc,a):RW(this,_.zc,a)}};
91
+ LW.prototype.getPosition=LW.prototype.getPosition;LW.prototype.setVolume=LW.prototype.setVolume;LW.prototype.getVolume=LW.prototype.getVolume;LW.prototype.skip=LW.prototype.skip;LW.prototype.pause=LW.prototype.pause;LW.prototype.resume=LW.prototype.resume;var MW=!1,NW=new _.L("clpp.cast.ads.AdsManager");TW.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(UW(),this.f)};TW.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(UW(),this.f)};TW.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return VW(a)})};
92
+ TW.prototype.h=function(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=_.vg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.wg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.xg}b&&this.a(new _.Q(b,{detail:VW(a.timedMetadataInfo)}))}else for(a=_.v(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.a(new _.Q(_.vg,{detail:b.value}))};_.w(WW,_.xt);_.r=WW.prototype;_.r.initialize=function(a){this.m=a;XW().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;XW().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.pa=function(){return this.j};_.r.qa=function(){return null};
93
+ _.r.Va=function(){var a=this.oa();return a&&a.renditions[0]};_.r.$a=function(){var a=this.xa();return a&&a.renditions[0]};_.r.zb=function(){return null};_.r.Nb=function(){return null};_.r.Ob=function(){return null};_.r.Ma=function(){return null};_.r.oa=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};
94
+ _.r.xa=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.pa().find(function(c){return c.id===b})||null)}return a};_.r.Hb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.Ia=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.ab=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.rb=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.Fb=function(a){this.Ia(a&&a.track)};
95
+ _.r.Gb=function(a){this.ab(a&&a.track)};
96
+ _.r.addTextTrack=function(a){var b=this,c,d,e;return _.I(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.x(f,KV(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]),ZW(b)}catch(g){throw b.g.warn("failed on track",
97
+ a),g;}}_.z(f)})};_.r.ya=function(){return!0};_.r.uo=function(){this.f=XW().getAudioTracksManager();var a=this.f.getTracks();this.h=YW(_.X,a);ZW(this);a=this.m.getConfiguration();$W(this,_.X,a.preferredAudioLanguage,a.preferredAudioRole);$W(this,_.at,a.preferredTextLanguage,a.preferredTextRole)};WW.prototype.isAbrEnabled=WW.prototype.ya;WW.prototype.addTextTrack=WW.prototype.addTextTrack;WW.prototype.setTextRendition=WW.prototype.Gb;WW.prototype.setAudioRendition=WW.prototype.Fb;
98
+ WW.prototype.setVideoRendition=WW.prototype.rb;WW.prototype.setTextTrack=WW.prototype.ab;WW.prototype.setAudioTrack=WW.prototype.Ia;WW.prototype.setVideoTrack=WW.prototype.Hb;WW.prototype.getTextTrack=WW.prototype.xa;WW.prototype.getAudioTrack=WW.prototype.oa;WW.prototype.getVideoTrack=WW.prototype.Ma;WW.prototype.getLoadingTextRendition=WW.prototype.Ob;WW.prototype.getLoadingAudioRendition=WW.prototype.Nb;WW.prototype.getLoadingVideoRendition=WW.prototype.zb;WW.prototype.getTextRendition=WW.prototype.$a;
99
+ WW.prototype.getAudioRendition=WW.prototype.Va;WW.prototype.getVideoRendition=WW.prototype.qa;WW.prototype.getTextTracks=WW.prototype.pa;WW.prototype.getAudioTracks=WW.prototype.getAudioTracks;WW.prototype.getVideoTracks=WW.prototype.getVideoTracks;_.w(aX,_.Di);_.r=aX.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=bX();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.Ck.bind(this));d.setMediaPlaybackInfoHandler(this.jk.bind(this));this.a=new oW(this);this.a.init();this.j=new WW;this.j.initialize(this);this.o=new TW(function(e){return c.trigger(e)});this.o.init()};
100
+ _.r.unload=function(){var a=cast.framework.messages.PlayerState,b=bX();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 _.I(function(b){if(1==b.a)return a.B=null,a.w=_.Mn(),a.h=a.w,a.l=-1,a.A=null,a.a?_.x(b,a.a.destroy(),3):b.C(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.z(b)})};
101
+ _.r.play=function(){var a=bX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.r.pause=function(){var a=bX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.r.isPaused=function(){return bX().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
102
+ _.r.isEnded=function(){return bX().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=bX();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(qV);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return this.getMediaPosition()};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.getMediaPosition=function(){return bX().getCurrentTimeSec()};
103
+ _.r.getDuration=function(){return this.getMediaDuration()};_.r.getMediaDuration=function(){var a=bX().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return bX().getPlaybackRate()};_.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;bX().sendLocalMediaRequest(b)}};_.r.getVolume=function(){this.g.warn(EV);return null};_.r.setVolume=function(){this.g.warn(EV)};_.r.setMuted=function(){this.g.warn(EV)};
104
+ _.r.isMuted=function(){this.g.warn(EV);return!1};_.r.getLoadedSource=function(){var a=bX().getMediaInformation();if(a){var b=bX().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,Jp:b,name:c}}return null};_.r.getDrmInfo=function(){return null};_.r.getPresentationStartTime=function(){return bX().getStartAbsoluteTime()};
105
+ _.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=bX().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():7};
106
+ _.r.getStats=function(){var a=_.du();if(this.f){a=bX().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
107
+ _.r.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.cu;b.a.j=b.f.a;b.A=_.Sn(a);b.h=_.On([b.w,a]);if(b.F)return b.F=!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:HV(b.h),local:!0};return _.x(e,bX().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.xa);return new _.gi};
108
+ _.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.nb)};_.r.appendLoad=function(){return Promise.reject(_.nb)};_.r.seekWith=function(){return Promise.reject(_.nb)};_.r.setNetworkEngine=function(a){this.G=a};_.r.setCmsdManager=function(){};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};
109
+ _.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return zV};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(vV)};_.r.onError=function(a){this.trigger(new _.Q(_.qe,{detail:a}))};_.r.canPlay=function(){return _.pj()?2:0};
110
+ _.r.Ck=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=HV(this.getStats());var b=bX(),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&&
111
+ (!e||e&&f)){d=bX().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};
112
+ _.r.jk=function(a,b){var c=null,d=b;a.media.customData&&(c=IV(a.media.customData.playerConfiguration));var e=null,f=null;a.media.customData&&(e=IV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),f=IV(a.media.customData.playerConfiguration));var g=e&&e.LiveConfiguration;g=g?0===g.liveEdgeLatencyMs:!1;e=!(!e||!e.lowLatencyMode);d=null!=f&&f.lowLatencyMode||g||e?cX(d,{streaming:{lowLatencyMode:!0}}):d;if(!c)return d;f=c.chromecast||null;e=c.abr||null;g=d;e&&typeof e.defaultBandwidthEstimate===
113
+ _.k?g.initialBandwidth=e.defaultBandwidthEstimate:g.initialBandwidth=void 0;fX(c,d);e={};g=c.streaming||null;f&&f.useSenderStreamingConfig&&g&&(e.streaming=JV(g,wX));c=c.abr||null;f&&f.useSenderAbrConfig&&c&&(e.abr=JV(c,xX));_.M.Qb(e)&&(d=cX(d,e));return d};_.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r=gX.prototype;_.r.init=function(a){var b=this;a&&(this.f=new aX,_.No(a,this.f),this.m=a,this.l.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.eu?_.x(c,FV(b.m),0):c.C(0)})}))};
114
+ _.r.start=function(){var a=this;if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var b=jX(),c=jX().getPlayerManager(),d=new cast.framework.CastReceiverOptions;d.customNamespaces={};d.customNamespaces[BV]=cast.framework.system.MessageType.JSON;d.customNamespaces[CV]=cast.framework.system.MessageType.JSON;var e=new cast.framework.PlaybackConfig;e.manifestHandler=this.an.bind(this);e.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};e.enableSmoothLiveRefresh=
115
+ !0;d.playbackConfig=e;if(e=this.m&&this.m.getSurface().getMedia())d.mediaElement=e;d.disableIdleTimeout=!0;d.maxInactivity=Infinity;this.h&&(d.queue=this.h);c.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,function(f){a.g.info("QUEUE_UPDATE message received",f);var g=a.getQueueManager();if(!g)return f;g=g.getCurrentItem();return g?(g=g.customData)&&!1===g.skippable?null:f:f});c.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.$m.bind(this));c.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,
116
+ this.cn.bind(this));c.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.F);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.Ek.bind(this));b.start(d);b.addCustomMessageListener(BV,this.B);this.l.on(document,_.Yg,function(){var f={type:"event",name:_.Yg,visible:!document.hidden};jX().sendCustomMessage(CV,void 0,f)})}};
117
+ _.r.stop=function(){if(this.a){this.a=!1;this.l.release();var a=jX();jX().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.F);a.removeCustomMessageListener(BV,this.B);a.stop();this.j=this.h=this.m=this.f=null}};_.r.Je=function(a){this.o=a};_.r.Lo=function(a){this.A=a};_.r.on=function(a,b){jX().addEventListener(a,b)};_.r.off=function(a,b){jX().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.ue&&this.w.add(a)};
118
+ _.r.removeMessageListener=function(a){typeof a===_.ue&&this.w["delete"](a)};_.r.sendMessage=function(a,b){jX().sendCustomMessage(BV,b,a)};_.r.Pc=function(){return this.a};_.r.Lb=function(){return kX()};_.r.kc=function(a){lX(this,a)};_.r.gp=function(a){var b=kX(),c=null;a?c=Object.assign({},b,a):c=b;lX(this,c)};_.r.No=function(a){this.h=a;this.j=null};_.r.getQueueManager=function(){return jX().getPlayerManager().getQueueManager()};
119
+ _.r.Ek=function(){var a=this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,jX().sendCustomMessage(BV,void 0,{type:uV,index:a})))};
120
+ _.r.an=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return nX(this,a);try{var b=(new DOMParser).parseFromString(a,_.tg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=jX();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===_.Sc){g=e[f].getAttribute(_.Ue);for(var h=e[f].getElementsByTagName(_.Ab),l=
121
+ h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Ue)||g,n=h[l].getAttribute(_.Fd),p=h[l].getAttribute(_.gh)||void 0,q=h[l].getAttribute(_.ve)||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(_.Ab).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ka).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Jb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=jX();c=a.getElementsByTagName("StreamIndex");
122
+ for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Sg){e=c[d].getElementsByTagName(_.yb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.eb)||void 0,h=e[f].getAttribute(_.db)||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(_.yb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
123
+ _.r.$m=function(a){var b=this,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=IV(c.media.customData.playerConfiguration));if(!b.m||!d){l.C(2);break}if(!b.o){l.C(3);break}return _.x(l,Promise.resolve(b.o(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.C(5);break}return _.x(l,PW(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.C(7);
124
+ break}b.f.F=!0;return _.x(l,_.Xo(b.m,d),8);case 8:return _.x(l,_.Yo(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.mc&&(c.media.hlsVideoSegmentFormat=LV(f.mc,_.bt)),f.ib&&(c.media.hlsSegmentFormat=LV(f.ib,_.X));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.A){l.C(10);break}return _.x(l,
125
+ Promise.resolve(b.A(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.r.cn=function(a){var b=a.media;b&&b.tracks&&b.tracks.length&&oX(b.tracks);if((b=a.items)&&b.length){b=_.v(b);for(var c=b.next();!c.done;c=b.next())(c=(c=c.value)&&c.media)&&c.tracks&&c.tracks.length&&oX(c.tracks)}return a};
126
+ _.r.Jn=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.M.Nm;var b=jX().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))}_.So(this.m)}};_.r.Dk=function(a){this.w.forEach(function(b){return b(a.data)})};_.K(AV,gX);gX.prototype.getQueueManager=gX.prototype.getQueueManager;
127
+ gX.prototype.setQueue=gX.prototype.No;gX.prototype.updateContentMetadata=gX.prototype.gp;gX.prototype.setContentMetadata=gX.prototype.kc;gX.prototype.getContentMetadata=gX.prototype.Lb;gX.prototype.isApiReady=gX.prototype.Pc;gX.prototype.sendMessage=gX.prototype.sendMessage;gX.prototype.removeMessageListener=gX.prototype.removeMessageListener;gX.prototype.addMessageListener=gX.prototype.addMessageListener;gX.prototype.off=gX.prototype.off;gX.prototype.on=gX.prototype.on;
128
+ gX.prototype.setLoadRequestDataInterceptor=gX.prototype.Lo;gX.prototype.setPlayerConfigInterceptor=gX.prototype.Je;gX.prototype.stop=gX.prototype.stop;gX.prototype.start=gX.prototype.start;gX.prototype.init=gX.prototype.init;gX.getInstance=iX;var hX=null;_.r=qX.prototype;_.r.load=function(){return _.I(function(a){_.z(a)})};_.r.Cd=function(){return!0};_.r.md=function(){};_.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()};_.r.skip=function(){var a=this.h.a;a&&this.h.sendMessage(DV,{type:"SKIP_AD",requestId:OV(),mediaSessionId:a.mediaSessionId})};
129
+ _.r.getVolume=function(){return this.h.getVolume()||0};_.r.setVolume=function(a){this.h.setVolume(a)};_.r.getPosition=function(){var a=-1,b=this.h.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.r.jd=function(){return!0};_.r.Ic=function(){var a=this;return _.I(function(b){a.j.release();_.z(b)})};
130
+ _.r.ao=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.h.trigger(new _.Q(_.Fc,{adsTimeline:new JW(a.breaks)})));break;case "isPlayingBreak":a.value?rX(this,_.jc):(rX(this,_.nc,this.f),rX(this,_.Cc,this.f),this.f=null,rX(this,_.kc));break;case "isPaused":this.f&&(a.value?rX(this,_.xc):rX(this,_.zc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(rX(this,_.nc,this.f),rX(this,_.Cc,this.f),this.f=sX(this),rX(this,_.Bc,this.f)));break;
131
+ default:this.f||(this.f=sX(this))&&rX(this,_.Bc,this.f)}};qX.prototype.getPosition=qX.prototype.getPosition;qX.prototype.setVolume=qX.prototype.setVolume;qX.prototype.getVolume=qX.prototype.getVolume;qX.prototype.skip=qX.prototype.skip;qX.prototype.pause=qX.prototype.pause;qX.prototype.resume=qX.prototype.resume;tX.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};tX.prototype.a=function(a,b){return a.namespace()!==_.xd?!1:!(!b||!b.ima)};tX.prototype.create=function(a){return new qX(a.a)};uX.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};uX.prototype.a=function(a,b){return iX().Pc()?!(!b||!b.ima):!1};uX.prototype.create=function(a){return new LW(a)};_.K("clpp.cast.createCastQueue",function(){vX=function(){return cast.framework.QueueBase.apply(this,arguments)||this};_.w(vX,cast.framework.QueueBase);vX.prototype.initialize=function(a){var b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b};return new vX});_.ei(new tX);_.ei(new uX);};
120
132
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
121
133
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
122
134
  else{_=this.clpp._;(f.call(g,this));}