@castlabs/prestoplay 6.33.0 → 6.34.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/CHANGELOG.md +16 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +19 -19
- package/cjs/cl.cast.js +129 -129
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +633 -624
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +101 -101
- package/cjs/cl.externs.js +48 -72
- 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 +26 -26
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +357 -353
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -5
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +73 -73
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +36 -36
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +100 -100
- package/cl.conviva.js +27 -27
- package/cl.core.js +510 -502
- package/cl.crypto.js +9 -9
- package/cl.dash.js +90 -90
- package/cl.externs.js +51 -63
- 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 +20 -20
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +308 -306
- package/cl.muxdata.js +13 -13
- 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 +61 -61
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +1 -1
- package/typings.d.ts +33 -46
package/cl.cast.js
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
_.
|
|
3
|
-
new Set(b);return Object.keys(a).reduce((d,e)=>{c.has(e)&&(d[e]=a[e]);return d},{})},
|
|
4
|
-
chrome.cast.media.HlsSegmentFormat,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 _.
|
|
5
|
-
chrome.cast.media;if(!b)throw new _.
|
|
6
|
-
c.type===b)},
|
|
7
|
-
a.activeTrackIds||[]:[]).map(b=>b.toString())},
|
|
8
|
-
a.Aa.bind(a));a.F.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.
|
|
12
|
-
g;typeof b.
|
|
13
|
-
a.setMuted(b.Fa.muted);null!=b.Fa.volume&&a.setVolume(b.Fa.volume)}}})},
|
|
14
|
-
a.W);b.addMessageListener(
|
|
15
|
-
(d.ima.playAdsAfterTime=d.startTime);c.
|
|
16
|
-
a.a.setPosition(b)},
|
|
17
|
-
{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=
|
|
18
|
-
|
|
19
|
-
h)=>g.position-h.position).findIndex(g=>g===e)));c=new Y(d,e,b.index,b.total,f)}return c},
|
|
20
|
-
value:b&&b.value||"",eventElement:b?b.eventElement:null}}
|
|
21
|
-
null,d.customData&&(b.mimeType=d.customData.mimeType||b.mimeType,b.src=d.customData.url||b.src),b.renditions.push(new _.
|
|
22
|
-
f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.
|
|
23
|
-
for(var g,h;f.length&&!h;)g=f.shift(),h=e.
|
|
24
|
-
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},
|
|
25
|
-
(
|
|
26
|
-
a=
|
|
27
|
-
c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},
|
|
28
|
-
a.l.trigger(new _.H(b,d))},
|
|
29
|
-
f,g,a)},
|
|
30
|
-
reason:this.j}}))):
|
|
31
|
-
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.a(
|
|
32
|
-
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;const 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 _.
|
|
33
|
-
_.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{
|
|
37
|
-
a}
|
|
38
|
-
new _.
|
|
39
|
-
this.a.play(null,a,b)}):Promise.resolve()}pause(){return this.f?new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(
|
|
40
|
-
this.a.seek(d,()=>{this.trigger(new _.H(_.
|
|
41
|
-
this.a.playbackRate||0:0}setPlaybackRate(a){this.f&&this.a&&0<a&&this.sendMessage(
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var QU="Cannot seek during ads playout.",RU="Cannot switch track",SU="Media session does not exist.",TU="No receivers available",UU="QUEUE_ITEM_CHANGED",VU="Reset ABR functionality not available on cast.",WU="SDK not yet ready",XU="Sender is destroyed.",YU="clpp.cast.CastProxy",ZU="clpp.cast.Player",$U="clpp.cast.Receiver",aV="urn:x-cast:castlabs",bV="urn:x-cast:castlabs:int",cV="urn:x-cast:com.google.cast.media",dV="volume control is not supported",eV=function(a){return _.v(function*(){yield _.Tr(a,
|
|
2
|
+
_.Ge);yield _.Tr(a,_.Fe)})},fV=function(a){return JSON.stringify(a,(b,c)=>{if("license"!==b&&typeof c!==_.Wd){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.Be?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.r?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},gV=function(a){if(typeof a!==_.Nf)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},hV=function(a,b){const c=
|
|
3
|
+
new Set(b);return Object.keys(a).reduce((d,e)=>{c.has(e)&&(d[e]=a[e]);return d},{})},iV=function(a,b,c,d){return _.v(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.Kl(d,a.mimeType,g);f&&g&&(h=_.ck(a.url),(h=yield c.fetch(h).V)&&h.data&&(e=f.a(_.E(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},jV=function(a,b){let c,d;if(window.chrome&&chrome.cast&&chrome.cast.media)c=
|
|
4
|
+
chrome.cast.media.HlsSegmentFormat,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 _.qg:return d.FMP4;case _.pg:return b===_.N?d.MPEG2_TS:c.TS;case _.Dc:return c.AAC;case _.Ec:return c.AC3;case _.Fc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Gc:return c.FMP4}},lV=function(a){a=void 0===a?kV:a;var b=cast.framework.messages||
|
|
5
|
+
chrome.cast.media;if(!b)throw new _.J(1,8,8001);const 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}},mV=function(){return Math.round(1E3*Math.random())},nV=function(a,b){return a.h.filter(c=>
|
|
6
|
+
c.type===b)},pV=function(a,b){const c=oV(a);return nV(a,b).find(d=>c.includes(d.id))||null},rV=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.L){const e=a.ua();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,()=>{a.f[b]=null;qV(a,b)},e=>{a.f[b]=null;a.g.debug(RU,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{qV(a,b)},e=>{a.g.debug(RU,e)}))},oV=function(a){a=a.a?a.a.a:null;return(a?
|
|
7
|
+
a.activeTrackIds||[]:[]).map(b=>b.toString())},qV=function(a,b){b===_.M?a.a.trigger(new _.H(_.Jc)):b===_.L&&a.a.trigger(new _.H(_.Vf))},wV=function(a){if(a){for(const b of sV)tV(b);uV=!0;for(const b of vV)b()}},tV=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.S.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.F.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,
|
|
8
|
+
a.Aa.bind(a));a.F.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Jb.bind(a));a.f=!0;a.L.resolve();a.w.Ef();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);xV&&a.w.la(.02)}},yV=function(a){return _.v(function*(){a.F.release();
|
|
9
|
+
sV.delete(a);if(a.f){a.f=!1;var b=cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}b=[];a.h&&(b.push(a.h.destroy()),a.h=null);a.l&&(b.push(a.l.destroy()),a.l=null);yield Promise.all(b);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.R=null;a.Z=null})},zV=function(a){return _.v(function*(){a.ya()||(yield cast.framework.CastContext.getInstance().requestSession())})},
|
|
10
|
+
BV=function(a,b,c){c=void 0===c?0:c;return _.v(function*(){var d=a.h.ua();d&&d.language&&(a.j.preferredTextLanguage=d.language);(d=a.h.ra())&&d.language&&(a.j.preferredAudioLanguage=d.language);yield AV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),mf:a.getPresentationStartTime(),autoplay:b,Fa:a.j})})},AV=function(a,b){return _.v(function*(){if(a.f){var c=chrome.cast.media.StreamType;yield zV(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
|
|
11
|
+
b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=jV(b.videoMimeType,_.N);e.hlsSegmentFormat=jV(c,_.M);b.Fa&&(a.J&&(c=yield Promise.resolve(a.J(b.Fa)))&&(b.Fa=c),a.j=b.Fa,a.C=_.gp(a.j),a.B=a.C.findIndex(k=>k.url===b.source.url),b.Fa.remoteTextTracks&&(c=yield Promise.all(b.Fa.remoteTextTracks.map(a.bb.bind(a))),e.tracks=c.filter(k=>k),b.Fa.remoteTextTracks=void 0),delete b.Fa.autoplay,b.Fa.startTime=null,e.customData={playerConfiguration:fV(b.Fa)});c=
|
|
12
|
+
a.Lb()||{};var f=CV(c.metadataType),g;typeof b.mf===_.r&&(g={metadataType:f,sectionStartAbsoluteTime:b.mf});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=DV(c);if(g=EV(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);(g=b.queueData)&&g.items&&0<g.items.length&&(h=new chrome.cast.media.QueueData,h.items=g.items,h.startIndex=g.startIndex,e.queueData=h);typeof b.autoplay===_.Mc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.r&&(e.currentTime=b.currentTime);
|
|
13
|
+
yield d.loadMedia(e);null!=b.Fa.muted&&a.setMuted(b.Fa.muted);null!=b.Fa.volume&&a.setVolume(b.Fa.volume)}}})},EV=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(FV);for(const d of c){const [e,f]=d;if(f===b){b=e;break a}}b=null}if(!b)return null;b=lV(FV[b]);return Object.assign(b,a)},CV=function(a){var b=void 0===b?kV:b;return Object.values(FV).includes(a)?a:b},DV=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},HV=function(a,b){GV(a,b.getMediaSession());
|
|
14
|
+
b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.W);b.addMessageListener(aV,a.P);b.addMessageListener(bV,a.U)},IV=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.r?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},GV=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.H(_.le)))},LV=function(a){return new JV(a.h,()=>{a.trigger(new _.H(_.Sc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=
|
|
15
|
+
c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Tf&&(d.preferredAudioLanguage=c.Tf);c.Zg&&(d.preferredTextLanguage=c.Zg);_.Rr(a.f,null);a.trigger(new _.H("castingended"));a.j(b,d)}},()=>KV(a))},KV=function(a){return _.v(function*(){a.trigger(new _.H(_.Rc));if(a.f.a!==a.a&&a.a){var b=null!=a.f.Ra();yield a.f.release();_.Rr(a.f,a.a);b&&(_.as(a.f),(b=a.f.getAdsManager())&&(yield b.load()))}})},MV=function(a){a.trigger(new _.H(_.df))},OV=function(a){NV(a);
|
|
16
|
+
const b=Math.min(a.a.Fd().length-1,a.a.getPosition()+1);a.a.setPosition(b)},NV=function(a){a.j||(a.a.on(_.cf,a.o),a.j=!0)},PV=function(a){return a.map(b=>{const c={};c.media={contentId:b.configuration.source};c.customData={skippable:!1!==b.skippable};return c})},TV=function(a,b,c){return _.v(function*(){var d=b.adTagUrl;if(d)try{QV=!1;const e=_.ck(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.vi(f.data),h=(new DOMParser).parseFromString(g,_.Uf);if(h.getElementsByTagName("vmap:VMAP").length)RV.warn("VMAP detected."),
|
|
17
|
+
a.vmapAdsRequest=SV(g);else if(h.getElementsByTagName("VAST").length){RV.warn("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=SV(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else RV.warn("Unsupported schema."),QV=!0}}catch(e){RV.warn("Failed to fetch an ad",e),QV=!0}})},SV=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},UV=function(a,b){b=new _.J(1,10,10003,{errorType:b});
|
|
18
|
+
a.m.onError(b)},VV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},XV=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=WV(a,c))&&(d={ad:c});a.m.trigger(new _.H(b,d))}},WV=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Nf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Nf&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>
|
|
19
|
+
g.breakClipIds.includes(d.id))||null),e&&(f=a.a.getBreaks().filter(g=>0<=g.position).sort((g,h)=>g.position-h.position).findIndex(g=>g===e)));c=new Y(d,e,b.index,b.total,f)}return c},YV=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]},ZV=function(a){const b=a.dashTimedMetadata;let c=_.ig;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.hg)?
|
|
20
|
+
_.bj:_.fg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},$V=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},bW=function(a){a.a=$V().getTextTracksManager();const b=a.a.getTracks();a.j=aW(_.L,b)},aW=function(a,b){const c=[];for(const d of b)b=new _.jl(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||null,b.language=d.language||null,b.originalLanguage=d.language||null,b.label=
|
|
21
|
+
d.name||null,b.src=d.trackContentId||null,b.mimeType=d.trackContentType||null,d.customData&&(b.mimeType=d.customData.mimeType||b.mimeType,b.src=d.customData.url||b.src),b.renditions.push(new _.nl(b.id,b)),c.push(b);return c},cW=function(a,b,c,d){c=_.kj(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.sa());if(c=c.find(g=>{const h=_.Tj(g);return f.some(k=>{k=_.Tj(k.language||"");return _.Uj(h,k)})})){const g=_.Tj(c);c=f.filter(h=>{h=_.Tj(h.language||"");return _.Uj(g,h)});
|
|
22
|
+
f=c.length?c:f;e=e||!!c.length}_.Ei(d)&&(c=f.filter(g=>g.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===_.M?a.za(e):b===_.L&&a.$a(e))},dW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},gW=function(a,b){var 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=_.mk(d);if(e){var f=[_.rd];_.gp(a)[0].type!==
|
|
23
|
+
_.Bc&&f.unshift(_.td);d.preferredDrmSystem===_.rd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.La[g];h?(c=g===_.td?cast.framework.ContentProtection.WIDEVINE:g===_.rd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},eW(b,h,a,c),fW(b,h,a,c)):c()}else c()}else c()},hW=function(a,b){b=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:b})},eW=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=
|
|
24
|
+
e=>{const f=_.ck({method:_.bb,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},fW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.v(function*(){const g=_.gk(Object.assign({},f.headers),e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.E(g.data)}):
|
|
25
|
+
a.licenseHandler=void 0},kW=function(){return iW||(iW=new jW)},lW=function(){return cast.framework.CastReceiverContext.getInstance()},mW=function(){const a=lW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},nW=function(a,b){const c=lW().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,lW().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},pW=function(a,
|
|
26
|
+
b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=lW();var {hlsVideoSegmentFormat:d}=lW().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.qg:_.pg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");b=b.split(/\n+/m);d=[];let e=0;for(;e<b.length;){const f=b[e].trim();if(b[e].startsWith("#EXT-X-STREAM-INF")){const g=oW(f,_.qa),h=oW(f,_.ib);let [k,l]=[];h&&([k,l]=h.split("x").map(m=>+m));if(!a.canDisplayType(c,g,k,l)){e+=2;continue}}d.push(f);++e}return d.join("\n")},
|
|
27
|
+
oW=function(a,b){let c;b+="\x3d";let d=a.indexOf(b);0<=d&&(c=a.substring(d+b.length),c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},qW=function(a){for(const b of a)a={},b.customData&&_.$g(b.customData)&&(a=b.customData),b.roles&&(a.roles=b.roles),b.audioTrackInfo&&(a.audioTrackInfo=b.audioTrackInfo),_.$g(a)&&(b.customData=a)},rW=function(a){_.v(function*(){yield a.l.L;a.a=a.l.o;a.B.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,
|
|
28
|
+
a.C.bind(a))})},sW=function(a,b,c){let d=null;c&&(d={ad:c});a.l.trigger(new _.H(b,d))},tW=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks;const c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,h=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=h&&d))return null;const k=b.find(l=>l.id===e)||null;a=0;k&&(a=0>=k.position?k.position:b.filter(l=>0<=l.position).sort((l,m)=>l.position-m.position).findIndex(l=>
|
|
29
|
+
l===k));b=c.find(l=>l.id===h)||null;return new Y(b,k,f,g,a)},uW,kV=0,FV={GENERIC:kV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},vW="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),wW="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");var xW=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.o=this.h=0;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(0)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===_.C&&this.a(3)}a(a){if(a!==this.h)if(3===this.h&&0!==a)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.h;this.h=a;6===this.h?(this.B=b,this.player.trigger(new _.H(_.Oc,{detail:{bufferedTimeMS:-1,
|
|
30
|
+
reason:this.j}}))):6===this.o&&this.player.trigger(new _.H(_.Nc,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.h,previousState:this.o,timeSinceLastStateChangeMS:b-this.C};this.C=b;this.l&&_.$o(this.l,this.h);this.player.trigger(new _.H(_.af,{detail:a}))}}};var yW=class extends xW{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.dc.bind(this)}init(){const a=this.player,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.o)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.o;b&&b.isPlayingBreak||super.a(a)}dc(){if(this.f&&
|
|
31
|
+
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.a(11);break;case chrome.cast.media.IdleReason.ERROR:this.a(3);break;default:this.a(0)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(8);break;case chrome.cast.media.PlayerState.PAUSED:this.a(10);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(6)}}};var zW=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}}initialize(a){this.a=a}release(){this.h=[];this.f={}}load(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(b=>{switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.N;break;case chrome.cast.media.TrackType.AUDIO:c=_.M;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.jl(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
|
|
32
|
+
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;const 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 _.nl(c.id,c));return c}):[],this.a.trigger(new _.H(_.ag)))}destroy(){this.a=null}getVideoTracks(){return nV(this,_.N)}getAudioTracks(){return nV(this,
|
|
33
|
+
_.M)}sa(){return nV(this,_.L)}ta(){const a=this.Ha();return a?a.renditions[0]:null}Pa(){const a=this.ra();return a?a.renditions[0]:null}Wa(){const a=this.ua();return a?a.renditions[0]:null}wb(){return this.f[_.N]||null}Nb(){return this.f[_.M]||null}Ob(){return this.f[_.L]||null}Ha(){return pV(this,_.N)}ra(){return pV(this,_.M)}ua(){return pV(this,_.L)}Fb(a){rV(this,_.N,a)}za(a){rV(this,_.M,a)}$a(a){rV(this,_.L,a)}rb(a){this.Fb(a&&a.track)}Db(a){this.za(a&&a.track)}Eb(a){this.$a(a&&a.track)}addTextTrack(){return _.v(function*(){})}va(){return!0}};
|
|
34
|
+
zW.prototype.isAbrEnabled=zW.prototype.va;zW.prototype.addTextTrack=zW.prototype.addTextTrack;zW.prototype.setTextRendition=zW.prototype.Eb;zW.prototype.setAudioRendition=zW.prototype.Db;zW.prototype.setVideoRendition=zW.prototype.rb;zW.prototype.setTextTrack=zW.prototype.$a;zW.prototype.setAudioTrack=zW.prototype.za;zW.prototype.setVideoTrack=zW.prototype.Fb;zW.prototype.getTextTrack=zW.prototype.ua;zW.prototype.getAudioTrack=zW.prototype.ra;zW.prototype.getVideoTrack=zW.prototype.Ha;
|
|
35
|
+
zW.prototype.getLoadingTextRendition=zW.prototype.Ob;zW.prototype.getLoadingAudioRendition=zW.prototype.Nb;zW.prototype.getLoadingVideoRendition=zW.prototype.wb;zW.prototype.getTextRendition=zW.prototype.Wa;zW.prototype.getAudioRendition=zW.prototype.Pa;zW.prototype.getVideoRendition=zW.prototype.ta;zW.prototype.getTextTracks=zW.prototype.sa;zW.prototype.getAudioTracks=zW.prototype.getAudioTracks;zW.prototype.getVideoTracks=zW.prototype.getVideoTracks;var JV=class extends _.lu{constructor(a,b,c,d){super();this.g=new _.S(_.gd);this.S=a;this.w=new _.Jh(b);this.R=c;this.Z=d;this.j=this.G=_.lm();this.C=[];this.B=0;this.I=new _.Cr;this.a=null;this.f=!1;this.L=new _.uk;this.A=!1;this.ca="";this.ja=1E6;this.h=new zW;this.h.initialize(this);this.l=new yW(this);this.F=new _.Et;this.H=null;this.K=new Set;this.M=this.cb.bind(this);this.da=this.Ub.bind(this);this.W=this.Hb.bind(this);this.P=this.Ib.bind(this);this.U=this.lb.bind(this);this.o=this.J=null;window.cast||
|
|
36
|
+
Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{wV(!0)},0)}});tV(this);sV.add(this)}init(a,b){this.j=this.G=b}unload(){return this.f?new Promise((a,b)=>{this.h&&this.h.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)}):Promise.resolve()}release(){return this.f?this.unload().then(()=>{this.l&&this.l.release()}):Promise.resolve()}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.v(function*(){})}Xd(a){this.J=
|
|
37
|
+
a}ed(){return this.f}ya(){return this.A}We(){return this.ca}sendMessage(a,b){const c=this;return _.v(function*(){if(c.f){var d=cast.framework.CastContext.getInstance().getCurrentSession();if(d)try{yield d.sendMessage(a,b)}catch(f){var e=new _.J(1,8,8E3,{detailedErrorCode:f})}else e=new _.J(1,8,8004,void 0);if(e)c.onError(e)}})}cast(){const a=this;return _.v(function*(){if(!a.ed())throw a.g.warn(WU),new _.J(1,8,8001,void 0);if(!xV)throw a.g.warn(TU),new _.J(1,8,8002,void 0);if(a.ya())throw a.g.warn("Already casting"),
|
|
38
|
+
new _.J(1,8,8003,void 0);try{yield zV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.J(1,8,8E3,c);}})}oe(){this.f&&this.ya()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Wd&&this.K.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.K.delete(a)}play(){return this.f?this.isEnded()?BV(this,!0):new Promise((a,b)=>{if(!this.a)return b(SU);
|
|
39
|
+
this.a.play(null,a,b)}):Promise.resolve()}pause(){return this.f?new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(SU);this.a.pause(null,a,b)}):Promise.resolve()}isPaused(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1}isEnded(){return this.f?11===this.getState():!1}seek(a){return this.f?this.isEnded()?BV(this,!1,a):new Promise((b,c)=>{this.a||c(SU);this.o.isPlayingBreak&&c(QU);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.H(_.kg));
|
|
40
|
+
this.a.seek(d,()=>{this.trigger(new _.H(_.jg));b()},c)}):Promise.resolve()}getPosition(){return this.f?this.getMediaPosition():0}getMediaPosition(){return this.f?this.a&&this.a.getEstimatedTime()||0:0}getDuration(){return this.f?this.getMediaDuration():0}getMediaDuration(){if(!this.f)return 0;if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.r?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.f?this.a&&
|
|
41
|
+
this.a.playbackRate||0:0}setPlaybackRate(a){this.f&&this.a&&0<a&&this.sendMessage(cV,{type:"SET_PLAYBACK_RATE",requestId:mV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.f?this.a&&this.a.volume.level:0}setVolume(a){this.f&&this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.f?this.a&&this.a.volume.muted:!1}setMuted(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,
|
|
42
42
|
a)),this.a.setVolume(a))}getPresentationStartTime(){if(!this.f)return 0;if(!this.a||!this.a.media||!this.a.media.metadata)return null;const a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.r?null:1E-8===a?0:a}getSeekRange(){if(!this.f)return{start:0,end:0};let a={start:0,end:this.getDuration()};if(this.isLive()){const b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.f?this.l?this.l.getState():
|
|
43
|
-
|
|
44
|
-
a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(
|
|
45
|
-
{};a={metadataType:
|
|
46
|
-
cast.framework.CastState.CONNECTED;
|
|
47
|
-
this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:
|
|
48
|
-
a.value.tracks&&this.h&&this.h.load()}
|
|
49
|
-
url:a.url});return c})}getTextDisplayer(){return null}},
|
|
50
|
-
c.a){{let e=null;const f=c.f.
|
|
51
|
-
currentTime:Math.max(c.f.getPosition()-1,0),
|
|
52
|
-
yield b.a.sendMessage(
|
|
53
|
-
this.a.addMessageListener(a):this.g.warn(
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
0:0}getStats(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?gV(this.a.customData.stats):_.dp():_.dp()}isLive(){return this.f?Infinity===this.getDuration():!1}load(a){const b=this;return _.v(function*(){if(b.ed())if(xV){b.C=_.gp(a);b.j=_.nm([b.G,a]);var c=b.C[b.B];yield AV(b,{source:c,isLive:c.isLive,autoplay:b.j.autoplay,Fa:b.j,videoMimeType:c.videoMimeType,audioMimeType:c.audioMimeType})}else b.g.warn(TU);else b.g.warn(WU)})}getBufferInfo(){return new _.iu}getTrackManager(){return this.h}getConfiguration(){return this.j}getSurface(){return null}setNetworkEngine(a){this.I=
|
|
44
|
+
a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(VU)}onError(a){if(a&&(this.trigger(new _.H(_.Sd,{detail:a})),this.l))this.l.onError(a)}namespace(){return _.gd}canPlay(){return this.ed()?2:0}Lb(){return this.H}fc(a){this.H=EV(a)}Se(){this.H=null}zf(a){if(this.f){var b=this.Lb()||
|
|
45
|
+
{};a={metadataType:CV(b.metadataType),title:a};this.fc(Object.assign({},b,a))}}xf(a){if(this.f){var b=this.Lb()||{},c=CV(b.metadataType);a=new chrome.cast.Image(a);this.fc(Object.assign({},b,{metadataType:c,images:[a]}))}}wf(a){if(this.f){var b=this.Lb()||{};this.fc(Object.assign({},b,{metadataType:3,artist:a}))}}yf(a){if(this.f){var b=this.Lb()||{};a={metadataType:CV(b.metadataType),releaseDate:a};this.fc(Object.assign({},b,a))}}cb(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===
|
|
46
|
+
cast.framework.CastState.CONNECTED;xV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ca=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Ef()}Ub(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;HV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ya()||(this.A=!0,HV(this,a.session),this.Z());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ya()&&
|
|
47
|
+
this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:IV(this),Zg:c,Tf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.W);a.session.removeMessageListener(aV,this.P);a.session.removeMessageListener(bV,this.U);this.A=!1;this.a=null}}Hb(a){this.g.debug("New media session",a.mediaSession);GV(this,a.mediaSession)}Jb(a){a.value&&
|
|
48
|
+
a.value.tracks&&this.h&&this.h.load()}Ib(a,b){const c=gV(b);this.K.forEach(d=>d(c))}lb(a,b){a=gV(b);"event"===a.type&&a.name===_.ug&&this.trigger(new _.H(_.Tc,{visible:!!a.visible}))}Aa(){this.trigger(new _.H(_.$f))}bb(a){const b=this;return _.v(function*(){let c=null;const d=yield iV(a,[_.Tf,_.Ac],b.I,b.j);d&&(c=new chrome.cast.media.Track(b.ja++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,
|
|
49
|
+
url:a.url});return c})}getTextDisplayer(){return null}},xV=!1,sV=new Set,uV=!1,vV=[];window.__onGCastApiAvailable=wV;_.w("clpp.cast.onReady",function(a){uV?a():vV.push(a)});var AW=class extends _.lu{constructor(a,b,c){super();this.f=a;this.h=b;this.j=this.l;typeof c===_.Wd&&(this.j=(d,e)=>c(_.Zo(d),e));this.a=LV(this);this.g=new _.S(YU);this.forwardEventsTo(this.f)}destroy(){const a=this;return _.v(function*(){a.a&&(yield yV(a.a),a.a=null);a.stopForwardingEventsTo(a.f)})}l(a,b){11!==a&&0!==a&&(delete b.license,this.f.open(b))}Qc(){return!!this.a&&this.a.ed()&&xV}ya(){return!!this.a&&this.a.ya()}We(){return this.a?this.a.We():""}Xd(a){this.a&&this.a.Xd(a)}cast(a,b){const c=
|
|
50
|
+
this;return _.v(function*(){if(c.a)try{if(yield c.a.cast(),c.a){{let e=null;const f=c.f.Ra();if(f){const g=c.f.getTrackManager(),h=g.getVideoTracks()[0];let k,l;h&&h.mimeType&&(k=h.mimeType);const m=c.f.getConfiguration(),n=g.ra();n&&(n.mimeType&&(l=n.mimeType),n.language&&(m.preferredAudioLanguage=n.language),n.roles.length&&(m.preferredAudioRole=n.roles[0]));const p=g.ua();p&&(p.language&&(m.preferredTextLanguage=p.language),p.roles.length&&(m.preferredTextRole=p.roles[0]));const u=f&&typeof f.isLive===
|
|
51
|
+
_.Mc?f.isLive:c.f.isLive();e={source:f,isLive:u,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),mf:c.f.getPresentationStartTime(),videoMimeType:k,audioMimeType:l,Fa:m}}var d=e}b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});yield KV(c);c.a&&(d&&(d.autoplay=!c.f.isPaused()),a?yield c.f.open(a):c.a.a||(yield AV(c.a,d)))}}catch(e){c.g.error("Error while trying to cast",e),d=new _.H(_.Sd,{detail:e}),c.trigger(d)}})}oe(){this.a&&this.a.oe()}Eh(a){const b=this;return _.v(function*(){a!==
|
|
52
|
+
b.h&&(b.h=a,b.a&&(yield yV(b.a)),b.a=LV(b))})}sendMessage(a){const b=this;return _.v(function*(){b.a?yield b.a.sendMessage(aV,a):b.g.warn(XU)})}Qg(){const a=this;return _.v(function*(){yield a.a.sendMessage(cV,{type:"QUEUE_NEXT",requestId:mV(),mediaSessionId:a.a.a.mediaSessionId})})}Rg(){const a=this;return _.v(function*(){yield a.a.sendMessage(cV,{type:"QUEUE_PREV",requestId:mV(),mediaSessionId:a.a.a.mediaSessionId})})}Pg(a){const b=this;return _.v(function*(){yield b.a.sendMessage(cV,{type:"QUEUE_INSERT",
|
|
53
|
+
requestId:mV(),mediaSessionId:b.a.a.mediaSessionId,items:a})})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(XU)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(XU)}Lb(){return this.a&&this.a.Lb()}fc(a){this.a&&this.a.fc(a)}Se(){this.a&&this.a.Se()}zf(a){this.a&&this.a.zf(a)}xf(a){this.a&&this.a.xf(a)}wf(a){this.a&&this.a.wf(a)}yf(a){this.a&&this.a.yf(a)}};_.w(YU,AW);AW.prototype.setContentReleaseDate=AW.prototype.yf;
|
|
54
|
+
AW.prototype.setContentArtist=AW.prototype.wf;AW.prototype.setContentImage=AW.prototype.xf;AW.prototype.setContentTitle=AW.prototype.zf;AW.prototype.clearContentMetadata=AW.prototype.Se;AW.prototype.setContentMetadata=AW.prototype.fc;AW.prototype.getContentMetadata=AW.prototype.Lb;AW.prototype.removeMessageListener=AW.prototype.removeMessageListener;AW.prototype.addMessageListener=AW.prototype.addMessageListener;AW.prototype.queueAddItems=AW.prototype.Pg;AW.prototype.queuePreviousItem=AW.prototype.Rg;
|
|
55
|
+
AW.prototype.queueNextItem=AW.prototype.Qg;AW.prototype.sendMessage=AW.prototype.sendMessage;AW.prototype.changeReceiverId=AW.prototype.Eh;AW.prototype.forceDisconnect=AW.prototype.oe;AW.prototype.cast=AW.prototype.cast;AW.prototype.setPlayerConfigInterceptor=AW.prototype.Xd;AW.prototype.getReceiverName=AW.prototype.We;AW.prototype.isCasting=AW.prototype.ya;AW.prototype.canCast=AW.prototype.Qc;AW.prototype.destroy=AW.prototype.destroy;var BW=class extends xW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.ca.bind(this);this.w=this.Z.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ja.bind(this);this.G=this.da.bind(this);this.F=this.P.bind(this);this.f=this.M.bind(this)}init(){const a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,
|
|
56
56
|
this.H);b.addEventListener(a.MEDIA_FINISHED,this.A);b.addEventListener(a.BUFFERING,this.w);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.F);b.addEventListener(a.BITRATE_CHANGED,this.f)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){const c=cast.framework.events.EventType,d=cast.framework.CastReceiverContext.getInstance().getPlayerManager();
|
|
57
|
-
d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.L);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.H(_.
|
|
58
|
-
this.a(
|
|
59
|
-
0;
|
|
60
|
-
a&&!1===a.skippable||
|
|
61
|
-
d=>{d&&d.type===
|
|
62
|
-
this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
0}
|
|
66
|
-
Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.
|
|
67
|
-
Y.prototype.getMediaHeight=Y.prototype.
|
|
68
|
-
Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getSourceId=Y.prototype.
|
|
69
|
-
|
|
70
|
-
cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=
|
|
71
|
-
_.
|
|
72
|
-
a):(this.f=!1,
|
|
73
|
-
_.
|
|
74
|
-
this.ra();return a&&a.renditions[0]}
|
|
75
|
-
this.f.setActiveById(+a.id)}
|
|
76
|
-
c.language;d.name=c.label;d.subtype=c.kind;d.trackContentId=c.url;d.trackContentType=c.mimeType;d.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([d]),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
cast.framework.messages.PlayerState,b=
|
|
80
|
-
cast.framework.messages.PlayerState.PAUSED}isEnded(){return
|
|
81
|
-
|
|
82
|
-
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,
|
|
83
|
-
_.
|
|
84
|
-
d.autoplay=b.h.autoplay;typeof b.h.startTime===_.r&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:
|
|
85
|
-
a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return
|
|
86
|
-
b.getStartAbsoluteTime();c&&typeof b===_.r&&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;const e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&(!e||e&&f)){d=
|
|
87
|
-
h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=
|
|
88
|
-
b;if(!c)return b;e=c.chromecast||null;a=c.abr||null;d=b;a&&typeof a.defaultBandwidthEstimate===_.r?d.initialBandwidth=a.defaultBandwidthEstimate:d.initialBandwidth=void 0;
|
|
89
|
-
a&&null!=a.useShakaForHls&&(d.useShakaForHls=a.useShakaForHls);d.customNamespaces={};d.customNamespaces[
|
|
57
|
+
d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.L);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.H(_.Qe));this.a(8)}R(){this.a(10)}ca(){this.a(11)}Z(a){a.isBuffering?
|
|
58
|
+
this.a(6):(a=this.player.isPaused()?10:8,this.a(a))}W(){this.j=1;this.player.trigger(new _.H(_.kg))}U(){this.player.trigger(new _.H(_.jg))}ja(){this.j=2}da(){this.a(2)}M(a){const b=this.player.getStats();this.player.trigger(new _.H(_.Lc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.J(_.C,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.H(_.Sd,{detail:a}));this.a(3)}};var CW=class extends _.lu{constructor(a=[],b=0){super();this.a=a.slice();this.f=b}Fd(){return this.a}getPosition(){return this.f}Mb(){return this.a[this.f]||null}tg(){return this.a[this.f+1]||null}setPosition(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.H(_.cf,{item:this.Mb()})))}append(a){this.a.push(a);MV(this)}xg(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),MV(this))}remove(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,MV(this))}clear(){this.a=[];this.f=
|
|
59
|
+
0;MV(this)}};var DW=class extends _.lu{constructor(a,b,c){c=void 0===c?()=>Promise.resolve():c;super();this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=()=>{const d=this;return _.v(function*(){if(!d.f){var e=d.a.Mb();if(e){d.f=!0;try{yield d.w(e),yield d.m.open(Object.assign({},e.configuration,{autoplay:!0}))}catch(f){throw f;}finally{d.f=!1}}}})};this.l=()=>{OV(this)}}start(){this.h||this.f||(this.h=!0,this.m.on(_.Rd,this.l),NV(this),this.a.setPosition(this.a.getPosition()))}next(){const a=this.a.Mb();
|
|
60
|
+
a&&!1===a.skippable||OV(this)}Ud(){var a=this.a.Mb();a&&!1===a.skippable||(NV(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))}cd(a){const b=this;return _.v(function*(){b.a.setPosition(a)})}stop(){this.h=!1;this.m.off(_.Rd,this.l);this.a.off(_.cf,this.o);this.j=!1}};var EW=class{constructor(a,b,c){this.player=a;this.Sb=new CW(c);this.pd=new DW({open:this.player.open.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.Sb,()=>_.v(function*(){}));this.a=new AW(this.player,b,(d,e)=>{const f=this;return _.v(function*(){const g=f.Sb.getPosition();f.pd.cd(g);e.autoplay=!0;delete e.license;yield f.player.open(e);typeof e.currentTime===_.r&&(yield f.player.setPosition(Math.max(e.currentTime-1,0)));f.player.play()})});this.f=
|
|
61
|
+
d=>{d&&d.type===UU&&typeof d.index===_.r&&this.Sb.setPosition(d.index)};this.a.addMessageListener(this.f)}zi(a){return this.Sb.on(_.cf,a)}Ai(a){return this.Sb.on(_.df,a)}wi(a){return this.player.on(_.Sc,a)}Qc(){return this.a.Qc()}ai(){return this.Sb.Fd()}ya(){return this.a.ya()}append(a){const b=this;return _.v(function*(){b.Sb.append(a);b.a.ya()&&(yield b.a.Pg(PV([a])))})}Vh(){return this.Sb.getPosition()}start(){this.pd.start()}play(){this.player.play()}pause(){this.player.pause()}destroy(){this.pd.stop();
|
|
62
|
+
this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}fj(){const a=this;return _.v(function*(){if(a.a.ya())a.a.oe();else{a.pd.stop();var b=PV(a.Sb.Fd()),c=a.Sb.getPosition();yield a.a.cast(void 0,{items:b,startIndex:c})}})}next(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Qg():yield a.pd.next()})}Ud(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Rg():yield a.pd.Ud()})}};_.w("clpp.cast.playlist.CastPlaylist",EW);EW.prototype.previous=EW.prototype.Ud;
|
|
63
|
+
EW.prototype.next=EW.prototype.next;EW.prototype.toggleCast=EW.prototype.fj;EW.prototype.destroy=EW.prototype.destroy;EW.prototype.pause=EW.prototype.pause;EW.prototype.play=EW.prototype.play;EW.prototype.start=EW.prototype.start;EW.prototype.getCurrentIndex=EW.prototype.Vh;EW.prototype.append=EW.prototype.append;EW.prototype.isCasting=EW.prototype.ya;EW.prototype.getPlaylistItems=EW.prototype.ai;EW.prototype.canCast=EW.prototype.Qc;EW.prototype.onCastStatusChanged=EW.prototype.wi;
|
|
64
|
+
EW.prototype.onPlaylistModified=EW.prototype.Ai;EW.prototype.onPlaylistItemChange=EW.prototype.zi;var Y=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.r?c:1;this.h=typeof d===_.r?d:1;this.j=typeof e===_.r?e:0}eb(){return"Google Cast Framework"}fb(){return cast.framework.VERSION}hb(){return 0}getId(){return this.a.id}getCreativeId(){return""}yb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||
|
|
65
|
+
0}Ab(){return!1}Qa(){return this.a.clickThroughUrl||null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}Ua(){return 0}Ta(){return 0}Ba(){return 0}Ca(){switch(this.ob()){case 0:return 0;case -1:return _.Mj;default:return _.Pj}}getPodIndex(){return this.j}ob(){return this.f.position}gb(){return this.l}Va(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}zb(){return null}};Y.prototype.getVideoElement=Y.prototype.zb;
|
|
66
|
+
Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.Va;Y.prototype.getPositionInSequence=Y.prototype.gb;Y.prototype.getPodTimeOffset=Y.prototype.ob;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ca;Y.prototype.getMediaBitrate=Y.prototype.Ba;
|
|
67
|
+
Y.prototype.getMediaHeight=Y.prototype.Ta;Y.prototype.getMediaWidth=Y.prototype.Ua;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.Qa;Y.prototype.isBumper=Y.prototype.Ab;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;
|
|
68
|
+
Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getSourceId=Y.prototype.yb;Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.hb;Y.prototype.getAdManagerVersion=Y.prototype.fb;Y.prototype.getAdManagerName=Y.prototype.eb;var FW=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Qb(){return!!this.a.find(a=>0===a.position)}Pb(){return!!this.a.find(a=>-1===a.position)}};FW.prototype.hasPostroll=FW.prototype.Pb;FW.prototype.hasPreroll=FW.prototype.Qb;FW.prototype.getCuePoints=FW.prototype.getCuePoints;var GW=class{constructor(a){this.m=a;this.a=null;this.B=this.C.bind(this);this.l=[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];this.f=!1;
|
|
69
|
+
VV().addEventListener(this.l,this.B)}load(){const a=this;return _.v(function*(){QV&&(QV=!1,UV(a,0))})}j(){return!0}A(){}Ia(){-1!==this.getPosition()&&VV().pause()}skip(){}getAdVolume(){RV.warn(dV);return 0}h(){RV.warn(dV)}setMuted(){}isMuted(){return!1}pb(){return-1!==this.getPosition()}isPaused(){return this.f}getPosition(){const a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.r?a:-1}w(){return!0}o(){const a=this;return _.v(function*(){VV().removeEventListener(a.l,a.B)})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.Ia()}resume(){this.j()}C(a){const b=
|
|
70
|
+
cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=VV().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.H(_.oc,{adsTimeline:new FW(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:XV(this,_.bc,a);break;case cast.framework.events.EventType.BREAK_STARTED:XV(this,_.Sb,a);break;case cast.framework.events.EventType.BREAK_ENDED:XV(this,_.Tb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:XV(this,
|
|
71
|
+
_.kc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(XV(this,_.ic,a),XV(this,_.lc,a)):a.endedReason===b.STOPPED?XV(this,_.lc,a):a.endedReason===b.END_OF_STREAM?(XV(this,_.Wb,a),XV(this,_.lc,a)):a.endedReason===b.ERROR&&UV(this,1);break;case cast.framework.events.EventType.PLAYING:this.f=!1;XV(this,_.fc,a);break;case cast.framework.events.EventType.PAUSE:this.f=!0;XV(this,_.dc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?XV(this,_.Ub,
|
|
72
|
+
a):(this.f=!1,XV(this,_.fc,a))}}};GW.prototype.resume=GW.prototype.resume;GW.prototype.pause=GW.prototype.pause;GW.prototype.getVolume=GW.prototype.getVolume;GW.prototype.setVolume=GW.prototype.setVolume;GW.prototype.getPosition=GW.prototype.getPosition;GW.prototype.skip=GW.prototype.skip;var QV=!1,RV=new _.S("clpp.cast.ads.AdsManager");var HW=class{constructor(a){this.a=a;this.f=this.h.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(YV(),this.f)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(YV(),this.f)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>ZV(a))}h(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=
|
|
73
|
+
_.Wf;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Xf;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Yf}b&&this.a(new _.H(b,{detail:ZV(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.a(new _.H(_.Wf,{detail:b}))}};var IW=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.w.bind(this);this.a=this.f=null}initialize(a){this.m=a;$V().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}release(){this.h=[];this.j=[];this.a=this.f=null}load(){}destroy(){this.m=null;$V().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}sa(){return this.j}ta(){return null}Pa(){const a=
|
|
74
|
+
this.ra();return a&&a.renditions[0]}Wa(){const a=this.ua();return a&&a.renditions[0]}wb(){return null}Nb(){return null}Ob(){return null}Ha(){return null}ra(){let a=null;if(this.f){let b=this.f.getActiveId();typeof b===_.r&&(b=b.toString(),a=this.getAudioTracks().find(c=>c.id===b)||null)}return a}ua(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.r&&(b=b.toString(),a=this.sa().find(c=>c.id===b)||null)}return a}Fb(){this.g.warn("Video tracks unavailable on Cast")}za(a){a&&this.f&&
|
|
75
|
+
this.f.setActiveById(+a.id)}$a(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}rb(){this.g.warn("Video renditions unavailable on Cast")}Db(a){this.za(a&&a.track)}Eb(a){this.$a(a&&a.track)}addTextTrack(a){const b=this;return _.v(function*(){var c=b.m.getConfiguration();if((c=yield iV(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c))&&b.a){const d=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);d.isInband=!1;d.language=
|
|
76
|
+
c.language;d.name=c.label;d.subtype=c.kind;d.trackContentId=c.url;d.trackContentType=c.mimeType;d.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([d]),bW(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}va(){return!0}w(){this.f=$V().getAudioTracksManager();var a=this.f.getTracks();this.h=aW(_.M,a);bW(this);a=this.m.getConfiguration();cW(this,_.M,a.preferredAudioLanguage,a.preferredAudioRole);cW(this,_.L,a.preferredTextLanguage,a.preferredTextRole)}};IW.prototype.isAbrEnabled=IW.prototype.va;
|
|
77
|
+
IW.prototype.addTextTrack=IW.prototype.addTextTrack;IW.prototype.setTextRendition=IW.prototype.Eb;IW.prototype.setAudioRendition=IW.prototype.Db;IW.prototype.setVideoRendition=IW.prototype.rb;IW.prototype.setTextTrack=IW.prototype.$a;IW.prototype.setAudioTrack=IW.prototype.za;IW.prototype.setVideoTrack=IW.prototype.Fb;IW.prototype.getTextTrack=IW.prototype.ua;IW.prototype.getAudioTrack=IW.prototype.ra;IW.prototype.getVideoTrack=IW.prototype.Ha;IW.prototype.getLoadingTextRendition=IW.prototype.Ob;
|
|
78
|
+
IW.prototype.getLoadingAudioRendition=IW.prototype.Nb;IW.prototype.getLoadingVideoRendition=IW.prototype.wb;IW.prototype.getTextRendition=IW.prototype.Wa;IW.prototype.getAudioRendition=IW.prototype.Pa;IW.prototype.getVideoRendition=IW.prototype.ta;IW.prototype.getTextTracks=IW.prototype.sa;IW.prototype.getAudioTracks=IW.prototype.getAudioTracks;IW.prototype.getVideoTracks=IW.prototype.getVideoTracks;var JW=class extends _.lu{constructor(){super();this.g=new _.S(ZU);this.h=this.w=_.lm();this.A=null;this.l=-1;this.F=new _.Cr;this.f=this.o=this.j=this.a=this.B=null;this.C=!1}init(a,b){this.B=a;b&&(this.h=this.w=b);a=dW();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new BW(this);this.a.init();this.j=new IW;this.j.initialize(this);this.o=new HW(c=>this.trigger(c));this.o.init()}unload(){const a=
|
|
79
|
+
cast.framework.messages.PlayerState,b=dW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.v(function*(){a.B=null;a.w=_.lm();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){dW().play();return Promise.resolve()}pause(){dW().pause();return Promise.resolve()}isPaused(){return dW().getPlayerState()===
|
|
80
|
+
cast.framework.messages.PlayerState.PAUSED}isEnded(){return dW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=dW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(QU);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return dW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
|
|
81
|
+
dW().getDurationSec();return typeof a===_.r?-1===a?Infinity:a:-1}getPlaybackRate(){return dW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;dW().sendLocalMediaRequest(b)}}getVolume(){this.g.warn(dV);return null}setVolume(){this.g.warn(dV)}setMuted(){this.g.warn(dV)}isMuted(){this.g.warn(dV);return!1}getLoadedSource(){const a=dW().getMediaInformation();if(a){var b=dW().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;
|
|
82
|
+
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}getDrmInfo(){return null}getPresentationStartTime(){return dW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=dW().getLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():0}getStats(){var a=
|
|
83
|
+
_.dp();if(this.f){a=dW().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===_.r?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.r?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.v(function*(){b.f=new _.Uu;b.a.l=b.f.a;b.A=_.gp(a);b.h=_.nm([b.w,a]);if(b.C)b.C=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;
|
|
84
|
+
d.autoplay=b.h.autoplay;typeof b.h.startTime===_.r&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:fV(b.h),local:!0};yield dW().load(d)}})}getBufferInfo(){this.g.warn(_.ra);return new _.iu}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setNetworkEngine(a){this.F=
|
|
85
|
+
a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return ZU}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(VU)}onError(a){a=new _.H(_.Sd,{detail:a});this.trigger(a)}canPlay(){return _.Xh()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=fV(this.getStats());var b=dW(),c=a.media||b.getMediaInformation();b=
|
|
86
|
+
b.getStartAbsoluteTime();c&&typeof b===_.r&&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;const e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&(!e||e&&f)){d=dW().getStartAbsoluteTime();if(typeof d===_.r){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;
|
|
87
|
+
h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=gV(a.media.customData.playerConfiguration));var d=null;var e=null;a.media.customData&&(d=gV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),e=gV(a.media.customData.playerConfiguration));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;d=!(!d||!d.lowLatencyMode);b=(e=null!=e&&e.lowLatencyMode||a||d)?hW(b,{streaming:{lowLatencyMode:!0}}):
|
|
88
|
+
b;if(!c)return b;e=c.chromecast||null;a=c.abr||null;d=b;a&&typeof a.defaultBandwidthEstimate===_.r?d.initialBandwidth=a.defaultBandwidthEstimate:d.initialBandwidth=void 0;gW(c,b);a={};d=c.streaming||null;e&&e.useSenderStreamingConfig&&d&&(a.streaming=hV(d,vW));c=c.abr||null;e&&e.useSenderAbrConfig&&c&&(a.abr=hV(c,wW));_.$g(a)&&(b=hW(b,a));return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var jW=class{constructor(){this.a=!1;this.g=new _.S($U);this.f=this.m=null;this.w=new Set;this.C=this.K.bind(this);this.B=this.F.bind(this);this.o=null;this.l=new _.Et;this.j=this.h=this.A=null}init(a){a&&(this.f=new JW,_.Rr(a,this.f),this.m=a,this.l.on(window,"unload",()=>{const b=this;return _.v(function*(){b.m&&0!==b.m.getPlayerState()&&(yield eV(b.m))})}))}start(a){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var b=lW(),c=lW().getPlayerManager(),d=new cast.framework.CastReceiverOptions;
|
|
89
|
+
a&&null!=a.useShakaForHls&&(d.useShakaForHls=a.useShakaForHls);d.customNamespaces={};d.customNamespaces[aV]=cast.framework.system.MessageType.JSON;d.customNamespaces[bV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.I.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};a.enableSmoothLiveRefresh=!0;d.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())d.mediaElement=a;d.disableIdleTimeout=!0;d.maxInactivity=Infinity;this.h&&
|
|
90
90
|
(d.queue=this.h);c.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,e=>{this.g.info("QUEUE_UPDATE message received",e);var f=this.getQueueManager();if(!f)return e;f=f.getCurrentItem();return f?(f=f.customData)&&!1===f.skippable?null:e:e});c.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.H.bind(this));c.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.J.bind(this));c.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
|
|
91
|
-
this.C);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.G.bind(this));b.start(d);b.addCustomMessageListener(
|
|
92
|
-
null}}
|
|
93
|
-
this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,
|
|
94
|
-
if(g===_.t||g===_.q){g=e[f].getAttribute(_.
|
|
95
|
-
b.getElementsByTagName(_.
|
|
96
|
-
this;return _.v(function*(){let c=a;var d;c.media.customData&&(d=
|
|
97
|
-
|
|
98
|
-
(!a.media.customData||!a.media.customData.local)){var b=
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
!1}isPaused(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1}getPosition(){let a=-1;var b=this.l.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.r&&(a=b));return a}w(){return!0}o(){const a=this;return _.v(function*(){a.B.release()})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.
|
|
102
|
-
|
|
103
|
-
|
|
91
|
+
this.C);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.G.bind(this));b.start(d);b.addCustomMessageListener(aV,this.B);this.l.on(document,_.ug,()=>{var e={type:"event",name:_.ug,visible:!document.hidden};lW().sendCustomMessage(bV,void 0,e)})}}stop(){if(this.a){this.a=!1;this.l.release();const a=lW();lW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.C);a.removeCustomMessageListener(aV,this.B);a.stop();this.j=this.h=this.m=this.f=
|
|
92
|
+
null}}Xd(a){this.o=a}Vi(a){this.A=a}on(a,b){lW().addEventListener(a,b)}off(a,b){lW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.Wd&&this.w.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.w.delete(a)}sendMessage(a,b){lW().sendCustomMessage(aV,b,a)}ed(){return this.a}$e(){return this.a}Lb(){return mW()}fc(a){nW(this,a)}mj(a){const b=mW();let c=null;a?c=Object.assign({},b,a):c=b;nW(this,c)}Xi(a){this.h=a;this.j=null}getQueueManager(){return lW().getPlayerManager().getQueueManager()}G(){var a=
|
|
93
|
+
this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,lW().sendCustomMessage(aV,void 0,{type:UU,index:a})))}I(a){a=a.trim();if(a.startsWith("#EXTM3U"))return pW(this,a);try{var b=(new DOMParser).parseFromString(a,_.Uf)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=lW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.ha);for(var f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");
|
|
94
|
+
if(g===_.t||g===_.q){g=e[f].getAttribute(_.se);var h=e[f].getElementsByTagName(_.kb);for(let k=h.length-1;0<=k;--k){const l=h[k].getAttribute(_.se)||g,m=h[k].getAttribute(_.md);let n=h[k].getAttribute(_.Gg)||void 0,p=h[k].getAttribute(_.Xd)||void 0;void 0!==n&&(n=+n);void 0!==p&&(p=+p);b.canDisplayType(l,m,n,p)||e[f].removeChild(h[k])}e[f].getElementsByTagName(_.kb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ha).length||a.removeChild(c[d])}return a=(new XMLSerializer).serializeToString(a)}if(c=
|
|
95
|
+
b.getElementsByTagName(_.qb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=lW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.t){e=c[d].getElementsByTagName(_.hb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Pa)||void 0,h=e[f].getAttribute(_.Oa)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.qg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.hb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a}H(a){const b=
|
|
96
|
+
this;return _.v(function*(){let c=a;var d;c.media.customData&&(d=gV(c.media.customData.playerConfiguration));if(b.m&&d){b.o&&(d=(yield Promise.resolve(b.o(d)))||d);d.ima&&(yield TV(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.r&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.cs(b.m,d),yield _.ds(b.m),d=b.m.Ra(),c.media.contentId=d.url,c.media.contentType=d.type,d.videoMimeType&&(c.media.hlsVideoSegmentFormat=
|
|
97
|
+
jV(d.videoMimeType,_.N)),d.audioMimeType&&(c.media.hlsSegmentFormat=jV(d.audioMimeType,_.M)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.r&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.A&&(d=yield Promise.resolve(b.A(c)))&&(c=d);return c})}J(a){var b=a.media;b&&b.tracks&&b.tracks.length&&qW(b.tracks);if((b=a.items)&&b.length)for(const c of b)(b=c&&c.media)&&b.tracks&&b.tracks.length&&
|
|
98
|
+
qW(b.tracks);return a}K(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){var b=lW().getPlayerManager(),c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.r||typeof c!==_.r||typeof d!==_.r||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.r&&b>=a&&b<=c&&this.m.setPosition(b))}_.fs(this.m)}}F(a){this.w.forEach(b=>b(a.data))}};_.w($U,jW);jW.prototype.getQueueManager=jW.prototype.getQueueManager;jW.prototype.setQueue=jW.prototype.Xi;
|
|
99
|
+
jW.prototype.updateContentMetadata=jW.prototype.mj;jW.prototype.setContentMetadata=jW.prototype.fc;jW.prototype.getContentMetadata=jW.prototype.Lb;jW.prototype.isApiReady=jW.prototype.ed;jW.prototype.sendMessage=jW.prototype.sendMessage;jW.prototype.removeMessageListener=jW.prototype.removeMessageListener;jW.prototype.addMessageListener=jW.prototype.addMessageListener;jW.prototype.off=jW.prototype.off;jW.prototype.on=jW.prototype.on;jW.prototype.setLoadRequestDataInterceptor=jW.prototype.Vi;
|
|
100
|
+
jW.prototype.setPlayerConfigInterceptor=jW.prototype.Xd;jW.prototype.stop=jW.prototype.stop;jW.prototype.start=jW.prototype.start;jW.prototype.init=jW.prototype.init;jW.getInstance=kW;var iW=null;var KW=class{constructor(a){this.l=a;this.a=null;this.B=new _.Et;this.f=null;rW(this)}load(){return _.v(function*(){})}j(){return!0}A(){}Ia(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.l.a;a&&this.l.sendMessage(cV,{type:"SKIP_AD",requestId:mV(),mediaSessionId:a.mediaSessionId})}getAdVolume(){return this.l.getVolume()||0}h(a){this.l.setVolume(a)}setMuted(a){this.l.setMuted(a)}isMuted(){return!!this.l.isMuted()}pb(){return this.a?this.a.isPlayingBreak:
|
|
101
|
+
!1}isPaused(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1}getPosition(){let a=-1;var b=this.l.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.r&&(a=b));return a}w(){return!0}o(){const a=this;return _.v(function*(){a.B.release()})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.Ia()}resume(){this.j()}C(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.l.trigger(new _.H(_.oc,{adsTimeline:new FW(a.breaks)})));break;case "isPlayingBreak":a.value?
|
|
102
|
+
sW(this,_.Sb):(sW(this,_.Wb,this.f),sW(this,_.lc,this.f),this.f=null,sW(this,_.Tb));break;case "isPaused":this.f&&(a.value?sW(this,_.dc):sW(this,_.fc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(sW(this,_.Wb,this.f),sW(this,_.lc,this.f),this.f=tW(this),sW(this,_.kc,this.f)));break;default:this.f||(this.f=tW(this))&&sW(this,_.kc,this.f)}}};KW.prototype.resume=KW.prototype.resume;KW.prototype.pause=KW.prototype.pause;KW.prototype.getVolume=KW.prototype.getVolume;
|
|
103
|
+
KW.prototype.setVolume=KW.prototype.setVolume;KW.prototype.getPosition=KW.prototype.getPosition;KW.prototype.skip=KW.prototype.skip;var LW=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.gd?!1:!(!b||!b.ima)}create(a){return new KW(a.a)}};var MW=class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return kW().$e()?!(!b||!b.ima):!1}create(a){return new GW(a)}};_.w("clpp.cast.createCastQueue",function(){uW=class extends cast.framework.QueueBase{initialize(a){let 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 uW});_.up(new LW);_.up(new MW);};f.call(g, window);
|