@castlabs/prestoplay 6.6.0 → 6.6.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 +17 -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 +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +406 -406
- package/cjs/cl.crypto.js +8 -8
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +17 -6
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +49 -48
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +256 -257
- 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 +71 -70
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +27 -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 +357 -356
- package/cl.crypto.js +8 -8
- package/cl.dash.js +66 -66
- package/cl.externs.js +17 -6
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +40 -40
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +16 -16
- package/cl.mse.js +199 -200
- package/cl.muxdata.js +8 -8
- package/cl.onboard.js +2 -2
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +4 -4
- package/cl.smooth.js +59 -58
- package/cl.thumbnails.js +16 -16
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +12 -12
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +13 -13
- package/cl.vtt.js +11 -11
- package/cl.youbora.js +15 -15
- package/package.json +5 -1
- package/typings.d.ts +100 -96
package/cjs/cl.htmlcue.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
function(c){return
|
|
4
|
-
f},
|
|
5
|
-
d-e)},
|
|
6
|
-
this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c},
|
|
7
|
-
|
|
8
|
-
case _.ug:return _.
|
|
9
|
-
case _.Pe:c=["+x","-x"];break;case _.Qe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},
|
|
10
|
-
100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(
|
|
11
|
-
e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.g.cssRules.length&&a.g.deleteRule(0);return c},
|
|
12
|
-
e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);
|
|
13
|
-
|
|
14
|
-
this.w=new Map;this.j=null},
|
|
15
|
-
void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.
|
|
16
|
-
else{
|
|
17
|
-
end:c}}
|
|
18
|
-
|
|
19
|
-
d=g)}}else d.appendChild(document.createTextNode(
|
|
20
|
-
|
|
21
|
-
c.next();!d.done;d=c.next())_.
|
|
22
|
-
c,null),f=
|
|
23
|
-
|
|
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=
|
|
25
|
-
|
|
26
|
-
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&
|
|
27
|
-
}a=
|
|
28
|
-
|
|
2
|
+
var f=function(window){var YI="CLPP Subtitle Styles",ZI="Unsupported unit",$I="clpp-text-plain",aJ="clpp-text-ttml",bJ="clpp.htmlcue.HtmlTextDisplayer",cJ="initial",dJ=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},eJ=function(){},fJ=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},hJ=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],
|
|
3
|
+
function(c){return gJ[c]});return a},jJ=function(a,b){iJ(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){iJ(a,c)})},iJ=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},kJ=function(a,b){return 0===a?"0":a+b},lJ=function(a,b){return 1>Math.abs(a-b)||a<b},mJ=function(a,b){return a<b&&1<Math.abs(a-b)},nJ=function(a,b){return a>b&&1<Math.abs(a-b)},oJ=function(a,b){return 1>Math.abs(a-b)||a>b},pJ=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},qJ=function(a){return new pJ(a.f,a.g,a.h,a.a,a.height,a.width)},rJ=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 pJ(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-
|
|
5
|
+
d-e)},sJ=function(a,b){return b.some(function(c){return mJ(a.f,c.g)&&nJ(a.g,c.f)&&mJ(a.h,c.a)&&nJ(a.a,c.h)})},tJ=function(a,b){return oJ(a.h,b.h)&&lJ(a.a,b.a)&&oJ(a.f,b.f)&&lJ(a.g,b.g)},uJ=function(a,b,c){switch(c){case "+x":return mJ(a.f,b.f);case "-x":return nJ(a.g,b.g);case "+y":return mJ(a.h,b.h);case "-y":return nJ(a.a,b.a);default:throw Error("Unknown axis");}},vJ=function(a,b,c){this.id=a;this.o=b;this.A=c;this.a=this.m();this.h=!1},wJ=function(a,b,c){vJ.call(this,a.id,"clpp-text-cue",{});
|
|
6
|
+
this.j=b;this.f=a;this.g=!!this.f.backgroundImage;this.B=c},yJ=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 xJ(a)?b:c},BJ=function(a,b,c){return xJ(a)&&_.K.la(c)?kJ(c,_.de):(zJ(a)||AJ(a))&&_.K.la(b)?kJ(b,"%"):cJ},zJ=function(a){return a.f.writingMode===_.Pe},AJ=function(a){return a.f.writingMode===_.Qe},xJ=function(a){return a.f.writingMode===_.vg},CJ=function(a,b,c){return(zJ(a)||AJ(a))&&_.K.la(c)?kJ(c,_.de):
|
|
7
|
+
zJ(a)&&_.K.R(c)?kJ(0,_.de):xJ(a)&&_.K.la(b)?kJ(b,"%"):cJ},DJ=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.ud:return a.f.position;case "auto":case _.Dc:return a.f.position-a.f.size/2;case _.vd:return a.f.position-a.f.size}return 0},EJ=function(a){switch(a.f.positionAlign){case _.ud:return _.rd;case "auto":case _.Dc:return _.ug;case _.vd:return _.ke}return a.f.textAlign},FJ=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.rd:case _.rd:return _.ud;
|
|
8
|
+
case _.ug:return _.Dc;case _.ke:case _.ke:return _.vd}return a.f.positionAlign},GJ=function(a){switch(a.f.writingMode){case _.vg:return"horizontal-tb";case _.Pe:return _.Pe;case _.Qe:return _.Qe;default:throw Error("Unknown writing mode");}},HJ=function(a,b){this.j=a;this.f=a.a;this.h=void 0===b?!1:b;this.a=rJ(a.a);this.g=[]},IJ=function(a,b){if(a.h)switch(b.writingMode){case _.vg:return["-y"];case _.Pe:return["+x"];case _.Qe:return["-x"]}var c=[];switch(b.writingMode){case _.vg:c=["+y","-y"];break;
|
|
9
|
+
case _.Pe:c=["+x","-x"];break;case _.Qe:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},JJ=function(a){for(a.g=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=rJ(a.j.a)},KJ=function(a,b,c){vJ.call(this,a,b,c);this.g=null;this.j=[]},LJ=function(a,b){JJ(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)},MJ=function(a,b){KJ.call(this,a.id,"clpp-text-cue-region",b);this.f=a},NJ=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Ag)return a.viewportAnchorY/
|
|
10
|
+
100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(ZI);},PJ=function(a){this.f=new _.H("clpp.htmlcue.StyleManager");this.m=[];this.h=a.getSurface().getUniqueCssClass();this.j=[];this.a=OJ(this,this.h);this.g=OJ(this,this.h,!0);this.g.disabled=!0;this.f.debug("Stylesheet CLPP Subtitle Styles has been created.")},QJ=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},RJ=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)},OJ=function(a,b,c){var d=document.createElement(_.xe),e=d.dataset;e.name=YI;
|
|
12
|
+
e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);SJ(a,b);a.f.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},SJ=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===YI&&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
|
+
VJ=function(a){_.cq.call(this,a);var b=this;this.M=new _.H(bJ);this.l=a;this.K=TJ(a);this.h=!1;this.f=[];this.B=a.getSurface().getContainer();this.g=new PJ(a);this.a=new KJ(null,"clpp-text-container",{});this.o=new _.zp(a.getSurface(),this.oh.bind(this));this.I=null;this.B?(this.B.appendChild(this.a.a),this.a.init(null)):this.M.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");this.D=new _.Si(function(){UJ(b)});
|
|
14
|
+
this.w=new Map;this.j=null},TJ=function(a){a=_.K.Ma(a.getConfiguration().htmlcue||{});_.K.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.K.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},WJ=function(a,b){return a.startTime<=b&&a.endTime>b},UJ=function(a,b){if((b||a.h)&&a.B){var c=a.l.getPosition();if(b||a.I!==c&&a.l.getState()===_.ln){a.I=c;var d=XJ(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,YJ(a),d)){c={color:a.getFontColor()||
|
|
15
|
+
void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.hq(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 _.Ye:h="clpp-text-vtt";break;case _.He:h=aJ;break;case _.tg:h=$I}h&&!g.classList.contains(h)&&_.In(g,h);g=rJ(f.a.a);if(0===g.width||0===g.height)f.M.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{iJ({fontSize:ZJ(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Ye;var l=e.payloadType===_.He;e.region&&(h||l||e.backgroundImage)&&(f.w.has(e.region.id)?g=f.w.get(e.region.id):(g=new MJ(e.region,{}),f.w.set(e.region.id,g),LJ(f.a,g)));e=new wJ(e,f.K,c);g?LJ(g,e):LJ(f.a,e)}}}}}},XJ=function(a,b){var c=dJ(a.f,function(e){return WJ(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&WJ(a.f[d-1],b);)d--;for(;c+1<a.f.length&&WJ(a.f[c+1],b);)c++;return{start:d,
|
|
17
|
+
end:c}},$J=function(a){YJ(a);a.I=null;a.j=null;a.f=[]},YJ=function(a){a.w.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(aJ);b.classList.remove($I);a=a.a;JJ(a.g);a.j=[]}},ZJ=function(a,b){var c=rJ(a.a.a).height;if(null!==a.H)return a.getFontSize();if(null!==a.A){var d=a.getFontSizePercent();return Math.round(c*d)+_.de}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.de;d=a.getFontSizePercent();return Math.round(c*d)+_.de},aK=function(){},bK=function(){};
|
|
18
|
+
eJ.prototype.parse=function(a){a={input:a};for(var b=_.Kn(_.Zc),c=[],d=b,e;null!==(e=fJ(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=cK[f];h?(h=_.Kn(h),(f=dK[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||eK[g.localName]&&eK[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(hJ(e)));return b};var cK={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},dK={v:"voice",lang:"lang"},eK={rt:"ruby"},gJ={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};vJ.prototype.init=function(){this.h=!0};vJ.prototype.w=function(){return!1};_.v(wJ,vJ);wJ.prototype.w=function(){return!this.g&&!(this.f.region&&this.f.region.displayAlign)};
|
|
20
|
+
wJ.prototype.init=function(a){vJ.prototype.init.call(this,a);if(this.g)_.In(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===_.He){var c=_.Kn(_.Zc);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ye?b=(new eJ).parse(b.payload):(c=_.Kn(_.Zc),c.textContent=b.payload,b=c);_.In(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())_.In(b,d.value);iJ({writingMode:GJ(this)},b);this.a.appendChild(b);_.In(this.a,"clpp-text-wrapper");c=_.u(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.In(this.a,"clpp-text-wrapper__"+d.value);_.K.R(this.f.line)&&(this.f.lineInterpretation=_.wg,this.f.line=xJ(this)?-1:0);c=GJ(this);iJ({writingMode:c,webkitWritingMode:c,direction:cJ,textAlign:EJ(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=DJ(this,FJ(this));d=CJ(this,c,null);var e=BJ(this,
|
|
22
|
+
c,null),f=AJ(this)&&_.K.R(null)?kJ(0,_.de):cJ;iJ({position:"absolute",left:d,right:f,top:e,width:xJ(this)?kJ(this.f.size,"%"):cJ,height:zJ(this)||AJ(this)?kJ(this.f.size,"%"):cJ},this.a);d=this.f;a=xJ(this)?a.height:a.width;e=yJ(this);if(d.lineInterpretation===_.wg)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 _.Dc:g-=f/2;break;case _.hd:g-=f}f=Math.round(g/100*a)}AJ(this)&&(f=a-f-e);a=f;d=CJ(this,c,a);e=AJ(this)&&_.K.R(a)?
|
|
23
|
+
kJ(0,_.de):cJ;iJ({left:d,right:e,top:BJ(this,c,a)},this.a)}jJ(this.B,b)}};wJ.prototype.m=function(){return _.Kn(_.Zc)};HJ.prototype.append=function(a){var b=a.a;b.style.visibility=_.nd;this.f.appendChild(b);a.h||a.init(this.a);if(a.w()){a:{var c=rJ(a.a);var d=IJ(this,a.f),e=yJ(a),f=qJ(c),g=null,h=0;d=_.u(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;uJ(c,this.a,l)||tJ(c,this.a)&&sJ(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||tJ(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=qJ(c),h=l);c=qJ(f)}c=g||f}iJ({top:kJ(c.h-this.a.h,_.de),bottom:kJ(this.a.a-c.a,_.de),left:kJ(c.f-this.a.f,_.de),right:kJ(this.a.g-c.g,_.de),height:kJ(c.height,_.de),width:kJ(c.width,_.de)},a.a)}b.style.visibility="visible";this.g.push(rJ(a.a))};_.v(KJ,vJ);KJ.prototype.init=function(){this.g=new HJ(this);this.h=!0};KJ.prototype.m=function(){var a=_.Kn(_.Zc);_.In(a,this.o);this.id&&(a.id=this.id);return a};_.v(MJ,KJ);
|
|
25
|
+
MJ.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Ag:b=b.width/100*a.width;break a;default:throw Error(ZI);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Ag)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(ZI);d=a.height;var e=NJ(this,d,a.height);iJ(this.A,this.a);iJ({left:kJ(c,_.de),top:kJ(e,_.de),width:kJ(b,_.de),height:kJ(d,_.de)},this.a);this.f.writingMode&&iJ({display:"flex",
|
|
26
|
+
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&iJ({"justify-content":this.f.displayAlign},this.a);b=_.u(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.In(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Ag:b=b.height/100*a.height;break a;case 2:b=b.height;d=new wJ(new _.zg(0,1,"Lorem ipsum",_.tg),{},{});c=d.a;this.a.appendChild(c);d.init(rJ(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(ZI);
|
|
27
|
+
}a=NJ(this,b,a.height);iJ({top:kJ(a,_.de),height:kJ(b,_.de)},this.a);this.g=new HJ(this,!0);this.h=!0};MJ.prototype.getId=function(){return this.f.id};PJ.prototype.appendRule=function(a){if(null!=this.a&&!this.j.some(function(c){return c===a})){var b=RJ(this,a);if(QJ(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
|
+
PJ.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.");_.y(b)})};_.v(VJ,_.cq);_.t=VJ.prototype;
|
|
29
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={od:c.od},e=d.next())c.od=e.value,this.f.some(function(f){return function(g){var h=f.od;return g.payload!==h.payload?!1:
|
|
30
|
-
g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.od);this.j=null;
|
|
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;
|
|
32
|
-
|
|
30
|
+
g.startTime!==h.startTime?!1:g.endTime!==h.endTime?!1:!0}}(c))||this.f.push(c.od);this.j=null;UJ(this,!1)}};_.t.ob=function(){null==this.g||UJ(this,!0)};_.t.destroy=function(){var a=this;return _.A(function(b){if(1==b.a){if(null==a.g)return b["return"]();$J(a);a.D.stop();return _.x(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;_.y(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;UJ(this,!0);return!0};_.t.isTextVisible=function(){return this.h};_.t.setTextVisibility=function(a){null!=this.g&&this.h!==a&&((this.h=a)?(this.D.ab(.25),this.K.enableResizeObserver&&this.o.start(),UJ(this,!0)):(this.D.stop(),this.o.stop(),$J(this)))};_.t.oh=function(){UJ(this,!0)};_.D(bJ,VJ);VJ.prototype.setTextVisibility=VJ.prototype.setTextVisibility;
|
|
32
|
+
VJ.prototype.isTextVisible=VJ.prototype.isTextVisible;VJ.prototype.remove=VJ.prototype.remove;VJ.prototype.destroy=VJ.prototype.destroy;VJ.prototype.append=VJ.prototype.append;aK.prototype.ca=function(a){return!!a.enableHtmlCue&&!_.aj()};aK.prototype.create=function(a){return new VJ(a)};_.v(bK,_.Jo);bK.prototype.Ia=function(){_.Km("html",new aK)};bK.prototype.Ca=function(){};bK.prototype.id=function(){return _.ze};_.D("clpp.htmlcue.HtmlCueComponent",bK);};
|
|
33
33
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
34
34
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
35
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.
|
|
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 _.
|
|
19
|
-
_.t.start=function(a){var b=this;return _.
|
|
2
|
+
var f=function(window){var GI="clpp.ima.AdsManagerFactory",HI=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},II=function(){},JI=function(a){this.a=a},KI=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.K.Ma(a.ima||{});this.m=this.l.$b("ima").Ec();this.J=this.l.$b("ima").g;this.o=this.l.$b("ima").a;this.H=new _.Bp;this.P=new _.H("clpp.ima");this.h=this.a=null;this.f=new _.Sh;this.F=!1;this.w=new _.eg;this.S=new II;this.A=null;this.I=this.D=this.M=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,_.id,this.Vi.bind(this))},LI=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.sh.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Wi.bind(a));c.on(b,d.STARTED,a.uh.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.qh.bind(a));c.on(b,d.MIDPOINT,a.Ii.bind(a));c.on(b,d.THIRD_QUARTILE,a.vh.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.ph.bind(a));c.on(b,d.SKIPPED,a.th.bind(a));c.on(b,d.IMPRESSION,a.rh.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))},MI=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===_.uc?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===_.uc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},OI=function(a){a.A=null;NI(a,_.Ub);a.m&&a.l.getSurface().hide(a.m)},PI=
|
|
6
|
+
function(a){_.Jn(a.j,{visibility:"visible"})},NI=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new HI(c,a.B,a.M)});a.l.trigger(new _.J(b,d))},QI=function(a,b){var c=b?a.S.create(b.getErrorCode()):null;a.l.onError(new _.L(1,9,10003,{errorType:c},b))},SI=function(a){var b,c;return _.A(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.x(d,a.H.canPlay(b),2);c=d.f;if(!c)return NI(a,_.sc),a.P.warn(_.ka),d["return"]();RI(a);_.y(d)})},TI=function(a,b){return _.A(function(c){if(1==
|
|
7
|
+
c.a)return a.J.initialize(),_.x(c,b.play(),2);RI(a);_.y(c)})},RI=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.F=!0},UI=function(){this.a=this.g=this.f=null},VI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},WI=function(){},XI=function(){this.a=new _.H(GI)};_.t=HI.prototype;_.t.rb=function(){return"Google IMA SDK"};_.t.sb=function(){return google.ima.VERSION};_.t.xb=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.Jb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ld&&typeof b[d].clickThroughUrl===_.ve});c&&(a=b[c].clickThroughUrl);return a};_.t.getMediaUrl=function(){return this.a.getMediaUrl()};_.t.ub=function(){return this.a.getVastMediaWidth()};_.t.tb=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.Kb=function(){return this.f?this.f.getTimeOffset():0};_.t.Lb=function(){return this.f?this.f.getAdPosition():1};_.t.wb=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()};HI.prototype.getWrapperCreativeIds=HI.prototype.getWrapperCreativeIds;HI.prototype.getWrapperAdSystems=HI.prototype.getWrapperAdSystems;
|
|
11
|
+
HI.prototype.getWrapperAdIds=HI.prototype.getWrapperAdIds;HI.prototype.getSequenceLength=HI.prototype.wb;HI.prototype.getPositionInSequence=HI.prototype.Lb;HI.prototype.getPodTimeOffset=HI.prototype.Kb;HI.prototype.getPodIndex=HI.prototype.getPodIndex;HI.prototype.getPodType=HI.prototype.Ua;HI.prototype.getMediaBitrate=HI.prototype.gb;HI.prototype.getMediaHeight=HI.prototype.tb;HI.prototype.getMediaWidth=HI.prototype.ub;HI.prototype.getMediaUrl=HI.prototype.getMediaUrl;
|
|
12
|
+
HI.prototype.getClickThroughUrl=HI.prototype.Jb;HI.prototype.isBumper=HI.prototype.dc;HI.prototype.getSkipTimeOffset=HI.prototype.getSkipTimeOffset;HI.prototype.getDuration=HI.prototype.getDuration;HI.prototype.getTitle=HI.prototype.getTitle;HI.prototype.getAdvertiserName=HI.prototype.getAdvertiserName;HI.prototype.getAdSystem=HI.prototype.getAdSystem;HI.prototype.getApiFramework=HI.prototype.getApiFramework;HI.prototype.getCreativeId=HI.prototype.getCreativeId;HI.prototype.getId=HI.prototype.getId;
|
|
13
|
+
HI.prototype.getTechnology=HI.prototype.xb;HI.prototype.getAdManagerVersion=HI.prototype.sb;HI.prototype.getAdManagerName=HI.prototype.rb;II.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}};JI.prototype.getCuePoints=function(){return this.a};JI.prototype.Mb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};JI.prototype.hb=function(){return 0<=this.a.indexOf(-1)};JI.prototype.hasPostroll=JI.prototype.hb;JI.prototype.hasPreroll=JI.prototype.Mb;JI.prototype.getCuePoints=JI.prototype.getCuePoints;_.t=KI.prototype;
|
|
14
|
+
_.t.Oi=function(a){var b=this;this.a=a.getAdsManager(this.j,MI(this));this.a.isCustomPlaybackUsed()?(this.P.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 _.zp(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 JI(a),this.l.trigger(new _.J(_.Xb,{adsTimeline:this.g})),LI(this));this.f.resolve()};
|
|
15
|
+
_.t.Ni=function(a){QI(this,a.getError());this.f.resolve()};_.t.Wi=function(a){var b=this;return _.A(function(c){if(1==c.a)return b.D=!0,_.x(c,b.l.pause(),2);_.Jn(b.j,{visibility:_.nd});NI(b,_.Gb,a);b.h.start();_.y(c)})};_.t.sh=function(a){a.getAd().isLinear()?NI(this,_.Nb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.t.uh=function(a){this.A=a.getAd().getDuration();NI(this,_.Tb,a);this.l.getSurface().show(this.m)};_.t.Hi=function(a){a=a.getAdData();QI(this,a?a.adError:null);OI(this)};
|
|
16
|
+
_.t.Li=function(a){NI(this,_.Qb,a)};_.t.Ei=function(a){NI(this,_.Ib,a)};_.t.qh=function(a){NI(this,_.Lb,a)};_.t.Ii=function(a){NI(this,_.Ob,a)};_.t.vh=function(a){NI(this,_.Vb,a)};_.t.Ki=function(a){NI(this,_.Pb,a)};_.t.Mi=function(a){NI(this,_.Rb,a)};_.t.ph=function(a){this.pause();NI(this,_.Jb,a)};_.t.th=function(a){NI(this,_.Sb,a);OI(this)};_.t.rh=function(a){NI(this,_.Mb,a)};_.t.Fi=function(a){NI(this,_.Kb,a);OI(this)};
|
|
17
|
+
_.t.Xi=function(){this.B=!0;if(!this.D)return this.l.play();this.D=!1;this.h.stop();this.l.isEnded()||this.l.play();NI(this,_.Hb);PI(this)};_.t.Qi=function(){this.I=!0};_.t.Vi=function(){this.M=!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!==_.ve)throw new _.L(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.H.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.H.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.F?b.g.Mb()?_.x(c,SI(b),0):_.x(c,TI(b,a),0):_.x(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.F&&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.F&&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)}),_.fg(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(){PI(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};KI.prototype.getPosition=KI.prototype.getPosition;
|
|
22
|
+
KI.prototype.setVolume=KI.prototype.setVolume;KI.prototype.getVolume=KI.prototype.getVolume;KI.prototype.skip=KI.prototype.skip;KI.prototype.pause=KI.prototype.pause;KI.prototype.resume=KI.prototype.resume;_.v(UI,_.mq);_.t=UI.prototype;_.t.onPlayerCreated=function(a){if(VI())return a.onError(new _.L(1,9,1E4));this.f=_.Hn(_.Zc,{"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(_.sa);this.a.getSettings().setPlayerVersion(_.ea);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.gi=function(){return this.a};_.t.ei=function(){return this.g};_.t.Ec=function(){return this.f};_.t.id=function(){return"ima"};_.D("clpp.ima.ImaPlugin",UI);UI.prototype.getAdContainer=UI.prototype.Ec;UI.prototype.getAdDisplayContainer=UI.prototype.ei;UI.prototype.getAdsLoader=UI.prototype.gi;UI.Id="ima";
|
|
24
|
+
UI.isSdkMissing=VI;WI.prototype.create=function(){return new UI};_.Eo(new WI);XI.prototype.name=function(){return GI};XI.prototype.ca=function(a,b){return a.namespace()===_.Jc?!1:VI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};XI.prototype.create=function(a){return new KI(a)};XI.prototype.create=XI.prototype.create;XI.prototype.isSupported=XI.prototype.ca;XI.prototype.name=XI.prototype.name;_.En(new XI);};
|
|
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));}
|