@castlabs/prestoplay 6.32.0-beta.3 → 6.32.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +56 -56
- package/cjs/cl.cdn.js +5 -5
- package/cjs/cl.conviva.js +18 -18
- package/cjs/cl.core.js +191 -191
- package/cjs/cl.dash.js +51 -51
- package/cjs/cl.freewheel.js +9 -9
- package/cjs/cl.hls.js +54 -54
- package/cjs/cl.hlssmpte.js +1 -1
- package/cjs/cl.htmlcue.js +3 -3
- package/cjs/cl.ima.js +11 -11
- package/cjs/cl.mediatailor.js +2 -2
- package/cjs/cl.mse.js +122 -122
- package/cjs/cl.muxdata.js +8 -8
- package/cjs/cl.persistent.js +2 -2
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.simid.js +3 -3
- package/cjs/cl.smooth.js +28 -28
- package/cjs/cl.thumbnails.js +3 -3
- package/cjs/cl.tizen.js +34 -34
- package/cjs/cl.ttml.js +3 -3
- package/cjs/cl.verimatrix.js +1 -1
- package/cjs/cl.vimond.js +8 -8
- package/cjs/cl.vr.js +7 -7
- package/cjs/cl.vtt.js +1 -1
- package/cjs/cl.yospace.js +2 -2
- package/cjs/cl.youbora.js +11 -11
- package/cl.airplay.js +1 -1
- package/cl.cast.js +29 -29
- package/cl.cdn.js +5 -5
- package/cl.conviva.js +3 -3
- package/cl.core.js +116 -116
- package/cl.dash.js +48 -48
- package/cl.freewheel.js +3 -3
- package/cl.hls.js +35 -35
- package/cl.htmlcue.js +1 -1
- package/cl.ima.js +1 -1
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +74 -74
- package/cl.muxdata.js +2 -2
- package/cl.persistent.js +1 -1
- package/cl.playlist.js +4 -4
- package/cl.simid.js +1 -1
- package/cl.smooth.js +22 -22
- package/cl.thumbnails.js +4 -4
- package/cl.tizen.js +15 -15
- package/cl.ttml.js +2 -2
- package/cl.verimatrix.js +1 -1
- package/cl.vimond.js +2 -2
- package/cl.vr.js +2 -2
- package/cl.vtt.js +2 -2
- package/cl.yospace.js +2 -2
- package/cl.youbora.js +8 -8
- package/package.json +1 -1
package/cjs/cl.airplay.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var eY=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.jj(function(){a.m.play()["catch"](function(){})});this.h=new _.Bi},fY=function(){};_.w(eY,_.gw);_.r=eY.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.r.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.
|
|
3
|
-
_.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.
|
|
4
|
-
_.r.zd=function(){return this.f};_.r.
|
|
2
|
+
var f=function(window){var eY=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.jj(function(){a.m.play()["catch"](function(){})});this.h=new _.Bi},fY=function(){};_.w(eY,_.gw);_.r=eY.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.r.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.Jn.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.ro.bind(this)))};
|
|
3
|
+
_.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.Jn=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.Q(_.Ic,{canCast:this.f}))};_.r.ro=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Hc:_.Gc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play()["catch"](function(){}):this.o.ia(.01);this.m.trigger(new _.Q(a))};_.r.Ea=function(){return this.j};
|
|
4
|
+
_.r.zd=function(){return this.f};_.r.ep=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.K("clpp.airplay.AirPlayPlugin",eY);eY.prototype.showCastMenu=eY.prototype.ep;eY.prototype.canCast=eY.prototype.zd;eY.prototype.isCasting=eY.prototype.Ea;eY.Id="airplay";fY.prototype.create=function(){return new eY};_.fp(new fY);};
|
|
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,22 +1,22 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var SX=function(a,b,c){this.a=a||{};this.f=b||{};this.w=c||0;this.o=0;this.l=this.j=this.h=!1},TX=function(a,b){this.m=a;this.f=b;this.a=new _.Bi;this.h=!1},UX=function(a){this.m=a;this.l=new _.Bi;this.h=this.j=this.f=this.a=null;this.o=this.
|
|
2
|
+
var f=function(window){var SX=function(a,b,c){this.a=a||{};this.f=b||{};this.w=c||0;this.o=0;this.l=this.j=this.h=!1},TX=function(a,b){this.m=a;this.f=b;this.a=new _.Bi;this.h=!1},UX=function(a){this.m=a;this.l=new _.Bi;this.h=this.j=this.f=this.a=null;this.o=this.En.bind(this)},VX=function(a){var b=a.m.getSurface().getMedia();b&&(a.h=a.qo.bind(a),b.addEventListener("click",a.h))},WX=function(a){a.l.off(a.m,_.Bg,a.o)},XX=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.f=_.Qj();d.a=0;return d}_.w(b,
|
|
3
3
|
GenericPlayerApi);b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return _.ia};b.prototype.getOSName=function(){return this.f.os};b.prototype.getDeviceVersion=function(){return this.f.osVersion.name};b.prototype.getDeviceType=function(){return"browser"};b.prototype.getTotalDuration=function(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){var c=1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,
|
|
4
4
|
this.a):c};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};b.prototype.getCapabilities=function(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}};return new b(a)},YX=function(){this.o=this.f=this.a=this.h=this.m=null;this.w=new _.Bi;this.l=!1;this.j=null},ZX=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===
|
|
5
|
-
_.ng&&a.h.setUUID(f))},$X=function(a,b,c){var d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.qe,a.
|
|
5
|
+
_.ng&&a.h.setUUID(f))},$X=function(a,b,c){var d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.qe,a.Jk.bind(a));a.o=XX(b);a.a.attachPlayer(a.o)},aY=function(a,b){_.Ei(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},bY=function(){return!window.SmartLib||!window.GenericPlayerApi},
|
|
6
6
|
cY=function(){},dY=function(){};_.r=SX.prototype;_.r.lb=function(){return"Broadpeak"};_.r.nb=function(){return""};_.r.pb=function(){return 1};_.r.getId=function(){return this.a.adId};_.r.getCreativeId=function(){return this.a.creativeId};_.r.Jb=function(){return null};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return""};_.r.getDuration=function(){return 0>=this.a.duration?-1:this.a.duration/1E3};
|
|
7
7
|
_.r.getPosition=function(){return this.o};_.r.setPosition=function(a){this.o=a};_.r.getSkipTimeOffset=function(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3};_.r.Lb=function(){return!1};_.r.$a=function(){return this.a.clickURL};_.r.getMediaUrl=function(){return null};_.r.fb=function(){return 0};_.r.eb=function(){return 0};_.r.Ga=function(){return 0};_.r.Ha=function(){return 0===this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1};
|
|
8
8
|
_.r.getPodIndex=function(){return 1};_.r.zb=function(){return this.f.startPosition/1E3};_.r.ob=function(){return this.a.index+1};_.r.gb=function(){return 0>=this.f.adCount?-1:this.f.adCount};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.Kb=function(){return null};_.r.canSeek=function(){return!1};SX.prototype.canSeek=SX.prototype.canSeek;SX.prototype.getVideoElement=SX.prototype.Kb;
|
|
9
9
|
SX.prototype.getWrapperCreativeIds=SX.prototype.getWrapperCreativeIds;SX.prototype.getWrapperAdSystems=SX.prototype.getWrapperAdSystems;SX.prototype.getWrapperAdIds=SX.prototype.getWrapperAdIds;SX.prototype.getSequenceLength=SX.prototype.gb;SX.prototype.getPositionInSequence=SX.prototype.ob;SX.prototype.getPodTimeOffset=SX.prototype.zb;SX.prototype.getPodIndex=SX.prototype.getPodIndex;SX.prototype.getPodType=SX.prototype.Ha;SX.prototype.getMediaBitrate=SX.prototype.Ga;
|
|
10
10
|
SX.prototype.getMediaHeight=SX.prototype.eb;SX.prototype.getMediaWidth=SX.prototype.fb;SX.prototype.getMediaUrl=SX.prototype.getMediaUrl;SX.prototype.getClickThroughUrl=SX.prototype.$a;SX.prototype.isBumper=SX.prototype.Lb;SX.prototype.getSkipTimeOffset=SX.prototype.getSkipTimeOffset;SX.prototype.getPosition=SX.prototype.getPosition;SX.prototype.getDuration=SX.prototype.getDuration;SX.prototype.getTitle=SX.prototype.getTitle;SX.prototype.getAdvertiserName=SX.prototype.getAdvertiserName;
|
|
11
|
-
SX.prototype.getAdSystem=SX.prototype.getAdSystem;SX.prototype.getApiFramework=SX.prototype.getApiFramework;SX.prototype.getSourceId=SX.prototype.Jb;SX.prototype.getCreativeId=SX.prototype.getCreativeId;SX.prototype.getId=SX.prototype.getId;SX.prototype.getTechnology=SX.prototype.pb;SX.prototype.getAdManagerVersion=SX.prototype.nb;SX.prototype.getAdManagerName=SX.prototype.lb;_.r=TX.prototype;_.r.init=function(){var a=this.m,b=this.a;b.on(a,_.kg,this.
|
|
12
|
-
_.r.
|
|
11
|
+
SX.prototype.getAdSystem=SX.prototype.getAdSystem;SX.prototype.getApiFramework=SX.prototype.getApiFramework;SX.prototype.getSourceId=SX.prototype.Jb;SX.prototype.getCreativeId=SX.prototype.getCreativeId;SX.prototype.getId=SX.prototype.getId;SX.prototype.getTechnology=SX.prototype.pb;SX.prototype.getAdManagerVersion=SX.prototype.nb;SX.prototype.getAdManagerName=SX.prototype.lb;_.r=TX.prototype;_.r.init=function(){var a=this.m,b=this.a;b.on(a,_.kg,this.Mk.bind(this));b.on(a,_.bd,this.Kk.bind(this));b.on(a,"seek",this.Lk.bind(this))};_.r.Kk=function(a){a=a.detail;typeof a.bandwidth===_.h&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.r.Mk=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case 4:c.notifyPause()}};
|
|
12
|
+
_.r.Lk=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.r.release=function(){this.a&&(_.Ei(this.a),this.a=null)};_.r=UX.prototype;
|
|
13
13
|
_.r.initialize=function(a,b){var c=this;this.j=a;a.activateAdvertising();VX(this);for(var d in b)a.setAdParameter(d,b[d]);a.setAdEventsListener({onAdBreakBegin:function(){c.m.trigger(new _.Q(_.ic,{ad:null}));c.l.on(c.m,_.Bg,c.o)},onAdBegin:function(e,f){c.f=e;c.a=new SX(e,f,1E3*c.m.getDuration());c.m.trigger(new _.Q(_.Bc,{ad:c.a}))},onAdSkippable:function(){},onAdEnd:function(){if(c.a){var e={ad:c.a};c.m.trigger(new _.Q(_.mc,e));c.m.trigger(new _.Q(_.Cc,e));c.a=null;c.f=null}},onAdBreakEnd:function(){WX(c);c.m.trigger(new _.Q(_.jc));
|
|
14
|
-
c.a=null}})};_.r.
|
|
15
|
-
_.r.
|
|
14
|
+
c.a=null}})};_.r.qo=function(){if(this.a&&this.j){var a=this.a.$a();a&&(this.j.adUserInteraction("click"),this.m.trigger(new _.Q(_.lc,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}};
|
|
15
|
+
_.r.En=function(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.Q(_.yc,{ad:this.a})),!this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.Q(_.nc,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.Q(_.vc,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.Q(_.Dc,{ad:this.a}))))}};_.r.load=function(){return Promise.resolve()};_.r.Cb=function(){return!0};_.r.Uc=function(){};
|
|
16
16
|
_.r.Rc=function(){return!0};_.r.skip=function(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,WX(this),this.m.trigger(new _.Q(_.Ac,{ad:b})),this.m.setPosition(a))}};_.r.rb=function(){};_.r.isPaused=function(){};_.r.pause=function(){};_.r.resume=function(){};_.r.getAdVolume=function(){return 0};_.r.Pa=function(){};_.r.getVolume=function(){return 0};_.r.setVolume=function(){};_.r.setMuted=function(){};
|
|
17
17
|
_.r.isMuted=function(){return!1};_.r.Ab=function(){return!1};_.r.getPosition=function(){return this.a?this.a.getPosition():-1};_.r.Cc=function(){WX(this);this.l.release();var a=this.m.getSurface().getMedia();a&&this.h&&(a.removeEventListener("click",this.h),this.h=null);this.j=this.f=this.a=null;return Promise.resolve()};UX.prototype.getPosition=UX.prototype.getPosition;UX.prototype.setVolume=UX.prototype.setVolume;UX.prototype.getVolume=UX.prototype.getVolume;UX.prototype.resume=UX.prototype.resume;
|
|
18
18
|
UX.prototype.pause=UX.prototype.pause;UX.prototype.skip=UX.prototype.skip;_.w(YX,_.gw);_.r=YX.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(bY())return a.onError(new _.O(1,9,11E3));this.l=!0;ZX(this,d);$X(this,a,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}));aY(c,void 0)}else b.url=e.getURL(),c.f=new TX(c.m,c.o),c.f.init()})}};
|
|
19
|
-
_.r.onContentLoaded=function(){!1!==this.l&&this.a.precacheEnded()};_.r.
|
|
19
|
+
_.r.onContentLoaded=function(){!1!==this.l&&this.a.precacheEnded()};_.r.Jk=function(a){a=a.detail;if(7003===a.code)aY(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.P)switch(a.category){case 3:aY(this,SmartLib.BPDecodingError);break;case 1:aY(this,SmartLib.BPNetworkingError);break;case 6:aY(this,SmartLib.BPAccessRightError);break;default:aY(this,SmartLib.BPUnspecifiedError)}};_.r.onPlayerWillRelease=function(){this.j=null;bY()||aY(this,SmartLib.BPSessionEndsNormally);this.l=!1};
|
|
20
20
|
_.r.id=function(){return"broadpeak"};_.K("clpp.broadpeak.BroadpeakPlugin",YX);YX.isSdkMissing=bY;YX.Id="broadpeak";cY.prototype.create=function(){return new YX};dY.prototype.name=function(){return"clpp.broadpeak.AdsManagerFactory"};dY.prototype.a=function(a,b){return bY()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)};dY.prototype.create=function(a){return new UX(a)};_.fp(new cY);_.ki(new dY);};
|
|
21
21
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
22
22
|
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,36 +6,36 @@ q.a&&(m=q.f)&&m.data&&(n=f.a(_.Vi(m.data)),p=URL.createObjectURL(new Blob([n])),
|
|
|
6
6
|
case _.Ug:return b===_.kt?d.MPEG2_TS:c.TS;case _.Tc:return c.AAC;case _.Vc:return c.AC3;case _.Wc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Xc:return c.FMP4}},hW=function(a){a=void 0===a?gW:a;var b=cast.framework.messages||chrome.cast.media;if(!b)throw new _.O(1,8,8001);var c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,k=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;
|
|
7
7
|
case c.MUSIC_TRACK:return new g;case c.PHOTO:return new k;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},iW=function(){return Math.round(1E3*Math.random())},jW=function(a){aW.call(this,a,"clpp.cast.SenderStateManager");this.o=this.a=null;this.w=this.rc.bind(this)},kW=function(){this.g=new _.M("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}},lW=function(a){a=a.a?a.a.a:null;return(a?a.activeTrackIds||[]:[]).map(function(b){return b.toString()})},nW=function(a,b){var c=
|
|
8
8
|
lW(a);return mW(a,b).find(function(d){return c.includes(d.id)})||null},mW=function(a,b){return a.h.filter(function(c){return c.type===b})},pW=function(a,b,c){var d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.jt){var e=a.wa();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,function(){a.f[b]=null;oW(a,b)},function(f){a.f[b]=null;a.g.debug(MV,f)})}else b===_.jt&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,function(){oW(a,b)},
|
|
9
|
-
function(f){a.g.debug(MV,f)}))},oW=function(a,b){b===_.X?a.a.trigger(new _.Q(_.$c)):b===_.jt&&a.a.trigger(new _.Q(_.wg))},tW=function(a,b,c,d){_.Ii.call(this);this.g=new _.M(_.xd);this.X=a;this.w=new _.lj(b);this.W=c;this.ma=d;this.j=this.H=_.Pn();this.D=[];this.B=0;this.J=new _.an;this.a=null;this.f=!1;this.M=new _.rm;this.A=!1;this.Aa="";this.Va=1E6;this.h=new kW;this.h.initialize(this);this.l=new jW(this);this.G=new _.Bi;this.I=null;this.L=new Set;this.P=this.
|
|
10
|
-
this.ha=this.
|
|
9
|
+
function(f){a.g.debug(MV,f)}))},oW=function(a,b){b===_.X?a.a.trigger(new _.Q(_.$c)):b===_.jt&&a.a.trigger(new _.Q(_.wg))},tW=function(a,b,c,d){_.Ii.call(this);this.g=new _.M(_.xd);this.X=a;this.w=new _.lj(b);this.W=c;this.ma=d;this.j=this.H=_.Pn();this.D=[];this.B=0;this.J=new _.an;this.a=null;this.f=!1;this.M=new _.rm;this.A=!1;this.Aa="";this.Va=1E6;this.h=new kW;this.h.initialize(this);this.l=new jW(this);this.G=new _.Bi;this.I=null;this.L=new Set;this.P=this.Mn.bind(this);this.Ba=this.ko.bind(this);
|
|
10
|
+
this.ha=this.Zn.bind(this);this.T=this.Sn.bind(this);this.ba=this.Rn.bind(this);this.o=this.K=null;window.cast||Object.defineProperty(window,"cast",{get:function(){return window.cast_},set:function(e){window.cast_=e;window.setTimeout(function(){qW(!0)},0)}});rW(this);sW.add(this)},uW=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.G.release(),sW["delete"](a),a.f&&(a.f=!1,b=cast.framework.CastContext.getInstance(),b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,
|
|
11
11
|
a.P),b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Ba)),c=[],a.h&&(c.push(a.h.destroy()),a.h=null),a.l&&(c.push(a.l.destroy()),a.l=null),_.y(d,Promise.all(c),2);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.W=null;a.ma=null;_.A(d)})},wW=function(a){if(!a)return null;a:{var b=a.metadataType;var c=Object.entries(vW);c=_.v(c);for(var d=c.next();!d.done;d=c.next()){d=_.v(d.value);var e=d.next().value;if(d.next().value===b){b=e;break a}}b=null}if(!b)return null;b=hW(vW[b]);return Object.assign(b,
|
|
12
|
-
a)},xW=function(a){var b=void 0===b?gW:b;return Object.values(vW).includes(a)?a:b},yW=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},rW=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.X.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.G.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.
|
|
13
|
-
a.
|
|
12
|
+
a)},xW=function(a){var b=void 0===b?gW:b;return Object.values(vW).includes(a)?a:b},yW=function(a){var b={},c;for(c in a)void 0!==a[c]&&(b[c]=a[c]);return b},rW=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.X.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.G.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Nk.bind(a));a.G.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,
|
|
13
|
+
a.Yn.bind(a));a.f=!0;a.M.resolve();a.w.yh();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.X;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.P);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.Ba);zW&&a.w.ia(.02)}},AW=function(a){var b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==
|
|
14
14
|
_.h?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},CW=function(a,b){BW(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.ha);b.addMessageListener(WV,a.T);b.addMessageListener(XV,a.ba)},BW=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.Q(_.Me)))},DW=function(a){return _.I(function(b){return a.Ea()?b.C(0):_.y(b,cast.framework.CastContext.getInstance().requestSession(),0)})},EW=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,z,B,D,C,E,x;return _.I(function(J){switch(J.a){case 1:if(!a.f)return J["return"]();
|
|
15
15
|
c=chrome.cast.media.StreamType;d=_.Hw;return _.y(J,DW(a),2);case 2:if(!b)return J["return"]();e=cast.framework.CastContext.getInstance();f=e.getCurrentSession();g=new chrome.cast.media.MediaInfo(b.source.url,b.source.type);g.streamType=b.isLive?c.LIVE:c.BUFFERED;k=b;l=k.xc;m=k.wb;g.hlsVideoSegmentFormat=fW(l,d.VIDEO);g.hlsSegmentFormat=fW(m,d.AUDIO);if(!b.Ka){J.C(3);break}if(!a.K){J.C(4);break}return _.y(J,Promise.resolve(a.K(b.Ka)),5);case 5:if(n=J.f)b.Ka=n;case 4:a.j=b.Ka;a.D=_.Vn(a.j);a.B=a.D.findIndex(function(L){return L.url===
|
|
16
|
-
b.source.url});if(!b.Ka.remoteTextTracks){J.C(6);break}return _.y(J,Promise.all(b.Ka.remoteTextTracks.map(a.
|
|
16
|
+
b.source.url});if(!b.Ka.remoteTextTracks){J.C(6);break}return _.y(J,Promise.all(b.Ka.remoteTextTracks.map(a.$l.bind(a))),7);case 7:p=J.f,g.tracks=p.filter(function(L){return L}),b.Ka.remoteTextTracks=void 0;case 6:delete b.Ka.autoplay,b.Ka.startTime=null,g.customData={playerConfiguration:bW(b.Ka)};case 3:q=a.Vb()||{};t=xW(q.metadataType);typeof b.ih===_.h&&(u={metadataType:t,sectionStartAbsoluteTime:b.ih});b.source.name&&(z={metadataType:t,title:b.source.name});B=yW(q);if(D=wW(Object.assign({},u,
|
|
17
17
|
z,B)))g.metadata=D;C=new chrome.cast.media.LoadRequest(g);(E=b.queueData)&&E.items&&0<E.items.length&&(x=new chrome.cast.media.QueueData,x.items=E.items,x.startIndex=E.startIndex,C.queueData=x);typeof b.autoplay===_.cd&&(C.autoplay=b.autoplay);typeof b.currentTime===_.h&&(C.currentTime=b.currentTime);return _.y(J,f.loadMedia(C),8);case 8:null!=b.Ka.muted&&a.setMuted(b.Ka.muted),null!=b.Ka.volume&&a.setVolume(b.Ka.volume),_.A(J)}})},FW=function(a,b,c){c=void 0===c?0:c;var d,e;return _.I(function(f){(d=
|
|
18
|
-
a.h.wa())&&d.language&&(a.j.preferredTextLanguage=d.language);(e=a.h.qa())&&e.language&&(a.j.preferredAudioLanguage=e.language);return _.y(f,EW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),
|
|
19
|
-
function(a){return new tW(a.h,function(){a.trigger(new _.Q(_.jd))},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.
|
|
20
|
-
b=a.f.a;if(b===a.a||!a.a)return e["return"]();c=null!=a.f.ab();return _.y(e,a.f.release(),2)}_.Qo(a.f,a.a);if(!c)return e.C(0);_.Zo(a.f);return(d=a.f.getAdsManager())?_.y(e,d.load(),0):e.C(0)})},MW=function(a){aW.call(this,a,"clpp.cast.StateManager");this.I=this.
|
|
18
|
+
a.h.wa())&&d.language&&(a.j.preferredTextLanguage=d.language);(e=a.h.qa())&&e.language&&(a.j.preferredAudioLanguage=e.language);return _.y(f,EW(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),ih:a.getPresentationStartTime(),autoplay:b,Ka:a.j}),0)})},qW=function(a){if(a){a=_.v(sW);for(var b=a.next();!b.done;b=a.next())rW(b.value)}},HW=function(a,b,c){_.Ii.call(this);this.f=a;this.h=b;this.j=typeof c===_.ue?c:this.So;this.a=GW(this);this.g=new _.M(TV);this.forwardEventsTo(this.f)},GW=
|
|
19
|
+
function(a){return new tW(a.h,function(){a.trigger(new _.Q(_.jd))},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.Rh&&(d.preferredAudioLanguage=c.Rh);c.Zj&&(d.preferredTextLanguage=c.Zj);_.Qo(a.f,null);a.trigger(new _.Q("castingended"));a.j(b,d)},function(){return IW(a)})},IW=function(a){var b,c,d;return _.I(function(e){if(1==e.a){a.trigger(new _.Q(_.id));
|
|
20
|
+
b=a.f.a;if(b===a.a||!a.a)return e["return"]();c=null!=a.f.ab();return _.y(e,a.f.release(),2)}_.Qo(a.f,a.a);if(!c)return e.C(0);_.Zo(a.f);return(d=a.f.getAdsManager())?_.y(e,d.load(),0):e.C(0)})},MW=function(a){aW.call(this,a,"clpp.cast.StateManager");this.I=this.Uk.bind(this);this.H=this.Tk.bind(this);this.w=this.Un.bind(this);this.o=this.Kn.bind(this);this.K=this.Wk.bind(this);this.J=this.Vk.bind(this);this.L=this.no.bind(this);this.G=this.Xn.bind(this);this.D=this.Sk.bind(this);this.a=this.Rk.bind(this)},
|
|
21
21
|
RW=function(a,b){a=void 0===a?[]:a;b=void 0===b?0:b;_.Ii.call(this);this.a=a.slice();this.f=b},WW=function(a){a.trigger(new _.Q(_.Cf))},YW=function(a,b,c){c=void 0===c?function(){return Promise.resolve()}:c;_.Ii.call(this);var d=this;this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=function(){var e,f;return _.I(function(g){switch(g.a){case 1:if(d.f)return g["return"]();e=d.a.Wb();if(!e)return g["return"]();d.f=!0;_.F(g,2,3);return _.y(g,d.w(e),5);case 5:return _.y(g,d.m.open(Object.assign({},
|
|
22
|
-
e.configuration,{autoplay:!0})),3);case 3:_.Jh(g);d.f=!1;_.Kh(g);break;case 2:throw f=_.H(g),f;}})};this.l=function(){XW(d)}},XW=function(a){ZW(a);var b=Math.min(a.a.
|
|
22
|
+
e.configuration,{autoplay:!0})),3);case 3:_.Jh(g);d.f=!1;_.Kh(g);break;case 2:throw f=_.H(g),f;}})};this.l=function(){XW(d)}},XW=function(a){ZW(a);var b=Math.min(a.a.Be().length-1,a.a.getPosition()+1);a.a.setPosition(b)},ZW=function(a){a.j||(a.a.on(_.Bf,a.o),a.j=!0)},$W=function(a,b,c){var d=this;this.player=a;this.cc=new RW(c);this.Ud=new YW({open:this.player.open.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.cc,function(){return _.I(function(e){_.A(e)})});
|
|
23
23
|
this.a=new HW(this.player,b,function(e,f){var g;return _.I(function(k){if(1==k.a)return g=d.cc.getPosition(),d.Ud.Md(g),f.autoplay=!0,delete f.license,_.y(k,d.player.open(f),2);if(3!=k.a)return typeof f.currentTime!==_.h?k.C(3):_.y(k,d.player.setPosition(Math.max(f.currentTime-1,0)),3);d.player.play();_.A(k)})});this.f=function(e){e&&e.type===PV&&typeof e.index===_.h&&d.cc.setPosition(e.index)};this.a.addMessageListener(this.f)},aX=function(a){return a.map(function(b){var c={};c.media={contentId:b.configuration.source};
|
|
24
|
-
c.customData={skippable:!1!==b.skippable};return c})},bX=function(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.h?c:1;this.h=typeof d===_.h?d:1;this.j=typeof e===_.h?e:0},cX=function(a){this.a=a},eX=function(a){this.m=a;this.a=null;this.j=this.
|
|
24
|
+
c.customData={skippable:!1!==b.skippable};return c})},bX=function(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.h?c:1;this.h=typeof d===_.h?d:1;this.j=typeof e===_.h?e:0},cX=function(a){this.a=a},eX=function(a){this.m=a;this.a=null;this.j=this.Xk.bind(this);this.h=[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,
|
|
25
25
|
cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];this.f=!1;dX().addEventListener(this.h,this.j)},iX=function(a,b,c){var d,e,f,g,k,l,m;return _.I(function(n){if(1==n.a){d=b.adTagUrl;if(!d)return n["return"]();_.F(n,2);fX=!1;e=_.dl(d);return _.y(n,c.fetch(e).U,4)}if(2!=n.a){if((f=n.f)&&f.data)if(g=_.R.ea(f.data),k=new DOMParser,l=k.parseFromString(g,_.vg),l.getElementsByTagName("vmap:VMAP").length)gX.warn("VMAP detected."),
|
|
26
26
|
a.vmapAdsRequest=hX(g);else if(l.getElementsByTagName("VAST").length){gX.warn("VAST detected.");var p=new cast.framework.messages.BreakClip("bc1");p.vastAdsRequest=hX(g);var q=new cast.framework.messages.Break("b1",[p.id],0);a.breakClips=[p];a.breaks=[q]}else gX.warn("Unsupported schema."),fX=!0;return _.G(n,0)}m=_.H(n);gX.warn("Failed to fetch an ad",m);fX=!0;_.A(n)})},hX=function(a){var b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},dX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},
|
|
27
27
|
kX=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=jX(a,c))&&(d={ad:c});a.m.trigger(new _.Q(b,d))}},lX=function(a,b){var c=new _.O(1,10,10003,{errorType:b});a.m.onError(c)},jX=function(a,b){var c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){var d=null,e=null,f;typeof b.breakClipId===_.ng&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.ng&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(function(g){return g.breakClipIds.includes(d.id)})||
|
|
28
28
|
null),e&&(f=a.a.getBreaks().filter(function(g){return 0<=g.position}).sort(function(g,k){return g.position-k.position}).findIndex(function(g){return g===e})));c=new bX(d,e,b.index,b.total,f)}return c},mX=function(a){this.a=a;this.f=this.h.bind(this)},nX=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]},oX=function(a){var b=
|
|
29
|
-
a.dashTimedMetadata,c=_.Mg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Lg)?_.ag:_.Hg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},pX=function(){this.g=new _.M("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.
|
|
30
|
-
a.j=rX(_.jt,b)},tX=function(a,b,c,d){c=_.Ni(c).filter(function(k){return k});var e=!1,f=[];b===_.X?f=a.getAudioTracks():b===_.jt&&(f=a.ra());if(c=c.find(function(k){var l=_.vo(k);return f.some(function(m){m=_.vo(m.language||"");return _.wo(l,m)})})){var g=_.vo(c);c=f.filter(function(k){k=_.vo(k.language||"");return _.wo(g,k)});f=c.length?c:f;e=e||!!c.length}_.R.
|
|
29
|
+
a.dashTimedMetadata,c=_.Mg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.Lg)?_.ag:_.Hg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},pX=function(){this.g=new _.M("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.Jo.bind(this);this.a=this.f=null},qX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},sX=function(a){a.a=qX().getTextTracksManager();var b=a.a.getTracks();
|
|
30
|
+
a.j=rX(_.jt,b)},tX=function(a,b,c,d){c=_.Ni(c).filter(function(k){return k});var e=!1,f=[];b===_.X?f=a.getAudioTracks():b===_.jt&&(f=a.ra());if(c=c.find(function(k){var l=_.vo(k);return f.some(function(m){m=_.vo(m.language||"");return _.wo(l,m)})})){var g=_.vo(c);c=f.filter(function(k){k=_.vo(k.language||"");return _.wo(g,k)});f=c.length?c:f;e=e||!!c.length}_.R.Uf(d)&&(c=f.filter(function(k){return k.roles.includes(d)}),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",
|
|
31
31
|
e),b===_.X?a.La(e):b===_.jt&&a.kb(e))},rX=function(a,b){for(var c=[],d=_.v(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=new _.ht(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 _.pt(f.id,f));c.push(f)}return c},uX=
|
|
32
32
|
function(){_.Ii.call(this);this.g=new _.M(UV);this.h=this.w=_.Pn();this.A=null;this.l=-1;this.G=new _.an;this.f=this.o=this.j=this.a=this.B=null;this.D=!1},vX=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},wX=function(a,b){var c=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:c})},zX=function(a,b){function c(){b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=
|
|
33
33
|
void 0}if(a&&a.drm){var d=a.drm,e=_.ao(d);if(e){var f=[_.Kd];_.Vn(a)[0].type!==_.Qc&&f.unshift(_.Md);d.preferredDrmSystem===_.Kd&&f.reverse();for(var g,k;f.length&&!k;)g=f.shift(),k=e.Ua[g];k?(d=g===_.Md?cast.framework.ContentProtection.WIDEVINE:g===_.Kd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=d,b.licenseUrl=k.licenseUrl,d={ldlDelay:0,customData:{}},xX(b,k,a,d),yX(b,k,a,d)):c()}else c()}else c()},xX=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=
|
|
34
34
|
function(e){var f=_.dl({method:_.rb,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},yX=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=function(e,f){var g;return _.I(function(k){return 1==k.a?(g=_.hl(Object.assign({},f.headers),e.buffer,200,""),_.y(k,b.modifiers.licenseResponse(c,
|
|
35
|
-
g,d),2)):k["return"](_.Vi(g.data))})}:a.licenseHandler=void 0},AX=function(){this.a=!1;this.g=new _.M(VV);this.f=this.m=null;this.w=new Set;this.D=this.
|
|
35
|
+
g,d),2)):k["return"](_.Vi(g.data))})}:a.licenseHandler=void 0},AX=function(){this.a=!1;this.g=new _.M(VV);this.f=this.m=null;this.w=new Set;this.D=this.Wn.bind(this);this.B=this.Pk.bind(this);this.o=null;this.l=new _.Bi;this.j=this.h=this.A=null},CX=function(){return BX||(BX=new AX)},DX=function(){return cast.framework.CastReceiverContext.getInstance()},EX=function(){var a=DX().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},FX=function(a,b){var c=DX().getPlayerManager().getMediaInformation();
|
|
36
36
|
if(c){b?c.metadata=b:delete c.metadata;var d=!0;d=void 0===d?!1:d;DX().getPlayerManager().setMediaInformation(c,d)}else a.g.warn("No mediaInformation is present. Skipping metadata update.")},HX=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat,d=DX();c=(DX().getPlayerManager().getMediaInformation()||{}).hlsVideoSegmentFormat===c.FMP4?_.Vg:_.Ug;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");for(var e=b.split(/\n+/m),f=[],g=0;g<e.length;){var k=e[g].trim();
|
|
37
37
|
if(e[g].startsWith("#EXT-X-STREAM-INF")){var l=GX(k,_.ua),m=GX(k,_.zb),n=_.v([]),p=n.next().value;n=n.next().value;m&&(m=_.v(m.split("x").map(function(q){return+q})),p=m.next().value,n=m.next().value);if(!d.canDisplayType(c,l,p,n)){g+=2;continue}}f.push(k);++g}return f.join("\n")},GX=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},IX=function(a){a=
|
|
38
|
-
_.v(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c={};b.customData&&_.N.Zb(b.customData)&&(c=b.customData);b.roles&&(c.roles=b.roles);b.audioTrackInfo&&(c.audioTrackInfo=b.audioTrackInfo);_.N.Zb(c)&&(b.customData=c)}},KX=function(a){this.h=a;this.a=null;this.j=new _.Bi;this.f=null;JX(this)},JX=function(a){_.I(function(b){if(1==b.a)return _.y(b,a.h.M,2);a.a=a.h.o;a.j.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,a.
|
|
38
|
+
_.v(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c={};b.customData&&_.N.Zb(b.customData)&&(c=b.customData);b.roles&&(c.roles=b.roles);b.audioTrackInfo&&(c.audioTrackInfo=b.audioTrackInfo);_.N.Zb(c)&&(b.customData=c)}},KX=function(a){this.h=a;this.a=null;this.j=new _.Bi;this.f=null;JX(this)},JX=function(a){_.I(function(b){if(1==b.a)return _.y(b,a.h.M,2);a.a=a.h.o;a.j.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,a.po.bind(a));_.A(b)})},LX=function(a,b,c){var d=null;c&&
|
|
39
39
|
(d={ad:c});a.h.trigger(new _.Q(b,d))},MX=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks,c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,k=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=k&&d))return null;var l=b.find(function(m){return m.id===e})||null;a=0;l&&(a=0>=l.position?l.position:b.filter(function(m){return 0<=m.position}).sort(function(m,n){return m.position-n.position}).findIndex(function(m){return m===
|
|
40
40
|
l}));b=c.find(function(m){return m.id===k})||null;return new bX(b,l,f,g,a)},NX=function(){},OX=function(){};_.r=aW.prototype;_.r.release=function(){this.Da(_.mu)};_.r.destroy=function(){this.j=this.player=null;return Promise.resolve()};_.r.getState=function(){return this.f};_.r.onError=function(a){a.severity===_.P&&this.Da(_.Fo)};
|
|
41
41
|
_.r.Da=function(a){if(a!==this.f)if(this.f===_.Fo&&a!==_.mu)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.l=this.f;this.f=a;2===this.f?(this.A=b,this.player.trigger(new _.Q(_.ed,{detail:{bufferedTimeMS:-1,reason:this.h}}))):2===this.l&&this.player.trigger(new _.Q(_.dd,{detail:{bufferedTimeMS:b-this.A,reason:this.h}}));a={currentState:this.f,previousState:this.l,timeSinceLastStateChangeMS:b-this.B};this.B=b;this.j&&_.fu(this.j,this.f);this.player.trigger(new _.Q(_.kg,
|
|
@@ -47,10 +47,10 @@ _.r.sa=function(){var a=this.Ra();return a?a.renditions[0]:null};_.r.Za=function
|
|
|
47
47
|
_.r.La=function(a){pW(this,_.X,a)};_.r.kb=function(a){pW(this,_.jt,a)};_.r.Db=function(a){this.Qb(a&&a.track)};_.r.Ob=function(a){this.La(a&&a.track)};_.r.Pb=function(a){this.kb(a&&a.track)};_.r.addTextTrack=function(){return _.I(function(a){_.A(a)})};_.r.xa=function(){return!0};kW.prototype.isAbrEnabled=kW.prototype.xa;kW.prototype.addTextTrack=kW.prototype.addTextTrack;kW.prototype.setTextRendition=kW.prototype.Pb;kW.prototype.setAudioRendition=kW.prototype.Ob;kW.prototype.setVideoRendition=kW.prototype.Db;
|
|
48
48
|
kW.prototype.setTextTrack=kW.prototype.kb;kW.prototype.setAudioTrack=kW.prototype.La;kW.prototype.setVideoTrack=kW.prototype.Qb;kW.prototype.getTextTrack=kW.prototype.wa;kW.prototype.getAudioTrack=kW.prototype.qa;kW.prototype.getVideoTrack=kW.prototype.Ra;kW.prototype.getLoadingTextRendition=kW.prototype.Yb;kW.prototype.getLoadingAudioRendition=kW.prototype.Xb;kW.prototype.getLoadingVideoRendition=kW.prototype.Hb;kW.prototype.getTextRendition=kW.prototype.hb;kW.prototype.getAudioRendition=kW.prototype.Za;
|
|
49
49
|
kW.prototype.getVideoRendition=kW.prototype.sa;kW.prototype.getTextTracks=kW.prototype.ra;kW.prototype.getAudioTracks=kW.prototype.getAudioTracks;kW.prototype.getVideoTracks=kW.prototype.getVideoTracks;_.w(tW,_.Ii);_.r=tW.prototype;_.r.init=function(a,b){this.j=this.H=b};_.r.unload=function(){var a=this;return this.f?new Promise(function(b,c){a.h&&a.h.release();a.a&&!a.a.idleReason||b();a.a.stop(null,b,c)}):Promise.resolve()};_.r.release=function(){var a=this;return this.f?this.unload().then(function(){a.l&&a.l.release()}):Promise.resolve()};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.nb)};_.r.appendLoad=function(){return Promise.reject(_.nb)};
|
|
50
|
-
_.r.seekWith=function(){return Promise.reject(_.nb)};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.I(function(a){_.A(a)})};_.r.
|
|
50
|
+
_.r.seekWith=function(){return Promise.reject(_.nb)};_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.destroy=function(){return _.I(function(a){_.A(a)})};_.r.Ze=function(a){this.K=a};_.r.Od=function(){return this.f};_.r.Ea=function(){return this.A};_.r.Ng=function(){return this.Aa};
|
|
51
51
|
_.r.sendMessage=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:if(!c.f)return g["return"]();e=cast.framework.CastContext.getInstance().getCurrentSession();if(!e){d=new _.O(1,8,8004,void 0);g.C(2);break}_.F(g,3);return _.y(g,e.sendMessage(a,b),5);case 5:_.G(g,2);break;case 3:f=_.H(g),d=new _.O(1,8,8E3,{detailedErrorCode:f});case 2:if(d)c.onError(d);_.A(g)}})};
|
|
52
52
|
_.r.cast=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){if(!a.Od())throw a.g.warn(RV),new _.O(1,8,8001,void 0);if(!zW)throw a.g.warn(OV),new _.O(1,8,8002,void 0);if(a.Ea())throw a.g.warn("Already casting"),new _.O(1,8,8003,void 0);_.F(d,2);return _.y(d,DW(a),4)}if(2!=d.a)return _.G(d,0);b=_.H(d);c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.O(1,8,8E3,c);})};
|
|
53
|
-
_.r.
|
|
53
|
+
_.r.If=function(){this.f&&this.Ea()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)};_.r.addMessageListener=function(a){typeof a===_.ue&&this.L.add(a)};_.r.removeMessageListener=function(a){typeof a===_.ue&&this.L["delete"](a)};_.r.play=function(){var a=this;return this.f?this.isEnded()?FW(this,!0):new Promise(function(b,c){if(!a.a)return c(NV);a.a.play(null,b,c)}):Promise.resolve()};
|
|
54
54
|
_.r.pause=function(){var a=this;return this.f?new Promise(function(b,c){a.isEnded()&&b();if(!a.a)return c(NV);a.a.pause(null,b,c)}):Promise.resolve()};_.r.isPaused=function(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1};_.r.isEnded=function(){return this.f?5===this.getState():!1};
|
|
55
55
|
_.r.seek=function(a){var b=this;return this.f?this.isEnded()?FW(this,!1,a):new Promise(function(c,d){b.a||d(NV);b.o.isPlayingBreak&&d(LV);var e=new chrome.cast.media.SeekRequest;e.currentTime=a;b.trigger(new _.Q(_.Og));b.a.seek(e,function(){b.trigger(new _.Q(_.Ng));c()},d)}):Promise.resolve()};_.r.getPosition=function(){return this.f?this.getMediaPosition():0};_.r.getMediaPosition=function(){return this.f?this.a&&this.a.getEstimatedTime()||0:0};
|
|
56
56
|
_.r.getDuration=function(){return this.f?this.getMediaDuration():0};_.r.getMediaDuration=function(){if(!this.f)return 0;if(!this.a||!this.a.media)return-1;var a=this.a.media.duration;return typeof a!==_.h?-1:-1===a?Infinity:a};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r.getPlaybackRate=function(){return this.f?this.a&&this.a.playbackRate||0:0};
|
|
@@ -59,36 +59,36 @@ _.r.setMuted=function(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(
|
|
|
59
59
|
_.r.getSeekRange=function(){if(!this.f)return{start:0,end:0};var a={start:0,end:this.getDuration()};if(this.isLive()){var b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.h&&typeof b.end===_.h&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.f?this.l?this.l.getState():7:7};_.r.getStats=function(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?cW(this.a.customData.stats):_.lu():_.lu()};
|
|
60
60
|
_.r.isLive=function(){return this.f?Infinity===this.getDuration():!1};_.r.load=function(a){var b=this,c,d;return _.I(function(e){if(!b.Od())return b.g.warn(RV),e["return"]();if(!zW)return b.g.warn(OV),e["return"]();b.D=_.Vn(a);b.j=_.Rn([b.H,a]);c=b.D[b.B];d={source:c,isLive:c.isLive,autoplay:b.j.autoplay,Ka:b.j,xc:c.xc,wb:c.wb};return _.y(e,EW(b,d),0)})};_.r.getBufferInfo=function(){return new _.mi};_.r.getTrackManager=function(){return this.h};_.r.getConfiguration=function(){return this.j};
|
|
61
61
|
_.r.getSurface=function(){return null};_.r.setNetworkEngine=function(a){this.J=a};_.r.getNetworkEngine=function(){return this.J};_.r.getSourceIndex=function(){return this.B};_.r.setSourceIndex=function(a){this.B=a};_.r.setCmsdManager=function(){};_.r.getLoadedSource=function(){return this.D[this.B]};_.r.getPeriods=function(){return[]};_.r.getDrmInfo=function(){return null};_.r.getTimelineCues=function(){return[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(QV)};
|
|
62
|
-
_.r.onError=function(a){if(a&&(this.trigger(new _.Q(_.qe,{detail:a})),this.l))this.l.onError(a)};_.r.namespace=function(){return _.xd};_.r.canPlay=function(){return this.Od()?2:0};_.r.Vb=function(){return this.I};_.r.uc=function(a){this.I=wW(a)};_.r.
|
|
63
|
-
_.r.
|
|
64
|
-
_.r.
|
|
65
|
-
_.r.
|
|
66
|
-
isLive:this.isLive()},currentTime:AW(this),
|
|
67
|
-
_.r.
|
|
68
|
-
_.r
|
|
62
|
+
_.r.onError=function(a){if(a&&(this.trigger(new _.Q(_.qe,{detail:a})),this.l))this.l.onError(a)};_.r.namespace=function(){return _.xd};_.r.canPlay=function(){return this.Od()?2:0};_.r.Vb=function(){return this.I};_.r.uc=function(a){this.I=wW(a)};_.r.Eg=function(){this.I=null};_.r.sh=function(a){if(this.f){var b=this.Vb()||{};a={metadataType:xW(b.metadataType),title:a};this.uc(Object.assign({},b,a))}};
|
|
63
|
+
_.r.qh=function(a){if(this.f){var b=this.Vb()||{},c=xW(b.metadataType);a=new chrome.cast.Image(a);this.uc(Object.assign({},b,{metadataType:c,images:[a]}))}};_.r.ph=function(a){if(this.f){var b=this.Vb()||{};this.uc(Object.assign({},b,{metadataType:3,artist:a}))}};_.r.rh=function(a){if(this.f){var b=this.Vb()||{};a={metadataType:xW(b.metadataType),releaseDate:a};this.uc(Object.assign({},b,a))}};
|
|
64
|
+
_.r.Mn=function(a){var b=cast.framework.CastContext.getInstance(),c=a.castState===cast.framework.CastState.CONNECTED;zW=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.Aa=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.yh()};
|
|
65
|
+
_.r.ko=function(a){this.g.debug("state: "+a.sessionState+", details:",a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;CW(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.Ea()||(this.A=!0,CW(this,a.session),this.ma());break;case cast.framework.SessionState.SESSION_ENDED:if(this.Ea()&&this.a){var b=this.a.media,c=this.h.qa(),d=this.h.wa();c=c&&c.language||void 0;d=d&&d.language||void 0;this.W(this.getState(),{source:{url:b.contentId,type:b.contentType,
|
|
66
|
+
isLive:this.isLive()},currentTime:AW(this),Zj:d,Rh:c})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.ha);a.session.removeMessageListener(WV,this.T);a.session.removeMessageListener(XV,this.ba);this.A=!1;this.a=null}};_.r.Zn=function(a){this.g.debug("New media session",a.mediaSession);BW(this,a.mediaSession)};_.r.Yn=function(a){a.value&&a.value.tracks&&this.h&&this.h.load()};_.r.Sn=function(a,b){var c=cW(b);this.L.forEach(function(d){return d(c)})};
|
|
67
|
+
_.r.Rn=function(a,b){var c=cW(b);"event"===c.type&&c.name===_.Zg&&this.trigger(new _.Q(_.kd,{visible:!!c.visible}))};_.r.Nk=function(){this.trigger(new _.Q(_.Bg))};
|
|
68
|
+
_.r.$l=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return c=null,_.y(e,eW(a,[_.ug,_.Pc],b.J,b.j),2);if(d=e.f)c=new chrome.cast.media.Track(b.Va++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,url:a.url};return e["return"](c)})};_.r.getTextDisplayer=function(){return null};var zW=!1,sW=new Set;window.__onGCastApiAvailable=qW;_.w(HW,_.Ii);_.r=HW.prototype;_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,uW(a.a),3):b.C(2);2!=b.a&&(a.a=null);a.stopForwardingEventsTo(a.f);_.A(b)})};_.r.So=function(a,b){5!==a&&a!==_.mu&&(delete b.license,this.f.open(b))};_.r.zd=function(){return!!this.a&&this.a.Od()&&zW};_.r.Ea=function(){return!!this.a&&this.a.Ea()};_.r.Ng=function(){return this.a?this.a.Ng():""};_.r.Ze=function(a){this.a&&this.a.Ze(a)};
|
|
69
69
|
_.r.cast=function(a,b){var c=this,d,e,f;return _.I(function(g){switch(g.a){case 1:if(!c.a)return g["return"]();_.F(g,2);return _.y(g,c.a.cast(),4);case 4:if(!c.a)return g["return"]();var k=null,l=c.f.ab();if(l){var m=c.f.getTrackManager();k=m.getVideoTracks()[0];if(k&&k.mimeType)var n=k.mimeType;k=c.f.getConfiguration();var p=m.qa();if(p){if(p.mimeType)var q=p.mimeType;p.language&&(k.preferredAudioLanguage=p.language);p.roles.length&&(k.preferredAudioRole=p.roles[0])}if(m=m.wa())m.language&&(k.preferredTextLanguage=
|
|
70
|
-
m.language),m.roles.length&&(k.preferredTextRole=m.roles[0]);m=l&&typeof l.isLive===_.cd?l.isLive:c.f.isLive();k={source:l,isLive:m,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),
|
|
71
|
-
break;case 2:e=_.H(g),c.g.error("Error while trying to cast",e),f=new _.Q(_.qe,{detail:e}),c.trigger(f),_.A(g)}})};_.r.
|
|
72
|
-
_.r.
|
|
73
|
-
_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(SV)};_.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(SV)};_.r.Vb=function(){return this.a&&this.a.Vb()};_.r.uc=function(a){this.a&&this.a.uc(a)};_.r.
|
|
74
|
-
HW.prototype.setContentReleaseDate=HW.prototype.
|
|
75
|
-
HW.prototype.queuePreviousItem=HW.prototype.
|
|
70
|
+
m.language),m.roles.length&&(k.preferredTextRole=m.roles[0]);m=l&&typeof l.isLive===_.cd?l.isLive:c.f.isLive();k={source:l,isLive:m,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),ih:c.f.getPresentationStartTime(),xc:n,wb:q,Ka:k}}d=k;b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});return _.y(g,IW(c),5);case 5:if(!c.a)return g["return"]();d&&(d.autoplay=!c.f.isPaused());if(a)return _.y(g,c.f.open(a),7);if(c.a.a){g.C(7);break}return _.y(g,EW(c.a,d),7);case 7:_.G(g,0);
|
|
71
|
+
break;case 2:e=_.H(g),c.g.error("Error while trying to cast",e),f=new _.Q(_.qe,{detail:e}),c.trigger(f),_.A(g)}})};_.r.If=function(){this.a&&this.a.If()};_.r.Hk=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,uW(b.a),2):c.C(2)}b.a=GW(b);_.A(c)})};_.r.sendMessage=function(a){var b=this;return _.I(function(c){return b.a?_.y(c,b.a.sendMessage(WV,a),0):(b.g.warn(SV),c["return"]())})};
|
|
72
|
+
_.r.Nj=function(){var a=this;return _.I(function(b){return _.y(b,a.a.sendMessage(YV,{type:"QUEUE_NEXT",requestId:iW(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Oj=function(){var a=this;return _.I(function(b){return _.y(b,a.a.sendMessage(YV,{type:"QUEUE_PREV",requestId:iW(),mediaSessionId:a.a.a.mediaSessionId}),0)})};_.r.Mj=function(a){var b=this;return _.I(function(c){return _.y(c,b.a.sendMessage(YV,{type:"QUEUE_INSERT",requestId:iW(),mediaSessionId:b.a.a.mediaSessionId,items:a}),0)})};
|
|
73
|
+
_.r.addMessageListener=function(a){this.a?this.a.addMessageListener(a):this.g.warn(SV)};_.r.removeMessageListener=function(a){this.a?this.a.removeMessageListener(a):this.g.warn(SV)};_.r.Vb=function(){return this.a&&this.a.Vb()};_.r.uc=function(a){this.a&&this.a.uc(a)};_.r.Eg=function(){this.a&&this.a.Eg()};_.r.sh=function(a){this.a&&this.a.sh(a)};_.r.qh=function(a){this.a&&this.a.qh(a)};_.r.ph=function(a){this.a&&this.a.ph(a)};_.r.rh=function(a){this.a&&this.a.rh(a)};_.K(TV,HW);
|
|
74
|
+
HW.prototype.setContentReleaseDate=HW.prototype.rh;HW.prototype.setContentArtist=HW.prototype.ph;HW.prototype.setContentImage=HW.prototype.qh;HW.prototype.setContentTitle=HW.prototype.sh;HW.prototype.clearContentMetadata=HW.prototype.Eg;HW.prototype.setContentMetadata=HW.prototype.uc;HW.prototype.getContentMetadata=HW.prototype.Vb;HW.prototype.removeMessageListener=HW.prototype.removeMessageListener;HW.prototype.addMessageListener=HW.prototype.addMessageListener;HW.prototype.queueAddItems=HW.prototype.Mj;
|
|
75
|
+
HW.prototype.queuePreviousItem=HW.prototype.Oj;HW.prototype.queueNextItem=HW.prototype.Nj;HW.prototype.sendMessage=HW.prototype.sendMessage;HW.prototype.changeReceiverId=HW.prototype.Hk;HW.prototype.forceDisconnect=HW.prototype.If;HW.prototype.cast=HW.prototype.cast;HW.prototype.setPlayerConfigInterceptor=HW.prototype.Ze;HW.prototype.getReceiverName=HW.prototype.Ng;HW.prototype.isCasting=HW.prototype.Ea;HW.prototype.canCast=HW.prototype.zd;HW.prototype.destroy=HW.prototype.destroy;_.w(MW,aW);_.r=MW.prototype;
|
|
76
76
|
_.r.init=function(){var a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,this.H);b.addEventListener(a.MEDIA_FINISHED,this.w);b.addEventListener(a.BUFFERING,this.o);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.D);b.addEventListener(a.BITRATE_CHANGED,this.a)};
|
|
77
77
|
_.r.destroy=function(){var a=this,b,c;return _.I(function(d){b=cast.framework.events.EventType;c=cast.framework.CastReceiverContext.getInstance().getPlayerManager();c.removeEventListener(b.PLAYING,a.I);c.removeEventListener(b.PAUSE,a.H);c.removeEventListener(b.MEDIA_FINISHED,a.w);c.removeEventListener(b.BUFFERING,a.o);c.removeEventListener(b.SEEKING,a.K);c.removeEventListener(b.SEEKED,a.J);c.removeEventListener(b.STALLED,a.L);c.removeEventListener(b.PLAYER_LOADING,a.G);c.removeEventListener(b.ERROR,
|
|
78
|
-
a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,aW.prototype.destroy.call(a),0)})};_.r.
|
|
79
|
-
_.r.
|
|
80
|
-
_.r.remove=function(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,WW(this))};_.r.clear=function(){this.a=[];this.f=0;WW(this)};_.w(YW,_.Ii);_.r=YW.prototype;_.r.start=function(){this.h||this.f||(this.h=!0,this.m.on(_.pe,this.l),ZW(this),this.a.setPosition(this.a.getPosition()))};_.r.next=function(){var a=this.a.Wb();a&&!1===a.skippable||XW(this)};_.r.
|
|
81
|
-
_.r.stop=function(){this.h=!1;this.m.off(_.pe,this.l);this.a.off(_.Bf,this.o);this.j=!1};_.r=$W.prototype;_.r.
|
|
82
|
-
_.r.pause=function(){this.player.pause()};_.r.destroy=function(){this.Ud.stop();this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()};_.r.
|
|
83
|
-
_.r.next=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.Ea()?_.y(b,a.a.
|
|
84
|
-
$W.prototype.pause=$W.prototype.pause;$W.prototype.play=$W.prototype.play;$W.prototype.start=$W.prototype.start;$W.prototype.getCurrentIndex=$W.prototype.
|
|
78
|
+
a.D);c.removeEventListener(b.BITRATE_CHANGED,a.a);return _.y(d,aW.prototype.destroy.call(a),0)})};_.r.Uk=function(){this.player.trigger(new _.Q(_.pf));this.Da(3)};_.r.Tk=function(){this.Da(4)};_.r.Un=function(){this.Da(5)};_.r.Kn=function(a){a.isBuffering?this.Da(2):(a=this.player.isPaused()?4:3,this.Da(a))};_.r.Wk=function(){this.h=1;this.player.trigger(new _.Q(_.Og))};_.r.Vk=function(){this.player.trigger(new _.Q(_.Ng))};_.r.no=function(){this.h=2};_.r.Xn=function(){this.Da(1)};
|
|
79
|
+
_.r.Rk=function(a){var b=this.player.getStats();this.player.trigger(new _.Q(_.bd,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))};_.r.Sk=function(a){a=new _.O(_.P,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.Q(_.qe,{detail:a}));this.Da(_.Fo)};_.w(RW,_.Ii);_.r=RW.prototype;_.r.Be=function(){return this.a};_.r.getPosition=function(){return this.f};_.r.Wb=function(){return this.a[this.f]||null};_.r.Ti=function(){return this.a[this.f+1]||null};_.r.setPosition=function(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.Q(_.Bf,{item:this.Wb()})))};_.r.append=function(a){this.a.push(a);WW(this)};_.r.Yi=function(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),WW(this))};
|
|
80
|
+
_.r.remove=function(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,WW(this))};_.r.clear=function(){this.a=[];this.f=0;WW(this)};_.w(YW,_.Ii);_.r=YW.prototype;_.r.start=function(){this.h||this.f||(this.h=!0,this.m.on(_.pe,this.l),ZW(this),this.a.setPosition(this.a.getPosition()))};_.r.next=function(){var a=this.a.Wb();a&&!1===a.skippable||XW(this)};_.r.Ve=function(){var a=this.a.Wb();a&&!1===a.skippable||(ZW(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))};_.r.Md=function(a){var b=this;return _.I(function(c){b.a.setPosition(a);_.A(c)})};
|
|
81
|
+
_.r.stop=function(){this.h=!1;this.m.off(_.pe,this.l);this.a.off(_.Bf,this.o);this.j=!1};_.r=$W.prototype;_.r.eo=function(a){return this.cc.on(_.Bf,a)};_.r.fo=function(a){return this.cc.on(_.Cf,a)};_.r.Nn=function(a){return this.player.on(_.jd,a)};_.r.zd=function(){return this.a.zd()};_.r.Km=function(){return this.cc.Be()};_.r.Ea=function(){return this.a.Ea()};_.r.append=function(a){var b=this;return _.I(function(c){b.cc.append(a);return b.a.Ea()?_.y(c,b.a.Mj(aX([a])),0):c["return"]()})};_.r.zm=function(){return this.cc.getPosition()};_.r.start=function(){this.Ud.start()};_.r.play=function(){this.player.play()};
|
|
82
|
+
_.r.pause=function(){this.player.pause()};_.r.destroy=function(){this.Ud.stop();this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()};_.r.np=function(){var a=this,b,c;return _.I(function(d){if(a.a.Ea())return a.a.If(),d["return"]();a.Ud.stop();b=aX(a.cc.Be());c=a.cc.getPosition();return _.y(d,a.a.cast(void 0,{items:b,startIndex:c}),0)})};
|
|
83
|
+
_.r.next=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.Ea()?_.y(b,a.a.Nj(),3):b.C(2):2!=b.a?b["return"]():_.y(b,a.Ud.next(),0)})};_.r.Ve=function(){var a=this;return _.I(function(b){return 1==b.a?a.a.Ea()?_.y(b,a.a.Oj(),3):b.C(2):2!=b.a?b["return"]():_.y(b,a.Ud.Ve(),0)})};_.K("clpp.cast.playlist.CastPlaylist",$W);$W.prototype.previous=$W.prototype.Ve;$W.prototype.next=$W.prototype.next;$W.prototype.toggleCast=$W.prototype.np;$W.prototype.destroy=$W.prototype.destroy;
|
|
84
|
+
$W.prototype.pause=$W.prototype.pause;$W.prototype.play=$W.prototype.play;$W.prototype.start=$W.prototype.start;$W.prototype.getCurrentIndex=$W.prototype.zm;$W.prototype.append=$W.prototype.append;$W.prototype.isCasting=$W.prototype.Ea;$W.prototype.getPlaylistItems=$W.prototype.Km;$W.prototype.canCast=$W.prototype.zd;$W.prototype.onCastStatusChanged=$W.prototype.Nn;$W.prototype.onPlaylistModified=$W.prototype.fo;$W.prototype.onPlaylistItemChange=$W.prototype.eo;_.r=bX.prototype;_.r.lb=function(){return"Google Cast Framework"};_.r.nb=function(){return cast.framework.VERSION};_.r.pb=function(){return 0};_.r.getId=function(){return this.a.id};_.r.getCreativeId=function(){return""};_.r.Jb=function(){return""};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return this.a.title||""};_.r.getDuration=function(){return this.a.duration||0};_.r.getPosition=function(){return 0};
|
|
85
85
|
_.r.getSkipTimeOffset=function(){return this.a.whenSkippable||0};_.r.Lb=function(){return!1};_.r.$a=function(){return this.a.clickThroughUrl||null};_.r.getMediaUrl=function(){return this.a.contentUrl||this.a.contentId||null};_.r.fb=function(){return 0};_.r.eb=function(){return 0};_.r.Ga=function(){return 0};_.r.Ha=function(){switch(this.zb()){case 0:return 0;case -1:return 2;default:return 1}};_.r.getPodIndex=function(){return this.j};_.r.zb=function(){return this.f.position};_.r.ob=function(){return this.l};
|
|
86
86
|
_.r.gb=function(){return this.h};_.r.getWrapperAdIds=function(){return[]};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.Kb=function(){return null};bX.prototype.getVideoElement=bX.prototype.Kb;bX.prototype.getWrapperCreativeIds=bX.prototype.getWrapperCreativeIds;bX.prototype.getWrapperAdSystems=bX.prototype.getWrapperAdSystems;bX.prototype.canSeek=bX.prototype.canSeek;bX.prototype.getWrapperAdIds=bX.prototype.getWrapperAdIds;
|
|
87
87
|
bX.prototype.getSequenceLength=bX.prototype.gb;bX.prototype.getPositionInSequence=bX.prototype.ob;bX.prototype.getPodTimeOffset=bX.prototype.zb;bX.prototype.getPodIndex=bX.prototype.getPodIndex;bX.prototype.getPodType=bX.prototype.Ha;bX.prototype.getMediaBitrate=bX.prototype.Ga;bX.prototype.getMediaHeight=bX.prototype.eb;bX.prototype.getMediaWidth=bX.prototype.fb;bX.prototype.getMediaUrl=bX.prototype.getMediaUrl;bX.prototype.getClickThroughUrl=bX.prototype.$a;bX.prototype.isBumper=bX.prototype.Lb;
|
|
88
88
|
bX.prototype.getSkipTimeOffset=bX.prototype.getSkipTimeOffset;bX.prototype.getPosition=bX.prototype.getPosition;bX.prototype.getDuration=bX.prototype.getDuration;bX.prototype.getTitle=bX.prototype.getTitle;bX.prototype.getAdvertiserName=bX.prototype.getAdvertiserName;bX.prototype.getAdSystem=bX.prototype.getAdSystem;bX.prototype.getApiFramework=bX.prototype.getApiFramework;bX.prototype.getSourceId=bX.prototype.Jb;bX.prototype.getCreativeId=bX.prototype.getCreativeId;bX.prototype.getId=bX.prototype.getId;
|
|
89
89
|
bX.prototype.getTechnology=bX.prototype.pb;bX.prototype.getAdManagerVersion=bX.prototype.nb;bX.prototype.getAdManagerName=bX.prototype.lb;cX.prototype.getCuePoints=function(){return this.a.map(function(a){return a.position})};cX.prototype.ac=function(){return!!this.a.find(function(a){return 0===a.position})};cX.prototype.$b=function(){return!!this.a.find(function(a){return-1===a.position})};cX.prototype.hasPostroll=cX.prototype.$b;cX.prototype.hasPreroll=cX.prototype.ac;cX.prototype.getCuePoints=cX.prototype.getCuePoints;_.r=eX.prototype;_.r.load=function(){var a=this;return _.I(function(b){fX&&(fX=!1,lX(a,0));_.A(b)})};_.r.Cb=function(){return!0};_.r.Uc=function(){};_.r.rb=function(){-1!==this.getPosition()&&dX().pause()};_.r.skip=function(){};_.r.getAdVolume=function(){gX.warn(ZV);return 0};_.r.Pa=function(){gX.warn(ZV)};_.r.setMuted=function(){};_.r.isMuted=function(){return!1};_.r.Ab=function(){return-1!==this.getPosition()};_.r.isPaused=function(){return this.f};
|
|
90
90
|
_.r.getPosition=function(){var a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.h?a:-1};_.r.Rc=function(){return!0};_.r.Cc=function(){var a=this;return _.I(function(b){dX().removeEventListener(a.h,a.j);_.A(b)})};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.rb()};_.r.resume=function(){this.Cb()};
|
|
91
|
-
_.r.
|
|
91
|
+
_.r.Xk=function(a){var b=cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=dX().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.Q(_.Fc,{adsTimeline:new cX(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:kX(this,_.tc,a);break;case cast.framework.events.EventType.BREAK_STARTED:kX(this,_.ic,a);break;case cast.framework.events.EventType.BREAK_ENDED:kX(this,_.jc,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:kX(this,
|
|
92
92
|
_.Bc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(kX(this,_.Ac,a),kX(this,_.Cc,a)):a.endedReason===b.STOPPED?kX(this,_.Cc,a):a.endedReason===b.END_OF_STREAM?(kX(this,_.mc,a),kX(this,_.Cc,a)):a.endedReason===b.ERROR&&lX(this,1);break;case cast.framework.events.EventType.PLAYING:this.f=!1;kX(this,_.zc,a);break;case cast.framework.events.EventType.PAUSE:this.f=!0;kX(this,_.xc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?kX(this,_.kc,
|
|
93
93
|
a):(this.f=!1,kX(this,_.zc,a))}};eX.prototype.resume=eX.prototype.resume;eX.prototype.pause=eX.prototype.pause;eX.prototype.getVolume=eX.prototype.getVolume;eX.prototype.setVolume=eX.prototype.setVolume;eX.prototype.getPosition=eX.prototype.getPosition;eX.prototype.skip=eX.prototype.skip;var fX=!1,gX=new _.M("clpp.cast.ads.AdsManager");mX.prototype.init=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(nX(),this.f)};mX.prototype.release=function(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(nX(),this.f)};mX.prototype.getTimelineCues=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(function(a){return oX(a)})};
|
|
94
94
|
mX.prototype.h=function(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=_.xg;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.yg;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.zg}b&&this.a(new _.Q(b,{detail:oX(a.timedMetadataInfo)}))}else for(a=_.v(this.getTimelineCues()),b=a.next();!b.done;b=a.next())this.a(new _.Q(_.xg,{detail:b.value}))};_.w(pX,_.Ft);_.r=pX.prototype;_.r.initialize=function(a){this.m=a;qX().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.release=function(){this.h=[];this.j=[];this.a=this.f=null};_.r.load=function(){};_.r.destroy=function(){this.m=null;qX().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)};_.r.getVideoTracks=function(){return[]};_.r.getAudioTracks=function(){return this.h};_.r.ra=function(){return this.j};_.r.sa=function(){return null};
|
|
@@ -96,41 +96,41 @@ _.r.Za=function(){var a=this.qa();return a&&a.renditions[0]};_.r.hb=function(){v
|
|
|
96
96
|
_.r.wa=function(){var a=null;if(this.a){var b=this.a.getActiveIds()[0];typeof b===_.h&&(b=b.toString(),a=this.ra().find(function(c){return c.id===b})||null)}return a};_.r.Qb=function(){this.g.warn("Video tracks unavailable on Cast")};_.r.La=function(a){a&&this.f&&this.f.setActiveById(+a.id)};_.r.kb=function(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))};_.r.Db=function(){this.g.warn("Video renditions unavailable on Cast")};_.r.Ob=function(a){this.La(a&&a.track)};
|
|
97
97
|
_.r.Pb=function(a){this.kb(a&&a.track)};
|
|
98
98
|
_.r.addTextTrack=function(a){var b=this,c,d,e;return _.I(function(f){if(1==f.a)return c=b.m.getConfiguration(),_.y(f,eW(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]),sX(b)}catch(g){throw b.g.warn("failed on track",
|
|
99
|
-
a),g;}}_.A(f)})};_.r.xa=function(){return!0};_.r.
|
|
99
|
+
a),g;}}_.A(f)})};_.r.xa=function(){return!0};_.r.Jo=function(){this.f=qX().getAudioTracksManager();var a=this.f.getTracks();this.h=rX(_.X,a);sX(this);a=this.m.getConfiguration();tX(this,_.X,a.preferredAudioLanguage,a.preferredAudioRole);tX(this,_.jt,a.preferredTextLanguage,a.preferredTextRole)};pX.prototype.isAbrEnabled=pX.prototype.xa;pX.prototype.addTextTrack=pX.prototype.addTextTrack;pX.prototype.setTextRendition=pX.prototype.Pb;pX.prototype.setAudioRendition=pX.prototype.Ob;
|
|
100
100
|
pX.prototype.setVideoRendition=pX.prototype.Db;pX.prototype.setTextTrack=pX.prototype.kb;pX.prototype.setAudioTrack=pX.prototype.La;pX.prototype.setVideoTrack=pX.prototype.Qb;pX.prototype.getTextTrack=pX.prototype.wa;pX.prototype.getAudioTrack=pX.prototype.qa;pX.prototype.getVideoTrack=pX.prototype.Ra;pX.prototype.getLoadingTextRendition=pX.prototype.Yb;pX.prototype.getLoadingAudioRendition=pX.prototype.Xb;pX.prototype.getLoadingVideoRendition=pX.prototype.Hb;pX.prototype.getTextRendition=pX.prototype.hb;
|
|
101
|
-
pX.prototype.getAudioRendition=pX.prototype.Za;pX.prototype.getVideoRendition=pX.prototype.sa;pX.prototype.getTextTracks=pX.prototype.ra;pX.prototype.getAudioTracks=pX.prototype.getAudioTracks;pX.prototype.getVideoTracks=pX.prototype.getVideoTracks;_.w(uX,_.Ii);_.r=uX.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=vX();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.
|
|
101
|
+
pX.prototype.getAudioRendition=pX.prototype.Za;pX.prototype.getVideoRendition=pX.prototype.sa;pX.prototype.getTextTracks=pX.prototype.ra;pX.prototype.getAudioTracks=pX.prototype.getAudioTracks;pX.prototype.getVideoTracks=pX.prototype.getVideoTracks;_.w(uX,_.Ii);_.r=uX.prototype;_.r.init=function(a,b){var c=this;this.B=a;b&&(this.h=this.w=b);var d=vX();d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.Ok.bind(this));d.setMediaPlaybackInfoHandler(this.vk.bind(this));this.a=new MW(this);this.a.init();this.j=new pX;this.j.initialize(this);this.o=new mX(function(e){return c.trigger(e)});this.o.init()};
|
|
102
102
|
_.r.unload=function(){var a=cast.framework.messages.PlayerState,b=vX();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()};_.r.release=function(){var a=this;return this.unload().then(function(){a.a&&a.a.release()})};_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.B=null,a.w=_.Pn(),a.h=a.w,a.l=-1,a.A=null,a.a?_.y(b,a.a.destroy(),3):b.C(2);2!=b.a&&(a.a=null);a.j&&(a.j.destroy(),a.j=null);_.A(b)})};
|
|
103
103
|
_.r.play=function(){vX().play();return Promise.resolve()};_.r.pause=function(){vX().pause();return Promise.resolve()};_.r.isPaused=function(){return vX().getPlayerState()===cast.framework.messages.PlayerState.PAUSED};_.r.isEnded=function(){return vX().getPlayerState()===cast.framework.messages.PlayerState.IDLE};_.r.seek=function(a){var b=vX();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(LV);b.seek(a);return Promise.resolve()};_.r.getPosition=function(){return this.getMediaPosition()};
|
|
104
104
|
_.r.setSeekInterceptor=function(){};_.r.setPlaybackSessionId=function(){};_.r.getBandwidthEstimate=function(){return null};_.r.getMediaPosition=function(){return vX().getCurrentTimeSec()};_.r.getDuration=function(){return this.getMediaDuration()};_.r.getMediaDuration=function(){var a=vX().getDurationSec();return typeof a===_.h?-1===a?Infinity:a:-1};_.r.getPlaybackRate=function(){return vX().getPlaybackRate()};
|
|
105
105
|
_.r.setPlaybackRate=function(a){if(0<a){var b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;vX().sendLocalMediaRequest(b)}};_.r.getVolume=function(){this.g.warn(ZV);return null};_.r.setVolume=function(){this.g.warn(ZV)};_.r.setMuted=function(){this.g.warn(ZV)};_.r.isMuted=function(){this.g.warn(ZV);return!1};
|
|
106
|
-
_.r.getLoadedSource=function(){var a=vX().getMediaInformation();if(a){var b=vX().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,
|
|
106
|
+
_.r.getLoadedSource=function(){var a=vX().getMediaInformation();if(a){var b=vX().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,Xp:b,name:c}}return null};_.r.getDrmInfo=function(){return null};_.r.getPresentationStartTime=function(){return vX().getStartAbsoluteTime()};
|
|
107
107
|
_.r.getSeekRange=function(){var a={start:0,end:this.getDuration()};if(this.isLive()){var b=vX().getLiveSeekableRange();b&&typeof b.start===_.h&&typeof b.end===_.h&&(a={start:b.start,end:b.end})}return a};_.r.getState=function(){return this.a?this.a.getState():7};
|
|
108
108
|
_.r.getStats=function(){var a=_.lu();if(this.f){a=vX().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.h?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.h?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a};_.r.isLive=function(){return Infinity===this.getDuration()};
|
|
109
109
|
_.r.load=function(a){var b=this,c,d;return _.I(function(e){b.f=new _.ku;b.a.j=b.f.a;b.A=_.Vn(a);b.h=_.Rn([b.w,a]);if(b.D)return b.D=!1,e["return"]();c=b.A[b.l];d=new cast.framework.messages.LoadRequestData;d.autoplay=b.h.autoplay;typeof b.h.startTime===_.h&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:bW(b.h),local:!0};return _.y(e,vX().load(d),0)})};_.r.getBufferInfo=function(){this.g.warn(_.xa);return new _.mi};
|
|
110
110
|
_.r.getTrackManager=function(){return this.j};_.r.getConfiguration=function(){return this.h};_.r.getSurface=function(){return this.B};_.r.getTimeline=function(){return null};_.r.setupPlaylist=function(){return Promise.reject(_.nb)};_.r.appendLoad=function(){return Promise.reject(_.nb)};_.r.seekWith=function(){return Promise.reject(_.nb)};_.r.setNetworkEngine=function(a){this.G=a};_.r.setCmsdManager=function(){};_.r.getNetworkEngine=function(){return this.G};_.r.getSourceIndex=function(){return this.l};
|
|
111
111
|
_.r.setSourceIndex=function(a){this.l=a};_.r.getPeriods=function(){return[]};_.r.namespace=function(){return UV};_.r.getTimelineCues=function(){return this.o&&this.o.getTimelineCues()||[]};_.r.getCueTimeline=function(){return null};_.r.resetAbr=function(){this.g.warn(QV)};_.r.onError=function(a){this.trigger(new _.Q(_.qe,{detail:a}))};_.r.canPlay=function(){return _.sj()?2:0};
|
|
112
|
-
_.r.
|
|
112
|
+
_.r.Ok=function(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=bW(this.getStats());var b=vX(),c=a.media||b.getMediaInformation();b=b.getStartAbsoluteTime();c&&typeof b===_.h&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime.Old value: "+(c.startAbsoluteTime+", new value: ")+b),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));c=cast.framework.messages.StreamType;b=a.media;var d=!!b,e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&
|
|
113
113
|
(!e||e&&f)){d=vX().getStartAbsoluteTime();if(typeof d===_.h){b.startAbsoluteTime=d;var k;f?k=new cast.framework.messages.GenericMediaMetadata:k=b.metadata;k.sectionStartAbsoluteTime=d;b.metadata=k}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}return a};
|
|
114
|
-
_.r.
|
|
114
|
+
_.r.vk=function(a,b){var c=null,d=b;a.media.customData&&(c=cW(a.media.customData.playerConfiguration));var e=null,f=null;a.media.customData&&(e=cW(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),f=cW(a.media.customData.playerConfiguration));var g=e&&e.LiveConfiguration;g=g?0===g.liveEdgeLatencyMs:!1;e=!(!e||!e.lowLatencyMode);d=null!=f&&f.lowLatencyMode||g||e?wX(d,{streaming:{lowLatencyMode:!0}}):d;if(!c)return d;f=c.chromecast||null;e=c.abr||null;g=d;e&&typeof e.defaultBandwidthEstimate===
|
|
115
115
|
_.h?g.initialBandwidth=e.defaultBandwidthEstimate:g.initialBandwidth=void 0;zX(c,d);e={};g=c.streaming||null;f&&f.useSenderStreamingConfig&&g&&(e.streaming=dW(g,QX));c=c.abr||null;f&&f.useSenderAbrConfig&&c&&(e.abr=dW(c,RX));_.N.Zb(e)&&(d=wX(d,e));return d};_.r.getTextDisplayer=function(){return null};_.r.setDrmCustomDataModifier=function(){};_.r.setCdnErrorCallback=function(){};_.r.detach=function(){};_.r=AX.prototype;_.r.init=function(a){var b=this;a&&(this.f=new uX,_.Qo(a,this.f),this.m=a,this.l.on(window,"unload",function(){return _.I(function(c){return b.m&&b.m.getState()!==_.mu?_.y(c,$V(b.m),0):c.C(0)})}))};
|
|
116
|
-
_.r.start=function(a){var b=this;if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var c=DX(),d=DX().getPlayerManager(),e=new cast.framework.CastReceiverOptions;a&&null!=a.useShakaForHls&&(e.useShakaForHls=a.useShakaForHls);e.customNamespaces={};e.customNamespaces[WV]=cast.framework.system.MessageType.JSON;e.customNamespaces[XV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.
|
|
117
|
-
a.enableSmoothLiveRefresh=!0;e.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())e.mediaElement=a;e.disableIdleTimeout=!0;e.maxInactivity=Infinity;this.h&&(e.queue=this.h);d.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,function(f){b.g.info("QUEUE_UPDATE message received",f);var g=b.getQueueManager();if(!g)return f;g=g.getCurrentItem();return g?(g=g.customData)&&!1===g.skippable?null:f:f});d.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.
|
|
118
|
-
d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.
|
|
119
|
-
_.r.stop=function(){if(this.a){this.a=!1;this.l.release();var a=DX();DX().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.D);a.removeCustomMessageListener(WV,this.B);a.stop();this.j=this.h=this.m=this.f=null}};_.r.
|
|
120
|
-
_.r.removeMessageListener=function(a){typeof a===_.ue&&this.w["delete"](a)};_.r.sendMessage=function(a,b){DX().sendCustomMessage(WV,b,a)};_.r.Od=function(){return this.a};_.r.
|
|
121
|
-
_.r.
|
|
122
|
-
_.r.
|
|
116
|
+
_.r.start=function(a){var b=this;if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var c=DX(),d=DX().getPlayerManager(),e=new cast.framework.CastReceiverOptions;a&&null!=a.useShakaForHls&&(e.useShakaForHls=a.useShakaForHls);e.customNamespaces={};e.customNamespaces[WV]=cast.framework.system.MessageType.JSON;e.customNamespaces[XV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.nn.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};
|
|
117
|
+
a.enableSmoothLiveRefresh=!0;e.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())e.mediaElement=a;e.disableIdleTimeout=!0;e.maxInactivity=Infinity;this.h&&(e.queue=this.h);d.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,function(f){b.g.info("QUEUE_UPDATE message received",f);var g=b.getQueueManager();if(!g)return f;g=g.getCurrentItem();return g?(g=g.customData)&&!1===g.skippable?null:f:f});d.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.mn.bind(this));
|
|
118
|
+
d.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.qn.bind(this));d.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.D);d.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.Qk.bind(this));c.start(e);c.addCustomMessageListener(WV,this.B);this.l.on(document,_.Zg,function(){var f={type:"event",name:_.Zg,visible:!document.hidden};DX().sendCustomMessage(XV,void 0,f)})}};
|
|
119
|
+
_.r.stop=function(){if(this.a){this.a=!1;this.l.release();var a=DX();DX().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.D);a.removeCustomMessageListener(WV,this.B);a.stop();this.j=this.h=this.m=this.f=null}};_.r.Ze=function(a){this.o=a};_.r.$o=function(a){this.A=a};_.r.on=function(a,b){DX().addEventListener(a,b)};_.r.off=function(a,b){DX().removeEventListener(a,b)};_.r.addMessageListener=function(a){typeof a===_.ue&&this.w.add(a)};
|
|
120
|
+
_.r.removeMessageListener=function(a){typeof a===_.ue&&this.w["delete"](a)};_.r.sendMessage=function(a,b){DX().sendCustomMessage(WV,b,a)};_.r.Od=function(){return this.a};_.r.Tg=function(){return this.a};_.r.Vb=function(){return EX()};_.r.uc=function(a){FX(this,a)};_.r.vp=function(a){var b=EX(),c=null;a?c=Object.assign({},b,a):c=b;FX(this,c)};_.r.bp=function(a){this.h=a;this.j=null};_.r.getQueueManager=function(){return DX().getPlayerManager().getQueueManager()};
|
|
121
|
+
_.r.Qk=function(){var a=this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,DX().sendCustomMessage(WV,void 0,{type:PV,index:a})))};
|
|
122
|
+
_.r.nn=function(a){a=a.trim();if(a.startsWith("#EXTM3U"))return HX(this,a);try{var b=(new DOMParser).parseFromString(a,_.vg)}catch(t){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=DX();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===_.Tg||g===_.Sc){g=e[f].getAttribute(_.Ue);for(var k=e[f].getElementsByTagName(_.Ab),l=
|
|
123
123
|
k.length-1;0<=l;--l){var m=k[l].getAttribute(_.Ue)||g,n=k[l].getAttribute(_.Fd),p=k[l].getAttribute(_.hh)||void 0,q=k[l].getAttribute(_.ve)||void 0;void 0!==p&&(p=+p);void 0!==q&&(q=+q);b.canDisplayType(m,n,p,q)||e[f].removeChild(k[l])}e[f].getElementsByTagName(_.Ab).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ka).length||a.removeChild(c[d])}return(new XMLSerializer).serializeToString(a)}if(c=b.getElementsByTagName(_.Jb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=DX();c=a.getElementsByTagName("StreamIndex");
|
|
124
124
|
for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.Tg){e=c[d].getElementsByTagName(_.yb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.eb)||void 0,k=e[f].getAttribute(_.db)||void 0,void 0!==g&&(g=+g),void 0!==k&&(k=+k),b.canDisplayType(_.Vg,void 0,g,k)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.yb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a};
|
|
125
|
-
_.r.
|
|
125
|
+
_.r.mn=function(a){var b=this,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:c=a;c.media.customData&&(d=cW(c.media.customData.playerConfiguration));if(!b.m||!d){l.C(2);break}if(!b.o){l.C(3);break}return _.y(l,Promise.resolve(b.o(d)),4);case 4:d=(e=l.f)||d;case 3:if(!d.ima){l.C(5);break}return _.y(l,iX(c.media,d.ima,b.m.getNetworkEngine()),5);case 5:typeof d.startTime===_.h&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;if(c.media.customData.local){l.C(7);
|
|
126
126
|
break}b.f.D=!0;return _.y(l,_.$o(b.m,d),8);case 8:return _.y(l,_.ap(b.m),9);case 9:f=b.m.ab(),c.media.contentId=f.url,c.media.contentType=f.type,f.xc&&(c.media.hlsVideoSegmentFormat=fW(f.xc,_.kt)),f.wb&&(c.media.hlsSegmentFormat=fW(f.wb,_.X));case 7:if((g=c.media.metadata)&&typeof g.sectionStartAbsoluteTime===_.h){var m=g.sectionStartAbsoluteTime;g.sectionStartAbsoluteTime=0===m?1E-8:m}void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay);case 2:if(!b.A){l.C(10);break}return _.y(l,Promise.resolve(b.A(c)),
|
|
127
|
-
11);case 11:(k=l.f)&&(c=k);case 10:return l["return"](c)}})};_.r.
|
|
128
|
-
_.r.
|
|
129
|
-
AX.prototype.setQueue=AX.prototype.
|
|
130
|
-
AX.prototype.setLoadRequestDataInterceptor=AX.prototype
|
|
127
|
+
11);case 11:(k=l.f)&&(c=k);case 10:return l["return"](c)}})};_.r.qn=function(a){var b=a.media;b&&b.tracks&&b.tracks.length&&IX(b.tracks);if((b=a.items)&&b.length){b=_.v(b);for(var c=b.next();!c.done;c=b.next())(c=(c=c.value)&&c.media)&&c.tracks&&c.tracks.length&&IX(c.tracks)}return a};
|
|
128
|
+
_.r.Wn=function(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){a=_.N.Zm;var b=DX().getPlayerManager(),c=b.getLiveSeekableRange();if(c){var d=c.start;c=c.end;var e=this.m.getConfiguration().startTime;typeof d!==_.h||typeof c!==_.h||typeof e!==_.h||a(e,d,c)||(b=b.getMediaTimeForAbsoluteTime(e),typeof b===_.h&&a(b,d,c)&&this.m.setPosition(b))}_.Vo(this.m)}};_.r.Pk=function(a){this.w.forEach(function(b){return b(a.data)})};_.K(VV,AX);AX.prototype.getQueueManager=AX.prototype.getQueueManager;
|
|
129
|
+
AX.prototype.setQueue=AX.prototype.bp;AX.prototype.updateContentMetadata=AX.prototype.vp;AX.prototype.setContentMetadata=AX.prototype.uc;AX.prototype.getContentMetadata=AX.prototype.Vb;AX.prototype.isApiReady=AX.prototype.Od;AX.prototype.sendMessage=AX.prototype.sendMessage;AX.prototype.removeMessageListener=AX.prototype.removeMessageListener;AX.prototype.addMessageListener=AX.prototype.addMessageListener;AX.prototype.off=AX.prototype.off;AX.prototype.on=AX.prototype.on;
|
|
130
|
+
AX.prototype.setLoadRequestDataInterceptor=AX.prototype.$o;AX.prototype.setPlayerConfigInterceptor=AX.prototype.Ze;AX.prototype.stop=AX.prototype.stop;AX.prototype.start=AX.prototype.start;AX.prototype.init=AX.prototype.init;AX.getInstance=CX;var BX=null;_.r=KX.prototype;_.r.load=function(){return _.I(function(a){_.A(a)})};_.r.Cb=function(){return!0};_.r.Uc=function(){};_.r.rb=function(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()};_.r.skip=function(){var a=this.h.a;a&&this.h.sendMessage(YV,{type:"SKIP_AD",requestId:iW(),mediaSessionId:a.mediaSessionId})};_.r.getAdVolume=function(){return this.h.getVolume()||0};_.r.Pa=function(a){this.h.setVolume(a)};_.r.setMuted=function(a){this.h.setMuted(a)};_.r.isMuted=function(){return!!this.h.isMuted()};
|
|
131
131
|
_.r.Ab=function(){return this.a?this.a.isPlayingBreak:!1};_.r.isPaused=function(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1};_.r.getPosition=function(){var a=-1,b=this.h.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.h&&(a=b));return a};_.r.Rc=function(){return!0};_.r.Cc=function(){var a=this;return _.I(function(b){a.j.release();_.A(b)})};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.rb()};_.r.resume=function(){this.Cb()};
|
|
132
|
-
_.r.
|
|
133
|
-
default:this.f||(this.f=MX(this))&&LX(this,_.Bc,this.f)}};KX.prototype.resume=KX.prototype.resume;KX.prototype.pause=KX.prototype.pause;KX.prototype.getVolume=KX.prototype.getVolume;KX.prototype.setVolume=KX.prototype.setVolume;KX.prototype.getPosition=KX.prototype.getPosition;KX.prototype.skip=KX.prototype.skip;NX.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};NX.prototype.a=function(a,b){return a.namespace()!==_.xd?!1:!(!b||!b.ima)};NX.prototype.create=function(a){return new KX(a.a)};OX.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};OX.prototype.a=function(a,b){return CX().
|
|
132
|
+
_.r.po=function(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.h.trigger(new _.Q(_.Fc,{adsTimeline:new cX(a.breaks)})));break;case "isPlayingBreak":a.value?LX(this,_.ic):(LX(this,_.mc,this.f),LX(this,_.Cc,this.f),this.f=null,LX(this,_.jc));break;case "isPaused":this.f&&(a.value?LX(this,_.xc):LX(this,_.zc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(LX(this,_.mc,this.f),LX(this,_.Cc,this.f),this.f=MX(this),LX(this,_.Bc,this.f)));break;
|
|
133
|
+
default:this.f||(this.f=MX(this))&&LX(this,_.Bc,this.f)}};KX.prototype.resume=KX.prototype.resume;KX.prototype.pause=KX.prototype.pause;KX.prototype.getVolume=KX.prototype.getVolume;KX.prototype.setVolume=KX.prototype.setVolume;KX.prototype.getPosition=KX.prototype.getPosition;KX.prototype.skip=KX.prototype.skip;NX.prototype.name=function(){return"clpp.cast.ads.SenderAdsManagerFactory"};NX.prototype.a=function(a,b){return a.namespace()!==_.xd?!1:!(!b||!b.ima)};NX.prototype.create=function(a){return new KX(a.a)};OX.prototype.name=function(){return"clpp.cast.ads.AdsManagerFactory"};OX.prototype.a=function(a,b){return CX().Tg()?!(!b||!b.ima):!1};OX.prototype.create=function(a){return new eX(a)};_.K("clpp.cast.createCastQueue",function(){PX=function(){return cast.framework.QueueBase.apply(this,arguments)||this};_.w(PX,cast.framework.QueueBase);PX.prototype.initialize=function(a){var b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b};return new PX});_.ki(new NX);_.ki(new OX);};
|
|
134
134
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
135
135
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
136
136
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.cdn.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var FV="clpp.cdn.CdnChallengeComponent",GV=function(){this.g=new _.M(FV);this.
|
|
3
|
-
|
|
4
|
-
t
|
|
2
|
+
var f=function(window){var FV="clpp.cdn.CdnChallengeComponent",GV=function(){this.g=new _.M(FV);this.a=new WeakMap},KV=function(a,b,c){var d,e,f,g,k,l,m,n,p,q,t,u,z,B,D,C,E;return _.I(function(x){switch(x.a){case 1:d=b.headers["x-drm-challenge-data"];e=b.headers["x-drm-challenge-token"];if(!d||!e)throw a.g.warn("428 received but missing challenge headers"),Error("428 challenge headers missing");a.g.info("428 challenge received");f=c.yf.onChallengeStart;typeof f===_.ue&&f();g=HV(d);_.F(x,2);return _.y(x,IV(g),4);case 4:k=
|
|
3
|
+
x.f;_.G(x,3);break;case 2:throw l=_.H(x),a.g.error("Failed to create CDM challenge session",l),l;case 3:return m=b.uri||b.request.uris[0],_.F(x,5),_.y(x,c.yf.getAuthToken(),7);case 7:n=x.f;_.G(x,6);break;case 5:throw p=_.H(x),a.g.error("getAuthToken() failed",p),p;case 6:return _.F(x,8),_.y(x,window.fetch(m,{headers:{"x-drm-license-request":JV(k),"x-drm-challenge-token":e,Authorization:"Bearer "+n}}),10);case 10:q=x.f;_.G(x,9);break;case 8:throw t=_.H(x),a.g.error("Manifest retry fetch failed",t),
|
|
4
|
+
t;case 9:if(!q.ok)throw a.g.error("Manifest retry returned "+q.status),Error("CDN challenge retry failed: "+q.status);u=q.headers.get("x-cat");z=q.headers.get(_.oh);B=q.headers.get(_.nh);u&&(c.ff=u);D=c.yf.onCatReceived;u&&typeof D===_.ue&&D(u);C=c.yf.onChallengeComplete;typeof C===_.ue&&C({nq:z,mq:B,ff:u});E=b;return _.y(x,q.arrayBuffer(),11);case 11:return E.data=x.f,b.status=q.status,q.headers.forEach(function(J,L){b.headers[L.toLowerCase()]=J}),a.g.info("428 challenge complete"),x["return"](b)}})},
|
|
5
5
|
HV=function(a){a=atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return b.buffer},JV=function(a){var b="";_.Vi(a).forEach(function(c){b+=String.fromCharCode(c)});return btoa(b)},IV=function(a){var b,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:return b=[{initDataTypes:[_.md],videoCapabilities:[{contentType:'video/mp4; codecs\x3d"avc1.42E01E"',robustness:_.Cb}],audioCapabilities:[{contentType:'audio/mp4; codecs\x3d"mp4a.40.2"',
|
|
6
6
|
robustness:_.Cb}]}],_.F(l,2),_.y(l,navigator.requestMediaKeySystemAccess(_.Md,b),4);case 4:c=l.f;_.G(l,3);break;case 2:throw d=_.H(l),Error("CDN challenge requires Widevine but requestMediaKeySystemAccess failed: "+d.message);case 3:return _.y(l,c.createMediaKeys(),5);case 5:e=l.f;f=_.cq.V2;if(!f){l.C(6);break}return _.y(l,e.setServerCertificate(new Uint8Array(f)),6);case 6:return g=e.createSession(_.sg),_.y(l,new Promise(function(m,n){var p=window.setTimeout(function(){n(Error("CDM challenge session timed out"))},
|
|
7
7
|
1E4);g.addEventListener(_.Re,function(q){window.clearTimeout(p);m(q.message)});g.generateRequest(_.md,a)["catch"](function(q){window.clearTimeout(p);n(q)})}),8);case 8:return k=l.f,g.close()["catch"](function(){}),l["return"](k)}})};_.w(GV,_.jv);GV.prototype.id=function(){return"cdn-challenge"};
|
|
8
|
-
GV.prototype.beforeLoad=function(a){var b=this,c=a.getConfiguration(),d=c.drm&&c.drm.customData&&c.drm.customData.cdn;if(d&&typeof d.getAuthToken===_.ue){if(c=this.
|
|
9
|
-
null});return
|
|
8
|
+
GV.prototype.beforeLoad=function(a){var b=this,c=a.getConfiguration(),d=c.drm&&c.drm.customData&&c.drm.customData.cdn;if(d&&typeof d.getAuthToken===_.ue){if(c=this.a.get(a)){var e=a.getNetworkEngine();c.hg&&e.mh(c.hg);c.ig&&e.We(c.ig);this.a["delete"](a)}var f={ff:null,ke:null,yf:d,hg:null,ig:null};c=a.getNetworkEngine();f.hg=function(g){!f.ff||1!==g.type&&2!==g.type||(g.headers["x-cat"]=f.ff)};f.ig=function(g){if(428===g.status&&g.request&&1===g.request.type){if(f.ke)return f.ke;f.ke=KV(b,g,f)["finally"](function(){f.ke=
|
|
9
|
+
null});return f.ke}if(g.request&&3===g.request.type&&(g=g.headers["x-cat"])){f.ff=g;var k=d.onCatReceived;typeof k===_.ue&&k(g)}};c.wg(f.hg);c.yd(f.ig);this.a.set(a,f)}};_.K(FV,GV);};
|
|
10
10
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
11
11
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
12
12
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.conviva.js
CHANGED
|
@@ -6,30 +6,30 @@ b;e[Conviva.Constants.IS_LIVE]=iV(!!d);e[Conviva.Constants.ASSET_NAME]=eV;a&&(e[
|
|
|
6
6
|
Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=kV(a.lb()),e["c3.ad.adManagerVersion"]=kV(a.nb()),e["c3.ad.advertiserCategory"]=kV(null),e["c3.ad.advertiserId"]=kV(null),e["c3.ad.breakId"]=kV(null),e["c3.ad.campaignName"]=kV(null),e["c3.ad.category"]=kV(null),e["c3.ad.classification"]=kV(null),e["c3.ad.creativeName"]=kV(null),e["c3.ad.sequence"]=kV(a.ob()),e["c3.ad.sessionStartEvent"]=kV(null),e["c3.ad.unitName"]=kV(null),e["c3.ad.dayPart"]=kV(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"]=kV(b),e["c3.ad.firstAdSystem"]=kV(c),e["c3.ad.firstCreativeId"]=kV(a));return e},kV=function(a){return a?""+a:"NA"},mV=function(a,b){this.m=a;this.B=b;this.A="";this.w=_.ya;this.g=new _.M("clpp.conviva.ad");this.f=new _.Bi;this.a=null;this.j=this.l=this.o=this.h=!1},nV=function(a,b){if(!a.l){a.j=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.B()),
|
|
8
8
|
b){var c=lV(b,a.A,a.w,a.m.isLive()),d=String(b.nb()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.lb();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)}}},qV=function(a,b,c){c=void 0===c?eV:c;if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case oV:a.a.reportAdFailed(c,lV(null,a.A,a.w));break;case pV:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();
|
|
9
|
-
a.a=null;a.h=!1}},rV=function(a){a.f.on(a.m,_.ic,a.
|
|
9
|
+
a.a=null;a.h=!1}},rV=function(a){a.f.on(a.m,_.ic,a.Yk.bind(a));a.f.on(a.m,_.jc,a.Zk.bind(a));a.f.on(a.m,_.Bc,a.gl.bind(a));a.f.on(a.m,_.yc,a.Wf.bind(a));a.f.on(a.m,_.xc,a.Wf.bind(a));a.f.on(a.m,_.zc,a.Wf.bind(a));a.f.on(a.m,_.kc,a.Wf.bind(a));a.f.on(a.m,_.Cc,a.hl.bind(a));a.f.on(a.m,_.Ac,a.fl.bind(a));a.f.on(a.m,_.lc,a.$k.bind(a));a.f.on(a.m,_.rc,a.cl.bind(a));a.f.on(a.m,_.tc,a.el.bind(a));a.f.on(a.m,_.nc,a.al.bind(a));a.f.on(a.m,_.vc,a.Bn.bind(a));a.f.on(a.m,_.Dc,a.il.bind(a));a.f.on(a.m,_.qe,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=eV}null===a.a&&nV(a,null);a.a.reportAdError(c,b.FATAL);a.j=!0;a.g.debug("Ad Playback Failure");qV(a,oV,c)}})},sV=function(a,b){this.m=a;this.f=new _.Bi;this.a=null;this.o=!1;this.H=!0;this.B=this.h=this.A=this.D=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
|
tV=function(a){if(!a.l&&a.a){var b=iV(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},uV=function(a){return null!==a.a&&a.D},vV=function(a){return a.m.getConfiguration().autoplay||!1},wV=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(hV(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]=_.ya;c[Conviva.Constants.FRAMEWORK_VERSION]=_.ia;a.a.setPlayerInfo(c)},xV=function(a){if(!a.l)if(a.D)a.g.warn("Current session still active. No-op.");else{var b=a.m.ab()||a.L,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||"N/A",e=c&&c.defaultResource||
|
|
13
13
|
"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.zn(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.An(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.ya;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.N.R(c.customTags))for(var k in c.customTags)f[k]=c.customTags[k];a.a.reportPlaybackRequested(f);a.a.setCallback(function(){a.g.debug("reportMiscellaneousMetrics()");if(uV(a)){var l=1E3*a.m.getPosition();
|
|
14
|
-
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.D=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.
|
|
14
|
+
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.D=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.Gi(l.args)}));a.j=[]}},yV=function(a){a.g.debug("terminateSession()");a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED),
|
|
15
15
|
a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.D=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.M=0,a.K=!1,a.j=[],a.I=0)},zV=function(){this.h=this.f=null;this.a=!1;this.g=new _.M("clpp.conviva")},AV=function(a){var b=[];typeof a===_.$e&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.O(1,9,9001,{missingKeys:b});},CV=function(a,b){var c=b.getConfiguration();a.a=!_.N.R(c.conviva)&&typeof c.conviva===_.$e;a.a?"undefined"===typeof window.Conviva?
|
|
16
|
-
(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.O(1,9,9E3),BV(b,c)):b.namespace()===_.xd&&(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.")},BV=function(a,b){a.trigger(new _.Q(_.qe,{detail:b}))},DV=function(){};_.r=mV.prototype;_.r.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.ya;rV(this)};_.r.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.ma):(_.Ei(this.f),this.a&&qV(this,EV),this.f.release(),this.o=!0,this.h=this.j=!1)};_.r.destroy=function(){this.g.debug(_.Vd);this.l?this.g.debug(_.la):this.l=!0};_.r.
|
|
17
|
-
_.r.
|
|
18
|
-
_.r.
|
|
19
|
-
_.r
|
|
20
|
-
_.r.
|
|
21
|
-
_.r.
|
|
22
|
-
_.r.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.N.xb(b),this.L=c,this.m=a,wV(this,this.G),this.f.on(this.m,_.pf,this.
|
|
23
|
-
this.f.on(this.m,_.qe,this.
|
|
24
|
-
_.r.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};_.r.
|
|
25
|
-
_.r.
|
|
16
|
+
(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.O(1,9,9E3),BV(b,c)):b.namespace()===_.xd&&(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.")},BV=function(a,b){a.trigger(new _.Q(_.qe,{detail:b}))},DV=function(){};_.r=mV.prototype;_.r.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.ya;rV(this)};_.r.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.ma):(_.Ei(this.f),this.a&&qV(this,EV),this.f.release(),this.o=!0,this.h=this.j=!1)};_.r.destroy=function(){this.g.debug(_.Vd);this.l?this.g.debug(_.la):this.l=!0};_.r.Yk=function(){this.g.debug(fV)};_.r.Zk=function(){this.g.debug(gV)};
|
|
17
|
+
_.r.gl=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"),nV(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.fb(),a.eb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.Ga())};
|
|
18
|
+
_.r.Wf=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 _.yc:case _.zc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.xc:c(Conviva.Constants.PlayerState.PAUSED);break;case _.kc:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.r.hl=function(){this.g.debug("onAdStopped()");this.a&&!this.j&&qV(this,EV)};_.r.fl=function(){this.g.debug("onAdSkipped()");this.a&&qV(this,pV)};
|
|
19
|
+
_.r.$k=function(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.r.cl=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
|
+
_.r.el=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,nV(b,c);else this.f.on(this.m,_.Bg,function(){b.m.getPosition()>=b.m.getDuration()-5&&(b.f.off(b.m,_.Bg),b.h=!0,nV(b,c))})};_.r.al=function(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.r.Bn=function(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
|
|
21
|
+
_.r.il=function(){this.g.debug("onAdThirdQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)};var pV=0,EV=1,oV=2;_.r=sV.prototype;
|
|
22
|
+
_.r.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.N.xb(b),this.L=c,this.m=a,wV(this,this.G),this.f.on(this.m,_.pf,this.co.bind(this)),this.f.on(this.m,_.kg,this.nl.bind(this)),this.f.on(this.m,_.bd,this.bi.bind(this)),this.f.on(this.m,_.Og,this.ml.bind(this)),this.f.on(this.m,_.Ng,this.ll.bind(this)),this.f.on(this.m,_.ic,this.jl.bind(this)),this.f.on(this.m,_.jc,this.kl.bind(this)),this.f.on(this.m,_.Fc,this.Hn.bind(this)),this.f.on(this.m,_.ad,this.In.bind(this)),
|
|
23
|
+
this.f.on(this.m,_.qe,this.ci.bind(this)),vV(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),xV(this)))};_.r.release=function(){this.g.debug("Release conviva");this.H?this.g.debug(_.ma):(_.Ei(this.f),uV(this)||this.o||!vV(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),uV(this)&&yV(this),this.a=null,this.H=!0)};_.r.destroy=function(){this.g.debug(_.Vd);this.l?this.g.debug(_.la):this.l=!0};
|
|
24
|
+
_.r.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};_.r.co=function(){this.g.debug("onPlayRequest()");uV(this)||vV(this)?uV(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),uV(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"),xV(this))};
|
|
25
|
+
_.r.nl=function(a){function b(d){if(c.o&&(c.g.debug("Creating conviva session (On Seek / Replay)"),wV(c,c.G),xV(c),tV(c),uV(c))){var e=c.m.getTrackManager();e=e.sa()||e.Hb();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)}uV(c)&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,d)}var c=this;this.g.debug(_.ff);switch(a.detail.currentState){case 3:b(Conviva.Constants.PlayerState.PLAYING);
|
|
26
26
|
break;case 4:b(Conviva.Constants.PlayerState.PAUSED);break;case 2:b(Conviva.Constants.PlayerState.BUFFERING);break;case 5:this.g.debug("onVideoEnded()"),uV(this)&&(this.w&&this.w.$b()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.K=!0):yV(this))}};
|
|
27
|
-
_.r.
|
|
28
|
-
_.r.
|
|
29
|
-
_.r.
|
|
30
|
-
b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")};_.r.
|
|
31
|
-
_.r.
|
|
32
|
-
args:a})}};_.r.
|
|
27
|
+
_.r.bi=function(a){this.g.debug(_.af);if(uV(this)){if(a=a.detail,typeof a.width===_.h&&typeof a.height===_.h&&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({Gi:this.bi.bind(this),args:a})};
|
|
28
|
+
_.r.ml=function(){this.g.debug("onSeeking()");uV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)};_.r.ll=function(){this.g.debug("onSeeked()");uV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)};_.r.Hn=function(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a};
|
|
29
|
+
_.r.jl=function(a){this.g.debug(fV);var b=a.ad;a=0===b.Ha();var c=jV(b.getPodIndex());uV(this)||vV(this)||!a||xV(this);if(uV(this)){a=0===b.pb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;var d=0,e={};1===b.gb()&&(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||_.sj()?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")};_.r.kl=function(){this.g.debug(gV);uV(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.K&&yV(this))};
|
|
31
|
+
_.r.ci=function(a){this.g.debug(_.cf);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,uV(this)||xV(this));uV(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,yV(this))):this.j.push({Gi:this.ci.bind(this),
|
|
32
|
+
args:a})}};_.r.In=function(){this.g.debug("onAutoPlayBlocked()");uV(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,uV(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))};_.r=zV.prototype;_.r.onPlayerCreated=function(a){this.f=new sV(a,this.g)};_.r.onContentWillLoad=function(a,b){var c=this;CV(this,a);if(this.a){var d=a.getConfiguration();d=_.N.xb(d.conviva||{});try{AV(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.h=new mV(a,function(){return c.f.a}),this.h.initialize(d))}catch(f){f instanceof _.O?BV(a,f):BV(a,new _.O(1,9,9002,f,f))}}};_.r.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&tV(this.f)};
|
|
33
33
|
_.r.onPlayerWillDestroy=function(){this.a&&(this.a=!1,this.f.destroy(),this.f=null,this.h&&(this.h.destroy(),this.h=null))};_.r.onPlayerWillRelease=function(){this.a&&(this.f.release(),this.h&&this.h.release())};_.r.id=function(){return"conviva"};_.r.reportAppEvent=function(a,b){return this.f?this.f.reportAppEvent(a,b):!1};_.K("clpp.conviva.ConvivaPlugin",zV);zV.prototype.reportAppEvent=zV.prototype.reportAppEvent;zV.Id="conviva";DV.prototype.create=function(){return new zV};_.fp(new DV);};
|
|
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;});}
|