@castlabs/prestoplay 6.25.2 → 6.27.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 +38 -0
- package/README.md +5 -5
- 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 +115 -114
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +620 -620
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +89 -88
- package/cjs/cl.externs.js +89 -51
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +79 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +351 -336
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +15 -15
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +17 -17
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +73 -72
- 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 +39 -37
- package/cjs/polyfill.min.js +15 -3
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +92 -90
- package/cl.conviva.js +27 -27
- package/cl.core.js +496 -500
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -82
- package/cl.externs.js +89 -51
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +80 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +3 -3
- package/cl.mse.js +305 -294
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- 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 +29 -28
- package/package.json +3 -3
- package/typings.d.ts +124 -3
package/cjs/cl.cast.js
CHANGED
|
@@ -1,120 +1,121 @@
|
|
|
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.
|
|
13
|
-
null;a=null===a?null:a+b;return null===a?b:a},
|
|
14
|
-
a.j&&a.j.init(),a.trigger(new _.
|
|
15
|
-
b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.
|
|
16
|
-
void 0;case 6:delete b.
|
|
17
|
-
|
|
18
|
-
this.a=
|
|
19
|
-
return _.
|
|
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
|
-
_.Ci:_.
|
|
26
|
-
var e=!1,f=[];b===_.T?f=a.getAudioTracks():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.
|
|
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
|
-
_.r.
|
|
37
|
-
{detail:a}))}};_.
|
|
38
|
-
|
|
39
|
-
_.r.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.
|
|
40
|
-
c.renditions.push(new _.
|
|
41
|
-
_.r.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.
|
|
45
|
-
_.r.sendMessage=function(a,b){var c=this,d,e,f;return _.
|
|
46
|
-
_.r.cast=function(){var a=this,b,c;return _.
|
|
47
|
-
_.r.addMessageListener=function(a){typeof a===_.
|
|
48
|
-
_.r.isEnded=function(){return this.getState()===_.
|
|
49
|
-
_.r.getMediaDuration=function(){if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.k?-1:-1===a?Infinity:a};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.r.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(
|
|
2
|
+
var f=function(window){var PW="Cannot seek during ads playout.",QW="Cannot switch track",RW="Media session does not exist.",SW="No receivers available",TW="Reset ABR functionality not available on cast.",UW="SDK not yet ready",VW="Sender is destroyed.",WW="clpp.cast.CastProxy",XW="clpp.cast.Player",YW="clpp.cast.Receiver",ZW="urn:x-cast:castlabs",$W="urn:x-cast:com.google.cast.media",aX=function(a){return _.I(function(b){return 1==b.a?_.x(b,a.Nc(_.We),2):_.x(b,a.Nc(_.Ve),0)})},bX=function(a,b){this.log=new _.K(b);this.player=
|
|
3
|
+
a;this.j=null;this.f=_.Lq;this.l=_.Mq;this.h=2;this.B=Date.now();this.A=-1},cX=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.le){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Re?"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}})},dX=function(a){if(typeof a!==_.eg)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}},eX=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=_.pm(d,a.mimeType,g);if(!f||!g)return q.C(2);l=_.Yj(a.url);return _.x(q,c.fetch(l).T,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.gj(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)})},fX=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 _.Mg:return d.FMP4;case _.Lg:return b===_.Ml?d.MPEG2_TS:c.TS;case _.Pc:return c.AAC;case _.Qc:return c.AC3;case _.Rc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Sc:return c.FMP4}},hX=function(a){a=
|
|
6
|
+
void 0===a?gX: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}},iX=function(){return Math.round(1E3*Math.random())},
|
|
7
|
+
jX=function(a){bX.call(this,a,"clpp.cast.SenderStateManager");this.o=this.a=null;this.w=this.cc.bind(this)},kX=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},lX=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},nX=function(a,b){var c=lX(a);return mX(a,b).find(function(d){return c.includes(d.id)})||null},mX=function(a,b){return a.h.filter(function(c){return c.type===b})},pX=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=
|
|
8
|
+
c.renditions[0];c=[+c.id];if(b!==_.Ll){var e=a.va();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;oX(a,b)},function(f){a.f[b]=null;a.g.debug(QW,f)})}else b===_.Ll&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){oX(a,b)},function(f){a.g.debug(QW,f)}))},oX=function(a,b){b===_.T?a.a.trigger(new _.M(_.Vc)):b===_.Ll&&a.a.trigger(new _.M(_.ng))},tX=function(a,b,c,d){_.Mm.call(this);this.g=new _.K(_.rd);this.da=
|
|
9
|
+
a;this.o=new _.Xh(b);this.Z=c;this.ja=d;this.h=this.J=_.Tm();this.F=[];this.B=0;this.L=new _.Cl;this.G=this.l=this.a=null;this.A=this.w=!1;this.ka="";this.Ia=1E6;this.f=new kX;this.f.initialize(this);this.j=new jX(this);this.H=new _.gi;this.K=null;this.I=new Set;this.P=this.Vm.bind(this);this.ya=this.sn.bind(this);this.fa=this.hn.bind(this);this.U=this.Zm.bind(this);this.N=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){qX(!0)},
|
|
10
|
+
0)}});rX(this);sX.add(this)},uX=function(a){var b,c;return _.I(function(d){if(1==d.a)return sX["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.x(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.Z=null;a.ja=null;_.z(d)})},
|
|
11
|
+
wX=function(a){if(!a)return null;a:{var b=a.metadataType;var c=Object.entries(vX);c=_.v(c);for(var d=c.next();!d.done;d=c.next()){d=_.v(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=hX(vX[b]);return Object.assign(b,a)},AX=function(a){var b=void 0===b?gX:b;return Object.values(vX).includes(a)?a:b},FX=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},rX=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&
|
|
12
|
+
cast.framework&&cast.framework.CastContext&&a.da.length){a.w=!0;a.o.Mg();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.da;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya);KX&&a.o.ha(.02)}},LX=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,
|
|
13
|
+
a=typeof a!==_.k?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},NX=function(a,b){MX(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.fa);b.addMessageListener(ZW,a.U)},MX=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.Wj.bind(a)),a.H.on(a.G,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,
|
|
14
|
+
a.gn.bind(a)),a.j&&a.j.init(),a.trigger(new _.M(_.De)))},OX=function(a){return _.I(function(b){return a.Pb()?b.C(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},PX=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,A,B,C;return _.I(function(E){switch(E.a){case 1:return c=chrome.cast.media.StreamType,d=_.hw,_.x(E,OX(a),2);case 2:if(!b)return E["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);
|
|
15
|
+
g.streamType=b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.gc;m=h.audioMimeType;g.hlsVideoSegmentFormat=fX(l,d.VIDEO);g.hlsSegmentFormat=fX(m,d.AUDIO);if(!b.ob){E.C(3);break}if(!a.N){E.C(4);break}return _.x(E,Promise.resolve(a.N(b.ob)),5);case 5:if(n=E.f)b.ob=n;case 4:a.h=b.ob;a.F=_.cr(a.h);a.B=a.F.findIndex(function(D){return D.url===b.source.url});if(!b.ob.remoteTextTracks){E.C(6);break}return _.x(E,Promise.all(b.ob.remoteTextTracks.map(a.ll.bind(a))),7);case 7:p=E.f,g.tracks=p.filter(function(D){return D}),
|
|
16
|
+
b.ob.remoteTextTracks=void 0;case 6:delete b.ob.autoplay,b.ob.startTime=null,g.customData={playerConfiguration:cX(b.ob)};case 3:q=a.Ib()||{};t=AX(q.metadataType);typeof b.wg===_.k&&(u={metadataType:t,sectionStartAbsoluteTime:b.wg});b.source.name&&(y={metadataType:t,title:b.source.name});A=FX(q);if(B=wX(Object.assign({},u,y,A)))g.metadata=B;C=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.Yc&&(C.autoplay=b.autoplay);typeof b.currentTime===_.k&&(C.currentTime=b.currentTime);return _.x(E,
|
|
17
|
+
f.loadMedia(C),0)}})},QX=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.f.va())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.f.na())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.x(f,PX(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),wg:a.getPresentationStartTime(),autoplay:b,ob:a.h}),0)})},qX=function(a){if(a){a=_.v(sX);for(var b=a.next();!b.done;b=a.next())rX(b.value)}},SX=function(a,b,c){_.Mm.call(this);this.f=a;this.h=b;this.j=typeof c===
|
|
18
|
+
_.le?c:this.bo;this.a=RX(this);this.g=new _.K(WW);this.f&&this.forwardEventsTo(this.f)},RX=function(a){return new tX(a.h,function(){a.trigger(new _.M(_.ed))},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.fh&&(d.preferredAudioLanguage=c.fh);c.kj&&(d.preferredTextLanguage=c.kj);_.cu(a.f,null);a.trigger(new _.M("castingended"));a.j(b,d)},function(){return TX(a)})},
|
|
19
|
+
TX=function(a){var b;return _.I(function(c){if(1==c.a)return a.trigger(new _.M(_.dd)),b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.cu(a.f,a.a);_.z(c)})},UX=function(a){bX.call(this,a,"clpp.cast.StateManager");this.I=this.ak.bind(this);this.H=this.$j.bind(this);this.w=this.cn.bind(this);this.o=this.Tm.bind(this);this.K=this.ck.bind(this);this.J=this.bk.bind(this);this.L=this.vn.bind(this);this.G=this.fn.bind(this);this.F=this.Zj.bind(this);this.a=this.Yj.bind(this)},VX=function(a,
|
|
20
|
+
b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},WX=function(a){this.a=a},YX=function(a){this.m=a;this.a=null;this.h=this.dk.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];XX().addEventListener(this.f,this.h)},aY=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.F(n,2);ZX=!1;e=_.Yj(d);return _.x(n,c.fetch(e).T,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.ea(f.data),h=new DOMParser,l=h.parseFromString(g,_.mg),l.getElementsByTagName("vmap:VMAP").length)_.Jh("VMAP detected."),a.vmapAdsRequest=$X(g);else if(l.getElementsByTagName("VAST").length){_.Jh("VAST detected.");
|
|
22
|
+
var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=$X(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.Jh("Unsupported schema."),ZX=!0;return _.G(n,0)}m=_.H(n);_.Jh("Failed to fetch an ad",m);ZX=!0;_.z(n)})},$X=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},XX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},cY=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||
|
|
23
|
+
-1!==a.getPosition()){var d=null;(c=bY(a,c))&&(d={ad:c});a.m.trigger(new _.M(b,d))}},dY=function(a,b){var c=new _.O(1,10,10003,{errorType:b});a.m.onError(c)},bY=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.eg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.eg&&(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 VX(d,e,b.index,b.total,f)}return c},eY=function(a){this.Za=a;this.a=this.f.bind(this)},fY=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]},gY=function(a){var b=a.dashTimedMetadata,c=_.Bg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Ag)?
|
|
25
|
+
_.Ci:_.yg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},hY=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.On.bind(this);this.a=this.f=null},iY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},kY=function(a){a.a=iY().getTextTracksManager();var b=a.a.getTracks();a.j=jY(_.Ll,b)},lY=function(a,b,c,d){c=_.Gi(c).filter(function(h){return h});
|
|
26
|
+
var e=!1,f=[];b===_.T?f=a.getAudioTracks():b===_.Ll&&(f=a.oa());if(c=c.find(function(h){var l=_.Kj(h);return f.some(function(m){m=_.Kj(m.language||"");return _.Lj(l,m)})})){var g=_.Kj(c);c=f.filter(function(h){h=_.Kj(h.language||"");return _.Lj(g,h)});f=c.length?c:f;e=e||!!c.length}_.R.kf(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.T?a.Ga(e):b===_.Ll&&a.Ya(e))},jY=function(a,b){for(var c=[],d=_.v(b),
|
|
27
|
+
e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Jl(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 _.Sl(f.id,f));c.push(f)}return c},mY=function(){_.Mm.call(this);this.g=new _.K(XW);this.h=this.w=_.Tm();this.A=null;
|
|
28
|
+
this.l=-1;this.G=new _.Cl;this.f=this.o=this.j=this.a=this.B=null;this.F=!1},nY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},qY=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=_.qn(d);if(e){var f=[_.Dd];_.cr(a)[0].type!==_.Mc&&f.unshift(_.Fd);d.preferredDrmSystem===_.Dd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
|
|
29
|
+
h=e.Oa[g];h?(d=g===_.Fd?cast.framework.ContentProtection.WIDEVINE:g===_.Dd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},oY(b,h,a,d),pY(b,h,a,d)):c()}else c()}else c()},oY=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.Yj({method:_.rb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);
|
|
30
|
+
e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},pY=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,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.gj(g.data))})}:a.licenseHandler=void 0},rY=function(){this.a=!1;this.g=new _.K(YW);this.f=this.m=null;this.j=new Set;this.B=this.en.bind(this);
|
|
31
|
+
this.A=this.Xj.bind(this);this.l=null;this.w=new _.gi;this.h=this.o=null},tY=function(){return sY||(sY=new rY)},uY=function(){return cast.framework.CastReceiverContext.getInstance()},vY=function(){var a=uY().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},wY=function(a,b){var c=uY().getPlayerManager().getMediaInformation();if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;uY().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},
|
|
32
|
+
yY=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=uY();c=(uY().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Mg:_.Lg;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=xY(h,_.ta),m=xY(h,_.Ab),n=_.v([]),p=n.next().value;n=n.next().value;m&&(m=_.v(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);
|
|
33
|
+
if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(h);++g}return f.join("\n")},xY=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},zY=function(a){this.f=a;this.a=null;this.h=new _.gi;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]},BY=function(a,b){var c=null,d=AY(a);d&&(c={ad:d});a.f.trigger(new _.M(b,c))},AY=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 VX(d,c,e,f,g)}return b},CY=function(){},DY=function(){};_.r=bX.prototype;_.r.release=function(){this.Aa(_.Lq)};_.r.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.r.getState=function(){return this.f};_.r.onError=function(a){a.severity===_.Q&&this.Aa(_.Wq)};
|
|
36
|
+
_.r.Aa=function(a){if(a!==this.f)if(this.f===_.Wq&&a!==_.Lq)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===_.Qq?(this.A=b,this.player.trigger(new _.M(_.$c,{detail:{bufferedTimeMS:-1,reason:this.h}}))):this.l===_.Qq&&this.player.trigger(new _.M(_.Zc,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.Eq(this.j,this.f);this.player.trigger(new _.M(_.bg,
|
|
37
|
+
{detail:a}))}};var EY;_.J("clpp.cast.CastUtils",function(){});var gX=0,vX={GENERIC:gX,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.w(jX,bX);jX.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)};jX.prototype.destroy=function(){var a=this;return _.I(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,bX.prototype.destroy.call(a),0)})};jX.prototype.Aa=function(a){var b=this.player.l;b&&b.isPlayingBreak||bX.prototype.Aa.call(this,a)};
|
|
38
|
+
jX.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(_.Sq);break;case chrome.cast.media.IdleReason.ERROR:this.Aa(_.Wq);break;default:this.Aa(_.Lq)}break;case chrome.cast.media.PlayerState.PLAYING:this.Aa(_.Zq);break;case chrome.cast.media.PlayerState.PAUSED:this.Aa(_.Yq);break;case chrome.cast.media.PlayerState.BUFFERING:this.Aa(_.Qq)}};_.w(kX,_.rm);_.r=kX.prototype;_.r.initialize=function(a){this.a=a};_.r.release=function(){this.h=[];this.f={}};
|
|
39
|
+
_.r.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.Ml;break;case chrome.cast.media.TrackType.AUDIO:c=_.T;break;case chrome.cast.media.TrackType.TEXT:c=_.Ll}c=new _.Jl(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 _.Sl(c.id,c));return c}):[],this.a.trigger(new _.M(_.tg)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return mX(this,_.Ml)};_.r.getAudioTracks=function(){return mX(this,_.T)};_.r.oa=function(){return mX(this,_.Ll)};_.r.pa=function(){var a=this.La();return a?a.renditions[0]:null};_.r.Sa=function(){var a=this.na();return a?a.renditions[0]:null};_.r.Xa=function(){var a=this.va();return a?a.renditions[0]:null};_.r.xb=function(){return this.f[_.Ml]||null};
|
|
41
|
+
_.r.Jb=function(){return this.f[_.T]||null};_.r.Kb=function(){return this.f[_.Ll]||null};_.r.La=function(){return nX(this,_.Ml)};_.r.na=function(){return nX(this,_.T)};_.r.va=function(){return nX(this,_.Ll)};_.r.Fb=function(a){pX(this,_.Ml,a)};_.r.Ga=function(a){pX(this,_.T,a)};_.r.Ya=function(a){pX(this,_.Ll,a)};_.r.pb=function(a){this.Fb(a&&a.track)};_.r.Db=function(a){this.Ga(a&&a.track)};_.r.Eb=function(a){this.Ya(a&&a.track)};_.r.addTextTrack=function(){return _.I(function(a){_.z(a)})};
|
|
42
|
+
_.r.wa=function(){return!0};kX.prototype.isAbrEnabled=kX.prototype.wa;kX.prototype.addTextTrack=kX.prototype.addTextTrack;kX.prototype.setTextRendition=kX.prototype.Eb;kX.prototype.setAudioRendition=kX.prototype.Db;kX.prototype.setVideoRendition=kX.prototype.pb;kX.prototype.setTextTrack=kX.prototype.Ya;kX.prototype.setAudioTrack=kX.prototype.Ga;kX.prototype.setVideoTrack=kX.prototype.Fb;kX.prototype.getTextTrack=kX.prototype.va;kX.prototype.getAudioTrack=kX.prototype.na;
|
|
43
|
+
kX.prototype.getVideoTrack=kX.prototype.La;kX.prototype.getLoadingTextRendition=kX.prototype.Kb;kX.prototype.getLoadingAudioRendition=kX.prototype.Jb;kX.prototype.getLoadingVideoRendition=kX.prototype.xb;kX.prototype.getTextRendition=kX.prototype.Xa;kX.prototype.getAudioRendition=kX.prototype.Sa;kX.prototype.getVideoRendition=kX.prototype.pa;kX.prototype.getTextTracks=kX.prototype.oa;kX.prototype.getAudioTracks=kX.prototype.getAudioTracks;kX.prototype.getVideoTracks=kX.prototype.getVideoTracks;_.w(tX,_.Mm);_.r=tX.prototype;_.r.init=function(a,b){this.h=this.J=b};_.r.unload=function(){var a=this;return new Promise(function(b,c){a.f&&a.f.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.r.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.nb)};_.r.appendLoad=function(){return Promise.reject(_.nb)};_.r.seekWith=function(){return Promise.reject(_.nb)};
|
|
44
|
+
_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.I(function(a){_.z(a)})};_.r.ye=function(a){this.N=a};_.r.Hc=function(){return this.w};_.r.Pb=function(){return this.A};_.r.eg=function(){return this.ka};
|
|
45
|
+
_.r.sendMessage=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.O(1,8,8004,void 0);g.C(2);break}_.F(g,3);return _.x(g,e.sendMessage(a,cX(b)),5);case 5:_.G(g,2);break;case 3:f=_.H(g),d=new _.O(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.z(g)}})};
|
|
46
|
+
_.r.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Hc())throw a.g.warn(UW),new _.O(1,8,8001,void 0);if(!KX)throw a.g.warn(SW),new _.O(1,8,8002,void 0);if(a.Pb())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.F(d,2);return _.x(d,OX(a),4)}if(2!=d.a)return _.G(d,0);b=_.H(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.O(1,8,8E3,c);})};_.r.dg=function(){this.Pb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
|
|
47
|
+
_.r.addMessageListener=function(a){typeof a===_.le&&this.I.add(a)};_.r.removeMessageListener=function(a){typeof a===_.le&&this.I["delete"](a)};_.r.play=function(){var a=this;return this.isEnded()?QX(this,!0):new Promise(function(b,c){if(!a.a)return c(RW);a.a.play(null,b,c)})};_.r.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(RW);a.a.pause(null,b,c)})};_.r.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
|
|
48
|
+
_.r.isEnded=function(){return this.getState()===_.Sq};_.r.seek=function(a){var b=this;return this.isEnded()?QX(this,!1,a):new Promise(function(c,d){b.a||d(RW);b.l.isPlayingBreak&&d(PW);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.M(_.Dg));b.a.seek(e,function(){b.trigger(new _.M(_.Cg));c()},d)})};_.r.getPosition=function(){return this.getMediaPosition()};_.r.getMediaPosition=function(){return this.a&&this.a.getEstimatedTime()||0};_.r.getDuration=function(){return this.getMediaDuration()};
|
|
49
|
+
_.r.getMediaDuration=function(){if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.k?-1:-1===a?Infinity:a};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.r.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage($W,{type:"SET_PLAYBACK_RATE",requestId:iX(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
|
|
50
50
|
_.r.getVolume=function(){return this.a&&this.a.volume.level};_.r.setVolume=function(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))};_.r.isMuted=function(){return this.a&&this.a.volume.muted};_.r.setMuted=function(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};
|
|
51
|
-
_.r.getPresentationStartTime=function(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;var a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.k?null:1E-8===a?0:a};_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.j?this.j.getState():_.
|
|
52
|
-
_.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?
|
|
53
|
-
_.r.getBufferInfo=function(){return new _.
|
|
54
|
-
_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(
|
|
55
|
-
_.r.
|
|
56
|
-
_.r.
|
|
57
|
-
_.r.
|
|
58
|
-
isLive:this.isLive()},currentTime:
|
|
59
|
-
_.r
|
|
60
|
-
window.__onGCastApiAvailable=
|
|
61
|
-
_.r.cast=function(a){var b=this,c,d,e;return _.
|
|
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 _.
|
|
64
|
-
_.r.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
_.r.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_.r.
|
|
72
|
-
_.r.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
_.r.
|
|
78
|
-
_.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
_.r.
|
|
83
|
-
_.r.
|
|
84
|
-
_.r.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
_.r.
|
|
90
|
-
_.r.
|
|
91
|
-
_.r.
|
|
51
|
+
_.r.getPresentationStartTime=function(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;var a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.k?null:1E-8===a?0:a};_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.j?this.j.getState():_.Mq};
|
|
52
|
+
_.r.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?dX(this.a.customData.stats):_.Kq()};_.r.isLive=function(){return Infinity===this.getDuration()};_.r.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Hc())return b.g.warn(UW),e["return"]();if(!KX)return b.g.warn(SW),e["return"]();b.F=_.cr(a);b.h=_.Vm(b.J,a);c=b.F[b.B];d={source:c,isLive:c.isLive,autoplay:b.h.autoplay,ob:b.h,gc:c.gc,audioMimeType:c.audioMimeType};return _.x(e,PX(b,d),0)})};
|
|
53
|
+
_.r.getBufferInfo=function(){return new _.Lm};_.r.getTrackManager=function(){return this.f};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.L=a};_.r.getNetworkEngine=function(){return this.L};_.r.getSourceIndex=function(){return this.B};_.r.setSourceIndex=function(a){this.B=a};_.r.setCmsdManager=function(){};_.r.getLoadedSource=function(){return this.F[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};
|
|
54
|
+
_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(TW)};_.r.onError=function(a){if(a&&(this.trigger(new _.M(_.he,{detail:a})),this.j))this.j.onError(a)};_.r.namespace=function(){return _.rd};_.r.canPlay=function(){return this.Hc()?2:0};_.r.Ib=function(){return this.K};_.r.fc=function(a){this.K=wX(a)};_.r.Wf=function(){this.K=null};
|
|
55
|
+
_.r.Gg=function(a){var b=this.Ib()||{};a={metadataType:AX(b.metadataType),title:a};this.fc(Object.assign({},b,a))};_.r.Eg=function(a){var b=this.Ib()||{},c=AX(b.metadataType);a=new chrome.cast.Image(a);this.fc(Object.assign({},b,{metadataType:c,images:[a]}))};_.r.Dg=function(a){var b=this.Ib()||{};this.fc(Object.assign({},b,{metadataType:3,artist:a}))};_.r.Fg=function(a){var b=this.Ib()||{};a={metadataType:AX(b.metadataType),releaseDate:a};this.fc(Object.assign({},b,a))};
|
|
56
|
+
_.r.Vm=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;KX=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ka=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Mg()};
|
|
57
|
+
_.r.sn=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;NX(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Pb()||(this.A=!0,NX(this,a.session),this.ja());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Pb()&&this.a){var b=this.a.media,c=this.f.na(),d=this.f.va();c=c&&c.language||void 0;d=d&&d.language||void 0;this.Z(this.getState(),{source:{url:b.contentId,type:b.contentType,
|
|
58
|
+
isLive:this.isLive()},currentTime:LX(this),kj:d,fh:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.fa);a.session.removeMessageListener(ZW,this.U);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}};_.r.hn=function(a){this.g.debug("New media session",a.mediaSession);MX(this,a.mediaSession)};_.r.gn=function(a){a.value&&a.value.tracks&&this.f&&this.f.load()};_.r.Zm=function(a,b){if(a===ZW&&0<this.I.size){var c=dX(b);this.I.forEach(function(d){return d(c)})}};
|
|
59
|
+
_.r.Wj=function(){this.trigger(new _.M(_.sg))};_.r.ll=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.x(e,eX(a,[_.lg,_.Lc],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ia++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.r.getTextDisplayer=function(){return null};var KX=!1,sX=new Set;
|
|
60
|
+
window.__onGCastApiAvailable=qX;_.w(SX,_.Mm);_.r=SX.prototype;_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.x(b,uX(a.a),3):b.C(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.z(b)})};_.r.bo=function(a,b){this.f&&a!==_.Sq&&a!==_.Lq&&(delete b.license,this.f.load(b))};_.r.Tf=function(){return!!this.a&&this.a.Hc()&&KX};_.r.Pb=function(){return!!this.a&&this.a.Pb()};_.r.eg=function(){return this.a?this.a.eg():""};_.r.ye=function(a){this.a&&this.a.ye(a)};
|
|
61
|
+
_.r.cast=function(a){var b=this,c,d,e;return _.I(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.F(f,2);return _.x(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.na();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.va())l.language&&
|
|
62
|
+
(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.Yc?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),wg:b.f.getPresentationStartTime(),gc:m,audioMimeType:p,ob:g}}c=g;return _.x(f,TX(b),5);case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.x(f,b.f.load(a),7);if(b.a.a){f.C(7);break}return _.x(f,PX(b.a,c),7);case 7:_.G(f,0);break;case 2:d=_.H(f),
|
|
63
|
+
b.g.error("Error while trying to cast",d),e=new _.M(_.he,{detail:d}),b.trigger(e),_.z(f)}})};_.r.dg=function(){this.a&&this.a.dg()};_.r.Qj=function(a){var b=this;return _.I(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.x(c,uX(b.a),2):c.C(2)}b.a=RX(b);_.z(c)})};_.r.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.x(c,b.a.sendMessage(ZW,a),0):(b.g.warn(VW),c["return"]())})};
|
|
64
|
+
_.r.Un=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage($W,{type:"QUEUE_NEXT",requestId:iX(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Vn=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage($W,{type:"QUEUE_PREV",requestId:iX(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Tn=function(a){var b=this;return _.I(function(c){return _.x(c,b.a.sendMessage($W,{type:"QUEUE_INSERT",requestId:iX(),mediaSessionId:b.a.a.mediaSessionId,items:a}),0)})};
|
|
65
|
+
_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(VW)};_.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(VW)};_.r.Ib=function(){return this.a&&this.a.Ib()};_.r.fc=function(a){this.a&&this.a.fc(a)};_.r.Wf=function(){this.a&&this.a.Wf()};_.r.Gg=function(a){this.a&&this.a.Gg(a)};_.r.Eg=function(a){this.a&&this.a.Eg(a)};_.r.Dg=function(a){this.a&&this.a.Dg(a)};_.r.Fg=function(a){this.a&&this.a.Fg(a)};_.J(WW,SX);
|
|
66
|
+
SX.prototype.setContentReleaseDate=SX.prototype.Fg;SX.prototype.setContentArtist=SX.prototype.Dg;SX.prototype.setContentImage=SX.prototype.Eg;SX.prototype.setContentTitle=SX.prototype.Gg;SX.prototype.clearContentMetadata=SX.prototype.Wf;SX.prototype.setContentMetadata=SX.prototype.fc;SX.prototype.getContentMetadata=SX.prototype.Ib;SX.prototype.removeMessageListener=SX.prototype.removeMessageListener;SX.prototype.addMessageListener=SX.prototype.addMessageListener;SX.prototype.queueAddItems=SX.prototype.Tn;
|
|
67
|
+
SX.prototype.queuePreviousItem=SX.prototype.Vn;SX.prototype.queueNextItem=SX.prototype.Un;SX.prototype.sendMessage=SX.prototype.sendMessage;SX.prototype.changeReceiverId=SX.prototype.Qj;SX.prototype.forceDisconnect=SX.prototype.dg;SX.prototype.cast=SX.prototype.cast;SX.prototype.setPlayerConfigInterceptor=SX.prototype.ye;SX.prototype.getReceiverName=SX.prototype.eg;SX.prototype.isCasting=SX.prototype.Pb;SX.prototype.canCast=SX.prototype.Tf;SX.prototype.destroy=SX.prototype.destroy;_.w(UX,bX);_.r=UX.prototype;
|
|
68
|
+
_.r.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,this.H);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.F);b.addEventListener(a.BITRATE_CHANGED,this.a)};
|
|
69
|
+
_.r.destroy=function(){var a=this,b,c;return _.I(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.I);c.removeEventListener(b.PAUSE,a.H);c.removeEventListener(b.MEDIA_FINISHED,a.w);c.removeEventListener(b.BUFFERING,a.o);c.removeEventListener(b.SEEKING,a.K);c.removeEventListener(b.SEEKED,a.J);c.removeEventListener(b.STALLED,a.L);c.removeEventListener(b.PLAYER_LOADING,a.G);c.removeEventListener(b.ERROR,
|
|
70
|
+
a.F);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,bX.prototype.destroy.call(a),0)})};_.r.ak=function(){this.player.trigger(new _.M(_.ff));this.Aa(_.Zq)};_.r.$j=function(){this.Aa(_.Yq)};_.r.cn=function(){this.Aa(_.Sq)};_.r.Tm=function(a){a.isBuffering?this.Aa(_.Qq):(a=this.player.isPaused()?_.Yq:_.Zq,this.Aa(a))};_.r.ck=function(){this.h=1;this.player.trigger(new _.M(_.Dg))};_.r.bk=function(){this.player.trigger(new _.M(_.Cg))};_.r.vn=function(){this.h=2};_.r.fn=function(){this.Aa(_.Xq)};
|
|
71
|
+
_.r.Yj=function(a){var b=this.player.getStats();this.player.trigger(new _.M(_.Xc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.Zj=function(a){a=new _.O(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.M(_.he,{detail:a}));this.Aa(_.Wq)};_.r=VX.prototype;_.r.ub=function(){return"Google Cast Framework"};_.r.vb=function(){return cast.framework.VERSION};_.r.Ab=function(){return 0};_.r.getId=function(){return""};_.r.getCreativeId=function(){return""};_.r.Xb=function(){return""};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return this.a.title||""};_.r.getDuration=function(){return this.a.duration||0};_.r.getPosition=function(){return 0};
|
|
72
|
+
_.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.ac=function(){return!1};_.r.wb=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.kb=function(){return 0};_.r.jb=function(){return 0};_.r.Va=function(){return 0};_.r.Wa=function(){switch(this.Lb()){case 0:return 0;case -1:return 2;default:return 1}};_.r.getPodIndex=function(){return this.j};_.r.Lb=function(){return this.f.position};_.r.yb=function(){return this.l};
|
|
73
|
+
_.r.lb=function(){return this.h};_.r.getWrapperAdIds=function(){return[]};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.$b=function(){return null};VX.prototype.getVideoElement=VX.prototype.$b;VX.prototype.getWrapperCreativeIds=VX.prototype.getWrapperCreativeIds;VX.prototype.getWrapperAdSystems=VX.prototype.getWrapperAdSystems;VX.prototype.canSeek=VX.prototype.canSeek;VX.prototype.getWrapperAdIds=VX.prototype.getWrapperAdIds;
|
|
74
|
+
VX.prototype.getSequenceLength=VX.prototype.lb;VX.prototype.getPositionInSequence=VX.prototype.yb;VX.prototype.getPodTimeOffset=VX.prototype.Lb;VX.prototype.getPodIndex=VX.prototype.getPodIndex;VX.prototype.getPodType=VX.prototype.Wa;VX.prototype.getMediaBitrate=VX.prototype.Va;VX.prototype.getMediaHeight=VX.prototype.jb;VX.prototype.getMediaWidth=VX.prototype.kb;VX.prototype.getMediaUrl=VX.prototype.getMediaUrl;VX.prototype.getClickThroughUrl=VX.prototype.wb;VX.prototype.isBumper=VX.prototype.ac;
|
|
75
|
+
VX.prototype.getSkipTimeOffset=VX.prototype.getSkipTimeOffset;VX.prototype.getPosition=VX.prototype.getPosition;VX.prototype.getDuration=VX.prototype.getDuration;VX.prototype.getTitle=VX.prototype.getTitle;VX.prototype.getAdvertiserName=VX.prototype.getAdvertiserName;VX.prototype.getAdSystem=VX.prototype.getAdSystem;VX.prototype.getApiFramework=VX.prototype.getApiFramework;VX.prototype.getSourceId=VX.prototype.Xb;VX.prototype.getCreativeId=VX.prototype.getCreativeId;VX.prototype.getId=VX.prototype.getId;
|
|
76
|
+
VX.prototype.getTechnology=VX.prototype.Ab;VX.prototype.getAdManagerVersion=VX.prototype.vb;VX.prototype.getAdManagerName=VX.prototype.ub;WX.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};WX.prototype.Nb=function(){return!!this.a.find(function(a){return 0===a.position})};WX.prototype.Mb=function(){return!!this.a.find(function(a){return-1===a.position})};WX.prototype.hasPostroll=WX.prototype.Mb;WX.prototype.hasPreroll=WX.prototype.Nb;WX.prototype.getCuePoints=WX.prototype.getCuePoints;_.r=YX.prototype;_.r.load=function(){var a=this;return _.I(function(b){ZX&&(ZX=!1,dY(a,0));_.z(b)})};_.r.start=function(){return _.I(function(a){XX().play();_.z(a)})};_.r.fd=function(){};_.r.resume=function(){-1!==this.getPosition()&&XX().play()};_.r.pause=function(){-1!==this.getPosition()&&XX().pause()};_.r.skip=function(){};_.r.getVolume=function(){return this.m.getVolume()||0};_.r.setVolume=function(a){this.m.setVolume(a)};
|
|
77
|
+
_.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.r.cd=function(){return!0};_.r.zc=function(){var a=this;return _.I(function(b){XX().removeEventListener(a.f,a.h);_.z(b)})};
|
|
78
|
+
_.r.dk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=XX().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.M(_.Bc,{adsTimeline:new WX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:cY(this,_.qc,a);break;case cast.framework.events.EventType.BREAK_STARTED:cY(this,_.gc,a);break;case cast.framework.events.EventType.BREAK_ENDED:cY(this,_.hc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:cY(this,
|
|
79
|
+
_.wc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(cY(this,_.vc,a),cY(this,_.yc,a)):a.endedReason===b.STOPPED?cY(this,_.yc,a):a.endedReason===b.END_OF_STREAM?(cY(this,_.kc,a),cY(this,_.yc,a)):a.endedReason===b.ERROR&&dY(this,1);break;case cast.framework.events.EventType.PLAYING:cY(this,_.uc,a);break;case cast.framework.events.EventType.PAUSE:cY(this,_.sc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?cY(this,_.ic,a):cY(this,_.uc,a)}};
|
|
80
|
+
YX.prototype.getPosition=YX.prototype.getPosition;YX.prototype.setVolume=YX.prototype.setVolume;YX.prototype.getVolume=YX.prototype.getVolume;YX.prototype.skip=YX.prototype.skip;YX.prototype.pause=YX.prototype.pause;YX.prototype.resume=YX.prototype.resume;var ZX=!1;eY.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(fY(),this.a)};eY.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(fY(),this.a)};eY.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return gY(a)})};
|
|
81
|
+
eY.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=_.og;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.pg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.qg}b&&this.Za(new _.M(b,{detail:gY(a.timedMetadataInfo)}))}else for(a=_.v(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Za(new _.M(_.og,{detail:b.value}))};_.w(hY,_.rm);_.r=hY.prototype;_.r.initialize=function(a){this.m=a;iY().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.r.load=function(){};_.r.destroy=function(){this.m=null;iY().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.oa=function(){return this.j};_.r.pa=function(){return null};
|
|
82
|
+
_.r.Sa=function(){var a=this.na();return a&&a.renditions[0]};_.r.Xa=function(){var a=this.va();return a&&a.renditions[0]};_.r.xb=function(){return null};_.r.Jb=function(){return null};_.r.Kb=function(){return null};_.r.La=function(){return null};_.r.na=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.k&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
|
|
83
|
+
_.r.va=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.oa().find(function(c){return c.id===b})||null)}return a};_.r.Fb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.Ga=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.Ya=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.pb=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.Db=function(a){this.Ga(a&&a.track)};
|
|
84
|
+
_.r.Eb=function(a){this.Ya(a&&a.track)};
|
|
85
|
+
_.r.addTextTrack=function(a){var b=this,c,d,e;return _.I(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.x(f,eX(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]),kY(b)}catch(g){throw b.g.warn("failed on track",
|
|
86
|
+
a),g;}}_.z(f)})};_.r.wa=function(){return!0};_.r.On=function(){this.f=iY().getAudioTracksManager();var a=this.f.getTracks();this.h=jY(_.T,a);kY(this);a=this.m.getConfiguration();lY(this,_.T,a.preferredAudioLanguage,a.preferredAudioRole);lY(this,_.Ll,a.preferredTextLanguage,a.preferredTextRole)};hY.prototype.isAbrEnabled=hY.prototype.wa;hY.prototype.addTextTrack=hY.prototype.addTextTrack;hY.prototype.setTextRendition=hY.prototype.Eb;hY.prototype.setAudioRendition=hY.prototype.Db;
|
|
87
|
+
hY.prototype.setVideoRendition=hY.prototype.pb;hY.prototype.setTextTrack=hY.prototype.Ya;hY.prototype.setAudioTrack=hY.prototype.Ga;hY.prototype.setVideoTrack=hY.prototype.Fb;hY.prototype.getTextTrack=hY.prototype.va;hY.prototype.getAudioTrack=hY.prototype.na;hY.prototype.getVideoTrack=hY.prototype.La;hY.prototype.getLoadingTextRendition=hY.prototype.Kb;hY.prototype.getLoadingAudioRendition=hY.prototype.Jb;hY.prototype.getLoadingVideoRendition=hY.prototype.xb;hY.prototype.getTextRendition=hY.prototype.Xa;
|
|
88
|
+
hY.prototype.getAudioRendition=hY.prototype.Sa;hY.prototype.getVideoRendition=hY.prototype.pa;hY.prototype.getTextTracks=hY.prototype.oa;hY.prototype.getAudioTracks=hY.prototype.getAudioTracks;hY.prototype.getVideoTracks=hY.prototype.getVideoTracks;_.w(mY,_.Mm);_.r=mY.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=nY();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.jn.bind(this));d.setMediaPlaybackInfoHandler(this.Fj.bind(this));this.a=new UX(this);this.a.init();this.j=new hY;this.j.initialize(this);this.o=new eY(function(e){return c.trigger(e)});this.o.init()};
|
|
89
|
+
_.r.unload=function(){var a=cast.framework.messages.PlayerState,b=nY();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.r.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.B=null,a.w=_.Tm(),a.h=a.w,a.l=-1,a.A=null,a.a?_.x(b,a.a.destroy(),3):b.C(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.z(b)})};
|
|
90
|
+
_.r.play=function(){var a=nY();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.r.pause=function(){var a=nY();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.r.isPaused=function(){return nY().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
|
|
91
|
+
_.r.isEnded=function(){return nY().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=nY();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(PW);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return this.getMediaPosition()};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.getMediaPosition=function(){return nY().getCurrentTimeSec()};
|
|
92
|
+
_.r.getDuration=function(){return this.getMediaDuration()};_.r.getMediaDuration=function(){var a=nY().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return nY().getPlaybackRate()};_.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;nY().sendLocalMediaRequest(b)}};_.r.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};
|
|
92
93
|
_.r.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.r.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};_.r.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};
|
|
93
|
-
_.r.getLoadedSource=function(){var a=
|
|
94
|
-
_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=
|
|
95
|
-
_.r.getStats=function(){var a=_.
|
|
96
|
-
_.r.load=function(a){var b=this,c,d;return _.
|
|
97
|
-
_.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.
|
|
98
|
-
_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return
|
|
99
|
-
_.r.
|
|
100
|
-
(!e||e&&f)){d=
|
|
101
|
-
_.r.
|
|
102
|
-
d=Object.assign({},d,{shakaConfig:c});return d};_.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r=
|
|
103
|
-
_.r.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
|
-
_.r.stop=function(){if(this.a){this.a=!1;this.
|
|
106
|
-
_.r.removeMessageListener=function(a){typeof a===_.
|
|
107
|
-
_.r.
|
|
108
|
-
h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Ke)||g,n=h[l].getAttribute(_.
|
|
109
|
-
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Jg){e=c[d].getElementsByTagName(_.
|
|
110
|
-
_.r.
|
|
111
|
-
break}b.f.
|
|
112
|
-
break}return _.x(l,Promise.resolve(b.
|
|
113
|
-
_.r.
|
|
114
|
-
|
|
115
|
-
_.r.skip=function(){var a=this.f.a;a&&this.f.sendMessage(
|
|
116
|
-
_.r.
|
|
117
|
-
|
|
94
|
+
_.r.getLoadedSource=function(){var a=nY().getMediaInformation();if(a){var b=nY().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,hp:b,name:c}}return null};_.r.getDrmInfo=function(){return null};_.r.getPresentationStartTime=function(){return nY().getStartAbsoluteTime()};
|
|
95
|
+
_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=nY().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.a?this.a.getState():_.Mq};
|
|
96
|
+
_.r.getStats=function(){var a=_.Kq();if(this.f){a=nY().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
|
|
97
|
+
_.r.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.Jq;b.a.j=b.f.a;b.A=_.cr(a);b.h=_.Vm(b.w,a);if(b.F)return b.F=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.k&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:cX(b.h),local:!0};return _.x(e,nY().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.va);return new _.Lm};
|
|
98
|
+
_.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.nb)};_.r.appendLoad=function(){return Promise.reject(_.nb)};_.r.seekWith=function(){return Promise.reject(_.nb)};_.r.setNetworkEngine=function(a){this.G=a};_.r.setCmsdManager=function(){};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};
|
|
99
|
+
_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return XW};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(TW)};_.r.onError=function(a){this.trigger(new _.M(_.he,{detail:a}))};_.r.canPlay=function(){return _.Jk()?2:0};
|
|
100
|
+
_.r.jn=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=cX(this.getStats());var b=nY(),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&&
|
|
101
|
+
(!e||e&&f)){d=nY().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};
|
|
102
|
+
_.r.Fj=function(a,b){var c=null,d=b;a.media.customData&&(c=dX(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;qY(c,d);e=null;a.media.customData&&(e=dX(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}}),
|
|
103
|
+
d=Object.assign({},d,{shakaConfig:c});return d};_.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r=rY.prototype;_.r.init=function(a){var b=this;a&&(this.f=new mY,_.cu(a,this.f),this.m=a,this.w.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.Lq?_.x(c,aX(b.m),0):c.C(0)})}))};
|
|
104
|
+
_.r.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=uY(),b=uY().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[ZW]=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=
|
|
105
|
+
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;this.h&&(c.queue=this.h);b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.ym.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.B);a.start(c);a.addCustomMessageListener(ZW,this.A)}};
|
|
106
|
+
_.r.stop=function(){if(this.a){this.a=!1;this.w.release();var a=uY();uY().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.B);a.removeCustomMessageListener(ZW,this.A);a.stop();this.h=this.m=this.f=null}};_.r.ye=function(a){this.l=a};_.r.ko=function(a){this.o=a};_.r.on=function(a,b){uY().addEventListener(a,b)};_.r.off=function(a,b){uY().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.le&&this.j.add(a)};
|
|
107
|
+
_.r.removeMessageListener=function(a){typeof a===_.le&&this.j["delete"](a)};_.r.sendMessage=function(a,b){uY().sendCustomMessage(ZW,b,cX(a))};_.r.Hc=function(){return this.a};_.r.Ib=function(){return vY()};_.r.fc=function(a){wY(this,a)};_.r.Eo=function(a){var b=vY(),c=null;a?c=Object.assign({},b,a):c=b;wY(this,c)};_.r.mo=function(a){this.h=a};_.r.getQueueManager=function(){return uY().getPlayerManager().getQueueManager()};
|
|
108
|
+
_.r.zm=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return yY(this,a);try{var b=(new DOMParser).parseFromString(a,_.mg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=uY();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===_.Jg||g===_.Oc){g=e[f].getAttribute(_.Ke);for(var h=e[f].getElementsByTagName(_.Bb),l=
|
|
109
|
+
h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Ke)||g,n=h[l].getAttribute(_.yd),p=h[l].getAttribute(_.Zg)||void 0,q=h[l].getAttribute(_.me)||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(_.Bb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ka).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Kb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=uY();c=a.getElementsByTagName("StreamIndex");
|
|
110
|
+
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Jg){e=c[d].getElementsByTagName(_.yb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.eb)||void 0,h=e[f].getAttribute(_.db)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Mg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.yb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
111
|
+
_.r.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=dX(c.media.customData.playerConfiguration));if(!b.m||!d){l.C(2);break}if(!b.l){l.C(3);break}return _.x(l,Promise.resolve(b.l(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.C(5);break}return _.x(l,aY(c.media,d.ima,b.m.getNetworkEngine()),5);case 5:typeof d.startTime===_.k&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.C(7);
|
|
112
|
+
break}b.f.F=!0;return _.x(l,_.mu(b.m,d),8);case 8:return _.x(l,_.nu(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.gc&&(c.media.hlsVideoSegmentFormat=fX(f.gc,_.Ml)),f.audioMimeType&&(c.media.hlsSegmentFormat=fX(f.audioMimeType,_.T));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.k){var m=g.sectionStartAbsoluteTime;g.sectionStartAbsoluteTime=0===m?1E-8:m}void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay);case 2:if(!b.o){l.C(10);
|
|
113
|
+
break}return _.x(l,Promise.resolve(b.o(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.r.en=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.lm;var b=uY().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))}_.hu(this.m)}};
|
|
114
|
+
_.r.Xj=function(a){if(0<this.j.size){var b=dX(a.data);this.j.forEach(function(c){return c(b)})}};_.J(YW,rY);rY.prototype.getQueueManager=rY.prototype.getQueueManager;rY.prototype.setQueue=rY.prototype.mo;rY.prototype.updateContentMetadata=rY.prototype.Eo;rY.prototype.setContentMetadata=rY.prototype.fc;rY.prototype.getContentMetadata=rY.prototype.Ib;rY.prototype.isApiReady=rY.prototype.Hc;rY.prototype.sendMessage=rY.prototype.sendMessage;rY.prototype.removeMessageListener=rY.prototype.removeMessageListener;
|
|
115
|
+
rY.prototype.addMessageListener=rY.prototype.addMessageListener;rY.prototype.off=rY.prototype.off;rY.prototype.on=rY.prototype.on;rY.prototype.setLoadRequestDataInterceptor=rY.prototype.ko;rY.prototype.setPlayerConfigInterceptor=rY.prototype.ye;rY.prototype.stop=rY.prototype.stop;rY.prototype.start=rY.prototype.start;rY.prototype.init=rY.prototype.init;rY.getInstance=tY;var sY=null;_.r=zY.prototype;_.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){a.a=a.f.l;if(a.a)for(b=a.a.controller,c=a.xn.bind(a),d=_.v(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.z(g)})};_.r.start=function(){return _.I(function(a){_.z(a)})};_.r.fd=function(){};_.r.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.r.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
|
|
116
|
+
_.r.skip=function(){var a=this.f.a;a&&this.f.sendMessage($W,{type:"SKIP_AD",requestId:iX(),mediaSessionId:a.mediaSessionId})};_.r.getVolume=function(){return this.f.getVolume()||0};_.r.setVolume=function(a){this.f.setVolume(a)};_.r.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.r.cd=function(){return!0};_.r.zc=function(){var a=this;return _.I(function(b){a.h.release();_.z(b)})};
|
|
117
|
+
_.r.xn=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.M(_.Bc,{adsTimeline:new WX(a.breaks)})));break;case "isPlayingBreak":a.value?BY(this,_.gc):(BY(this,_.kc),BY(this,_.yc),BY(this,_.hc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(BY(this,_.kc),BY(this,_.yc)),BY(this,_.wc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?BY(this,_.sc):BY(this,_.uc))}};zY.prototype.getPosition=zY.prototype.getPosition;
|
|
118
|
+
zY.prototype.setVolume=zY.prototype.setVolume;zY.prototype.getVolume=zY.prototype.getVolume;zY.prototype.skip=zY.prototype.skip;zY.prototype.pause=zY.prototype.pause;zY.prototype.resume=zY.prototype.resume;CY.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};CY.prototype.a=function(a,b){return a.namespace()!==_.rd?!1:!(!b||!b.ima)};CY.prototype.create=function(a){return new zY(a.a)};_.rr(new CY);DY.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};DY.prototype.a=function(a,b){return tY().Hc()?!(!b||!b.ima):!1};DY.prototype.create=function(a){return new YX(a)};_.rr(new DY);_.J("clpp.cast.createCastQueue",function(){EY=function(){return cast.framework.QueueBase.apply(this,arguments)||this};_.w(EY,cast.framework.QueueBase);EY.prototype.initialize=function(a){var b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b};return new EY});};
|
|
118
119
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
119
120
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
120
121
|
else{_=this.clpp._;(f.call(g,this));}
|