@gcorevideo/player 2.20.7 → 2.20.8

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 (49) hide show
  1. package/dist/core.js +37 -13
  2. package/dist/index.css +1343 -1343
  3. package/dist/index.js +241 -217
  4. package/dist/plugins/index.css +475 -475
  5. package/dist/plugins/index.js +152 -154
  6. package/lib/playback/BasePlayback.d.ts +5 -0
  7. package/lib/playback/BasePlayback.d.ts.map +1 -1
  8. package/lib/playback/BasePlayback.js +8 -0
  9. package/lib/playback/HTML5Video.d.ts +4 -0
  10. package/lib/playback/HTML5Video.d.ts.map +1 -0
  11. package/lib/playback/HTML5Video.js +3 -0
  12. package/lib/playback/dash-playback/DashPlayback.d.ts +1 -0
  13. package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
  14. package/lib/playback/dash-playback/DashPlayback.js +6 -2
  15. package/lib/playback/index.d.ts.map +1 -1
  16. package/lib/playback/index.js +2 -0
  17. package/lib/playback/types.d.ts +9 -0
  18. package/lib/playback/types.d.ts.map +1 -0
  19. package/lib/playback/types.js +9 -0
  20. package/lib/plugins/bottom-gear/BottomGear.d.ts +6 -11
  21. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  22. package/lib/plugins/bottom-gear/BottomGear.js +5 -14
  23. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +2 -2
  24. package/lib/plugins/dvr-controls/DvrControls.d.ts +1 -1
  25. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  26. package/lib/plugins/dvr-controls/DvrControls.js +27 -16
  27. package/lib/plugins/level-selector/LevelSelector.d.ts +2 -0
  28. package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
  29. package/lib/plugins/level-selector/LevelSelector.js +14 -3
  30. package/lib/plugins/media-control/MediaControl.d.ts +1 -0
  31. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  32. package/lib/plugins/media-control/MediaControl.js +5 -3
  33. package/lib/plugins/playback-rate/PlaybackRate.d.ts +11 -10
  34. package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
  35. package/lib/plugins/playback-rate/PlaybackRate.js +83 -91
  36. package/package.json +1 -1
  37. package/src/playback/BasePlayback.ts +12 -4
  38. package/src/playback/HTML5Video.ts +3 -0
  39. package/src/playback/dash-playback/DashPlayback.ts +15 -11
  40. package/src/playback/index.ts +2 -1
  41. package/src/playback/types.ts +9 -0
  42. package/src/plugins/bottom-gear/BottomGear.ts +6 -15
  43. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +3 -3
  44. package/src/plugins/dvr-controls/DvrControls.ts +87 -54
  45. package/src/plugins/level-selector/LevelSelector.ts +17 -5
  46. package/src/plugins/media-control/MediaControl.ts +9 -6
  47. package/src/plugins/playback-rate/PlaybackRate.ts +89 -105
  48. package/tsconfig.tsbuildinfo +1 -1
  49. package/assets/playback-rate/playback-rate-selector.ejs +0 -9
@@ -31427,7 +31427,7 @@ function timelineConfig() {
31427
31427
  // export const CLAPPR_VERSION: string = process.env.CLAPPR_VERSION || '0.11.3';
31428
31428
  const CLAPPR_VERSION = '0.11.3';
31429
31429
 
31430
- const pluginHtml$8 = "<button data-track-selector-button class='gcore-skin-button-color'>\n <span class='audio-text'><%= title %></span> <span class=\"audio-arrow\"></span>\n</button>\n<ul class='gcore-skin-bg-color'>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li>\n <a href=\"#\" class='gcore-skin-text-color' data-track-selector-select=\"<%= tracks[i].id %>\">\n <%= tracks[i].label || tracks[i].name %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
31430
+ const pluginHtml$7 = "<button data-track-selector-button class='gcore-skin-button-color'>\n <span class='audio-text'><%= title %></span> <span class=\"audio-arrow\"></span>\n</button>\n<ul class='gcore-skin-bg-color'>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li>\n <a href=\"#\" class='gcore-skin-text-color' data-track-selector-select=\"<%= tracks[i].id %>\">\n <%= tracks[i].label || tracks[i].name %>\n </a>\n </li>\n <% }; %>\n</ul>\n";
31431
31431
 
31432
31432
  const audioArrow = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"9px\" height=\"6px\" viewBox=\"0 0 9 6\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <!-- Generator: Sketch 49 (51002) - http://www.bohemiancoding.com/sketch -->\n <title>quality-arrow</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id=\"quality-arrow\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path\n d=\"M5.07079194,5.78553848 C4.91457318,5.94277844 4.70551573,6.00941824 4.50028717,5.99893557 C4.2950586,6.00941824 4.08676693,5.94277844 3.92978239,5.78553848 L0.221118462,1.2997069 C-0.0737061539,1.00469478 -0.0737061539,0.526236029 0.221118462,0.231972666 C0.515177299,-0.0630394586 1.23500883,0.00734414472 1.64852907,0.00734414472 L7.77475484,0.00734414472 C8.21201421,0.00734414472 8.48539703,-0.0630394586 8.77945587,0.231972666 C9.07351471,0.526236029 9.07351471,1.00469478 8.77945587,1.2997069 L5.07079194,5.78553848 Z\"\n fill=\"#FFFFFE\"></path>\n </g>\n</svg>\n";
31433
31433
 
@@ -32366,7 +32366,7 @@ class AudioSelector extends UICorePlugin {
32366
32366
  static get version() {
32367
32367
  return VERSION$6;
32368
32368
  }
32369
- static template = tmpl(pluginHtml$8);
32369
+ static template = tmpl(pluginHtml$7);
32370
32370
  /**
32371
32371
  * @internal
32372
32372
  */
@@ -32647,9 +32647,9 @@ function trace(msg, data = {}) {
32647
32647
 
32648
32648
  const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M5.50025 8.00025C4.67125 8.00025 4.00025 8.67225 4.00025 9.50025V14.5003C4.00025 15.3283 4.67125 16.0003 5.50025 16.0003H7.24824C7.65024 16.0003 8.03627 16.1613 8.31727 16.4483L12.5443 20.7413C12.7083 20.9073 12.9262 20.9963 13.1492 20.9963C13.2572 20.9963 13.3672 20.9763 13.4722 20.9333C13.7932 20.8013 14.0003 20.4923 14.0003 20.1462V16.3283C14.0003 16.1963 13.9473 16.0683 13.8543 15.9753L6.02528 8.14625C5.93228 8.05325 5.80425 8.00025 5.67225 8.00025H5.50025ZM14.0003 3.85426C14.0003 3.50826 13.7932 3.19927 13.4722 3.06727C13.1502 2.93627 12.7873 3.01226 12.5443 3.25926L9.33827 6.51527C9.14627 6.71127 9.14626 7.02625 9.34126 7.22025L13.5733 11.4522C13.7313 11.6102 14.0003 11.4982 14.0003 11.2752V3.85426ZM20.8543 20.8543C20.7563 20.9513 20.6283 21.0003 20.5003 21.0003C20.3723 21.0003 20.2442 20.9513 20.1462 20.8543L3.14625 3.85426C2.95125 3.65826 2.95125 3.34225 3.14625 3.14625C3.34225 2.95125 3.65826 2.95125 3.85426 3.14625L20.8543 20.1462C21.0493 20.3422 21.0493 20.6583 20.8543 20.8543Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
32649
32649
 
32650
- const pluginHtml$7 = "<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";
32650
+ 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";
32651
32651
 
32652
- const T$a = 'plugins.big_mute_button';
32652
+ const T$c = 'plugins.big_mute_button';
32653
32653
  // TODO rewrite as a container plugin
32654
32654
  /**
32655
32655
  * Displays a big mute button over the video when it's muted.
@@ -32673,7 +32673,7 @@ class BigMuteButton extends UICorePlugin {
32673
32673
  get supportedVersion() {
32674
32674
  return { min: CLAPPR_VERSION };
32675
32675
  }
32676
- static template = tmpl(pluginHtml$7);
32676
+ static template = tmpl(pluginHtml$6);
32677
32677
  /**
32678
32678
  * @internal
32679
32679
  */
@@ -32691,7 +32691,7 @@ class BigMuteButton extends UICorePlugin {
32691
32691
  this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
32692
32692
  this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
32693
32693
  this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
32694
- trace(`${T$a} bindEvents`, {
32694
+ trace(`${T$c} bindEvents`, {
32695
32695
  mediacontrol: !!this.core.mediaControl,
32696
32696
  });
32697
32697
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
@@ -32748,7 +32748,7 @@ class BigMuteButton extends UICorePlugin {
32748
32748
  */
32749
32749
  render() {
32750
32750
  if (this.shouldRender()) {
32751
- trace(`${T$a} render`, {
32751
+ trace(`${T$c} render`, {
32752
32752
  el: !!this.$el,
32753
32753
  });
32754
32754
  this.$el.html(BigMuteButton.template());
@@ -32787,7 +32787,7 @@ class BigMuteButton extends UICorePlugin {
32787
32787
  }
32788
32788
  }
32789
32789
 
32790
- const pluginHtml$6 = "<div class=\"media-control-gear\" data-<%= name %>>\n <button type=\"button\" class=\"button-gear gplayer-lite-btn gcore-skin-button-color\" data-gear-button=\"-1\">\n <span class=\"gear-icon\"><%= icon %></span>\n </button>\n <div class=\"gear-wrapper gcore-skin-bg-color\">\n <ul class=\"gear-options-list\">\n <% items.forEach(function (gear) { %>\n <li data-<%= gear %>></li>\n <% }); %>\n </ul>\n </div>\n</div>\n";
32790
+ const pluginHtml$5 = "<div class=\"media-control-gear\" data-<%= name %>>\n <button type=\"button\" class=\"button-gear gplayer-lite-btn gcore-skin-button-color\" data-gear-button=\"-1\">\n <span class=\"gear-icon\"><%= icon %></span>\n </button>\n <div class=\"gear-wrapper gcore-skin-bg-color\">\n <ul class=\"gear-options-list\">\n <% items.forEach(function (gear) { %>\n <li data-<%= gear %>></li>\n <% }); %>\n </ul>\n </div>\n</div>\n";
32791
32791
 
32792
32792
  const gearIcon = "<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_660_1503)\">\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 </g>\n <defs>\n <clipPath id=\"clip0_660_1503\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
32793
32793
 
@@ -33113,7 +33113,7 @@ class MediaControl extends UICorePlugin {
33113
33113
  buttonsColor = null;
33114
33114
  currentDurationValue = 0;
33115
33115
  currentPositionValue = 0;
33116
- currentSeekBarPercentage = null;
33116
+ currentSeekBarPercentage = 0;
33117
33117
  disabledClickableList = [];
33118
33118
  displayedDuration = null;
33119
33119
  displayedPosition = null;
@@ -33231,6 +33231,9 @@ class MediaControl extends UICorePlugin {
33231
33231
  'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible',
33232
33232
  };
33233
33233
  }
33234
+ get currentSeekPos() {
33235
+ return this.currentSeekBarPercentage;
33236
+ }
33234
33237
  /**
33235
33238
  * Current volume [0..100]
33236
33239
  */
@@ -33590,8 +33593,7 @@ class MediaControl extends UICorePlugin {
33590
33593
  this.changeTogglePlay();
33591
33594
  this.bindContainerEvents();
33592
33595
  this.settingsUpdate();
33593
- this.core.activeContainer &&
33594
- this.core.activeContainer.trigger(Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.core.activeContainer.isDvrInUse());
33596
+ this.core.activeContainer.trigger(Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.core.activeContainer.isDvrInUse());
33595
33597
  // TODO test
33596
33598
  if (this.core.activeContainer.mediaControlDisabled) {
33597
33599
  this.disable();
@@ -34157,17 +34159,6 @@ MediaControl.extend = function (properties) {
34157
34159
  };
34158
34160
 
34159
34161
  const VERSION$5 = '2.19.12';
34160
- /**
34161
- * Custom events emitted by the plugin
34162
- * @beta
34163
- */
34164
- var GearEvents;
34165
- (function (GearEvents) {
34166
- /**
34167
- * Emitted when the gear menu is rendered
34168
- */
34169
- GearEvents["MEDIACONTROL_GEAR_RENDERED"] = "mediacontrol:gear:rendered";
34170
- })(GearEvents || (GearEvents = {}));
34171
34162
  /**
34172
34163
  * Adds the gear button that triggers extra options menu on the right side of the {@link MediaControl | media control} UI
34173
34164
  * @beta
@@ -34198,7 +34189,7 @@ class BottomGear extends UICorePlugin {
34198
34189
  static get version() {
34199
34190
  return VERSION$5;
34200
34191
  }
34201
- static template = tmpl(pluginHtml$6);
34192
+ static template = tmpl(pluginHtml$5);
34202
34193
  /**
34203
34194
  * @internal
34204
34195
  */
@@ -34223,7 +34214,6 @@ class BottomGear extends UICorePlugin {
34223
34214
  const mediaControl = this.core.getPlugin('media_control');
34224
34215
  assert(mediaControl, 'media_control plugin is required');
34225
34216
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
34226
- this.listenTo(this.core, 'gear:refresh', this.refresh); // TODO use direct plugin method call
34227
34217
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
34228
34218
  this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.hide); // TODO mediacontrol show as well
34229
34219
  }
@@ -34266,11 +34256,14 @@ class BottomGear extends UICorePlugin {
34266
34256
  const icon = this.isHd ? gearHdIcon : gearIcon;
34267
34257
  this.$el.html(BottomGear.template({ icon, items }));
34268
34258
  mediaControl.getElement('gear')?.html(this.el);
34269
- this.core.trigger('gear:rendered'); // @deprecated
34270
- mediaControl.trigger(GearEvents.MEDIACONTROL_GEAR_RENDERED); // TODO drop
34271
34259
  mediaControl.trigger(MediaControlEvents.MEDIACONTROL_GEAR_RENDERED);
34272
34260
  return this;
34273
34261
  }
34262
+ /**
34263
+ * Re-renders the gear menu.
34264
+ * It fires the {@link MediaControlEvents.MEDIACONTROL_GEAR_RENDERED | MEDIACONTROL_GEAR_RENDERED} event,
34265
+ * which the plugins that attach to the gear menu can listen to to re-render themselves.
34266
+ */
34274
34267
  refresh() {
34275
34268
  this.render();
34276
34269
  this.$el.find('.gear-wrapper').show();
@@ -36345,7 +36338,7 @@ function rankConnectionSpeed(dlSpeed) {
36345
36338
  return 0;
36346
36339
  }
36347
36340
 
36348
- const pluginHtml$5 = "<% general = metrics.general %>\n<% counters = metrics.counters %>\n<% timers = metrics.timers %>\n<% extra = metrics.extra %>\n<% custom = metrics.custom %>\n\n<div class=\"stats-box\">\n <div class=\"stats-box-top\">\n <a class=\"close-button gplayer-lite-btn\" data-close-button>\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>General</span></li>\n <li>\n Display resolution:\n <div><span><%= general.displayResolution %></span></div>\n </li>\n <li>\n Volume:\n <div><span><%= general.volume %></span></div>\n </li>\n <li>\n Connection speed:\n <div><span id=\"dlText\"><%= custom.connectionSpeed %></span> Mbps</div>\n </li>\n <li class=\"canvas-wrapper\">\n <canvas id=\"speedTestCanvas\" width=\"190\" height=\"20\"></canvas>\n </li>\n <li>\n Ping:\n <div><span id=\"pingText\"><%= custom.ping %></span> ms</div>\n </li>\n <li>\n Jitter:\n <div><span id=\"jitterText\"><%= custom.jitter %></span> ms</div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span>Counters</span></li>\n <li>\n Plays:\n <div><span><%= counters.play %></span></div>\n </li>\n <li>\n Pauses:\n <div><span><%= counters.pause %></span></div>\n </li>\n <li>\n Errors:\n <div><span><%= counters.error %></span></div>\n </li>\n <li>\n Bufferings:\n <div><span><%= counters.buffering %></span></div>\n </li>\n <li>\n Decoded frames:\n <div><span><%= counters.decodedFrames %></span></div>\n </li>\n <li>\n Dropped frames:\n <div><span><%= counters.droppedFrames %></span></div>\n </li>\n <li>\n Frames per second:\n <div><span><%= counters.fps %></span></div>\n </li>\n <li>\n Bitrate changes:\n <div><span><%= counters.changeLevel %></span></div>\n </li>\n <li>\n Seeks:\n <div><span><%= counters.seek %></span></div>\n </li>\n <li>\n Fullscreen:\n <div><span><%= counters.fullscreen %></span></div>\n </li>\n <li>\n DVR seeks:\n <div><span><%= counters.dvrUsage %></span></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span>Timers</span></li>\n <li>\n Startup time:\n <div><span><%= timers.startup %></span></div>\n </li>\n <li>\n Watching time:\n <div><span><%= timers.watch %></span></div>\n </li>\n <li>\n Pause time:\n <div><span><%= timers.pause %></span></div>\n </li>\n <li>\n Buffering time:\n <div><span><%= timers.buffering %></span></div>\n </li>\n <li>\n Session time:\n <div><span><%= timers.session %></span></div>\n </li>\n <!-- <li>-->\n <!-- Latency:-->\n <!-- <div><span><%= timers.latency %></span></div>-->\n <!-- </li>-->\n </ul>\n\n <ul>\n <li class=\"title\"><span>Extra</span></li>\n <li>\n Playback:\n <div><span><%= extra.playbackName %></span></div>\n </li>\n <li>\n Playback type:\n <div><span><%= extra.playbackType %></span></div>\n </li>\n <li>\n Buffer size:\n <div><span><%= extra.buffersize %></span></div>\n </li>\n <li>\n Video duration:\n <div><span><%= extra.duration %></span></div>\n </li>\n <li>\n Current time:\n <div><span><%= extra.currentTime %></span></div>\n </li>\n <li>\n Bitrate weighted mean:\n <div><span><%= extra.bitrateWeightedMean %></span></div>\n </li>\n <li>\n Bitrate most used:\n <div><span><%= extra.bitrateMostUsed %></span></div>\n </li>\n <li>\n % Watched:\n <div><span><%= extra.watchedPercentage %></span></div>\n </li>\n <li>\n % Buffering:\n <div><span><%= extra.bufferingPercentage %></span></div>\n </li>\n </ul>\n </div>\n <div class=\"speedtest-summary\">\n <div class=\"speedtest-summary-header\">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\">VOD: <%= custom.vodQuality %></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"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\">Live: <%= custom.liveQuality %></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"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\" data-refresh-button type=\"button\">\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 Refresh\n </button>\n </div>\n</div>\n";
36341
+ const pluginHtml$4 = "<% general = metrics.general %>\n<% counters = metrics.counters %>\n<% timers = metrics.timers %>\n<% extra = metrics.extra %>\n<% custom = metrics.custom %>\n\n<div class=\"stats-box\">\n <div class=\"stats-box-top\">\n <a class=\"close-button gplayer-lite-btn\" data-close-button>\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>General</span></li>\n <li>\n Display resolution:\n <div><span><%= general.displayResolution %></span></div>\n </li>\n <li>\n Volume:\n <div><span><%= general.volume %></span></div>\n </li>\n <li>\n Connection speed:\n <div><span id=\"dlText\"><%= custom.connectionSpeed %></span> Mbps</div>\n </li>\n <li class=\"canvas-wrapper\">\n <canvas id=\"speedTestCanvas\" width=\"190\" height=\"20\"></canvas>\n </li>\n <li>\n Ping:\n <div><span id=\"pingText\"><%= custom.ping %></span> ms</div>\n </li>\n <li>\n Jitter:\n <div><span id=\"jitterText\"><%= custom.jitter %></span> ms</div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span>Counters</span></li>\n <li>\n Plays:\n <div><span><%= counters.play %></span></div>\n </li>\n <li>\n Pauses:\n <div><span><%= counters.pause %></span></div>\n </li>\n <li>\n Errors:\n <div><span><%= counters.error %></span></div>\n </li>\n <li>\n Bufferings:\n <div><span><%= counters.buffering %></span></div>\n </li>\n <li>\n Decoded frames:\n <div><span><%= counters.decodedFrames %></span></div>\n </li>\n <li>\n Dropped frames:\n <div><span><%= counters.droppedFrames %></span></div>\n </li>\n <li>\n Frames per second:\n <div><span><%= counters.fps %></span></div>\n </li>\n <li>\n Bitrate changes:\n <div><span><%= counters.changeLevel %></span></div>\n </li>\n <li>\n Seeks:\n <div><span><%= counters.seek %></span></div>\n </li>\n <li>\n Fullscreen:\n <div><span><%= counters.fullscreen %></span></div>\n </li>\n <li>\n DVR seeks:\n <div><span><%= counters.dvrUsage %></span></div>\n </li>\n </ul>\n\n <ul>\n <li class=\"title\"><span>Timers</span></li>\n <li>\n Startup time:\n <div><span><%= timers.startup %></span></div>\n </li>\n <li>\n Watching time:\n <div><span><%= timers.watch %></span></div>\n </li>\n <li>\n Pause time:\n <div><span><%= timers.pause %></span></div>\n </li>\n <li>\n Buffering time:\n <div><span><%= timers.buffering %></span></div>\n </li>\n <li>\n Session time:\n <div><span><%= timers.session %></span></div>\n </li>\n <!-- <li>-->\n <!-- Latency:-->\n <!-- <div><span><%= timers.latency %></span></div>-->\n <!-- </li>-->\n </ul>\n\n <ul>\n <li class=\"title\"><span>Extra</span></li>\n <li>\n Playback:\n <div><span><%= extra.playbackName %></span></div>\n </li>\n <li>\n Playback type:\n <div><span><%= extra.playbackType %></span></div>\n </li>\n <li>\n Buffer size:\n <div><span><%= extra.buffersize %></span></div>\n </li>\n <li>\n Video duration:\n <div><span><%= extra.duration %></span></div>\n </li>\n <li>\n Current time:\n <div><span><%= extra.currentTime %></span></div>\n </li>\n <li>\n Bitrate weighted mean:\n <div><span><%= extra.bitrateWeightedMean %></span></div>\n </li>\n <li>\n Bitrate most used:\n <div><span><%= extra.bitrateMostUsed %></span></div>\n </li>\n <li>\n % Watched:\n <div><span><%= extra.watchedPercentage %></span></div>\n </li>\n <li>\n % Buffering:\n <div><span><%= extra.bufferingPercentage %></span></div>\n </li>\n </ul>\n </div>\n <div class=\"speedtest-summary\">\n <div class=\"speedtest-summary-header\">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\">VOD: <%= custom.vodQuality %></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"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\">Live: <%= custom.liveQuality %></div>\n <div class=\"speedtest-quality-content\" data-streaming-type=\"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\" data-refresh-button type=\"button\">\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 Refresh\n </button>\n </div>\n</div>\n";
36349
36342
 
36350
36343
  const buttonHtml$3 = "<button class='nerd-button gplayer-lite-btn gcore-skin-text-color gear-option'>\n <span class=\"stats-icon\"></span>\n <span>Statistics</span>\n</button>\n";
36351
36344
 
@@ -36460,7 +36453,7 @@ class ClapprNerdStats extends UICorePlugin {
36460
36453
  get supportedVersion() {
36461
36454
  return { min: CLAPPR_VERSION };
36462
36455
  }
36463
- static template = tmpl(pluginHtml$5);
36456
+ static template = tmpl(pluginHtml$4);
36464
36457
  /**
36465
36458
  * @internal
36466
36459
  */
@@ -36514,7 +36507,7 @@ class ClapprNerdStats extends UICorePlugin {
36514
36507
  const mediaControl = this.core.getPlugin('media_control');
36515
36508
  assert(mediaControl, 'media_control plugin is required');
36516
36509
  this.listenToOnce(this.core, Events$1.CORE_READY, this.init);
36517
- this.listenTo(mediaControl, GearEvents.MEDIACONTROL_GEAR_RENDERED, this.addToBottomGear);
36510
+ this.listenTo(mediaControl, MediaControlEvents.MEDIACONTROL_GEAR_RENDERED, this.addToBottomGear);
36518
36511
  }
36519
36512
  init() {
36520
36513
  this.container = this.core.activeContainer;
@@ -37255,7 +37248,7 @@ class ClipsPlugin extends UICorePlugin {
37255
37248
 
37256
37249
  const templateHtml$1 = "<ul class=\"context-menu-list\">\n <% if(options) { %>\n <% for (var i = 0; i < options.length; i++) { %>\n <li class=\"context-menu-list-item <%= options[i].class %>\"\n data-<%= options[i].name %>><%= options[i].label %></li>\n <% } %>\n <% } %>\n</ul>\n";
37257
37250
 
37258
- var version$1 = "2.20.7";
37251
+ var version$1 = "2.20.8";
37259
37252
 
37260
37253
  var packages = {
37261
37254
  "node_modules/@clappr/core": {
@@ -37390,6 +37383,7 @@ class ContextMenu extends UIContainerPlugin {
37390
37383
 
37391
37384
  const dvrHTML = "<div class=\"live-info\"><%= live %></div>\n<button type=\"button\" class=\"live-button\" aria-label=\"<%= backToLive %>\"><%= backToLive %></button>\n";
37392
37385
 
37386
+ const T$b = 'plugins.dvr_controls';
37393
37387
  /**
37394
37388
  * Adds the DVR controls to the media control UI
37395
37389
  * @beta
@@ -37420,7 +37414,7 @@ class DvrControls extends UICorePlugin {
37420
37414
  */
37421
37415
  get events() {
37422
37416
  return {
37423
- 'click .live-button': 'click'
37417
+ 'click .live-button': 'click',
37424
37418
  };
37425
37419
  }
37426
37420
  /**
@@ -37428,8 +37422,8 @@ class DvrControls extends UICorePlugin {
37428
37422
  */
37429
37423
  get attributes() {
37430
37424
  return {
37431
- 'class': 'dvr-controls',
37432
- 'data-dvr-controls': ''
37425
+ class: 'dvr-controls',
37426
+ 'data-dvr-controls': '',
37433
37427
  };
37434
37428
  }
37435
37429
  constructor(core) {
@@ -37448,23 +37442,22 @@ class DvrControls extends UICorePlugin {
37448
37442
  }
37449
37443
  bindContainerEvents() {
37450
37444
  this.listenToOnce(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.render);
37451
- this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
37445
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDvrChanged);
37452
37446
  }
37453
- dvrChanged(dvrEnabled) {
37447
+ onDvrChanged(dvrEnabled) {
37454
37448
  if (this.core.getPlaybackType() !== Playback.LIVE) {
37455
37449
  return;
37456
37450
  }
37457
37451
  this.settingsUpdate();
37458
37452
  this.core.mediaControl.$el.addClass('live');
37459
37453
  if (dvrEnabled) {
37460
- this.core.mediaControl.$playbackRate.removeClass('playbackrate-enable');
37454
+ // TODO
37461
37455
  this.core.mediaControl.$el
37462
37456
  .addClass('dvr')
37463
37457
  .find('.media-control-indicator[data-position], .media-control-indicator[data-duration]')
37464
37458
  .hide();
37465
37459
  }
37466
37460
  else {
37467
- this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
37468
37461
  this.core.mediaControl.$el.removeClass('dvr');
37469
37462
  }
37470
37463
  }
@@ -37489,24 +37482,31 @@ class DvrControls extends UICorePlugin {
37489
37482
  this.bindEvents();
37490
37483
  }
37491
37484
  shouldRender() {
37492
- const useDvrControls = this.core.options.useDvrControls === undefined || !!this.core.options.useDvrControls;
37485
+ const useDvrControls = this.core.options.useDvrControls === undefined ||
37486
+ !!this.core.options.useDvrControls;
37493
37487
  return useDvrControls && this.core.getPlaybackType() === Playback.LIVE;
37494
37488
  }
37495
37489
  /**
37496
37490
  * @internal
37497
37491
  */
37498
37492
  render() {
37493
+ trace(`${T$b} render`, {
37494
+ dvrEnabled: this.core.activePlayback?.dvrEnabled,
37495
+ });
37496
+ if (!this.shouldRender()) {
37497
+ return this;
37498
+ }
37499
37499
  this.$el.html(DvrControls.template({
37500
37500
  live: this.core.i18n.t('live'),
37501
- backToLive: this.core.i18n.t('back_to_live')
37501
+ backToLive: this.core.i18n.t('back_to_live'),
37502
37502
  }));
37503
- if (this.shouldRender()) {
37504
- const mediaControl = this.core.getPlugin('media_control');
37505
- assert(mediaControl, 'media_control plugin is required');
37506
- // TODO don't tap into the $el directly
37507
- mediaControl.$el.addClass('live');
37508
- mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el);
37509
- }
37503
+ const mediaControl = this.core.getPlugin('media_control');
37504
+ assert(mediaControl, 'media_control plugin is required');
37505
+ // TODO don't tap into the $el directly
37506
+ mediaControl.$el.addClass('live');
37507
+ mediaControl
37508
+ .$('.media-control-left-panel[data-media-control]')
37509
+ .append(this.$el);
37510
37510
  return this;
37511
37511
  }
37512
37512
  }
@@ -37515,7 +37515,7 @@ const reloadIcon = "<svg fill=\"#FFFFFF\" height=\"24\" viewBox=\"0 0 24 24\" wi
37515
37515
 
37516
37516
  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>Error code: <%= code %></div>\n <% } %>\n <% if (reloadIcon) { %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n <% } %>\n</div>\n";
37517
37517
 
37518
- const T$9 = 'plugins.error_screen';
37518
+ const T$a = 'plugins.error_screen';
37519
37519
  /**
37520
37520
  * Displays an error nicely in the overlay on top of the player.
37521
37521
  * @beta
@@ -37576,7 +37576,7 @@ class ErrorScreen extends UICorePlugin {
37576
37576
  }, 0);
37577
37577
  }
37578
37578
  onActiveContainerChanged() {
37579
- trace(`${T$9} onActiveContainerChanged`, {
37579
+ trace(`${T$a} onActiveContainerChanged`, {
37580
37580
  reloading: this.core.options.reloading,
37581
37581
  });
37582
37582
  this.err = null;
@@ -37859,7 +37859,7 @@ const arrowLeftIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
37859
37859
 
37860
37860
  const checkIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M20.5793 4.19296C20.1216 3.86696 19.4777 3.96396 19.1424 4.40896L9.37295 17.3809L4.81634 12.107C4.45222 11.683 3.80218 11.6289 3.36709 11.9839C2.932 12.3389 2.87543 12.97 3.2416 13.393L8.64165 19.643C8.83708 19.869 9.12506 20 9.42849 20C9.4398 20 9.45114 20 9.46246 19.999C9.77926 19.989 10.0724 19.838 10.2586 19.59L20.8015 5.58996C21.1368 5.14496 21.0371 4.51896 20.5793 4.19296Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
37861
37861
 
37862
- const T$8 = 'plugins.level_selector';
37862
+ const T$9 = 'plugins.level_selector';
37863
37863
  const VERSION$4 = '2.19.4';
37864
37864
  /**
37865
37865
  * A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
@@ -37936,9 +37936,16 @@ class LevelSelector extends UICorePlugin {
37936
37936
  * @internal
37937
37937
  */
37938
37938
  bindEvents() {
37939
+ this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
37940
+ this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.bindPlaybackEvents);
37941
+ }
37942
+ onCoreReady() {
37939
37943
  const mediaControl = this.core.getPlugin('media_control');
37940
37944
  assert(mediaControl, 'media_control plugin is required');
37941
- this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.bindPlaybackEvents);
37945
+ this.listenTo(mediaControl, MediaControlEvents.MEDIACONTROL_GEAR_RENDERED, this.onGearRendered);
37946
+ }
37947
+ onGearRendered() {
37948
+ this.deferRender();
37942
37949
  }
37943
37950
  bindPlaybackEvents() {
37944
37951
  this.removeAuto = false;
@@ -37959,7 +37966,7 @@ class LevelSelector extends UICorePlugin {
37959
37966
  }
37960
37967
  onStop() {
37961
37968
  this.listenToOnce(this.core.activePlayback, Events$1.PLAYBACK_PLAY, () => {
37962
- trace(`${T$8} on PLAYBACK_PLAY after stop`, {
37969
+ trace(`${T$9} on PLAYBACK_PLAY after stop`, {
37963
37970
  selectedLevelId: this.selectedLevelId,
37964
37971
  });
37965
37972
  if (this.core.activePlayback.getPlaybackType() === 'live') {
@@ -38056,8 +38063,9 @@ class LevelSelector extends UICorePlugin {
38056
38063
  }
38057
38064
  goBack() {
38058
38065
  this.isOpen = false;
38059
- this.core.trigger('gear:refresh');
38060
- this.deferRender();
38066
+ setTimeout(() => {
38067
+ this.core.getPlugin('bottom_gear').refresh();
38068
+ }, 0);
38061
38069
  }
38062
38070
  setLevel(index) {
38063
38071
  this.selectedLevelId = index;
@@ -38114,7 +38122,7 @@ class LevelSelector extends UICorePlugin {
38114
38122
  this.highlightCurrentLevel();
38115
38123
  }
38116
38124
  highlightCurrentLevel() {
38117
- trace(`${T$8} highlightCurrentLevel`, {
38125
+ trace(`${T$9} highlightCurrentLevel`, {
38118
38126
  selectedLevelId: this.selectedLevelId,
38119
38127
  });
38120
38128
  this.allLevelElements().removeClass('current');
@@ -38355,7 +38363,7 @@ class Logo extends UIContainerPlugin {
38355
38363
  }
38356
38364
  }
38357
38365
 
38358
- const pluginHtml$4 = "<button data-multicamera-button class='gcore-skin-button-color'>\n <span class=\"multicamera-icon\"></span>\n</button>\n\n<ul class=\"gcore-skin-bg-color\">\n <% for (var i = 0; i < streams.length; i++) { %>\n <% if(!streams[i].live && multisources_mode === 'only_live') { %>\n <% continue; %>\n <% } %>\n <li>\n <div class=\"multicamera-item\" data-multicamera-selector-live=\"<%= streams[i].live %>\"\n data-multicamera-selector-select=\"<%= streams[i].id %>\">\n <div class=\"multicamera-screenshot\">\n <% if (streams[i].screenshot) { %>\n <img src=\"<%= streams[i].screenshot %>\" alt=\"<%= streams[i].title %>\"/>\n <% } %>\n </div>\n <div class=\"multicamera-text gcore-skin-text-color\">\n <% if (streams[i].title) { %>\n <div class=\"multicamera-title gcore-skin-text-color\"><%= streams[i].title %></div>\n <% } %>\n <% if (streams[i].description) { %>\n <div class=\"multicamera-description gcore-skin-text-color\"><%= streams[i].description %></div>\n <% } %>\n </div>\n </div>\n </li>\n <% } %>\n</ul>\n";
38366
+ const pluginHtml$3 = "<button data-multicamera-button class='gcore-skin-button-color'>\n <span class=\"multicamera-icon\"></span>\n</button>\n\n<ul class=\"gcore-skin-bg-color\">\n <% for (var i = 0; i < streams.length; i++) { %>\n <% if(!streams[i].live && multisources_mode === 'only_live') { %>\n <% continue; %>\n <% } %>\n <li>\n <div class=\"multicamera-item\" data-multicamera-selector-live=\"<%= streams[i].live %>\"\n data-multicamera-selector-select=\"<%= streams[i].id %>\">\n <div class=\"multicamera-screenshot\">\n <% if (streams[i].screenshot) { %>\n <img src=\"<%= streams[i].screenshot %>\" alt=\"<%= streams[i].title %>\"/>\n <% } %>\n </div>\n <div class=\"multicamera-text gcore-skin-text-color\">\n <% if (streams[i].title) { %>\n <div class=\"multicamera-title gcore-skin-text-color\"><%= streams[i].title %></div>\n <% } %>\n <% if (streams[i].description) { %>\n <div class=\"multicamera-description gcore-skin-text-color\"><%= streams[i].description %></div>\n <% } %>\n </div>\n </div>\n </li>\n <% } %>\n</ul>\n";
38359
38367
 
38360
38368
  const streamsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"20\" viewBox=\"0 0 24 20\">\n <path fill=\"#FFF\" fill-rule=\"nonzero\" d=\"M24 1.5v13a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 1-.5-.5v-10A2.5 2.5 0 0 0 18.5 3h-14a.5.5 0 0 1-.5-.5v-1A1.5 1.5 0 0 1 5.5 0h17A1.5 1.5 0 0 1 24 1.5M12.724 12.447l-5 2.5a.505.505 0 0 1-.487-.021A.503.503 0 0 1 7 14.5v-5c0-.173.09-.334.237-.426a.505.505 0 0 1 .487-.021l5 2.5a.5.5 0 0 1 0 .894M18.5 4h-17C.673 4 0 4.673 0 5.5v13c0 .827.673 1.5 1.5 1.5h17c.827 0 1.5-.673 1.5-1.5v-13c0-.827-.673-1.5-1.5-1.5\"/>\n</svg>\n";
38361
38369
 
@@ -38364,7 +38372,7 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
38364
38372
  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";
38365
38373
 
38366
38374
  const VERSION$3 = '0.0.1';
38367
- const T$7 = 'plugins.multicamera';
38375
+ const T$8 = 'plugins.multicamera';
38368
38376
  /**
38369
38377
  * The plugin adds support for loading multiple streams and switching between them using the media control UI.
38370
38378
  * @beta
@@ -38385,7 +38393,7 @@ class MultiCamera extends UICorePlugin {
38385
38393
  return VERSION$3;
38386
38394
  }
38387
38395
  get template() {
38388
- return tmpl(pluginHtml$4);
38396
+ return tmpl(pluginHtml$3);
38389
38397
  }
38390
38398
  get attributes() {
38391
38399
  return {
@@ -38636,7 +38644,7 @@ class MultiCamera extends UICorePlugin {
38636
38644
  // TODO figure out what this does
38637
38645
  playbackOptions.recycleVideo = Browser.isMobile;
38638
38646
  this.currentCamera = this.findElementById(id) ?? null;
38639
- trace(`${T$7} changeById`, { currentCamera: this.currentCamera, multicamera: this.multicamera });
38647
+ trace(`${T$8} changeById`, { currentCamera: this.currentCamera, multicamera: this.multicamera });
38640
38648
  if (!this.currentCamera) {
38641
38649
  return;
38642
38650
  }
@@ -38652,7 +38660,7 @@ class MultiCamera extends UICorePlugin {
38652
38660
  // TODO remove?
38653
38661
  // for html5 playback:
38654
38662
  this.options.dvrEnabled = this.currentCamera.dvr;
38655
- trace(`${T$7} changeById`, { currentCamera: this.currentCamera });
38663
+ trace(`${T$8} changeById`, { currentCamera: this.currentCamera });
38656
38664
  // TODO
38657
38665
  this.core.configure({
38658
38666
  playback: playbackOptions,
@@ -38710,7 +38718,7 @@ const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"no
38710
38718
  const buttonHtml$1 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\">\n <span><%= pipIcon %></span>\n</button>\n";
38711
38719
 
38712
38720
  const VERSION$2 = '0.0.1';
38713
- const T$6 = `plugins.pip`;
38721
+ const T$7 = `plugins.pip`;
38714
38722
  /**
38715
38723
  * Enables picture in picture mode.
38716
38724
  * @beta
@@ -38784,7 +38792,7 @@ class PictureInPicture extends UICorePlugin {
38784
38792
  }
38785
38793
  }
38786
38794
  requestPictureInPicture() {
38787
- trace(`${T$6} requestPictureInPicture`, {
38795
+ trace(`${T$7} requestPictureInPicture`, {
38788
38796
  videoElement: !!this.videoElement,
38789
38797
  });
38790
38798
  this.videoElement.requestPictureInPicture();
@@ -38794,14 +38802,22 @@ class PictureInPicture extends UICorePlugin {
38794
38802
  }
38795
38803
  }
38796
38804
 
38797
- const pluginHtml$3 = "<button class=\"gcore-skin-button-color\" data-playback-rate-button>\n <span><%= title %></span>\n</button>\n<ul>\n <% for (var i = 0; i < playbackRates.length; i++) { %>\n <li data-playback-rate-select=\"<%= playbackRates[i].value %>\"><a\n data-playback-rate-a=\"<%= playbackRates[i].value %>\" href=\"#\"><%= playbackRates[i].label %></a></li>\n <% }; %>\n</ul>\n";
38798
-
38799
38805
  const buttonHtml = "<button class='gplayer-lite-btn gcore-skin-text-color gear-option'>\n <span class=\"gear-option_speed-icon\"><%= speedIcon %></span>\n <span>Playback speed</span>\n <span class=\"gear-option_arrow-right-icon\"><%= arrowRightIcon %></span>\n <span class='gear-option_value'><%= title %></span>\n</button>\n";
38800
38806
 
38801
38807
  const listHtml = "<button class=\"gplayer-lite-btn go-back gcore-skin-text-color\">\n <span class=\"arrow-left-icon\"><%= arrowLeftIcon %></span>\n Playback speed\n</button>\n<ul class=\"gear-sub-menu\">\n <% for (var i = playbackRates.length - 1; i >= 0; i--) { %>\n <li>\n <a href=\"#\" class='gear-sub-menu_btn gcore-skin-text-color' data-rate=\"<%= playbackRates[i].value %>\">\n <span class=\"check-icon\"><%= checkIcon %></span>\n <%= playbackRates[i].label %>\n </a>\n </li>\n <% } %>\n</ul>\n";
38802
38808
 
38803
38809
  const speedIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M11.9854 23.9999C11.4272 23.9999 10.9571 23.5293 10.9571 22.9704C10.9571 22.4115 11.4272 21.9409 11.9854 21.9409C17.4492 21.9409 21.9143 17.4704 21.9143 11.9999C21.9143 6.52948 17.4492 2.05899 11.9854 2.05899C11.4272 2.05899 10.9571 1.58836 10.9571 1.02949C10.9571 0.470625 11.4272 0 11.9854 0C18.5949 0 24 5.38224 24 12.0291C24 18.6766 18.5949 24 11.9854 24V23.9999ZM10.2227 17.853L17.4785 13.4413C18.0072 13.1178 18.301 12.5885 18.301 11.9707C18.301 11.353 17.9779 10.8237 17.4785 10.5002L10.2227 6.08852C9.69405 5.76499 9.01826 5.76499 8.4896 6.05919C7.96094 6.35338 7.60828 6.94157 7.60828 7.5591V16.3824C7.60828 17.0002 7.93142 17.5883 8.4896 17.8824C8.75393 18.0294 9.04779 18.1177 9.34139 18.1177C9.63523 18.1177 9.95838 18.0294 10.2227 17.853V17.853ZM15.9216 11.9707L9.66457 15.7647V8.17661L15.9216 11.9707ZM8.22516 22.3529C8.4602 21.8236 8.25447 21.2058 7.7258 20.9705C7.19714 20.7353 6.69755 20.4413 6.2277 20.0882C5.75764 19.7646 5.11137 19.8822 4.78824 20.3235C4.46509 20.7941 4.58251 21.4412 5.02327 21.7647C5.58146 22.1764 6.19819 22.5293 6.81519 22.8235C6.96211 22.8824 7.10903 22.9117 7.25574 22.9117C7.66699 22.941 8.04893 22.7057 8.22513 22.3528L8.22516 22.3529ZM3.58381 19.0882C4.05387 18.7647 4.17127 18.1177 3.84814 17.647C3.52502 17.1764 3.23115 16.6765 2.99635 16.1471C2.76132 15.6178 2.14456 15.4118 1.6157 15.6472C1.08704 15.8825 0.881306 16.5 1.11634 17.0295C1.41018 17.6472 1.7626 18.2648 2.14459 18.8236C2.35032 19.1178 2.67325 19.2646 2.99638 19.2646C3.20191 19.2942 3.40763 19.2353 3.58384 19.0882L3.58381 19.0882ZM1.14563 13.9707C1.70382 13.9118 2.14435 13.4118 2.08576 12.853C2.05645 12.5588 2.05645 12.2648 2.05645 11.9706C2.05645 11.6764 2.05645 11.4117 2.08576 11.1178C2.14456 10.5589 1.70381 10.059 1.14563 10.0001C0.587439 9.94122 0.0881057 10.3825 0.0293019 10.9414C1.96979e-07 11.2942 0 11.6178 0 11.9709C0 12.3237 0.0293018 12.6768 0.0588091 13.0297C0.117618 13.5589 0.558169 13.9709 1.08706 13.9709C1.08686 13.9707 1.11636 13.9707 1.14567 13.9707L1.14563 13.9707ZM2.96687 7.79432C3.2019 7.26502 3.49553 6.76482 3.81866 6.2944C4.1418 5.82377 4.02439 5.17672 3.55432 4.8532C3.08427 4.52967 2.438 4.64722 2.11486 5.11786C1.73292 5.67672 1.38047 6.2942 1.08661 6.91193C0.851579 7.44123 1.08661 8.05897 1.58597 8.29426C1.73289 8.35314 1.87981 8.38247 2.02652 8.38247C2.40888 8.41181 2.7906 8.1767 2.96686 7.7943L2.96687 7.79432ZM6.22757 3.85328C6.69762 3.52974 7.19696 3.23554 7.69635 2.97089C8.22501 2.73558 8.43074 2.11807 8.19571 1.58857C7.96068 1.05927 7.34392 0.85329 6.81505 1.08861C6.19806 1.3828 5.58128 1.73565 5.02314 2.14741C4.55308 2.47094 4.43568 3.11797 4.78811 3.5886C4.99384 3.8828 5.31676 4.02969 5.6399 4.02969C5.84583 4.05902 6.05135 4.00014 6.22757 3.85325V3.85328Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
38804
38810
 
38811
+ var PlaybackEvents;
38812
+ (function (PlaybackEvents) {
38813
+ /**
38814
+ * Emitted when the playback rate changes.
38815
+ * Payload:
38816
+ * - playbackRate number
38817
+ */
38818
+ PlaybackEvents["PLAYBACK_RATE_CHANGED"] = "playback:rate-changed";
38819
+ })(PlaybackEvents || (PlaybackEvents = {}));
38820
+
38805
38821
  const DEFAULT_PLAYBACK_RATES = [
38806
38822
  { value: '0.5', label: '0.5x' },
38807
38823
  { value: '0.75', label: '0.75x' },
@@ -38812,10 +38828,9 @@ const DEFAULT_PLAYBACK_RATES = [
38812
38828
  { value: '2.0', label: '2x' }
38813
38829
  ];
38814
38830
  const DEFAULT_PLAYBACK_RATE = '1.0';
38815
- // TODO
38816
- const MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
38831
+ const T$6 = 'plugins.playback_rate';
38817
38832
  /**
38818
- * Allows changing the playback speed of the video.
38833
+ * PLUGIN that allows changing the playback speed of the video.
38819
38834
  * @beta
38820
38835
  *
38821
38836
  * @remarks
@@ -38825,12 +38840,13 @@ const MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
38825
38840
  *
38826
38841
  * - {@link BottomGear | bottom_gear}
38827
38842
  *
38828
- * It renders a button in the gear menu, which opens a dropdown with the available playback rates.
38843
+ * It renders a button in the gear menu, which opens a dropdown with the options to change the playback rate.
38829
38844
  */
38830
38845
  class PlaybackRate extends UICorePlugin {
38831
- currentPlayback = null;
38832
38846
  playbackRates = DEFAULT_PLAYBACK_RATES;
38847
+ // Saved when an ad starts to restore after it finishes
38833
38848
  prevSelectedRate;
38849
+ rendered = false;
38834
38850
  selectedRate = DEFAULT_PLAYBACK_RATE;
38835
38851
  /**
38836
38852
  * @internal
@@ -38844,9 +38860,13 @@ class PlaybackRate extends UICorePlugin {
38844
38860
  get supportedVersion() {
38845
38861
  return { min: CLAPPR_VERSION };
38846
38862
  }
38847
- static template = tmpl(pluginHtml$3);
38848
38863
  static buttonTemplate = tmpl(buttonHtml);
38849
38864
  static listTemplate = tmpl(listHtml);
38865
+ constructor(core) {
38866
+ super(core);
38867
+ this.playbackRates = core.options.playbackRate?.options || DEFAULT_PLAYBACK_RATES;
38868
+ this.selectedRate = core.options.playbackRate?.defaultValue || DEFAULT_PLAYBACK_RATE;
38869
+ }
38850
38870
  /**
38851
38871
  * @internal
38852
38872
  */
@@ -38870,27 +38890,33 @@ class PlaybackRate extends UICorePlugin {
38870
38890
  * @internal
38871
38891
  */
38872
38892
  bindEvents() {
38873
- this.listenTo(this.core, 'gear:rendered', this.render);
38874
- // TODO this.core.getPlugin('media_control'), bottom_gear
38875
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.reload);
38876
- this.listenTo(this.core.mediaControl, MEDIACONTROL_PLAYBACKRATE, this.updatePlaybackRate);
38877
- this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
38878
- this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
38879
- if (this.core.activeContainer) {
38880
- this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_BUFFERFULL, this.updateLiveStatus);
38881
- }
38882
- if (this.currentPlayback) {
38883
- this.listenTo(this.currentPlayback, Events$1.PLAYBACK_STOP, this.onStop);
38884
- this.listenTo(this.currentPlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
38885
- // TODO import dash playback events
38886
- this.listenTo(this.currentPlayback, 'dash:playback-rate-changed', this.onDashRateChange);
38887
- }
38893
+ this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
38894
+ this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
38888
38895
  }
38889
- unBindEvents() {
38890
- this.stopListening(this.core, 'gear:rendered', this.render);
38891
- this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.reload);
38892
- this.stopListening(this.core, 'core:advertisement:start', this.onStartAd);
38893
- this.stopListening(this.core, 'core:advertisement:finish', this.onFinishAd);
38896
+ onCoreReady() {
38897
+ const mediaControl = this.core.getPlugin('media_control');
38898
+ assert(mediaControl, 'media_control plugin is required');
38899
+ const gear = this.core.getPlugin('bottom_gear');
38900
+ assert(gear, 'bottom_gear plugin is required');
38901
+ this.listenTo(mediaControl, MediaControlEvents.MEDIACONTROL_GEAR_RENDERED, this.onGearRendered);
38902
+ }
38903
+ onActiveContainerChange() {
38904
+ this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_STOP, this.onStop);
38905
+ this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
38906
+ this.listenTo(this.core.activePlayback, PlaybackEvents.PLAYBACK_RATE_CHANGED, this.onPlaybackRateChange);
38907
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDvrStateChanged);
38908
+ }
38909
+ onGearRendered() {
38910
+ trace(`${T$6} onGearRendered`, {
38911
+ rendered: this.rendered,
38912
+ });
38913
+ this.rendered = false;
38914
+ this.render();
38915
+ }
38916
+ onDvrStateChanged(dvrEnabled) {
38917
+ if (dvrEnabled) {
38918
+ this.render();
38919
+ }
38894
38920
  }
38895
38921
  allRateElements() {
38896
38922
  return this.$('ul.gear-sub-menu li');
@@ -38898,68 +38924,49 @@ class PlaybackRate extends UICorePlugin {
38898
38924
  rateElement(rate = "1") {
38899
38925
  return this.$(`ul.gear-sub-menu a[data-rate="${rate}"]`).parent();
38900
38926
  }
38901
- onDashRateChange() {
38902
- // TODO consider removing
38903
- this.currentPlayback._dash?.setPlaybackRate(this.selectedRate);
38904
- }
38905
- updateLiveStatus() {
38906
- if (this.core.getPlaybackType() === Playback.LIVE) {
38907
- if (this.core.mediaControl.currentSeekBarPercentage <= 98.9) {
38908
- this.core.mediaControl.$playbackRate.removeClass('playbackrate-enable');
38909
- this.core.mediaControl.$el.addClass('dvr');
38910
- return;
38911
- }
38912
- this.updatePlaybackRate(DEFAULT_PLAYBACK_RATE);
38913
- this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
38914
- this.core.mediaControl.$el.removeClass('dvr');
38927
+ onPlaybackRateChange(playbackRate) {
38928
+ const selectedRate = parseInt(this.selectedRate, 10);
38929
+ if (playbackRate !== selectedRate) {
38930
+ this.core.activePlayback?.setPlaybackRate(selectedRate);
38915
38931
  }
38916
38932
  }
38917
- reload() {
38918
- this.unBindEvents();
38919
- this.bindEvents();
38920
- }
38921
38933
  shouldRender() {
38922
38934
  if (!this.core.activeContainer) {
38923
38935
  return false;
38924
38936
  }
38925
- this.currentPlayback = this.core.activePlayback;
38926
- return !(this.currentPlayback?.tagName !== 'video' && this.currentPlayback?.tagName !== 'audio');
38937
+ if (this.core.getPlaybackType() === Playback.LIVE && !this.core.activePlayback.dvrEnabled) {
38938
+ return false;
38939
+ }
38940
+ return 'setPlaybackRate' in this.core.activePlayback;
38927
38941
  }
38928
38942
  /**
38929
38943
  * @internal
38930
38944
  */
38931
38945
  render() {
38932
- const container = this.core.activeContainer;
38933
- if (this.core.getPlaybackType() === Playback.LIVE && !container.isDvrEnabled()) {
38946
+ trace(`${T$6} render`, {
38947
+ rendered: this.rendered,
38948
+ shouldRender: this.shouldRender(),
38949
+ });
38950
+ if (!this.shouldRender()) {
38934
38951
  return this;
38935
38952
  }
38936
- const cfg = this.core.options.playbackRateConfig || {};
38937
- if (!this.playbackRates) {
38938
- this.playbackRates = cfg.options || DEFAULT_PLAYBACK_RATES;
38939
- }
38940
- if (!this.selectedRate) {
38941
- this.selectedRate = cfg.defaultValue || DEFAULT_PLAYBACK_RATE;
38942
- }
38943
- if (this.shouldRender()) {
38944
- const button = PlaybackRate.buttonTemplate({
38945
- title: this.getTitle(),
38946
- speedIcon,
38947
- arrowRightIcon,
38948
- });
38949
- this.$el.html(button);
38950
- // if (this.core.getPlaybackType() === Playback.LIVE) {
38951
- // this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
38952
- // }
38953
- // this.core.mediaControl.$playbackRate.append(this.el);
38954
- this.core.mediaControl.$el?.find('.gear-options-list [data-rate]').html(this.el);
38955
- // this.updateText();
38953
+ if (this.rendered) {
38954
+ return this;
38956
38955
  }
38956
+ const button = PlaybackRate.buttonTemplate({
38957
+ title: this.getTitle(),
38958
+ speedIcon,
38959
+ arrowRightIcon,
38960
+ });
38961
+ this.$el.html(button);
38962
+ this.core.getPlugin('bottom_gear')?.getElement('rate')?.html(this.el);
38963
+ this.rendered = true;
38957
38964
  return this;
38958
38965
  }
38959
38966
  onStartAd() {
38960
38967
  this.prevSelectedRate = this.selectedRate;
38961
- this.setSelectedRate('1.0');
38962
- this.listenToOnce(this.currentPlayback, Events$1.PLAYBACK_PLAY, this.onFinishAd);
38968
+ this.resetPlaybackRate();
38969
+ this.listenToOnce(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onFinishAd);
38963
38970
  }
38964
38971
  onFinishAd() {
38965
38972
  if (this.prevSelectedRate) {
@@ -38967,16 +38974,16 @@ class PlaybackRate extends UICorePlugin {
38967
38974
  }
38968
38975
  }
38969
38976
  onPlay() {
38970
- if (!this.core.mediaControl.$el.hasClass('dvr')) {
38971
- if (this.core.getPlaybackType() === Playback.LIVE) {
38972
- this.updatePlaybackRate(DEFAULT_PLAYBACK_RATE);
38973
- this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
38974
- }
38977
+ if (this.core.getPlaybackType() === Playback.LIVE && !this.core.activePlayback.dvrEnabled) {
38978
+ this.resetPlaybackRate();
38975
38979
  }
38976
38980
  else {
38977
38981
  this.setSelectedRate(this.selectedRate);
38978
38982
  }
38979
38983
  }
38984
+ resetPlaybackRate() {
38985
+ this.setSelectedRate(DEFAULT_PLAYBACK_RATE);
38986
+ }
38980
38987
  onStop() {
38981
38988
  }
38982
38989
  onRateSelect(event) {
@@ -38994,30 +39001,21 @@ class PlaybackRate extends UICorePlugin {
38994
39001
  arrowLeftIcon,
38995
39002
  checkIcon,
38996
39003
  }));
38997
- this.core.mediaControl.$el?.find('.gear-wrapper').html(this.el);
39004
+ this.core.getPlugin('bottom_gear')?.setContent(this.el);
38998
39005
  this.highlightCurrentRate();
38999
39006
  }
39000
39007
  goBack() {
39001
- this.core.trigger('gear:refresh');
39002
- }
39003
- updatePlaybackRate(rate) {
39004
- this.setSelectedRate(rate);
39008
+ setTimeout(() => {
39009
+ this.core.getPlugin('bottom_gear').refresh();
39010
+ }, 0);
39005
39011
  }
39006
39012
  setSelectedRate(rate) {
39007
39013
  // Set <video playbackRate="..."
39008
- this.core.$el.find('video,audio').get(0).playbackRate = rate;
39014
+ this.core.activePlayback?.setPlaybackRate(rate);
39009
39015
  this.selectedRate = rate;
39010
- // TODO
39011
- // Player.player.trigger('playbackRateChanged', rate);
39012
39016
  }
39013
39017
  getTitle() {
39014
- let title = this.selectedRate;
39015
- this.playbackRates.forEach((r) => {
39016
- if (r.value === this.selectedRate) {
39017
- title = r.label;
39018
- }
39019
- });
39020
- return title;
39018
+ return this.playbackRates.find((r) => r.value === this.selectedRate)?.label || this.selectedRate;
39021
39019
  }
39022
39020
  highlightCurrentRate() {
39023
39021
  this.allRateElements().removeClass('current');
@@ -41251,4 +41249,4 @@ class VolumeFade extends UICorePlugin {
41251
41249
  }
41252
41250
  }
41253
41251
 
41254
- export { AudioSelector, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause, ClipsPlugin, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, Kibo, LevelSelector, Logo, MediaControl, MediaControlEvents, MultiCamera, PictureInPicture, PlaybackRate, Poster, SeekTime, Share, SkipTime, SourceController, SpinnerEvents, SpinnerThreeBounce, Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents };
41252
+ export { AudioSelector, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause, ClipsPlugin, ContextMenu, DvrControls, ErrorScreen, Favicon, GoogleAnalytics, Kibo, LevelSelector, Logo, MediaControl, MediaControlEvents, MultiCamera, PictureInPicture, PlaybackRate, Poster, SeekTime, Share, SkipTime, SourceController, SpinnerEvents, SpinnerThreeBounce, Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents };