@castlabs/prestoplay 6.9.0 → 6.10.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 +39 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +105 -104
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +420 -417
- package/cjs/cl.crypto.js +10 -9
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +11 -12
- package/cjs/cl.freewheel.js +21 -21
- package/cjs/cl.hls.js +72 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -31
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +273 -272
- package/cjs/cl.muxdata.js +14 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +27 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +16 -16
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +363 -359
- package/cl.crypto.js +9 -9
- package/cl.dash.js +67 -67
- package/cl.externs.js +11 -12
- package/cl.freewheel.js +17 -17
- package/cl.hls.js +61 -61
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +235 -236
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +59 -58
- package/cl.thumbnails.js +17 -17
- 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.youbora.js +13 -13
- package/package.json +1 -1
- package/typings.d.ts +47 -2
package/cjs/cl.cast.js
CHANGED
|
@@ -1,115 +1,116 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
a;this.m=null;this.g=_.
|
|
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.w=this.f=null;this.A=this.Eb.bind(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.ga.length){a.w=!0;a.o.
|
|
13
|
-
null;a=null===a?null:a+b;return null===a?b:a},
|
|
14
|
-
b.G(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},
|
|
15
|
-
g.hlsSegmentFormat=
|
|
16
|
-
case 3:q=a.hb()||{};r=
|
|
17
|
-
d.language);(e=a.f.
|
|
18
|
-
function(a){return new
|
|
19
|
-
b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.
|
|
20
|
-
typeof e===_.k?e:0},
|
|
21
|
-
|
|
22
|
-
p.vastAdsRequest=
|
|
23
|
-
(c=
|
|
24
|
-
h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new Z(d,e,b.index,b.total,f)}return c},
|
|
25
|
-
_.
|
|
26
|
-
var e=!1,f=[];b===_.
|
|
27
|
-
d.next();!e.done;e=d.next()){e=e.value;var f=new _.
|
|
28
|
-
this.j=this.a=this.B=null;this.D=!1},
|
|
29
|
-
g===_.
|
|
30
|
-
f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},
|
|
31
|
-
|
|
32
|
-
p=n.next().value;n=n.next().value;m&&(m=_.u(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(h);++g}return f.join("\n")},
|
|
33
|
-
cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},
|
|
34
|
-
b.breaks.filter(function(h){return 0<=h.position}).sort(function(h,l){return h.position-l.position}).findIndex(function(h){return h===c})}b.breakClips&&(d=b.breakClips.find(function(h){return h.id===a.a.breakClipId})||null);b=new Z(d,c,e,f,g)}return b},
|
|
35
|
-
_.t.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_.t.
|
|
44
|
-
_.t.
|
|
45
|
-
_.t.
|
|
46
|
-
_.t.
|
|
47
|
-
_.t.
|
|
2
|
+
var f=function(window){var FM="Cannot seek during ads playout.",GM="Cannot switch track",HM="Media session does not exist.",IM="No receivers available",JM="Reset ABR functionality not available on cast.",KM="SDK not yet ready",LM="Sender is destroyed.",MM="clpp.cast.CastProxy",NM="clpp.cast.Player",OM="clpp.cast.Receiver",PM="urn:x-cast:castlabs",QM="urn:x-cast:com.google.cast.media",RM=function(a){return _.B(function(b){return 1==b.a?_.x(b,a.kc(_.Pd),2):_.x(b,a.kc(_.Od),0)})},SM=function(a,b){this.log=new _.I(b);this.a=
|
|
3
|
+
a;this.m=null;this.g=_.Om;this.o=_.Pm;this.j=2;this.D=Date.now();this.B=-1},TM=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.ld){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ld?"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}})},UM=function(a){if(typeof a!==_.ve)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}},VM=function(a,b,c,d){var e,f,g,h,l,m,n,p;return _.B(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=_.Vi(d,a.mimeType,g);if(!f||!g)return q.G(2);l=_.ai(a.url);return _.x(q,c.fetch(l).P,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.N(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)})},WM=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 _.Te:return d.FMP4;case _.Se:return b===_.wi?d.MPEG2_TS:c.TS;case _.nc:return c.AAC;case _.oc:return c.AC3;case _.pc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.qc:return c.FMP4}},YM=function(a){a=
|
|
6
|
+
void 0===a?XM:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.L(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}},ZM=function(a){SM.call(this,a,"clpp.cast.SenderStateManager");
|
|
7
|
+
this.w=this.f=null;this.A=this.Eb.bind(this)},$M=function(){this.h=new _.I("clpp.cast.SenderTrackManager");this.a=null;this.g=[];this.f={}},aN=function(a){return(a=a.a?a.a.a:null)?a.activeTrackIds.map(function(b){return b.toString()}):[]},cN=function(a,b){var c=aN(a);return bN(a,b).find(function(d){return c.includes(d.id)})||null},bN=function(a,b){return a.g.filter(function(c){return c.type===b})},eN=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.P){var e=a.ra();
|
|
8
|
+
e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;dN(a,b)},function(f){a.f[b]=null;a.h.debug(GM,f)})}else b===_.P&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){dN(a,b)},function(f){a.h.debug(GM,f)}))},dN=function(a,b){b===_.R?a.a.trigger(new _.J(_.Tj)):b===_.P&&a.a.trigger(new _.J(_.Uj))},iN=function(a,b,c,d){_.ak.call(this);this.h=new _.I(_.Jc);this.ga=a;this.o=new _.$i(b);this.da=c;this.ma=d;this.g=this.J=
|
|
9
|
+
_.gk();this.D=[];this.B=0;this.M=new _.ri;this.H=this.m=this.a=null;this.A=this.w=!1;this.na="";this.Xa=1E6;this.f=new $M;this.f.initialize(this);this.j=new ZM(this);this.I=new _.eg;this.K=null;this.F=new Set;this.T=this.mk.bind(this);this.Ia=this.Gk.bind(this);this.ha=this.xk.bind(this);this.V=this.rk.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(){fN(!0)},0)}});gN(this);hN.add(this)},
|
|
10
|
+
jN=function(a){var b,c;return _.B(function(d){if(1==d.a)return hN["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Ia)),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.da=null;a.ma=null;_.y(d)})},oN=function(a){if(!a)return null;
|
|
11
|
+
a:{var b=a.metadataType;var c=Object.entries(kN);c=_.u(c);for(var d=c.next();!d.done;d=c.next()){d=_.u(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=YM(kN[b]);return Object.assign(b,a)},tN=function(a){var b=void 0===b?XM:b;return Object.values(kN).includes(a)?a:b},yN=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},gN=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
|
|
12
|
+
a.ga.length){a.w=!0;a.o.wf();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.ga;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.T);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Ia);zN&&a.o.aa(.02)}},AN=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},CN=function(a,b){BN(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ha);b.addMessageListener(PM,a.V)},BN=function(a,b){a.a=b;a.a&&(a.I.release(),a.H=null,a.m=null,a.m=new cast.framework.RemotePlayer,a.H=new cast.framework.RemotePlayerController(a.m),a.I.on(a.H,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Ih.bind(a)),a.f&&a.f.load(),a.j&&a.j.init(),a.trigger(new _.J(_.xd)))},DN=function(a){return _.B(function(b){return a.mb()?
|
|
14
|
+
b.G(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},EN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,v,z,A,D,F;return _.B(function(E){switch(E.a){case 1:return c=chrome.cast.media.StreamType,d=_.sq,_.x(E,DN(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);g.streamType=b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.Hb;m=h.audioMimeType;g.hlsVideoSegmentFormat=WM(l,d.VIDEO);
|
|
15
|
+
g.hlsSegmentFormat=WM(m,d.AUDIO);if(!b.Va){E.G(3);break}if(!a.N){E.G(4);break}return _.x(E,Promise.resolve(a.N(b.Va)),5);case 5:if(n=E.f)b.Va=n;case 4:a.g=b.Va;a.D=_.fn(a.g);a.B=a.D.findIndex(function(H){return H.url===b.source.url});if(!b.Va.remoteTextTracks){E.G(6);break}return _.x(E,Promise.all(b.Va.remoteTextTracks.map(a.Si.bind(a))),7);case 7:p=E.f,g.tracks=p.filter(function(H){return H}),b.Va.remoteTextTracks=void 0;case 6:delete b.Va.autoplay,b.Va.startTime=null,g.customData={playerConfiguration:TM(b.Va)};
|
|
16
|
+
case 3:q=a.hb()||{};r=tN(q.metadataType);typeof b.lf===_.k&&(v={metadataType:r,sectionStartAbsoluteTime:b.lf});b.source.name&&(z={metadataType:r,title:b.source.name});A=yN(q);if(D=oN(Object.assign({},v,z,A)))g.metadata=D;F=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.uc&&(F.autoplay=b.autoplay);typeof b.currentTime===_.k&&(F.currentTime=b.currentTime);return _.x(E,f.loadMedia(F),0)}})},FN=function(a,b,c){c=void 0===c?0:c;var d,e;return _.B(function(f){(d=a.f.ra())&&d.language&&(a.g.preferredTextLanguage=
|
|
17
|
+
d.language);(e=a.f.qa())&&e.language&&(a.g.preferredAudioLanguage=e.language);return _.x(f,EN(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),lf:a.getPresentationStartTime(),autoplay:b,Va:a.g}),0)})},fN=function(a){if(a){a=_.u(hN);for(var b=a.next();!b.done;b=a.next())gN(b.value)}},HN=function(a,b,c){_.ak.call(this);var d=this;this.f=a;this.g=b;this.j=typeof c===_.ld?c:function(e,f){d.f&&e!==_.Vm&&e!==_.Om&&d.f.load(f)};this.a=GN(this);this.h=new _.I(MM);this.addDelegate(this.f)},GN=
|
|
18
|
+
function(a){return new iN(a.g,function(){a.trigger(new _.J(_.Ac))},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.If&&(d.preferredAudioLanguage=c.If);c.kh&&(d.preferredTextLanguage=c.kh);_.no(a.f,null);a.trigger(new _.J("castingended"));a.j(b,d)},function(){return IN(a)})},IN=function(a){var b;return _.B(function(c){if(1==c.a)return a.trigger(new _.J(_.zc)),
|
|
19
|
+
b=a.f.a,b!==a.a&&a.f&&a.a?_.x(c,a.f.release(),2):c["return"]();_.no(a.f,a.a);_.y(c)})},JN=function(a){SM.call(this,a,"clpp.cast.StateManager");this.J=this.Mh.bind(this);this.I=this.Lh.bind(this);this.A=this.tk.bind(this);this.w=this.lk.bind(this);this.M=this.Oh.bind(this);this.K=this.Nh.bind(this);this.N=this.Jk.bind(this);this.H=this.wk.bind(this);this.F=this.U.bind(this);this.f=this.Kh.bind(this)},Z=function(a,b,c,d,e){this.a=a;this.f=b;this.j=typeof c===_.k?c:1;this.m=typeof d===_.k?d:1;this.g=
|
|
20
|
+
typeof e===_.k?e:0},KN=function(a){this.a=a},MN=function(a){this.l=a;this.a=null;this.g=this.Ph.bind(this);this.f=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];
|
|
21
|
+
LN().addEventListener(this.f,this.g)},PN=function(a,b,c){var d,e,f,g,h,l,m;return _.B(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.Bf(n,2);NN=!1;e=_.ai(d);return _.x(n,c.fetch(e).P,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.yh(f.data),h=new DOMParser,l=h.parseFromString(g,_.Ee),l.getElementsByTagName("vmap:VMAP").length)_.G("VMAP detected."),a.vmapAdsRequest=ON(g);else if(l.getElementsByTagName("VAST").length){_.G("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");
|
|
22
|
+
p.vastAdsRequest=ON(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.G("Unsupported schema."),NN=!0;return _.Cf(n,0)}m=_.Df(n);_.G("Failed to fetch an ad",m);NN=!0;_.y(n)})},ON=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},LN=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},RN=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;
|
|
23
|
+
(c=QN(a,c))&&(d={ad:c});a.l.trigger(new _.J(b,d))}},SN=function(a,b){var c=new _.L(1,10,10003,{errorType:b});a.l.onError(c)},QN=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.ve&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.ve&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,
|
|
24
|
+
h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new Z(d,e,b.index,b.total,f)}return c},TN=function(a){this.Xb=a;this.a=this.f.bind(this)},UN=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]},VN=function(a){var b=a.dashTimedMetadata,c=_.Le;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Ke)?
|
|
25
|
+
_.og:_.mg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b&&b.eventElement}},WN=function(){this.h=new _.I("clpp.cast.TrackManager");this.l=null;this.o=1E9;this.g=[];this.j=[];this.m=this.Yk.bind(this);this.a=this.f=null},XN=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},ZN=function(a){a.a=XN().getTextTracksManager();var b=a.a.getTracks();a.j=YN(_.P,b)},$N=function(a,b,c,d){c=_.tg(c).filter(function(h){return h});
|
|
26
|
+
var e=!1,f=[];b===_.R?f=a.getAudioTracks():b===_.P&&(f=a.ia());if(c=c.find(function(h){var l=_.ih(h);return f.some(function(m){m=_.ih(m.language||"");return _.jh(l,m)})})){var g=_.ih(c);c=f.filter(function(h){h=_.ih(h.language||"");return _.jh(g,h)});f=c.length?c:f;e=e||!!c.length}_.Hh(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.h.info("Will select track",e),b===_.R?a.ya(e):b===_.P&&a.Ga(e))},YN=function(a,b){for(var c=[],d=_.u(b),e=
|
|
27
|
+
d.next();!e.done;e=d.next()){e=e.value;var f=new _.ui(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 _.Ci(f.id,f));c.push(f)}return c},aO=function(){_.ak.call(this);this.h=new _.I(NM);this.g=this.w=_.gk();this.A=null;this.m=
|
|
28
|
+
-1;this.F=new _.ri;this.f=this.o=this.j=this.a=this.B=null;this.D=!1},bO=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},eO=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=_.xk(d);if(e){var f=[_.Sc];_.fn(a)[0].type!==_.kc&&f.unshift(_.Tc);d.preferredDrmSystem===_.Sc&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Wa[g];
|
|
29
|
+
h?(d=g===_.Tc?cast.framework.ContentProtection.WIDEVINE:g===_.Sc?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},cO(b,h,a,d),dO(b,h,a,d)):c()}else c()}else c()},cO=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.ai({method:"POST",uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];
|
|
30
|
+
e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},dO=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.B(function(h){return 1==h.a?(g=_.bi(Object.assign({},f.headers),e.buffer,200,""),_.x(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.N(g.data))})}:a.licenseHandler=void 0},fO=function(){this.a=!1;this.h=new _.I(OM);this.f=this.l=null;this.g=new Set;this.A=this.vk.bind(this);this.w=this.Jh.bind(this);
|
|
31
|
+
this.j=null;this.o=new _.eg;this.m=null},hO=function(){return gO||(gO=new fO)},iO=function(){return cast.framework.CastReceiverContext.getInstance()},kO=function(a,b){a.h.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=iO();c=(iO().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Te:_.Se;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=
|
|
32
|
+
jO(h,_.na),m=jO(h,_.hb),n=_.u([]),p=n.next().value;n=n.next().value;m&&(m=_.u(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(h);++g}return f.join("\n")},jO=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},lO=function(a){this.f=a;this.a=null;this.g=new _.eg;this.j=
|
|
33
|
+
[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},nO=function(a,b){var c=null,d=mO(a);d&&(c={ad:d});a.f.trigger(new _.J(b,c))},mO=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})||
|
|
34
|
+
null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:b.breaks.filter(function(h){return 0<=h.position}).sort(function(h,l){return h.position-l.position}).findIndex(function(h){return h===c})}b.breakClips&&(d=b.breakClips.find(function(h){return h.id===a.a.breakClipId})||null);b=new Z(d,c,e,f,g)}return b},oO=function(){},pO=function(){};_.t=SM.prototype;_.t.release=function(){this.oa(_.Om)};_.t.destroy=function(){this.m=this.a=null;return Promise.resolve()};_.t.getState=function(){return this.g};
|
|
35
|
+
_.t.onError=function(a){a.severity===_.M&&this.oa(_.Zm)};
|
|
36
|
+
_.t.oa=function(a){if(a!==this.g)if(this.g===_.Zm&&a!==_.Om)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.g;this.g=a;this.g===_.Tm?(this.B=b,this.a.trigger(new _.J(_.wc,{detail:{bufferedTimeMS:-1,reason:this.j}}))):this.o===_.Tm&&this.a.trigger(new _.J(_.vc,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.g,previousState:this.o,timeSinceLastStateChangeMS:b-this.D};this.D=b;this.m&&_.zm(this.m,this.g);this.a.trigger(new _.J(_.re,
|
|
37
|
+
{detail:a}))}};_.C("clpp.cast.CastUtils",function(){});var XM=0,kN={GENERIC:XM,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};_.w(ZM,SM);ZM.prototype.init=function(){var a=this.a,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.m)};ZM.prototype.destroy=function(){var a=this;return _.B(function(b){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);return _.x(b,SM.prototype.destroy.call(a),0)})};ZM.prototype.oa=function(a){var b=this.a.m;b&&b.isPlayingBreak||SM.prototype.oa.call(this,a)};
|
|
38
|
+
ZM.prototype.Eb=function(){if(this.f&&this.w&&!this.w.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.oa(_.Vm);break;case chrome.cast.media.IdleReason.ERROR:this.oa(_.Zm);break;default:this.oa(_.Om)}break;case chrome.cast.media.PlayerState.PLAYING:this.oa(_.bn);break;case chrome.cast.media.PlayerState.PAUSED:this.oa(_.an);break;case chrome.cast.media.PlayerState.BUFFERING:this.oa(_.Tm)}};_.w($M,_.S);_.t=$M.prototype;_.t.initialize=function(a){this.a=a};_.t.release=function(){this.g=[];this.f={}};
|
|
39
|
+
_.t.load=function(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.g=(a=a.tracks)?a.map(function(b){switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.wi;break;case chrome.cast.media.TrackType.AUDIO:c=_.R;break;case chrome.cast.media.TrackType.TEXT:c=_.P}c=new _.ui(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 _.Ci(c.id,c));return c}):[],this.a.trigger(new _.J(_.vq)))};_.t.destroy=function(){this.a=null};_.t.getVideoTracks=function(){return bN(this,_.wi)};_.t.getAudioTracks=function(){return bN(this,_.R)};_.t.ia=function(){return bN(this,_.P)};_.t.fa=function(){var a=this.Pa();return a?a.renditions[0]:null};_.t.La=function(){var a=this.qa();return a?a.renditions[0]:null};_.t.Na=function(){var a=this.ra();return a?a.renditions[0]:null};_.t.Za=function(){return this.f[_.wi]||null};
|
|
41
|
+
_.t.ib=function(){return this.f[_.R]||null};_.t.jb=function(){return this.f[_.P]||null};_.t.Pa=function(){return cN(this,_.wi)};_.t.qa=function(){return cN(this,_.R)};_.t.ra=function(){return cN(this,_.P)};_.t.eb=function(a){eN(this,_.wi,a)};_.t.ya=function(a){eN(this,_.R,a)};_.t.Ga=function(a){eN(this,_.P,a)};_.t.cb=function(a){this.eb(a&&a.track)};_.t.pb=function(a){this.ya(a&&a.track)};_.t.qb=function(a){this.Ga(a&&a.track)};_.t.addTextTrack=function(){return _.B(function(a){_.y(a)})};_.t.ka=function(){return!0};
|
|
42
|
+
$M.prototype.isAbrEnabled=$M.prototype.ka;$M.prototype.addTextTrack=$M.prototype.addTextTrack;$M.prototype.setTextRendition=$M.prototype.qb;$M.prototype.setAudioRendition=$M.prototype.pb;$M.prototype.setVideoRendition=$M.prototype.cb;$M.prototype.setTextTrack=$M.prototype.Ga;$M.prototype.setAudioTrack=$M.prototype.ya;$M.prototype.setVideoTrack=$M.prototype.eb;$M.prototype.getTextTrack=$M.prototype.ra;$M.prototype.getAudioTrack=$M.prototype.qa;$M.prototype.getVideoTrack=$M.prototype.Pa;
|
|
43
|
+
$M.prototype.getLoadingTextRendition=$M.prototype.jb;$M.prototype.getLoadingAudioRendition=$M.prototype.ib;$M.prototype.getLoadingVideoRendition=$M.prototype.Za;$M.prototype.getTextRendition=$M.prototype.Na;$M.prototype.getAudioRendition=$M.prototype.La;$M.prototype.getVideoRendition=$M.prototype.fa;$M.prototype.getTextTracks=$M.prototype.ia;$M.prototype.getAudioTracks=$M.prototype.getAudioTracks;$M.prototype.getVideoTracks=$M.prototype.getVideoTracks;_.w(iN,_.ak);_.t=iN.prototype;_.t.init=function(a,b){this.g=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.destroy=function(){return _.B(function(a){_.y(a)})};_.t.xd=function(a){this.N=a};_.t.gc=function(){return this.w};_.t.mb=function(){return this.A};_.t.Le=function(){return this.na};
|
|
44
|
+
_.t.sendMessage=function(a,b){var c=this,d,e,f;return _.B(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.L(1,8,8004,void 0);g.G(2);break}_.Bf(g,3);return _.x(g,e.sendMessage(a,TM(b)),5);case 5:_.Cf(g,2);break;case 3:f=_.Df(g),d=new _.L(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.y(g)}})};
|
|
45
|
+
_.t.cast=function(){var a=this,b,c;return _.B(function(d){if(1==d.a){if(!a.gc())throw a.h.warn(KM),new _.L(1,8,8001,void 0);if(!zN)throw a.h.warn(IM),new _.L(1,8,8002,void 0);if(a.mb())throw a.h.warn("Already casting"),new _.L(1,8,8003,void 0);_.Bf(d,2);return _.x(d,DN(a),4)}if(2!=d.a)return _.Cf(d,0);b=_.Df(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.L(1,8,8E3,c);})};
|
|
46
|
+
_.t.Ge=function(){this.mb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.t.addMessageListener=function(a){typeof a===_.ld&&this.F.add(a)};_.t.removeMessageListener=function(a){typeof a===_.ld&&this.F["delete"](a)};_.t.play=function(){var a=this;return this.isEnded()?FN(this,!0):new Promise(function(b,c){if(!a.a)return c(HM);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(HM);a.a.pause(null,b,c)})};
|
|
47
|
+
_.t.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};_.t.isEnded=function(){return this.getState()===_.Vm};_.t.seek=function(a){var b=this;return this.isEnded()?FN(this,!1,a):new Promise(function(c,d){b.a||d(HM);b.m.isPlayingBreak&&d(FM);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.J(_.Ne));b.a.seek(e,function(){b.trigger(new _.J(_.Me));c()},d)})};_.t.getPosition=function(){return this.a&&this.a.getEstimatedTime()||0};
|
|
48
|
+
_.t.getDuration=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(QM,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
|
|
48
49
|
_.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))};
|
|
49
|
-
_.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():_.
|
|
50
|
-
_.t.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?
|
|
51
|
-
_.t.getBufferInfo=function(){return new _.
|
|
52
|
-
_.t.getTimelineCues=function(){return[]};_.t.resetAbr=function(){this.h.warn(
|
|
53
|
-
_.t.
|
|
54
|
-
_.t.
|
|
55
|
-
_.t.
|
|
56
|
-
isLive:this.isLive()},currentTime:
|
|
57
|
-
_.t.
|
|
58
|
-
|
|
59
|
-
_.t.cast=function(a){var b=this,c,d,e;return _.B(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.
|
|
60
|
-
(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.
|
|
61
|
-
b.h.error("Error while trying to cast",d),e=new _.J(_.
|
|
62
|
-
_.t.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.h.warn(
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
_.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():_.Pm};
|
|
51
|
+
_.t.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stats?UM(this.a.customData.stats):_.Fm()};_.t.isLive=function(){return Infinity===this.getDuration()};_.t.load=function(a){var b=this,c,d;return _.B(function(e){if(!b.gc())return b.h.warn(KM),e["return"]();if(!zN)return b.h.warn(IM),e["return"]();b.D=_.fn(a);_.jk(a)&&(b.g=_.ik(b.J,a));c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.g.autoplay,Va:b.g,Hb:c.Hb,audioMimeType:c.audioMimeType};return _.x(e,EN(b,d),0)})};
|
|
52
|
+
_.t.getBufferInfo=function(){return new _.Zj};_.t.getTrackManager=function(){return this.f};_.t.getConfiguration=function(){return this.g};_.t.getSurface=function(){return null};_.t.setNetworkEngine=function(a){this.M=a};_.t.getNetworkEngine=function(){return this.M};_.t.getSourceIndex=function(){return this.B};_.t.setSourceIndex=function(a){this.B=a};_.t.getLoadedSource=function(){return this.D[this.B]};_.t.getPeriods=function(){return[]};_.t.getDrmInfo=function(){return null};
|
|
53
|
+
_.t.getTimelineCues=function(){return[]};_.t.resetAbr=function(){this.h.warn(JM)};_.t.onError=function(a){if(a&&(this.trigger(new _.J(_.jd,{detail:a})),this.j))this.j.onError(a)};_.t.namespace=function(){return _.Jc};_.t.canPlay=function(){return this.gc()?2:0};_.t.hb=function(){return this.K};_.t.mc=function(a){this.K=oN(a)};_.t.ye=function(){this.K=null};_.t.rf=function(a){var b=this.hb()||{};a={metadataType:tN(b.metadataType),title:a};this.mc(Object.assign({},b,a))};
|
|
54
|
+
_.t.pf=function(a){var b=this.hb()||{},c=tN(b.metadataType);a=new chrome.cast.Image(a);this.mc(Object.assign({},b,{metadataType:c,images:[a]}))};_.t.nf=function(a){var b=this.hb()||{};this.mc(Object.assign({},b,{metadataType:3,artist:a}))};_.t.qf=function(a){var b=this.hb()||{};a={metadataType:tN(b.metadataType),releaseDate:a};this.mc(Object.assign({},b,a))};
|
|
55
|
+
_.t.mk=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;zN=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.na=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.wf()};
|
|
56
|
+
_.t.Gk=function(a){this.h.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;CN(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.mb()||(this.A=!0,CN(this,a.session),this.ma());break;case cast.framework.SessionState.SESSION_ENDED:if(this.mb()&&this.a){var b=this.a.media,c=this.f.qa(),d=this.f.ra();c=c&&c.language||void 0;d=d&&d.language||void 0;this.da(this.getState(),{source:{url:b.contentId,type:b.contentType,
|
|
57
|
+
isLive:this.isLive()},currentTime:AN(this),kh:d,If:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ha);a.session.removeMessageListener(PM,this.V);this.A=!1;this.a=null;this.I.release();this.m=this.H=null}};_.t.xk=function(a){this.h.debug("New media session",a.mediaSession);BN(this,a.mediaSession)};_.t.rk=function(a,b){if(a===PM&&0<this.F.size){var c=UM(b);this.F.forEach(function(d){return d(c)})}};_.t.Ih=function(){this.trigger(new _.J(_.Fe))};
|
|
58
|
+
_.t.Si=function(a){var b=this,c,d;return _.B(function(e){if(1==e.a)return c=null,_.x(e,VM(a,[_.De,_.jc],b.M,b.g),2);if(d=e.f)c=new chrome.cast.media.Track(b.Xa++,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};iN.prototype.getTextDisplayer=iN.prototype.getTextDisplayer;iN.prototype.getNetworkEngine=iN.prototype.getNetworkEngine;
|
|
59
|
+
iN.prototype.setNetworkEngine=iN.prototype.setNetworkEngine;var zN=!1,hN=new Set;window.__onGCastApiAvailable=fN;_.w(HN,_.ak);_.t=HN.prototype;_.t.destroy=function(){var a=this;return _.B(function(b){if(1==b.a)return a.a?_.x(b,jN(a.a),3):b.G(2);2!=b.a&&(a.a=null);a.removeDelegate(a.f);_.y(b)})};_.t.ve=function(){return!!this.a&&this.a.gc()&&zN};_.t.mb=function(){return!!this.a&&this.a.mb()};_.t.Le=function(){return this.a?this.a.Le():""};_.t.xd=function(a){this.a&&this.a.xd(a)};
|
|
60
|
+
_.t.cast=function(a){var b=this,c,d,e;return _.B(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.Bf(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.qa();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.ra())l.language&&
|
|
61
|
+
(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.uc?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),lf:b.f.getPresentationStartTime(),Hb:m,audioMimeType:p,Va:g}}c=g;return _.x(f,IN(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.G(7);break}return _.x(f,EN(b.a,c),7);case 7:_.Cf(f,0);break;case 2:d=_.Df(f),
|
|
62
|
+
b.h.error("Error while trying to cast",d),e=new _.J(_.jd,{detail:d}),b.trigger(e),_.y(f)}})};_.t.Ge=function(){this.a&&this.a.Ge()};_.t.Eh=function(a){var b=this;return _.B(function(c){if(1==c.a){if(a===b.g)return c["return"]();b.g=a;return b.a?_.x(c,jN(b.a),2):c.G(2)}b.a=GN(b);_.y(c)})};_.t.sendMessage=function(a){var b=this;return _.B(function(c){return b.a?_.x(c,b.a.sendMessage(PM,a),0):(b.h.warn(LM),c["return"]())})};_.t.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.h.warn(LM)};
|
|
63
|
+
_.t.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.h.warn(LM)};_.t.hb=function(){return this.a&&this.a.hb()};_.t.mc=function(a){this.a&&this.a.mc(a)};_.t.ye=function(){this.a&&this.a.ye()};_.t.rf=function(a){this.a&&this.a.rf(a)};_.t.pf=function(a){this.a&&this.a.pf(a)};_.t.nf=function(a){this.a&&this.a.nf(a)};_.t.qf=function(a){this.a&&this.a.qf(a)};_.C(MM,HN);HN.prototype.setContentReleaseDate=HN.prototype.qf;HN.prototype.setContentArtist=HN.prototype.nf;
|
|
64
|
+
HN.prototype.setContentImage=HN.prototype.pf;HN.prototype.setContentTitle=HN.prototype.rf;HN.prototype.clearContentMetadata=HN.prototype.ye;HN.prototype.setContentMetadata=HN.prototype.mc;HN.prototype.getContentMetadata=HN.prototype.hb;HN.prototype.removeMessageListener=HN.prototype.removeMessageListener;HN.prototype.addMessageListener=HN.prototype.addMessageListener;HN.prototype.sendMessage=HN.prototype.sendMessage;HN.prototype.changeReceiverId=HN.prototype.Eh;HN.prototype.forceDisconnect=HN.prototype.Ge;
|
|
65
|
+
HN.prototype.cast=HN.prototype.cast;HN.prototype.setPlayerConfigInterceptor=HN.prototype.xd;HN.prototype.getReceiverName=HN.prototype.Le;HN.prototype.isCasting=HN.prototype.mb;HN.prototype.canCast=HN.prototype.ve;HN.prototype.destroy=HN.prototype.destroy;_.w(JN,SM);_.t=JN.prototype;
|
|
65
66
|
_.t.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.J);b.addEventListener(a.PAUSE,this.I);b.addEventListener(a.MEDIA_FINISHED,this.A);b.addEventListener(a.BUFFERING,this.w);b.addEventListener(a.SEEKING,this.M);b.addEventListener(a.SEEKED,this.K);b.addEventListener(a.STALLED,this.N);b.addEventListener(a.PLAYER_LOADING,this.H);b.addEventListener(a.ERROR,this.F);b.addEventListener(a.BITRATE_CHANGED,this.f)};
|
|
66
67
|
_.t.destroy=function(){var a=this,b,c;return _.B(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.J);c.removeEventListener(b.PAUSE,a.I);c.removeEventListener(b.MEDIA_FINISHED,a.A);c.removeEventListener(b.BUFFERING,a.w);c.removeEventListener(b.SEEKING,a.M);c.removeEventListener(b.SEEKED,a.K);c.removeEventListener(b.STALLED,a.N);c.removeEventListener(b.PLAYER_LOADING,a.H);c.removeEventListener(b.ERROR,
|
|
67
|
-
a.F);c.removeEventListener(b.BITRATE_CHANGED,a.f);return _.x(d,
|
|
68
|
-
_.t.
|
|
68
|
+
a.F);c.removeEventListener(b.BITRATE_CHANGED,a.f);return _.x(d,SM.prototype.destroy.call(a),0)})};_.t.Mh=function(){this.a.trigger(new _.J(_.Zd));this.oa(_.bn)};_.t.Lh=function(){this.oa(_.an)};_.t.tk=function(){this.oa(_.Vm)};_.t.lk=function(a){a.isBuffering?this.oa(_.Tm):(a=this.a.isPaused()?_.an:_.bn,this.oa(a))};_.t.Oh=function(){this.j=1;this.a.trigger(new _.J(_.Ne))};_.t.Nh=function(){this.a.trigger(new _.J(_.Me))};_.t.Jk=function(){this.j=2};_.t.wk=function(){this.oa(_.$m)};
|
|
69
|
+
_.t.Kh=function(a){var b=this.a.getStats();this.a.trigger(new _.J(_.tc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.t.U=function(a){a=new _.L(_.M,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.a.trigger(new _.J(_.jd,{detail:a}));this.oa(_.Zm)};_.t=Z.prototype;_.t.vb=function(){return"Google Cast Framework"};_.t.wb=function(){return cast.framework.VERSION};_.t.Bb=function(){return 0};_.t.getId=function(){return""};_.t.getCreativeId=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};
|
|
69
70
|
_.t.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.t.ic=function(){return!1};_.t.Nb=function(){return this.a.clickThroughUrl||null};_.t.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.t.yb=function(){return 0};_.t.xb=function(){return 0};_.t.kb=function(){return 0};_.t.$a=function(){switch(this.Ob()){case 0:return 0;case -1:return 2;default:return 1}};_.t.getPodIndex=function(){return this.g};_.t.Ob=function(){return this.f.position};_.t.Pb=function(){return this.j};
|
|
70
71
|
_.t.Ab=function(){return this.m};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};_.t.getWrapperCreativeIds=function(){return[]};Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.Ab;Z.prototype.getPositionInSequence=Z.prototype.Pb;Z.prototype.getPodTimeOffset=Z.prototype.Ob;
|
|
71
72
|
Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.$a;Z.prototype.getMediaBitrate=Z.prototype.kb;Z.prototype.getMediaHeight=Z.prototype.xb;Z.prototype.getMediaWidth=Z.prototype.yb;Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.Nb;Z.prototype.isBumper=Z.prototype.ic;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;
|
|
72
|
-
Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.Bb;Z.prototype.getAdManagerVersion=Z.prototype.wb;Z.prototype.getAdManagerName=Z.prototype.vb;
|
|
73
|
-
_.t.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.t.dispose=function(){var a=this;return _.B(function(b){
|
|
74
|
-
_.t.
|
|
75
|
-
_.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_.t.
|
|
79
|
-
_.t.
|
|
73
|
+
Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.Bb;Z.prototype.getAdManagerVersion=Z.prototype.wb;Z.prototype.getAdManagerName=Z.prototype.vb;KN.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};KN.prototype.Qb=function(){return!!this.a.find(function(a){return 0===a.position})};KN.prototype.lb=function(){return!!this.a.find(function(a){return-1===a.position})};KN.prototype.hasPostroll=KN.prototype.lb;KN.prototype.hasPreroll=KN.prototype.Qb;KN.prototype.getCuePoints=KN.prototype.getCuePoints;_.t=MN.prototype;_.t.load=function(){var a=this;return _.B(function(b){NN&&(NN=!1,SN(a,0));_.y(b)})};_.t.start=function(){return _.B(function(a){LN().play();_.y(a)})};_.t.resume=function(){-1!==this.getPosition()&&LN().play()};_.t.pause=function(){-1!==this.getPosition()&&LN().pause()};_.t.skip=function(){};_.t.getVolume=function(){return this.l.getVolume()||0};_.t.setVolume=function(a){this.l.setVolume(a)};
|
|
74
|
+
_.t.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.t.dispose=function(){var a=this;return _.B(function(b){LN().removeEventListener(a.f,a.g);_.y(b)})};
|
|
75
|
+
_.t.Ph=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=LN().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.l.trigger(new _.J(_.Zb,{adsTimeline:new KN(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:RN(this,_.Ob,a);break;case cast.framework.events.EventType.BREAK_STARTED:RN(this,_.Fb,a);break;case cast.framework.events.EventType.BREAK_ENDED:RN(this,_.Hb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:RN(this,
|
|
76
|
+
_.Vb,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(RN(this,_.Ub,a),RN(this,_.Wb,a)):a.endedReason===b.STOPPED?RN(this,_.Wb,a):a.endedReason===b.END_OF_STREAM?(RN(this,_.Kb,a),RN(this,_.Wb,a)):a.endedReason===b.ERROR&&SN(this,1);break;case cast.framework.events.EventType.PLAYING:RN(this,_.Tb,a);break;case cast.framework.events.EventType.PAUSE:RN(this,_.Qb,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?RN(this,_.Ib,a):RN(this,_.Tb,a)}};
|
|
77
|
+
MN.prototype.getPosition=MN.prototype.getPosition;MN.prototype.setVolume=MN.prototype.setVolume;MN.prototype.getVolume=MN.prototype.getVolume;MN.prototype.skip=MN.prototype.skip;MN.prototype.pause=MN.prototype.pause;MN.prototype.resume=MN.prototype.resume;var NN=!1;TN.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(UN(),this.a)};TN.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(UN(),this.a)};TN.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return VN(a)})};
|
|
78
|
+
TN.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=_.pg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.rg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.sg}b&&this.Xb(new _.J(b,{detail:VN(a.timedMetadataInfo)}))}else for(a=_.u(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.Xb(new _.J(_.pg,{detail:b.value}))};_.w(WN,_.S);_.t=WN.prototype;_.t.initialize=function(a){this.l=a;XN().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.t.release=function(){this.g=[];this.j=[];this.a=this.f=null};_.t.load=function(){};_.t.destroy=function(){this.l=null;XN().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.m)};_.t.getVideoTracks=function(){return[]};_.t.getAudioTracks=function(){return this.g};_.t.ia=function(){return this.j};_.t.fa=function(){return null};
|
|
79
|
+
_.t.La=function(){var a=this.qa();return a&&a.renditions[0]};_.t.Na=function(){var a=this.ra();return a&&a.renditions[0]};_.t.Za=function(){return null};_.t.ib=function(){return null};_.t.jb=function(){return null};_.t.Pa=function(){return null};_.t.qa=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.k&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
|
|
80
|
+
_.t.ra=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ia().find(function(c){return c.id===b})||null)}return a};_.t.eb=function(){this.h.warn("Video tracks unavailable on Cast")};_.t.ya=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.t.Ga=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.t.cb=function(){this.h.warn("Video renditions unavailable on Cast")};_.t.pb=function(a){this.ya(a&&a.track)};
|
|
80
81
|
_.t.qb=function(a){this.Ga(a&&a.track)};
|
|
81
|
-
_.t.addTextTrack=function(a){var b=this,c,d,e;return _.B(function(f){if(1==f.a)return c=b.l.getConfiguration(),_.x(f,
|
|
82
|
-
a),g;}}_.y(f)})};_.t.ka=function(){return!0};_.t.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
_.t.unload=function(){var a=cast.framework.messages.PlayerState,b=
|
|
86
|
-
_.t.play=function(){var a=
|
|
87
|
-
_.t.isEnded=function(){return
|
|
88
|
-
_.t.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;
|
|
89
|
-
_.t.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.t.getLoadedSource=function(){var a=
|
|
90
|
-
_.t.getPresentationStartTime=function(){return
|
|
91
|
-
_.t.getStats=function(){var a=_.
|
|
92
|
-
_.t.load=function(a){var b=this,c,d;return _.B(function(e){b.f=new _.
|
|
93
|
-
_.t.getTrackManager=function(){return this.j};_.t.getConfiguration=function(){return this.g};_.t.getSurface=function(){return this.B};_.t.setNetworkEngine=function(a){this.F=a};_.t.getNetworkEngine=function(){return this.F};_.t.getSourceIndex=function(){return this.m};_.t.setSourceIndex=function(a){this.m=a};_.t.getPeriods=function(){return[]};_.t.namespace=function(){return
|
|
94
|
-
_.t.onError=function(a){this.trigger(new _.J(_.
|
|
95
|
-
_.t.
|
|
96
|
-
(!e||e&&f)){d=
|
|
97
|
-
_.t.getTextDisplayer=function(){return null};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};
|
|
98
|
-
_.t.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=
|
|
99
|
-
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.
|
|
100
|
-
_.t.stop=function(){if(this.a){this.a=!1;this.o.release();var a=
|
|
101
|
-
_.t.removeMessageListener=function(a){typeof a===_.
|
|
102
|
-
_.t.
|
|
103
|
-
h.length-1;0<=l;--l){var m=h[l].getAttribute(_.
|
|
104
|
-
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.
|
|
105
|
-
_.t.
|
|
106
|
-
break}b.f.D=!0;return _.x(l,_.
|
|
107
|
-
break}return _.x(l,Promise.resolve(b.m(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.t.
|
|
108
|
-
_.t.
|
|
109
|
-
|
|
110
|
-
_.t.skip=function(){var a=this.f.a;a&&this.f.sendMessage(
|
|
111
|
-
_.t.
|
|
112
|
-
|
|
82
|
+
_.t.addTextTrack=function(a){var b=this,c,d,e;return _.B(function(f){if(1==f.a)return c=b.l.getConfiguration(),_.x(f,VM(a,Object.values(cast.framework.messages.CaptionMimeType),b.l.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]),ZN(b)}catch(g){throw b.h.warn("failed on track",
|
|
83
|
+
a),g;}}_.y(f)})};_.t.ka=function(){return!0};_.t.Yk=function(){this.f=XN().getAudioTracksManager();var a=this.f.getTracks();this.g=YN(_.R,a);ZN(this);a=this.l.getConfiguration();$N(this,_.R,a.preferredAudioLanguage,a.preferredAudioRole);$N(this,_.P,a.preferredTextLanguage,a.preferredTextRole)};WN.prototype.isAbrEnabled=WN.prototype.ka;WN.prototype.addTextTrack=WN.prototype.addTextTrack;WN.prototype.setTextRendition=WN.prototype.qb;WN.prototype.setAudioRendition=WN.prototype.pb;
|
|
84
|
+
WN.prototype.setVideoRendition=WN.prototype.cb;WN.prototype.setTextTrack=WN.prototype.Ga;WN.prototype.setAudioTrack=WN.prototype.ya;WN.prototype.setVideoTrack=WN.prototype.eb;WN.prototype.getTextTrack=WN.prototype.ra;WN.prototype.getAudioTrack=WN.prototype.qa;WN.prototype.getVideoTrack=WN.prototype.Pa;WN.prototype.getLoadingTextRendition=WN.prototype.jb;WN.prototype.getLoadingAudioRendition=WN.prototype.ib;WN.prototype.getLoadingVideoRendition=WN.prototype.Za;WN.prototype.getTextRendition=WN.prototype.Na;
|
|
85
|
+
WN.prototype.getAudioRendition=WN.prototype.La;WN.prototype.getVideoRendition=WN.prototype.fa;WN.prototype.getTextTracks=WN.prototype.ia;WN.prototype.getAudioTracks=WN.prototype.getAudioTracks;WN.prototype.getVideoTracks=WN.prototype.getVideoTracks;_.w(aO,_.ak);_.t=aO.prototype;_.t.init=function(a,b){var c=this;this.B=a;b&&(this.g=this.w=b);var d=bO();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.yk.bind(this));d.setMediaPlaybackInfoHandler(this.uh.bind(this));this.a=new JN(this);this.a.init();this.j=new WN;this.j.initialize(this);this.o=new TN(function(e){return c.trigger(e)});this.o.init()};
|
|
86
|
+
_.t.unload=function(){var a=cast.framework.messages.PlayerState,b=bO();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 _.B(function(b){if(1==b.a)return a.B=null,a.w=_.gk(),a.g=a.w,a.m=-1,a.A=null,a.a?_.x(b,a.a.destroy(),3):b.G(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.y(b)})};
|
|
87
|
+
_.t.play=function(){var a=bO();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.t.pause=function(){var a=bO();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.t.isPaused=function(){return bO().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
|
|
88
|
+
_.t.isEnded=function(){return bO().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.t.seek=function(a){var b=bO();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(FM);b.seek(a);return Promise.resolve()};_.t.getPosition=function(){return bO().getCurrentTimeSec()};_.t.getDuration=function(){var a=bO().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.t.getPlaybackRate=function(){return bO().getPlaybackRate()};
|
|
89
|
+
_.t.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;bO().sendLocalMediaRequest(b)}};_.t.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};_.t.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.t.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};
|
|
90
|
+
_.t.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};_.t.getLoadedSource=function(){var a=bO().getMediaInformation();if(a){var b=bO().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.m?this.A[this.m]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,Xl:b,name:c}}return null};_.t.getDrmInfo=function(){return null};
|
|
91
|
+
_.t.getPresentationStartTime=function(){return bO().getStartAbsoluteTime()};_.t.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=bO().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():_.Pm};
|
|
92
|
+
_.t.getStats=function(){var a=_.Fm();if(this.f){a=bO().getStats();this.f.f=a.estimatedBandwidth||NaN;this.f.o=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.w=a.width||NaN;b.g=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.m=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.j=c;a=this.f.getStats()}return a};_.t.isLive=function(){return Infinity===this.getDuration()};
|
|
93
|
+
_.t.load=function(a){var b=this,c,d;return _.B(function(e){b.f=new _.Em;b.a.m=b.f.a;b.A=_.fn(a);_.jk(a)&&(b.g=_.ik(b.w,a));if(b.D)return b.D=!1,e["return"]();c=b.A[b.m];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.g.autoplay;typeof b.g.startTime===_.k&&(d.currentTime=b.g.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:TM(b.g),local:!0};return _.x(e,bO().load(d),0)})};_.t.getBufferInfo=function(){this.h.warn(_.pa);return new _.Zj};
|
|
94
|
+
_.t.getTrackManager=function(){return this.j};_.t.getConfiguration=function(){return this.g};_.t.getSurface=function(){return this.B};_.t.setNetworkEngine=function(a){this.F=a};_.t.getNetworkEngine=function(){return this.F};_.t.getSourceIndex=function(){return this.m};_.t.setSourceIndex=function(a){this.m=a};_.t.getPeriods=function(){return[]};_.t.namespace=function(){return NM};_.t.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.t.resetAbr=function(){this.h.warn(JM)};
|
|
95
|
+
_.t.onError=function(a){this.trigger(new _.J(_.jd,{detail:a}))};_.t.canPlay=function(){return _.fj()?2:0};
|
|
96
|
+
_.t.yk=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=TM(this.getStats());var b=bO(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.k&&c.startAbsoluteTime!==b&&(this.h.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&&
|
|
97
|
+
(!e||e&&f)){d=bO().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};_.t.uh=function(a,b){var c=null;a.media.customData&&(c=UM(a.media.customData.playerConfiguration));var d=c?c.abr:null;d&&typeof d.defaultBandwidthEstimate===_.k?b.initialBandwidth=d.defaultBandwidthEstimate:b.initialBandwidth=void 0;eO(c,b);return b};
|
|
98
|
+
_.t.getTextDisplayer=function(){return null};_.t.setDrmCustomDataModifier=function(){};_.t.setCdnErrorCallback=function(){};_.t.detach=function(){};aO.prototype.getTextDisplayer=aO.prototype.getTextDisplayer;aO.prototype.getNetworkEngine=aO.prototype.getNetworkEngine;aO.prototype.setNetworkEngine=aO.prototype.setNetworkEngine;_.t=fO.prototype;_.t.init=function(a){var b=this;a&&(this.f=new aO,_.no(a,this.f),this.l=a,this.o.on(window,"unload",function(){return _.B(function(c){return b.l&&b.l.getState()!==_.Om?_.x(c,RM(b.l),0):c.G(0)})}))};
|
|
99
|
+
_.t.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=iO(),b=iO().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[PM]=cast.framework.system.MessageType.JSON;c.shakaVersion="4.3.4";var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Rj.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.l&&this.l.getSurface().getMedia())c.mediaElement=
|
|
100
|
+
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Qj.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(PM,this.w)}};
|
|
101
|
+
_.t.stop=function(){if(this.a){this.a=!1;this.o.release();var a=iO();iO().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(PM,this.w);a.stop();this.l=this.f=null}};_.t.xd=function(a){this.j=a};_.t.kl=function(a){this.m=a};_.t.on=function(a,b){iO().addEventListener(a,b)};_.t.off=function(a,b){iO().removeEventListener(a,b)};_.t.addMessageListener=function(a){typeof a===_.ld&&this.g.add(a)};
|
|
102
|
+
_.t.removeMessageListener=function(a){typeof a===_.ld&&this.g["delete"](a)};_.t.sendMessage=function(a,b){iO().sendCustomMessage(PM,b,TM(a))};_.t.gc=function(){return this.a};_.t.hb=function(){var a=iO().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null};
|
|
103
|
+
_.t.Rj=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return kO(this,a);try{var b=(new DOMParser).parseFromString(a,_.Ee)}catch(r){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.h.debug("Detected DASH, parsing");b=iO();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.fa),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.Re||g===_.mc){g=e[f].getAttribute(_.Dd);for(var h=e[f].getElementsByTagName(_.jb),l=
|
|
104
|
+
h.length-1;0<=l;--l){var m=h[l].getAttribute(_.Dd)||g,n=h[l].getAttribute(_.Oc),p=h[l].getAttribute(_.ff)||void 0,q=h[l].getAttribute(_.md)||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(_.jb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.fa).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.rb)[0]){a=c;this.h.debug("Detected Smooth, parsing");b=iO();c=a.getElementsByTagName("StreamIndex");
|
|
105
|
+
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Re){e=c[d].getElementsByTagName(_.gb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Va)||void 0,h=e[f].getAttribute(_.Ua)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Te,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.gb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
106
|
+
_.t.Qj=function(a){var b=this,c,d,e,f,g,h;return _.B(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=UM(c.media.customData.playerConfiguration));if(!b.l||!d){l.G(2);break}if(!b.j){l.G(3);break}return _.x(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.G(5);break}return _.x(l,PN(c.media,d.ima,b.l.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.G(7);
|
|
107
|
+
break}b.f.D=!0;return _.x(l,_.ro(b.l,d),8);case 8:return _.x(l,_.so(b.l),9);case 9:f=b.l.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.Hb&&(c.media.hlsVideoSegmentFormat=WM(f.Hb,_.wi)),f.audioMimeType&&(c.media.hlsSegmentFormat=WM(f.audioMimeType,_.R));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.l.getConfiguration().autoplay);case 2:if(!b.m){l.G(10);
|
|
108
|
+
break}return _.x(l,Promise.resolve(b.m(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.t.vk=function(a){if(this.l&&(!a.media.customData||!a.media.customData.local)){a=_.K.Ij;var b=iO().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.l.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.l.seek(b))}_.uo(this.l)}};
|
|
109
|
+
_.t.Jh=function(a){if(0<this.g.size){var b=UM(a.data);this.g.forEach(function(c){return c(b)})}};_.C(OM,fO);fO.prototype.getContentMetadata=fO.prototype.hb;fO.prototype.isApiReady=fO.prototype.gc;fO.prototype.sendMessage=fO.prototype.sendMessage;fO.prototype.removeMessageListener=fO.prototype.removeMessageListener;fO.prototype.addMessageListener=fO.prototype.addMessageListener;fO.prototype.off=fO.prototype.off;fO.prototype.on=fO.prototype.on;fO.prototype.setLoadRequestDataInterceptor=fO.prototype.kl;
|
|
110
|
+
fO.prototype.setPlayerConfigInterceptor=fO.prototype.xd;fO.prototype.stop=fO.prototype.stop;fO.prototype.start=fO.prototype.start;fO.prototype.init=fO.prototype.init;fO.getInstance=hO;var gO=null;_.t=lO.prototype;_.t.load=function(){var a=this,b,c,d,e,f;return _.B(function(g){a.a=a.f.m;if(a.a)for(b=a.a.controller,c=a.Lk.bind(a),d=_.u(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.g.on(b,f,c);_.y(g)})};_.t.start=function(){return _.B(function(a){_.y(a)})};_.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()};
|
|
111
|
+
_.t.skip=function(){var a=this.f.a;a&&this.f.sendMessage(QM,{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.dispose=function(){var a=this;return _.B(function(b){a.g.release();_.y(b)})};
|
|
112
|
+
_.t.Lk=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.J(_.Zb,{adsTimeline:new KN(a.breaks)})));break;case "isPlayingBreak":a.value?nO(this,_.Fb):(nO(this,_.Kb),nO(this,_.Wb),nO(this,_.Hb));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(nO(this,_.Kb),nO(this,_.Wb)),nO(this,_.Vb));break;case "isPaused":this.a.isPlayingBreak&&(a.value?nO(this,_.Qb):nO(this,_.Tb))}};lO.prototype.getPosition=lO.prototype.getPosition;
|
|
113
|
+
lO.prototype.setVolume=lO.prototype.setVolume;lO.prototype.getVolume=lO.prototype.getVolume;lO.prototype.skip=lO.prototype.skip;lO.prototype.pause=lO.prototype.pause;lO.prototype.resume=lO.prototype.resume;oO.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};oO.prototype.ba=function(a,b){return a.namespace()!==_.Jc?!1:!(!b||!b.ima)};oO.prototype.create=function(a){return new lO(a.a)};oO.prototype.create=oO.prototype.create;oO.prototype.isSupported=oO.prototype.ba;oO.prototype.name=oO.prototype.name;_.vn(new oO);pO.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};pO.prototype.ba=function(a,b){return hO().gc()?!(!b||!b.ima):!1};pO.prototype.create=function(a){return new MN(a)};pO.prototype.create=pO.prototype.create;pO.prototype.isSupported=pO.prototype.ba;pO.prototype.name=pO.prototype.name;_.vn(new pO);};
|
|
113
114
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
114
115
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
115
116
|
else{_=this.clpp._;(f.call(g,this));}
|