@castlabs/prestoplay 6.29.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 +22 -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 +129 -127
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +619 -621
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +92 -89
- package/cjs/cl.externs.js +36 -35
- 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 +25 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +352 -351
- 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 +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 +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 -99
- package/cl.conviva.js +27 -27
- package/cl.core.js +486 -486
- package/cl.crypto.js +9 -9
- package/cl.dash.js +84 -83
- package/cl.externs.js +36 -35
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -18
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +303 -303
- 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 +11 -1
package/cjs/cl.muxdata.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
data:
|
|
4
|
-
f.video_source_url=_.
|
|
5
|
-
d.language);return f}});a.g.debug("Mux SDK options",b);return b},
|
|
6
|
-
a.a.on(a.m,_.
|
|
7
|
-
_.
|
|
8
|
-
request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.
|
|
9
|
-
b)}})},
|
|
10
|
-
_.r.emit=function(a,b){if(null===this.w)throw new _.
|
|
11
|
-
_.r.
|
|
12
|
-
_.r.
|
|
13
|
-
request_url:_.
|
|
14
|
-
_.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.M.
|
|
15
|
-
var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,
|
|
2
|
+
var f=function(window){var fB=function(a){switch(a.type){case 1:return cB;case 2:return dB;case 3:return eB}},hB=function(a){var b=Object.keys(a).find(function(c){return gB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},iB=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.wi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.tl.bind(this);this.F=this.sl.bind(this)},kB=function(a){var b={debug:!0,
|
|
3
|
+
data:jB(a)};a.f&&a.f.muxOptionsOverride&&_.M.xd(a.f.muxOptionsOverride)&&(b=_.M.ra(b,a.f.muxOptionsOverride));b=_.M.ra(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager(),e=a.m.getSurface(),f={player_is_paused:a.m.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){var g=new _.wn(c.url);
|
|
4
|
+
f.video_source_url=_.xn(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().qa(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.oa())&&d.language&&(f.player_language_code=
|
|
5
|
+
d.language);return f}});a.g.debug("Mux SDK options",b);return b},jB=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.ya,player_software_name:_.ya,player_software_version:_.ia,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ia};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},lB=function(a){a.a.on(a.m,_.zg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.zg,b)});a.a.on(a.m,_.pf,function(){return a.emit(_.pf)});
|
|
6
|
+
a.a.on(a.m,_.ad,a.pl.bind(a));a.a.on(a.m,_.ig,a.rl.bind(a));a.a.on(a.m,_.Ng,function(){return a.emit(_.ag)});a.a.on(a.m,_.Mg,function(){return a.emit(_.$f)});a.a.on(a.m,_.qe,a.ql.bind(a));a.a.on(a.m,_.jc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.kc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Bc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.xc,function(){return a.emit("adpause")});a.a.on(a.m,_.zc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
|
|
7
|
+
_.Cc,function(){return a.emit("adended")});a.a.on(a.m,_.oc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.wc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Dc,function(){return a.emit("adthirdquartile")});a.j.Od(a.G);a.j.wh(a.F);a.a.on(a.m,_.qe,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.wn(b.uris[b.uriIndex]);b={request_start:c,request_type:fB(b),
|
|
8
|
+
request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.wn(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:fB(b),request_hostname:e.a,request_error:""+fB(b)+"LoadError",request_error_code:void 0===f?-1:void 0!==f.response?f.response.status:void 0!==f.status?f.status:-1,request_error_text:c.toString()};a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",
|
|
9
|
+
b)}})},mB=function(a){_.zi(a.a);a.j.Rf(a.G);a.j.Dj(a.F)},nB=function(){this.f=this.m=null;this.a=!1;this.g=new _.L("clpp.muxdata")},oB=function(a){return!_.M.R(a)&&typeof a.init===_.ue&&typeof a.emit===_.ue},pB=function(a,b){a.trigger(new _.Q(_.qe,{detail:b}))},qB=function(){},cB="manifest",dB="media",eB="encryption",gB=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=iB.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,kB(this))}catch(d){throw this.h=!1,mB(this),new _.O(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=jB(this),this.emit("videochange",a),this.l=!1);lB(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ma):(mB(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Vd);this.A?this.g.debug(_.la):(this.A=!0,this.emit("destroy"))};
|
|
10
|
+
_.r.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.r.pl=function(a){this.g.debug(_.af);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Va())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.rl=function(a){this.g.debug(_.ff);switch(a.detail.currentState){case 1:this.m.getConfiguration().autoplay&&this.emit(_.pf);break;case 3:this.emit(_.Af);break;case 4:this.emit(_.lf);break;case 5:this.emit(_.pe)}};
|
|
11
|
+
_.r.ql=function(a){this.g.debug(_.cf);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.P){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=b+" castlabs-error-data:"+JSON.stringify(a.data);this.emit(_.qe,{player_error_code:a.code,player_error_message:b})}};
|
|
12
|
+
_.r.tl=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.wn(b.uris[b.uriIndex]);a={request_start:e,request_type:fB(b),request_hostname:g.a,request_id:hB(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
|
|
13
|
+
request_url:_.xn(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.sl=function(a){a.requestStartTimestamp=Date.now()};_.w(nB,_.Zv);_.r=nB.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new iB(a,this.g)};
|
|
14
|
+
_.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.M.jb(c.muxdata);try{var d=[];typeof c===_.$e&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.O(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.M.R(e.muxdata)&&typeof e.muxdata===_.$e){var f=e.muxdata;d=oB(f.muxLib)?f.muxLib:window.mux;if(!oB(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.O(1,9,9301);pB(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
|
|
15
|
+
var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,pB(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&pB(this.m,c),c;}};_.K("clpp.muxdata.MuxDataPlugin",nB);nB.prototype.emit=nB.prototype.emit;nB.Id="mux";qB.prototype.create=function(){return new nB};_.bp(new qB);};
|
|
16
16
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
17
17
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
18
18
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.onboard.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
serverCertificate:_.
|
|
4
|
-
|
|
5
|
-
_.K("clpp.onboard.register",
|
|
2
|
+
var f=function(window){var aB=function(){this.g=new _.L("clpp.onboard");this.a=new Set},bB=function(a,b){function c(n){return n&&(_.R.startsWith(n,_.ze)||_.R.startsWith(n,"http://")||_.R.startsWith(n,"//"))?n:d+n}var d=b.baseUrl;_.R.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=b.serverCertificate,l=_.Zp("V2"),m=new _.$p(a);m.eb(_.Md,{licenseUrl:e,videoRobustness:[_.Db,void 0],audioRobustness:[_.Cb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,
|
|
3
|
+
serverCertificate:_.aq(h,l),modifiers:{licenseRequest:_.Rq,licenseResponse:_.Wq}});m.eb(_.Id,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Tq,licenseResponse:_.Uq,extractContentId:_.Pq,certificateRequest:_.Vq}});m.eb(_.Kd,{licenseUrl:f,modifiers:{licenseRequest:_.Rq}});_.Wn(m)};_.w(aB,_.bv);aB.prototype.uninstall=function(){for(var a=_.v(this.a),b=a.next();!b.done;b=a.next())delete _.Vn[b.value];this.a.clear()};
|
|
4
|
+
aB.prototype.beforeLoad=function(a){a=a.getConfiguration().drm;var b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,serverCertificate:a.serverCertificate,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),bB(b,a),this.a.add(b))};aB.prototype.id=function(){return"onboard"};_.K("clpp.onboard.OnboardComponent",aB);
|
|
5
|
+
_.K("clpp.onboard.register",bB);};
|
|
6
6
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
7
7
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
8
8
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.persistent.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
_.r.store=function(a,b){var c;return _.I(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
|
|
9
|
-
|
|
10
|
-
_.K("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,t,u,y,
|
|
11
|
-
[];u=_.v(d);for(y=u.next();!y.done;y=u.next())
|
|
12
|
-
new _.
|
|
13
|
-
_.K("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:b=
|
|
14
|
-
6);case 6:return _.x(l,_.
|
|
15
|
-
_.K("clpp.persistent.getSessionStorage",function(){return
|
|
16
|
-
|
|
2
|
+
var f=function(window){var KA="A persistent DRM session already exists for: ",LA="No DRM configuration.",MA="clpp.persistent",NA="clpp.persistent.SimpleSessionStorage",OA=function(a){var b=[];a=_.v(a.h.keys());for(var c=a.next();!c.done;c=a.next())b.push(c.value.sessionId);return b},PA=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,_.ws(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.h.get(c))&&a.F&&(e.Cc=new _.om,d.push(e.Cc));a.g.debug("Attempting to remove session",
|
|
3
|
+
b);d.push(c.remove());return f["return"](Promise.all(d))})},RA=function(a,b){a.L=QA;a.O=[];a.H=!0;return _.Zr(a,b)},TA=function(a,b,c,d,e,f){a.L=SA;var g=new Map,h=_.Bs(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.hf,persistentState:_.Sf,sessionTypes:[_.nf],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.is(a,
|
|
4
|
+
g)},UA=function(){this.g=new _.L(NA)},VA=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=a.audioCapabilities||[],d=a.videoCapabilities||[],e=a.serverCertificate||[],f=a.drmConfig||{};return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri||""),serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},WA=function(a,b){var c=_.Yn(a),d=_.On([{drm:a}]);d.drm=a;var e=new _.Vr({Db:b,onError:function(){},Kg:function(){},
|
|
5
|
+
Jg:function(){},onEvent:function(){},getConfiguration:function(){return d},td:function(){return null}});e.f=c;return e},ZA=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=XA;e=YA;if(!a)return e.debug(LA),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(KA,f),q["return"]();h=WA(a,c);_.F(q,3,4);return _.x(q,RA(h,b),6);case 6:return _.x(q,_.ps(h),7);case 7:return _.x(q,_.qs(h),8);case 8:return l=h.getDrmInfo(),
|
|
6
|
+
m=b.map(function(t){return{contentType:_.Fn(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=OA(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.Eh(q),_.x(q,h.destroy(),10);case 10:_.Fh(q);break;case 3:throw p=_.H(q),e.error("Error while persisting DRM session "+f),new _.O(1,6,6200,null,p);}})},$A=function(){this.g=new _.L(MA)},
|
|
7
|
+
QA=1,SA=2;_.r=UA.prototype;
|
|
8
|
+
_.r.store=function(a,b){var c;return _.I(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),btoa(c));
|
|
9
|
+
_.z(d)})};_.r.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](VA(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.z(b)})};_.r.clear=function(){return _.I(function(a){window.localStorage.clear();_.z(a)})};_.r.getName=function(){return NA};_.K("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.M.R(a)||(_.M.Tb(a.store)||c.push("store"),_.M.Tb(a.get)||c.push("get"),_.M.Tb(a["delete"])||c.push("delete"),_.M.Tb(a.clear)||c.push("clear"),_.M.Tb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw YA.warn("Invalid session storage implementation"),new _.O(1,6,6202,{missingMethods:b});XA=a});
|
|
10
|
+
_.K("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,t,u,y,D,C,B,E,A,J,N,V;return _.I(function(U){switch(U.a){case 1:f=XA;g=YA;h=function(qa,wa){return new _.O(1,6,6200,qa,wa)};l=_.Sn(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(LA);m=b.offlineId;if(typeof m!==_.lg||!m.length)throw h("Missing offline id.");return _.x(U,f.get(m),2);case 2:if(n=U.f)return g.debug(KA,m),U["return"]();p=_.Mn();q=new _.Ym;t=
|
|
11
|
+
[];u=_.v(d);for(y=u.next();!y.done;y=u.next())D=y.value,C=new D,_.ii(C.id())||(C.install(),_.ki(C),t.push(C));B=null;_.F(U,3,4);return _.x(U,_.Vv(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return B=U.f,B.configure(p.manifest),_.x(U,B.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:E=U.f;if(!E.periods.length)throw h(null,
|
|
12
|
+
new _.O(_.P,4,4014));A=_.nv(E.periods);return _.x(U,ZA(b,A,q),4);case 4:for(_.Eh(U);t.length;)J=t.shift(),J.uninstall(),_.hi["delete"](J.id());N=[];B&&N.push(B.stop());N.push(q.destroy());return _.x(U,Promise.all(N),9);case 9:_.Fh(U);break;case 3:V=_.H(U);if(V instanceof _.O&&6200===V.code)throw V;throw h(null,V);}})});
|
|
13
|
+
_.K("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:b=XA;c=YA;if(!_.M.ia(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.F(l,2,3);return _.x(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.Ym;d=WA(f.drmConfig,e);return _.x(l,TA(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
|
|
14
|
+
6);case 6:return _.x(l,_.ps(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.x(n,PA(d,m),2);c.debug("successfully removed session with id",m);_.z(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.Eh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.Fh(l);break;case 2:throw h=_.H(l),c.error("Failed to remove session"),new _.O(1,6,6201,null,h);}})});
|
|
15
|
+
_.K("clpp.persistent.getSessionStorage",function(){return XA});var XA=new UA,YA=new _.L(MA);_.w($A,_.bv);$A.prototype.id=function(){return _.mf};$A.prototype.f=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().drm;if(!d)return c.g.debug("No DRM configuration found for loaded source."),g["return"]();c.g.debug("Persisting DRM session ID: "+d.offlineId);e=a.getNetworkEngine();_.F(g,2);return _.x(g,ZA(d,b,e),4)}if(2!=g.a)return a.trigger(new _.Q(_.he,{offlineId:d.offlineId})),_.G(g,0);f=_.H(g);a.onError(f);_.z(g)})};
|
|
16
|
+
$A.prototype.a=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=XA,_.F(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.H(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.K("clpp.persistent.PersistentLicenseComponent",$A);};
|
|
17
17
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
18
18
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
19
19
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.playlist.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
_.r.
|
|
4
|
-
_.r.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.vd(b),0)})};_.r.
|
|
5
|
-
_.r.vd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&
|
|
6
|
-
_.r.remove=function(a){if(0<this.a.length&&
|
|
7
|
-
|
|
2
|
+
var f=function(window){var HA=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Di.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Ga.bind(this)},IA=function(a){a.trigger(new _.Q(_.Df))},JA=function(a,b){return 0<=b&&b<a.a.length};_.w(HA,_.Di);_.r=HA.prototype;_.r.on=function(a,b,c){return _.Di.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.Di.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.Di.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
|
|
3
|
+
_.r.le=function(){return this.a};_.r.Mb=function(){return 0<this.a.length&&JA(this,this.f)?this.a[this.f]:null};_.r.Fi=function(){var a=this.f+1;return 0<this.a.length&&JA(this,a)?this.a[a]:null};_.r.Pm=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.pe,this.j),this.vd(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.pe,this.j)};_.r.Ga=function(){this.next()};
|
|
4
|
+
_.r.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.vd(b),0)})};_.r.Ge=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.x(c,a.vd(b),0)})};
|
|
5
|
+
_.r.vd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&JA(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Mb())&&!1===d.skippable?e["return"]():d?_.x(e,c.l(d),3):e.C(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.Q(_.Cf,{item:d}));_.z(e)})};_.r.append=function(a){this.a.push(a);IA(this)};_.r.Ki=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Mb();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));IA(this)}};
|
|
6
|
+
_.r.remove=function(a){if(0<this.a.length&&JA(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);IA(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;IA(this)};_.K("clpp.Playlist",HA);HA.prototype.clear=HA.prototype.clear;HA.prototype.remove=HA.prototype.remove;HA.prototype.insert=HA.prototype.Ki;HA.prototype.append=HA.prototype.append;HA.prototype.goTo=HA.prototype.vd;HA.prototype.previous=HA.prototype.Ge;HA.prototype.next=HA.prototype.next;
|
|
7
|
+
HA.prototype.onEnded=HA.prototype.Ga;HA.prototype.stop=HA.prototype.stop;HA.prototype.start=HA.prototype.start;HA.prototype.isStarted=HA.prototype.Pm;HA.prototype.getUpcoming=HA.prototype.Fi;HA.prototype.getCurrent=HA.prototype.Mb;HA.prototype.getQueue=HA.prototype.le;HA.prototype.getPosition=HA.prototype.getPosition;HA.prototype.off=HA.prototype.off;HA.prototype.one=HA.prototype.one;HA.prototype.on=HA.prototype.on;};
|
|
8
8
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
9
9
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
10
10
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.simid.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
_.
|
|
4
|
-
f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var h=
|
|
5
|
-
g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);
|
|
6
|
-
d.a){a.h=b.sessionId;
|
|
7
|
-
closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=
|
|
8
|
-
args:c}},
|
|
9
|
-
this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},
|
|
10
|
-
e);
|
|
11
|
-
500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.Q(_
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new
|
|
15
|
-
_.r.
|
|
16
|
-
b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.
|
|
17
|
-
_.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.
|
|
2
|
+
var f=function(window){var pA="No surface found. Can not attach frame!",qA="SIMID:Media:timeupdate",rA="Starting creative",wA=function(a,b){var c=this;this.f=a;this.w=b;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";var d=this.w.style;d.className?this.a.classList.add(d.className):(this.a.style.border=_.Ze,this.a.style.backgroundColor="transparent",this.a.style.transition="opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.Ze,this.a.style.overflow=
|
|
3
|
+
_.we);this.a.classList.add(_.sd);this.o=function(e){if(e.source===c.a.contentWindow&&(e=(e=e.data)?typeof e===_.lg?JSON.parse(e):e:null))if(e.type)switch(c.g.info("Received message ["+e.messageId+"] '"+e.type+"':",e.args),e.type){case "createSession":sA(c,e);break;case "resolve":e=e.args;var f=c.j.get(e.messageId);f&&f.resolve(e);break;case "reject":e=e.args;(f=c.j.get(e.messageId))&&f.reject(e);break;case "SIMID:Creative:requestResize":f=c.f;var g=e.args;f.g.info("Creative requested resize",g);if(f.m&&
|
|
4
|
+
f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var h=tA(f,g.mediaDimensions);f.m.getSurface().getMedia().style.left=h.left;f.m.getSurface().getMedia().style.top=h.top;f.m.getSurface().getMedia().style.width=h.width;f.m.getSurface().getMedia().style.height=h.height}g.creativeDimensions&&(g=tA(f,g.creativeDimensions),f.a.a.style.left=
|
|
5
|
+
g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);uA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.L("clpp.simid.SimidPlayer");vA(this.f,this)},zA=function(a){var b=xA(a,"SIMID:Player:startCreative",void 0);yA(a,b).then(function(){var c=a.f;c.g.info(rA);c.m.trigger(new _.Q(_.cg));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},sA=function(a,b){var c;_.I(function(d){if(1==
|
|
6
|
+
d.a){a.h=b.sessionId;uA(a,b);_.F(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:e.m.isMuted()||!1,volume:e.m.getVolume()||0,navigationSupport:"adHandles",
|
|
7
|
+
closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=xA(a,"SIMID:Player:init",e);e=yA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.G(d,0);c=_.H(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.z(d)})},xA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
|
|
8
|
+
args:c}},AA=function(a,b){a.h?(b.type!==qA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},uA=function(a,b){AA(a,xA(a,"resolve",{messageId:b.messageId,value:void 0}))},yA=function(a,b){return new Promise(function(c,d){new BA(a.j,c,d,b);AA(a,b)})},BA=function(a,b,c,d){var e=this;var f=void 0===f?-1:f;this.f=a;this.l=b;this.j=c;this.h=d;
|
|
9
|
+
this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},CA=function(){this.g=new _.L("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.vl.bind(this);this.f=null;this.o=!1},DA=function(a,b,c){return new ResizeObserver(function(){if(a.a.h){var d=a.a,e={videoDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},creativeDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},fullscreen:c.isFullscreen()};e=xA(d,"SIMID:Player:resize",
|
|
10
|
+
e);AA(d,e)}})},EA=function(a){this.m=a;this.a=null;this.g=new _.L("clpp.simid.Loader");this.h=!1;this.f=null},tA=function(a,b){var c=a.getContainer(),d=c.clientWidth;c=c.clientHeight;return{top:b.y/c*100+"%",left:b.x/d*100+"%",width:b.width/d*100+"%",height:b.height/c*100+"%"}},vA=function(a,b){a.g.info("SIMID Session created");a.a=b},FA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},
|
|
11
|
+
500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.Q(_.dg))},GA=function(){};
|
|
12
|
+
wA.prototype.load=function(a){window.addEventListener(_.Se,this.o);this.h="";this.l=0;var b=this.f.url();this.g.info('Loading "'+b+'" as src of iFrame');this.a.src=b;this.g.info("Attaching iFrame");a.appendChild(this.a)};wA.prototype.unload=function(){FA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Se,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};
|
|
13
|
+
BA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};BA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(CA,_.Zv);_.r=CA.prototype;_.r.id=function(){return"simid"};_.r.onPlayerCreated=function(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new EA(a)};
|
|
14
|
+
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new wA(this.h,b.simid),b=c.getContainer(),this.j=DA(this,b,c),this.j.observe(b),a.on(_.zg,this.w)):this.g.warn(pA)}};
|
|
15
|
+
_.r.vl=function(){var a=this.m.getPosition();a:if(this.f&&a<this.f.startTime+this.f.duration)var b=this.f;else{for(b=0;b<this.l.length;b++){var c=this.l[b],d=c.startTime+c.duration;if(a>=c.startTime-(c.preload||5)&&a<d){b=c;break a}}b=null}b?b===this.f?(b=b.startTime,this.a&&(c=a>=b,!this.o&&c&&(zA(this.a),this.o=!0,this.g.info(rA)),c&&(c=this.a,AA(c,xA(c,qA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(pA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
|
|
16
|
+
b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.Zv.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.zg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.r=EA.prototype;_.r.release=function(){this.g.info("Releasing loader")};
|
|
17
|
+
_.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.O(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.O(1,10,10100,"No surface");return a};_.r.Di=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};GA.prototype.create=function(){return new CA};_.bp(new GA);};
|
|
18
18
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
19
19
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
20
20
|
else{_=this.clpp._;(f.call(g,this));}
|