@castlabs/prestoplay 6.14.1 → 6.16.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 +28 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +114 -112
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +553 -538
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +74 -73
- package/cjs/cl.externs.js +193 -58
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +368 -264
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +89 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +455 -443
- package/cl.crypto.js +9 -9
- package/cl.dash.js +70 -68
- package/cl.externs.js +189 -58
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -71
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +318 -236
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +1 -1
- package/typings.d.ts +393 -57
package/cjs/cl.htmlcue.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},
|
|
4
|
-
1<Math.abs(a-b)},
|
|
5
|
-
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
|
|
6
|
-
case "+y":return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
a.a;this.j=void 0===b?!1:b;this.a=
|
|
10
|
-
a.l.unshift(b);for(var c=_.
|
|
11
|
-
|
|
12
|
-
c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)}
|
|
13
|
-
c.observe(b,{subtree:!1,childList:!0});a.
|
|
14
|
-
this.G=new _.
|
|
15
|
-
d)){c={color:a.getFontColor()||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(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=
|
|
25
|
-
|
|
26
|
-
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&
|
|
27
|
-
}a=
|
|
28
|
-
|
|
29
|
-
_.
|
|
30
|
-
_.
|
|
2
|
+
var f=function(window){var pT="CLPP Subtitle Styles",qT="Unsupported unit",rT="clpp-text-plain",sT="clpp-text-ttml",tT="clpp.htmlcue.HtmlTextDisplayer",uT="initial",vT=function(a){return _.ni(a,{oh:function(b,c){return b.oa(c)}})},wT=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},xT=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},yT=function(){},zT=function(a){if(!a.input)return null;
|
|
3
|
+
var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},BT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return AT[c]});return a},DT=function(a,b){CT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){CT(a,c)})},CT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},ET=function(a,b){return 0===a?"0":a+b},FT=function(a,b){return 1>Math.abs(a-b)||a<b},GT=function(a,b){return a<b&&
|
|
4
|
+
1<Math.abs(a-b)},HT=function(a,b){return a>b&&1<Math.abs(a-b)},IT=function(a,b){return 1>Math.abs(a-b)||a>b},JT=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},KT=function(a){return new JT(a.left,a.f,a.top,a.a,a.height,a.width)},LT=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"))||
|
|
5
|
+
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 JT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},MT=function(a,b){return b.some(function(c){return GT(a.left,c.f)&&HT(a.f,c.left)&>(a.top,c.a)&&HT(a.a,c.top)})},NT=function(a,b){return IT(a.top,b.top)&&FT(a.a,b.a)&&IT(a.left,b.left)&&FT(a.f,b.f)},OT=function(a,b,c){switch(c){case "+x":return GT(a.left,b.left);case "-x":return HT(a.f,b.f);
|
|
6
|
+
case "+y":return GT(a.top,b.top);case "-y":return HT(a.a,b.a);default:throw Error("Unknown axis");}},PT=function(a,b,c){this.id=a;this.w=b;this.C=c;this.a=this.o();this.j=!1},QT=function(a,b,c){PT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},ST=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 RT(a)?b:c},VT=function(a,b,c){return RT(a)&&_.O.ya(c)?ET(c,_.Kf):(TT(a)||
|
|
7
|
+
UT(a))&&_.O.ya(b)?ET(b,"%"):uT},TT=function(a){return a.f.writingMode===_.Dg},UT=function(a){return a.f.writingMode===_.Eg},RT=function(a){return a.f.writingMode===_.qi},WT=function(a,b,c){return(TT(a)||UT(a))&&_.O.ya(c)?ET(c,_.Kf):TT(a)&&_.O.S(c)?ET(0,_.Kf):RT(a)&&_.O.ya(b)?ET(b,"%"):uT},XT=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ge:return a.f.position;case "auto":case _.vd:return a.f.position-a.f.size/2;case _.He:return a.f.position-a.f.size}return 0},
|
|
8
|
+
YT=function(a){switch(a.f.positionAlign){case _.Ge:return _.De;case "auto":case _.vd:return _.pi;case _.He:return _.Uf}return a.f.textAlign},ZT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.De:case _.De:return _.Ge;case _.pi:return _.vd;case _.Uf:case _.Uf:return _.He}return a.f.positionAlign},$T=function(a){switch(a.f.writingMode){case _.qi:return"horizontal-tb";case _.Dg:return _.Dg;case _.Eg:return _.Eg;default:throw Error("Unknown writing mode");}},aU=function(a,b){this.l=a;this.f=
|
|
9
|
+
a.a;this.j=void 0===b?!1:b;this.a=LT(a.a);this.h=[]},bU=function(a,b){if(a.j)switch(b.writingMode){case _.qi:return["-y"];case _.Dg:return["+x"];case _.Eg:return["-x"]}var c=[];switch(b.writingMode){case _.qi:c=["+y","-y"];break;case _.Dg:c=["+x","-x"];break;case _.Eg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},cU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=LT(a.l.a)},dU=function(a,b,c){PT.call(this,a,b,c);this.h=null;this.l=[]},eU=function(a,b){cU(a.h);
|
|
10
|
+
a.l.unshift(b);for(var c=_.w(a.l),d=c.next();!d.done;d=c.next())a.h.append(d.value)},fU=function(a,b){dU.call(this,a.id,"clpp-text-cue-region",b);this.f=a},gU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.vi)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(qT);},iU=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=hU(this,this.h);this.f=hU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},
|
|
11
|
+
jU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},kU=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,
|
|
12
|
+
c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,c)},hU=function(a,b,c){var d=document.createElement(_.mg),e=d.dataset;e.name=pT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);lU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},lU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===pT&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
|
|
13
|
+
c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},oU=function(a){_.ju.call(this,a);var b=this;this.g=new _.K(tT);this.m=a;this.M=mU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new iU(a.getSurface().getUniqueCssClass());this.a=new dU(null,"clpp-text-container",{});this.w=new _.wt(a.getSurface(),this.Tj.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
|
|
14
|
+
this.G=new _.Zk(function(){nU(b)});this.A=new Map;this.l=null},mU=function(a){a=_.O.Xa(a.htmlcue||{});_.O.S(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.O.S(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},pU=function(a,b){return a.startTime<=b&&a.endTime>b},nU=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.Bp){a.J=c;var d=qU(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,rU(a),
|
|
15
|
+
d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.ou(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(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 _.Ng:h="clpp-text-vtt";break;case _.ug:h=sT;break;case _.oi:h=rT}h&&!g.classList.contains(h)&&_.Zp(g,h);g=LT(f.a.a);if(0===g.width||0===g.height)f.g.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{CT({fontSize:sU(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Ng;var l=e.payloadType===_.ug;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new fU(e.region,{}),f.A.set(e.region.id,g),eU(f.a,g)));e=new QT(e,f.M,c);g?eU(g,e):eU(f.a,e)}}}}}},qU=function(a,b){var c=xT(a.f,function(e){return pU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&pU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&pU(a.f[c+1],b);)c++;return{start:d,
|
|
17
|
+
end:c}},tU=function(a){rU(a);a.J=null;a.l=null;a.f=[]},rU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(sT);b.classList.remove(rT);a=a.a;cU(a.h);a.l=[]}},sU=function(a,b){var c=LT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.C){var d=a.getFontSizePercent();return Math.round(c*d)+_.Kf}if(typeof b===_.k&&0<b)return Math.round(c/b)+_.Kf;d=a.getFontSizePercent();return Math.round(c*d)+_.Kf},uU=function(){},vU=function(){};
|
|
18
|
+
yT.prototype.parse=function(a){a={input:a};for(var b=_.aq(_.ae),c=[],d=b,e;null!==(e=zT(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=wU[f];h?(h=_.aq(h),(f=xU[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||yU[g.localName]&&yU[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(BT(e)));return b};var wU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},xU={v:"voice",lang:"lang"},yU={rt:"ruby"},AT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};PT.prototype.init=function(){this.j=!0};PT.prototype.A=function(){return!1};_.x(QT,PT);QT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
|
|
20
|
+
QT.prototype.init=function(a){PT.prototype.init.call(this,a);if(this.h)_.Zp(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.ug){var c=_.aq(_.ae);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ng?b=(new yT).parse(b.payload):(c=_.aq(_.ae),c.textContent=b.payload,b=c);_.Zp(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
|
|
21
|
+
c.next();!d.done;d=c.next())_.Zp(b,d.value);CT({writingMode:$T(this)},b);this.a.appendChild(b);_.Zp(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Zp(this.a,"clpp-text-wrapper__"+d.value);_.O.S(this.f.line)&&(this.f.lineInterpretation=_.ri,this.f.line=RT(this)?-1:0);c=$T(this);CT({writingMode:c,webkitWritingMode:c,direction:uT,textAlign:YT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=XT(this,ZT(this));d=WT(this,c,null);var e=VT(this,
|
|
22
|
+
c,null),f=UT(this)&&_.O.S(null)?ET(0,_.Kf):uT;CT({position:"absolute",left:d,right:f,top:e,width:RT(this)?ET(this.f.size,"%"):uT,height:TT(this)||UT(this)?ET(this.f.size,"%"):uT},this.a);d=this.f;a=RT(this)?a.height:a.width;e=ST(this);if(d.lineInterpretation===_.ri)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 _.vd:g-=f/2;break;case _.qe:g-=f}f=Math.round(g/100*a)}UT(this)&&(f=a-f-e);a=f;d=WT(this,c,a);e=UT(this)&&_.O.S(a)?
|
|
23
|
+
ET(0,_.Kf):uT;CT({left:d,right:e,top:VT(this,c,a)},this.a)}DT(this.D,b)}};QT.prototype.o=function(){return _.aq(_.ae)};aU.prototype.append=function(a){var b=a.a;b.style.visibility=_.xe;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=LT(a.a);var d=bU(this,a.f),e=ST(a),f=KT(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;OT(c,this.a,l)||NT(c,this.a)&&MT(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||NT(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
|
|
24
|
+
l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>h&&(g=KT(c),h=l);c=KT(f)}c=g||f}CT({top:ET(c.top-this.a.top,_.Kf),bottom:ET(this.a.a-c.a,_.Kf),left:ET(c.left-this.a.left,_.Kf),right:ET(this.a.f-c.f,_.Kf),height:ET(c.height,_.Kf),width:ET(c.width,_.Kf)},a.a)}b.style.visibility="visible";this.h.push(LT(a.a))};_.x(dU,PT);dU.prototype.init=function(){this.h=new aU(this);this.j=!0};dU.prototype.o=function(){var a=_.aq(_.ae);_.Zp(a,this.w);this.id&&(a.id=this.id);return a};_.x(fU,dU);
|
|
25
|
+
fU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.vi:b=b.width/100*a.width;break a;default:throw Error(qT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.vi)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(qT);d=a.height;var e=gU(this,d,a.height);CT(this.C,this.a);CT({left:ET(c,_.Kf),top:ET(e,_.Kf),width:ET(b,_.Kf),height:ET(d,_.Kf)},this.a);this.f.writingMode&&CT({display:"flex",
|
|
26
|
+
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&CT({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Zp(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.vi:b=b.height/100*a.height;break a;case 2:b=b.height;d=new QT(new _.ui(0,1,"Lorem ipsum",_.oi),{},{});c=d.a;this.a.appendChild(c);d.init(LT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(qT);
|
|
27
|
+
}a=gU(this,b,a.height);CT({top:ET(a,_.Kf),height:ET(b,_.Kf)},this.a);this.h=new aU(this,!0);this.j=!0};fU.prototype.getId=function(){return this.f.id};iU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=kU(this,a);if(jU(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
|
|
28
|
+
iU.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.C(b)})};_.x(oU,_.ju);_.u=oU.prototype;_.u.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=wT(this.f,vT(a));this.l=null;nU(this,!1)}};_.u.Kb=function(){null==this.h||nU(this,!0)};
|
|
29
|
+
_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();tU(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.C(b)})};_.u.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;nU(this,!0);return!0};_.u.isTextVisible=function(){return this.j};
|
|
30
|
+
_.u.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.yb(.25),this.M.enableResizeObserver&&this.w.start(),nU(this,!0)):(this.G.stop(),this.w.stop(),tU(this)))};_.u.Rd=function(){return this.f};_.u.Tj=function(){nU(this,!0)};_.J(tT,oU);oU.prototype.setTextVisibility=oU.prototype.setTextVisibility;oU.prototype.isTextVisible=oU.prototype.isTextVisible;oU.prototype.remove=oU.prototype.remove;oU.prototype.destroy=oU.prototype.destroy;oU.prototype.append=oU.prototype.append;uU.prototype.isSupported=function(a){return!!a.enableHtmlCue&&!_.il()};uU.prototype.create=function(a){return new oU(a)};_.x(vU,_.Gs);vU.prototype.f=function(){_.ap(_.ye,new uU)};vU.prototype.a=function(){_.Zo.has(_.ye)&&(_.Zo["delete"](_.ye),_.$o.info("Removed factory: 'html'"))};vU.prototype.id=function(){return _.og};_.J("clpp.htmlcue.HtmlCueComponent",vU);};
|
|
31
31
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
32
32
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
33
33
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.ima.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
null;this.P=this.H=this.D=this.G=!1;this.
|
|
4
|
-
d.AD_PROGRESS,a.
|
|
5
|
-
b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.
|
|
6
|
-
[];return b},
|
|
7
|
-
b=!!a.m.getConfiguration().muted,_.
|
|
8
|
-
_.
|
|
9
|
-
_.
|
|
10
|
-
_.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_.
|
|
15
|
-
_.
|
|
16
|
-
_.
|
|
17
|
-
_.
|
|
18
|
-
_.
|
|
19
|
-
_.
|
|
20
|
-
return g["return"](a.f)})};_.
|
|
21
|
-
_.
|
|
22
|
-
_.
|
|
23
|
-
|
|
24
|
-
_.
|
|
25
|
-
|
|
2
|
+
var f=function(window){var XS="clpp.ima.AdsManagerFactory",YS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},ZS=function(){},$S=function(a){this.a=a},aT=function(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.O.Xa(a.ima||{});this.J=_.O.ra({disableCustomPlayback:!1},a);this.o=this.m.yc("ima").kd();this.T=this.m.yc("ima").h;this.l=this.m.yc("ima").a;this.M=new _.yt;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.Qj;this.I=!1;this.w=new _.Uh;this.W=new ZS;this.C=
|
|
3
|
+
null;this.P=this.H=this.D=this.G=!1;this.L=this.j=null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.fm.bind(this));a.on(this.l,b,this.em.bind(this));a.on(this.m,_.re,this.mm.bind(this))},bT=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Vl.bind(a));c.on(b,d.LOADED,a.Xj.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.nm.bind(a));c.on(b,d.STARTED,a.Zj.bind(a));c.on(b,d.LOG,a.Zl.bind(a));c.on(b,
|
|
4
|
+
d.AD_PROGRESS,a.cm.bind(a));c.on(b,d.AD_BUFFERING,a.Wl.bind(a));c.on(b,d.FIRST_QUARTILE,a.Vj.bind(a));c.on(b,d.MIDPOINT,a.$l.bind(a));c.on(b,d.THIRD_QUARTILE,a.$j.bind(a));c.on(b,d.PAUSED,a.bm.bind(a));c.on(b,d.RESUMED,a.dm.bind(a));c.on(b,d.CLICK,a.Uj.bind(a));c.on(b,d.SKIPPED,a.Yj.bind(a));c.on(b,d.IMPRESSION,a.Wj.bind(a));c.on(b,d.COMPLETE,a.Xl.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.om.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.hm.bind(a))},cT=function(a){a=a.J;var b=new google.ima.AdsRenderingSettings;
|
|
5
|
+
b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.ld?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===_.ld&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:
|
|
6
|
+
[];return b},eT=function(a){a.C=null;dT(a,_.Mc);a.o&&a.m.getSurface().hide(a.o)},fT=function(a){_.$p(a.A,{visibility:"visible"})},dT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new YS(c,a.G,a.D)});a.m.trigger(new _.L(b,d))},gT=function(a,b){var c=b?a.W.create(b.getErrorCode()):null;a.m.onError(new _.P(1,9,10003,{errorType:c},b))},hT=function(a){return!1===a.J.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.Xj()},jT=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.T.initialize(),
|
|
7
|
+
b=!!a.m.getConfiguration().muted,_.y(d,a.M.canPlay(b),2);c=d.f;if(!c&&!hT(a))return dT(a,_.jd),a.g.warn(_.na),d["return"]();iT(a);_.C(d)})},kT=function(a,b){return _.I(function(c){if(1==c.a)return a.T.initialize(),_.y(c,b.play(),2);iT(a);_.C(c)})},iT=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.I=!0},lT=function(){this.a=this.h=this.f=null},mT=function(){return!window.google||!google.ima||!google.ima.AdsLoader},nT=function(){},oT=function(){this.od=
|
|
8
|
+
new _.K(XS)};_.u=YS.prototype;_.u.Nb=function(){return"Google IMA SDK"};_.u.Ob=function(){return google.ima.VERSION};_.u.Tb=function(){return 0};_.u.getId=function(){return this.a.getAdId()};_.u.getCreativeId=function(){return this.a.getCreativeId()};_.u.getApiFramework=function(){return this.a.getApiFramework()};_.u.getAdSystem=function(){return this.a.getAdSystem()};_.u.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.u.getTitle=function(){return this.a.getTitle()};
|
|
9
|
+
_.u.getDuration=function(){return this.a.getDuration()};_.u.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.u.Dc=function(){return this.f?this.f.getIsBumper():!1};_.u.dc=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ye&&typeof b[d].clickThroughUrl===_.kg});c&&(a=b[c].clickThroughUrl);return a};_.u.getMediaUrl=function(){return this.a.getMediaUrl()};_.u.Rb=function(){return this.a.getVastMediaWidth()};_.u.Qb=function(){return this.a.getVastMediaHeight()};
|
|
10
|
+
_.u.Db=function(){return this.a.getVastMediaBitrate()};_.u.qb=function(){return this.h?2:this.j?1:0};_.u.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.u.ec=function(){return this.f?this.f.getTimeOffset():0};_.u.fc=function(){return this.f?this.f.getAdPosition():1};_.u.Sb=function(){return this.f?this.f.getTotalAds():1};_.u.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.u.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.u.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};
|
|
11
|
+
YS.prototype.getWrapperCreativeIds=YS.prototype.getWrapperCreativeIds;YS.prototype.getWrapperAdSystems=YS.prototype.getWrapperAdSystems;YS.prototype.getWrapperAdIds=YS.prototype.getWrapperAdIds;YS.prototype.getSequenceLength=YS.prototype.Sb;YS.prototype.getPositionInSequence=YS.prototype.fc;YS.prototype.getPodTimeOffset=YS.prototype.ec;YS.prototype.getPodIndex=YS.prototype.getPodIndex;YS.prototype.getPodType=YS.prototype.qb;YS.prototype.getMediaBitrate=YS.prototype.Db;
|
|
12
|
+
YS.prototype.getMediaHeight=YS.prototype.Qb;YS.prototype.getMediaWidth=YS.prototype.Rb;YS.prototype.getMediaUrl=YS.prototype.getMediaUrl;YS.prototype.getClickThroughUrl=YS.prototype.dc;YS.prototype.isBumper=YS.prototype.Dc;YS.prototype.getSkipTimeOffset=YS.prototype.getSkipTimeOffset;YS.prototype.getDuration=YS.prototype.getDuration;YS.prototype.getTitle=YS.prototype.getTitle;YS.prototype.getAdvertiserName=YS.prototype.getAdvertiserName;YS.prototype.getAdSystem=YS.prototype.getAdSystem;
|
|
13
|
+
YS.prototype.getApiFramework=YS.prototype.getApiFramework;YS.prototype.getCreativeId=YS.prototype.getCreativeId;YS.prototype.getId=YS.prototype.getId;YS.prototype.getTechnology=YS.prototype.Tb;YS.prototype.getAdManagerVersion=YS.prototype.Ob;YS.prototype.getAdManagerName=YS.prototype.Nb;ZS.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}};$S.prototype.getCuePoints=function(){return this.a};$S.prototype.hc=function(){return 0<=this.a.indexOf(0)||0===this.a.length};$S.prototype.Fb=function(){return 0<=this.a.indexOf(-1)};$S.prototype.hasPostroll=$S.prototype.Fb;$S.prototype.hasPreroll=$S.prototype.hc;$S.prototype.getCuePoints=$S.prototype.getCuePoints;_.u=aT.prototype;
|
|
14
|
+
_.u.fm=function(a){var b=this;this.a=a.getAdsManager(this.A,cT(this));this.a.isCustomPlaybackUsed()&&!hT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.P(1,9,10002)),this.dispose()):(this.h=new _.wt(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new $S(a),this.m.trigger(new _.L(_.Pc,{adsTimeline:this.j})),bT(this));this.f.resolve()};
|
|
15
|
+
_.u.em=function(a){gT(this,a.getError());this.f.resolve()};_.u.nm=function(a){var b=this;return _.I(function(c){switch(c.a){case 1:return b.H=!0,hT(b)?(b.L=b.m.getPosition(),_.y(c,b.m.detach(),5)):_.y(c,b.m.pause(),4);case 4:_.$p(b.A,{visibility:_.xe});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:dT(b,_.yc,a),b.h.start(),_.C(c)}})};_.u.Vl=function(){var a=this;return _.I(function(b){a.a.start();_.C(b)})};
|
|
16
|
+
_.u.Xj=function(a){a.getAd().isLinear()?dT(this,_.Fc,a):(this.a.discardAdBreak(),this.G||(this.G=!0,this.m.play()))};_.u.Zj=function(a){this.C=a.getAd().getDuration();dT(this,_.Lc,a);this.m.getSurface().show(this.o)};_.u.Zl=function(a){a=a.getAdData();gT(this,a?a.adError:null);eT(this)};_.u.cm=function(a){dT(this,_.Ic,a)};_.u.Wl=function(a){dT(this,_.Ac,a)};_.u.Vj=function(a){dT(this,_.Dc,a)};_.u.$l=function(a){dT(this,_.Gc,a)};_.u.$j=function(a){dT(this,_.Nc,a)};_.u.bm=function(a){dT(this,_.Hc,a)};
|
|
17
|
+
_.u.dm=function(a){dT(this,_.Jc,a)};_.u.Uj=function(a){this.pause();dT(this,_.Bc,a)};_.u.Yj=function(a){dT(this,_.Kc,a);eT(this)};_.u.Wj=function(a){dT(this,_.Ec,a)};_.u.Xl=function(a){dT(this,_.Cc,a);eT(this)};
|
|
18
|
+
_.u.om=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.G=!0;if(!hT(a)||null===a.L){if(!a.H)return b["return"](a.m.play());fT(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.y(b,_.Wq(a.m),3);case 3:if(a.D){b.F(2);break}return _.y(b,a.m.seek(a.L),2);case 2:a.H=!1;a.h&&a.h.stop();if(a.D){b.F(6);break}return _.y(b,a.m.play(),6);case 6:dT(a,_.zc),_.C(b)}})};_.u.hm=function(){this.P=!0};_.u.mm=function(){this.D=!0;this.l.contentComplete()};
|
|
19
|
+
_.u.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.J;try{if(typeof c.adTagUrl!==_.kg)throw new _.P(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.M.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.M.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(f);
|
|
20
|
+
return g["return"](a.f)})};_.u.start=function(a){var b=this;return _.I(function(c){return b.a&&b.j&&!b.I?b.j.hc()?_.y(c,jT(b),0):_.y(c,kT(b,a),0):_.y(c,a.play(),0)})};_.u.resume=function(){this.a&&this.a.resume()};_.u.pause=function(){this.a&&this.a.pause()};_.u.skip=function(){this.a&&this.a.skip()};_.u.getVolume=function(){return this.a?this.a.getVolume():1};_.u.setVolume=function(a){this.a&&this.a.setVolume(a)};
|
|
21
|
+
_.u.getPosition=function(){if(!this.a||null===this.C)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.C-a};
|
|
22
|
+
_.u.dispose=function(){var a=this;return(new Promise(function(b){a.I&&a.j&&a.j.Fb()&&!a.P?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.o&&a.m.getSurface().hide(a.o)}),_.Vh(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.l.contentComplete()})).then(function(){fT(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};aT.prototype.getPosition=aT.prototype.getPosition;
|
|
23
|
+
aT.prototype.setVolume=aT.prototype.setVolume;aT.prototype.getVolume=aT.prototype.getVolume;aT.prototype.skip=aT.prototype.skip;aT.prototype.pause=aT.prototype.pause;aT.prototype.resume=aT.prototype.resume;_.x(lT,_.tu);_.u=lT.prototype;_.u.onPlayerCreated=function(a){if(mT())return a.onError(new _.P(1,9,1E4));this.f=_.Yp(_.ae,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.wa);this.a.getSettings().setPlayerVersion(_.ja);this.a.getSettings().setAutoPlayAdBreaks(!0)};
|
|
24
|
+
_.u.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.u.al=function(){return this.a};_.u.Zk=function(){return this.h};_.u.kd=function(){return this.f};_.u.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",lT);lT.prototype.getAdContainer=lT.prototype.kd;lT.prototype.getAdDisplayContainer=lT.prototype.Zk;lT.prototype.getAdsLoader=lT.prototype.al;lT.Id="ima";
|
|
25
|
+
lT.isSdkMissing=mT;nT.prototype.create=function(){return new lT};_.Zq(new nT);oT.prototype.name=function(){return XS};oT.prototype.isSupported=function(a,b){return a.namespace()===_.Fd?!1:mT()?(this.od.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};oT.prototype.create=function(a){return new aT(a)};oT.prototype.create=oT.prototype.create;oT.prototype.isSupported=oT.prototype.isSupported;oT.prototype.name=oT.prototype.name;_.Vp(new oT);};
|
|
26
26
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
27
27
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
28
28
|
else{_=this.clpp._;(f.call(g,this));}
|