@castlabs/prestoplay 6.9.0 → 6.11.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 +66 -0
- 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 +112 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +467 -432
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +143 -45
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +78 -73
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -31
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +276 -275
- package/cjs/cl.muxdata.js +14 -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.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +29 -27
- 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 +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +396 -365
- package/cl.crypto.js +9 -9
- package/cl.dash.js +68 -67
- package/cl.externs.js +139 -45
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +64 -61
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +240 -242
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +59 -58
- package/cl.thumbnails.js +17 -17
- 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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/clpp.styles.css +15 -0
- package/package.json +1 -1
- package/typings.d.ts +249 -21
package/cjs/cl.ttml.js
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
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.w,a.A,a.g,a.a,a.j,a.f)}).filter(function(b){return null!=b})},
|
|
9
|
-
g={},
|
|
10
|
-
a},
|
|
11
|
-
"color",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(
|
|
26
|
-
_.
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
var f=function(window){var Nt='application/mp4; codecs\x3d"stpp.ttml"',Ot='application/mp4; codecs\x3d"stpp.ttml.im1i"',Pt='application/mp4; codecs\x3d"stpp.ttml.im1t"',Qt="backgroundColor",Rt="direction",St="displayAlign",Tt="region",Ut="sans-serif",Vt="textAlign",Wt="textDecoration",Xt="writingMode",Yt=function(a,b,c){this.g=a;this.f=b;this.a=c},Zt=function(a,b,c){Yt.call(this,a,[],c);this.j=b||""},$t=function(a,b,c){Yt.call(this,a,b,c)},au=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},iu=function(a,b){var c=null;if(bu.test(a)){c=bu.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 cu.test(a)?c=du(cu,a):eu.test(a)?c=du(eu,a):fu.test(a)?(c=fu.exec(a),c=Number(c[1])/b.frameRate):gu.test(a)?(c=gu.exec(a),c=Number(c[1])/b.a):hu.test(a)&&(c=du(hu,a));return c},du=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)},ju=function(a){return a.split(":").pop()},ku=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},mu=function(a,b){for(;lu.test(a);){var c=lu.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},nu=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},ou=function(a,b,c,d,e,f,g){Yt.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},pu=function(a,b,c){a=au(a,b,Vt);if(!a&&c&&(a=au(c,b,Vt),!a&&"rltb"===au(c,
|
|
5
|
+
b,Xt)))return _.Ke;switch(a){case _.Ic:return _.Zg;case _.Ke:case _.wd:return _.Ke;default:return _.Hd}},qu=function(a,b,c){if(_.gi(a.w))return document.createTextNode(_.ki(a.w||""));if(a.A)return _.to("br");for(var d=_.to("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.uo(d,f.value);a=_.u(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(qu(c.get(e.value),b,c));return d},ru=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*
|
|
6
|
+
this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))},su=function(a,b,c){Yt.call(this,a,b,c)},vu=function(a,b,c,d){var e=tu.exec(a);a=uu.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},wu=function(a,b){return typeof b===_.k&&0<b?_.eh:uu.test(a)?0:_.eh},xu=function(a,b){Yt.call(this,"root-container",[],b);this.j=a},yu=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},zu=function(a,b){var c=a.getAttribute("extent");
|
|
7
|
+
return(c=uu.exec(c))?Number(c[b]):null},Bu=function(a){a=a.getAttribute("cellResolution");return(a=Au.exec(a))?Number(a[2]):null},Cu=function(a,b,c){Yt.call(this,a,b,c)},Du=function(a){this.B=a;this.w=this.l=null;this.A=0;this.g=new Map;this.a=new Map;this.j=new Map;this.f=new Map;this.o=[]},Fu=function(a){return Eu.some(function(b){return b in a.attributes})},Gu=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,_.Of(Gu(a,
|
|
8
|
+
a.a.get(e).f)).concat([e]));return c},Iu=function(){return"inline-"+Hu++},Ju=function(a){return a.o.map(function(b){return b.build(a.l,a.w,a.A,a.g,a.a,a.j,a.f)}).filter(function(b){return null!=b})},Ku=function(a){this.a=a.firstChild;this.f=new Set},Lu=function(a,b,c,d,e,f){this.g=a;this.a=b;this.j=c;this.l=d;this.f=e;this.attributes=f},Mu=function(a){return ju(a.g.nodeName)},Nu=function(){this.a=new Map},Pu=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},h=b.parentNode;
|
|
9
|
+
if(h&&a.a.has(h)){var l=a.a.get(h);e=_.Of(l.l).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.Of(l.f).concat(),g={},Ou.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(Tt)&&(c=b.getAttribute(Tt));b.hasAttribute(_.We)&&f.push.apply(f,_.Of(b.getAttribute(_.We).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=ju(h);g[m]=b.getAttribute(h)}d=
|
|
10
|
+
g.backgroundImage}c=new Lu(b,c,d,e,f,g);a.a.set(b,c);return c},Qu=function(a){this.a=a;this.f=new DOMParser},Ru=function(a){this.f=a},Su=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")},Tu=function(){},Uu=function(a){this.a=new Qu(a);this.h=new _.K("clpp.ttml.Mp4TtmlParser")},Vu=function(){this.j=new Tu};Yt.prototype.getId=function(){return this.g};
|
|
11
|
+
Yt.prototype.getAttribute=function(a){return this.a[a]};_.w(Zt,Yt);_.w($t,Yt);var bu=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,cu=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,eu=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,fu=/^(\d*(?:\.\d*)?)f$/,gu=/^(\d*(?:\.\d*)?)t$/,hu=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,tu=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,uu=/^(\d+)px (\d+)px$/,Au=/^(\d+) (\d+)$/,lu=/(\d+)px/,Wu=/^(\d+px|\d+em|\d*\.?\d+c)$/,Eu=[Qt,"color",Rt,St,"fontFamily","fontSize","fontStyle","fontWeight",
|
|
12
|
+
"lineHeight","opacity","padding",Vt,Wt,"textOutline",Xt,"zIndex"],Ou=["begin",_.wd];_.w(ou,$t);
|
|
13
|
+
ou.prototype.build=function(a,b,c,d,e,f,g){var h=iu(this.a.begin,b);b=iu(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.to(_.gd);for(var l=_.u(this.j),m=l.next();!m.done;m=l.next())c.appendChild(qu(g.get(m.value),e,g));g=new _.dh(h,b,c.innerHTML.trim(),_.ef);g.cssClassList=_.Of(this.f).concat();g.textAlign=pu(this,e,null);g.writingMode=_.$g;g.line=-1;g.lineInterpretation=_.ah;g.lineAlign=_.bh;g.containerRows=yu(null,Bu(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
|
|
14
|
+
pu(this,e,f);a:switch(au(f,e,Xt)){case "tb":case "tblr":a=_.sf;break a;case "tbrl":a=_.tf;break a;default:a=_.$g}g.writingMode=a;a:switch(au(f,e,St)){case _.Ic:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(au(f,e,St)){case _.Ic:a=1;break a;default:a=_.ah}g.lineInterpretation=a;a:switch(au(f,e,St)){case _.Ic:e=_.Ic;break a;default:e=_.bh}g.lineAlign=e}this.l&&(a=d.get(this.l))&&(d=a.getAttribute("encoding"),e=a.getAttribute("imageType")||a.getAttribute("imagetype"),a=a.j.trim(),
|
|
15
|
+
g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.w(su,$t);
|
|
16
|
+
su.prototype.build=function(a,b){var c=new _.gh;c.id=this.getId();var d=yu(a.j.containerWidth,zu(a,1),720),e=yu(a.j.containerHeight,zu(a,2),480);a:switch(au(this,b,St)){case "after":var f="flex-start";break a;case _.Ic:f=_.Ic;break a;default:f="flex-end"}c.displayAlign=f;a:switch(au(this,b,Xt)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Wc}c.writingMode=f;f=this.getAttribute("extent")||au(this,b,"extent");c.width=vu(f,d,1,100);c.widthUnits=wu(f,d);c.height=
|
|
17
|
+
vu(f,e,2,100);c.heightUnits=wu(f,e);f=this.getAttribute("origin")||au(this,b,"origin");c.viewportAnchorX=vu(f,d,1,0);c.viewportAnchorY=vu(f,e,2,0);c.viewportAnchorUnits=wu(f,d);c.cssClassList=_.Of(this.f).concat();return c};_.w(xu,Yt);_.w(Cu,Yt);
|
|
18
|
+
Cu.prototype.build=function(a){var b=null;var c=Bu(a);c&&(b=yu(a.j.containerHeight,zu(a,2),480)/c);b=yu(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.u(Xu.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+":"+ku(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:"+
|
|
19
|
+
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&&!Wu.test(g)&&Wu.test(h)&&Wu.test(l)?(e=g,f=h):2===d.length&&!Wu.test(g)&&Wu.test(h)?(e=g,f=h):2===d.length&&Wu.test(g)&&Wu.test(h)&&(f=g);if(""!==f){f=ku(f);d="text-shadow:0 0 "+(f+" "+e+",0 0 ")+(f+" "+e+",0 0 ")+(f+" "+e+";");break a}}d=""}c+=d;"textShadow"in this.a?(d=nu(this.a.textShadow),d=ku(d),d="text-shadow:"+
|
|
20
|
+
d+";"):d="";c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif","monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",Ut).replace("proportionalSerif",Ut).replace("sansSerif",Ut).replace("default",Ut)+";":"");a:{if(Wt 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=
|
|
21
|
+
"text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+ku(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=ku(e),e=mu(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=ku(d);d=mu(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.g+" .clpp-text-wrapper {",a.push(c+b+"}"),
|
|
22
|
+
c="::ttml .clpp-text-wrapper__"+this.g+" {",a.push(c+b+"}"));return a};var Xu=new Map([[Qt,"background-color"],["color","color"],[Rt,Rt],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Hu=0;Ku.prototype.Wd=function(){return!!this.a};Ku.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Yu.has(ju(a.nodeName))||Zu.has(ju(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&&!Yu.has(ju(a.nodeName))));var b=this.a;this.a=a;return b};
|
|
23
|
+
var Yu=new Set(["tt","head","layout",_.Td,_.Ed,Tt,"styling",_.We,"body",_.gd,"p","span","br"]),Zu=new Set([_.We,_.Ed]);Lu.prototype.getId=function(){return this.attributes.id};Qu.prototype.parseInit=function(){};
|
|
24
|
+
Qu.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.M.Sa(this.a.ttml||{}),e=_.R(a,0,c[0]);e=_.Yh(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.bf)}catch(n){throw new _.N(_.O,2,2005,"Failed to parse TTML.");}d=new Du(d);e=new Nu;f=new Ku(f);b=b.periodStart;typeof b===_.k&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var h=c[g],l=_.R(a,b,h);l=_.mi(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new Zt(m,l,{imageType:"PNG",encoding:"Base64"}));
|
|
25
|
+
b+=h}for(;f.Wd();)a=f.next(),a=Pu(e,a),"tt"===Mu(a)&&(d.l=new xu(d.B,Object.assign({},a.attributes))),"tt"===Mu(a)&&(d.w=new ru(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),Mu(a)!==_.Ed||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.g.set(c,new Zt(c,a.g.textContent,a.attributes))),Mu(a)===_.Ed&&a.attributes.begin&&a.attributes.end?(c="#"+Iu(),b=new Zt(c,a.g.textContent,a.attributes),d.g.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
|
|
26
|
+
Mu(a)===_.We&&(c=a.getId()||Iu(),b=new Cu(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),Mu(a)!==_.We&&Fu(a)?(c=Iu(),b=new Cu(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),Mu(a)!==_.gd||!a.attributes.extent&&!a.attributes.origin?c=null:(c=Iu(),b=new su(c,Gu(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),Mu(a)!==Tt?c=null:(c=a.getId(),b=new su(c,Gu(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
|
|
27
|
+
c=b),c&&(a.a=c.getId()),c=a.l,-1===["#text","span","br"].indexOf(Mu(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=Iu(),b=new ou(c,"#text"===a.g.nodeName?a.g.textContent:null,"br"===Mu(a),a.a,a.j,Gu(d,a.f),a.attributes),d.f.set(c,b),(g=d.f.get(g))&&g.j.push(c),c=b):c=null),c&&a.l.push(c.getId()),"p"===Mu(a)||a.j?(c=Iu(),b=new ou(c,null,!1,a.a,a.j,Gu(d,a.f),a.attributes),d.f.set(c,b),d.o.push(b),c=b):c=null,c&&a.l.push(c.getId());e=Ju(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
|
|
28
|
+
_.Of(c.value.build(d.l)));return{cues:e,styles:f}};Ru.prototype.a=function(a){a=(new Qu(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=Su(c.startTime)+" --\x3e "+Su(c.endTime),e=[];switch(c.textAlign){case _.Hd:e.push("align:left");break;case _.Ke:e.push("align:right");break;case _.Zg:e.push("align:middle");break;case _.Hd:e.push("align:start");break;case _.Ke:e.push("align:end")}switch(c.writingMode){case _.sf:e.push("vertical:lr");break;
|
|
29
|
+
case _.tf:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.bi(b)};Tu.prototype.probe=function(a,b){return a===_.oc&&b===_.af};Tu.prototype.create=function(a){return new Ru(a)};Uu.prototype.parseInit=function(a){var b=!1;(new _.ul).L(_.Wd,_.vl).L(_.df,_.vl).L(_.Rd,_.vl).L(_.Vd,_.vl).L(_.Te,_.vl).X(_.Ve,_.wl).L("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.N(_.O,2,2007);};
|
|
30
|
+
Uu.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.ul).L("moof",_.vl).L("traf",_.vl).X("subs",function(h){for(var l=_.W(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.pl(h.reader),p=0;p<n;++p){var q=1===h.version?_.W(h.reader):_.pl(h.reader);g.push(q);h.reader.skip(6)}}}).L(_.Qd,_.xl(function(h){d=!0;h=c.a.parseMedia(h,b,g);e=e.concat(h.cues);f=f.concat(h.styles)})).parse(a);d||this.h.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.w(Vu,_.Mp);Vu.prototype.f=function(){_.fr[_.oc]=Qu;_.fr[_.mc]=Uu;_.fr[Nt]=Uu;_.fr[Pt]=Uu;_.fr[Ot]=Uu;_.tj.push(this.j)};Vu.prototype.a=function(){_.gr(_.oc);_.gr(_.mc);_.gr(Nt);_.gr(Pt);_.gr(Ot);_.vj(this.j)};Vu.prototype.id=function(){return"subtitles-ttml"};_.I("clpp.ttml.TtmlComponent",Vu);};
|
|
29
31
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
30
32
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
31
33
|
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.D=d;this.B=b;this.w=
|
|
4
|
-
_.
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var f=function(window){var Bt="VerimatrixVCAS",Ct="clpp.verimatrix.Vcas",Dt="clpp.verimatrix.VcasComponent",Jt=function(a){_.hl.call(this,Bt);var b={};b[Et]=Et;b[Ft]=Ft;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Gt: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?Ht:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
|
|
3
|
+
this.D=d;this.B=b;this.w=It(this,e);this.o=It(this,f);this.l=It(this,g);this.j=h;this.H=l;this.F=m;this.h=new _.K(Ct);_.hi(this.w)?this.h.warn(_.Kb):this.Pa(_.ad,{licenseUrl:this.w,videoRobustness:[_.sb,void 0],audioRobustness:[_.rb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.g.bind(this)}});_.hi(this.o)?this.h.warn(_.gb):this.Pa(_.Zc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.g.bind(this)}});
|
|
4
|
+
_.hi(this.l)?this.h.warn(_.La):_.hi(this.j)?this.h.warn(_.Ka):this.Pa(_.Yc,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.M.bind(this),extractContentId:this.I.bind(this)}})},It=function(a,b){if(a.D===Gt){var c=Object.assign({},{deviceId:_.ni(_.di(a.A))},a.a&&{authenticator:_.ni(_.di(a.a))});return b+_.ej(c)}return b},Kt=function(){this.h=new _.K(Dt)};_.w(Jt,_.hl);
|
|
5
|
+
Jt.prototype.g=function(a,b){if(this.D===Lt){var c=this.B[Ft],d={};d[this.B[Et]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Jt.prototype.I=function(a,b){var c=_.Dl(b);switch(this.F){case Mt:c=_.ej({r:c,um:this.H},!0)}return c};Jt.prototype.K=function(a,b){this.g(a,b);_.Gl(b)};Jt.prototype.M=function(a,b){_.Hl(b)};_.I(Ct,Jt);Jt.prototype.constructor=Jt.prototype.constructor;Jt.NAME=Bt;var Gt="query-string",Lt="http-header";
|
|
6
|
+
Jt.LicenseRequestVuidLocation={QUERY_STRING:Gt,HTTP_HEADER:Lt};var Et="DeviceId",Ft="Authenticator";Jt.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Et,AUTHENTICATOR_HEADER:Ft};var Ht="keyid",Mt="contentid-siteid";Jt.FairPlayAssetIdStrategy={KEYID:Ht,CONTENTID_SITEID:Mt};_.w(Kt,_.Mp);Kt.prototype.a=function(){delete _.al.VerimatrixVCAS};Kt.prototype.g=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===Bt){a=a.drm.customData;if(!a)throw new _.N(_.O,7,7100,_.bd);a=new Jt(a);this.h.info("Registering the Verimatrix VCAS Ultra environment");_.bl(a)}};Kt.prototype.id=function(){return"verimatrix-vcas"};_.I(Dt,Kt);};
|
|
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.
|
|
4
|
-
|
|
5
|
-
_.
|
|
6
|
-
_.
|
|
7
|
-
b.B=e;return _.x(h,b.
|
|
8
|
-
_.
|
|
9
|
-
l.a.
|
|
10
|
-
typeof n.liveResumePossible!==_.
|
|
11
|
-
|
|
12
|
-
_.
|
|
13
|
-
c=b.failIfUnreachable;typeof c!==_.
|
|
14
|
-
_.
|
|
2
|
+
var f=function(window){var rt="Registering listeners",st="clpp.vimond.VimondPlugin",tt=function(a,b,c,d,e){this.F=a;this.H=b;this.I=c;this.m=d;this.D=e;this.a=new _.Eg;this.l=!0;this.f=this.j=this.A=!1;this.B=null;this.g=new _.zj(this.hg.bind(this));this.h=new _.K("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.h.debug(rt),this.a.on(this.m,_.Re,this.Wi.bind(this)),this.a.on(this.m,_.cf,this.Xi.bind(this)),this.a.on(this.m,_.Mb,this.Ui.bind(this)),this.a.on(this.m,_.Nb,this.Vi.bind(this)))},ut=function(a,
|
|
3
|
+
b){a.m.trigger(new _.L(_.zf,{detail:b}))},vt=function(a,b,c){b&&(a.A=!0,a.g.stop());a.m.onError(new _.N(b?_.O:1,9,9201,c))},wt=function(a,b,c,d,e){this.l=a;this.o=c;this.g=b;this.a=d;this.j=e;this.h=new _.K("clpp.vimond.VimondService");this.f=0},xt=function(a){this.m=a;this.a=new _.Eg;this.h=new _.K("clpp.vimond.VimondAdapter");this.f=this.g=!1;this.m&&this.a&&(this.h.debug(rt),this.a.on(this.m,_.Ge,this.Nk.bind(this)),this.a.on(this.m,_.Mb,this.Si.bind(this)),this.a.on(this.m,_.Nb,this.Ti.bind(this)))},
|
|
4
|
+
yt=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.ve];if(a.g)return[_.wd,_.ke];if(c===_.Qn)return[_.wd,null];if(c===_.Un)return[_.yd,_.ke];var d=_.ke;if(c===_.On||c===_.Xn||a.f)d=_.ve;return["period",d]},zt=function(){this.a=!1;this.h=new _.K(st);this.j=this.g=this.f=null},At=function(){};_.r=tt.prototype;_.r.Xi=function(){this.f||(this.f=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.Ui=function(){this.h.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.r.Vi=function(){this.h.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.r.Wi=function(a){var b=this,c,d,e,f,g;return _.G(function(h){if(1==h.a){c=a.detail;d=_.Sn;e=c.currentState;f=c.previousState;b.h.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.h.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.h.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.h.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.G(0);
|
|
7
|
+
b.B=e;return _.x(h,b.hg(),3)}e===d.ENDED&&b.g.stop();_.y(h)})};
|
|
8
|
+
_.r.hg=function(){var a=this,b,c,d,e,f,g;return _.G(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.h.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.g.stop();a.g.$(a.l?10:a.F);a.l=!1;_.B(h,2);l=a.D;l.f++;var m=_.M.va(l.o);m.client.buildName=_.sa;m.client.buildVersion=_.fa;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 _.cj(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=yt(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!==_.zc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.Ai(l.l);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.di(JSON.stringify(m));l=l.j.fetch(n).O;return _.x(h,l,4)}if(2!=h.a)return b=h.f,ut(a,b),_.ag(h,0);d=c=_.D(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.h.debug("Unreachable service"),ut(a,f),vt(a,a.H,f)):1001===e?(a.h.debug("Generic service error"),
|
|
11
|
+
ut(a,f),vt(a,a.I,f)):a.h.error(c.toString());_.y(h)})};_.r.dispose=function(){this.h.debug(_.Eb);_.Hg(this.a);this.g.stop()};wt.prototype.Bf=function(a){this.g=a};_.r=xt.prototype;_.r.getPosition=function(){return Math.floor(this.m.getPosition())};_.r.Nk=function(){this.g=!0};_.r.Si=function(){this.f=!0};_.r.Ti=function(){this.f=!1};_.r.dispose=function(){this.h.debug(_.Eb);_.Hg(this.a)};_.w(zt,_.rr);_.r=zt.prototype;_.r.onPlayerCreated=function(){};
|
|
12
|
+
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.M.R(b.vimond)&&typeof b.vimond===_.ae)?a.namespace()===_.Pc&&(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 _.N(1,9,9200));return}this.h.debug("Configuration is valid");
|
|
13
|
+
c=b.failIfUnreachable;typeof c!==_.zc&&(c=!0);d=b.failOnError;typeof d!==_.zc&&(d=!0);this.f=new xt(a);this.g=new wt(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new tt(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.r.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
|
|
14
|
+
_.r.Bf=function(a){this.a&&this.g&&this.g.Bf(a)};_.I(st,zt);zt.prototype.updateAuthToken=zt.prototype.Bf;zt.Id="vimond";At.prototype.create=function(){return new zt};_.qp(new At);};
|
|
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.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.ha=this.H=this.f=this.a=this.
|
|
11
|
-
this.D=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 Hs="touchmove",Is="touchstart",Js=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Ks=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)},Ls=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Js(a/d*e,b/d*e,0/d*e,Math.cos(c))},Ms=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Ns=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},Os=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Ps=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},Qs=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Rs=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},Ss=function(a){var b=new Ms(0,0,0),c=new Ms(0,0,1),d=new Ms,e=new Ms,f=new Ms;a=a.a;var g=new Ms(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Ns(f,1/g);c=Ps(d,c,f);g=c.length();Ns(c,1/g);Ps(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Os(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Os(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Os(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Us=function(a){this.a=a;this.f=a.createProgram();this.l=
|
|
5
|
+
Ts(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=Ts(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.g=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},Ts=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},dt=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)},lt=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)},mt=function(){var a=this;this.o=this.w=this.M=this.J=this.A=
|
|
10
|
+
this.ha=this.H=this.f=this.a=this.m=null;this.h=new _.K("clpp.vr");this.I=70;this.ea=1;this.T=this.P=!1;this.F=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.M.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.g={x:0,y:0};this.V=new Qs;this.ca=new Qs;this.ma=new Qs;this.na=new Qs;this.B=this.Kk.bind(this);
|
|
11
|
+
this.D=this.Lk.bind(this);this.K=this.Jk.bind(this)},nt=function(a){var b=Ls(1,0,a.l*Math.PI/180);Ks(Ls(0,1,a.j*Math.PI/180),a.V);Ks(b,a.ca);Ss(a.ma);Rs(a.na,a.V,a.ma);Rs(a.H,a.ca,a.na)},ot=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Hs,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},pt=function(){};Ms.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Qs.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,v,z){var A=this.a;A[0]=a;A[4]=b;A[8]=c;A[12]=d;A[1]=e;A[5]=f;A[9]=g;A[13]=h;A[2]=l;A[6]=m;A[10]=n;A[14]=p;A[3]=q;A[7]=t;A[11]=v;A[15]=z;return this};var qt={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(mt,_.rr);_.r=mt.prototype;_.r.onPlayerCreated=function(a){this.h.info("Player created");this.m=a};
|
|
12
|
+
_.r.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.la(d))this.I=d;else throw new _.N(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.M.la(e)&&0<e)this.ea=e;else throw new _.N(1,7,7100,"sensitivity configuration must be a positive number");this.P=!!f;this.T=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.uf){this.h.info("Initialize VR Surface");
|
|
13
|
+
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",qt)||this.a.getContext("experimental-webgl",qt);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new Qs;Ss(this.H);this.ha=new dt(this.f);this.A=new Us(this.f);this.J=new Qs;this.M=new Qs;this.o=this.w=null;this.a.addEventListener(_.Je,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
|
|
14
|
+
!1),this.a.addEventListener(Is,this.K,!1));this.F();this.hh()}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")}};
|
|
15
|
+
_.r.onPlayerWillRelease=function(){this.h.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.g.x=0;this.l=this.j=this.g.y=0;this.f&&(delete this.f,this.f=null);this.a&&(ot(this),this.a.removeEventListener(_.Je,this.F),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.G(function(b){a.m=null;_.y(b)})};_.r.id=function(){return"vr"};
|
|
16
|
+
_.r.hh=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.uf){this.w=requestAnimationFrame(this.hh.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new lt(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=Rs(this.J,this.M,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.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.ha;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.g);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
|
|
19
|
-
_.
|
|
20
|
-
_.
|
|
21
|
-
_.
|
|
19
|
+
_.r.Jk=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Is)a.type===Is?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(Hs,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
|
|
20
|
+
_.r.Kk=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Hs&&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;b=this.ea;c=d*b*(this.T?-1:1);this.j+=a*b*(this.P?-1:1);this.l+=c;nt(this)};_.r.Lk=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();ot(this)};_.r.dk=function(a,b){this.l=b;this.j=a;nt(this)};_.r.tj=function(){return{x:this.j,y:this.l}};
|
|
21
|
+
_.r.wl=function(a){this.I=a;this.F()};_.I("clpp.vr.VrPlugin",mt);mt.prototype.setCameraFieldOfView=mt.prototype.wl;mt.prototype.getCameraCoordinates=mt.prototype.tj;mt.prototype.moveCamera=mt.prototype.dk;mt.Id="vr";pt.prototype.create=function(){return new mt};_.qp(new pt);};
|
|
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
|
-
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 h=g.value;if(/^region/.test(h.toLowerCase())){h=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=_.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 _.
|
|
12
|
-
n,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var f=function(window){var ns=" The setting will be ignored.",os="VTT parser encountered an invalid VTT setting: ",ps="application/x-subrip",qs="text/srt",rs='text/vtt; codecs\x3d"vtt"',ss='text/vtt; codecs\x3d"wvtt"',ts=function(a){_.ui(a,/[ \t]+/gm)},us=function(a){return a.a==a.f.length?null:(a=_.ui(a,/[^ \t\n]*/gm))?a[0]:null},vs=function(){},ws=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},xs=function(){},ys=function(a){this.a=a},As=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.Zg:a.textAlign=
|
|
4
|
+
_.xr[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.sf:_.tf;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==_.Kd||b==_.Qe?_.Kd:b==_.Ld||b==_.wd?_.Ld:_.Ic);else if(d=/^region:(.*)$/.exec(b)){if(b=zs(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=_.yr[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ah,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.yr[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},zs=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.J("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Bs=function(a){a=_.ui(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)},Cs=function(){ys.apply(this,arguments)},Ds=function(){this.a=null;this.h=new _.K("clpp.vtt.mp4")},Fs=function(a,b,c){var d,e,f;(new _.ul).L("payl",_.xl(function(g){d=_.Yh(g)})).L("iden",_.xl(function(g){e=_.Yh(g)})).L("sttg",_.xl(function(g){f=_.Yh(g)})).parse(a);return d?Es(d,e,f,b,c):null},Es=function(a,b,c,d,e){a=new _.dh(d,e,a,_.Bf);b&&(a.id=b);if(c)for(b=new _.ti(c),c=us(b);c;)As(a,c,[])||
|
|
7
|
+
_.J(os,c,ns),ts(b),c=us(b);return a},Gs=function(){this.j=new xs};vs.prototype.a=function(a){a=_.Yh(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+=ws(c.value)}return _.bi(a)};xs.prototype.create=function(){return new vs};xs.prototype.probe=function(a,b){return(a===qs||a===ps)&&b===_.af};ys.prototype.parseInit=function(){};
|
|
8
|
+
ys.prototype.parseMedia=function(a,b){var c=_.Yh(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=Bs(new _.ti(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=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.ti(h.replace(/\n/g," "));g=new _.gh;us(h);ts(h);for(var l=us(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||_.J("VTT parser encountered an invalid VTTRegion setting: ",l,ns);ts(h);l=us(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 _.ti(p[0]);m=Bs(l);var t=_.ui(l,/[ \t]+--\x3e[ \t]+/g);n=Bs(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 _.dh(m,n,p,_.Bf);g&&(m.id=g);ts(l);for(n=us(l);n;)As(m,n,f)||_.J(os,
|
|
12
|
+
n,ns),ts(l),n=us(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(Cs,ys);Cs.prototype.parseMedia=function(a,b){return ys.prototype.parseMedia.call(this,(new vs).a(a),b)};Ds.prototype.parseInit=function(a){var b=this,c=!1;(new _.ul).L(_.Wd,_.vl).L(_.df,_.vl).L(_.Rd,_.vl).X("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)}).L(_.Vd,_.vl).L(_.Te,_.vl).X(_.Ve,_.wl).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.O,2,2008);if(!c)throw new _.N(_.O,2,2008);};
|
|
13
|
+
Ds.prototype.parseMedia=function(a,b){if(!this.a)throw this.h.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 _.ul).L("moof",_.vl).L("traf",_.vl).X("tfdt",function(H){g=!0;c=0==H.version?_.W(H.reader):_.rl(H.reader)}).X("tfhd",function(H){var Q=H.flags;H=H.reader;H.skip(4);Q&1&&H.skip(8);Q&2&&H.skip(4);m=Q&8?_.W(H):null}).X("trun",function(H){h=!0;var Q=H.version,P=H.flags;H=H.reader;var Ba=_.W(H);P&1&&H.skip(4);P&4&&H.skip(4);for(var ta=[],
|
|
14
|
+
ya=0;ya<Ba;ya++){var Ja={duration:null,sampleSize:null,yf:null};P&256&&(Ja.duration=_.W(H));P&512&&(Ja.sampleSize=_.W(H));P&1024&&H.skip(4);P&2048&&(Ja.yf=0==Q?_.W(H):_.ql(H));ta.push(Ja)}d=ta}).L(_.Qd,_.xl(function(H){l=!0;e=H})).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 _.ll(p,!1);for(var q=_.u(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.yf?c+t.yf:n;n=z+(v||0);var A=0;do{var C=_.W(p);A+=C;var F=_.W(p);
|
|
15
|
+
F=_.zl(F);var E=null;"vttc"==F?8<C&&(E=_.tl(p,C-8)):("vtte"!=F&&this.h.error("Unknown box "+F+"! Skipping!"),p.skip(C-8));v?E&&f.push(Fs(E,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.h.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&A<t.sampleSize)}return{cues:f.filter(_.mh),styles:[]}};_.w(Gs,_.Mp);Gs.prototype.f=function(){_.fr[_.af]=ys;_.fr[rs]=ys;_.fr[ss]=ys;_.fr[_.nc]=Ds;_.fr[qs]=Cs;_.fr[ps]=Cs;_.tj.push(this.j)};Gs.prototype.a=function(){_.gr(_.af);_.gr(rs);_.gr(ss);_.gr(_.nc);_.gr(qs);_.gr(ps);_.vj(this.j)};Gs.prototype.id=function(){return"subtitles-vtt"};_.I("clpp.vtt.VttComponent",Gs);};
|
|
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(
|
|
4
|
-
if(c&&(c=c.
|
|
5
|
-
b.prototype.getFramesPerSecond=function(){var c=this.
|
|
6
|
-
_.
|
|
7
|
-
if(c)switch(c.currentState){case _.
|
|
8
|
-
(this.g=!1,this.fireInit())};b.prototype.A=function(){var c=this.
|
|
9
|
-
b.prototype.J=function(){this.j(_.
|
|
10
|
-
youbora.Adapter.call(this,c)||this;d.
|
|
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.
|
|
13
|
-
function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.
|
|
14
|
-
function(){return _.
|
|
15
|
-
_.
|
|
16
|
-
this.fireJoin()};b.prototype.I=function(){this.g("ad ended");this.fireStop()};b.prototype.K=function(){this.g("ad pause");this.w();this.firePause()};b.prototype.M=function(){this.g("ad resume");this.w();this.fireResume()};b.prototype.F=function(){this.
|
|
17
|
-
var c=this.a&&this.a.
|
|
18
|
-
b.prototype.g=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[
|
|
19
|
-
b.onError(new _.
|
|
20
|
-
_.
|
|
21
|
-
|
|
2
|
+
var f=function(window){var cs='" event to Youbora',ds='Reporting "',es="clpp.npaw.YouboraPlugin",fs="content.isLive",gs=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},hs=function(a,b,c,d){b=gs(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.yd;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(ds+a+'" to Youbora',b.code,b));return b},is=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Eg;d.h=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.g=!1;d.registerListeners();d.B=!1;return d}_.w(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
|
+
if(c&&(c=c.ga())){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.Oa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.sa};b.prototype.getVersion=function(){return"6.11.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.fa};b.prototype.registerListeners=function(){this.m&&this.a&&(this.h.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Re,this.K.bind(this)),this.a.on(this.m,_.yd,this.H.bind(this)),this.a.on(this.m,
|
|
6
|
+
_.mf,this.J.bind(this)),this.a.on(this.m,_.lf,this.I.bind(this)),this.a.on(this.m,_.dc,this.D.bind(this)),this.a.on(this.m,_.Ec,this.F.bind(this)))};b.prototype.unregisterListeners=function(){this.h.debug(_.Eb);_.Hg(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.l=function(){return this.m.getStats()||_.Fn()};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 _.Vn:this.o()&&this.f();break;case _.Xn:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Wn:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Jn:this.fireBufferEnd();this.fireStop();break;case _.Qn:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.On:this.fireBufferBegin();break;default:this.h.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
|
|
8
|
+
(this.g=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.ad)?"Widevine":c.startsWith(_.Yc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.ie)?"ClearKey":c.startsWith(_.Xc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.g||10003===c.code&&this.plugin.getAdsAdapter()||(c=hs(c,this.m,this.h,this))&&c.severity===_.O&&(this.g=!0)};
|
|
9
|
+
b.prototype.J=function(){this.j(_.Me);this.m.isEnded()||(this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.Le);this.fireSeekEnd()};b.prototype.D=function(c){this.h.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.kb()};b.prototype.F=function(c){this.h.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.h.debug.apply(this.h,[ds+c+cs].concat(_.Of(e)))};return new b(a)},js=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 _.Eg;d.h=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(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.xb(),this.a.wb(),this.a.jb()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.jb()};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.Za()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.h.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.zb()};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.h.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.sa};b.prototype.getVersion=function(){return"6.11.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
|
|
14
|
+
function(){return _.fa};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.dc,this.V.bind(this)),this.f.on(this.m,_.$b,this.T.bind(this)),this.f.on(this.m,_.Vb,this.K.bind(this)),this.f.on(this.m,_.Yb,this.M.bind(this)),this.f.on(this.m,_.Qb,this.I.bind(this)),this.f.on(this.m,_.Rb,this.o.bind(this,1)),this.f.on(this.m,_.Ub,this.o.bind(this,2)),this.f.on(this.m,_.bc,this.o.bind(this,3)),this.f.on(this.m,_.Pb,this.H.bind(this)),this.f.on(this.m,_.Zb,this.P.bind(this)),this.f.on(this.m,
|
|
15
|
+
_.yd,this.J.bind(this)),this.f.on(this.m,_.Mb,this.B.bind(this)),this.f.on(this.m,_.Nb,this.D.bind(this)),this.f.on(this.m,_.Ob,this.F.bind(this)),this.f.on(this.m,_.Xb,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Hg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.h.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.T=function(c){this.a=c.ad;this.g("ad start",this.a);this.fireStart();
|
|
16
|
+
this.fireJoin()};b.prototype.I=function(){this.g("ad ended");this.fireStop()};b.prototype.K=function(){this.g("ad pause");this.w();this.firePause()};b.prototype.M=function(){this.g("ad resume");this.w();this.fireResume()};b.prototype.F=function(){this.l=!0;this.g("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.g("ad buffering ended"),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.g("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.g("ad clicked");
|
|
17
|
+
var c=this.a&&this.a.Lb();this.h.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.P=function(){this.g("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.g("ad break start",this.a);this.fireBreakStart()};b.prototype.D=function(){this.g("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&&hs(c,this.m,this.h,this)};
|
|
18
|
+
b.prototype.g=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[ds+c+cs].concat(_.Of(e)))};return new b(a)},ks=function(){this.a=null;this.h=new _.K(es);this.m=null},ls=function(a,b){if(b.namespace()===_.Pc)return a.h.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.M.Dg(c))return a.h.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.h.warn("accountCode key is missing in Youbora config"),
|
|
19
|
+
b.onError(new _.N(1,9,9101)),!1;if(_.M.R(window.youbora))return a.h.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.49"!==youbora.VERSION&&(a.h.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.N(1,9,9102)));return!0},ms=function(){};_.w(ks,_.rr);_.r=ks.prototype;_.r.uf=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(is(this.m)),this.a.setAdsAdapter(js(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;ls(this,a)&&(a=a.getConfiguration().youbora,this.uf(new youbora.Plugin(a)))};
|
|
20
|
+
_.r.onContentWillLoad=function(a,b){if(ls(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[fs]&&(d[fs]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.uf(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.I(es,ks);ks.prototype.getAdsAdapter=ks.prototype.getAdsAdapter;ks.prototype.getAdapter=ks.prototype.getAdapter;
|
|
21
|
+
ks.prototype.setYouboraPlugin=ks.prototype.uf;ks.Id="youbora";ms.prototype.create=function(){return new ks};_.qp(new ms);};
|
|
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
|
-
_.z("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var zO=function(a){a.f=new _.vp;a.f.on(a.m,_.af,()=>xO(a));a.f.on(a.m,_.$e,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Bd,()=>yO(a));a.f.on(a.m,_.Ge,b=>{b=b.detail;switch(b.currentState){case _.Dm:a.a.length||yO(a);s.Media.play(a.a,a.m.getPosition());break;case _.Cm:case _.vm:xO(a);break;case _.sm:case _.Am:case _.zm:a.h.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),xO(a),s.Media.close(a.a),a.a=""}})},xO=function(a){s.Media.stop(a.a,a.m.getPosition())},
|
|
2
|
+
yO=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.h.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.na)},AO=class extends _.rr{constructor(){super();this.m=this.f=null;this.a="";this.h=new _.R("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.m=a,zO(this)):this.h.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};
|
|
3
|
+
_.z("clpp.adobe.AdobeAnalyticsPlugin",AO);AO.Id="adobe";_.En(new class{create(){return new AO}});};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.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var wO=class extends _.rr{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.$p(()=>{this.m.play().catch(()=>{})});this.g=new _.vp}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.g.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 _.F(_.Yb,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Xb:_.Wb;if(this.l||!this.m.isPaused()||this.m.getState()===_.Dm)this.l?this.m.play().catch(()=>{}):this.o.ca(.01);this.m.trigger(new _.F(a))}ib(){return this.j}xd(){return this.f}Ig(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",wO);wO.prototype.showCastMenu=wO.prototype.Ig;
|
|
3
|
+
wO.prototype.canCast=wO.prototype.xd;wO.prototype.isCasting=wO.prototype.ib;wO.Id="airplay";_.En(new class{create(){return new wO}});};f.call(g, window);
|