@castlabs/prestoplay 6.34.0 → 6.35.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +125 -125
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +579 -577
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +100 -100
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +76 -76
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +25 -25
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +345 -345
- package/cjs/cl.muxdata.js +13 -13
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +70 -70
- package/cjs/cl.thumbnails.js +25 -25
- package/cjs/cl.tizen.js +67 -67
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +8 -8
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +3 -3
- package/cjs/cl.youbora.js +38 -38
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +97 -97
- package/cl.conviva.js +28 -27
- package/cl.core.js +463 -462
- package/cl.crypto.js +8 -8
- package/cl.dash.js +89 -89
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +299 -299
- package/cl.muxdata.js +11 -11
- package/cl.onboard.js +5 -5
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +55 -55
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +1 -1
package/cjs/cl.cast.js
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b.a?_.x(b,a.hd(_.Ze),2):_.x(b,a.hd(_.Ye),0)})},
|
|
4
|
-
|
|
5
|
-
mimeType:g});return q["return"](e)})}
|
|
6
|
-
case "audio/mpeg":return c.MP3;case _.
|
|
7
|
-
default:return new d}},
|
|
8
|
-
function(a,b){var c=
|
|
9
|
-
function(){
|
|
10
|
-
this.Fa=this.
|
|
11
|
-
a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Fa)),c=[],a.h&&(c.push(a.h.destroy()),a.h=null),a.l&&(c.push(a.l.destroy()),a.l=null),_.x(d,Promise.all(c),2);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.W=null;a.na=null;_.z(d)})},
|
|
12
|
-
a)},
|
|
13
|
-
a.
|
|
14
|
-
_.h?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},
|
|
15
|
-
c=chrome.cast.media.StreamType;d=_.
|
|
16
|
-
a.D=_.
|
|
17
|
-
title:b.source.name});A=
|
|
18
|
-
b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.h.
|
|
19
|
-
this.f=a;this.h=b;this.j=this.
|
|
20
|
-
null);a.trigger(new _.R("castingended"));a.j(b,d)},function(){return
|
|
21
|
-
this.K=this.Sk.bind(this);this.J=this.Rk.bind(this);this.L=this.
|
|
22
|
-
e=d.a.
|
|
23
|
-
off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.
|
|
24
|
-
this.a.addMessageListener(this.f)}
|
|
25
|
-
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];this.f=!1;
|
|
26
|
-
f.data)if(g=_.S.ga(f.data),k=new DOMParser,l=k.parseFromString(g,_.og),l.getElementsByTagName("vmap:VMAP").length)
|
|
27
|
-
_.z(n)})},
|
|
28
|
-
null,e=null,f;typeof b.breakClipId===_.hg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.hg&&(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,k){return g.position-k.position}).findIndex(function(g){return g===e})));c=new
|
|
29
|
-
cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},
|
|
30
|
-
this.
|
|
31
|
-
"");return _.
|
|
32
|
-
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 _.
|
|
33
|
-
a,{shakaConfig:c})},
|
|
34
|
-
b.licenseUrl=k.licenseUrl,d={ldlDelay:0,customData:{}},
|
|
35
|
-
b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(k){return 1==k.a?(g=_
|
|
36
|
-
|
|
37
|
-
{}).hlsVideoSegmentFormat===c.FMP4?_.Og:_.Mg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var k=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=
|
|
38
|
-
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},
|
|
39
|
-
a.h.M,2);a.a=a.h.o;a.j.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,a.
|
|
40
|
-
a=0;l&&(a=0>=l.position?l.position:b.filter(function(m){return 0<=m.position}).sort(function(m,n){return m.position-n.position}).findIndex(function(m){return m===l}));b=c.find(function(m){return m.id===k})||null;return new
|
|
41
|
-
|
|
42
|
-
_.r.
|
|
43
|
-
{detail:a}))}};_.w(
|
|
44
|
-
|
|
45
|
-
_.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=_.
|
|
46
|
-
var d=b.customData.roles;d&&(c.roles=d);if(b=b.customData.audioTrackInfo)void 0!==b.numAudioChannels&&(c.channelsCount=b.numAudioChannels),void 0!==b.spatialAudio&&(c.spatialAudio=b.spatialAudio)}c.renditions.push(new _.
|
|
47
|
-
_.r.sa=function(){var a=this.Ra();return a?a.renditions[0]:null};_.r
|
|
48
|
-
_.r.La=function(a){
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_.r.seekWith=function(){return Promise.reject(_.lb)};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.I(function(a){_.z(a)})};_.r.We=function(a){this.K=a};_.r.Pd=function(){return this.f};_.r.
|
|
2
|
+
var f=function(window){var IV="Cannot seek during ads playout.",JV="Cannot switch track",KV="Media session does not exist.",LV="No receivers available",MV="QUEUE_ITEM_CHANGED",NV="Reset ABR functionality not available on cast.",OV="SDK not yet ready",PV="Sender is destroyed.",QV="clpp.cast.CastProxy",RV="clpp.cast.Player",SV="clpp.cast.Receiver",TV="urn:x-cast:castlabs",UV="urn:x-cast:castlabs:int",VV="urn:x-cast:com.google.cast.media",WV="volume control is not supported",XV=function(a){return _.I(function(b){return 1==
|
|
3
|
+
b.a?_.x(b,a.hd(_.Ze),2):_.x(b,a.hd(_.Ye),0)})},YV=function(a){return JSON.stringify(a,function(b,c){if("license"!==b&&typeof c!==_.pe){if(c instanceof Event){var d={},e;for(e in c){var f=c[e];typeof f===_.Ue?"detail"===e&&(d[e]=f):e in Event||(d[e]=f)}return d}return typeof c===_.h?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},ZV=function(a){if(typeof a!==_.hg)return a;try{return JSON.parse(a,function(b,c){return"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c})}catch(b){return a}},
|
|
4
|
+
$V=function(a,b){var c=new Set(b);return Object.keys(a).reduce(function(d,e){c.has(e)&&(d[e]=a[e]);return d},{})},aW=function(a,b,c,d){var e,f,g,k,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(k=0;k<b.length&&!f;)g=b[k++],f=_.Mm(d,a.mimeType,g);if(!f||!g)return q.C(2);l=_.Wk(a.url);return _.x(q,c.fetch(l).U,3)}2!=q.a&&(m=q.f)&&m.data&&(n=f.a(_.Wi(m.data)),p=URL.createObjectURL(new Blob([n])),e={url:p,kind:a.kind,language:a.language,label:a.label,
|
|
5
|
+
mimeType:g});return q["return"](e)})},bW=function(a,b){if(window.chrome&&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 _.Og:return d.FMP4;case _.Mg:return b===_.jm?d.MPEG2_TS:c.TS;case _.Sc:return c.AAC;case _.Tc:return c.AC3;case _.Uc:return c.E_AC3;
|
|
6
|
+
case "audio/mpeg":return c.MP3;case _.Vc:return c.FMP4}},dW=function(a){a=void 0===a?cW: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,k=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 k;case c.AUDIOBOOK_CHAPTER:return new b;
|
|
7
|
+
default:return new d}},eW=function(){return Math.round(1E3*Math.random())},fW=function(a,b){this.log=new _.L(b);this.player=a;this.j=null;this.l=this.f=0;this.h=2;this.B=Date.now();this.A=-1},gW=function(a){fW.call(this,a,"clpp.cast.SenderStateManager");this.o=this.a=null;this.w=this.rc.bind(this)},hW=function(){this.g=new _.L("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},iW=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},kW=
|
|
8
|
+
function(a,b){var c=iW(a);return jW(a,b).find(function(d){return c.includes(d.id)})||null},jW=function(a,b){return a.h.filter(function(c){return c.type===b})},mW=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.hm){var e=a.xa();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;lW(a,b)},function(f){a.f[b]=null;a.g.debug(JV,f)})}else b===_.hm&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,
|
|
9
|
+
function(){lW(a,b)},function(f){a.g.debug(JV,f)}))},lW=function(a,b){b===_.im?a.a.trigger(new _.R(_.Zc)):b===_.hm&&a.a.trigger(new _.R(_.pg))},qW=function(a,b,c,d){_.rn.call(this);this.g=new _.L(_.wd);this.X=a;this.w=new _.oi(b);this.W=c;this.na=d;this.j=this.H=_.yn();this.D=[];this.B=0;this.J=new _.Xl;this.a=null;this.f=!1;this.M=new _.pl;this.A=!1;this.Ba="";this.wb=1E6;this.h=new hW;this.h.initialize(this);this.l=new gW(this);this.G=new _.gi;this.I=null;this.L=new Set;this.P=this.In.bind(this);
|
|
10
|
+
this.Fa=this.ho.bind(this);this.ha=this.Wn.bind(this);this.T=this.Pn.bind(this);this.ba=this.On.bind(this);this.o=this.K=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){nW(!0)},0)}});oW(this);pW.add(this)},rW=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.G.release(),pW["delete"](a),a.f&&(a.f=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,
|
|
11
|
+
a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Fa)),c=[],a.h&&(c.push(a.h.destroy()),a.h=null),a.l&&(c.push(a.l.destroy()),a.l=null),_.x(d,Promise.all(c),2);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.W=null;a.na=null;_.z(d)})},tW=function(a){if(!a)return null;a:{var b=a.metadataType;var c=Object.entries(sW);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=dW(sW[b]);return Object.assign(b,
|
|
12
|
+
a)},uW=function(a){var b=void 0===b?cW:b;return Object.values(sW).includes(a)?a:b},vW=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},oW=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.X.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.G.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Jk.bind(a));a.G.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,
|
|
13
|
+
a.Vn.bind(a));a.f=!0;a.M.resolve();a.w.sh();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.X;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.Fa);wW&&a.w.ia(.02)}},xW=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==
|
|
14
|
+
_.h?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},zW=function(a,b){yW(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ha);b.addMessageListener(TV,a.T);b.addMessageListener(UV,a.ba)},yW=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.R(_.Fe)))},AW=function(a){return _.I(function(b){return a.Ea()?b.C(0):_.x(b,cast.framework.CastContext.getInstance().requestSession(),0)})},BW=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,y,A,D,B,E,C;return _.I(function(K){switch(K.a){case 1:if(!a.f)return K["return"]();
|
|
15
|
+
c=chrome.cast.media.StreamType;d=_.uw;return _.x(K,AW(a),2);case 2:if(!b)return K["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;k=b;l=k.videoMimeType;m=k.audioMimeType;g.hlsVideoSegmentFormat=bW(l,d.VIDEO);g.hlsSegmentFormat=bW(m,d.AUDIO);if(!b.Ka){K.C(3);break}if(!a.K){K.C(4);break}return _.x(K,Promise.resolve(a.K(b.Ka)),5);case 5:if(n=K.f)b.Ka=n;case 4:a.j=b.Ka;
|
|
16
|
+
a.D=_.Kq(a.j);a.B=a.D.findIndex(function(P){return P.url===b.source.url});if(!b.Ka.remoteTextTracks){K.C(6);break}return _.x(K,Promise.all(b.Ka.remoteTextTracks.map(a.Vl.bind(a))),7);case 7:p=K.f,g.tracks=p.filter(function(P){return P}),b.Ka.remoteTextTracks=void 0;case 6:delete b.Ka.autoplay,b.Ka.startTime=null,g.customData={playerConfiguration:YV(b.Ka)};case 3:q=a.Vb()||{};t=uW(q.metadataType);typeof b.dh===_.h&&(u={metadataType:t,sectionStartAbsoluteTime:b.dh});b.source.name&&(y={metadataType:t,
|
|
17
|
+
title:b.source.name});A=vW(q);if(D=tW(Object.assign({},u,y,A)))g.metadata=D;B=new chrome.cast.media.LoadRequest(g);(E=b.queueData)&&E.items&&0<E.items.length&&(C=new chrome.cast.media.QueueData,C.items=E.items,C.startIndex=E.startIndex,B.queueData=C);typeof b.autoplay===_.bd&&(B.autoplay=b.autoplay);typeof b.currentTime===_.h&&(B.currentTime=b.currentTime);return _.x(K,f.loadMedia(B),8);case 8:null!=b.Ka.muted&&a.setMuted(b.Ka.muted),null!=b.Ka.volume&&a.setVolume(b.Ka.volume),_.z(K)}})},CW=function(a,
|
|
18
|
+
b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.h.xa())&&d.language&&(a.j.preferredTextLanguage=d.language);(e=a.h.qa())&&e.language&&(a.j.preferredAudioLanguage=e.language);return _.x(f,BW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),dh:a.getPresentationStartTime(),autoplay:b,Ka:a.j}),0)})},nW=function(a){if(a){a=_.v(pW);for(var b=a.next();!b.done;b=a.next())oW(b.value);DW=!0;a=_.v(EW);for(b=a.next();!b.done;b=a.next())b=b.value,b()}},GW=function(a,b,c){_.rn.call(this);
|
|
19
|
+
this.f=a;this.h=b;this.j=this.Qo;typeof c===_.pe&&(this.j=function(d,e){return c(_.zq(d),e)});this.a=FW(this);this.g=new _.L(QV);this.forwardEventsTo(this.f)},FW=function(a){return new qW(a.h,function(){a.trigger(new _.R(_.id))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Kh&&(d.preferredAudioLanguage=c.Kh);c.Uj&&(d.preferredTextLanguage=c.Uj);_.Qt(a.f,
|
|
20
|
+
null);a.trigger(new _.R("castingended"));a.j(b,d)},function(){return HW(a)})},HW=function(a){var b,c,d;return _.I(function(e){if(1==e.a){a.trigger(new _.R(_.hd));b=a.f.a;if(b===a.a||!a.a)return e["return"]();c=null!=a.f.bb();return _.x(e,a.f.release(),2)}_.Qt(a.f,a.a);if(!c)return e.C(0);_.Zt(a.f);return(d=a.f.getAdsManager())?_.x(e,d.load(),0):e.C(0)})},IW=function(a){fW.call(this,a,"clpp.cast.StateManager");this.I=this.Qk.bind(this);this.H=this.Pk.bind(this);this.w=this.Rn.bind(this);this.o=this.Gn.bind(this);
|
|
21
|
+
this.K=this.Sk.bind(this);this.J=this.Rk.bind(this);this.L=this.ko.bind(this);this.G=this.Un.bind(this);this.D=this.Ok.bind(this);this.a=this.Nk.bind(this)},JW=function(a,b){a=void 0===a?[]:a;b=void 0===b?0:b;_.rn.call(this);this.a=a.slice();this.f=b},KW=function(a){a.trigger(new _.R(_.xf))},MW=function(a,b,c){c=void 0===c?function(){return Promise.resolve()}:c;_.rn.call(this);var d=this;this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=function(){var e,f;return _.I(function(g){switch(g.a){case 1:if(d.f)return g["return"]();
|
|
22
|
+
e=d.a.Wb();if(!e)return g["return"]();d.f=!0;_.F(g,2,3);return _.x(g,d.w(e),5);case 5:return _.x(g,d.m.open(Object.assign({},e.configuration,{autoplay:!0})),3);case 3:_.yh(g);d.f=!1;_.zh(g);break;case 2:throw f=_.H(g),f;}})};this.l=function(){LW(d)}},LW=function(a){QW(a);var b=Math.min(a.a.ze().length-1,a.a.getPosition()+1);a.a.setPosition(b)},QW=function(a){a.j||(a.a.on(_.wf,a.o),a.j=!0)},VW=function(a,b,c){var d=this;this.player=a;this.dc=new JW(c);this.Vd=new MW({open:this.player.open.bind(this.player),
|
|
23
|
+
off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.dc,function(){return _.I(function(e){_.z(e)})});this.a=new GW(this.player,b,function(e,f){var g;return _.I(function(k){if(1==k.a)return g=d.dc.getPosition(),d.Vd.Nd(g),f.autoplay=!0,delete f.license,_.x(k,d.player.open(f),2);if(3!=k.a)return typeof f.currentTime!==_.h?k.C(3):_.x(k,d.player.setPosition(Math.max(f.currentTime-1,0)),3);d.player.play();_.z(k)})});this.f=function(e){e&&e.type===MV&&typeof e.index===_.h&&d.dc.setPosition(e.index)};
|
|
24
|
+
this.a.addMessageListener(this.f)},$W=function(a){return a.map(function(b){var c={};c.media={contentId:b.configuration.source};c.customData={skippable:!1!==b.skippable};return c})},aX=function(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.h?c:1;this.h=typeof d===_.h?d:1;this.j=typeof e===_.h?e:0},bX=function(a){this.a=a},dX=function(a){this.m=a;this.a=null;this.j=this.Tk.bind(this);this.h=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,
|
|
25
|
+
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];this.f=!1;cX().addEventListener(this.h,this.j)},hX=function(a,b,c){var d,e,f,g,k,l,m;return _.I(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.F(n,2);eX=!1;e=_.Wk(d);return _.x(n,c.fetch(e).U,4)}if(2!=n.a){if((f=n.f)&&
|
|
26
|
+
f.data)if(g=_.S.ga(f.data),k=new DOMParser,l=k.parseFromString(g,_.og),l.getElementsByTagName("vmap:VMAP").length)fX.warn("VMAP detected."),a.vmapAdsRequest=gX(g);else if(l.getElementsByTagName("VAST").length){fX.warn("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=gX(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else fX.warn("Unsupported schema."),eX=!0;return _.G(n,0)}m=_.H(n);fX.warn("Failed to fetch an ad",m);eX=!0;
|
|
27
|
+
_.z(n)})},gX=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},cX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},jX=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=iX(a,c))&&(d={ad:c});a.m.trigger(new _.R(b,d))}},kX=function(a,b){var c=new _.O(1,10,10003,{errorType:b});a.m.onError(c)},iX=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=
|
|
28
|
+
null,e=null,f;typeof b.breakClipId===_.hg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.hg&&(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,k){return g.position-k.position}).findIndex(function(g){return g===e})));c=new aX(d,e,b.index,b.total,f)}return c},lX=function(a){this.a=a;this.f=this.h.bind(this)},mX=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
|
|
29
|
+
cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},nX=function(a){var b=a.dashTimedMetadata,c=_.Dg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Cg)?_.Bj:_.Ag,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},oX=function(){this.g=new _.L("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=
|
|
30
|
+
this.Ho.bind(this);this.a=this.f=null},pX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},rX=function(a){a.a=pX().getTextTracksManager();var b=a.a.getTracks();a.j=qX(_.hm,b)},sX=function(a,b,c,d){c=_.Fj(c).filter(function(k){return k});var e=!1,f=[];b===_.im?f=a.getAudioTracks():b===_.hm&&(f=a.ra());if(c=c.find(function(k){var l=_.Ik(k);return f.some(function(m){m=_.Ik(m.language||"");return _.Jk(l,m)})})){var g=_.Ik(c);c=f.filter(function(k){k=_.Ik(k.language||
|
|
31
|
+
"");return _.Jk(g,k)});f=c.length?c:f;e=e||!!c.length}_.S.Of(d)&&(c=f.filter(function(k){return k.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===_.im?a.La(e):b===_.hm&&a.lb(e))},qX=function(a,b){for(var c=[],d=_.v(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.fm(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||
|
|
32
|
+
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 _.om(f.id,f));c.push(f)}return c},tX=function(){_.rn.call(this);this.g=new _.L(RV);this.h=this.w=_.yn();this.A=null;this.l=-1;this.G=new _.Xl;this.f=this.o=this.j=this.a=this.B=null;this.D=!1},uX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},vX=function(a,b){var c=Object.assign({},a.shakaConfig,b);return Object.assign({},
|
|
33
|
+
a,{shakaConfig:c})},yX=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=_.gl(d);if(e){var f=[_.Hd];_.Kq(a)[0].type!==_.Pc&&f.unshift(_.Jd);d.preferredDrmSystem===_.Hd&&f.reverse();for(var g,k;f.length&&!k;)g=f.shift(),k=e.Wa[g];k?(d=g===_.Jd?cast.framework.ContentProtection.WIDEVINE:g===_.Hd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,
|
|
34
|
+
b.licenseUrl=k.licenseUrl,d={ldlDelay:0,customData:{}},wX(b,k,a,d),xX(b,k,a,d)):c()}else c()}else c()},wX=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.Wk({method:_.pb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},xX=function(a,
|
|
35
|
+
b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(k){return 1==k.a?(g=_.$k(Object.assign({},f.headers),e.buffer,200,""),_.x(k,b.modifiers.licenseResponse(c,g,d),2)):k["return"](_.Wi(g.data))})}:a.licenseHandler=void 0},zX=function(){this.a=!1;this.g=new _.L(SV);this.f=this.m=null;this.w=new Set;this.D=this.Tn.bind(this);this.B=this.Lk.bind(this);this.o=null;this.l=new _.gi;this.j=this.h=this.A=null},BX=function(){return AX||(AX=new zX)},CX=function(){return cast.framework.CastReceiverContext.getInstance()},
|
|
36
|
+
DX=function(){var a=CX().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},EX=function(a,b){var c=CX().getPlayerManager().getMediaInformation();if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;CX().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},GX=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=CX();c=(CX().getPlayerManager().getMediaInformation()||
|
|
37
|
+
{}).hlsVideoSegmentFormat===c.FMP4?_.Og:_.Mg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var k=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=FX(k,_.xa),m=FX(k,_.wb),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);if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(k);++g}return f.join("\n")},FX=function(a,b){b+="\x3d";var c=a.indexOf(b);if(0<=c){var d=a.substring(c+
|
|
38
|
+
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},HX=function(a){a=_.v(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c={};b.customData&&_.N.Zb(b.customData)&&(c=b.customData);b.roles&&(c.roles=b.roles);b.audioTrackInfo&&(c.audioTrackInfo=b.audioTrackInfo);_.N.Zb(c)&&(b.customData=c)}},JX=function(a){this.h=a;this.a=null;this.j=new _.gi;this.f=null;IX(this)},IX=function(a){_.I(function(b){if(1==b.a)return _.x(b,
|
|
39
|
+
a.h.M,2);a.a=a.h.o;a.j.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,a.no.bind(a));_.z(b)})},KX=function(a,b,c){var d=null;c&&(d={ad:c});a.h.trigger(new _.R(b,d))},LX=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks,c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,k=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=k&&d))return null;var l=b.find(function(m){return m.id===e})||null;
|
|
40
|
+
a=0;l&&(a=0>=l.position?l.position:b.filter(function(m){return 0<=m.position}).sort(function(m,n){return m.position-n.position}).findIndex(function(m){return m===l}));b=c.find(function(m){return m.id===k})||null;return new aX(b,l,f,g,a)},MX=function(){},NX=function(){},OX,cW=0,sW={GENERIC:cW,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},PX="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),
|
|
41
|
+
QX="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");_.r=fW.prototype;_.r.release=function(){this.Da(0)};_.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.Da(3)};
|
|
42
|
+
_.r.Da=function(a){if(a!==this.f)if(3===this.f&&0!==a)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;6===this.f?(this.A=b,this.player.trigger(new _.R(_.dd,{detail:{bufferedTimeMS:-1,reason:this.h}}))):6===this.l&&this.player.trigger(new _.R(_.cd,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.Bq(this.j,this.f);this.player.trigger(new _.R(_.uf,
|
|
43
|
+
{detail:a}))}};_.w(gW,fW);gW.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.o)};gW.prototype.destroy=function(){var a=this;return _.I(function(b){a.a&&(a.a.removeUpdateListener(a.w),a.a=null);return _.x(b,fW.prototype.destroy.call(a),0)})};gW.prototype.Da=function(a){var b=this.player.o;b&&b.isPlayingBreak||fW.prototype.Da.call(this,a)};
|
|
44
|
+
gW.prototype.rc=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.Da(11);break;case chrome.cast.media.IdleReason.ERROR:this.Da(3);break;default:this.Da(0)}break;case chrome.cast.media.PlayerState.PLAYING:this.Da(8);break;case chrome.cast.media.PlayerState.PAUSED:this.Da(10);break;case chrome.cast.media.PlayerState.BUFFERING:this.Da(6)}};_.w(hW,_.Om);_.r=hW.prototype;_.r.initialize=function(a){this.a=a};_.r.release=function(){this.h=[];this.f={}};
|
|
45
|
+
_.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=_.jm;break;case chrome.cast.media.TrackType.AUDIO:c=_.im;break;case chrome.cast.media.TrackType.TEXT:c=_.hm}c=new _.fm(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;if(b.customData){c.src=b.customData.url||c.src;c.mimeType=b.customData.mimeType||c.mimeType;
|
|
46
|
+
var d=b.customData.roles;d&&(c.roles=d);if(b=b.customData.audioTrackInfo)void 0!==b.numAudioChannels&&(c.channelsCount=b.numAudioChannels),void 0!==b.spatialAudio&&(c.spatialAudio=b.spatialAudio)}c.renditions.push(new _.om(c.id,c));return c}):[],this.a.trigger(new _.R(_.vg)))};_.r.destroy=function(){this.a=null};_.r.getVideoTracks=function(){return jW(this,_.jm)};_.r.getAudioTracks=function(){return jW(this,_.im)};_.r.ra=function(){return jW(this,_.hm)};
|
|
47
|
+
_.r.sa=function(){var a=this.Ra();return a?a.renditions[0]:null};_.r.$a=function(){var a=this.qa();return a?a.renditions[0]:null};_.r.ib=function(){var a=this.xa();return a?a.renditions[0]:null};_.r.Gb=function(){return this.f[_.jm]||null};_.r.Xb=function(){return this.f[_.im]||null};_.r.Yb=function(){return this.f[_.hm]||null};_.r.Ra=function(){return kW(this,_.jm)};_.r.qa=function(){return kW(this,_.im)};_.r.xa=function(){return kW(this,_.hm)};_.r.Qb=function(a){mW(this,_.jm,a)};
|
|
48
|
+
_.r.La=function(a){mW(this,_.im,a)};_.r.lb=function(a){mW(this,_.hm,a)};_.r.Cb=function(a){this.Qb(a&&a.track)};_.r.Ob=function(a){this.La(a&&a.track)};_.r.Pb=function(a){this.lb(a&&a.track)};_.r.addTextTrack=function(){return _.I(function(a){_.z(a)})};_.r.ya=function(){return!0};hW.prototype.isAbrEnabled=hW.prototype.ya;hW.prototype.addTextTrack=hW.prototype.addTextTrack;hW.prototype.setTextRendition=hW.prototype.Pb;hW.prototype.setAudioRendition=hW.prototype.Ob;hW.prototype.setVideoRendition=hW.prototype.Cb;
|
|
49
|
+
hW.prototype.setTextTrack=hW.prototype.lb;hW.prototype.setAudioTrack=hW.prototype.La;hW.prototype.setVideoTrack=hW.prototype.Qb;hW.prototype.getTextTrack=hW.prototype.xa;hW.prototype.getAudioTrack=hW.prototype.qa;hW.prototype.getVideoTrack=hW.prototype.Ra;hW.prototype.getLoadingTextRendition=hW.prototype.Yb;hW.prototype.getLoadingAudioRendition=hW.prototype.Xb;hW.prototype.getLoadingVideoRendition=hW.prototype.Gb;hW.prototype.getTextRendition=hW.prototype.ib;hW.prototype.getAudioRendition=hW.prototype.$a;
|
|
50
|
+
hW.prototype.getVideoRendition=hW.prototype.sa;hW.prototype.getTextTracks=hW.prototype.ra;hW.prototype.getAudioTracks=hW.prototype.getAudioTracks;hW.prototype.getVideoTracks=hW.prototype.getVideoTracks;_.w(qW,_.rn);_.r=qW.prototype;_.r.init=function(a,b){this.j=this.H=b};_.r.unload=function(){var a=this;return this.f?new Promise(function(b,c){a.h&&a.h.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)}):Promise.resolve()};_.r.release=function(){var a=this;return this.f?this.unload().then(function(){a.l&&a.l.release()}):Promise.resolve()};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.lb)};_.r.appendLoad=function(){return Promise.reject(_.lb)};
|
|
51
|
+
_.r.seekWith=function(){return Promise.reject(_.lb)};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.I(function(a){_.z(a)})};_.r.We=function(a){this.K=a};_.r.Pd=function(){return this.f};_.r.Ea=function(){return this.A};_.r.Ig=function(){return this.Ba};
|
|
52
52
|
_.r.sendMessage=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:if(!c.f)return g["return"]();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,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)}})};
|
|
53
|
-
_.r.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Pd())throw a.g.warn(
|
|
54
|
-
_.r.Cf=function(){this.f&&this.
|
|
55
|
-
_.r.pause=function(){var a=this;return this.f?new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(
|
|
56
|
-
_.r.seek=function(a){var b=this;return this.f?this.isEnded()?
|
|
53
|
+
_.r.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Pd())throw a.g.warn(OV),new _.O(1,8,8001,void 0);if(!wW)throw a.g.warn(LV),new _.O(1,8,8002,void 0);if(a.Ea())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.F(d,2);return _.x(d,AW(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);})};
|
|
54
|
+
_.r.Cf=function(){this.f&&this.Ea()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.r.addMessageListener=function(a){typeof a===_.pe&&this.L.add(a)};_.r.removeMessageListener=function(a){typeof a===_.pe&&this.L["delete"](a)};_.r.play=function(){var a=this;return this.f?this.isEnded()?CW(this,!0):new Promise(function(b,c){if(!a.a)return c(KV);a.a.play(null,b,c)}):Promise.resolve()};
|
|
55
|
+
_.r.pause=function(){var a=this;return this.f?new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(KV);a.a.pause(null,b,c)}):Promise.resolve()};_.r.isPaused=function(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1};_.r.isEnded=function(){return this.f?11===this.getState():!1};
|
|
56
|
+
_.r.seek=function(a){var b=this;return this.f?this.isEnded()?CW(this,!1,a):new Promise(function(c,d){b.a||d(KV);b.o.isPlayingBreak&&d(IV);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.R(_.Fg));b.a.seek(e,function(){b.trigger(new _.R(_.Eg));c()},d)}):Promise.resolve()};_.r.getPosition=function(){return this.f?this.getMediaPosition():0};_.r.getMediaPosition=function(){return this.f?this.a&&this.a.getEstimatedTime()||0:0};
|
|
57
57
|
_.r.getDuration=function(){return this.f?this.getMediaDuration():0};_.r.getMediaDuration=function(){if(!this.f)return 0;if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.h?-1:-1===a?Infinity:a};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.getPlaybackRate=function(){return this.f?this.a&&this.a.playbackRate||0:0};
|
|
58
|
-
_.r.setPlaybackRate=function(a){this.f&&this.a&&0<a&&this.sendMessage(
|
|
58
|
+
_.r.setPlaybackRate=function(a){this.f&&this.a&&0<a&&this.sendMessage(VV,{type:"SET_PLAYBACK_RATE",requestId:eW(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};_.r.getVolume=function(){return this.f?this.a&&this.a.volume.level:0};_.r.setVolume=function(a){this.f&&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.f?this.a&&this.a.volume.muted:!1};
|
|
59
59
|
_.r.setMuted=function(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))};_.r.getPresentationStartTime=function(){if(!this.f)return 0;if(!this.a||!this.a.media||!this.a.media.metadata)return null;var a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.h?null:1E-8===a?0:a};
|
|
60
|
-
_.r.getSeekRange=function(){if(!this.f)return{start:0,end:0};var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.h&&typeof b.end===_.h&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.f?this.l?this.l.getState():0:0};_.r.getStats=function(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?
|
|
61
|
-
_.r.isLive=function(){return this.f?Infinity===this.getDuration():!1};_.r.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Pd())return b.g.warn(
|
|
60
|
+
_.r.getSeekRange=function(){if(!this.f)return{start:0,end:0};var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.h&&typeof b.end===_.h&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.f?this.l?this.l.getState():0:0};_.r.getStats=function(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?ZV(this.a.customData.stats):_.Hq():_.Hq()};
|
|
61
|
+
_.r.isLive=function(){return this.f?Infinity===this.getDuration():!1};_.r.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Pd())return b.g.warn(OV),e["return"]();if(!wW)return b.g.warn(LV),e["return"]();b.D=_.Kq(a);b.j=_.An([b.H,a]);c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.j.autoplay,Ka:b.j,videoMimeType:c.videoMimeType,audioMimeType:c.audioMimeType};return _.x(e,BW(b,d),0)})};_.r.getBufferInfo=function(){return new _.on};_.r.getTrackManager=function(){return this.h};
|
|
62
62
|
_.r.getConfiguration=function(){return this.j};_.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.J=a};_.r.getNetworkEngine=function(){return this.J};_.r.getSourceIndex=function(){return this.B};_.r.setSourceIndex=function(a){this.B=a};_.r.setCmsdManager=function(){};_.r.getLoadedSource=function(){return this.D[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};
|
|
63
|
-
_.r.resetAbr=function(){this.g.warn(
|
|
64
|
-
_.r.kh=function(a){if(this.f){var b=this.
|
|
65
|
-
_.r.
|
|
66
|
-
_.r.
|
|
67
|
-
isLive:this.isLive()},currentTime:
|
|
68
|
-
_.r.
|
|
69
|
-
_.r.Vl=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.x(e,
|
|
70
|
-
_.J("clpp.cast.onReady",function(a){
|
|
71
|
-
_.r.cast=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:if(!c.a)return g["return"]();_.F(g,2);return _.x(g,c.a.cast(),4);case 4:if(!c.a)return g["return"]();var k=null,l=c.f.
|
|
72
|
-
m.language),m.roles.length&&(k.preferredTextRole=m.roles[0]);m=l&&typeof l.isLive===_.bd?l.isLive:c.f.isLive();k={source:l,isLive:m,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),dh:c.f.getPresentationStartTime(),videoMimeType:n,audioMimeType:q,Ka:k}}d=k;b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});return _.x(g,
|
|
73
|
-
d),7);case 7:_.G(g,0);break;case 2:e=_.H(g),c.g.error("Error while trying to cast",e),f=new _.R(_.le,{detail:e}),c.trigger(f),_.z(g)}})};_.r.Cf=function(){this.a&&this.a.Cf()};_.r.Dk=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,
|
|
74
|
-
_.r.Hj=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage(
|
|
75
|
-
_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
_.r.resetAbr=function(){this.g.warn(NV)};_.r.onError=function(a){if(a&&(this.trigger(new _.R(_.le,{detail:a})),this.l))this.l.onError(a)};_.r.namespace=function(){return _.wd};_.r.canPlay=function(){return this.Pd()?2:0};_.r.Vb=function(){return this.I};_.r.tc=function(a){this.I=tW(a)};_.r.zg=function(){this.I=null};_.r.mh=function(a){if(this.f){var b=this.Vb()||{};a={metadataType:uW(b.metadataType),title:a};this.tc(Object.assign({},b,a))}};
|
|
64
|
+
_.r.kh=function(a){if(this.f){var b=this.Vb()||{},c=uW(b.metadataType);a=new chrome.cast.Image(a);this.tc(Object.assign({},b,{metadataType:c,images:[a]}))}};_.r.jh=function(a){if(this.f){var b=this.Vb()||{};this.tc(Object.assign({},b,{metadataType:3,artist:a}))}};_.r.lh=function(a){if(this.f){var b=this.Vb()||{};a={metadataType:uW(b.metadataType),releaseDate:a};this.tc(Object.assign({},b,a))}};
|
|
65
|
+
_.r.In=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;wW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.Ba=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.sh()};
|
|
66
|
+
_.r.ho=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;zW(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Ea()||(this.A=!0,zW(this,a.session),this.na());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Ea()&&this.a){var b=this.a.media,c=this.h.qa(),d=this.h.xa();c=c&&c.language||void 0;d=d&&d.language||void 0;this.W(this.getState(),{source:{url:b.contentId,type:b.contentType,
|
|
67
|
+
isLive:this.isLive()},currentTime:xW(this),Uj:d,Kh:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ha);a.session.removeMessageListener(TV,this.T);a.session.removeMessageListener(UV,this.ba);this.A=!1;this.a=null}};_.r.Wn=function(a){this.g.debug("New media session",a.mediaSession);yW(this,a.mediaSession)};_.r.Vn=function(a){a.value&&a.value.tracks&&this.h&&this.h.load()};_.r.Pn=function(a,b){var c=ZV(b);this.L.forEach(function(d){return d(c)})};
|
|
68
|
+
_.r.On=function(a,b){var c=ZV(b);"event"===c.type&&c.name===_.Sg&&this.trigger(new _.R(_.jd,{visible:!!c.visible}))};_.r.Jk=function(){this.trigger(new _.R(_.ug))};
|
|
69
|
+
_.r.Vl=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.x(e,aW(a,[_.ng,_.Oc],b.J,b.j),2);if(d=e.f)c=new chrome.cast.media.Track(b.wb++,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 wW=!1,pW=new Set,DW=!1,EW=[];window.__onGCastApiAvailable=nW;
|
|
70
|
+
_.J("clpp.cast.onReady",function(a){DW?a():EW.push(a)});_.w(GW,_.rn);_.r=GW.prototype;_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.x(b,rW(a.a),3):b.C(2);2!=b.a&&(a.a=null);a.stopForwardingEventsTo(a.f);_.z(b)})};_.r.Qo=function(a,b){11!==a&&0!==a&&(delete b.license,this.f.open(b))};_.r.zd=function(){return!!this.a&&this.a.Pd()&&wW};_.r.Ea=function(){return!!this.a&&this.a.Ea()};_.r.Ig=function(){return this.a?this.a.Ig():""};_.r.We=function(a){this.a&&this.a.We(a)};
|
|
71
|
+
_.r.cast=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:if(!c.a)return g["return"]();_.F(g,2);return _.x(g,c.a.cast(),4);case 4:if(!c.a)return g["return"]();var k=null,l=c.f.bb();if(l){var m=c.f.getTrackManager();k=m.getVideoTracks()[0];if(k&&k.mimeType)var n=k.mimeType;k=c.f.getConfiguration();var p=m.qa();if(p){if(p.mimeType)var q=p.mimeType;p.language&&(k.preferredAudioLanguage=p.language);p.roles.length&&(k.preferredAudioRole=p.roles[0])}if(m=m.xa())m.language&&(k.preferredTextLanguage=
|
|
72
|
+
m.language),m.roles.length&&(k.preferredTextRole=m.roles[0]);m=l&&typeof l.isLive===_.bd?l.isLive:c.f.isLive();k={source:l,isLive:m,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),dh:c.f.getPresentationStartTime(),videoMimeType:n,audioMimeType:q,Ka:k}}d=k;b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});return _.x(g,HW(c),5);case 5:if(!c.a)return g["return"]();d&&(d.autoplay=!c.f.isPaused());if(a)return _.x(g,c.f.open(a),7);if(c.a.a){g.C(7);break}return _.x(g,BW(c.a,
|
|
73
|
+
d),7);case 7:_.G(g,0);break;case 2:e=_.H(g),c.g.error("Error while trying to cast",e),f=new _.R(_.le,{detail:e}),c.trigger(f),_.z(g)}})};_.r.Cf=function(){this.a&&this.a.Cf()};_.r.Dk=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,rW(b.a),2):c.C(2)}b.a=FW(b);_.z(c)})};_.r.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.x(c,b.a.sendMessage(TV,a),0):(b.g.warn(PV),c["return"]())})};
|
|
74
|
+
_.r.Hj=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage(VV,{type:"QUEUE_NEXT",requestId:eW(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Ij=function(){var a=this;return _.I(function(b){return _.x(b,a.a.sendMessage(VV,{type:"QUEUE_PREV",requestId:eW(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Gj=function(a){var b=this;return _.I(function(c){return _.x(c,b.a.sendMessage(VV,{type:"QUEUE_INSERT",requestId:eW(),mediaSessionId:b.a.a.mediaSessionId,items:a}),0)})};
|
|
75
|
+
_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(PV)};_.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(PV)};_.r.Vb=function(){return this.a&&this.a.Vb()};_.r.tc=function(a){this.a&&this.a.tc(a)};_.r.zg=function(){this.a&&this.a.zg()};_.r.mh=function(a){this.a&&this.a.mh(a)};_.r.kh=function(a){this.a&&this.a.kh(a)};_.r.jh=function(a){this.a&&this.a.jh(a)};_.r.lh=function(a){this.a&&this.a.lh(a)};_.J(QV,GW);
|
|
76
|
+
GW.prototype.setContentReleaseDate=GW.prototype.lh;GW.prototype.setContentArtist=GW.prototype.jh;GW.prototype.setContentImage=GW.prototype.kh;GW.prototype.setContentTitle=GW.prototype.mh;GW.prototype.clearContentMetadata=GW.prototype.zg;GW.prototype.setContentMetadata=GW.prototype.tc;GW.prototype.getContentMetadata=GW.prototype.Vb;GW.prototype.removeMessageListener=GW.prototype.removeMessageListener;GW.prototype.addMessageListener=GW.prototype.addMessageListener;GW.prototype.queueAddItems=GW.prototype.Gj;
|
|
77
|
+
GW.prototype.queuePreviousItem=GW.prototype.Ij;GW.prototype.queueNextItem=GW.prototype.Hj;GW.prototype.sendMessage=GW.prototype.sendMessage;GW.prototype.changeReceiverId=GW.prototype.Dk;GW.prototype.forceDisconnect=GW.prototype.Cf;GW.prototype.cast=GW.prototype.cast;GW.prototype.setPlayerConfigInterceptor=GW.prototype.We;GW.prototype.getReceiverName=GW.prototype.Ig;GW.prototype.isCasting=GW.prototype.Ea;GW.prototype.canCast=GW.prototype.zd;GW.prototype.destroy=GW.prototype.destroy;_.w(IW,fW);_.r=IW.prototype;
|
|
78
78
|
_.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.D);b.addEventListener(a.BITRATE_CHANGED,this.a)};
|
|
79
79
|
_.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,
|
|
80
|
-
a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,
|
|
81
|
-
_.r.Nk=function(a){var b=this.player.getStats();this.player.trigger(new _.R(_.ad,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.Ok=function(a){a=new _.O(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.R(_.le,{detail:a}));this.
|
|
82
|
-
_.r.remove=function(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,
|
|
83
|
-
_.r.stop=function(){this.h=!1;this.m.off(_.ke,this.l);this.a.off(_.wf,this.o);this.j=!1};_.r=
|
|
84
|
-
_.r.pause=function(){this.player.pause()};_.r.destroy=function(){this.Vd.stop();this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()};_.r.
|
|
85
|
-
_.r.next=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.
|
|
86
|
-
|
|
87
|
-
_.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.
|
|
88
|
-
_.r.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
_.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.h?a:-1};_.r.
|
|
93
|
-
_.r.Tk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=
|
|
94
|
-
_.xc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(
|
|
95
|
-
a):(this.f=!1,
|
|
96
|
-
|
|
97
|
-
_.r
|
|
98
|
-
_.r.
|
|
99
|
-
_.r.
|
|
100
|
-
_.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,
|
|
101
|
-
a),g;}}_.z(f)})};_.r.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
_.r.unload=function(){var a=cast.framework.messages.PlayerState,b=
|
|
105
|
-
_.r.play=function(){
|
|
106
|
-
_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.getMediaPosition=function(){return
|
|
107
|
-
_.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;
|
|
108
|
-
_.r.getLoadedSource=function(){var a=
|
|
109
|
-
_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=
|
|
110
|
-
_.r.getStats=function(){var a=_.
|
|
111
|
-
_.r.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.
|
|
80
|
+
a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.x(d,fW.prototype.destroy.call(a),0)})};_.r.Qk=function(){this.player.trigger(new _.R(_.jf));this.Da(8)};_.r.Pk=function(){this.Da(10)};_.r.Rn=function(){this.Da(11)};_.r.Gn=function(a){a.isBuffering?this.Da(6):(a=this.player.isPaused()?10:8,this.Da(a))};_.r.Sk=function(){this.h=1;this.player.trigger(new _.R(_.Fg))};_.r.Rk=function(){this.player.trigger(new _.R(_.Eg))};_.r.ko=function(){this.h=2};_.r.Un=function(){this.Da(2)};
|
|
81
|
+
_.r.Nk=function(a){var b=this.player.getStats();this.player.trigger(new _.R(_.ad,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.Ok=function(a){a=new _.O(_.Q,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.R(_.le,{detail:a}));this.Da(3)};_.w(JW,_.rn);_.r=JW.prototype;_.r.ze=function(){return this.a};_.r.getPosition=function(){return this.f};_.r.Wb=function(){return this.a[this.f]||null};_.r.Mi=function(){return this.a[this.f+1]||null};_.r.setPosition=function(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.R(_.wf,{item:this.Wb()})))};_.r.append=function(a){this.a.push(a);KW(this)};_.r.Ri=function(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),KW(this))};
|
|
82
|
+
_.r.remove=function(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,KW(this))};_.r.clear=function(){this.a=[];this.f=0;KW(this)};_.w(MW,_.rn);_.r=MW.prototype;_.r.start=function(){this.h||this.f||(this.h=!0,this.m.on(_.ke,this.l),QW(this),this.a.setPosition(this.a.getPosition()))};_.r.next=function(){var a=this.a.Wb();a&&!1===a.skippable||LW(this)};_.r.Te=function(){var a=this.a.Wb();a&&!1===a.skippable||(QW(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))};_.r.Nd=function(a){var b=this;return _.I(function(c){b.a.setPosition(a);_.z(c)})};
|
|
83
|
+
_.r.stop=function(){this.h=!1;this.m.off(_.ke,this.l);this.a.off(_.wf,this.o);this.j=!1};_.r=VW.prototype;_.r.ao=function(a){return this.dc.on(_.wf,a)};_.r.bo=function(a){return this.dc.on(_.xf,a)};_.r.Jn=function(a){return this.player.on(_.id,a)};_.r.zd=function(){return this.a.zd()};_.r.Em=function(){return this.dc.ze()};_.r.Ea=function(){return this.a.Ea()};_.r.append=function(a){var b=this;return _.I(function(c){b.dc.append(a);return b.a.Ea()?_.x(c,b.a.Gj($W([a])),0):c["return"]()})};_.r.tm=function(){return this.dc.getPosition()};_.r.start=function(){this.Vd.start()};_.r.play=function(){this.player.play()};
|
|
84
|
+
_.r.pause=function(){this.player.pause()};_.r.destroy=function(){this.Vd.stop();this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()};_.r.mp=function(){var a=this,b,c;return _.I(function(d){if(a.a.Ea())return a.a.Cf(),d["return"]();a.Vd.stop();b=$W(a.dc.ze());c=a.dc.getPosition();return _.x(d,a.a.cast(void 0,{items:b,startIndex:c}),0)})};
|
|
85
|
+
_.r.next=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.Ea()?_.x(b,a.a.Hj(),3):b.C(2):2!=b.a?b["return"]():_.x(b,a.Vd.next(),0)})};_.r.Te=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.Ea()?_.x(b,a.a.Ij(),3):b.C(2):2!=b.a?b["return"]():_.x(b,a.Vd.Te(),0)})};_.J("clpp.cast.playlist.CastPlaylist",VW);VW.prototype.previous=VW.prototype.Te;VW.prototype.next=VW.prototype.next;VW.prototype.toggleCast=VW.prototype.mp;VW.prototype.destroy=VW.prototype.destroy;
|
|
86
|
+
VW.prototype.pause=VW.prototype.pause;VW.prototype.play=VW.prototype.play;VW.prototype.start=VW.prototype.start;VW.prototype.getCurrentIndex=VW.prototype.tm;VW.prototype.append=VW.prototype.append;VW.prototype.isCasting=VW.prototype.Ea;VW.prototype.getPlaylistItems=VW.prototype.Em;VW.prototype.canCast=VW.prototype.zd;VW.prototype.onCastStatusChanged=VW.prototype.Jn;VW.prototype.onPlaylistModified=VW.prototype.bo;VW.prototype.onPlaylistItemChange=VW.prototype.ao;_.r=aX.prototype;_.r.nb=function(){return"Google Cast Framework"};_.r.ob=function(){return cast.framework.VERSION};_.r.qb=function(){return 0};_.r.getId=function(){return this.a.id};_.r.getCreativeId=function(){return""};_.r.Ib=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};
|
|
87
|
+
_.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.Lb=function(){return!1};_.r.ab=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.gb=function(){return 0};_.r.fb=function(){return 0};_.r.Ga=function(){return 0};_.r.Ha=function(){switch(this.zb()){case 0:return 0;case -1:return _.Ck;default:return _.Fk}};_.r.getPodIndex=function(){return this.j};_.r.zb=function(){return this.f.position};_.r.pb=function(){return this.l};
|
|
88
|
+
_.r.hb=function(){return this.h};_.r.getWrapperAdIds=function(){return[]};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.Jb=function(){return null};aX.prototype.getVideoElement=aX.prototype.Jb;aX.prototype.getWrapperCreativeIds=aX.prototype.getWrapperCreativeIds;aX.prototype.getWrapperAdSystems=aX.prototype.getWrapperAdSystems;aX.prototype.canSeek=aX.prototype.canSeek;aX.prototype.getWrapperAdIds=aX.prototype.getWrapperAdIds;
|
|
89
|
+
aX.prototype.getSequenceLength=aX.prototype.hb;aX.prototype.getPositionInSequence=aX.prototype.pb;aX.prototype.getPodTimeOffset=aX.prototype.zb;aX.prototype.getPodIndex=aX.prototype.getPodIndex;aX.prototype.getPodType=aX.prototype.Ha;aX.prototype.getMediaBitrate=aX.prototype.Ga;aX.prototype.getMediaHeight=aX.prototype.fb;aX.prototype.getMediaWidth=aX.prototype.gb;aX.prototype.getMediaUrl=aX.prototype.getMediaUrl;aX.prototype.getClickThroughUrl=aX.prototype.ab;aX.prototype.isBumper=aX.prototype.Lb;
|
|
90
|
+
aX.prototype.getSkipTimeOffset=aX.prototype.getSkipTimeOffset;aX.prototype.getPosition=aX.prototype.getPosition;aX.prototype.getDuration=aX.prototype.getDuration;aX.prototype.getTitle=aX.prototype.getTitle;aX.prototype.getAdvertiserName=aX.prototype.getAdvertiserName;aX.prototype.getAdSystem=aX.prototype.getAdSystem;aX.prototype.getApiFramework=aX.prototype.getApiFramework;aX.prototype.getSourceId=aX.prototype.Ib;aX.prototype.getCreativeId=aX.prototype.getCreativeId;aX.prototype.getId=aX.prototype.getId;
|
|
91
|
+
aX.prototype.getTechnology=aX.prototype.qb;aX.prototype.getAdManagerVersion=aX.prototype.ob;aX.prototype.getAdManagerName=aX.prototype.nb;bX.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};bX.prototype.$b=function(){return!!this.a.find(function(a){return 0===a.position})};bX.prototype.Kb=function(){return!!this.a.find(function(a){return-1===a.position})};bX.prototype.hasPostroll=bX.prototype.Kb;bX.prototype.hasPreroll=bX.prototype.$b;bX.prototype.getCuePoints=bX.prototype.getCuePoints;_.r=dX.prototype;_.r.load=function(){var a=this;return _.I(function(b){eX&&(eX=!1,kX(a,0));_.z(b)})};_.r.Bb=function(){return!0};_.r.Tc=function(){};_.r.Ta=function(){-1!==this.getPosition()&&cX().pause()};_.r.skip=function(){};_.r.getAdVolume=function(){fX.warn(WV);return 0};_.r.Pa=function(){fX.warn(WV)};_.r.setMuted=function(){};_.r.isMuted=function(){return!1};_.r.Sa=function(){return-1!==this.getPosition()};_.r.isPaused=function(){return this.f};
|
|
92
|
+
_.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.h?a:-1};_.r.Qc=function(){return!0};_.r.Bc=function(){var a=this;return _.I(function(b){cX().removeEventListener(a.h,a.j);_.z(b)})};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.Ta()};_.r.resume=function(){this.Bb()};
|
|
93
|
+
_.r.Tk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=cX().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.R(_.Dc,{adsTimeline:new bX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:jX(this,_.qc,a);break;case cast.framework.events.EventType.BREAK_STARTED:jX(this,_.gc,a);break;case cast.framework.events.EventType.BREAK_ENDED:jX(this,_.hc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:jX(this,
|
|
94
|
+
_.xc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(jX(this,_.wc,a),jX(this,_.yc,a)):a.endedReason===b.STOPPED?jX(this,_.yc,a):a.endedReason===b.END_OF_STREAM?(jX(this,_.kc,a),jX(this,_.yc,a)):a.endedReason===b.ERROR&&kX(this,1);break;case cast.framework.events.EventType.PLAYING:this.f=!1;jX(this,_.vc,a);break;case cast.framework.events.EventType.PAUSE:this.f=!0;jX(this,_.sc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?jX(this,_.ic,
|
|
95
|
+
a):(this.f=!1,jX(this,_.vc,a))}};dX.prototype.resume=dX.prototype.resume;dX.prototype.pause=dX.prototype.pause;dX.prototype.getVolume=dX.prototype.getVolume;dX.prototype.setVolume=dX.prototype.setVolume;dX.prototype.getPosition=dX.prototype.getPosition;dX.prototype.skip=dX.prototype.skip;var eX=!1,fX=new _.L("clpp.cast.ads.AdsManager");lX.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(mX(),this.f)};lX.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(mX(),this.f)};lX.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return nX(a)})};
|
|
96
|
+
lX.prototype.h=function(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=_.qg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.rg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.sg}b&&this.a(new _.R(b,{detail:nX(a.timedMetadataInfo)}))}else for(a=_.v(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.a(new _.R(_.qg,{detail:b.value}))};_.w(oX,_.Om);_.r=oX.prototype;_.r.initialize=function(a){this.m=a;pX().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;pX().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.ra=function(){return this.j};_.r.sa=function(){return null};
|
|
97
|
+
_.r.$a=function(){var a=this.qa();return a&&a.renditions[0]};_.r.ib=function(){var a=this.xa();return a&&a.renditions[0]};_.r.Gb=function(){return null};_.r.Xb=function(){return null};_.r.Yb=function(){return null};_.r.Ra=function(){return null};_.r.qa=function(){var a=null;if(this.f){var b=this.f.getActiveId();typeof b===_.h&&(b=b.toString(),a=this.getAudioTracks().find(function(c){return c.id===b})||null)}return a};
|
|
98
|
+
_.r.xa=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.h&&(b=b.toString(),a=this.ra().find(function(c){return c.id===b})||null)}return a};_.r.Qb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.La=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.lb=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.Cb=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.Ob=function(a){this.La(a&&a.track)};
|
|
99
|
+
_.r.Pb=function(a){this.lb(a&&a.track)};
|
|
100
|
+
_.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,aW(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]),rX(b)}catch(g){throw b.g.warn("failed on track",
|
|
101
|
+
a),g;}}_.z(f)})};_.r.ya=function(){return!0};_.r.Ho=function(){this.f=pX().getAudioTracksManager();var a=this.f.getTracks();this.h=qX(_.im,a);rX(this);a=this.m.getConfiguration();sX(this,_.im,a.preferredAudioLanguage,a.preferredAudioRole);sX(this,_.hm,a.preferredTextLanguage,a.preferredTextRole)};oX.prototype.isAbrEnabled=oX.prototype.ya;oX.prototype.addTextTrack=oX.prototype.addTextTrack;oX.prototype.setTextRendition=oX.prototype.Pb;oX.prototype.setAudioRendition=oX.prototype.Ob;
|
|
102
|
+
oX.prototype.setVideoRendition=oX.prototype.Cb;oX.prototype.setTextTrack=oX.prototype.lb;oX.prototype.setAudioTrack=oX.prototype.La;oX.prototype.setVideoTrack=oX.prototype.Qb;oX.prototype.getTextTrack=oX.prototype.xa;oX.prototype.getAudioTrack=oX.prototype.qa;oX.prototype.getVideoTrack=oX.prototype.Ra;oX.prototype.getLoadingTextRendition=oX.prototype.Yb;oX.prototype.getLoadingAudioRendition=oX.prototype.Xb;oX.prototype.getLoadingVideoRendition=oX.prototype.Gb;oX.prototype.getTextRendition=oX.prototype.ib;
|
|
103
|
+
oX.prototype.getAudioRendition=oX.prototype.$a;oX.prototype.getVideoRendition=oX.prototype.sa;oX.prototype.getTextTracks=oX.prototype.ra;oX.prototype.getAudioTracks=oX.prototype.getAudioTracks;oX.prototype.getVideoTracks=oX.prototype.getVideoTracks;_.w(tX,_.rn);_.r=tX.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=uX();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.Kk.bind(this));d.setMediaPlaybackInfoHandler(this.sk.bind(this));this.a=new IW(this);this.a.init();this.j=new oX;this.j.initialize(this);this.o=new lX(function(e){return c.trigger(e)});this.o.init()};
|
|
104
|
+
_.r.unload=function(){var a=cast.framework.messages.PlayerState,b=uX();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=_.yn(),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)})};
|
|
105
|
+
_.r.play=function(){uX().play();return Promise.resolve()};_.r.pause=function(){uX().pause();return Promise.resolve()};_.r.isPaused=function(){return uX().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};_.r.isEnded=function(){return uX().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=uX();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(IV);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return this.getMediaPosition()};
|
|
106
|
+
_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.getMediaPosition=function(){return uX().getCurrentTimeSec()};_.r.getDuration=function(){return this.getMediaDuration()};_.r.getMediaDuration=function(){var a=uX().getDurationSec();return typeof a===_.h?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return uX().getPlaybackRate()};
|
|
107
|
+
_.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;uX().sendLocalMediaRequest(b)}};_.r.getVolume=function(){this.g.warn(WV);return null};_.r.setVolume=function(){this.g.warn(WV)};_.r.setMuted=function(){this.g.warn(WV)};_.r.isMuted=function(){this.g.warn(WV);return!1};
|
|
108
|
+
_.r.getLoadedSource=function(){var a=uX().getMediaInformation();if(a){var b=uX().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,drmProtected:b,name:c}}return null};_.r.getDrmInfo=function(){return null};_.r.getPresentationStartTime=function(){return uX().getStartAbsoluteTime()};
|
|
109
|
+
_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=uX().getLiveSeekableRange();b&&typeof b.start===_.h&&typeof b.end===_.h&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.a?this.a.getState():0};
|
|
110
|
+
_.r.getStats=function(){var a=_.Hq();if(this.f){a=uX().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===_.h?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.h?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
|
|
111
|
+
_.r.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.Gq;b.a.j=b.f.a;b.A=_.Kq(a);b.h=_.An([b.w,a]);if(b.D)return b.D=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.h&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:YV(b.h),local:!0};return _.x(e,uX().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.za);return new _.on};
|
|
112
112
|
_.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(_.lb)};_.r.appendLoad=function(){return Promise.reject(_.lb)};_.r.seekWith=function(){return Promise.reject(_.lb)};_.r.setNetworkEngine=function(a){this.G=a};_.r.setCmsdManager=function(){};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};
|
|
113
|
-
_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return
|
|
114
|
-
_.r.Kk=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=
|
|
115
|
-
(!e||e&&f)){d=
|
|
116
|
-
_.r.sk=function(a,b){var c=null,d=b;a.media.customData&&(c=
|
|
117
|
-
_.h?g.initialBandwidth=e.defaultBandwidthEstimate:g.initialBandwidth=void 0;
|
|
118
|
-
_.r.start=function(a){var b=this;if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var c=
|
|
113
|
+
_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return RV};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(NV)};_.r.onError=function(a){this.trigger(new _.R(_.le,{detail:a}))};_.r.canPlay=function(){return _.vi()?2:0};
|
|
114
|
+
_.r.Kk=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=YV(this.getStats());var b=uX(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.h&&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&&
|
|
115
|
+
(!e||e&&f)){d=uX().getStartAbsoluteTime();if(typeof d===_.h){b.startAbsoluteTime=d;var k;f?k=new cast.framework.messages.GenericMediaMetadata:k=b.metadata;k.sectionStartAbsoluteTime=d;b.metadata=k}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}return a};
|
|
116
|
+
_.r.sk=function(a,b){var c=null,d=b;a.media.customData&&(c=ZV(a.media.customData.playerConfiguration));var e=null,f=null;a.media.customData&&(e=ZV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),f=ZV(a.media.customData.playerConfiguration));var g=e&&e.LiveConfiguration;g=g?0===g.liveEdgeLatencyMs:!1;e=!(!e||!e.lowLatencyMode);d=null!=f&&f.lowLatencyMode||g||e?vX(d,{streaming:{lowLatencyMode:!0}}):d;if(!c)return d;f=c.chromecast||null;e=c.abr||null;g=d;e&&typeof e.defaultBandwidthEstimate===
|
|
117
|
+
_.h?g.initialBandwidth=e.defaultBandwidthEstimate:g.initialBandwidth=void 0;yX(c,d);e={};g=c.streaming||null;f&&f.useSenderStreamingConfig&&g&&(e.streaming=$V(g,PX));c=c.abr||null;f&&f.useSenderAbrConfig&&c&&(e.abr=$V(c,QX));_.N.Zb(e)&&(d=vX(d,e));return d};_.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r=zX.prototype;_.r.init=function(a){var b=this;a&&(this.f=new tX,_.Qt(a,this.f),this.m=a,this.l.on(window,"unload",function(){return _.I(function(c){return b.m&&0!==b.m.getPlayerState()?_.x(c,XV(b.m),0):c.C(0)})}))};
|
|
118
|
+
_.r.start=function(a){var b=this;if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var c=CX(),d=CX().getPlayerManager(),e=new cast.framework.CastReceiverOptions;a&&null!=a.useShakaForHls&&(e.useShakaForHls=a.useShakaForHls);e.customNamespaces={};e.customNamespaces[TV]=cast.framework.system.MessageType.JSON;e.customNamespaces[UV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.gn.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};
|
|
119
119
|
a.enableSmoothLiveRefresh=!0;e.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())e.mediaElement=a;e.disableIdleTimeout=!0;e.maxInactivity=Infinity;this.h&&(e.queue=this.h);d.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,function(f){b.g.info("QUEUE_UPDATE message received",f);var g=b.getQueueManager();if(!g)return f;g=g.getCurrentItem();return g?(g=g.customData)&&!1===g.skippable?null:f:f});d.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.fn.bind(this));
|
|
120
|
-
d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.jn.bind(this));d.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.D);d.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.Mk.bind(this));c.start(e);c.addCustomMessageListener(
|
|
121
|
-
_.r.stop=function(){if(this.a){this.a=!1;this.l.release();var a=
|
|
122
|
-
_.r.removeMessageListener=function(a){typeof a===_.pe&&this.w["delete"](a)};_.r.sendMessage=function(a,b){
|
|
123
|
-
_.r.Mk=function(){var a=this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,
|
|
124
|
-
_.r.gn=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return
|
|
125
|
-
k.length-1;0<=l;--l){var m=k[l].getAttribute(_.Me)||g,n=k[l].getAttribute(_.Cd),p=k[l].getAttribute(_.ah)||void 0,q=k[l].getAttribute(_.qe)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(k[l])}e[f].getElementsByTagName(_.xb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ma).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Hb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=
|
|
120
|
+
d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.jn.bind(this));d.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.D);d.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.Mk.bind(this));c.start(e);c.addCustomMessageListener(TV,this.B);this.l.on(document,_.Sg,function(){var f={type:"event",name:_.Sg,visible:!document.hidden};CX().sendCustomMessage(UV,void 0,f)})}};
|
|
121
|
+
_.r.stop=function(){if(this.a){this.a=!1;this.l.release();var a=CX();CX().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.D);a.removeCustomMessageListener(TV,this.B);a.stop();this.j=this.h=this.m=this.f=null}};_.r.We=function(a){this.o=a};_.r.Yo=function(a){this.A=a};_.r.on=function(a,b){CX().addEventListener(a,b)};_.r.off=function(a,b){CX().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.pe&&this.w.add(a)};
|
|
122
|
+
_.r.removeMessageListener=function(a){typeof a===_.pe&&this.w["delete"](a)};_.r.sendMessage=function(a,b){CX().sendCustomMessage(TV,b,a)};_.r.Pd=function(){return this.a};_.r.Og=function(){return this.a};_.r.Vb=function(){return DX()};_.r.tc=function(a){EX(this,a)};_.r.up=function(a){var b=DX(),c=null;a?c=Object.assign({},b,a):c=b;EX(this,c)};_.r.$o=function(a){this.h=a;this.j=null};_.r.getQueueManager=function(){return CX().getPlayerManager().getQueueManager()};
|
|
123
|
+
_.r.Mk=function(){var a=this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,CX().sendCustomMessage(TV,void 0,{type:MV,index:a})))};
|
|
124
|
+
_.r.gn=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return GX(this,a);try{var b=(new DOMParser).parseFromString(a,_.og)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=CX();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ma),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.Kg||g===_.Rc){g=e[f].getAttribute(_.Me);for(var k=e[f].getElementsByTagName(_.xb),l=
|
|
125
|
+
k.length-1;0<=l;--l){var m=k[l].getAttribute(_.Me)||g,n=k[l].getAttribute(_.Cd),p=k[l].getAttribute(_.ah)||void 0,q=k[l].getAttribute(_.qe)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(k[l])}e[f].getElementsByTagName(_.xb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ma).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Hb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=CX();c=a.getElementsByTagName("StreamIndex");
|
|
126
126
|
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Kg){e=c[d].getElementsByTagName(_.vb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.eb)||void 0,k=e[f].getAttribute(_.db)||void 0,void 0!==g&&(g=+g),void 0!==k&&(k=+k),b.canDisplayType(_.Og,void 0,g,k)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.vb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
127
|
-
_.r.fn=function(a){var b=this,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=
|
|
128
|
-
break}b.f.D=!0;return _.x(l,_
|
|
129
|
-
break}return _.x(l,Promise.resolve(b.A(c)),11);case 11:(k=l.f)&&(c=k);case 10:return l["return"](c)}})};_.r.jn=function(a){var b=a.media;b&&b.tracks&&b.tracks.length&&
|
|
130
|
-
_.r.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
_.r.
|
|
134
|
-
_.r.
|
|
135
|
-
default:this.f||(this.f=
|
|
127
|
+
_.r.fn=function(a){var b=this,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=ZV(c.media.customData.playerConfiguration));if(!b.m||!d){l.C(2);break}if(!b.o){l.C(3);break}return _.x(l,Promise.resolve(b.o(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.C(5);break}return _.x(l,hX(c.media,d.ima,b.m.getNetworkEngine()),5);case 5:typeof d.startTime===_.h&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.C(7);
|
|
128
|
+
break}b.f.D=!0;return _.x(l,_.$t(b.m,d),8);case 8:return _.x(l,_.au(b.m),9);case 9:f=b.m.bb(),c.media.contentId=f.url,c.media.contentType=f.type,f.videoMimeType&&(c.media.hlsVideoSegmentFormat=bW(f.videoMimeType,_.jm)),f.audioMimeType&&(c.media.hlsSegmentFormat=bW(f.audioMimeType,_.im));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.h){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.A){l.C(10);
|
|
129
|
+
break}return _.x(l,Promise.resolve(b.A(c)),11);case 11:(k=l.f)&&(c=k);case 10:return l["return"](c)}})};_.r.jn=function(a){var b=a.media;b&&b.tracks&&b.tracks.length&&HX(b.tracks);if((b=a.items)&&b.length){b=_.v(b);for(var c=b.next();!c.done;c=b.next())(c=(c=c.value)&&c.media)&&c.tracks&&c.tracks.length&&HX(c.tracks)}return a};
|
|
130
|
+
_.r.Tn=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.Tm;var b=CX().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.m.getConfiguration().startTime;typeof d!==_.h||typeof c!==_.h||typeof e!==_.h||a(e,d,c)||(b=b.getMediaTimeForAbsoluteTime(e),typeof b===_.h&&a(b,d,c)&&this.m.setPosition(b))}_.Vt(this.m)}};_.r.Lk=function(a){this.w.forEach(function(b){return b(a.data)})};_.J(SV,zX);zX.prototype.getQueueManager=zX.prototype.getQueueManager;
|
|
131
|
+
zX.prototype.setQueue=zX.prototype.$o;zX.prototype.updateContentMetadata=zX.prototype.up;zX.prototype.setContentMetadata=zX.prototype.tc;zX.prototype.getContentMetadata=zX.prototype.Vb;zX.prototype.isApiReady=zX.prototype.Pd;zX.prototype.sendMessage=zX.prototype.sendMessage;zX.prototype.removeMessageListener=zX.prototype.removeMessageListener;zX.prototype.addMessageListener=zX.prototype.addMessageListener;zX.prototype.off=zX.prototype.off;zX.prototype.on=zX.prototype.on;
|
|
132
|
+
zX.prototype.setLoadRequestDataInterceptor=zX.prototype.Yo;zX.prototype.setPlayerConfigInterceptor=zX.prototype.We;zX.prototype.stop=zX.prototype.stop;zX.prototype.start=zX.prototype.start;zX.prototype.init=zX.prototype.init;zX.getInstance=BX;var AX=null;_.r=JX.prototype;_.r.load=function(){return _.I(function(a){_.z(a)})};_.r.Bb=function(){return!0};_.r.Tc=function(){};_.r.Ta=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};_.r.skip=function(){var a=this.h.a;a&&this.h.sendMessage(VV,{type:"SKIP_AD",requestId:eW(),mediaSessionId:a.mediaSessionId})};_.r.getAdVolume=function(){return this.h.getVolume()||0};_.r.Pa=function(a){this.h.setVolume(a)};_.r.setMuted=function(a){this.h.setMuted(a)};_.r.isMuted=function(){return!!this.h.isMuted()};
|
|
133
|
+
_.r.Sa=function(){return this.a?this.a.isPlayingBreak:!1};_.r.isPaused=function(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1};_.r.getPosition=function(){var a=-1,b=this.h.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.h&&(a=b));return a};_.r.Qc=function(){return!0};_.r.Bc=function(){var a=this;return _.I(function(b){a.j.release();_.z(b)})};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.Ta()};_.r.resume=function(){this.Bb()};
|
|
134
|
+
_.r.no=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.h.trigger(new _.R(_.Dc,{adsTimeline:new bX(a.breaks)})));break;case "isPlayingBreak":a.value?KX(this,_.gc):(KX(this,_.kc,this.f),KX(this,_.yc,this.f),this.f=null,KX(this,_.hc));break;case "isPaused":this.f&&(a.value?KX(this,_.sc):KX(this,_.vc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(KX(this,_.kc,this.f),KX(this,_.yc,this.f),this.f=LX(this),KX(this,_.xc,this.f)));break;
|
|
135
|
+
default:this.f||(this.f=LX(this))&&KX(this,_.xc,this.f)}};JX.prototype.resume=JX.prototype.resume;JX.prototype.pause=JX.prototype.pause;JX.prototype.getVolume=JX.prototype.getVolume;JX.prototype.setVolume=JX.prototype.setVolume;JX.prototype.getPosition=JX.prototype.getPosition;JX.prototype.skip=JX.prototype.skip;MX.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};MX.prototype.a=function(a,b){return a.namespace()!==_.wd?!1:!(!b||!b.ima)};MX.prototype.create=function(a){return new JX(a.a)};NX.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};NX.prototype.a=function(a,b){return BX().Og()?!(!b||!b.ima):!1};NX.prototype.create=function(a){return new dX(a)};_.J("clpp.cast.createCastQueue",function(){OX=function(){return cast.framework.QueueBase.apply(this,arguments)||this};_.w(OX,cast.framework.QueueBase);OX.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 OX});_.Zq(new MX);_.Zq(new NX);};
|
|
136
136
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
137
137
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
138
138
|
else{_=this.clpp._;(f.call(g,this));}
|