@castlabs/prestoplay 6.19.0 → 6.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -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 +106 -106
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +536 -534
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +77 -77
- package/cjs/cl.externs.js +1 -1
- package/cjs/cl.freewheel.js +18 -19
- package/cjs/cl.hls.js +69 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +28 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +305 -307
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +70 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +28 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -12
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +16 -16
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +84 -84
- package/cl.conviva.js +26 -26
- package/cl.core.js +386 -386
- package/cl.crypto.js +6 -6
- package/cl.dash.js +71 -71
- package/cl.externs.js +1 -1
- package/cl.freewheel.js +15 -15
- package/cl.hls.js +74 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -26
- package/cl.ima.js +14 -14
- package/cl.mse.js +271 -270
- package/cl.muxdata.js +11 -11
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +58 -58
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +9 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +12 -12
- package/package.json +1 -1
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
|
-
_.Rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},
|
|
3
|
-
c.on(b,d.FIRST_QUARTILE,a.X.bind(a));c.on(b,d.MIDPOINT,a.wb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ia.bind(a));c.on(b,d.PAUSED,a.Kb.bind(a));c.on(b,d.RESUMED,a.cc.bind(a));c.on(b,d.CLICK,a.V.bind(a));c.on(b,d.SKIPPED,a.ba.bind(a));c.on(b,d.IMPRESSION,a.Y.bind(a));c.on(b,d.COMPLETE,a.Ra.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Fc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.hc.bind(a))},
|
|
4
|
-
b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.I,a.H)});a.m.trigger(new _.C(b,d))},
|
|
5
|
-
google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var KQ="clpp.ima.AdsManagerFactory",LQ=function(a){a=a.L;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.Rc?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
|
+
_.Rc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},MQ=function(a){return!1===a.L.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.ak()},NQ=function(a){const b=a.a,c=a.C,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Pa.bind(a));c.on(b,d.LOADED,a.Z.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Dc.bind(a));c.on(b,d.STARTED,a.da.bind(a));c.on(b,d.LOG,a.Ya.bind(a));c.on(b,d.AD_PROGRESS,a.bc.bind(a));c.on(b,d.AD_BUFFERING,a.Qa.bind(a));
|
|
3
|
+
c.on(b,d.FIRST_QUARTILE,a.X.bind(a));c.on(b,d.MIDPOINT,a.wb.bind(a));c.on(b,d.THIRD_QUARTILE,a.ia.bind(a));c.on(b,d.PAUSED,a.Kb.bind(a));c.on(b,d.RESUMED,a.cc.bind(a));c.on(b,d.CLICK,a.V.bind(a));c.on(b,d.SKIPPED,a.ba.bind(a));c.on(b,d.IMPRESSION,a.Y.bind(a));c.on(b,d.COMPLETE,a.Ra.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Fc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.hc.bind(a))},OQ=function(a,b){const c=b?a.Oa.create(b.getErrorCode()):null;a.m.onError(new _.G(1,9,10003,{errorType:c},b))},PQ=function(a,
|
|
4
|
+
b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.I,a.H)});a.m.trigger(new _.C(b,d))},QQ=function(a){a.G=null;PQ(a,_.tc);a.B&&a.m.getSurface().hide(a.B)},RQ=function(a){_.Fp(a.F,{visibility:"visible"})},TQ=function(a){return _.w(function*(){a.S.initialize();const b=!!a.m.getConfiguration().muted;(yield a.O.canPlay(b))||MQ(a)?SQ(a):(PQ(a,_.Oc),a.g.warn(_.ka))})},UQ=function(a,b){return _.w(function*(){a.S.initialize();yield b.play();SQ(a)})},SQ=function(a){a.a.init(a.F.offsetWidth,a.F.offsetHeight,
|
|
5
|
+
google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},VQ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},WQ=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 XQ=class{constructor(a){this.a=a}getCuePoints(){return this.a}Eb(){return 0<=this.a.indexOf(0)||0===this.a.length}Db(){return 0<=this.a.indexOf(-1)}};XQ.prototype.hasPostroll=XQ.prototype.Db;XQ.prototype.hasPreroll=XQ.prototype.Eb;XQ.prototype.getCuePoints=XQ.prototype.getCuePoints;var X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c}hb(){return"Google IMA SDK"}ib(){return google.ima.VERSION}ob(){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()}getPosition(){return 0}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}Nb(){return this.f?
|
|
6
6
|
this.f.getIsBumper():!1}xb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Fe&&typeof b[d].clickThroughUrl===_.Pf);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}lb(){return this.a.getVastMediaWidth()}kb(){return this.a.getVastMediaHeight()}Za(){return this.a.getVastMediaBitrate()}Ua(){return this.h?2:this.j?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Bb(){return this.f?this.f.getTimeOffset():0}Cb(){return this.f?this.f.getAdPosition():
|
|
7
7
|
1}nb(){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.nb;X.prototype.getPositionInSequence=X.prototype.Cb;
|
|
8
8
|
X.prototype.getPodTimeOffset=X.prototype.Bb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Ua;X.prototype.getMediaBitrate=X.prototype.Za;X.prototype.getMediaHeight=X.prototype.kb;X.prototype.getMediaWidth=X.prototype.lb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.xb;X.prototype.isBumper=X.prototype.Nb;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getPosition=X.prototype.getPosition;
|
|
9
|
-
X.prototype.getDuration=X.prototype.getDuration;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.ob;X.prototype.getAdManagerVersion=X.prototype.ib;X.prototype.getAdManagerName=X.prototype.hb;var
|
|
10
|
-
this.fc.bind(this));a.on(this.A,b,this.ec.bind(this));a.on(this.m,_.Ud,this.jc.bind(this))}}fc(a){this.a=a.getAdsManager(this.F,
|
|
11
|
-
{adsTimeline:this.l})),
|
|
12
|
-
|
|
13
|
-
(yield a.m.seek(a.M))}else{if(!a.J)return a.m.play();
|
|
14
|
-
c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.A.getSettings().setAutoPlayAdBreaks(!1);a.A.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.l&&!b.K?b.l.Eb()?yield
|
|
15
|
-
return 0>a?0:this.G-a}h(){return(new Promise(a=>{this.K&&this.l&&this.l.Db()&&!this.R?(this.C.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.B&&this.m.getSurface().hide(this.B)}),_.
|
|
16
|
-
|
|
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)}Cg(){return this.a}Ag(){return this.h}Bc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",
|
|
9
|
+
X.prototype.getDuration=X.prototype.getDuration;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.ob;X.prototype.getAdManagerVersion=X.prototype.ib;X.prototype.getAdManagerName=X.prototype.hb;var YQ=class{constructor(a){this.m=a;this.F=a.getSurface().getMedia();a=this.m.getConfiguration();a=_.Rg(a.ima||{});this.L=a=_.Qg({disableCustomPlayback:!1},a);this.B=this.m.kc("ima").Bc();this.S=this.m.kc("ima").h;this.A=this.m.kc("ima").a;this.O=new _.xu;this.g=new _.R("clpp.ima");this.j=this.a=null;this.f=new _.ln;this.K=!1;this.C=new _.Fs;this.Oa=new WQ;this.G=null;this.R=this.J=this.H=this.I=!1;this.M=this.l=null;{a=this.C;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.A,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
|
|
10
|
+
this.fc.bind(this));a.on(this.A,b,this.ec.bind(this));a.on(this.m,_.Ud,this.jc.bind(this))}}fc(a){this.a=a.getAdsManager(this.F,LQ(this));this.a.isCustomPlaybackUsed()&&!MQ(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.G(1,9,10002)),this.h()):(this.j=new _.yu(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.l=new XQ(a),this.m.trigger(new _.C(_.wc,
|
|
11
|
+
{adsTimeline:this.l})),NQ(this));this.f.resolve()}ec(a){OQ(this,a.getError());this.f.resolve()}Dc(a){const b=this;return _.w(function*(){b.J=!0;if(MQ(b)){b.M=b.m.getPosition();yield b.m.detach();var c=b.m;c.a&&c.a.stopForwardingEventsTo(c)}else yield b.m.pause(),_.Fp(b.F,{visibility:_.ae});PQ(b,_.cc,a);b.j.start()})}Pa(){const a=this;return _.w(function*(){a.a.start()})}Z(a){a.getAd().isLinear()?PQ(this,_.mc,a):(this.a.discardAdBreak(),this.I||(this.I=!0,this.m.play()))}da(a){this.G=a.getAd().getDuration();
|
|
12
|
+
PQ(this,_.sc,a);this.m.getSurface().show(this.B)}Ya(a){a=a.getAdData();OQ(this,a?a.adError:null);QQ(this)}bc(a){PQ(this,_.pc,a)}Qa(a){PQ(this,_.ec,a)}X(a){PQ(this,_.hc,a)}wb(a){PQ(this,_.nc,a)}ia(a){PQ(this,_.uc,a)}Kb(a){PQ(this,_.oc,a)}cc(a){PQ(this,_.qc,a)}V(a){this.pause();PQ(this,_.fc,a)}ba(a){PQ(this,_.rc,a);QQ(this)}Y(a){PQ(this,_.lc,a)}Ra(a){PQ(this,_.gc,a);QQ(this)}Fc(){const a=this;return _.w(function*(){a.I=!0;if(MQ(a)&&null!==a.M){var b=a.m;b.a&&b.a.forwardEventsTo(b);yield _.Ar(a.m);a.H||
|
|
13
|
+
(yield a.m.seek(a.M))}else{if(!a.J)return a.m.play();RQ(a)}a.J=!1;a.j&&a.j.stop();a.H||(yield a.m.play());PQ(a,_.dc)})}hc(){this.R=!0}jc(){this.H=!0;this.A.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.m;const c=a.L;try{if(typeof c.adTagUrl!==_.Pf)throw new _.G(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.O.canPlay(!1);const d=yield a.O.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=
|
|
14
|
+
c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.A.getSettings().setAutoPlayAdBreaks(!1);a.A.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.l&&!b.K?b.l.Eb()?yield TQ(b):yield UQ(b,a):yield a.play()})}w(){}o(){return!0}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.G)return-1;const a=this.a.getRemainingTime();
|
|
15
|
+
return 0>a?0:this.G-a}h(){return(new Promise(a=>{this.K&&this.l&&this.l.Db()&&!this.R?(this.C.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.B&&this.m.getSurface().hide(this.B)}),_.oh(this.C,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.A.contentComplete()})).then(()=>{RQ(this);this.C.release();this.j&&(this.j.stop(),this.j=null);this.a&&(this.a.destroy(),this.a=null)})}};
|
|
16
|
+
YQ.prototype.getPosition=YQ.prototype.getPosition;YQ.prototype.setVolume=YQ.prototype.setVolume;YQ.prototype.getVolume=YQ.prototype.getVolume;YQ.prototype.skip=YQ.prototype.skip;YQ.prototype.pause=YQ.prototype.pause;YQ.prototype.resume=YQ.prototype.resume;var ZQ=class extends _.Fu{constructor(){super();this.a=this.h=this.f=null}onPlayerCreated(a){if(VQ())return a.onError(new _.G(1,9,1E4));this.f=_.Dp(_.Fd,{"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(_.ra);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)}Cg(){return this.a}Ag(){return this.h}Bc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",ZQ);ZQ.prototype.getAdContainer=ZQ.prototype.Bc;ZQ.prototype.getAdDisplayContainer=ZQ.prototype.Ag;ZQ.prototype.getAdsLoader=ZQ.prototype.Cg;ZQ.Id="ima";ZQ.isSdkMissing=VQ;_.jr(new class{create(){return new ZQ}});_.yo(new class{constructor(){this.f=new _.R(KQ)}name(){return KQ}a(a,b){return a.namespace()===_.kd?!1:VQ()?(this.f.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new YQ(a)}});};f.call(g, window);
|