@castlabs/prestoplay 6.34.0-beta.1 → 6.35.0-beta.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 +8 -2
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +127 -127
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +601 -597
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +100 -100
- package/cjs/cl.externs.js +37 -38
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +76 -76
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +26 -26
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +351 -352
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +3 -3
- package/cjs/cl.youbora.js +39 -39
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +98 -98
- package/cl.conviva.js +28 -27
- package/cl.core.js +477 -473
- package/cl.crypto.js +8 -8
- package/cl.dash.js +89 -89
- package/cl.externs.js +37 -38
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +299 -301
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +5 -5
- 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 +17 -17
- package/cl.tizen.js +55 -55
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +1 -1
- package/typings.d.ts +24 -125
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 k},
|
|
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
|
-
|
|
14
|
-
a.
|
|
15
|
-
a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.
|
|
16
|
-
(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.O(1,9,9E3),
|
|
17
|
-
_.r
|
|
18
|
-
_.r.Qf=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 _.uc:case _.vc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.
|
|
19
|
-
_.r.
|
|
20
|
-
_.r.
|
|
21
|
-
_.r.
|
|
22
|
-
_.r.initialize=function(a,b,c){this.
|
|
23
|
-
this.f.on(this.m,_.le,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.
|
|
26
|
-
break;case 10:b(Conviva.Constants.PlayerState.PAUSED);break;case 6:b(Conviva.Constants.PlayerState.BUFFERING);break;case 11:this.g.debug("onVideoEnded()"),
|
|
27
|
-
_.r.
|
|
28
|
-
_.r.
|
|
29
|
-
_.r.
|
|
30
|
-
b,e);this.
|
|
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};_.J("clpp.conviva.ConvivaPlugin",
|
|
2
|
+
var f=function(window){var gV="Ad Error",hV="Must have an AdTimeline",iV="onAdBreakStarted()",jV="onAdBreakStopped()",kV=function(a){function b(l,m){l in k||!m||(k[l]=m)}var c=_.Ti(),d=Conviva.Constants.DeviceType.DESKTOP,e=Conviva.Constants.DeviceCategory.WEB,f=c.os;c=c.osVersion.name;var g="";_.wi()&&(g="Apple");_.vi()?(g="Google",d=Conviva.Constants.DeviceType.SETTOP,e=Conviva.Constants.DeviceCategory.CHROMECAST):_.xi()?(d=Conviva.Constants.DeviceType.MOBILE,/(android)/i.test(navigator.userAgent)?e=Conviva.Constants.DeviceCategory.ANDROID_DEVICE:
|
|
3
|
+
_.wi()&&(e=Conviva.Constants.DeviceCategory.APPLE_DEVICE)):_.ui()||_.ti()||_.si("Hisense")?(d=Conviva.Constants.DeviceType.SMARTTV,e=Conviva.Constants.DeviceCategory.SMART_TV,_.ui()?(c="",g="LG",e=Conviva.Constants.DeviceCategory.LG_TV):_.ti()?(g="Samsung",e=Conviva.Constants.DeviceCategory.SAMSUNG_TV):_.si("Hisense")&&(c="",g="Hisense")):_.si("Xbox One")&&(g="Microsoft",d=Conviva.Constants.DeviceType.CONSOLE,e=Conviva.Constants.DeviceCategory.XBOX);var k=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 k},lV=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},mV=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},oV=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]=lV(!!d);e[Conviva.Constants.ASSET_NAME]=gV;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"]=nV(a.getId()),e["c3.ad.creativeId"]=nV(a.getCreativeId()),e["c3.ad.system"]=nV(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=nV(a.getApiFramework()),e["c3.ad.advertiser"]=nV(a.getAdvertiserName()),e["c3.ad.position"]=mV(a.getPodIndex()),e["c3.ad.technology"]=0===a.qb()?
|
|
6
|
+
Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=nV(a.nb()),e["c3.ad.adManagerVersion"]=nV(a.ob()),e["c3.ad.advertiserCategory"]=nV(null),e["c3.ad.advertiserId"]=nV(null),e["c3.ad.breakId"]=nV(null),e["c3.ad.campaignName"]=nV(null),e["c3.ad.category"]=nV(null),e["c3.ad.classification"]=nV(null),e["c3.ad.creativeName"]=nV(null),e["c3.ad.sequence"]=nV(a.pb()),e["c3.ad.sessionStartEvent"]=nV(null),e["c3.ad.unitName"]=nV(null),e["c3.ad.dayPart"]=nV(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"]=nV(b),e["c3.ad.firstAdSystem"]=nV(c),e["c3.ad.firstCreativeId"]=nV(a));return e},nV=function(a){return a?""+a:"NA"},pV=function(a,b){this.m=a;this.B=b;this.A="";this.w=_.Ba;this.g=new _.L("clpp.conviva.ad");this.f=new _.gi;this.a=null;this.j=this.l=this.o=this.h=!1},qV=function(a,b){if(!a.l){a.j=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.B()),
|
|
8
|
+
b){var c=oV(b,a.A,a.w,a.m.isLive()),d=String(b.ob()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.nb();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)}}},tV=function(a,b,c){c=void 0===c?gV:c;if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case rV:a.a.reportAdFailed(c,oV(null,a.A,a.w));break;case sV:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();
|
|
9
|
+
a.a=null;a.h=!1}},uV=function(a){a.f.on(a.m,_.gc,a.Uk.bind(a));a.f.on(a.m,_.hc,a.Vk.bind(a));a.f.on(a.m,_.xc,a.al.bind(a));a.f.on(a.m,_.uc,a.Qf.bind(a));a.f.on(a.m,_.sc,a.Qf.bind(a));a.f.on(a.m,_.vc,a.Qf.bind(a));a.f.on(a.m,_.ic,a.Qf.bind(a));a.f.on(a.m,_.yc,a.cl.bind(a));a.f.on(a.m,_.wc,a.$k.bind(a));a.f.on(a.m,_.jc,a.Wk.bind(a));a.f.on(a.m,_.pc,a.Yk.bind(a));a.f.on(a.m,_.qc,a.Zk.bind(a));a.f.on(a.m,_.lc,a.Xk.bind(a));a.f.on(a.m,_.rc,a.xn.bind(a));a.f.on(a.m,_.Ac,a.el.bind(a));a.f.on(a.m,_.le,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=gV}null===a.a&&qV(a,null);a.a.reportAdError(c,b.FATAL);a.j=!0;a.g.debug("Ad Playback Failure");tV(a,rV,c)}})},vV=function(a,b){this.m=a;this.f=new _.gi;this.a=null;this.A=!1;this.w=!0;this.H=this.l=this.D=this.B=this.o=!1;this.M=0;this.K=!1;this.h=null;this.J=!1;this.g=b;this.L=this.G=null;this.j=[];this.I=0},
|
|
11
|
+
wV=function(a){if(!a.o&&a.a){var b=lV(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},xV=function(a){return null!=a.a&&a.B},yV=function(a){return a.m.getConfiguration().autoplay||!1},zV=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(kV(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.A=!1;c={};c[Conviva.Constants.FRAMEWORK_NAME]=_.Ba;c[Conviva.Constants.FRAMEWORK_VERSION]=_.ja;a.a.setPlayerInfo(c)},AV=function(a){if(!a.o&&!a.B&&a.a){var b=a.m.bb()||a.L;if(b){var c=a.m.getConfiguration().conviva||null;if(c){var d=c.viewerId||"N/A",e=c.defaultResource||"N/A",f={},g=new _.dk(b.url);
|
|
13
|
+
b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.ek(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.Ba;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(xV(a)){var l=1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,l);if(l=
|
|
14
|
+
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.B=!0;a.l=!0;a.J=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(function(l){l.zi(l.args)}));a.j=[]}else a.g.warn("Must have Conviva plugin configuration")}else a.g.warn("Cannot start Conviva session without a loaded source")}},BV=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.A=!0,a.B=!1,a.D=!1,a.l=!1,a.h=null,a.H=!1,a.M=0,a.K=!1,a.j=[],a.I=0)},CV=function(){this.h=this.f=null;this.a=!1;this.g=new _.L("clpp.conviva")},DV=function(a){var b=[];typeof a===_.Ue&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.O(1,9,9001,{missingKeys:b});},FV=function(a,b){var c=b.getConfiguration();a.a=!_.N.R(c.conviva)&&typeof c.conviva===
|
|
16
|
+
_.Ue;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,c=new _.O(1,9,9E3),EV(b,c)):b.namespace()===_.wd&&(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.")},EV=function(a,b){a.trigger(new _.R(_.le,{detail:b}))},GV=function(){};_.r=pV.prototype;_.r.initialize=function(a){this.g.debug("Initialize Ad Insights");this.j=this.o=!1;this.A=a.viewerId;this.w=a.playerName||_.Ba;uV(this)};_.r.release=function(){this.g.debug("Release Ad Insights");this.o?this.g.debug(_.pa):(_.ki(this.f),this.a&&tV(this,HV),this.f.release(),this.o=!0,this.h=this.j=!1)};_.r.destroy=function(){this.g.debug(_.Od);this.l?this.g.debug(_.na):this.l=!0};_.r.Uk=function(){this.g.debug(iV)};_.r.Vk=function(){this.g.debug(jV)};
|
|
17
|
+
_.r.al=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"),qV(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.gb(),a.fb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.Ga())};
|
|
18
|
+
_.r.Qf=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 _.uc:case _.vc:c(Conviva.Constants.PlayerState.PLAYING);break;case _.sc:c(Conviva.Constants.PlayerState.PAUSED);break;case _.ic:c(Conviva.Constants.PlayerState.BUFFERING)}}};_.r.cl=function(){this.g.debug("onAdStopped()");this.a&&!this.j&&tV(this,HV)};_.r.$k=function(){this.g.debug("onAdSkipped()");this.a&&tV(this,sV)};
|
|
19
|
+
_.r.Wk=function(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.r.Yk=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.Zk=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,qV(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,qV(b,c))})};_.r.Xk=function(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.r.xn=function(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
|
|
21
|
+
_.r.el=function(){this.g.debug("onAdThirdQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)};var sV=0,HV=1,rV=2;_.r=vV.prototype;
|
|
22
|
+
_.r.initialize=function(a,b,c){!this.o&&this.w&&(this.g.debug("Initialize conviva"),this.w=!1,this.G=_.N.xb(b),this.L=c,this.m=a,zV(this,this.G),this.f.on(this.m,_.jf,this.$n.bind(this)),this.f.on(this.m,_.uf,this.jl.bind(this)),this.f.on(this.m,_.ad,this.Vh.bind(this)),this.f.on(this.m,_.Fg,this.il.bind(this)),this.f.on(this.m,_.Eg,this.hl.bind(this)),this.f.on(this.m,_.gc,this.fl.bind(this)),this.f.on(this.m,_.hc,this.gl.bind(this)),this.f.on(this.m,_.Dc,this.Dn.bind(this)),this.f.on(this.m,_.$c,
|
|
23
|
+
this.En.bind(this)),this.f.on(this.m,_.le,this.Wh.bind(this)),yV(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),AV(this)))};_.r.release=function(){this.g.debug("Release conviva");this.w?this.g.debug(_.pa):(_.ki(this.f),xV(this)||this.A||!yV(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),xV(this)&&BV(this),this.a=null,this.w=!0)};_.r.destroy=function(){this.g.debug(_.Od);this.w||this.release();this.o?this.g.debug(_.na):this.o=!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.$n=function(){this.g.debug("onPlayRequest()");xV(this)||yV(this)?xV(this)&&this.D&&!this.l&&(this.g.debug("Resuming VST monitoring ..."),this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_ENDED),this.l=!0,this.D=!1):(this.g.debug("Creating conviva session. On Play Requested / No autoplay"),AV(this))};
|
|
25
|
+
_.r.jl=function(a){function b(d){if(c.A)if(c.B)c.g.warn("Cannot restart Conviva session while a session is still active.");else if(c.G&&c.m){if(c.g.debug("Creating conviva session (On Seek / Replay)"),zV(c,c.G),AV(c),wV(c),xV(c)){var e=c.m.getTrackManager();(e=e.sa()||e.Gb())?(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)):c.g.warn("Cannot restart Conviva session without a video rendition.")}}else c.g.warn("Cannot restart Conviva session without player/configuration.");
|
|
26
|
+
xV(c)&&c.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,d)}var c=this;this.g.debug(_.$e);switch(a.detail.currentState){case 8:b(Conviva.Constants.PlayerState.PLAYING);break;case 10:b(Conviva.Constants.PlayerState.PAUSED);break;case 6:b(Conviva.Constants.PlayerState.BUFFERING);break;case 11:this.g.debug("onVideoEnded()"),xV(this)&&(this.h&&this.h.Kb()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.K=!0):BV(this))}};
|
|
27
|
+
_.r.Vh=function(a){this.g.debug(_.Ve);if(xV(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({zi:this.Vh.bind(this),args:a})};
|
|
28
|
+
_.r.il=function(){this.g.debug("onSeeking()");xV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)};_.r.hl=function(){this.g.debug("onSeeked()");xV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)};_.r.Dn=function(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.h=a};
|
|
29
|
+
_.r.fl=function(a){this.g.debug(iV);var b=a.ad;a=0===b.Ha();var c=mV(b.getPodIndex());xV(this)||yV(this)||!a||AV(this);if(xV(this))if(this.h){a=0===b.qb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;var d=0,e={};1===b.hb()&&(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||_.vi()?b.CONTENT:b.SEPARATE;this.a.reportAdBreakStarted(a,
|
|
30
|
+
b,e);this.H=!0}else this.g.warn(hV);else this.g.warn("Should already have a valid session")};_.r.gl=function(){this.g.debug(jV);xV(this)&&this.H&&(this.h?(this.a.reportAdBreakEnded(),this.H=!1,this.K&&(this.h.Kb()?BV(this):this.g.warn("Cannot postpone Conviva session closure without a postroll."))):this.g.warn(hV))};
|
|
31
|
+
_.r.Wh=function(a){this.g.debug(_.Xe);if(this.A&&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===_.Q&&(d=Conviva.Constants.ErrorSeverity.FATAL,xV(this)||AV(this));xV(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,BV(this))):this.j.push({zi:this.Wh.bind(this),
|
|
32
|
+
args:a})}};_.r.En=function(){this.g.debug("onAutoPlayBlocked()");xV(this)&&this.l?(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.D=!0,this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.l=!1):this.g.warn("Should have an active session and monitoring session")};_.r=CV.prototype;_.r.onPlayerCreated=function(a){this.f=new vV(a,this.g)};_.r.onContentWillLoad=function(a,b){var c=this;FV(this,a);if(this.a){var d=a.getConfiguration();d=_.N.xb(d.conviva||{});try{DV(d);var e=d.enableAdInsights||!1;this.f.initialize(a,d,b);e&&(this.h=new pV(a,function(){return c.f.a}),this.h.initialize(d))}catch(f){f instanceof _.O?EV(a,f):EV(a,new _.O(1,9,9002,f,f))}}};_.r.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);this.a&&wV(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};_.J("clpp.conviva.ConvivaPlugin",CV);CV.prototype.reportAppEvent=CV.prototype.reportAppEvent;CV.Id="conviva";GV.prototype.create=function(){return new CV};_.fu(new GV);};
|
|
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));}
|