@castlabs/prestoplay 6.23.1 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +116 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +607 -591
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +88 -86
- package/cjs/cl.externs.js +105 -54
- package/cjs/cl.freewheel.js +25 -24
- package/cjs/cl.hls.js +77 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mse.js +352 -342
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +15 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +491 -478
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -80
- package/cl.externs.js +105 -54
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +79 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +18 -17
- package/cl.mse.js +310 -306
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +60 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +28 -28
- package/package.json +1 -1
- package/typings.d.ts +54 -25
package/cl.cast.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
{if("license"!==b&&typeof c!==_.
|
|
3
|
-
null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.
|
|
4
|
-
d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.
|
|
5
|
-
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}},
|
|
6
|
-
d.editTracksInfo(c,()=>{a.f[b]=null;
|
|
7
|
-
cast.framework&&cast.framework.CastContext&&a.S.length){a.w=!0;a.o
|
|
8
|
-
cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a
|
|
9
|
-
void 0===c?0:c;return _.x(function*(){var d=a.f.
|
|
10
|
-
b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=
|
|
11
|
-
var f
|
|
12
|
-
if(f===b){b=e;break a}}b=null}if(!b)return null;b=
|
|
13
|
-
null;a=null===a?null:a+b;return null===a?b:a},
|
|
14
|
-
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.
|
|
15
|
-
_.
|
|
16
|
-
e),
|
|
17
|
-
null,e=null,f;typeof b.breakClipId===_.
|
|
18
|
-
cast.framework.events.EventType.TIMED_METADATA_EXIT]},
|
|
19
|
-
new _.
|
|
20
|
-
_.
|
|
21
|
-
b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.
|
|
22
|
-
function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=e=>{const f=_.
|
|
23
|
-
e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.K(g.data)}):a.licenseHandler=void 0},
|
|
24
|
-
|
|
25
|
-
++e}return d.join("\n")},
|
|
26
|
-
c.breakClipIds.length,f=0>=c.position?c.position:b.breaks.filter(h=>0<=h.position).sort((h,k)=>h.position-k.position).findIndex(h=>h===c));b.breakClips&&(d=b.breakClips.find(h=>h.id===a.a.breakClipId)||null);b=new Z(d,c,g,e,f)}return b},
|
|
27
|
-
_.F&&this.a(_.
|
|
28
|
-
{detail:a}))}}};_.z("clpp.cast.CastUtils",class{});var
|
|
29
|
-
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(_
|
|
30
|
-
c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;b.customData&&(c.src=b.customData.url||c.src,c.mimeType=b.customData.mimeType||c.mimeType);c.renditions.push(new _.
|
|
31
|
-
null}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{
|
|
35
|
-
a}
|
|
36
|
-
new _.
|
|
37
|
-
a,b)})}pause(){return new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(
|
|
38
|
-
this.a.getEstimatedTime()||0}getDuration(){return this.getMediaDuration()}getMediaDuration(){if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.t?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.a&&this.a.playbackRate||0}setPlaybackRate(a){this.a&&0<a&&this.sendMessage(
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var rW="Cannot seek during ads playout.",sW="Cannot switch track",tW="Media session does not exist.",uW="No receivers available",vW="Reset ABR functionality not available on cast.",wW="SDK not yet ready",xW="Sender is destroyed.",yW="clpp.cast.CastProxy",zW="clpp.cast.Player",AW="clpp.cast.Receiver",BW="urn:x-cast:castlabs",CW="urn:x-cast:com.google.cast.media",DW=function(a){return _.x(function*(){yield _.Sr(a,_.Xe);yield _.Sr(a,_.We)})},EW=function(a){return JSON.stringify(a,(b,c)=>
|
|
2
|
+
{if("license"!==b&&typeof c!==_.ne){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.Se?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.t?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},FW=function(a){if(typeof a!==_.cg)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},GW=function(a,b,c,d){return _.x(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=
|
|
3
|
+
null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.sk(d,a.mimeType,g);f&&g&&(h=_.Bj(a.url),(h=yield c.fetch(h).V)&&h.data&&(e=f.a(_.K(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},HW=function(a,b){let c,d;if(window.chrome&&chrome.cast&&chrome.cast.media)c=chrome.cast.media.HlsSegmentFormat,d=chrome.cast.media.HlsVideoSegmentFormat;else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,
|
|
4
|
+
d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.Ig:return d.FMP4;case _.Hg:return b===_.N?d.MPEG2_TS:c.TS;case _.Rc:return c.AAC;case _.Sc:return c.AC3;case _.Tc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Uc:return c.FMP4}},JW=function(a){a=void 0===a?IW:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.I(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;
|
|
5
|
+
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}},KW=function(a,b){return a.h.filter(c=>c.type===b)},MW=function(a,b){const c=LW(a);return KW(a,b).find(d=>c.includes(d.id))||null},OW=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.xa();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);
|
|
6
|
+
d.editTracksInfo(c,()=>{a.f[b]=null;NW(a,b)},e=>{a.f[b]=null;a.g.debug(sW,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{NW(a,b)},e=>{a.g.debug(sW,e)}))},LW=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(b=>b.toString())},NW=function(a,b){b===_.M?a.a.trigger(new _.D(_.Xc)):b===_.L&&a.a.trigger(new _.D(_.jg))},RW=function(a){if(a)for(const b of PW)QW(b)},QW=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&
|
|
7
|
+
cast.framework&&cast.framework.CastContext&&a.S.length){a.w=!0;a.o.ff();var b=cast.framework.CastContext.getInstance(),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.$);SW&&a.o.ia(.02)}},TW=function(a){return _.x(function*(){PW.delete(a);if(a.w){a.w=!1;var b=
|
|
8
|
+
cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.$)}b=[];a.f&&(b.push(a.f.destroy()),a.f=null);a.j&&(b.push(a.j.destroy()),a.j=null);yield Promise.all(b);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.R=null;a.W=null})},UW=function(a){return _.x(function*(){a.Nb()||(yield cast.framework.CastContext.getInstance().requestSession())})},WW=function(a,b,c){c=
|
|
9
|
+
void 0===c?0:c;return _.x(function*(){var d=a.f.xa();d&&d.language&&(a.h.preferredTextLanguage=d.language);(d=a.f.ra())&&d.language&&(a.h.preferredAudioLanguage=d.language);yield VW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Qe:a.getPresentationStartTime(),autoplay:b,lb:a.h})})},VW=function(a,b){return _.x(function*(){var c=chrome.cast.media.StreamType;yield UW(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
|
|
10
|
+
b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=HW(b.ac,_.N);e.hlsSegmentFormat=HW(c,_.M);b.lb&&(a.L&&(c=yield Promise.resolve(a.L(b.lb)))&&(b.lb=c),a.h=b.lb,a.C=_.np(a.h),a.B=a.C.findIndex(k=>k.url===b.source.url),b.lb.remoteTextTracks&&(c=yield Promise.all(b.lb.remoteTextTracks.map(a.ha.bind(a))),e.tracks=c.filter(k=>k),b.lb.remoteTextTracks=void 0),delete b.lb.autoplay,b.lb.startTime=null,e.customData={playerConfiguration:EW(b.lb)});c=a.Fb()||{};
|
|
11
|
+
var f=XW(c.metadataType),g;typeof b.Qe===_.t&&(g={metadataType:f,sectionStartAbsoluteTime:b.Qe});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=YW(c);if(g=ZW(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);typeof b.autoplay===_.$c&&(e.autoplay=b.autoplay);typeof b.currentTime===_.t&&(e.currentTime=b.currentTime);yield d.loadMedia(e)}})},ZW=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries($W);for(const d of c){const [e,f]=d;
|
|
12
|
+
if(f===b){b=e;break a}}b=null}if(!b)return null;b=JW($W[b]);return Object.assign(b,a)},XW=function(a){var b=void 0===b?IW:b;return Object.values($W).includes(a)?a:b},YW=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},bX=function(a,b){aX(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.U);b.addMessageListener(BW,a.O)},cX=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.t?null:a):a=
|
|
13
|
+
null;a=null===a?null:a+b;return null===a?b:a},aX=function(a,b){a.a=b;a.a&&(a.G.release(),a.F=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.F=new cast.framework.RemotePlayerController(a.l),a.G.on(a.F,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.ba.bind(a)),a.G.on(a.F,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Ha.bind(a)),a.j&&a.j.init(),a.trigger(new _.D(_.Fe)))},fX=function(a){return new dX(a.h,()=>{a.trigger(new _.D(_.id))},(b,c)=>{{const d=a.f.getConfiguration();
|
|
14
|
+
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.yf&&(d.preferredAudioLanguage=c.yf);c.wg&&(d.preferredTextLanguage=c.wg);_.Ur(a.f,null);a.trigger(new _.D("castingended"));a.j(b,d)}},()=>eX(a))},eX=function(a){return _.x(function*(){a.trigger(new _.D(_.fd));a.f.a!==a.a&&a.f&&a.a&&(yield a.f.release(),_.Ur(a.f,a.a))})},iX=function(a,b,c){return _.x(function*(){var d=b.adTagUrl;if(d)try{gX=!1;const e=
|
|
15
|
+
_.Bj(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.ij(f.data),h=(new DOMParser).parseFromString(g,_.ig);if(h.getElementsByTagName("vmap:VMAP").length)_.C("VMAP detected."),a.vmapAdsRequest=hX(g);else if(h.getElementsByTagName("VAST").length){_.C("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=hX(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else _.C("Unsupported schema."),gX=!0}}catch(e){_.C("Failed to fetch an ad",
|
|
16
|
+
e),gX=!0}})},hX=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},jX=function(a,b){b=new _.I(1,10,10003,{errorType:b});a.m.onError(b)},kX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},mX=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=lX(a,c))&&(d={ad:c});a.m.trigger(new _.D(b,d))}},lX=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=
|
|
17
|
+
null,e=null,f;typeof b.breakClipId===_.cg&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.cg&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>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 Z(d,e,b.index,b.total,f)}return c},nX=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,
|
|
18
|
+
cast.framework.events.EventType.TIMED_METADATA_EXIT]},oX=function(a){const b=a.dashTimedMetadata;let c=_.Ag;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.wg)?_.gi:_.ug,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},pX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},rX=function(a){a.a=pX().getTextTracksManager();const b=a.a.getTracks();a.j=qX(_.L,b)},qX=function(a,b){const c=[];for(const d of b)b=
|
|
19
|
+
new _.Xj(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=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 _.fk(b.id,b)),c.push(b);return c},sX=function(a,b,c,d){c=_.pi(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.na());if(c=c.find(g=>{const h=
|
|
20
|
+
_.Qi(g);return f.some(k=>{k=_.Qi(k.language||"");return _.Ri(h,k)})})){const g=_.Qi(c);c=f.filter(h=>{h=_.Qi(h.language||"");return _.Ri(g,h)});f=c.length?c:f;e=e||!!c.length}_.rj(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.ya(e):b===_.L&&a.Xa(e))},tX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},wX=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;
|
|
21
|
+
b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.hm(d);if(e){var f=[_.Hd];_.np(a)[0].type!==_.Pc&&f.unshift(_.Jd);d.preferredDrmSystem===_.Hd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.Na[g];h?(c=g===_.Jd?cast.framework.ContentProtection.WIDEVINE:g===_.Hd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},uX(b,h,a,c),vX(b,h,a,c)):c()}else c()}else c()},uX=
|
|
22
|
+
function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=e=>{const f=_.Bj({method:_.sb,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},vX=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.x(function*(){const g=_.Hj(Object.assign({},f.headers),
|
|
23
|
+
e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.K(g.data)}):a.licenseHandler=void 0},zX=function(){return xX||(xX=new yX)},AX=function(){return cast.framework.CastReceiverContext.getInstance()},BX=function(){const a=AX().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},CX=function(a,b){const c=AX().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,AX().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},
|
|
24
|
+
EX=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=AX();var {hlsVideoSegmentFormat:d}=AX().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.Ig:_.Hg;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=DX(f,_.oa),h=DX(f,_.Ab);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);
|
|
25
|
+
++e}return d.join("\n")},DX=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},GX=function(a,b){let c=null;const d=FX(a);d&&(c={ad:d});a.f.trigger(new _.D(b,c))},FX=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;let c=null,d=null,e,f;const g=a.a.currentBreakClipNumber;b.breaks&&(c=b.breaks.find(h=>h.id===a.a.breakId)||null)&&(e=
|
|
26
|
+
c.breakClipIds.length,f=0>=c.position?c.position:b.breaks.filter(h=>0<=h.position).sort((h,k)=>h.position-k.position).findIndex(h=>h===c));b.breakClips&&(d=b.breakClips.find(h=>h.id===a.a.breakClipId)||null);b=new Z(d,c,g,e,f)}return b},HX=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.h=_.hp;this.o=_.rv;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(_.hp)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===
|
|
27
|
+
_.F&&this.a(_.ap)}a(a){if(a!==this.h)if(this.h===_.ap&&a!==_.hp)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;this.h===_.dp?(this.B=b,this.player.trigger(new _.D(_.bd,{detail:{bufferedTimeMS:-1,reason:this.j}}))):this.o===_.dp&&this.player.trigger(new _.D(_.ad,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.h,previousState:this.o,timeSinceLastStateChangeMS:b-this.C};this.C=b;this.l&&_.To(this.l,this.h);this.player.trigger(new _.D(_.$f,
|
|
28
|
+
{detail:a}))}}};_.z("clpp.cast.CastUtils",class{});var IW=0,$W={GENERIC:IW,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5};var IX=class extends HX{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.Xb.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.l)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.x(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.l;b&&b.isPlayingBreak||super.a(a)}Xb(){if(this.f&&
|
|
29
|
+
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(_.$o);break;case chrome.cast.media.IdleReason.ERROR:this.a(_.ap);break;default:this.a(_.hp)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(_.kp);break;case chrome.cast.media.PlayerState.PAUSED:this.a(_.jp);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(_.dp)}}};var JX=class extends _.T{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 _.Xj(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
|
|
30
|
+
c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;b.customData&&(c.src=b.customData.url||c.src,c.mimeType=b.customData.mimeType||c.mimeType);c.renditions.push(new _.fk(c.id,c));return c}):[],this.a.trigger(new _.D(_.pg)))}destroy(){this.a=null}getVideoTracks(){return KW(this,_.N)}getAudioTracks(){return KW(this,_.M)}na(){return KW(this,_.L)}oa(){const a=this.Ia();return a?a.renditions[0]:null}Ra(){const a=this.ra();return a?a.renditions[0]:null}Va(){const a=this.xa();return a?a.renditions[0]:
|
|
31
|
+
null}vb(){return this.f[_.N]||null}Gb(){return this.f[_.M]||null}Hb(){return this.f[_.L]||null}Ia(){return MW(this,_.N)}ra(){return MW(this,_.M)}xa(){return MW(this,_.L)}Db(a){OW(this,_.N,a)}ya(a){OW(this,_.M,a)}Xa(a){OW(this,_.L,a)}nb(a){this.Db(a&&a.track)}Bb(a){this.ya(a&&a.track)}Cb(a){this.Xa(a&&a.track)}addTextTrack(){return _.x(function*(){})}ua(){return!0}};JX.prototype.isAbrEnabled=JX.prototype.ua;JX.prototype.addTextTrack=JX.prototype.addTextTrack;JX.prototype.setTextRendition=JX.prototype.Cb;
|
|
32
|
+
JX.prototype.setAudioRendition=JX.prototype.Bb;JX.prototype.setVideoRendition=JX.prototype.nb;JX.prototype.setTextTrack=JX.prototype.Xa;JX.prototype.setAudioTrack=JX.prototype.ya;JX.prototype.setVideoTrack=JX.prototype.Db;JX.prototype.getTextTrack=JX.prototype.xa;JX.prototype.getAudioTrack=JX.prototype.ra;JX.prototype.getVideoTrack=JX.prototype.Ia;JX.prototype.getLoadingTextRendition=JX.prototype.Hb;JX.prototype.getLoadingAudioRendition=JX.prototype.Gb;JX.prototype.getLoadingVideoRendition=JX.prototype.vb;
|
|
33
|
+
JX.prototype.getTextRendition=JX.prototype.Va;JX.prototype.getAudioRendition=JX.prototype.Ra;JX.prototype.getVideoRendition=JX.prototype.oa;JX.prototype.getTextTracks=JX.prototype.na;JX.prototype.getAudioTracks=JX.prototype.getAudioTracks;JX.prototype.getVideoTracks=JX.prototype.getVideoTracks;var dX=class extends _.Cu{constructor(a,b,c,d){super();this.g=new _.S(_.ud);this.S=a;this.o=new _.Gk(b);this.R=c;this.W=d;this.h=this.I=_.Gl();this.C=[];this.B=0;this.K=new _.Er;this.F=this.l=this.a=null;this.A=this.w=!1;this.Y="";this.da=1E6;this.f=new JX;this.f.initialize(this);this.j=new IX(this);this.G=new _.St;this.J=null;this.H=new Set;this.M=this.va.bind(this);this.$=this.Oa.bind(this);this.U=this.Za.bind(this);this.O=this.Aa.bind(this);this.L=null;window.cast||Object.defineProperty(window,
|
|
34
|
+
"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{RW(!0)},0)}});QW(this);PW.add(this)}init(a,b){this.h=this.I=b}unload(){return new Promise((a,b)=>{this.f&&this.f.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)})}release(){return this.unload().then(()=>{this.j&&this.j.release()})}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.ob)}appendLoad(){return Promise.reject(_.ob)}seekWith(){return Promise.reject(_.ob)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.x(function*(){})}zd(a){this.L=
|
|
35
|
+
a}wc(){return this.w}Nb(){return this.A}ze(){return this.Y}sendMessage(a,b){const c=this;return _.x(function*(){let d;const e=cast.framework.CastContext.getInstance().getCurrentSession();if(e)try{yield e.sendMessage(a,EW(b))}catch(f){d=new _.I(1,8,8E3,{detailedErrorCode:f})}else d=new _.I(1,8,8004,void 0);if(d)c.onError(d)})}cast(){const a=this;return _.x(function*(){if(!a.wc())throw a.g.warn(wW),new _.I(1,8,8001,void 0);if(!SW)throw a.g.warn(uW),new _.I(1,8,8002,void 0);if(a.Nb())throw a.g.warn("Already casting"),
|
|
36
|
+
new _.I(1,8,8003,void 0);try{yield UW(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 _.I(1,8,8E3,c);}})}ye(){this.Nb()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.ne&&this.H.add(a)}removeMessageListener(a){typeof a===_.ne&&this.H.delete(a)}play(){return this.isEnded()?WW(this,!0):new Promise((a,b)=>{if(!this.a)return b(tW);this.a.play(null,
|
|
37
|
+
a,b)})}pause(){return new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(tW);this.a.pause(null,a,b)})}isPaused(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED}isEnded(){return this.getState()===_.$o}seek(a){return this.isEnded()?WW(this,!1,a):new Promise((b,c)=>{this.a||c(tW);this.l.isPlayingBreak&&c(rW);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.D(_.Cg));this.a.seek(d,()=>{this.trigger(new _.D(_.Bg));b()},c)})}getPosition(){return this.getMediaPosition()}getMediaPosition(){return this.a&&
|
|
38
|
+
this.a.getEstimatedTime()||0}getDuration(){return this.getMediaDuration()}getMediaDuration(){if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.t?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.a&&this.a.playbackRate||0}setPlaybackRate(a){this.a&&0<a&&this.sendMessage(CW,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.a&&
|
|
39
39
|
this.a.volume.level}setVolume(a){this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.a&&this.a.volume.muted}setMuted(a){this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,a)),this.a.setVolume(a))}getPresentationStartTime(){if(!this.a||!this.a.media||!this.a.media.metadata)return null;const a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.t?null:1E-8===a?0:a}getSeekRange(){let a=
|
|
40
|
-
{start:0,end:this.getDuration()};if(this.isLive()){const b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.t&&typeof b.end===_.t&&(a={start:b.start,end:b.end})}return a}getState(){return this.j?this.j.getState():_.
|
|
41
|
-
isLive:c.isLive,autoplay:b.h.autoplay,
|
|
42
|
-
(this.trigger(new _.
|
|
43
|
-
this.
|
|
44
|
-
case cast.framework.SessionState.SESSION_RESUMED:this.
|
|
45
|
-
this.O);this.A=!1;this.a=null;this.G.release();this.l=this.F=null}}
|
|
46
|
-
d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url});return c})}getTextDisplayer(){return null}},
|
|
47
|
-
this;return _.x(function*(){if(b.a)try{if(yield b.a.cast(),b.f&&b.a){{let d=null;const e=b.f.getLoadedSource();if(e){const f=b.f.getTrackManager(),g=f.getVideoTracks()[0];let h,k;g&&g.mimeType&&(h=g.mimeType);const l=b.f.getConfiguration(),m=f.
|
|
48
|
-
e&&typeof e.isLive===_
|
|
49
|
-
b.a=
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
{start:0,end:this.getDuration()};if(this.isLive()){const b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.t&&typeof b.end===_.t&&(a={start:b.start,end:b.end})}return a}getState(){return this.j?this.j.getState():_.rv}getStats(){return this.a&&this.a.customData&&this.a.customData.stats?FW(this.a.customData.stats):_.Xo()}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.x(function*(){if(b.wc())if(SW){b.C=_.np(a);b.h=_.Il(b.I,a);var c=b.C[b.B];yield VW(b,{source:c,
|
|
41
|
+
isLive:c.isLive,autoplay:b.h.autoplay,lb:b.h,ac:c.ac,audioMimeType:c.audioMimeType})}else b.g.warn(uW);else b.g.warn(wW)})}getBufferInfo(){return new _.Bu}getTrackManager(){return this.f}getConfiguration(){return this.h}getSurface(){return null}setNetworkEngine(a){this.K=a}getNetworkEngine(){return this.K}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(vW)}onError(a){if(a&&
|
|
42
|
+
(this.trigger(new _.D(_.q,{detail:a})),this.j))this.j.onError(a)}namespace(){return _.ud}canPlay(){return this.wc()?2:0}Fb(){return this.J}$b(a){this.J=ZW(a)}te(){this.J=null}af(a){const b=this.Fb()||{};a={metadataType:XW(b.metadataType),title:a};this.$b(Object.assign({},b,a))}Ze(a){const b=this.Fb()||{},c=XW(b.metadataType);a=new chrome.cast.Image(a);this.$b(Object.assign({},b,{metadataType:c,images:[a]}))}Ye(a){const b=this.Fb()||{};this.$b(Object.assign({},b,{metadataType:3,artist:a}))}$e(a){const b=
|
|
43
|
+
this.Fb()||{};a={metadataType:XW(b.metadataType),releaseDate:a};this.$b(Object.assign({},b,a))}va(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;SW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.Y=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.ff()}Oa(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;bX(this,a.session);break;
|
|
44
|
+
case cast.framework.SessionState.SESSION_RESUMED:this.Nb()||(this.A=!0,bX(this,a.session),this.W());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Nb()&&this.a){const d=this.a.media;var b=this.f.ra(),c=this.f.xa();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:cX(this),wg:c,yf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.U);a.session.removeMessageListener(BW,
|
|
45
|
+
this.O);this.A=!1;this.a=null;this.G.release();this.l=this.F=null}}Za(a){this.g.debug("New media session",a.mediaSession);aX(this,a.mediaSession)}Ha(a){a.value&&a.value.tracks&&this.f&&this.f.load()}Aa(a,b){if(a===BW&&0<this.H.size){const c=FW(b);this.H.forEach(d=>d(c))}}ba(){this.trigger(new _.D(_.og))}ha(a){const b=this;return _.x(function*(){let c=null;const d=yield GW(a,[_.hg,_.Oc],b.K,b.h);d&&(c=new chrome.cast.media.Track(b.da++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=
|
|
46
|
+
d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url});return c})}getTextDisplayer(){return null}},SW=!1,PW=new Set;window.__onGCastApiAvailable=RW;var KX=class extends _.Cu{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.ne?c:this.l;this.a=fX(this);this.g=new _.S(yW);this.f&&this.forwardEventsTo(this.f)}destroy(){const a=this;return _.x(function*(){a.a&&(yield TW(a.a),a.a=null);a.f&&a.stopForwardingEventsTo(a.f)})}l(a,b){this.f&&a!==_.$o&&a!==_.hp&&(delete b.license,this.f.load(b))}qe(){return!!this.a&&this.a.wc()&&SW}Nb(){return!!this.a&&this.a.Nb()}ze(){return this.a?this.a.ze():""}zd(a){this.a&&this.a.zd(a)}cast(a){const b=
|
|
47
|
+
this;return _.x(function*(){if(b.a)try{if(yield b.a.cast(),b.f&&b.a){{let d=null;const e=b.f.getLoadedSource();if(e){const f=b.f.getTrackManager(),g=f.getVideoTracks()[0];let h,k;g&&g.mimeType&&(h=g.mimeType);const l=b.f.getConfiguration(),m=f.ra();m&&(m.mimeType&&(k=m.mimeType),m.language&&(l.preferredAudioLanguage=m.language),m.roles.length&&(l.preferredAudioRole=m.roles[0]));const n=f.xa();n&&(n.language&&(l.preferredTextLanguage=n.language),n.roles.length&&(l.preferredTextRole=n.roles[0]));const r=
|
|
48
|
+
e&&typeof e.isLive===_.$c?e.isLive:b.f.isLive();d={source:e,isLive:r,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Qe:b.f.getPresentationStartTime(),ac:h,audioMimeType:k,lb:l}}var c=d}yield eX(b);b.a&&(c&&(c.autoplay=!b.f.isPaused()),a?yield b.f.load(a):b.a.a||(yield VW(b.a,c)))}}catch(d){b.g.error("Error while trying to cast",d),c=new _.D(_.q,{detail:d}),b.trigger(c)}})}ye(){this.a&&this.a.ye()}$g(a){const b=this;return _.x(function*(){a!==b.h&&(b.h=a,b.a&&(yield TW(b.a)),
|
|
49
|
+
b.a=fX(b))})}sendMessage(a){const b=this;return _.x(function*(){b.a?yield b.a.sendMessage(BW,a):b.g.warn(xW)})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(xW)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(xW)}Fb(){return this.a&&this.a.Fb()}$b(a){this.a&&this.a.$b(a)}te(){this.a&&this.a.te()}af(a){this.a&&this.a.af(a)}Ze(a){this.a&&this.a.Ze(a)}Ye(a){this.a&&this.a.Ye(a)}$e(a){this.a&&this.a.$e(a)}};_.z(yW,KX);
|
|
50
|
+
KX.prototype.setContentReleaseDate=KX.prototype.$e;KX.prototype.setContentArtist=KX.prototype.Ye;KX.prototype.setContentImage=KX.prototype.Ze;KX.prototype.setContentTitle=KX.prototype.af;KX.prototype.clearContentMetadata=KX.prototype.te;KX.prototype.setContentMetadata=KX.prototype.$b;KX.prototype.getContentMetadata=KX.prototype.Fb;KX.prototype.removeMessageListener=KX.prototype.removeMessageListener;KX.prototype.addMessageListener=KX.prototype.addMessageListener;KX.prototype.sendMessage=KX.prototype.sendMessage;
|
|
51
|
+
KX.prototype.changeReceiverId=KX.prototype.$g;KX.prototype.forceDisconnect=KX.prototype.ye;KX.prototype.cast=KX.prototype.cast;KX.prototype.setPlayerConfigInterceptor=KX.prototype.zd;KX.prototype.getReceiverName=KX.prototype.ze;KX.prototype.isCasting=KX.prototype.Nb;KX.prototype.canCast=KX.prototype.qe;KX.prototype.destroy=KX.prototype.destroy;var LX=class extends HX{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.$.bind(this);this.w=this.Y.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ba.bind(this);this.G=this.da.bind(this);this.F=this.O.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,
|
|
52
52
|
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 _.x(function*(){const c=cast.framework.events.EventType,d=cast.framework.CastReceiverContext.getInstance().getPlayerManager();
|
|
53
|
-
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 _.
|
|
54
|
-
this.a(_.
|
|
55
|
-
null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}
|
|
56
|
-
Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.
|
|
57
|
-
Z.prototype.getClickThroughUrl=Z.prototype.
|
|
58
|
-
Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.
|
|
59
|
-
this.j)}load(){const a=this;return _.x(function*(){
|
|
60
|
-
switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=
|
|
61
|
-
break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(
|
|
62
|
-
|
|
63
|
-
_
|
|
64
|
-
this.
|
|
65
|
-
this.f.setActiveById(+a.id)}
|
|
66
|
-
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]),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
cast.framework.messages.PlayerState,b=
|
|
70
|
-
a.play();return Promise.resolve()}pause(){const a=
|
|
71
|
-
|
|
72
|
-
null}getLoadedSource(){const a=
|
|
73
|
-
b&&typeof b.start===_.t&&typeof b.end===_.t&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():_.
|
|
74
|
-
this;return _.x(function*(){b.f=new _.
|
|
75
|
-
a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return
|
|
76
|
-
c&&typeof b===_.t&&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=
|
|
77
|
-
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=
|
|
78
|
-
a)a=Object.assign({},b.shakaConfig,{streaming:{lowLatencyMode:!0}}),b=Object.assign({},b,{shakaConfig:a});return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var
|
|
79
|
-
c.customNamespaces={};c.customNamespaces[
|
|
80
|
-
this.A);a.start(c);a.addCustomMessageListener(
|
|
81
|
-
b){
|
|
82
|
-
1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.w||g===_.p){g=e[f].getAttribute(_.
|
|
83
|
-
(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.
|
|
84
|
-
(new XMLSerializer).serializeToString(a)}return a}C(a){const b=this;return _.x(function*(){let c=a;var d;c.media.customData&&(d=
|
|
85
|
-
d.url,c.media.contentType=d.type,d.
|
|
86
|
-
c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.t||typeof c!==_.t||typeof d!==_.t||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.t&&b>=a&&b<=c&&this.m.seek(b))}_.
|
|
87
|
-
|
|
88
|
-
this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()}pause(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.f.a;a&&this.f.sendMessage(
|
|
89
|
-
this;return _.x(function*(){a.j.release()})}A(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.
|
|
90
|
-
|
|
53
|
+
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 _.D(_.gf));this.a(_.kp)}R(){this.a(_.jp)}$(){this.a(_.$o)}Y(a){a.isBuffering?
|
|
54
|
+
this.a(_.dp):(a=this.player.isPaused()?_.jp:_.kp,this.a(a))}W(){this.j=1;this.player.trigger(new _.D(_.Cg))}U(){this.player.trigger(new _.D(_.Bg))}ba(){this.j=2}da(){this.a(_.ip)}M(a){const b=this.player.getStats();this.player.trigger(new _.D(_.Zc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}O(a){a=new _.I(_.F,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.D(_.q,{detail:a}));this.a(_.ap)}};var Z=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.t?c:1;this.h=typeof d===_.t?d:1;this.j=typeof e===_.t?e:0}sb(){return"Google Cast Framework"}tb(){return cast.framework.VERSION}xb(){return 0}getId(){return""}getCreativeId(){return""}Sb(){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||0}Vb(){return!1}ub(){return this.a.clickThroughUrl||
|
|
55
|
+
null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}ib(){return 0}hb(){return 0}Ta(){return 0}Ua(){switch(this.Ib()){case 0:return 0;case -1:return 2;default:return 1}}getPodIndex(){return this.j}Ib(){return this.f.position}wb(){return this.l}jb(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ub(){return null}};Z.prototype.getVideoElement=Z.prototype.Ub;Z.prototype.getWrapperCreativeIds=Z.prototype.getWrapperCreativeIds;
|
|
56
|
+
Z.prototype.getWrapperAdSystems=Z.prototype.getWrapperAdSystems;Z.prototype.canSeek=Z.prototype.canSeek;Z.prototype.getWrapperAdIds=Z.prototype.getWrapperAdIds;Z.prototype.getSequenceLength=Z.prototype.jb;Z.prototype.getPositionInSequence=Z.prototype.wb;Z.prototype.getPodTimeOffset=Z.prototype.Ib;Z.prototype.getPodIndex=Z.prototype.getPodIndex;Z.prototype.getPodType=Z.prototype.Ua;Z.prototype.getMediaBitrate=Z.prototype.Ta;Z.prototype.getMediaHeight=Z.prototype.hb;Z.prototype.getMediaWidth=Z.prototype.ib;
|
|
57
|
+
Z.prototype.getMediaUrl=Z.prototype.getMediaUrl;Z.prototype.getClickThroughUrl=Z.prototype.ub;Z.prototype.isBumper=Z.prototype.Vb;Z.prototype.getSkipTimeOffset=Z.prototype.getSkipTimeOffset;Z.prototype.getPosition=Z.prototype.getPosition;Z.prototype.getDuration=Z.prototype.getDuration;Z.prototype.getTitle=Z.prototype.getTitle;Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName;Z.prototype.getAdSystem=Z.prototype.getAdSystem;Z.prototype.getApiFramework=Z.prototype.getApiFramework;
|
|
58
|
+
Z.prototype.getSourceId=Z.prototype.Sb;Z.prototype.getCreativeId=Z.prototype.getCreativeId;Z.prototype.getId=Z.prototype.getId;Z.prototype.getTechnology=Z.prototype.xb;Z.prototype.getAdManagerVersion=Z.prototype.tb;Z.prototype.getAdManagerName=Z.prototype.sb;var MX=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Lb(){return!!this.a.find(a=>0===a.position)}Kb(){return!!this.a.find(a=>-1===a.position)}};MX.prototype.hasPostroll=MX.prototype.Kb;MX.prototype.hasPreroll=MX.prototype.Lb;MX.prototype.getCuePoints=MX.prototype.getCuePoints;var NX=class{constructor(a){this.m=a;this.a=null;this.j=this.l.bind(this);this.f=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];kX().addEventListener(this.f,
|
|
59
|
+
this.j)}load(){const a=this;return _.x(function*(){gX&&(gX=!1,jX(a,0))})}start(){return _.x(function*(){kX().play()})}w(){}resume(){-1!==this.getPosition()&&kX().play()}pause(){-1!==this.getPosition()&&kX().pause()}skip(){}getVolume(){return this.m.getVolume()||0}setVolume(a){this.m.setVolume(a)}getPosition(){const a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.t?a:-1}o(){return!0}h(){const a=this;return _.x(function*(){kX().removeEventListener(a.f,a.j)})}l(a){const b=cast.framework.events.EndedReason;
|
|
60
|
+
switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=kX().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.D(_.Fc,{adsTimeline:new MX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:mX(this,_.tc,a);break;case cast.framework.events.EventType.BREAK_STARTED:mX(this,_.jc,a);break;case cast.framework.events.EventType.BREAK_ENDED:mX(this,_.kc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:mX(this,_.zc,a);
|
|
61
|
+
break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(mX(this,_.yc,a),mX(this,_.Cc,a)):a.endedReason===b.STOPPED?mX(this,_.Cc,a):a.endedReason===b.END_OF_STREAM?(mX(this,_.nc,a),mX(this,_.Cc,a)):a.endedReason===b.ERROR&&jX(this,1);break;case cast.framework.events.EventType.PLAYING:mX(this,_.xc,a);break;case cast.framework.events.EventType.PAUSE:mX(this,_.vc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?mX(this,_.lc,a):mX(this,_.xc,a)}}};
|
|
62
|
+
NX.prototype.getPosition=NX.prototype.getPosition;NX.prototype.setVolume=NX.prototype.setVolume;NX.prototype.getVolume=NX.prototype.getVolume;NX.prototype.skip=NX.prototype.skip;NX.prototype.pause=NX.prototype.pause;NX.prototype.resume=NX.prototype.resume;var gX=!1;var OX=class{constructor(a){this.Ya=a;this.a=this.f.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(nX(),this.a)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(nX(),this.a)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>oX(a))}f(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=
|
|
63
|
+
_.kg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.lg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.mg}b&&this.Ya(new _.D(b,{detail:oX(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.Ya(new _.D(_.kg,{detail:b}))}};var PX=class extends _.T{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;pX().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;pX().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}na(){return this.j}oa(){return null}Ra(){const a=
|
|
64
|
+
this.ra();return a&&a.renditions[0]}Va(){const a=this.xa();return a&&a.renditions[0]}vb(){return null}Gb(){return null}Hb(){return null}Ia(){return null}ra(){let a=null;if(this.f){let b=this.f.getActiveId();typeof b===_.t&&(b=b.toString(),a=this.getAudioTracks().find(c=>c.id===b)||null)}return a}xa(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.t&&(b=b.toString(),a=this.na().find(c=>c.id===b)||null)}return a}Db(){this.g.warn("Video tracks unavailable on Cast")}ya(a){a&&this.f&&
|
|
65
|
+
this.f.setActiveById(+a.id)}Xa(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}nb(){this.g.warn("Video renditions unavailable on Cast")}Bb(a){this.ya(a&&a.track)}Cb(a){this.Xa(a&&a.track)}addTextTrack(a){const b=this;return _.x(function*(){var c=b.m.getConfiguration();if((c=yield GW(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=
|
|
66
|
+
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]),rX(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}ua(){return!0}w(){this.f=pX().getAudioTracksManager();var a=this.f.getTracks();this.h=qX(_.M,a);rX(this);a=this.m.getConfiguration();sX(this,_.M,a.preferredAudioLanguage,a.preferredAudioRole);sX(this,_.L,a.preferredTextLanguage,a.preferredTextRole)}};PX.prototype.isAbrEnabled=PX.prototype.ua;
|
|
67
|
+
PX.prototype.addTextTrack=PX.prototype.addTextTrack;PX.prototype.setTextRendition=PX.prototype.Cb;PX.prototype.setAudioRendition=PX.prototype.Bb;PX.prototype.setVideoRendition=PX.prototype.nb;PX.prototype.setTextTrack=PX.prototype.Xa;PX.prototype.setAudioTrack=PX.prototype.ya;PX.prototype.setVideoTrack=PX.prototype.Db;PX.prototype.getTextTrack=PX.prototype.xa;PX.prototype.getAudioTrack=PX.prototype.ra;PX.prototype.getVideoTrack=PX.prototype.Ia;PX.prototype.getLoadingTextRendition=PX.prototype.Hb;
|
|
68
|
+
PX.prototype.getLoadingAudioRendition=PX.prototype.Gb;PX.prototype.getLoadingVideoRendition=PX.prototype.vb;PX.prototype.getTextRendition=PX.prototype.Va;PX.prototype.getAudioRendition=PX.prototype.Ra;PX.prototype.getVideoRendition=PX.prototype.oa;PX.prototype.getTextTracks=PX.prototype.na;PX.prototype.getAudioTracks=PX.prototype.getAudioTracks;PX.prototype.getVideoTracks=PX.prototype.getVideoTracks;var QX=class extends _.Cu{constructor(){super();this.g=new _.S(zW);this.h=this.w=_.Gl();this.A=null;this.l=-1;this.F=new _.Er;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=tX();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new LX(this);this.a.init();this.j=new PX;this.j.initialize(this);this.o=new OX(c=>this.trigger(c));this.o.init()}unload(){const a=
|
|
69
|
+
cast.framework.messages.PlayerState,b=tX();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 _.x(function*(){a.B=null;a.w=_.Gl();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(){const a=tX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");
|
|
70
|
+
a.play();return Promise.resolve()}pause(){const a=tX();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()}isPaused(){return tX().getPlayerState()===cast.framework.messages.PlayerState.PAUSED}isEnded(){return tX().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=tX();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(rW);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return tX().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
|
|
71
|
+
tX().getDurationSec();return typeof a===_.t?-1===a?Infinity:a:-1}getPlaybackRate(){return tX().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;tX().sendLocalMediaRequest(b)}}getVolume(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null}setVolume(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)}setMuted(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)}isMuted(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||
|
|
72
|
+
null}getLoadedSource(){const a=tX().getMediaInformation();if(a){var b=tX().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,Pi:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return tX().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=tX().getLiveSeekableRange();
|
|
73
|
+
b&&typeof b.start===_.t&&typeof b.end===_.t&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():_.rv}getStats(){var a=_.Xo();if(this.f){a=tX().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===_.t?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.t?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=
|
|
74
|
+
this;return _.x(function*(){b.f=new _.qv;b.a.l=b.f.a;b.A=_.np(a);b.h=_.Il(b.w,a);if(b.C)b.C=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.t&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:EW(b.h),local:!0};yield tX().load(d)}})}getBufferInfo(){this.g.warn(_.pa);return new _.Bu}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.ob)}appendLoad(){return Promise.reject(_.ob)}seekWith(){return Promise.reject(_.ob)}setNetworkEngine(a){this.F=
|
|
75
|
+
a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return zW}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(vW)}onError(a){a=new _.D(_.q,{detail:a});this.trigger(a)}canPlay(){return _.Tk()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=EW(this.getStats());var b=tX(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();
|
|
76
|
+
c&&typeof b===_.t&&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=tX().getStartAbsoluteTime();if(typeof d===_.t){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=
|
|
77
|
+
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=FW(a.media.customData.playerConfiguration));var d=c?c.abr||null:null,e=b;d&&typeof d.defaultBandwidthEstimate===_.t?e.initialBandwidth=d.defaultBandwidthEstimate:e.initialBandwidth=void 0;wX(c,b);d=null;a.media.customData&&(d=FW(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;if(a=null!=c&&c.lowLatencyMode||
|
|
78
|
+
a)a=Object.assign({},b.shakaConfig,{streaming:{lowLatencyMode:!0}}),b=Object.assign({},b,{shakaConfig:a});return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var yX=class{constructor(){this.a=!1;this.g=new _.S(AW);this.f=this.m=null;this.h=new Set;this.A=this.G.bind(this);this.w=this.B.bind(this);this.j=null;this.o=new _.St;this.l=null}init(a){a&&(this.f=new QX,_.Ur(a,this.f),this.m=a,this.o.on(window,"unload",()=>{const b=this;return _.x(function*(){b.m&&b.m.getState()!==_.hp&&(yield DW(b.m))})}))}start(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=AX(),b=AX().getPlayerManager(),c=new cast.framework.CastReceiverOptions;
|
|
79
|
+
c.customNamespaces={};c.customNamespaces[BW]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.F.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.C.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
|
|
80
|
+
this.A);a.start(c);a.addCustomMessageListener(BW,this.w)}}stop(){if(this.a){this.a=!1;this.o.release();const a=AX();AX().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(BW,this.w);a.stop();this.m=this.f=null}}zd(a){this.j=a}li(a){this.l=a}on(a,b){AX().addEventListener(a,b)}off(a,b){AX().removeEventListener(a,b)}addMessageListener(a){typeof a===_.ne&&this.h.add(a)}removeMessageListener(a){typeof a===_.ne&&this.h.delete(a)}sendMessage(a,
|
|
81
|
+
b){AX().sendCustomMessage(BW,b,EW(a))}wc(){return this.a}Fb(){return BX()}$b(a){CX(this,a)}Ci(a){const b=BX();let c=null;a?c=Object.assign({},b,a):c=b;CX(this,c)}F(a){a=a.trim();if(a.startsWith("#EXTM3U"))return EX(this,a);try{var b=(new DOMParser).parseFromString(a,_.ig)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=AX();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.fa);for(var f=e.length-
|
|
82
|
+
1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.w||g===_.p){g=e[f].getAttribute(_.Me);var h=e[f].getElementsByTagName(_.Bb);for(let k=h.length-1;0<=k;--k){const l=h[k].getAttribute(_.Me)||g,m=h[k].getAttribute(_.Bd);let n=h[k].getAttribute(_.Vg)||void 0,r=h[k].getAttribute(_.oe)||void 0;void 0!==n&&(n=+n);void 0!==r&&(r=+r);b.canDisplayType(l,m,n,r)||e[f].removeChild(h[k])}e[f].getElementsByTagName(_.Bb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.fa).length||a.removeChild(c[d])}return a=
|
|
83
|
+
(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Hb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=AX();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.w){e=c[d].getElementsByTagName(_.zb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.eb)||void 0,h=e[f].getAttribute(_.db)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Ig,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.zb).length||a.removeChild(c[d])}a=
|
|
84
|
+
(new XMLSerializer).serializeToString(a)}return a}C(a){const b=this;return _.x(function*(){let c=a;var d;c.media.customData&&(d=FW(c.media.customData.playerConfiguration));if(b.m&&d){b.j&&(d=(yield Promise.resolve(b.j(d)))||d);d.ima&&(yield iX(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.t&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.es(b.m,d),yield _.fs(b.m),d=b.m.getLoadedSource(),c.media.contentId=
|
|
85
|
+
d.url,c.media.contentType=d.type,d.ac&&(c.media.hlsVideoSegmentFormat=HW(d.ac,_.N)),d.audioMimeType&&(c.media.hlsSegmentFormat=HW(d.audioMimeType,_.M)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.t&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.l&&(d=yield Promise.resolve(b.l(c)))&&(c=d);return c})}G(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){var b=AX().getPlayerManager(),
|
|
86
|
+
c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.t||typeof c!==_.t||typeof d!==_.t||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.t&&b>=a&&b<=c&&this.m.seek(b))}_.hs(this.m)}}B(a){if(0<this.h.size){const b=FW(a.data);this.h.forEach(c=>c(b))}}};_.z(AW,yX);yX.prototype.updateContentMetadata=yX.prototype.Ci;yX.prototype.setContentMetadata=yX.prototype.$b;yX.prototype.getContentMetadata=yX.prototype.Fb;yX.prototype.isApiReady=yX.prototype.wc;
|
|
87
|
+
yX.prototype.sendMessage=yX.prototype.sendMessage;yX.prototype.removeMessageListener=yX.prototype.removeMessageListener;yX.prototype.addMessageListener=yX.prototype.addMessageListener;yX.prototype.off=yX.prototype.off;yX.prototype.on=yX.prototype.on;yX.prototype.setLoadRequestDataInterceptor=yX.prototype.li;yX.prototype.setPlayerConfigInterceptor=yX.prototype.zd;yX.prototype.stop=yX.prototype.stop;yX.prototype.start=yX.prototype.start;yX.prototype.init=yX.prototype.init;yX.getInstance=zX;var xX=null;var RX=class{constructor(a){this.f=a;this.a=null;this.j=new _.St;this.l=[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]}load(){const a=this;return _.x(function*(){a.a=a.f.l;if(a.a){const b=a.a.controller,c=a.A.bind(a);for(const d of a.l)a.j.on(b,d,c)}})}start(){return _.x(function*(){})}w(){}resume(){this.a&&
|
|
88
|
+
this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()}pause(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.f.a;a&&this.f.sendMessage(CW,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})}getVolume(){return this.f.getVolume()||0}setVolume(a){this.f.setVolume(a)}getPosition(){let a=-1;var b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.t&&(a=b));return a}o(){return!0}h(){const a=
|
|
89
|
+
this;return _.x(function*(){a.j.release()})}A(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.D(_.Fc,{adsTimeline:new MX(a.breaks)})));break;case "isPlayingBreak":a.value?GX(this,_.jc):(GX(this,_.nc),GX(this,_.Cc),GX(this,_.kc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(GX(this,_.nc),GX(this,_.Cc)),GX(this,_.zc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?GX(this,_.vc):GX(this,_.xc))}}};RX.prototype.getPosition=RX.prototype.getPosition;
|
|
90
|
+
RX.prototype.setVolume=RX.prototype.setVolume;RX.prototype.getVolume=RX.prototype.getVolume;RX.prototype.skip=RX.prototype.skip;RX.prototype.pause=RX.prototype.pause;RX.prototype.resume=RX.prototype.resume;_.Bp(new class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.ud?!1:!(!b||!b.ima)}create(a){return new RX(a.a)}});_.Bp(new class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return zX().wc()?!(!b||!b.ima):!1}create(a){return new NX(a)}});};f.call(g, window);
|
package/cl.conviva.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
_.
|
|
3
|
-
c);h(Conviva.Constants.DeviceMetadata.OS_NAME,e);h(Conviva.Constants.DeviceMetadata.OS_VERSION,b);h(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||d);h(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||f);return g},
|
|
4
|
-
|
|
5
|
-
Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=
|
|
6
|
-
a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=
|
|
7
|
-
a.f.on(a.m,_.
|
|
8
|
-
|
|
9
|
-
d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(c){a.g.error("Could not create ad analytics session",c)}}},
|
|
10
|
-
b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;b={};b[Conviva.Constants.FRAMEWORK_NAME]=_.qa;b[Conviva.Constants.FRAMEWORK_VERSION]=_.ea;a.a.setPlayerInfo(b)},
|
|
11
|
-
new _.
|
|
12
|
-
h);if(h=a.m.getStats()){h=h.decodedFrames;const k=h-a.H;a.H=h;isFinite(k)&&(a.g.debug("Current FPS",k),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,k))}}});a.C=!0;a.h=!0;a.I=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(h=>{h.
|
|
13
|
-
a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.C=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.O=0,a.J=!1,a.j=[],a.H=0)},
|
|
14
|
-
a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},
|
|
15
|
-
a=a.ad;this.j||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF")
|
|
16
|
-
break;case _.
|
|
17
|
-
const b=a.ad,c=()=>{this.j=!0
|
|
18
|
-
this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)}},
|
|
19
|
-
_.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
break;case _
|
|
23
|
-
a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){const b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({
|
|
24
|
-
var b=a.ad;a=0===b.
|
|
25
|
-
|
|
26
|
-
this.I=!0,
|
|
27
|
-
this.f=null,this.h&&(this.h.destroy(),this.h=null))}onPlayerWillRelease(){this.a&&(this.f.release(),this.h&&this.h.release())}id(){return"conviva"}reportAppEvent(a,b){return this.f?this.f.reportAppEvent(a,b):!1}};_.z("clpp.conviva.ConvivaPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var SV="Ad Error",TV="onAdBreakStarted()",UV="onAdBreakStopped()",VV=function(a){var b=_.il();let c=Conviva.Constants.DeviceType.DESKTOP,d=Conviva.Constants.DeviceCategory.WEB;const e=b.os;b=b.osVersion.name;let f="";_.Uk()&&(f="Apple");_.Tk()?(f="Google",c=Conviva.Constants.DeviceType.SETTOP,d=Conviva.Constants.DeviceCategory.CHROMECAST):_.Vk()?(c=Conviva.Constants.DeviceType.MOBILE,/(android)/i.test(navigator.userAgent)?d=Conviva.Constants.DeviceCategory.ANDROID_DEVICE:_.Uk()&&(d=Conviva.Constants.DeviceCategory.APPLE_DEVICE)):
|
|
2
|
+
_.Nk()||_.Kk()||_.Jk("Hisense")?(c=Conviva.Constants.DeviceType.SMARTTV,d=Conviva.Constants.DeviceCategory.SMART_TV,_.Nk()?(b="",f="LG",d=Conviva.Constants.DeviceCategory.LG_TV):_.Kk()?(f="Samsung",d=Conviva.Constants.DeviceCategory.SAMSUNG_TV):_.Jk("Hisense")&&(b="",f="Hisense")):_.Jk("Xbox One")&&(f="Microsoft",c=Conviva.Constants.DeviceType.CONSOLE,d=Conviva.Constants.DeviceCategory.XBOX);const g=a.deviceMetadata||{},h=(k,l)=>{k in g||!l||(g[k]=l)};h(Conviva.Constants.DeviceMetadata.TYPE,a.deviceType||
|
|
3
|
+
c);h(Conviva.Constants.DeviceMetadata.OS_NAME,e);h(Conviva.Constants.DeviceMetadata.OS_VERSION,b);h(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||d);h(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||f);return g},WV=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},XV=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},ZV=function(a,b,c,d){const e={};e[Conviva.Constants.PLAYER_NAME]=c;e[Conviva.Constants.VIEWER_ID]=b;e[Conviva.Constants.IS_LIVE]=
|
|
4
|
+
WV(!!d);e[Conviva.Constants.ASSET_NAME]=SV;a&&(e[Conviva.Constants.ASSET_NAME]=a.getTitle(),e[Conviva.Constants.STREAM_URL]=a.getMediaUrl(),e[Conviva.Constants.DURATION]=a.getDuration(),e["c3.ad.id"]=YV(a.getId()),e["c3.ad.creativeId"]=YV(a.getCreativeId()),e["c3.ad.system"]=YV(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=YV(a.getApiFramework()),e["c3.ad.advertiser"]=YV(a.getAdvertiserName()),e["c3.ad.position"]=XV(a.getPodIndex()),e["c3.ad.technology"]=0===a.xb()?Conviva.Constants.AdType.CLIENT_SIDE:
|
|
5
|
+
Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=YV(a.sb()),e["c3.ad.adManagerVersion"]=YV(a.tb()),e["c3.ad.advertiserCategory"]=YV(null),e["c3.ad.advertiserId"]=YV(null),e["c3.ad.breakId"]=YV(null),e["c3.ad.campaignName"]=YV(null),e["c3.ad.category"]=YV(null),e["c3.ad.classification"]=YV(null),e["c3.ad.creativeName"]=YV(null),e["c3.ad.sequence"]=YV(a.wb()),e["c3.ad.sessionStartEvent"]=YV(null),e["c3.ad.unitName"]=YV(null),e["c3.ad.dayPart"]=YV(null),b=a.getWrapperAdIds().slice(-1)[0]||
|
|
6
|
+
a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=YV(b),e["c3.ad.firstAdSystem"]=YV(c),e["c3.ad.firstCreativeId"]=YV(a));return e},YV=function(a){return a?""+a:"NA"},cW=function(a){a.f.on(a.m,_.jc,a.C.bind(a));a.f.on(a.m,_.kc,a.F.bind(a));a.f.on(a.m,_.zc,a.L.bind(a));a.f.on(a.m,_.wc,a.l.bind(a));a.f.on(a.m,_.vc,a.l.bind(a));a.f.on(a.m,_.xc,a.l.bind(a));a.f.on(a.m,_.lc,a.l.bind(a));a.f.on(a.m,_.Cc,a.M.bind(a));
|
|
7
|
+
a.f.on(a.m,_.yc,a.K.bind(a));a.f.on(a.m,_.mc,a.G.bind(a));a.f.on(a.m,_.sc,a.I.bind(a));a.f.on(a.m,_.tc,a.J.bind(a));a.f.on(a.m,_.oc,a.H.bind(a));a.f.on(a.m,_.uc,a.S.bind(a));a.f.on(a.m,_.Dc,a.O.bind(a));a.f.on(a.m,_.q,b=>{var c=b.detail;if(10003===c.code&&(a.g.debug("onAdError()"),!a.h)){b=Conviva.Constants.ErrorSeverity;switch(c.data.errorType){case 0:c="Ad Load Error";break;case 1:c="Ad Play Error";break;default:c=SV}null===a.a&&$V(a,null);a.a.reportAdError(c,b.FATAL);a.h=!0;a.g.debug("Ad Playback Failure");
|
|
8
|
+
aW(a,bW,c)}})},aW=function(a,b,c=SV){if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case bW:a.a.reportAdFailed(c,ZV(null,a.B,a.A));break;case dW:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();a.a=null;a.j=!1}},$V=function(a,b){if(!a.o){a.h=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.R()),b){const c=ZV(b,a.B,a.A,a.m.isLive()),d=String(b.tb()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.sb();e[Conviva.Constants.FRAMEWORK_VERSION]=
|
|
9
|
+
d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(c){a.g.error("Could not create ad analytics session",c)}}},eW=function(a,b){const c={};c[Conviva.Constants.LOG_LEVEL]=Conviva.Constants.LogLevel.DEBUG;b.serviceUrl&&(a.g.warn("Touchstone URL is set. Do not set this in production!"),c[Conviva.Constants.GATEWAY_URL]=b.serviceUrl.replace(/\/$/,""));Conviva.Analytics.init(b.customerKey,null,c);Conviva.Analytics.setDeviceMetadata(VV(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,
|
|
10
|
+
b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;b={};b[Conviva.Constants.FRAMEWORK_NAME]=_.qa;b[Conviva.Constants.FRAMEWORK_VERSION]=_.ea;a.a.setPlayerInfo(b)},fW=function(a){return a.m.getConfiguration().autoplay||!1},hW=function(a){if(!a.l)if(a.C)a.g.warn("Current session still active. No-op.");else{var b=a.m.getLoadedSource()||a.K,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||"N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=
|
|
11
|
+
new _.Bm(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.Zj(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.qa;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.B(c.customTags))for(const h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(()=>{a.g.debug("reportMiscellaneousMetrics()");if(gW(a)){var h=1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,
|
|
12
|
+
h);if(h=a.m.getStats()){h=h.decodedFrames;const k=h-a.H;a.H=h;isFinite(k)&&(a.g.debug("Current FPS",k),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,k))}}});a.C=!0;a.h=!0;a.I=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(h=>{h.Pf(h.args)}));a.j=[]}},iW=function(a){if(!a.l&&a.a){const b=WV(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},gW=function(a){return null!==a.a&&a.C},jW=function(a){a.g.debug("terminateSession()");
|
|
13
|
+
a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.C=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.O=0,a.J=!1,a.j=[],a.H=0)},lW=function(a,b){const c=b.getConfiguration();a.a=!_.B(c.conviva)&&typeof c.conviva===_.Se;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,a=new _.I(1,9,9E3),kW(b,a)):b.namespace()===_.ud&&(a.a=!1,
|
|
14
|
+
a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},mW=function(a){const b=[];typeof a===_.Se&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.I(1,9,9001,{missingKeys:b});},kW=function(a,b){a.trigger(new _.D(_.q,{detail:b}))};var oW=class{constructor(a,b){this.m=a;this.R=b;this.B="";this.A=_.qa;this.g=new _.S("clpp.conviva.ad");this.f=new _.St;this.a=null;this.h=this.o=this.w=this.j=!1}initialize(a){this.g.debug("Initialize Ad Insights");this.h=this.w=!1;this.B=a.viewerId;this.A=a.playerName||_.qa;cW(this)}release(){this.g.debug("Release Ad Insights");this.w?this.g.debug(_.ia):(_.Th(this.f),this.a&&aW(this,nW),this.f.release(),this.w=!0,this.j=this.h=!1)}destroy(){this.g.debug(_.Qd);this.o?this.g.debug(_.ha):this.o=!0}C(){this.g.debug(TV)}F(){this.g.debug(UV)}L(a){this.g.debug("onAdStarted()");
|
|
15
|
+
a=a.ad;this.j||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),$V(this,a));this.j=!1;this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.PLAYING);this.a.reportAdMetric(Conviva.Constants.Playback.RESOLUTION,a.ib(),a.hb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.Ta())}l(a){this.g.debug("onAdStateChanged()");if(this.a){const b=c=>{this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,c)};switch(a.type){case _.wc:case _.xc:b(Conviva.Constants.PlayerState.PLAYING);
|
|
16
|
+
break;case _.vc:b(Conviva.Constants.PlayerState.PAUSED);break;case _.lc:b(Conviva.Constants.PlayerState.BUFFERING)}}}M(){this.g.debug("onAdStopped()");this.a&&!this.h&&aW(this,nW)}K(){this.g.debug("onAdSkipped()");this.a&&aW(this,dW)}G(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")}I(){this.g.debug("onAdImpression()");if(this.a){const a=Conviva.Constants.Events;this.a.reportAdPlayerEvent(a.AD_IMPRESSION_START);this.a.reportAdPlayerEvent(a.AD_IMPRESSION_END)}}J(a){this.g.debug("onAdLoaded()");
|
|
17
|
+
const b=a.ad,c=()=>{this.j=!0;$V(this,b)};if(-1!==b.getPodIndex()||this.m.getPosition()>=this.m.getDuration()-5)c();else this.f.on(this.m,_.og,()=>{this.m.getPosition()>=this.m.getDuration()-5&&(this.f.off(this.m,_.og),c())})}H(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)}S(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)}O(){this.g.debug("onAdThirdQuartile()");this.a&&
|
|
18
|
+
this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)}},dW=0,nW=1,bW=2;var pW=class{constructor(a,b){this.m=a;this.f=new _.St;this.a=null;this.o=!1;this.G=!0;this.B=this.h=this.A=this.C=this.l=!1;this.O=0;this.J=!1;this.w=null;this.I=!1;this.g=b;this.K=this.F=null;this.j=[];this.H=0}initialize(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.G=!1,this.F=_.mh(b),this.K=c,this.m=a,eW(this,this.F),this.f.on(this.m,_.gf,this.ba.bind(this)),this.f.on(this.m,_.$f,this.Y.bind(this)),this.f.on(this.m,_.Zc,this.L.bind(this)),this.f.on(this.m,_.Cg,this.W.bind(this)),this.f.on(this.m,
|
|
19
|
+
_.Bg,this.U.bind(this)),this.f.on(this.m,_.jc,this.R.bind(this)),this.f.on(this.m,_.kc,this.S.bind(this)),this.f.on(this.m,_.Fc,this.$.bind(this)),this.f.on(this.m,_.Yc,this.da.bind(this)),this.f.on(this.m,_.q,this.M.bind(this)),fW(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),hW(this)))}release(){this.g.debug("Release conviva");this.G?this.g.debug(_.ia):(_.Th(this.f),gW(this)||this.o||!fW(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),gW(this)&&
|
|
20
|
+
jW(this),this.a=null,this.G=!0)}destroy(){this.g.debug(_.Qd);this.l?this.g.debug(_.ha):this.l=!0}reportAppEvent(a,b){let c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c}ba(){this.g.debug("onPlayRequest()");gW(this)||fW(this)?gW(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),gW(this)&&!this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_ENDED),this.h=!0),this.A=!1):(this.g.debug("Creating conviva session. On Play Requested / No autoplay"),
|
|
21
|
+
hW(this))}Y(a){this.g.debug(_.Ye);const b=c=>{if(this.o&&(this.g.debug("Creating conviva session (On Seek / Replay)"),eW(this,this.F),hW(this),iW(this),gW(this))){var d=this.m.getTrackManager();d=d.oa()||d.vb();d.width&&d.height&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,d.width,d.height);d.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,d.bandwidth/1E3)}gW(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,c)};switch(a.detail.currentState){case _.kp:b(Conviva.Constants.PlayerState.PLAYING);
|
|
22
|
+
break;case _.jp:b(Conviva.Constants.PlayerState.PAUSED);break;case _.dp:b(Conviva.Constants.PlayerState.BUFFERING);break;case _.$o:this.g.debug("onVideoEnded()"),gW(this)&&(this.w&&this.w.Kb()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.J=!0):jW(this))}}L(a){this.g.debug(_.Te);if(gW(this)){if(a=a.detail,typeof a.width===_.t&&typeof a.height===_.t&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,
|
|
23
|
+
a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){const b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({Pf:this.L.bind(this),args:a})}W(){this.g.debug("onSeeking()");gW(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)}U(){this.g.debug("onSeeked()");gW(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)}$(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a}R(a){this.g.debug(TV);
|
|
24
|
+
var b=a.ad;a=0===b.Ua();const c=XV(b.getPodIndex());gW(this)||fW(this)||!a||hW(this);if(gW(this)){a=0===b.xb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;let d=0;const e={};1===b.jb()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.O;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.Tk()?b.CONTENT:b.SEPARATE;this.a.reportAdBreakStarted(a,b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")}S(){this.g.debug(UV);
|
|
25
|
+
gW(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.J&&jW(this))}M(a){this.g.debug(_.Ve);if(this.o&&this.I)this.g.debug("Session ended in VPF; ignoring subsequent errors");else{var b=a.detail||null,c=b&&b.message||"Player error",d=Conviva.Constants.ErrorSeverity.WARNING;b&&b.severity&&b.severity===_.F&&(d=Conviva.Constants.ErrorSeverity.FATAL,gW(this)||hW(this));gW(this)?(this.g.debug("Report error",c,d),this.a.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.g.debug("Video Playback Failure"),
|
|
26
|
+
this.I=!0,jW(this))):this.j.push({Pf:this.M.bind(this),args:a})}}da(){this.g.debug("onAutoPlayBlocked()");gW(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,gW(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))}};var qW=class{constructor(){this.h=this.f=null;this.a=!1;this.g=new _.S("clpp.conviva")}onPlayerCreated(a){this.f=new pW(a,this.g)}onContentWillLoad(a,b){lW(this,a);if(this.a){var c=a.getConfiguration();c=_.mh(c.conviva||{});try{mW(c);const d=c.enableAdInsights||!1;this.f.initialize(a,c,b);d&&(this.h=new oW(a,()=>this.f.a),this.h.initialize(c))}catch(d){d instanceof _.I?kW(a,d):kW(a,new _.I(1,9,9002,d,d))}}}onContentLoaded(){this.a&&iW(this.f)}onPlayerWillDestroy(){this.a&&(this.a=!1,this.f.destroy(),
|
|
27
|
+
this.f=null,this.h&&(this.h.destroy(),this.h=null))}onPlayerWillRelease(){this.a&&(this.f.release(),this.h&&this.h.release())}id(){return"conviva"}reportAppEvent(a,b){return this.f?this.f.reportAppEvent(a,b):!1}};_.z("clpp.conviva.ConvivaPlugin",qW);qW.prototype.reportAppEvent=qW.prototype.reportAppEvent;qW.Id="conviva";_.Nr(new class{create(){return new qW}});};f.call(g, window);
|