@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.
Files changed (58) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -106
  6. package/cjs/cl.conviva.js +33 -32
  7. package/cjs/cl.core.js +395 -383
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +69 -68
  10. package/cjs/cl.externs.js +98 -47
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +44 -43
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +32 -30
  15. package/cjs/cl.ima.js +23 -23
  16. package/cjs/cl.mse.js +250 -255
  17. package/cjs/cl.muxdata.js +12 -11
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -5
  21. package/cjs/cl.smooth.js +70 -70
  22. package/cjs/cl.thumbnails.js +22 -22
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +26 -26
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +18 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +19 -18
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +86 -82
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +346 -334
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +63 -62
  38. package/cl.externs.js +98 -47
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +37 -36
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -24
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +220 -224
  45. package/cl.muxdata.js +8 -9
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -4
  49. package/cl.smooth.js +57 -57
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +21 -21
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -15
  58. 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 nF="clpp.ima.AdsManagerFactory",oF=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===_.Zb?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
- _.Zb&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},pF=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.ec.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.Sa.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.Qa.bind(a));c.on(b,d.THIRD_QUARTILE,a.aa.bind(a));c.on(b,d.PAUSED,
3
- a.Ra.bind(a));c.on(b,d.RESUMED,a.Ta.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.hc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Jb.bind(a))},qF=function(a,b){const c=b?a.ca.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},rF=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 _.F(b,d))},sF=function(a){a.A=null;rF(a,_.Ab);
4
- a.m&&a.l.getSurface().hide(a.m)},tF=function(a){_.Xk(a.j,{visibility:"visible"})},vF=function(a){return _.v(function*(){a.I.initialize();const b=!!a.l.getConfiguration().muted;(yield a.F.canPlay(b))?uF(a):(rF(a,_.Xb),a.L.warn(_.ia))})},wF=function(a,b){return _.v(function*(){a.I.initialize();yield b.play();uF(a)})},uF=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},xF=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}gb(){return"Google IMA SDK"}hb(){return google.ima.VERSION}mb(){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()}Tb(){return this.f?
6
- this.f.getIsBumper():!1}zb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.rd&&typeof b[d].clickThroughUrl===_.ee);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}jb(){return this.a.getVastMediaWidth()}ib(){return this.a.getVastMediaHeight()}Wa(){return this.a.getVastMediaBitrate()}Ja(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Ab(){return this.f?this.f.getTimeOffset():0}Bb(){return this.f?this.f.getAdPosition():
7
- 1}lb(){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.lb;V.prototype.getPositionInSequence=V.prototype.Bb;
8
- V.prototype.getPodTimeOffset=V.prototype.Ab;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Ja;V.prototype.getMediaBitrate=V.prototype.Wa;V.prototype.getMediaHeight=V.prototype.ib;V.prototype.getMediaWidth=V.prototype.jb;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getClickThroughUrl=V.prototype.zb;V.prototype.isBumper=V.prototype.Tb;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.mb;V.prototype.getAdManagerVersion=V.prototype.hb;V.prototype.getAdManagerName=V.prototype.gb;var yF=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 zF=class{constructor(a){this.a=a}getCuePoints(){return this.a}Cb(){return 0<=this.a.indexOf(0)||0===this.a.length}Xa(){return 0<=this.a.indexOf(-1)}};zF.prototype.hasPostroll=zF.prototype.Xa;zF.prototype.hasPreroll=zF.prototype.Cb;zF.prototype.getCuePoints=zF.prototype.getCuePoints;var AF=class{constructor(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.J=a=_.bf(a.ima||{});this.m=this.l.Pb("ima").ic();this.I=this.l.Pb("ima").g;this.o=this.l.Pb("ima").a;this.F=new _.Lo;this.L=new _.O("clpp.ima");this.h=this.a=null;this.f=new _.Hj;this.D=!1;this.w=new _.cn;this.ca=new yF;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.wb.bind(this));a.on(this.o,b,this.vb.bind(this));a.one(this.j,_.Nc,this.Kb.bind(this))}}wb(a){this.a=a.getAdsManager(this.j,oF(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 _.H(1,9,10002)),this.dispose()):(this.h=new _.Jo(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 zF(a),
11
- this.l.trigger(new _.F(_.Db,{adsTimeline:this.g})),pF(this));this.f.resolve()}vb(a){qF(this,a.getError());this.f.resolve()}ec(a){const b=this;return _.v(function*(){b.C=!0;yield b.l.pause();_.Xk(b.j,{visibility:_.Sc});rF(b,_.mb,a);b.h.start()})}T(a){a.getAd().isLinear()?rF(this,_.tb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))}W(a){this.A=a.getAd().getDuration();rF(this,_.zb,a);this.l.getSurface().show(this.m)}ua(a){a=a.getAdData();qF(this,a?a.adError:null);sF(this)}Sa(a){rF(this,
12
- _.wb,a)}ga(a){rF(this,_.ob,a)}R(a){rF(this,_.rb,a)}Qa(a){rF(this,_.ub,a)}aa(a){rF(this,_.Bb,a)}Ra(a){rF(this,_.vb,a)}Ta(a){rF(this,_.xb,a)}N(a){this.pause();rF(this,_.pb,a)}V(a){rF(this,_.yb,a);sF(this)}S(a){rF(this,_.sb,a)}na(a){rF(this,_.qb,a);sF(this)}hc(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();rF(this,_.nb);tF(this)}Jb(){this.H=!0}Kb(){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!==_.ee)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.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.Cb()?yield vF(b):yield wF(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.Xa()&&!this.H?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Ef(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(()=>{tF(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};AF.prototype.getPosition=AF.prototype.getPosition;AF.prototype.setVolume=AF.prototype.setVolume;AF.prototype.getVolume=AF.prototype.getVolume;AF.prototype.skip=AF.prototype.skip;AF.prototype.pause=AF.prototype.pause;AF.prototype.resume=AF.prototype.resume;var BF=class extends _.So{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(xF())return a.onError(new _.H(1,9,1E4));this.f=_.Vk(_.Ec,{"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)}af(){return this.a}Ze(){return this.g}ic(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",BF);BF.prototype.getAdContainer=BF.prototype.ic;BF.prototype.getAdDisplayContainer=BF.prototype.Ze;BF.prototype.getAdsLoader=BF.prototype.af;BF.Id="ima";BF.isSdkMissing=xF;_.Cl(new class{create(){return new BF}});var CF=class{constructor(){this.a=new _.O(nF)}name(){return nF}Y(a,b){return a.namespace()===_.pc?!1:xF()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new AF(a)}};CF.prototype.create=CF.prototype.create;CF.prototype.isSupported=CF.prototype.Y;CF.prototype.name=CF.prototype.name;_.Sk(new CF);};f.call(g, window);
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);