@castlabs/prestoplay 6.9.0 → 6.10.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 (59) hide show
  1. package/CHANGELOG.md +39 -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 +105 -104
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +420 -417
  8. package/cjs/cl.crypto.js +10 -9
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +11 -12
  11. package/cjs/cl.freewheel.js +21 -21
  12. package/cjs/cl.hls.js +72 -71
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -31
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +273 -272
  17. package/cjs/cl.muxdata.js +14 -15
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +68 -68
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +16 -16
  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 +87 -87
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +363 -359
  36. package/cl.crypto.js +9 -9
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +11 -12
  39. package/cl.freewheel.js +17 -17
  40. package/cl.hls.js +61 -61
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +26 -25
  43. package/cl.ima.js +17 -17
  44. package/cl.mse.js +235 -236
  45. package/cl.muxdata.js +12 -12
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +9 -9
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +59 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  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 +13 -13
  58. package/package.json +1 -1
  59. package/typings.d.ts +47 -2
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 MI="clpp.ima.AdsManagerFactory",NI=function(a){a=a.H;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.fc?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
- _.fc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},OI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.bi()},PI=function(a){const b=a.a,c=a.o,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ma.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.pc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.Za.bind(a));c.on(b,d.AD_PROGRESS,a.Db.bind(a));c.on(b,d.AD_BUFFERING,a.La.bind(a));
3
- c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.$a.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.ab.bind(a));c.on(b,d.RESUMED,a.Qb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.Ya.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.qc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.kc.bind(a))},QI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},RI=function(a,
4
- b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new W(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},SI=function(a){a.A=null;RI(a,_.Ib);a.m&&a.l.getSurface().hide(a.m)},TI=function(a){_.cm(a.w,{visibility:"visible"})},VI=function(a){return _.y(function*(){a.M.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||OI(a)?UI(a):(RI(a,_.dc),a.N.warn(_.ia))})},WI=function(a,b){return _.y(function*(){a.M.initialize();yield b.play();UI(a)})},UI=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
5
- google.ima.ViewMode.NORMAL);a.G=!0},XI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},W=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}pb(){return"Google IMA SDK"}qb(){return google.ima.VERSION}vb(){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()}$b(){return this.f?
6
- this.f.getIsBumper():!1}Hb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}sb(){return this.a.getVastMediaWidth()}rb(){return this.a.getVastMediaHeight()}gb(){return this.a.getVastMediaBitrate()}Sa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Ib(){return this.f?this.f.getTimeOffset():0}Jb(){return this.f?this.f.getAdPosition():
7
- 1}ub(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.ub;W.prototype.getPositionInSequence=W.prototype.Jb;
8
- W.prototype.getPodTimeOffset=W.prototype.Ib;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Sa;W.prototype.getMediaBitrate=W.prototype.gb;W.prototype.getMediaHeight=W.prototype.rb;W.prototype.getMediaWidth=W.prototype.sb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.Hb;W.prototype.isBumper=W.prototype.$b;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getDuration=W.prototype.getDuration;
9
- W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.vb;W.prototype.getAdManagerVersion=W.prototype.qb;W.prototype.getAdManagerName=W.prototype.pb;var YI=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 ZI=class{constructor(a){this.a=a}getCuePoints(){return this.a}Kb(){return 0<=this.a.indexOf(0)||0===this.a.length}hb(){return 0<=this.a.indexOf(-1)}};ZI.prototype.hasPostroll=ZI.prototype.hb;ZI.prototype.hasPreroll=ZI.prototype.Kb;ZI.prototype.getCuePoints=ZI.prototype.getCuePoints;var $I=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.kf(a.ima||{});this.H=a=_.jf({disableCustomPlayback:!1},a);this.m=this.l.Wb("ima").rc();this.M=this.l.Wb("ima").g;this.j=this.l.Wb("ima").a;this.J=new _.Up;this.N=new _.O("clpp.ima");this.g=this.a=null;this.f=new _.Mk;this.G=!1;this.o=new _.jo;this.ga=new YI;this.A=null;this.K=this.F=this.B=this.C=!1;this.I=this.h=null;{a=this.o;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
- this.Sb.bind(this));a.on(this.j,b,this.Rb.bind(this));a.on(this.l,_.Xc,this.oc.bind(this))}}Sb(a){this.a=a.getAdsManager(this.w,NI(this));this.a.isCustomPlaybackUsed()&&!OI(this)?(this.N.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.Sp(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.h=new ZI(a),this.l.trigger(new _.F(_.Lb,
11
- {adsTimeline:this.h})),PI(this));this.f.resolve()}Rb(a){QI(this,a.getError());this.f.resolve()}pc(a){const b=this;return _.y(function*(){b.F=!0;OI(b)||(yield b.l.pause(),_.cm(b.w,{visibility:_.bd}));RI(b,_.ub,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(OI(a)){a.I=a.l.getPosition();yield a.l.detach();var b=a.l;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?RI(this,_.Bb,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
12
- RI(this,_.Hb,a);this.l.getSurface().show(this.m)}Za(a){a=a.getAdData();QI(this,a?a.adError:null);SI(this)}Db(a){RI(this,_.Eb,a)}La(a){RI(this,_.wb,a)}T(a){RI(this,_.zb,a)}$a(a){RI(this,_.Cb,a)}ba(a){RI(this,_.Jb,a)}ab(a){RI(this,_.Db,a)}Qb(a){RI(this,_.Fb,a)}R(a){this.pause();RI(this,_.xb,a)}Y(a){RI(this,_.Gb,a);SI(this)}V(a){RI(this,_.Ab,a)}Ya(a){RI(this,_.yb,a);SI(this)}qc(){const a=this;return _.y(function*(){a.C=!0;if(OI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.Vm(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
13
- TI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());RI(a,_.vb)})}kc(){this.K=!0}oc(){this.B=!0;this.j.contentComplete()}load(){const a=this;return _.y(function*(){var b=a.l;const c=a.H;try{if(typeof c.adTagUrl!==_.me)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.J.canPlay(!1);const d=yield a.J.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
- a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(e);return a.f})}start(a){const b=this;return _.y(function*(){b.a&&b.h&&!b.G?b.h.Kb()?yield VI(b):yield WI(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.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>
15
- {this.G&&this.h&&this.h.hb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Nf(this.o,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.j.contentComplete()})).then(()=>{TI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};$I.prototype.getPosition=$I.prototype.getPosition;
16
- $I.prototype.setVolume=$I.prototype.setVolume;$I.prototype.getVolume=$I.prototype.getVolume;$I.prototype.skip=$I.prototype.skip;$I.prototype.pause=$I.prototype.pause;$I.prototype.resume=$I.prototype.resume;var aJ=class extends _.$p{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(XI())return a.onError(new _.H(1,9,1E4));this.f=_.am(_.Oc,{"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(_.ma);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)}Hf(){return this.a}Ff(){return this.g}rc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",aJ);aJ.prototype.getAdContainer=aJ.prototype.rc;aJ.prototype.getAdDisplayContainer=aJ.prototype.Ff;aJ.prototype.getAdsLoader=aJ.prototype.Hf;aJ.Id="ima";aJ.isSdkMissing=XI;_.Hm(new class{create(){return new aJ}});var bJ=class{constructor(){this.a=new _.O(MI)}name(){return MI}ea(a,b){return a.namespace()===_.yc?!1:XI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new $I(a)}};bJ.prototype.create=bJ.prototype.create;bJ.prototype.isSupported=bJ.prototype.ea;bJ.prototype.name=bJ.prototype.name;_.Yl(new bJ);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var SI="clpp.ima.AdsManagerFactory",TI=function(a){a=a.H;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.jc?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
+ _.jc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},UI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.gi()},VI=function(a){const b=a.a,c=a.o,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ma.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.pc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.Za.bind(a));c.on(b,d.AD_PROGRESS,a.Db.bind(a));c.on(b,d.AD_BUFFERING,a.Na.bind(a));
3
+ c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.$a.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.ab.bind(a));c.on(b,d.RESUMED,a.Qb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.Ya.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.qc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.kc.bind(a))},WI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},XI=function(a,
4
+ b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},YI=function(a){a.A=null;XI(a,_.Kb);a.m&&a.l.getSurface().hide(a.m)},ZI=function(a){_.im(a.w,{visibility:"visible"})},aJ=function(a){return _.y(function*(){a.M.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||UI(a)?$I(a):(XI(a,_.fc),a.N.warn(_.ia))})},bJ=function(a,b){return _.y(function*(){a.M.initialize();yield b.play();$I(a)})},$I=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
5
+ google.ima.ViewMode.NORMAL);a.G=!0},cJ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}pb(){return"Google IMA SDK"}qb(){return google.ima.VERSION}vb(){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()}$b(){return this.f?
6
+ this.f.getIsBumper():!1}Hb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Dd&&typeof b[d].clickThroughUrl===_.pe);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}sb(){return this.a.getVastMediaWidth()}rb(){return this.a.getVastMediaHeight()}gb(){return this.a.getVastMediaBitrate()}Sa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Ib(){return this.f?this.f.getTimeOffset():0}Jb(){return this.f?this.f.getAdPosition():
7
+ 1}ub(){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.ub;X.prototype.getPositionInSequence=X.prototype.Jb;
8
+ X.prototype.getPodTimeOffset=X.prototype.Ib;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Sa;X.prototype.getMediaBitrate=X.prototype.gb;X.prototype.getMediaHeight=X.prototype.rb;X.prototype.getMediaWidth=X.prototype.sb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Hb;X.prototype.isBumper=X.prototype.$b;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.vb;X.prototype.getAdManagerVersion=X.prototype.qb;X.prototype.getAdManagerName=X.prototype.pb;var dJ=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 eJ=class{constructor(a){this.a=a}getCuePoints(){return this.a}Kb(){return 0<=this.a.indexOf(0)||0===this.a.length}hb(){return 0<=this.a.indexOf(-1)}};eJ.prototype.hasPostroll=eJ.prototype.hb;eJ.prototype.hasPreroll=eJ.prototype.Kb;eJ.prototype.getCuePoints=eJ.prototype.getCuePoints;var fJ=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.lf(a.ima||{});this.H=a=_.kf({disableCustomPlayback:!1},a);this.m=this.l.Wb("ima").rc();this.M=this.l.Wb("ima").g;this.j=this.l.Wb("ima").a;this.J=new _.$p;this.N=new _.Q("clpp.ima");this.g=this.a=null;this.f=new _.Sk;this.G=!1;this.o=new _.po;this.ga=new dJ;this.A=null;this.K=this.F=this.B=this.C=!1;this.I=this.h=null;{a=this.o;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
10
+ this.Sb.bind(this));a.on(this.j,b,this.Rb.bind(this));a.on(this.l,_.$c,this.oc.bind(this))}}Sb(a){this.a=a.getAdsManager(this.w,TI(this));this.a.isCustomPlaybackUsed()&&!UI(this)?(this.N.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.Yp(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.h=new eJ(a),this.l.trigger(new _.F(_.Nb,
11
+ {adsTimeline:this.h})),VI(this));this.f.resolve()}Rb(a){WI(this,a.getError());this.f.resolve()}pc(a){const b=this;return _.y(function*(){b.F=!0;UI(b)||(yield b.l.pause(),_.im(b.w,{visibility:_.ed}));XI(b,_.wb,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(UI(a)){a.I=a.l.getPosition();yield a.l.detach();var b=a.l;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?XI(this,_.Db,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
12
+ XI(this,_.Jb,a);this.l.getSurface().show(this.m)}Za(a){a=a.getAdData();WI(this,a?a.adError:null);YI(this)}Db(a){XI(this,_.Gb,a)}Na(a){XI(this,_.yb,a)}T(a){XI(this,_.Bb,a)}$a(a){XI(this,_.Eb,a)}ba(a){XI(this,_.Lb,a)}ab(a){XI(this,_.Fb,a)}Qb(a){XI(this,_.Hb,a)}R(a){this.pause();XI(this,_.zb,a)}Y(a){XI(this,_.Ib,a);YI(this)}V(a){XI(this,_.Cb,a)}Ya(a){XI(this,_.Ab,a);YI(this)}qc(){const a=this;return _.y(function*(){a.C=!0;if(UI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.an(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
13
+ ZI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());XI(a,_.xb)})}kc(){this.K=!0}oc(){this.B=!0;this.j.contentComplete()}load(){const a=this;return _.y(function*(){var b=a.l;const c=a.H;try{if(typeof c.adTagUrl!==_.pe)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.J.canPlay(!1);const d=yield a.J.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
14
+ a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(e);return a.f})}start(a){const b=this;return _.y(function*(){b.a&&b.h&&!b.G?b.h.Kb()?yield aJ(b):yield bJ(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.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>
15
+ {this.G&&this.h&&this.h.hb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Of(this.o,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.j.contentComplete()})).then(()=>{ZI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};fJ.prototype.getPosition=fJ.prototype.getPosition;
16
+ fJ.prototype.setVolume=fJ.prototype.setVolume;fJ.prototype.getVolume=fJ.prototype.getVolume;fJ.prototype.skip=fJ.prototype.skip;fJ.prototype.pause=fJ.prototype.pause;fJ.prototype.resume=fJ.prototype.resume;var gJ=class extends _.fq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(cJ())return a.onError(new _.H(1,9,1E4));this.f=_.gm(_.Rc,{"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(_.ma);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)}Lf(){return this.a}Jf(){return this.g}rc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",gJ);gJ.prototype.getAdContainer=gJ.prototype.rc;gJ.prototype.getAdDisplayContainer=gJ.prototype.Jf;gJ.prototype.getAdsLoader=gJ.prototype.Lf;gJ.Id="ima";gJ.isSdkMissing=cJ;_.Nm(new class{create(){return new gJ}});var hJ=class{constructor(){this.a=new _.Q(SI)}name(){return SI}ea(a,b){return a.namespace()===_.Bc?!1:cJ()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new fJ(a)}};hJ.prototype.create=hJ.prototype.create;hJ.prototype.isSupported=hJ.prototype.ea;hJ.prototype.name=hJ.prototype.name;_.dm(new hJ);};f.call(g, window);