@castlabs/prestoplay 6.2.7 → 6.3.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 +64 -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 +110 -106
- package/cjs/cl.conviva.js +33 -32
- package/cjs/cl.core.js +395 -383
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +69 -68
- package/cjs/cl.externs.js +98 -47
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +44 -43
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +32 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +250 -255
- package/cjs/cl.muxdata.js +12 -11
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -5
- package/cjs/cl.smooth.js +70 -70
- package/cjs/cl.thumbnails.js +22 -22
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +26 -26
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +19 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +86 -82
- package/cl.conviva.js +27 -27
- package/cl.core.js +346 -334
- package/cl.crypto.js +8 -8
- package/cl.dash.js +63 -62
- package/cl.externs.js +98 -47
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +37 -36
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -24
- package/cl.ima.js +16 -16
- package/cl.mse.js +220 -224
- package/cl.muxdata.js +8 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -4
- package/cl.smooth.js +57 -57
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +21 -21
- 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 +15 -15
- package/package.json +1 -1
package/cl.ima.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
_.
|
|
3
|
-
a.
|
|
4
|
-
a.m&&a.l.getSurface().hide(a.m)},
|
|
5
|
-
b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}
|
|
6
|
-
this.f.getIsBumper():!1}
|
|
7
|
-
1}
|
|
8
|
-
V.prototype.getPodTimeOffset=V.prototype.
|
|
9
|
-
V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.ba;V.prototype.getTechnology=V.prototype.
|
|
10
|
-
this.
|
|
11
|
-
this.l.trigger(new _.
|
|
12
|
-
_.
|
|
13
|
-
try{if(typeof c.adTagUrl!==_.
|
|
14
|
-
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.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>{this.D&&this.g&&this.g.
|
|
15
|
-
()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.o.contentComplete()})).then(()=>{
|
|
16
|
-
(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var EF="clpp.ima.AdsManagerFactory",FF=function(a){a=a.J;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.p&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.cc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.p&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.p&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
|
|
2
|
+
_.cc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},GF=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.T.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.gc.bind(a));c.on(b,d.STARTED,a.W.bind(a));c.on(b,d.LOG,a.ua.bind(a));c.on(b,d.AD_PROGRESS,a.Ta.bind(a));c.on(b,d.AD_BUFFERING,a.ga.bind(a));c.on(b,d.FIRST_QUARTILE,a.R.bind(a));c.on(b,d.MIDPOINT,a.Ra.bind(a));c.on(b,d.THIRD_QUARTILE,a.aa.bind(a));c.on(b,d.PAUSED,
|
|
3
|
+
a.Sa.bind(a));c.on(b,d.RESUMED,a.Ua.bind(a));c.on(b,d.CLICK,a.N.bind(a));c.on(b,d.SKIPPED,a.V.bind(a));c.on(b,d.IMPRESSION,a.S.bind(a));c.on(b,d.COMPLETE,a.na.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.jc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Kb.bind(a))},HF=function(a,b){const c=b?a.ca.create(b.getErrorCode()):null;a.l.onError(new _.G(1,9,10003,{errorType:c},b))},IF=function(a,b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new V(c,a.B,a.K)});a.l.trigger(new _.B(b,d))},JF=function(a){a.A=null;IF(a,_.Eb);
|
|
4
|
+
a.m&&a.l.getSurface().hide(a.m)},KF=function(a){_.yl(a.j,{visibility:"visible"})},MF=function(a){return _.v(function*(){a.I.initialize();const b=!!a.l.getConfiguration().muted;(yield a.F.canPlay(b))?LF(a):(IF(a,_.ac),a.L.warn(_.ia))})},NF=function(a,b){return _.v(function*(){a.I.initialize();yield b.play();LF(a)})},LF=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},OF=function(){return!window.google||!google.ima||!google.ima.AdsLoader},V=class{constructor(a,
|
|
5
|
+
b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}hb(){return"Google IMA SDK"}ib(){return google.ima.VERSION}nb(){return 0}ba(){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()}Ub(){return this.f?
|
|
6
|
+
this.f.getIsBumper():!1}Ab(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.wd&&typeof b[d].clickThroughUrl===_.je);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}kb(){return this.a.getVastMediaWidth()}jb(){return this.a.getVastMediaHeight()}Ya(){return this.a.getVastMediaBitrate()}Ka(){return this.g?2:this.h?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
|
+
1}mb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};V.prototype.getWrapperCreativeIds=V.prototype.getWrapperCreativeIds;V.prototype.getWrapperAdSystems=V.prototype.getWrapperAdSystems;V.prototype.getWrapperAdIds=V.prototype.getWrapperAdIds;V.prototype.getSequenceLength=V.prototype.mb;V.prototype.getPositionInSequence=V.prototype.Cb;
|
|
8
|
+
V.prototype.getPodTimeOffset=V.prototype.Bb;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Ka;V.prototype.getMediaBitrate=V.prototype.Ya;V.prototype.getMediaHeight=V.prototype.jb;V.prototype.getMediaWidth=V.prototype.kb;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getClickThroughUrl=V.prototype.Ab;V.prototype.isBumper=V.prototype.Ub;V.prototype.getSkipTimeOffset=V.prototype.getSkipTimeOffset;V.prototype.getDuration=V.prototype.getDuration;
|
|
9
|
+
V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.ba;V.prototype.getTechnology=V.prototype.nb;V.prototype.getAdManagerVersion=V.prototype.ib;V.prototype.getAdManagerName=V.prototype.hb;var PF=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 QF=class{constructor(a){this.a=a}getCuePoints(){return this.a}Db(){return 0<=this.a.indexOf(0)||0===this.a.length}Za(){return 0<=this.a.indexOf(-1)}};QF.prototype.hasPostroll=QF.prototype.Za;QF.prototype.hasPreroll=QF.prototype.Db;QF.prototype.getCuePoints=QF.prototype.getCuePoints;var RF=class{constructor(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.J=a=_.gf(a.ima||{});this.m=this.l.Qb("ima").kc();this.I=this.l.Qb("ima").g;this.o=this.l.Qb("ima").a;this.F=new _.np;this.L=new _.O("clpp.ima");this.h=this.a=null;this.f=new _.fk;this.D=!1;this.w=new _.Fn;this.ca=new PF;this.A=null;this.H=this.C=this.K=this.B=!1;this.g=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
|
|
10
|
+
this.xb.bind(this));a.on(this.o,b,this.wb.bind(this));a.one(this.j,_.Sc,this.Lb.bind(this))}}xb(a){this.a=a.getAdsManager(this.j,FF(this));this.a.isCustomPlaybackUsed()?(this.L.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.G(1,9,10002)),this.dispose()):(this.h=new _.lp(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.g=new QF(a),
|
|
11
|
+
this.l.trigger(new _.B(_.Hb,{adsTimeline:this.g})),GF(this));this.f.resolve()}wb(a){HF(this,a.getError());this.f.resolve()}gc(a){const b=this;return _.v(function*(){b.C=!0;yield b.l.pause();_.yl(b.j,{visibility:_.Zc});IF(b,_.qb,a);b.h.start()})}T(a){a.getAd().isLinear()?IF(this,_.xb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))}W(a){this.A=a.getAd().getDuration();IF(this,_.Db,a);this.l.getSurface().show(this.m)}ua(a){a=a.getAdData();HF(this,a?a.adError:null);JF(this)}Ta(a){IF(this,
|
|
12
|
+
_.Ab,a)}ga(a){IF(this,_.sb,a)}R(a){IF(this,_.vb,a)}Ra(a){IF(this,_.yb,a)}aa(a){IF(this,_.Fb,a)}Sa(a){IF(this,_.zb,a)}Ua(a){IF(this,_.Bb,a)}N(a){this.pause();IF(this,_.tb,a)}V(a){IF(this,_.Cb,a);JF(this)}S(a){IF(this,_.wb,a)}na(a){IF(this,_.ub,a);JF(this)}jc(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();IF(this,_.rb);KF(this)}Kb(){this.H=!0}Lb(){this.K=!0;this.o.contentComplete()}load(){const a=this;return _.v(function*(){var b=a.l;const c=a.J;
|
|
13
|
+
try{if(typeof c.adTagUrl!==_.je)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.F.canPlay(!1);const d=yield a.F.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.o.requestAds(e);return a.f})}start(a){const b=this;return _.v(function*(){b.a&&b.g&&!b.D?b.g.Db()?yield MF(b):yield NF(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&
|
|
14
|
+
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.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>{this.D&&this.g&&this.g.Za()&&!this.H?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Kf(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],
|
|
15
|
+
()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.o.contentComplete()})).then(()=>{KF(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};RF.prototype.getPosition=RF.prototype.getPosition;RF.prototype.setVolume=RF.prototype.setVolume;RF.prototype.getVolume=RF.prototype.getVolume;RF.prototype.skip=RF.prototype.skip;RF.prototype.pause=RF.prototype.pause;RF.prototype.resume=RF.prototype.resume;var SF=class extends _.up{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(OF())return a.onError(new _.G(1,9,1E4));this.f=_.wl(_.Jc,{"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(_.la);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
|
|
16
|
+
(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}cf(){return this.a}af(){return this.g}kc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",SF);SF.prototype.getAdContainer=SF.prototype.kc;SF.prototype.getAdDisplayContainer=SF.prototype.af;SF.prototype.getAdsLoader=SF.prototype.cf;SF.Id="ima";SF.isSdkMissing=OF;_.cm(new class{create(){return new SF}});var TF=class{constructor(){this.a=new _.O(EF)}name(){return EF}Y(a,b){return a.namespace()===_.tc?!1:OF()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new RF(a)}};TF.prototype.create=TF.prototype.create;TF.prototype.isSupported=TF.prototype.Y;TF.prototype.name=TF.prototype.name;_.tl(new TF);};f.call(g, window);
|