@castlabs/prestoplay 6.28.0 → 6.30.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 +37 -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 +128 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +619 -614
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +92 -89
- package/cjs/cl.externs.js +154 -60
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +25 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +350 -349
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +15 -15
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +57 -58
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +60 -60
- 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/cjs/polyfill.min.js +2 -2
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -6
- package/cl.cast.js +101 -92
- package/cl.conviva.js +27 -27
- package/cl.core.js +500 -496
- package/cl.crypto.js +9 -9
- package/cl.dash.js +84 -83
- package/cl.externs.js +150 -60
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +82 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -17
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +304 -305
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- 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 +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- 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 +198 -88
package/cl.conviva.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
_.
|
|
3
|
-
c);h(Conviva.Constants.DeviceMetadata.OS_NAME,e);h(Conviva.Constants.DeviceMetadata.OS_VERSION,b);h(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||d);h(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||f);return g},
|
|
4
|
-
|
|
5
|
-
Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=
|
|
6
|
-
a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=
|
|
7
|
-
a.f.on(a.m,_.
|
|
8
|
-
|
|
9
|
-
d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(c){a.g.error("Could not create ad analytics session",c)}}},
|
|
10
|
-
b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;b={};b[Conviva.Constants.FRAMEWORK_NAME]=_.ra;b[Conviva.Constants.FRAMEWORK_VERSION]=_.ea;a.a.setPlayerInfo(b)},
|
|
11
|
-
new _.
|
|
12
|
-
h);if(h=a.m.getStats()){h=h.decodedFrames;const k=h-a.H;a.H=h;isFinite(k)&&(a.g.debug("Current FPS",k),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,k))}}});a.C=!0;a.h=!0;a.I=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(h=>{h.
|
|
13
|
-
a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.C=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.P=0,a.J=!1,a.j=[],a.H=0)},
|
|
14
|
-
a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},
|
|
15
|
-
a=a.ad;this.j||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),
|
|
16
|
-
break;case _.
|
|
17
|
-
const b=a.ad,c=()=>{this.j=!0;
|
|
18
|
-
this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)}},
|
|
19
|
-
_.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
break;case 4:b(Conviva.Constants.PlayerState.PAUSED);break;case 2:b(Conviva.Constants.PlayerState.BUFFERING);break;case 5:this.g.debug("onVideoEnded()"),
|
|
23
|
-
a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){const b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({
|
|
24
|
-
var b=a.ad;a=0===b.
|
|
25
|
-
|
|
26
|
-
this.I=!0,
|
|
27
|
-
this.f=null,this.h&&(this.h.destroy(),this.h=null))}onPlayerWillRelease(){this.a&&(this.f.release(),this.h&&this.h.release())}id(){return"conviva"}reportAppEvent(a,b){return this.f?this.f.reportAppEvent(a,b):!1}};_.x("clpp.conviva.ConvivaPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var lU="Ad Error",mU="onAdBreakStarted()",nU="onAdBreakStopped()",oU=function(a){var b=_.mj();let c=Conviva.Constants.DeviceType.DESKTOP,d=Conviva.Constants.DeviceCategory.WEB;const e=b.os;b=b.osVersion.name;let f="";_.Zi()&&(f="Apple");_.Yi()?(f="Google",c=Conviva.Constants.DeviceType.SETTOP,d=Conviva.Constants.DeviceCategory.CHROMECAST):_.$i()?(c=Conviva.Constants.DeviceType.MOBILE,/(android)/i.test(navigator.userAgent)?d=Conviva.Constants.DeviceCategory.ANDROID_DEVICE:_.Zi()&&(d=Conviva.Constants.DeviceCategory.APPLE_DEVICE)):
|
|
2
|
+
_.Si()||_.Pi()||_.Oi("Hisense")?(c=Conviva.Constants.DeviceType.SMARTTV,d=Conviva.Constants.DeviceCategory.SMART_TV,_.Si()?(b="",f="LG",d=Conviva.Constants.DeviceCategory.LG_TV):_.Pi()?(f="Samsung",d=Conviva.Constants.DeviceCategory.SAMSUNG_TV):_.Oi("Hisense")&&(b="",f="Hisense")):_.Oi("Xbox One")&&(f="Microsoft",c=Conviva.Constants.DeviceType.CONSOLE,d=Conviva.Constants.DeviceCategory.XBOX);const g=a.deviceMetadata||{},h=(k,l)=>{k in g||!l||(g[k]=l)};h(Conviva.Constants.DeviceMetadata.TYPE,a.deviceType||
|
|
3
|
+
c);h(Conviva.Constants.DeviceMetadata.OS_NAME,e);h(Conviva.Constants.DeviceMetadata.OS_VERSION,b);h(Conviva.Constants.DeviceMetadata.CATEGORY,a.deviceCategory||d);h(Conviva.Constants.DeviceMetadata.BRAND,a.deviceBrand||f);return g},pU=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},qU=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},sU=function(a,b,c,d){const e={};e[Conviva.Constants.PLAYER_NAME]=c;e[Conviva.Constants.VIEWER_ID]=b;e[Conviva.Constants.IS_LIVE]=
|
|
4
|
+
pU(!!d);e[Conviva.Constants.ASSET_NAME]=lU;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"]=rU(a.getId()),e["c3.ad.creativeId"]=rU(a.getCreativeId()),e["c3.ad.system"]=rU(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=rU(a.getApiFramework()),e["c3.ad.advertiser"]=rU(a.getAdvertiserName()),e["c3.ad.position"]=qU(a.getPodIndex()),e["c3.ad.technology"]=0===a.ub()?Conviva.Constants.AdType.CLIENT_SIDE:
|
|
5
|
+
Conviva.Constants.AdType.SERVER_SIDE,e["c3.ad.adManagerName"]=rU(a.nb()),e["c3.ad.adManagerVersion"]=rU(a.ob()),e["c3.ad.advertiserCategory"]=rU(null),e["c3.ad.advertiserId"]=rU(null),e["c3.ad.breakId"]=rU(null),e["c3.ad.campaignName"]=rU(null),e["c3.ad.category"]=rU(null),e["c3.ad.classification"]=rU(null),e["c3.ad.creativeName"]=rU(null),e["c3.ad.sequence"]=rU(a.rb()),e["c3.ad.sessionStartEvent"]=rU(null),e["c3.ad.unitName"]=rU(null),e["c3.ad.dayPart"]=rU(null),b=a.getWrapperAdIds().slice(-1)[0]||
|
|
6
|
+
a.getId(),c=a.getWrapperAdSystems().slice(-1)[0]||a.getAdSystem(),a=a.getWrapperCreativeIds().slice(-1)[0]||a.getCreativeId(),e["c3.ad.firstAdId"]=rU(b),e["c3.ad.firstAdSystem"]=rU(c),e["c3.ad.firstCreativeId"]=rU(a));return e},rU=function(a){return a?""+a:"NA"},wU=function(a){a.f.on(a.m,_.Tb,a.C.bind(a));a.f.on(a.m,_.Ub,a.F.bind(a));a.f.on(a.m,_.lc,a.L.bind(a));a.f.on(a.m,_.ic,a.l.bind(a));a.f.on(a.m,_.hc,a.l.bind(a));a.f.on(a.m,_.jc,a.l.bind(a));a.f.on(a.m,_.Vb,a.l.bind(a));a.f.on(a.m,_.mc,a.M.bind(a));
|
|
7
|
+
a.f.on(a.m,_.kc,a.K.bind(a));a.f.on(a.m,_.Wb,a.G.bind(a));a.f.on(a.m,_.bc,a.I.bind(a));a.f.on(a.m,_.ec,a.J.bind(a));a.f.on(a.m,_.Yb,a.H.bind(a));a.f.on(a.m,_.gc,a.T.bind(a));a.f.on(a.m,_.nc,a.P.bind(a));a.f.on(a.m,_.Xd,b=>{var c=b.detail;if(10003===c.code&&(a.g.debug("onAdError()"),!a.h)){b=Conviva.Constants.ErrorSeverity;switch(c.data.errorType){case 0:c="Ad Load Error";break;case 1:c="Ad Play Error";break;default:c=lU}null===a.a&&tU(a,null);a.a.reportAdError(c,b.FATAL);a.h=!0;a.g.debug("Ad Playback Failure");
|
|
8
|
+
uU(a,vU,c)}})},uU=function(a,b,c=lU){if(a.a){a.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED);switch(b){case vU:a.a.reportAdFailed(c,sU(null,a.B,a.A));break;case xU:a.a.reportAdSkipped();break;default:a.a.reportAdEnded()}a.a.release();a.a=null;a.j=!1}},tU=function(a,b){if(!a.o){a.h=!1;try{if(a.a=Conviva.Analytics.buildAdAnalytics(a.R()),b){const c=sU(b,a.B,a.A,a.m.isLive()),d=String(b.ob()),e={};e[Conviva.Constants.FRAMEWORK_NAME]=b.nb();e[Conviva.Constants.FRAMEWORK_VERSION]=
|
|
9
|
+
d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(c){a.g.error("Could not create ad analytics session",c)}}},yU=function(a,b){const 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,null,c);Conviva.Analytics.setDeviceMetadata(oU(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,
|
|
10
|
+
b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;b={};b[Conviva.Constants.FRAMEWORK_NAME]=_.ra;b[Conviva.Constants.FRAMEWORK_VERSION]=_.ea;a.a.setPlayerInfo(b)},zU=function(a){return a.m.getConfiguration().autoplay||!1},BU=function(a){if(!a.l)if(a.C)a.g.warn("Current session still active. No-op.");else{var b=a.m.getLoadedSource()||a.K,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||"N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=
|
|
11
|
+
new _.gp(b.url);b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.Nm(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.ra;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.z(c.customTags))for(const h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(()=>{a.g.debug("reportMiscellaneousMetrics()");if(AU(a)){var h=1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,
|
|
12
|
+
h);if(h=a.m.getStats()){h=h.decodedFrames;const k=h-a.H;a.H=h;isFinite(k)&&(a.g.debug("Current FPS",k),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,k))}}});a.C=!0;a.h=!0;a.I=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(h=>{h.ig(h.args)}));a.j=[]}},CU=function(a){if(!a.l&&a.a){const b=pU(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},AU=function(a){return null!==a.a&&a.C},DU=function(a){a.g.debug("terminateSession()");
|
|
13
|
+
a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.C=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.P=0,a.J=!1,a.j=[],a.H=0)},FU=function(a,b){const c=b.getConfiguration();a.a=!_.z(c.conviva)&&typeof c.conviva===_.He;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,a=new _.I(1,9,9E3),EU(b,a)):b.namespace()===_.hd&&(a.a=!1,
|
|
14
|
+
a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},GU=function(a){const b=[];typeof a===_.He&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.I(1,9,9001,{missingKeys:b});},EU=function(a,b){a.trigger(new _.H(_.Xd,{detail:b}))};var IU=class{constructor(a,b){this.m=a;this.R=b;this.B="";this.A=_.ra;this.g=new _.T("clpp.conviva.ad");this.f=new _.Kt;this.a=null;this.h=this.o=this.w=this.j=!1}initialize(a){this.g.debug("Initialize Ad Insights");this.h=this.w=!1;this.B=a.viewerId;this.A=a.playerName||_.ra;wU(this)}release(){this.g.debug("Release Ad Insights");this.w?this.g.debug(_.ja):(_.Xh(this.f),this.a&&uU(this,HU),this.f.release(),this.w=!0,this.j=this.h=!1)}destroy(){this.g.debug(_.Dd);this.o?this.g.debug(_.ha):this.o=!0}C(){this.g.debug(mU)}F(){this.g.debug(nU)}L(a){this.g.debug("onAdStarted()");
|
|
15
|
+
a=a.ad;this.j||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),tU(this,a));this.j=!1;this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.PLAYING);this.a.reportAdMetric(Conviva.Constants.Playback.RESOLUTION,a.eb(),a.cb());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.Pa())}l(a){this.g.debug("onAdStateChanged()");if(this.a){const b=c=>{this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,c)};switch(a.type){case _.ic:case _.jc:b(Conviva.Constants.PlayerState.PLAYING);
|
|
16
|
+
break;case _.hc:b(Conviva.Constants.PlayerState.PAUSED);break;case _.Vb:b(Conviva.Constants.PlayerState.BUFFERING)}}}M(){this.g.debug("onAdStopped()");this.a&&!this.h&&uU(this,HU)}K(){this.g.debug("onAdSkipped()");this.a&&uU(this,xU)}G(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")}I(){this.g.debug("onAdImpression()");if(this.a){const a=Conviva.Constants.Events;this.a.reportAdPlayerEvent(a.AD_IMPRESSION_START);this.a.reportAdPlayerEvent(a.AD_IMPRESSION_END)}}J(a){this.g.debug("onAdLoaded()");
|
|
17
|
+
const b=a.ad,c=()=>{this.j=!0;tU(this,b)};if(-1!==b.getPodIndex()||this.m.getPosition()>=this.m.getDuration()-5)c();else this.f.on(this.m,_.fg,()=>{this.m.getPosition()>=this.m.getDuration()-5&&(this.f.off(this.m,_.fg),c())})}H(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)}T(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)}P(){this.g.debug("onAdThirdQuartile()");this.a&&
|
|
18
|
+
this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_THIRD_QUARTILE)}},xU=0,HU=1,vU=2;var JU=class{constructor(a,b){this.m=a;this.f=new _.Kt;this.a=null;this.o=!1;this.G=!0;this.B=this.h=this.A=this.C=this.l=!1;this.P=0;this.J=!1;this.w=null;this.I=!1;this.g=b;this.K=this.F=null;this.j=[];this.H=0}initialize(a,b,c){this.l||(this.g.debug("Initialize conviva"),this.G=!1,this.F=_.dh(b),this.K=c,this.m=a,yU(this,this.F),this.f.on(this.m,_.We,this.ia.bind(this)),this.f.on(this.m,_.Qf,this.ba.bind(this)),this.f.on(this.m,_.Mc,this.L.bind(this)),this.f.on(this.m,_.tg,this.Y.bind(this)),this.f.on(this.m,
|
|
19
|
+
_.sg,this.V.bind(this)),this.f.on(this.m,_.Tb,this.R.bind(this)),this.f.on(this.m,_.Ub,this.T.bind(this)),this.f.on(this.m,_.pc,this.ca.bind(this)),this.f.on(this.m,_.Lc,this.ga.bind(this)),this.f.on(this.m,_.Xd,this.M.bind(this)),zU(this)&&(this.g.debug("Start a new session: A new video starts in autoplay."),BU(this)))}release(){this.g.debug("Release conviva");this.G?this.g.debug(_.ja):(_.Xh(this.f),AU(this)||this.o||!zU(this)||this.a&&this.a.reportPlaybackFailed("Exit Before Video Start"),AU(this)&&
|
|
20
|
+
DU(this),this.a=null,this.G=!0)}destroy(){this.g.debug(_.Dd);this.l?this.g.debug(_.ha):this.l=!0}reportAppEvent(a,b){let c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c}ia(){this.g.debug("onPlayRequest()");AU(this)||zU(this)?AU(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),AU(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"),
|
|
21
|
+
BU(this))}ba(a){this.g.debug(_.Ne);const b=c=>{if(this.o&&(this.g.debug("Creating conviva session (On Seek / Replay)"),yU(this,this.F),BU(this),CU(this),AU(this))){var d=this.m.getTrackManager();d=d.ra()||d.qb();d.width&&d.height&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,d.width,d.height);d.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,d.bandwidth/1E3)}AU(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,c)};switch(a.detail.currentState){case 3:b(Conviva.Constants.PlayerState.PLAYING);
|
|
22
|
+
break;case 4:b(Conviva.Constants.PlayerState.PAUSED);break;case 2:b(Conviva.Constants.PlayerState.BUFFERING);break;case 5:this.g.debug("onVideoEnded()"),AU(this)&&(this.w&&this.w.Ib()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.J=!0):DU(this))}}L(a){this.g.debug(_.Ie);if(AU(this)){if(a=a.detail,typeof a.width===_.r&&typeof a.height===_.r&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,
|
|
23
|
+
a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){const b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({ig:this.L.bind(this),args:a})}Y(){this.g.debug("onSeeking()");AU(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)}V(){this.g.debug("onSeeked()");AU(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)}ca(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a}R(a){this.g.debug(mU);
|
|
24
|
+
var b=a.ad;a=0===b.Qa();const c=qU(b.getPodIndex());AU(this)||zU(this)||!a||BU(this);if(AU(this)){a=0===b.ub()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;let d=0;const e={};1===b.fb()&&(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.a.reportAdBreakStarted(a,b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")}T(){this.g.debug(nU);
|
|
25
|
+
AU(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.J&&DU(this))}M(a){this.g.debug(_.Ke);if(this.o&&this.I)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===_.D&&(d=Conviva.Constants.ErrorSeverity.FATAL,AU(this)||BU(this));AU(this)?(this.g.debug("Report error",c,d),this.a.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.g.debug("Video Playback Failure"),
|
|
26
|
+
this.I=!0,DU(this))):this.j.push({ig:this.M.bind(this),args:a})}}ga(){this.g.debug("onAutoPlayBlocked()");AU(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,AU(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))}};var KU=class{constructor(){this.h=this.f=null;this.a=!1;this.g=new _.T("clpp.conviva")}onPlayerCreated(a){this.f=new JU(a,this.g)}onContentWillLoad(a,b){FU(this,a);if(this.a){var c=a.getConfiguration();c=_.dh(c.conviva||{});try{GU(c);const d=c.enableAdInsights||!1;this.f.initialize(a,c,b);d&&(this.h=new IU(a,()=>this.f.a),this.h.initialize(c))}catch(d){d instanceof _.I?EU(a,d):EU(a,new _.I(1,9,9002,d,d))}}}onContentLoaded(){this.a&&CU(this.f)}onPlayerWillDestroy(){this.a&&(this.a=!1,this.f.destroy(),
|
|
27
|
+
this.f=null,this.h&&(this.h.destroy(),this.h=null))}onPlayerWillRelease(){this.a&&(this.f.release(),this.h&&this.h.release())}id(){return"conviva"}reportAppEvent(a,b){return this.f?this.f.reportAppEvent(a,b):!1}};_.x("clpp.conviva.ConvivaPlugin",KU);KU.prototype.reportAppEvent=KU.prototype.reportAppEvent;KU.Id="conviva";_.Qn(new class{create(){return new KU}});};f.call(g, window);
|