@castlabs/prestoplay 6.13.0 → 6.14.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 +32 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -6
- package/cjs/cl.cast.js +83 -83
- package/cjs/cl.conviva.js +24 -24
- package/cjs/cl.core.js +431 -429
- package/cjs/cl.crypto.js +6 -6
- package/cjs/cl.dash.js +59 -59
- package/cjs/cl.externs.js +48 -40
- package/cjs/cl.freewheel.js +19 -19
- package/cjs/cl.hls.js +58 -57
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +17 -17
- package/cjs/cl.ima.js +18 -18
- package/cjs/cl.mse.js +269 -268
- package/cjs/cl.muxdata.js +15 -14
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +33 -33
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +53 -53
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +424 -421
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +48 -40
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +69 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +221 -220
- package/cl.muxdata.js +13 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- 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 +14 -14
- package/package.json +4 -4
- package/typings.d.ts +53 -17
package/cl.ima.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
_.Kc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},
|
|
3
|
-
c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.
|
|
4
|
-
b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.F(b,d))},
|
|
5
|
-
google.ima.ViewMode.NORMAL);a.H=!0},
|
|
6
|
-
this.f.getIsBumper():!1}
|
|
7
|
-
1}xb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.xb;X.prototype.getPositionInSequence=X.prototype.
|
|
8
|
-
X.prototype.getPodTimeOffset=X.prototype.
|
|
9
|
-
X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.yb;X.prototype.getAdManagerVersion=X.prototype.sb;X.prototype.getAdManagerName=X.prototype.rb;var
|
|
10
|
-
this.
|
|
11
|
-
{adsTimeline:this.j})),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.j&&!b.H?b.j.
|
|
15
|
-
{this.H&&this.j&&this.j.
|
|
16
|
-
|
|
17
|
-
(this.a.destroy(),this.a=null);this.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var yM="clpp.ima.AdsManagerFactory",zM=function(a){a=a.I;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Kc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.r&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.r&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
|
|
2
|
+
_.Kc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},AM=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.qj()},BM=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.la.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.uc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.eb.bind(a));c.on(b,d.AD_PROGRESS,a.Gb.bind(a));c.on(b,d.AD_BUFFERING,a.Oa.bind(a));
|
|
3
|
+
c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.fb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.gb.bind(a));c.on(b,d.RESUMED,a.Tb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Z.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.cb.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.vc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Wb.bind(a))},CM=function(a,b){const c=b?a.ea.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},DM=function(a,
|
|
4
|
+
b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.F,a.C)});a.m.trigger(new _.F(b,d))},EM=function(a){a.B=null;DM(a,_.kc);a.o&&a.m.getSurface().hide(a.o)},FM=function(a){_.Nn(a.A,{visibility:"visible"})},HM=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||AM(a)?GM(a):(DM(a,_.Ic),a.g.warn(_.ja))})},IM=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();GM(a)})},GM=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
|
|
5
|
+
google.ima.ViewMode.NORMAL);a.H=!0},JM=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c}rb(){return"Google IMA SDK"}sb(){return google.ima.VERSION}yb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}fc(){return this.f?
|
|
6
|
+
this.f.getIsBumper():!1}Jb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.ve&&typeof b[d].clickThroughUrl===_.vf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}vb(){return this.a.getVastMediaWidth()}ub(){return this.a.getVastMediaHeight()}kb(){return this.a.getVastMediaBitrate()}Wa(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Kb(){return this.f?this.f.getTimeOffset():0}Lb(){return this.f?this.f.getAdPosition():
|
|
7
|
+
1}xb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.xb;X.prototype.getPositionInSequence=X.prototype.Lb;
|
|
8
|
+
X.prototype.getPodTimeOffset=X.prototype.Kb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Wa;X.prototype.getMediaBitrate=X.prototype.kb;X.prototype.getMediaHeight=X.prototype.ub;X.prototype.getMediaWidth=X.prototype.vb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Jb;X.prototype.isBumper=X.prototype.fc;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;
|
|
9
|
+
X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.yb;X.prototype.getAdManagerVersion=X.prototype.sb;X.prototype.getAdManagerName=X.prototype.rb;var KM=class{create(a){const 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}}};var LM=class{constructor(a){this.a=a}getCuePoints(){return this.a}Mb(){return 0<=this.a.indexOf(0)||0===this.a.length}lb(){return 0<=this.a.indexOf(-1)}};LM.prototype.hasPostroll=LM.prototype.lb;LM.prototype.hasPreroll=LM.prototype.Mb;LM.prototype.getCuePoints=LM.prototype.getCuePoints;var MM=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.vg(a.ima||{});this.I=a=_.ug({disableCustomPlayback:!1},a);this.o=this.m.bc("ima").wc();this.N=this.m.bc("ima").h;this.l=this.m.bc("ima").a;this.K=new _.ct;this.g=new _.R("clpp.ima");this.h=this.a=null;this.f=new _.wm;this.H=!1;this.w=new _.ir;this.ea=new KM;this.B=null;this.M=this.G=this.C=this.F=!1;this.J=this.j=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.l,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
|
|
10
|
+
this.Vb.bind(this));a.on(this.l,b,this.Ub.bind(this));a.on(this.m,_.Md,this.Yb.bind(this))}}Vb(a){this.a=a.getAdsManager(this.A,zM(this));this.a.isCustomPlaybackUsed()&&!AM(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.h=new _.at(this.m.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.j=new LM(a),this.m.trigger(new _.F(_.nc,
|
|
11
|
+
{adsTimeline:this.j})),BM(this));this.f.resolve()}Ub(a){CM(this,a.getError());this.f.resolve()}uc(a){const b=this;return _.x(function*(){b.G=!0;AM(b)||(yield b.m.pause(),_.Nn(b.A,{visibility:_.Sd}));DM(b,_.Wb,a);b.h.start()})}la(){const a=this;return _.x(function*(){if(AM(a)){a.J=a.m.getPosition();yield a.m.detach();var b=a.m;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?DM(this,_.dc,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
|
|
12
|
+
DM(this,_.jc,a);this.m.getSurface().show(this.o)}eb(a){a=a.getAdData();CM(this,a?a.adError:null);EM(this)}Gb(a){DM(this,_.gc,a)}Oa(a){DM(this,_.Zb,a)}T(a){DM(this,_.bc,a)}fb(a){DM(this,_.ec,a)}ba(a){DM(this,_.lc,a)}gb(a){DM(this,_.fc,a)}Tb(a){DM(this,_.hc,a)}R(a){this.pause();DM(this,_.$b,a)}Z(a){DM(this,_.ic,a);EM(this)}V(a){DM(this,_.cc,a)}cb(a){DM(this,_.ac,a);EM(this)}vc(){const a=this;return _.x(function*(){a.F=!0;if(AM(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Go(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
|
|
13
|
+
FM(a)}a.G=!1;a.h&&a.h.stop();a.C||(yield a.m.play());DM(a,_.Xb)})}Wb(){this.M=!0}Yb(){this.C=!0;this.l.contentComplete()}load(){const a=this;return _.x(function*(){var b=a.m;const c=a.I;try{if(typeof c.adTagUrl!==_.vf)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.K.canPlay(!1);const d=yield a.K.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
|
|
14
|
+
a.l.getSettings().setAutoPlayAdBreaks(!1);a.l.requestAds(e);return a.f})}start(a){const b=this;return _.x(function*(){b.a&&b.j&&!b.H?b.j.Mb()?yield HM(b):yield IM(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.B)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.B-a}dispose(){return(new Promise(a=>
|
|
15
|
+
{this.H&&this.j&&this.j.lb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.Vg(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.l.contentComplete()})).then(()=>{FM(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};MM.prototype.getPosition=MM.prototype.getPosition;
|
|
16
|
+
MM.prototype.setVolume=MM.prototype.setVolume;MM.prototype.getVolume=MM.prototype.getVolume;MM.prototype.skip=MM.prototype.skip;MM.prototype.pause=MM.prototype.pause;MM.prototype.resume=MM.prototype.resume;var NM=class extends _.kt{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(JM())return a.onError(new _.H(1,9,1E4));this.f=_.Ln(_.zd,{"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(_.pa);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
|
|
17
|
+
(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}mg(){return this.a}kg(){return this.h}wc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",NM);NM.prototype.getAdContainer=NM.prototype.wc;NM.prototype.getAdDisplayContainer=NM.prototype.kg;NM.prototype.getAdsLoader=NM.prototype.mg;NM.Id="ima";NM.isSdkMissing=JM;_.so(new class{create(){return new NM}});var OM=class{constructor(){this.a=new _.R(yM)}name(){return yM}da(a,b){return a.namespace()===_.dd?!1:JM()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new MM(a)}};OM.prototype.create=OM.prototype.create;OM.prototype.isSupported=OM.prototype.da;OM.prototype.name=OM.prototype.name;_.In(new OM);};f.call(g, window);
|