@castlabs/prestoplay 6.6.0 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +406 -406
- package/cjs/cl.crypto.js +8 -8
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +17 -6
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +49 -48
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +256 -257
- package/cjs/cl.muxdata.js +12 -12
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +71 -70
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +27 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +357 -356
- package/cl.crypto.js +8 -8
- package/cl.dash.js +66 -66
- package/cl.externs.js +17 -6
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +40 -40
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +16 -16
- package/cl.mse.js +199 -200
- package/cl.muxdata.js +8 -8
- package/cl.onboard.js +2 -2
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +4 -4
- package/cl.smooth.js +59 -58
- package/cl.thumbnails.js +16 -16
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +12 -12
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +13 -13
- package/cl.vtt.js +11 -11
- package/cl.youbora.js +15 -15
- package/package.json +5 -1
- package/typings.d.ts +100 -96
package/cjs/cl.conviva.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
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.f.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.a.debug(a.l.getConfiguration().source);var f={},g=new _.
|
|
14
|
-
1E3*a.l.getPosition();a.f.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=a.l.getStats()){l=l.decodedFrames;var m=l-a.
|
|
15
|
-
Conviva.Constants.PlayerState.STOPPED),a.f.reportPlaybackEnded(),a.f.release(),Conviva.Analytics.release(),a.o=!0,a.D=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.
|
|
16
|
-
_.
|
|
17
|
-
_.t.
|
|
18
|
-
_.t.Nd=function(a){var b=this;this.f.debug("onAdStateChanged()");if(this.a){var c=function(d){b.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,d)};switch(a.type){case _.Qb:case _.Rb:c(Conviva.Constants.PlayerState.PLAYING);break;case _.Pb:c(Conviva.Constants.PlayerState.PAUSED);break;case _.Ib:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.t.
|
|
19
|
-
_.t.
|
|
20
|
-
_.t.
|
|
21
|
-
_.t.
|
|
22
|
-
_.t.initialize=function(a,b,c){this.m||(this.a.debug("Initialize conviva"),this.
|
|
23
|
-
this.g.on(this.l,_.
|
|
24
|
-
_.t.reportAppEvent=function(a,b){var c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.a.debug("Report app event error",d),c=!1}return c};_.t.
|
|
25
|
-
_.t.
|
|
26
|
-
break;case _.
|
|
27
|
-
_.t.
|
|
28
|
-
_.t.
|
|
29
|
-
_.t.
|
|
30
|
-
b,e);this.B=!0}else this.a.debug("Bug: should already have a valid session")};_.t.
|
|
31
|
-
_.t.
|
|
32
|
-
|
|
33
|
-
_.t.onPlayerWillDestroy=function(){this.a&&(this.a=!1,this.f.destroy(),this.f=null,this.g&&(this.g.destroy(),this.g=null))};_.t.onPlayerWillRelease=function(){this.a&&(this.f.release(),this.g&&this.g.release())};_.t.id=function(){return"conviva"};_.t.
|
|
34
|
-
|
|
2
|
+
var f=function(window){var NK="Ad Error",OK="onAdBreakStarted()",PK="onAdBreakStopped()",QK=function(a){function b(l,m){l in h||!m||(h[l]=m)}var c=_.ai(),d=Conviva.Constants.DeviceType.DESKTOP,e=Conviva.Constants.DeviceCategory.WEB,f=c.os;c=c.osVersion.name;var g="";_.Zi()&&(g="Apple");_.Yi()?(g="Google",d=Conviva.Constants.DeviceType.SETTOP,e=Conviva.Constants.DeviceCategory.CHROMECAST):_.$i()?(d=Conviva.Constants.DeviceType.MOBILE,/(android)/i.test(navigator.userAgent)?e=Conviva.Constants.DeviceCategory.ANDROID_DEVICE:
|
|
3
|
+
_.Zi()&&(e=Conviva.Constants.DeviceCategory.APPLE_DEVICE)):_.$h()||_.Zh()||_.Vi("Hisense")?(d=Conviva.Constants.DeviceType.SMARTTV,e=Conviva.Constants.DeviceCategory.SMART_TV,_.$h()?(c="",g="LG",e=Conviva.Constants.DeviceCategory.LG_TV):_.Zh()?(g="Samsung",e=Conviva.Constants.DeviceCategory.SAMSUNG_TV):_.Vi("Hisense")&&(c="",g="Hisense")):_.Vi("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},RK=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},SK=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},UK=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]=RK(!!d);e[Conviva.Constants.ASSET_NAME]=NK;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"]=TK(a.getId()),e["c3.ad.creativeId"]=TK(a.getCreativeId()),e["c3.ad.system"]=TK(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=TK(a.getApiFramework()),e["c3.ad.advertiser"]=TK(a.getAdvertiserName()),e["c3.ad.position"]=SK(a.getPodIndex()),e["c3.ad.technology"]=0===a.xb()?
|
|
6
|
+
Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=TK(a.rb()),e["c3.ad.adManagerVersion"]=TK(a.sb()),e["c3.ad.advertiserCategory"]=TK(null),e["c3.ad.advertiserId"]=TK(null),e["c3.ad.breakId"]=TK(null),e["c3.ad.campaignName"]=TK(null),e["c3.ad.category"]=TK(null),e["c3.ad.classification"]=TK(null),e["c3.ad.creativeName"]=TK(null),e["c3.ad.sequence"]=TK(a.Lb()),e["c3.ad.sessionStartEvent"]=TK(null),e["c3.ad.unitName"]=TK(null),e["c3.ad.dayPart"]=TK(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"]=TK(b),e["c3.ad.firstAdSystem"]=TK(c),e["c3.ad.firstCreativeId"]=TK(a));return e},TK=function(a){return a?""+a:"NA"},VK=function(a,b){this.l=a;this.B=b;this.A="";this.w=_.sa;this.f=new _.H("clpp.conviva.ad");this.g=new _.eg;this.a=null;this.j=this.m=this.o=this.h=!1},WK=function(a,b){if(!a.m){a.j=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.B()),
|
|
8
|
+
b){var c=UK(b,a.A,a.w,a.l.isLive()),d=String(b.sb()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.rb();e[Conviva.Constants.FRAMEWORK_VERSION]=d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(f){a.f.error("Could not create ad analytics session",f)}}},ZK=function(a,b,c){c=void 0===c?NK:c;if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case XK:a.a.reportAdFailed(c,UK(null,a.A,a.w));break;case YK:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();
|
|
9
|
+
a.a=null;a.h=!1}},$K=function(a){a.g.on(a.l,_.Gb,a.Xg.bind(a));a.g.on(a.l,_.Hb,a.Yg.bind(a));a.g.on(a.l,_.Tb,a.eh.bind(a));a.g.on(a.l,_.Qb,a.Nd.bind(a));a.g.on(a.l,_.Pb,a.Nd.bind(a));a.g.on(a.l,_.Rb,a.Nd.bind(a));a.g.on(a.l,_.Ib,a.Nd.bind(a));a.g.on(a.l,_.Ub,a.fh.bind(a));a.g.on(a.l,_.Sb,a.dh.bind(a));a.g.on(a.l,_.Jb,a.Zg.bind(a));a.g.on(a.l,_.Mb,a.ah.bind(a));a.g.on(a.l,_.Nb,a.bh.bind(a));a.g.on(a.l,_.Lb,a.$g.bind(a));a.g.on(a.l,_.Ob,a.Ji.bind(a));a.g.on(a.l,_.Vb,a.gh.bind(a));a.g.on(a.l,_.jd,function(b){var c=
|
|
10
|
+
b.detail;if(10003===c.code&&(a.f.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=NK}null===a.a&&WK(a,null);a.a.reportAdError(c,b.FATAL);a.j=!0;a.f.debug("Ad Playback Failure");ZK(a,XK,c)}})},aL=function(a,b){this.l=a;this.g=new _.eg;this.f=null;this.o=!1;this.H=!0;this.B=this.h=this.A=this.D=this.m=!1;this.P=0;this.K=!1;this.w=null;this.J=!1;this.a=b;this.M=this.F=null;this.j=[];this.I=0},
|
|
11
|
+
bL=function(a){if(!a.m&&a.f){var b=RK(a.l.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.l.getDuration();a.f.setContentInfo(c)}},cL=function(a){return null!==a.f&&a.D},dL=function(a){return a.l.getConfiguration().autoplay||!1},eL=function(a,b){var c={};c[Conviva.Constants.LOG_LEVEL]=Conviva.Constants.LogLevel.DEBUG;b.serviceUrl&&(a.a.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(QK(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,b.connectionType);a.f=Conviva.Analytics.buildVideoAnalytics();a.o=!1;c={};c[Conviva.Constants.FRAMEWORK_NAME]=_.sa;c[Conviva.Constants.FRAMEWORK_VERSION]=_.ea;a.f.setPlayerInfo(c)},fL=function(a){if(!a.m)if(a.D)a.a.warn("Current session still active. No-op.");else{var b=a.l.getLoadedSource()||a.M,c=a.l.getConfiguration().conviva||null,d=c&&c.viewerId||
|
|
13
|
+
"N/A",e=c&&c.defaultResource||"N/A";a.a.debug(a.l.getConfiguration().source);var f={},g=new _.pi(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.qi(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.sa;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.K.R(c.customTags))for(var h in c.customTags)f[h]=c.customTags[h];a.f.reportPlaybackRequested(f);a.f.setCallback(function(){a.a.debug("reportMiscellaneousMetrics()");if(cL(a)){var l=
|
|
14
|
+
1E3*a.l.getPosition();a.f.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=a.l.getStats()){l=l.decodedFrames;var m=l-a.I;a.I=l;isFinite(m)&&(a.a.debug("Current FPS",m),a.f.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,m))}}});a.D=!0;a.h=!0;a.J=!1;0<a.j.length&&(a.a.debug("Report deferred events"),a.j.forEach(function(l){l.Kf(l.gf)}));a.j=[]}},gL=function(a){a.a.debug("terminateSession()");a.f&&(a.f.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,
|
|
15
|
+
Conviva.Constants.PlayerState.STOPPED),a.f.reportPlaybackEnded(),a.f.release(),Conviva.Analytics.release(),a.o=!0,a.D=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.P=0,a.K=!1,a.j=[],a.I=0)},hL=function(){this.g=this.f=null;this.a=!1;this.h=new _.H("clpp.conviva")},iL=function(a){var b=[];typeof a===_.Ld&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.L(1,9,9001,{missingKeys:b});},jL=function(a,b){var c=b.getConfiguration();a.a=!_.K.R(c.conviva)&&typeof c.conviva===
|
|
16
|
+
_.Ld;a.a?"undefined"===typeof window.Conviva?(a.h.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.L(1,9,9E3),a.T(b,c)):b.namespace()===_.Jc&&(a.a=!1,a.h.debug("Conviva does not report when casting.")):a.h.warn("Conviva plugin is loaded but not configured. Will do nothing.")},kL=function(){};_.t=VK.prototype;_.t.initialize=function(a){this.f.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.sa;$K(this)};_.t.release=function(){this.f.debug("Release Ad Insights");this.o?this.f.debug(_.ia):(_.hg(this.g),this.a&&ZK(this,lL),this.g.release(),this.o=!0,this.h=this.j=!1)};_.t.destroy=function(){this.f.debug(_.Xc);this.m?this.f.debug(_.ha):this.m=!0};_.t.Xg=function(){this.f.debug(OK)};_.t.Yg=function(){this.f.debug(PK)};
|
|
17
|
+
_.t.eh=function(a){this.f.debug("onAdStarted()");a=a.ad;this.h||(this.f.warn("Ad load event was not triggered. This will have incidence on VSF"),WK(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.ub(),a.tb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.gb())};
|
|
18
|
+
_.t.Nd=function(a){var b=this;this.f.debug("onAdStateChanged()");if(this.a){var c=function(d){b.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,d)};switch(a.type){case _.Qb:case _.Rb:c(Conviva.Constants.PlayerState.PLAYING);break;case _.Pb:c(Conviva.Constants.PlayerState.PAUSED);break;case _.Ib:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.t.fh=function(){this.f.debug("onAdStopped()");this.a&&!this.j&&ZK(this,lL)};_.t.dh=function(){this.f.debug("onAdSkipped()");this.a&&ZK(this,YK)};
|
|
19
|
+
_.t.Zg=function(){this.f.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.t.ah=function(){this.f.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
|
+
_.t.bh=function(a){var b=this;this.f.debug("onAdLoaded()");var c=a.ad;if(-1!==c.getPodIndex()||this.l.getPosition()>=this.l.getDuration()-5)b.h=!0,WK(b,c);else this.g.on(this.l,_.Fe,function(){b.l.getPosition()>=b.l.getDuration()-5&&(b.g.off(b.l,_.Fe),b.h=!0,WK(b,c))})};_.t.$g=function(){this.f.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.t.Ji=function(){this.f.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
|
|
21
|
+
_.t.gh=function(){this.f.debug("onAdThirdQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)};var YK=0,lL=1,XK=2;_.t=aL.prototype;
|
|
22
|
+
_.t.initialize=function(a,b,c){this.m||(this.a.debug("Initialize conviva"),this.H=!1,this.F=_.K.Ma(b),this.M=c,this.l=a,eL(this,this.F),this.g.on(this.l,_.Zd,this.ij.bind(this)),this.g.on(this.l,_.se,this.lh.bind(this)),this.g.on(this.l,_.tc,this.sf.bind(this)),this.g.on(this.l,_.Ne,this.kh.bind(this)),this.g.on(this.l,_.Me,this.jh.bind(this)),this.g.on(this.l,_.Gb,this.hh.bind(this)),this.g.on(this.l,_.Hb,this.ih.bind(this)),this.g.on(this.l,_.Xb,this.Pi.bind(this)),this.g.on(this.l,_.sc,this.Ri.bind(this)),
|
|
23
|
+
this.g.on(this.l,_.jd,this.tf.bind(this)),dL(this)&&(this.a.debug("Start a new session: A new video starts in autoplay."),fL(this)))};_.t.release=function(){this.a.debug("Release conviva");this.H?this.a.debug(_.ia):(_.hg(this.g),cL(this)||this.o||!dL(this)||this.f&&this.f.reportPlaybackFailed("Exit Before Video Start"),cL(this)&&gL(this),this.f=null,this.H=!0)};_.t.destroy=function(){this.a.debug(_.Xc);this.m?this.a.debug(_.ha):this.m=!0};
|
|
24
|
+
_.t.reportAppEvent=function(a,b){var c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.a.debug("Report app event error",d),c=!1}return c};_.t.ij=function(){this.a.debug("onPlayRequest()");cL(this)||dL(this)?cL(this)&&this.A&&!this.h&&(this.a.debug("Resuming VST monitoring ..."),cL(this)&&!this.h&&(this.f.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_ENDED),this.h=!0),this.A=!1):(this.a.debug("Creating conviva session. On Play Requested / No autoplay"),fL(this))};
|
|
25
|
+
_.t.lh=function(a){function b(d){if(c.o&&(c.a.debug("Creating conviva session (On Seek / Replay)"),eL(c,c.F),fL(c),bL(c),cL(c))){var e=c.l.getTrackManager();e=e.ha()||e.Ta();e.width&&e.height&&c.f.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,e.width,e.height);e.bandwidth&&c.f.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,e.bandwidth/1E3)}cL(c)&&c.f.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,d)}var c=this;this.a.debug(_.Qd);switch(a.detail.currentState){case _.ln:b(Conviva.Constants.PlayerState.PLAYING);
|
|
26
|
+
break;case _.kn:b(Conviva.Constants.PlayerState.PAUSED);break;case _.bn:b(Conviva.Constants.PlayerState.BUFFERING);break;case _.dn:this.a.debug("onVideoEnded()"),cL(this)&&(this.w&&this.w.hb()?(this.a.debug("Waiting for postroll Ad before terminating session"),this.K=!0):gL(this))}};
|
|
27
|
+
_.t.sf=function(a){this.a.debug(_.Md);if(cL(this)){if(a=a.detail,typeof a.width===_.k&&typeof a.height===_.k&&this.f.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.f.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.f.setContentInfo(b)}}else this.j.push({Kf:this.sf.bind(this),gf:a})};
|
|
28
|
+
_.t.kh=function(){this.a.debug("onSeeking()");cL(this)&&this.f.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)};_.t.jh=function(){this.a.debug("onSeeked()");cL(this)&&this.f.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)};_.t.Pi=function(a){this.a.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a};
|
|
29
|
+
_.t.hh=function(a){this.a.debug(OK);var b=a.ad;a=0===b.Ua();var c=SK(b.getPodIndex());cL(this)||dL(this)||!a||fL(this);if(cL(this)){a=0===b.xb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;var d=0,e={};1===b.wb()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.P;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.Yi()?b.CONTENT:b.SEPARATE;this.f.reportAdBreakStarted(a,
|
|
30
|
+
b,e);this.B=!0}else this.a.debug("Bug: should already have a valid session")};_.t.ih=function(){this.a.debug(PK);cL(this)&&this.B&&(this.f.reportAdBreakEnded(),this.B=!1,this.K&&gL(this))};
|
|
31
|
+
_.t.tf=function(a){this.a.debug(_.Nd);if(this.o&&this.J)this.a.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===_.M&&(d=Conviva.Constants.ErrorSeverity.FATAL,cL(this)||fL(this));cL(this)?(this.a.debug("Report error",c,d),this.f.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.a.debug("Video Playback Failure"),this.J=!0,gL(this))):this.j.push({Kf:this.tf.bind(this),
|
|
32
|
+
gf:a})}};_.t.Ri=function(){this.a.debug("onAutoPlayBlocked()");cL(this)&&(this.a.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,cL(this)&&this.h&&(this.f.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))};_.t=hL.prototype;_.t.onPlayerCreated=function(a){this.f=new aL(a,this.h)};_.t.onContentWillLoad=function(a,b){var c=this;jL(this,a);if(this.a){var d=a.getConfiguration();d=_.K.Ma(d.conviva||{});try{iL(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.g=new VK(a,function(){return c.f.f}),this.g.initialize(d))}catch(f){f instanceof _.L?this.T(a,f):this.T(a,new _.L(1,9,9002,f,f))}}};_.t.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&bL(this.f)};
|
|
33
|
+
_.t.onPlayerWillDestroy=function(){this.a&&(this.a=!1,this.f.destroy(),this.f=null,this.g&&(this.g.destroy(),this.g=null))};_.t.onPlayerWillRelease=function(){this.a&&(this.f.release(),this.g&&this.g.release())};_.t.id=function(){return"conviva"};_.t.T=function(a,b){a.trigger(new _.J(_.jd,{detail:b}))};_.t.reportAppEvent=function(a,b){return this.f?this.f.reportAppEvent(a,b):!1};_.D("clpp.conviva.ConvivaPlugin",hL);hL.prototype.reportAppEvent=hL.prototype.reportAppEvent;hL.Id="conviva";
|
|
34
|
+
kL.prototype.create=function(){return new hL};_.Eo(new kL);};
|
|
35
35
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
36
36
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
37
37
|
else{_=this.clpp._;(f.call(g,this));}
|