@gcorevideo/player 2.26.1 → 2.26.4

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 (84) hide show
  1. package/README.md +5 -5
  2. package/dist/core.js +1 -1
  3. package/dist/index.css +893 -893
  4. package/dist/index.embed.js +42 -29
  5. package/dist/index.js +52 -39
  6. package/dist/player.d.ts +14 -15
  7. package/docs/api/player.audiotracks.md +0 -3
  8. package/docs/api/player.contextmenu._constructor_.md +0 -3
  9. package/docs/api/player.contextmenu.md +1 -4
  10. package/docs/api/player.contextmenupluginsettings.md +1 -4
  11. package/docs/api/player.contextmenupluginsettings.options.md +0 -3
  12. package/docs/api/player.md +14 -14
  13. package/docs/api/player.mediacontrol._constructor_.md +0 -3
  14. package/docs/api/player.mediacontrol.currentseekpos.md +0 -3
  15. package/docs/api/player.mediacontrol.defaultsettings.md +0 -3
  16. package/docs/api/player.mediacontrol.disable.md +0 -3
  17. package/docs/api/player.mediacontrol.enable.md +0 -3
  18. package/docs/api/player.mediacontrol.extendsettings.md +0 -3
  19. package/docs/api/player.mediacontrol.getavailableheight.md +0 -3
  20. package/docs/api/player.mediacontrol.getavailablepopupheight.md +0 -3
  21. package/docs/api/player.mediacontrol.md +11 -22
  22. package/docs/api/player.mediacontrol.mount.md +0 -3
  23. package/docs/api/player.mediacontrol.muted.md +0 -3
  24. package/docs/api/player.mediacontrol.setinitialvolume.md +0 -3
  25. package/docs/api/player.mediacontrol.setvolume.md +0 -3
  26. package/docs/api/player.mediacontrol.slot.md +0 -3
  27. package/docs/api/player.mediacontrol.toggleelement.md +0 -3
  28. package/docs/api/player.mediacontrol.volume.md +0 -3
  29. package/docs/api/player.mediacontrolelement.md +0 -3
  30. package/docs/api/player.mediacontrolsettings.md +0 -3
  31. package/docs/api/player.mediacontrolslotmountpoint.md +0 -3
  32. package/docs/api/player.playbackrate._constructor_.md +0 -3
  33. package/docs/api/player.playbackrate.md +1 -4
  34. package/docs/api/player.seektime.attributes.md +0 -3
  35. package/docs/api/player.seektime.md +0 -9
  36. package/docs/api/player.seektime.name.md +0 -3
  37. package/docs/api/player.seektime.supportedversion.md +0 -3
  38. package/docs/api/player.seektimesettings.md +0 -3
  39. package/docs/api/player.standardmediacontrolelement.md +0 -3
  40. package/docs/api/player.thumbnails._constructor_.md +0 -3
  41. package/docs/api/player.thumbnails.md +1 -6
  42. package/docs/api/player.thumbnails.render.md +0 -3
  43. package/docs/api/player.thumbnailspluginsettings.md +0 -3
  44. package/docs/api/player.volumefade._constructor_.md +0 -3
  45. package/docs/api/player.volumefade.md +1 -4
  46. package/lib/plugins/audio-selector/AudioTracks.d.ts +1 -1
  47. package/lib/plugins/audio-selector/AudioTracks.js +1 -1
  48. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  49. package/lib/plugins/bottom-gear/BottomGear.js +3 -1
  50. package/lib/plugins/context-menu/ContextMenu.d.ts +2 -2
  51. package/lib/plugins/context-menu/ContextMenu.js +1 -1
  52. package/lib/plugins/level-selector/QualityLevels.js +1 -1
  53. package/lib/plugins/media-control/MediaControl.d.ts +5 -5
  54. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  55. package/lib/plugins/media-control/MediaControl.js +7 -6
  56. package/lib/plugins/playback-rate/PlaybackRate.d.ts +1 -1
  57. package/lib/plugins/playback-rate/PlaybackRate.js +1 -1
  58. package/lib/plugins/seek-time/SeekTime.d.ts +2 -3
  59. package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
  60. package/lib/plugins/seek-time/SeekTime.js +1 -1
  61. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  62. package/lib/plugins/source-controller/SourceController.js +16 -8
  63. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  64. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +4 -2
  65. package/lib/plugins/thumbnails/Thumbnails.d.ts +2 -2
  66. package/lib/plugins/thumbnails/Thumbnails.js +1 -1
  67. package/lib/plugins/volume-fade/VolumeFade.d.ts +1 -1
  68. package/lib/plugins/volume-fade/VolumeFade.js +1 -1
  69. package/package.json +1 -1
  70. package/release.txt +395 -0
  71. package/src/plugins/audio-selector/AudioTracks.ts +1 -1
  72. package/src/plugins/bottom-gear/BottomGear.ts +1 -0
  73. package/src/plugins/context-menu/ContextMenu.ts +2 -2
  74. package/src/plugins/level-selector/QualityLevels.ts +1 -1
  75. package/src/plugins/media-control/MediaControl.ts +13 -12
  76. package/src/plugins/playback-rate/PlaybackRate.ts +1 -1
  77. package/src/plugins/seek-time/SeekTime.ts +2 -3
  78. package/src/plugins/source-controller/SourceController.ts +19 -11
  79. package/src/plugins/source-controller/__tests__/SourceController.test.ts +31 -18
  80. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +4 -2
  81. package/src/plugins/thumbnails/Thumbnails.ts +2 -2
  82. package/src/plugins/volume-fade/VolumeFade.ts +1 -1
  83. package/temp/player.api.json +52 -52
  84. package/tsconfig.tsbuildinfo +1 -1
@@ -41681,7 +41681,7 @@ const AUTO = -1;
41681
41681
  const DEFAULT_RECOVER_ATTEMPTS = 16;
41682
41682
  Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
41683
41683
  Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
41684
- const T$6 = 'playback.hls';
41684
+ const T$7 = 'playback.hls';
41685
41685
  class HlsPlayback extends BasePlayback {
41686
41686
  _ccIsSetup = false;
41687
41687
  _ccTracksUpdated = false;
@@ -42005,7 +42005,7 @@ class HlsPlayback extends BasePlayback {
42005
42005
  }
42006
42006
  else {
42007
42007
  Log.error('hlsjs: failed to recover', { evt, data });
42008
- trace(`${T$6} _recover failed to recover`, {
42008
+ trace(`${T$7} _recover failed to recover`, {
42009
42009
  type: data.type,
42010
42010
  details: data.details,
42011
42011
  });
@@ -42091,7 +42091,7 @@ class HlsPlayback extends BasePlayback {
42091
42091
  this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
42092
42092
  }
42093
42093
  _onHLSJSError(evt, data) {
42094
- trace(`${T$6} _onHLSJSError`, {
42094
+ trace(`${T$7} _onHLSJSError`, {
42095
42095
  fatal: data.fatal,
42096
42096
  type: data.type,
42097
42097
  details: data.details,
@@ -42139,7 +42139,7 @@ class HlsPlayback extends BasePlayback {
42139
42139
  evt,
42140
42140
  data,
42141
42141
  });
42142
- trace(`${T$6} _onHLSJSError trying to recover from network error`, {
42142
+ trace(`${T$7} _onHLSJSError trying to recover from network error`, {
42143
42143
  details: data.details,
42144
42144
  });
42145
42145
  error.level = PlayerError.Levels.WARN;
@@ -42152,7 +42152,7 @@ class HlsPlayback extends BasePlayback {
42152
42152
  evt,
42153
42153
  data,
42154
42154
  });
42155
- trace(`${T$6} _onHLSJSError trying to recover from media error`, {
42155
+ trace(`${T$7} _onHLSJSError trying to recover from media error`, {
42156
42156
  details: data.details,
42157
42157
  });
42158
42158
  error.level = PlayerError.Levels.WARN;
@@ -42182,7 +42182,7 @@ class HlsPlayback extends BasePlayback {
42182
42182
  return;
42183
42183
  }
42184
42184
  Log.warn('hlsjs: non-fatal error occurred', { evt, data });
42185
- trace(`${T$6} _onHLSJSError non-fatal error occurred`, {
42185
+ trace(`${T$7} _onHLSJSError non-fatal error occurred`, {
42186
42186
  type: data.type,
42187
42187
  details: data.details,
42188
42188
  });
@@ -42657,7 +42657,7 @@ function registerPlaybacks() {
42657
42657
  Loader.registerPlayback(DashPlayback);
42658
42658
  }
42659
42659
 
42660
- const T$5 = 'gplayer';
42660
+ const T$6 = 'gplayer';
42661
42661
  const DEFAULT_OPTIONS = {
42662
42662
  autoPlay: false,
42663
42663
  debug: 'none',
@@ -42981,7 +42981,7 @@ class Player {
42981
42981
  // TODO test
42982
42982
  events = {
42983
42983
  onReady: () => {
42984
- trace(`${T$5} onReady`, {
42984
+ trace(`${T$6} onReady`, {
42985
42985
  ready: this.ready,
42986
42986
  });
42987
42987
  if (this.ready) {
@@ -43412,7 +43412,7 @@ const INITIAL_SETTINGS = {
43412
43412
  default: [],
43413
43413
  seekEnabled: false,
43414
43414
  };
43415
- // const T = 'plugins.media_control'
43415
+ const T$5 = 'plugins.media_control';
43416
43416
  /**
43417
43417
  * Extended events for the {@link MediaControl} plugin
43418
43418
  * @public
@@ -43425,7 +43425,7 @@ var ExtendedEvents;
43425
43425
  const { Config, Fullscreen, formatTime: formatTime$1, extend, removeArrayItem } = Utils;
43426
43426
  /**
43427
43427
  * `PLUGIN` that provides framework for building media control UI.
43428
- * @beta
43428
+ * @public
43429
43429
  * @remarks
43430
43430
  * The methods exposed are to be used by the other plugins that extend the media control UI.
43431
43431
  *
@@ -44030,7 +44030,10 @@ class MediaControl extends UICorePlugin {
44030
44030
  else {
44031
44031
  this.hideVolumeId = setTimeout(() => {
44032
44032
  this.hideVolumeId = null;
44033
- this.$volumeBarContainer.addClass('volume-bar-hide');
44033
+ trace(`${T$5} hideVolumeBar`, {
44034
+ volumeBarContainer: !!this.$volumeBarContainer,
44035
+ });
44036
+ this.$volumeBarContainer?.addClass('volume-bar-hide');
44034
44037
  }, timeout);
44035
44038
  }
44036
44039
  }
@@ -44472,8 +44475,6 @@ class MediaControl extends UICorePlugin {
44472
44475
  }
44473
44476
  const timeout = this.options.hideMediaControlDelay || 2000;
44474
44477
  this.$el.html(MediaControl.template({ settings: this.settings }));
44475
- // const style = Styler.getStyleFor(mediaControlStyle, { baseUrl: this.options.baseUrl });
44476
- // this.$el.append(style[0]);
44477
44478
  this.createCachedElements();
44478
44479
  this.drawDurationAndPosition();
44479
44480
  this.$playPauseToggle?.addClass('paused');
@@ -44640,7 +44641,7 @@ const VERSION$6 = '2.22.4';
44640
44641
  // const T = 'plugins.audiotracks'
44641
44642
  /**
44642
44643
  * `PLUGIN` that makes possible to switch audio tracks via the media control UI.
44643
- * @beta
44644
+ * @public
44644
44645
  * @remarks
44645
44646
  * The plugin is activated when there are multiple audio tracks available.
44646
44647
  * The plugin adds a button showing the current audio track and a dropdown to switch to another audio track.
@@ -45221,7 +45222,9 @@ class BottomGear extends UICorePlugin {
45221
45222
  assert(mediaControl, 'media_control plugin is required');
45222
45223
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
45223
45224
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.collapse);
45224
- this.listenTo(mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, () => {
45225
+ this.listenTo(mediaControl,
45226
+ // TODO ACTIVE_CONTAINER_CHANGED?
45227
+ Events$1.MEDIACONTROL_CONTAINERCHANGED, () => {
45225
45228
  this.bindContainerEvents(mediaControl.container);
45226
45229
  });
45227
45230
  this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_MENU_COLLAPSE, (from) => {
@@ -48238,7 +48241,7 @@ const templateHtml$1 = "<ul class=\"context-menu-list\" role=\"menu\" id=\"conte
48238
48241
 
48239
48242
  /**
48240
48243
  * `PLUGIN` that displays a small context menu when clicked on the player container.
48241
- * @beta
48244
+ * @public
48242
48245
  * @remarks
48243
48246
  * Configuration options - {@link ContextMenuPluginSettings}
48244
48247
  *
@@ -48718,7 +48721,7 @@ const DEFAULT_PLAYBACK_RATE = 1;
48718
48721
  const T$2 = 'plugins.playback_rate';
48719
48722
  /**
48720
48723
  * `PLUGIN` that allows changing the playback speed of the video.
48721
- * @beta
48724
+ * @public
48722
48725
  *
48723
48726
  * @remarks
48724
48727
  * Depends on:
@@ -49386,7 +49389,7 @@ class QualityLevels extends UICorePlugin {
49386
49389
  }));
49387
49390
  }
49388
49391
  get pluginOptions() {
49389
- return (this.core.options.qualityLevels || this.core.options.levelSelector || {});
49392
+ return (this.core.options.qualityLevels ?? this.core.options.levelSelector ?? {});
49390
49393
  }
49391
49394
  get maxLevel() {
49392
49395
  const maxRes = this.pluginOptions.restrictResolution;
@@ -49491,7 +49494,7 @@ const { formatTime } = Utils;
49491
49494
  // const T = 'plugins.seek_time'
49492
49495
  /**
49493
49496
  * `PLUGIN` that adds a seek time indicator when the mouse pointer is over the seek bar.
49494
- * @beta
49497
+ * @public
49495
49498
  * @remarks
49496
49499
  * Configuration options - {@link SeekTimeSettings}
49497
49500
  */
@@ -49862,8 +49865,10 @@ class SpinnerThreeBounce extends UIContainerPlugin {
49862
49865
  */
49863
49866
  render() {
49864
49867
  this.$el.html(this.template());
49865
- this.el.firstElementChild?.addEventListener('animationiteration', () => {
49866
- this.trigger(SpinnerEvents.SYNC);
49868
+ this.el.firstElementChild?.addEventListener('animationiteration', (event) => {
49869
+ this.trigger(SpinnerEvents.SYNC, {
49870
+ elapsedTime: event.elapsedTime,
49871
+ });
49867
49872
  });
49868
49873
  this.container.$el.append(this.$el[0]);
49869
49874
  if (this.container.buffering) {
@@ -50062,20 +50067,29 @@ class SourceController extends CorePlugin {
50062
50067
  break;
50063
50068
  }
50064
50069
  });
50065
- this.core.activePlayback.on(Events$1.PLAYBACK_PLAY, () => {
50066
- trace(`${T$1} on PLAYBACK_PLAY`, {
50070
+ // this.core.activePlayback.on(Events.PLAYBACK_PLAY, () => {
50071
+ // trace(`${T} on PLAYBACK_PLAY`, {
50072
+ // currentSource: this.sourcesList[this.currentSourceIndex],
50073
+ // retrying: this.active,
50074
+ // })
50075
+ // if (this.active) {
50076
+ // this.reset()
50077
+ // this.core.activeContainer?.getPlugin('poster')?.enable()
50078
+ // this.core.activeContainer?.getPlugin('spinner')?.hide()
50079
+ // }
50080
+ // })
50081
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAY, (_, { autoPlay }) => {
50082
+ trace(`${T$1} onContainerPlay`, {
50067
50083
  currentSource: this.sourcesList[this.currentSourceIndex],
50068
50084
  retrying: this.active,
50069
50085
  });
50086
+ this.autoPlay = !!autoPlay;
50070
50087
  if (this.active) {
50071
50088
  this.reset();
50072
50089
  this.core.activeContainer?.getPlugin('poster')?.enable();
50073
50090
  this.core.activeContainer?.getPlugin('spinner')?.hide();
50074
50091
  }
50075
50092
  });
50076
- this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAY, (_, { autoPlay }) => {
50077
- this.autoPlay = !!autoPlay;
50078
- });
50079
50093
  }
50080
50094
  reset() {
50081
50095
  this.active = false;
@@ -50096,8 +50110,7 @@ class SourceController extends CorePlugin {
50096
50110
  this.core.load(nextSource.source, nextSource.mimeType);
50097
50111
  setTimeout(() => {
50098
50112
  trace(`${T$1} retryPlayback playing`, {
50099
- autoPlay: this.autoPlay,
50100
- });
50113
+ autoPlay: this.autoPlay});
50101
50114
  this.core.activeContainer.play({
50102
50115
  autoPlay: this.autoPlay,
50103
50116
  });
@@ -50667,7 +50680,7 @@ function loadImageDimensions(url) {
50667
50680
 
50668
50681
  /**
50669
50682
  * `PLUGIN` that displays the thumbnails of the video when available.
50670
- * @beta
50683
+ * @public
50671
50684
  * @remarks
50672
50685
  * The plugin needs specially crafted VTT file with a thumbnail sprite sheet to work.
50673
50686
  * The VTT consist of timestamp records followed by a thumbnail area
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$d = 'playback.dash';
12683
+ const T$e = 'playback.dash';
12684
12684
  class DashPlayback extends BasePlayback {
12685
12685
  _levels = null;
12686
12686
  _currentLevel = null;
@@ -12954,7 +12954,7 @@ class DashPlayback extends BasePlayback {
12954
12954
  }
12955
12955
  _onPlaybackError = (event) => {
12956
12956
  // TODO
12957
- trace(`${T$d} _onPlaybackError`, { event });
12957
+ trace(`${T$e} _onPlaybackError`, { event });
12958
12958
  };
12959
12959
  _onDASHJSSError = (event) => {
12960
12960
  this._stopTimeUpdateTimer();
@@ -41840,7 +41840,7 @@ const AUTO = -1;
41840
41840
  const DEFAULT_RECOVER_ATTEMPTS = 16;
41841
41841
  Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
41842
41842
  Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
41843
- const T$c = 'playback.hls';
41843
+ const T$d = 'playback.hls';
41844
41844
  class HlsPlayback extends BasePlayback {
41845
41845
  _ccIsSetup = false;
41846
41846
  _ccTracksUpdated = false;
@@ -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$c} _recover failed to recover`, {
42167
+ trace(`${T$d} _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$c} _onHLSJSError`, {
42253
+ trace(`${T$d} _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$c} _onHLSJSError trying to recover from network error`, {
42301
+ trace(`${T$d} _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$c} _onHLSJSError trying to recover from media error`, {
42314
+ trace(`${T$d} _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$c} _onHLSJSError non-fatal error occurred`, {
42344
+ trace(`${T$d} _onHLSJSError non-fatal error occurred`, {
42345
42345
  type: data.type,
42346
42346
  details: data.details,
42347
42347
  });
@@ -42682,7 +42682,7 @@ class HlsPlayback extends BasePlayback {
42682
42682
  this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
42683
42683
  }
42684
42684
  _onAudioTrackSwitched(_, data) {
42685
- trace(`${T$c} onAudioTrackSwitched`);
42685
+ trace(`${T$d} onAudioTrackSwitched`);
42686
42686
  // @ts-ignore
42687
42687
  const track = this._hls.audioTracks[data.id];
42688
42688
  this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
@@ -42703,7 +42703,7 @@ function toClapprTrack(t) {
42703
42703
  };
42704
42704
  }
42705
42705
 
42706
- const T$b = 'playback.html5_video';
42706
+ const T$c = 'playback.html5_video';
42707
42707
  const STALL_TIMEOUT = 15000;
42708
42708
  class HTML5Video extends BasePlayback {
42709
42709
  stallTimerId = null;
@@ -42802,7 +42802,7 @@ class HTML5Video extends BasePlayback {
42802
42802
  switchAudioTrack(id) {
42803
42803
  const tracks = this.el.audioTracks;
42804
42804
  const supported = !!tracks;
42805
- trace(`${T$b} switchAudioTrack`, {
42805
+ trace(`${T$c} switchAudioTrack`, {
42806
42806
  supported,
42807
42807
  });
42808
42808
  if (supported) {
@@ -42821,7 +42821,7 @@ function registerPlaybacks() {
42821
42821
  Loader.registerPlayback(DashPlayback);
42822
42822
  }
42823
42823
 
42824
- const T$a = 'gplayer';
42824
+ const T$b = 'gplayer';
42825
42825
  const DEFAULT_OPTIONS = {
42826
42826
  autoPlay: false,
42827
42827
  debug: 'none',
@@ -43130,7 +43130,7 @@ class Player {
43130
43130
  }
43131
43131
  }
43132
43132
  triggerAutoPlay() {
43133
- trace(`${T$a} triggerAutoPlay`);
43133
+ trace(`${T$b} triggerAutoPlay`);
43134
43134
  setTimeout(() => {
43135
43135
  this.player?.play({
43136
43136
  autoPlay: true,
@@ -43148,7 +43148,7 @@ class Player {
43148
43148
  // TODO test
43149
43149
  events = {
43150
43150
  onReady: () => {
43151
- trace(`${T$a} onReady`, {
43151
+ trace(`${T$b} onReady`, {
43152
43152
  ready: this.ready,
43153
43153
  });
43154
43154
  if (this.ready) {
@@ -43182,7 +43182,7 @@ class Player {
43182
43182
  buildCoreOptions(rootNode) {
43183
43183
  const sources = this.buildMediaSourcesList();
43184
43184
  const source = sources[0];
43185
- trace(`${T$a} buildCoreOptions`, {
43185
+ trace(`${T$b} buildCoreOptions`, {
43186
43186
  source,
43187
43187
  sources,
43188
43188
  });
@@ -43259,7 +43259,7 @@ class Player {
43259
43259
  }
43260
43260
  }
43261
43261
 
43262
- var version$1 = "2.26.1";
43262
+ var version$1 = "2.26.4";
43263
43263
 
43264
43264
  var packages = {
43265
43265
  "node_modules/@clappr/core": {
@@ -43595,7 +43595,7 @@ const INITIAL_SETTINGS = {
43595
43595
  default: [],
43596
43596
  seekEnabled: false,
43597
43597
  };
43598
- // const T = 'plugins.media_control'
43598
+ const T$a = 'plugins.media_control';
43599
43599
  /**
43600
43600
  * Extended events for the {@link MediaControl} plugin
43601
43601
  * @public
@@ -43608,7 +43608,7 @@ var ExtendedEvents;
43608
43608
  const { Config, Fullscreen, formatTime: formatTime$1, extend, removeArrayItem } = Utils;
43609
43609
  /**
43610
43610
  * `PLUGIN` that provides framework for building media control UI.
43611
- * @beta
43611
+ * @public
43612
43612
  * @remarks
43613
43613
  * The methods exposed are to be used by the other plugins that extend the media control UI.
43614
43614
  *
@@ -44214,7 +44214,10 @@ class MediaControl extends UICorePlugin {
44214
44214
  else {
44215
44215
  this.hideVolumeId = setTimeout(() => {
44216
44216
  this.hideVolumeId = null;
44217
- this.$volumeBarContainer.addClass('volume-bar-hide');
44217
+ trace(`${T$a} hideVolumeBar`, {
44218
+ volumeBarContainer: !!this.$volumeBarContainer,
44219
+ });
44220
+ this.$volumeBarContainer?.addClass('volume-bar-hide');
44218
44221
  }, timeout);
44219
44222
  }
44220
44223
  }
@@ -44656,8 +44659,6 @@ class MediaControl extends UICorePlugin {
44656
44659
  }
44657
44660
  const timeout = this.options.hideMediaControlDelay || 2000;
44658
44661
  this.$el.html(MediaControl.template({ settings: this.settings }));
44659
- // const style = Styler.getStyleFor(mediaControlStyle, { baseUrl: this.options.baseUrl });
44660
- // this.$el.append(style[0]);
44661
44662
  this.createCachedElements();
44662
44663
  this.drawDurationAndPosition();
44663
44664
  this.$playPauseToggle?.addClass('paused');
@@ -44824,7 +44825,7 @@ const VERSION$7 = '2.22.4';
44824
44825
  // const T = 'plugins.audiotracks'
44825
44826
  /**
44826
44827
  * `PLUGIN` that makes possible to switch audio tracks via the media control UI.
44827
- * @beta
44828
+ * @public
44828
44829
  * @remarks
44829
44830
  * The plugin is activated when there are multiple audio tracks available.
44830
44831
  * The plugin adds a button showing the current audio track and a dropdown to switch to another audio track.
@@ -45403,7 +45404,9 @@ class BottomGear extends UICorePlugin {
45403
45404
  assert(mediaControl, 'media_control plugin is required');
45404
45405
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
45405
45406
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.collapse);
45406
- this.listenTo(mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, () => {
45407
+ this.listenTo(mediaControl,
45408
+ // TODO ACTIVE_CONTAINER_CHANGED?
45409
+ Events$1.MEDIACONTROL_CONTAINERCHANGED, () => {
45407
45410
  this.bindContainerEvents(mediaControl.container);
45408
45411
  });
45409
45412
  this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_MENU_COLLAPSE, (from) => {
@@ -48679,7 +48682,7 @@ const templateHtml$1 = "<ul class=\"context-menu-list\" role=\"menu\" id=\"conte
48679
48682
 
48680
48683
  /**
48681
48684
  * `PLUGIN` that displays a small context menu when clicked on the player container.
48682
- * @beta
48685
+ * @public
48683
48686
  * @remarks
48684
48687
  * Configuration options - {@link ContextMenuPluginSettings}
48685
48688
  *
@@ -49945,7 +49948,7 @@ const DEFAULT_PLAYBACK_RATE = 1;
49945
49948
  const T$5 = 'plugins.playback_rate';
49946
49949
  /**
49947
49950
  * `PLUGIN` that allows changing the playback speed of the video.
49948
- * @beta
49951
+ * @public
49949
49952
  *
49950
49953
  * @remarks
49951
49954
  * Depends on:
@@ -50614,7 +50617,7 @@ class QualityLevels extends UICorePlugin {
50614
50617
  }));
50615
50618
  }
50616
50619
  get pluginOptions() {
50617
- return (this.core.options.qualityLevels || this.core.options.levelSelector || {});
50620
+ return (this.core.options.qualityLevels ?? this.core.options.levelSelector ?? {});
50618
50621
  }
50619
50622
  get maxLevel() {
50620
50623
  const maxRes = this.pluginOptions.restrictResolution;
@@ -50717,7 +50720,7 @@ const { formatTime } = Utils;
50717
50720
  // const T = 'plugins.seek_time'
50718
50721
  /**
50719
50722
  * `PLUGIN` that adds a seek time indicator when the mouse pointer is over the seek bar.
50720
- * @beta
50723
+ * @public
50721
50724
  * @remarks
50722
50725
  * Configuration options - {@link SeekTimeSettings}
50723
50726
  */
@@ -51211,8 +51214,10 @@ class SpinnerThreeBounce extends UIContainerPlugin {
51211
51214
  */
51212
51215
  render() {
51213
51216
  this.$el.html(this.template());
51214
- this.el.firstElementChild?.addEventListener('animationiteration', () => {
51215
- this.trigger(SpinnerEvents.SYNC);
51217
+ this.el.firstElementChild?.addEventListener('animationiteration', (event) => {
51218
+ this.trigger(SpinnerEvents.SYNC, {
51219
+ elapsedTime: event.elapsedTime,
51220
+ });
51216
51221
  });
51217
51222
  this.container.$el.append(this.$el[0]);
51218
51223
  if (this.container.buffering) {
@@ -51411,23 +51416,30 @@ class SourceController extends CorePlugin {
51411
51416
  break;
51412
51417
  }
51413
51418
  });
51414
- this.core.activePlayback.on(Events$1.PLAYBACK_PLAY, () => {
51415
- trace(`${T$4} on PLAYBACK_PLAY`, {
51419
+ // this.core.activePlayback.on(Events.PLAYBACK_PLAY, () => {
51420
+ // trace(`${T} on PLAYBACK_PLAY`, {
51421
+ // currentSource: this.sourcesList[this.currentSourceIndex],
51422
+ // retrying: this.active,
51423
+ // })
51424
+ // if (this.active) {
51425
+ // this.reset()
51426
+ // this.core.activeContainer?.getPlugin('poster')?.enable()
51427
+ // this.core.activeContainer?.getPlugin('spinner')?.hide()
51428
+ // }
51429
+ // })
51430
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAY, (_, { autoPlay }) => {
51431
+ trace(`${T$4} onContainerPlay`, {
51432
+ autoPlay,
51416
51433
  currentSource: this.sourcesList[this.currentSourceIndex],
51417
51434
  retrying: this.active,
51418
51435
  });
51436
+ this.autoPlay = !!autoPlay;
51419
51437
  if (this.active) {
51420
51438
  this.reset();
51421
51439
  this.core.activeContainer?.getPlugin('poster')?.enable();
51422
51440
  this.core.activeContainer?.getPlugin('spinner')?.hide();
51423
51441
  }
51424
51442
  });
51425
- this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAY, (_, { autoPlay }) => {
51426
- trace(`${T$4} onContainerPlay`, {
51427
- autoPlay,
51428
- });
51429
- this.autoPlay = !!autoPlay;
51430
- });
51431
51443
  }
51432
51444
  reset() {
51433
51445
  this.active = false;
@@ -51455,6 +51467,7 @@ class SourceController extends CorePlugin {
51455
51467
  setTimeout(() => {
51456
51468
  trace(`${T$4} retryPlayback playing`, {
51457
51469
  autoPlay: this.autoPlay,
51470
+ nextSource,
51458
51471
  });
51459
51472
  this.core.activeContainer.play({
51460
51473
  autoPlay: this.autoPlay,
@@ -52191,7 +52204,7 @@ function loadImageDimensions(url) {
52191
52204
  const T$1 = 'plugins.thumbnails';
52192
52205
  /**
52193
52206
  * `PLUGIN` that displays the thumbnails of the video when available.
52194
- * @beta
52207
+ * @public
52195
52208
  * @remarks
52196
52209
  * The plugin needs specially crafted VTT file with a thumbnail sprite sheet to work.
52197
52210
  * The VTT consist of timestamp records followed by a thumbnail area
@@ -52553,7 +52566,7 @@ const DEFAULT_DURATION = 600;
52553
52566
  const DEFAULT_VOLUME_LEVEL = 80;
52554
52567
  /**
52555
52568
  * `PLUGIN` that mutes the sound and fades it in when the mouse is over the player.
52556
- * @beta
52569
+ * @public
52557
52570
  *
52558
52571
  * @remarks
52559
52572
  * When the user moves the mouse over and away from the player, the sound is unmuted and unmuted with a fade effect.
package/dist/player.d.ts CHANGED
@@ -43,7 +43,7 @@ import { UIObject } from '@clappr/core';
43
43
 
44
44
  /**
45
45
  * `PLUGIN` that makes possible to switch audio tracks via the media control UI.
46
- * @beta
46
+ * @public
47
47
  * @remarks
48
48
  * The plugin is activated when there are multiple audio tracks available.
49
49
  * The plugin adds a button showing the current audio track and a dropdown to switch to another audio track.
@@ -814,7 +814,7 @@ export declare class ClapprStats extends ContainerPlugin {
814
814
 
815
815
  /**
816
816
  * `PLUGIN` that displays a small context menu when clicked on the player container.
817
- * @beta
817
+ * @public
818
818
  * @remarks
819
819
  * Configuration options - {@link ContextMenuPluginSettings}
820
820
  *
@@ -868,7 +868,7 @@ export declare class ClapprStats extends ContainerPlugin {
868
868
 
869
869
  /**
870
870
  * Context menu plugin settings
871
- * @beta
871
+ * @public
872
872
  */
873
873
  export declare interface ContextMenuPluginSettings {
874
874
  options?: MenuOption[];
@@ -1193,7 +1193,7 @@ export declare class ClapprStats extends ContainerPlugin {
1193
1193
 
1194
1194
  /**
1195
1195
  * `PLUGIN` that provides framework for building media control UI.
1196
- * @beta
1196
+ * @public
1197
1197
  * @remarks
1198
1198
  * The methods exposed are to be used by the other plugins that extend the media control UI.
1199
1199
  *
@@ -1524,7 +1524,7 @@ export declare class ClapprStats extends ContainerPlugin {
1524
1524
  /**
1525
1525
  * Media control element.
1526
1526
  * Each element's token in the media control layout settings determines where the element is rendered.
1527
- * @beta
1527
+ * @public
1528
1528
  * @remarks
1529
1529
  * Standard media control elements are defined in the {@link StandardMediaControlElement} type.
1530
1530
  * Custom media control elements can be identified by a unique token.
@@ -1535,7 +1535,7 @@ export declare class ClapprStats extends ContainerPlugin {
1535
1535
  * Specifies the layout of media control elements.
1536
1536
  * Actual elements will be rendered according to the playback settings. Custom elements rendered by the plugins
1537
1537
  * will be mounted at the specified locations.
1538
- * @beta
1538
+ * @public
1539
1539
  */
1540
1540
  export declare type MediaControlSettings = {
1541
1541
  left: MediaControlElement[];
@@ -1546,7 +1546,7 @@ export declare class ClapprStats extends ContainerPlugin {
1546
1546
 
1547
1547
  /**
1548
1548
  * Identifies a location for mounting custom media control elements.
1549
- * @beta
1549
+ * @public
1550
1550
  */
1551
1551
  export declare type MediaControlSlotMountPoint = 'root' | 'base' | 'left' | 'right' | 'center' | 'seekbar';
1552
1552
 
@@ -1836,7 +1836,7 @@ export declare class ClapprStats extends ContainerPlugin {
1836
1836
 
1837
1837
  /**
1838
1838
  * `PLUGIN` that allows changing the playback speed of the video.
1839
- * @beta
1839
+ * @public
1840
1840
  *
1841
1841
  * @remarks
1842
1842
  * Depends on:
@@ -2626,7 +2626,7 @@ export declare class ClapprStats extends ContainerPlugin {
2626
2626
 
2627
2627
  /**
2628
2628
  * `PLUGIN` that adds a seek time indicator when the mouse pointer is over the seek bar.
2629
- * @beta
2629
+ * @public
2630
2630
  * @remarks
2631
2631
  * Configuration options - {@link SeekTimeSettings}
2632
2632
  */
@@ -2668,12 +2668,11 @@ export declare class ClapprStats extends ContainerPlugin {
2668
2668
 
2669
2669
  /**
2670
2670
  * Configuration options for the SeekTime plugin.
2671
- * @beta
2671
+ * @public
2672
2672
  */
2673
2673
  export declare type SeekTimeSettings = {
2674
2674
  /**
2675
2675
  * Whether to show the duration of the video. Applies only to the VOD streams.
2676
- * @beta
2677
2676
  */
2678
2677
  duration?: boolean;
2679
2678
  };
@@ -2951,7 +2950,7 @@ export declare class ClapprStats extends ContainerPlugin {
2951
2950
 
2952
2951
  /**
2953
2952
  * Built-in media control elements.
2954
- * @beta
2953
+ * @public
2955
2954
  */
2956
2955
  export declare type StandardMediaControlElement = 'duration' | 'fullscreen' | 'hd-indicator' | 'playpause' | 'playstop' | 'position' | 'seekbar' | 'volume';
2957
2956
 
@@ -3080,7 +3079,7 @@ export declare class ClapprStats extends ContainerPlugin {
3080
3079
 
3081
3080
  /**
3082
3081
  * `PLUGIN` that displays the thumbnails of the video when available.
3083
- * @beta
3082
+ * @public
3084
3083
  * @remarks
3085
3084
  * The plugin needs specially crafted VTT file with a thumbnail sprite sheet to work.
3086
3085
  * The VTT consist of timestamp records followed by a thumbnail area
@@ -3161,7 +3160,7 @@ export declare class ClapprStats extends ContainerPlugin {
3161
3160
 
3162
3161
  /**
3163
3162
  * Plugin configuration options for the thumbnails plugin.
3164
- * @beta
3163
+ * @public
3165
3164
  */
3166
3165
  export declare type ThumbnailsPluginSettings = {
3167
3166
  backdropHeight?: number;
@@ -3273,7 +3272,7 @@ export declare class ClapprStats extends ContainerPlugin {
3273
3272
 
3274
3273
  /**
3275
3274
  * `PLUGIN` that mutes the sound and fades it in when the mouse is over the player.
3276
- * @beta
3275
+ * @public
3277
3276
  *
3278
3277
  * @remarks
3279
3278
  * When the user moves the mouse over and away from the player, the sound is unmuted and unmuted with a fade effect.
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## AudioTracks class
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
  `PLUGIN` that makes possible to switch audio tracks via the media control UI.
11
8
 
12
9
  **Signature:**
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## ContextMenu.(constructor)
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
  Constructs a new instance of the `ContextMenu` class
11
8
 
12
9
  **Signature:**