@castlabs/prestoplay 6.22.0 → 6.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +116 -116
- package/cjs/cl.conviva.js +32 -33
- package/cjs/cl.core.js +592 -590
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +86 -80
- package/cjs/cl.externs.js +43 -36
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +71 -70
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +342 -328
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +86 -86
- package/cl.conviva.js +27 -27
- package/cl.core.js +474 -472
- package/cl.crypto.js +9 -9
- package/cl.dash.js +80 -75
- package/cl.externs.js +43 -36
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +16 -16
- package/cl.mse.js +303 -290
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +27 -26
- package/package.json +1 -1
- package/typings.d.ts +53 -6
package/cjs/cl.cast.js
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
a;this.j=null;this.f=_.
|
|
4
|
-
"Infinity"===c?Infinity:c})}catch(b){return a}},
|
|
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 _.
|
|
6
|
-
void 0===a?
|
|
7
|
-
this.o=this.a=null;this.w=this.
|
|
8
|
-
e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;
|
|
9
|
-
_.
|
|
10
|
-
|
|
11
|
-
a:{var b=a.metadataType;var c=Object.entries(
|
|
12
|
-
a.ca.length){a.w=!0;a.o.
|
|
13
|
-
null;a=null===a?null:a+b;return null===a?b:a},
|
|
14
|
-
a.j&&a.j.init(),a.trigger(new _.L(_.
|
|
15
|
-
b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.
|
|
16
|
-
void 0;case 6:delete b.
|
|
17
|
-
|
|
18
|
-
this.a=
|
|
19
|
-
return _.I(function(c){if(1==c.a)return a.trigger(new _.L(_.
|
|
20
|
-
b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},
|
|
21
|
-
cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];
|
|
22
|
-
var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=
|
|
23
|
-
-1!==a.getPosition()){var d=null;(c=
|
|
24
|
-
g.position}).sort(function(g,h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new
|
|
25
|
-
_.
|
|
26
|
-
var e=!1,f=[];b===_.
|
|
27
|
-
e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.
|
|
28
|
-
this.l=-1;this.G=new _.
|
|
29
|
-
h=e.
|
|
30
|
-
e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},
|
|
31
|
-
this.w=this.
|
|
32
|
-
|
|
33
|
-
if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(h);++g}return f.join("\n")},
|
|
34
|
-
cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},
|
|
35
|
-
c})}b.breakClips&&(d=b.breakClips.find(function(h){return h.id===a.a.breakClipId})||null);b=new
|
|
36
|
-
_.
|
|
37
|
-
{detail:a}))}};_.J("clpp.cast.CastUtils",function(){});var
|
|
38
|
-
|
|
39
|
-
_.
|
|
40
|
-
c.renditions.push(new _.
|
|
41
|
-
_.
|
|
42
|
-
_.
|
|
43
|
-
|
|
44
|
-
_.
|
|
45
|
-
_.
|
|
46
|
-
_.
|
|
47
|
-
_.
|
|
48
|
-
_.
|
|
49
|
-
_.
|
|
50
|
-
_.
|
|
51
|
-
_.
|
|
52
|
-
_.
|
|
53
|
-
_.
|
|
54
|
-
_.
|
|
55
|
-
_.
|
|
56
|
-
_.
|
|
57
|
-
_.
|
|
58
|
-
isLive:this.isLive()},currentTime:
|
|
59
|
-
_.
|
|
60
|
-
window.__onGCastApiAvailable=
|
|
61
|
-
_.
|
|
62
|
-
(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.
|
|
63
|
-
b.g.error("Error while trying to cast",d),e=new _.L(_.
|
|
64
|
-
_.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_.
|
|
68
|
-
_.
|
|
69
|
-
a.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,
|
|
70
|
-
_.
|
|
71
|
-
_.
|
|
72
|
-
_.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_.
|
|
77
|
-
_.
|
|
78
|
-
_.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
_.
|
|
82
|
-
_.
|
|
83
|
-
_.
|
|
84
|
-
_.
|
|
85
|
-
a),g;}}_.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_.
|
|
89
|
-
_.
|
|
90
|
-
_.
|
|
91
|
-
_.
|
|
92
|
-
_.
|
|
93
|
-
_.
|
|
94
|
-
_.
|
|
95
|
-
_.
|
|
96
|
-
_.
|
|
97
|
-
_.
|
|
98
|
-
_.
|
|
99
|
-
_.
|
|
100
|
-
(!e||e&&f)){d=
|
|
101
|
-
_.
|
|
102
|
-
d=Object.assign({},d,{shakaConfig:c});return d};_.
|
|
103
|
-
_.
|
|
104
|
-
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.
|
|
105
|
-
_.
|
|
106
|
-
_.
|
|
107
|
-
_.
|
|
108
|
-
1;0<=l;--l){var m=h[l].getAttribute(_.
|
|
109
|
-
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.r){e=c[d].getElementsByTagName(_.
|
|
110
|
-
_.
|
|
111
|
-
break}b.f.C=!0;return _.y(l,_.
|
|
112
|
-
break}return _.y(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.
|
|
113
|
-
_.
|
|
114
|
-
|
|
115
|
-
_.
|
|
116
|
-
_.
|
|
117
|
-
|
|
2
|
+
var f=function(window){var rW="Cannot seek during ads playout.",sW="Cannot switch track",tW="Media session does not exist.",uW="No receivers available",vW="Reset ABR functionality not available on cast.",wW="SDK not yet ready",xW="Sender is destroyed.",yW="clpp.cast.CastProxy",zW="clpp.cast.Player",AW="clpp.cast.Receiver",BW="urn:x-cast:castlabs",CW="urn:x-cast:com.google.cast.media",DW=function(a){return _.I(function(b){return 1==b.a?_.y(b,a.Jc(_.df),2):_.y(b,a.Jc(_.cf),0)})},EW=function(a,b){this.log=new _.K(b);this.player=
|
|
3
|
+
a;this.j=null;this.f=_.uq;this.l=_.vq;this.h=2;this.B=Date.now();this.A=-1},FW=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.we){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ze?"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}})},GW=function(a){if(typeof a!==_.lg)return a;try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:
|
|
4
|
+
"Infinity"===c?Infinity:c})}catch(b){return a}},HW=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=_.jl(d,a.mimeType,g);if(!f||!g)return q.F(2);l=_.gk(a.url);return _.y(q,c.fetch(l).T,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Hj(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)})},IW=function(a,b){if(window.chrome&&
|
|
5
|
+
chrome.cast&&chrome.cast.media){var c=chrome.cast.media.HlsSegmentFormat;var d=chrome.cast.media.HlsVideoSegmentFormat}else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.Lg:return d.FMP4;case _.Kg:return b===_.Kk?d.MPEG2_TS:c.TS;case _.$c:return c.AAC;case _.ad:return c.AC3;case _.bd:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.cd:return c.FMP4}},KW=function(a){a=
|
|
6
|
+
void 0===a?JW:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.P(1,8,8001);var c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},LW=function(a){EW.call(this,a,"clpp.cast.SenderStateManager");
|
|
7
|
+
this.o=this.a=null;this.w=this.cc.bind(this)},MW=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},NW=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},PW=function(a,b){var c=NW(a);return OW(a,b).find(function(d){return c.includes(d.id)})||null},OW=function(a,b){return a.h.filter(function(c){return c.type===b})},RW=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.U){var e=a.Ba();
|
|
8
|
+
e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;QW(a,b)},function(f){a.f[b]=null;a.g.debug(sW,f)})}else b===_.U&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){QW(a,b)},function(f){a.g.debug(sW,f)}))},QW=function(a,b){b===_.Jk?a.a.trigger(new _.L(_.qm)):b===_.U&&a.a.trigger(new _.L(_.rm))},VW=function(a,b,c,d){_.xm.call(this);this.g=new _.K(_.zd);this.ca=a;this.o=new _.yl(b);this.$=c;this.ha=d;this.h=this.J=
|
|
9
|
+
_.Em();this.C=[];this.B=0;this.L=new _.Bk;this.G=this.l=this.a=null;this.A=this.w=!1;this.ia="";this.Ja=1E6;this.f=new MW;this.f.initialize(this);this.j=new LW(this);this.H=new _.Yh;this.K=null;this.I=new Set;this.P=this.Sm.bind(this);this.ya=this.nn.bind(this);this.da=this.en.bind(this);this.U=this.Wm.bind(this);this.M=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){SW(!0)},0)}});TW(this);UW.add(this)},
|
|
10
|
+
WW=function(a){var b,c;return _.I(function(d){if(1==d.a)return UW["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.y(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.$=null;a.ha=null;_.B(d)})},YW=function(a){if(!a)return null;
|
|
11
|
+
a:{var b=a.metadataType;var c=Object.entries(XW);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=KW(XW[b]);return Object.assign(b,a)},ZW=function(a){var b=void 0===b?JW:b;return Object.values(XW).includes(a)?a:b},cX=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},TW=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
|
|
12
|
+
a.ca.length){a.w=!0;a.o.Ug();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.ca;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya);hX&&a.o.ea(.02)}},mX=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},oX=function(a,b){nX(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.da);b.addMessageListener(BW,a.U)},nX=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.ak.bind(a)),a.H.on(a.G,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.dn.bind(a)),
|
|
14
|
+
a.j&&a.j.init(),a.trigger(new _.L(_.Me)))},pX=function(a){return _.I(function(b){return a.Ob()?b.F(0):_.y(b,cast.framework.CastContext.getInstance().requestSession(),0)})},qX=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G;return _.I(function(D){switch(D.a){case 1:return c=chrome.cast.media.StreamType,d=_.cw,_.y(D,pX(a),2);case 2:if(!b)return D["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);g.streamType=
|
|
15
|
+
b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.gc;m=h.audioMimeType;g.hlsVideoSegmentFormat=IW(l,d.VIDEO);g.hlsSegmentFormat=IW(m,d.AUDIO);if(!b.nb){D.F(3);break}if(!a.M){D.F(4);break}return _.y(D,Promise.resolve(a.M(b.nb)),5);case 5:if(n=D.f)b.nb=n;case 4:a.h=b.nb;a.C=_.Mq(a.h);a.B=a.C.findIndex(function(F){return F.url===b.source.url});if(!b.nb.remoteTextTracks){D.F(6);break}return _.y(D,Promise.all(b.nb.remoteTextTracks.map(a.sl.bind(a))),7);case 7:p=D.f,g.tracks=p.filter(function(F){return F}),b.nb.remoteTextTracks=
|
|
16
|
+
void 0;case 6:delete b.nb.autoplay,b.nb.startTime=null,g.customData={playerConfiguration:FW(b.nb)};case 3:q=a.Gb()||{};u=ZW(q.metadataType);typeof b.Eg===_.k&&(v={metadataType:u,sectionStartAbsoluteTime:b.Eg});b.source.name&&(z={metadataType:u,title:b.source.name});A=cX(q);if(H=YW(Object.assign({},v,z,A)))g.metadata=H;G=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.hd&&(G.autoplay=b.autoplay);typeof b.currentTime===_.k&&(G.currentTime=b.currentTime);return _.y(D,f.loadMedia(G),0)}})},
|
|
17
|
+
rX=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.f.Ba())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.f.qa())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.y(f,qX(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Eg:a.getPresentationStartTime(),autoplay:b,nb:a.h}),0)})},SW=function(a){if(a){a=_.w(UW);for(var b=a.next();!b.done;b=a.next())TW(b.value)}},tX=function(a,b,c){_.xm.call(this);this.f=a;this.h=b;this.j=typeof c===_.we?c:this.Xn;
|
|
18
|
+
this.a=sX(this);this.g=new _.K(yW);this.f&&this.forwardEventsTo(this.f)},sX=function(a){return new VW(a.h,function(){a.trigger(new _.L(_.od))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.kh&&(d.preferredAudioLanguage=c.kh);c.rj&&(d.preferredTextLanguage=c.rj);_.st(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return uX(a)})},uX=function(a){var b;
|
|
19
|
+
return _.I(function(c){if(1==c.a)return a.trigger(new _.L(_.nd)),b=a.f.a,b!==a.a&&a.f&&a.a?_.y(c,a.f.release(),2):c["return"]();_.st(a.f,a.a);_.B(c)})},vX=function(a){EW.call(this,a,"clpp.cast.StateManager");this.I=this.fk.bind(this);this.H=this.ek.bind(this);this.w=this.$m.bind(this);this.o=this.Rm.bind(this);this.K=this.hk.bind(this);this.J=this.gk.bind(this);this.L=this.rn.bind(this);this.G=this.cn.bind(this);this.C=this.dk.bind(this);this.a=this.ck.bind(this)},wX=function(a,b,c,d,e){this.a=a;
|
|
20
|
+
this.f=b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},xX=function(a){this.a=a},zX=function(a){this.m=a;this.a=null;this.h=this.ik.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];yX().addEventListener(this.f,this.h)},CX=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"]();_.C(n,2);AX=!1;e=_.gk(d);return _.y(n,c.fetch(e).T,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.T.ba(f.data),h=new DOMParser,l=h.parseFromString(g,_.sg),l.getElementsByTagName("vmap:VMAP").length)_.Jh("VMAP detected."),a.vmapAdsRequest=BX(g);else if(l.getElementsByTagName("VAST").length){_.Jh("VAST detected.");
|
|
22
|
+
var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=BX(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.Jh("Unsupported schema."),AX=!0;return _.uh(n,0)}m=_.E(n);_.Jh("Failed to fetch an ad",m);AX=!0;_.B(n)})},BX=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},yX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},EX=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||
|
|
23
|
+
-1!==a.getPosition()){var d=null;(c=DX(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},FX=function(a,b){var c=new _.P(1,10,10003,{errorType:b});a.m.onError(c)},DX=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.lg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.lg&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||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 wX(d,e,b.index,b.total,f)}return c},GX=function(a){this.Xa=a;this.a=this.f.bind(this)},HX=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]},IX=function(a){var b=a.dashTimedMetadata,c=_.Bg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Ag)?
|
|
25
|
+
_.xi:_.yg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},JX=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.Ln.bind(this);this.a=this.f=null},KX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},MX=function(a){a.a=KX().getTextTracksManager();var b=a.a.getTracks();a.j=LX(_.U,b)},NX=function(a,b,c,d){c=_.Bi(c).filter(function(h){return h});
|
|
26
|
+
var e=!1,f=[];b===_.Jk?f=a.getAudioTracks():b===_.U&&(f=a.la());if(c=c.find(function(h){var l=_.yj(h);return f.some(function(m){m=_.yj(m.language||"");return _.zj(l,m)})})){var g=_.yj(c);c=f.filter(function(h){h=_.yj(h.language||"");return _.zj(g,h)});f=c.length?c:f;e=e||!!c.length}_.T.jf(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===_.Jk?a.Ha(e):b===_.U&&a.Wa(e))},LX=function(a,b){for(var c=[],d=_.w(b),
|
|
27
|
+
e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Hk(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 _.Qk(f.id,f));c.push(f)}return c},OX=function(){_.xm.call(this);this.g=new _.K(zW);this.h=this.w=_.Em();this.A=null;
|
|
28
|
+
this.l=-1;this.G=new _.Bk;this.f=this.o=this.j=this.a=this.B=null;this.C=!1},PX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},SX=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=_.an(d);if(e){var f=[_.Od];_.Mq(a)[0].type!==_.Xc&&f.unshift(_.Qd);d.preferredDrmSystem===_.Od&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
|
|
29
|
+
h=e.Pa[g];h?(d=g===_.Qd?cast.framework.ContentProtection.WIDEVINE:g===_.Od?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},QX(b,h,a,d),RX(b,h,a,d)):c()}else c()}else c()},QX=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.gk({method:_.Gb,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},RX=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.kk(Object.assign({},f.headers),e.buffer,200,""),_.y(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.Hj(g.data))})}:a.licenseHandler=void 0},TX=function(){this.a=!1;this.g=new _.K(AW);this.f=this.m=null;this.h=new Set;this.A=this.bn.bind(this);
|
|
31
|
+
this.w=this.bk.bind(this);this.j=null;this.o=new _.Yh;this.l=null},VX=function(){return UX||(UX=new TX)},WX=function(){return cast.framework.CastReceiverContext.getInstance()},XX=function(){var a=WX().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},YX=function(a,b){var c=WX().getPlayerManager().getMediaInformation();if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;WX().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},
|
|
32
|
+
$X=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=WX();c=(WX().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Lg:_.Kg;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=ZX(h,_.sa),m=ZX(h,_.Ob),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")},ZX=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},aY=function(a){this.f=a;this.a=null;this.h=new _.Yh;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]},cY=function(a,b){var c=null,d=bY(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},bY=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 wX(d,c,e,f,g)}return b},dY=function(){},eY=function(){};_.t=EW.prototype;_.t.release=function(){this.Aa(_.uq)};_.t.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.t.getState=function(){return this.f};_.t.onError=function(a){a.severity===_.Q&&this.Aa(_.Fq)};
|
|
36
|
+
_.t.Aa=function(a){if(a!==this.f)if(this.f===_.Fq&&a!==_.uq)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===_.zq?(this.A=b,this.player.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.zq&&this.player.trigger(new _.L(_.id,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.nq(this.j,this.f);this.player.trigger(new _.L(_.ig,
|
|
37
|
+
{detail:a}))}};_.J("clpp.cast.CastUtils",function(){});var JW=0,XW={GENERIC:JW,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.x(LW,EW);LW.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)};LW.prototype.destroy=function(){var a=this;return _.I(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.y(b,EW.prototype.destroy.call(a),0)})};LW.prototype.Aa=function(a){var b=this.player.l;b&&b.isPlayingBreak||EW.prototype.Aa.call(this,a)};
|
|
38
|
+
LW.prototype.cc=function(){if(this.a&&this.o&&!this.o.isPlayingBreak)switch(this.a.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.a.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.Aa(_.Bq);break;case chrome.cast.media.IdleReason.ERROR:this.Aa(_.Fq);break;default:this.Aa(_.uq)}break;case chrome.cast.media.PlayerState.PLAYING:this.Aa(_.Iq);break;case chrome.cast.media.PlayerState.PAUSED:this.Aa(_.Hq);break;case chrome.cast.media.PlayerState.BUFFERING:this.Aa(_.zq)}};_.x(MW,_.ll);_.t=MW.prototype;_.t.initialize=function(a){this.a=a};_.t.release=function(){this.h=[];this.f={}};
|
|
39
|
+
_.t.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=_.Kk;break;case chrome.cast.media.TrackType.AUDIO:c=_.Jk;break;case chrome.cast.media.TrackType.TEXT:c=_.U}c=new _.Hk(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 _.Qk(c.id,c));return c}):[],this.a.trigger(new _.L(_.ew)))};_.t.destroy=function(){this.a=null};_.t.getVideoTracks=function(){return OW(this,_.Kk)};_.t.getAudioTracks=function(){return OW(this,_.Jk)};_.t.la=function(){return OW(this,_.U)};_.t.ma=function(){var a=this.La();return a?a.renditions[0]:null};_.t.Ya=function(){var a=this.qa();return a?a.renditions[0]:null};_.t.Va=function(){var a=this.Ba();return a?a.renditions[0]:null};_.t.vb=function(){return this.f[_.Kk]||null};
|
|
41
|
+
_.t.Hb=function(){return this.f[_.Jk]||null};_.t.Ib=function(){return this.f[_.U]||null};_.t.La=function(){return PW(this,_.Kk)};_.t.qa=function(){return PW(this,_.Jk)};_.t.Ba=function(){return PW(this,_.U)};_.t.Db=function(a){RW(this,_.Kk,a)};_.t.Ha=function(a){RW(this,_.Jk,a)};_.t.Wa=function(a){RW(this,_.U,a)};_.t.ob=function(a){this.Db(a&&a.track)};_.t.Bb=function(a){this.Ha(a&&a.track)};_.t.Cb=function(a){this.Wa(a&&a.track)};_.t.addTextTrack=function(){return _.I(function(a){_.B(a)})};
|
|
42
|
+
_.t.wa=function(){return!0};MW.prototype.isAbrEnabled=MW.prototype.wa;MW.prototype.addTextTrack=MW.prototype.addTextTrack;MW.prototype.setTextRendition=MW.prototype.Cb;MW.prototype.setAudioRendition=MW.prototype.Bb;MW.prototype.setVideoRendition=MW.prototype.ob;MW.prototype.setTextTrack=MW.prototype.Wa;MW.prototype.setAudioTrack=MW.prototype.Ha;MW.prototype.setVideoTrack=MW.prototype.Db;MW.prototype.getTextTrack=MW.prototype.Ba;MW.prototype.getAudioTrack=MW.prototype.qa;
|
|
43
|
+
MW.prototype.getVideoTrack=MW.prototype.La;MW.prototype.getLoadingTextRendition=MW.prototype.Ib;MW.prototype.getLoadingAudioRendition=MW.prototype.Hb;MW.prototype.getLoadingVideoRendition=MW.prototype.vb;MW.prototype.getTextRendition=MW.prototype.Va;MW.prototype.getAudioRendition=MW.prototype.Ya;MW.prototype.getVideoRendition=MW.prototype.ma;MW.prototype.getTextTracks=MW.prototype.la;MW.prototype.getAudioTracks=MW.prototype.getAudioTracks;MW.prototype.getVideoTracks=MW.prototype.getVideoTracks;_.x(VW,_.xm);_.t=VW.prototype;_.t.init=function(a,b){this.h=this.J=b};_.t.unload=function(){var a=this;return new Promise(function(b,c){a.f&&a.f.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.t.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.t.getTimeline=function(){return null};_.t.setupPlaylist=function(){return Promise.reject(_.Cb)};_.t.appendLoad=function(){return Promise.reject(_.Cb)};_.t.seekWith=function(){return Promise.reject(_.Cb)};
|
|
44
|
+
_.t.setSeekInterceptor=function(){};_.t.setPlaybackSessionId=function(){};_.t.destroy=function(){return _.I(function(a){_.B(a)})};_.t.xe=function(a){this.M=a};_.t.Hc=function(){return this.w};_.t.Ob=function(){return this.A};_.t.hg=function(){return this.ia};
|
|
45
|
+
_.t.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 _.P(1,8,8004,void 0);g.F(2);break}_.C(g,3);return _.y(g,e.sendMessage(a,FW(b)),5);case 5:_.uh(g,2);break;case 3:f=_.E(g),d=new _.P(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.B(g)}})};
|
|
46
|
+
_.t.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Hc())throw a.g.warn(wW),new _.P(1,8,8001,void 0);if(!hX)throw a.g.warn(uW),new _.P(1,8,8002,void 0);if(a.Ob())throw a.g.warn("Already casting"),new _.P(1,8,8003,void 0);_.C(d,2);return _.y(d,pX(a),4)}if(2!=d.a)return _.uh(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 _.P(1,8,8E3,c);})};_.t.eg=function(){this.Ob()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
|
|
47
|
+
_.t.addMessageListener=function(a){typeof a===_.we&&this.I.add(a)};_.t.removeMessageListener=function(a){typeof a===_.we&&this.I["delete"](a)};_.t.play=function(){var a=this;return this.isEnded()?rX(this,!0):new Promise(function(b,c){if(!a.a)return c(tW);a.a.play(null,b,c)})};_.t.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(tW);a.a.pause(null,b,c)})};_.t.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
|
|
48
|
+
_.t.isEnded=function(){return this.getState()===_.Bq};_.t.seek=function(a){var b=this;return this.isEnded()?rX(this,!1,a):new Promise(function(c,d){b.a||d(tW);b.l.isPlayingBreak&&d(rW);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.Dg));b.a.seek(e,function(){b.trigger(new _.L(_.Cg));c()},d)})};_.t.getPosition=function(){return this.getMediaPosition()};_.t.getMediaPosition=function(){return this.a&&this.a.getEstimatedTime()||0};_.t.getDuration=function(){return this.getMediaDuration()};
|
|
49
|
+
_.t.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};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};_.t.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.t.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(CW,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
|
|
50
|
+
_.t.getVolume=function(){return this.a&&this.a.volume.level};_.t.setVolume=function(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))};_.t.isMuted=function(){return this.a&&this.a.volume.muted};_.t.setMuted=function(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};
|
|
51
|
+
_.t.getPresentationStartTime=function(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;var a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.k?null:1E-8===a?0:a};_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.t.getState=function(){return this.j?this.j.getState():_.vq};
|
|
52
|
+
_.t.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?GW(this.a.customData.stats):_.tq()};_.t.isLive=function(){return Infinity===this.getDuration()};_.t.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Hc())return b.g.warn(wW),e["return"]();if(!hX)return b.g.warn(uW),e["return"]();b.C=_.Mq(a);b.h=_.Gm(b.J,a);c=b.C[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,nb:b.h,gc:c.gc,audioMimeType:c.audioMimeType};return _.y(e,qX(b,d),0)})};
|
|
53
|
+
_.t.getBufferInfo=function(){return new _.wm};_.t.getTrackManager=function(){return this.f};_.t.getConfiguration=function(){return this.h};_.t.getSurface=function(){return null};_.t.setNetworkEngine=function(a){this.L=a};_.t.getNetworkEngine=function(){return this.L};_.t.getSourceIndex=function(){return this.B};_.t.setSourceIndex=function(a){this.B=a};_.t.setCmsdManager=function(){};_.t.getLoadedSource=function(){return this.C[this.B]};_.t.getPeriods=function(){return[]};_.t.getDrmInfo=function(){return null};
|
|
54
|
+
_.t.getTimelineCues=function(){return[]};_.t.getCueTimeline=function(){return null};_.t.resetAbr=function(){this.g.warn(vW)};_.t.onError=function(a){if(a&&(this.trigger(new _.L(_.se,{detail:a})),this.j))this.j.onError(a)};_.t.namespace=function(){return _.zd};_.t.canPlay=function(){return this.Hc()?2:0};_.t.Gb=function(){return this.K};_.t.fc=function(a){this.K=YW(a)};_.t.Uf=function(){this.K=null};
|
|
55
|
+
_.t.Og=function(a){var b=this.Gb()||{};a={metadataType:ZW(b.metadataType),title:a};this.fc(Object.assign({},b,a))};_.t.Mg=function(a){var b=this.Gb()||{},c=ZW(b.metadataType);a=new chrome.cast.Image(a);this.fc(Object.assign({},b,{metadataType:c,images:[a]}))};_.t.Lg=function(a){var b=this.Gb()||{};this.fc(Object.assign({},b,{metadataType:3,artist:a}))};_.t.Ng=function(a){var b=this.Gb()||{};a={metadataType:ZW(b.metadataType),releaseDate:a};this.fc(Object.assign({},b,a))};
|
|
56
|
+
_.t.Sm=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;hX=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ia=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Ug()};
|
|
57
|
+
_.t.nn=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;oX(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Ob()||(this.A=!0,oX(this,a.session),this.ha());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Ob()&&this.a){var b=this.a.media,c=this.f.qa(),d=this.f.Ba();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:mX(this),rj:d,kh:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.da);a.session.removeMessageListener(BW,this.U);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}};_.t.en=function(a){this.g.debug("New media session",a.mediaSession);nX(this,a.mediaSession)};_.t.dn=function(a){a.value&&a.value.tracks&&this.f&&this.f.load()};_.t.Wm=function(a,b){if(a===BW&&0<this.I.size){var c=GW(b);this.I.forEach(function(d){return d(c)})}};
|
|
59
|
+
_.t.ak=function(){this.trigger(new _.L(_.tg))};_.t.sl=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.y(e,HW(a,[_.rg,_.Wc],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ja++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.t.getTextDisplayer=function(){return null};var hX=!1,UW=new Set;
|
|
60
|
+
window.__onGCastApiAvailable=SW;_.x(tX,_.xm);_.t=tX.prototype;_.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,WW(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.B(b)})};_.t.Xn=function(a,b){this.f&&a!==_.Bq&&a!==_.uq&&(delete b.license,this.f.load(b))};_.t.Rf=function(){return!!this.a&&this.a.Hc()&&hX};_.t.Ob=function(){return!!this.a&&this.a.Ob()};_.t.hg=function(){return this.a?this.a.hg():""};_.t.xe=function(a){this.a&&this.a.xe(a)};
|
|
61
|
+
_.t.cast=function(a){var b=this,c,d,e;return _.I(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.C(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.qa();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.Ba())l.language&&
|
|
62
|
+
(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.hd?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Eg:b.f.getPresentationStartTime(),gc:m,audioMimeType:p,nb:g}}c=g;return _.y(f,uX(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,qX(b.a,c),7);case 7:_.uh(f,0);break;case 2:d=_.E(f),
|
|
63
|
+
b.g.error("Error while trying to cast",d),e=new _.L(_.se,{detail:d}),b.trigger(e),_.B(f)}})};_.t.eg=function(){this.a&&this.a.eg()};_.t.Wj=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,WW(b.a),2):c.F(2)}b.a=sX(b);_.B(c)})};_.t.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.y(c,b.a.sendMessage(BW,a),0):(b.g.warn(xW),c["return"]())})};_.t.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(xW)};
|
|
64
|
+
_.t.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(xW)};_.t.Gb=function(){return this.a&&this.a.Gb()};_.t.fc=function(a){this.a&&this.a.fc(a)};_.t.Uf=function(){this.a&&this.a.Uf()};_.t.Og=function(a){this.a&&this.a.Og(a)};_.t.Mg=function(a){this.a&&this.a.Mg(a)};_.t.Lg=function(a){this.a&&this.a.Lg(a)};_.t.Ng=function(a){this.a&&this.a.Ng(a)};_.J(yW,tX);tX.prototype.setContentReleaseDate=tX.prototype.Ng;tX.prototype.setContentArtist=tX.prototype.Lg;
|
|
65
|
+
tX.prototype.setContentImage=tX.prototype.Mg;tX.prototype.setContentTitle=tX.prototype.Og;tX.prototype.clearContentMetadata=tX.prototype.Uf;tX.prototype.setContentMetadata=tX.prototype.fc;tX.prototype.getContentMetadata=tX.prototype.Gb;tX.prototype.removeMessageListener=tX.prototype.removeMessageListener;tX.prototype.addMessageListener=tX.prototype.addMessageListener;tX.prototype.sendMessage=tX.prototype.sendMessage;tX.prototype.changeReceiverId=tX.prototype.Wj;tX.prototype.forceDisconnect=tX.prototype.eg;
|
|
66
|
+
tX.prototype.cast=tX.prototype.cast;tX.prototype.setPlayerConfigInterceptor=tX.prototype.xe;tX.prototype.getReceiverName=tX.prototype.hg;tX.prototype.isCasting=tX.prototype.Ob;tX.prototype.canCast=tX.prototype.Rf;tX.prototype.destroy=tX.prototype.destroy;_.x(vX,EW);_.t=vX.prototype;
|
|
67
|
+
_.t.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,this.H);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.C);b.addEventListener(a.BITRATE_CHANGED,this.a)};
|
|
68
|
+
_.t.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,
|
|
69
|
+
a.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,EW.prototype.destroy.call(a),0)})};_.t.fk=function(){this.player.trigger(new _.L(_.of));this.Aa(_.Iq)};_.t.ek=function(){this.Aa(_.Hq)};_.t.$m=function(){this.Aa(_.Bq)};_.t.Rm=function(a){a.isBuffering?this.Aa(_.zq):(a=this.player.isPaused()?_.Hq:_.Iq,this.Aa(a))};_.t.hk=function(){this.h=1;this.player.trigger(new _.L(_.Dg))};_.t.gk=function(){this.player.trigger(new _.L(_.Cg))};_.t.rn=function(){this.h=2};_.t.cn=function(){this.Aa(_.Gq)};
|
|
70
|
+
_.t.ck=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.gd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.t.dk=function(a){a=new _.P(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.se,{detail:a}));this.Aa(_.Fq)};_.t=wX.prototype;_.t.sb=function(){return"Google Cast Framework"};_.t.tb=function(){return cast.framework.VERSION};_.t.wb=function(){return 0};_.t.getId=function(){return""};_.t.getCreativeId=function(){return""};_.t.Xb=function(){return""};_.t.getApiFramework=function(){return null};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return this.a.title||""};_.t.getDuration=function(){return this.a.duration||0};_.t.getPosition=function(){return 0};
|
|
71
|
+
_.t.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.t.ac=function(){return!1};_.t.ub=function(){return this.a.clickThroughUrl||null};_.t.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.t.jb=function(){return 0};_.t.ib=function(){return 0};_.t.Ta=function(){return 0};_.t.Ua=function(){switch(this.Jb()){case 0:return 0;case -1:return 2;default:return 1}};_.t.getPodIndex=function(){return this.j};_.t.Jb=function(){return this.f.position};_.t.Kb=function(){return this.l};
|
|
72
|
+
_.t.kb=function(){return this.h};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};_.t.getWrapperCreativeIds=function(){return[]};_.t.$b=function(){return null};wX.prototype.getVideoElement=wX.prototype.$b;wX.prototype.getWrapperCreativeIds=wX.prototype.getWrapperCreativeIds;wX.prototype.getWrapperAdSystems=wX.prototype.getWrapperAdSystems;wX.prototype.getWrapperAdIds=wX.prototype.getWrapperAdIds;wX.prototype.getSequenceLength=wX.prototype.kb;
|
|
73
|
+
wX.prototype.getPositionInSequence=wX.prototype.Kb;wX.prototype.getPodTimeOffset=wX.prototype.Jb;wX.prototype.getPodIndex=wX.prototype.getPodIndex;wX.prototype.getPodType=wX.prototype.Ua;wX.prototype.getMediaBitrate=wX.prototype.Ta;wX.prototype.getMediaHeight=wX.prototype.ib;wX.prototype.getMediaWidth=wX.prototype.jb;wX.prototype.getMediaUrl=wX.prototype.getMediaUrl;wX.prototype.getClickThroughUrl=wX.prototype.ub;wX.prototype.isBumper=wX.prototype.ac;wX.prototype.getSkipTimeOffset=wX.prototype.getSkipTimeOffset;
|
|
74
|
+
wX.prototype.getPosition=wX.prototype.getPosition;wX.prototype.getDuration=wX.prototype.getDuration;wX.prototype.getTitle=wX.prototype.getTitle;wX.prototype.getAdvertiserName=wX.prototype.getAdvertiserName;wX.prototype.getAdSystem=wX.prototype.getAdSystem;wX.prototype.getApiFramework=wX.prototype.getApiFramework;wX.prototype.getSourceId=wX.prototype.Xb;wX.prototype.getCreativeId=wX.prototype.getCreativeId;wX.prototype.getId=wX.prototype.getId;wX.prototype.getTechnology=wX.prototype.wb;
|
|
75
|
+
wX.prototype.getAdManagerVersion=wX.prototype.tb;wX.prototype.getAdManagerName=wX.prototype.sb;xX.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};xX.prototype.Mb=function(){return!!this.a.find(function(a){return 0===a.position})};xX.prototype.Lb=function(){return!!this.a.find(function(a){return-1===a.position})};xX.prototype.hasPostroll=xX.prototype.Lb;xX.prototype.hasPreroll=xX.prototype.Mb;xX.prototype.getCuePoints=xX.prototype.getCuePoints;_.t=zX.prototype;_.t.load=function(){var a=this;return _.I(function(b){AX&&(AX=!1,FX(a,0));_.B(b)})};_.t.start=function(){return _.I(function(a){yX().play();_.B(a)})};_.t.cd=function(){};_.t.resume=function(){-1!==this.getPosition()&&yX().play()};_.t.pause=function(){-1!==this.getPosition()&&yX().pause()};_.t.skip=function(){};_.t.getVolume=function(){return this.m.getVolume()||0};_.t.setVolume=function(a){this.m.setVolume(a)};
|
|
76
|
+
_.t.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.t.Zc=function(){return!0};_.t.yc=function(){var a=this;return _.I(function(b){yX().removeEventListener(a.f,a.h);_.B(b)})};
|
|
77
|
+
_.t.ik=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=yX().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Mc,{adsTimeline:new xX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:EX(this,_.Cc,a);break;case cast.framework.events.EventType.BREAK_STARTED:EX(this,_.qc,a);break;case cast.framework.events.EventType.BREAK_ENDED:EX(this,_.sc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:EX(this,
|
|
78
|
+
_.Ic,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(EX(this,_.Hc,a),EX(this,_.Jc,a)):a.endedReason===b.STOPPED?EX(this,_.Jc,a):a.endedReason===b.END_OF_STREAM?(EX(this,_.wc,a),EX(this,_.Jc,a)):a.endedReason===b.ERROR&&FX(this,1);break;case cast.framework.events.EventType.PLAYING:EX(this,_.Gc,a);break;case cast.framework.events.EventType.PAUSE:EX(this,_.Ec,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?EX(this,_.uc,a):EX(this,_.Gc,a)}};
|
|
79
|
+
zX.prototype.getPosition=zX.prototype.getPosition;zX.prototype.setVolume=zX.prototype.setVolume;zX.prototype.getVolume=zX.prototype.getVolume;zX.prototype.skip=zX.prototype.skip;zX.prototype.pause=zX.prototype.pause;zX.prototype.resume=zX.prototype.resume;var AX=!1;GX.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(HX(),this.a)};GX.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(HX(),this.a)};GX.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return IX(a)})};
|
|
80
|
+
GX.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=_.qi;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.li;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.mi}b&&this.Xa(new _.L(b,{detail:IX(a.timedMetadataInfo)}))}else for(a=_.w(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Xa(new _.L(_.qi,{detail:b.value}))};_.x(JX,_.ll);_.t=JX.prototype;_.t.initialize=function(a){this.m=a;KX().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.t.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.t.load=function(){};_.t.destroy=function(){this.m=null;KX().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.t.getVideoTracks=function(){return[]};_.t.getAudioTracks=function(){return this.h};_.t.la=function(){return this.j};_.t.ma=function(){return null};
|
|
81
|
+
_.t.Ya=function(){var a=this.qa();return a&&a.renditions[0]};_.t.Va=function(){var a=this.Ba();return a&&a.renditions[0]};_.t.vb=function(){return null};_.t.Hb=function(){return null};_.t.Ib=function(){return null};_.t.La=function(){return null};_.t.qa=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
|
+
_.t.Ba=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.la().find(function(c){return c.id===b})||null)}return a};_.t.Db=function(){this.g.warn("Video tracks unavailable on Cast")};_.t.Ha=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.t.Wa=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.t.ob=function(){this.g.warn("Video renditions unavailable on Cast")};_.t.Bb=function(a){this.Ha(a&&a.track)};
|
|
83
|
+
_.t.Cb=function(a){this.Wa(a&&a.track)};
|
|
84
|
+
_.t.addTextTrack=function(a){var b=this,c,d,e;return _.I(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.y(f,HW(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]),MX(b)}catch(g){throw b.g.warn("failed on track",
|
|
85
|
+
a),g;}}_.B(f)})};_.t.wa=function(){return!0};_.t.Ln=function(){this.f=KX().getAudioTracksManager();var a=this.f.getTracks();this.h=LX(_.Jk,a);MX(this);a=this.m.getConfiguration();NX(this,_.Jk,a.preferredAudioLanguage,a.preferredAudioRole);NX(this,_.U,a.preferredTextLanguage,a.preferredTextRole)};JX.prototype.isAbrEnabled=JX.prototype.wa;JX.prototype.addTextTrack=JX.prototype.addTextTrack;JX.prototype.setTextRendition=JX.prototype.Cb;JX.prototype.setAudioRendition=JX.prototype.Bb;
|
|
86
|
+
JX.prototype.setVideoRendition=JX.prototype.ob;JX.prototype.setTextTrack=JX.prototype.Wa;JX.prototype.setAudioTrack=JX.prototype.Ha;JX.prototype.setVideoTrack=JX.prototype.Db;JX.prototype.getTextTrack=JX.prototype.Ba;JX.prototype.getAudioTrack=JX.prototype.qa;JX.prototype.getVideoTrack=JX.prototype.La;JX.prototype.getLoadingTextRendition=JX.prototype.Ib;JX.prototype.getLoadingAudioRendition=JX.prototype.Hb;JX.prototype.getLoadingVideoRendition=JX.prototype.vb;JX.prototype.getTextRendition=JX.prototype.Va;
|
|
87
|
+
JX.prototype.getAudioRendition=JX.prototype.Ya;JX.prototype.getVideoRendition=JX.prototype.ma;JX.prototype.getTextTracks=JX.prototype.la;JX.prototype.getAudioTracks=JX.prototype.getAudioTracks;JX.prototype.getVideoTracks=JX.prototype.getVideoTracks;_.x(OX,_.xm);_.t=OX.prototype;_.t.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=PX();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.fn.bind(this));d.setMediaPlaybackInfoHandler(this.Kj.bind(this));this.a=new vX(this);this.a.init();this.j=new JX;this.j.initialize(this);this.o=new GX(function(e){return c.trigger(e)});this.o.init()};
|
|
88
|
+
_.t.unload=function(){var a=cast.framework.messages.PlayerState,b=PX();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.t.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.B=null,a.w=_.Em(),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
|
+
_.t.play=function(){var a=PX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.t.pause=function(){var a=PX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.t.isPaused=function(){return PX().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
|
|
90
|
+
_.t.isEnded=function(){return PX().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.t.seek=function(a){var b=PX();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(rW);b.seek(a);return Promise.resolve()};_.t.getPosition=function(){return this.getMediaPosition()};_.t.setSeekInterceptor=function(){};_.t.setPlaybackSessionId=function(){};_.t.getMediaPosition=function(){return PX().getCurrentTimeSec()};_.t.getDuration=function(){return this.getMediaDuration()};
|
|
91
|
+
_.t.getMediaDuration=function(){var a=PX().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.t.getPlaybackRate=function(){return PX().getPlaybackRate()};_.t.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;PX().sendLocalMediaRequest(b)}};_.t.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.t.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};
|
|
92
|
+
_.t.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};_.t.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};
|
|
93
|
+
_.t.getLoadedSource=function(){var a=PX().getMediaInformation();if(a){var b=PX().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,Yo:b,name:c}}return null};_.t.getDrmInfo=function(){return null};_.t.getPresentationStartTime=function(){return PX().getStartAbsoluteTime()};
|
|
94
|
+
_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=PX().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.t.getState=function(){return this.a?this.a.getState():_.vq};
|
|
95
|
+
_.t.getStats=function(){var a=_.tq();if(this.f){a=PX().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};_.t.isLive=function(){return Infinity===this.getDuration()};
|
|
96
|
+
_.t.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.sq;b.a.j=b.f.a;b.A=_.Mq(a);b.h=_.Gm(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:FW(b.h),local:!0};return _.y(e,PX().load(d),0)})};_.t.getBufferInfo=function(){this.g.warn(_.ua);return new _.wm};
|
|
97
|
+
_.t.getTrackManager=function(){return this.j};_.t.getConfiguration=function(){return this.h};_.t.getSurface=function(){return this.B};_.t.getTimeline=function(){return null};_.t.setupPlaylist=function(){return Promise.reject(_.Cb)};_.t.appendLoad=function(){return Promise.reject(_.Cb)};_.t.seekWith=function(){return Promise.reject(_.Cb)};_.t.setNetworkEngine=function(a){this.G=a};_.t.setCmsdManager=function(){};_.t.getNetworkEngine=function(){return this.G};_.t.getSourceIndex=function(){return this.l};
|
|
98
|
+
_.t.setSourceIndex=function(a){this.l=a};_.t.getPeriods=function(){return[]};_.t.namespace=function(){return zW};_.t.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.t.getCueTimeline=function(){return null};_.t.resetAbr=function(){this.g.warn(vW)};_.t.onError=function(a){this.trigger(new _.L(_.se,{detail:a}))};_.t.canPlay=function(){return _.Fl()?2:0};
|
|
99
|
+
_.t.fn=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=FW(this.getStats());var b=PX(),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
|
+
(!e||e&&f)){d=PX().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
|
+
_.t.Kj=function(a,b){var c=null,d=b;a.media.customData&&(c=GW(a.media.customData.playerConfiguration));var e=c?c.abr||null:null,f=d;e&&typeof e.defaultBandwidthEstimate===_.k?f.initialBandwidth=e.defaultBandwidthEstimate:f.initialBandwidth=void 0;SX(c,d);e=null;a.media.customData&&(e=GW(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]));e=(e=e&&e.LiveConfiguration)?0===e.liveEdgeLatencyMs:!1;if(null!=c&&c.lowLatencyMode||e)c=Object.assign({},d.shakaConfig,{streaming:{lowLatencyMode:!0}}),
|
|
102
|
+
d=Object.assign({},d,{shakaConfig:c});return d};_.t.getTextDisplayer=function(){return null};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};_.t=TX.prototype;_.t.init=function(a){var b=this;a&&(this.f=new OX,_.st(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.uq?_.y(c,DW(b.m),0):c.F(0)})}))};
|
|
103
|
+
_.t.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=WX(),b=WX().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[BW]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.zm.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=
|
|
104
|
+
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.ym.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(BW,this.w)}};
|
|
105
|
+
_.t.stop=function(){if(this.a){this.a=!1;this.o.release();var a=WX();WX().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(BW,this.w);a.stop();this.m=this.f=null}};_.t.xe=function(a){this.j=a};_.t.eo=function(a){this.l=a};_.t.on=function(a,b){WX().addEventListener(a,b)};_.t.off=function(a,b){WX().removeEventListener(a,b)};_.t.addMessageListener=function(a){typeof a===_.we&&this.h.add(a)};
|
|
106
|
+
_.t.removeMessageListener=function(a){typeof a===_.we&&this.h["delete"](a)};_.t.sendMessage=function(a,b){WX().sendCustomMessage(BW,b,FW(a))};_.t.Hc=function(){return this.a};_.t.Gb=function(){return XX()};_.t.fc=function(a){YX(this,a)};_.t.xo=function(a){var b=XX(),c=null;a?c=Object.assign({},b,a):c=b;YX(this,c)};
|
|
107
|
+
_.t.zm=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return $X(this,a);try{var b=(new DOMParser).parseFromString(a,_.sg)}catch(u){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=WX();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ja),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.r||g===_.Zc){g=e[f].getAttribute(_.Te);for(var h=e[f].getElementsByTagName(_.Pb),l=h.length-
|
|
108
|
+
1;0<=l;--l){var m=h[l].getAttribute(_.Te)||g,n=h[l].getAttribute(_.Gd),p=h[l].getAttribute(_.Yg)||void 0,q=h[l].getAttribute(_.xe)||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(_.Pb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ja).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Xb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=WX();c=a.getElementsByTagName("StreamIndex");
|
|
109
|
+
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.r){e=c[d].getElementsByTagName(_.Nb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.ub)||void 0,h=e[f].getAttribute(_.tb)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Lg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.Nb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
110
|
+
_.t.ym=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=GW(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,CX(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
|
+
break}b.f.C=!0;return _.y(l,_.Ct(b.m,d),8);case 8:return _.y(l,_.Dt(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.gc&&(c.media.hlsVideoSegmentFormat=IW(f.gc,_.Kk)),f.audioMimeType&&(c.media.hlsSegmentFormat=IW(f.audioMimeType,_.Jk));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)}})};_.t.bn=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.om;var b=WX().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))}_.xt(this.m)}};
|
|
113
|
+
_.t.bk=function(a){if(0<this.h.size){var b=GW(a.data);this.h.forEach(function(c){return c(b)})}};_.J(AW,TX);TX.prototype.updateContentMetadata=TX.prototype.xo;TX.prototype.setContentMetadata=TX.prototype.fc;TX.prototype.getContentMetadata=TX.prototype.Gb;TX.prototype.isApiReady=TX.prototype.Hc;TX.prototype.sendMessage=TX.prototype.sendMessage;TX.prototype.removeMessageListener=TX.prototype.removeMessageListener;TX.prototype.addMessageListener=TX.prototype.addMessageListener;TX.prototype.off=TX.prototype.off;
|
|
114
|
+
TX.prototype.on=TX.prototype.on;TX.prototype.setLoadRequestDataInterceptor=TX.prototype.eo;TX.prototype.setPlayerConfigInterceptor=TX.prototype.xe;TX.prototype.stop=TX.prototype.stop;TX.prototype.start=TX.prototype.start;TX.prototype.init=TX.prototype.init;TX.getInstance=VX;var UX=null;_.t=aY.prototype;_.t.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.tn.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)})};_.t.start=function(){return _.I(function(a){_.B(a)})};_.t.cd=function(){};_.t.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.t.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
|
|
115
|
+
_.t.skip=function(){var a=this.f.a;a&&this.f.sendMessage(CW,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.t.getVolume=function(){return this.f.getVolume()||0};_.t.setVolume=function(a){this.f.setVolume(a)};_.t.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.t.Zc=function(){return!0};_.t.yc=function(){var a=this;return _.I(function(b){a.h.release();_.B(b)})};
|
|
116
|
+
_.t.tn=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Mc,{adsTimeline:new xX(a.breaks)})));break;case "isPlayingBreak":a.value?cY(this,_.qc):(cY(this,_.wc),cY(this,_.Jc),cY(this,_.sc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(cY(this,_.wc),cY(this,_.Jc)),cY(this,_.Ic));break;case "isPaused":this.a.isPlayingBreak&&(a.value?cY(this,_.Ec):cY(this,_.Gc))}};aY.prototype.getPosition=aY.prototype.getPosition;
|
|
117
|
+
aY.prototype.setVolume=aY.prototype.setVolume;aY.prototype.getVolume=aY.prototype.getVolume;aY.prototype.skip=aY.prototype.skip;aY.prototype.pause=aY.prototype.pause;aY.prototype.resume=aY.prototype.resume;dY.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};dY.prototype.a=function(a,b){return a.namespace()!==_.zd?!1:!(!b||!b.ima)};dY.prototype.create=function(a){return new aY(a.a)};_.cr(new dY);eY.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};eY.prototype.a=function(a,b){return VX().Hc()?!(!b||!b.ima):!1};eY.prototype.create=function(a){return new zX(a)};_.cr(new eY);};
|
|
118
118
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
119
119
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
120
120
|
else{_=this.clpp._;(f.call(g,this));}
|