@castlabs/prestoplay 6.23.1 → 6.24.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.
- package/CHANGELOG.md +14 -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 +113 -113
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +608 -591
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +87 -86
- package/cjs/cl.externs.js +94 -30
- package/cjs/cl.freewheel.js +25 -24
- package/cjs/cl.hls.js +73 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +344 -339
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -13
- 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 +71 -71
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- 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 +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +492 -478
- package/cl.crypto.js +9 -9
- package/cl.dash.js +81 -80
- package/cl.externs.js +94 -30
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +75 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +307 -305
- 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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +28 -28
- package/package.json +1 -1
- package/typings.d.ts +44 -10
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
|
-
this.f=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
|
-
_.t.Aa=function(a){if(a!==this.f)if(this.f===_.
|
|
37
|
-
{detail:a}))}};_.J("clpp.cast.CastUtils",function(){});var
|
|
38
|
-
|
|
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=_
|
|
40
|
-
c.renditions.push(new _.
|
|
41
|
-
_.t.
|
|
42
|
-
_.t.wa=function(){return!0};
|
|
43
|
-
|
|
44
|
-
_.t.setSeekInterceptor=function(){};_.t.setPlaybackSessionId=function(){};_.t.destroy=function(){return _.I(function(a){_.B(a)})};_.t.
|
|
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 _.
|
|
46
|
-
_.t.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.
|
|
47
|
-
_.t.addMessageListener=function(a){typeof a===_.
|
|
48
|
-
_.t.isEnded=function(){return this.getState()===_.
|
|
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(
|
|
2
|
+
var f=function(window){var gX="Cannot seek during ads playout.",hX="Cannot switch track",iX="Media session does not exist.",jX="No receivers available",kX="Reset ABR functionality not available on cast.",lX="SDK not yet ready",mX="Sender is destroyed.",nX="clpp.cast.CastProxy",oX="clpp.cast.Player",pX="clpp.cast.Receiver",qX="urn:x-cast:castlabs",rX="urn:x-cast:com.google.cast.media",sX=function(a){return _.I(function(b){return 1==b.a?_.y(b,a.Qc(_.lf),2):_.y(b,a.Qc(_.kf),0)})},tX=function(a,b){this.log=new _.K(b);this.player=
|
|
3
|
+
a;this.j=null;this.f=_.Gq;this.l=_.Hq;this.h=2;this.B=Date.now();this.A=-1},uX=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.De){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.ff?"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}})},vX=function(a){if(typeof a!==_.tg)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}},wX=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=_.zl(d,a.mimeType,g);if(!f||!g)return q.F(2);l=_.wk(a.url);return _.y(q,c.fetch(l).T,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)})},xX=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 _.Yg:return d.FMP4;case _.Xg:return b===_.$k?d.MPEG2_TS:c.TS;case _.dd:return c.AAC;case _.ed:return c.AC3;case _.fd:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.gd:return c.FMP4}},zX=function(a){a=
|
|
6
|
+
void 0===a?yX: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}},AX=function(a){tX.call(this,a,"clpp.cast.SenderStateManager");
|
|
7
|
+
this.o=this.a=null;this.w=this.ic.bind(this)},BX=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},CX=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},EX=function(a,b){var c=CX(a);return DX(a,b).find(function(d){return c.includes(d.id)})||null},DX=function(a,b){return a.h.filter(function(c){return c.type===b})},GX=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.Zk){var e=
|
|
8
|
+
a.Ba();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;FX(a,b)},function(f){a.f[b]=null;a.g.debug(hX,f)})}else b===_.Zk&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){FX(a,b)},function(f){a.g.debug(hX,f)}))},FX=function(a,b){b===_.U?a.a.trigger(new _.L(_.jd)):b===_.Zk&&a.a.trigger(new _.L(_.Bg))},KX=function(a,b,c,d){_.Hm.call(this);this.g=new _.K(_.Fd);this.ca=a;this.o=new _.li(b);this.Y=c;this.ha=d;this.h=
|
|
9
|
+
this.J=_.Om();this.C=[];this.B=0;this.L=new _.Rk;this.G=this.l=this.a=null;this.A=this.w=!1;this.ja="";this.Ea=1E6;this.f=new BX;this.f.initialize(this);this.j=new AX(this);this.H=new _.vi;this.K=null;this.I=new Set;this.P=this.hn.bind(this);this.ya=this.En.bind(this);this.ea=this.wn.bind(this);this.U=this.mn.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(){HX(!0)},0)}});IX(this);
|
|
10
|
+
JX.add(this)},LX=function(a){var b,c;return _.I(function(d){if(1==d.a)return JX["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.Y=null;a.ha=null;_.B(d)})},NX=function(a){if(!a)return null;
|
|
11
|
+
a:{var b=a.metadataType;var c=Object.entries(MX);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=zX(MX[b]);return Object.assign(b,a)},OX=function(a){var b=void 0===b?yX:b;return Object.values(MX).includes(a)?a:b},SX=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},IX=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.Zg();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);XX&&a.o.fa(.02)}},bY=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},dY=function(a,b){cY(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ea);b.addMessageListener(qX,a.U)},cY=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.mk.bind(a)),a.H.on(a.G,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.vn.bind(a)),
|
|
14
|
+
a.j&&a.j.init(),a.trigger(new _.L(_.Te)))},eY=function(a){return _.I(function(b){return a.Ub()?b.F(0):_.y(b,cast.framework.CastContext.getInstance().requestSession(),0)})},fY=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=_.ww,_.y(D,eY(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.mc;m=h.audioMimeType;g.hlsVideoSegmentFormat=xX(l,d.VIDEO);g.hlsSegmentFormat=xX(m,d.AUDIO);if(!b.tb){D.F(3);break}if(!a.M){D.F(4);break}return _.y(D,Promise.resolve(a.M(b.tb)),5);case 5:if(n=D.f)b.tb=n;case 4:a.h=b.tb;a.C=_.Yq(a.h);a.B=a.C.findIndex(function(F){return F.url===b.source.url});if(!b.tb.remoteTextTracks){D.F(6);break}return _.y(D,Promise.all(b.tb.remoteTextTracks.map(a.El.bind(a))),7);case 7:p=D.f,g.tracks=p.filter(function(F){return F}),b.tb.remoteTextTracks=
|
|
16
|
+
void 0;case 6:delete b.tb.autoplay,b.tb.startTime=null,g.customData={playerConfiguration:uX(b.tb)};case 3:q=a.Mb()||{};u=OX(q.metadataType);typeof b.Ig===_.k&&(v={metadataType:u,sectionStartAbsoluteTime:b.Ig});b.source.name&&(z={metadataType:u,title:b.source.name});A=SX(q);if(H=NX(Object.assign({},v,z,A)))g.metadata=H;G=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.md&&(G.autoplay=b.autoplay);typeof b.currentTime===_.k&&(G.currentTime=b.currentTime);return _.y(D,f.loadMedia(G),0)}})},
|
|
17
|
+
gY=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.ra())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.y(f,fY(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Ig:a.getPresentationStartTime(),autoplay:b,tb:a.h}),0)})},HX=function(a){if(a){a=_.w(JX);for(var b=a.next();!b.done;b=a.next())IX(b.value)}},iY=function(a,b,c){_.Hm.call(this);this.f=a;this.h=b;this.j=typeof c===_.De?c:this.oo;
|
|
18
|
+
this.a=hY(this);this.g=new _.K(nX);this.f&&this.forwardEventsTo(this.f)},hY=function(a){return new KX(a.h,function(){a.trigger(new _.L(_.td))},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.qh&&(d.preferredAudioLanguage=c.qh);c.zj&&(d.preferredTextLanguage=c.zj);_.Nt(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return jY(a)})},jY=function(a){var b;
|
|
19
|
+
return _.I(function(c){if(1==c.a)return a.trigger(new _.L(_.sd)),b=a.f.a,b!==a.a&&a.f&&a.a?_.y(c,a.f.release(),2):c["return"]();_.Nt(a.f,a.a);_.B(c)})},kY=function(a){tX.call(this,a,"clpp.cast.StateManager");this.I=this.sk.bind(this);this.H=this.rk.bind(this);this.w=this.rn.bind(this);this.o=this.gn.bind(this);this.K=this.uk.bind(this);this.J=this.tk.bind(this);this.L=this.Hn.bind(this);this.G=this.un.bind(this);this.C=this.qk.bind(this);this.a=this.pk.bind(this)},lY=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},mY=function(a){this.a=a},oY=function(a){this.m=a;this.a=null;this.h=this.vk.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];nY().addEventListener(this.f,this.h)},rY=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);pY=!1;e=_.wk(d);return _.y(n,c.fetch(e).T,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.T.da(f.data),h=new DOMParser,l=h.parseFromString(g,_.Ag),l.getElementsByTagName("vmap:VMAP").length)_.Wh("VMAP detected."),a.vmapAdsRequest=qY(g);else if(l.getElementsByTagName("VAST").length){_.Wh("VAST detected.");
|
|
22
|
+
var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=qY(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.Wh("Unsupported schema."),pY=!0;return _.Hh(n,0)}m=_.E(n);_.Wh("Failed to fetch an ad",m);pY=!0;_.B(n)})},qY=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},nY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},tY=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||
|
|
23
|
+
-1!==a.getPosition()){var d=null;(c=sY(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},uY=function(a,b){var c=new _.O(1,10,10003,{errorType:b});a.m.onError(c)},sY=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.tg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.tg&&(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 lY(d,e,b.index,b.total,f)}return c},vY=function(a){this.ab=a;this.a=this.f.bind(this)},wY=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]},xY=function(a){var b=a.dashTimedMetadata,c=_.Qg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Pg)?
|
|
25
|
+
_.Qi:_.Ng,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},yY=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.ao.bind(this);this.a=this.f=null},zY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},BY=function(a){a.a=zY().getTextTracksManager();var b=a.a.getTracks();a.j=AY(_.Zk,b)},CY=function(a,b,c,d){c=_.Ui(c).filter(function(h){return h});
|
|
26
|
+
var e=!1,f=[];b===_.U?f=a.getAudioTracks():b===_.Zk&&(f=a.ma());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}_.T.pf(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.U?a.Ka(e):b===_.Zk&&a.$a(e))},AY=function(a,b){for(var c=[],d=_.w(b),
|
|
27
|
+
e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Xk(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 _.gl(f.id,f));c.push(f)}return c},DY=function(){_.Hm.call(this);this.g=new _.K(oX);this.h=this.w=_.Om();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},EY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},HY=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=_.ln(d);if(e){var f=[_.Vd];_.Yq(a)[0].type!==_.ad&&f.unshift(_.Xd);d.preferredDrmSystem===_.Vd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
|
|
29
|
+
h=e.Sa[g];h?(d=g===_.Xd?cast.framework.ContentProtection.WIDEVINE:g===_.Vd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},FY(b,h,a,d),GY(b,h,a,d)):c()}else c()}else c()},FY=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.wk({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},GY=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.Ck(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},IY=function(){this.a=!1;this.g=new _.K(pX);this.f=this.m=null;this.h=new Set;this.A=this.tn.bind(this);
|
|
31
|
+
this.w=this.nk.bind(this);this.j=null;this.o=new _.vi;this.l=null},KY=function(){return JY||(JY=new IY)},LY=function(){return cast.framework.CastReceiverContext.getInstance()},MY=function(){var a=LY().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},NY=function(a,b){var c=LY().getPlayerManager().getMediaInformation();if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;LY().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},
|
|
32
|
+
PY=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=LY();c=(LY().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Yg:_.Xg;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=OY(h,_.ta),m=OY(h,_.Qb),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")},OY=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},QY=function(a){this.f=a;this.a=null;this.h=new _.vi;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]},SY=function(a,b){var c=null,d=RY(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},RY=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 lY(d,c,e,f,g)}return b},TY=function(){},UY=function(){};_.t=tX.prototype;_.t.release=function(){this.Aa(_.Gq)};_.t.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.t.getState=function(){return this.f};_.t.onError=function(a){a.severity===_.P&&this.Aa(_.Rq)};
|
|
36
|
+
_.t.Aa=function(a){if(a!==this.f)if(this.f===_.Rq&&a!==_.Gq)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===_.Lq?(this.A=b,this.player.trigger(new _.L(_.od,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.Lq&&this.player.trigger(new _.L(_.nd,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.zq(this.j,this.f);this.player.trigger(new _.L(_.qg,
|
|
37
|
+
{detail:a}))}};_.J("clpp.cast.CastUtils",function(){});var yX=0,MX={GENERIC:yX,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.x(AX,tX);AX.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)};AX.prototype.destroy=function(){var a=this;return _.I(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.y(b,tX.prototype.destroy.call(a),0)})};AX.prototype.Aa=function(a){var b=this.player.l;b&&b.isPlayingBreak||tX.prototype.Aa.call(this,a)};
|
|
38
|
+
AX.prototype.ic=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(_.Nq);break;case chrome.cast.media.IdleReason.ERROR:this.Aa(_.Rq);break;default:this.Aa(_.Gq)}break;case chrome.cast.media.PlayerState.PLAYING:this.Aa(_.Uq);break;case chrome.cast.media.PlayerState.PAUSED:this.Aa(_.Tq);break;case chrome.cast.media.PlayerState.BUFFERING:this.Aa(_.Lq)}};_.x(BX,_.Bl);_.t=BX.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=_.$k;break;case chrome.cast.media.TrackType.AUDIO:c=_.U;break;case chrome.cast.media.TrackType.TEXT:c=_.Zk}c=new _.Xk(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 _.gl(c.id,c));return c}):[],this.a.trigger(new _.L(_.Hg)))};_.t.destroy=function(){this.a=null};_.t.getVideoTracks=function(){return DX(this,_.$k)};_.t.getAudioTracks=function(){return DX(this,_.U)};_.t.ma=function(){return DX(this,_.Zk)};_.t.na=function(){var a=this.Na();return a?a.renditions[0]:null};_.t.Va=function(){var a=this.ra();return a?a.renditions[0]:null};_.t.Za=function(){var a=this.Ba();return a?a.renditions[0]:null};_.t.Bb=function(){return this.f[_.$k]||null};
|
|
41
|
+
_.t.Nb=function(){return this.f[_.U]||null};_.t.Ob=function(){return this.f[_.Zk]||null};_.t.Na=function(){return EX(this,_.$k)};_.t.ra=function(){return EX(this,_.U)};_.t.Ba=function(){return EX(this,_.Zk)};_.t.Jb=function(a){GX(this,_.$k,a)};_.t.Ka=function(a){GX(this,_.U,a)};_.t.$a=function(a){GX(this,_.Zk,a)};_.t.ub=function(a){this.Jb(a&&a.track)};_.t.Hb=function(a){this.Ka(a&&a.track)};_.t.Ib=function(a){this.$a(a&&a.track)};_.t.addTextTrack=function(){return _.I(function(a){_.B(a)})};
|
|
42
|
+
_.t.wa=function(){return!0};BX.prototype.isAbrEnabled=BX.prototype.wa;BX.prototype.addTextTrack=BX.prototype.addTextTrack;BX.prototype.setTextRendition=BX.prototype.Ib;BX.prototype.setAudioRendition=BX.prototype.Hb;BX.prototype.setVideoRendition=BX.prototype.ub;BX.prototype.setTextTrack=BX.prototype.$a;BX.prototype.setAudioTrack=BX.prototype.Ka;BX.prototype.setVideoTrack=BX.prototype.Jb;BX.prototype.getTextTrack=BX.prototype.Ba;BX.prototype.getAudioTrack=BX.prototype.ra;
|
|
43
|
+
BX.prototype.getVideoTrack=BX.prototype.Na;BX.prototype.getLoadingTextRendition=BX.prototype.Ob;BX.prototype.getLoadingAudioRendition=BX.prototype.Nb;BX.prototype.getLoadingVideoRendition=BX.prototype.Bb;BX.prototype.getTextRendition=BX.prototype.Za;BX.prototype.getAudioRendition=BX.prototype.Va;BX.prototype.getVideoRendition=BX.prototype.na;BX.prototype.getTextTracks=BX.prototype.ma;BX.prototype.getAudioTracks=BX.prototype.getAudioTracks;BX.prototype.getVideoTracks=BX.prototype.getVideoTracks;_.x(KX,_.Hm);_.t=KX.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(_.Eb)};_.t.appendLoad=function(){return Promise.reject(_.Eb)};_.t.seekWith=function(){return Promise.reject(_.Eb)};
|
|
44
|
+
_.t.setSeekInterceptor=function(){};_.t.setPlaybackSessionId=function(){};_.t.getBandwidthEstimate=function(){return null};_.t.destroy=function(){return _.I(function(a){_.B(a)})};_.t.De=function(a){this.M=a};_.t.Mc=function(){return this.w};_.t.Ub=function(){return this.A};_.t.ng=function(){return this.ja};
|
|
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 _.O(1,8,8004,void 0);g.F(2);break}_.C(g,3);return _.y(g,e.sendMessage(a,uX(b)),5);case 5:_.Hh(g,2);break;case 3:f=_.E(g),d=new _.O(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.Mc())throw a.g.warn(lX),new _.O(1,8,8001,void 0);if(!XX)throw a.g.warn(jX),new _.O(1,8,8002,void 0);if(a.Ub())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.C(d,2);return _.y(d,eY(a),4)}if(2!=d.a)return _.Hh(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);})};_.t.kg=function(){this.Ub()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
|
|
47
|
+
_.t.addMessageListener=function(a){typeof a===_.De&&this.I.add(a)};_.t.removeMessageListener=function(a){typeof a===_.De&&this.I["delete"](a)};_.t.play=function(){var a=this;return this.isEnded()?gY(this,!0):new Promise(function(b,c){if(!a.a)return c(iX);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(iX);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()===_.Nq};_.t.seek=function(a){var b=this;return this.isEnded()?gY(this,!1,a):new Promise(function(c,d){b.a||d(iX);b.l.isPlayingBreak&&d(gX);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.Sg));b.a.seek(e,function(){b.trigger(new _.L(_.Rg));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(rX,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
|
|
50
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():_.
|
|
52
|
-
_.t.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?
|
|
53
|
-
_.t.getBufferInfo=function(){return new _.
|
|
54
|
-
_.t.getTimelineCues=function(){return[]};_.t.getCueTimeline=function(){return null};_.t.resetAbr=function(){this.g.warn(
|
|
55
|
-
_.t.
|
|
56
|
-
_.t.
|
|
57
|
-
_.t.
|
|
58
|
-
isLive:this.isLive()},currentTime:
|
|
59
|
-
_.t.
|
|
60
|
-
window.__onGCastApiAvailable=
|
|
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.
|
|
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
|
-
_.t.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(
|
|
65
|
-
|
|
66
|
-
|
|
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():_.Hq};
|
|
52
|
+
_.t.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?vX(this.a.customData.stats):_.Fq()};_.t.isLive=function(){return Infinity===this.getDuration()};_.t.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Mc())return b.g.warn(lX),e["return"]();if(!XX)return b.g.warn(jX),e["return"]();b.C=_.Yq(a);b.h=_.Qm(b.J,a);c=b.C[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,tb:b.h,mc:c.mc,audioMimeType:c.audioMimeType};return _.y(e,fY(b,d),0)})};
|
|
53
|
+
_.t.getBufferInfo=function(){return new _.Gm};_.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(kX)};_.t.onError=function(a){if(a&&(this.trigger(new _.L(_.ze,{detail:a})),this.j))this.j.onError(a)};_.t.namespace=function(){return _.Fd};_.t.canPlay=function(){return this.Mc()?2:0};_.t.Mb=function(){return this.K};_.t.lc=function(a){this.K=NX(a)};_.t.$f=function(){this.K=null};
|
|
55
|
+
_.t.Tg=function(a){var b=this.Mb()||{};a={metadataType:OX(b.metadataType),title:a};this.lc(Object.assign({},b,a))};_.t.Rg=function(a){var b=this.Mb()||{},c=OX(b.metadataType);a=new chrome.cast.Image(a);this.lc(Object.assign({},b,{metadataType:c,images:[a]}))};_.t.Qg=function(a){var b=this.Mb()||{};this.lc(Object.assign({},b,{metadataType:3,artist:a}))};_.t.Sg=function(a){var b=this.Mb()||{};a={metadataType:OX(b.metadataType),releaseDate:a};this.lc(Object.assign({},b,a))};
|
|
56
|
+
_.t.hn=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;XX=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ja=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Zg()};
|
|
57
|
+
_.t.En=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;dY(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Ub()||(this.A=!0,dY(this,a.session),this.ha());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Ub()&&this.a){var b=this.a.media,c=this.f.ra(),d=this.f.Ba();c=c&&c.language||void 0;d=d&&d.language||void 0;this.Y(this.getState(),{source:{url:b.contentId,type:b.contentType,
|
|
58
|
+
isLive:this.isLive()},currentTime:bY(this),zj:d,qh:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ea);a.session.removeMessageListener(qX,this.U);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}};_.t.wn=function(a){this.g.debug("New media session",a.mediaSession);cY(this,a.mediaSession)};_.t.vn=function(a){a.value&&a.value.tracks&&this.f&&this.f.load()};_.t.mn=function(a,b){if(a===qX&&0<this.I.size){var c=vX(b);this.I.forEach(function(d){return d(c)})}};
|
|
59
|
+
_.t.mk=function(){this.trigger(new _.L(_.Gg))};_.t.El=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.y(e,wX(a,[_.zg,_.$c],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ea++,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 XX=!1,JX=new Set;
|
|
60
|
+
window.__onGCastApiAvailable=HX;_.x(iY,_.Hm);_.t=iY.prototype;_.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,LX(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.B(b)})};_.t.oo=function(a,b){this.f&&a!==_.Nq&&a!==_.Gq&&(delete b.license,this.f.load(b))};_.t.Xf=function(){return!!this.a&&this.a.Mc()&&XX};_.t.Ub=function(){return!!this.a&&this.a.Ub()};_.t.ng=function(){return this.a?this.a.ng():""};_.t.De=function(a){this.a&&this.a.De(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.ra();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===_.md?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Ig:b.f.getPresentationStartTime(),mc:m,audioMimeType:p,tb:g}}c=g;return _.y(f,jY(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,fY(b.a,c),7);case 7:_.Hh(f,0);break;case 2:d=_.E(f),
|
|
63
|
+
b.g.error("Error while trying to cast",d),e=new _.L(_.ze,{detail:d}),b.trigger(e),_.B(f)}})};_.t.kg=function(){this.a&&this.a.kg()};_.t.gk=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,LX(b.a),2):c.F(2)}b.a=hY(b);_.B(c)})};_.t.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.y(c,b.a.sendMessage(qX,a),0):(b.g.warn(mX),c["return"]())})};_.t.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(mX)};
|
|
64
|
+
_.t.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(mX)};_.t.Mb=function(){return this.a&&this.a.Mb()};_.t.lc=function(a){this.a&&this.a.lc(a)};_.t.$f=function(){this.a&&this.a.$f()};_.t.Tg=function(a){this.a&&this.a.Tg(a)};_.t.Rg=function(a){this.a&&this.a.Rg(a)};_.t.Qg=function(a){this.a&&this.a.Qg(a)};_.t.Sg=function(a){this.a&&this.a.Sg(a)};_.J(nX,iY);iY.prototype.setContentReleaseDate=iY.prototype.Sg;iY.prototype.setContentArtist=iY.prototype.Qg;
|
|
65
|
+
iY.prototype.setContentImage=iY.prototype.Rg;iY.prototype.setContentTitle=iY.prototype.Tg;iY.prototype.clearContentMetadata=iY.prototype.$f;iY.prototype.setContentMetadata=iY.prototype.lc;iY.prototype.getContentMetadata=iY.prototype.Mb;iY.prototype.removeMessageListener=iY.prototype.removeMessageListener;iY.prototype.addMessageListener=iY.prototype.addMessageListener;iY.prototype.sendMessage=iY.prototype.sendMessage;iY.prototype.changeReceiverId=iY.prototype.gk;iY.prototype.forceDisconnect=iY.prototype.kg;
|
|
66
|
+
iY.prototype.cast=iY.prototype.cast;iY.prototype.setPlayerConfigInterceptor=iY.prototype.De;iY.prototype.getReceiverName=iY.prototype.ng;iY.prototype.isCasting=iY.prototype.Ub;iY.prototype.canCast=iY.prototype.Xf;iY.prototype.destroy=iY.prototype.destroy;_.x(kY,tX);_.t=kY.prototype;
|
|
67
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
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,
|
|
70
|
-
_.t.
|
|
71
|
-
_.t.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.t.
|
|
72
|
-
_.t.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_.t.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.t.
|
|
77
|
-
_.t.
|
|
78
|
-
_.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
_.t.
|
|
82
|
-
_.t.Ba=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.
|
|
83
|
-
_.t.
|
|
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,
|
|
85
|
-
a),g;}}_.B(f)})};_.t.wa=function(){return!0};_.t.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_.t.unload=function(){var a=cast.framework.messages.PlayerState,b=
|
|
89
|
-
_.t.play=function(){var a=
|
|
90
|
-
_.t.isEnded=function(){return
|
|
91
|
-
_.t.getMediaDuration=function(){var 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=
|
|
94
|
-
_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=
|
|
95
|
-
_.t.getStats=function(){var a=_.
|
|
96
|
-
_.t.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.
|
|
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(_.
|
|
98
|
-
_.t.setSourceIndex=function(a){this.l=a};_.t.getPeriods=function(){return[]};_.t.namespace=function(){return
|
|
99
|
-
_.t.
|
|
100
|
-
(!e||e&&f)){d=
|
|
101
|
-
_.t.
|
|
102
|
-
d=Object.assign({},d,{shakaConfig:c});return d};_.t.getTextDisplayer=function(){return null};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};_.t=
|
|
103
|
-
_.t.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=
|
|
104
|
-
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.
|
|
105
|
-
_.t.stop=function(){if(this.a){this.a=!1;this.o.release();var a=
|
|
106
|
-
_.t.removeMessageListener=function(a){typeof a===_.
|
|
107
|
-
_.t.
|
|
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
|
-
_.t.
|
|
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)}})};_.t.
|
|
113
|
-
_.t.
|
|
114
|
-
|
|
115
|
-
_.t.skip=function(){var a=this.f.a;a&&this.f.sendMessage(
|
|
116
|
-
_.t.
|
|
117
|
-
|
|
69
|
+
a.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,tX.prototype.destroy.call(a),0)})};_.t.sk=function(){this.player.trigger(new _.L(_.vf));this.Aa(_.Uq)};_.t.rk=function(){this.Aa(_.Tq)};_.t.rn=function(){this.Aa(_.Nq)};_.t.gn=function(a){a.isBuffering?this.Aa(_.Lq):(a=this.player.isPaused()?_.Tq:_.Uq,this.Aa(a))};_.t.uk=function(){this.h=1;this.player.trigger(new _.L(_.Sg))};_.t.tk=function(){this.player.trigger(new _.L(_.Rg))};_.t.Hn=function(){this.h=2};_.t.un=function(){this.Aa(_.Sq)};
|
|
70
|
+
_.t.pk=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.ld,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.t.qk=function(a){a=new _.O(_.P,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.ze,{detail:a}));this.Aa(_.Rq)};_.t=lY.prototype;_.t.yb=function(){return"Google Cast Framework"};_.t.zb=function(){return cast.framework.VERSION};_.t.Db=function(){return 0};_.t.getId=function(){return""};_.t.getCreativeId=function(){return""};_.t.cc=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.gc=function(){return!1};_.t.Ab=function(){return this.a.clickThroughUrl||null};_.t.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.t.qb=function(){return 0};_.t.pb=function(){return 0};_.t.Xa=function(){return 0};_.t.Ya=function(){switch(this.Pb()){case 0:return 0;case -1:return 2;default:return 1}};_.t.getPodIndex=function(){return this.j};_.t.Pb=function(){return this.f.position};_.t.Cb=function(){return this.l};
|
|
72
|
+
_.t.rb=function(){return this.h};_.t.getWrapperAdIds=function(){return[]};_.t.canSeek=function(){return!1};_.t.getWrapperAdSystems=function(){return[]};_.t.getWrapperCreativeIds=function(){return[]};_.t.fc=function(){return null};lY.prototype.getVideoElement=lY.prototype.fc;lY.prototype.getWrapperCreativeIds=lY.prototype.getWrapperCreativeIds;lY.prototype.getWrapperAdSystems=lY.prototype.getWrapperAdSystems;lY.prototype.canSeek=lY.prototype.canSeek;lY.prototype.getWrapperAdIds=lY.prototype.getWrapperAdIds;
|
|
73
|
+
lY.prototype.getSequenceLength=lY.prototype.rb;lY.prototype.getPositionInSequence=lY.prototype.Cb;lY.prototype.getPodTimeOffset=lY.prototype.Pb;lY.prototype.getPodIndex=lY.prototype.getPodIndex;lY.prototype.getPodType=lY.prototype.Ya;lY.prototype.getMediaBitrate=lY.prototype.Xa;lY.prototype.getMediaHeight=lY.prototype.pb;lY.prototype.getMediaWidth=lY.prototype.qb;lY.prototype.getMediaUrl=lY.prototype.getMediaUrl;lY.prototype.getClickThroughUrl=lY.prototype.Ab;lY.prototype.isBumper=lY.prototype.gc;
|
|
74
|
+
lY.prototype.getSkipTimeOffset=lY.prototype.getSkipTimeOffset;lY.prototype.getPosition=lY.prototype.getPosition;lY.prototype.getDuration=lY.prototype.getDuration;lY.prototype.getTitle=lY.prototype.getTitle;lY.prototype.getAdvertiserName=lY.prototype.getAdvertiserName;lY.prototype.getAdSystem=lY.prototype.getAdSystem;lY.prototype.getApiFramework=lY.prototype.getApiFramework;lY.prototype.getSourceId=lY.prototype.cc;lY.prototype.getCreativeId=lY.prototype.getCreativeId;lY.prototype.getId=lY.prototype.getId;
|
|
75
|
+
lY.prototype.getTechnology=lY.prototype.Db;lY.prototype.getAdManagerVersion=lY.prototype.zb;lY.prototype.getAdManagerName=lY.prototype.yb;mY.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};mY.prototype.Sb=function(){return!!this.a.find(function(a){return 0===a.position})};mY.prototype.Rb=function(){return!!this.a.find(function(a){return-1===a.position})};mY.prototype.hasPostroll=mY.prototype.Rb;mY.prototype.hasPreroll=mY.prototype.Sb;mY.prototype.getCuePoints=mY.prototype.getCuePoints;_.t=oY.prototype;_.t.load=function(){var a=this;return _.I(function(b){pY&&(pY=!1,uY(a,0));_.B(b)})};_.t.start=function(){return _.I(function(a){nY().play();_.B(a)})};_.t.kd=function(){};_.t.resume=function(){-1!==this.getPosition()&&nY().play()};_.t.pause=function(){-1!==this.getPosition()&&nY().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.gd=function(){return!0};_.t.Dc=function(){var a=this;return _.I(function(b){nY().removeEventListener(a.f,a.h);_.B(b)})};
|
|
77
|
+
_.t.vk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=nY().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Qc,{adsTimeline:new mY(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:tY(this,_.Gc,a);break;case cast.framework.events.EventType.BREAK_STARTED:tY(this,_.wc,a);break;case cast.framework.events.EventType.BREAK_ENDED:tY(this,_.xc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:tY(this,
|
|
78
|
+
_.Mc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(tY(this,_.Lc,a),tY(this,_.Nc,a)):a.endedReason===b.STOPPED?tY(this,_.Nc,a):a.endedReason===b.END_OF_STREAM?(tY(this,_.Ac,a),tY(this,_.Nc,a)):a.endedReason===b.ERROR&&uY(this,1);break;case cast.framework.events.EventType.PLAYING:tY(this,_.Kc,a);break;case cast.framework.events.EventType.PAUSE:tY(this,_.Ic,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?tY(this,_.yc,a):tY(this,_.Kc,a)}};
|
|
79
|
+
oY.prototype.getPosition=oY.prototype.getPosition;oY.prototype.setVolume=oY.prototype.setVolume;oY.prototype.getVolume=oY.prototype.getVolume;oY.prototype.skip=oY.prototype.skip;oY.prototype.pause=oY.prototype.pause;oY.prototype.resume=oY.prototype.resume;var pY=!1;vY.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(wY(),this.a)};vY.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(wY(),this.a)};vY.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return xY(a)})};
|
|
80
|
+
vY.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=_.Cg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Dg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Eg}b&&this.ab(new _.L(b,{detail:xY(a.timedMetadataInfo)}))}else for(a=_.w(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.ab(new _.L(_.Cg,{detail:b.value}))};_.x(yY,_.Bl);_.t=yY.prototype;_.t.initialize=function(a){this.m=a;zY().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;zY().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.t.getVideoTracks=function(){return[]};_.t.getAudioTracks=function(){return this.h};_.t.ma=function(){return this.j};_.t.na=function(){return null};
|
|
81
|
+
_.t.Va=function(){var a=this.ra();return a&&a.renditions[0]};_.t.Za=function(){var a=this.Ba();return a&&a.renditions[0]};_.t.Bb=function(){return null};_.t.Nb=function(){return null};_.t.Ob=function(){return null};_.t.Na=function(){return null};_.t.ra=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.ma().find(function(c){return c.id===b})||null)}return a};_.t.Jb=function(){this.g.warn("Video tracks unavailable on Cast")};_.t.Ka=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.t.$a=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.t.ub=function(){this.g.warn("Video renditions unavailable on Cast")};_.t.Hb=function(a){this.Ka(a&&a.track)};
|
|
83
|
+
_.t.Ib=function(a){this.$a(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,wX(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]),BY(b)}catch(g){throw b.g.warn("failed on track",
|
|
85
|
+
a),g;}}_.B(f)})};_.t.wa=function(){return!0};_.t.ao=function(){this.f=zY().getAudioTracksManager();var a=this.f.getTracks();this.h=AY(_.U,a);BY(this);a=this.m.getConfiguration();CY(this,_.U,a.preferredAudioLanguage,a.preferredAudioRole);CY(this,_.Zk,a.preferredTextLanguage,a.preferredTextRole)};yY.prototype.isAbrEnabled=yY.prototype.wa;yY.prototype.addTextTrack=yY.prototype.addTextTrack;yY.prototype.setTextRendition=yY.prototype.Ib;yY.prototype.setAudioRendition=yY.prototype.Hb;
|
|
86
|
+
yY.prototype.setVideoRendition=yY.prototype.ub;yY.prototype.setTextTrack=yY.prototype.$a;yY.prototype.setAudioTrack=yY.prototype.Ka;yY.prototype.setVideoTrack=yY.prototype.Jb;yY.prototype.getTextTrack=yY.prototype.Ba;yY.prototype.getAudioTrack=yY.prototype.ra;yY.prototype.getVideoTrack=yY.prototype.Na;yY.prototype.getLoadingTextRendition=yY.prototype.Ob;yY.prototype.getLoadingAudioRendition=yY.prototype.Nb;yY.prototype.getLoadingVideoRendition=yY.prototype.Bb;yY.prototype.getTextRendition=yY.prototype.Za;
|
|
87
|
+
yY.prototype.getAudioRendition=yY.prototype.Va;yY.prototype.getVideoRendition=yY.prototype.na;yY.prototype.getTextTracks=yY.prototype.ma;yY.prototype.getAudioTracks=yY.prototype.getAudioTracks;yY.prototype.getVideoTracks=yY.prototype.getVideoTracks;_.x(DY,_.Hm);_.t=DY.prototype;_.t.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=EY();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.xn.bind(this));d.setMediaPlaybackInfoHandler(this.Uj.bind(this));this.a=new kY(this);this.a.init();this.j=new yY;this.j.initialize(this);this.o=new vY(function(e){return c.trigger(e)});this.o.init()};
|
|
88
|
+
_.t.unload=function(){var a=cast.framework.messages.PlayerState,b=EY();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=_.Om(),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=EY();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.t.pause=function(){var a=EY();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.t.isPaused=function(){return EY().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
|
|
90
|
+
_.t.isEnded=function(){return EY().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.t.seek=function(a){var b=EY();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(gX);b.seek(a);return Promise.resolve()};_.t.getPosition=function(){return this.getMediaPosition()};_.t.setSeekInterceptor=function(){};_.t.setPlaybackSessionId=function(){};_.t.getBandwidthEstimate=function(){return null};_.t.getMediaPosition=function(){return EY().getCurrentTimeSec()};
|
|
91
|
+
_.t.getDuration=function(){return this.getMediaDuration()};_.t.getMediaDuration=function(){var a=EY().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.t.getPlaybackRate=function(){return EY().getPlaybackRate()};_.t.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;EY().sendLocalMediaRequest(b)}};_.t.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};
|
|
92
|
+
_.t.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.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=EY().getMediaInformation();if(a){var b=EY().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,pp:b,name:c}}return null};_.t.getDrmInfo=function(){return null};_.t.getPresentationStartTime=function(){return EY().getStartAbsoluteTime()};
|
|
94
|
+
_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=EY().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():_.Hq};
|
|
95
|
+
_.t.getStats=function(){var a=_.Fq();if(this.f){a=EY().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a};_.t.isLive=function(){return Infinity===this.getDuration()};
|
|
96
|
+
_.t.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.Eq;b.a.j=b.f.a;b.A=_.Yq(a);b.h=_.Qm(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:uX(b.h),local:!0};return _.y(e,EY().load(d),0)})};_.t.getBufferInfo=function(){this.g.warn(_.va);return new _.Gm};
|
|
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(_.Eb)};_.t.appendLoad=function(){return Promise.reject(_.Eb)};_.t.seekWith=function(){return Promise.reject(_.Eb)};_.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 oX};_.t.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.t.getCueTimeline=function(){return null};_.t.resetAbr=function(){this.g.warn(kX)};_.t.onError=function(a){this.trigger(new _.L(_.ze,{detail:a}))};_.t.canPlay=function(){return _.Rl()?2:0};
|
|
99
|
+
_.t.xn=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=uX(this.getStats());var b=EY(),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=EY().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.Uj=function(a,b){var c=null,d=b;a.media.customData&&(c=vX(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;HY(c,d);e=null;a.media.customData&&(e=vX(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=IY.prototype;_.t.init=function(a){var b=this;a&&(this.f=new DY,_.Nt(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.Gq?_.y(c,sX(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=LY(),b=LY().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[qX]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Nm.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.Mm.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(qX,this.w)}};
|
|
105
|
+
_.t.stop=function(){if(this.a){this.a=!1;this.o.release();var a=LY();LY().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(qX,this.w);a.stop();this.m=this.f=null}};_.t.De=function(a){this.j=a};_.t.wo=function(a){this.l=a};_.t.on=function(a,b){LY().addEventListener(a,b)};_.t.off=function(a,b){LY().removeEventListener(a,b)};_.t.addMessageListener=function(a){typeof a===_.De&&this.h.add(a)};
|
|
106
|
+
_.t.removeMessageListener=function(a){typeof a===_.De&&this.h["delete"](a)};_.t.sendMessage=function(a,b){LY().sendCustomMessage(qX,b,uX(a))};_.t.Mc=function(){return this.a};_.t.Mb=function(){return MY()};_.t.lc=function(a){NY(this,a)};_.t.Oo=function(a){var b=MY(),c=null;a?c=Object.assign({},b,a):c=b;NY(this,c)};
|
|
107
|
+
_.t.Nm=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return PY(this,a);try{var b=(new DOMParser).parseFromString(a,_.Ag)}catch(u){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=LY();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===_.cd){g=e[f].getAttribute(_.$e);for(var h=e[f].getElementsByTagName(_.Rb),l=h.length-
|
|
108
|
+
1;0<=l;--l){var m=h[l].getAttribute(_.$e)||g,n=h[l].getAttribute(_.Md),p=h[l].getAttribute(_.kh)||void 0,q=h[l].getAttribute(_.Ee)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(h[l])}e[f].getElementsByTagName(_.Rb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ka).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Zb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=LY();c=a.getElementsByTagName("StreamIndex");
|
|
109
|
+
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.r){e=c[d].getElementsByTagName(_.Pb);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(_.Yg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.Pb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
110
|
+
_.t.Mm=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=vX(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,rY(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,_.Xt(b.m,d),8);case 8:return _.y(l,_.Yt(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.mc&&(c.media.hlsVideoSegmentFormat=xX(f.mc,_.$k)),f.audioMimeType&&(c.media.hlsSegmentFormat=xX(f.audioMimeType,_.U));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.tn=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.Bm;var b=LY().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))}_.St(this.m)}};
|
|
113
|
+
_.t.nk=function(a){if(0<this.h.size){var b=vX(a.data);this.h.forEach(function(c){return c(b)})}};_.J(pX,IY);IY.prototype.updateContentMetadata=IY.prototype.Oo;IY.prototype.setContentMetadata=IY.prototype.lc;IY.prototype.getContentMetadata=IY.prototype.Mb;IY.prototype.isApiReady=IY.prototype.Mc;IY.prototype.sendMessage=IY.prototype.sendMessage;IY.prototype.removeMessageListener=IY.prototype.removeMessageListener;IY.prototype.addMessageListener=IY.prototype.addMessageListener;IY.prototype.off=IY.prototype.off;
|
|
114
|
+
IY.prototype.on=IY.prototype.on;IY.prototype.setLoadRequestDataInterceptor=IY.prototype.wo;IY.prototype.setPlayerConfigInterceptor=IY.prototype.De;IY.prototype.stop=IY.prototype.stop;IY.prototype.start=IY.prototype.start;IY.prototype.init=IY.prototype.init;IY.getInstance=KY;var JY=null;_.t=QY.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.Jn.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.kd=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(rX,{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.gd=function(){return!0};_.t.Dc=function(){var a=this;return _.I(function(b){a.h.release();_.B(b)})};
|
|
116
|
+
_.t.Jn=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Qc,{adsTimeline:new mY(a.breaks)})));break;case "isPlayingBreak":a.value?SY(this,_.wc):(SY(this,_.Ac),SY(this,_.Nc),SY(this,_.xc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(SY(this,_.Ac),SY(this,_.Nc)),SY(this,_.Mc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?SY(this,_.Ic):SY(this,_.Kc))}};QY.prototype.getPosition=QY.prototype.getPosition;
|
|
117
|
+
QY.prototype.setVolume=QY.prototype.setVolume;QY.prototype.getVolume=QY.prototype.getVolume;QY.prototype.skip=QY.prototype.skip;QY.prototype.pause=QY.prototype.pause;QY.prototype.resume=QY.prototype.resume;TY.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};TY.prototype.a=function(a,b){return a.namespace()!==_.Fd?!1:!(!b||!b.ima)};TY.prototype.create=function(a){return new QY(a.a)};_.mr(new TY);UY.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};UY.prototype.a=function(a,b){return KY().Mc()?!(!b||!b.ima):!1};UY.prototype.create=function(a){return new oY(a)};_.mr(new UY);};
|
|
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));}
|