@gcorevideo/player 2.22.20 → 2.22.22

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 (50) hide show
  1. package/assets/clappr-nerd-stats/clappr-nerd-stats.ejs +30 -30
  2. package/assets/clappr-nerd-stats/clappr-nerd-stats.scss +21 -14
  3. package/assets/level-selector/button.ejs +1 -1
  4. package/dist/core.js +1 -1
  5. package/dist/index.css +696 -688
  6. package/dist/index.js +271 -247
  7. package/dist/player.d.ts +57 -27
  8. package/dist/plugins/index.css +335 -327
  9. package/dist/plugins/index.js +109 -89
  10. package/docs/api/{player.bitratetrackrecord.md → player.clapprstatsbitratetrack.md} +3 -3
  11. package/docs/api/player.clapprstatsmetrics.md +2 -2
  12. package/docs/api/player.extendedevents.md +45 -0
  13. package/docs/api/player.gearevents.md +1 -1
  14. package/docs/api/player.md +22 -2
  15. package/docs/api/player.mediacontrol.mount.md +0 -5
  16. package/docs/api/player.mediacontrol.putelement.md +5 -0
  17. package/docs/api/player.mediacontrol.toggleelement.md +1 -1
  18. package/docs/api/player.volumefade._constructor_.md +50 -0
  19. package/docs/api/player.volumefade.md +40 -1
  20. package/docs/api/player.volumefadesettings.md +18 -0
  21. package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts +1 -0
  22. package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts.map +1 -1
  23. package/lib/plugins/clappr-nerd-stats/NerdStats.js +13 -3
  24. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -1
  25. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +1 -0
  26. package/lib/plugins/clappr-nerd-stats/speedtest/index.js +1 -1
  27. package/lib/plugins/clappr-nerd-stats/utils.d.ts.map +1 -1
  28. package/lib/plugins/clappr-nerd-stats/utils.js +17 -15
  29. package/lib/plugins/clappr-stats/ClapprStats.d.ts +1 -0
  30. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
  31. package/lib/plugins/clappr-stats/ClapprStats.js +3 -0
  32. package/lib/plugins/click-to-pause/ClickToPause.js +6 -7
  33. package/lib/plugins/media-control/MediaControl.d.ts +3 -0
  34. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  35. package/lib/plugins/media-control/MediaControl.js +6 -1
  36. package/lib/plugins/volume-fade/VolumeFade.d.ts +28 -11
  37. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  38. package/lib/plugins/volume-fade/VolumeFade.js +66 -61
  39. package/package.json +1 -1
  40. package/src/plugins/clappr-nerd-stats/NerdStats.ts +21 -8
  41. package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +1 -0
  42. package/src/plugins/clappr-nerd-stats/speedtest/index.ts +1 -1
  43. package/src/plugins/clappr-nerd-stats/utils.ts +23 -13
  44. package/src/plugins/clappr-stats/ClapprStats.ts +4 -0
  45. package/src/plugins/click-to-pause/ClickToPause.ts +6 -6
  46. package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +1 -1
  47. package/src/plugins/media-control/MediaControl.ts +6 -1
  48. package/src/plugins/volume-fade/VolumeFade.ts +96 -76
  49. package/temp/player.api.json +132 -34
  50. package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js CHANGED
@@ -12680,7 +12680,7 @@ var PlaybackEvents;
12680
12680
  // https://github.com/clappr/clappr/blob/8752995ea439321ac7ca3cd35e8c64de7a3c3d17/LICENSE
12681
12681
  const AUTO$1 = -1;
12682
12682
  const { now: now$2 } = Utils;
12683
- const T$k = 'playback.dash';
12683
+ const T$l = 'playback.dash';
12684
12684
  class DashPlayback extends BasePlayback {
12685
12685
  _levels = null;
12686
12686
  _currentLevel = null;
@@ -12955,10 +12955,10 @@ class DashPlayback extends BasePlayback {
12955
12955
  }
12956
12956
  _onPlaybackError = (event) => {
12957
12957
  // TODO
12958
- trace(`${T$k} _onPlaybackError`, { event });
12958
+ trace(`${T$l} _onPlaybackError`, { event });
12959
12959
  };
12960
12960
  _onDASHJSSError = (event) => {
12961
- trace(`${T$k} _onDASHJSSError`, { event });
12961
+ trace(`${T$l} _onDASHJSSError`, { event });
12962
12962
  this._stopTimeUpdateTimer();
12963
12963
  // Note that the other error types are deprecated
12964
12964
  const e = event.error;
@@ -12993,7 +12993,7 @@ class DashPlayback extends BasePlayback {
12993
12993
  }
12994
12994
  };
12995
12995
  triggerError(error) {
12996
- trace(`${T$k} triggerError`, { error });
12996
+ trace(`${T$l} triggerError`, { error });
12997
12997
  // this triggers Events.ERROR to be handled by the UI
12998
12998
  this.trigger(Events$1.PLAYBACK_ERROR, this.createError(error, {
12999
12999
  useCodePrefix: false,
@@ -13032,10 +13032,10 @@ class DashPlayback extends BasePlayback {
13032
13032
  }
13033
13033
  get dvrEnabled() {
13034
13034
  if (!this._dash) {
13035
- trace(`${T$k} dvrEnable no dash player instance`);
13035
+ trace(`${T$l} dvrEnable no dash player instance`);
13036
13036
  return false;
13037
13037
  }
13038
- trace(`${T$k} get.dvrEnabled`, {
13038
+ trace(`${T$l} get.dvrEnabled`, {
13039
13039
  dvrWindowSize: this._dash?.getDVRWindowSize(),
13040
13040
  minDvrSize: this._minDvrSize,
13041
13041
  playbackType: this.getPlaybackType(),
@@ -13057,7 +13057,7 @@ class DashPlayback extends BasePlayback {
13057
13057
  this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
13058
13058
  }
13059
13059
  play() {
13060
- trace(`${T$k} play`, { dash: !!this._dash });
13060
+ trace(`${T$l} play`, { dash: !!this._dash });
13061
13061
  if (!this._dash) {
13062
13062
  this._setup();
13063
13063
  }
@@ -13143,7 +13143,7 @@ class DashPlayback extends BasePlayback {
13143
13143
  }
13144
13144
  // @ts-expect-error
13145
13145
  get currentAudioTrack() {
13146
- trace(`${T$k} get currentAudioTrack`);
13146
+ trace(`${T$l} get currentAudioTrack`);
13147
13147
  assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
13148
13148
  const t = this._dash.getCurrentTrackFor('audio');
13149
13149
  if (!t) {
@@ -41844,7 +41844,7 @@ const AUTO = -1;
41844
41844
  const DEFAULT_RECOVER_ATTEMPTS = 16;
41845
41845
  Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
41846
41846
  Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
41847
- const T$j = 'playback.hls';
41847
+ const T$k = 'playback.hls';
41848
41848
  class HlsPlayback extends BasePlayback {
41849
41849
  _ccIsSetup = false;
41850
41850
  _ccTracksUpdated = false;
@@ -42073,7 +42073,7 @@ class HlsPlayback extends BasePlayback {
42073
42073
  maxBufferLength: 2,
42074
42074
  maxMaxBufferLength: 4,
42075
42075
  }, this.options.playback.hlsjsConfig);
42076
- trace(`${T$j} _createHLSInstance`, { config });
42076
+ trace(`${T$k} _createHLSInstance`, { config });
42077
42077
  this._hls = new Hls(config);
42078
42078
  }
42079
42079
  _attachHLSMedia() {
@@ -42164,7 +42164,7 @@ class HlsPlayback extends BasePlayback {
42164
42164
  }
42165
42165
  else {
42166
42166
  Log.error('hlsjs: failed to recover', { evt, data });
42167
- trace(`${T$j} _recover failed to recover`, {
42167
+ trace(`${T$k} _recover failed to recover`, {
42168
42168
  type: data.type,
42169
42169
  details: data.details,
42170
42170
  });
@@ -42250,7 +42250,7 @@ class HlsPlayback extends BasePlayback {
42250
42250
  this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
42251
42251
  }
42252
42252
  _onHLSJSError(evt, data) {
42253
- trace(`${T$j} _onHLSJSError`, {
42253
+ trace(`${T$k} _onHLSJSError`, {
42254
42254
  fatal: data.fatal,
42255
42255
  type: data.type,
42256
42256
  details: data.details,
@@ -42298,7 +42298,7 @@ class HlsPlayback extends BasePlayback {
42298
42298
  evt,
42299
42299
  data,
42300
42300
  });
42301
- trace(`${T$j} _onHLSJSError trying to recover from network error`, {
42301
+ trace(`${T$k} _onHLSJSError trying to recover from network error`, {
42302
42302
  details: data.details,
42303
42303
  });
42304
42304
  error.level = PlayerError.Levels.WARN;
@@ -42311,7 +42311,7 @@ class HlsPlayback extends BasePlayback {
42311
42311
  evt,
42312
42312
  data,
42313
42313
  });
42314
- trace(`${T$j} _onHLSJSError trying to recover from media error`, {
42314
+ trace(`${T$k} _onHLSJSError trying to recover from media error`, {
42315
42315
  details: data.details,
42316
42316
  });
42317
42317
  error.level = PlayerError.Levels.WARN;
@@ -42341,7 +42341,7 @@ class HlsPlayback extends BasePlayback {
42341
42341
  return;
42342
42342
  }
42343
42343
  Log.warn('hlsjs: non-fatal error occurred', { evt, data });
42344
- trace(`${T$j} _onHLSJSError non-fatal error occurred`, {
42344
+ trace(`${T$k} _onHLSJSError non-fatal error occurred`, {
42345
42345
  type: data.type,
42346
42346
  details: data.details,
42347
42347
  });
@@ -42675,11 +42675,11 @@ class HlsPlayback extends BasePlayback {
42675
42675
  this._hls.audioTrack = Number(id); // TODO or find index by .id == id?
42676
42676
  }
42677
42677
  _onAudioTracksUpdated(_, data) {
42678
- trace(`${T$j} onAudioTracksUpdated`);
42678
+ trace(`${T$k} onAudioTracksUpdated`);
42679
42679
  this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
42680
42680
  }
42681
42681
  _onAudioTrackSwitched(_, data) {
42682
- trace(`${T$j} onAudioTrackSwitched`);
42682
+ trace(`${T$k} onAudioTrackSwitched`);
42683
42683
  // @ts-ignore
42684
42684
  const track = this._hls.audioTracks[data.id];
42685
42685
  this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
@@ -42700,7 +42700,7 @@ function toClapprTrack(t) {
42700
42700
  };
42701
42701
  }
42702
42702
 
42703
- const T$i = 'playback.html5_video';
42703
+ const T$j = 'playback.html5_video';
42704
42704
  const STALL_TIMEOUT = 15000;
42705
42705
  class HTML5Video extends BasePlayback {
42706
42706
  stallTimerId = null;
@@ -42708,7 +42708,7 @@ class HTML5Video extends BasePlayback {
42708
42708
  * @internal
42709
42709
  */
42710
42710
  createError(errorData, options) {
42711
- trace(`${T$i} createError`, {
42711
+ trace(`${T$j} createError`, {
42712
42712
  errorData: { ...errorData },
42713
42713
  });
42714
42714
  const i18n = this.i18n ||
@@ -42724,11 +42724,11 @@ class HTML5Video extends BasePlayback {
42724
42724
  return super.createError(errorData, { ...options, useCodePrefix: false });
42725
42725
  }
42726
42726
  _onWaiting() {
42727
- trace(`${T$i} _onWaiting`);
42727
+ trace(`${T$j} _onWaiting`);
42728
42728
  super._onWaiting();
42729
42729
  }
42730
42730
  _onEnded() {
42731
- trace(`${T$i} _onEnded`);
42731
+ trace(`${T$j} _onEnded`);
42732
42732
  if (this.stallTimerId) {
42733
42733
  clearTimeout(this.stallTimerId);
42734
42734
  this.stallTimerId = null;
@@ -42736,12 +42736,12 @@ class HTML5Video extends BasePlayback {
42736
42736
  super._onEnded();
42737
42737
  }
42738
42738
  _handleBufferingEvents() {
42739
- trace(`${T$i} _handleBufferingEvents`, {
42739
+ trace(`${T$j} _handleBufferingEvents`, {
42740
42740
  networkState: this.el.networkState,
42741
42741
  });
42742
42742
  if (!this.stallTimerId) {
42743
42743
  this.stallTimerId = setTimeout(() => {
42744
- trace(`${T$i} _handleBufferingEvents stall timeout`, {
42744
+ trace(`${T$j} _handleBufferingEvents stall timeout`, {
42745
42745
  buffering: this.buffering,
42746
42746
  ended: this.ended,
42747
42747
  });
@@ -42759,7 +42759,7 @@ class HTML5Video extends BasePlayback {
42759
42759
  super._handleBufferingEvents();
42760
42760
  }
42761
42761
  _onPlaying() {
42762
- trace(`${T$i} _onPlaying`);
42762
+ trace(`${T$j} _onPlaying`);
42763
42763
  if (this.stallTimerId) {
42764
42764
  clearTimeout(this.stallTimerId);
42765
42765
  this.stallTimerId = null;
@@ -42767,7 +42767,7 @@ class HTML5Video extends BasePlayback {
42767
42767
  super._onPlaying();
42768
42768
  }
42769
42769
  _onPause() {
42770
- trace(`${T$i} _onPause`);
42770
+ trace(`${T$j} _onPause`);
42771
42771
  super._onPause();
42772
42772
  if (this.stallTimerId) {
42773
42773
  clearTimeout(this.stallTimerId);
@@ -42777,7 +42777,7 @@ class HTML5Video extends BasePlayback {
42777
42777
  get audioTracks() {
42778
42778
  const tracks = this.el.audioTracks;
42779
42779
  const supported = !!tracks;
42780
- trace(`${T$i} get audioTracks`, { supported });
42780
+ trace(`${T$j} get audioTracks`, { supported });
42781
42781
  const retval = [];
42782
42782
  if (supported) {
42783
42783
  for (let i = 0; i < tracks.length; i++) {
@@ -42796,7 +42796,7 @@ class HTML5Video extends BasePlayback {
42796
42796
  get currentAudioTrack() {
42797
42797
  const tracks = this.el.audioTracks;
42798
42798
  const supported = !!tracks;
42799
- trace(`${T$i} get currentAudioTrack`, {
42799
+ trace(`${T$j} get currentAudioTrack`, {
42800
42800
  supported,
42801
42801
  });
42802
42802
  if (supported) {
@@ -42817,7 +42817,7 @@ class HTML5Video extends BasePlayback {
42817
42817
  switchAudioTrack(id) {
42818
42818
  const tracks = this.el.audioTracks;
42819
42819
  const supported = !!tracks;
42820
- trace(`${T$i} switchAudioTrack`, {
42820
+ trace(`${T$j} switchAudioTrack`, {
42821
42821
  supported,
42822
42822
  });
42823
42823
  if (supported) {
@@ -42836,7 +42836,7 @@ function registerPlaybacks() {
42836
42836
  Loader.registerPlayback(DashPlayback);
42837
42837
  }
42838
42838
 
42839
- const T$h = 'GPlayer';
42839
+ const T$i = 'GPlayer';
42840
42840
  const DEFAULT_OPTIONS = {
42841
42841
  autoPlay: false,
42842
42842
  debug: 'none',
@@ -42924,7 +42924,7 @@ class Player {
42924
42924
  * ```
42925
42925
  */
42926
42926
  attachTo(playerElement) {
42927
- trace(`${T$h} attachTo`, {
42927
+ trace(`${T$i} attachTo`, {
42928
42928
  player: !!this.player,
42929
42929
  });
42930
42930
  assert.ok(!this.player, 'Player already initialized');
@@ -42934,7 +42934,7 @@ class Player {
42934
42934
  }
42935
42935
  const coreOpts = this.buildCoreOptions(playerElement);
42936
42936
  const { core, container } = Player.getRegisteredPlugins();
42937
- trace(`${T$h} init`, {
42937
+ trace(`${T$i} init`, {
42938
42938
  registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
42939
42939
  });
42940
42940
  coreOpts.plugins = {
@@ -42948,7 +42948,7 @@ class Player {
42948
42948
  * Destroys the player, releasing all resources and unmounting its UI from the DOM.
42949
42949
  */
42950
42950
  destroy() {
42951
- trace(`${T$h} destroy`, {
42951
+ trace(`${T$i} destroy`, {
42952
42952
  player: !!this.player,
42953
42953
  });
42954
42954
  if (this.player) {
@@ -43135,7 +43135,7 @@ class Player {
43135
43135
  this.config = $.extend(true, this.config, config);
43136
43136
  }
43137
43137
  initPlayer(coreOptions) {
43138
- trace(`${T$h} initPlayer`, {
43138
+ trace(`${T$i} initPlayer`, {
43139
43139
  autoPlay: coreOptions.autoPlay,
43140
43140
  sources: coreOptions.sources,
43141
43141
  player: !!this.player,
@@ -43160,7 +43160,7 @@ class Player {
43160
43160
  }
43161
43161
  }
43162
43162
  triggerAutoPlay() {
43163
- trace(`${T$h} triggerAutoPlay`);
43163
+ trace(`${T$i} triggerAutoPlay`);
43164
43164
  setTimeout(() => {
43165
43165
  this.player?.play({
43166
43166
  autoPlay: true,
@@ -43178,7 +43178,7 @@ class Player {
43178
43178
  // TODO test
43179
43179
  events = {
43180
43180
  onReady: () => {
43181
- trace(`${T$h} onReady`, {
43181
+ trace(`${T$i} onReady`, {
43182
43182
  ready: this.ready,
43183
43183
  });
43184
43184
  if (this.ready) {
@@ -43212,7 +43212,7 @@ class Player {
43212
43212
  buildCoreOptions(rootNode) {
43213
43213
  const sources = this.buildMediaSourcesList();
43214
43214
  const source = sources[0];
43215
- trace(`${T$h} buildCoreOptions`, {
43215
+ trace(`${T$i} buildCoreOptions`, {
43216
43216
  source,
43217
43217
  sources,
43218
43218
  });
@@ -43273,7 +43273,7 @@ class Player {
43273
43273
  assert.ok(this.player, 'Player is not initialized');
43274
43274
  const core = this.player.core;
43275
43275
  core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
43276
- trace(`${T$h} on CORE_SCREEN_ORIENTATION_CHANGED`, {
43276
+ trace(`${T$i} on CORE_SCREEN_ORIENTATION_CHANGED`, {
43277
43277
  orientation,
43278
43278
  rootNode: {
43279
43279
  width: this.rootNode?.clientWidth,
@@ -43288,14 +43288,14 @@ class Player {
43288
43288
  }
43289
43289
  }, null);
43290
43290
  core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
43291
- trace(`${T$h} on CORE_RESIZE`, {
43291
+ trace(`${T$i} on CORE_RESIZE`, {
43292
43292
  width,
43293
43293
  height,
43294
43294
  });
43295
43295
  this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
43296
43296
  }, null);
43297
43297
  core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
43298
- trace(`${T$h} CORE_FULLSCREEN`, {
43298
+ trace(`${T$i} CORE_FULLSCREEN`, {
43299
43299
  isFullscreen,
43300
43300
  });
43301
43301
  this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
@@ -43303,7 +43303,7 @@ class Player {
43303
43303
  }
43304
43304
  }
43305
43305
 
43306
- var version$1 = "2.22.20";
43306
+ var version$1 = "2.22.22";
43307
43307
 
43308
43308
  var packages = {
43309
43309
  "node_modules/@clappr/core": {
@@ -43502,7 +43502,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
43502
43502
 
43503
43503
  const pluginHtml$6 = "<div class=\"big-mute-icon-wrapper\" data-big-mute>\n <div class=\"big-mute-icon gcore-skin-border-color\" data-big-mute-icon></div>\n</div>\n";
43504
43504
 
43505
- const T$g = 'plugins.big_mute_button';
43505
+ const T$h = 'plugins.big_mute_button';
43506
43506
  // TODO rewrite as a container plugin
43507
43507
  /**
43508
43508
  * `PLUGIN` that displays a big mute button over the video when it's muted.
@@ -43543,7 +43543,7 @@ class BigMuteButton extends UICorePlugin {
43543
43543
  this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
43544
43544
  this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
43545
43545
  this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
43546
- trace(`${T$g} bindEvents`, {
43546
+ trace(`${T$h} bindEvents`, {
43547
43547
  mediacontrol: !!this.core.mediaControl,
43548
43548
  });
43549
43549
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
@@ -43568,12 +43568,12 @@ class BigMuteButton extends UICorePlugin {
43568
43568
  }
43569
43569
  mediaControlRendered() {
43570
43570
  const container = this.core.activeContainer;
43571
- trace(`${T$g} mediaControlRendered`, {
43571
+ trace(`${T$h} mediaControlRendered`, {
43572
43572
  container: !!container,
43573
43573
  });
43574
43574
  if (container) {
43575
43575
  this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
43576
- trace(`${T$g} PLAYBACK_PLAY`);
43576
+ trace(`${T$h} PLAYBACK_PLAY`);
43577
43577
  this.render();
43578
43578
  });
43579
43579
  }
@@ -43597,7 +43597,7 @@ class BigMuteButton extends UICorePlugin {
43597
43597
  }
43598
43598
  const { autoPlay, wasMuted } = this.options;
43599
43599
  const volume = container.volume;
43600
- trace(`${T$g} shouldRender`, {
43600
+ trace(`${T$h} shouldRender`, {
43601
43601
  autoPlay,
43602
43602
  wasMuted,
43603
43603
  volume,
@@ -43609,7 +43609,7 @@ class BigMuteButton extends UICorePlugin {
43609
43609
  */
43610
43610
  render() {
43611
43611
  if (this.shouldRender()) {
43612
- trace(`${T$g} render`, {
43612
+ trace(`${T$h} render`, {
43613
43613
  el: !!this.$el,
43614
43614
  });
43615
43615
  this.$el.html(BigMuteButton.template());
@@ -43655,7 +43655,7 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
43655
43655
  const gearHdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_28_1567)\">\n <path\n d=\"M19.14 12.94C19.18 12.64 19.2 12.33 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.16 9.47999C21.34 9.33999 21.39 9.06999 21.28 8.86999L19.36 5.54999C19.24 5.32999 18.99 5.25999 18.77 5.32999L16.38 6.28999C15.88 5.90999 15.35 5.58999 14.76 5.34999L14.4 2.80999C14.36 2.56999 14.16 2.39999 13.92 2.39999H10.08C9.83999 2.39999 9.64999 2.56999 9.60999 2.80999L9.24999 5.34999C8.65999 5.58999 8.11999 5.91999 7.62999 6.28999L5.23999 5.32999C5.01999 5.24999 4.76999 5.32999 4.64999 5.54999L2.73999 8.86999C2.61999 9.07999 2.65999 9.33999 2.85999 9.47999L4.88999 11.06C4.83999 11.36 4.79999 11.69 4.79999 12C4.79999 12.31 4.81999 12.64 4.86999 12.94L2.83999 14.52C2.65999 14.66 2.60999 14.93 2.71999 15.13L4.63999 18.45C4.75999 18.67 5.00999 18.74 5.22999 18.67L7.61999 17.71C8.11999 18.09 8.64999 18.41 9.23999 18.65L9.59999 21.19C9.64999 21.43 9.83999 21.6 10.08 21.6H13.92C14.16 21.6 14.36 21.43 14.39 21.19L14.75 18.65C15.34 18.41 15.88 18.09 16.37 17.71L18.76 18.67C18.98 18.75 19.23 18.67 19.35 18.45L21.27 15.13C21.39 14.91 21.34 14.66 21.15 14.52L19.14 12.94ZM12 15.6C10.02 15.6 8.39999 13.98 8.39999 12C8.39999 10.02 10.02 8.39999 12 8.39999C13.98 8.39999 15.6 10.02 15.6 12C15.6 13.98 13.98 15.6 12 15.6Z\"\n fill=\"#C9C9C9\"/>\n <rect x=\"13\" width=\"11\" height=\"7\" rx=\"1\" fill=\"#F6413B\"/>\n <path\n d=\"M14.6962 6V1.63636H15.3546V3.53267H17.53V1.63636H18.1905V6H17.53V4.0973H15.3546V6H14.6962ZM20.562 6H19.1493V1.63636H20.6067C21.0343 1.63636 21.4015 1.72372 21.7083 1.89844C22.0151 2.07173 22.2502 2.32102 22.4135 2.64631C22.5783 2.97017 22.6607 3.35866 22.6607 3.81179C22.6607 4.26634 22.5776 4.65696 22.4114 4.98366C22.2466 5.31037 22.008 5.56179 21.6955 5.73793C21.383 5.91264 21.0051 6 20.562 6ZM19.8077 5.42472H20.5257C20.8581 5.42472 21.1344 5.36222 21.3546 5.23722C21.5748 5.1108 21.7395 4.92827 21.8489 4.68963C21.9583 4.44957 22.013 4.15696 22.013 3.81179C22.013 3.46946 21.9583 3.17898 21.8489 2.94034C21.7409 2.7017 21.5797 2.5206 21.3652 2.39702C21.1507 2.27344 20.8844 2.21165 20.5662 2.21165H19.8077V5.42472Z\"\n fill=\"#C9C9C9\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_28_1567\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
43656
43656
 
43657
43657
  const VERSION$6 = '2.19.12';
43658
- const T$f = 'plugins.bottom_gear';
43658
+ const T$g = 'plugins.bottom_gear';
43659
43659
  /**
43660
43660
  * Events triggered by the plugin
43661
43661
  * @beta
@@ -43805,20 +43805,20 @@ class BottomGear extends UICorePlugin {
43805
43805
  addItem(name, $subMenu) {
43806
43806
  const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
43807
43807
  if ($existingItem.length) {
43808
- trace(`${T$f} addItem already exists`, { name });
43808
+ trace(`${T$g} addItem already exists`, { name });
43809
43809
  return $existingItem;
43810
43810
  }
43811
43811
  const $item = $('<li></li>')
43812
43812
  .attr(`data-${name}`, '')
43813
43813
  .appendTo(this.$el.find('#gear-options'));
43814
43814
  if ($subMenu) {
43815
- trace(`${T$f} addItem adding submenu`, { name });
43815
+ trace(`${T$g} addItem adding submenu`, { name });
43816
43816
  $subMenu
43817
43817
  .addClass('gear-sub-menu-wrapper')
43818
43818
  .hide()
43819
43819
  .appendTo(this.$el.find('#gear-options-wrapper'));
43820
43820
  $item.on('click', (e) => {
43821
- trace(`${T$f} addItem submenu clicked`, { name });
43821
+ trace(`${T$g} addItem submenu clicked`, { name });
43822
43822
  e.stopPropagation();
43823
43823
  $subMenu.show();
43824
43824
  this.$el.find('#gear-options').hide();
@@ -43827,15 +43827,15 @@ class BottomGear extends UICorePlugin {
43827
43827
  return $item;
43828
43828
  }
43829
43829
  onActiveContainerChanged() {
43830
- trace(`${T$f} onActiveContainerChanged`);
43830
+ trace(`${T$g} onActiveContainerChanged`);
43831
43831
  this.bindContainerEvents();
43832
43832
  }
43833
43833
  bindContainerEvents() {
43834
- trace(`${T$f} bindContainerEvents`);
43834
+ trace(`${T$g} bindContainerEvents`);
43835
43835
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
43836
43836
  }
43837
43837
  highDefinitionUpdate(isHd) {
43838
- trace(`${T$f} highDefinitionUpdate`, { isHd });
43838
+ trace(`${T$g} highDefinitionUpdate`, { isHd });
43839
43839
  this.isHd = isHd;
43840
43840
  this.$el.find('.gear-icon').html(isHd ? gearHdIcon : gearIcon);
43841
43841
  }
@@ -43843,7 +43843,7 @@ class BottomGear extends UICorePlugin {
43843
43843
  * @internal
43844
43844
  */
43845
43845
  render() {
43846
- trace(`${T$f} render`);
43846
+ trace(`${T$g} render`);
43847
43847
  const mediaControl = this.core.getPlugin('media_control');
43848
43848
  if (!mediaControl) {
43849
43849
  return this; // TODO test
@@ -43875,14 +43875,14 @@ class BottomGear extends UICorePlugin {
43875
43875
  this.$el.find('#gear-options-wrapper').hide();
43876
43876
  }
43877
43877
  onCoreReady() {
43878
- trace(`${T$f} onCoreReady`);
43878
+ trace(`${T$g} onCoreReady`);
43879
43879
  const mediaControl = this.core.getPlugin('media_control');
43880
43880
  assert(mediaControl, 'media_control plugin is required');
43881
43881
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
43882
43882
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide);
43883
43883
  }
43884
43884
  onMediaControlRendered() {
43885
- trace(`${T$f} onMediaControlRendered`);
43885
+ trace(`${T$g} onMediaControlRendered`);
43886
43886
  const mediaControl = this.core.getPlugin('media_control');
43887
43887
  mediaControl.mount('gear', this.$el);
43888
43888
  }
@@ -44067,6 +44067,9 @@ class ClapprStats extends ContainerPlugin {
44067
44067
  exportMetrics() {
44068
44068
  return structuredClone(this.metrics);
44069
44069
  }
44070
+ clearMetrics() {
44071
+ this.metrics = newMetrics$1();
44072
+ }
44070
44073
  onBitrate(newBitrate) {
44071
44074
  const bitrate = newBitrate.bitrate;
44072
44075
  const now = this.now();
@@ -45840,6 +45843,7 @@ class Speedtest {
45840
45843
  }
45841
45844
  addTestPoint(server) {
45842
45845
  this._checkServerDefinition(server);
45846
+ console.log('Speedtest addTestPoint %o', server);
45843
45847
  if (this._state === 0) {
45844
45848
  this._state = 1;
45845
45849
  }
@@ -46144,7 +46148,7 @@ const getColor = (speedValue) => {
46144
46148
  }
46145
46149
  };
46146
46150
  function drawSpeedTestResults() {
46147
- const canvas = document.getElementById('speedTestCanvas');
46151
+ const canvas = document.getElementById('nerd-stats-speed-test-canvas');
46148
46152
  if (!canvas) {
46149
46153
  return;
46150
46154
  }
@@ -46267,7 +46271,7 @@ function rankConnectionSpeed(dlSpeed) {
46267
46271
  return 0;
46268
46272
  }
46269
46273
 
46270
- const pluginHtml$4 = "<% general = metrics.general %>\n<% counters = metrics.counters %>\n<% timers = metrics.chrono %>\n<% extra = metrics.extra %>\n<% custom = metrics.custom %>\n\n<div class=\"stats-box\" id=\"nerd-stats-box\">\n <div class=\"stats-box-top\">\n <a class=\"close-button gplayer-lite-btn\" id=\"nerd-stats-close\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\n <g clip-path=\"url(#clip0_184_1489)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7.41376 6.00013L13.7068 -0.292872C14.0978 -0.683872 14.0978 -1.31587 13.7068 -1.70687C13.3158 -2.09787 12.6838 -2.09787 12.2928 -1.70687L5.99976 4.58613L-0.293238 -1.70687C-0.684238 -2.09787 -1.31624 -2.09787 -1.70724 -1.70687C-2.09824 -1.31587 -2.09824 -0.683872 -1.70724 -0.292872L4.58576 6.00013L-1.70724 12.2931C-2.09824 12.6841 -2.09824 13.3161 -1.70724 13.7071C-1.51224 13.9021 -1.25624 14.0001 -1.00024 14.0001C-0.744238 14.0001 -0.488238 13.9021 -0.293238 13.7071L5.99976 7.41413L12.2928 13.7071C12.4878 13.9021 12.7438 14.0001 12.9998 14.0001C13.2558 14.0001 13.5118 13.9021 13.7068 13.7071C14.0978 13.3161 14.0978 12.6841 13.7068 12.2931L7.41376 6.00013Z\"\n fill=\"white\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_184_1489\">\n <rect width=\"12\" height=\"12\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n </a>\n </div>\n <div class=\"stats-box-main\">\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.general') %></span></li>\n <li>\n <%= i18n.t('stats.display_resolution') %>\n <div><span><span id=\"nerd-stats-resolution-width\"><%= general.resolution.width %></span>&times;<span id=\"nerd-stats-resolution-height\"><%= general.resolution.height %></span></span></div>\n </li>\n <li>\n <%= i18n.t('stats.volume') %>\n <div id=\"nerd-stats-volume\"><span><%= general.volume %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.connection_speed') %>\n <div><span id=\"dlText\"><%= custom.connectionSpeed %></span> <%= i18n.t('mbps') %></div>\n </li>\n <li class=\"canvas-wrapper\">\n <canvas id=\"speedTestCanvas\" width=\"190\" height=\"20\"></canvas>\n </li>\n <li>\n <%= i18n.t('stats.ping') %>\n <div><span id=\"pingText\"><%= custom.ping %></span> <%= i18n.t('ms') %></div>\n </li>\n <li>\n <%= i18n.t('stats.jitter') %>\n <div><span id=\"jitterText\"><%= custom.jitter %></span> <%= i18n.t('ms') %></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.counters') %></span></li>\n <li>\n <%= i18n.t('stats.plays') %>\n <div><span id=\"nerd-stats-plays\"><%= counters.play %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.pauses') %>\n <div><span id=\"nerd-stats-pauses\"><%= counters.pause %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.errors') %>\n <div><span id=\"nerd-stats-errors\"><%= counters.error %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bufferings') %>\n <div><span id=\"nerd-stats-bufferings\"><%= counters.buffering %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.decoded_frames') %>\n <div><span id=\"nerd-stats-decoded-frames\"><%= counters.decodedFrames %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.dropped_frames') %>\n <div><span id=\"nerd-stats-dropped-frames\"><%= counters.droppedFrames %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.fps') %>\n <div><span id=\"nerd-stats-fps\"><%= counters.fps %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bitrate_changes') %>\n <div><span id=\"nerd-stats-bitrate-changes\"><%= counters.changeLevel %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.seeks') %>\n <div><span id=\"nerd-stats-seeks\"><%= counters.seek %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.fullscreen') %>\n <div><span id=\"nerd-stats-fullscreen\"><%= counters.fullscreen %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.dvr_seeks') %>\n <div><span id=\"nerd-stats-dvr-usage\"><%= counters.dvrUsage %></span></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.duration') %></span></li>\n <li>\n <%= i18n.t('stats.startup') %>\n <div><span id=\"nerd-stats-startup-time\"><%= timers.startup %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.watching') %>\n <div><span id=\"nerd-stats-watch-time\"><%= timers.watch %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.paused') %>\n <div><span id=\"nerd-stats-pause-time\"><%= timers.pause %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.buffering') %>\n <div><span id=\"nerd-stats-buffering-time\"><%= timers.buffering %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.session') %>\n <div><span id=\"nerd-stats-session-time\"><%= timers.session %></span></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.extra') %></span></li>\n <li>\n <%= i18n.t('stats.playback') %>\n <div><span id=\"nerd-stats-playback-name\"><%= extra.playbackName %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.playback_type') %>\n <div><span id=\"nerd-stats-playback-type\"><%= extra.playbackType %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.buffer_size') %>\n <div><span id=\"nerd-stats-buffer-size\"><%= extra.buffersize %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.video_duration') %>\n <div><span id=\"nerd-stats-video-duration\"><%= extra.duration %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.current_time') %>\n <div><span id=\"nerd-stats-current-time\"><%= extra.currentTime %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bitrate_weighted_mean') %>\n <div><span id=\"nerd-stats-bitrate-weighted-mean\"><%= extra.bitrateWeightedMean %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bitrate_most_used') %>\n <div><span id=\"nerd-stats-bitrate-most-used\"><%= extra.bitrateMostUsed %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.watched_percentage') %>\n <div><span id=\"nerd-stats-watched-percentage\"><%= extra.watchedPercentage %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.buffering_percentage') %>\n <div><span id=\"nerd-stats-buffering-percentage\"><%= extra.bufferingPercentage %></span></div>\n </li>\n </ul>\n </div>\n <div class=\"speedtest-summary\">\n <div class=\"speedtest-summary-header\"><%= i18n.t('stats.your_internet_quality_summary') %>:</div>\n <div class=\"speedtest-summary-block\">\n <div class=\"speedtest-summary-subblock\">\n <div class=\"speedtest-summary-subblock-content\">\n <div class=\"speedtest-quality\">\n <div class=\"speedtest-quality-header\"><%= i18n.t('vod') %>: \n <span id=\"nerd-stats-quality-vod-text\"><%= custom.vodQuality %></span></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"vod\" id=\"nerd-stats-quality-vod\">\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"speedtest-summary-subblock\">\n <div class=\"speedtest-summary-subblock-content\">\n <div class=\"speedtest-quality\">\n <div class=\"speedtest-quality-header\"><%= i18n.t('live') %>: \n <span id=\"nerd-stats-quality-live-text\"><%= custom.liveQuality %></span></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"live\" id=\"nerd-stats-quality-live\">\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"speedtest-footer\">\n <!-- <a class=\"speedtest-footer-about-link\" href=\"\" target=\"_blank\">I am not a nerd, what's this all about?</a>-->\n <button class=\"gplayer-lite-btn speedtest-btn speedtest-footer-refresh\" type=\"button\" id=\"nerd-stats-refresh\">\n <svg width=\"12\" height=\"10\" viewBox=\"0 0 12 10\" fill=\"none\">\n <path\n d=\"M6.03968 0.124998C3.64268 0.124998 1.67268 1.9565 1.48068 4.2915H1.00018C0.925833 4.29146 0.853156 4.31353 0.791378 4.35489C0.729601 4.39625 0.681511 4.45503 0.653218 4.52378C0.624925 4.59253 0.617705 4.66814 0.632476 4.74101C0.647248 4.81387 0.683343 4.88069 0.736177 4.933L1.57618 5.766C1.64641 5.83561 1.74129 5.87467 1.84018 5.87467C1.93906 5.87467 2.03395 5.83561 2.10418 5.766L2.94418 4.933C2.99701 4.88069 3.03311 4.81387 3.04788 4.74101C3.06265 4.66814 3.05543 4.59253 3.02714 4.52378C2.99884 4.45503 2.95075 4.39625 2.88898 4.35489C2.8272 4.31353 2.75452 4.29146 2.68018 4.2915H2.23368C2.42368 2.376 4.05268 0.874998 6.03968 0.874998C6.6948 0.873639 7.33932 1.04039 7.91158 1.35931C8.48384 1.67822 8.9647 2.13863 9.30818 2.6965C9.33331 2.73978 9.36686 2.7776 9.40684 2.80771C9.44682 2.83783 9.49243 2.85963 9.54097 2.87184C9.58951 2.88405 9.64001 2.88643 9.68948 2.87881C9.73895 2.8712 9.7864 2.85377 9.82902 2.82753C9.87165 2.80129 9.90859 2.76679 9.93767 2.72605C9.96675 2.68531 9.98739 2.63916 9.99835 2.59032C10.0093 2.54148 10.0104 2.49095 10.0015 2.44168C9.99264 2.39242 9.974 2.34544 9.94668 2.3035C9.53615 1.63664 8.96146 1.08621 8.27752 0.704805C7.59359 0.323402 6.82277 0.123774 6.03968 0.124998ZM10.4207 4.2335C10.3505 4.16419 10.2558 4.12532 10.1572 4.12532C10.0585 4.12532 9.96386 4.16419 9.89368 4.2335L9.05018 5.0665C8.9972 5.11874 8.96096 5.18557 8.94608 5.25847C8.93119 5.33137 8.93833 5.40705 8.96658 5.47588C8.99483 5.54472 9.04292 5.60359 9.10473 5.64501C9.16654 5.68644 9.23927 5.70853 9.31368 5.7085H9.76318C9.57218 7.6235 7.93768 9.125 5.94118 9.125C5.28399 9.12683 4.63729 8.96035 4.06269 8.64141C3.48808 8.32247 3.00473 7.86169 2.65868 7.303C2.63281 7.26107 2.59893 7.22465 2.55899 7.19582C2.51904 7.16699 2.47381 7.14631 2.42587 7.13495C2.37793 7.1236 2.32823 7.1218 2.27959 7.12966C2.23096 7.13752 2.18435 7.15488 2.14243 7.18075C2.05776 7.233 1.99731 7.31674 1.97438 7.41355C1.95146 7.51037 1.96793 7.61233 2.02018 7.697C2.43345 8.36457 3.01076 8.91521 3.69713 9.29647C4.38349 9.67772 5.15604 9.87689 5.94118 9.875C8.34518 9.875 10.3237 8.045 10.5162 5.7085H11.0002C11.0746 5.70853 11.1473 5.68644 11.2091 5.64501C11.2709 5.60359 11.319 5.54472 11.3473 5.47588C11.3755 5.40705 11.3827 5.33137 11.3678 5.25847C11.3529 5.18557 11.3167 5.11874 11.2637 5.0665L10.4207 4.2335Z\"\n fill=\"white\"/>\n </svg>\n <%= i18n.t('stats.refresh') %>\n </button>\n </div>\n</div>\n";
46274
+ const pluginHtml$4 = "<% general = metrics.general %>\n<% counters = metrics.counters %>\n<% timers = metrics.chrono %>\n<% extra = metrics.extra %>\n<% custom = metrics.custom %>\n\n<div class=\"stats-box\" id=\"nerd-stats-box\">\n <div class=\"stats-box-top\">\n <a class=\"close-button gplayer-lite-btn\" id=\"nerd-stats-close\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\n <g clip-path=\"url(#clip0_184_1489)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7.41376 6.00013L13.7068 -0.292872C14.0978 -0.683872 14.0978 -1.31587 13.7068 -1.70687C13.3158 -2.09787 12.6838 -2.09787 12.2928 -1.70687L5.99976 4.58613L-0.293238 -1.70687C-0.684238 -2.09787 -1.31624 -2.09787 -1.70724 -1.70687C-2.09824 -1.31587 -2.09824 -0.683872 -1.70724 -0.292872L4.58576 6.00013L-1.70724 12.2931C-2.09824 12.6841 -2.09824 13.3161 -1.70724 13.7071C-1.51224 13.9021 -1.25624 14.0001 -1.00024 14.0001C-0.744238 14.0001 -0.488238 13.9021 -0.293238 13.7071L5.99976 7.41413L12.2928 13.7071C12.4878 13.9021 12.7438 14.0001 12.9998 14.0001C13.2558 14.0001 13.5118 13.9021 13.7068 13.7071C14.0978 13.3161 14.0978 12.6841 13.7068 12.2931L7.41376 6.00013Z\"\n fill=\"white\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_184_1489\">\n <rect width=\"12\" height=\"12\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n </a>\n </div>\n <div class=\"stats-box-main\">\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.general') %></span></li>\n <li>\n <%= i18n.t('stats.display_resolution') %>\n <div><span><span id=\"nerd-stats-resolution-width\"><%= general.resolution.width %></span>&times;<span id=\"nerd-stats-resolution-height\"><%= general.resolution.height %></span></span></div>\n </li>\n <li>\n <%= i18n.t('stats.volume') %>\n <div id=\"nerd-stats-volume\"><span><%= general.volume %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.connection_speed') %>\n <div><span id=\"nerd-stats-dl-text\"><%= custom.connectionSpeed %></span> <%= i18n.t('mbps') %></div>\n </li>\n <li class=\"canvas-wrapper\">\n <canvas id=\"nerd-stats-speed-test-canvas\" width=\"190\" height=\"20\"></canvas>\n </li>\n <li>\n <%= i18n.t('stats.ping') %>\n <div><span id=\"nerd-stats-ping-text\"><%= custom.ping %></span> <%= i18n.t('ms') %></div>\n </li>\n <li>\n <%= i18n.t('stats.jitter') %>\n <div><span id=\"nerd-stats-jitter-text\"><%= custom.jitter %></span> <%= i18n.t('ms') %></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.duration') %></span></li>\n <li>\n <%= i18n.t('stats.startup') %>\n <div><span id=\"nerd-stats-startup-time\"><%= timers.startup %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.watching') %>\n <div><span id=\"nerd-stats-watch-time\"><%= timers.watch %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.paused') %>\n <div><span id=\"nerd-stats-pause-time\"><%= timers.pause %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.buffering') %>\n <div><span id=\"nerd-stats-buffering-time\"><%= timers.buffering %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.session') %>\n <div><span id=\"nerd-stats-session-time\"><%= timers.session %></span></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.counters') %></span></li>\n <li>\n <%= i18n.t('stats.plays') %>\n <div><span id=\"nerd-stats-plays\"><%= counters.play %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.pauses') %>\n <div><span id=\"nerd-stats-pauses\"><%= counters.pause %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.errors') %>\n <div><span id=\"nerd-stats-errors\"><%= counters.error %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bufferings') %>\n <div><span id=\"nerd-stats-bufferings\"><%= counters.buffering %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.decoded_frames') %>\n <div><span id=\"nerd-stats-decoded-frames\"><%= counters.decodedFrames %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.dropped_frames') %>\n <div><span id=\"nerd-stats-dropped-frames\"><%= counters.droppedFrames %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.fps') %>\n <div><span id=\"nerd-stats-fps\"><%= counters.fps %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bitrate_changes') %>\n <div><span id=\"nerd-stats-bitrate-changes\"><%= counters.changeLevel %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.seeks') %>\n <div><span id=\"nerd-stats-seeks\"><%= counters.seek %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.fullscreen') %>\n <div><span id=\"nerd-stats-fullscreen\"><%= counters.fullscreen %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.dvr_seeks') %>\n <div><span id=\"nerd-stats-dvr-usage\"><%= counters.dvrUsage %></span></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span><%= i18n.t('stats.extra') %></span></li>\n <li>\n <%= i18n.t('stats.playback') %>\n <div><span id=\"nerd-stats-playback-name\"><%= extra.playbackName %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.playback_type') %>\n <div><span id=\"nerd-stats-playback-type\"><%= extra.playbackType %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.buffer_size') %>\n <div><span id=\"nerd-stats-buffer-size\"><%= extra.buffersize %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.video_duration') %>\n <div><span id=\"nerd-stats-video-duration\"><%= extra.duration %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.current_time') %>\n <div><span id=\"nerd-stats-current-time\"><%= extra.currentTime %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bitrate_weighted_mean') %>\n <div><span id=\"nerd-stats-bitrate-weighted-mean\"><%= extra.bitrateWeightedMean %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.bitrate_most_used') %>\n <div><span id=\"nerd-stats-bitrate-most-used\"><%= extra.bitrateMostUsed %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.watched_percentage') %>\n <div><span id=\"nerd-stats-watched-percentage\"><%= extra.watchedPercentage %></span></div>\n </li>\n <li>\n <%= i18n.t('stats.buffering_percentage') %>\n <div><span id=\"nerd-stats-buffering-percentage\"><%= extra.bufferingPercentage %></span></div>\n </li>\n </ul>\n </div>\n <div class=\"speedtest-summary\">\n <div class=\"speedtest-summary-header\"><%= i18n.t('stats.your_internet_quality_summary') %>:</div>\n <div class=\"speedtest-summary-block\">\n <div class=\"speedtest-summary-subblock\">\n <div class=\"speedtest-summary-subblock-content\">\n <div class=\"speedtest-quality\">\n <div class=\"speedtest-quality-header\"><%= i18n.t('vod') %>: \n <span id=\"nerd-stats-quality-vod-text\"><%= custom.vodQuality %></span></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"vod\" id=\"nerd-stats-quality-vod\">\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"speedtest-summary-subblock\">\n <div class=\"speedtest-summary-subblock-content\">\n <div class=\"speedtest-quality\">\n <div class=\"speedtest-quality-header\"><%= i18n.t('live') %>: \n <span id=\"nerd-stats-quality-live-text\"><%= custom.liveQuality %></span></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"live\" id=\"nerd-stats-quality-live\">\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n <div class=\"speedtest-quality-content-item\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"speedtest-footer\">\n <!-- <a class=\"speedtest-footer-about-link\" href=\"\" target=\"_blank\">I am not a nerd, what's this all about?</a>-->\n <button class=\"gplayer-lite-btn speedtest-btn speedtest-footer-refresh\" type=\"button\" id=\"nerd-stats-refresh\">\n <svg width=\"12\" height=\"10\" viewBox=\"0 0 12 10\" fill=\"none\">\n <path\n d=\"M6.03968 0.124998C3.64268 0.124998 1.67268 1.9565 1.48068 4.2915H1.00018C0.925833 4.29146 0.853156 4.31353 0.791378 4.35489C0.729601 4.39625 0.681511 4.45503 0.653218 4.52378C0.624925 4.59253 0.617705 4.66814 0.632476 4.74101C0.647248 4.81387 0.683343 4.88069 0.736177 4.933L1.57618 5.766C1.64641 5.83561 1.74129 5.87467 1.84018 5.87467C1.93906 5.87467 2.03395 5.83561 2.10418 5.766L2.94418 4.933C2.99701 4.88069 3.03311 4.81387 3.04788 4.74101C3.06265 4.66814 3.05543 4.59253 3.02714 4.52378C2.99884 4.45503 2.95075 4.39625 2.88898 4.35489C2.8272 4.31353 2.75452 4.29146 2.68018 4.2915H2.23368C2.42368 2.376 4.05268 0.874998 6.03968 0.874998C6.6948 0.873639 7.33932 1.04039 7.91158 1.35931C8.48384 1.67822 8.9647 2.13863 9.30818 2.6965C9.33331 2.73978 9.36686 2.7776 9.40684 2.80771C9.44682 2.83783 9.49243 2.85963 9.54097 2.87184C9.58951 2.88405 9.64001 2.88643 9.68948 2.87881C9.73895 2.8712 9.7864 2.85377 9.82902 2.82753C9.87165 2.80129 9.90859 2.76679 9.93767 2.72605C9.96675 2.68531 9.98739 2.63916 9.99835 2.59032C10.0093 2.54148 10.0104 2.49095 10.0015 2.44168C9.99264 2.39242 9.974 2.34544 9.94668 2.3035C9.53615 1.63664 8.96146 1.08621 8.27752 0.704805C7.59359 0.323402 6.82277 0.123774 6.03968 0.124998ZM10.4207 4.2335C10.3505 4.16419 10.2558 4.12532 10.1572 4.12532C10.0585 4.12532 9.96386 4.16419 9.89368 4.2335L9.05018 5.0665C8.9972 5.11874 8.96096 5.18557 8.94608 5.25847C8.93119 5.33137 8.93833 5.40705 8.96658 5.47588C8.99483 5.54472 9.04292 5.60359 9.10473 5.64501C9.16654 5.68644 9.23927 5.70853 9.31368 5.7085H9.76318C9.57218 7.6235 7.93768 9.125 5.94118 9.125C5.28399 9.12683 4.63729 8.96035 4.06269 8.64141C3.48808 8.32247 3.00473 7.86169 2.65868 7.303C2.63281 7.26107 2.59893 7.22465 2.55899 7.19582C2.51904 7.16699 2.47381 7.14631 2.42587 7.13495C2.37793 7.1236 2.32823 7.1218 2.27959 7.12966C2.23096 7.13752 2.18435 7.15488 2.14243 7.18075C2.05776 7.233 1.99731 7.31674 1.97438 7.41355C1.95146 7.51037 1.96793 7.61233 2.02018 7.697C2.43345 8.36457 3.01076 8.91521 3.69713 9.29647C4.38349 9.67772 5.15604 9.87689 5.94118 9.875C8.34518 9.875 10.3237 8.045 10.5162 5.7085H11.0002C11.0746 5.70853 11.1473 5.68644 11.2091 5.64501C11.2709 5.60359 11.319 5.54472 11.3473 5.47588C11.3755 5.40705 11.3827 5.33137 11.3678 5.25847C11.3529 5.18557 11.3167 5.11874 11.2637 5.0665L10.4207 4.2335Z\"\n fill=\"white\"/>\n </svg>\n <%= i18n.t('stats.refresh') %>\n </button>\n </div>\n</div>\n";
46271
46275
 
46272
46276
  const buttonHtml$3 = "<button class='nerd-button gplayer-lite-btn gcore-skin-text-color gear-option' id=\"nerd-stats-button\">\n <span class=\"gear-option_icon\"><%= icon %></span>\n <span class=\"gear-option_label\"><%= i18n.t('statistics') %></span>\n</button>\n";
46273
46277
 
@@ -46281,38 +46285,40 @@ const qualityClasses = [
46281
46285
  'speedtest-quality-value-5',
46282
46286
  ];
46283
46287
  const getDownloadQuality = (speedValue) => {
46288
+ if (!speedValue) {
46289
+ return 0;
46290
+ }
46284
46291
  if (speedValue < 3) {
46285
46292
  return 1;
46286
46293
  }
46287
- else if (speedValue < 7) {
46294
+ if (speedValue < 7) {
46288
46295
  return 2;
46289
46296
  }
46290
- else if (speedValue < 13) {
46297
+ if (speedValue < 13) {
46291
46298
  return 3;
46292
46299
  }
46293
- else if (speedValue < 25) {
46300
+ if (speedValue < 25) {
46294
46301
  return 4;
46295
46302
  }
46296
- else {
46297
- return 5;
46298
- }
46303
+ return 5;
46299
46304
  };
46300
46305
  const getPingQuality = (pingValue) => {
46306
+ if (!pingValue) {
46307
+ return 0;
46308
+ }
46301
46309
  if (pingValue < 20) {
46302
46310
  return 5;
46303
46311
  }
46304
- else if (pingValue < 50) {
46312
+ if (pingValue < 50) {
46305
46313
  return 4;
46306
46314
  }
46307
- else if (pingValue < 100) {
46315
+ if (pingValue < 100) {
46308
46316
  return 3;
46309
46317
  }
46310
- else if (pingValue < 150) {
46318
+ if (pingValue < 150) {
46311
46319
  return 2;
46312
46320
  }
46313
- else {
46314
- return 1;
46315
- }
46321
+ return 1;
46316
46322
  };
46317
46323
  const generateQualityHtml = (quality) => {
46318
46324
  const html = [];
@@ -46329,9 +46335,9 @@ const generateQualityHtml = (quality) => {
46329
46335
  };
46330
46336
  const drawSummary = (customMetrics, vodContainer, liveContainer) => {
46331
46337
  const { connectionSpeed, ping } = customMetrics;
46332
- if (!connectionSpeed || !ping) {
46333
- return;
46334
- }
46338
+ // if (!connectionSpeed || !ping) {
46339
+ // return
46340
+ // }
46335
46341
  const downloadQuality = getDownloadQuality(connectionSpeed);
46336
46342
  const pingQuality = getPingQuality(ping);
46337
46343
  const liveQuality = Math.min(downloadQuality, pingQuality);
@@ -46346,7 +46352,7 @@ const PLAYBACK_NAMES = {
46346
46352
  hls: 'HLS.js',
46347
46353
  html5_video: 'Native',
46348
46354
  };
46349
- const T$e = 'plugins.nerd_stats';
46355
+ const T$f = 'plugins.nerd_stats';
46350
46356
  /**
46351
46357
  * `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
46352
46358
  * @beta
@@ -46526,7 +46532,7 @@ class NerdStats extends UICorePlugin {
46526
46532
  .text(this.metrics.general.resolution.height);
46527
46533
  }
46528
46534
  estimateQuality() {
46529
- trace(`${T$e} estimateQuality`);
46535
+ trace(`${T$f} estimateQuality`);
46530
46536
  const videoQualityNames = [
46531
46537
  'SD (480p)',
46532
46538
  'HD (720p)',
@@ -46551,9 +46557,12 @@ class NerdStats extends UICorePlugin {
46551
46557
  prefix + videoQualityNames[liveQuality - 1];
46552
46558
  }
46553
46559
  updateMetrics(metrics) {
46554
- trace(`${T$e} updateMetrics`, { custom: this.speedtestMetrics });
46555
- Object.assign(this.metrics, metrics);
46556
- this.updateEstimatedQuality();
46560
+ trace(`${T$f} updateMetrics`, { custom: this.speedtestMetrics });
46561
+ Object.assign(this.metrics, metrics); // TODO no Object.assign
46562
+ this.metrics.custom = {
46563
+ ...this.speedtestMetrics,
46564
+ };
46565
+ this.updateCustomMetrics();
46557
46566
  this.$el
46558
46567
  .find('#nerd-stats-current-time')
46559
46568
  .text(Formatter.formatTime(this.metrics.extra.currentTime));
@@ -46615,11 +46624,16 @@ class NerdStats extends UICorePlugin {
46615
46624
  .text(Formatter.formatFps(this.metrics.counters.fps));
46616
46625
  this.setStatsBoxSize();
46617
46626
  drawSpeedTestResults();
46618
- drawSummary(this.speedtestMetrics, this.$el.find('#nerd-stats-quality-vod'), this.$el.find('#nerd-stats-quality-live'));
46627
+ this.updateEstimatedQuality();
46619
46628
  if (!this.open) {
46620
46629
  this.hide();
46621
46630
  }
46622
46631
  }
46632
+ updateCustomMetrics() {
46633
+ this.$el.find('#nerd-stats-dl-text').text(this.metrics.custom.connectionSpeed.toFixed(2));
46634
+ this.$el.find('#nerd-stats-ping-text').text(this.metrics.custom.ping.toFixed(2));
46635
+ this.$el.find('#nerd-stats-jitter-text').text(this.metrics.custom.jitter.toFixed(2));
46636
+ }
46623
46637
  updateEstimatedQuality() {
46624
46638
  this.estimateQuality();
46625
46639
  this.$el
@@ -46628,6 +46642,7 @@ class NerdStats extends UICorePlugin {
46628
46642
  this.$el
46629
46643
  .find('#nerd-stats-quality-live-text')
46630
46644
  .html(this.metrics.custom.liveQuality);
46645
+ drawSummary(this.speedtestMetrics, this.$el.find('#nerd-stats-quality-vod'), this.$el.find('#nerd-stats-quality-live'));
46631
46646
  }
46632
46647
  setStatsBoxSize() {
46633
46648
  if (this.playerWidth >= this.statsBoxWidthThreshold) {
@@ -46653,7 +46668,7 @@ class NerdStats extends UICorePlugin {
46653
46668
  return this;
46654
46669
  }
46655
46670
  attach() {
46656
- trace(`${T$e} attach`);
46671
+ trace(`${T$f} attach`);
46657
46672
  const gear = this.core.getPlugin('bottom_gear');
46658
46673
  gear
46659
46674
  .addItem('nerd_stats')
@@ -46672,6 +46687,7 @@ class NerdStats extends UICorePlugin {
46672
46687
  this.speedtestMetrics.ping = 0;
46673
46688
  this.speedtestMetrics.jitter = 0;
46674
46689
  if (clapprStats) {
46690
+ clapprStats.clearMetrics();
46675
46691
  this.updateMetrics(clapprStats.exportMetrics());
46676
46692
  }
46677
46693
  }
@@ -46720,7 +46736,7 @@ function newMetrics() {
46720
46736
  // Copyright 2014 Globo.com Player authors. All rights reserved.
46721
46737
  // Use of this source code is governed by a BSD-style
46722
46738
  // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
46723
- const T$d = 'plugins.click_to_pause';
46739
+ const T$e = 'plugins.click_to_pause';
46724
46740
  /**
46725
46741
  * A small `PLUGIN` that toggles the playback state on click over the video container
46726
46742
  * @beta
@@ -46750,20 +46766,19 @@ class ClickToPause extends ContainerPlugin {
46750
46766
  click() {
46751
46767
  const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
46752
46768
  const isDvrEnabled = this.container.isDvrEnabled();
46753
- trace(`${T$d} click`, {
46769
+ trace(`${T$e} click`, {
46754
46770
  isLivePlayback,
46755
46771
  isDvrEnabled,
46756
46772
  });
46757
46773
  if (isLivePlayback && !isDvrEnabled) {
46758
46774
  this.togglePlay(true);
46775
+ return;
46759
46776
  }
46760
- else if (!isLivePlayback || isDvrEnabled) {
46761
- this.clearTimer();
46762
- this.timer = setTimeout(() => {
46763
- this.timer = null;
46764
- this.togglePlay(false);
46765
- }, 300);
46766
- }
46777
+ this.clearTimer();
46778
+ this.timer = setTimeout(() => {
46779
+ this.timer = null;
46780
+ this.togglePlay(false);
46781
+ }, 300);
46767
46782
  }
46768
46783
  settingsUpdate() {
46769
46784
  const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
@@ -46865,7 +46880,7 @@ function buildSvg(clips, duration, barWidth) {
46865
46880
 
46866
46881
  const clipsHTML = "<div class=\"media-clip-text\" id=\"clips-text\"></div>";
46867
46882
 
46868
- const T$c = 'plugins.clips';
46883
+ const T$d = 'plugins.clips';
46869
46884
  const VERSION$5 = '2.22.16';
46870
46885
  const CLAPPR_VERSION = '0.11.4';
46871
46886
  /**
@@ -46915,7 +46930,7 @@ class Clips extends UICorePlugin {
46915
46930
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
46916
46931
  }
46917
46932
  render() {
46918
- trace(`${T$c} render`);
46933
+ trace(`${T$d} render`);
46919
46934
  if (!this.options.clips) {
46920
46935
  return this;
46921
46936
  }
@@ -46942,19 +46957,19 @@ class Clips extends UICorePlugin {
46942
46957
  return super.enable();
46943
46958
  }
46944
46959
  onCoreReady() {
46945
- trace(`${T$c} onCoreReady`);
46960
+ trace(`${T$d} onCoreReady`);
46946
46961
  const mediaControl = this.core.getPlugin('media_control');
46947
46962
  assert(mediaControl, 'media_control plugin is required');
46948
46963
  this.parseClips(this.options.clips.text);
46949
46964
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMcRender);
46950
46965
  }
46951
46966
  onMcRender() {
46952
- trace(`${T$c} onMcRender`);
46967
+ trace(`${T$d} onMcRender`);
46953
46968
  const mediaControl = this.core.getPlugin('media_control');
46954
46969
  mediaControl.mount('clips', this.$el);
46955
46970
  }
46956
46971
  onContainerChanged() {
46957
- trace(`${T$c} onContainerChanged`);
46972
+ trace(`${T$d} onContainerChanged`);
46958
46973
  // TODO figure out the conditions of changing the container (without destroying the previous one)
46959
46974
  if (this.oldContainer) {
46960
46975
  this.stopListening(this.oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
@@ -47247,7 +47262,7 @@ const reloadIcon = "<svg fill=\"#FFFFFF\" height=\"24\" viewBox=\"0 0 24 24\" wi
47247
47262
 
47248
47263
  const templateHtml = "<div class=\"player-error-screen__content\" data-error-screen>\n <% if (icon) { %>\n <div class=\"player-error-screen__icon\" data-error-screen><%= icon %></div>\n <% } %>\n <div class=\"player-error-screen__title\" data-error-screen><%= title %></div>\n <% if (message) { %>\n <div class=\"player-error-screen__message\" data-error-screen><%= message %></div>\n <% } %>\n <% if (code) { %>\n <div class=\"player-error-screen__code\" data-error-screen><%= i18n.t('error_code') %>: <%= code %></div>\n <% } %>\n <% if (reloadIcon) { %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n <% } %>\n</div>\n";
47249
47264
 
47250
- const T$b = 'plugins.error_screen';
47265
+ const T$c = 'plugins.error_screen';
47251
47266
  /**
47252
47267
  * `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
47253
47268
  * @public
@@ -47299,11 +47314,11 @@ class ErrorScreen extends UICorePlugin {
47299
47314
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
47300
47315
  }
47301
47316
  onPlay() {
47302
- trace(`${T$b} onPlay`);
47317
+ trace(`${T$c} onPlay`);
47303
47318
  this.unmount();
47304
47319
  }
47305
47320
  unmount() {
47306
- trace(`${T$b} unmount`);
47321
+ trace(`${T$c} unmount`);
47307
47322
  this.err = null;
47308
47323
  this.$el.remove();
47309
47324
  }
@@ -47316,7 +47331,7 @@ class ErrorScreen extends UICorePlugin {
47316
47331
  };
47317
47332
  }
47318
47333
  reload() {
47319
- trace(`${T$b} reload`);
47334
+ trace(`${T$c} reload`);
47320
47335
  setTimeout(() => {
47321
47336
  this.core.configure({
47322
47337
  reloading: true,
@@ -47326,7 +47341,7 @@ class ErrorScreen extends UICorePlugin {
47326
47341
  }, 0);
47327
47342
  }
47328
47343
  onActiveContainerChanged() {
47329
- trace(`${T$b} onActiveContainerChanged`, {
47344
+ trace(`${T$c} onActiveContainerChanged`, {
47330
47345
  reloading: this.core.options.reloading,
47331
47346
  });
47332
47347
  this.err = null;
@@ -47342,7 +47357,7 @@ class ErrorScreen extends UICorePlugin {
47342
47357
  }
47343
47358
  }
47344
47359
  onError(err) {
47345
- trace(`${T$b} onError`, { err });
47360
+ trace(`${T$c} onError`, { err });
47346
47361
  if (err.UI) {
47347
47362
  if (this.err) {
47348
47363
  this.unmount();
@@ -48062,7 +48077,7 @@ const INITIAL_SETTINGS = {
48062
48077
  default: [],
48063
48078
  seekEnabled: false,
48064
48079
  };
48065
- const T$a = 'plugins.media_control';
48080
+ const T$b = 'plugins.media_control';
48066
48081
  const LEFT_ORDER = [
48067
48082
  'playpause',
48068
48083
  'playstop',
@@ -48071,6 +48086,10 @@ const LEFT_ORDER = [
48071
48086
  'duration',
48072
48087
  'dvr',
48073
48088
  ];
48089
+ var ExtendedEvents;
48090
+ (function (ExtendedEvents) {
48091
+ ExtendedEvents["MEDIACONTROL_VOLUME"] = "mediacontrol:volume";
48092
+ })(ExtendedEvents || (ExtendedEvents = {}));
48074
48093
  const { Config, Fullscreen, formatTime: formatTime$1, extend, removeArrayItem } = Utils;
48075
48094
  function orderByOrderPattern(arr, order) {
48076
48095
  const arrWithoutDuplicates = [...new Set(arr)];
@@ -48308,7 +48327,7 @@ class MediaControl extends UICorePlugin {
48308
48327
  * Hides the media control UI
48309
48328
  */
48310
48329
  disable() {
48311
- trace(`${T$a} disable`);
48330
+ trace(`${T$b} disable`);
48312
48331
  this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
48313
48332
  this.hide();
48314
48333
  this.unbindKeyEvents();
@@ -48318,7 +48337,7 @@ class MediaControl extends UICorePlugin {
48318
48337
  * Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
48319
48338
  */
48320
48339
  enable() {
48321
- trace(`${T$a} enable`);
48340
+ trace(`${T$b} enable`);
48322
48341
  if (this.options.chromeless) {
48323
48342
  return;
48324
48343
  }
@@ -48551,14 +48570,15 @@ class MediaControl extends UICorePlugin {
48551
48570
  // if the container is not ready etc
48552
48571
  this.intendedVolume = value;
48553
48572
  this.persistConfig && !isInitialVolume && Config.persist('volume', value);
48554
- // TODO
48555
48573
  const setWhenContainerReady = () => {
48556
48574
  if (this.core.activeContainer && this.core.activeContainer.isReady) {
48557
48575
  this.core.activeContainer.setVolume(value);
48576
+ this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
48558
48577
  }
48559
48578
  else {
48560
48579
  this.listenToOnce(this.core.activeContainer, Events$1.CONTAINER_READY, () => {
48561
48580
  this.core.activeContainer.setVolume(value);
48581
+ this.trigger(ExtendedEvents.MEDIACONTROL_VOLUME, value);
48562
48582
  });
48563
48583
  }
48564
48584
  };
@@ -48763,13 +48783,13 @@ class MediaControl extends UICorePlugin {
48763
48783
  }
48764
48784
  }
48765
48785
  updateSettings() {
48766
- trace(`${T$a} updateSettings`, { settings: this.settings });
48786
+ trace(`${T$b} updateSettings`, { settings: this.settings });
48767
48787
  const newSettings = $.extend(true, {
48768
48788
  left: [],
48769
48789
  default: [],
48770
48790
  right: [],
48771
48791
  }, this.core.activeContainer.settings);
48772
- trace(`${T$a} updateSettings`, { newSettings });
48792
+ trace(`${T$b} updateSettings`, { newSettings });
48773
48793
  newSettings.left.push('clips'); // TODO settings
48774
48794
  // TODO make order controlled via CSS
48775
48795
  newSettings.left = orderByOrderPattern([...newSettings.left, 'volume', 'clips'], LEFT_ORDER);
@@ -48781,7 +48801,7 @@ class MediaControl extends UICorePlugin {
48781
48801
  newSettings.right = DEFAULT_SETTINGS.right; // TODO get from the options
48782
48802
  if ((!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
48783
48803
  this.options.fullscreenDisable) {
48784
- trace(`${T$a} updateSettings removing fullscreen`, {
48804
+ trace(`${T$b} updateSettings removing fullscreen`, {
48785
48805
  supported: this.fullScreenOnVideoTagSupported,
48786
48806
  enabled: Fullscreen.fullscreenEnabled(),
48787
48807
  optionsDisable: this.options.fullscreenDisable,
@@ -48848,7 +48868,7 @@ class MediaControl extends UICorePlugin {
48848
48868
  */
48849
48869
  mount(name, element) {
48850
48870
  const panel = this.getElementLocation(name);
48851
- trace(`${T$a} mount`, { name, panel: !!panel });
48871
+ trace(`${T$b} mount`, { name, panel: !!panel });
48852
48872
  if (panel) {
48853
48873
  const current = panel.find(`[data-${name}]`);
48854
48874
  element.attr(`data-${name}`, '');
@@ -49044,7 +49064,7 @@ class MediaControl extends UICorePlugin {
49044
49064
  * @internal
49045
49065
  */
49046
49066
  render() {
49047
- trace(`${T$a} render`, {
49067
+ trace(`${T$b} render`, {
49048
49068
  needsUpdate: this.hasUpdate,
49049
49069
  metadataLoaded: this.metadataLoaded,
49050
49070
  });
@@ -49174,7 +49194,7 @@ class MediaControl extends UICorePlugin {
49174
49194
  return isFinite(this.core.activePlayback.getDuration());
49175
49195
  }
49176
49196
  getElementLocation(name) {
49177
- trace(`${T$a} getElementLocation`, {
49197
+ trace(`${T$b} getElementLocation`, {
49178
49198
  name,
49179
49199
  right: this.settings.right,
49180
49200
  left: this.settings.left,
@@ -49221,7 +49241,7 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
49221
49241
  const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"50\" height=\"50\" viewBox=\"0 0 50 50\">\n <defs>\n <clipPath id=\"clip-Icon\">\n <rect width=\"50\" height=\"50\"/>\n </clipPath>\n </defs>\n <g id=\"Icon\" clip-path=\"url(#clip-Icon)\">\n <g id=\"icon2\" transform=\"translate(-0.041 0)\">\n <path id=\"Контур_77\" data-name=\"Контур 77\" d=\"M6.493,13v8.266h6.275V19.74H8.31V17.714h4.006V16.3H8.31V14.53h4.365V13Zm7.5,0v8.266h1.7V15.732h.023l3.438,5.534h1.818V13h-1.7v5.545h-.023L15.8,13Z\" fill=\"#fff\"/>\n <path id=\"Контур_76\" data-name=\"Контур 76\" d=\"M29.949,29.1V26.774H31.94a1.4,1.4,0,0,1,.938.272,1.1,1.1,0,0,1,.313.874,1.155,1.155,0,0,1-.313.9,1.375,1.375,0,0,1-.938.278ZM28.132,25.36v8.266h1.817V30.4h1.818a1.353,1.353,0,0,1,.984.3,1.637,1.637,0,0,1,.394.949c.046.333.079.681.1,1.042a3.2,3.2,0,0,0,.185.938h1.819a1.218,1.218,0,0,1-.191-.423,3.611,3.611,0,0,1-.093-.527c-.019-.185-.033-.367-.041-.544s-.016-.332-.023-.463a5.052,5.052,0,0,0-.087-.625,2.109,2.109,0,0,0-.2-.573,1.586,1.586,0,0,0-.359-.451,1.414,1.414,0,0,0-.556-.284v-.023a1.926,1.926,0,0,0,1-.81,2.494,2.494,0,0,0,.307-1.262,2.308,2.308,0,0,0-.165-.88,2.128,2.128,0,0,0-.486-.724,2.3,2.3,0,0,0-.764-.492,2.67,2.67,0,0,0-1-.179ZM43.506,30.5V25.36H41.689V30.5a2.065,2.065,0,0,1-.37,1.36,1.7,1.7,0,0,1-1.343.434,2.086,2.086,0,0,1-.886-.156,1.283,1.283,0,0,1-.758-.978,3.748,3.748,0,0,1-.058-.66V25.36H36.456V30.5a3.16,3.16,0,0,0,.92,2.5,3.807,3.807,0,0,0,2.6.81,3.82,3.82,0,0,0,2.593-.816,3.132,3.132,0,0,0,.937-2.492Z\" fill=\"#fff\"/>\n <path id=\"Контур_80\" data-name=\"Контур 80\" d=\"M22.646,31.2H4.689a4.505,4.505,0,0,1-4.5-4.5V8.5A4.505,4.505,0,0,1,4.689,4h18.2a4.505,4.505,0,0,1,4.5,4.5v8.445l-.893.1a3.184,3.184,0,0,0-2.846,3.177V30.5l-.465.7ZM4.689,6a2.5,2.5,0,0,0-2.5,2.5V26.7a2.5,2.5,0,0,0,2.5,2.5H21.65V20.22a5.18,5.18,0,0,1,3.739-4.992V8.5a2.5,2.5,0,0,0-2.5-2.5Z\" fill=\"#fff\"/>\n <path id=\"Контур_81\" data-name=\"Контур 81\" d=\"M30.127,47.884a1,1,0,0,1-1-1V43.267H26.846a5.206,5.206,0,0,1-5.2-5.2V20.222a5.206,5.206,0,0,1,5.2-5.2H44.692a5.206,5.206,0,0,1,5.2,5.2V38.068a5.206,5.206,0,0,1-5.2,5.2H35.058l-4.216,4.316A1,1,0,0,1,30.127,47.884ZM26.846,17.022a3.2,3.2,0,0,0-3.2,3.2V38.067a3.2,3.2,0,0,0,3.2,3.2h3.281a1,1,0,0,1,1,1v2.162l2.8-2.86a1,1,0,0,1,.715-.3H44.692a3.2,3.2,0,0,0,3.2-3.2V20.222a3.2,3.2,0,0,0-3.2-3.2Z\" fill=\"#fff\"/>\n </g>\n </g>\n</svg>\n";
49222
49242
 
49223
49243
  const VERSION$4 = '0.0.1';
49224
- const T$9 = 'plugins.multicamera';
49244
+ const T$a = 'plugins.multicamera';
49225
49245
  /**
49226
49246
  * `PLUGIN` that adds support for loading multiple streams and switching between them using the media control UI.
49227
49247
  * @beta
@@ -49367,7 +49387,7 @@ class MultiCamera extends UICorePlugin {
49367
49387
  }
49368
49388
  onCameraSelect(event) {
49369
49389
  const value = event.currentTarget.dataset.multicameraSelectorSelect;
49370
- trace(`${T$9} onCameraSelect`, { value });
49390
+ trace(`${T$a} onCameraSelect`, { value });
49371
49391
  if (value !== undefined) {
49372
49392
  this.changeById(parseInt(value, 10));
49373
49393
  }
@@ -49493,13 +49513,13 @@ class MultiCamera extends UICorePlugin {
49493
49513
  }
49494
49514
  }
49495
49515
  changeById(id) {
49496
- trace(`${T$9} changeById`, { id });
49516
+ trace(`${T$a} changeById`, { id });
49497
49517
  queueMicrotask(() => {
49498
49518
  const playbackOptions = this.core.options.playback || {};
49499
49519
  // TODO figure out what this does
49500
49520
  playbackOptions.recycleVideo = Browser.isMobile;
49501
49521
  this.currentCamera = this.findElementById(id) ?? null;
49502
- trace(`${T$9} changeById`, { id, currentCamera: this.currentCamera, multicamera: this.multicamera });
49522
+ trace(`${T$a} changeById`, { id, currentCamera: this.currentCamera, multicamera: this.multicamera });
49503
49523
  if (!this.currentCamera) {
49504
49524
  return;
49505
49525
  }
@@ -49516,7 +49536,7 @@ class MultiCamera extends UICorePlugin {
49516
49536
  // TODO remove?
49517
49537
  // for html5 playback:
49518
49538
  this.options.dvrEnabled = this.currentCamera.dvr;
49519
- trace(`${T$9} changeById`, { currentCamera: this.currentCamera });
49539
+ trace(`${T$a} changeById`, { currentCamera: this.currentCamera });
49520
49540
  // TODO
49521
49541
  this.core.configure({
49522
49542
  playback: playbackOptions,
@@ -49574,7 +49594,7 @@ const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"no
49574
49594
  const buttonHtml$2 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\">\n <%= pipIcon %>\n</button>\n";
49575
49595
 
49576
49596
  const VERSION$3 = '0.0.1';
49577
- const T$8 = `plugins.pip`;
49597
+ const T$9 = `plugins.pip`;
49578
49598
  /**
49579
49599
  * `PLUGIN` that enables picture in picture mode.
49580
49600
  * @beta
@@ -49632,7 +49652,7 @@ class PictureInPicture extends UICorePlugin {
49632
49652
  });
49633
49653
  }
49634
49654
  isPiPSupported() {
49635
- trace(`${T$8} isPiPSupported`, {
49655
+ trace(`${T$9} isPiPSupported`, {
49636
49656
  pictureInPictureEnabled: !!document.pictureInPictureEnabled,
49637
49657
  requestPictureInPicture: !!HTMLVideoElement.prototype.requestPictureInPicture,
49638
49658
  });
@@ -49653,7 +49673,7 @@ class PictureInPicture extends UICorePlugin {
49653
49673
  return this;
49654
49674
  }
49655
49675
  togglePictureInPicture() {
49656
- trace(`${T$8} togglePictureInPicture`);
49676
+ trace(`${T$9} togglePictureInPicture`);
49657
49677
  if (this.videoElement !== document.pictureInPictureElement) {
49658
49678
  this.requestPictureInPicture();
49659
49679
  }
@@ -49662,13 +49682,13 @@ class PictureInPicture extends UICorePlugin {
49662
49682
  }
49663
49683
  }
49664
49684
  requestPictureInPicture() {
49665
- trace(`${T$8} requestPictureInPicture`, {
49685
+ trace(`${T$9} requestPictureInPicture`, {
49666
49686
  videoElement: !!this.videoElement,
49667
49687
  });
49668
49688
  this.videoElement.requestPictureInPicture();
49669
49689
  }
49670
49690
  exitPictureInPicture() {
49671
- trace(`${T$8} exitPictureInPicture`);
49691
+ trace(`${T$9} exitPictureInPicture`);
49672
49692
  document.exitPictureInPicture();
49673
49693
  }
49674
49694
  }
@@ -49695,7 +49715,7 @@ const DEFAULT_PLAYBACK_RATES = [
49695
49715
  { value: 2.0, label: '2x' },
49696
49716
  ];
49697
49717
  const DEFAULT_PLAYBACK_RATE = 1;
49698
- const T$7 = 'plugins.playback_rate';
49718
+ const T$8 = 'plugins.playback_rate';
49699
49719
  /**
49700
49720
  * `PLUGIN` that allows changing the playback speed of the video.
49701
49721
  * @beta
@@ -49781,7 +49801,7 @@ class PlaybackRate extends UICorePlugin {
49781
49801
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
49782
49802
  }
49783
49803
  onCoreReady() {
49784
- trace(`${T$7} onCoreReady`);
49804
+ trace(`${T$8} onCoreReady`);
49785
49805
  const mediaControl = this.core.getPlugin('media_control');
49786
49806
  assert(mediaControl, 'media_control plugin is required');
49787
49807
  const gear = this.core.getPlugin('bottom_gear');
@@ -49790,7 +49810,7 @@ class PlaybackRate extends UICorePlugin {
49790
49810
  this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
49791
49811
  }
49792
49812
  onActiveContainerChange() {
49793
- trace(`${T$7} onActiveContainerChange`);
49813
+ trace(`${T$8} onActiveContainerChange`);
49794
49814
  this.metadataLoaded = false;
49795
49815
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_STOP, this.onStop);
49796
49816
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
@@ -49798,15 +49818,15 @@ class PlaybackRate extends UICorePlugin {
49798
49818
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetaDataLoaded);
49799
49819
  }
49800
49820
  onMediaControlRendered() {
49801
- trace(`${T$7} onMediaControlRendered`);
49821
+ trace(`${T$8} onMediaControlRendered`);
49802
49822
  this.render();
49803
49823
  }
49804
49824
  onGearRendered() {
49805
- trace(`${T$7} onGearRendered`);
49825
+ trace(`${T$8} onGearRendered`);
49806
49826
  this.mount();
49807
49827
  }
49808
49828
  mount() {
49809
- trace(`${T$7} mount`, {
49829
+ trace(`${T$8} mount`, {
49810
49830
  shouldMount: this.shouldMount(),
49811
49831
  });
49812
49832
  if (!this.shouldMount()) {
@@ -49823,7 +49843,7 @@ class PlaybackRate extends UICorePlugin {
49823
49843
  })));
49824
49844
  }
49825
49845
  onMetaDataLoaded() {
49826
- trace(`${T$7} onMetaDataLoaded`, {
49846
+ trace(`${T$8} onMetaDataLoaded`, {
49827
49847
  playbackType: this.core.activePlayback.getPlaybackType(),
49828
49848
  dvrEnabled: this.core.activePlayback.dvrEnabled,
49829
49849
  });
@@ -49845,14 +49865,14 @@ class PlaybackRate extends UICorePlugin {
49845
49865
  this.core.activePlayback?.setPlaybackRate(this.selectedRate);
49846
49866
  }
49847
49867
  else {
49848
- trace(`${T$7} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
49868
+ trace(`${T$8} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
49849
49869
  playbackRate,
49850
49870
  selectedRate: this.selectedRate,
49851
49871
  });
49852
49872
  }
49853
49873
  }
49854
49874
  shouldMount() {
49855
- trace(`${T$7} shouldMount`, {
49875
+ trace(`${T$8} shouldMount`, {
49856
49876
  playbackType: this.core.activePlayback?.getPlaybackType(),
49857
49877
  dvrEnabled: this.core.activePlayback?.dvrEnabled,
49858
49878
  });
@@ -49869,7 +49889,7 @@ class PlaybackRate extends UICorePlugin {
49869
49889
  * @internal
49870
49890
  */
49871
49891
  render() {
49872
- trace(`${T$7} render`, {
49892
+ trace(`${T$8} render`, {
49873
49893
  shouldMount: this.shouldMount(),
49874
49894
  });
49875
49895
  this.$el.html(PlaybackRate.listTemplate({
@@ -49915,13 +49935,13 @@ class PlaybackRate extends UICorePlugin {
49915
49935
  }
49916
49936
  }
49917
49937
  syncRate() {
49918
- trace(`${T$7} syncRate`, {
49938
+ trace(`${T$8} syncRate`, {
49919
49939
  selectedRate: this.selectedRate,
49920
49940
  });
49921
49941
  this.core.activePlayback?.setPlaybackRate(this.selectedRate);
49922
49942
  }
49923
49943
  resetPlaybackRate() {
49924
- trace(`${T$7} resetPlaybackRate`, {
49944
+ trace(`${T$8} resetPlaybackRate`, {
49925
49945
  selectedRate: this.selectedRate,
49926
49946
  });
49927
49947
  this.core.activePlayback?.setPlaybackRate(DEFAULT_PLAYBACK_RATE);
@@ -49956,7 +49976,7 @@ class PlaybackRate extends UICorePlugin {
49956
49976
  ?.label || `x${rate}`);
49957
49977
  }
49958
49978
  highlightCurrentRate() {
49959
- trace(`${T$7} highlightCurrentRate`, {
49979
+ trace(`${T$8} highlightCurrentRate`, {
49960
49980
  selectedRate: this.selectedRate,
49961
49981
  });
49962
49982
  this.allRateElements().removeClass('current');
@@ -49967,7 +49987,7 @@ class PlaybackRate extends UICorePlugin {
49967
49987
  .addClass('gcore-skin-active');
49968
49988
  }
49969
49989
  updateGearOptionLabel() {
49970
- trace(`${T$7} updateGearOptionLabel`, {
49990
+ trace(`${T$8} updateGearOptionLabel`, {
49971
49991
  selectedRate: this.selectedRate,
49972
49992
  });
49973
49993
  this.mount();
@@ -49979,7 +49999,7 @@ const posterHTML = "<div class=\"play-wrapper\" data-poster></div>\n";
49979
49999
  //Copyright 2014 Globo.com Player authors. All rights reserved.
49980
50000
  // Use of this source code is governed by a BSD-style
49981
50001
  // license that can be found in the LICENSE file.
49982
- const T$6 = 'plugins.poster';
50002
+ const T$7 = 'plugins.poster';
49983
50003
  /**
49984
50004
  * `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped
49985
50005
  * @beta
@@ -50085,13 +50105,13 @@ class Poster extends UIContainerPlugin {
50085
50105
  * Disables the plugin, unmounting it from the DOM
50086
50106
  */
50087
50107
  disable() {
50088
- trace(`${T$6} disable`);
50108
+ trace(`${T$7} disable`);
50089
50109
  this.hasStartedPlaying = false;
50090
50110
  this.playRequested = false;
50091
50111
  super.disable();
50092
50112
  }
50093
50113
  onError(error) {
50094
- trace(`${T$6} onError`, {
50114
+ trace(`${T$7} onError`, {
50095
50115
  error,
50096
50116
  enabled: this.enabled,
50097
50117
  });
@@ -50104,18 +50124,18 @@ class Poster extends UIContainerPlugin {
50104
50124
  }
50105
50125
  }
50106
50126
  onPlay() {
50107
- trace(`${T$6} onPlay`);
50127
+ trace(`${T$7} onPlay`);
50108
50128
  this.hasStartedPlaying = true;
50109
50129
  this.playRequested = false;
50110
50130
  this.update();
50111
50131
  }
50112
50132
  onPlayIntent() {
50113
- trace(`${T$6} onPlayIntent`);
50133
+ trace(`${T$7} onPlayIntent`);
50114
50134
  this.playRequested = true;
50115
50135
  this.update();
50116
50136
  }
50117
50137
  onStop() {
50118
- trace(`${T$6} onStop`, {
50138
+ trace(`${T$7} onStop`, {
50119
50139
  enabled: this.enabled,
50120
50140
  });
50121
50141
  this.hasStartedPlaying = false;
@@ -50123,7 +50143,7 @@ class Poster extends UIContainerPlugin {
50123
50143
  this.update();
50124
50144
  }
50125
50145
  updatePlayButton(show) {
50126
- trace(`${T$6} updatePlayButton`, {
50146
+ trace(`${T$7} updatePlayButton`, {
50127
50147
  show,
50128
50148
  chromeless: this.options.chromeless,
50129
50149
  allowUserInteraction: this.options.allowUserInteraction,
@@ -50152,7 +50172,7 @@ class Poster extends UIContainerPlugin {
50152
50172
  this.$el.removeClass('clickable');
50153
50173
  }
50154
50174
  clicked() {
50155
- trace(`${T$6} clicked`, {
50175
+ trace(`${T$7} clicked`, {
50156
50176
  hasStartedPlaying: this.hasStartedPlaying,
50157
50177
  chromeless: this.options.chromeless,
50158
50178
  allowUserInteraction: this.options.allowUserInteraction,
@@ -50173,7 +50193,7 @@ class Poster extends UIContainerPlugin {
50173
50193
  return !this.container.playback.isAudioOnly;
50174
50194
  }
50175
50195
  update() {
50176
- trace(`${T$6} update`, {
50196
+ trace(`${T$7} update`, {
50177
50197
  shouldRender: this.shouldRender,
50178
50198
  });
50179
50199
  if (!this.shouldRender) {
@@ -50186,7 +50206,7 @@ class Poster extends UIContainerPlugin {
50186
50206
  this.updatePoster();
50187
50207
  }
50188
50208
  updatePoster() {
50189
- trace(`${T$6} updatePoster`, {
50209
+ trace(`${T$7} updatePoster`, {
50190
50210
  hasStartedPlaying: this.hasStartedPlaying,
50191
50211
  });
50192
50212
  if (!this.hasStartedPlaying) {
@@ -50201,7 +50221,7 @@ class Poster extends UIContainerPlugin {
50201
50221
  this.$el.show();
50202
50222
  }
50203
50223
  hidePoster() {
50204
- trace(`${T$6} hidePoster`, {
50224
+ trace(`${T$7} hidePoster`, {
50205
50225
  shouldHideOnPlay: this.shouldHideOnPlay(),
50206
50226
  });
50207
50227
  if (!this.options.disableMediaControl) {
@@ -50251,13 +50271,13 @@ class Poster extends UIContainerPlugin {
50251
50271
  }
50252
50272
  }
50253
50273
 
50254
- const buttonHtml = "<button class='gplayer-lite-btn gcore-skin-text-color gear-option' aria-haspopup=\"menu\">\n <span class=\"gear-option_icon<%= isHd ? '' : ' hidden' %>\"><%= hdIcon %></span>\n <span class=\"gear-option_label\"><%= i18n.t('quality') %></span>\n <span class='gear-option_value'><%= currentText %></span>\n <span class=\"gear-option_arrow-right-icon\"><%= arrowRightIcon %></span>\n</button>\n";
50274
+ const buttonHtml = "<button class='gplayer-lite-btn gcore-skin-text-color gear-option' aria-haspopup=\"menu\" id=\"quality-levels\">\n <span class=\"gear-option_icon<%= isHd ? '' : ' hidden' %>\"><%= hdIcon %></span>\n <span class=\"gear-option_label\"><%= i18n.t('quality') %></span>\n <span class='gear-option_value'><%= currentText %></span>\n <span class=\"gear-option_arrow-right-icon\"><%= arrowRightIcon %></span>\n</button>\n";
50255
50275
 
50256
50276
  const listHtml = "<button class=\"gplayer-lite-btn go-back gcore-skin-text-color\" id=\"level-selector-back-button\">\n <span class=\"arrow-left-icon\"><%= arrowLeftIcon %></span>\n <%= i18n.t('quality') %>\n</button>\n<ul class=\"gear-sub-menu quality-levels\" id=\"level-selector-menu\" role=\"menu\">\n <% if (!removeAuto) { %>\n <li>\n <a href=\"#\"\n class=\"gear-sub-menu_btn gcore-skin-text-color\"\n data-id=\"-1\"\n id=\"level_selector_auto\"\n aria-checked=\"<%= current === -1 %>\"\n role=\"menuitemradio\"\n >\n <span class=\"check-icon\"><%= checkIcon %></span>\n <%= i18n.t('auto') %>\n </a>\n </li>\n <% } %>\n <% for (const item of levels.slice().reverse()) {\n var disabled = maxLevel >= 0 && item.level > maxLevel\n var checked = item.level === current\n %>\n <li class=\"<%= disabled ? ' disabled' : ''%><%=checked ? ' current' : ''%>\">\n <a href=\"#\"\n class=\"gear-sub-menu_btn gcore-skin-text-color<%= checked ? ' gcore-skin-active' : '' %>\"\n data-id=\"<%= item.level %>\"\n aria-disabled=\"<%= disabled %>\"\n aria-checked=\"<%= checked %>\"\n role=\"menuitemradio\"\n id=\"level_selector_<%= item.width > item.height ? item.height : item.width %>\"\n >\n <span class=\"check-icon\"><%= checkIcon %></span>\n <%= labels[item.level] %>\n </a>\n </li>\n <% } %>\n</ul>\n";
50257
50277
 
50258
50278
  const hdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M14.9562 8.22232H13.9961V15.1873H14.9562C15.8914 15.1873 16.766 14.8253 17.4195 14.1676C18.0786 13.5037 18.4415 12.6281 18.4415 11.7026C18.4415 9.7837 16.8781 8.22253 14.9561 8.22253L14.9562 8.22232Z\"\n fill=\"#C9C9C9\"/>\n <path\n d=\"M22.0801 4H1.91994C0.859222 4 0 4.86406 0 5.91994V17.4878C0 18.5437 0.859222 19.4078 1.91994 19.4078H22.0801C23.1408 19.4078 24 18.5437 24 17.4878V5.91994C24 4.86406 23.1408 4 22.0801 4ZM10.3975 15.3473C10.3975 15.6124 10.1827 15.8272 9.91754 15.8272C9.65216 15.8272 9.43761 15.6122 9.43761 15.3473V12.0239H5.55956V15.3473C5.55956 15.6124 5.34481 15.8272 5.07963 15.8272C4.81425 15.8272 4.5997 15.6122 4.5997 15.3473L4.59949 7.74042C4.59949 7.47524 4.81425 7.26049 5.07943 7.26049C5.34481 7.26049 5.55936 7.47544 5.55936 7.74042V11.0636H9.43741V7.74042C9.43741 7.47524 9.65216 7.26049 9.91734 7.26049C10.1827 7.26049 10.3973 7.47544 10.3973 7.74042L10.3975 15.3473ZM18.1005 14.8438C17.2652 15.6844 16.1486 16.1472 14.9561 16.1472H13.5161C13.2507 16.1472 13.0361 15.9323 13.0361 15.6673V7.74263C13.0361 7.47745 13.2509 7.26269 13.5161 7.26269H14.9561C17.4072 7.26269 19.4013 9.25438 19.4013 11.7027C19.4013 12.8835 18.9392 13.9991 18.1005 14.844V14.8438Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
50259
50279
 
50260
- const T$5 = 'plugins.quality_levels';
50280
+ const T$6 = 'plugins.quality_levels';
50261
50281
  const VERSION$2 = 'v2.22.5';
50262
50282
  /**
50263
50283
  * `PLUGIN` that provides a UI to select the desired quality level of the playback.
@@ -50334,14 +50354,14 @@ class QualityLevels extends UICorePlugin {
50334
50354
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
50335
50355
  }
50336
50356
  onCoreReady() {
50337
- trace(`${T$5} onCoreReady`);
50357
+ trace(`${T$6} onCoreReady`);
50338
50358
  const gear = this.core.getPlugin('bottom_gear');
50339
50359
  assert(gear, 'bottom_gear plugin is required');
50340
50360
  this.currentText = this.core.i18n.t('auto');
50341
50361
  this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
50342
50362
  }
50343
50363
  onGearRendered() {
50344
- trace(`${T$5} onGearRendered`);
50364
+ trace(`${T$6} onGearRendered`);
50345
50365
  this.render();
50346
50366
  }
50347
50367
  onActiveContainerChange() {
@@ -50370,7 +50390,7 @@ class QualityLevels extends UICorePlugin {
50370
50390
  }
50371
50391
  }
50372
50392
  onStop() {
50373
- trace(`${T$5} onStop`);
50393
+ trace(`${T$6} onStop`);
50374
50394
  this.listenToOnce(this.core.activePlayback, Events$1.PLAYBACK_PLAY, () => {
50375
50395
  if (this.core.activePlayback.getPlaybackType() === 'live') {
50376
50396
  if (this.selectedLevelId !== -1) {
@@ -50466,7 +50486,7 @@ class QualityLevels extends UICorePlugin {
50466
50486
  return false;
50467
50487
  }
50468
50488
  goBack() {
50469
- trace(`${T$5} goBack`);
50489
+ trace(`${T$6} goBack`);
50470
50490
  this.core.getPlugin('bottom_gear').refresh();
50471
50491
  }
50472
50492
  setLevel(index) {
@@ -50501,11 +50521,11 @@ class QualityLevels extends UICorePlugin {
50501
50521
  return this.levelLabels[index] ?? formatLevelLabel(this.levels[index]);
50502
50522
  }
50503
50523
  onBitrate(info) {
50504
- trace(`${T$5} updateCurrentLevel`, { info });
50524
+ trace(`${T$6} updateCurrentLevel`, { info });
50505
50525
  this.highlightCurrentLevel();
50506
50526
  }
50507
50527
  highlightCurrentLevel() {
50508
- trace(`${T$5} highlightCurrentLevel`, {
50528
+ trace(`${T$6} highlightCurrentLevel`, {
50509
50529
  selectedLevelId: this.selectedLevelId,
50510
50530
  });
50511
50531
  this.allLevelElements()
@@ -50905,7 +50925,7 @@ const spinnerHTML = "<div data-bounce1></div>\n<div data-bounce2></div>\n<div da
50905
50925
  // Use of this source code is governed by a BSD-style
50906
50926
  // license that can be found in the LICENSE file.
50907
50927
  // https://github.com/clappr/clappr-plugins/blob/ffaa9d27005fa5a8a7c243ffc47eb5655b84b371/LICENSE
50908
- const T$4 = 'plugins.spinner';
50928
+ const T$5 = 'plugins.spinner';
50909
50929
  /**
50910
50930
  * Custom events emitted by the plugin
50911
50931
  * @public
@@ -50975,18 +50995,18 @@ class SpinnerThreeBounce extends UIContainerPlugin {
50975
50995
  this.hasBuffering = false;
50976
50996
  }
50977
50997
  onPlay() {
50978
- trace(`${T$4} onPlay`);
50998
+ trace(`${T$5} onPlay`);
50979
50999
  this._hide();
50980
51000
  }
50981
51001
  onStop() {
50982
- trace(`${T$4} onStop`, {
51002
+ trace(`${T$5} onStop`, {
50983
51003
  hasFatalError: this.hasFatalError,
50984
51004
  });
50985
51005
  this._hide();
50986
51006
  }
50987
51007
  onError(e) {
50988
51008
  this.hasFatalError = e.code === PlaybackErrorCode.MediaSourceUnavailable;
50989
- trace(`${T$4} onError`, {
51009
+ trace(`${T$5} onError`, {
50990
51010
  e,
50991
51011
  hasFatalError: this.hasFatalError,
50992
51012
  error: e.code,
@@ -51001,7 +51021,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
51001
51021
  * @param delay - The delay in milliseconds before the spinner is shown.
51002
51022
  */
51003
51023
  show(delay = 300) {
51004
- trace(`${T$4} show`);
51024
+ trace(`${T$5} show`);
51005
51025
  this.userShown = true;
51006
51026
  this._show(delay);
51007
51027
  }
@@ -51021,7 +51041,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
51021
51041
  }
51022
51042
  }
51023
51043
  _hide() {
51024
- trace(`${T$4} _hide`, {
51044
+ trace(`${T$5} _hide`, {
51025
51045
  userShown: this.userShown,
51026
51046
  });
51027
51047
  if (this.userShown) {
@@ -51038,7 +51058,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
51038
51058
  * @internal
51039
51059
  */
51040
51060
  render() {
51041
- trace(`${T$4} render`, {
51061
+ trace(`${T$5} render`, {
51042
51062
  buffering: this.container.buffering,
51043
51063
  });
51044
51064
  this.$el.html(this.template());
@@ -51056,7 +51076,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
51056
51076
  }
51057
51077
  }
51058
51078
 
51059
- const T$3 = 'plugins.source_controller';
51079
+ const T$4 = 'plugins.source_controller';
51060
51080
  const INITIAL_RETRY_DELAY = 1000;
51061
51081
  const MAX_RETRY_DELAY = 5000;
51062
51082
  const RETRY_DELAY_BLUR = 500;
@@ -51198,11 +51218,11 @@ class SourceController extends CorePlugin {
51198
51218
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
51199
51219
  }
51200
51220
  onCoreReady() {
51201
- trace(`${T$3} onCoreReady`);
51221
+ trace(`${T$4} onCoreReady`);
51202
51222
  this.core.getPlugin('error_screen')?.disable(); // TODO test
51203
51223
  }
51204
51224
  onActiveContainerChanged() {
51205
- trace(`${T$3} onActiveContainerChanged`, {
51225
+ trace(`${T$4} onActiveContainerChanged`, {
51206
51226
  retrying: this.active,
51207
51227
  currentSource: this.sourcesList[this.currentSourceIndex],
51208
51228
  });
@@ -51223,7 +51243,7 @@ class SourceController extends CorePlugin {
51223
51243
  }
51224
51244
  bindContainerEventListeners() {
51225
51245
  this.core.activePlayback.on(Events$1.PLAYBACK_ERROR, (error) => {
51226
- trace(`${T$3} on PLAYBACK_ERROR`, {
51246
+ trace(`${T$4} on PLAYBACK_ERROR`, {
51227
51247
  error: {
51228
51248
  code: error?.code,
51229
51249
  description: error?.description,
@@ -51244,7 +51264,7 @@ class SourceController extends CorePlugin {
51244
51264
  }
51245
51265
  });
51246
51266
  this.core.activePlayback.on(Events$1.PLAYBACK_PLAY, () => {
51247
- trace(`${T$3} on PLAYBACK_PLAY`, {
51267
+ trace(`${T$4} on PLAYBACK_PLAY`, {
51248
51268
  currentSource: this.sourcesList[this.currentSourceIndex],
51249
51269
  retrying: this.active,
51250
51270
  });
@@ -51260,7 +51280,7 @@ class SourceController extends CorePlugin {
51260
51280
  this.sourcesDelay = {};
51261
51281
  }
51262
51282
  retryPlayback() {
51263
- trace(`${T$3} retryPlayback enter`, {
51283
+ trace(`${T$4} retryPlayback enter`, {
51264
51284
  currentSourceIndex: this.currentSourceIndex,
51265
51285
  currentSource: this.sourcesList[this.currentSourceIndex],
51266
51286
  });
@@ -51268,20 +51288,20 @@ class SourceController extends CorePlugin {
51268
51288
  this.switching = true;
51269
51289
  this.core.activeContainer?.getPlugin('spinner')?.show(0);
51270
51290
  this.getNextMediaSource().then((nextSource) => {
51271
- trace(`${T$3} retryPlayback syncing...`, {
51291
+ trace(`${T$4} retryPlayback syncing...`, {
51272
51292
  nextSource,
51273
51293
  });
51274
51294
  const rnd = RETRY_DELAY_BLUR * Math.random();
51275
51295
  this.sync(() => {
51276
- trace(`${T$3} retryPlayback loading...`);
51296
+ trace(`${T$4} retryPlayback loading...`);
51277
51297
  this.switching = false;
51278
51298
  this.core.load(nextSource.source, nextSource.mimeType);
51279
- trace(`${T$3} retryPlayback loaded`, {
51299
+ trace(`${T$4} retryPlayback loaded`, {
51280
51300
  nextSource,
51281
51301
  });
51282
51302
  setTimeout(() => {
51283
51303
  this.core.activePlayback.play();
51284
- trace(`${T$3} retryPlayback playing`);
51304
+ trace(`${T$4} retryPlayback playing`);
51285
51305
  }, rnd);
51286
51306
  });
51287
51307
  });
@@ -51314,7 +51334,7 @@ const stringHTML = "<div class=\"cc-line\" id=\"cc-line\">\n <p></p>\n</div>\n"
51314
51334
 
51315
51335
  const VERSION = '2.19.14';
51316
51336
  const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
51317
- const T$2 = 'plugins.cc';
51337
+ const T$3 = 'plugins.cc';
51318
51338
  /**
51319
51339
  * `PLUGIN` that provides a UI to select the subtitles when available.
51320
51340
  * @beta
@@ -51397,14 +51417,14 @@ class ClosedCaptions extends UICorePlugin {
51397
51417
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
51398
51418
  }
51399
51419
  onCoreReady() {
51400
- trace(`${T$2} onCoreReady`);
51420
+ trace(`${T$3} onCoreReady`);
51401
51421
  const mediaControl = this.core.getPlugin('media_control');
51402
51422
  assert(mediaControl, 'media_control plugin is required');
51403
51423
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
51404
51424
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hideMenu);
51405
51425
  }
51406
51426
  onContainerChanged() {
51407
- trace(`${T$2} onContainerChanged`);
51427
+ trace(`${T$3} onContainerChanged`);
51408
51428
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_FULLSCREEN, this.playerResize);
51409
51429
  this.listenTo(this.core.activeContainer, 'container:advertisement:start', this.onStartAd);
51410
51430
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SUBTITLE_AVAILABLE, this.onSubtitleAvailable);
@@ -51424,11 +51444,11 @@ class ClosedCaptions extends UICorePlugin {
51424
51444
  });
51425
51445
  }
51426
51446
  onSubtitleAvailable() {
51427
- trace(`${T$2} onSubtitleAvailable`);
51447
+ trace(`${T$3} onSubtitleAvailable`);
51428
51448
  this.applyTracks();
51429
51449
  }
51430
51450
  onSubtitleChanged({ id }) {
51431
- trace(`${T$2} onSubtitleChanged`, { id });
51451
+ trace(`${T$3} onSubtitleChanged`, { id });
51432
51452
  if (id === -1) {
51433
51453
  this.clearSubtitleText();
51434
51454
  }
@@ -51478,7 +51498,7 @@ class ClosedCaptions extends UICorePlugin {
51478
51498
  this.stopListening(this.core.activeContainer, 'container:advertisement:finish', this.onFinishAd);
51479
51499
  }
51480
51500
  playerResize() {
51481
- trace(`${T$2} playerResize`);
51501
+ trace(`${T$3} playerResize`);
51482
51502
  const shouldShow = this.core.activeContainer &&
51483
51503
  isFullscreen(this.core.activeContainer.el) &&
51484
51504
  this.track &&
@@ -51568,7 +51588,7 @@ class ClosedCaptions extends UICorePlugin {
51568
51588
  }
51569
51589
  onItemSelect(event) {
51570
51590
  const id = event.target.dataset.ccSelect ?? '-1';
51571
- trace(`${T$2} onItemSelect`, { id });
51591
+ trace(`${T$3} onItemSelect`, { id });
51572
51592
  localStorage.setItem(LOCAL_STORAGE_CC_ID, id);
51573
51593
  this.selectItem(this.findById(Number(id)));
51574
51594
  return false;
@@ -51588,7 +51608,7 @@ class ClosedCaptions extends UICorePlugin {
51588
51608
  this.$('[data-cc] ul').hide();
51589
51609
  }
51590
51610
  toggleMenu() {
51591
- trace(`${T$2} toggleMenu`);
51611
+ trace(`${T$3} toggleMenu`);
51592
51612
  this.$('[data-cc] ul').toggle();
51593
51613
  }
51594
51614
  itemElement(id) {
@@ -51635,7 +51655,7 @@ class ClosedCaptions extends UICorePlugin {
51635
51655
  .removeClass('current')
51636
51656
  .find('a')
51637
51657
  .removeClass('gcore-skin-active');
51638
- trace(`${T$2} highlightCurrentSubtitles`, {
51658
+ trace(`${T$3} highlightCurrentSubtitles`, {
51639
51659
  track: this.track?.id,
51640
51660
  });
51641
51661
  const currentLevelElement = this.itemElement(this.track ? this.track.id : -1);
@@ -51653,7 +51673,7 @@ class ClosedCaptions extends UICorePlugin {
51653
51673
  // An example implementation of client side performancestatistics
51654
51674
  const WATCH_CUTOFF = 5;
51655
51675
  const STALL_MEASURE_PERIOD = 10;
51656
- const T$1 = 'plugins.telemetry';
51676
+ const T$2 = 'plugins.telemetry';
51657
51677
  /**
51658
51678
  * Telemetry event type
51659
51679
  * @beta
@@ -51763,7 +51783,7 @@ class Telemetry extends ContainerPlugin {
51763
51783
  }
51764
51784
  onReady() {
51765
51785
  this.sendInit();
51766
- trace(`${T$1} onReady`, {
51786
+ trace(`${T$2} onReady`, {
51767
51787
  autoPlay: this.options.autoPlay,
51768
51788
  });
51769
51789
  if (this.options.autoPlay) {
@@ -51944,7 +51964,7 @@ const parseSRT = /*@__PURE__*/getDefaultExportFromCjs$1(parseSrtExports);
51944
51964
 
51945
51965
  const pluginHtml = "<div class=\"thumbnails-text\"></div>\n<% if (backdropHeight) { %>\n <div class=\"backdrop\" style=\"height: <%= backdropHeight %>px;\">\n <div class=\"carousel\"></div>\n </div>\n<% }; %>\n<% if (spotlightHeight) { %>\n <div class=\"spotlight\" style=\"height: <%= spotlightHeight %>px;\">\n </div>\n<% }; %>\n";
51946
51966
 
51947
- const T = 'plugins.thumbnails';
51967
+ const T$1 = 'plugins.thumbnails';
51948
51968
  /**
51949
51969
  * `PLUGIN` that displays the thumbnails of the video when available.
51950
51970
  * @beta
@@ -52249,7 +52269,7 @@ class Thumbnails extends UICorePlugin {
52249
52269
  // calculate how far along the carousel should currently be slid
52250
52270
  // depending on where the user is hovering on the progress bar
52251
52271
  _updateCarousel() {
52252
- trace(`${T} _updateCarousel`, {
52272
+ trace(`${T$1} _updateCarousel`, {
52253
52273
  backdropHeight: this._getOptions().backdropHeight,
52254
52274
  });
52255
52275
  if (!this._getOptions().backdropHeight) {
@@ -52308,7 +52328,7 @@ class Thumbnails extends UICorePlugin {
52308
52328
  }
52309
52329
  }
52310
52330
  _updateSpotlightThumb() {
52311
- trace(`${T} _updateSpotlightThumb`, {
52331
+ trace(`${T$1} _updateSpotlightThumb`, {
52312
52332
  spotlightHeight: this._getOptions().spotlightHeight,
52313
52333
  });
52314
52334
  if (!this._getOptions().spotlightHeight) {
@@ -52353,7 +52373,7 @@ class Thumbnails extends UICorePlugin {
52353
52373
  return 0;
52354
52374
  }
52355
52375
  _renderPlugin() {
52356
- trace(`${T} _renderPlugin`, {
52376
+ trace(`${T$1} _renderPlugin`, {
52357
52377
  show: this._show,
52358
52378
  thumbsLoaded: this._thumbsLoaded,
52359
52379
  thumbs: this._thumbs.length,
@@ -52371,7 +52391,7 @@ class Thumbnails extends UICorePlugin {
52371
52391
  }
52372
52392
  }
52373
52393
  _createElements() {
52374
- trace(`${T} _createElements`);
52394
+ trace(`${T$1} _createElements`);
52375
52395
  this.$el.html(Thumbnails.template({
52376
52396
  backdropHeight: this._getOptions().backdropHeight,
52377
52397
  spotlightHeight: this._getOptions().spotlightHeight,
@@ -52394,100 +52414,104 @@ var VolumeFadeEvents;
52394
52414
  (function (VolumeFadeEvents) {
52395
52415
  VolumeFadeEvents["FADE"] = "core:volume:fade";
52396
52416
  })(VolumeFadeEvents || (VolumeFadeEvents = {}));
52417
+ const T = 'plugins.volume_fade';
52418
+ const DEFAULT_DURATION = 600;
52419
+ const DEFAULT_VOLUME_LEVEL = 80;
52397
52420
  /**
52398
- * `PLUGIN` that applies fade effect to the player's volume change.
52421
+ * `PLUGIN` that mutes the sound and fades it in when the mouse is over the player.
52399
52422
  * @beta
52423
+ *
52424
+ * @remarks
52425
+ * When the user moves the mouse over and away from the player, the sound is unmuted and unmuted with a fade effect.
52426
+ *
52427
+ * Depends on {@link MediaControl} plugin.
52428
+ * Configuration options - {@link VolumeFadeSettings}
52400
52429
  */
52401
52430
  class VolumeFade extends UICorePlugin {
52402
- _aboveBorderVolume = 0;
52403
- container = null;
52404
- delay = 0;
52405
- interval = null;
52431
+ activeVolume = 0;
52432
+ duration = 0;
52433
+ timerId = null;
52406
52434
  /**
52407
52435
  * @internal
52408
52436
  */
52409
52437
  get name() {
52410
52438
  return 'volume_fade';
52411
52439
  }
52440
+ constructor(core) {
52441
+ super(core);
52442
+ if (typeof this.options.volumeFade?.level === 'number') {
52443
+ this.activeVolume = this.options.volumeFade.level;
52444
+ }
52445
+ }
52412
52446
  /**
52413
52447
  * @internal
52414
52448
  */
52415
52449
  bindEvents() {
52416
- // TODO on container changed
52417
52450
  this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
52418
- if (this.core.mediaControl) {
52419
- this.listenTo(this.core.mediaControl, 'mediacontrol:volume:user', this._onUserChangeVolume);
52420
- }
52421
- // this.listenTo(this.core, 'core:volume:config', this._onVolumeConfig);
52422
- }
52423
- unBindEvents() {
52424
- this.core.$el.off('mouseleave.volume');
52425
- this.core.$el.off('mouseenter.volume');
52426
- }
52427
- _onUserChangeVolume(volume) {
52428
- this._aboveBorderVolume = volume;
52429
- }
52430
- _onVolumeConfig(value) {
52431
- this._aboveBorderVolume = value;
52432
- this.container?.setVolume(0);
52433
52451
  }
52434
52452
  onCoreReady() {
52435
- this.unBindEvents();
52436
- this.container = this.core.activeContainer;
52437
- if (this.core && this.core.$el) {
52438
- // TODO find out why options.playerElement instead of this.core.$el or this.container.$el
52439
- $(this.options.playerElement).on('mouseenter.volume', () => {
52440
- this.onEnter();
52441
- });
52442
- $(this.options.playerElement).on('mouseleave.volume', () => {
52443
- this.onLeave();
52444
- });
52445
- }
52446
- if (!this._aboveBorderVolume) {
52447
- this._aboveBorderVolume = this.container?.volume && !isNaN(this.container.volume) ? this.container.volume : 80;
52448
- }
52449
- if (this.options.mute || Browser.isMobile) {
52453
+ const mediaControl = this.core.getPlugin('media_control');
52454
+ if (Browser.isMobile) {
52450
52455
  this.destroy();
52451
52456
  return;
52452
52457
  }
52453
- this.delay = this.options.volumeFade && this.options.volumeFade.delay || 600;
52454
- this.container?.setVolume(0);
52458
+ if (mediaControl) {
52459
+ this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_VOLUME, this.onVolumeChange);
52460
+ }
52461
+ $(this.core.$el).on('mouseenter', () => this.onEnter());
52462
+ $(this.core.$el).on('mouseleave', () => this.onLeave());
52463
+ if (!this.activeVolume) {
52464
+ this.activeVolume =
52465
+ this.core.activeContainer?.volume &&
52466
+ !isNaN(this.core.activeContainer.volume)
52467
+ ? this.core.activeContainer.volume
52468
+ : DEFAULT_VOLUME_LEVEL;
52469
+ }
52470
+ this.duration = this.options.volumeFade?.duration || DEFAULT_DURATION;
52471
+ // TODO check if `mute` must be respected
52472
+ this.core.activeContainer?.setVolume(this.activeVolume);
52473
+ this.core.activePlayback.volume(0);
52474
+ }
52475
+ onVolumeChange(volume) {
52476
+ trace(`${T} onVolumeChange`, { volume });
52477
+ this.activeVolume = volume;
52455
52478
  }
52456
52479
  onEnter() {
52457
- this.numberTo(this.delay);
52480
+ trace(`${T} onEnter`);
52481
+ this.fade(this.duration, 1);
52458
52482
  }
52459
- numberTo(duration, contra = 0) {
52460
- this.clearCurrentInterval();
52483
+ onLeave() {
52484
+ trace(`${T} onLeave`);
52485
+ this.fade(this.duration, 0);
52486
+ }
52487
+ fade(duration, to) {
52488
+ this.stopFade();
52461
52489
  const start = new Date().getTime();
52462
- this.interval = setInterval(() => {
52463
- let now = (new Date().getTime()) - start;
52464
- if (now > duration) {
52465
- now = duration;
52466
- }
52467
- const progress = Math.abs(contra - now / duration);
52490
+ const from = 1 - to;
52491
+ this.timerId = setInterval(() => {
52492
+ const delta = new Date().getTime() - start;
52493
+ const progress = Math.min(1, delta / duration);
52494
+ const normVol = progress * to + (1 - progress) * from;
52495
+ const volume = normVol * this.activeVolume;
52496
+ this.core.activePlayback.volume(volume);
52468
52497
  try {
52469
- this.container?.setVolume(progress * this._aboveBorderVolume);
52470
- this.core.trigger(VolumeFadeEvents.FADE, progress * this._aboveBorderVolume);
52498
+ this.core.trigger(VolumeFadeEvents.FADE, volume);
52471
52499
  }
52472
52500
  catch (error) {
52473
- // LogManager.exception(error);
52474
52501
  reportError(error);
52475
- this.clearCurrentInterval();
52476
52502
  }
52477
- if (progress >= 1 || progress <= 0) {
52478
- this.clearCurrentInterval();
52503
+ if (progress >= 1) {
52504
+ this.stopFade();
52479
52505
  }
52480
52506
  }, 10);
52481
52507
  }
52482
- clearCurrentInterval() {
52483
- if (this.interval !== null) {
52484
- clearInterval(this.interval);
52485
- this.interval = null;
52508
+ stopFade() {
52509
+ trace(`${T} stopFade`);
52510
+ if (this.timerId !== null) {
52511
+ clearInterval(this.timerId);
52512
+ this.timerId = null;
52486
52513
  }
52487
52514
  }
52488
- onLeave() {
52489
- this.numberTo(this.delay, 1);
52490
- }
52491
52515
  }
52492
52516
 
52493
- export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
52517
+ export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, ExtendedEvents, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };