@castlabs/prestoplay 6.25.0 → 6.25.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 +9 -1
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +4 -4
- package/cjs/cl.cast.js +38 -38
- package/cjs/cl.conviva.js +14 -14
- package/cjs/cl.core.js +115 -115
- package/cjs/cl.crypto.js +2 -2
- package/cjs/cl.dash.js +21 -21
- package/cjs/cl.freewheel.js +8 -8
- package/cjs/cl.hls.js +42 -42
- package/cjs/cl.htmlcue.js +7 -7
- package/cjs/cl.ima.js +9 -9
- package/cjs/cl.mse.js +46 -46
- package/cjs/cl.muxdata.js +6 -6
- package/cjs/cl.playlist.js +4 -4
- package/cjs/cl.sessions.js +5 -5
- package/cjs/cl.simid.js +2 -2
- package/cjs/cl.smooth.js +19 -19
- package/cjs/cl.thumbnails.js +2 -2
- package/cjs/cl.tizen.js +18 -18
- package/cjs/cl.ttml.js +5 -5
- package/cjs/cl.verimatrix.js +1 -1
- package/cjs/cl.vimond.js +4 -4
- package/cjs/cl.vr.js +7 -7
- package/cjs/cl.vtt.js +1 -1
- package/cjs/cl.youbora.js +6 -6
- package/cl.airplay.js +1 -1
- package/cl.cast.js +11 -11
- package/cl.conviva.js +1 -1
- package/cl.core.js +61 -61
- package/cl.crypto.js +2 -2
- package/cl.dash.js +10 -10
- package/cl.freewheel.js +1 -1
- package/cl.hls.js +9 -9
- package/cl.htmlcue.js +2 -2
- package/cl.ima.js +3 -3
- package/cl.mse.js +11 -11
- package/cl.muxdata.js +1 -1
- package/cl.playlist.js +1 -1
- package/cl.smooth.js +10 -10
- package/cl.tizen.js +3 -3
- package/cl.ttml.js +2 -2
- package/cl.vimond.js +1 -1
- package/cl.vr.js +2 -2
- package/cl.vtt.js +1 -1
- package/cl.youbora.js +4 -4
- package/clpp.styles.css +4 -0
- package/package.json +1 -1
- package/typings.d.ts +9 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 6.25.
|
|
1
|
+
# 6.25.1
|
|
2
2
|
|
|
3
3
|
## New Features
|
|
4
4
|
|
|
@@ -16,8 +16,16 @@
|
|
|
16
16
|
* Fix an issue with AirPlay on iOS when switching between DASH and HLS playback.
|
|
17
17
|
* Fix `streaming.disableAudioTracks` config option for multi-period streams.
|
|
18
18
|
* Support EXT-X-DEFINE tags anywhere in the playlist in HLS.
|
|
19
|
+
* Fix issues with `setDrmCustomDataModifier()` in AirPlay related to loading
|
|
20
|
+
a new stream during na AirPLay session.
|
|
19
21
|
* Fix an issues with upper case values of `Content-Type` HTTP header in media
|
|
20
22
|
segment responses in HLS.
|
|
23
|
+
* Fix positioning of WebVTT subtitles based on the base direction of text.
|
|
24
|
+
* `align:start` and `align:end` in WebVTT now respect the base direction.
|
|
25
|
+
|
|
26
|
+
# 6.25.0
|
|
27
|
+
|
|
28
|
+
(We released 6.25.1 instead)
|
|
21
29
|
|
|
22
30
|
# 6.24.0
|
|
23
31
|
|
package/cjs/cl.airplay.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var lZ=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.ji(function(){a.m.play()["catch"](function(){})});this.h=new _.wi},mZ=function(){};_.x(lZ,_.gw);_.u=lZ.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.u.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.
|
|
3
|
-
_.u.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.u.id=function(){return"airplay"};_.u.
|
|
4
|
-
_.u.Xf=function(){return this.f};_.u.
|
|
2
|
+
var f=function(window){var lZ=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.ji(function(){a.m.play()["catch"](function(){})});this.h=new _.wi},mZ=function(){};_.x(lZ,_.gw);_.u=lZ.prototype;_.u.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.u.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.en.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.Jn.bind(this)))};
|
|
3
|
+
_.u.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.u.id=function(){return"airplay"};_.u.en=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.L(_.Uc,{canCast:this.f}))};_.u.Jn=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Tc:_.Sc;if(this.l||!this.m.isPaused()||this.m.getState()===_.Vq)this.l?this.m.play()["catch"](function(){}):this.o.fa(.01);this.m.trigger(new _.L(a))};_.u.Ub=function(){return this.j};
|
|
4
|
+
_.u.Xf=function(){return this.f};_.u.zo=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.J("clpp.airplay.AirPlayPlugin",lZ);lZ.prototype.showCastMenu=lZ.prototype.zo;lZ.prototype.canCast=lZ.prototype.Xf;lZ.prototype.isCasting=lZ.prototype.Ub;lZ.Id="airplay";mZ.prototype.create=function(){return new lZ};_.cu(new mZ);};
|
|
5
5
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
6
6
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
7
7
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.broadpeak.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
2
|
var f=function(window){var dZ=function(a,b){this.m=a;this.f=b;this.a=new _.wi;this.h=!1},eZ=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.a=_.Hk();return d}_.x(b,GenericPlayerApi);b.prototype.getPlayerName=function(){return _.xa};b.prototype.getVersion=function(){return _.ia};b.prototype.getOSName=function(){return this.a.os};b.prototype.getDeviceVersion=function(){return this.a.osVersion.name};b.prototype.getDeviceType=function(){return"browser"};b.prototype.getTotalDuration=function(){return this.m.isLive()?
|
|
3
3
|
0:1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){return 1E3*this.m.getPosition()};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};return new b(a)},fZ=function(){this.l=this.f=this.a=this.h=this.m=null;this.o=new _.wi;this.j=!1},gZ=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof f===_.ug&&a.h.setUUID(f))},hZ=
|
|
4
|
-
function(a,b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var d in c)a.a.setCustomParameter(d,c[d]);a.o.on(a.m,_.Ae,a.
|
|
5
|
-
_.u.init=function(){var a=this.m,b=this.a;b.on(a,_.rg,this.
|
|
6
|
-
_.u.
|
|
7
|
-
_.u.onContentLoaded=function(){!1!==this.j&&this.a.precacheEnded()};_.u.
|
|
4
|
+
function(a,b){var c=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var d in c)a.a.setCustomParameter(d,c[d]);a.o.on(a.m,_.Ae,a.ek.bind(a));a.l=eZ(a.m);a.a.attachPlayer(a.l)},iZ=function(a,b){_.zi(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},jZ=function(){return!window.SmartLib||!window.GenericPlayerApi},kZ=function(){};_.u=dZ.prototype;
|
|
5
|
+
_.u.init=function(){var a=this.m,b=this.a;b.on(a,_.rg,this.hk.bind(this));b.on(a,_.md,this.fk.bind(this));b.on(a,"seek",this.gk.bind(this))};_.u.fk=function(a){a=a.detail;typeof a.bandwidth===_.k&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.u.hk=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;a.previousState===_.Mq&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Mq:c.notifyStallStart();break;case _.Vq:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.Uq:c.notifyPause()}};
|
|
6
|
+
_.u.gk=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.u.release=function(){this.a&&(_.zi(this.a),this.a=null)};_.x(fZ,_.gw);_.u=fZ.prototype;_.u.onPlayerCreated=function(a){this.m=a};_.u.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(jZ())return a.onError(new _.O(1,9,11E3));this.j=!0;gZ(this,d);hZ(this,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.O(1,9,11001,{bpkErrorCode:f,message:e}));iZ(c,void 0)}else b.url=e.getURL(),c.f=new dZ(c.m,c.l),c.f.init()})}};
|
|
7
|
+
_.u.onContentLoaded=function(){!1!==this.j&&this.a.precacheEnded()};_.u.ek=function(a){a=a.detail;if(7003===a.code)iZ(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.P)switch(a.category){case 3:iZ(this,SmartLib.BPDecodingError);break;case 1:iZ(this,SmartLib.BPNetworkingError);break;case 6:iZ(this,SmartLib.BPAccessRightError);break;default:iZ(this,SmartLib.BPUnspecifiedError)}};_.u.onPlayerWillRelease=function(){jZ()||iZ(this,SmartLib.BPSessionEndsNormally);this.j=!1};_.u.id=function(){return"broadpeak"};
|
|
8
8
|
_.J("clpp.broadpeak.BroadpeakPlugin",fZ);fZ.isSdkMissing=jZ;fZ.Id="broadpeak";kZ.prototype.create=function(){return new fZ};_.cu(new kZ);};
|
|
9
9
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
10
10
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
package/cjs/cl.cast.js
CHANGED
|
@@ -6,29 +6,29 @@ chrome.cast&&chrome.cast.media){var c=chrome.cast.media.HlsSegmentFormat;var d=c
|
|
|
6
6
|
void 0===a?HX:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.O(1,8,8001);var c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},JX=function(a){CX.call(this,a,"clpp.cast.SenderStateManager");
|
|
7
7
|
this.o=this.a=null;this.w=this.ic.bind(this)},KX=function(){this.g=new _.K("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},LX=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},NX=function(a,b){var c=LX(a);return MX(a,b).find(function(d){return c.includes(d.id)})||null},MX=function(a,b){return a.h.filter(function(c){return c.type===b})},PX=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.Sk){var e=
|
|
8
8
|
a.Ba();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;OX(a,b)},function(f){a.f[b]=null;a.g.debug(qX,f)})}else b===_.Sk&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){OX(a,b)},function(f){a.g.debug(qX,f)}))},OX=function(a,b){b===_.V?a.a.trigger(new _.L(_.kd)):b===_.Sk&&a.a.trigger(new _.L(_.Cg))},TX=function(a,b,c,d){_.Am.call(this);this.g=new _.K(_.Hd);this.ca=a;this.o=new _.mi(b);this.Y=c;this.ga=d;this.h=
|
|
9
|
-
this.J=_.Hm();this.C=[];this.B=0;this.L=new _.Kk;this.G=this.l=this.a=null;this.A=this.w=!1;this.ja="";this.Ea=1E6;this.f=new KX;this.f.initialize(this);this.j=new JX(this);this.H=new _.wi;this.K=null;this.I=new Set;this.P=this.
|
|
9
|
+
this.J=_.Hm();this.C=[];this.B=0;this.L=new _.Kk;this.G=this.l=this.a=null;this.A=this.w=!1;this.ja="";this.Ea=1E6;this.f=new KX;this.f.initialize(this);this.j=new JX(this);this.H=new _.wi;this.K=null;this.I=new Set;this.P=this.gn.bind(this);this.ya=this.Dn.bind(this);this.da=this.vn.bind(this);this.U=this.ln.bind(this);this.M=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){QX(!0)},0)}});RX(this);
|
|
10
10
|
SX.add(this)},UX=function(a){var b,c;return _.I(function(d){if(1==d.a)return SX["delete"](a),a.w&&(a.w=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya)),c=[],a.f&&(c.push(a.f.destroy()),a.f=null),a.j&&(c.push(a.j.destroy()),a.j=null),_.y(d,Promise.all(c),2);a.A=!1;a.o&&(a.o.stop(),a.o=null);a.Y=null;a.ga=null;_.C(d)})},ZX=function(a){if(!a)return null;
|
|
11
11
|
a:{var b=a.metadataType;var c=Object.entries(VX);c=_.w(c);for(var d=c.next();!d.done;d=c.next()){d=_.w(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=IX(VX[b]);return Object.assign(b,a)},dY=function(a){var b=void 0===b?HX:b;return Object.values(VX).includes(a)?a:b},iY=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},RX=function(a){if(!a.w&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&
|
|
12
12
|
a.ca.length){a.w=!0;a.o.Xg();var b=cast.framework.CastContext.getInstance(),c=new cast.framework.CastOptions;c.receiverApplicationId=a.ca;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.ya);jY&&a.o.fa(.02)}},kY=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.k?null:a):a=
|
|
13
|
-
null;a=null===a?null:a+b;return null===a?b:a},mY=function(a,b){lY(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.da);b.addMessageListener(zX,a.U)},lY=function(a,b){a.a=b;a.a&&(a.H.release(),a.G=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.G=new cast.framework.RemotePlayerController(a.l),a.H.on(a.G,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.
|
|
13
|
+
null;a=null===a?null:a+b;return null===a?b:a},mY=function(a,b){lY(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.da);b.addMessageListener(zX,a.U)},lY=function(a,b){a.a=b;a.a&&(a.H.release(),a.G=null,a.l=null,a.l=new cast.framework.RemotePlayer,a.G=new cast.framework.RemotePlayerController(a.l),a.H.on(a.G,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.ik.bind(a)),a.H.on(a.G,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.un.bind(a)),
|
|
14
14
|
a.j&&a.j.init(),a.trigger(new _.L(_.Ue)))},nY=function(a){return _.I(function(b){return a.Ub()?b.F(0):_.y(b,cast.framework.CastContext.getInstance().requestSession(),0)})},oY=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,E,G;return _.I(function(B){switch(B.a){case 1:return c=chrome.cast.media.StreamType,d=_.zw,_.y(B,nY(a),2);case 2:if(!b)return B["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);g.streamType=
|
|
15
|
-
b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.mc;m=h.audioMimeType;g.hlsVideoSegmentFormat=GX(l,d.VIDEO);g.hlsSegmentFormat=GX(m,d.AUDIO);if(!b.tb){B.F(3);break}if(!a.M){B.F(4);break}return _.y(B,Promise.resolve(a.M(b.tb)),5);case 5:if(n=B.f)b.tb=n;case 4:a.h=b.tb;a.C=_.Zq(a.h);a.B=a.C.findIndex(function(F){return F.url===b.source.url});if(!b.tb.remoteTextTracks){B.F(6);break}return _.y(B,Promise.all(b.tb.remoteTextTracks.map(a.
|
|
15
|
+
b.isLive?c.LIVE:c.BUFFERED;h=b;l=h.mc;m=h.audioMimeType;g.hlsVideoSegmentFormat=GX(l,d.VIDEO);g.hlsSegmentFormat=GX(m,d.AUDIO);if(!b.tb){B.F(3);break}if(!a.M){B.F(4);break}return _.y(B,Promise.resolve(a.M(b.tb)),5);case 5:if(n=B.f)b.tb=n;case 4:a.h=b.tb;a.C=_.Zq(a.h);a.B=a.C.findIndex(function(F){return F.url===b.source.url});if(!b.tb.remoteTextTracks){B.F(6);break}return _.y(B,Promise.all(b.tb.remoteTextTracks.map(a.Al.bind(a))),7);case 7:p=B.f,g.tracks=p.filter(function(F){return F}),b.tb.remoteTextTracks=
|
|
16
16
|
void 0;case 6:delete b.tb.autoplay,b.tb.startTime=null,g.customData={playerConfiguration:DX(b.tb)};case 3:q=a.Mb()||{};t=dY(q.metadataType);typeof b.Gg===_.k&&(v={metadataType:t,sectionStartAbsoluteTime:b.Gg});b.source.name&&(z={metadataType:t,title:b.source.name});A=iY(q);if(E=ZX(Object.assign({},v,z,A)))g.metadata=E;G=new chrome.cast.media.LoadRequest(g);typeof b.autoplay===_.nd&&(G.autoplay=b.autoplay);typeof b.currentTime===_.k&&(G.currentTime=b.currentTime);return _.y(B,f.loadMedia(G),0)}})},
|
|
17
|
-
pY=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.f.Ba())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.f.ra())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.y(f,oY(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Gg:a.getPresentationStartTime(),autoplay:b,tb:a.h}),0)})},QX=function(a){if(a){a=_.w(SX);for(var b=a.next();!b.done;b=a.next())RX(b.value)}},rY=function(a,b,c){_.Am.call(this);this.f=a;this.h=b;this.j=typeof c===_.Ee?c:this.
|
|
18
|
-
this.a=qY(this);this.g=new _.K(wX);this.f&&this.forwardEventsTo(this.f)},qY=function(a){return new TX(a.h,function(){a.trigger(new _.L(_.vd))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.ph&&(d.preferredAudioLanguage=c.ph);c.
|
|
19
|
-
return _.I(function(c){if(1==c.a)return a.trigger(new _.L(_.ud)),b=a.f.a,b!==a.a&&a.f&&a.a?_.y(c,a.f.release(),2):c["return"]();_.Ot(a.f,a.a);_.C(c)})},tY=function(a){CX.call(this,a,"clpp.cast.StateManager");this.I=this.
|
|
20
|
-
this.f=b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},vY=function(a){this.a=a},xY=function(a){this.m=a;this.a=null;this.h=this.
|
|
17
|
+
pY=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=a.f.Ba())&&d.language&&(a.h.preferredTextLanguage=d.language);(e=a.f.ra())&&e.language&&(a.h.preferredAudioLanguage=e.language);return _.y(f,oY(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),Gg:a.getPresentationStartTime(),autoplay:b,tb:a.h}),0)})},QX=function(a){if(a){a=_.w(SX);for(var b=a.next();!b.done;b=a.next())RX(b.value)}},rY=function(a,b,c){_.Am.call(this);this.f=a;this.h=b;this.j=typeof c===_.Ee?c:this.no;
|
|
18
|
+
this.a=qY(this);this.g=new _.K(wX);this.f&&this.forwardEventsTo(this.f)},qY=function(a){return new TX(a.h,function(){a.trigger(new _.L(_.vd))},function(b,c){var d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.ph&&(d.preferredAudioLanguage=c.ph);c.wj&&(d.preferredTextLanguage=c.wj);_.Ot(a.f,null);a.trigger(new _.L("castingended"));a.j(b,d)},function(){return sY(a)})},sY=function(a){var b;
|
|
19
|
+
return _.I(function(c){if(1==c.a)return a.trigger(new _.L(_.ud)),b=a.f.a,b!==a.a&&a.f&&a.a?_.y(c,a.f.release(),2):c["return"]();_.Ot(a.f,a.a);_.C(c)})},tY=function(a){CX.call(this,a,"clpp.cast.StateManager");this.I=this.nk.bind(this);this.H=this.mk.bind(this);this.w=this.qn.bind(this);this.o=this.fn.bind(this);this.K=this.qk.bind(this);this.J=this.pk.bind(this);this.L=this.Gn.bind(this);this.G=this.tn.bind(this);this.C=this.lk.bind(this);this.a=this.kk.bind(this)},uY=function(a,b,c,d,e){this.a=a;
|
|
20
|
+
this.f=b;this.l=typeof c===_.k?c:1;this.h=typeof d===_.k?d:1;this.j=typeof e===_.k?e:0},vY=function(a){this.a=a},xY=function(a){this.m=a;this.a=null;this.h=this.rk.bind(this);this.f=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,
|
|
21
21
|
cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];wY().addEventListener(this.f,this.h)},AY=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.D(n,2);yY=!1;e=_.pk(d);return _.y(n,c.fetch(e).T,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.T.ea(f.data),h=new DOMParser,l=h.parseFromString(g,_.Bg),l.getElementsByTagName("vmap:VMAP").length)_.Yh("VMAP detected."),a.vmapAdsRequest=zY(g);else if(l.getElementsByTagName("VAST").length){_.Yh("VAST detected.");
|
|
22
22
|
var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=zY(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else _.Yh("Unsupported schema."),yY=!0;return _.Jh(n,0)}m=_.H(n);_.Yh("Failed to fetch an ad",m);yY=!0;_.C(n)})},zY=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},wY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},CY=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||
|
|
23
23
|
-1!==a.getPosition()){var d=null;(c=BY(a,c))&&(d={ad:c});a.m.trigger(new _.L(b,d))}},DY=function(a,b){var c=new _.O(1,10,10003,{errorType:b});a.m.onError(c)},BY=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.ug&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.ug&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=
|
|
24
24
|
g.position}).sort(function(g,h){return g.position-h.position}).findIndex(function(g){return g===e})));c=new uY(d,e,b.index,b.total,f)}return c},EY=function(a){this.ab=a;this.a=this.f.bind(this)},FY=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},GY=function(a){var b=a.dashTimedMetadata,c=_.Sg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Rg)?
|
|
25
|
-
_.Ri:_.Pg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},HY=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.
|
|
25
|
+
_.Ri:_.Pg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},HY=function(){this.g=new _.K("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.$n.bind(this);this.a=this.f=null},IY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},KY=function(a){a.a=IY().getTextTracksManager();var b=a.a.getTracks();a.j=JY(_.Sk,b)},LY=function(a,b,c,d){c=_.Vi(c).filter(function(h){return h});
|
|
26
26
|
var e=!1,f=[];b===_.V?f=a.getAudioTracks():b===_.Sk&&(f=a.ma());if(c=c.find(function(h){var l=_.Pj(h);return f.some(function(m){m=_.Pj(m.language||"");return _.Qj(l,m)})})){var g=_.Pj(c);c=f.filter(function(h){h=_.Pj(h.language||"");return _.Qj(g,h)});f=c.length?c:f;e=e||!!c.length}_.T.qf(d)&&(c=f.filter(function(h){return h.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.V?a.Ka(e):b===_.Sk&&a.$a(e))},JY=function(a,b){for(var c=[],d=_.w(b),
|
|
27
27
|
e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.Qk(e.trackId.toString(),a);f.roles=e.roles||[];f.kind=e.subtype||null;f.language=e.language||null;f.originalLanguage=e.language||null;f.label=e.name||null;f.src=e.trackContentId||null;f.mimeType=e.trackContentType||null;e.customData&&(f.mimeType=e.customData.mimeType||f.mimeType,f.src=e.customData.url||f.src);f.renditions.push(new _.Zk(f.id,f));c.push(f)}return c},MY=function(){_.Am.call(this);this.g=new _.K(xX);this.h=this.w=_.Hm();this.A=null;
|
|
28
28
|
this.l=-1;this.G=new _.Kk;this.f=this.o=this.j=this.a=this.B=null;this.C=!1},NY=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},QY=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0}if(a&&a.drm){var d=a.drm,e=_.mn(d);if(e){var f=[_.Vd];_.Zq(a)[0].type!==_.bd&&f.unshift(_.Xd);d.preferredDrmSystem===_.Vd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),
|
|
29
29
|
h=e.Sa[g];h?(d=g===_.Xd?cast.framework.ContentProtection.WIDEVINE:g===_.Vd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=h.licenseUrl,d={ldlDelay:0,customData:{}},OY(b,h,a,d),PY(b,h,a,d)):c()}else c()}else c()},OY=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=function(e){var f=_.pk({method:_.Jb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);
|
|
30
|
-
e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},PY=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.tk(Object.assign({},f.headers),e.buffer,200,""),_.y(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.bk(g.data))})}:a.licenseHandler=void 0},RY=function(){this.a=!1;this.g=new _.K(yX);this.f=this.m=null;this.h=new Set;this.A=this.
|
|
31
|
-
this.w=this.
|
|
30
|
+
e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},PY=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(h){return 1==h.a?(g=_.tk(Object.assign({},f.headers),e.buffer,200,""),_.y(h,b.modifiers.licenseResponse(c,g,d),2)):h["return"](_.bk(g.data))})}:a.licenseHandler=void 0},RY=function(){this.a=!1;this.g=new _.K(yX);this.f=this.m=null;this.h=new Set;this.A=this.sn.bind(this);
|
|
31
|
+
this.w=this.jk.bind(this);this.j=null;this.o=new _.wi;this.l=null},TY=function(){return SY||(SY=new RY)},UY=function(){return cast.framework.CastReceiverContext.getInstance()},VY=function(){var a=UY().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},WY=function(a,b){var c=UY().getPlayerManager().getMediaInformation();if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;UY().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},
|
|
32
32
|
YY=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=UY();c=(UY().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.$g:_.Zg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var h=e[g].trim();if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=XY(h,_.ua),m=XY(h,_.Rb),n=_.w([]),p=n.next().value;n=n.next().value;m&&(m=_.w(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);
|
|
33
33
|
if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(h);++g}return f.join("\n")},XY=function(a,b){b+="\x3d";var c=a.indexOf(b);if(0<=c){var d=a.substring(c+b.length);d.startsWith('"')?(d=d.substring(1),d=d.substring(0,d.indexOf('"'))):(c=d.indexOf(","),0<=c&&(d=d.substring(0,c)))}return d},ZY=function(a){this.f=a;this.a=null;this.h=new _.wi;this.j=[cast.framework.RemotePlayerEventType.IS_PLAYING_BREAK_CHANGED,cast.framework.RemotePlayerEventType.CURRENT_BREAK_CLIP_NUMBER_CHANGED,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,
|
|
34
34
|
cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]},aZ=function(a,b){var c=null,d=$Y(a);d&&(c={ad:d});a.f.trigger(new _.L(b,c))},$Y=function(a){var b=null;if(a.a&&a.a.mediaInfo){b=a.a.mediaInfo;var c=null,d=null,e=a.a.currentBreakClipNumber;if(b.breaks&&(c=b.breaks.find(function(h){return h.id===a.a.breakId})||null)){var f=c.breakClipIds.length;var g=0>=c.position?c.position:b.breaks.filter(function(h){return 0<=h.position}).sort(function(h,l){return h.position-l.position}).findIndex(function(h){return h===
|
|
@@ -41,9 +41,9 @@ c.renditions.push(new _.Zk(c.id,c));return c}):[],this.a.trigger(new _.L(_.Ig)))
|
|
|
41
41
|
_.u.Nb=function(){return this.f[_.V]||null};_.u.Ob=function(){return this.f[_.Sk]||null};_.u.Na=function(){return NX(this,_.Tk)};_.u.ra=function(){return NX(this,_.V)};_.u.Ba=function(){return NX(this,_.Sk)};_.u.Jb=function(a){PX(this,_.Tk,a)};_.u.Ka=function(a){PX(this,_.V,a)};_.u.$a=function(a){PX(this,_.Sk,a)};_.u.ub=function(a){this.Jb(a&&a.track)};_.u.Hb=function(a){this.Ka(a&&a.track)};_.u.Ib=function(a){this.$a(a&&a.track)};_.u.addTextTrack=function(){return _.I(function(a){_.C(a)})};
|
|
42
42
|
_.u.wa=function(){return!0};KX.prototype.isAbrEnabled=KX.prototype.wa;KX.prototype.addTextTrack=KX.prototype.addTextTrack;KX.prototype.setTextRendition=KX.prototype.Ib;KX.prototype.setAudioRendition=KX.prototype.Hb;KX.prototype.setVideoRendition=KX.prototype.ub;KX.prototype.setTextTrack=KX.prototype.$a;KX.prototype.setAudioTrack=KX.prototype.Ka;KX.prototype.setVideoTrack=KX.prototype.Jb;KX.prototype.getTextTrack=KX.prototype.Ba;KX.prototype.getAudioTrack=KX.prototype.ra;
|
|
43
43
|
KX.prototype.getVideoTrack=KX.prototype.Na;KX.prototype.getLoadingTextRendition=KX.prototype.Ob;KX.prototype.getLoadingAudioRendition=KX.prototype.Nb;KX.prototype.getLoadingVideoRendition=KX.prototype.Bb;KX.prototype.getTextRendition=KX.prototype.Za;KX.prototype.getAudioRendition=KX.prototype.Va;KX.prototype.getVideoRendition=KX.prototype.na;KX.prototype.getTextTracks=KX.prototype.ma;KX.prototype.getAudioTracks=KX.prototype.getAudioTracks;KX.prototype.getVideoTracks=KX.prototype.getVideoTracks;_.x(TX,_.Am);_.u=TX.prototype;_.u.init=function(a,b){this.h=this.J=b};_.u.unload=function(){var a=this;return new Promise(function(b,c){a.f&&a.f.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)})};_.u.release=function(){var a=this;return this.unload().then(function(){a.j&&a.j.release()})};_.u.getTimeline=function(){return null};_.u.setupPlaylist=function(){return Promise.reject(_.Fb)};_.u.appendLoad=function(){return Promise.reject(_.Fb)};_.u.seekWith=function(){return Promise.reject(_.Fb)};
|
|
44
|
-
_.u.setSeekInterceptor=function(){};_.u.setPlaybackSessionId=function(){};_.u.getBandwidthEstimate=function(){return null};_.u.destroy=function(){return _.I(function(a){_.C(a)})};_.u.De=function(a){this.M=a};_.u.Nc=function(){return this.w};_.u.Ub=function(){return this.A};_.u.
|
|
44
|
+
_.u.setSeekInterceptor=function(){};_.u.setPlaybackSessionId=function(){};_.u.getBandwidthEstimate=function(){return null};_.u.destroy=function(){return _.I(function(a){_.C(a)})};_.u.De=function(a){this.M=a};_.u.Nc=function(){return this.w};_.u.Ub=function(){return this.A};_.u.lg=function(){return this.ja};
|
|
45
45
|
_.u.sendMessage=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.O(1,8,8004,void 0);g.F(2);break}_.D(g,3);return _.y(g,e.sendMessage(a,DX(b)),5);case 5:_.Jh(g,2);break;case 3:f=_.H(g),d=new _.O(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.C(g)}})};
|
|
46
|
-
_.u.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Nc())throw a.g.warn(uX),new _.O(1,8,8001,void 0);if(!jY)throw a.g.warn(sX),new _.O(1,8,8002,void 0);if(a.Ub())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.D(d,2);return _.y(d,nY(a),4)}if(2!=d.a)return _.Jh(d,0);b=_.H(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.O(1,8,8E3,c);})};_.u.
|
|
46
|
+
_.u.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Nc())throw a.g.warn(uX),new _.O(1,8,8001,void 0);if(!jY)throw a.g.warn(sX),new _.O(1,8,8002,void 0);if(a.Ub())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.D(d,2);return _.y(d,nY(a),4)}if(2!=d.a)return _.Jh(d,0);b=_.H(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.O(1,8,8E3,c);})};_.u.jg=function(){this.Ub()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};
|
|
47
47
|
_.u.addMessageListener=function(a){typeof a===_.Ee&&this.I.add(a)};_.u.removeMessageListener=function(a){typeof a===_.Ee&&this.I["delete"](a)};_.u.play=function(){var a=this;return this.isEnded()?pY(this,!0):new Promise(function(b,c){if(!a.a)return c(rX);a.a.play(null,b,c)})};_.u.pause=function(){var a=this;return new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(rX);a.a.pause(null,b,c)})};_.u.isPaused=function(){return!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED};
|
|
48
48
|
_.u.isEnded=function(){return this.getState()===_.Oq};_.u.seek=function(a){var b=this;return this.isEnded()?pY(this,!1,a):new Promise(function(c,d){b.a||d(rX);b.l.isPlayingBreak&&d(pX);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.L(_.Ug));b.a.seek(e,function(){b.trigger(new _.L(_.Tg));c()},d)})};_.u.getPosition=function(){return this.getMediaPosition()};_.u.getMediaPosition=function(){return this.a&&this.a.getEstimatedTime()||0};_.u.getDuration=function(){return this.getMediaDuration()};
|
|
49
49
|
_.u.getMediaDuration=function(){if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.k?-1:-1===a?Infinity:a};_.u.setDrmCustomDataModifier=function(){};_.u.setCdnErrorCallback=function(){};_.u.detach=function(){};_.u.getPlaybackRate=function(){return this.a&&this.a.playbackRate||0};_.u.setPlaybackRate=function(a){this.a&&0<a&&this.sendMessage(AX,{type:"SET_PLAYBACK_RATE",requestId:Math.round(1E3*Math.random()),mediaSessionId:this.a.mediaSessionId,playbackRate:a})};
|
|
@@ -53,28 +53,28 @@ _.u.getStats=function(){return this.a&&this.a.customData&&this.a.customData.stat
|
|
|
53
53
|
_.u.getBufferInfo=function(){return new _.zm};_.u.getTrackManager=function(){return this.f};_.u.getConfiguration=function(){return this.h};_.u.getSurface=function(){return null};_.u.setNetworkEngine=function(a){this.L=a};_.u.getNetworkEngine=function(){return this.L};_.u.getSourceIndex=function(){return this.B};_.u.setSourceIndex=function(a){this.B=a};_.u.setCmsdManager=function(){};_.u.getLoadedSource=function(){return this.C[this.B]};_.u.getPeriods=function(){return[]};_.u.getDrmInfo=function(){return null};
|
|
54
54
|
_.u.getTimelineCues=function(){return[]};_.u.getCueTimeline=function(){return null};_.u.resetAbr=function(){this.g.warn(tX)};_.u.onError=function(a){if(a&&(this.trigger(new _.L(_.Ae,{detail:a})),this.j))this.j.onError(a)};_.u.namespace=function(){return _.Hd};_.u.canPlay=function(){return this.Nc()?2:0};_.u.Mb=function(){return this.K};_.u.lc=function(a){this.K=ZX(a)};_.u.$f=function(){this.K=null};
|
|
55
55
|
_.u.Rg=function(a){var b=this.Mb()||{};a={metadataType:dY(b.metadataType),title:a};this.lc(Object.assign({},b,a))};_.u.Pg=function(a){var b=this.Mb()||{},c=dY(b.metadataType);a=new chrome.cast.Image(a);this.lc(Object.assign({},b,{metadataType:c,images:[a]}))};_.u.Og=function(a){var b=this.Mb()||{};this.lc(Object.assign({},b,{metadataType:3,artist:a}))};_.u.Qg=function(a){var b=this.Mb()||{};a={metadataType:dY(b.metadataType),releaseDate:a};this.lc(Object.assign({},b,a))};
|
|
56
|
-
_.u.
|
|
57
|
-
_.u.
|
|
58
|
-
isLive:this.isLive()},currentTime:kY(this),
|
|
59
|
-
_.u.
|
|
60
|
-
window.__onGCastApiAvailable=QX;_.x(rY,_.Am);_.u=rY.prototype;_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,UX(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.C(b)})};_.u.
|
|
56
|
+
_.u.gn=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;jY=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ja=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.o.Xg()};
|
|
57
|
+
_.u.Dn=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;mY(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Ub()||(this.A=!0,mY(this,a.session),this.ga());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Ub()&&this.a){var b=this.a.media,c=this.f.ra(),d=this.f.Ba();c=c&&c.language||void 0;d=d&&d.language||void 0;this.Y(this.getState(),{source:{url:b.contentId,type:b.contentType,
|
|
58
|
+
isLive:this.isLive()},currentTime:kY(this),wj:d,ph:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.da);a.session.removeMessageListener(zX,this.U);this.A=!1;this.a=null;this.H.release();this.l=this.G=null}};_.u.vn=function(a){this.g.debug("New media session",a.mediaSession);lY(this,a.mediaSession)};_.u.un=function(a){a.value&&a.value.tracks&&this.f&&this.f.load()};_.u.ln=function(a,b){if(a===zX&&0<this.I.size){var c=EX(b);this.I.forEach(function(d){return d(c)})}};
|
|
59
|
+
_.u.ik=function(){this.trigger(new _.L(_.Hg))};_.u.Al=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.y(e,FX(a,[_.Ag,_.ad],b.L,b.h),2);if(d=e.f)c=new chrome.cast.media.Track(b.Ea++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.u.getTextDisplayer=function(){return null};var jY=!1,SX=new Set;
|
|
60
|
+
window.__onGCastApiAvailable=QX;_.x(rY,_.Am);_.u=rY.prototype;_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,UX(a.a),3):b.F(2);2!=b.a&&(a.a=null);a.f&&a.stopForwardingEventsTo(a.f);_.C(b)})};_.u.no=function(a,b){this.f&&a!==_.Oq&&a!==_.Hq&&(delete b.license,this.f.load(b))};_.u.Xf=function(){return!!this.a&&this.a.Nc()&&jY};_.u.Ub=function(){return!!this.a&&this.a.Ub()};_.u.lg=function(){return this.a?this.a.lg():""};_.u.De=function(a){this.a&&this.a.De(a)};
|
|
61
61
|
_.u.cast=function(a){var b=this,c,d,e;return _.I(function(f){switch(f.a){case 1:if(!b.a)return f["return"]();_.D(f,2);return _.y(f,b.a.cast(),4);case 4:if(!b.f||!b.a)return f["return"]();var g=null,h=b.f.getLoadedSource();if(h){var l=b.f.getTrackManager();g=l.getVideoTracks()[0];if(g&&g.mimeType)var m=g.mimeType;g=b.f.getConfiguration();var n=l.ra();if(n){if(n.mimeType)var p=n.mimeType;n.language&&(g.preferredAudioLanguage=n.language);n.roles.length&&(g.preferredAudioRole=n.roles[0])}if(l=l.Ba())l.language&&
|
|
62
62
|
(g.preferredTextLanguage=l.language),l.roles.length&&(g.preferredTextRole=l.roles[0]);l=h&&typeof h.isLive===_.nd?h.isLive:b.f.isLive();g={source:h,isLive:l,autoplay:!b.f.isPaused(),currentTime:Math.max(b.f.getPosition()-1,0),Gg:b.f.getPresentationStartTime(),mc:m,audioMimeType:p,tb:g}}c=g;return _.y(f,sY(b),5);case 5:if(!b.a)return f["return"]();c&&(c.autoplay=!b.f.isPaused());if(a)return _.y(f,b.f.load(a),7);if(b.a.a){f.F(7);break}return _.y(f,oY(b.a,c),7);case 7:_.Jh(f,0);break;case 2:d=_.H(f),
|
|
63
|
-
b.g.error("Error while trying to cast",d),e=new _.L(_.Ae,{detail:d}),b.trigger(e),_.C(f)}})};_.u.
|
|
63
|
+
b.g.error("Error while trying to cast",d),e=new _.L(_.Ae,{detail:d}),b.trigger(e),_.C(f)}})};_.u.jg=function(){this.a&&this.a.jg()};_.u.ck=function(a){var b=this;return _.I(function(c){if(1==c.a){if(a===b.h)return c["return"]();b.h=a;return b.a?_.y(c,UX(b.a),2):c.F(2)}b.a=qY(b);_.C(c)})};_.u.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.y(c,b.a.sendMessage(zX,a),0):(b.g.warn(vX),c["return"]())})};_.u.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(vX)};
|
|
64
64
|
_.u.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(vX)};_.u.Mb=function(){return this.a&&this.a.Mb()};_.u.lc=function(a){this.a&&this.a.lc(a)};_.u.$f=function(){this.a&&this.a.$f()};_.u.Rg=function(a){this.a&&this.a.Rg(a)};_.u.Pg=function(a){this.a&&this.a.Pg(a)};_.u.Og=function(a){this.a&&this.a.Og(a)};_.u.Qg=function(a){this.a&&this.a.Qg(a)};_.J(wX,rY);rY.prototype.setContentReleaseDate=rY.prototype.Qg;rY.prototype.setContentArtist=rY.prototype.Og;
|
|
65
|
-
rY.prototype.setContentImage=rY.prototype.Pg;rY.prototype.setContentTitle=rY.prototype.Rg;rY.prototype.clearContentMetadata=rY.prototype.$f;rY.prototype.setContentMetadata=rY.prototype.lc;rY.prototype.getContentMetadata=rY.prototype.Mb;rY.prototype.removeMessageListener=rY.prototype.removeMessageListener;rY.prototype.addMessageListener=rY.prototype.addMessageListener;rY.prototype.sendMessage=rY.prototype.sendMessage;rY.prototype.changeReceiverId=rY.prototype.
|
|
66
|
-
rY.prototype.cast=rY.prototype.cast;rY.prototype.setPlayerConfigInterceptor=rY.prototype.De;rY.prototype.getReceiverName=rY.prototype.
|
|
65
|
+
rY.prototype.setContentImage=rY.prototype.Pg;rY.prototype.setContentTitle=rY.prototype.Rg;rY.prototype.clearContentMetadata=rY.prototype.$f;rY.prototype.setContentMetadata=rY.prototype.lc;rY.prototype.getContentMetadata=rY.prototype.Mb;rY.prototype.removeMessageListener=rY.prototype.removeMessageListener;rY.prototype.addMessageListener=rY.prototype.addMessageListener;rY.prototype.sendMessage=rY.prototype.sendMessage;rY.prototype.changeReceiverId=rY.prototype.ck;rY.prototype.forceDisconnect=rY.prototype.jg;
|
|
66
|
+
rY.prototype.cast=rY.prototype.cast;rY.prototype.setPlayerConfigInterceptor=rY.prototype.De;rY.prototype.getReceiverName=rY.prototype.lg;rY.prototype.isCasting=rY.prototype.Ub;rY.prototype.canCast=rY.prototype.Xf;rY.prototype.destroy=rY.prototype.destroy;_.x(tY,CX);_.u=tY.prototype;
|
|
67
67
|
_.u.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,this.H);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.C);b.addEventListener(a.BITRATE_CHANGED,this.a)};
|
|
68
68
|
_.u.destroy=function(){var a=this,b,c;return _.I(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.I);c.removeEventListener(b.PAUSE,a.H);c.removeEventListener(b.MEDIA_FINISHED,a.w);c.removeEventListener(b.BUFFERING,a.o);c.removeEventListener(b.SEEKING,a.K);c.removeEventListener(b.SEEKED,a.J);c.removeEventListener(b.STALLED,a.L);c.removeEventListener(b.PLAYER_LOADING,a.G);c.removeEventListener(b.ERROR,
|
|
69
|
-
a.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,CX.prototype.destroy.call(a),0)})};_.u.
|
|
70
|
-
_.u.
|
|
69
|
+
a.C);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,CX.prototype.destroy.call(a),0)})};_.u.nk=function(){this.player.trigger(new _.L(_.wf));this.Aa(_.Vq)};_.u.mk=function(){this.Aa(_.Uq)};_.u.qn=function(){this.Aa(_.Oq)};_.u.fn=function(a){a.isBuffering?this.Aa(_.Mq):(a=this.player.isPaused()?_.Uq:_.Vq,this.Aa(a))};_.u.qk=function(){this.h=1;this.player.trigger(new _.L(_.Ug))};_.u.pk=function(){this.player.trigger(new _.L(_.Tg))};_.u.Gn=function(){this.h=2};_.u.tn=function(){this.Aa(_.Tq)};
|
|
70
|
+
_.u.kk=function(a){var b=this.player.getStats();this.player.trigger(new _.L(_.md,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.u.lk=function(a){a=new _.O(_.P,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.L(_.Ae,{detail:a}));this.Aa(_.Sq)};_.u=uY.prototype;_.u.yb=function(){return"Google Cast Framework"};_.u.zb=function(){return cast.framework.VERSION};_.u.Db=function(){return 0};_.u.getId=function(){return""};_.u.getCreativeId=function(){return""};_.u.cc=function(){return""};_.u.getApiFramework=function(){return null};_.u.getAdSystem=function(){return""};_.u.getAdvertiserName=function(){return""};_.u.getTitle=function(){return this.a.title||""};_.u.getDuration=function(){return this.a.duration||0};_.u.getPosition=function(){return 0};
|
|
71
71
|
_.u.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.u.gc=function(){return!1};_.u.Ab=function(){return this.a.clickThroughUrl||null};_.u.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.u.qb=function(){return 0};_.u.pb=function(){return 0};_.u.Xa=function(){return 0};_.u.Ya=function(){switch(this.Pb()){case 0:return 0;case -1:return 2;default:return 1}};_.u.getPodIndex=function(){return this.j};_.u.Pb=function(){return this.f.position};_.u.Cb=function(){return this.l};
|
|
72
72
|
_.u.rb=function(){return this.h};_.u.getWrapperAdIds=function(){return[]};_.u.canSeek=function(){return!1};_.u.getWrapperAdSystems=function(){return[]};_.u.getWrapperCreativeIds=function(){return[]};_.u.fc=function(){return null};uY.prototype.getVideoElement=uY.prototype.fc;uY.prototype.getWrapperCreativeIds=uY.prototype.getWrapperCreativeIds;uY.prototype.getWrapperAdSystems=uY.prototype.getWrapperAdSystems;uY.prototype.canSeek=uY.prototype.canSeek;uY.prototype.getWrapperAdIds=uY.prototype.getWrapperAdIds;
|
|
73
73
|
uY.prototype.getSequenceLength=uY.prototype.rb;uY.prototype.getPositionInSequence=uY.prototype.Cb;uY.prototype.getPodTimeOffset=uY.prototype.Pb;uY.prototype.getPodIndex=uY.prototype.getPodIndex;uY.prototype.getPodType=uY.prototype.Ya;uY.prototype.getMediaBitrate=uY.prototype.Xa;uY.prototype.getMediaHeight=uY.prototype.pb;uY.prototype.getMediaWidth=uY.prototype.qb;uY.prototype.getMediaUrl=uY.prototype.getMediaUrl;uY.prototype.getClickThroughUrl=uY.prototype.Ab;uY.prototype.isBumper=uY.prototype.gc;
|
|
74
74
|
uY.prototype.getSkipTimeOffset=uY.prototype.getSkipTimeOffset;uY.prototype.getPosition=uY.prototype.getPosition;uY.prototype.getDuration=uY.prototype.getDuration;uY.prototype.getTitle=uY.prototype.getTitle;uY.prototype.getAdvertiserName=uY.prototype.getAdvertiserName;uY.prototype.getAdSystem=uY.prototype.getAdSystem;uY.prototype.getApiFramework=uY.prototype.getApiFramework;uY.prototype.getSourceId=uY.prototype.cc;uY.prototype.getCreativeId=uY.prototype.getCreativeId;uY.prototype.getId=uY.prototype.getId;
|
|
75
75
|
uY.prototype.getTechnology=uY.prototype.Db;uY.prototype.getAdManagerVersion=uY.prototype.zb;uY.prototype.getAdManagerName=uY.prototype.yb;vY.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};vY.prototype.Sb=function(){return!!this.a.find(function(a){return 0===a.position})};vY.prototype.Rb=function(){return!!this.a.find(function(a){return-1===a.position})};vY.prototype.hasPostroll=vY.prototype.Rb;vY.prototype.hasPreroll=vY.prototype.Sb;vY.prototype.getCuePoints=vY.prototype.getCuePoints;_.u=xY.prototype;_.u.load=function(){var a=this;return _.I(function(b){yY&&(yY=!1,DY(a,0));_.C(b)})};_.u.start=function(){return _.I(function(a){wY().play();_.C(a)})};_.u.kd=function(){};_.u.resume=function(){-1!==this.getPosition()&&wY().play()};_.u.pause=function(){-1!==this.getPosition()&&wY().pause()};_.u.skip=function(){};_.u.getVolume=function(){return this.m.getVolume()||0};_.u.setVolume=function(a){this.m.setVolume(a)};
|
|
76
76
|
_.u.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.k?a:-1};_.u.gd=function(){return!0};_.u.Ec=function(){var a=this;return _.I(function(b){wY().removeEventListener(a.f,a.h);_.C(b)})};
|
|
77
|
-
_.u.
|
|
77
|
+
_.u.rk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=wY().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.L(_.Rc,{adsTimeline:new vY(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:CY(this,_.Hc,a);break;case cast.framework.events.EventType.BREAK_STARTED:CY(this,_.xc,a);break;case cast.framework.events.EventType.BREAK_ENDED:CY(this,_.yc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:CY(this,
|
|
78
78
|
_.Nc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(CY(this,_.Mc,a),CY(this,_.Oc,a)):a.endedReason===b.STOPPED?CY(this,_.Oc,a):a.endedReason===b.END_OF_STREAM?(CY(this,_.Bc,a),CY(this,_.Oc,a)):a.endedReason===b.ERROR&&DY(this,1);break;case cast.framework.events.EventType.PLAYING:CY(this,_.Lc,a);break;case cast.framework.events.EventType.PAUSE:CY(this,_.Jc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?CY(this,_.zc,a):CY(this,_.Lc,a)}};
|
|
79
79
|
xY.prototype.getPosition=xY.prototype.getPosition;xY.prototype.setVolume=xY.prototype.setVolume;xY.prototype.getVolume=xY.prototype.getVolume;xY.prototype.skip=xY.prototype.skip;xY.prototype.pause=xY.prototype.pause;xY.prototype.resume=xY.prototype.resume;var yY=!1;EY.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(FY(),this.a)};EY.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(FY(),this.a)};EY.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return GY(a)})};
|
|
80
80
|
EY.prototype.f=function(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=_.Dg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Eg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Fg}b&&this.ab(new _.L(b,{detail:GY(a.timedMetadataInfo)}))}else for(a=_.w(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.ab(new _.L(_.Dg,{detail:b.value}))};_.x(HY,_.ul);_.u=HY.prototype;_.u.initialize=function(a){this.m=a;IY().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.u.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.u.load=function(){};_.u.destroy=function(){this.m=null;IY().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.u.getVideoTracks=function(){return[]};_.u.getAudioTracks=function(){return this.h};_.u.ma=function(){return this.j};_.u.na=function(){return null};
|
|
@@ -82,38 +82,38 @@ _.u.Va=function(){var a=this.ra();return a&&a.renditions[0]};_.u.Za=function(){v
|
|
|
82
82
|
_.u.Ba=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.k&&(b=b.toString(),a=this.ma().find(function(c){return c.id===b})||null)}return a};_.u.Jb=function(){this.g.warn("Video tracks unavailable on Cast")};_.u.Ka=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.u.$a=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.u.ub=function(){this.g.warn("Video renditions unavailable on Cast")};_.u.Hb=function(a){this.Ka(a&&a.track)};
|
|
83
83
|
_.u.Ib=function(a){this.$a(a&&a.track)};
|
|
84
84
|
_.u.addTextTrack=function(a){var b=this,c,d,e;return _.I(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.y(f,FX(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c),2);if((d=f.f)&&b.a){e=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);e.isInband=!1;e.language=d.language;e.name=d.label;e.subtype=d.kind;e.trackContentId=d.url;e.trackContentType=d.mimeType;e.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([e]),KY(b)}catch(g){throw b.g.warn("failed on track",
|
|
85
|
-
a),g;}}_.C(f)})};_.u.wa=function(){return!0};_.u
|
|
85
|
+
a),g;}}_.C(f)})};_.u.wa=function(){return!0};_.u.$n=function(){this.f=IY().getAudioTracksManager();var a=this.f.getTracks();this.h=JY(_.V,a);KY(this);a=this.m.getConfiguration();LY(this,_.V,a.preferredAudioLanguage,a.preferredAudioRole);LY(this,_.Sk,a.preferredTextLanguage,a.preferredTextRole)};HY.prototype.isAbrEnabled=HY.prototype.wa;HY.prototype.addTextTrack=HY.prototype.addTextTrack;HY.prototype.setTextRendition=HY.prototype.Ib;HY.prototype.setAudioRendition=HY.prototype.Hb;
|
|
86
86
|
HY.prototype.setVideoRendition=HY.prototype.ub;HY.prototype.setTextTrack=HY.prototype.$a;HY.prototype.setAudioTrack=HY.prototype.Ka;HY.prototype.setVideoTrack=HY.prototype.Jb;HY.prototype.getTextTrack=HY.prototype.Ba;HY.prototype.getAudioTrack=HY.prototype.ra;HY.prototype.getVideoTrack=HY.prototype.Na;HY.prototype.getLoadingTextRendition=HY.prototype.Ob;HY.prototype.getLoadingAudioRendition=HY.prototype.Nb;HY.prototype.getLoadingVideoRendition=HY.prototype.Bb;HY.prototype.getTextRendition=HY.prototype.Za;
|
|
87
|
-
HY.prototype.getAudioRendition=HY.prototype.Va;HY.prototype.getVideoRendition=HY.prototype.na;HY.prototype.getTextTracks=HY.prototype.ma;HY.prototype.getAudioTracks=HY.prototype.getAudioTracks;HY.prototype.getVideoTracks=HY.prototype.getVideoTracks;_.x(MY,_.Am);_.u=MY.prototype;_.u.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=NY();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.
|
|
87
|
+
HY.prototype.getAudioRendition=HY.prototype.Va;HY.prototype.getVideoRendition=HY.prototype.na;HY.prototype.getTextTracks=HY.prototype.ma;HY.prototype.getAudioTracks=HY.prototype.getAudioTracks;HY.prototype.getVideoTracks=HY.prototype.getVideoTracks;_.x(MY,_.Am);_.u=MY.prototype;_.u.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=NY();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.wn.bind(this));d.setMediaPlaybackInfoHandler(this.Rj.bind(this));this.a=new tY(this);this.a.init();this.j=new HY;this.j.initialize(this);this.o=new EY(function(e){return c.trigger(e)});this.o.init()};
|
|
88
88
|
_.u.unload=function(){var a=cast.framework.messages.PlayerState,b=NY();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.u.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.B=null,a.w=_.Hm(),a.h=a.w,a.l=-1,a.A=null,a.a?_.y(b,a.a.destroy(),3):b.F(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.C(b)})};
|
|
89
89
|
_.u.play=function(){var a=NY();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot play during ads playout.");a.play();return Promise.resolve()};_.u.pause=function(){var a=NY();if(null!==a.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject("Cannot pause during ads playout.");a.pause();return Promise.resolve()};_.u.isPaused=function(){return NY().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};
|
|
90
90
|
_.u.isEnded=function(){return NY().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.u.seek=function(a){var b=NY();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(pX);b.seek(a);return Promise.resolve()};_.u.getPosition=function(){return this.getMediaPosition()};_.u.setSeekInterceptor=function(){};_.u.setPlaybackSessionId=function(){};_.u.getBandwidthEstimate=function(){return null};_.u.getMediaPosition=function(){return NY().getCurrentTimeSec()};
|
|
91
91
|
_.u.getDuration=function(){return this.getMediaDuration()};_.u.getMediaDuration=function(){var a=NY().getDurationSec();return typeof a===_.k?-1===a?Infinity:a:-1};_.u.getPlaybackRate=function(){return NY().getPlaybackRate()};_.u.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;NY().sendLocalMediaRequest(b)}};_.u.getVolume=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().level||null};
|
|
92
92
|
_.u.setVolume=function(a){0<=a&&1>=a&&cast.framework.CastReceiverContext.getInstance().setSystemVolumeLevel(a)};_.u.setMuted=function(a){cast.framework.CastReceiverContext.getInstance().setSystemVolumeMuted(a)};_.u.isMuted=function(){return cast.framework.CastReceiverContext.getInstance().getSystemVolume().muted||null};
|
|
93
|
-
_.u.getLoadedSource=function(){var a=NY().getMediaInformation();if(a){var b=NY().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,
|
|
93
|
+
_.u.getLoadedSource=function(){var a=NY().getMediaInformation();if(a){var b=NY().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,pp:b,name:c}}return null};_.u.getDrmInfo=function(){return null};_.u.getPresentationStartTime=function(){return NY().getStartAbsoluteTime()};
|
|
94
94
|
_.u.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=NY().getLiveSeekableRange();b&&typeof b.start===_.k&&typeof b.end===_.k&&(a={start:b.start,end:b.end})}return a};_.u.getState=function(){return this.a?this.a.getState():_.Iq};
|
|
95
95
|
_.u.getStats=function(){var a=_.Gq();if(this.f){a=NY().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.k?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.k?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a};_.u.isLive=function(){return Infinity===this.getDuration()};
|
|
96
96
|
_.u.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.Fq;b.a.j=b.f.a;b.A=_.Zq(a);b.h=_.Jm(b.w,a);if(b.C)return b.C=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.k&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:DX(b.h),local:!0};return _.y(e,NY().load(d),0)})};_.u.getBufferInfo=function(){this.g.warn(_.wa);return new _.zm};
|
|
97
97
|
_.u.getTrackManager=function(){return this.j};_.u.getConfiguration=function(){return this.h};_.u.getSurface=function(){return this.B};_.u.getTimeline=function(){return null};_.u.setupPlaylist=function(){return Promise.reject(_.Fb)};_.u.appendLoad=function(){return Promise.reject(_.Fb)};_.u.seekWith=function(){return Promise.reject(_.Fb)};_.u.setNetworkEngine=function(a){this.G=a};_.u.setCmsdManager=function(){};_.u.getNetworkEngine=function(){return this.G};_.u.getSourceIndex=function(){return this.l};
|
|
98
98
|
_.u.setSourceIndex=function(a){this.l=a};_.u.getPeriods=function(){return[]};_.u.namespace=function(){return xX};_.u.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.u.getCueTimeline=function(){return null};_.u.resetAbr=function(){this.g.warn(tX)};_.u.onError=function(a){this.trigger(new _.L(_.Ae,{detail:a}))};_.u.canPlay=function(){return _.Kl()?2:0};
|
|
99
|
-
_.u.
|
|
99
|
+
_.u.wn=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=DX(this.getStats());var b=NY(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.k&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime.Old value: "+(c.startAbsoluteTime+", new value: ")+b),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));c=cast.framework.messages.StreamType;b=a.media;var d=!!b,e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&
|
|
100
100
|
(!e||e&&f)){d=NY().getStartAbsoluteTime();if(typeof d===_.k){b.startAbsoluteTime=d;var h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}return a};
|
|
101
|
-
_.u.
|
|
101
|
+
_.u.Rj=function(a,b){var c=null,d=b;a.media.customData&&(c=EX(a.media.customData.playerConfiguration));var e=c?c.abr||null:null,f=d;e&&typeof e.defaultBandwidthEstimate===_.k?f.initialBandwidth=e.defaultBandwidthEstimate:f.initialBandwidth=void 0;QY(c,d);e=null;a.media.customData&&(e=EX(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]));e=(e=e&&e.LiveConfiguration)?0===e.liveEdgeLatencyMs:!1;if(null!=c&&c.lowLatencyMode||e)c=Object.assign({},d.shakaConfig,{streaming:{lowLatencyMode:!0}}),
|
|
102
102
|
d=Object.assign({},d,{shakaConfig:c});return d};_.u.getTextDisplayer=function(){return null};_.u.setDrmCustomDataModifier=function(){};_.u.setCdnErrorCallback=function(){};_.u.detach=function(){};_.u=RY.prototype;_.u.init=function(a){var b=this;a&&(this.f=new MY,_.Ot(a,this.f),this.m=a,this.o.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.Hq?_.y(c,BX(b.m),0):c.F(0)})}))};
|
|
103
|
-
_.u.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=UY(),b=UY().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[zX]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.
|
|
104
|
-
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.
|
|
105
|
-
_.u.stop=function(){if(this.a){this.a=!1;this.o.release();var a=UY();UY().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(zX,this.w);a.stop();this.m=this.f=null}};_.u.De=function(a){this.j=a};_.u.
|
|
106
|
-
_.u.removeMessageListener=function(a){typeof a===_.Ee&&this.h["delete"](a)};_.u.sendMessage=function(a,b){UY().sendCustomMessage(zX,b,DX(a))};_.u.Nc=function(){return this.a};_.u.Mb=function(){return VY()};_.u.lc=function(a){WY(this,a)};_.u.
|
|
107
|
-
_.u.
|
|
103
|
+
_.u.start=function(){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var a=UY(),b=UY().getPlayerManager(),c=new cast.framework.CastReceiverOptions;c.customNamespaces={};c.customNamespaces[zX]=cast.framework.system.MessageType.JSON;var d=new cast.framework.PlaybackConfig;d.manifestHandler=this.Mm.bind(this);d.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};d.enableSmoothLiveRefresh=!0;c.playbackConfig=d;if(d=this.m&&this.m.getSurface().getMedia())c.mediaElement=
|
|
104
|
+
d;c.disableIdleTimeout=!0;c.maxInactivity=Infinity;b.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.Lm.bind(this));b.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.start(c);a.addCustomMessageListener(zX,this.w)}};
|
|
105
|
+
_.u.stop=function(){if(this.a){this.a=!1;this.o.release();var a=UY();UY().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.A);a.removeCustomMessageListener(zX,this.w);a.stop();this.m=this.f=null}};_.u.De=function(a){this.j=a};_.u.vo=function(a){this.l=a};_.u.on=function(a,b){UY().addEventListener(a,b)};_.u.off=function(a,b){UY().removeEventListener(a,b)};_.u.addMessageListener=function(a){typeof a===_.Ee&&this.h.add(a)};
|
|
106
|
+
_.u.removeMessageListener=function(a){typeof a===_.Ee&&this.h["delete"](a)};_.u.sendMessage=function(a,b){UY().sendCustomMessage(zX,b,DX(a))};_.u.Nc=function(){return this.a};_.u.Mb=function(){return VY()};_.u.lc=function(a){WY(this,a)};_.u.No=function(a){var b=VY(),c=null;a?c=Object.assign({},b,a):c=b;WY(this,c)};
|
|
107
|
+
_.u.Mm=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return YY(this,a);try{var b=(new DOMParser).parseFromString(a,_.Bg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=UY();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){for(var e=c[d].getElementsByTagName(_.ka),f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");if(g===_.r||g===_.dd){g=e[f].getAttribute(_.af);for(var h=e[f].getElementsByTagName(_.Sb),l=h.length-
|
|
108
108
|
1;0<=l;--l){var m=h[l].getAttribute(_.af)||g,n=h[l].getAttribute(_.Od),p=h[l].getAttribute(_.mh)||void 0,q=h[l].getAttribute(_.Fe)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(h[l])}e[f].getElementsByTagName(_.Sb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ka).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.$b)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=UY();c=a.getElementsByTagName("StreamIndex");
|
|
109
109
|
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.r){e=c[d].getElementsByTagName(_.Qb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.vb)||void 0,h=e[f].getAttribute(_.ub)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.$g,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.Qb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
110
|
-
_.u.
|
|
110
|
+
_.u.Lm=function(a){var b=this,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=EX(c.media.customData.playerConfiguration));if(!b.m||!d){l.F(2);break}if(!b.j){l.F(3);break}return _.y(l,Promise.resolve(b.j(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.F(5);break}return _.y(l,AY(c.media,d.ima,b.m.getNetworkEngine()),5);case 5:typeof d.startTime===_.k&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.F(7);
|
|
111
111
|
break}b.f.C=!0;return _.y(l,_.Yt(b.m,d),8);case 8:return _.y(l,_.Zt(b.m),9);case 9:f=b.m.getLoadedSource(),c.media.contentId=f.url,c.media.contentType=f.type,f.mc&&(c.media.hlsVideoSegmentFormat=GX(f.mc,_.Tk)),f.audioMimeType&&(c.media.hlsSegmentFormat=GX(f.audioMimeType,_.V));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.k){var m=g.sectionStartAbsoluteTime;g.sectionStartAbsoluteTime=0===m?1E-8:m}void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay);case 2:if(!b.l){l.F(10);
|
|
112
|
-
break}return _.y(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.u.
|
|
113
|
-
_.u.
|
|
114
|
-
RY.prototype.on=RY.prototype.on;RY.prototype.setLoadRequestDataInterceptor=RY.prototype.
|
|
112
|
+
break}return _.y(l,Promise.resolve(b.l(c)),11);case 11:(h=l.f)&&(c=h);case 10:return l["return"](c)}})};_.u.sn=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.zm;var b=UY().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.m.getConfiguration().startTime;typeof d!==_.k||typeof c!==_.k||typeof e!==_.k||a(e,d,c)||(b=b.getMediaTimeForAbsoluteTime(e),typeof b===_.k&&a(b,d,c)&&this.m.seek(b))}_.Tt(this.m)}};
|
|
113
|
+
_.u.jk=function(a){if(0<this.h.size){var b=EX(a.data);this.h.forEach(function(c){return c(b)})}};_.J(yX,RY);RY.prototype.updateContentMetadata=RY.prototype.No;RY.prototype.setContentMetadata=RY.prototype.lc;RY.prototype.getContentMetadata=RY.prototype.Mb;RY.prototype.isApiReady=RY.prototype.Nc;RY.prototype.sendMessage=RY.prototype.sendMessage;RY.prototype.removeMessageListener=RY.prototype.removeMessageListener;RY.prototype.addMessageListener=RY.prototype.addMessageListener;RY.prototype.off=RY.prototype.off;
|
|
114
|
+
RY.prototype.on=RY.prototype.on;RY.prototype.setLoadRequestDataInterceptor=RY.prototype.vo;RY.prototype.setPlayerConfigInterceptor=RY.prototype.De;RY.prototype.stop=RY.prototype.stop;RY.prototype.start=RY.prototype.start;RY.prototype.init=RY.prototype.init;RY.getInstance=TY;var SY=null;_.u=ZY.prototype;_.u.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){a.a=a.f.l;if(a.a)for(b=a.a.controller,c=a.In.bind(a),d=_.w(a.j),e=d.next();!e.done;e=d.next())f=e.value,a.h.on(b,f,c);_.C(g)})};_.u.start=function(){return _.I(function(a){_.C(a)})};_.u.kd=function(){};_.u.resume=function(){this.a&&this.a.isPlayingBreak&&this.a.isPaused&&this.a.controller.playOrPause()};_.u.pause=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};
|
|
115
115
|
_.u.skip=function(){var a=this.f.a;a&&this.f.sendMessage(AX,{type:"SKIP_AD",requestId:Math.round(1E3*Math.random()),mediaSessionId:a.mediaSessionId})};_.u.getVolume=function(){return this.f.getVolume()||0};_.u.setVolume=function(a){this.f.setVolume(a)};_.u.getPosition=function(){var a=-1,b=this.f.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.k&&(a=b));return a};_.u.gd=function(){return!0};_.u.Ec=function(){var a=this;return _.I(function(b){a.h.release();_.C(b)})};
|
|
116
|
-
_.u.
|
|
116
|
+
_.u.In=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.f.trigger(new _.L(_.Rc,{adsTimeline:new vY(a.breaks)})));break;case "isPlayingBreak":a.value?aZ(this,_.xc):(aZ(this,_.Bc),aZ(this,_.Oc),aZ(this,_.yc));break;case "currentBreakClipNumber":0<=a.value&&(0<a.value&&(aZ(this,_.Bc),aZ(this,_.Oc)),aZ(this,_.Nc));break;case "isPaused":this.a.isPlayingBreak&&(a.value?aZ(this,_.Jc):aZ(this,_.Lc))}};ZY.prototype.getPosition=ZY.prototype.getPosition;
|
|
117
117
|
ZY.prototype.setVolume=ZY.prototype.setVolume;ZY.prototype.getVolume=ZY.prototype.getVolume;ZY.prototype.skip=ZY.prototype.skip;ZY.prototype.pause=ZY.prototype.pause;ZY.prototype.resume=ZY.prototype.resume;bZ.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};bZ.prototype.a=function(a,b){return a.namespace()!==_.Hd?!1:!(!b||!b.ima)};bZ.prototype.create=function(a){return new ZY(a.a)};_.nr(new bZ);cZ.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};cZ.prototype.a=function(a,b){return TY().Nc()?!(!b||!b.ima):!1};cZ.prototype.create=function(a){return new xY(a)};_.nr(new cZ);};
|
|
118
118
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
119
119
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
package/cjs/cl.conviva.js
CHANGED
|
@@ -6,30 +6,30 @@ b;e[Conviva.Constants.IS_LIVE]=TW(!!d);e[Conviva.Constants.ASSET_NAME]=PW;a&&(e[
|
|
|
6
6
|
Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=VW(a.yb()),e["c3.ad.adManagerVersion"]=VW(a.zb()),e["c3.ad.advertiserCategory"]=VW(null),e["c3.ad.advertiserId"]=VW(null),e["c3.ad.breakId"]=VW(null),e["c3.ad.campaignName"]=VW(null),e["c3.ad.category"]=VW(null),e["c3.ad.classification"]=VW(null),e["c3.ad.creativeName"]=VW(null),e["c3.ad.sequence"]=VW(a.Cb()),e["c3.ad.sessionStartEvent"]=VW(null),e["c3.ad.unitName"]=VW(null),e["c3.ad.dayPart"]=VW(null),
|
|
7
7
|
b=a.getWrapperAdIds().slice(-1)[0]||a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=VW(b),e["c3.ad.firstAdSystem"]=VW(c),e["c3.ad.firstCreativeId"]=VW(a));return e},VW=function(a){return a?""+a:"NA"},XW=function(a,b){this.m=a;this.B=b;this.A="";this.w=_.xa;this.g=new _.K("clpp.conviva.ad");this.f=new _.wi;this.a=null;this.j=this.l=this.o=this.h=!1},YW=function(a,b){if(!a.l){a.j=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.B()),
|
|
8
8
|
b){var c=WW(b,a.A,a.w,a.m.isLive()),d=String(b.zb()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.yb();e[Conviva.Constants.FRAMEWORK_VERSION]=d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(f){a.g.error("Could not create ad analytics session",f)}}},aX=function(a,b,c){c=void 0===c?PW:c;if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case ZW:a.a.reportAdFailed(c,WW(null,a.A,a.w));break;case $W:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();
|
|
9
|
-
a.a=null;a.h=!1}},bX=function(a){a.f.on(a.m,_.xc,a.
|
|
9
|
+
a.a=null;a.h=!1}},bX=function(a){a.f.on(a.m,_.xc,a.sk.bind(a));a.f.on(a.m,_.yc,a.tk.bind(a));a.f.on(a.m,_.Nc,a.zk.bind(a));a.f.on(a.m,_.Kc,a.tf.bind(a));a.f.on(a.m,_.Jc,a.tf.bind(a));a.f.on(a.m,_.Lc,a.tf.bind(a));a.f.on(a.m,_.zc,a.tf.bind(a));a.f.on(a.m,_.Oc,a.Ak.bind(a));a.f.on(a.m,_.Mc,a.yk.bind(a));a.f.on(a.m,_.Ac,a.uk.bind(a));a.f.on(a.m,_.Gc,a.wk.bind(a));a.f.on(a.m,_.Hc,a.xk.bind(a));a.f.on(a.m,_.Cc,a.vk.bind(a));a.f.on(a.m,_.Ic,a.Ym.bind(a));a.f.on(a.m,_.Pc,a.Bk.bind(a));a.f.on(a.m,_.Ae,function(b){var c=
|
|
10
10
|
b.detail;if(10003===c.code&&(a.g.debug("onAdError()"),!a.j)){b=Conviva.Constants.ErrorSeverity;switch(c.data.errorType){case 0:c="Ad Load Error";break;case 1:c="Ad Play Error";break;default:c=PW}null===a.a&&YW(a,null);a.a.reportAdError(c,b.FATAL);a.j=!0;a.g.debug("Ad Playback Failure");aX(a,ZW,c)}})},cX=function(a,b){this.m=a;this.f=new _.wi;this.a=null;this.o=!1;this.H=!0;this.B=this.h=this.A=this.C=this.l=!1;this.M=0;this.K=!1;this.w=null;this.J=!1;this.g=b;this.L=this.G=null;this.j=[];this.I=0},
|
|
11
11
|
dX=function(a){if(!a.l&&a.a){var b=TW(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},eX=function(a){return null!==a.a&&a.C},fX=function(a){return a.m.getConfiguration().autoplay||!1},gX=function(a,b){var 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,
|
|
12
12
|
null,c);Conviva.Analytics.setDeviceMetadata(SW(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;c={};c[Conviva.Constants.FRAMEWORK_NAME]=_.xa;c[Conviva.Constants.FRAMEWORK_VERSION]=_.ia;a.a.setPlayerInfo(c)},hX=function(a){if(!a.l)if(a.C)a.g.warn("Current session still active. No-op.");else{var b=a.m.getLoadedSource()||a.L,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||
|
|
13
13
|
"N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.$k(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.al(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.xa;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.N.R(c.customTags))for(var h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(function(){a.g.debug("reportMiscellaneousMetrics()");if(eX(a)){var l=
|
|
14
14
|
1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=a.m.getStats()){l=l.decodedFrames;var m=l-a.I;a.I=l;isFinite(m)&&(a.g.debug("Current FPS",m),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,m))}}});a.C=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.ei(l.args)}));a.j=[]}},iX=function(a){a.g.debug("terminateSession()");a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,
|
|
15
15
|
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.M=0,a.K=!1,a.j=[],a.I=0)},jX=function(){this.h=this.f=null;this.a=!1;this.g=new _.K("clpp.conviva")},kX=function(a){var b=[];typeof a===_.gf&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.O(1,9,9001,{missingKeys:b});},mX=function(a,b){var c=b.getConfiguration();a.a=!_.N.R(c.conviva)&&typeof c.conviva===
|
|
16
|
-
_.gf;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.O(1,9,9E3),lX(b,c)):b.namespace()===_.Hd&&(a.a=!1,a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},lX=function(a,b){a.trigger(new _.L(_.Ae,{detail:b}))},nX=function(){};_.u=XW.prototype;_.u.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.xa;bX(this)};_.u.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.na):(_.zi(this.f),this.a&&aX(this,oX),this.f.release(),this.o=!0,this.h=this.j=!1)};_.u.destroy=function(){this.g.debug(_.de);this.l?this.g.debug(_.ma):this.l=!0};_.u.
|
|
17
|
-
_.u.
|
|
18
|
-
_.u.tf=function(a){var b=this;this.g.debug("onAdStateChanged()");if(this.a){var c=function(d){b.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,d)};switch(a.type){case _.Kc:case _.Lc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.Jc:c(Conviva.Constants.PlayerState.PAUSED);break;case _.zc:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.u.
|
|
19
|
-
_.u.
|
|
20
|
-
_.u.
|
|
21
|
-
_.u.
|
|
22
|
-
_.u.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.N.nb(b),this.L=c,this.m=a,gX(this,this.G),this.f.on(this.m,_.wf,this.
|
|
16
|
+
_.gf;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.O(1,9,9E3),lX(b,c)):b.namespace()===_.Hd&&(a.a=!1,a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},lX=function(a,b){a.trigger(new _.L(_.Ae,{detail:b}))},nX=function(){};_.u=XW.prototype;_.u.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.xa;bX(this)};_.u.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.na):(_.zi(this.f),this.a&&aX(this,oX),this.f.release(),this.o=!0,this.h=this.j=!1)};_.u.destroy=function(){this.g.debug(_.de);this.l?this.g.debug(_.ma):this.l=!0};_.u.sk=function(){this.g.debug(QW)};_.u.tk=function(){this.g.debug(RW)};
|
|
17
|
+
_.u.zk=function(a){this.g.debug("onAdStarted()");a=a.ad;this.h||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),YW(this,a));this.h=!1;this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.PLAYING);this.a.reportAdMetric(Conviva.Constants.Playback.RESOLUTION,a.qb(),a.pb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.Xa())};
|
|
18
|
+
_.u.tf=function(a){var b=this;this.g.debug("onAdStateChanged()");if(this.a){var c=function(d){b.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,d)};switch(a.type){case _.Kc:case _.Lc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.Jc:c(Conviva.Constants.PlayerState.PAUSED);break;case _.zc:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.u.Ak=function(){this.g.debug("onAdStopped()");this.a&&!this.j&&aX(this,oX)};_.u.yk=function(){this.g.debug("onAdSkipped()");this.a&&aX(this,$W)};
|
|
19
|
+
_.u.uk=function(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.u.wk=function(){this.g.debug("onAdImpression()");if(this.a){var a=Conviva.Constants.Events;this.a.reportAdPlayerEvent(a.AD_IMPRESSION_START);this.a.reportAdPlayerEvent(a.AD_IMPRESSION_END)}};
|
|
20
|
+
_.u.xk=function(a){var b=this;this.g.debug("onAdLoaded()");var c=a.ad;if(-1!==c.getPodIndex()||this.m.getPosition()>=this.m.getDuration()-5)b.h=!0,YW(b,c);else this.f.on(this.m,_.Hg,function(){b.m.getPosition()>=b.m.getDuration()-5&&(b.f.off(b.m,_.Hg),b.h=!0,YW(b,c))})};_.u.vk=function(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.u.Ym=function(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
|
|
21
|
+
_.u.Bk=function(){this.g.debug("onAdThirdQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)};var $W=0,oX=1,ZW=2;_.u=cX.prototype;
|
|
22
|
+
_.u.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.N.nb(b),this.L=c,this.m=a,gX(this,this.G),this.f.on(this.m,_.wf,this.An.bind(this)),this.f.on(this.m,_.rg,this.Gk.bind(this)),this.f.on(this.m,_.md,this.zh.bind(this)),this.f.on(this.m,_.Ug,this.Fk.bind(this)),this.f.on(this.m,_.Tg,this.Ek.bind(this)),this.f.on(this.m,_.xc,this.Ck.bind(this)),this.f.on(this.m,_.yc,this.Dk.bind(this)),this.f.on(this.m,_.Rc,this.cn.bind(this)),this.f.on(this.m,_.ld,this.dn.bind(this)),
|
|
23
23
|
this.f.on(this.m,_.Ae,this.Ah.bind(this)),fX(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),hX(this)))};_.u.release=function(){this.g.debug("Release conviva");this.H?this.g.debug(_.na):(_.zi(this.f),eX(this)||this.o||!fX(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),eX(this)&&iX(this),this.a=null,this.H=!0)};_.u.destroy=function(){this.g.debug(_.de);this.l?this.g.debug(_.ma):this.l=!0};
|
|
24
|
-
_.u.reportAppEvent=function(a,b){var c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c};_.u.
|
|
25
|
-
_.u.
|
|
24
|
+
_.u.reportAppEvent=function(a,b){var c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c};_.u.An=function(){this.g.debug("onPlayRequest()");eX(this)||fX(this)?eX(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),eX(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"),hX(this))};
|
|
25
|
+
_.u.Gk=function(a){function b(d){if(c.o&&(c.g.debug("Creating conviva session (On Seek / Replay)"),gX(c,c.G),hX(c),dX(c),eX(c))){var e=c.m.getTrackManager();e=e.na()||e.Bb();e.width&&e.height&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,e.width,e.height);e.bandwidth&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,e.bandwidth/1E3)}eX(c)&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,d)}var c=this;this.g.debug(_.nf);switch(a.detail.currentState){case _.Vq:b(Conviva.Constants.PlayerState.PLAYING);
|
|
26
26
|
break;case _.Uq:b(Conviva.Constants.PlayerState.PAUSED);break;case _.Mq:b(Conviva.Constants.PlayerState.BUFFERING);break;case _.Oq:this.g.debug("onVideoEnded()"),eX(this)&&(this.w&&this.w.Rb()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.K=!0):iX(this))}};
|
|
27
27
|
_.u.zh=function(a){this.g.debug(_.hf);if(eX(this)){if(a=a.detail,typeof a.width===_.k&&typeof a.height===_.k&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){var b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({ei:this.zh.bind(this),args:a})};
|
|
28
|
-
_.u.
|
|
29
|
-
_.u.
|
|
30
|
-
b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")};_.u.
|
|
28
|
+
_.u.Fk=function(){this.g.debug("onSeeking()");eX(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)};_.u.Ek=function(){this.g.debug("onSeeked()");eX(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)};_.u.cn=function(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a};
|
|
29
|
+
_.u.Ck=function(a){this.g.debug(QW);var b=a.ad;a=0===b.Ya();var c=UW(b.getPodIndex());eX(this)||fX(this)||!a||hX(this);if(eX(this)){a=0===b.Db()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;var d=0,e={};1===b.rb()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.M;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.Kl()?b.CONTENT:b.SEPARATE;this.a.reportAdBreakStarted(a,
|
|
30
|
+
b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")};_.u.Dk=function(){this.g.debug(RW);eX(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.K&&iX(this))};
|
|
31
31
|
_.u.Ah=function(a){this.g.debug(_.kf);if(this.o&&this.J)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===_.P&&(d=Conviva.Constants.ErrorSeverity.FATAL,eX(this)||hX(this));eX(this)?(this.g.debug("Report error",c,d),this.a.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.g.debug("Video Playback Failure"),this.J=!0,iX(this))):this.j.push({ei:this.Ah.bind(this),
|
|
32
|
-
args:a})}};_.u.
|
|
32
|
+
args:a})}};_.u.dn=function(){this.g.debug("onAutoPlayBlocked()");eX(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,eX(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))};_.u=jX.prototype;_.u.onPlayerCreated=function(a){this.f=new cX(a,this.g)};_.u.onContentWillLoad=function(a,b){var c=this;mX(this,a);if(this.a){var d=a.getConfiguration();d=_.N.nb(d.conviva||{});try{kX(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.h=new XW(a,function(){return c.f.a}),this.h.initialize(d))}catch(f){f instanceof _.O?lX(a,f):lX(a,new _.O(1,9,9002,f,f))}}};_.u.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&dX(this.f)};
|
|
33
33
|
_.u.onPlayerWillDestroy=function(){this.a&&(this.a=!1,this.f.destroy(),this.f=null,this.h&&(this.h.destroy(),this.h=null))};_.u.onPlayerWillRelease=function(){this.a&&(this.f.release(),this.h&&this.h.release())};_.u.id=function(){return"conviva"};_.u.reportAppEvent=function(a,b){return this.f?this.f.reportAppEvent(a,b):!1};_.J("clpp.conviva.ConvivaPlugin",jX);jX.prototype.reportAppEvent=jX.prototype.reportAppEvent;jX.Id="conviva";nX.prototype.create=function(){return new jX};_.cu(new nX);};
|
|
34
34
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
35
35
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|