@castlabs/prestoplay 6.26.0 → 6.28.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 (68) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +115 -113
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +623 -623
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +89 -89
  10. package/cjs/cl.externs.js +112 -72
  11. package/cjs/cl.freewheel.js +25 -25
  12. package/cjs/cl.hls.js +78 -77
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +23 -24
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +353 -345
  18. package/cjs/cl.muxdata.js +14 -15
  19. package/cjs/cl.onboard.js +4 -3
  20. package/cjs/cl.persistent.js +15 -15
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -17
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +73 -72
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +38 -38
  33. package/cjs/polyfill.min.js +15 -3
  34. package/cl.adobe.js +3 -3
  35. package/cl.airplay.js +3 -3
  36. package/cl.broadpeak.js +6 -5
  37. package/cl.cast.js +93 -90
  38. package/cl.conviva.js +27 -27
  39. package/cl.core.js +506 -507
  40. package/cl.crypto.js +9 -9
  41. package/cl.dash.js +83 -82
  42. package/cl.externs.js +112 -72
  43. package/cl.freewheel.js +19 -19
  44. package/cl.hls.js +80 -79
  45. package/cl.hlssmpte.js +5 -5
  46. package/cl.htmlcue.js +26 -26
  47. package/cl.ima.js +17 -17
  48. package/cl.mediatailor.js +2 -3
  49. package/cl.mse.js +308 -305
  50. package/cl.muxdata.js +13 -13
  51. package/cl.onboard.js +4 -4
  52. package/cl.persistent.js +11 -11
  53. package/cl.playlist.js +5 -5
  54. package/cl.simid.js +14 -14
  55. package/cl.smooth.js +60 -60
  56. package/cl.thumbnails.js +19 -19
  57. package/cl.tizen.js +57 -57
  58. package/cl.ttml.js +22 -22
  59. package/cl.verimatrix.js +4 -4
  60. package/cl.vimond.js +8 -8
  61. package/cl.vr.js +15 -15
  62. package/cl.vtt.js +12 -12
  63. package/cl.yospace.js +3 -3
  64. package/cl.youbora.js +31 -29
  65. package/package.json +1 -1
  66. package/typings.d.ts +115 -63
  67. package/cjs/cl.sessions.js +0 -21
  68. package/cl.sessions.js +0 -10
package/cl.freewheel.js CHANGED
@@ -1,19 +1,19 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var aV="clpp-freewheel",bV="clpp.freewheel.AdsManagerFactory",cV="freewheel",dV=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},eV=function(a){const b=[];typeof a.networkId!==_.t&&b.push("networkId");typeof a.serverUrl!==_.Pf&&b.push("serverUrl");typeof a.profileId!==_.Pf&&b.push("profileId");typeof a.videoAssetId!==_.Pf&&typeof a.videoAssetId!==_.t&&b.push("videoAssetId");
2
- if(b.length)throw new _.I(1,9,12001,{missingKeys:b.join(", ")});},fV=function(){return _.x(function*(){var a=new _.Kv;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},gV=function(a){a.j.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.K.bind(a));a.j.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.M.bind(a));a.j.on(a.a,
3
- tv.freewheel.SDK.EVENT_SLOT_ENDED,a.L.bind(a));a.j.on(a.a,tv.freewheel.SDK.EVENT_AD,a.J.bind(a));a.j.on(a.m,_.ag,a.I.bind(a));a.j.on(a.m,_.Mf,a.H.bind(a))},jV=function(a){return _.x(function*(){a.G.length?(hV(a),a.f=a.G.shift(),a.f.play()):(iV(a),yield a.m.a.play())})},iV=function(a){const b=a.m.kd(cV).Pc();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},hV=function(a){const b=a.m.kd(cV).Pc();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(aV),
4
- a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},kV=function(a){a.F.length?(hV(a),a.f=a.F.shift(),a.f.play()):iV(a)},lV=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new Y(a.a,c,d)});a.m.trigger(new _.F(b,d))},mV=class extends _.Sv{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.rp(_.Cd,{id:aV}),this.f=_.rp(_.w,{"class":_.Zc}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,
5
- !0),a.getSurface().hide(this.a);else a.onError(new _.I(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return cV}Pc(){return this.a}xh(){return this.f}};_.z("clpp.freewheel.FreeWheelPlugin",mV);mV.prototype.getAdVideo=mV.prototype.xh;mV.prototype.getAdContainer=mV.prototype.Pc;mV.Id=cV;mV.AD_CONTAINER_ID=aV;_.Mr(new class{create(){return new mV}});var Y=class{constructor(a,b,c){this.h=a;this.f=b;this.a=c}ob(){return"FreeWheel AdManager SDK"}pb(){return tv.freewheel.SDK.version}ub(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.Pf?a:""}Qb(){return""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
6
- 0}getPosition(){return 0}getSkipTimeOffset(){return 0}Tb(){return!1}qb(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}fb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}eb(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}Qa(){return 0}Ra(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
7
- case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.Ra()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Hb(){switch(this.Ra()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}sb(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}gb(){return this.f.getAdCount()}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Sb(){return null}};
8
- Y.prototype.getVideoElement=Y.prototype.Sb;Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.gb;Y.prototype.getPositionInSequence=Y.prototype.sb;Y.prototype.getPodTimeOffset=Y.prototype.Hb;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ra;
9
- Y.prototype.getMediaBitrate=Y.prototype.Qa;Y.prototype.getMediaHeight=Y.prototype.eb;Y.prototype.getMediaWidth=Y.prototype.fb;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.qb;Y.prototype.isBumper=Y.prototype.Tb;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;
10
- Y.prototype.getAdSystem=Y.prototype.getAdSystem;Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getSourceId=Y.prototype.Qb;Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.ub;Y.prototype.getAdManagerVersion=Y.prototype.pb;Y.prototype.getAdManagerName=Y.prototype.ob;var nV=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(a=>{switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})}Kb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}Jb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
11
- nV.prototype.hasPostroll=nV.prototype.Jb;nV.prototype.hasPreroll=nV.prototype.Kb;nV.prototype.getCuePoints=nV.prototype.getCuePoints;var oV=class{constructor(a){this.g=new _.T("clpp.freewheel.AdsManager");this.m=a;this.j=new _.Rt;this.C=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.G=[];this.B=[];this.F=[];this.A=new _.Ij;this.w=null}load(){const a=this;return _.x(function*(){const b=a.m.getConfiguration().freewheel||{};try{eV(b)}catch(d){return a.m.onError(d),a.A.resolve(),a.A}a.C.setNetwork(b.networkId);a.C.setServer(b.serverUrl);a.a=a.C.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.Pf&&typeof b.siteSectionId!==
12
- _.t||a.a.setSiteSection(b.siteSectionId);const c=yield fV();a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,dV(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ee&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
13
- if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);gV(a);a.a.submitRequest();return a.A})}start(){const a=this;return _.x(function*(){yield jV(a)})}o(){}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}l(){return!0}h(){const a=this;return _.x(function*(){a.j.release();
14
- a.w&&(a.w.stop(),a.w=null);iV(a);a.a&&(a.a.dispose(),a.a=null)})}K(a){if(a.success)this.G=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.F=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.F(_.pc,{adsTimeline:new nV(this.a)})),this.w=new _.Iv(this.m.getSurface(),(b,c)=>this.a.resize(b,c),this.m.kd(cV).f);else this.m.onError(new _.I(1,
15
- 9,10003,{errorType:0},void 0));this.A.resolve()}M(a){lV(this,_.Sb,a);this.w.start()}L(a){this.f=null;a=a.slot;lV(this,_.Tb);this.w.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:jV(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:iV(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:kV(this)}}J(a){const b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:lV(this,_.hc,a);lV(this,
16
- _.ac,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:lV(this,_.lc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:lV(this,_.Xb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:lV(this,_.cc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:lV(this,_.nc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:lV(this,_.Wb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:lV(this,_.Vb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:lV(this,_.dc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:lV(this,
17
- _.fc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:lV(this,_.gc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:lV(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:lV(this,_.ec,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.I(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}I(){if(!this.f){var a=this.m.getPosition();if(this.f=this.B.find(b=>
18
- .5>Math.abs(a-b.getTimePosition()))||null){const b=this.B.findIndex(c=>c===this.f);this.B.splice(b,1);this.m.pause();hV(this);this.f.play()}}}H(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Zo:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Yo:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Oo:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);kV(this);break;case _.Wo:case _.Po:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};
19
- oV.prototype.getPosition=oV.prototype.getPosition;oV.prototype.setVolume=oV.prototype.setVolume;oV.prototype.getVolume=oV.prototype.getVolume;oV.prototype.skip=oV.prototype.skip;oV.prototype.pause=oV.prototype.pause;oV.prototype.resume=oV.prototype.resume;_.pp(new class{constructor(){this.Ta=new _.T(bV)}name(){return bV}a(a,b){return a.namespace()!==_.dd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.Ta.warn("FreeWheel SDK is not loaded."),!1):!1}create(a){return new oV(a)}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var YT="clpp-freewheel",ZT="clpp.freewheel.AdsManagerFactory",$T="freewheel",aU=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},bU=function(a){const b=[];typeof a.networkId!==_.r&&b.push("networkId");typeof a.serverUrl!==_.Sf&&b.push("serverUrl");typeof a.profileId!==_.Sf&&b.push("profileId");typeof a.videoAssetId!==_.Sf&&typeof a.videoAssetId!==_.r&&b.push("videoAssetId");
2
+ if(b.length)throw new _.H(1,9,12001,{missingKeys:b.join(", ")});},cU=function(){return _.w(function*(){var a=new _.yv;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},dU=function(a){a.j.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.K.bind(a));a.j.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.M.bind(a));a.j.on(a.a,
3
+ tv.freewheel.SDK.EVENT_SLOT_ENDED,a.L.bind(a));a.j.on(a.a,tv.freewheel.SDK.EVENT_AD,a.J.bind(a));a.j.on(a.m,_.eg,a.I.bind(a));a.j.on(a.m,_.Pf,a.H.bind(a))},gU=function(a){return _.w(function*(){a.G.length?(eU(a),a.f=a.G.shift(),a.f.play()):(fU(a),yield a.m.a.play())})},fU=function(a){const b=a.m.ed($T).Jc();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},eU=function(a){const b=a.m.ed($T).Jc();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(YT),
4
+ a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},hU=function(a){a.F.length?(eU(a),a.f=a.F.shift(),a.f.play()):fU(a)},iU=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new X(a.a,c,d)});a.m.trigger(new _.G(b,d))},jU=class extends _.Iv{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Ci(_.Dd,{id:YT}),this.f=_.Ci(_.t,{"class":_.ad}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,
5
+ !0),a.getSurface().hide(this.a);else a.onError(new _.H(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return $T}Jc(){return this.a}Ch(){return this.f}};_.x("clpp.freewheel.FreeWheelPlugin",jU);jU.prototype.getAdVideo=jU.prototype.Ch;jU.prototype.getAdContainer=jU.prototype.Jc;jU.Id=$T;jU.AD_CONTAINER_ID=YT;var kU=class{create(){return new jU}};var X=class{constructor(a,b,c){this.h=a;this.f=b;this.a=c}lb(){return"FreeWheel AdManager SDK"}nb(){return tv.freewheel.SDK.version}sb(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.Sf?a:""}Nb(){return""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
6
+ 0}getPosition(){return 0}getSkipTimeOffset(){return 0}Qb(){return!1}ob(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}cb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}bb(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}Na(){return 0}Oa(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
7
+ case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.Oa()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Fb(){switch(this.Oa()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}qb(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}eb(){return this.f.getAdCount()}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Pb(){return null}};
8
+ X.prototype.getVideoElement=X.prototype.Pb;X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.canSeek=X.prototype.canSeek;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.eb;X.prototype.getPositionInSequence=X.prototype.qb;X.prototype.getPodTimeOffset=X.prototype.Fb;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Oa;
9
+ X.prototype.getMediaBitrate=X.prototype.Na;X.prototype.getMediaHeight=X.prototype.bb;X.prototype.getMediaWidth=X.prototype.cb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.ob;X.prototype.isBumper=X.prototype.Qb;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getPosition=X.prototype.getPosition;X.prototype.getDuration=X.prototype.getDuration;X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;
10
+ X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getSourceId=X.prototype.Nb;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.sb;X.prototype.getAdManagerVersion=X.prototype.nb;X.prototype.getAdManagerName=X.prototype.lb;var lU=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(a=>{switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})}Hb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}Gb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
11
+ lU.prototype.hasPostroll=lU.prototype.Gb;lU.prototype.hasPreroll=lU.prototype.Hb;lU.prototype.getCuePoints=lU.prototype.getCuePoints;var mU=class{constructor(a){this.g=new _.S("clpp.freewheel.AdsManager");this.m=a;this.j=new _.Gt;this.C=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.G=[];this.B=[];this.F=[];this.A=new _.Tl;this.w=null}load(){const a=this;return _.w(function*(){const b=a.m.getConfiguration().freewheel||{};try{bU(b)}catch(d){return a.m.onError(d),a.A.resolve(),a.A}a.C.setNetwork(b.networkId);a.C.setServer(b.serverUrl);a.a=a.C.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.Sf&&typeof b.siteSectionId!==
12
+ _.r||a.a.setSiteSection(b.siteSectionId);const c=yield cU();a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,aU(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ge&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
13
+ if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);dU(a);a.a.submitRequest();return a.A})}start(){const a=this;return _.w(function*(){yield gU(a)})}o(){}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}l(){return!0}h(){const a=this;return _.w(function*(){a.j.release();
14
+ a.w&&(a.w.stop(),a.w=null);fU(a);a.a&&(a.a.dispose(),a.a=null)})}K(a){if(a.success)this.G=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.F=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.G(_.oc,{adsTimeline:new lU(this.a)})),this.w=new _.wv(this.m.getSurface(),(b,c)=>this.a.resize(b,c),this.m.ed($T).f);else this.m.onError(new _.H(1,
15
+ 9,10003,{errorType:0},void 0));this.A.resolve()}M(a){iU(this,_.Rb,a);this.w.start()}L(a){this.f=null;a=a.slot;iU(this,_.Sb);this.w.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:gU(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:fU(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:hU(this)}}J(a){const b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:iU(this,_.kc,a);iU(this,
16
+ _.cc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:iU(this,_.lc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:iU(this,_.Wb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:iU(this,_.fc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:iU(this,_.mc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:iU(this,_.Vb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:iU(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:iU(this,_.gc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:iU(this,
17
+ _.ic,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:iU(this,_.jc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:iU(this,_.Tb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:iU(this,_.hc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.H(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}I(){if(!this.f){var a=this.m.getPosition();if(this.f=this.B.find(b=>
18
+ .5>Math.abs(a-b.getTimePosition()))||null){const b=this.B.findIndex(c=>c===this.f);this.B.splice(b,1);this.m.pause();eU(this);this.f.play()}}}H(a){if((a=a.detail)&&this.a)switch(a.currentState){case 3:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case 4:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case 5:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);hU(this);break;case _.ts:case _.ks:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};
19
+ mU.prototype.getPosition=mU.prototype.getPosition;mU.prototype.setVolume=mU.prototype.setVolume;mU.prototype.getVolume=mU.prototype.getVolume;mU.prototype.skip=mU.prototype.skip;mU.prototype.pause=mU.prototype.pause;mU.prototype.resume=mU.prototype.resume;_.Eh(new class{constructor(){this.Qa=new _.S(ZT)}name(){return ZT}a(a,b){return a.namespace()!==_.fd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.Qa.warn("FreeWheel SDK is not loaded."),!1):!1}create(a){return new mU(a)}});_.Ln(new kU);};f.call(g, window);