@castlabs/prestoplay 6.3.0 → 6.4.1
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 +70 -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 +108 -107
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +426 -398
- package/cjs/cl.crypto.js +10 -10
- package/cjs/cl.dash.js +72 -69
- package/cjs/cl.externs.js +79 -155
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +47 -44
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -32
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +259 -254
- package/cjs/cl.muxdata.js +12 -12
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +69 -69
- package/cjs/cl.thumbnails.js +24 -23
- package/cjs/cl.tizen.js +70 -70
- package/cjs/cl.ttml.js +27 -26
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -19
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +365 -348
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -63
- package/cl.externs.js +74 -154
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +39 -37
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +16 -16
- package/cl.mse.js +233 -222
- package/cl.muxdata.js +8 -8
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +58 -58
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -21
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +16 -15
- package/package.json +4 -2
package/cjs/cl.ttml.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
e.a)return e.getAttribute(c)}return null}
|
|
4
|
-
0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},
|
|
5
|
-
|
|
6
|
-
b,c){
|
|
7
|
-
Number(a[2]):null},
|
|
8
|
-
a.o,a.w,a.g,a.a,a.h,a.f)}).filter(function(b){return null!=b})},
|
|
9
|
-
{},
|
|
10
|
-
3600)).padStart(2,"0")+":"+String(Math.floor(a/60%60)).padStart(2,"0")+":"+String(Math.floor(a%60)).padStart(2,"0")+"."+String(Math.floor(1E3*a%1E3)).padStart(3,"0")},
|
|
11
|
-
"color",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.v(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
e+";";break a}}d=""}c+=d;a:{if("textOutline"in this.a){d=this.a.textOutline.split(" ");e="black";f=".4em";var g=d[0]&&d[0].trim(),
|
|
19
|
-
"monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
b+=
|
|
24
|
-
|
|
25
|
-
null,"br"===
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
var f=function(window){var os='application/mp4; codecs\x3d"stpp.ttml"',ps='application/mp4; codecs\x3d"stpp.ttml.im1i"',qs='application/mp4; codecs\x3d"stpp.ttml.im1t"',rs="backgroundColor",ss="direction",ts="displayAlign",us="region",vs="sans-serif",ws="textAlign",xs="textDecoration",ys="writingMode",zs=function(a,b,c){this.g=a;this.f=b;this.a=c},As=function(a,b,c){zs.call(this,a,[],c);this.h=b||""},Bs=function(a,b,c){zs.call(this,a,b,c)},Cs=function(a,b,c){a=a.f;for(var d=a.length-1;0<=d;d--){var e=b.get(a[d]);if(c in
|
|
3
|
+
e.a)return e.getAttribute(c)}return null},Ks=function(a,b){var c=null;if(Ds.test(a)){c=Ds.exec(a);var d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]);g+=(Number(c[5])||0)/b.f;f+=g/b.frameRate;c=f+60*e+3600*d}else Es.test(a)?c=Fs(Es,a):Gs.test(a)?c=Fs(Gs,a):Hs.test(a)?(c=Hs.exec(a),c=Number(c[1])/b.frameRate):Is.test(a)?(c=Is.exec(a),c=Number(c[1])/b.a):Js.test(a)&&(c=Fs(Js,a));return c},Fs=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||
|
|
4
|
+
0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},Ls=function(a){return a.split(":").pop()},Ms=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Os=function(a,b){for(;Ns.test(a);){var c=Ns.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Ps=function(a,b,c,d,e,f,g){zs.call(this,a,f,g);this.o=b;this.w=c;this.m=d;this.j=e;this.h=[]},Qs=function(a,b,c){a=Cs(a,b,ws);if(!a&&c&&(a=Cs(c,b,ws),!a&&"rltb"===Cs(c,b,ys)))return _.he;switch(a){case _.Ac:return _.sg;case _.he:case _.dd:return _.he;default:return _.od}},
|
|
5
|
+
Rs=function(a,b,c){if(_.xh(a.o))return document.createTextNode(_.Bh(a.o||""));if(a.w)return _.xn("br");for(var d=_.xn("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.yn(d,f.value);a=_.u(a.h);for(e=a.next();!e.done;e=a.next())d.appendChild(Rs(c.get(e.value),b,c));return d},Ss=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))},Ts=function(a,
|
|
6
|
+
b,c){zs.call(this,a,b,c)},Ws=function(a,b,c,d){var e=Us.exec(a);a=Vs.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},Xs=function(a,b){return typeof b===_.k&&0<b?_.yg:Vs.test(a)?0:_.yg},Ys=function(a,b){zs.call(this,"root-container",[],b);this.h=a},Zs=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},$s=function(a,b){var c=a.getAttribute("extent");return(c=Vs.exec(c))?Number(c[b]):null},bt=function(a){a=a.getAttribute("cellResolution");return(a=at.exec(a))?
|
|
7
|
+
Number(a[2]):null},ct=function(a,b,c){zs.call(this,a,b,c)},dt=function(a){this.A=a;this.o=this.j=null;this.w=0;this.g=new Map;this.a=new Map;this.h=new Map;this.f=new Map;this.m=[]},ft=function(a){return et.some(function(b){return b in a.attributes})},gt=function(a,b){if(0===b.length)return[];for(var c=[],d=_.u(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.kf(gt(a,a.a.get(e).f)).concat([e]));return c},it=function(){return"inline-"+ht++},jt=function(a){return a.m.map(function(b){return b.build(a.j,
|
|
8
|
+
a.o,a.w,a.g,a.a,a.h,a.f)}).filter(function(b){return null!=b})},kt=function(a){this.a=a.firstChild;this.f=new Set},lt=function(a,b,c,d,e,f){this.g=a;this.a=b;this.h=c;this.j=d;this.f=e;this.attributes=f},mt=function(a){return Ls(a.g.nodeName)},nt=function(){this.a=new Map},pt=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},h=b.parentNode;if(h&&a.a.has(h)){var l=a.a.get(h);e=_.kf(l.j).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.h,f=_.kf(l.f).concat(),
|
|
9
|
+
g={},ot.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(us)&&(c=b.getAttribute(us));b.hasAttribute(_.ve)&&f.push.apply(f,_.kf(b.getAttribute(_.ve).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.u(d);for(h=d.next();!h.done;h=d.next()){h=h.value;var m=Ls(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new lt(b,c,d,e,f,g);a.a.set(b,c);return c},qt=function(a){this.a=a;this.f=new DOMParser},rt=function(a){this.f=
|
|
10
|
+
a},st=function(a){return String(Math.floor(a/3600)).padStart(2,"0")+":"+String(Math.floor(a/60%60)).padStart(2,"0")+":"+String(Math.floor(a%60)).padStart(2,"0")+"."+String(Math.floor(1E3*a%1E3)).padStart(3,"0")},tt=function(){},ut=function(a){this.f=new qt(a);this.a=new _.H("clpp.ttml.Mp4TtmlParser")},vt=function(){this.a=new tt};zs.prototype.getId=function(){return this.g};zs.prototype.getAttribute=function(a){return this.a[a]};_.v(As,zs);_.v(Bs,zs);var Ds=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Es=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Gs=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Hs=/^(\d*(?:\.\d*)?)f$/,Is=/^(\d*(?:\.\d*)?)t$/,Js=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Us=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Vs=/^(\d+)px (\d+)px$/,at=/^(\d+) (\d+)$/,Ns=/(\d+)px/,wt=/^(\d+px|\d+em|\d*\.?\d+c)$/,et=["fontStyle","fontSize","fontFamily","fontWeight","lineHeight",
|
|
11
|
+
"color",rs,"opacity","padding","zIndex",ws,ts,ys,ss,xs,"textOutline"],ot=["begin",_.dd];_.v(Ps,Bs);
|
|
12
|
+
Ps.prototype.build=function(a,b,c,d,e,f,g){var h=Ks(this.a.begin,b);b=Ks(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.xn(_.Vc);for(var l=_.u(this.h),m=l.next();!m.done;m=l.next())c.appendChild(Rs(g.get(m.value),e,g));g=new _.xg(h,b,c.innerHTML.trim(),_.Fe);g.cssClassList=_.kf(this.f).concat();g.textAlign=Qs(this,e,null);g.writingMode=_.tg;g.line=-1;g.lineInterpretation=_.ug;g.lineAlign=_.vg;g.containerRows=Zs(null,bt(a),15);if(this.m&&(f=f.get(this.m))){g.region=f.build(a,e);g.textAlign=
|
|
13
|
+
Qs(this,e,f);a:switch(Cs(f,e,ys)){case "tb":case "tblr":a=_.Ne;break a;case "tbrl":a=_.Oe;break a;default:a=_.tg}g.writingMode=a;a:switch(Cs(f,e,ts)){case _.Ac:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Cs(f,e,ts)){case _.Ac:a=1;break a;default:a=_.ug}g.lineInterpretation=a;a:switch(Cs(f,e,ts)){case _.Ac:e=_.Ac;break a;default:e=_.vg}g.lineAlign=e}this.j&&(a=d.get(this.j))&&(d=a.getAttribute("encoding"),e=a.getAttribute("imageType")||a.getAttribute("imagetype"),a=a.h.trim(),
|
|
14
|
+
g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.v(Ts,Bs);
|
|
15
|
+
Ts.prototype.build=function(a,b){var c=new _.Ag;c.id=this.getId();var d=Zs(a.h.containerWidth,$s(a,1),720),e=Zs(a.h.containerHeight,$s(a,2),480);a:switch(Cs(this,b,ts)){case "after":var f="flex-start";break a;case _.Ac:f=_.Ac;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Cs(this,b,ys)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Lc}c.writingMode=f;f=this.getAttribute("extent")||Cs(this,b,"extent");c.width=Ws(f,d,1,100);c.widthUnits=Xs(f,d);c.height=
|
|
16
|
+
Ws(f,e,2,100);c.heightUnits=Xs(f,e);f=this.getAttribute("origin")||Cs(this,b,"origin");c.viewportAnchorX=Ws(f,d,1,0);c.viewportAnchorY=Ws(f,e,2,0);c.viewportAnchorUnits=Xs(f,d);c.cssClassList=_.kf(this.f).concat();return c};_.v(Ys,zs);_.v(ct,zs);
|
|
17
|
+
ct.prototype.build=function(a){var b=null;var c=bt(a);c&&(b=Zs(a.h.containerHeight,$s(a,2),480)/c);b=Zs(a.h.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.u(xt.entries()),e=d.next();!e.done;e=d.next()){var f=_.u(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+Ms(this.a[e])+";")}a:{if("unicodeBidi"in this.a){d=this.a.unicodeBidi;e="";switch(d){case "normal":case "embed":e=d;break;case "bidiOverride":e="bidi-override"}if(0<e.length){d="unicode-bidi:"+
|
|
18
|
+
e+";";break a}}d=""}c+=d;a:{if("textOutline"in this.a){d=this.a.textOutline.split(" ");e="black";f=".4em";var g=d[0]&&d[0].trim(),h=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!wt.test(g)&&wt.test(h)&&wt.test(l)?(e=g,f=h):2===d.length&&!wt.test(g)&&wt.test(h)?(e=g,f=h):2===d.length&&wt.test(g)&&wt.test(h)&&(f=g);if(""!==f){f=Ms(f);d="text-shadow:0 0 "+(f+" "+e+",0 0 ")+(f+" "+e+",0 0 ")+(f+" "+e+";");break a}}d=""}c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif",
|
|
19
|
+
"monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",vs).replace("proportionalSerif",vs).replace("sansSerif",vs).replace("default",vs)+";":"");a:{if(xs in this.a){d=[];e=_.u(this.a.textDecoration.split(" "));for(f=e.next();!f.done;f=e.next())switch(f=f.value,f){case "underline":case "overline":d.push(f);break;case "lineThrough":d.push("line-through")}if(0<d.length){d="text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+
|
|
20
|
+
Ms(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Ms(e),e=Os(e,b),d=d+"line-height:"+e+";"):d="";a.push(c+d+"}");a:{if("fontSize"in this.a&&(c=this.a.fontSize.split(" "),d=null,1===c.length&&(d=c[0]),2===c.length&&(d=c[1]),d)){d=d.trim();d=Ms(d);d=Os(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.g+" .clpp-text-wrapper {",a.push(c+b+"}"),c="::ttml .clpp-text-wrapper__"+this.g+" {",a.push(c+b+"}"));return a};
|
|
21
|
+
var xt=new Map([["color","color"],[rs,"background-color"],[ss,ss],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var ht=0;kt.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!yt.has(Ls(a.nodeName))||zt.has(Ls(a.nodeName))||!a.firstChild||this.f.has(a.firstChild)?a.nextSibling?a=a.nextSibling:a=a.parentNode:a=a.firstChild;while(a&&(this.f.has(a)||a.nodeType!==Node.TEXT_NODE&&!yt.has(Ls(a.nodeName))));var b=this.a;this.a=a;return b};var yt=new Set(["tt","head","layout",_.zd,_.kd,us,"styling",_.ve,"body",_.Vc,"p","span","br"]),zt=new Set([_.ve,_.kd]);lt.prototype.getId=function(){return this.attributes.id};qt.prototype.parseInit=function(){};
|
|
22
|
+
qt.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.J.Ma(this.a.ttml||{}),e=_.N(a,0,c[0]);e=_.oh(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.Ce)}catch(n){throw new _.L(_.M,2,2005,"Failed to parse TTML.");}d=new dt(d);e=new nt;f=new kt(f);b=b.periodStart;typeof b===_.k&&(d.w=b);b=c[0];for(var g=1;g<c.length;++g){var h=c[g],l=_.N(a,b,h);l=_.ak(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new As(m,l,{imageType:"PNG",encoding:"Base64"}));
|
|
23
|
+
b+=h}for(;f.a;)a=f.next(),a=pt(e,a),"tt"===mt(a)&&(d.j=new Ys(d.A,Object.assign({},a.attributes))),"tt"===mt(a)&&(d.o=new Ss(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),mt(a)!==_.kd||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.g.set(c,new As(c,a.g.textContent,a.attributes))),mt(a)===_.kd&&a.attributes.begin&&a.attributes.end?(c="#"+it(),b=new As(c,a.g.textContent,a.attributes),d.g.set(c,b),c=b):c=null,c&&(a.h=c.getId()),mt(a)===
|
|
24
|
+
_.ve&&(c=a.getId()||it(),b=new ct(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.h.get(a.a).f.push(c)),mt(a)!==_.ve&&ft(a)?(c=it(),b=new ct(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),mt(a)!==_.Vc||!a.attributes.extent&&!a.attributes.origin?c=null:(c=it(),b=new Ts(c,gt(d,a.f),Object.assign({},a.attributes)),d.h.set(c,b),c=b),c&&(a.a=c.getId()),mt(a)!==us?c=null:(c=a.getId(),b=new Ts(c,gt(d,a.f),Object.assign({},a.attributes)),d.h.set(c,b),c=b),c&&
|
|
25
|
+
(a.a=c.getId()),c=a.j,-1===["#text","span","br"].indexOf(mt(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=it(),b=new Ps(c,"#text"===a.g.nodeName?a.g.textContent:null,"br"===mt(a),a.a,a.h,gt(d,a.f),a.attributes),d.f.set(c,b),(g=d.f.get(g))&&g.h.push(c),c=b):c=null),c&&a.j.push(c.getId()),"p"===mt(a)||a.h?(c=it(),b=new Ps(c,null,!1,a.a,a.h,gt(d,a.f),a.attributes),d.f.set(c,b),d.m.push(b),c=b):c=null,c&&a.j.push(c.getId());e=jt(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
|
|
26
|
+
_.kf(c.value.build(d.j)));return{cues:e,styles:f}};rt.prototype.a=function(a){a=(new qt(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.u(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=st(c.startTime)+" --\x3e "+st(c.endTime),e=[];switch(c.textAlign){case _.od:e.push("align:left");break;case _.he:e.push("align:right");break;case _.sg:e.push("align:middle");break;case _.od:e.push("align:start");break;case _.he:e.push("align:end")}switch(c.writingMode){case _.Ne:e.push("vertical:lr");break;
|
|
27
|
+
case _.Oe:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.sh(b)};tt.prototype.probe=function(a,b){return a===_.fc&&b===_.Be};tt.prototype.create=function(a){return new rt(a)};ut.prototype.parseInit=function(a){var b=!1;(new _.Fk).M(_.Cd,_.Gk).M(_.Ee,_.Gk).M(_.xd,_.Gk).M(_.Bd,_.Gk).M(_.se,_.Gk).V(_.ue,_.Hk).M("stpp",function(c){b=!0;c.Wa.stop()}).parse(a);if(!b)throw new _.L(_.M,2,2007);};
|
|
28
|
+
ut.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Fk).M("moof",_.Gk).M("traf",_.Gk).V("subs",function(h){for(var l=_.U(h.F),m=0;m<l;++m){h.F.skip(4);for(var n=_.Ak(h.F),p=0;p<n;++p){var q=1===h.version?_.U(h.F):_.Ak(h.F);g.push(q);h.F.skip(6)}}}).M(_.wd,_.Ik(function(h){d=!0;h=c.f.parseMedia(h,b,g);e=e.concat(h.cues);f=f.concat(h.styles)})).parse(a);d||this.a.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.v(vt,_.zo);vt.prototype.Ja=function(){_.Rp[_.fc]=qt;_.Rp[_.dc]=ut;_.Rp[os]=ut;_.Rp[qs]=ut;_.Rp[ps]=ut;_.Ci.push(this.a)};vt.prototype.Ca=function(){_.Sp(_.fc);_.Sp(_.dc);_.Sp(os);_.Sp(qs);_.Sp(ps);_.Ei(this.a)};vt.prototype.id=function(){return _.ye};_.B("clpp.ttml.TtmlComponent",vt);};
|
|
28
29
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
29
30
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
30
31
|
else{_=this.clpp._;(f.call(g,this));}
|
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 Qr="VerimatrixVCAS",Rr="clpp.verimatrix.Vcas",Sr="clpp.verimatrix.VcasComponent",ds=function(a){_.rk.call(this,Qr);var b={};b[Tr]=Tr;b[Ur]=Ur;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Vr:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,h=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?Wr:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
|
|
3
|
+
this.C=d;this.B=b;this.w=Xr(this,e);this.o=Xr(this,f);this.m=Xr(this,g);this.j=h;this.G=l;this.D=m;this.f=new _.H(Rr);_.yh(this.w)?this.f.warn(_.Cb):this.Ka(_.Pc,{licenseUrl:this.w,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.yh(this.o)?this.f.warn(_.db):this.Ka(_.Oc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
|
|
4
|
+
_.yh(this.m)?this.f.warn(_.Ja):_.yh(this.j)?this.f.warn(_.Ia):this.Ka(_.Nc,{licenseUrl:this.m,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},Xr=function(a,b){if(a.C===Vr){var c=Object.assign({},{deviceId:_.bk(_.uh(a.A))},a.a&&{authenticator:_.bk(_.uh(a.a))});return b+_.oi(c)}return b},ls=function(){this.l=null;this.a=new _.H(Sr)};_.v(ds,_.rk);
|
|
5
|
+
ds.prototype.h=function(a,b){if(this.C===ms){var c=this.B[Ur],d={};d[this.B[Tr]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};ds.prototype.I=function(a,b){var c=_.Ok(b);switch(this.D){case ns:c=_.oi({r:c,uk:this.G},!0)}return c};ds.prototype.K=function(a,b){this.h(a,b);_.Rk(b)};ds.prototype.L=function(a,b){_.Sk(b)};_.B(Rr,ds);ds.prototype.constructor=ds.prototype.constructor;ds.NAME=Qr;var Vr="query-string",ms="http-header";
|
|
6
|
+
ds.LicenseRequestVuidLocation={QUERY_STRING:Vr,HTTP_HEADER:ms};var Tr="DeviceId",Ur="Authenticator";ds.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Tr,AUTHENTICATOR_HEADER:Ur};var Wr="keyid",ns="contentid-siteid";ds.FairPlayAssetIdStrategy={KEYID:Wr,CONTENTID_SITEID:ns};_.v(ls,_.zo);_.t=ls.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};_.t.Wb=function(){var a=this.l.getConfiguration();if(a.drm&&a.drm.env===Qr){a=a.drm.customData;if(!a)throw new _.L(_.M,7,7100,_.Qc);a=new ds(a);this.a.info("Registering the Verimatrix VCAS Ultra environment");_.mk(a)}};_.t.release=function(){};_.t.id=function(){return"verimatrix-vcas"};_.B(Sr,ls);};
|
|
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 _.I(_.
|
|
4
|
-
|
|
5
|
-
_.t.
|
|
6
|
-
_.t.
|
|
7
|
-
b.B=e;return _.
|
|
8
|
-
_.t.
|
|
9
|
-
l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.
|
|
10
|
-
typeof n.liveResumePossible!==_.
|
|
11
|
-
|
|
12
|
-
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.J.R(b.vimond)&&typeof b.vimond===_.
|
|
13
|
-
c=b.failIfUnreachable;typeof c!==_.
|
|
14
|
-
_.t.
|
|
2
|
+
var f=function(window){var Gr="Registering listeners",Hr="clpp.vimond.VimondPlugin",Ir=function(a,b,c,d,e){this.D=a;this.G=b;this.I=c;this.l=d;this.C=e;this.f=new _.cg;this.m=!0;this.g=this.j=this.A=!1;this.B=null;this.h=new _.Li(this.Df.bind(this));this.a=new _.H("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.f&&(this.a.debug(Gr),this.f.on(this.l,_.pe,this.Ph.bind(this)),this.f.on(this.l,_.De,this.Qh.bind(this)),this.f.on(this.l,_.Fb,this.Nh.bind(this)),this.f.on(this.l,_.Gb,this.Oh.bind(this)))},Jr=function(a,
|
|
3
|
+
b){a.l.trigger(new _.I(_.Ue,{detail:b}))},Kr=function(a,b,c){b&&(a.A=!0,a.h.stop());a.l.onError(new _.L(b?_.M:1,9,9201,c))},Lr=function(a,b,c,d,e){this.o=a;this.m=c;this.g=b;this.a=d;this.j=e;this.h=new _.H("clpp.vimond.VimondService");this.f=0},Mr=function(a){this.l=a;this.a=new _.cg;this.g=new _.H("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.l&&this.a&&(this.g.debug(Gr),this.a.on(this.l,_.de,this.jj.bind(this)),this.a.on(this.l,_.Fb,this.Lh.bind(this)),this.a.on(this.l,_.Gb,this.Mh.bind(this)))},
|
|
4
|
+
Nr=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.Xd];if(a.h)return[_.dd,_.Sd];if(c===_.Vm)return[_.dd,null];if(c===_.Zm)return[_.fd,_.Sd];var d=_.Sd;if(c===_.Tm||c===_.bn||a.f)d=_.Xd;return["period",d]},Or=function(){this.a=!1;this.h=new _.H(Hr);this.j=this.g=this.f=null},Pr=function(){};_.t=Ir.prototype;_.t.Qh=function(){this.g||(this.g=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.t.Nh=function(){this.a.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.t.Oh=function(){this.a.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.t.Ph=function(a){var b=this,c,d,e,f,g;return _.A(function(h){if(1==h.a){c=a.detail;d=_.Xm;e=c.currentState;f=c.previousState;b.a.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.g)return b.a.debug("Ignore transition"),h["return"]();if(b.m&&e!==d.PLAYING)return h["return"]();if(b.g&&[d.PAUSED,d.BUFFERING].includes(e))return b.a.debug("Seeking"),h["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 h.H(0);
|
|
7
|
+
b.B=e;return _.y(h,b.Df(),3)}e===d.ENDED&&b.h.stop();_.z(h)})};
|
|
8
|
+
_.t.Df=function(){var a=this,b,c,d,e,f,g;return _.A(function(h){if(1==h.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.Z(a.m?10:a.D);a.m=!1;_.xf(h,2);l=a.C;l.f++;var m=_.J.Va(l.m);m.client.buildName=_.ta;m.client.buildVersion=_.ia;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 _.mi(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Nr(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.l.getPresentationStartTime()||0;p=Math.floor(q+p.l.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;q=l.a;p=q.l.getPosition();q=q.l.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);
|
|
10
|
+
typeof n.liveResumePossible!==_.rc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.Hh(l.o);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.uh(JSON.stringify(m));l=l.j.fetch(n).P;return _.y(h,l,4)}if(2!=h.a)return b=h.f,Jr(a,b),_.yf(h,0);d=c=_.zf(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.a.debug("Unreachable service"),Jr(a,f),Kr(a,a.G,f)):1001===e?(a.a.debug("Generic service error"),
|
|
11
|
+
Jr(a,f),Kr(a,a.I,f)):a.a.error(c.toString());_.z(h)})};_.t.dispose=function(){this.a.debug(_.yb);_.fg(this.f);this.h.stop()};Lr.prototype.df=function(a){this.g=a};_.t=Mr.prototype;_.t.getPosition=function(){return Math.floor(this.l.getPosition())};_.t.jj=function(){this.h=!0};_.t.Lh=function(){this.f=!0};_.t.Mh=function(){this.f=!1};_.t.dispose=function(){this.g.debug(_.yb);_.fg(this.a)};_.v(Or,_.cq);_.t=Or.prototype;_.t.onPlayerCreated=function(){};
|
|
12
|
+
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.J.R(b.vimond)&&typeof b.vimond===_.Id)?a.namespace()===_.Fc&&(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=_.u(["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 _.L(1,9,9200));return}this.h.debug("Configuration is valid");
|
|
13
|
+
c=b.failIfUnreachable;typeof c!==_.rc&&(c=!0);d=b.failOnError;typeof d!==_.rc&&(d=!0);this.f=new Mr(a);this.g=new Lr(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Ir(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.t.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"vimond"};
|
|
14
|
+
_.t.df=function(a){this.a&&this.g&&this.g.df(a)};_.B(Hr,Or);Or.prototype.updateAuthToken=Or.prototype.df;Or.Id="vimond";Pr.prototype.create=function(){return new Or};_.uo(new Pr);};
|
|
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,23 +1,23 @@
|
|
|
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.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)},
|
|
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.U=this.G=this.f=this.a=this.l=null;this.h=new _.
|
|
11
|
-
this.
|
|
12
|
-
_.t.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()===_.
|
|
13
|
-
this.A=new
|
|
14
|
-
_.t.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&&(
|
|
15
|
-
_.t.
|
|
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=
|
|
2
|
+
var f=function(window){var lr="touchmove",mr="touchstart",nr=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},or=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)},pr=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new nr(a/d*e,b/d*e,0/d*e,Math.cos(c))},qr=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},rr=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},sr=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},tr=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},ur=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},vr=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},wr=function(a){var b=new qr(0,0,0),c=new qr(0,0,1),d=new qr,e=new qr,f=new qr;a=a.a;var g=new qr(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();rr(f,1/g);c=tr(d,c,f);g=c.length();rr(c,1/g);tr(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-sr(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-sr(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-sr(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},yr=function(a){this.a=a;this.f=a.createProgram();this.j=
|
|
5
|
+
xr(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=xr(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 _.L(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)},xr=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 _.L(1,
|
|
7
|
+
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},zr=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.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)},Ar=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)},Br=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
+
this.U=this.G=this.f=this.a=this.l=null;this.h=new _.H("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.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.m=this.j=0;this.g={x:0,y:0};this.O=new ur;this.S=new ur;this.X=new ur;this.$=new ur;this.B=this.gj.bind(this);this.C=this.hj.bind(this);this.K=
|
|
11
|
+
this.fj.bind(this)},Cr=function(a){var b=pr(1,0,a.m*Math.PI/180);or(pr(0,1,a.j*Math.PI/180),a.O);or(b,a.S);wr(a.X);vr(a.$,a.O,a.X);vr(a.G,a.S,a.$)},Dr=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(lr,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},Er=function(){};qr.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};ur.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r,w,x){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]=r;C[11]=w;C[15]=x;return this};var Fr={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.v(Br,_.cq);_.t=Br.prototype;_.t.onPlayerCreated=function(a){this.h.info("Player created");this.l=a};
|
|
12
|
+
_.t.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()===_.Pe){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",Fr)||this.a.getContext("experimental-webgl",Fr);if(!this.f)throw new _.L(1,9,9003,"Unable to create GL context");this.G=new ur;wr(this.G);this.U=new zr(this.f);
|
|
13
|
+
this.A=new yr(this.f);this.J=new ur;this.L=new ur;this.o=this.w=null;this.a.addEventListener(_.ge,this.D)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,!1),this.a.addEventListener(mr,this.K,!1));this.D();this.mg()}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
|
+
_.t.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&&(Dr(this),this.a.removeEventListener(_.ge,this.D),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.t.onPlayerWillDestroy=function(){var a=this;return _.A(function(b){a.l=null;_.z(b)})};_.t.id=function(){return"vr"};
|
|
15
|
+
_.t.mg=function(){if(this.l&&this.f){var a=this.l.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Pe){this.w=requestAnimationFrame(this.mg.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Ar(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=vr(this.J,this.L,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
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
|
-
_.t.
|
|
19
|
-
_.t.
|
|
20
|
-
|
|
18
|
+
_.t.fj=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===mr)a.type===mr?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(lr,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
|
|
19
|
+
_.t.gj=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===lr&&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;Cr(this)};_.t.hj=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Dr(this)};_.t.Ci=function(a,b){this.m=b;this.j=a;Cr(this)};_.t.fi=function(){return{x:this.j,y:this.m}};_.t.Hj=function(a){this.I=a;this.D()};_.B("clpp.vr.VrPlugin",Br);
|
|
20
|
+
Br.prototype.setCameraFieldOfView=Br.prototype.Hj;Br.prototype.getCameraCoordinates=Br.prototype.fi;Br.prototype.moveCamera=Br.prototype.Ci;Br.Id="vr";Er.prototype.create=function(){return new Br};_.uo(new Er);};
|
|
21
21
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
22
22
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
23
23
|
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
|
-
c[2]&&(a.lineAlign=_.
|
|
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)},
|
|
7
|
-
c,
|
|
8
|
-
|
|
9
|
-
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.u(d);for(var g=e.next();!g.done;g=e.next()){var
|
|
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)}
|
|
12
|
-
n,
|
|
13
|
-
|
|
14
|
-
{duration:null,sampleSize:null,
|
|
15
|
-
|
|
2
|
+
var f=function(window){var Sq=" The setting will be ignored.",Tq="VTT parser encountered an invalid VTT setting: ",Uq="application/x-subrip",Vq="text/srt",Wq='text/vtt; codecs\x3d"vtt"',Xq='text/vtt; codecs\x3d"wvtt"',Yq=function(a){_.$g(a,/[ \t]+/gm)},Zq=function(a){return a.a==a.f.length?null:(a=_.$g(a,/[^ \t\n]*/gm))?a[0]:null},$q=function(){},ar=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},br=function(){},cr=function(a){this.a=a},er=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.sg:a.textAlign=
|
|
4
|
+
_.iq[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Ne:_.Oe;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==_.rd||b==_.oe?_.rd:b==_.sd||b==_.dd?_.sd:_.Ac);else if(d=/^region:(.*)$/.exec(b)){if(b=dr(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=_.jq[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ug,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.jq[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},dr=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.F("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},fr=function(a){a=_.$g(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)},gr=function(){cr.apply(this,arguments)},hr=function(){this.a=null;this.f=new _.H("clpp.vtt.mp4")},jr=function(a,b,c){var d,e,f;(new _.Fk).M("payl",_.Ik(function(g){d=_.oh(g)})).M("iden",_.Ik(function(g){e=_.oh(g)})).M("sttg",_.Ik(function(g){f=_.oh(g)})).parse(a);return d?ir(d,e,f,b,c):null},ir=function(a,b,c,d,e){a=new _.xg(d,e,a);b&&(a.id=b);if(c)for(b=new _.Zg(c),c=Zq(b);c;)er(a,c,[])||_.F(Tq,
|
|
7
|
+
c,Sq),Yq(b),c=Zq(b);return a},kr=function(){this.a=new br};$q.prototype.a=function(a){a=_.oh(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=_.u(b);for(var c=b.next();!c.done;c=b.next())a+=ar(c.value)}return _.sh(a)};br.prototype.create=function(){return new $q};br.prototype.probe=function(a,b){return(a===Vq||a===Uq)&&b===_.Be};cr.prototype.parseInit=function(){};
|
|
8
|
+
cr.prototype.parseMedia=function(a,b){var c=_.oh(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 _.L(_.M,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=fr(new _.Zg(e[1]));if(null==c)throw new _.L(_.M,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=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Zg(h.replace(/\n/g," "));g=new _.Ag;Zq(h);Yq(h);for(var l=Zq(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||_.F("VTT parser encountered an invalid VTTRegion setting: ",l,Sq);Yq(h);l=Zq(h)}f.push(g)}}e=[];h=_.u(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=_.u(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 _.Zg(p[0]);m=fr(l);var r=_.$g(l,/[ \t]+--\x3e[ \t]+/g);n=fr(l);if(null==m||null==r||null==n)throw new _.L(_.M,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.xg(m,n,p,_.We);g&&(m.id=g);Yq(l);for(n=Zq(l);n;)er(m,n,f)||_.F(Tq,
|
|
12
|
+
n,Sq),Yq(l),n=Zq(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.v(gr,cr);gr.prototype.parseMedia=function(a,b){return cr.prototype.parseMedia.call(this,(new $q).a(a),b)};hr.prototype.parseInit=function(a){var b=this,c=!1;(new _.Fk).M(_.Cd,_.Gk).M(_.Ee,_.Gk).M(_.xd,_.Gk).V("mdhd",function(d){0==d.version?(d.F.skip(4),d.F.skip(4),b.a=_.U(d.F),d.F.skip(4)):(d.F.skip(8),d.F.skip(8),b.a=_.U(d.F),d.F.skip(8));d.F.skip(4)}).M(_.Bd,_.Gk).M(_.se,_.Gk).V(_.ue,_.Hk).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.L(_.M,2,2008);if(!c)throw new _.L(_.M,2,2008);};
|
|
13
|
+
hr.prototype.parseMedia=function(a,b){if(!this.a)throw this.f.error("No init segment for MP4+VTT!"),new _.L(_.M,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.Fk).M("moof",_.Gk).M("traf",_.Gk).V("tfdt",function(K){g=!0;c=0==K.version?_.U(K.F):_.Dk(K.F)}).V("tfhd",function(K){var O=K.flags;K=K.F;K.skip(4);O&1&&K.skip(8);O&2&&K.skip(4);m=O&8?_.U(K):null}).V("trun",function(K){h=!0;var O=K.version,T=K.flags;K=K.F;var Da=_.U(K);T&1&&K.skip(4);T&4&&K.skip(4);for(var ea=[],fa=0;fa<Da;fa++){var xa=
|
|
14
|
+
{duration:null,sampleSize:null,af:null};T&256&&(xa.duration=_.U(K));T&512&&(xa.sampleSize=_.U(K));T&1024&&K.skip(4);T&2048&&(xa.af=0==O?_.U(K):_.Bk(K));ea.push(xa)}d=ea}).M(_.wd,_.Ik(function(K){l=!0;e=K})).parse(a);if(!l&&!g&&!h)throw new _.L(_.M,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.wk(p,!1);for(var q=_.u(d),r=q.next();!r.done;r=q.next()){r=r.value;var w=r.duration||m,x=r.af?c+r.af:n;n=x+(w||0);var C=0;do{var D=_.U(p);C+=D;var E=_.U(p);E=_.Kk(E);var G=null;"vttc"==
|
|
15
|
+
E?8<D&&(G=_.Ek(p,D-8)):("vtte"!=E&&this.f.error("Unknown box "+E+"! Skipping!"),p.skip(D-8));w?G&&f.push(jr(G,b.periodStart+x/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(_.Dg),styles:[]}};_.v(kr,_.zo);kr.prototype.Ja=function(){_.Rp[_.Be]=cr;_.Rp[Wq]=cr;_.Rp[Xq]=cr;_.Rp[_.ec]=hr;_.Rp[Vq]=gr;_.Rp[Uq]=gr;_.Ci.push(this.a)};kr.prototype.Ca=function(){_.Sp(_.Be);_.Sp(Wq);_.Sp(Xq);_.Sp(_.ec);_.Sp(Vq);_.Sp(Uq);_.Ei(this.a)};kr.prototype.id=function(){return _.ye};_.B("clpp.vtt.VttComponent",kr);};
|
|
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,23 +1,24 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
if(c&&(c=c.
|
|
4
|
-
b.prototype.getFramesPerSecond=function(){var c=this.l.getTrackManager();return c&&(c=c.
|
|
5
|
-
_.
|
|
6
|
-
c.detail)switch(c.currentState){case _
|
|
7
|
-
(this.h=!1,this.fireInit())};b.prototype.w=function(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.
|
|
8
|
-
this.fireFatalError(""+c.code,c.message)):this.fireError(""+c.code,c.message))};b.prototype.I=function(c){this.a.debug("Seeking",c);this.l.isEnded()||(this.g(),this.fireSeekBegin())};b.prototype.G=function(c){this.a.debug("Seeked",c);this.fireSeekEnd()};b.prototype.B=function(c){this.a.debug("adsTimeline",c);c=c.adsTimeline;this.o=!!c&&c.
|
|
9
|
-
d.l=c;d.a=null;d.h=null;d.f=new _.
|
|
10
|
-
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.
|
|
11
|
-
b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.l.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.
|
|
12
|
-
this;return this.h&&this.h.getCuePoints().map(function(d){return-1===d?c.l.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.l.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.
|
|
13
|
-
b.prototype.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.
|
|
14
|
-
this.f.on(this.l,_.
|
|
15
|
-
function(c){this.g.debug("ad
|
|
16
|
-
this.a.
|
|
17
|
-
_.M?this.fireFatalError(""+c.code,c.message):this.fireError(""+c.code,c.message))};return new b(a)},
|
|
18
|
-
|
|
19
|
-
_.t.
|
|
20
|
-
|
|
2
|
+
var f=function(window){var Jq="accountCode key is missing in Youbora config",Kq="clpp.npaw.YouboraPlugin",Lq="content.isLive",Mq=function(a,b){for(var c=a.split("."),d=b.split("."),e=0;e<c.length;e++){var f=parseInt(c[e],10),g=parseInt(d[e],10);if(f<g)return!0;if(f>g)break}return!1},Nq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.l=c;d.f=new _.cg;d.a=new _.H("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.registerListeners();d.A=!1;return d}_.v(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.l.getPosition()};
|
|
3
|
+
b.prototype.getDuration=function(){return this.l.getDuration()};b.prototype.getRendition=function(){var c=this.l.getTrackManager();if(c&&(c=c.ea())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),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.l.isLive()};b.prototype.getResource=function(){var c=this.l.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};
|
|
4
|
+
b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.l.getPlaybackRate()};b.prototype.getFramesPerSecond=function(){var c=this.l.getTrackManager();return c&&(c=c.Ia())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ta};b.prototype.getVersion=function(){return"6.4.1-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),
|
|
5
|
+
youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.pe,this.J.bind(this)),this.f.on(this.l,_.fd,this.D.bind(this)),this.f.on(this.l,_.Le,this.I.bind(this)),this.f.on(this.l,_.Ke,this.G.bind(this)),this.f.on(this.l,_.Wb,this.B.bind(this)),this.f.on(this.l,_.wc,this.C.bind(this)))};b.prototype.unregisterListeners=function(){this.a.debug(_.yb);_.fg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.j=function(){return this.l.getStats()||_.Km()};
|
|
6
|
+
b.prototype.m=function(){return!!this.l.getConfiguration().autoplay};b.prototype.J=function(c){this.a.debug("State changed",c);if(c=c.detail)switch(c.currentState){case _.$m:this.m()&&this.g();break;case _.bn:this.g();this.w();this.fireResume();this.fireBufferEnd();break;case _.an:this.m()&&this.g();this.w();this.fireBufferEnd();this.firePause();break;case _.Om:this.fireBufferEnd();this.fireStop();break;case _.Vm:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();
|
|
7
|
+
break;case _.Tm:this.fireBufferBegin();break;default:this.a.debug("Unhandled state",c)}};b.prototype.g=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.w=function(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Pc)?"Widevine":c.startsWith(_.Nc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Qd)?"ClearKey":c.startsWith(_.Mc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.D=
|
|
8
|
+
function(c){this.a.debug("Fire error",c);!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c.severity===_.M?(this.h=!0,this.fireFatalError(""+c.code,c.message)):this.fireError(""+c.code,c.message))};b.prototype.I=function(c){this.a.debug("Seeking",c);this.l.isEnded()||(this.g(),this.fireSeekBegin())};b.prototype.G=function(c){this.a.debug("Seeked",c);this.fireSeekEnd()};b.prototype.B=function(c){this.a.debug("adsTimeline",c);c=c.adsTimeline;this.o=!!c&&c.hb()};b.prototype.C=function(c){this.a.debug("Casting",
|
|
9
|
+
c);this.fireCasted()};return new b(a)},Oq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.l=c;d.a=null;d.h=null;d.f=new _.cg;d.g=new _.H("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.m=!1;return d}_.v(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.vb(),this.a.ub(),this.a.gb()));return c};b.prototype.getBitrate=function(){return this.a&&
|
|
10
|
+
this.a.gb()};b.prototype.getPlayhead=function(){var c=this.l.getAdsManager();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=
|
|
11
|
+
c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.l.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.xb()};
|
|
12
|
+
b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.h&&this.h.getCuePoints().map(function(d){return-1===d?c.l.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.l.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.ta};
|
|
13
|
+
b.prototype.getVersion=function(){return"6.4.1-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Wb,this.I.bind(this)),this.f.on(this.l,_.Sb,this.G.bind(this)),this.f.on(this.l,_.Ob,this.B.bind(this)),this.f.on(this.l,_.Qb,this.C.bind(this)),this.f.on(this.l,_.Jb,this.w.bind(this)),this.f.on(this.l,_.Kb,this.j.bind(this,1)),this.f.on(this.l,_.Nb,this.j.bind(this,2)),this.f.on(this.l,_.Ub,this.j.bind(this,
|
|
14
|
+
3)),this.f.on(this.l,_.Ib,this.o.bind(this)),this.f.on(this.l,_.Rb,this.D.bind(this)),this.f.on(this.l,_.fd,this.A.bind(this)),this.f.on(this.l,_.Fb,this.J.bind(this)),this.f.on(this.l,_.Gb,this.K.bind(this)),this.f.on(this.l,_.Hb,this.L.bind(this)),this.f.on(this.l,_.Pb,this.O.bind(this)))};b.prototype.unregisterListeners=function(){_.fg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.m=!0};b.prototype.I=function(c){this.g.debug("ad timeline changed",c);
|
|
15
|
+
this.h=c.adsTimeline};b.prototype.G=function(c){this.g.debug("ad start",c);this.a=c.ad;this.fireStart();this.fireJoin()};b.prototype.w=function(c){this.g.debug("ad end",c);this.fireStop()};b.prototype.B=function(c){this.g.debug("ad pause",c);this.firePause()};b.prototype.C=function(c){this.g.debug("ad resume",c);this.fireResume()};b.prototype.L=function(c){this.g.debug("on buffering",c);this.fireBufferBegin()};b.prototype.O=function(c){this.g.debug("on progress",c);this.fireBufferEnd()};b.prototype.j=
|
|
16
|
+
function(c,d){this.g.debug("ad quartile",c,d);this.fireQuartile(c)};b.prototype.o=function(c){this.g.debug("ad clicked",c);c=this.a&&this.a.Ib();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.D=function(c){this.g.debug("ad skipped",c);this.fireSkip()};b.prototype.J=function(c){this.g.debug("break start",c);this.a=c.ad;this.fireBreakStart()};b.prototype.K=function(c){this.g.debug("ad break stop",c);this.fireBreakStop();this.getPosition()===youbora.Constants.AdPosition.Postroll&&
|
|
17
|
+
(c=this.plugin.getAdapter())&&c.fireStop()};b.prototype.A=function(c){this.g.warn("ad error",c);(c=c.detail)&&10003===c.code&&(c.severity===_.M?this.fireFatalError(""+c.code,c.message):this.fireError(""+c.code,c.message))};return new b(a)},Pq=function(){this.a=null;this.f=!1;this.g=new _.H(Kq);this.l=null},Qq=function(a,b){var c=b.getConfiguration();a.f=!_.J.R(c.youbora)&&typeof c.youbora===_.Id;if(a.f)if(null==window.youbora)a.f=!1,a.g.warn("Youbora SDK not found."),b.onError(new _.L(1,9,9100));
|
|
18
|
+
else{c=youbora.VERSION;var d;if(typeof c===_.te&&null!=c.match(/^\d+\.\d+\.\d+$/)){if(d=!Mq(c,"6.8.12"))d="6.8.25"===c||Mq(c,"6.8.25")}else d=!1;d||(a.g.warn("Youbora SDK version is not supported. Supported versions are 6.8.12 - 6.8.25, found version "+(c+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.L(1,9,9102)));b.namespace()===_.Fc&&(a.f=!1,a.g.info("Youbora does not report when casting."))}else a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},
|
|
19
|
+
Rq=function(){};_.v(Pq,_.cq);_.t=Pq.prototype;_.t.Xe=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Nq(this.l)),this.a.setAdsAdapter(Oq(this.l))};_.t.getAdapter=function(){return this.a&&this.a.getAdapter()};_.t.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.t.onPlayerCreated=function(a){this.l=a;Qq(this,a);if(this.f){var b=a.getConfiguration().youbora;b.accountCode?this.Xe(new youbora.Plugin(b)):(this.g.warn(Jq),a.onError(new _.L(1,9,9101)))}};
|
|
20
|
+
_.t.onContentWillLoad=function(a,b){Qq(this,a);if(this.f){var c=a.getConfiguration(),d=c.youbora;d.accountCode?(void 0===d[Lq]&&(d[Lq]=b.isLive),void 0===d["content.title"]&&(d["content.title"]=b.name),void 0===d.viewerId&&(d.viewerId=c.viewerId),this.a||this.Xe(new youbora.Plugin(d)),this.a.setOptions(d)):(this.g.warn(Jq),a.onError(new _.L(1,9,9101)))}};_.t.onPlayerWillRelease=function(){};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"youbora"};_.B(Kq,Pq);
|
|
21
|
+
Pq.prototype.getAdsAdapter=Pq.prototype.getAdsAdapter;Pq.prototype.getAdapter=Pq.prototype.getAdapter;Pq.prototype.setYouboraPlugin=Pq.prototype.Xe;Pq.Id="youbora";Rq.prototype.create=function(){return new Pq};_.uo(new Rq);};
|
|
21
22
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
22
23
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
23
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
|
-
_.x("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var TK=function(a){a.f=new _.mo;a.f.on(a.l,_.Be,()=>RK(a));a.f.on(a.l,_.Ae,()=>{s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.nd,()=>SK(a));a.f.on(a.l,_.ie,b=>{b=b.detail;switch(b.currentState){case _.Ll:a.a.length||SK(a);s.Media.play(a.a,a.l.getPosition());break;case _.Kl:case _.Dl:RK(a);break;case _.Al:case _.Il:case _.Hl:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),RK(a),s.Media.close(a.a),a.a=""}})},RK=function(a){s.Media.stop(a.a,a.l.getPosition())},
|
|
2
|
+
SK=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(),_.pa)},UK=class extends _.Zp{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,TK(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",UK);UK.Id="adobe";_.Km(new class{create(){return new UK}});};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 _.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var QK=class extends _.Zp{constructor(){super();this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.No(()=>{this.l.play().catch(()=>{})});this.g=new _.mo}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 _.C(_.Pb,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Nb:_.Mb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Ll)this.j?this.l.play().catch(()=>{}):this.m.aa(.01);this.l.trigger(new _.C(a))}fb(){return this.h}fd(){return this.f}Qf(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",QK);QK.prototype.showCastMenu=QK.prototype.Qf;
|
|
3
|
+
QK.prototype.canCast=QK.prototype.fd;QK.prototype.isCasting=QK.prototype.fb;QK.Id="airplay";_.Km(new class{create(){return new QK}});};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 JK=function(){return!window.SmartLib||!window.GenericPlayerApi},KK=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===_.le&&a.g.setUUID(b))},MK=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,_.Wc,a.T.bind(a));a.h=new LK(a.l);a.a.attachPlayer(a.h)},NK=function(a,b){_.Mf(a.j);a.f&&
|
|
2
|
+
(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},OK=class{constructor(a,b){this.l=a;this.f=b;this.a=new _.mo;this.g=!1}init(){const a=this.l,b=this.a;b.on(a,_.ie,this.m.bind(this));b.on(a,_.ec,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===_.Dl&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Dl:c.notifyStallStart();
|
|
3
|
+
break;case _.Ll:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Kl:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Mf(this.a),this.a=null)}};var LK=class extends GenericPlayerApi{constructor(a){super();this.l=a;this.a=_.ri()}getPlayerName(){return _.pa}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 PK=class extends _.Zp{constructor(){super();this.h=this.f=this.a=this.g=this.l=null;this.j=new _.mo}onPlayerCreated(a){this.l=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(JK())return a.onError(new _.H(1,9,11E3));KK(this,c);MK(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}));NK(this,void 0)}else b.url=d.getURL(),this.f=new OK(this.l,
|
|
4
|
+
this.h),this.f.init()})}}T(a){a=a.detail;if(7003===a.code)NK(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.F)switch(a.category){case 3:NK(this,SmartLib.BPDecodingError);break;case 1:NK(this,SmartLib.BPNetworkingError);break;case 6:NK(this,SmartLib.BPAccessRightError);break;default:NK(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){JK()||NK(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",PK);PK.isSdkMissing=JK;PK.Id="broadpeak";
|
|
5
|
+
_.Km(new class{create(){return new PK}});};f.call(g, window);
|