@castlabs/prestoplay 6.34.0-beta.1 → 6.34.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 +8 -2
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +127 -127
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +541 -539
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +100 -100
- package/cjs/cl.externs.js +37 -38
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +76 -76
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +25 -25
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +348 -349
- package/cjs/cl.muxdata.js +13 -13
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +3 -3
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +98 -98
- package/cl.conviva.js +26 -26
- package/cl.core.js +435 -432
- package/cl.crypto.js +7 -7
- package/cl.dash.js +89 -89
- package/cl.externs.js +37 -38
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +297 -299
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +5 -5
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +55 -55
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +30 -30
- package/package.json +1 -1
- package/typings.d.ts +24 -125
package/cjs/cl.htmlcue.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
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.id,"clpp-text-cue-region",b);this.f=a},
|
|
11
|
-
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},
|
|
12
|
-
c)},
|
|
13
|
-
c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},
|
|
14
|
-
this.G=new _.Yh(function(){
|
|
15
|
-
c.start===d.start&&c.end===d.end)),c&&(a.l=d,
|
|
16
|
-
else{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
d=g)}}else d.appendChild(document.createTextNode(
|
|
21
|
-
|
|
22
|
-
c.next();!d.done;d=c.next())_.
|
|
23
|
-
c,null),f=
|
|
24
|
-
|
|
25
|
-
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>k&&(g=
|
|
26
|
-
|
|
27
|
-
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&
|
|
28
|
-
}a=
|
|
29
|
-
|
|
30
|
-
_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();
|
|
31
|
-
_.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Qb(.25),this.L.enableResizeObserver&&this.w.start(),
|
|
2
|
+
var f=function(window){var qT="CLPP Subtitle Styles",rT="Unsupported unit",sT="clpp-text-plain",tT="clpp-text-ttml",uT="clpp.htmlcue.HtmlTextDisplayer",vT="initial",wT=function(a){return _.Ij(a,{gi:function(b,c){return b.va(c)}})},xT=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)},yT=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},zT=function(){},AT=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},CT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return BT[c]});return a},ET=function(a,b){DT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){DT(a,c)})},DT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},FT=function(a,b){return 0===a?"0":a+b},GT=function(a,b){return 1>Math.abs(a-b)||a<b},HT=function(a,b){return a<b&&
|
|
4
|
+
1<Math.abs(a-b)},IT=function(a,b){return a>b&&1<Math.abs(a-b)},JT=function(a,b){return 1>Math.abs(a-b)||a>b},KT=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},LT=function(a){return new KT(a.left,a.f,a.top,a.a,a.height,a.width)},MT=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 KT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},NT=function(a,b){return b.some(function(c){return HT(a.left,c.f)&&IT(a.f,c.left)&&HT(a.top,c.a)&&IT(a.a,c.top)})},OT=function(a,b){return JT(a.top,b.top)&>(a.a,b.a)&&JT(a.left,b.left)&>(a.f,b.f)},PT=function(a,b,c){switch(c){case "+x":return HT(a.left,b.left);case "-x":return IT(a.f,b.f);
|
|
6
|
+
case "+y":return HT(a.top,b.top);case "-y":return IT(a.a,b.a);default:throw Error("Unknown axis");}},QT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},RT=function(a,b,c){QT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},TT=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 ST(a)?b:c},WT=function(a,b,c){return ST(a)&&_.N.ya(c)?FT(c,_.Kf):(UT(a)||
|
|
7
|
+
VT(a))&&_.N.ya(b)?FT(b,"%"):vT},UT=function(a){return a.f.writingMode===_.Ig},VT=function(a){return a.f.writingMode===_.Jg},ST=function(a){return a.f.writingMode===_.Mj},XT=function(a,b,c){return(UT(a)||VT(a))&&_.N.ya(c)?FT(c,_.Kf):UT(a)&&_.N.R(c)?FT(0,_.Kf):ST(a)&&_.N.ya(b)?FT(b,"%"):vT},YT=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.Ae:return a.f.position;case "auto":case _.md:return a.f.position-a.f.size/2;case _.Be:return a.f.position-a.f.size}return 0},
|
|
8
|
+
ZT=function(a){switch(a.f.positionAlign){case _.Ae:return _.xe;case "auto":case _.md:return _.Lj;case _.Be:return _.Rf}return a.f.textAlign},$T=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.dg:case _.xe:return _.Ae;case _.Lj:return _.md;case _.je:case _.Rf:return _.Be}return a.f.positionAlign},aU=function(a){switch(a.f.writingMode){case _.Mj:return"horizontal-tb";case _.Ig:return _.Ig;case _.Jg:return _.Jg;default:throw Error("Unknown writing mode");}},bU=function(a,b){this.l=a;this.f=
|
|
9
|
+
a.a;this.j=void 0===b?!1:b;this.a=MT(a.a);this.h=[]},cU=function(a,b){if(a.j)switch(b.writingMode){case _.Mj:return["-y"];case _.Ig:return["+x"];case _.Jg:return["-x"]}var c=[];switch(b.writingMode){case _.Mj:c=["+y","-y"];break;case _.Ig:c=["+x","-x"];break;case _.Jg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},dU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=MT(a.l.a)},eU=function(a,b,c){QT.call(this,a,b,c);this.h=null;this.l=[]},fU=function(a,b){eU.call(this,
|
|
10
|
+
a.id,"clpp-text-cue-region",b);this.f=a},gU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Rj)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(rT);},iU=function(a){this.g=new _.L("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.")},jU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
|
|
11
|
+
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,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
|
|
12
|
+
c)},hU=function(a,b,c){var d=document.createElement(_.jg),e=d.dataset;e.name=qT;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===qT&&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){_.Rv.call(this,a);var b=this;this.g=new _.L(uT);this.m=a;this.L=mU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new iU(a.getSurface().getUniqueCssClass());this.a=new eU(null,"clpp-text-container",{});this.w=new _.yv(a.getSurface(),this.ml.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 _.Yh(function(){nU(b)});this.A=new Map;this.l=null},mU=function(a){a=_.N.wb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(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(),d;!(d=b)&&(d=a.J!==c)&&(d=a.m instanceof _.X?3===a.m.getState():8===a.m.getState());if(d&&(a.J=c,d=qU(a,c),(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&
|
|
15
|
+
c.start===d.start&&c.end===d.end)),c&&(a.l=d,rU(a),d))){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Wv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,k=null;switch(e.payloadType){case _.Tg:k="clpp-text-vtt";break;case _.xg:k=tT;break;case _.Kj:k=sT}k&&!g.classList.contains(k)&&_.qr(g,k);g=MT(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{DT({fontSize:sU(f,e.containerRows)},f.a.a);g=null;k=e.payloadType===_.Tg;var l=e.payloadType===_.xg;e.region&&(k||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),f.a.appendChild(g)));e=new RT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}},qU=function(a,b){var c=yT(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&&
|
|
17
|
+
pU(a.f[c+1],b);)c++;return{start:d,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(tT);b.classList.remove(sT);a=a.a;dU(a.h);a.l=[]}},sU=function(a,b){var c=MT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Kf}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Kf;d=a.getFontSizePercent();return Math.round(c*d)+_.Kf},uU=function(){},
|
|
18
|
+
vU=function(){};
|
|
19
|
+
zT.prototype.parse=function(a){a={input:a};for(var b=_.sr(_.Sd),c=[],d=b,e;null!==(e=AT(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 k=wU[f];k?(k=_.sr(k),(f=xU[f])&&g&&k.setAttribute(f,g.trim()),g=k):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),
|
|
20
|
+
d=g)}}else d.appendChild(document.createTextNode(CT(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"},BT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};QT.prototype.init=function(){this.j=!0};QT.prototype.A=function(){return!1};_.w(RT,QT);RT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
|
|
21
|
+
RT.prototype.init=function(a){QT.prototype.init.call(this,a);if(this.h)_.qr(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===_.xg){var c=_.sr(_.Sd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Tg?b=(new zT).parse(b.payload):(c=_.sr(_.Sd),c.textContent=b.payload,b=c);_.qr(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
|
|
22
|
+
c.next();!d.done;d=c.next())_.qr(b,d.value);DT({writingMode:aU(this)},b);this.a.appendChild(b);_.qr(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.qr(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Nj,this.f.line=ST(this)?-1:0);c=aU(this);DT({writingMode:c,webkitWritingMode:c,direction:vT,textAlign:ZT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=YT(this,$T(this));d=XT(this,c,null);var e=WT(this,
|
|
23
|
+
c,null),f=VT(this)&&_.N.R(null)?FT(0,_.Kf):vT;DT({position:"absolute",left:d,right:f,top:e,width:ST(this)?FT(this.f.size,"%"):vT,height:UT(this)||VT(this)?FT(this.f.size,"%"):vT},this.a);d=this.f;a=ST(this)?a.height:a.width;e=TT(this);if(d.lineInterpretation===_.Nj)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 _.md:g-=f/2;break;case _.je:g-=f}f=Math.round(g/100*a)}VT(this)&&(f=a-f-e);a=f;d=XT(this,c,a);e=VT(this)&&_.N.R(a)?
|
|
24
|
+
FT(0,_.Kf):vT;DT({left:d,right:e,top:WT(this,c,a)},this.a)}ET(this.D,b)}};RT.prototype.o=function(){return _.sr(_.Sd)};bU.prototype.append=function(a){var b=a.a;b.style.visibility=_.re;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=MT(a.a);var d=cU(this,a.f),e=TT(a),f=LT(c),g=null,k=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;PT(c,this.a,l)||OT(c,this.a)&&NT(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||OT(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
|
|
25
|
+
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>k&&(g=LT(c),k=l);c=LT(f)}c=g||f}DT({top:FT(c.top-this.a.top,_.Kf),bottom:FT(this.a.a-c.a,_.Kf),left:FT(c.left-this.a.left,_.Kf),right:FT(this.a.f-c.f,_.Kf),height:FT(c.height,_.Kf),width:FT(c.width,_.Kf)},a.a)}b.style.visibility="visible";this.h.push(MT(a.a))};_.w(eU,QT);eU.prototype.init=function(){this.h=new bU(this);this.j=!0};eU.prototype.o=function(){var a=_.sr(_.Sd);_.qr(a,this.w);this.id&&(a.id=this.id);return a};eU.prototype.appendChild=function(a){dU(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(fU,eU);
|
|
26
|
+
fU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Rj:b=b.width/100*a.width;break a;default:throw Error(rT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Rj)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(rT);d=a.height;var e=gU(this,d,a.height);DT(this.B,this.a);DT({left:FT(c,_.Kf),top:FT(e,_.Kf),width:FT(b,_.Kf),height:FT(d,_.Kf)},this.a);this.f.writingMode&&DT({display:"flex",
|
|
27
|
+
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&DT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.qr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Rj:b=b.height/100*a.height;break a;case 2:b=b.height;d=new RT(new _.Qj(0,1,"Lorem ipsum",_.Kj),{},{});c=d.a;this.a.appendChild(c);d.init(MT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(rT);
|
|
28
|
+
}a=gU(this,b,a.height);DT({top:FT(a,_.Kf),height:FT(b,_.Kf)},this.a);this.h=new bU(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)}};
|
|
29
|
+
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.");_.z(b)})};_.w(oU,_.Rv);_.r=oU.prototype;_.r.getClass=function(){return _.se};_.r.isRenderer=function(){return!0};_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(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=xT(this.f,wT(a));this.l=null;nU(this,!1)}};_.r.ec=function(){null==this.h||nU(this,!0)};
|
|
30
|
+
_.r.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 _.x(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;_.z(b)})};_.r.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};_.r.isTextVisible=function(){return this.j};
|
|
31
|
+
_.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Qb(.25),this.L.enableResizeObserver&&this.w.start(),nU(this,!0)):(this.G.stop(),this.w.stop(),tU(this)))};_.r.ml=function(){nU(this,!0)};_.J(uT,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.a=function(a){return!!a.enableHtmlCue&&!_.xi()};uU.prototype.create=function(a){return new oU(a)};_.w(vU,_.Iu);vU.prototype.install=function(){_.wq(_.se,new uU)};vU.prototype.uninstall=function(){_.uq.has(_.se)&&(_.uq["delete"](_.se),_.vq.info("Removed factory: 'html'"))};vU.prototype.id=function(){return"subtitles-htmlcue"};_.J("clpp.htmlcue.HtmlCueComponent",vU);};
|
|
32
32
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
33
33
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
34
34
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.ima.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.wb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.
|
|
4
|
-
c.on(this.j,d,this.
|
|
5
|
-
c.on(b,d.RESUMED,a.
|
|
6
|
-
Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.bd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},
|
|
7
|
-
a.w=null;
|
|
8
|
-
var d=null;c&&(d={ad:new
|
|
9
|
-
d["return"]();
|
|
2
|
+
var f=function(window){var WS="clpp.ima.AdsManagerFactory",XS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},YS=function(){},ZS=function(a){this.a=a},$S=function(){this.a=this.h=this.f=null},aT=function(){return!window.google||!google.ima||!google.ima.AdsLoader},bT=function(){},cT=function(a){var b=a.ye("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Hd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
|
|
3
|
+
this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.wb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.Av;this.g=new _.L("clpp.ima");this.a=null;this.P=!1;this.h=null;this.f=new _.ol;this.W=!1;this.L=new _.ki;this.ha=new YS;this.w=null;this.l=this.M=!1;this.H=1;this.J=this.B=this.D=!1;this.I=this.K=null;this.G=!0;c=this.L;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.An.bind(this));
|
|
4
|
+
c.on(this.j,d,this.zn.bind(this));c.on(this.m,_.ke,this.Jn.bind(this))},dT=function(a){var b=a.a,c=a.L,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.pn.bind(a));c.on(b,d.LOADED,a.ql.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Kn.bind(a));c.on(b,d.STARTED,a.tl.bind(a));c.on(b,d.LOG,a.tn.bind(a));c.on(b,d.AD_PROGRESS,a.rl.bind(a));c.on(b,d.AD_BUFFERING,a.qn.bind(a));c.on(b,d.FIRST_QUARTILE,a.ol.bind(a));c.on(b,d.MIDPOINT,a.un.bind(a));c.on(b,d.THIRD_QUARTILE,a.ul.bind(a));c.on(b,d.PAUSED,a.wn.bind(a));
|
|
5
|
+
c.on(b,d.RESUMED,a.xn.bind(a));c.on(b,d.CLICK,a.nl.bind(a));c.on(b,d.SKIPPED,a.sl.bind(a));c.on(b,d.IMPRESSION,a.pl.bind(a));c.on(b,d.COMPLETE,a.rn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Ln.bind(a))},eT=function(a){a=a.A;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.bd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);
|
|
6
|
+
Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.bd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},gT=function(a){_.I(function(b){switch(b.a){case 1:return a.I=a.m.getPosition(),_.x(b,fT(a,[8,10,11]),2);case 2:return _.x(b,a.m.pause(),3);case 3:return _.x(b,a.m.detach(),4);case 4:a.a.start(),_.z(b)}})},iT=function(a){a.M=!1;
|
|
7
|
+
a.w=null;hT(a,_.zc);a.m.getSurface().hide(a.X)},fT=function(a,b){return _.I(function(c){return c["return"](new Promise(function(d,e){var f=setTimeout(function(){clearInterval(g);e(Error("Timeout waiting for player state"))},1E4),g=setInterval(function(){var k=a.m.getPlayerState();3===k?(clearInterval(g),clearTimeout(f),e(Error("Player entered error state"))):b.includes(k)&&(clearInterval(g),clearTimeout(f),d())},200)}))})},jT=function(a){_.rr(a.o,{visibility:"visible"})},hT=function(a,b,c){c=c&&c.getAd();
|
|
8
|
+
var d=null;c&&(d={ad:new XS(c,a.D,a.B)});a.m.trigger(new _.R(b,d))},kT=function(a,b){var c=b?a.ha.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},lT=function(a){var b=_.si()||_.ti()||_.xi();return!1===a.A.disableCustomPlayback&&b},mT=function(a){return lT(a)&&a.a.isCustomPlaybackUsed()},oT=function(a){var b,c;_.I(function(d){if(1==d.a)return a.ba.initialize(),b=!!a.m.getConfiguration().muted,_.x(d,a.T.canPlay(b),2);c=d.f;if(!c&&!mT(a))return hT(a,_.$c),a.g.warn(_.qa),
|
|
9
|
+
d["return"]();nT(a);_.z(d)})},nT=function(a){a.a.init(a.o.offsetWidth,a.o.offsetHeight,google.ima.ViewMode.NORMAL);mT(a)?a.A.isVast&&gT(a):a.a.start();a.W=!0},pT=function(){this.Ea=new _.L(WS)};_.r=XS.prototype;_.r.lb=function(){return"Google IMA SDK"};_.r.nb=function(){return google.ima.VERSION};_.r.pb=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Ib=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};
|
|
10
10
|
_.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.Kb=function(){return this.f?this.f.getIsBumper():!1};
|
|
11
|
-
_.r
|
|
12
|
-
_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.yb=function(){return this.f?this.f.getTimeOffset():0};_.r.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_.r.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)};_.r.
|
|
17
|
-
|
|
18
|
-
_.r.
|
|
19
|
-
|
|
20
|
-
_.r.
|
|
21
|
-
_.r.
|
|
22
|
-
_.r.
|
|
23
|
-
2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.x(d,a.m.play(),10);case 10:
|
|
24
|
-
_.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.A;try{if(typeof c.adTagUrl!==_.
|
|
25
|
-
return g["return"](a.f)})};_.r.Bb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.$b())return
|
|
26
|
-
_.r.
|
|
27
|
-
_.r.Ac=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;
|
|
11
|
+
_.r.$a=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ue&&typeof b[d].clickThroughUrl===_.hg});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.fb=function(){return this.a.getVastMediaWidth()};_.r.eb=function(){return this.a.getVastMediaHeight()};_.r.Ga=function(){return this.a.getVastMediaBitrate()};_.r.Ha=function(){return this.h?_.Bk:this.j?_.Ek:0};
|
|
12
|
+
_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.yb=function(){return this.f?this.f.getTimeOffset():0};_.r.ob=function(){return this.f?this.f.getAdPosition():1};_.r.gb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.Jb=function(){return null};
|
|
13
|
+
XS.prototype.getVideoElement=XS.prototype.Jb;XS.prototype.getWrapperCreativeIds=XS.prototype.getWrapperCreativeIds;XS.prototype.getWrapperAdSystems=XS.prototype.getWrapperAdSystems;XS.prototype.canSeek=XS.prototype.canSeek;XS.prototype.getWrapperAdIds=XS.prototype.getWrapperAdIds;XS.prototype.getSequenceLength=XS.prototype.gb;XS.prototype.getPositionInSequence=XS.prototype.ob;XS.prototype.getPodTimeOffset=XS.prototype.yb;XS.prototype.getPodIndex=XS.prototype.getPodIndex;XS.prototype.getPodType=XS.prototype.Ha;
|
|
14
|
+
XS.prototype.getMediaBitrate=XS.prototype.Ga;XS.prototype.getMediaHeight=XS.prototype.eb;XS.prototype.getMediaWidth=XS.prototype.fb;XS.prototype.getMediaUrl=XS.prototype.getMediaUrl;XS.prototype.getClickThroughUrl=XS.prototype.$a;XS.prototype.isBumper=XS.prototype.Kb;XS.prototype.getSkipTimeOffset=XS.prototype.getSkipTimeOffset;XS.prototype.getPosition=XS.prototype.getPosition;XS.prototype.getDuration=XS.prototype.getDuration;XS.prototype.getTitle=XS.prototype.getTitle;
|
|
15
|
+
XS.prototype.getAdvertiserName=XS.prototype.getAdvertiserName;XS.prototype.getAdSystem=XS.prototype.getAdSystem;XS.prototype.getApiFramework=XS.prototype.getApiFramework;XS.prototype.getSourceId=XS.prototype.Ib;XS.prototype.getCreativeId=XS.prototype.getCreativeId;XS.prototype.getId=XS.prototype.getId;XS.prototype.getTechnology=XS.prototype.pb;XS.prototype.getAdManagerVersion=XS.prototype.nb;XS.prototype.getAdManagerName=XS.prototype.lb;YS.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}};ZS.prototype.getCuePoints=function(){return this.a};ZS.prototype.$b=function(){return 0<=this.a.indexOf(0)||0===this.a.length};ZS.prototype.Zb=function(){return 0<=this.a.indexOf(-1)};ZS.prototype.hasPostroll=ZS.prototype.Zb;ZS.prototype.hasPreroll=ZS.prototype.$b;ZS.prototype.getCuePoints=ZS.prototype.getCuePoints;_.w($S,_.hw);_.r=$S.prototype;_.r.onPlayerCreated=function(a){if(aT())return a.onError(new _.O(1,9,1E4));this.f=_.pr(_.Sd,{"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(_.Ba);this.a.getSettings().setPlayerVersion(_.ja);this.a.getSettings().setAutoPlayAdBreaks(!0)};
|
|
16
|
+
_.r.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)};_.r.pm=function(){return this.a};_.r.nm=function(){return this.h};_.r.Hd=function(){return this.f};_.r.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",$S);$S.prototype.getAdContainer=$S.prototype.Hd;$S.prototype.getAdDisplayContainer=$S.prototype.nm;$S.prototype.getAdsLoader=$S.prototype.pm;$S.Id="ima";
|
|
17
|
+
$S.isSdkMissing=aT;bT.prototype.create=function(){return new $S};_.r=cT.prototype;
|
|
18
|
+
_.r.An=function(a){var b=this;this.a=a.getAdsManager(this.o,eT(this));this.a.isCustomPlaybackUsed()&&!lT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Ac()):(this.setMuted(this.l),this.Pa(this.H),this.h=new _.yv(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.K=new ZS(a),this.m.trigger(new _.R(_.Dc,{adsTimeline:this.K})),
|
|
19
|
+
dT(this));this.f.resolve()};_.r.zn=function(a){kT(this,a.getError());this.f.resolve()};_.r.Kn=function(a){this.J=!0;mT(this)||(this.m.pause(),_.rr(this.o,{visibility:_.re}));hT(this,_.gc,a);this.h.start()};_.r.pn=function(){mT(this)?gT(this):this.a.start()};_.r.ql=function(a){a.getAd().isLinear()?hT(this,_.qc,a):(this.a.discardAdBreak(),this.D||(this.D=!0,this.m.play()))};_.r.tl=function(a){this.M=!0;this.G=!1;this.w=a.getAd().getDuration();hT(this,_.xc,a);this.m.getSurface().show(this.X)};
|
|
20
|
+
_.r.tn=function(a){a=a.getAdData();kT(this,a?a.adError:null);iT(this)};_.r.rl=function(a){hT(this,_.uc,a)};_.r.qn=function(a){hT(this,_.ic,a)};_.r.ol=function(a){hT(this,_.lc,a)};_.r.un=function(a){hT(this,_.rc,a)};_.r.ul=function(a){hT(this,_.Bc,a)};_.r.wn=function(a){this.G=!0;hT(this,_.tc,a)};_.r.xn=function(a){this.G=!1;hT(this,_.vc,a)};_.r.nl=function(a){this.pause();hT(this,_.jc,a)};_.r.sl=function(a){hT(this,_.wc,a);iT(this)};_.r.pl=function(a){hT(this,_.pc,a)};
|
|
21
|
+
_.r.rn=function(a){hT(this,_.kc,a);iT(this)};
|
|
22
|
+
_.r.Ln=function(){var a=this,b,c;return _.I(function(d){switch(d.a){case 1:a.D=!0;if(!mT(a)||null===a.I){if(!a.J)return d["return"](a.m.play());jT(a);d.C(2);break}b=a.m.getVolume();c=a.m.isMuted();var e=a.m;e.a&&e.a.forwardEventsTo(e);e=a.m;e.f=_.N.ta(e.f,{volume:b,muted:c});return _.x(d,_.$t(a.m),3);case 3:if(a.B||!a.I){d.C(2);break}return _.x(d,fT(a,[6,8,10,11]),5);case 5:return _.x(d,a.m.play(),6);case 6:return _.x(d,a.m.pause(),7);case 7:return _.x(d,fT(a,[10,11]),8);case 8:return _.x(d,a.m.setPosition(a.I),
|
|
23
|
+
2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.x(d,a.m.play(),10);case 10:hT(a,_.hc),_.z(d)}})};_.r.Jn=function(){this.B=!0;this.j.contentComplete()};
|
|
24
|
+
_.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.A;try{if(typeof c.adTagUrl!==_.hg)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.x(g,a.T.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.x(g,a.T.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
|
|
25
|
+
return g["return"](a.f)})};_.r.Bb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.$b())return oT(this),!1;this.ba.initialize();nT(this);return!0}return this.zb()&&this.a?(this.a.resume(),!1):!0};_.r.Sc=function(){};_.r.Pc=function(){return!0};_.r.Sa=function(){this.a&&this.a.pause()};_.r.isPaused=function(){return this.G};_.r.skip=function(){this.a&&this.a.skip()};_.r.getAdVolume=function(){return this.a?this.l?this.H:this.a.getVolume():1};
|
|
26
|
+
_.r.Pa=function(a){this.H=a;this.a&&(this.l||this.a.setVolume(a))};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.Sa()};_.r.resume=function(){this.Bb()};_.r.setMuted=function(a){this.l=a;this.a&&(a?this.a.setVolume(0):this.a.setVolume(this.H))};_.r.isMuted=function(){return this.l};_.r.zb=function(){return this.M};_.r.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};
|
|
27
|
+
_.r.Ac=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;jT(this);this.L.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};cT.prototype.getPosition=cT.prototype.getPosition;cT.prototype.resume=cT.prototype.resume;cT.prototype.pause=cT.prototype.pause;cT.prototype.getVolume=cT.prototype.getVolume;cT.prototype.setVolume=cT.prototype.setVolume;cT.prototype.getAdVolume=cT.prototype.getAdVolume;cT.prototype.skip=cT.prototype.skip;cT.prototype.pauseAd=cT.prototype.Sa;pT.prototype.name=function(){return WS};pT.prototype.a=function(a,b){return a.namespace()===_.wd?!1:aT()?(this.Ea.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};pT.prototype.create=function(a){return new cT(a)};_.Yq(new pT);_.eu(new bT);};
|
|
28
28
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
29
29
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
30
30
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.mediatailor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var f=function(window){var TS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},US=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a)return _.x(l,fetch(b,{method:_.pb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.x(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;k={Dj:_.gk(f,b),nq:g?_.gk(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+k.Dj);return l["return"](k)})},VS=function(){};_.w(TS,_.hw);
|
|
3
|
+
TS.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.x(g,US(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.R("mt-session-started")),b.url=e.Dj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.Q,9,7003,"Media Tailor session failed to initialize.");})};TS.prototype.id=function(){return"mediatailor"};
|
|
4
|
+
VS.prototype.create=function(){return new TS};_.eu(new VS);};
|
|
5
5
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
6
6
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
7
7
|
else{_=this.clpp._;(f.call(g,this));}
|