@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.htmlcue.js
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
return a},
|
|
4
|
-
null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new
|
|
5
|
-
b){return
|
|
6
|
-
b=c.height/d.length;c=c.width/d.length;return
|
|
7
|
-
case "auto":case _.
|
|
8
|
-
case _.
|
|
9
|
-
a.a=
|
|
10
|
-
|
|
11
|
-
a.
|
|
12
|
-
|
|
13
|
-
a;this.L=
|
|
14
|
-
this.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
c
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
vI.prototype.isTextVisible=vI.prototype.isTextVisible;vI.prototype.remove=vI.prototype.remove;vI.prototype.destroy=vI.prototype.destroy;vI.prototype.append=vI.prototype.append;BI.prototype.W=function(a){return!!a.enableHtmlCue&&!_.yi()};BI.prototype.create=function(a){return new vI(a)};BI.prototype.create=BI.prototype.create;BI.prototype.isSupported=BI.prototype.W;_.v(CI,_.Kn);CI.prototype.Da=function(){_.Jl("html",new BI)};CI.prototype.va=function(){};CI.prototype.id=function(){return _.qe};_.B("clpp.htmlcue.HtmlCueComponent",CI);};
|
|
2
|
+
var f=function(window){var II="CLPP Subtitle Styles",JI="Unsupported unit",KI="clpp-text-plain",LI="clpp-text-ttml",MI="clpp.htmlcue.HtmlTextDisplayer",NI="initial",OI=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},PI=function(){},QI=function(a){if(!a.input)return null;var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},SI=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
|
|
3
|
+
function(c){return RI[c]});return a},UI=function(a,b){TI(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){TI(a,c)})},TI=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},VI=function(a,b){return 0===a?"0":a+b},WI=function(a,b){return 1>Math.abs(a-b)||a<b},XI=function(a,b){return a<b&&1<Math.abs(a-b)},YI=function(a,b){return a>b&&1<Math.abs(a-b)},ZI=function(a,b){return 1>Math.abs(a-b)||a>b},$I=function(a,b,c,d,e,f){this.f=a;this.g=b;this.h=c;this.a=d;this.height=e;this.width=
|
|
4
|
+
f},aJ=function(a){return new $I(a.f,a.g,a.h,a.a,a.height,a.width)},bJ=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new $I(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
|
|
5
|
+
d-e)},cJ=function(a,b){return b.some(function(c){return XI(a.f,c.g)&&YI(a.g,c.f)&&XI(a.h,c.a)&&YI(a.a,c.h)})},dJ=function(a,b){return ZI(a.h,b.h)&&WI(a.a,b.a)&&ZI(a.f,b.f)&&WI(a.g,b.g)},eJ=function(a,b,c){switch(c){case "+x":return XI(a.f,b.f);case "-x":return YI(a.g,b.g);case "+y":return XI(a.h,b.h);case "-y":return YI(a.a,b.a);default:throw Error("Unknown axis");}},fJ=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},gJ=function(a,b,c){fJ.call(this,a.id,"clpp-text-cue",{});
|
|
6
|
+
this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c},iJ=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return hJ(a)?b:c},lJ=function(a,b,c){return hJ(a)&&_.J.pa(c)?VI(c,_.ae):(jJ(a)||kJ(a))&&_.J.pa(b)?VI(b,"%"):NI},jJ=function(a){return a.f.writingMode===_.Ne},kJ=function(a){return a.f.writingMode===_.Oe},hJ=function(a){return a.f.writingMode===_.tg},mJ=function(a,b,c){return(jJ(a)||kJ(a))&&_.J.pa(c)?VI(c,_.ae):
|
|
7
|
+
jJ(a)&&_.J.R(c)?VI(0,_.ae):hJ(a)&&_.J.pa(b)?VI(b,"%"):NI},nJ=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.rd:return a.f.position;case "auto":case _.Ac:return a.f.position-a.f.size/2;case _.sd:return a.f.position-a.f.size}return 0},oJ=function(a){switch(a.f.positionAlign){case _.rd:return _.od;case "auto":case _.Ac:return _.sg;case _.sd:return _.he}return a.f.textAlign},pJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.od:case _.od:return _.rd;
|
|
8
|
+
case _.sg:return _.Ac;case _.he:case _.he:return _.sd}return a.f.positionAlign},qJ=function(a){switch(a.f.writingMode){case _.tg:return"horizontal-tb";case _.Ne:return _.Ne;case _.Oe:return _.Oe;default:throw Error("Unknown writing mode");}},rJ=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=bJ(a.a);this.g=[]},sJ=function(a,b){if(a.h)switch(b.writingMode){case _.tg:return["-y"];case _.Ne:return["+x"];case _.Oe:return["-x"]}var c=[];switch(b.writingMode){case _.tg:c=["+y","-y"];break;
|
|
9
|
+
case _.Ne:c=["+x","-x"];break;case _.Oe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},tJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=bJ(a.j.a)},uJ=function(a,b,c){fJ.call(this,a,b,c);this.g=null;this.j=[]},vJ=function(a,b){tJ(a.g);a.j.unshift(b);for(var c=_.u(a.j),d=c.next();!d.done;d=c.next())a.g.append(d.value)},wJ=function(a,b){uJ.call(this,a.id,"clpp-text-cue-region",b);this.f=a},xJ=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.yg)return a.viewportAnchorY/
|
|
10
|
+
100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(JI);},zJ=function(a){this.f=new _.H("clpp.htmlcue.StyleManager");this.m=[];this.h=a.getSurface().getUniqueCssClass();this.j=[];this.a=yJ(this,this.h);this.g=yJ(this,this.h,!0);this.g.disabled=!0;this.f.debug("Stylesheet CLPP Subtitle Styles has been created.")},AJ=function(a,b){var c=!1;try{a.g.insertRule(b,0);var d=a.g.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===
|
|
11
|
+
e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},BJ=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},yJ=function(a,b,c){var d=document.createElement(_.ve),e=d.dataset;e.name=II;
|
|
12
|
+
e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);CJ(a,b);a.f.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},CJ=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===II&&a.f.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});c.observe(b,{subtree:!1,childList:!0});a.m.push(function(){return c.disconnect()})},
|
|
13
|
+
FJ=function(a){_.Tp.call(this,a);var b=this;this.L=new _.H(MI);this.l=a;this.K=DJ(a);this.h=!1;this.f=[];this.B=a.getSurface().getContainer();this.g=new zJ(a);this.a=new uJ(null,"clpp-text-container",{});this.o=new _.pp(a.getSurface(),this.lh.bind(this));this.I=null;this.B?(this.B.appendChild(this.a.a),this.a.init(null)):this.L.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.C=new _.Li(function(){EJ(b)});
|
|
14
|
+
this.w=new Map;this.j=null},DJ=function(a){a=_.J.Ma(a.getConfiguration().htmlcue||{});_.J.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.J.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},GJ=function(a,b){return a.startTime<=b&&a.endTime>b},EJ=function(a,b){if((b||a.h)&&a.B){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.bn){a.I=c;var d=HJ(a,c);(c=b)||(c=a.j,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.j=d,IJ(a),d)){c={color:a.getFontColor()||
|
|
15
|
+
void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Yp(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.u(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.We:h="clpp-text-vtt";break;case _.Fe:h=LI;break;case _.rg:h=KI}h&&!g.classList.contains(h)&&_.yn(g,h);g=bJ(f.a.a);if(0===g.width||0===g.height)f.L.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
|
|
16
|
+
else{TI({fontSize:JJ(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.We;var l=e.payloadType===_.Fe;e.region&&(h||l||e.backgroundImage)&&(f.w.has(e.region.id)?g=f.w.get(e.region.id):(g=new wJ(e.region,{}),f.w.set(e.region.id,g),vJ(f.a,g)));e=new gJ(e,f.K,c);g?vJ(g,e):vJ(f.a,e)}}}}}},HJ=function(a,b){var c=OI(a.f,function(e){return GJ(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&GJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&GJ(a.f[c+1],b);)c++;return{start:d,
|
|
17
|
+
end:c}},KJ=function(a){IJ(a);a.I=null;a.j=null;a.f=[]},IJ=function(a){a.w.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(LI);b.classList.remove(KI);a=a.a;tJ(a.g);a.j=[]}},JJ=function(a,b){var c=bJ(a.a.a).height;if(null!==a.G)return a.getFontSize();if(null!==a.A){var d=a.getFontSizePercent();return Math.round(c*d)+_.ae}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.ae;d=a.getFontSizePercent();return Math.round(c*d)+_.ae},LJ=function(){},MJ=function(){};
|
|
18
|
+
PI.prototype.parse=function(a){a={input:a};for(var b=_.An(_.Vc),c=[],d=b,e;null!==(e=QI(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var h=NJ[f];h?(h=_.An(h),(f=OJ[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||PJ[g.localName]&&PJ[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
|
|
19
|
+
d=g)}}else d.appendChild(document.createTextNode(SI(e)));return b};var NJ={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},OJ={v:"voice",lang:"lang"},PJ={rt:"ruby"},RI={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};fJ.prototype.init=function(){this.h=!0};fJ.prototype.w=function(){return!1};_.v(gJ,fJ);gJ.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
|
|
20
|
+
gJ.prototype.init=function(a){fJ.prototype.init.call(this,a);if(this.g)_.yn(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.j.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.Fe){var c=_.An(_.Vc);c.innerHTML=b.payload;b=c}else b.payloadType===_.We?b=(new PI).parse(b.payload):(c=_.An(_.Vc),c.textContent=b.payload,b=c);_.yn(b,this.o);this.id&&(b.id=this.id);c=_.u(this.f.cssClassList);for(var d=
|
|
21
|
+
c.next();!d.done;d=c.next())_.yn(b,d.value);TI({writingMode:qJ(this)},b);this.a.appendChild(b);_.yn(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.yn(this.a,"clpp-text-wrapper__"+d.value);_.J.R(this.f.line)&&(this.f.lineInterpretation=_.ug,this.f.line=hJ(this)?-1:0);c=qJ(this);TI({writingMode:c,webkitWritingMode:c,direction:NI,textAlign:oJ(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=nJ(this,pJ(this));d=mJ(this,c,null);var e=lJ(this,
|
|
22
|
+
c,null),f=kJ(this)&&_.J.R(null)?VI(0,_.ae):NI;TI({position:"absolute",left:d,right:f,top:e,width:hJ(this)?VI(this.f.size,"%"):NI,height:jJ(this)||kJ(this)?VI(this.f.size,"%"):NI},this.a);d=this.f;a=hJ(this)?a.height:a.width;e=iJ(this);if(d.lineInterpretation===_.ug)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.Ac:g-=f/2;break;case _.dd:g-=f}f=Math.round(g/100*a)}kJ(this)&&(f=a-f-e);a=f;d=mJ(this,c,a);e=kJ(this)&&_.J.R(a)?
|
|
23
|
+
VI(0,_.ae):NI;TI({left:d,right:e,top:lJ(this,c,a)},this.a)}UI(this.B,b)}};gJ.prototype.m=function(){return _.An(_.Vc)};rJ.prototype.append=function(a){var b=a.a;b.style.visibility=_.jd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=bJ(a.a);var d=sJ(this,a.f),e=iJ(a),f=aJ(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;eJ(c,this.a,l)||dJ(c,this.a)&&cJ(c,this.g);){var m=c,n=e;switch(l){case "+x":m.f+=n;m.g+=n;break;case "-x":m.f-=n;m.g-=n;break;case "+y":m.h+=n;m.a+=n;break;case "-y":m.h-=n,m.a-=n}}if(this.h||dJ(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.g,l.g)-Math.max(c.f,
|
|
24
|
+
l.f))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.h,l.h))/(c.height*c.width);l>h&&(g=aJ(c),h=l);c=aJ(f)}c=g||f}TI({top:VI(c.h-this.a.h,_.ae),bottom:VI(this.a.a-c.a,_.ae),left:VI(c.f-this.a.f,_.ae),right:VI(this.a.g-c.g,_.ae),height:VI(c.height,_.ae),width:VI(c.width,_.ae)},a.a)}b.style.visibility="visible";this.g.push(bJ(a.a))};_.v(uJ,fJ);uJ.prototype.init=function(){this.g=new rJ(this);this.h=!0};uJ.prototype.m=function(){var a=_.An(_.Vc);_.yn(a,this.o);this.id&&(a.id=this.id);return a};_.v(wJ,uJ);
|
|
25
|
+
wJ.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.yg:b=b.width/100*a.width;break a;default:throw Error(JI);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.yg)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(JI);d=a.height;var e=xJ(this,d,a.height);TI(this.A,this.a);TI({left:VI(c,_.ae),top:VI(e,_.ae),width:VI(b,_.ae),height:VI(d,_.ae)},this.a);this.f.writingMode&&TI({display:"flex",
|
|
26
|
+
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&TI({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.yn(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.yg:b=b.height/100*a.height;break a;case 2:b=b.height;d=new gJ(new _.xg(0,1,"Lorem ipsum",_.rg),{},{});c=d.a;this.a.appendChild(c);d.init(bJ(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(JI);
|
|
27
|
+
}a=xJ(this,b,a.height);TI({top:VI(a,_.ae),height:VI(b,_.ae)},this.a);this.g=new rJ(this,!0);this.h=!0};wJ.prototype.getId=function(){return this.f.id};zJ.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=BJ(this,a);if(AJ(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.f.debug("Added CSS rule "+b)}catch(c){this.f.error("An error occurred when adding a CSS rule: "+b)}this.j.push(a)}else this.f.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
|
|
28
|
+
zJ.prototype.destroy=function(){var a=this;return _.A(function(b){if(null==a.a)return b["return"]();a.m.forEach(function(c){return c()});a.m=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.j=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.g.ownerNode);a.a=null;a.g=null;a.f.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.z(b)})};_.v(FJ,_.Tp);_.t=FJ.prototype;
|
|
29
|
+
_.t.append=function(a,b){if(null!=this.g&&0!==a.length){for(var c=_.u(b),d=c.next();!d.done;d=c.next())this.g.appendRule(d.value);a.sort(function(f,g){return f.startTime!==g.startTime?f.startTime-g.startTime:f.endTime-g.endTime});c=this.f.findIndex(function(f){return f.startTime>=a[0].startTime});0===c?this.f=[]:0<c&&this.f.splice(0,c);c={};d=_.u(a);for(var e=d.next();!e.done;c={md:c.md},e=d.next())c.md=e.value,this.f.some(function(f){return function(g){var h=f.md;return g.payload!==h.payload?!1:
|
|
30
|
+
g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.md);this.j=null;EJ(this,!1)}};_.t.ob=function(){null==this.g||EJ(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();KJ(a);a.C.stop();return _.y(b,a.g.destroy(),2)}a.g=null;a.B.removeChild(a.a.a);a.a=null;a.o.stop();a.o=null;a.h=!1;_.z(b)})};
|
|
31
|
+
_.t.remove=function(a,b){if(null==this.g)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.j=null;EJ(this,!0);return!0};_.t.isTextVisible=function(){return this.h};_.t.setTextVisibility=function(a){null!=this.g&&this.h!==a&&((this.h=a)?(this.C.ab(.25),this.K.enableResizeObserver&&this.o.start(),EJ(this,!0)):(this.C.stop(),this.o.stop(),KJ(this)))};_.t.lh=function(){EJ(this,!0)};_.B(MI,FJ);FJ.prototype.setTextVisibility=FJ.prototype.setTextVisibility;
|
|
32
|
+
FJ.prototype.isTextVisible=FJ.prototype.isTextVisible;FJ.prototype.remove=FJ.prototype.remove;FJ.prototype.destroy=FJ.prototype.destroy;FJ.prototype.append=FJ.prototype.append;LJ.prototype.aa=function(a){return!!a.enableHtmlCue&&!_.Vi()};LJ.prototype.create=function(a){return new FJ(a)};_.v(MJ,_.zo);MJ.prototype.Ja=function(){_.wm("html",new LJ)};MJ.prototype.Ca=function(){};MJ.prototype.id=function(){return _.xe};_.B("clpp.htmlcue.HtmlCueComponent",MJ);};
|
|
34
33
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
35
34
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
36
35
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.ima.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.
|
|
4
|
-
a.
|
|
5
|
-
a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.
|
|
6
|
-
function(a){_.
|
|
7
|
-
c.a)return a.J.initialize(),_.
|
|
8
|
-
_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.
|
|
9
|
-
_.t.
|
|
10
|
-
_.t.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_.t.
|
|
15
|
-
_.t.
|
|
16
|
-
_.t.
|
|
17
|
-
_.t.
|
|
18
|
-
_.t.load=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){b=a.l;c=a.K;try{if(typeof c.adTagUrl!==_.
|
|
19
|
-
_.t.start=function(a){var b=this;return _.A(function(c){return b.a&&b.g&&!b.D?b.g.
|
|
2
|
+
var f=function(window){var qI="clpp.ima.AdsManagerFactory",rI=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},sI=function(){},tI=function(a){this.a=a},uI=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.J.Ma(a.ima||{});this.m=this.l.$b("ima").Dc();this.J=this.l.$b("ima").g;this.o=this.l.$b("ima").a;this.G=new _.rp;this.O=new _.H("clpp.ima");this.h=this.a=null;this.f=new _.Mh;this.D=!1;this.w=new _.cg;this.S=new sI;this.A=null;this.I=this.C=this.L=this.B=!1;this.g=
|
|
3
|
+
null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Oi.bind(this));a.on(this.o,b,this.Ni.bind(this));a.one(this.j,_.ed,this.Vi.bind(this))},vI=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.ph.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Wi.bind(a));c.on(b,d.STARTED,a.rh.bind(a));c.on(b,d.LOG,a.Hi.bind(a));c.on(b,d.AD_PROGRESS,a.Li.bind(a));c.on(b,d.AD_BUFFERING,a.Ei.bind(a));c.on(b,d.FIRST_QUARTILE,
|
|
4
|
+
a.nh.bind(a));c.on(b,d.MIDPOINT,a.Ii.bind(a));c.on(b,d.THIRD_QUARTILE,a.sh.bind(a));c.on(b,d.PAUSED,a.Ki.bind(a));c.on(b,d.RESUMED,a.Mi.bind(a));c.on(b,d.CLICK,a.mh.bind(a));c.on(b,d.SKIPPED,a.qh.bind(a));c.on(b,d.IMPRESSION,a.oh.bind(a));c.on(b,d.COMPLETE,a.Fi.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Xi.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Qi.bind(a))},wI=function(a){a=a.K;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=
|
|
5
|
+
a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.rc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},yI=function(a){a.A=null;xI(a,_.Tb);a.m&&a.l.getSurface().hide(a.m)},zI=
|
|
6
|
+
function(a){_.zn(a.j,{visibility:"visible"})},xI=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new rI(c,a.B,a.L)});a.l.trigger(new _.I(b,d))},AI=function(a,b){var c=b?a.S.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},CI=function(a){var b,c;return _.A(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.y(d,a.G.canPlay(b),2);c=d.f;if(!c)return xI(a,_.pc),a.O.warn(_.ma),d["return"]();BI(a);_.z(d)})},DI=function(a,b){return _.A(function(c){if(1==
|
|
7
|
+
c.a)return a.J.initialize(),_.y(c,b.play(),2);BI(a);_.z(c)})},BI=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},EI=function(){this.a=this.g=this.f=null},FI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},GI=function(){},HI=function(){this.a=new _.H(qI)};_.t=rI.prototype;_.t.sb=function(){return"Google IMA SDK"};_.t.tb=function(){return google.ima.VERSION};_.t.yb=function(){return 0};_.t.getId=function(){return this.a.getAdId()};
|
|
8
|
+
_.t.getCreativeId=function(){return this.a.getCreativeId()};_.t.getApiFramework=function(){return this.a.getApiFramework()};_.t.getAdSystem=function(){return this.a.getAdSystem()};_.t.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.t.getTitle=function(){return this.a.getTitle()};_.t.getDuration=function(){return this.a.getDuration()};_.t.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.t.dc=function(){return this.f?this.f.getIsBumper():!1};
|
|
9
|
+
_.t.Ib=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Id&&typeof b[d].clickThroughUrl===_.te});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.vb=function(){return this.a.getVastMediaWidth()};_.t.ub=function(){return this.a.getVastMediaHeight()};_.t.gb=function(){return this.a.getVastMediaBitrate()};_.t.Ua=function(){return this.g?2:this.h?1:0};_.t.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
|
|
10
|
+
_.t.Jb=function(){return this.f?this.f.getTimeOffset():0};_.t.Kb=function(){return this.f?this.f.getAdPosition():1};_.t.xb=function(){return this.f?this.f.getTotalAds():1};_.t.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.t.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.t.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};rI.prototype.getWrapperCreativeIds=rI.prototype.getWrapperCreativeIds;rI.prototype.getWrapperAdSystems=rI.prototype.getWrapperAdSystems;
|
|
11
|
+
rI.prototype.getWrapperAdIds=rI.prototype.getWrapperAdIds;rI.prototype.getSequenceLength=rI.prototype.xb;rI.prototype.getPositionInSequence=rI.prototype.Kb;rI.prototype.getPodTimeOffset=rI.prototype.Jb;rI.prototype.getPodIndex=rI.prototype.getPodIndex;rI.prototype.getPodType=rI.prototype.Ua;rI.prototype.getMediaBitrate=rI.prototype.gb;rI.prototype.getMediaHeight=rI.prototype.ub;rI.prototype.getMediaWidth=rI.prototype.vb;rI.prototype.getMediaUrl=rI.prototype.getMediaUrl;
|
|
12
|
+
rI.prototype.getClickThroughUrl=rI.prototype.Ib;rI.prototype.isBumper=rI.prototype.dc;rI.prototype.getSkipTimeOffset=rI.prototype.getSkipTimeOffset;rI.prototype.getDuration=rI.prototype.getDuration;rI.prototype.getTitle=rI.prototype.getTitle;rI.prototype.getAdvertiserName=rI.prototype.getAdvertiserName;rI.prototype.getAdSystem=rI.prototype.getAdSystem;rI.prototype.getApiFramework=rI.prototype.getApiFramework;rI.prototype.getCreativeId=rI.prototype.getCreativeId;rI.prototype.getId=rI.prototype.getId;
|
|
13
|
+
rI.prototype.getTechnology=rI.prototype.yb;rI.prototype.getAdManagerVersion=rI.prototype.tb;rI.prototype.getAdManagerName=rI.prototype.sb;sI.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};tI.prototype.getCuePoints=function(){return this.a};tI.prototype.Lb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};tI.prototype.hb=function(){return 0<=this.a.indexOf(-1)};tI.prototype.hasPostroll=tI.prototype.hb;tI.prototype.hasPreroll=tI.prototype.Lb;tI.prototype.getCuePoints=tI.prototype.getCuePoints;_.t=uI.prototype;
|
|
14
|
+
_.t.Oi=function(a){var b=this;this.a=a.getAdsManager(this.j,wI(this));this.a.isCustomPlaybackUsed()?(this.O.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.L(1,9,10002)),this.dispose()):(this.h=new _.pp(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.g=new tI(a),this.l.trigger(new _.I(_.Wb,{adsTimeline:this.g})),vI(this));this.f.resolve()};
|
|
15
|
+
_.t.Ni=function(a){AI(this,a.getError());this.f.resolve()};_.t.Wi=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.C=!0,_.y(c,b.l.pause(),2);_.zn(b.j,{visibility:_.jd});xI(b,_.Fb,a);b.h.start();_.z(c)})};_.t.ph=function(a){a.getAd().isLinear()?xI(this,_.Mb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.rh=function(a){this.A=a.getAd().getDuration();xI(this,_.Sb,a);this.l.getSurface().show(this.m)};_.t.Hi=function(a){a=a.getAdData();AI(this,a?a.adError:null);yI(this)};
|
|
16
|
+
_.t.Li=function(a){xI(this,_.Pb,a)};_.t.Ei=function(a){xI(this,_.Hb,a)};_.t.nh=function(a){xI(this,_.Kb,a)};_.t.Ii=function(a){xI(this,_.Nb,a)};_.t.sh=function(a){xI(this,_.Ub,a)};_.t.Ki=function(a){xI(this,_.Ob,a)};_.t.Mi=function(a){xI(this,_.Qb,a)};_.t.mh=function(a){this.pause();xI(this,_.Ib,a)};_.t.qh=function(a){xI(this,_.Rb,a);yI(this)};_.t.oh=function(a){xI(this,_.Lb,a)};_.t.Fi=function(a){xI(this,_.Jb,a);yI(this)};
|
|
17
|
+
_.t.Xi=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();xI(this,_.Gb);zI(this)};_.t.Qi=function(){this.I=!0};_.t.Vi=function(){this.L=!0;this.o.contentComplete()};
|
|
18
|
+
_.t.load=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){b=a.l;c=a.K;try{if(typeof c.adTagUrl!==_.te)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.G.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.G.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.requestAds(f);return g["return"](a.f)})};
|
|
19
|
+
_.t.start=function(a){var b=this;return _.A(function(c){return b.a&&b.g&&!b.D?b.g.Lb()?_.y(c,CI(b),0):_.y(c,DI(b,a),0):_.y(c,a.play(),0)})};_.t.resume=function(){this.a&&this.a.resume()};_.t.pause=function(){this.a&&this.a.pause()};_.t.skip=function(){this.a&&this.a.skip()};_.t.getVolume=function(){return this.a?this.a.getVolume():1};_.t.setVolume=function(a){this.a&&this.a.setVolume(a)};
|
|
20
20
|
_.t.getPosition=function(){if(!this.a||null===this.A)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.A-a};
|
|
21
|
-
_.t.dispose=function(){var a=this;return(new Promise(function(b){a.D&&a.g&&a.g.
|
|
22
|
-
|
|
23
|
-
_.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.
|
|
24
|
-
|
|
21
|
+
_.t.dispose=function(){var a=this;return(new Promise(function(b){a.D&&a.g&&a.g.hb()&&!a.I?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.m&&a.l.getSurface().hide(a.m)}),_.dg(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.o.contentComplete()})).then(function(){zI(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};uI.prototype.getPosition=uI.prototype.getPosition;
|
|
22
|
+
uI.prototype.setVolume=uI.prototype.setVolume;uI.prototype.getVolume=uI.prototype.getVolume;uI.prototype.skip=uI.prototype.skip;uI.prototype.pause=uI.prototype.pause;uI.prototype.resume=uI.prototype.resume;_.v(EI,_.cq);_.t=EI.prototype;_.t.onPlayerCreated=function(a){if(FI())return a.onError(new _.L(1,9,1E4));this.f=_.xn(_.Vc,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.ta);this.a.getSettings().setPlayerVersion(_.ia);this.a.getSettings().setAutoPlayAdBreaks(!0)};
|
|
23
|
+
_.t.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.t.ei=function(){return this.a};_.t.ci=function(){return this.g};_.t.Dc=function(){return this.f};_.t.id=function(){return"ima"};_.B("clpp.ima.ImaPlugin",EI);EI.prototype.getAdContainer=EI.prototype.Dc;EI.prototype.getAdDisplayContainer=EI.prototype.ci;EI.prototype.getAdsLoader=EI.prototype.ei;EI.Id="ima";
|
|
24
|
+
EI.isSdkMissing=FI;GI.prototype.create=function(){return new EI};_.uo(new GI);HI.prototype.name=function(){return qI};HI.prototype.aa=function(a,b){return a.namespace()===_.Fc?!1:FI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};HI.prototype.create=function(a){return new uI(a)};HI.prototype.create=HI.prototype.create;HI.prototype.isSupported=HI.prototype.aa;HI.prototype.name=HI.prototype.name;_.un(new HI);};
|
|
25
25
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
26
26
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
27
27
|
else{_=this.clpp._;(f.call(g,this));}
|