@castlabs/prestoplay 6.2.6 → 6.2.8
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 +43 -0
- package/README.md +1 -1
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +103 -103
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +377 -376
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +69 -68
- package/cjs/cl.externs.js +64 -33
- package/cjs/cl.freewheel.js +23 -23
- package/cjs/cl.hls.js +44 -43
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +21 -21
- package/cjs/cl.mse.js +251 -248
- package/cjs/cl.muxdata.js +11 -11
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.smooth.js +69 -69
- package/cjs/cl.thumbnails.js +22 -22
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +26 -26
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +24 -0
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +16 -16
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +82 -82
- package/cl.conviva.js +27 -27
- package/cl.core.js +333 -329
- package/cl.crypto.js +8 -8
- package/cl.dash.js +64 -62
- package/cl.externs.js +60 -33
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +37 -36
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +24 -24
- package/cl.ima.js +16 -16
- package/cl.mse.js +223 -220
- package/cl.muxdata.js +9 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +4 -4
- package/cl.smooth.js +57 -57
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +21 -21
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -0
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +14 -14
- package/package.json +1 -1
package/cjs/cl.verimatrix.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.C=d;this.B=b;this.w=
|
|
4
|
-
_
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var f=function(window){var Qq="VerimatrixVCAS",Rq="clpp.verimatrix.Vcas",Sq="clpp.verimatrix.VcasComponent",Yq=function(a){_.Aj.call(this,Qq);var b={};b[Tq]=Tq;b[Uq]=Uq;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Vq:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,k=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?Wq:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
|
|
3
|
+
this.C=d;this.B=b;this.w=Xq(this,e);this.o=Xq(this,f);this.m=Xq(this,g);this.j=k;this.G=l;this.D=m;this.f=new _.D(Rq);_.ch(this.w)?this.f.warn(_.tb):this.Fa(_.Gc,{licenseUrl:this.w,videoRobustness:[_.ib,void 0],audioRobustness:[_.hb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.ch(this.o)?this.f.warn(_.Za):this.Fa(_.Fc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
|
|
4
|
+
_.ch(this.m)?this.f.warn(_.Ea):_.ch(this.j)?this.f.warn(_.Da):this.Fa(_.Ec,{licenseUrl:this.m,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.M.bind(this),extractContentId:this.I.bind(this)}})},Xq=function(a,b){if(a.C===Vq){var c=Object.assign({},{deviceId:_.kj(_.Zg(a.A))},a.a&&{authenticator:_.kj(_.Zg(a.a))});return b+_.Xj(c)}return b},Zq=function(){this.l=null;this.a=new _.D(Sq)};_.u(Yq,_.Aj);
|
|
5
|
+
Yq.prototype.h=function(a,b){if(this.C===$q){var c=this.B[Uq],d={};d[this.B[Tq]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Yq.prototype.I=function(a,b){var c=_.bk(b);switch(this.D){case ar:c=_.Xj({r:c,uk:this.G},!0)}return c};Yq.prototype.K=function(a,b){this.h(a,b);_.ek(b)};Yq.prototype.M=function(a,b){_.fk(b)};_.A(Rq,Yq);Yq.prototype.constructor=Yq.prototype.constructor;Yq.NAME=Qq;var Vq="query-string",$q="http-header";
|
|
6
|
+
Yq.LicenseRequestVuidLocation={QUERY_STRING:Vq,HTTP_HEADER:$q};var Tq="DeviceId",Uq="Authenticator";Yq.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Tq,AUTHENTICATOR_HEADER:Uq};var Wq="keyid",ar="contentid-siteid";Yq.FairPlayAssetIdStrategy={KEYID:Wq,CONTENTID_SITEID:ar};_.u(Zq,_.un);_.h=Zq.prototype;_.h.Ea=function(a){this.l=a};_.h.va=function(){this.l=null};_.h.Ub=function(){var a=this.l.getConfiguration();if(a.drm&&a.drm.env===Qq){a=a.drm.customData;if(!a)throw new _.J(_.K,7,7100,_.Hc);a=new Yq(a);this.a.info("Registering the Verimatrix VCAS Ultra environment");_.vj(a)}};_.h.release=function(){};_.h.id=function(){return"verimatrix-vcas"};_.A(Sq,Zq);};
|
|
7
7
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
8
8
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
9
9
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vimond.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b){a.l.trigger(new _.
|
|
4
|
-
|
|
5
|
-
_.h.
|
|
6
|
-
_.h.
|
|
7
|
-
b.B=e;return _.v(k,b.
|
|
8
|
-
_.h.
|
|
9
|
-
l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.
|
|
10
|
-
_.
|
|
11
|
-
f)):a.a.error(c.toString());_.w(k)})};_.h.dispose=function(){this.a.debug(_.
|
|
12
|
-
_.h.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.H.R(b.vimond)&&typeof b.vimond===_.Ad)?a.namespace()===_.
|
|
13
|
-
c=b.failIfUnreachable;typeof c!==_.
|
|
14
|
-
_.h.
|
|
2
|
+
var f=function(window){var Gq="Registering listeners",Hq="clpp.vimond.VimondPlugin",Iq=function(a,b,c,d,e){this.D=a;this.G=b;this.I=c;this.l=d;this.C=e;this.f=new _.Yf;this.m=!0;this.g=this.j=this.A=!1;this.B=null;this.h=new _.qh(this.vf.bind(this));this.a=new _.D("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.f&&(this.a.debug(Gq),this.f.on(this.l,_.ie,this.Qh.bind(this)),this.f.on(this.l,_.we,this.Rh.bind(this)),this.f.on(this.l,_.vb,this.Oh.bind(this)),this.f.on(this.l,_.wb,this.Ph.bind(this)))},Jq=function(a,
|
|
3
|
+
b){a.l.trigger(new _.E(_.Ne,{detail:b}))},Kq=function(a,b,c){b&&(a.A=!0,a.h.stop());a.l.onError(new _.J(b?_.K:1,9,9201,c))},Lq=function(a,b,c,d,e){this.o=a;this.m=c;this.g=b;this.a=d;this.j=e;this.h=new _.D("clpp.vimond.VimondService");this.f=0},Mq=function(a){this.l=a;this.a=new _.Yf;this.g=new _.D("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.l&&this.a&&(this.g.debug(Gq),this.a.on(this.l,_.Xd,this.fj.bind(this)),this.a.on(this.l,_.vb,this.Mh.bind(this)),this.a.on(this.l,_.wb,this.Nh.bind(this)))},
|
|
4
|
+
Nq=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.Qd];if(a.h)return[_.Vc,_.Ld];if(c===_.Ol)return[_.Vc,null];if(c===_.Sl)return[_.Xc,_.Ld];var d=_.Ld;if(c===_.Ml||c===_.Vl||a.f)d=_.Qd;return["period",d]},Oq=function(){this.a=!1;this.h=new _.D(Hq);this.j=this.g=this.f=null},Pq=function(){};_.h=Iq.prototype;_.h.Rh=function(){this.g||(this.g=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.h.Oh=function(){this.a.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.h.Ph=function(){this.a.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.h.Qh=function(a){var b=this,c,d,e,f,g;return _.z(function(k){if(1==k.a){c=a.detail;d=_.Ql;e=c.currentState;f=c.previousState;b.a.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return k["return"]();if(e===b.B&&!b.g)return b.a.debug("Ignore transition"),k["return"]();if(b.m&&e!==d.PLAYING)return k["return"]();if(b.g&&[d.PAUSED,d.BUFFERING].includes(e))return b.a.debug("Seeking"),k["return"]();b.g&&e===d.PLAYING&&(b.a.debug("Seeked"),b.g=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return k.H(0);
|
|
7
|
+
b.B=e;return _.v(k,b.vf(),3)}e===d.ENDED&&b.h.stop();_.w(k)})};
|
|
8
|
+
_.h.vf=function(){var a=this,b,c,d,e,f,g;return _.z(function(k){if(1==k.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.a.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.h.stop();a.h.$(a.m?10:a.D);a.m=!1;_.rf(k,2);l=a.C;l.f++;var m=_.H.Sa(l.m);m.client.buildName=_.na;m.client.buildVersion=_.ea;var n=m.client,p=l.a.l.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.l.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
|
|
9
|
+
l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.Vj(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Nq(l.a,l.f);m.client.playerEvent=n[0]||"";m.client.playerState=n[1]||"";m.progress.vod&&(m.progress.vod.position=l.a.getPosition());if(n=m.progress.live){p=l.a;p=Math.floor(p.l.getPresentationStartTime()+p.l.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;var q=l.a;p=q.l.getPosition();q=q.l.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);typeof n.liveResumePossible!==
|
|
10
|
+
_.ic&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.ih(l.o);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.Zg(JSON.stringify(m));l=l.j.fetch(n).N;return _.v(k,l,4)}if(2!=k.a)return b=k.f,Jq(a,b),_.sf(k,0);d=c=_.tf(k);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.a.debug("Unreachable service"),Jq(a,f),Kq(a,a.G,f)):1001===e?(a.a.debug("Generic service error"),Jq(a,f),Kq(a,a.I,
|
|
11
|
+
f)):a.a.error(c.toString());_.w(k)})};_.h.dispose=function(){this.a.debug(_.pb);_.ag(this.f);this.h.stop()};Lq.prototype.Ve=function(a){this.g=a};_.h=Mq.prototype;_.h.getPosition=function(){return Math.floor(this.l.getPosition())};_.h.fj=function(){this.h=!0};_.h.Mh=function(){this.f=!0};_.h.Nh=function(){this.f=!1};_.h.dispose=function(){this.g.debug(_.pb);_.ag(this.a)};_.u(Oq,_.ap);_.h=Oq.prototype;_.h.onPlayerCreated=function(){};
|
|
12
|
+
_.h.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.H.R(b.vimond)&&typeof b.vimond===_.Ad)?a.namespace()===_.xc&&(this.a=!1,this.h.info("Vimond does not report when casting.")):this.h.warn("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.t(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.h.warn(d+" key is missing");a.onError(new _.J(1,9,9200));return}this.h.debug("Configuration is valid");
|
|
13
|
+
c=b.failIfUnreachable;typeof c!==_.ic&&(c=!0);d=b.failOnError;typeof d!==_.ic&&(d=!0);this.f=new Mq(a);this.g=new Lq(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Iq(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.h.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.h.onPlayerWillDestroy=function(){};_.h.id=function(){return"vimond"};
|
|
14
|
+
_.h.Ve=function(a){this.a&&this.g&&this.g.Ve(a)};_.A(Hq,Oq);Oq.prototype.updateAuthToken=Oq.prototype.Ve;Oq.Id="vimond";Pq.prototype.create=function(){return new Oq};_.pn(new Pq);};
|
|
15
15
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
16
16
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
17
17
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vr.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var lq="touchmove",mq="touchstart",nq=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},oq=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},pq=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new nq(a/d*e,b/d*e,0/d*e,Math.cos(c))},qq=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},rq=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},sq=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},tq=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},uq=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},vq=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
|
|
4
|
+
3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},wq=function(a){var b=new qq(0,0,0),c=new qq(0,0,1),d=new qq,e=new qq,f=new qq;a=a.a;var g=new qq(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();rq(f,1/g);c=tq(d,c,f);g=c.length();rq(c,1/g);tq(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-sq(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-sq(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-sq(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},yq=function(a){this.a=a;this.f=a.createProgram();this.j=
|
|
5
|
+
xq(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.h=xq(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.j);a.attachShader(this.f,this.h);a.bindAttribLocation(this.f,
|
|
6
|
+
0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.J(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.g=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},xq=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.J(1,
|
|
7
|
+
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},zq=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var k=c/128,l=(.5+k)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-k);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
|
|
8
|
+
5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.g=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},Aq=function(a,
|
|
9
|
+
b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},Bq=function(){var a=this;this.o=this.w=this.M=this.J=this.A=
|
|
10
|
+
this.U=this.G=this.f=this.a=this.l=null;this.h=new _.D("clpp.vr");this.I=70;this.D=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.M.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.m=this.j=0;this.g={x:0,y:0};this.O=new uq;this.T=new uq;this.Y=new uq;this.aa=new uq;this.B=this.bj.bind(this);this.C=this.cj.bind(this);this.K=
|
|
11
|
+
this.aj.bind(this)},Cq=function(a){var b=pq(1,0,a.m*Math.PI/180);oq(pq(0,1,a.j*Math.PI/180),a.O);oq(b,a.T);wq(a.Y);vq(a.aa,a.O,a.Y);vq(a.G,a.T,a.aa)},Dq=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(lq,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},Eq=function(){};qq.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};uq.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,x,y){var C=this.a;C[0]=a;C[4]=b;C[8]=c;C[12]=d;C[1]=e;C[5]=f;C[9]=g;C[13]=k;C[2]=l;C[6]=m;C[10]=n;C[14]=p;C[3]=q;C[7]=r;C[11]=x;C[15]=y;return this};var Fq={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.u(Bq,_.ap);_.h=Bq.prototype;_.h.onPlayerCreated=function(a){this.h.info("Player created");this.l=a};
|
|
12
|
+
_.h.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable)if(this.I=b.vr.fieldOfView?b.vr.fieldOfView:70,a=a.getSurface()){var c=a.getMedia();if(c&&c.tagName.toLowerCase()===_.Ie){this.h.info("Initialize VR Surface");if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",Fq)||this.a.getContext("experimental-webgl",Fq);if(!this.f)throw new _.J(1,9,9003,"Unable to create GL context");this.G=new uq;wq(this.G);this.U=new zq(this.f);
|
|
13
|
+
this.A=new yq(this.f);this.J=new uq;this.M=new uq;this.o=this.w=null;this.a.addEventListener(_.$d,this.D)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,!1),this.a.addEventListener(mq,this.K,!1));this.D();this.cg()}else this.h.info("No video element found, can not initialize VR plugin")}else this.h.info("No surface found, can not initialize VR plugin")};
|
|
14
|
+
_.h.onPlayerWillRelease=function(){this.h.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.g.x=0;this.m=this.j=this.g.y=0;this.f&&(delete this.f,this.f=null);this.a&&(Dq(this),this.a.removeEventListener(_.$d,this.D),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.h.onPlayerWillDestroy=function(){var a=this;return _.z(function(b){a.l=null;_.w(b)})};_.h.id=function(){return"vr"};
|
|
15
|
+
_.h.cg=function(){if(this.l&&this.f){var a=this.l.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Ie){this.w=requestAnimationFrame(this.cg.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Aq(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
|
|
16
|
+
0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=vq(this.J,this.M,this.G).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.g,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.U;a.a.bindBuffer(a.a.ARRAY_BUFFER,
|
|
17
|
+
a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,0,a.g);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
|
|
18
|
+
_.h.aj=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===mq)a.type===mq?a.touches[0]&&(this.g.x=a.touches[0].clientX,this.g.y=a.touches[0].clientY):(this.g.x=a.clientX,this.g.y=a.clientY),this.h.debug("Mouse Start coordinates:",this.g,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(lq,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
|
|
19
|
+
_.h.bj=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===lq&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.g.x-b;var d=this.g.y-c;this.g.x=b;this.g.y=c;this.j+=a;this.m+=d;Cq(this)};_.h.cj=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Dq(this)};_.h.wi=function(a,b){this.m=b;this.j=a;Cq(this)};_.h.gi=function(){return{x:this.j,y:this.m}};_.h.Dj=function(a){this.I=a;this.D()};_.A("clpp.vr.VrPlugin",Bq);
|
|
20
|
+
Bq.prototype.setCameraFieldOfView=Bq.prototype.Dj;Bq.prototype.getCameraCoordinates=Bq.prototype.gi;Bq.prototype.moveCamera=Bq.prototype.wi;Bq.Id="vr";Eq.prototype.create=function(){return new Bq};_.pn(new Eq);};
|
|
21
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
22
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
23
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
24
|
+
})();
|
package/cjs/cl.vtt.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},
|
|
4
|
-
else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.
|
|
5
|
-
_.
|
|
6
|
-
c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},
|
|
7
|
-
new
|
|
8
|
-
|
|
9
|
-
f/9E4-c}}f=[];e=_.t(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.
|
|
10
|
-
else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.B("VTT parser encountered an invalid VTTRegion setting: ",l,
|
|
11
|
-
for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.
|
|
12
|
-
g=m}g&&k.push(g)}return{cues:k,styles:e}};_.u(
|
|
13
|
-
|
|
14
|
-
{duration:null,sampleSize:null,
|
|
15
|
-
"vttc"==F?8<I&&(G=_.
|
|
2
|
+
var f=function(window){var Sp=" The setting will be ignored.",Tp="VTT parser encountered an invalid VTT setting: ",Up="application/x-subrip",Vp="text/srt",Wp='text/vtt; codecs\x3d"vtt"',Xp='text/vtt; codecs\x3d"wvtt"',Yp=function(a){_.io(a,/[ \t]+/gm)},Zp=function(a){return a.a==a.f.length?null:(a=_.io(a,/[^ \t\n]*/gm))?a[0]:null},$p=function(){},aq=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
|
|
3
|
+
a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},bq=function(){},cq=function(a){this.a=a},eq=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.ng:a.textAlign=
|
|
4
|
+
_.gp[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Ge:_.He;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b==_.hd||b==_.he?_.hd:b==_.id||b==_.Vc?_.id:_.rc);else if(d=/^region:(.*)$/.exec(b)){if(b=dq(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),
|
|
5
|
+
c[2]&&(a.lineAlign=_.hp[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.pg,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.hp[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},dq=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.B("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},fq=function(a){a=_.io(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;
|
|
6
|
+
var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},gq=function(){cq.apply(this,arguments)},hq=function(){this.a=null;this.f=new _.D("clpp.vtt.mp4")},jq=function(a,b,c){var d,e,f;(new _.Oj).L("payl",_.Rj(function(g){d=_.Tg(g)})).L("iden",_.Rj(function(g){e=_.Tg(g)})).L("sttg",_.Rj(function(g){f=_.Tg(g)})).parse(a);return d?iq(d,e,f,b,c):null},iq=function(a,b,c,d,e){a=new _.sg(d,e,a);b&&(a.id=b);if(c)for(b=new _.ho(c),c=Zp(b);c;)eq(a,c,[])||_.B(Tp,
|
|
7
|
+
c,Sp),Yp(b),c=Zp(b);return a},kq=function(){this.a=new bq};$p.prototype.a=function(a){a=_.Tg(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.t(b);for(var c=b.next();!c.done;c=b.next())a+=aq(c.value)}return _.Xg(a)};bq.prototype.create=function(){return new $p};bq.prototype.probe=function(a,b){return(a===Vp||a===Up)&&b===_.ue};cq.prototype.parseInit=function(){};
|
|
8
|
+
cq.prototype.parseMedia=function(a,b){var c=_.Tg(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.J(_.K,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=fq(new _.ho(e[1]));if(null==c)throw new _.J(_.K,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
|
|
9
|
+
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.t(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.ho(k.replace(/\n/g," "));g=new _.vg;Zp(k);Yp(k);for(var l=Zp(k);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
|
|
10
|
+
Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.B("VTT parser encountered an invalid VTTRegion setting: ",l,Sp);Yp(k);l=Zp(k)}f.push(g)}}e=[];k=_.t(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
|
|
11
|
+
e.push(m[0]);while(m)}k=[];d=_.t(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.ho(p[0]);m=fq(l);var r=_.io(l,/[ \t]+--\x3e[ \t]+/g);n=fq(l);if(null==m||null==r||null==n)throw new _.J(_.K,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.sg(m,n,p,_.Pe);g&&(m.id=g);Yp(l);for(n=Zp(l);n;)eq(m,n,f)||_.B(Tp,
|
|
12
|
+
n,Sp),Yp(l),n=Zp(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.u(gq,cq);gq.prototype.parseMedia=function(a,b){return cq.prototype.parseMedia.call(this,(new $p).a(a),b)};hq.prototype.parseInit=function(a){var b=this,c=!1;(new _.Oj).L(_.sd,_.Pj).L(_.xe,_.Pj).L(_.nd,_.Pj).V("mdhd",function(d){0==d.version?(d.F.skip(4),d.F.skip(4),b.a=_.Kj(d.F),d.F.skip(4)):(d.F.skip(8),d.F.skip(8),b.a=_.Kj(d.F),d.F.skip(8));d.F.skip(4)}).L(_.rd,_.Pj).L(_.le,_.Pj).V(_.ne,_.Qj).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.J(_.K,2,2008);if(!c)throw new _.J(_.K,2,2008);};
|
|
13
|
+
hq.prototype.parseMedia=function(a,b){if(!this.a)throw this.f.error("No init segment for MP4+VTT!"),new _.J(_.K,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.Oj).L("moof",_.Pj).L("traf",_.Pj).V("tfdt",function(M){g=!0;c=0==M.version?_.Kj(M.F):_.Mj(M.F)}).V("tfhd",function(M){var O=M.flags;M=M.F;M.skip(4);O&1&&M.skip(8);O&2&&M.skip(4);m=O&8?_.Kj(M):null}).V("trun",function(M){k=!0;var O=M.version,T=M.flags;M=M.F;var wa=_.Kj(M);T&1&&M.skip(4);T&4&&M.skip(4);for(var ca=[],ra=0;ra<wa;ra++){var za=
|
|
14
|
+
{duration:null,sampleSize:null,Se:null};T&256&&(za.duration=_.Kj(M));T&512&&(za.sampleSize=_.Kj(M));T&1024&&M.skip(4);T&2048&&(za.Se=0==O?_.Kj(M):_.Lj(M));ca.push(za)}d=ca}).L(_.md,_.Rj(function(M){l=!0;e=M})).parse(a);if(!l&&!g&&!k)throw new _.J(_.K,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Fj(p,!1);for(var q=_.t(d),r=q.next();!r.done;r=q.next()){r=r.value;var x=r.duration||m,y=r.Se?c+r.Se:n;n=y+(x||0);var C=0;do{var I=_.Kj(p);C+=I;var F=_.Kj(p);F=_.Tj(F);var G=null;
|
|
15
|
+
"vttc"==F?8<I&&(G=_.Nj(p,I-8)):("vtte"!=F&&this.f.error("Unknown box "+F+"! Skipping!"),p.skip(I-8));x?G&&f.push(jq(G,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.f.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&C<r.sampleSize)}return{cues:f.filter(_.vl),styles:[]}};_.u(kq,_.un);kq.prototype.Ea=function(){_.Oo[_.ue]=cq;_.Oo[Wp]=cq;_.Oo[Xp]=cq;_.Oo[_.Vb]=hq;_.Oo[Vp]=gq;_.Oo[Up]=gq;_.rh.push(this.a)};kq.prototype.va=function(){_.Po(_.ue);_.Po(Wp);_.Po(Xp);_.Po(_.Vb);_.Po(Vp);_.Po(Up);_.th(this.a)};kq.prototype.id=function(){return _.re};_.A("clpp.vtt.VttComponent",kq);};
|
|
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.youbora.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
"ClearKey":b.startsWith(_.
|
|
4
|
-
_.
|
|
5
|
-
_.h.getRendition=function(){var a=this.l.getTrackManager();if(a&&(a=a.fa())){var b=a.width;var c=a.height;var d=a.bandwidth}b&&c&&d||(a=this.l.getStats()||_.
|
|
6
|
-
_.h.getThroughput=function(){return(this.l.getStats()||_.
|
|
7
|
-
_.h.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.
|
|
8
|
-
_.h.
|
|
9
|
-
break;default:this.a.debug("Unhandled state",a)}};_.h.
|
|
10
|
-
_.h.
|
|
2
|
+
var f=function(window){var Ip="accountCode key is missing",Jp="clpp.npaw.YouboraPlugin",Kp="content.isLive",Lp=function(a){var b=youbora.Adapter.call(this,a)||this;b.l=a;b.f=new _.Yf;b.a=new _.D("clpp.npaw.YouboraAdapter");b.h=!1;b.g=!1;b.registerListeners();return b},Mp=function(a){a.plugin.isInitiated||(a.g=!1,a.fireInit())},Np=function(a){var b=a.l.getDrmInfo();b&&(b=b.keySystem,(b=b.startsWith(_.Gc)?"Widevine":b.startsWith(_.Ec)?"FairPlay":b.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":b.startsWith(_.Jd)?
|
|
3
|
+
"ClearKey":b.startsWith(_.Dc)?"Primetime":b)&&a.plugin.setOptions({"content.drm":b}));a.fireJoin()},Op=function(a){var b=youbora.Adapter.call(this,a)||this;b.l=a;b.a=null;b.h=null;b.f=new _.Yf;b.g=new _.D("clpp.npaw.YouboraAdsAdapter");b.registerListeners();return b},Pp=function(){this.a=null;this.f=!1;this.g=new _.D(Jp);this.h=this.j=null},Qp=function(a,b){var c=b.getConfiguration();a.f=!_.H.R(c.youbora)&&typeof c.youbora===_.Ad;a.f?window.youbora&&6<=+youbora.VERSION.split(".")[0]?b.namespace()===
|
|
4
|
+
_.xc&&(a.f=!1,a.g.info("Youbora does not report when casting.")):(a.g.warn("No valid Youbora SDK available. Youbora SDK is supported","starting from version",6),a.f=!1,b.onError(new _.J(1,9,9100))):a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},Rp=function(){};_.u(Lp,youbora.Adapter);_.h=Lp.prototype;_.h.getPlayhead=function(){return this.l.getPosition()};_.h.getDuration=function(){return this.l.getDuration()};
|
|
5
|
+
_.h.getRendition=function(){var a=this.l.getTrackManager();if(a&&(a=a.fa())){var b=a.width;var c=a.height;var d=a.bandwidth}b&&c&&d||(a=this.l.getStats()||_.Dl(),b=b||a.width,c=c||a.height,d=d||a.streamBandwidth);return youbora.Util.buildRenditionString(b,c,d)};_.h.getIsLive=function(){return this.l.isLive()};_.h.getResource=function(){var a=this.l.getLoadedSource();return a&&a.url};_.h.getBitrate=function(){return(this.l.getStats()||_.Dl()).streamBandwidth};
|
|
6
|
+
_.h.getThroughput=function(){return(this.l.getStats()||_.Dl()).estimatedBandwidth};_.h.getPlayrate=function(){return this.l.getPlaybackRate()};_.h.getFramesPerSecond=function(){var a=this.l.getTrackManager();return a&&(a=a.Da())?a.frameRate:null};_.h.getPlayerName=function(){return _.na};_.h.getVersion=function(){return"6.2.8-castlabsadapter-js"};_.h.getPlayerVersion=function(){return _.ea};
|
|
7
|
+
_.h.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.ie,this.Hj.bind(this)),this.f.on(this.l,_.Xc,this.Wh.bind(this)),this.f.on(this.l,_.Ee,this.Bj.bind(this)),this.f.on(this.l,_.De,this.Aj.bind(this)),this.f.on(this.l,_.Mb,this.Dg.bind(this)),this.f.on(this.l,_.nc,this.Ig.bind(this)))};_.h.unregisterListeners=function(){this.a.debug(_.pb);_.ag(this.f)};
|
|
8
|
+
_.h.Hj=function(a){this.a.debug("State changed",a);if(a=a.detail)switch(a.currentState){case _.Tl:this.l.getConfiguration().autoplay&&Mp(this);break;case _.Vl:Mp(this);Np(this);this.fireResume();this.fireBufferEnd();break;case _.Ul:this.l.getConfiguration().autoplay&&Mp(this);Np(this);this.fireBufferEnd();this.firePause();break;case _.Hl:this.fireBufferEnd();this.fireStop();break;case _.Ol:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Ml:this.fireBufferBegin();
|
|
9
|
+
break;default:this.a.debug("Unhandled state",a)}};_.h.Wh=function(a){this.a.debug("Fire error",a);!(a=a.detail)||this.g||10003===a.code&&this.plugin.getAdsAdapter()||(a.severity===_.K?(this.g=!0,this.fireFatalError(""+a.code,a.message)):this.fireError(""+a.code,a.message))};_.h.Bj=function(a){this.a.debug("Seeking",a);this.l.isEnded()||(Mp(this),this.fireSeekBegin())};_.h.Aj=function(a){this.a.debug("Seeked",a);this.fireSeekEnd()};
|
|
10
|
+
_.h.Dg=function(a){this.a.debug("adsTimeline",a);a=a.adsTimeline;this.h=!!a&&a.bb()};_.h.Ig=function(a){this.a.debug("Casting",a);this.fireCasted()};_.u(Op,youbora.Adapter);_.h=Op.prototype;_.h.getDuration=function(){return this.a&&this.a.getDuration()};_.h.getRendition=function(){var a=null;this.a&&(a=youbora.Util.buildRenditionString(this.a.pb(),this.a.ob(),this.a.ab()));return a};_.h.getBitrate=function(){return this.a&&this.a.ab()};_.h.getPlayhead=function(){var a=this.l.getAdsManager();return a&&a.getPosition()};_.h.getResource=function(){return this.a&&this.a.getMediaUrl()};_.h.getTitle=function(){return this.a&&this.a.getTitle()};
|
|
11
11
|
_.h.getProvider=function(){return this.a&&this.a.getAdvertiserName()};_.h.getCreativeId=function(){return this.a&&this.a.getCreativeId()};_.h.getPosition=function(){var a=youbora.Constants.AdPosition,b=null;if(this.a)switch(this.a.Qa()){case 0:b=a.Preroll;break;case 2:b=a.Postroll;break;case 1:b=a.Midroll}this.g.debug("Ad position",b);return b};_.h.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};_.h.getAudioEnabled=function(){var a=this.l.getAdsManager();return a&&0<a.getVolume()};
|
|
12
12
|
_.h.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};_.h.getGivenBreaks=function(){return this.getExpectedBreaks()};_.h.getExpectedAds=function(){return this.a&&this.a.rb()};_.h.getGivenAds=function(){return this.getExpectedAds()};_.h.getBreaksTime=function(){var a=this;return this.h&&this.h.getCuePoints().map(function(b){return-1===b?a.l.getDuration():b})};_.h.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};
|
|
13
|
-
_.h.getIsVisible=function(){var a=this.l.getSurface().getContainer();a=youbora.Util.calculateAdViewability(a);this.g.debug("is container visible",a);return a};_.h.getPlayerName=function(){return _.
|
|
14
|
-
_.h.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.
|
|
15
|
-
this.f.on(this.l,_.
|
|
16
|
-
_.h.
|
|
17
|
-
_.h.
|
|
18
|
-
_.h.onContentWillLoad=function(a,b){
|
|
19
|
-
_.h.
|
|
13
|
+
_.h.getIsVisible=function(){var a=this.l.getSurface().getContainer();a=youbora.Util.calculateAdViewability(a);this.g.debug("is container visible",a);return a};_.h.getPlayerName=function(){return _.na};_.h.getVersion=function(){return"6.2.8-castlabsadsadapter-js"};_.h.getPlayerVersion=function(){return _.ea};
|
|
14
|
+
_.h.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Mb,this.Cg.bind(this)),this.f.on(this.l,_.Ib,this.zg.bind(this)),this.f.on(this.l,_.Eb,this.wg.bind(this)),this.f.on(this.l,_.Gb,this.xg.bind(this)),this.f.on(this.l,_.zb,this.ug.bind(this)),this.f.on(this.l,_.Ab,this.Ud.bind(this,1)),this.f.on(this.l,_.Db,this.Ud.bind(this,2)),this.f.on(this.l,_.Kb,this.Ud.bind(this,3)),this.f.on(this.l,_.yb,this.tg.bind(this)),this.f.on(this.l,_.Hb,this.yg.bind(this)),this.f.on(this.l,_.Xc,this.vg.bind(this)),
|
|
15
|
+
this.f.on(this.l,_.vb,this.Gg.bind(this)),this.f.on(this.l,_.wb,this.Hg.bind(this)),this.f.on(this.l,_.xb,this.Oi.bind(this)),this.f.on(this.l,_.Fb,this.ej.bind(this)))};_.h.unregisterListeners=function(){_.ag(this.f)};_.h.Cg=function(a){this.g.debug("ad timeline changed",a);this.h=a.adsTimeline};_.h.zg=function(a){this.g.debug("ad start",a);this.a=a.ad;this.fireStart();this.fireJoin()};_.h.ug=function(a){this.g.debug("ad end",a);this.fireStop()};_.h.wg=function(a){this.g.debug("ad pause",a);this.firePause()};
|
|
16
|
+
_.h.xg=function(a){this.g.debug("ad resume",a);this.fireResume()};_.h.Oi=function(a){this.g.debug("on buffering",a);this.fireBufferBegin()};_.h.ej=function(a){this.g.debug("on progress",a);this.fireBufferEnd()};_.h.Ud=function(a,b){this.g.debug("ad quartile",a,b);this.fireQuartile(a)};_.h.tg=function(a){this.g.debug("ad clicked",a);a=this.a&&this.a.Hb();this.g.debug("ad click through url: ",a);this.fireClick(a)};_.h.yg=function(a){this.g.debug("ad skipped",a);this.fireSkip()};
|
|
17
|
+
_.h.Gg=function(a){this.g.debug("break start",a);this.a=a.ad;this.fireBreakStart()};_.h.Hg=function(a){this.g.debug("ad break stop",a);this.fireBreakStop();this.getPosition()===youbora.Constants.AdPosition.Postroll&&(a=this.plugin.getAdapter())&&a.fireStop()};_.h.vg=function(a){this.g.warn("ad error",a);(a=a.detail)&&10003===a.code&&(a.severity===_.K?this.fireFatalError(""+a.code,a.message):this.fireError(""+a.code,a.message))};_.u(Pp,_.ap);_.h=Pp.prototype;_.h.onPlayerCreated=function(a){Qp(this,a);if(this.f){this.j=new Lp(a);this.h=new Op(a);var b=a.getConfiguration().youbora;b.accountCode?this.Pe(new youbora.Plugin(b)):(this.g.warn(Ip),a.onError(new _.J(1,9,9101)))}};
|
|
18
|
+
_.h.onContentWillLoad=function(a,b){Qp(this,a);if(this.f){var c=a.getConfiguration(),d=c.youbora;d.accountCode?(void 0===d[Kp]&&(d[Kp]=b.isLive),void 0===d["content.title"]&&(d["content.title"]=b.name),void 0===d.viewerId&&(d.viewerId=c.viewerId),this.a||this.Pe(new youbora.Plugin(d)),this.a.setOptions(d)):(this.g.warn(Ip),a.onError(new _.J(1,9,9101)))}};_.h.onPlayerWillRelease=function(){};_.h.onPlayerWillDestroy=function(){};_.h.id=function(){return"youbora"};
|
|
19
|
+
_.h.Pe=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(this.j),this.a.setAdsAdapter(this.h)};_.h.getAdapter=function(){return this.a&&this.a.getAdapter()};_.h.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.A(Jp,Pp);Pp.prototype.getAdsAdapter=Pp.prototype.getAdsAdapter;Pp.prototype.getAdapter=Pp.prototype.getAdapter;Pp.prototype.setYouboraPlugin=Pp.prototype.Pe;Pp.Id="youbora";Rp.prototype.create=function(){return new Pp};_.pn(new Rp);};
|
|
20
20
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
21
21
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
22
22
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cl.adobe.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
|
|
3
|
-
_.x("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var AJ=function(a){a.f=new _.mn;a.f.on(a.l,_.ze,()=>yJ(a));a.f.on(a.l,_.xe,()=>{s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.fd,()=>zJ(a));a.f.on(a.l,_.ee,b=>{b=b.detail;switch(b.currentState){case _.Lk:a.a.length||zJ(a);s.Media.play(a.a,a.l.getPosition());break;case _.Kk:case _.Dk:yJ(a);break;case _.Ak:case _.Ik:case _.Hk:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),yJ(a),s.Media.close(a.a),a.a=""}})},yJ=function(a){s.Media.stop(a.a,a.l.getPosition())},
|
|
2
|
+
zJ=function(a){{const b=a.l.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.l.getDuration()}`);s.Media.open(a.a,a.l.getDuration(),_.la)},BJ=class extends _.bp{constructor(){super();this.l=this.f=null;this.a="";this.g=new _.O("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.l=a,AJ(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""}id(){return"adobe"}};
|
|
3
|
+
_.x("clpp.adobe.AdobeAnalyticsPlugin",BJ);BJ.Id="adobe";_.Ll(new class{create(){return new BJ}});};f.call(g, window);
|
package/cl.airplay.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
!0;break;case "not-available":this.f=!1}this.l.trigger(new _.F(_.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var xJ=class extends _.bp{constructor(){super();this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.En(()=>{this.l.play().catch(()=>{})});this.g=new _.mn}onPlayerCreated(a){this.l=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.o.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.w.bind(this)))}onPlayerWillRelease(){this.m.stop();this.g.release()}id(){return"airplay"}o(a){switch(a.availability){case "available":this.f=
|
|
2
|
+
!0;break;case "not-available":this.f=!1}this.l.trigger(new _.F(_.Ib,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Hb:_.Gb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Lk)this.j?this.l.play().catch(()=>{}):this.m.$(.01);this.l.trigger(new _.F(a))}Za(){return this.h}Yc(){return this.f}Af(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",xJ);xJ.prototype.showCastMenu=xJ.prototype.Af;
|
|
3
|
+
xJ.prototype.canCast=xJ.prototype.Yc;xJ.prototype.isCasting=xJ.prototype.Za;xJ.Id="airplay";_.Ll(new class{create(){return new xJ}});};f.call(g, window);
|
package/cl.broadpeak.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},
|
|
3
|
-
break;case _.
|
|
4
|
-
this.h),this.f.init()})}}
|
|
5
|
-
_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var qJ=function(){return!window.SmartLib||!window.GenericPlayerApi},rJ=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.g||(a.g=SmartLib.getInstance(),a.g.init(c,d,e),typeof b===_.he&&a.g.setUUID(b))},tJ=function(a,b){b=b.customParameters||{};a.a=a.g.createStreamingSession();for(const c in b)a.a.setCustomParameter(c,b[c]);a.j.on(a.l,_.Qc,a.U.bind(a));a.h=new sJ(a.l);a.a.attachPlayer(a.h)},uJ=function(a,b){_.Gf(a.j);a.f&&
|
|
2
|
+
(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},vJ=class{constructor(a,b){this.l=a;this.f=b;this.a=new _.mn;this.g=!1}init(){const a=this.l,b=this.a;b.on(a,_.ee,this.m.bind(this));b.on(a,_.$b,this.h.bind(this));b.on(a,"seek",this.j.bind(this))}h(a){a=a.detail;typeof a.bandwidth===_.p&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}m(a){const b=this.l,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.Dk&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Dk:c.notifyStallStart();
|
|
3
|
+
break;case _.Lk:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Kk:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Gf(this.a),this.a=null)}};var sJ=class extends GenericPlayerApi{constructor(a){super();this.l=a;this.a=_.Yh()}getPlayerName(){return _.la}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.l.isLive()?0:1E3*this.l.getDuration()}getCurrentPosition(){return 1E3*this.l.getPosition()}getCurrentBitrate(){const a=this.l.getStats();return(a?a.streamBandwidth:0)/1E3}};var wJ=class extends _.bp{constructor(){super();this.h=this.f=this.a=this.g=this.l=null;this.j=new _.mn}onPlayerCreated(a){this.l=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(qJ())return a.onError(new _.H(1,9,11E3));rJ(this,c);tJ(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.l.onError(new _.H(1,9,11001,{bpkErrorCode:e,message:d}));uJ(this,void 0)}else b.url=d.getURL(),this.f=new vJ(this.l,
|
|
4
|
+
this.h),this.f.init()})}}U(a){a=a.detail;if(7003===a.code)uJ(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:uJ(this,SmartLib.BPDecodingError);break;case 1:uJ(this,SmartLib.BPNetworkingError);break;case 6:uJ(this,SmartLib.BPAccessRightError);break;default:uJ(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){qJ()||uJ(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",wJ);wJ.isSdkMissing=qJ;wJ.Id="broadpeak";
|
|
5
|
+
_.Ll(new class{create(){return new wJ}});};f.call(g, window);
|