@castlabs/prestoplay 6.17.1 → 6.19.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 +55 -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 +115 -114
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +575 -565
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +77 -74
- package/cjs/cl.externs.js +175 -293
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +70 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +315 -314
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +29 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +90 -89
- package/cl.conviva.js +27 -27
- package/cl.core.js +473 -466
- package/cl.crypto.js +9 -9
- package/cl.dash.js +72 -70
- package/cl.externs.js +172 -294
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +276 -273
- 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.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/clpp.styles.css +14 -0
- package/package.json +2 -2
- package/typings.d.ts +406 -377
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.m.trigger(new _.L(_.
|
|
4
|
-
|
|
5
|
-
_.
|
|
6
|
-
_.
|
|
7
|
-
b.B=e;return _.y(h,b.
|
|
8
|
-
_.
|
|
9
|
-
l.a.m.getLoadedSource().type||"";n=m.client;p=l.a.m.getLoadedSource();p=((new _.
|
|
10
|
-
typeof n.liveResumePossible!==_.
|
|
11
|
-
|
|
12
|
-
_.
|
|
13
|
-
c=b.failIfUnreachable;typeof c!==_.
|
|
14
|
-
_.
|
|
2
|
+
var f=function(window){var Fw="Registering listeners",Gw="clpp.vimond.VimondPlugin",Hw=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.C=e;this.a=new _.Sh;this.l=!0;this.f=this.j=this.A=!1;this.B=null;this.h=new _.Vk(this.ph.bind(this));this.g=new _.K("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(Fw),this.a.on(this.m,_.cg,this.xk.bind(this)),this.a.on(this.m,_.og,this.yk.bind(this)),this.a.on(this.m,_.uc,this.vk.bind(this)),this.a.on(this.m,_.vc,this.wk.bind(this)))},Iw=function(a,
|
|
3
|
+
b){a.m.trigger(new _.L(_.Kg,{detail:b}))},Jw=function(a,b,c){b&&(a.A=!0,a.h.stop());a.m.onError(new _.N(b?_.O:1,9,9201,c))},Kw=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.K("clpp.vimond.VimondService");this.f=0},Lw=function(a){this.m=a;this.a=new _.Sh;this.g=new _.K("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(Fw),this.a.on(this.m,_.Lf,this.o.bind(this)),this.a.on(this.m,_.uc,this.j.bind(this)),this.a.on(this.m,_.vc,this.l.bind(this)))},
|
|
4
|
+
Mw=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.tf];if(a.h)return[_.le,_.df];if(c===_.qp)return[_.le,null];if(c===_.up)return[_.ne,_.df];var d=_.df;if(c===_.op||c===_.xp||a.f)d=_.tf;return["period",d]},Nw=function(){this.a=!1;this.g=new _.K(Gw);this.j=this.h=this.f=null},Ow=function(){};_.u=Hw.prototype;_.u.yk=function(){this.f||(this.f=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.u.vk=function(){this.g.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.u.wk=function(){this.g.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.u.xk=function(a){var b=this,c,d,e,f,g;return _.I(function(h){if(1==h.a){c=a.detail;d=_.sp;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.g.debug("Ignore transition"),h["return"]();if(b.l&&e!==d.PLAYING)return h["return"]();if(b.f&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.g.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.F(0);
|
|
7
|
+
b.B=e;return _.y(h,b.ph(),3)}e===d.ENDED&&b.h.stop();_.A(h)})};
|
|
8
|
+
_.u.ph=function(){var a=this,b,c,d,e,f,g;return _.I(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.g.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.h.stop();a.h.ea(a.l?10:a.G);a.l=!1;_.D(h,2);l=a.C;l.f++;var m=_.M.sa(l.o);m.client.buildName=_.va;m.client.buildVersion=_.ia;var n=m.client,p=l.a.m.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.m.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
|
|
9
|
+
l.a.m.getLoadedSource().type||"";n=m.client;p=l.a.m.getLoadedSource();p=((new _.pk(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Mw(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;var q=p.m.getPresentationStartTime()||0;p=Math.floor(q+p.m.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;q=l.a;p=q.m.getPosition();q=q.m.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);
|
|
10
|
+
typeof n.liveResumePossible!==_.jd&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.g.debug("Fire an event");n=_.Jj(l.l);n.method=_.Ib;n.contentType="application/json";n.headers.Authorization="Bearer "+l.h;n.body=_.S.nd(JSON.stringify(m));l=l.j.fetch(n).U;return _.y(h,l,4)}if(2!=h.a)return b=h.f,Iw(a,b),_.oh(h,0);d=c=_.F(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),Iw(a,f),Jw(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),
|
|
11
|
+
Iw(a,f),Jw(a,a.I,f)):a.g.error(c.toString());_.A(h)})};Kw.prototype.Ag=function(a){this.h=a};Lw.prototype.getPosition=function(){return Math.floor(this.m.getPosition())};Lw.prototype.o=function(){this.h=!0};Lw.prototype.j=function(){this.f=!0};Lw.prototype.l=function(){this.f=!1};_.x(Nw,_.Cu);_.u=Nw.prototype;_.u.onPlayerCreated=function(){};
|
|
12
|
+
_.u.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.M.R(b.vimond)&&typeof b.vimond===_.Ue)?a.namespace()===_.Bd&&(this.a=!1,this.g.info("Vimond does not report when casting.")):this.g.warn("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.w(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.g.warn(d+" key is missing");a.onError(new _.N(1,9,9200));return}this.g.debug(_.wa);
|
|
13
|
+
c=b.failIfUnreachable;typeof c!==_.jd&&(c=!0);d=b.failOnError;typeof d!==_.jd&&(d=!0);this.f=new Lw(a);this.h=new Kw(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Hw(b.playerEventRequest.eventInterval,c,d,a,this.h)}};_.u.onPlayerWillRelease=function(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.fc);_.Vh(a.a)}this.j&&(a=this.j,a.g.debug(_.fc),_.Vh(a.a),a.h.stop());this.j=this.h=this.f=null}};_.u.onPlayerWillDestroy=function(){};_.u.id=function(){return"vimond"};
|
|
14
|
+
_.u.Ag=function(a){this.a&&this.h&&this.h.Ag(a)};_.J(Gw,Nw);Nw.prototype.updateAuthToken=Nw.prototype.Ag;Nw.Id="vimond";Ow.prototype.create=function(){return new Nw};_.qs(new Ow);};
|
|
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
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b):(a.x=0,a.y=0,a.a=0)},
|
|
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},
|
|
5
|
-
|
|
6
|
-
0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.
|
|
7
|
-
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},
|
|
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.h=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)},
|
|
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)},
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
_.
|
|
13
|
-
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",
|
|
14
|
-
!1),this.a.addEventListener(
|
|
15
|
-
_.
|
|
16
|
-
_.
|
|
17
|
-
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=
|
|
2
|
+
var f=function(window){var kw="touchmove",lw="touchstart",mw=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},nw=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)},ow=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new mw(a/d*e,b/d*e,0/d*e,Math.cos(c))},pw=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},qw=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},rw=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},sw=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},tw=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},uw=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},vw=function(a){var b=new pw(0,0,0),c=new pw(0,0,1),d=new pw,e=new pw,f=new pw;a=a.a;var g=new pw(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();qw(f,1/g);c=sw(d,c,f);g=c.length();qw(c,1/g);sw(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-rw(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-rw(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-rw(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},xw=function(a){this.a=a;this.f=a.createProgram();this.l=
|
|
5
|
+
ww(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.j=ww(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.l);a.attachShader(this.f,this.j);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 _.N(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.h=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},ww=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 _.N(1,
|
|
7
|
+
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},yw=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 h=c/128,l=(.5+h)*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-h);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.h=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)},zw=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)},Aw=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
+
this.ca=this.H=this.f=this.a=this.m=null;this.g=new _.K("clpp.vr");this.I=70;this.ba=1;this.P=this.N=!1;this.G=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.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.l=this.j=0;this.h={x:0,y:0};this.V=new tw;this.$=new tw;this.fa=new tw;this.ga=new tw;this.B=this.vm.bind(this);
|
|
11
|
+
this.C=this.wm.bind(this);this.K=this.um.bind(this)},Bw=function(a){var b=ow(1,0,a.l*Math.PI/180);nw(ow(0,1,a.j*Math.PI/180),a.V);nw(b,a.$);vw(a.fa);uw(a.ga,a.V,a.fa);uw(a.H,a.$,a.ga)},Cw=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(kw,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},Dw=function(){};pw.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};tw.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,v,z){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]=h;C[2]=l;C[6]=m;C[10]=n;C[14]=p;C[3]=q;C[7]=t;C[11]=v;C[15]=z;return this};var Ew={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.x(Aw,_.Cu);_.u=Aw.prototype;_.u.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
|
|
12
|
+
_.u.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.M.ra(d))this.I=d;else throw new _.N(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.M.ra(e)&&0<e)this.ba=e;else throw new _.N(1,7,7100,"sensitivity configuration must be a positive number");this.N=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.r){this.g.info("Initialize VR Surface");
|
|
13
|
+
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",Ew)||this.a.getContext("experimental-webgl",Ew);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new tw;vw(this.H);this.ca=new yw(this.f);this.A=new xw(this.f);this.J=new tw;this.L=new tw;this.o=this.w=null;this.a.addEventListener(_.Of,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
|
|
14
|
+
!1),this.a.addEventListener(lw,this.K,!1));this.G();this.Bi()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
|
|
15
|
+
_.u.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(Cw(this),this.a.removeEventListener(_.Of,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.u.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.A(b)})};_.u.id=function(){return"vr"};
|
|
16
|
+
_.u.Bi=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.r){this.w=requestAnimationFrame(this.Bi.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new zw(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,
|
|
17
|
+
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=uw(this.J,this.L,this.H).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.h,!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.ca;a.a.bindBuffer(a.a.ARRAY_BUFFER,
|
|
18
18
|
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.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
|
|
19
|
-
_.
|
|
20
|
-
_.
|
|
21
|
-
_.
|
|
19
|
+
_.u.um=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===lw)a.type===lw?a.touches[0]&&(this.h.x=a.touches[0].clientX,this.h.y=a.touches[0].clientY):(this.h.x=a.clientX,this.h.y=a.clientY),this.g.debug("Mouse Start coordinates:",this.h,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(kw,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
|
|
20
|
+
_.u.vm=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===kw&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;var d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.ba;c=d*b*(this.P?-1:1);this.j+=a*b*(this.N?-1:1);this.l+=c;Bw(this)};_.u.wm=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Cw(this)};_.u.Ol=function(a,b){this.l=b;this.j=a;Bw(this)};_.u.Yk=function(){return{x:this.j,y:this.l}};
|
|
21
|
+
_.u.mn=function(a){this.I=a;this.G()};_.J("clpp.vr.VrPlugin",Aw);Aw.prototype.setCameraFieldOfView=Aw.prototype.mn;Aw.prototype.getCameraCoordinates=Aw.prototype.Yk;Aw.prototype.moveCamera=Aw.prototype.Ol;Aw.Id="vr";Dw.prototype.create=function(){return new Aw};_.qs(new Dw);};
|
|
22
22
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
23
23
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
24
24
|
else{_=this.clpp._;(f.call(g,this));}
|
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
|
-
_.
|
|
5
|
-
Number(c[1]),c[2]&&(a.lineAlign=_.
|
|
6
|
-
a)return null;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)},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.w(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Cj(h.replace(/\n/g," "));g=new _.
|
|
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||_.
|
|
11
|
-
e.push(m[0]);while(m)}h=[];d=_.w(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 _.Cj(p[0]);m=
|
|
12
|
-
n,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var f=function(window){var Rv=" The setting will be ignored.",Sv="VTT parser encountered an invalid VTT setting: ",Tv="application/x-subrip",Uv="text/srt",Vv='text/vtt; codecs\x3d"vtt"',Wv='text/vtt; codecs\x3d"wvtt"',Xv=function(a){_.Dj(a,/[ \t]+/gm)},Yv=function(a){return a.a===a.f.length?null:(a=_.Dj(a,/[^ \t\n]*/gm))?a[0]:null},Zv=function(){},$v=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},aw=function(){},bw=function(a){this.a=a},dw=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"===b?a.textAlign=_.oi:a.textAlign=
|
|
4
|
+
_.Xu[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"===d[1]?_.Dg:_.Fg;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===_.Be||b===_.bg?_.Be:b===_.Ce||b===_.le?_.Ce:_.td);else if(d=/^region:(.*)$/.exec(b)){if(b=cw(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=
|
|
5
|
+
Number(c[1]),c[2]&&(a.lineAlign=_.Yu[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.qi,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Yu[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},cw=function(a,b){var c=a.filter(function(d){return d.id===b});return c.length?c[0]:(_.Dh("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},ew=function(a){a=_.Dj(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==
|
|
6
|
+
a)return null;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)},fw=function(){bw.apply(this,arguments)},gw=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},iw=function(a,b,c){var d,e,f;(new _.Nm).M("payl",_.Qm(function(g){d=_.S.aa(g)})).M("iden",_.Qm(function(g){e=_.S.aa(g)})).M("sttg",_.Qm(function(g){f=_.S.aa(g)})).parse(a);return d?hw(d,e,f,b,c):null},hw=function(a,b,c,d,e){a=new _.ti(d,e,a,_.Mg);b&&(a.id=b);if(c)for(b=new _.Cj(c),c=
|
|
7
|
+
Yv(b);c;)dw(a,c,[])||_.Dh(Sv,c,Rv),Xv(b),c=Yv(b);return a},jw=function(){this.j=new aw};Zv.prototype.a=function(a){a=_.S.aa(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=_.w(b);for(var c=b.next();!c.done;c=b.next())a+=$v(c.value)}return _.S.Ya(a)};aw.prototype.create=function(){return new Zv};aw.prototype.probe=function(a,b){return(a===Uv||a===Tv)&&b===_.lg};bw.prototype.parseInit=function(){};
|
|
8
|
+
bw.prototype.parseMedia=function(a,b){var c=_.S.aa(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 _.N(_.O,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=ew(new _.Cj(e[1]));if(null==c)throw new _.N(_.O,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=_.w(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Cj(h.replace(/\n/g," "));g=new _.wi;Yv(h);Xv(h);for(var l=Yv(h);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||_.Dh("VTT parser encountered an invalid VTTRegion setting: ",l,Rv);Xv(h);l=Yv(h)}f.push(g)}}e=[];h=_.w(d);for(g=h.next();!g.done;g=h.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)}h=[];d=_.w(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 _.Cj(p[0]);m=ew(l);var t=_.Dj(l,/[ \t]+--\x3e[ \t]+/g);n=ew(l);if(null==m||null==t||null==n)throw new _.N(_.O,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.ti(m,n,p,_.Mg);g&&(m.id=g);Xv(l);for(n=Yv(l);n;)dw(m,n,f)||_.Dh(Sv,
|
|
12
|
+
n,Rv),Xv(l),n=Yv(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.x(fw,bw);fw.prototype.parseMedia=function(a,b){return bw.prototype.parseMedia.call(this,(new Zv).a(a),b)};gw.prototype.parseInit=function(a){var b=this,c=!1;(new _.Nm).M(_.Qe,_.Om).M(_.pg,_.Om).M(_.Le,_.Om).Y("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.W(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.W(d.reader),d.reader.skip(8));d.reader.skip(4)}).M(_.Pe,_.Om).M(_.eg,_.Om).Y(_.gg,_.Pm).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.O,2,2008);if(!c)throw new _.N(_.O,2,2008);};
|
|
13
|
+
gw.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.N(_.O,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.Nm).M("moof",_.Om).M("traf",_.Om).Y("tfdt",function(G){g=!0;c=0===G.version?_.W(G.reader):_.Km(G.reader)}).Y("tfhd",function(G){var Q=G.flags;G=G.reader;G.skip(4);Q&1&&G.skip(8);Q&2&&G.skip(4);m=Q&8?_.W(G):null}).Y("trun",function(G){h=!0;var Q=G.version,R=G.flags;G=G.reader;var oa=_.W(G);R&1&&G.skip(4);R&4&&G.skip(4);for(var da=[],
|
|
14
|
+
Ca=0;Ca<oa;Ca++){var bb={duration:null,sampleSize:null,wg:null};R&256&&(bb.duration=_.W(G));R&512&&(bb.sampleSize=_.W(G));R&1024&&G.skip(4);R&2048&&(bb.wg=0===Q?_.W(G):_.Jm(G));da.push(bb)}d=da}).M(_.Ke,_.Qm(function(G){l=!0;e=G})).parse(a);if(!l&&!g&&!h)throw new _.N(_.O,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Em(p,!1);for(var q=_.w(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.wg?c+t.wg:n;n=z+(v||0);var C=0;do{var H=_.W(p);C+=H;var E=_.W(p);
|
|
15
|
+
E=_.Sm(E);var B=null;"vttc"===E?8<H&&(B=_.Mm(p,H-8)):("vtte"!==E&&this.g.error("Unknown box "+E+"! Skipping!"),p.skip(H-8));v?B&&f.push(iw(B,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&C<t.sampleSize)}return{cues:f.filter(_.Ci),styles:[]}};_.x(jw,_.Us);jw.prototype.f=function(){_.pu(_.lg,bw);_.pu(Vv,bw);_.pu(Wv,bw);_.pu(_.Wc,gw);_.pu(Uv,fw);_.pu(Tv,fw);_.Gk.push(this.j)};jw.prototype.a=function(){_.ru(_.lg);_.ru(Vv);_.ru(Wv);_.ru(_.Wc);_.ru(Uv);_.ru(Tv);_.Ik(this.j)};jw.prototype.id=function(){return"subtitles-vtt"};_.J("clpp.vtt.VttComponent",jw);};
|
|
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,24 +1,24 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b)):(d.fireError(b.code,b.message,b.metadata),c.debug(
|
|
2
|
+
var f=function(window){var Gv='" event to Youbora',Hv='Reporting "',Iv="clpp.npaw.YouboraPlugin",Jv="content.isLive",Kv=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Lv=function(a,b,c,d){b=Kv(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.ne;b.severity===_.O?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
|
|
3
|
+
b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Hv+a+'" to Youbora',b.code,b));return b},Mv=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Sh;d.g=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.h=!1;d.registerListeners();d.B=!1;return d}_.x(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();
|
|
4
4
|
if(c&&(c=c.na())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.l(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.l().streamBandwidth};b.prototype.getThroughput=function(){return this.l().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
|
|
5
|
-
b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.
|
|
6
|
-
_.
|
|
7
|
-
if(c)switch(c.currentState){case _.
|
|
8
|
-
(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.
|
|
9
|
-
b.prototype.J=function(){this.m.isEnded()||(this.j(_.
|
|
10
|
-
youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.
|
|
11
|
-
return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.
|
|
12
|
-
d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.
|
|
13
|
-
function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.va};b.prototype.getVersion=function(){return"6.
|
|
14
|
-
function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.
|
|
15
|
-
_.
|
|
5
|
+
b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Oa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.va};b.prototype.getVersion=function(){return"6.19.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.cg,this.K.bind(this)),this.a.on(this.m,_.ne,this.H.bind(this)),this.a.on(this.m,
|
|
6
|
+
_.yg,this.J.bind(this)),this.a.on(this.m,_.xg,this.I.bind(this)),this.a.on(this.m,_.Nc,this.C.bind(this)),this.a.on(this.m,_.pd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.fc);_.Vh(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.l=function(){return this.m.getStats()||_.fp()};b.prototype.o=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
|
|
7
|
+
if(c)switch(c.currentState){case _.vp:this.o()&&this.f();break;case _.xp:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.wp:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.jp:this.fireBufferEnd();this.fireStop();break;case _.qp:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.op:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
|
|
8
|
+
(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Pd)?"Widevine":c.startsWith(_.Ld)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.bf)?"ClearKey":c.startsWith(_.Kd)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Lv(c,this.m,this.g,this))&&c.severity===_.O&&(this.h=!0)};
|
|
9
|
+
b.prototype.J=function(){this.m.isEnded()||(this.j(_.Vf),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.Uf);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.Eb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Hv+c+Gv].concat(_.ah(e)))};return new b(a)},Nv=function(a){function b(c){var d=
|
|
10
|
+
youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Sh;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.x(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.ob(),this.a.nb(),this.a.ab()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.ab()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();
|
|
11
|
+
return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ua()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",
|
|
12
|
+
d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.pb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
|
|
13
|
+
function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.va};b.prototype.getVersion=function(){return"6.19.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
|
|
14
|
+
function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Nc,this.V.bind(this)),this.f.on(this.m,_.Jc,this.P.bind(this)),this.f.on(this.m,_.Fc,this.K.bind(this)),this.f.on(this.m,_.Hc,this.L.bind(this)),this.f.on(this.m,_.yc,this.I.bind(this)),this.f.on(this.m,_.zc,this.o.bind(this,1)),this.f.on(this.m,_.Ec,this.o.bind(this,2)),this.f.on(this.m,_.Lc,this.o.bind(this,3)),this.f.on(this.m,_.xc,this.H.bind(this)),this.f.on(this.m,_.Ic,this.N.bind(this)),this.f.on(this.m,
|
|
15
|
+
_.ne,this.J.bind(this)),this.f.on(this.m,_.uc,this.B.bind(this)),this.f.on(this.m,_.vc,this.C.bind(this)),this.f.on(this.m,_.wc,this.G.bind(this)),this.f.on(this.m,_.Gc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Vh(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();
|
|
16
16
|
this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h("ad buffering ended"),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");
|
|
17
|
-
var c=this.a&&this.a.
|
|
18
|
-
b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[
|
|
19
|
-
b.onError(new _.
|
|
20
|
-
_.
|
|
21
|
-
|
|
17
|
+
var c=this.a&&this.a.yb();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.N=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h("ad break start",this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Lv(c,this.m,this.g,this)};
|
|
18
|
+
b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Hv+c+Gv].concat(_.ah(e)))};return new b(a)},Ov=function(){this.a=null;this.g=new _.K(Iv);this.m=null},Pv=function(a,b){if(b.namespace()===_.Bd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.M.Qh(c))return a.g.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),
|
|
19
|
+
b.onError(new _.N(1,9,9101)),!1;if(_.M.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.N(1,9,9102)));return!0},Qv=function(){};_.x(Ov,_.Cu);_.u=Ov.prototype;_.u.qg=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Mv(this.m)),this.a.setAdsAdapter(Nv(this.m))};_.u.getAdapter=function(){return this.a&&this.a.getAdapter()};_.u.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.u.onPlayerCreated=function(a){this.m=a;Pv(this,a)&&(a=a.getConfiguration().youbora,this.qg(new youbora.Plugin(a)))};
|
|
20
|
+
_.u.onContentWillLoad=function(a,b){if(Pv(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Jv]&&(d[Jv]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.qg(new youbora.Plugin(d));this.a.setOptions(d)}};_.u.onPlayerWillRelease=function(){};_.u.onPlayerWillDestroy=function(){};_.u.id=function(){return"youbora"};_.J(Iv,Ov);Ov.prototype.getAdsAdapter=Ov.prototype.getAdsAdapter;Ov.prototype.getAdapter=Ov.prototype.getAdapter;
|
|
21
|
+
Ov.prototype.setYouboraPlugin=Ov.prototype.qg;Ov.Id="youbora";Qv.prototype.create=function(){return new Ov};_.qs(new Qv);};
|
|
22
22
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
23
23
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
24
24
|
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
|
-
_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var VU=function(a){a.f=new _.Bs;a.f.on(a.m,_.gg,()=>TU(a));a.f.on(a.m,_.fg,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.se,()=>UU(a));a.f.on(a.m,_.Mf,b=>{b=b.detail;switch(b.currentState){case _.bo:a.a.length||UU(a);s.Media.play(a.a,a.m.getPosition());break;case _.ao:case _.Un:TU(a);break;case _.Rn:case _.Zn:case _.Yn:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),TU(a),s.Media.close(a.a),a.a=""}})},TU=function(a){s.Media.stop(a.a,a.m.getPosition())},
|
|
2
|
+
UU=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.ra)},WU=class extends _.Bu{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.R("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.m=a,VU(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};
|
|
3
|
+
_.x("clpp.adobe.AdobeAnalyticsPlugin",WU);WU.Id="adobe";_.rq(new class{create(){return new WU}});};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.m.trigger(new _.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var SU=class extends _.Bu{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.jt(()=>{this.m.play().catch(()=>{})});this.h=new _.Bs}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
|
|
2
|
+
!0;break;case "not-available":this.f=!1}this.m.trigger(new _.C(_.zc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.yc:_.xc;if(this.l||!this.m.isPaused()||this.m.getState()===_.bo)this.l?this.m.play().catch(()=>{}):this.o.fa(.01);this.m.trigger(new _.C(a))}Gb(){return this.j}Sd(){return this.f}xh(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",SU);SU.prototype.showCastMenu=SU.prototype.xh;
|
|
3
|
+
SU.prototype.canCast=SU.prototype.Sd;SU.prototype.isCasting=SU.prototype.Gb;SU.Id="airplay";_.rq(new class{create(){return new SU}});};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.a.attachPlayer(a.l)},
|
|
3
|
-
switch(d){case _.
|
|
4
|
-
this.f=new
|
|
5
|
-
_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var LU=function(){return!window.SmartLib||!window.GenericPlayerApi},MU=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.Pf&&a.h.setUUID(b))},OU=function(a,b){b=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const c in b)a.a.setCustomParameter(c,b[c]);a.o.on(a.m,_.Vd,a.T.bind(a));a.l=NU(a.m);
|
|
2
|
+
a.a.attachPlayer(a.l)},PU=function(a,b){_.rh(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},QU=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.Bs;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.Mf,this.o.bind(this));b.on(a,_.Pc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.Un&&c.notifyStallEnd(!b.isPaused());
|
|
3
|
+
switch(d){case _.Un:c.notifyStallStart();break;case _.bo:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.ao:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.rh(this.a),this.a=null)}};var NU=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.yk()}getPlayerName(){return _.ra}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var RU=class extends _.Bu{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.Bs;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(LU())return a.onError(new _.G(1,9,11E3));this.j=!0;MU(this,c);OU(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.G(1,9,11001,{bpkErrorCode:e,message:d}));PU(this,void 0)}else b.url=d.getURL(),
|
|
4
|
+
this.f=new QU(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}T(a){a=a.detail;if(7003===a.code)PU(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.E)switch(a.category){case 3:PU(this,SmartLib.BPDecodingError);break;case 1:PU(this,SmartLib.BPNetworkingError);break;case 6:PU(this,SmartLib.BPAccessRightError);break;default:PU(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){LU()||PU(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
|
|
5
|
+
_.x("clpp.broadpeak.BroadpeakPlugin",RU);RU.isSdkMissing=LU;RU.Id="broadpeak";_.rq(new class{create(){return new RU}});};f.call(g, window);
|