@castlabs/prestoplay 6.33.0 → 6.34.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 (65) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +19 -19
  5. package/cjs/cl.cast.js +129 -129
  6. package/cjs/cl.conviva.js +31 -31
  7. package/cjs/cl.core.js +635 -624
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +101 -101
  10. package/cjs/cl.externs.js +49 -74
  11. package/cjs/cl.freewheel.js +26 -26
  12. package/cjs/cl.hls.js +76 -76
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +26 -26
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +356 -353
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -5
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +71 -71
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +72 -72
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +11 -11
  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 +39 -39
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +14 -14
  36. package/cl.cast.js +100 -100
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +513 -502
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +90 -90
  41. package/cl.externs.js +52 -65
  42. package/cl.freewheel.js +20 -20
  43. package/cl.hls.js +82 -82
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +20 -20
  47. package/cl.mediatailor.js +2 -2
  48. package/cl.mse.js +306 -306
  49. package/cl.muxdata.js +13 -13
  50. package/cl.onboard.js +5 -5
  51. package/cl.persistent.js +10 -10
  52. package/cl.playlist.js +5 -5
  53. package/cl.simid.js +14 -14
  54. package/cl.smooth.js +61 -61
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +57 -57
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -3
  63. package/cl.youbora.js +31 -31
  64. package/package.json +1 -1
  65. package/typings.d.ts +57 -171
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ # 6.34.0
2
+
3
+ ## New Features
4
+
5
+ * Add ABR stalled segment cancellation.
6
+ * Improved ABR performance by cancelling long running segment requests.
7
+ * Add SVTA error codes.
8
+ * Add support for Broadpeak session options configuration.
9
+
10
+ ## Changes
11
+
12
+ * Ignore autoplay attribute if found on `<video>` element. Autoplay should be
13
+ configured in player configuration.
14
+ * Fix track selection by preferred language (`preferredTextLanguage`, `preferredAudioLanguage`)
15
+ on Safari (native player) in case of tracks with regional variants of the same
16
+ language (e.g. es, es-ES, es-MX).
17
+ * Fix text track selection and track IDs on Safari 16.
18
+ * Sort text and audio tracks on Safari by `NAME`.
19
+ * Fix `preferredTextLanguage` selection of subtitles by language on Safari.
20
+
1
21
  # 6.33.0
2
22
 
3
23
  ## New Features
@@ -26,6 +46,8 @@
26
46
 
27
47
  * Send `Content-Type: application/octet-stream` HTTP header with Widevine
28
48
  DRM requests.
49
+ * Optimize DASH segment handling by creating `SegmentTemplate` and
50
+ `SegmentList` segment references on demand.
29
51
  * Add `ReceiverConfiguration` to `start()` method of `clpp.cast.Receiver`.
30
52
  It is now possible to configure the player engine used under the hood
31
53
  by the Chromecast Receiver SDK.
package/cjs/cl.adobe.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var WX=function(){this.m=this.f=null;this.a="";this.g=new _.L("clpp.adobe.AdobePlugin")},ZX=function(a){a.f=new _.ti;a.f.on(a.m,_.Ig,function(){return XX(a)});a.f.on(a.m,_.Hg,function(){s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Ie,function(){return YX(a)});a.f.on(a.m,_.gg,function(b){b=b.detail;switch(b.currentState){case 3:a.a.length||YX(a);s.Media.play(a.a,a.m.getPosition());break;case 4:case 2:XX(a);break;case 5:case _.dp:case _.xo:a.g.info("Close session for "+a.a+" in player state "+
3
- (b.currentState+".")),XX(a),s.Media.close(a.a),a.a=""}})},YX=function(a){var b=a.m.$a();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.m.getDuration());s.Media.open(a.a,a.m.getDuration(),_.Aa)},XX=function(a){s.Media.stop(a.a,a.m.getPosition())},$X=function(){};_.w(WX,_.Yv);WX.prototype.onPlayerCreated=function(a){var b=a.getConfiguration().adobe;b&&!1===b.enabled?this.g.debug("Adobe plugin is disabled."):window.s&&s.Media?(this.m=a,ZX(this)):this.g.warn("Adobe API not available.")};
4
- WX.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""};WX.prototype.id=function(){return"adobe"};_.K("clpp.adobe.AdobeAnalyticsPlugin",WX);WX.Id="adobe";$X.prototype.create=function(){return new WX};_.Yo(new $X);};
2
+ var f=function(window){var dY=function(){this.m=this.f=null;this.a="";this.g=new _.L("clpp.adobe.AdobePlugin")},gY=function(a){a.f=new _.ki;a.f.on(a.m,_.Fg,function(){return eY(a)});a.f.on(a.m,_.Eg,function(){s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Fe,function(){return fY(a)});a.f.on(a.m,_.uf,function(b){b=b.detail;switch(b.currentState){case 8:a.a.length||fY(a);s.Media.play(a.a,a.m.getPosition());break;case 10:case 6:eY(a);break;case 11:case 0:case 3:a.g.info("Close session for "+a.a+" in player state "+(b.currentState+
3
+ ".")),eY(a),s.Media.close(a.a),a.a=""}})},fY=function(a){var b=a.m.ab();a.a=b?b.name||b.url:"";a.g.info("Open session for "+a.a+" with duration "+a.m.getDuration());s.Media.open(a.a,a.m.getDuration(),_.Ba)},eY=function(a){s.Media.stop(a.a,a.m.getPosition())},hY=function(){};_.w(dY,_.hw);dY.prototype.onPlayerCreated=function(a){var b=a.getConfiguration().adobe;b&&!1===b.enabled?this.g.debug("Adobe plugin is disabled."):window.s&&s.Media?(this.m=a,gY(this)):this.g.warn("Adobe API not available.")};
4
+ dY.prototype.onPlayerWillDestroy=function(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""};dY.prototype.id=function(){return"adobe"};_.J("clpp.adobe.AdobeAnalyticsPlugin",dY);dY.Id="adobe";hY.prototype.create=function(){return new dY};_.eu(new hY);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.airplay.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var UX=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.bj(function(){a.m.play()["catch"](function(){})});this.h=new _.ti},VX=function(){};_.w(UX,_.Yv);_.r=UX.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.r.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.Dn.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.no.bind(this)))};
3
- _.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.Dn=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.Q(_.Fc,{canCast:this.f}))};_.r.no=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Ec:_.Dc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play()["catch"](function(){}):this.o.ia(.01);this.m.trigger(new _.Q(a))};_.r.Ea=function(){return this.j};
4
- _.r.Bd=function(){return this.f};_.r.$o=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.K("clpp.airplay.AirPlayPlugin",UX);UX.prototype.showCastMenu=UX.prototype.$o;UX.prototype.canCast=UX.prototype.Bd;UX.prototype.isCasting=UX.prototype.Ea;UX.Id="airplay";VX.prototype.create=function(){return new UX};_.Yo(new VX);};
2
+ var f=function(window){var bY=function(){var a=this;this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Wh(function(){a.m.play()["catch"](function(){})});this.h=new _.ki},cY=function(){};_.w(bY,_.hw);_.r=bY.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.a=a.getSurface().getMedia()};_.r.onContentWillLoad=function(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.Dn.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.no.bind(this)))};
3
+ _.r.onPlayerWillRelease=function(){this.o.stop();this.h.release()};_.r.id=function(){return"airplay"};_.r.Dn=function(a){switch(a.availability){case "available":this.f=!0;break;case "not-available":this.f=!1}this.m.trigger(new _.R(_.Gc,{canCast:this.f}))};_.r.no=function(){var a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Fc:_.Ec;if(this.l||!this.m.isPaused()||8===this.m.getPlayerState())this.l?this.m.play()["catch"](function(){}):this.o.ia(.01);this.m.trigger(new _.R(a))};_.r.Da=function(){return this.j};
4
+ _.r.zd=function(){return this.f};_.r.$o=function(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())};_.J("clpp.airplay.AirPlayPlugin",bY);bY.prototype.showCastMenu=bY.prototype.$o;bY.prototype.canCast=bY.prototype.zd;bY.prototype.isCasting=bY.prototype.Da;bY.Id="airplay";cY.prototype.create=function(){return new bY};_.eu(new cY);};
5
5
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
6
6
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
7
7
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,23 +1,23 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var HX=function(a,b,c){this.a=a||{};this.f=b||{};this.w=c||0;this.o=0;this.l=this.j=this.h=!1},IX=function(a,b){this.m=a;this.f=b;this.a=new _.ti;this.h=!1},JX=function(a){this.m=a;this.l=new _.ti;this.h=this.j=this.f=this.a=null;this.o=this.yn.bind(this)},KX=function(a){var b=a.m.getSurface().getMedia();b&&(a.h=a.mo.bind(a),b.addEventListener("click",a.h))},LX=function(a){a.l.off(a.m,_.xg,a.o)},MX=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.f=_.Ij();d.a=0;return d}_.w(b,
3
- GenericPlayerApi);b.prototype.getPlayerName=function(){return _.Aa};b.prototype.getVersion=function(){return _.ja};b.prototype.getOSName=function(){return this.f.os};b.prototype.getDeviceVersion=function(){return this.f.osVersion.name};b.prototype.getDeviceType=function(){return"browser"};b.prototype.getTotalDuration=function(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){var c=1E3*this.m.getPosition();return 5===this.m.getState()?Math.max(c,
4
- this.a):c};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};b.prototype.getCapabilities=function(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}};return new b(a)},NX=function(){this.o=this.f=this.a=this.h=this.m=null;this.w=new _.ti;this.l=!1;this.j=null},OX=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof f===
5
- _.jg&&a.h.setUUID(f))},PX=function(a,b,c){var d=c.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(var e in d)a.a.setCustomParameter(e,d[e]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.ne,a.Fk.bind(a));a.o=MX(b);a.a.attachPlayer(a.o)},QX=function(a,b){_.wi(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},RX=function(){return!window.SmartLib||!window.GenericPlayerApi},
6
- SX=function(){},TX=function(){};_.r=HX.prototype;_.r.kb=function(){return"Broadpeak"};_.r.lb=function(){return""};_.r.ob=function(){return 1};_.r.getId=function(){return this.a.adId};_.r.getCreativeId=function(){return this.a.creativeId};_.r.Jb=function(){return null};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return""};_.r.getDuration=function(){return 0>=this.a.duration?-1:this.a.duration/1E3};
7
- _.r.getPosition=function(){return this.o};_.r.setPosition=function(a){this.o=a};_.r.getSkipTimeOffset=function(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3};_.r.Lb=function(){return!1};_.r.Za=function(){return this.a.clickURL};_.r.getMediaUrl=function(){return null};_.r.eb=function(){return 0};_.r.cb=function(){return 0};_.r.Ga=function(){return 0};_.r.Ha=function(){return 0===this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?2:1};
8
- _.r.getPodIndex=function(){return 1};_.r.zb=function(){return this.f.startPosition/1E3};_.r.nb=function(){return this.a.index+1};_.r.fb=function(){return 0>=this.f.adCount?-1:this.f.adCount};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.Kb=function(){return null};_.r.canSeek=function(){return!1};HX.prototype.canSeek=HX.prototype.canSeek;HX.prototype.getVideoElement=HX.prototype.Kb;
9
- HX.prototype.getWrapperCreativeIds=HX.prototype.getWrapperCreativeIds;HX.prototype.getWrapperAdSystems=HX.prototype.getWrapperAdSystems;HX.prototype.getWrapperAdIds=HX.prototype.getWrapperAdIds;HX.prototype.getSequenceLength=HX.prototype.fb;HX.prototype.getPositionInSequence=HX.prototype.nb;HX.prototype.getPodTimeOffset=HX.prototype.zb;HX.prototype.getPodIndex=HX.prototype.getPodIndex;HX.prototype.getPodType=HX.prototype.Ha;HX.prototype.getMediaBitrate=HX.prototype.Ga;
10
- HX.prototype.getMediaHeight=HX.prototype.cb;HX.prototype.getMediaWidth=HX.prototype.eb;HX.prototype.getMediaUrl=HX.prototype.getMediaUrl;HX.prototype.getClickThroughUrl=HX.prototype.Za;HX.prototype.isBumper=HX.prototype.Lb;HX.prototype.getSkipTimeOffset=HX.prototype.getSkipTimeOffset;HX.prototype.getPosition=HX.prototype.getPosition;HX.prototype.getDuration=HX.prototype.getDuration;HX.prototype.getTitle=HX.prototype.getTitle;HX.prototype.getAdvertiserName=HX.prototype.getAdvertiserName;
11
- HX.prototype.getAdSystem=HX.prototype.getAdSystem;HX.prototype.getApiFramework=HX.prototype.getApiFramework;HX.prototype.getSourceId=HX.prototype.Jb;HX.prototype.getCreativeId=HX.prototype.getCreativeId;HX.prototype.getId=HX.prototype.getId;HX.prototype.getTechnology=HX.prototype.ob;HX.prototype.getAdManagerVersion=HX.prototype.lb;HX.prototype.getAdManagerName=HX.prototype.kb;_.r=IX.prototype;_.r.init=function(){var a=this.m,b=this.a;b.on(a,_.gg,this.Ik.bind(this));b.on(a,_.$c,this.Gk.bind(this));b.on(a,"seek",this.Hk.bind(this))};_.r.Gk=function(a){a=a.detail;typeof a.bandwidth===_.h&&this.f.notifyLayerSwitch(a.bandwidth/1E3)};_.r.Ik=function(a){var b=this.m,c=this.f;a=a.detail;var d=a.currentState;2===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 2:c.notifyStallStart();break;case 3:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case 4:c.notifyPause()}};
12
- _.r.Hk=function(){var a=1E3*this.m.getPosition();this.f.notifySeek(a)};_.r.release=function(){this.a&&(_.wi(this.a),this.a=null)};_.r=JX.prototype;
13
- _.r.initialize=function(a,b){var c=this;this.j=a;a.activateAdvertising();KX(this);for(var d in b)a.setAdParameter(d,b[d]);a.setAdEventsListener({onAdBreakBegin:function(){c.m.trigger(new _.Q(_.fc,{ad:null}));c.l.on(c.m,_.xg,c.o)},onAdBegin:function(e,f){c.f=e;c.a=new HX(e,f,1E3*c.m.getDuration());c.m.trigger(new _.Q(_.yc,{ad:c.a}))},onAdSkippable:function(){},onAdEnd:function(){if(c.a){var e={ad:c.a};c.m.trigger(new _.Q(_.jc,e));c.m.trigger(new _.Q(_.zc,e));c.a=null;c.f=null}},onAdBreakEnd:function(){LX(c);c.m.trigger(new _.Q(_.gc));
14
- c.a=null}})};_.r.mo=function(){if(this.a&&this.j){var a=this.a.Za();a&&(this.j.adUserInteraction("click"),this.m.trigger(new _.Q(_.ic,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}};
15
- _.r.yn=function(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.Q(_.uc,{ad:this.a})),!this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.Q(_.kc,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.Q(_.qc,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.Q(_.Ac,{ad:this.a}))))}};_.r.load=function(){return Promise.resolve()};_.r.Cb=function(){return!0};_.r.Uc=function(){};
16
- _.r.Rc=function(){return!0};_.r.skip=function(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,LX(this),this.m.trigger(new _.Q(_.xc,{ad:b})),this.m.setPosition(a))}};_.r.qb=function(){};_.r.isPaused=function(){};_.r.pause=function(){};_.r.resume=function(){};_.r.getAdVolume=function(){return 0};_.r.Oa=function(){};_.r.getVolume=function(){return 0};_.r.setVolume=function(){};_.r.setMuted=function(){};
17
- _.r.isMuted=function(){return!1};_.r.Ab=function(){return!1};_.r.getPosition=function(){return this.a?this.a.getPosition():-1};_.r.Cc=function(){LX(this);this.l.release();var a=this.m.getSurface().getMedia();a&&this.h&&(a.removeEventListener("click",this.h),this.h=null);this.j=this.f=this.a=null;return Promise.resolve()};JX.prototype.getPosition=JX.prototype.getPosition;JX.prototype.setVolume=JX.prototype.setVolume;JX.prototype.getVolume=JX.prototype.getVolume;JX.prototype.resume=JX.prototype.resume;
18
- JX.prototype.pause=JX.prototype.pause;JX.prototype.skip=JX.prototype.skip;_.w(NX,_.Yv);_.r=NX.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(RX())return a.onError(new _.N(1,9,11E3));this.l=!0;OX(this,d);PX(this,a,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.N(1,9,11001,{bpkErrorCode:f,message:e}));QX(c,void 0)}else b.url=e.getURL(),c.f=new IX(c.m,c.o),c.f.init()})}};
19
- _.r.onContentLoaded=function(){!1!==this.l&&this.a.precacheEnded()};_.r.Fk=function(a){a=a.detail;if(7003===a.code)QX(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.P)switch(a.category){case 3:QX(this,SmartLib.BPDecodingError);break;case 1:QX(this,SmartLib.BPNetworkingError);break;case 6:QX(this,SmartLib.BPAccessRightError);break;default:QX(this,SmartLib.BPUnspecifiedError)}};_.r.onPlayerWillRelease=function(){this.j=null;RX()||QX(this,SmartLib.BPSessionEndsNormally);this.l=!1};
20
- _.r.id=function(){return"broadpeak"};_.K("clpp.broadpeak.BroadpeakPlugin",NX);NX.isSdkMissing=RX;NX.Id="broadpeak";SX.prototype.create=function(){return new NX};TX.prototype.name=function(){return"clpp.broadpeak.AdsManagerFactory"};TX.prototype.a=function(a,b){return RX()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)};TX.prototype.create=function(a){return new JX(a)};_.Yo(new SX);_.ai(new TX);};
2
+ var f=function(window){var PX=function(a,b,c){this.a=a||{};this.f=b||{};this.w=c||0;this.o=0;this.l=this.j=this.h=!1},QX=function(a,b){this.m=a;this.a=b;this.f=new _.ki;this.h=!1},RX=function(a){this.m=a;this.l=new _.ki;this.h=this.j=this.f=this.a=null;this.o=this.yn.bind(this)},SX=function(a){var b=a.m.getSurface().getMedia();b&&(a.h=a.mo.bind(a),b.addEventListener("click",a.h))},TX=function(a){a.l.off(a.m,_.ug,a.o)},UX=function(a){function b(c){var d=GenericPlayerApi.call(this)||this;d.m=c;d.f=_.Si();d.a=0;return d}_.w(b,
3
+ GenericPlayerApi);b.prototype.getPlayerName=function(){return _.Ba};b.prototype.getVersion=function(){return _.ja};b.prototype.getOSName=function(){return this.f.os};b.prototype.getDeviceVersion=function(){return this.f.osVersion.name};b.prototype.getDeviceType=function(){return"browser"};b.prototype.getTotalDuration=function(){return this.m.isLive()?0:this.a=1E3*this.m.getDuration()};b.prototype.getCurrentPosition=function(){var c=1E3*this.m.getPosition();return 11===this.m.getPlayerState()?Math.max(c,
4
+ this.a):c};b.prototype.getCurrentBitrate=function(){var c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3};b.prototype.getCapabilities=function(){return{adTracking:this.m.getConfiguration().broadpeak.adTracking}};return new b(a)},VX=function(){this.o=this.f=this.a=this.h=this.m=null;this.w=new _.ki;this.l=!1;this.j=null},WX=function(a,b){var c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"",f=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof f===
5
+ _.hg&&a.h.setUUID(f))},XX=function(a,b,c){var d=c.customParameters||{},e=a.h.createStreamingSession();a.a=e;var f=c.sessionOptions||{},g;for(g in f){var k=f[g];if(null!=k){var l=Number(g);Number.isNaN(l)||e.setOption(l,k)}}null==f[StreamingSessionOptions.SESSION_PRECACHE]&&e.setOption(StreamingSessionOptions.SESSION_PRECACHE,!1);for(var m in d)a.a.setCustomParameter(m,d[m]);c.adTracking&&(a.j=b.getAdsManager(),a.j.initialize(a.a,c.adParameters||{}));a.w.on(b,_.le,a.Fk.bind(a));a.o=UX(b);a.a.attachPlayer(a.o)},
6
+ YX=function(a,b){_.ni(a.w);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},ZX=function(){return!window.SmartLib||!window.GenericPlayerApi},$X=function(){},aY=function(){};_.r=PX.prototype;_.r.lb=function(){return"Broadpeak"};_.r.nb=function(){return""};_.r.pb=function(){return 1};_.r.getId=function(){return this.a.adId};_.r.getCreativeId=function(){return this.a.creativeId};_.r.Ib=function(){return null};_.r.getApiFramework=function(){return null};_.r.getAdSystem=function(){return""};
7
+ _.r.getAdvertiserName=function(){return""};_.r.getTitle=function(){return""};_.r.getDuration=function(){return 0>=this.a.duration?-1:this.a.duration/1E3};_.r.getPosition=function(){return this.o};_.r.setPosition=function(a){this.o=a};_.r.getSkipTimeOffset=function(){return 0===this.a.skipPosition?-1:(this.a.skipPosition-this.a.startPosition)/1E3};_.r.Kb=function(){return!1};_.r.$a=function(){return this.a.clickURL};_.r.getMediaUrl=function(){return null};_.r.fb=function(){return 0};_.r.eb=function(){return 0};
8
+ _.r.Ga=function(){return 0};_.r.Ha=function(){return 0===this.f.startPosition?0:0<this.w&&this.f.startPosition+this.f.duration>=this.w?_.Bk:_.Ek};_.r.getPodIndex=function(){return 1};_.r.yb=function(){return this.f.startPosition/1E3};_.r.ob=function(){return this.a.index+1};_.r.gb=function(){return 0>=this.f.adCount?-1:this.f.adCount};_.r.getWrapperAdIds=function(){return[]};_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.Jb=function(){return null};
9
+ _.r.canSeek=function(){return!1};PX.prototype.canSeek=PX.prototype.canSeek;PX.prototype.getVideoElement=PX.prototype.Jb;PX.prototype.getWrapperCreativeIds=PX.prototype.getWrapperCreativeIds;PX.prototype.getWrapperAdSystems=PX.prototype.getWrapperAdSystems;PX.prototype.getWrapperAdIds=PX.prototype.getWrapperAdIds;PX.prototype.getSequenceLength=PX.prototype.gb;PX.prototype.getPositionInSequence=PX.prototype.ob;PX.prototype.getPodTimeOffset=PX.prototype.yb;PX.prototype.getPodIndex=PX.prototype.getPodIndex;
10
+ PX.prototype.getPodType=PX.prototype.Ha;PX.prototype.getMediaBitrate=PX.prototype.Ga;PX.prototype.getMediaHeight=PX.prototype.eb;PX.prototype.getMediaWidth=PX.prototype.fb;PX.prototype.getMediaUrl=PX.prototype.getMediaUrl;PX.prototype.getClickThroughUrl=PX.prototype.$a;PX.prototype.isBumper=PX.prototype.Kb;PX.prototype.getSkipTimeOffset=PX.prototype.getSkipTimeOffset;PX.prototype.getPosition=PX.prototype.getPosition;PX.prototype.getDuration=PX.prototype.getDuration;PX.prototype.getTitle=PX.prototype.getTitle;
11
+ PX.prototype.getAdvertiserName=PX.prototype.getAdvertiserName;PX.prototype.getAdSystem=PX.prototype.getAdSystem;PX.prototype.getApiFramework=PX.prototype.getApiFramework;PX.prototype.getSourceId=PX.prototype.Ib;PX.prototype.getCreativeId=PX.prototype.getCreativeId;PX.prototype.getId=PX.prototype.getId;PX.prototype.getTechnology=PX.prototype.pb;PX.prototype.getAdManagerVersion=PX.prototype.nb;PX.prototype.getAdManagerName=PX.prototype.lb;_.r=QX.prototype;_.r.init=function(){var a=this.m,b=this.f;b.on(a,_.uf,this.Ik.bind(this));b.on(a,_.ad,this.Gk.bind(this));b.on(a,"seek",this.Hk.bind(this))};_.r.Gk=function(a){a=a.detail;typeof a.bandwidth===_.h&&this.a.notifyLayerSwitch(a.bandwidth/1E3)};
12
+ _.r.Ik=function(a){var b=this.m,c=this.a;a=a.detail;var d=a.currentState;6===a.previousState&&c.notifyStallEnd(!b.isPaused());switch(d){case 6:c.notifyStallStart();break;case 8:this.h?c.notifyResume():(this.a.notifyFirstImage(),this.h=!0);break;case 10:this.h||(this.a.notifyFirstImage(),this.h=!0),c.notifyPause()}};_.r.Hk=function(){var a=1E3*this.m.getPosition();this.a.notifySeek(a)};_.r.release=function(){this.f&&(_.ni(this.f),this.f=null)};_.r=RX.prototype;
13
+ _.r.initialize=function(a,b){var c=this;this.j=a;a.activateAdvertising();SX(this);for(var d in b)a.setAdParameter(d,b[d]);a.setAdEventsListener({onAdBreakBegin:function(){c.m.trigger(new _.R(_.gc,{ad:null}));c.l.on(c.m,_.ug,c.o)},onAdBegin:function(e,f){c.f=e;c.a=new PX(e,f,1E3*c.m.getDuration());c.m.trigger(new _.R(_.xc,{ad:c.a}))},onAdSkippable:function(){},onAdEnd:function(){if(c.a){var e={ad:c.a};c.m.trigger(new _.R(_.kc,e));c.m.trigger(new _.R(_.zc,e));c.a=null;c.f=null}},onAdBreakEnd:function(){TX(c);c.m.trigger(new _.R(_.hc));
14
+ c.a=null}})};_.r.mo=function(){if(this.a&&this.j){var a=this.a.$a();a&&(this.j.adUserInteraction("click"),this.m.trigger(new _.R(_.jc,{ad:this.a})),this.m.pause(),(a=window.open(a,"_blank"))&&a.focus())}};
15
+ _.r.yn=function(){if(this.a&&this.f){var a=this.m.getPosition()-this.f.startPosition/1E3,b=this.a.getDuration();0<b&&a>b||(this.a.setPosition(a),this.m.trigger(new _.R(_.uc,{ad:this.a})),!this.a.h&&a>=b/4&&(this.a.h=!0,this.m.trigger(new _.R(_.lc,{ad:this.a}))),!this.a.j&&a>=b/2&&(this.a.j=!0,this.m.trigger(new _.R(_.rc,{ad:this.a}))),!this.a.l&&a>=3*b/4&&(this.a.l=!0,this.m.trigger(new _.R(_.Bc,{ad:this.a}))))}};_.r.load=function(){return Promise.resolve()};_.r.Bb=function(){return!0};_.r.Sc=function(){};
16
+ _.r.Pc=function(){return!0};_.r.skip=function(){if(this.a){var a=this.a.getPosition(),b=this.a.getSkipTimeOffset();-1===b||a<b||(a=this.m.getPosition()-a+this.a.getDuration(),b=this.a,this.f=this.a=null,TX(this),this.m.trigger(new _.R(_.wc,{ad:b})),this.m.setPosition(a))}};_.r.Sa=function(){};_.r.isPaused=function(){};_.r.pause=function(){};_.r.resume=function(){};_.r.getAdVolume=function(){return 0};_.r.Pa=function(){};_.r.getVolume=function(){return 0};_.r.setVolume=function(){};_.r.setMuted=function(){};
17
+ _.r.isMuted=function(){return!1};_.r.zb=function(){return!1};_.r.getPosition=function(){return this.a?this.a.getPosition():-1};_.r.Ac=function(){TX(this);this.l.release();var a=this.m.getSurface().getMedia();a&&this.h&&(a.removeEventListener("click",this.h),this.h=null);this.j=this.f=this.a=null;return Promise.resolve()};RX.prototype.getPosition=RX.prototype.getPosition;RX.prototype.setVolume=RX.prototype.setVolume;RX.prototype.getVolume=RX.prototype.getVolume;RX.prototype.resume=RX.prototype.resume;
18
+ RX.prototype.pause=RX.prototype.pause;RX.prototype.skip=RX.prototype.skip;_.w(VX,_.hw);_.r=VX.prototype;_.r.onPlayerCreated=function(a){this.m=a};_.r.onContentWillLoad=function(a,b){var c=this,d=a.getConfiguration().broadpeak;if(d){if(ZX())return a.onError(new _.O(1,9,11E3));this.l=!0;WX(this,d);XX(this,a,d);return this.a.getURL(b.url).then(function(e){if(e.isError()){var f=e.getDetailedErrorCode();e=e.getDetailedErrorMessage();c.m.onError(new _.O(1,9,11001,{bpkErrorCode:f,message:e}));YX(c,void 0)}else b.url=e.getURL(),c.f=new QX(c.m,c.o),c.f.init()})}};
19
+ _.r.onContentLoaded=function(){!1!==this.l&&this.a.precacheEnded()};_.r.Fk=function(a){a=a.detail;if(7003===a.code)YX(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.Q)switch(a.category){case 3:YX(this,SmartLib.BPDecodingError);break;case 1:YX(this,SmartLib.BPNetworkingError);break;case 6:YX(this,SmartLib.BPAccessRightError);break;default:YX(this,SmartLib.BPUnspecifiedError)}};_.r.onPlayerWillRelease=function(){this.j=null;ZX()||YX(this,SmartLib.BPSessionEndsNormally);this.l=!1};
20
+ _.r.id=function(){return"broadpeak"};_.J("clpp.broadpeak.BroadpeakPlugin",VX);VX.isSdkMissing=ZX;VX.Id="broadpeak";$X.prototype.create=function(){return new VX};aY.prototype.name=function(){return"clpp.broadpeak.AdsManagerFactory"};aY.prototype.a=function(a,b){return ZX()?!1:!!(b&&b.broadpeak&&b.broadpeak.adTracking)};aY.prototype.create=function(a){return new RX(a)};_.eu(new $X);_.Yq(new aY);};
21
21
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
22
22
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
23
23
  else{_=this.clpp._;(f.call(g,this));}