@castlabs/prestoplay 6.12.0 → 6.13.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 +22 -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 +106 -106
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +504 -505
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +53 -50
- package/cjs/cl.freewheel.js +22 -22
- package/cjs/cl.hls.js +66 -66
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +21 -21
- package/cjs/cl.mse.js +269 -267
- package/cjs/cl.muxdata.js +14 -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 +71 -71
- package/cjs/cl.thumbnails.js +26 -24
- package/cjs/cl.tizen.js +68 -68
- 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 +16 -16
- package/cjs/polyfill.min.js +26 -23
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +83 -83
- package/cl.conviva.js +27 -27
- package/cl.core.js +416 -416
- package/cl.crypto.js +9 -9
- package/cl.dash.js +67 -67
- package/cl.externs.js +53 -50
- package/cl.freewheel.js +15 -15
- package/cl.hls.js +69 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +15 -15
- package/cl.mse.js +232 -231
- package/cl.muxdata.js +12 -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 -17
- 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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +13 -13
- package/package.json +1 -1
- package/typings.d.ts +82 -13
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.cb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.eb.bind(a));c.on(b,d.RESUMED,a.Gb.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.ab.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.uc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Vb.bind(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}Lb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var xM="clpp.ima.AdsManagerFactory",yM=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},zM=function(a){return!1===a.I.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.pj()},AM=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ja.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.tc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.bb.bind(a));c.on(b,d.AD_PROGRESS,a.Hb.bind(a));c.on(b,d.AD_BUFFERING,a.Ga.bind(a));
|
|
3
|
+
c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.cb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.eb.bind(a));c.on(b,d.RESUMED,a.Gb.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.ab.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.uc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Vb.bind(a))},BM=function(a,b){const c=b?a.ea.create(b.getErrorCode()):null;a.m.onError(new _.H(1,9,10003,{errorType:c},b))},CM=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))},DM=function(a){a.B=null;CM(a,_.kc);a.o&&a.m.getSurface().hide(a.o)},EM=function(a){_.Mn(a.A,{visibility:"visible"})},GM=function(a){return _.x(function*(){a.N.initialize();const b=!!a.m.getConfiguration().muted;(yield a.K.canPlay(b))||zM(a)?FM(a):(CM(a,_.Ic),a.h.warn(_.ja))})},HM=function(a,b){return _.x(function*(){a.N.initialize();yield b.play();FM(a)})},FM=function(a){a.a.init(a.A.offsetWidth,a.A.offsetHeight,
|
|
5
|
+
google.ima.ViewMode.NORMAL);a.H=!0},IM=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.g=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()}ec(){return this.f?
|
|
6
|
+
this.f.getIsBumper():!1}Lb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.ue&&typeof b[d].clickThroughUrl===_.uf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}vb(){return this.a.getVastMediaWidth()}ub(){return this.a.getVastMediaHeight()}ib(){return this.a.getVastMediaBitrate()}Va(){return this.g?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Mb(){return this.f?this.f.getTimeOffset():0}Nb(){return this.f?this.f.getAdPosition():
|
|
7
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.Nb;
|
|
8
8
|
X.prototype.getPodTimeOffset=X.prototype.Mb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Va;X.prototype.getMediaBitrate=X.prototype.ib;X.prototype.getMediaHeight=X.prototype.ub;X.prototype.getMediaWidth=X.prototype.vb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Lb;X.prototype.isBumper=X.prototype.ec;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
|
|
10
|
-
this.Ub.bind(this));a.on(this.l,b,this.Ib.bind(this));a.on(this.m,_.
|
|
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.Ob()?yield
|
|
15
|
-
{this.H&&this.j&&this.j.jb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.
|
|
16
|
-
|
|
17
|
-
(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}
|
|
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 JM=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 KM=class{constructor(a){this.a=a}getCuePoints(){return this.a}Ob(){return 0<=this.a.indexOf(0)||0===this.a.length}jb(){return 0<=this.a.indexOf(-1)}};KM.prototype.hasPostroll=KM.prototype.jb;KM.prototype.hasPreroll=KM.prototype.Ob;KM.prototype.getCuePoints=KM.prototype.getCuePoints;var LM=class{constructor(a){this.m=a;this.A=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.ug(a.ima||{});this.I=a=_.tg({disableCustomPlayback:!1},a);this.o=this.m.ac("ima").vc();this.N=this.m.ac("ima").g;this.l=this.m.ac("ima").a;this.K=new _.bt;this.h=new _.R("clpp.ima");this.g=this.a=null;this.f=new _.vm;this.H=!1;this.w=new _.hr;this.ea=new JM;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.Ub.bind(this));a.on(this.l,b,this.Ib.bind(this));a.on(this.m,_.Md,this.Xb.bind(this))}}Ub(a){this.a=a.getAdsManager(this.A,yM(this));this.a.isCustomPlaybackUsed()&&!zM(this)?(this.h.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.$s(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 KM(a),this.m.trigger(new _.F(_.nc,
|
|
11
|
+
{adsTimeline:this.j})),AM(this));this.f.resolve()}Ib(a){BM(this,a.getError());this.f.resolve()}tc(a){const b=this;return _.x(function*(){b.G=!0;zM(b)||(yield b.m.pause(),_.Mn(b.A,{visibility:_.Rd}));CM(b,_.Wb,a);b.g.start()})}ja(){const a=this;return _.x(function*(){if(zM(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()?CM(this,_.dc,a):(this.a.discardAdBreak(),this.F||(this.F=!0,this.m.play()))}aa(a){this.B=a.getAd().getDuration();
|
|
12
|
+
CM(this,_.jc,a);this.m.getSurface().show(this.o)}bb(a){a=a.getAdData();BM(this,a?a.adError:null);DM(this)}Hb(a){CM(this,_.gc,a)}Ga(a){CM(this,_.Yb,a)}T(a){CM(this,_.bc,a)}cb(a){CM(this,_.ec,a)}ba(a){CM(this,_.lc,a)}eb(a){CM(this,_.fc,a)}Gb(a){CM(this,_.hc,a)}R(a){this.pause();CM(this,_.$b,a)}Z(a){CM(this,_.ic,a);DM(this)}V(a){CM(this,_.cc,a)}ab(a){CM(this,_.ac,a);DM(this)}uc(){const a=this;return _.x(function*(){a.F=!0;if(zM(a)&&null!==a.J){var b=a.m;b.a&&b.a.addDelegate(b);yield _.Fo(a.m);a.C||(yield a.m.seek(a.J))}else{if(!a.G)return a.m.play();
|
|
13
|
+
EM(a)}a.G=!1;a.g&&a.g.stop();a.C||(yield a.m.play());CM(a,_.Xb)})}Vb(){this.M=!0}Xb(){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!==_.uf)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.Ob()?yield GM(b):yield HM(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.jb()&&!this.M?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.o&&this.m.getSurface().hide(this.o)}),_.Ug(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(()=>{EM(this);this.w.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};LM.prototype.getPosition=LM.prototype.getPosition;
|
|
16
|
+
LM.prototype.setVolume=LM.prototype.setVolume;LM.prototype.getVolume=LM.prototype.getVolume;LM.prototype.skip=LM.prototype.skip;LM.prototype.pause=LM.prototype.pause;LM.prototype.resume=LM.prototype.resume;var MM=class extends _.jt{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(IM())return a.onError(new _.H(1,9,1E4));this.f=_.Kn(_.zd,{"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(_.pa);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
|
|
17
|
+
(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}kg(){return this.a}ig(){return this.g}vc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",MM);MM.prototype.getAdContainer=MM.prototype.vc;MM.prototype.getAdDisplayContainer=MM.prototype.ig;MM.prototype.getAdsLoader=MM.prototype.kg;MM.Id="ima";MM.isSdkMissing=IM;_.ro(new class{create(){return new MM}});var NM=class{constructor(){this.a=new _.R(xM)}name(){return xM}da(a,b){return a.namespace()===_.dd?!1:IM()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new LM(a)}};NM.prototype.create=NM.prototype.create;NM.prototype.isSupported=NM.prototype.da;NM.prototype.name=NM.prototype.name;_.Hn(new NM);};f.call(g, window);
|