@castlabs/prestoplay 6.20.0-beta.1 → 6.20.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 (59) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +8 -6
  3. package/cjs/cl.adobe.js +1 -1
  4. package/cjs/cl.airplay.js +3 -3
  5. package/cjs/cl.broadpeak.js +1 -1
  6. package/cjs/cl.cast.js +69 -70
  7. package/cjs/cl.conviva.js +6 -6
  8. package/cjs/cl.core.js +274 -274
  9. package/cjs/cl.crypto.js +5 -5
  10. package/cjs/cl.dash.js +46 -46
  11. package/cjs/cl.externs.js +31 -31
  12. package/cjs/cl.freewheel.js +11 -11
  13. package/cjs/cl.hls.js +56 -56
  14. package/cjs/cl.hlssmpte.js +3 -3
  15. package/cjs/cl.htmlcue.js +7 -7
  16. package/cjs/cl.ima.js +23 -23
  17. package/cjs/cl.mse.js +142 -142
  18. package/cjs/cl.muxdata.js +7 -7
  19. package/cjs/cl.onboard.js +1 -1
  20. package/cjs/cl.persistent.js +8 -8
  21. package/cjs/cl.playlist.js +4 -4
  22. package/cjs/cl.sessions.js +4 -4
  23. package/cjs/cl.simid.js +2 -2
  24. package/cjs/cl.smooth.js +25 -25
  25. package/cjs/cl.thumbnails.js +17 -17
  26. package/cjs/cl.tizen.js +32 -32
  27. package/cjs/cl.ttml.js +3 -3
  28. package/cjs/cl.verimatrix.js +4 -4
  29. package/cjs/cl.vimond.js +6 -6
  30. package/cjs/cl.vr.js +9 -9
  31. package/cjs/cl.vtt.js +8 -8
  32. package/cjs/cl.youbora.js +6 -6
  33. package/cl.adobe.js +2 -2
  34. package/cl.cast.js +45 -45
  35. package/cl.conviva.js +2 -2
  36. package/cl.core.js +93 -93
  37. package/cl.crypto.js +5 -5
  38. package/cl.dash.js +14 -14
  39. package/cl.externs.js +31 -31
  40. package/cl.freewheel.js +7 -7
  41. package/cl.hls.js +34 -34
  42. package/cl.htmlcue.js +1 -1
  43. package/cl.ima.js +15 -15
  44. package/cl.mse.js +78 -78
  45. package/cl.muxdata.js +3 -3
  46. package/cl.onboard.js +2 -2
  47. package/cl.persistent.js +1 -1
  48. package/cl.playlist.js +4 -4
  49. package/cl.sessions.js +2 -2
  50. package/cl.smooth.js +18 -18
  51. package/cl.thumbnails.js +4 -4
  52. package/cl.tizen.js +6 -6
  53. package/cl.verimatrix.js +2 -2
  54. package/cl.vimond.js +1 -1
  55. package/cl.vtt.js +2 -2
  56. package/cl.youbora.js +4 -4
  57. package/clpp.styles.css +0 -8
  58. package/package.json +1 -1
  59. package/typings.d.ts +26 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # 6.20.0
2
2
 
3
+ ## **Warning!**
4
+
5
+ Changes in this release might be breaking for some very specific use cases:
6
+
7
+ * Disallow passing a config with the `license` attribute into `player.load()`
8
+ and throw an error if it happens. License is intended to be passed into
9
+ the player constructor only.
10
+
3
11
  ## New Features
4
12
 
5
13
  * On Safari with native player improve support for timeline cues:
@@ -12,6 +20,8 @@
12
20
  ## Changes
13
21
 
14
22
  * Recognize MP3 file extension.
23
+ * Fix the payload of ad events emitted for HLS interstitial ads.
24
+ * Fix audio and subtitle track selection when casting to Chromecast devices.
15
25
 
16
26
  # 6.19.1
17
27
 
package/README.md CHANGED
@@ -20,16 +20,18 @@ Once installed, you can follow the [getting started guide](https://demo.castlabs
20
20
  example, but here is how it would look like:
21
21
 
22
22
  ```javascript
23
- import {clpp} from "@castlabs/prestoplay"
24
- import "@castlabs/prestoplay/cl.mse"
25
- import "@castlabs/prestoplay/cl.dash"
23
+ import { clpp } from "@castlabs/prestoplay";
24
+ import "@castlabs/prestoplay/cl.mse";
25
+ import "@castlabs/prestoplay/cl.dash";
26
+
27
+ clpp.install(clpp.dash.DashComponent);
26
28
 
27
29
  const player = new clpp.Player("video");
28
- player.use(clpp.dash.DashComponent);
29
30
 
30
31
  player.load({
31
- source: "https://content.players.castlabs.com/demos/clear-segmented/manifest.mpd"
32
- })
32
+ source: "https://content.players.castlabs.com/demos/clear-segmented/manifest.mpd",
33
+ autoplay: true,
34
+ });
33
35
  ```
34
36
 
35
37
  There is also an accompanying stylesheet that can be found in:
package/cjs/cl.adobe.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
2
  var f=function(window){var FW=function(){this.m=this.f=null;this.a="";this.g=new _.K("clpp.adobe.AdobePlugin")},IW=function(a){a.f=new _.Qh;a.f.on(a.m,_.xg,function(){return GW(a)});a.f.on(a.m,_.wg,function(){s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.He,function(){return HW(a)});a.f.on(a.m,_.cg,function(b){b=b.detail;switch(b.currentState){case _.Mp:a.a.length||HW(a);s.Media.play(a.a,a.m.getPosition());break;case _.Lp:case _.Dp:GW(a);break;case _.Fp:case _.yp:case _.Jp:a.g.info("Close session for "+a.a+" in player state "+
3
- (b.currentState+".")),GW(a),s.Media.close(a.a),a.a=""}})},HW=function(a){var b=a.m.getLoadedSource();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.m.getDuration());s.Media.open(a.a,a.m.getDuration(),_.va)},GW=function(a){s.Media.stop(a.a,a.m.getPosition())},JW=function(){};_.x(FW,_.ev);FW.prototype.onPlayerCreated=function(a){window.s&&s.Media?(this.m=a,IW(this)):this.g.warn("Adobe API not available.")};
3
+ (b.currentState+".")),GW(a),s.Media.close(a.a),a.a=""}})},HW=function(a){var b=a.m.getLoadedSource();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.m.getDuration());s.Media.open(a.a,a.m.getDuration(),_.va)},GW=function(a){s.Media.stop(a.a,a.m.getPosition())},JW=function(){};_.x(FW,_.ev);FW.prototype.onPlayerCreated=function(a){var b=a.getConfiguration().adobe;b&&!1===b.enabled?this.g.debug("Adobe plugin is disabled."):window.s&&s.Media?(this.m=a,IW(this)):this.g.warn("Adobe API not available.")};
4
4
  FW.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""};FW.prototype.id=function(){return"adobe"};_.J("clpp.adobe.AdobeAnalyticsPlugin",FW);FW.Id="adobe";JW.prototype.create=function(){return new FW};_.Fs(new JW);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
package/cjs/cl.airplay.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var DW=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.jl(function(){a.m.play()["catch"](function(){})});this.h=new _.Qh},EW=function(){};_.x(DW,_.ev);_.u=DW.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.u.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.gm.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Im.bind(this)))};
3
- _.u.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.u.id=function(){return"airplay"};_.u.gm=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.L(_.Qc,{canCast:this.f}))};_.u.Im=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Pc:_.Oc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Mp)this.l?this.m.play()["catch"](function(){}):this.o.ea(.01);this.m.trigger(new _.L(a))};_.u.Hb=function(){return this.j};
4
- _.u.tf=function(){return this.f};_.u.wn=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.J("clpp.airplay.AirPlayPlugin",DW);DW.prototype.showCastMenu=DW.prototype.wn;DW.prototype.canCast=DW.prototype.tf;DW.prototype.isCasting=DW.prototype.Hb;DW.Id="airplay";EW.prototype.create=function(){return new DW};_.Fs(new EW);};
2
+ var f=function(window){var DW=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.jl(function(){a.m.play()["catch"](function(){})});this.h=new _.Qh},EW=function(){};_.x(DW,_.ev);_.u=DW.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.u.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.gm.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Jm.bind(this)))};
3
+ _.u.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.u.id=function(){return"airplay"};_.u.gm=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.L(_.Qc,{canCast:this.f}))};_.u.Jm=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Pc:_.Oc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Mp)this.l?this.m.play()["catch"](function(){}):this.o.ea(.01);this.m.trigger(new _.L(a))};_.u.Hb=function(){return this.j};
4
+ _.u.tf=function(){return this.f};_.u.yn=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.J("clpp.airplay.AirPlayPlugin",DW);DW.prototype.showCastMenu=DW.prototype.yn;DW.prototype.canCast=DW.prototype.tf;DW.prototype.isCasting=DW.prototype.Hb;DW.Id="airplay";EW.prototype.create=function(){return new DW};_.Fs(new EW);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}
@@ -3,7 +3,7 @@ var f=function(window){var vW=function(a,b){this.m=a;this.f=b;this.a=new _.Qh;th
3
3
  0:1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){return 1E3*this.m.getPosition()};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};return new b(a)},xW=function(){this.l=this.f=this.a=this.h=this.m=null;this.o=new _.Qh;this.j=!1},yW=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof f===_.fg&&a.h.setUUID(f))},zW=
4
4
  function(a,b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var d in c)a.a.setCustomParameter(d,c[d]);a.o.on(a.m,_.ne,a.S.bind(a));a.l=wW(a.m);a.a.attachPlayer(a.l)},AW=function(a,b){_.Th(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},BW=function(){return!window.SmartLib||!window.GenericPlayerApi},CW=function(){};_.u=vW.prototype;
5
5
  _.u.init=function(){var a=this.m,b=this.a;b.on(a,_.cg,this.sj.bind(this));b.on(a,_.hd,this.qj.bind(this));b.on(a,"seek",this.rj.bind(this))};_.u.qj=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.u.sj=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.Dp&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Dp:c.notifyStallStart();break;case _.Mp:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Lp:c.notifyPause()}};
6
- _.u.rj=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.u.release=function(){this.a&&(_.Th(this.a),this.a=null)};_.x(xW,_.ev);_.u=xW.prototype;_.u.onPlayerCreated=function(a){this.m=a};_.u.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(BW())return a.onError(new _.O(1,9,11E3));this.j=!0;yW(this,d);zW(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.O(1,9,11001,{bpkErrorCode:f,message:e}));AW(c,void 0)}else b.url=e.getURL(),c.f=new vW(c.m,c.l),c.f.init()})}};
6
+ _.u.rj=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.u.release=function(){this.a&&(_.Th(this.a),this.a=null)};_.x(xW,_.ev);_.u=xW.prototype;_.u.onPlayerCreated=function(a){this.m=a};_.u.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(BW())return a.onError(new _.N(1,9,11E3));this.j=!0;yW(this,d);zW(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.N(1,9,11001,{bpkErrorCode:f,message:e}));AW(c,void 0)}else b.url=e.getURL(),c.f=new vW(c.m,c.l),c.f.init()})}};
7
7
  _.u.onContentLoaded=function(){!1!==this.j&&this.a.precacheEnded()};_.u.S=function(a){a=a.detail;if(7003===a.code)AW(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.P)switch(a.category){case 3:AW(this,SmartLib.BPDecodingError);break;case 1:AW(this,SmartLib.BPNetworkingError);break;case 6:AW(this,SmartLib.BPAccessRightError);break;default:AW(this,SmartLib.BPUnspecifiedError)}};_.u.onPlayerWillRelease=function(){BW()||AW(this,SmartLib.BPSessionEndsNormally);this.j=!1};_.u.id=function(){return"broadpeak"};
8
8
  _.J("clpp.broadpeak.BroadpeakPlugin",xW);xW.isSdkMissing=BW;xW.Id="broadpeak";CW.prototype.create=function(){return new xW};_.Fs(new CW);};
9
9
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
package/cjs/cl.cast.js CHANGED
@@ -1,120 +1,119 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var FU="Cannot seek during ads playout.",GU="Cannot switch track",HU="Media session does not exist.",IU="No receivers available",JU="Reset ABR functionality not available on cast.",KU="SDK not yet ready",LU="Sender is destroyed.",MU="clpp.cast.CastProxy",NU="clpp.cast.Player",OU="clpp.cast.Receiver",PU="urn:x-cast:castlabs",QU="urn:x-cast:com.google.cast.media",RU=function(a){return _.I(function(b){return 1==b.a?_.y(b,a.Ac(_.Ye),2):_.y(b,a.Ac(_.Xe),0)})},SU=function(a,b){this.log=new _.K(b);this.player=
2
+ var f=function(window){var FU="Cannot seek during ads playout.",GU="Cannot switch track",HU="Media session does not exist.",IU="No receivers available",JU="Reset ABR functionality not available on cast.",KU="SDK not yet ready",LU="Sender is destroyed.",MU="clpp.cast.CastProxy",NU="clpp.cast.Player",OU="clpp.cast.Receiver",PU="urn:x-cast:castlabs",QU="urn:x-cast:com.google.cast.media",RU=function(a){return _.I(function(b){return 1==b.a?_.y(b,a.zc(_.Ye),2):_.y(b,a.zc(_.Xe),0)})},SU=function(a,b){this.log=new _.K(b);this.player=
3
3
  a;this.j=null;this.f=_.yp;this.l=_.zp;this.h=2;this.B=Date.now();this.A=-1},TU=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.re){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ue?"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}})},UU=function(a){if(typeof a!==_.fg)return a;try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:
4
4
  "Infinity"===c?Infinity:c})}catch(b){return a}},VU=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=_.Xk(d,a.mimeType,g);if(!f||!g)return q.F(2);l=_.Wj(a.url);return _.y(q,c.fetch(l).U,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.xj(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)})},WU=function(a,b){if(window.chrome&&
5
5
  chrome.cast&&chrome.cast.media){var c=chrome.cast.media.HlsSegmentFormat;var d=chrome.cast.media.HlsVideoSegmentFormat}else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.Fg:return d.FMP4;case _.Eg:return b===_.yk?d.MPEG2_TS:c.TS;case _.ad:return c.AAC;case _.bd:return c.AC3;case _.cd:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.dd:return c.FMP4}},YU=function(a){a=
6
- void 0===a?XU: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;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},ZU=function(a){SU.call(this,a,"clpp.cast.SenderStateManager");
7
- this.o=this.a=null;this.w=this.Ub.bind(this)},$U=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},aV=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},cV=function(a,b){var c=aV(a);return bV(a,b).find(function(d){return c.includes(d.id)})||null},bV=function(a,b){return a.h.filter(function(c){return c.type===b})},eV=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.T){var e=a.xa();
8
- e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;dV(a,b)},function(f){a.f[b]=null;a.g.debug(GU,f)})}else b===_.T&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){dV(a,b)},function(f){a.g.debug(GU,f)}))},dV=function(a,b){b===_.xk?a.a.trigger(new _.L(_.cm)):b===_.T&&a.a.trigger(new _.L(_.dm))},iV=function(a,b,c,d){_.jm.call(this);this.g=new _.K(_.Ad);this.ba=a;this.o=new _.ll(b);this.$=c;this.fa=d;this.h=this.J=
9
- _.pm();this.C=[];this.B=0;this.L=new _.rk;this.H=this.l=this.a=null;this.A=this.w=!1;this.ha="";this.Fa=1E6;this.f=new $U;this.f.initialize(this);this.j=new ZU(this);this.I=new _.Qh;this.K=null;this.G=new Set;this.P=this.im.bind(this);this.ta=this.Cm.bind(this);this.ca=this.um.bind(this);this.V=this.mm.bind(this);this.N=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){fV(!0)},0)}});gV(this);hV.add(this)},
10
- jV=function(a){var b,c;return _.I(function(d){if(1==d.a)return hV["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.ta)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.y(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.$=null;a.fa=null;_.A(d)})},lV=function(a){if(!a)return null;
6
+ void 0===a?XU: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;default:return new d}},ZU=function(a){SU.call(this,a,"clpp.cast.SenderStateManager");
7
+ this.o=this.a=null;this.w=this.Ub.bind(this)},$U=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},aV=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},cV=function(a,b){var c=aV(a);return bV(a,b).find(function(d){return c.includes(d.id)})||null},bV=function(a,b){return a.h.filter(function(c){return c.type===b})},eV=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.S){var e=a.xa();
8
+ e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;dV(a,b)},function(f){a.f[b]=null;a.g.debug(GU,f)})}else b===_.S&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){dV(a,b)},function(f){a.g.debug(GU,f)}))},dV=function(a,b){b===_.xk?a.a.trigger(new _.L(_.cm)):b===_.S&&a.a.trigger(new _.L(_.dm))},iV=function(a,b,c,d){_.jm.call(this);this.g=new _.K(_.Ad);this.ba=a;this.o=new _.ll(b);this.$=c;this.fa=d;this.h=this.J=
9
+ _.pm();this.C=[];this.B=0;this.L=new _.rk;this.G=this.l=this.a=null;this.A=this.w=!1;this.ga="";this.Fa=1E6;this.f=new $U;this.f.initialize(this);this.j=new ZU(this);this.H=new _.Qh;this.K=null;this.I=new Set;this.P=this.im.bind(this);this.ta=this.Dm.bind(this);this.ca=this.vm.bind(this);this.V=this.mm.bind(this);this.N=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){fV(!0)},0)}});gV(this);hV.add(this)},
10
+ jV=function(a){var b,c;return _.I(function(d){if(1==d.a)return hV["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.ta)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.y(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.$=null;a.fa=null;_.B(d)})},lV=function(a){if(!a)return null;
11
11
  a:{var b=a.metadataType;var c=Object.entries(kV);c=_.w(c);for(var d=c.next();!d.done;d=c.next()){d=_.w(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=YU(kV[b]);return Object.assign(b,a)},mV=function(a){var b=void 0===b?XU:b;return Object.values(kV).includes(a)?a:b},sV=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},gV=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
12
12
  a.ba.length){a.w=!0;a.o.wg();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.ba;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ta);xV&&a.o.ea(.02)}},CV=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.k?null:a):a=
13
- null;a=null===a?null:a+b;return null===a?b:a},EV=function(a,b){DV(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ca);b.addMessageListener(PU,a.V)},DV=function(a,b){a.a=b;a.a&&(a.I.release(),a.H=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.H=new cast.framework.RemotePlayerController(a.l),a.I.on(a.H,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.tj.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.L(_.He)))},FV=function(a){return _.I(function(b){return a.Hb()?
14
- b.F(0):_.y(b,cast.framework.CastContext.getInstance().requestSession(),0)})},GV=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,B,F,G,C;return _.I(function(H){switch(H.a){case 1:return c=chrome.cast.media.StreamType,d=_.xv,_.y(H,FV(a),2);case 2:if(!b)return H["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.tracks.map(function(M){switch(M.type){case d.VIDEO:var R=chrome.cast.media.TrackType.VIDEO;
15
- break;case d.AUDIO:R=chrome.cast.media.TrackType.AUDIO;break;case d.TEXT:R=chrome.cast.media.TrackType.TEXT;break;default:R=chrome.cast.media.TrackType.TEXT}R=new chrome.cast.media.Track(+M.id,R);R.language=M.language;R.name=M.label||null;R.trackContentId=M.src;R.trackContentType=M.mimeType;R.customData={mimeType:M.mimeType,url:M.src};return R});g.tracks=h;l=b;m=l.Yb;n=l.audioMimeType;g.hlsVideoSegmentFormat=WU(m,d.VIDEO);g.hlsSegmentFormat=WU(n,d.AUDIO);if(!b.bb){H.F(3);break}if(!a.N){H.F(4);break}return _.y(H,
16
- Promise.resolve(a.N(b.bb)),5);case 5:if(p=H.f)b.bb=p;case 4:a.h=b.bb;a.C=_.Qp(a.h);a.B=a.C.findIndex(function(M){return M.url===b.source.url});if(!b.bb.remoteTextTracks){H.F(6);break}return _.y(H,Promise.all(b.bb.remoteTextTracks.map(a.Fk.bind(a))),7);case 7:q=H.f,g.tracks=q.filter(function(M){return M}),b.bb.remoteTextTracks=void 0;case 6:delete b.bb.autoplay,b.bb.startTime=null,g.customData={playerConfiguration:TU(b.bb)};case 3:t=a.zb()||{};v=mV(t.metadataType);typeof b.gg===_.k&&(z={metadataType:v,
17
- sectionStartAbsoluteTime:b.gg});b.source.name&&(B={metadataType:v,title:b.source.name});F=sV(t);if(G=lV(Object.assign({},z,B,F)))g.metadata=G;C=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.id&&(C.autoplay=b.autoplay);typeof b.currentTime===_.k&&(C.currentTime=b.currentTime);return _.y(H,f.loadMedia(C),0)}})},HV=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.f.xa())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.f.ma())&&e.language&&(a.h.preferredAudioLanguage=
18
- e.language);return _.y(f,GV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),gg:a.getPresentationStartTime(),autoplay:b,bb:a.h}),0)})},fV=function(a){if(a){a=_.w(hV);for(var b=a.next();!b.done;b=a.next())gV(b.value)}},JV=function(a,b,c){_.jm.call(this);var d=this;this.f=a;this.h=b;this.j=typeof c===_.re?c:function(e,f){d.f&&e!==_.Fp&&e!==_.yp&&d.f.load(f)};this.a=IV(this);this.g=new _.K(MU);this.f&&this.forwardEventsTo(this.f)},IV=function(a){return new iV(a.h,function(){a.trigger(new _.L(_.pd))},
19
- 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.Ig&&(d.preferredAudioLanguage=c.Ig);c.Ki&&(d.preferredTextLanguage=c.Ki);_.ss(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return KV(a)})},KV=function(a){var b;return _.I(function(c){if(1==c.a)return a.trigger(new _.L(_.od)),b=a.f.a,b!==a.a&&a.f&&a.a?_.y(c,a.f.release(),2):c["return"]();
20
- _.ss(a.f,a.a);_.A(c)})},LV=function(a){SU.call(this,a,"clpp.cast.StateManager");this.I=this.xj.bind(this);this.H=this.wj.bind(this);this.w=this.qm.bind(this);this.o=this.hm.bind(this);this.K=this.zj.bind(this);this.J=this.yj.bind(this);this.L=this.Fm.bind(this);this.G=this.tm.bind(this);this.C=this.S.bind(this);this.a=this.vj.bind(this)},MV=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},NV=function(a){this.a=a},PV=function(a){this.m=
21
- a;this.a=null;this.h=this.Aj.bind(this);this.f=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];OV().addEventListener(this.f,this.h)},SV=function(a,
22
- 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"]();_.D(n,2);QV=!1;e=_.Wj(d);return _.y(n,c.fetch(e).U,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.S.aa(f.data),h=new DOMParser,l=h.parseFromString(g,_.mg),l.getElementsByTagName("vmap:VMAP").length)_.Bh("VMAP detected."),a.vmapAdsRequest=RV(g);else if(l.getElementsByTagName("VAST").length){_.Bh("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=RV(g);var q=new cast.framework.messages.Break("b1",
23
- [p.id],0);a.breakClips=[p];a.breaks=[q]}else _.Bh("Unsupported schema."),QV=!0;return _.mh(n,0)}m=_.E(n);_.Bh("Failed to fetch an ad",m);QV=!0;_.A(n)})},RV=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},OV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},UV=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=TV(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},VV=function(a,
24
- b){var c=new _.O(1,10,10003,{errorType:b});a.m.onError(c)},TV=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.fg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.fg&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,h){return g.position-h.position}).findIndex(function(g){return g===
25
- e})));c=new MV(d,e,b.index,b.total,f)}return c},WV=function(a){this.fb=a;this.a=this.f.bind(this)},XV=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]},YV=function(a){var b=a.dashTimedMetadata,c=_.vg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.ug)?_.pi:_.sg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,
26
- value:b&&b.value||"",eventElement:b?b.eventElement:null}},ZV=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.Zm.bind(this);this.a=this.f=null},$V=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},bW=function(a){a.a=$V().getTextTracksManager();var b=a.a.getTracks();a.j=aW(_.T,b)},cW=function(a,b,c,d){c=_.ti(c).filter(function(h){return h});var e=!1,f=[];b===_.xk?f=a.getAudioTracks():b===_.T&&(f=a.ga());
27
- if(c=c.find(function(h){var l=_.oj(h);return f.some(function(m){m=_.oj(m.language||"");return _.pj(l,m)})})){var g=_.oj(c);c=f.filter(function(h){h=_.oj(h.language||"");return _.pj(g,h)});f=c.length?c:f;e=e||!!c.length}_.S.Me(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.xk?a.Da(e):b===_.T&&a.Qa(e))},aW=function(a,b){for(var c=[],d=_.w(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.vk(e.trackId.toString(),
28
- 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 _.Ek(f.id,f));c.push(f)}return c},dW=function(){_.jm.call(this);this.g=new _.K(NU);this.h=this.w=_.pm();this.A=null;this.l=-1;this.G=new _.rk;this.f=this.o=this.j=this.a=this.B=null;this.C=!1},
29
- eW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},hW=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0}if(a&&a.drm){var d=a.drm,e=_.Nm(d);if(e){var f=[_.Nd];_.Qp(a)[0].type!==_.Yc&&f.unshift(_.Pd);d.preferredDrmSystem===_.Nd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.eb[g];h?(d=g===_.Pd?cast.framework.ContentProtection.WIDEVINE:g===_.Nd?cast.framework.ContentProtection.PLAYREADY:
30
- void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},fW(b,h,a,d),gW(b,h,a,d)):c()}else c()}else c()},fW=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.Wj({method:_.Ib,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=
31
- void 0},gW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.ak(Object.assign({},f.headers),e.buffer,200,""),_.y(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.xj(g.data))})}:a.licenseHandler=void 0},iW=function(){this.a=!1;this.g=new _.K(OU);this.f=this.m=null;this.h=new Set;this.A=this.sm.bind(this);this.w=this.uj.bind(this);this.j=null;this.o=new _.Qh;this.l=null},kW=function(){return jW||(jW=new iW)},lW=function(){return cast.framework.CastReceiverContext.getInstance()},
32
- mW=function(){var a=lW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},nW=function(a,b){var c=lW().getPlayerManager().getMediaInformation();if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;lW().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},pW=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=lW();c=(lW().getPlayerManager().getMediaInformation()||
33
- {}).hlsVideoSegmentFormat===c.FMP4?_.Fg:_.Eg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var h=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=oW(h,_.sa),m=oW(h,_.Rb),n=_.w([]),p=n.next().value;n=n.next().value;m&&(m=_.w(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")},oW=function(a,b){b+="\x3d";var c=a.indexOf(b);if(0<=c){var d=a.substring(c+
34
- 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},qW=function(a){this.f=a;this.a=null;this.h=new _.Qh;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]},sW=function(a,b){var c=null,d=rW(a);d&&(c={ad:d});a.f.trigger(new _.L(b,
35
- c))},rW=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(h){return h.id===a.a.breakId})||null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position: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 MV(d,c,e,f,g)}return b},
36
- tW=function(){},uW=function(){};_.u=SU.prototype;_.u.release=function(){this.va(_.yp)};_.u.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.u.getState=function(){return this.f};_.u.onError=function(a){a.severity===_.P&&this.va(_.Jp)};
13
+ null;a=null===a?null:a+b;return null===a?b:a},EV=function(a,b){DV(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ca);b.addMessageListener(PU,a.V)},DV=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,a.tj.bind(a)),a.H.on(a.G,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.um.bind(a)),
14
+ a.j&&a.j.init(),a.trigger(new _.L(_.He)))},FV=function(a){return _.I(function(b){return a.Hb()?b.F(0):_.y(b,cast.framework.CastContext.getInstance().requestSession(),0)})},GV=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,C,F,G;return _.I(function(A){switch(A.a){case 1:return c=chrome.cast.media.StreamType,d=_.xv,_.y(A,FV(a),2);case 2:if(!b)return A["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);g.streamType=
15
+ b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.Yb;m=h.audioMimeType;g.hlsVideoSegmentFormat=WU(l,d.VIDEO);g.hlsSegmentFormat=WU(m,d.AUDIO);if(!b.bb){A.F(3);break}if(!a.N){A.F(4);break}return _.y(A,Promise.resolve(a.N(b.bb)),5);case 5:if(n=A.f)b.bb=n;case 4:a.h=b.bb;a.C=_.Qp(a.h);a.B=a.C.findIndex(function(H){return H.url===b.source.url});if(!b.bb.remoteTextTracks){A.F(6);break}return _.y(A,Promise.all(b.bb.remoteTextTracks.map(a.Fk.bind(a))),7);case 7:p=A.f,g.tracks=p.filter(function(H){return H}),b.bb.remoteTextTracks=
16
+ void 0;case 6:delete b.bb.autoplay,b.bb.startTime=null,g.customData={playerConfiguration:TU(b.bb)};case 3:q=a.zb()||{};t=mV(q.metadataType);typeof b.gg===_.k&&(v={metadataType:t,sectionStartAbsoluteTime:b.gg});b.source.name&&(z={metadataType:t,title:b.source.name});C=sV(q);if(F=lV(Object.assign({},v,z,C)))g.metadata=F;G=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.id&&(G.autoplay=b.autoplay);typeof b.currentTime===_.k&&(G.currentTime=b.currentTime);return _.y(A,f.loadMedia(G),0)}})},
17
+ HV=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.f.xa())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.f.ma())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.y(f,GV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),gg:a.getPresentationStartTime(),autoplay:b,bb:a.h}),0)})},fV=function(a){if(a){a=_.w(hV);for(var b=a.next();!b.done;b=a.next())gV(b.value)}},JV=function(a,b,c){_.jm.call(this);this.f=a;this.h=b;this.j=typeof c===_.re?c:this.mn;
18
+ this.a=IV(this);this.g=new _.K(MU);this.f&&this.forwardEventsTo(this.f)},IV=function(a){return new iV(a.h,function(){a.trigger(new _.L(_.pd))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Ig&&(d.preferredAudioLanguage=c.Ig);c.Ki&&(d.preferredTextLanguage=c.Ki);_.ss(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return KV(a)})},KV=function(a){var b;
19
+ return _.I(function(c){if(1==c.a)return a.trigger(new _.L(_.od)),b=a.f.a,b!==a.a&&a.f&&a.a?_.y(c,a.f.release(),2):c["return"]();_.ss(a.f,a.a);_.B(c)})},LV=function(a){SU.call(this,a,"clpp.cast.StateManager");this.I=this.xj.bind(this);this.H=this.wj.bind(this);this.w=this.qm.bind(this);this.o=this.hm.bind(this);this.K=this.zj.bind(this);this.J=this.yj.bind(this);this.L=this.Gm.bind(this);this.G=this.tm.bind(this);this.C=this.S.bind(this);this.a=this.vj.bind(this)},MV=function(a,b,c,d,e){this.a=a;this.f=
20
+ b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},NV=function(a){this.a=a},PV=function(a){this.m=a;this.a=null;this.h=this.Aj.bind(this);this.f=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,
21
+ cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];OV().addEventListener(this.f,this.h)},SV=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"]();_.D(n,2);QV=!1;e=_.Wj(d);return _.y(n,c.fetch(e).U,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.aa(f.data),h=new DOMParser,l=h.parseFromString(g,_.mg),l.getElementsByTagName("vmap:VMAP").length)_.Bh("VMAP detected."),a.vmapAdsRequest=RV(g);else if(l.getElementsByTagName("VAST").length){_.Bh("VAST detected.");
22
+ var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=RV(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.Bh("Unsupported schema."),QV=!0;return _.mh(n,0)}m=_.E(n);_.Bh("Failed to fetch an ad",m);QV=!0;_.B(n)})},RV=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},OV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},UV=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||
23
+ -1!==a.getPosition()){var d=null;(c=TV(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},VV=function(a,b){var c=new _.N(1,10,10003,{errorType:b});a.m.onError(c)},TV=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.fg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.fg&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=
24
+ g.position}).sort(function(g,h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new MV(d,e,b.index,b.total,f)}return c},WV=function(a){this.fb=a;this.a=this.f.bind(this)},XV=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]},YV=function(a){var b=a.dashTimedMetadata,c=_.vg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.ug)?
25
+ _.pi:_.sg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},ZV=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.$m.bind(this);this.a=this.f=null},$V=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},bW=function(a){a.a=$V().getTextTracksManager();var b=a.a.getTracks();a.j=aW(_.S,b)},cW=function(a,b,c,d){c=_.ti(c).filter(function(h){return h});
26
+ var e=!1,f=[];b===_.xk?f=a.getAudioTracks():b===_.S&&(f=a.ia());if(c=c.find(function(h){var l=_.oj(h);return f.some(function(m){m=_.oj(m.language||"");return _.pj(l,m)})})){var g=_.oj(c);c=f.filter(function(h){h=_.oj(h.language||"");return _.pj(g,h)});f=c.length?c:f;e=e||!!c.length}_.R.Me(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.xk?a.Da(e):b===_.S&&a.Qa(e))},aW=function(a,b){for(var c=[],d=_.w(b),
27
+ e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.vk(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 _.Ek(f.id,f));c.push(f)}return c},dW=function(){_.jm.call(this);this.g=new _.K(NU);this.h=this.w=_.pm();this.A=null;
28
+ this.l=-1;this.G=new _.rk;this.f=this.o=this.j=this.a=this.B=null;this.C=!1},eW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},hW=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0}if(a&&a.drm){var d=a.drm,e=_.Nm(d);if(e){var f=[_.Nd];_.Qp(a)[0].type!==_.Yc&&f.unshift(_.Pd);d.preferredDrmSystem===_.Nd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
29
+ h=e.eb[g];h?(d=g===_.Pd?cast.framework.ContentProtection.WIDEVINE:g===_.Nd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},fW(b,h,a,d),gW(b,h,a,d)):c()}else c()}else c()},fW=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.Wj({method:_.Ib,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);
30
+ e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},gW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.ak(Object.assign({},f.headers),e.buffer,200,""),_.y(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.xj(g.data))})}:a.licenseHandler=void 0},iW=function(){this.a=!1;this.g=new _.K(OU);this.f=this.m=null;this.h=new Set;this.A=this.sm.bind(this);
31
+ this.w=this.uj.bind(this);this.j=null;this.o=new _.Qh;this.l=null},kW=function(){return jW||(jW=new iW)},lW=function(){return cast.framework.CastReceiverContext.getInstance()},mW=function(){var a=lW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},nW=function(a,b){var c=lW().getPlayerManager().getMediaInformation();if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;lW().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},
32
+ pW=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=lW();c=(lW().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Fg:_.Eg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var h=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=oW(h,_.sa),m=oW(h,_.Rb),n=_.w([]),p=n.next().value;n=n.next().value;m&&(m=_.w(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);
33
+ if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(h);++g}return f.join("\n")},oW=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},qW=function(a){this.f=a;this.a=null;this.h=new _.Qh;this.j=[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,
34
+ cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},sW=function(a,b){var c=null,d=rW(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},rW=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(h){return h.id===a.a.breakId})||null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:b.breaks.filter(function(h){return 0<=h.position}).sort(function(h,l){return h.position-l.position}).findIndex(function(h){return h===
35
+ c})}b.breakClips&&(d=b.breakClips.find(function(h){return h.id===a.a.breakClipId})||null);b=new MV(d,c,e,f,g)}return b},tW=function(){},uW=function(){};_.u=SU.prototype;_.u.release=function(){this.va(_.yp)};_.u.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.u.getState=function(){return this.f};_.u.onError=function(a){a.severity===_.P&&this.va(_.Jp)};
37
36
  _.u.va=function(a){if(a!==this.f)if(this.f===_.Jp&&a!==_.yp)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.l=this.f;this.f=a;this.f===_.Dp?(this.A=b,this.player.trigger(new _.L(_.kd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.Dp&&this.player.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.op(this.j,this.f);this.player.trigger(new _.L(_.cg,
38
37
  {detail:a}))}};_.J("clpp.cast.CastUtils",function(){});var XU=0,kV={GENERIC:XU,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.x(ZU,SU);ZU.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)};ZU.prototype.destroy=function(){var a=this;return _.I(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.y(b,SU.prototype.destroy.call(a),0)})};ZU.prototype.va=function(a){var b=this.player.l;b&&b.isPlayingBreak||SU.prototype.va.call(this,a)};
39
38
  ZU.prototype.Ub=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.va(_.Fp);break;case chrome.cast.media.IdleReason.ERROR:this.va(_.Jp);break;default:this.va(_.yp)}break;case chrome.cast.media.PlayerState.PLAYING:this.va(_.Mp);break;case chrome.cast.media.PlayerState.PAUSED:this.va(_.Lp);break;case chrome.cast.media.PlayerState.BUFFERING:this.va(_.Dp)}};_.x($U,_.U);_.u=$U.prototype;_.u.initialize=function(a){this.a=a};_.u.release=function(){this.h=[];this.f={}};
40
- _.u.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=_.yk;break;case chrome.cast.media.TrackType.AUDIO:c=_.xk;break;case chrome.cast.media.TrackType.TEXT:c=_.T}c=new _.vk(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 _.Ek(c.id,c));return c}):[],this.a.trigger(new _.L(_.zv)))};_.u.destroy=function(){this.a=null};_.u.getVideoTracks=function(){return bV(this,_.yk)};_.u.getAudioTracks=function(){return bV(this,_.xk)};_.u.ga=function(){return bV(this,_.T)};_.u.na=function(){var a=this.Oa();return a?a.renditions[0]:null};_.u.Sa=function(){var a=this.ma();return a?a.renditions[0]:null};_.u.Na=function(){var a=this.xa();return a?a.renditions[0]:null};_.u.lb=function(){return this.f[_.yk]||null};
42
- _.u.Ab=function(){return this.f[_.xk]||null};_.u.Bb=function(){return this.f[_.T]||null};_.u.Oa=function(){return cV(this,_.yk)};_.u.ma=function(){return cV(this,_.xk)};_.u.xa=function(){return cV(this,_.T)};_.u.wb=function(a){eV(this,_.yk,a)};_.u.Da=function(a){eV(this,_.xk,a)};_.u.Qa=function(a){eV(this,_.T,a)};_.u.cb=function(a){this.wb(a&&a.track)};_.u.ub=function(a){this.Da(a&&a.track)};_.u.vb=function(a){this.Qa(a&&a.track)};_.u.addTextTrack=function(){return _.I(function(a){_.A(a)})};
39
+ _.u.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=_.yk;break;case chrome.cast.media.TrackType.AUDIO:c=_.xk;break;case chrome.cast.media.TrackType.TEXT:c=_.S}c=new _.vk(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;b.customData&&(c.src=b.customData.url||c.src,c.mimeType=b.customData.mimeType||c.mimeType);
40
+ c.renditions.push(new _.Ek(c.id,c));return c}):[],this.a.trigger(new _.L(_.zv)))};_.u.destroy=function(){this.a=null};_.u.getVideoTracks=function(){return bV(this,_.yk)};_.u.getAudioTracks=function(){return bV(this,_.xk)};_.u.ia=function(){return bV(this,_.S)};_.u.na=function(){var a=this.Oa();return a?a.renditions[0]:null};_.u.Sa=function(){var a=this.ma();return a?a.renditions[0]:null};_.u.Na=function(){var a=this.xa();return a?a.renditions[0]:null};_.u.lb=function(){return this.f[_.yk]||null};
41
+ _.u.Ab=function(){return this.f[_.xk]||null};_.u.Bb=function(){return this.f[_.S]||null};_.u.Oa=function(){return cV(this,_.yk)};_.u.ma=function(){return cV(this,_.xk)};_.u.xa=function(){return cV(this,_.S)};_.u.wb=function(a){eV(this,_.yk,a)};_.u.Da=function(a){eV(this,_.xk,a)};_.u.Qa=function(a){eV(this,_.S,a)};_.u.cb=function(a){this.wb(a&&a.track)};_.u.ub=function(a){this.Da(a&&a.track)};_.u.vb=function(a){this.Qa(a&&a.track)};_.u.addTextTrack=function(){return _.I(function(a){_.B(a)})};
43
42
  _.u.ra=function(){return!0};$U.prototype.isAbrEnabled=$U.prototype.ra;$U.prototype.addTextTrack=$U.prototype.addTextTrack;$U.prototype.setTextRendition=$U.prototype.vb;$U.prototype.setAudioRendition=$U.prototype.ub;$U.prototype.setVideoRendition=$U.prototype.cb;$U.prototype.setTextTrack=$U.prototype.Qa;$U.prototype.setAudioTrack=$U.prototype.Da;$U.prototype.setVideoTrack=$U.prototype.wb;$U.prototype.getTextTrack=$U.prototype.xa;$U.prototype.getAudioTrack=$U.prototype.ma;
44
- $U.prototype.getVideoTrack=$U.prototype.Oa;$U.prototype.getLoadingTextRendition=$U.prototype.Bb;$U.prototype.getLoadingAudioRendition=$U.prototype.Ab;$U.prototype.getLoadingVideoRendition=$U.prototype.lb;$U.prototype.getTextRendition=$U.prototype.Na;$U.prototype.getAudioRendition=$U.prototype.Sa;$U.prototype.getVideoRendition=$U.prototype.na;$U.prototype.getTextTracks=$U.prototype.ga;$U.prototype.getAudioTracks=$U.prototype.getAudioTracks;$U.prototype.getVideoTracks=$U.prototype.getVideoTracks;_.x(iV,_.jm);_.u=iV.prototype;_.u.init=function(a,b){this.h=this.J=b};_.u.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)})};_.u.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.u.getTimeline=function(){return null};_.u.setupPlaylist=function(){return Promise.reject(_.Eb)};_.u.appendLoad=function(){return Promise.reject(_.Eb)};_.u.seekWith=function(){return Promise.reject(_.Eb)};
45
- _.u.setSeekInterceptor=function(){};_.u.destroy=function(){return _.I(function(a){_.A(a)})};_.u.de=function(a){this.N=a};_.u.yc=function(){return this.w};_.u.Hb=function(){return this.A};_.u.Kf=function(){return this.ha};
46
- _.u.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 _.O(1,8,8004,void 0);g.F(2);break}_.D(g,3);return _.y(g,e.sendMessage(a,TU(b)),5);case 5:_.mh(g,2);break;case 3:f=_.E(g),d=new _.O(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.A(g)}})};
47
- _.u.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.yc())throw a.g.warn(KU),new _.O(1,8,8001,void 0);if(!xV)throw a.g.warn(IU),new _.O(1,8,8002,void 0);if(a.Hb())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.D(d,2);return _.y(d,FV(a),4)}if(2!=d.a)return _.mh(d,0);b=_.E(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);})};_.u.Hf=function(){this.Hb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
48
- _.u.addMessageListener=function(a){typeof a===_.re&&this.G.add(a)};_.u.removeMessageListener=function(a){typeof a===_.re&&this.G["delete"](a)};_.u.play=function(){var a=this;return this.isEnded()?HV(this,!0):new Promise(function(b,c){if(!a.a)return c(HU);a.a.play(null,b,c)})};_.u.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(HU);a.a.pause(null,b,c)})};_.u.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
43
+ $U.prototype.getVideoTrack=$U.prototype.Oa;$U.prototype.getLoadingTextRendition=$U.prototype.Bb;$U.prototype.getLoadingAudioRendition=$U.prototype.Ab;$U.prototype.getLoadingVideoRendition=$U.prototype.lb;$U.prototype.getTextRendition=$U.prototype.Na;$U.prototype.getAudioRendition=$U.prototype.Sa;$U.prototype.getVideoRendition=$U.prototype.na;$U.prototype.getTextTracks=$U.prototype.ia;$U.prototype.getAudioTracks=$U.prototype.getAudioTracks;$U.prototype.getVideoTracks=$U.prototype.getVideoTracks;_.x(iV,_.jm);_.u=iV.prototype;_.u.init=function(a,b){this.h=this.J=b};_.u.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)})};_.u.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.u.getTimeline=function(){return null};_.u.setupPlaylist=function(){return Promise.reject(_.Eb)};_.u.appendLoad=function(){return Promise.reject(_.Eb)};_.u.seekWith=function(){return Promise.reject(_.Eb)};
44
+ _.u.setSeekInterceptor=function(){};_.u.destroy=function(){return _.I(function(a){_.B(a)})};_.u.de=function(a){this.N=a};_.u.xc=function(){return this.w};_.u.Hb=function(){return this.A};_.u.Kf=function(){return this.ga};
45
+ _.u.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.F(2);break}_.D(g,3);return _.y(g,e.sendMessage(a,TU(b)),5);case 5:_.mh(g,2);break;case 3:f=_.E(g),d=new _.N(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.B(g)}})};
46
+ _.u.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.xc())throw a.g.warn(KU),new _.N(1,8,8001,void 0);if(!xV)throw a.g.warn(IU),new _.N(1,8,8002,void 0);if(a.Hb())throw a.g.warn("Already casting"),new _.N(1,8,8003,void 0);_.D(d,2);return _.y(d,FV(a),4)}if(2!=d.a)return _.mh(d,0);b=_.E(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);})};_.u.Hf=function(){this.Hb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
47
+ _.u.addMessageListener=function(a){typeof a===_.re&&this.I.add(a)};_.u.removeMessageListener=function(a){typeof a===_.re&&this.I["delete"](a)};_.u.play=function(){var a=this;return this.isEnded()?HV(this,!0):new Promise(function(b,c){if(!a.a)return c(HU);a.a.play(null,b,c)})};_.u.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(HU);a.a.pause(null,b,c)})};_.u.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
49
48
  _.u.isEnded=function(){return this.getState()===_.Fp};_.u.seek=function(a){var b=this;return this.isEnded()?HV(this,!1,a):new Promise(function(c,d){b.a||d(HU);b.l.isPlayingBreak&&d(FU);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.xg));b.a.seek(e,function(){b.trigger(new _.L(_.wg));c()},d)})};_.u.getPosition=function(){return this.getMediaPosition()};_.u.getMediaPosition=function(){return this.a&&this.a.getEstimatedTime()||0};_.u.getDuration=function(){return this.getMediaDuration()};
50
49
  _.u.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};_.u.setDrmCustomDataModifier=function(){};_.u.setCdnErrorCallback=function(){};_.u.detach=function(){};_.u.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.u.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(QU,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
51
50
  _.u.getVolume=function(){return this.a&&this.a.volume.level};_.u.setVolume=function(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))};_.u.isMuted=function(){return this.a&&this.a.volume.muted};_.u.setMuted=function(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};
52
51
  _.u.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};_.u.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};_.u.getState=function(){return this.j?this.j.getState():_.zp};
53
- _.u.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?UU(this.a.customData.stats):_.up()};_.u.isLive=function(){return Infinity===this.getDuration()};_.u.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.yc())return b.g.warn(KU),e["return"]();if(!xV)return b.g.warn(IU),e["return"]();b.C=_.Qp(a);b.h=_.rm(b.J,a);c=b.C[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,bb:b.h,Yb:c.Yb,audioMimeType:c.audioMimeType};return _.y(e,GV(b,d),0)})};
52
+ _.u.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?UU(this.a.customData.stats):_.up()};_.u.isLive=function(){return Infinity===this.getDuration()};_.u.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.xc())return b.g.warn(KU),e["return"]();if(!xV)return b.g.warn(IU),e["return"]();b.C=_.Qp(a);b.h=_.rm(b.J,a);c=b.C[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,bb:b.h,Yb:c.Yb,audioMimeType:c.audioMimeType};return _.y(e,GV(b,d),0)})};
54
53
  _.u.getBufferInfo=function(){return new _.im};_.u.getTrackManager=function(){return this.f};_.u.getConfiguration=function(){return this.h};_.u.getSurface=function(){return null};_.u.setNetworkEngine=function(a){this.L=a};_.u.getNetworkEngine=function(){return this.L};_.u.getSourceIndex=function(){return this.B};_.u.setSourceIndex=function(a){this.B=a};_.u.setCmsdManager=function(){};_.u.getLoadedSource=function(){return this.C[this.B]};_.u.getPeriods=function(){return[]};_.u.getDrmInfo=function(){return null};
55
- _.u.getTimelineCues=function(){return[]};_.u.getCueTimeline=function(){return null};_.u.resetAbr=function(){this.g.warn(JU)};_.u.onError=function(a){if(a&&(this.trigger(new _.L(_.ne,{detail:a})),this.j))this.j.onError(a)};_.u.namespace=function(){return _.Ad};_.u.canPlay=function(){return this.yc()?2:0};_.u.zb=function(){return this.K};_.u.Xb=function(a){this.K=lV(a)};_.u.wf=function(){this.K=null};
54
+ _.u.getTimelineCues=function(){return[]};_.u.getCueTimeline=function(){return null};_.u.resetAbr=function(){this.g.warn(JU)};_.u.onError=function(a){if(a&&(this.trigger(new _.L(_.ne,{detail:a})),this.j))this.j.onError(a)};_.u.namespace=function(){return _.Ad};_.u.canPlay=function(){return this.xc()?2:0};_.u.zb=function(){return this.K};_.u.Xb=function(a){this.K=lV(a)};_.u.wf=function(){this.K=null};
56
55
  _.u.qg=function(a){var b=this.zb()||{};a={metadataType:mV(b.metadataType),title:a};this.Xb(Object.assign({},b,a))};_.u.og=function(a){var b=this.zb()||{},c=mV(b.metadataType);a=new chrome.cast.Image(a);this.Xb(Object.assign({},b,{metadataType:c,images:[a]}))};_.u.ng=function(a){var b=this.zb()||{};this.Xb(Object.assign({},b,{metadataType:3,artist:a}))};_.u.pg=function(a){var b=this.zb()||{};a={metadataType:mV(b.metadataType),releaseDate:a};this.Xb(Object.assign({},b,a))};
57
- _.u.im=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;xV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ha=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.wg()};
58
- _.u.Cm=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;EV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Hb()||(this.A=!0,EV(this,a.session),this.fa());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Hb()&&this.a){var b=this.a.media,c=this.f.ma(),d=this.f.xa();c=c&&c.language||void 0;d=d&&d.language||void 0;this.$(this.getState(),{source:{url:b.contentId,type:b.contentType,
59
- isLive:this.isLive()},currentTime:CV(this),Ki:d,Ig:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ca);a.session.removeMessageListener(PU,this.V);this.A=!1;this.a=null;this.I.release();this.l=this.H=null}};_.u.um=function(a){this.g.debug("New media session",a.mediaSession);DV(this,a.mediaSession)};_.u.mm=function(a,b){if(a===PU&&0<this.G.size){var c=UU(b);this.G.forEach(function(d){return d(c)})}};_.u.tj=function(){this.trigger(new _.L(_.ng))};
60
- _.u.Fk=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.y(e,VU(a,[_.lg,_.Xc],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Fa++,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)})};_.u.getTextDisplayer=function(){return null};iV.prototype.getTextDisplayer=iV.prototype.getTextDisplayer;iV.prototype.getNetworkEngine=iV.prototype.getNetworkEngine;
61
- iV.prototype.setNetworkEngine=iV.prototype.setNetworkEngine;var xV=!1,hV=new Set;window.__onGCastApiAvailable=fV;_.x(JV,_.jm);_.u=JV.prototype;_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,jV(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.A(b)})};_.u.tf=function(){return!!this.a&&this.a.yc()&&xV};_.u.Hb=function(){return!!this.a&&this.a.Hb()};_.u.Kf=function(){return this.a?this.a.Kf():""};_.u.de=function(a){this.a&&this.a.de(a)};
62
- _.u.cast=function(a){var b=this,c,d,e;return _.I(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.D(f,2);return _.y(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){g=b.f.getTrackManager();var l=g.getVideoTracks()[0];if(l&&l.mimeType)var m=l.mimeType;l=b.f.getConfiguration();var n=g.ma();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(l.preferredAudioLanguage=n.language);n.roles.length&&(l.preferredAudioRole=n.roles[0])}if(n=g.xa())n.language&&
63
- (l.preferredTextLanguage=n.language),n.roles.length&&(l.preferredTextRole=n.roles[0]);n=h&&typeof h.isLive===_.id?h.isLive:b.f.isLive();g={source:h,isLive:n,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),gg:b.f.getPresentationStartTime(),Yb:m,audioMimeType:p,bb:l,tracks:_.Zg(g.ga()).concat(_.Zg(g.getAudioTracks()))}}c=g;return _.y(f,KV(b),5);case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.y(f,b.f.load(a),7);if(b.a.a){f.F(7);break}return _.y(f,
64
- GV(b.a,c),7);case 7:_.mh(f,0);break;case 2:d=_.E(f),b.g.error("Error while trying to cast",d),e=new _.L(_.ne,{detail:d}),b.trigger(e),_.A(f)}})};_.u.Hf=function(){this.a&&this.a.Hf()};_.u.pj=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?_.y(c,jV(b.a),2):c.F(2)}b.a=IV(b);_.A(c)})};_.u.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.y(c,b.a.sendMessage(PU,a),0):(b.g.warn(LU),c["return"]())})};
65
- _.u.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(LU)};_.u.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(LU)};_.u.zb=function(){return this.a&&this.a.zb()};_.u.Xb=function(a){this.a&&this.a.Xb(a)};_.u.wf=function(){this.a&&this.a.wf()};_.u.qg=function(a){this.a&&this.a.qg(a)};_.u.og=function(a){this.a&&this.a.og(a)};_.u.ng=function(a){this.a&&this.a.ng(a)};_.u.pg=function(a){this.a&&this.a.pg(a)};_.J(MU,JV);
66
- JV.prototype.setContentReleaseDate=JV.prototype.pg;JV.prototype.setContentArtist=JV.prototype.ng;JV.prototype.setContentImage=JV.prototype.og;JV.prototype.setContentTitle=JV.prototype.qg;JV.prototype.clearContentMetadata=JV.prototype.wf;JV.prototype.setContentMetadata=JV.prototype.Xb;JV.prototype.getContentMetadata=JV.prototype.zb;JV.prototype.removeMessageListener=JV.prototype.removeMessageListener;JV.prototype.addMessageListener=JV.prototype.addMessageListener;JV.prototype.sendMessage=JV.prototype.sendMessage;
67
- JV.prototype.changeReceiverId=JV.prototype.pj;JV.prototype.forceDisconnect=JV.prototype.Hf;JV.prototype.cast=JV.prototype.cast;JV.prototype.setPlayerConfigInterceptor=JV.prototype.de;JV.prototype.getReceiverName=JV.prototype.Kf;JV.prototype.isCasting=JV.prototype.Hb;JV.prototype.canCast=JV.prototype.tf;JV.prototype.destroy=JV.prototype.destroy;_.x(LV,SU);_.u=LV.prototype;
56
+ _.u.im=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;xV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ga=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.wg()};
57
+ _.u.Dm=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;EV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Hb()||(this.A=!0,EV(this,a.session),this.fa());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Hb()&&this.a){var b=this.a.media,c=this.f.ma(),d=this.f.xa();c=c&&c.language||void 0;d=d&&d.language||void 0;this.$(this.getState(),{source:{url:b.contentId,type:b.contentType,
58
+ isLive:this.isLive()},currentTime:CV(this),Ki:d,Ig:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ca);a.session.removeMessageListener(PU,this.V);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}};_.u.vm=function(a){this.g.debug("New media session",a.mediaSession);DV(this,a.mediaSession)};_.u.um=function(a){a.value&&a.value.tracks&&this.f&&this.f.load()};_.u.mm=function(a,b){if(a===PU&&0<this.I.size){var c=UU(b);this.I.forEach(function(d){return d(c)})}};
59
+ _.u.tj=function(){this.trigger(new _.L(_.ng))};_.u.Fk=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.y(e,VU(a,[_.lg,_.Xc],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Fa++,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)})};_.u.getTextDisplayer=function(){return null};iV.prototype.getTextDisplayer=iV.prototype.getTextDisplayer;
60
+ iV.prototype.getNetworkEngine=iV.prototype.getNetworkEngine;iV.prototype.setNetworkEngine=iV.prototype.setNetworkEngine;var xV=!1,hV=new Set;window.__onGCastApiAvailable=fV;_.x(JV,_.jm);_.u=JV.prototype;_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,jV(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.B(b)})};_.u.mn=function(a,b){this.f&&a!==_.Fp&&a!==_.yp&&(delete b.license,this.f.load(b))};_.u.tf=function(){return!!this.a&&this.a.xc()&&xV};_.u.Hb=function(){return!!this.a&&this.a.Hb()};_.u.Kf=function(){return this.a?this.a.Kf():""};_.u.de=function(a){this.a&&this.a.de(a)};
61
+ _.u.cast=function(a){var b=this,c,d,e;return _.I(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.D(f,2);return _.y(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.ma();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.xa())l.language&&
62
+ (g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.id?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),gg:b.f.getPresentationStartTime(),Yb:m,audioMimeType:p,bb:g}}c=g;return _.y(f,KV(b),5);case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.y(f,b.f.load(a),7);if(b.a.a){f.F(7);break}return _.y(f,GV(b.a,c),7);case 7:_.mh(f,0);break;case 2:d=_.E(f),
63
+ b.g.error("Error while trying to cast",d),e=new _.L(_.ne,{detail:d}),b.trigger(e),_.B(f)}})};_.u.Hf=function(){this.a&&this.a.Hf()};_.u.pj=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?_.y(c,jV(b.a),2):c.F(2)}b.a=IV(b);_.B(c)})};_.u.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.y(c,b.a.sendMessage(PU,a),0):(b.g.warn(LU),c["return"]())})};_.u.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(LU)};
64
+ _.u.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(LU)};_.u.zb=function(){return this.a&&this.a.zb()};_.u.Xb=function(a){this.a&&this.a.Xb(a)};_.u.wf=function(){this.a&&this.a.wf()};_.u.qg=function(a){this.a&&this.a.qg(a)};_.u.og=function(a){this.a&&this.a.og(a)};_.u.ng=function(a){this.a&&this.a.ng(a)};_.u.pg=function(a){this.a&&this.a.pg(a)};_.J(MU,JV);JV.prototype.setContentReleaseDate=JV.prototype.pg;JV.prototype.setContentArtist=JV.prototype.ng;
65
+ JV.prototype.setContentImage=JV.prototype.og;JV.prototype.setContentTitle=JV.prototype.qg;JV.prototype.clearContentMetadata=JV.prototype.wf;JV.prototype.setContentMetadata=JV.prototype.Xb;JV.prototype.getContentMetadata=JV.prototype.zb;JV.prototype.removeMessageListener=JV.prototype.removeMessageListener;JV.prototype.addMessageListener=JV.prototype.addMessageListener;JV.prototype.sendMessage=JV.prototype.sendMessage;JV.prototype.changeReceiverId=JV.prototype.pj;JV.prototype.forceDisconnect=JV.prototype.Hf;
66
+ JV.prototype.cast=JV.prototype.cast;JV.prototype.setPlayerConfigInterceptor=JV.prototype.de;JV.prototype.getReceiverName=JV.prototype.Kf;JV.prototype.isCasting=JV.prototype.Hb;JV.prototype.canCast=JV.prototype.tf;JV.prototype.destroy=JV.prototype.destroy;_.x(LV,SU);_.u=LV.prototype;
68
67
  _.u.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.C);b.addEventListener(a.BITRATE_CHANGED,this.a)};
69
68
  _.u.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,
70
- a.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,SU.prototype.destroy.call(a),0)})};_.u.xj=function(){this.player.trigger(new _.L(_.hf));this.va(_.Mp)};_.u.wj=function(){this.va(_.Lp)};_.u.qm=function(){this.va(_.Fp)};_.u.hm=function(a){a.isBuffering?this.va(_.Dp):(a=this.player.isPaused()?_.Lp:_.Mp,this.va(a))};_.u.zj=function(){this.h=1;this.player.trigger(new _.L(_.xg))};_.u.yj=function(){this.player.trigger(new _.L(_.wg))};_.u.Fm=function(){this.h=2};_.u.tm=function(){this.va(_.Kp)};
71
- _.u.vj=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.hd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.u.S=function(a){a=new _.O(_.P,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.ne,{detail:a}));this.va(_.Jp)};_.u=MV.prototype;_.u.jb=function(){return"Google Cast Framework"};_.u.kb=function(){return cast.framework.VERSION};_.u.qb=function(){return 0};_.u.getId=function(){return""};_.u.getCreativeId=function(){return""};_.u.getApiFramework=function(){return null};_.u.getAdSystem=function(){return""};_.u.getAdvertiserName=function(){return""};_.u.getTitle=function(){return this.a.title||""};_.u.getDuration=function(){return this.a.duration||0};_.u.getPosition=function(){return 0};
69
+ a.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,SU.prototype.destroy.call(a),0)})};_.u.xj=function(){this.player.trigger(new _.L(_.hf));this.va(_.Mp)};_.u.wj=function(){this.va(_.Lp)};_.u.qm=function(){this.va(_.Fp)};_.u.hm=function(a){a.isBuffering?this.va(_.Dp):(a=this.player.isPaused()?_.Lp:_.Mp,this.va(a))};_.u.zj=function(){this.h=1;this.player.trigger(new _.L(_.xg))};_.u.yj=function(){this.player.trigger(new _.L(_.wg))};_.u.Gm=function(){this.h=2};_.u.tm=function(){this.va(_.Kp)};
70
+ _.u.vj=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.hd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.u.S=function(a){a=new _.N(_.P,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.ne,{detail:a}));this.va(_.Jp)};_.u=MV.prototype;_.u.jb=function(){return"Google Cast Framework"};_.u.kb=function(){return cast.framework.VERSION};_.u.qb=function(){return 0};_.u.getId=function(){return""};_.u.getCreativeId=function(){return""};_.u.getApiFramework=function(){return null};_.u.getAdSystem=function(){return""};_.u.getAdvertiserName=function(){return""};_.u.getTitle=function(){return this.a.title||""};_.u.getDuration=function(){return this.a.duration||0};_.u.getPosition=function(){return 0};
72
71
  _.u.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.u.Sb=function(){return!1};_.u.yb=function(){return this.a.clickThroughUrl||null};_.u.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.u.ob=function(){return 0};_.u.nb=function(){return 0};_.u.ab=function(){return 0};_.u.Ua=function(){switch(this.Cb()){case 0:return 0;case -1:return 2;default:return 1}};_.u.getPodIndex=function(){return this.j};_.u.Cb=function(){return this.f.position};_.u.Db=function(){return this.l};
73
72
  _.u.pb=function(){return this.h};_.u.getWrapperAdIds=function(){return[]};_.u.getWrapperAdSystems=function(){return[]};_.u.getWrapperCreativeIds=function(){return[]};MV.prototype.getWrapperCreativeIds=MV.prototype.getWrapperCreativeIds;MV.prototype.getWrapperAdSystems=MV.prototype.getWrapperAdSystems;MV.prototype.getWrapperAdIds=MV.prototype.getWrapperAdIds;MV.prototype.getSequenceLength=MV.prototype.pb;MV.prototype.getPositionInSequence=MV.prototype.Db;MV.prototype.getPodTimeOffset=MV.prototype.Cb;
74
73
  MV.prototype.getPodIndex=MV.prototype.getPodIndex;MV.prototype.getPodType=MV.prototype.Ua;MV.prototype.getMediaBitrate=MV.prototype.ab;MV.prototype.getMediaHeight=MV.prototype.nb;MV.prototype.getMediaWidth=MV.prototype.ob;MV.prototype.getMediaUrl=MV.prototype.getMediaUrl;MV.prototype.getClickThroughUrl=MV.prototype.yb;MV.prototype.isBumper=MV.prototype.Sb;MV.prototype.getSkipTimeOffset=MV.prototype.getSkipTimeOffset;MV.prototype.getPosition=MV.prototype.getPosition;MV.prototype.getDuration=MV.prototype.getDuration;
75
- MV.prototype.getTitle=MV.prototype.getTitle;MV.prototype.getAdvertiserName=MV.prototype.getAdvertiserName;MV.prototype.getAdSystem=MV.prototype.getAdSystem;MV.prototype.getApiFramework=MV.prototype.getApiFramework;MV.prototype.getCreativeId=MV.prototype.getCreativeId;MV.prototype.getId=MV.prototype.getId;MV.prototype.getTechnology=MV.prototype.qb;MV.prototype.getAdManagerVersion=MV.prototype.kb;MV.prototype.getAdManagerName=MV.prototype.jb;NV.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};NV.prototype.Fb=function(){return!!this.a.find(function(a){return 0===a.position})};NV.prototype.Eb=function(){return!!this.a.find(function(a){return-1===a.position})};NV.prototype.hasPostroll=NV.prototype.Eb;NV.prototype.hasPreroll=NV.prototype.Fb;NV.prototype.getCuePoints=NV.prototype.getCuePoints;_.u=PV.prototype;_.u.load=function(){var a=this;return _.I(function(b){QV&&(QV=!1,VV(a,0));_.A(b)})};_.u.start=function(){return _.I(function(a){OV().play();_.A(a)})};_.u.Uc=function(){};_.u.resume=function(){-1!==this.getPosition()&&OV().play()};_.u.pause=function(){-1!==this.getPosition()&&OV().pause()};_.u.skip=function(){};_.u.getVolume=function(){return this.m.getVolume()||0};_.u.setVolume=function(a){this.m.setVolume(a)};
76
- _.u.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.u.Qc=function(){return!0};_.u.pc=function(){var a=this;return _.I(function(b){OV().removeEventListener(a.f,a.h);_.A(b)})};
74
+ MV.prototype.getTitle=MV.prototype.getTitle;MV.prototype.getAdvertiserName=MV.prototype.getAdvertiserName;MV.prototype.getAdSystem=MV.prototype.getAdSystem;MV.prototype.getApiFramework=MV.prototype.getApiFramework;MV.prototype.getCreativeId=MV.prototype.getCreativeId;MV.prototype.getId=MV.prototype.getId;MV.prototype.getTechnology=MV.prototype.qb;MV.prototype.getAdManagerVersion=MV.prototype.kb;MV.prototype.getAdManagerName=MV.prototype.jb;NV.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};NV.prototype.Fb=function(){return!!this.a.find(function(a){return 0===a.position})};NV.prototype.Eb=function(){return!!this.a.find(function(a){return-1===a.position})};NV.prototype.hasPostroll=NV.prototype.Eb;NV.prototype.hasPreroll=NV.prototype.Fb;NV.prototype.getCuePoints=NV.prototype.getCuePoints;_.u=PV.prototype;_.u.load=function(){var a=this;return _.I(function(b){QV&&(QV=!1,VV(a,0));_.B(b)})};_.u.start=function(){return _.I(function(a){OV().play();_.B(a)})};_.u.Tc=function(){};_.u.resume=function(){-1!==this.getPosition()&&OV().play()};_.u.pause=function(){-1!==this.getPosition()&&OV().pause()};_.u.skip=function(){};_.u.getVolume=function(){return this.m.getVolume()||0};_.u.setVolume=function(a){this.m.setVolume(a)};
75
+ _.u.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.u.Pc=function(){return!0};_.u.pc=function(){var a=this;return _.I(function(b){OV().removeEventListener(a.f,a.h);_.B(b)})};
77
76
  _.u.Aj=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=OV().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Nc,{adsTimeline:new NV(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:UV(this,_.Dc,a);break;case cast.framework.events.EventType.BREAK_STARTED:UV(this,_.uc,a);break;case cast.framework.events.EventType.BREAK_ENDED:UV(this,_.vc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:UV(this,
78
77
  _.Jc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(UV(this,_.Ic,a),UV(this,_.Kc,a)):a.endedReason===b.STOPPED?UV(this,_.Kc,a):a.endedReason===b.END_OF_STREAM?(UV(this,_.yc,a),UV(this,_.Kc,a)):a.endedReason===b.ERROR&&VV(this,1);break;case cast.framework.events.EventType.PLAYING:UV(this,_.Hc,a);break;case cast.framework.events.EventType.PAUSE:UV(this,_.Fc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?UV(this,_.wc,a):UV(this,_.Hc,a)}};
79
78
  PV.prototype.getPosition=PV.prototype.getPosition;PV.prototype.setVolume=PV.prototype.setVolume;PV.prototype.getVolume=PV.prototype.getVolume;PV.prototype.skip=PV.prototype.skip;PV.prototype.pause=PV.prototype.pause;PV.prototype.resume=PV.prototype.resume;var QV=!1;WV.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(XV(),this.a)};WV.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(XV(),this.a)};WV.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return YV(a)})};
80
- WV.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=_.ii;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.di;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.ei}b&&this.fb(new _.L(b,{detail:YV(a.timedMetadataInfo)}))}else for(a=_.w(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.fb(new _.L(_.ii,{detail:b.value}))};_.x(ZV,_.U);_.u=ZV.prototype;_.u.initialize=function(a){this.m=a;$V().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.u.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.u.load=function(){};_.u.destroy=function(){this.m=null;$V().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.u.getVideoTracks=function(){return[]};_.u.getAudioTracks=function(){return this.h};_.u.ga=function(){return this.j};_.u.na=function(){return null};
79
+ WV.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=_.ii;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.di;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.ei}b&&this.fb(new _.L(b,{detail:YV(a.timedMetadataInfo)}))}else for(a=_.w(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.fb(new _.L(_.ii,{detail:b.value}))};_.x(ZV,_.U);_.u=ZV.prototype;_.u.initialize=function(a){this.m=a;$V().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.u.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.u.load=function(){};_.u.destroy=function(){this.m=null;$V().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.u.getVideoTracks=function(){return[]};_.u.getAudioTracks=function(){return this.h};_.u.ia=function(){return this.j};_.u.na=function(){return null};
81
80
  _.u.Sa=function(){var a=this.ma();return a&&a.renditions[0]};_.u.Na=function(){var a=this.xa();return a&&a.renditions[0]};_.u.lb=function(){return null};_.u.Ab=function(){return null};_.u.Bb=function(){return null};_.u.Oa=function(){return null};_.u.ma=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.k&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
82
- _.u.xa=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ga().find(function(c){return c.id===b})||null)}return a};_.u.wb=function(){this.g.warn("Video tracks unavailable on Cast")};_.u.Da=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.u.Qa=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.u.cb=function(){this.g.warn("Video renditions unavailable on Cast")};_.u.ub=function(a){this.Da(a&&a.track)};
81
+ _.u.xa=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ia().find(function(c){return c.id===b})||null)}return a};_.u.wb=function(){this.g.warn("Video tracks unavailable on Cast")};_.u.Da=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.u.Qa=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.u.cb=function(){this.g.warn("Video renditions unavailable on Cast")};_.u.ub=function(a){this.Da(a&&a.track)};
83
82
  _.u.vb=function(a){this.Qa(a&&a.track)};
84
83
  _.u.addTextTrack=function(a){var b=this,c,d,e;return _.I(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.y(f,VU(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]),bW(b)}catch(g){throw b.g.warn("failed on track",
85
- a),g;}}_.A(f)})};_.u.ra=function(){return!0};_.u.Zm=function(){this.f=$V().getAudioTracksManager();var a=this.f.getTracks();this.h=aW(_.xk,a);bW(this);a=this.m.getConfiguration();cW(this,_.xk,a.preferredAudioLanguage,a.preferredAudioRole);cW(this,_.T,a.preferredTextLanguage,a.preferredTextRole)};ZV.prototype.isAbrEnabled=ZV.prototype.ra;ZV.prototype.addTextTrack=ZV.prototype.addTextTrack;ZV.prototype.setTextRendition=ZV.prototype.vb;ZV.prototype.setAudioRendition=ZV.prototype.ub;
84
+ a),g;}}_.B(f)})};_.u.ra=function(){return!0};_.u.$m=function(){this.f=$V().getAudioTracksManager();var a=this.f.getTracks();this.h=aW(_.xk,a);bW(this);a=this.m.getConfiguration();cW(this,_.xk,a.preferredAudioLanguage,a.preferredAudioRole);cW(this,_.S,a.preferredTextLanguage,a.preferredTextRole)};ZV.prototype.isAbrEnabled=ZV.prototype.ra;ZV.prototype.addTextTrack=ZV.prototype.addTextTrack;ZV.prototype.setTextRendition=ZV.prototype.vb;ZV.prototype.setAudioRendition=ZV.prototype.ub;
86
85
  ZV.prototype.setVideoRendition=ZV.prototype.cb;ZV.prototype.setTextTrack=ZV.prototype.Qa;ZV.prototype.setAudioTrack=ZV.prototype.Da;ZV.prototype.setVideoTrack=ZV.prototype.wb;ZV.prototype.getTextTrack=ZV.prototype.xa;ZV.prototype.getAudioTrack=ZV.prototype.ma;ZV.prototype.getVideoTrack=ZV.prototype.Oa;ZV.prototype.getLoadingTextRendition=ZV.prototype.Bb;ZV.prototype.getLoadingAudioRendition=ZV.prototype.Ab;ZV.prototype.getLoadingVideoRendition=ZV.prototype.lb;ZV.prototype.getTextRendition=ZV.prototype.Na;
87
- ZV.prototype.getAudioRendition=ZV.prototype.Sa;ZV.prototype.getVideoRendition=ZV.prototype.na;ZV.prototype.getTextTracks=ZV.prototype.ga;ZV.prototype.getAudioTracks=ZV.prototype.getAudioTracks;ZV.prototype.getVideoTracks=ZV.prototype.getVideoTracks;_.x(dW,_.jm);_.u=dW.prototype;_.u.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=eW();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.vm.bind(this));d.setMediaPlaybackInfoHandler(this.ej.bind(this));this.a=new LV(this);this.a.init();this.j=new ZV;this.j.initialize(this);this.o=new WV(function(e){return c.trigger(e)});this.o.init()};
88
- _.u.unload=function(){var a=cast.framework.messages.PlayerState,b=eW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.u.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.B=null,a.w=_.pm(),a.h=a.w,a.l=-1,a.A=null,a.a?_.y(b,a.a.destroy(),3):b.F(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.A(b)})};
86
+ ZV.prototype.getAudioRendition=ZV.prototype.Sa;ZV.prototype.getVideoRendition=ZV.prototype.na;ZV.prototype.getTextTracks=ZV.prototype.ia;ZV.prototype.getAudioTracks=ZV.prototype.getAudioTracks;ZV.prototype.getVideoTracks=ZV.prototype.getVideoTracks;_.x(dW,_.jm);_.u=dW.prototype;_.u.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=eW();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.wm.bind(this));d.setMediaPlaybackInfoHandler(this.ej.bind(this));this.a=new LV(this);this.a.init();this.j=new ZV;this.j.initialize(this);this.o=new WV(function(e){return c.trigger(e)});this.o.init()};
87
+ _.u.unload=function(){var a=cast.framework.messages.PlayerState,b=eW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.u.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.B=null,a.w=_.pm(),a.h=a.w,a.l=-1,a.A=null,a.a?_.y(b,a.a.destroy(),3):b.F(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.B(b)})};
89
88
  _.u.play=function(){var a=eW();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.u.pause=function(){var a=eW();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.u.isPaused=function(){return eW().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
90
89
  _.u.isEnded=function(){return eW().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.u.seek=function(a){var b=eW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(FU);b.seek(a);return Promise.resolve()};_.u.getPosition=function(){return this.getMediaPosition()};_.u.setSeekInterceptor=function(){};_.u.getMediaPosition=function(){return eW().getCurrentTimeSec()};_.u.getDuration=function(){return this.getMediaDuration()};
91
90
  _.u.getMediaDuration=function(){var a=eW().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.u.getPlaybackRate=function(){return eW().getPlaybackRate()};_.u.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;eW().sendLocalMediaRequest(b)}};_.u.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.u.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};
92
91
  _.u.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};_.u.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};
93
- _.u.getLoadedSource=function(){var a=eW().getMediaInformation();if(a){var b=eW().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,mo:b,name:c}}return null};_.u.getDrmInfo=function(){return null};_.u.getPresentationStartTime=function(){return eW().getStartAbsoluteTime()};
92
+ _.u.getLoadedSource=function(){var a=eW().getMediaInformation();if(a){var b=eW().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,oo:b,name:c}}return null};_.u.getDrmInfo=function(){return null};_.u.getPresentationStartTime=function(){return eW().getStartAbsoluteTime()};
94
93
  _.u.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=eW().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.u.getState=function(){return this.a?this.a.getState():_.zp};
95
94
  _.u.getStats=function(){var a=_.up();if(this.f){a=eW().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.o=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.w=a.width||NaN;b.h=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.l=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.j=c;a=this.f.getStats()}return a};_.u.isLive=function(){return Infinity===this.getDuration()};
96
95
  _.u.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.tp;b.a.j=b.f.a;b.A=_.Qp(a);b.h=_.rm(b.w,a);if(b.C)return b.C=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.k&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:TU(b.h),local:!0};return _.y(e,eW().load(d),0)})};_.u.getBufferInfo=function(){this.g.warn(_.ua);return new _.im};
97
96
  _.u.getTrackManager=function(){return this.j};_.u.getConfiguration=function(){return this.h};_.u.getSurface=function(){return this.B};_.u.getTimeline=function(){return null};_.u.setupPlaylist=function(){return Promise.reject(_.Eb)};_.u.appendLoad=function(){return Promise.reject(_.Eb)};_.u.seekWith=function(){return Promise.reject(_.Eb)};_.u.setNetworkEngine=function(a){this.G=a};_.u.setCmsdManager=function(){};_.u.getNetworkEngine=function(){return this.G};_.u.getSourceIndex=function(){return this.l};
98
97
  _.u.setSourceIndex=function(a){this.l=a};_.u.getPeriods=function(){return[]};_.u.namespace=function(){return NU};_.u.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.u.getCueTimeline=function(){return null};_.u.resetAbr=function(){this.g.warn(JU)};_.u.onError=function(a){this.trigger(new _.L(_.ne,{detail:a}))};_.u.canPlay=function(){return _.rl()?2:0};
99
- _.u.vm=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=TU(this.getStats());var b=eW(),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&&
98
+ _.u.wm=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=TU(this.getStats());var b=eW(),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&&
100
99
  (!e||e&&f)){d=eW().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};
101
100
  _.u.ej=function(a,b){var c=null;a.media.customData&&(c=UU(a.media.customData.playerConfiguration));var d=c?c.abr||null:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;hW(c,b);return b};_.u.getTextDisplayer=function(){return null};_.u.setDrmCustomDataModifier=function(){};_.u.setCdnErrorCallback=function(){};_.u.detach=function(){};dW.prototype.getTextDisplayer=dW.prototype.getTextDisplayer;dW.prototype.getNetworkEngine=dW.prototype.getNetworkEngine;
102
101
  dW.prototype.setNetworkEngine=dW.prototype.setNetworkEngine;_.u=iW.prototype;_.u.init=function(a){var b=this;a&&(this.f=new dW,_.ss(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.yp?_.y(c,RU(b.m),0):c.F(0)})}))};
103
102
  _.u.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=lW(),b=lW().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[PU]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Nl.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=
104
103
  d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Ml.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(PU,this.w)}};
105
- _.u.stop=function(){if(this.a){this.a=!1;this.o.release();var a=lW();lW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(PU,this.w);a.stop();this.m=this.f=null}};_.u.de=function(a){this.j=a};_.u.tn=function(a){this.l=a};_.u.on=function(a,b){lW().addEventListener(a,b)};_.u.off=function(a,b){lW().removeEventListener(a,b)};_.u.addMessageListener=function(a){typeof a===_.re&&this.h.add(a)};
106
- _.u.removeMessageListener=function(a){typeof a===_.re&&this.h["delete"](a)};_.u.sendMessage=function(a,b){lW().sendCustomMessage(PU,b,TU(a))};_.u.yc=function(){return this.a};_.u.zb=function(){return mW()};_.u.Xb=function(a){nW(this,a)};_.u.Kn=function(a){var b=mW(),c=null;a?c=Object.assign({},b,a):c=b;nW(this,c)};
104
+ _.u.stop=function(){if(this.a){this.a=!1;this.o.release();var a=lW();lW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(PU,this.w);a.stop();this.m=this.f=null}};_.u.de=function(a){this.j=a};_.u.vn=function(a){this.l=a};_.u.on=function(a,b){lW().addEventListener(a,b)};_.u.off=function(a,b){lW().removeEventListener(a,b)};_.u.addMessageListener=function(a){typeof a===_.re&&this.h.add(a)};
105
+ _.u.removeMessageListener=function(a){typeof a===_.re&&this.h["delete"](a)};_.u.sendMessage=function(a,b){lW().sendCustomMessage(PU,b,TU(a))};_.u.xc=function(){return this.a};_.u.zb=function(){return mW()};_.u.Xb=function(a){nW(this,a)};_.u.Mn=function(a){var b=mW(),c=null;a?c=Object.assign({},b,a):c=b;nW(this,c)};
107
106
  _.u.Nl=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return pW(this,a);try{var b=(new DOMParser).parseFromString(a,_.mg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=lW();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===_.r||g===_.$c){g=e[f].getAttribute(_.Oe);for(var h=e[f].getElementsByTagName(_.Sb),l=h.length-
108
107
  1;0<=l;--l){var m=h[l].getAttribute(_.Oe)||g,n=h[l].getAttribute(_.Hd),p=h[l].getAttribute(_.Sg)||void 0,q=h[l].getAttribute(_.se)||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(_.Sb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ka).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.ac)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=lW();c=a.getElementsByTagName("StreamIndex");
109
108
  for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.r){e=c[d].getElementsByTagName(_.Qb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.vb)||void 0,h=e[f].getAttribute(_.ub)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Fg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.Qb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
110
109
  _.u.Ml=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=UU(c.media.customData.playerConfiguration));if(!b.m||!d){l.F(2);break}if(!b.j){l.F(3);break}return _.y(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.F(5);break}return _.y(l,SV(c.media,d.ima,b.m.getNetworkEngine()),5);case 5:typeof d.startTime===_.k&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.F(7);
111
110
  break}b.f.C=!0;return _.y(l,_.Bs(b.m,d),8);case 8:return _.y(l,_.Cs(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Yb&&(c.media.hlsVideoSegmentFormat=WU(f.Yb,_.yk)),f.audioMimeType&&(c.media.hlsSegmentFormat=WU(f.audioMimeType,_.xk));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.k){var m=g.sectionStartAbsoluteTime;g.sectionStartAbsoluteTime=0===m?1E-8:m}void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay);case 2:if(!b.l){l.F(10);
112
- break}return _.y(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.u.sm=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.Cl;var b=lW().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))}_.xs(this.m)}};
113
- _.u.uj=function(a){if(0<this.h.size){var b=UU(a.data);this.h.forEach(function(c){return c(b)})}};_.J(OU,iW);iW.prototype.updateContentMetadata=iW.prototype.Kn;iW.prototype.setContentMetadata=iW.prototype.Xb;iW.prototype.getContentMetadata=iW.prototype.zb;iW.prototype.isApiReady=iW.prototype.yc;iW.prototype.sendMessage=iW.prototype.sendMessage;iW.prototype.removeMessageListener=iW.prototype.removeMessageListener;iW.prototype.addMessageListener=iW.prototype.addMessageListener;iW.prototype.off=iW.prototype.off;
114
- iW.prototype.on=iW.prototype.on;iW.prototype.setLoadRequestDataInterceptor=iW.prototype.tn;iW.prototype.setPlayerConfigInterceptor=iW.prototype.de;iW.prototype.stop=iW.prototype.stop;iW.prototype.start=iW.prototype.start;iW.prototype.init=iW.prototype.init;iW.getInstance=kW;var jW=null;_.u=qW.prototype;_.u.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.Hm.bind(a),d=_.w(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.A(g)})};_.u.start=function(){return _.I(function(a){_.A(a)})};_.u.Uc=function(){};_.u.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.u.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
115
- _.u.skip=function(){var a=this.f.a;a&&this.f.sendMessage(QU,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.u.getVolume=function(){return this.f.getVolume()||0};_.u.setVolume=function(a){this.f.setVolume(a)};_.u.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.u.Qc=function(){return!0};_.u.pc=function(){var a=this;return _.I(function(b){a.h.release();_.A(b)})};
116
- _.u.Hm=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Nc,{adsTimeline:new NV(a.breaks)})));break;case "isPlayingBreak":a.value?sW(this,_.uc):(sW(this,_.yc),sW(this,_.Kc),sW(this,_.vc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(sW(this,_.yc),sW(this,_.Kc)),sW(this,_.Jc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?sW(this,_.Fc):sW(this,_.Hc))}};qW.prototype.getPosition=qW.prototype.getPosition;
117
- qW.prototype.setVolume=qW.prototype.setVolume;qW.prototype.getVolume=qW.prototype.getVolume;qW.prototype.skip=qW.prototype.skip;qW.prototype.pause=qW.prototype.pause;qW.prototype.resume=qW.prototype.resume;tW.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};tW.prototype.a=function(a,b){return a.namespace()!==_.Ad?!1:!(!b||!b.ima)};tW.prototype.create=function(a){return new qW(a.a)};_.fq(new tW);uW.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};uW.prototype.a=function(a,b){return kW().yc()?!(!b||!b.ima):!1};uW.prototype.create=function(a){return new PV(a)};_.fq(new uW);};
111
+ break}return _.y(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.u.sm=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.M.Cl;var b=lW().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))}_.xs(this.m)}};
112
+ _.u.uj=function(a){if(0<this.h.size){var b=UU(a.data);this.h.forEach(function(c){return c(b)})}};_.J(OU,iW);iW.prototype.updateContentMetadata=iW.prototype.Mn;iW.prototype.setContentMetadata=iW.prototype.Xb;iW.prototype.getContentMetadata=iW.prototype.zb;iW.prototype.isApiReady=iW.prototype.xc;iW.prototype.sendMessage=iW.prototype.sendMessage;iW.prototype.removeMessageListener=iW.prototype.removeMessageListener;iW.prototype.addMessageListener=iW.prototype.addMessageListener;iW.prototype.off=iW.prototype.off;
113
+ iW.prototype.on=iW.prototype.on;iW.prototype.setLoadRequestDataInterceptor=iW.prototype.vn;iW.prototype.setPlayerConfigInterceptor=iW.prototype.de;iW.prototype.stop=iW.prototype.stop;iW.prototype.start=iW.prototype.start;iW.prototype.init=iW.prototype.init;iW.getInstance=kW;var jW=null;_.u=qW.prototype;_.u.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.Im.bind(a),d=_.w(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.B(g)})};_.u.start=function(){return _.I(function(a){_.B(a)})};_.u.Tc=function(){};_.u.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.u.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
114
+ _.u.skip=function(){var a=this.f.a;a&&this.f.sendMessage(QU,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.u.getVolume=function(){return this.f.getVolume()||0};_.u.setVolume=function(a){this.f.setVolume(a)};_.u.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.u.Pc=function(){return!0};_.u.pc=function(){var a=this;return _.I(function(b){a.h.release();_.B(b)})};
115
+ _.u.Im=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Nc,{adsTimeline:new NV(a.breaks)})));break;case "isPlayingBreak":a.value?sW(this,_.uc):(sW(this,_.yc),sW(this,_.Kc),sW(this,_.vc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(sW(this,_.yc),sW(this,_.Kc)),sW(this,_.Jc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?sW(this,_.Fc):sW(this,_.Hc))}};qW.prototype.getPosition=qW.prototype.getPosition;
116
+ qW.prototype.setVolume=qW.prototype.setVolume;qW.prototype.getVolume=qW.prototype.getVolume;qW.prototype.skip=qW.prototype.skip;qW.prototype.pause=qW.prototype.pause;qW.prototype.resume=qW.prototype.resume;tW.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};tW.prototype.a=function(a,b){return a.namespace()!==_.Ad?!1:!(!b||!b.ima)};tW.prototype.create=function(a){return new qW(a.a)};_.fq(new tW);uW.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};uW.prototype.a=function(a,b){return kW().xc()?!(!b||!b.ima):!1};uW.prototype.create=function(a){return new PV(a)};_.fq(new uW);};
118
117
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
119
118
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
120
119
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.conviva.js CHANGED
@@ -10,18 +10,18 @@ a.a=null;a.h=!1}},sU=function(a){a.f.on(a.m,_.uc,a.Bj.bind(a));a.f.on(a.m,_.vc,a
10
10
  b.detail;if(10003===c.code&&(a.g.debug("onAdError()"),!a.j)){b=Conviva.Constants.ErrorSeverity;switch(c.data.errorType){case 0:c="Ad Load Error";break;case 1:c="Ad Play Error";break;default:c=fU}null===a.a&&oU(a,null);a.a.reportAdError(c,b.FATAL);a.j=!0;a.g.debug("Ad Playback Failure");rU(a,pU,c)}})},tU=function(a,b){this.m=a;this.f=new _.Qh;this.a=null;this.o=!1;this.H=!0;this.B=this.h=this.A=this.C=this.l=!1;this.N=0;this.K=!1;this.w=null;this.J=!1;this.g=b;this.L=this.G=null;this.j=[];this.I=0},
11
11
  uU=function(a){if(!a.l&&a.a){var b=jU(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},vU=function(a){return null!==a.a&&a.C},wU=function(a){return a.m.getConfiguration().autoplay||!1},xU=function(a,b){var c={};c[Conviva.Constants.LOG_LEVEL]=Conviva.Constants.LogLevel.DEBUG;b.serviceUrl&&(a.g.warn("Touchstone URL is set. Do not set this in production!"),c[Conviva.Constants.GATEWAY_URL]=b.serviceUrl.replace(/\/$/,""));Conviva.Analytics.init(b.customerKey,
12
12
  null,c);Conviva.Analytics.setDeviceMetadata(iU(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;c={};c[Conviva.Constants.FRAMEWORK_NAME]=_.va;c[Conviva.Constants.FRAMEWORK_VERSION]=_.ja;a.a.setPlayerInfo(c)},yU=function(a){if(!a.l)if(a.C)a.g.warn("Current session still active. No-op.");else{var b=a.m.getLoadedSource()||a.L,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||
13
- "N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.Fk(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.Gk(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.va;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.N.R(c.customTags))for(var h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(function(){a.g.debug("reportMiscellaneousMetrics()");if(vU(a)){var l=
13
+ "N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.Fk(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.Gk(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.va;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.M.R(c.customTags))for(var h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(function(){a.g.debug("reportMiscellaneousMetrics()");if(vU(a)){var l=
14
14
  1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=a.m.getStats()){l=l.decodedFrames;var m=l-a.I;a.I=l;isFinite(m)&&(a.g.debug("Current FPS",m),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,m))}}});a.C=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.xh(l.args)}));a.j=[]}},zU=function(a){a.g.debug("terminateSession()");a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,
15
- Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.C=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.N=0,a.K=!1,a.j=[],a.I=0)},AU=function(){this.h=this.f=null;this.a=!1;this.g=new _.K("clpp.conviva")},BU=function(a){var b=[];typeof a===_.Ue&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.O(1,9,9001,{missingKeys:b});},CU=function(a,b){var c=b.getConfiguration();a.a=!_.N.R(c.conviva)&&typeof c.conviva===
16
- _.Ue;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.O(1,9,9E3),a.S(b,c)):b.namespace()===_.Ad&&(a.a=!1,a.g.debug("Conviva does not report when casting.")):a.g.warn("Conviva plugin is loaded but not configured. Will do nothing.")},DU=function(){};_.u=nU.prototype;_.u.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.va;sU(this)};_.u.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.ma):(_.Th(this.f),this.a&&rU(this,EU),this.f.release(),this.o=!0,this.h=this.j=!1)};_.u.destroy=function(){this.g.debug(_.Ud);this.l?this.g.debug(_.la):this.l=!0};_.u.Bj=function(){this.g.debug(gU)};_.u.Cj=function(){this.g.debug(hU)};
15
+ Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.C=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.N=0,a.K=!1,a.j=[],a.I=0)},AU=function(){this.h=this.f=null;this.a=!1;this.g=new _.K("clpp.conviva")},BU=function(a){var b=[];typeof a===_.Ue&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.N(1,9,9001,{missingKeys:b});},CU=function(a,b){var c=b.getConfiguration();a.a=!_.M.R(c.conviva)&&typeof c.conviva===
16
+ _.Ue;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.N(1,9,9E3),a.S(b,c)):b.namespace()===_.Ad&&(a.a=!1,a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},DU=function(){};_.u=nU.prototype;_.u.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.va;sU(this)};_.u.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.ma):(_.Th(this.f),this.a&&rU(this,EU),this.f.release(),this.o=!0,this.h=this.j=!1)};_.u.destroy=function(){this.g.debug(_.Ud);this.l?this.g.debug(_.la):this.l=!0};_.u.Bj=function(){this.g.debug(gU)};_.u.Cj=function(){this.g.debug(hU)};
17
17
  _.u.Ij=function(a){this.g.debug("onAdStarted()");a=a.ad;this.h||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),oU(this,a));this.h=!1;this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.PLAYING);this.a.reportAdMetric(Conviva.Constants.Playback.RESOLUTION,a.ob(),a.nb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.ab())};
18
18
  _.u.Oe=function(a){var b=this;this.g.debug("onAdStateChanged()");if(this.a){var c=function(d){b.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,d)};switch(a.type){case _.Gc:case _.Hc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.Fc:c(Conviva.Constants.PlayerState.PAUSED);break;case _.wc:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.u.Jj=function(){this.g.debug("onAdStopped()");this.a&&!this.j&&rU(this,EU)};_.u.Hj=function(){this.g.debug("onAdSkipped()");this.a&&rU(this,qU)};
19
19
  _.u.Dj=function(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.u.Fj=function(){this.g.debug("onAdImpression()");if(this.a){var a=Conviva.Constants.Events;this.a.reportAdPlayerEvent(a.AD_IMPRESSION_START);this.a.reportAdPlayerEvent(a.AD_IMPRESSION_END)}};
20
20
  _.u.Gj=function(a){var b=this;this.g.debug("onAdLoaded()");var c=a.ad;if(-1!==c.getPodIndex()||this.m.getPosition()>=this.m.getDuration()-5)b.h=!0,oU(b,c);else this.f.on(this.m,_.ng,function(){b.m.getPosition()>=b.m.getDuration()-5&&(b.f.off(b.m,_.ng),b.h=!0,oU(b,c))})};_.u.Ej=function(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.u.Yl=function(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
21
21
  _.u.Kj=function(){this.g.debug("onAdThirdQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)};var qU=0,EU=1,pU=2;_.u=tU.prototype;
22
- _.u.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.N.$a(b),this.L=c,this.m=a,xU(this,this.G),this.f.on(this.m,_.hf,this.zm.bind(this)),this.f.on(this.m,_.cg,this.Pj.bind(this)),this.f.on(this.m,_.hd,this.Rg.bind(this)),this.f.on(this.m,_.xg,this.Oj.bind(this)),this.f.on(this.m,_.wg,this.Nj.bind(this)),this.f.on(this.m,_.uc,this.Lj.bind(this)),this.f.on(this.m,_.vc,this.Mj.bind(this)),this.f.on(this.m,_.Nc,this.dm.bind(this)),this.f.on(this.m,_.gd,this.fm.bind(this)),
22
+ _.u.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.M.$a(b),this.L=c,this.m=a,xU(this,this.G),this.f.on(this.m,_.hf,this.Am.bind(this)),this.f.on(this.m,_.cg,this.Pj.bind(this)),this.f.on(this.m,_.hd,this.Rg.bind(this)),this.f.on(this.m,_.xg,this.Oj.bind(this)),this.f.on(this.m,_.wg,this.Nj.bind(this)),this.f.on(this.m,_.uc,this.Lj.bind(this)),this.f.on(this.m,_.vc,this.Mj.bind(this)),this.f.on(this.m,_.Nc,this.dm.bind(this)),this.f.on(this.m,_.gd,this.fm.bind(this)),
23
23
  this.f.on(this.m,_.ne,this.Sg.bind(this)),wU(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),yU(this)))};_.u.release=function(){this.g.debug("Release conviva");this.H?this.g.debug(_.ma):(_.Th(this.f),vU(this)||this.o||!wU(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),vU(this)&&zU(this),this.a=null,this.H=!0)};_.u.destroy=function(){this.g.debug(_.Ud);this.l?this.g.debug(_.la):this.l=!0};
24
- _.u.reportAppEvent=function(a,b){var c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c};_.u.zm=function(){this.g.debug("onPlayRequest()");vU(this)||wU(this)?vU(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),vU(this)&&!this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_ENDED),this.h=!0),this.A=!1):(this.g.debug("Creating conviva session. On Play Requested / No autoplay"),yU(this))};
24
+ _.u.reportAppEvent=function(a,b){var c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c};_.u.Am=function(){this.g.debug("onPlayRequest()");vU(this)||wU(this)?vU(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),vU(this)&&!this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_ENDED),this.h=!0),this.A=!1):(this.g.debug("Creating conviva session. On Play Requested / No autoplay"),yU(this))};
25
25
  _.u.Pj=function(a){function b(d){if(c.o&&(c.g.debug("Creating conviva session (On Seek / Replay)"),xU(c,c.G),yU(c),uU(c),vU(c))){var e=c.m.getTrackManager();e=e.na()||e.lb();e.width&&e.height&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,e.width,e.height);e.bandwidth&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,e.bandwidth/1E3)}vU(c)&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,d)}var c=this;this.g.debug(_.Ze);switch(a.detail.currentState){case _.Mp:b(Conviva.Constants.PlayerState.PLAYING);
26
26
  break;case _.Lp:b(Conviva.Constants.PlayerState.PAUSED);break;case _.Dp:b(Conviva.Constants.PlayerState.BUFFERING);break;case _.Fp:this.g.debug("onVideoEnded()"),vU(this)&&(this.w&&this.w.Eb()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.K=!0):zU(this))}};
27
27
  _.u.Rg=function(a){this.g.debug(_.Ve);if(vU(this)){if(a=a.detail,typeof a.width===_.k&&typeof a.height===_.k&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){var b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({xh:this.Rg.bind(this),args:a})};
@@ -29,7 +29,7 @@ _.u.Oj=function(){this.g.debug("onSeeking()");vU(this)&&this.a.reportPlaybackMet
29
29
  _.u.Lj=function(a){this.g.debug(gU);var b=a.ad;a=0===b.Ua();var c=kU(b.getPodIndex());vU(this)||wU(this)||!a||yU(this);if(vU(this)){a=0===b.qb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;var d=0,e={};1===b.pb()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.N;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.rl()?b.CONTENT:b.SEPARATE;this.a.reportAdBreakStarted(a,
30
30
  b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")};_.u.Mj=function(){this.g.debug(hU);vU(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.K&&zU(this))};
31
31
  _.u.Sg=function(a){this.g.debug(_.We);if(this.o&&this.J)this.g.debug("Session ended in VPF; ignoring subsequent errors");else{var b=a.detail||null,c=b&&b.message||"Player error",d=Conviva.Constants.ErrorSeverity.WARNING;b&&b.severity&&b.severity===_.P&&(d=Conviva.Constants.ErrorSeverity.FATAL,vU(this)||yU(this));vU(this)?(this.g.debug("Report error",c,d),this.a.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.g.debug("Video Playback Failure"),this.J=!0,zU(this))):this.j.push({xh:this.Sg.bind(this),
32
- args:a})}};_.u.fm=function(){this.g.debug("onAutoPlayBlocked()");vU(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,vU(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))};_.u=AU.prototype;_.u.onPlayerCreated=function(a){this.f=new tU(a,this.g)};_.u.onContentWillLoad=function(a,b){var c=this;CU(this,a);if(this.a){var d=a.getConfiguration();d=_.N.$a(d.conviva||{});try{BU(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.h=new nU(a,function(){return c.f.a}),this.h.initialize(d))}catch(f){f instanceof _.O?this.S(a,f):this.S(a,new _.O(1,9,9002,f,f))}}};_.u.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&uU(this.f)};
32
+ args:a})}};_.u.fm=function(){this.g.debug("onAutoPlayBlocked()");vU(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,vU(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))};_.u=AU.prototype;_.u.onPlayerCreated=function(a){this.f=new tU(a,this.g)};_.u.onContentWillLoad=function(a,b){var c=this;CU(this,a);if(this.a){var d=a.getConfiguration();d=_.M.$a(d.conviva||{});try{BU(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.h=new nU(a,function(){return c.f.a}),this.h.initialize(d))}catch(f){f instanceof _.N?this.S(a,f):this.S(a,new _.N(1,9,9002,f,f))}}};_.u.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&uU(this.f)};
33
33
  _.u.onPlayerWillDestroy=function(){this.a&&(this.a=!1,this.f.destroy(),this.f=null,this.h&&(this.h.destroy(),this.h=null))};_.u.onPlayerWillRelease=function(){this.a&&(this.f.release(),this.h&&this.h.release())};_.u.id=function(){return"conviva"};_.u.S=function(a,b){a.trigger(new _.L(_.ne,{detail:b}))};_.u.reportAppEvent=function(a,b){return this.f?this.f.reportAppEvent(a,b):!1};_.J("clpp.conviva.ConvivaPlugin",AU);AU.prototype.reportAppEvent=AU.prototype.reportAppEvent;AU.Id="conviva";
34
34
  DU.prototype.create=function(){return new AU};_.Fs(new DU);};
35
35
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}