@castlabs/prestoplay 6.27.0 → 6.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +113 -112
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +625 -624
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +89 -89
- package/cjs/cl.externs.js +80 -72
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +78 -79
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +23 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +347 -347
- package/cjs/cl.muxdata.js +14 -15
- package/cjs/cl.onboard.js +4 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -17
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +38 -38
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -5
- package/cl.cast.js +91 -90
- package/cl.conviva.js +27 -27
- package/cl.core.js +503 -499
- package/cl.crypto.js +8 -8
- package/cl.dash.js +83 -82
- package/cl.externs.js +80 -72
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +80 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +2 -3
- package/cl.mse.js +304 -305
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -29
- package/package.json +1 -1
- package/typings.d.ts +34 -65
- package/cjs/cl.sessions.js +0 -21
- package/cl.sessions.js +0 -10
package/cjs/cl.conviva.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
_.
|
|
4
|
-
a.deviceType||d);b(Conviva.Constants.DeviceMetadata.OS_NAME,f);b(Conviva.Constants.DeviceMetadata.OS_VERSION,c);b(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||e);b(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||g);return h},
|
|
5
|
-
b;e[Conviva.Constants.IS_LIVE]=
|
|
6
|
-
Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=
|
|
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"]=
|
|
8
|
-
b){var c=
|
|
9
|
-
a.a=null;a.h=!1}},
|
|
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=
|
|
11
|
-
|
|
12
|
-
null,c);Conviva.Analytics.setDeviceMetadata(
|
|
13
|
-
"N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.
|
|
14
|
-
1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=a.m.getStats()){l=l.decodedFrames;var m=l-a.I;a.I=l;isFinite(m)&&(a.g.debug("Current FPS",m),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,m))}}});a.F=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.
|
|
15
|
-
Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.F=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.
|
|
16
|
-
_.
|
|
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=_.
|
|
23
|
-
this.f.on(this.m,_.
|
|
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.
|
|
26
|
-
break;case
|
|
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
|
|
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};_.
|
|
2
|
+
var f=function(window){var cV="Ad Error",dV="onAdBreakStarted()",eV="onAdBreakStopped()",fV=function(a){function b(l,m){l in h||!m||(h[l]=m)}var c=_.Jj(),d=Conviva.Constants.DeviceType.DESKTOP,e=Conviva.Constants.DeviceCategory.WEB,f=c.os;c=c.osVersion.name;var g="";_.nj()&&(g="Apple");_.mj()?(g="Google",d=Conviva.Constants.DeviceType.SETTOP,e=Conviva.Constants.DeviceCategory.CHROMECAST):_.oj()?(d=Conviva.Constants.DeviceType.MOBILE,/(android)/i.test(navigator.userAgent)?e=Conviva.Constants.DeviceCategory.ANDROID_DEVICE:
|
|
3
|
+
_.nj()&&(e=Conviva.Constants.DeviceCategory.APPLE_DEVICE)):_.jj()||_.ij()||_.hj("Hisense")?(d=Conviva.Constants.DeviceType.SMARTTV,e=Conviva.Constants.DeviceCategory.SMART_TV,_.jj()?(c="",g="LG",e=Conviva.Constants.DeviceCategory.LG_TV):_.ij()?(g="Samsung",e=Conviva.Constants.DeviceCategory.SAMSUNG_TV):_.hj("Hisense")&&(c="",g="Hisense")):_.hj("Xbox One")&&(g="Microsoft",d=Conviva.Constants.DeviceType.CONSOLE,e=Conviva.Constants.DeviceCategory.XBOX);var h=a.deviceMetadata||{};b(Conviva.Constants.DeviceMetadata.TYPE,
|
|
4
|
+
a.deviceType||d);b(Conviva.Constants.DeviceMetadata.OS_NAME,f);b(Conviva.Constants.DeviceMetadata.OS_VERSION,c);b(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||e);b(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||g);return h},gV=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},hV=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},jV=function(a,b,c,d){var e={};e[Conviva.Constants.PLAYER_NAME]=c;e[Conviva.Constants.VIEWER_ID]=
|
|
5
|
+
b;e[Conviva.Constants.IS_LIVE]=gV(!!d);e[Conviva.Constants.ASSET_NAME]=cV;a&&(e[Conviva.Constants.ASSET_NAME]=a.getTitle(),e[Conviva.Constants.STREAM_URL]=a.getMediaUrl(),e[Conviva.Constants.DURATION]=a.getDuration(),e["c3.ad.id"]=iV(a.getId()),e["c3.ad.creativeId"]=iV(a.getCreativeId()),e["c3.ad.system"]=iV(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=iV(a.getApiFramework()),e["c3.ad.advertiser"]=iV(a.getAdvertiserName()),e["c3.ad.position"]=hV(a.getPodIndex()),e["c3.ad.technology"]=0===a.Bb()?
|
|
6
|
+
Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=iV(a.vb()),e["c3.ad.adManagerVersion"]=iV(a.wb()),e["c3.ad.advertiserCategory"]=iV(null),e["c3.ad.advertiserId"]=iV(null),e["c3.ad.breakId"]=iV(null),e["c3.ad.campaignName"]=iV(null),e["c3.ad.category"]=iV(null),e["c3.ad.classification"]=iV(null),e["c3.ad.creativeName"]=iV(null),e["c3.ad.sequence"]=iV(a.zb()),e["c3.ad.sessionStartEvent"]=iV(null),e["c3.ad.unitName"]=iV(null),e["c3.ad.dayPart"]=iV(null),
|
|
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"]=iV(b),e["c3.ad.firstAdSystem"]=iV(c),e["c3.ad.firstCreativeId"]=iV(a));return e},iV=function(a){return a?""+a:"NA"},kV=function(a,b){this.m=a;this.B=b;this.A="";this.w=_.xa;this.g=new _.L("clpp.conviva.ad");this.f=new _.ti;this.a=null;this.j=this.l=this.o=this.h=!1},lV=function(a,b){if(!a.l){a.j=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.B()),
|
|
8
|
+
b){var c=jV(b,a.A,a.w,a.m.isLive()),d=String(b.wb()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.vb();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)}}},oV=function(a,b,c){c=void 0===c?cV:c;if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case mV:a.a.reportAdFailed(c,jV(null,a.A,a.w));break;case nV:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();
|
|
9
|
+
a.a=null;a.h=!1}},pV=function(a){a.f.on(a.m,_.fc,a.sk.bind(a));a.f.on(a.m,_.gc,a.tk.bind(a));a.f.on(a.m,_.wc,a.zk.bind(a));a.f.on(a.m,_.tc,a.rf.bind(a));a.f.on(a.m,_.sc,a.rf.bind(a));a.f.on(a.m,_.uc,a.rf.bind(a));a.f.on(a.m,_.hc,a.rf.bind(a));a.f.on(a.m,_.xc,a.Ak.bind(a));a.f.on(a.m,_.vc,a.yk.bind(a));a.f.on(a.m,_.ic,a.uk.bind(a));a.f.on(a.m,_.pc,a.wk.bind(a));a.f.on(a.m,_.qc,a.xk.bind(a));a.f.on(a.m,_.kc,a.vk.bind(a));a.f.on(a.m,_.rc,a.Um.bind(a));a.f.on(a.m,_.yc,a.Bk.bind(a));a.f.on(a.m,_.je,function(b){var c=
|
|
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=cV}null===a.a&&lV(a,null);a.a.reportAdError(c,b.FATAL);a.j=!0;a.g.debug("Ad Playback Failure");oV(a,mV,c)}})},qV=function(a,b){this.m=a;this.f=new _.ti;this.a=null;this.o=!1;this.H=!0;this.B=this.h=this.A=this.F=this.l=!1;this.O=0;this.K=!1;this.w=null;this.J=!1;this.g=b;this.L=this.G=null;this.j=[];this.I=0},
|
|
11
|
+
rV=function(a){if(!a.l&&a.a){var b=gV(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},sV=function(a){return null!==a.a&&a.F},tV=function(a){return a.m.getConfiguration().autoplay||!1},uV=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
|
+
null,c);Conviva.Analytics.setDeviceMetadata(fV(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;c={};c[Conviva.Constants.FRAMEWORK_NAME]=_.xa;c[Conviva.Constants.FRAMEWORK_VERSION]=_.ia;a.a.setPlayerInfo(c)},vV=function(a){if(!a.l)if(a.F)a.g.warn("Current session still active. No-op.");else{var b=a.m.getLoadedSource()||a.L,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||
|
|
13
|
+
"N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.mn(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.nn(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.xa;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.M.R(c.customTags))for(var h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(function(){a.g.debug("reportMiscellaneousMetrics()");if(sV(a)){var l=
|
|
14
|
+
1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=a.m.getStats()){l=l.decodedFrames;var m=l-a.I;a.I=l;isFinite(m)&&(a.g.debug("Current FPS",m),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,m))}}});a.F=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.ai(l.args)}));a.j=[]}},wV=function(a){a.g.debug("terminateSession()");a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,
|
|
15
|
+
Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.F=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.O=0,a.K=!1,a.j=[],a.I=0)},xV=function(){this.h=this.f=null;this.a=!1;this.g=new _.L("clpp.conviva")},yV=function(a){var b=[];typeof a===_.Se&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.N(1,9,9001,{missingKeys:b});},AV=function(a,b){var c=b.getConfiguration();a.a=!_.M.R(c.conviva)&&typeof c.conviva===
|
|
16
|
+
_.Se;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.N(1,9,9E3),zV(b,c)):b.namespace()===_.qd&&(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.")},zV=function(a,b){a.trigger(new _.Q(_.je,{detail:b}))},BV=function(){};_.r=kV.prototype;_.r.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.xa;pV(this)};_.r.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.ma):(_.wi(this.f),this.a&&oV(this,CV),this.f.release(),this.o=!0,this.h=this.j=!1)};_.r.destroy=function(){this.g.debug(_.Nd);this.l?this.g.debug(_.la):this.l=!0};_.r.sk=function(){this.g.debug(dV)};_.r.tk=function(){this.g.debug(eV)};
|
|
17
|
+
_.r.zk=function(a){this.g.debug("onAdStarted()");a=a.ad;this.h||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),lV(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.lb(),a.kb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.Va())};
|
|
18
|
+
_.r.rf=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 _.tc:case _.uc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.sc:c(Conviva.Constants.PlayerState.PAUSED);break;case _.hc:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.r.Ak=function(){this.g.debug("onAdStopped()");this.a&&!this.j&&oV(this,CV)};_.r.yk=function(){this.g.debug("onAdSkipped()");this.a&&oV(this,nV)};
|
|
19
|
+
_.r.uk=function(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.r.wk=function(){this.g.debug("onAdImpression()");if(this.a){var a=Conviva.Constants.Events;this.a.reportAdPlayerEvent(a.AD_IMPRESSION_START);this.a.reportAdPlayerEvent(a.AD_IMPRESSION_END)}};
|
|
20
|
+
_.r.xk=function(a){var b=this;this.g.debug("onAdLoaded()");var c=a.ad;if(-1!==c.getPodIndex()||this.m.getPosition()>=this.m.getDuration()-5)b.h=!0,lV(b,c);else this.f.on(this.m,_.ug,function(){b.m.getPosition()>=b.m.getDuration()-5&&(b.f.off(b.m,_.ug),b.h=!0,lV(b,c))})};_.r.vk=function(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.r.Um=function(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
|
|
21
|
+
_.r.Bk=function(){this.g.debug("onAdThirdQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)};var nV=0,CV=1,mV=2;_.r=qV.prototype;
|
|
22
|
+
_.r.initialize=function(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.H=!1,this.G=_.M.ib(b),this.L=c,this.m=a,uV(this,this.G),this.f.on(this.m,_.gf,this.vn.bind(this)),this.f.on(this.m,_.dg,this.Gk.bind(this)),this.f.on(this.m,_.Wc,this.zh.bind(this)),this.f.on(this.m,_.Hg,this.Fk.bind(this)),this.f.on(this.m,_.Gg,this.Ek.bind(this)),this.f.on(this.m,_.fc,this.Ck.bind(this)),this.f.on(this.m,_.gc,this.Dk.bind(this)),this.f.on(this.m,_.Ac,this.Zm.bind(this)),this.f.on(this.m,_.Vc,this.$m.bind(this)),
|
|
23
|
+
this.f.on(this.m,_.je,this.Ah.bind(this)),tV(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),vV(this)))};_.r.release=function(){this.g.debug("Release conviva");this.H?this.g.debug(_.ma):(_.wi(this.f),sV(this)||this.o||!tV(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),sV(this)&&wV(this),this.a=null,this.H=!0)};_.r.destroy=function(){this.g.debug(_.Nd);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.vn=function(){this.g.debug("onPlayRequest()");sV(this)||tV(this)?sV(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),sV(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"),vV(this))};
|
|
25
|
+
_.r.Gk=function(a){function b(d){if(c.o&&(c.g.debug("Creating conviva session (On Seek / Replay)"),uV(c,c.G),vV(c),rV(c),sV(c))){var e=c.m.getTrackManager();e=e.pa()||e.yb();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)}sV(c)&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,d)}var c=this;this.g.debug(_.Ye);switch(a.detail.currentState){case 3:b(Conviva.Constants.PlayerState.PLAYING);
|
|
26
|
+
break;case 4:b(Conviva.Constants.PlayerState.PAUSED);break;case 2:b(Conviva.Constants.PlayerState.BUFFERING);break;case 5:this.g.debug("onVideoEnded()"),sV(this)&&(this.w&&this.w.Nb()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.K=!0):wV(this))}};
|
|
27
|
+
_.r.zh=function(a){this.g.debug(_.Te);if(sV(this)){if(a=a.detail,typeof a.width===_.k&&typeof a.height===_.k&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){var b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({ai:this.zh.bind(this),args:a})};
|
|
28
|
+
_.r.Fk=function(){this.g.debug("onSeeking()");sV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)};_.r.Ek=function(){this.g.debug("onSeeked()");sV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)};_.r.Zm=function(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a};
|
|
29
|
+
_.r.Ck=function(a){this.g.debug(dV);var b=a.ad;a=0===b.Wa();var c=hV(b.getPodIndex());sV(this)||tV(this)||!a||vV(this);if(sV(this)){a=0===b.Bb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;var d=0,e={};1===b.nb()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.O;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.mj()?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.Dk=function(){this.g.debug(eV);sV(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.K&&wV(this))};
|
|
31
|
+
_.r.Ah=function(a){this.g.debug(_.Ve);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===_.O&&(d=Conviva.Constants.ErrorSeverity.FATAL,sV(this)||vV(this));sV(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,wV(this))):this.j.push({ai:this.Ah.bind(this),
|
|
32
|
+
args:a})}};_.r.$m=function(){this.g.debug("onAutoPlayBlocked()");sV(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,sV(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))};_.r=xV.prototype;_.r.onPlayerCreated=function(a){this.f=new qV(a,this.g)};_.r.onContentWillLoad=function(a,b){var c=this;AV(this,a);if(this.a){var d=a.getConfiguration();d=_.M.ib(d.conviva||{});try{yV(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.h=new kV(a,function(){return c.f.a}),this.h.initialize(d))}catch(f){f instanceof _.N?zV(a,f):zV(a,new _.N(1,9,9002,f,f))}}};_.r.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&rV(this.f)};
|
|
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",xV);xV.prototype.reportAppEvent=xV.prototype.reportAppEvent;xV.Id="conviva";BV.prototype.create=function(){return new xV};_.To(new BV);};
|
|
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;});}
|
|
36
36
|
else{_=this.clpp._;(f.call(g,this));}
|