@castlabs/prestoplay 6.31.0 → 6.32.0-beta.2
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 +38 -0
- package/README.md +2 -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 -125
- package/cjs/cl.cdn.js +13 -0
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +615 -610
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +101 -95
- package/cjs/cl.externs.js +113 -44
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +78 -78
- 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 -350
- 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 +6 -6
- 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 +71 -71
- 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 +4 -4
- package/cjs/cl.youbora.js +40 -40
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +102 -101
- package/cl.cdn.js +7 -0
- package/cl.conviva.js +27 -27
- package/cl.core.js +498 -495
- package/cl.crypto.js +9 -9
- package/cl.dash.js +91 -87
- package/cl.externs.js +109 -44
- 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 +20 -20
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +301 -300
- 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 +61 -61
- 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 +10 -1
- package/typings.d.ts +328 -114
package/cjs/cl.cdn.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var FV="clpp.cdn.CdnChallengeComponent",GV=function(){this.g=new _.M(FV);this.f=new WeakMap;this.a=null},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.xf.onChallengeStart;typeof f===_.ue&&f();g=HV(d);_.F(x,2);return _.y(x,IV(g),
|
|
3
|
+
4);case 4:k=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.xf.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",
|
|
4
|
+
t),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.ef=u);D=c.xf.onCatReceived;u&&typeof D===_.ue&&D(u);C=c.xf.onChallengeComplete;typeof C===_.ue&&C({mq:z,lq:B,ef: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
|
+
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
|
+
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
|
+
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.f.get(a)){var e=a.getNetworkEngine();c.gg&&e.lh(c.gg);c.hg&&e.Ve(c.hg);this.f["delete"](a)}var f={ef:null,xf:d,gg:null,hg:null};c=a.getNetworkEngine();f.gg=function(g){!f.ef||1!==g.type&&2!==g.type||(g.headers["x-cat"]=f.ef)};f.hg=function(g){if(428===g.status&&g.request&&1===g.request.type){if(b.a)return b.a;b.a=KV(b,g,f)["finally"](function(){b.a=
|
|
9
|
+
null});return b.a}if(g.request&&3===g.request.type&&(g=g.headers["x-cat"])){f.ef=g;var k=d.onCatReceived;typeof k===_.ue&&k(g)}};c.vg(f.gg);c.yd(f.hg);this.f.set(a,f)}};_.K(FV,GV);};
|
|
10
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
11
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
12
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
13
|
+
})();
|
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
|
-
"N/A"
|
|
14
|
-
|
|
15
|
-
|
|
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=_.N.
|
|
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.
|
|
26
|
-
break;case 4:b(Conviva.Constants.PlayerState.PAUSED);break;case 2:b(Conviva.Constants.PlayerState.BUFFERING);break;case 5:this.g.debug("onVideoEnded()"),
|
|
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};_.K("clpp.conviva.ConvivaPlugin",
|
|
2
|
+
var f=function(window){var eV="Ad Error",fV="onAdBreakStarted()",gV="onAdBreakStopped()",hV=function(a){function b(l,m){l in k||!m||(k[l]=m)}var c=_.Qj(),d=Conviva.Constants.DeviceType.DESKTOP,e=Conviva.Constants.DeviceCategory.WEB,f=c.os;c=c.osVersion.name;var g="";_.tj()&&(g="Apple");_.sj()?(g="Google",d=Conviva.Constants.DeviceType.SETTOP,e=Conviva.Constants.DeviceCategory.CHROMECAST):_.uj()?(d=Conviva.Constants.DeviceType.MOBILE,/(android)/i.test(navigator.userAgent)?e=Conviva.Constants.DeviceCategory.ANDROID_DEVICE:
|
|
3
|
+
_.tj()&&(e=Conviva.Constants.DeviceCategory.APPLE_DEVICE)):_.rj()||_.qj()||_.pj("Hisense")?(d=Conviva.Constants.DeviceType.SMARTTV,e=Conviva.Constants.DeviceCategory.SMART_TV,_.rj()?(c="",g="LG",e=Conviva.Constants.DeviceCategory.LG_TV):_.qj()?(g="Samsung",e=Conviva.Constants.DeviceCategory.SAMSUNG_TV):_.pj("Hisense")&&(c="",g="Hisense")):_.pj("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},iV=function(a){return a?Conviva.Constants.StreamType.LIVE:Conviva.Constants.StreamType.VOD},jV=function(a){return 0===a?"Pre-roll":-1===a?"Post-roll":"Mid-roll"},lV=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]=iV(!!d);e[Conviva.Constants.ASSET_NAME]=eV;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"]=kV(a.getId()),e["c3.ad.creativeId"]=kV(a.getCreativeId()),e["c3.ad.system"]=kV(a.getAdSystem()),e["c3.ad.mediaFileApiFramework"]=kV(a.getApiFramework()),e["c3.ad.advertiser"]=kV(a.getAdvertiserName()),e["c3.ad.position"]=jV(a.getPodIndex()),e["c3.ad.technology"]=0===a.pb()?
|
|
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
|
+
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
|
+
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.Xk.bind(a));a.f.on(a.m,_.jc,a.Yk.bind(a));a.f.on(a.m,_.Bc,a.fl.bind(a));a.f.on(a.m,_.yc,a.Vf.bind(a));a.f.on(a.m,_.xc,a.Vf.bind(a));a.f.on(a.m,_.zc,a.Vf.bind(a));a.f.on(a.m,_.kc,a.Vf.bind(a));a.f.on(a.m,_.Cc,a.gl.bind(a));a.f.on(a.m,_.Ac,a.el.bind(a));a.f.on(a.m,_.lc,a.Zk.bind(a));a.f.on(a.m,_.rc,a.al.bind(a));a.f.on(a.m,_.tc,a.cl.bind(a));a.f.on(a.m,_.nc,a.$k.bind(a));a.f.on(a.m,_.vc,a.An.bind(a));a.f.on(a.m,_.Dc,a.hl.bind(a));a.f.on(a.m,_.qe,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=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
|
+
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
|
+
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
|
+
"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.Fi(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
|
+
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.Xk=function(){this.g.debug(fV)};_.r.Yk=function(){this.g.debug(gV)};
|
|
17
|
+
_.r.fl=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.Vf=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.gl=function(){this.g.debug("onAdStopped()");this.a&&!this.j&&qV(this,EV)};_.r.el=function(){this.g.debug("onAdSkipped()");this.a&&qV(this,pV)};
|
|
19
|
+
_.r.Zk=function(){this.g.debug("onAdClicked()");this.a&&this.a.reportAdPlayerEvent("AdClicked")};_.r.al=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.cl=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.$k=function(){this.g.debug("onAdFirstQuartile()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_FIRST_QUARTILE)};_.r.An=function(){this.g.debug("onAdMidPoint()");this.a&&this.a.reportAdPlayerEvent(Conviva.Constants.Events.AD_MID_QUARTILE)};
|
|
21
|
+
_.r.hl=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.bo.bind(this)),this.f.on(this.m,_.kg,this.ml.bind(this)),this.f.on(this.m,_.bd,this.ai.bind(this)),this.f.on(this.m,_.Og,this.ll.bind(this)),this.f.on(this.m,_.Ng,this.kl.bind(this)),this.f.on(this.m,_.ic,this.il.bind(this)),this.f.on(this.m,_.jc,this.jl.bind(this)),this.f.on(this.m,_.Fc,this.Gn.bind(this)),this.f.on(this.m,_.ad,this.Hn.bind(this)),
|
|
23
|
+
this.f.on(this.m,_.qe,this.bi.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.bo=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.ml=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
|
+
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.ai=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({Fi:this.ai.bind(this),args:a})};
|
|
28
|
+
_.r.ll=function(){this.g.debug("onSeeking()");uV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)};_.r.kl=function(){this.g.debug("onSeeked()");uV(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)};_.r.Gn=function(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a};
|
|
29
|
+
_.r.il=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.jl=function(){this.g.debug(gV);uV(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.K&&yV(this))};
|
|
31
|
+
_.r.bi=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({Fi:this.bi.bind(this),
|
|
32
|
+
args:a})}};_.r.Hn=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
|
+
_.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;});}
|
|
36
36
|
else{_=this.clpp._;(f.call(g,this));}
|