@gcorevideo/player 2.28.29 → 2.28.35

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.
package/dist/index.js CHANGED
@@ -12917,7 +12917,7 @@ var PlaybackEvents;
12917
12917
  // https://github.com/clappr/clappr/blob/8752995ea439321ac7ca3cd35e8c64de7a3c3d17/LICENSE
12918
12918
  const AUTO$1 = -1;
12919
12919
  const { now: now$2 } = Utils;
12920
- const T$f = 'playback.dash';
12920
+ const T$e = 'playback.dash';
12921
12921
  class DashPlayback extends BasePlayback {
12922
12922
  _levels = [];
12923
12923
  _currentLevel = AUTO$1;
@@ -13203,7 +13203,7 @@ class DashPlayback extends BasePlayback {
13203
13203
  this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
13204
13204
  }
13205
13205
  _onPlaybackError = (event) => {
13206
- trace(`${T$f} _onPlaybackError`, { type: event.type, code: event.error.code, message: event.error.message });
13206
+ trace(`${T$e} _onPlaybackError`, { type: event.type, code: event.error.code, message: event.error.message });
13207
13207
  };
13208
13208
  _onDASHJSSError = (event) => {
13209
13209
  this._stopTimeUpdateTimer();
@@ -50103,7 +50103,7 @@ const { now } = Utils;
50103
50103
  const AUTO = -1;
50104
50104
  const DEFAULT_RECOVER_ATTEMPTS = 16;
50105
50105
  Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
50106
- const T$e = 'playback.hls';
50106
+ const T$d = 'playback.hls';
50107
50107
  class HlsPlayback extends BasePlayback {
50108
50108
  _ccTracksUpdated = false;
50109
50109
  _currentFragment = null;
@@ -50428,7 +50428,7 @@ class HlsPlayback extends BasePlayback {
50428
50428
  }
50429
50429
  else {
50430
50430
  Log.error('hlsjs: failed to recover', { evt, data });
50431
- trace(`${T$e} _recover failed to recover`, {
50431
+ trace(`${T$d} _recover failed to recover`, {
50432
50432
  type: data.type,
50433
50433
  details: data.details,
50434
50434
  });
@@ -50515,7 +50515,7 @@ class HlsPlayback extends BasePlayback {
50515
50515
  this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
50516
50516
  }
50517
50517
  _onHLSJSError(evt, data) {
50518
- trace(`${T$e} _onHLSJSError`, {
50518
+ trace(`${T$d} _onHLSJSError`, {
50519
50519
  fatal: data.fatal,
50520
50520
  type: data.type,
50521
50521
  details: data.details,
@@ -50563,7 +50563,7 @@ class HlsPlayback extends BasePlayback {
50563
50563
  evt,
50564
50564
  data,
50565
50565
  });
50566
- trace(`${T$e} _onHLSJSError trying to recover from network error`, {
50566
+ trace(`${T$d} _onHLSJSError trying to recover from network error`, {
50567
50567
  details: data.details,
50568
50568
  });
50569
50569
  error.level = PlayerError.Levels.WARN;
@@ -50576,7 +50576,7 @@ class HlsPlayback extends BasePlayback {
50576
50576
  evt,
50577
50577
  data,
50578
50578
  });
50579
- trace(`${T$e} _onHLSJSError trying to recover from media error`, {
50579
+ trace(`${T$d} _onHLSJSError trying to recover from media error`, {
50580
50580
  details: data.details,
50581
50581
  });
50582
50582
  error.level = PlayerError.Levels.WARN;
@@ -50606,7 +50606,7 @@ class HlsPlayback extends BasePlayback {
50606
50606
  return;
50607
50607
  }
50608
50608
  Log.warn('hlsjs: non-fatal error occurred', { evt, data });
50609
- trace(`${T$e} _onHLSJSError non-fatal error occurred`, {
50609
+ trace(`${T$d} _onHLSJSError non-fatal error occurred`, {
50610
50610
  type: data.type,
50611
50611
  details: data.details,
50612
50612
  });
@@ -50947,7 +50947,7 @@ class HlsPlayback extends BasePlayback {
50947
50947
  this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
50948
50948
  }
50949
50949
  _onAudioTrackSwitched(_, data) {
50950
- trace(`${T$e} onAudioTrackSwitched`);
50950
+ trace(`${T$d} onAudioTrackSwitched`);
50951
50951
  // @ts-ignore
50952
50952
  const track = this._hls.audioTracks[data.id];
50953
50953
  this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
@@ -50988,7 +50988,7 @@ function toClapprTrack(t) {
50988
50988
  };
50989
50989
  }
50990
50990
 
50991
- const T$d = 'playback.html5_video';
50991
+ const T$c = 'playback.html5_video';
50992
50992
  const STALL_TIMEOUT = 15000;
50993
50993
  class HTML5Video extends BasePlayback {
50994
50994
  stallTimerId = null;
@@ -51089,7 +51089,7 @@ class HTML5Video extends BasePlayback {
51089
51089
  switchAudioTrack(id) {
51090
51090
  const tracks = this.el.audioTracks;
51091
51091
  const supported = !!tracks;
51092
- trace(`${T$d} switchAudioTrack`, {
51092
+ trace(`${T$c} switchAudioTrack`, {
51093
51093
  supported,
51094
51094
  });
51095
51095
  if (supported) {
@@ -51108,7 +51108,7 @@ function registerPlaybacks() {
51108
51108
  Loader.registerPlayback(DashPlayback);
51109
51109
  }
51110
51110
 
51111
- const T$c = 'gplayer';
51111
+ const T$b = 'gplayer';
51112
51112
  const DEFAULT_OPTIONS = {
51113
51113
  autoPlay: false,
51114
51114
  debug: 'none',
@@ -51444,7 +51444,7 @@ class Player {
51444
51444
  }
51445
51445
  }
51446
51446
  triggerAutoPlay() {
51447
- trace(`${T$c} triggerAutoPlay`);
51447
+ trace(`${T$b} triggerAutoPlay`);
51448
51448
  setTimeout(() => {
51449
51449
  this.player?.play({
51450
51450
  autoPlay: true,
@@ -51462,7 +51462,7 @@ class Player {
51462
51462
  // TODO test
51463
51463
  events = {
51464
51464
  onReady: () => {
51465
- trace(`${T$c} onReady`, {
51465
+ trace(`${T$b} onReady`, {
51466
51466
  ready: this.ready,
51467
51467
  });
51468
51468
  if (this.ready) {
@@ -51496,7 +51496,7 @@ class Player {
51496
51496
  buildCoreOptions(rootNode) {
51497
51497
  const sources = this.buildMediaSourcesList();
51498
51498
  const source = sources[0];
51499
- trace(`${T$c} buildCoreOptions`, {
51499
+ trace(`${T$b} buildCoreOptions`, {
51500
51500
  source,
51501
51501
  sources,
51502
51502
  });
@@ -51573,7 +51573,7 @@ class Player {
51573
51573
  }
51574
51574
  }
51575
51575
 
51576
- var version$1 = "2.28.29";
51576
+ var version$1 = "2.28.35";
51577
51577
 
51578
51578
  var packages = {
51579
51579
  "node_modules/@clappr/core": {
@@ -51912,21 +51912,9 @@ const FullscreenIOS = {
51912
51912
  },
51913
51913
  };
51914
51914
 
51915
- const mediaControlHTML = "<div class=\"media-control-background\" data-background></div>\n\n<div class=\"media-control-layer gcore-skin-bg-color\" data-controls>\n <% var renderBar = function(name) { %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1\" data-<%= name %>></div>\n <div class=\"bar-fill-2 gcore-skin-main-color\" data-<%= name %>></div>\n <div class=\"bar-hover\" data-<%= name %>></div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1 gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class=\"drawer-container\" data-<%= name %>>\n <div class=\"drawer-icon-container\" data-<%= name %>>\n <div class=\"drawer-icon media-control-icon gcore-skin-button-color\" data-<%= name %>></div>\n <span class=\"drawer-text\" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class=\"media-control-indicator gcore-skin-text-color\" data-<%= name %>></div>\n <% }; %>\n <% var renderQuality = function(name) { %>\n <div class=\"media-control-quality\" data-<%= name %>></div>\n <% }; %>\n <% var renderNerd = function(name) { %>\n <div class=\"media-control-nerd\" data-<%= name %>></div>\n <% }; %>\n <% var renderMultiCamera = function(name) { %>\n <div class=\"media-control-multicamera\" data-<%= name %>></div>\n <% }; %>\n <% var renderVR = function(name) { %>\n <div class=\"media-control-vr\" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type=\"button\" class=\"media-control-button media-control-icon gcore-skin-button-color\" data-<%= name %>\n aria-label=\"<%= name %>\"></button>\n <% }; %>\n\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function (settingsList) {\n settingsList.forEach(function (setting) {\n\n if (setting === \"seekbar\") {\n renderBar(setting);\n } else if (setting === \"volume\") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function (name) {\n return renderSegmentedBar(name);\n });\n } else if (setting === \"duration\" || setting === \"position\" || setting === \"clips\") {\n renderIndicator(setting);\n } else if (setting === \"quality\") {\n renderQuality(setting)\n } else if (setting === \"nerd\") {\n renderNerd(setting)\n } else if (setting === \"multicamera\") {\n renderMultiCamera(setting)\n } else if (setting === \"vr\") {\n renderVR(setting)\n } else if ([\"playpause\", \"playstop\", \"fullscreen\"].includes(setting)) {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.left && settings.left.length) { %>\n <div class=\"media-control-left-panel\" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.default && settings.default.length) { %>\n <div class=\"media-control-center-panel\" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class=\"media-control-right-panel\" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n";
51916
-
51917
- const playIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_28_1564)\">\n <path d=\"M6 3V20L19.3571 11.5L6 3Z\" fill=\"#C9C9C9\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_28_1564\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
51918
-
51919
- const pauseIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18.05 3H15.35C14.6057 3 14 3.6057 14 4.35V19.65C14 20.3943 14.6057 21 15.35 21H18.05C18.7943 21 19.4 20.3943 19.4 19.65V4.35C19.4 3.6057 18.7943 3 18.05 3ZM10.4 4.35V19.65C10.4 20.3943 9.7943 21 9.05 21H6.35C5.6057 21 5 20.3943 5 19.65V4.35C5 3.6057 5.6057 3 6.35 3H9.05C9.7943 3 10.4 3.6057 10.4 4.35Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
51920
-
51921
- const stopIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"#C9C9C9\" d=\"M4.568 3.86h14.9v16.28h-14.9z\"/>\n</svg>\n";
51922
-
51923
- const volumeMaxIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M14.187 7.71405C13.759 8.06405 13.697 8.69307 14.046 9.12107C14.662 9.87207 15 10.8941 15 11.9961C15 13.0991 14.662 14.1201 14.046 14.8711C13.697 15.2991 13.759 15.9291 14.187 16.2781C14.373 16.4311 14.597 16.5051 14.82 16.5051C15.109 16.5051 15.396 16.3801 15.594 16.1391C16.501 15.0301 17 13.5601 17 11.9961C17 10.4331 16.501 8.96207 15.594 7.85407C15.245 7.42707 14.614 7.36405 14.187 7.71405ZM19.772 5.14408C19.443 4.70008 18.816 4.60907 18.374 4.94007C17.931 5.27007 17.839 5.89605 18.169 6.33905C19.367 7.94705 20 9.90307 20 11.9961C20 14.0891 19.367 16.0451 18.169 17.6531C17.839 18.0971 17.931 18.7231 18.374 19.0531C18.553 19.1871 18.762 19.2511 18.97 19.2511C19.275 19.2511 19.576 19.1121 19.772 18.8491C21.23 16.8921 22 14.5231 22 11.9961C22 9.47007 21.23 7.10108 19.772 5.14408ZM12 3.85108V20.1421C12 20.4881 11.793 20.7971 11.473 20.9291C11.368 20.9721 11.258 20.9921 11.149 20.9921C10.926 20.9921 10.708 20.9031 10.544 20.7371L6.317 16.4431C6.038 16.1591 5.648 15.9961 5.249 15.9961H3.5C2.673 15.9961 2 15.3231 2 14.4961V9.49607C2 8.66907 2.673 7.99607 3.5 7.99607H5.249C5.648 7.99607 6.038 7.83308 6.317 7.54908L10.544 3.25507C10.787 3.00807 11.151 2.93206 11.473 3.06406C11.793 3.19506 12 3.50408 12 3.85108Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
51924
-
51925
- const volumeMuteIcon = "<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";
51926
-
51927
- const fullscreenOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M17.1999 4.85023H21.1498V8.80019C21.1498 9.0786 21.2604 9.34577 21.4574 9.54268C21.6283 9.71365 21.8523 9.81956 22.0906 9.84449L22.0965 9.85041H22.2001C22.4785 9.85041 22.7456 9.73981 22.9426 9.5429C23.1395 9.346 23.2501 9.07883 23.2501 8.80042V3.80024C23.2501 3.52182 23.1395 3.25465 22.9426 3.05775L22.7658 3.23453L22.9426 3.05775C22.7456 2.86085 22.4785 2.75024 22.2001 2.75024H17.1999C16.8247 2.75024 16.478 2.95039 16.2905 3.27526C16.103 3.6001 16.103 4.00037 16.2905 4.32521C16.478 4.65009 16.8247 4.85023 17.1999 4.85023Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n <path\n d=\"M1.79999 9.85017H1.90368L1.90961 9.84423C2.14785 9.81928 2.37176 9.71338 2.54271 9.54243C2.73961 9.34553 2.85021 9.07836 2.85021 8.79995V4.84999H6.80017C7.17536 4.84999 7.52201 4.64984 7.70953 4.32497C7.89703 4.00013 7.89703 3.59986 7.70953 3.27502C7.52201 2.95014 7.17537 2.75 6.80017 2.75H1.79999C1.52158 2.75 1.25441 2.8606 1.05751 3.05751C0.860605 3.25441 0.75 3.52158 0.75 3.79999V8.80017C0.75 9.07859 0.860605 9.34576 1.05751 9.54266C1.25441 9.73956 1.52158 9.85017 1.79999 9.85017Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n <path\n d=\"M21.1496 18.7498H17.1996C16.8245 18.7498 16.4778 18.95 16.2903 19.2748C16.1028 19.5997 16.1028 19.9999 16.2903 20.3248C16.4778 20.6497 16.8244 20.8498 17.1996 20.8498H21.5963L21.596 20.85H22.1996C22.478 20.85 22.7452 20.7394 22.9421 20.5425C23.139 20.3456 23.2496 20.0785 23.2496 19.8V14.7999C23.2496 14.4247 23.0494 14.078 22.7246 13.8905C22.3997 13.703 21.9995 13.703 21.6746 13.8905C21.3497 14.078 21.1496 14.4247 21.1496 14.7999V18.7498Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n <path\n d=\"M2.85003 18.7498H6.79999C7.17518 18.7498 7.52183 18.95 7.70935 19.2748C7.89685 19.5997 7.89685 19.9999 7.70935 20.3248C7.52183 20.6497 7.17519 20.8498 6.79999 20.8498H2.40337L2.40359 20.85H1.80004C1.52163 20.85 1.25446 20.7394 1.05756 20.5425C0.860653 20.3456 0.750049 20.0785 0.750049 19.8V14.7999C0.750049 14.4247 0.950194 14.078 1.27507 13.8905C1.5999 13.703 2.00018 13.703 2.32501 13.8905C2.64989 14.078 2.85003 14.4247 2.85003 14.7999V18.7498Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n</svg>\n";
51928
-
51929
- const fullscreenOnIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M15.1568 23.15C15.7408 23.15 16.2142 22.6766 16.2142 22.0926V17.1947C16.2142 16.7253 16.5948 16.3447 17.0642 16.3447H21.9621C22.5461 16.3447 23.0195 15.8713 23.0195 15.2873C23.0195 14.7034 22.5461 14.2299 21.9621 14.2299H16.0642C14.9832 14.2299 14.0995 15.1137 14.0995 16.1947V22.0926C14.0995 22.6766 14.5729 23.15 15.1568 23.15Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n <path\n d=\"M1.90739 10.7701H7.80528C8.88627 10.7701 9.77006 9.88627 9.77006 8.80528V2.90739C9.77006 2.32341 9.29665 1.85 8.71267 1.85C8.12869 1.85 7.65528 2.32341 7.65528 2.90739V7.80528C7.65528 8.27472 7.27472 8.65528 6.80528 8.65528H1.90739C1.32341 8.65528 0.85 9.12869 0.85 9.71267C0.85 10.2966 1.32341 10.7701 1.90739 10.7701Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n <path\n d=\"M8.71261 23.15C9.29659 23.15 9.77 22.6766 9.77 22.0926V16.1947C9.77 15.1137 8.88621 14.2299 7.80521 14.2299H1.90733C1.32335 14.2299 0.849939 14.7034 0.849939 15.2873C0.849939 15.8713 1.32335 16.3447 1.90733 16.3447H6.80521C7.27466 16.3447 7.65521 16.7253 7.65521 17.1947V22.0926C7.65521 22.6766 8.12862 23.15 8.71261 23.15Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n <path\n d=\"M21.9621 10.7701C22.5461 10.7701 23.0195 10.2966 23.0195 9.71267C23.0195 9.12869 22.5461 8.65528 21.9621 8.65528H17.0642C16.5948 8.65528 16.2142 8.27472 16.2142 7.80528V2.90739C16.2142 2.32341 15.7408 1.85 15.1568 1.85C14.5729 1.85 14.0995 2.32341 14.0995 2.90739V8.80528C14.0995 9.88627 14.9832 10.7701 16.0642 10.7701H21.9621Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n</svg>\n";
51915
+ function isMobile() {
51916
+ return Browser.isMobile;
51917
+ }
51930
51918
 
51931
51919
  /**
51932
51920
  *
@@ -51968,6 +51956,22 @@ function mediaControlClickaway(callback) {
51968
51956
  };
51969
51957
  }
51970
51958
 
51959
+ const mediaControlHTML = "<div class=\"media-control-background\" data-background></div>\n\n<div class=\"media-control-layer gcore-skin-bg-color\" data-controls>\n <% var renderBar = function(name) { %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1\" data-<%= name %>></div>\n <div class=\"bar-fill-2 gcore-skin-main-color\" data-<%= name %>></div>\n <div class=\"bar-hover\" data-<%= name %>></div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class=\"bar-container\" data-<%= name %>>\n <div class=\"bar-background\" data-<%= name %>>\n <div class=\"bar-fill-1 gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n <div class=\"bar-scrubber\" data-<%= name %>>\n <div class=\"bar-scrubber-icon gcore-skin-main-color\" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class=\"drawer-container\" data-<%= name %>>\n <div class=\"drawer-icon-container\" data-<%= name %>>\n <div class=\"drawer-icon media-control-icon gcore-skin-button-color\" data-<%= name %>></div>\n <span class=\"drawer-text\" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class=\"media-control-indicator gcore-skin-text-color\" data-<%= name %>></div>\n <% }; %>\n <% var renderQuality = function(name) { %>\n <div class=\"media-control-quality\" data-<%= name %>></div>\n <% }; %>\n <% var renderNerd = function(name) { %>\n <div class=\"media-control-nerd\" data-<%= name %>></div>\n <% }; %>\n <% var renderMultiCamera = function(name) { %>\n <div class=\"media-control-multicamera\" data-<%= name %>></div>\n <% }; %>\n <% var renderVR = function(name) { %>\n <div class=\"media-control-vr\" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type=\"button\" class=\"media-control-button media-control-icon gcore-skin-button-color\" data-<%= name %>\n aria-label=\"<%= name %>\"></button>\n <% }; %>\n\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function (settingsList) {\n settingsList.forEach(function (setting) {\n\n if (setting === \"seekbar\") {\n renderBar(setting);\n } else if (setting === \"volume\") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function (name) {\n return renderSegmentedBar(name);\n });\n } else if (setting === \"duration\" || setting === \"position\" || setting === \"clips\") {\n renderIndicator(setting);\n } else if (setting === \"quality\") {\n renderQuality(setting)\n } else if (setting === \"nerd\") {\n renderNerd(setting)\n } else if (setting === \"multicamera\") {\n renderMultiCamera(setting)\n } else if (setting === \"vr\") {\n renderVR(setting)\n } else if ([\"playpause\", \"playstop\", \"fullscreen\"].includes(setting)) {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.left && settings.left.length) { %>\n <div class=\"media-control-left-panel\" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.default && settings.default.length) { %>\n <div class=\"media-control-center-panel\" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class=\"media-control-right-panel\" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n";
51960
+
51961
+ const playIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_28_1564)\">\n <path d=\"M6 3V20L19.3571 11.5L6 3Z\" fill=\"#C9C9C9\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_28_1564\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
51962
+
51963
+ const pauseIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18.05 3H15.35C14.6057 3 14 3.6057 14 4.35V19.65C14 20.3943 14.6057 21 15.35 21H18.05C18.7943 21 19.4 20.3943 19.4 19.65V4.35C19.4 3.6057 18.7943 3 18.05 3ZM10.4 4.35V19.65C10.4 20.3943 9.7943 21 9.05 21H6.35C5.6057 21 5 20.3943 5 19.65V4.35C5 3.6057 5.6057 3 6.35 3H9.05C9.7943 3 10.4 3.6057 10.4 4.35Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
51964
+
51965
+ const stopIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"#C9C9C9\" d=\"M4.568 3.86h14.9v16.28h-14.9z\"/>\n</svg>\n";
51966
+
51967
+ const volumeMaxIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M14.187 7.71405C13.759 8.06405 13.697 8.69307 14.046 9.12107C14.662 9.87207 15 10.8941 15 11.9961C15 13.0991 14.662 14.1201 14.046 14.8711C13.697 15.2991 13.759 15.9291 14.187 16.2781C14.373 16.4311 14.597 16.5051 14.82 16.5051C15.109 16.5051 15.396 16.3801 15.594 16.1391C16.501 15.0301 17 13.5601 17 11.9961C17 10.4331 16.501 8.96207 15.594 7.85407C15.245 7.42707 14.614 7.36405 14.187 7.71405ZM19.772 5.14408C19.443 4.70008 18.816 4.60907 18.374 4.94007C17.931 5.27007 17.839 5.89605 18.169 6.33905C19.367 7.94705 20 9.90307 20 11.9961C20 14.0891 19.367 16.0451 18.169 17.6531C17.839 18.0971 17.931 18.7231 18.374 19.0531C18.553 19.1871 18.762 19.2511 18.97 19.2511C19.275 19.2511 19.576 19.1121 19.772 18.8491C21.23 16.8921 22 14.5231 22 11.9961C22 9.47007 21.23 7.10108 19.772 5.14408ZM12 3.85108V20.1421C12 20.4881 11.793 20.7971 11.473 20.9291C11.368 20.9721 11.258 20.9921 11.149 20.9921C10.926 20.9921 10.708 20.9031 10.544 20.7371L6.317 16.4431C6.038 16.1591 5.648 15.9961 5.249 15.9961H3.5C2.673 15.9961 2 15.3231 2 14.4961V9.49607C2 8.66907 2.673 7.99607 3.5 7.99607H5.249C5.648 7.99607 6.038 7.83308 6.317 7.54908L10.544 3.25507C10.787 3.00807 11.151 2.93206 11.473 3.06406C11.793 3.19506 12 3.50408 12 3.85108Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
51968
+
51969
+ const volumeMuteIcon = "<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";
51970
+
51971
+ const fullscreenOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M17.1999 4.85023H21.1498V8.80019C21.1498 9.0786 21.2604 9.34577 21.4574 9.54268C21.6283 9.71365 21.8523 9.81956 22.0906 9.84449L22.0965 9.85041H22.2001C22.4785 9.85041 22.7456 9.73981 22.9426 9.5429C23.1395 9.346 23.2501 9.07883 23.2501 8.80042V3.80024C23.2501 3.52182 23.1395 3.25465 22.9426 3.05775L22.7658 3.23453L22.9426 3.05775C22.7456 2.86085 22.4785 2.75024 22.2001 2.75024H17.1999C16.8247 2.75024 16.478 2.95039 16.2905 3.27526C16.103 3.6001 16.103 4.00037 16.2905 4.32521C16.478 4.65009 16.8247 4.85023 17.1999 4.85023Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n <path\n d=\"M1.79999 9.85017H1.90368L1.90961 9.84423C2.14785 9.81928 2.37176 9.71338 2.54271 9.54243C2.73961 9.34553 2.85021 9.07836 2.85021 8.79995V4.84999H6.80017C7.17536 4.84999 7.52201 4.64984 7.70953 4.32497C7.89703 4.00013 7.89703 3.59986 7.70953 3.27502C7.52201 2.95014 7.17537 2.75 6.80017 2.75H1.79999C1.52158 2.75 1.25441 2.8606 1.05751 3.05751C0.860605 3.25441 0.75 3.52158 0.75 3.79999V8.80017C0.75 9.07859 0.860605 9.34576 1.05751 9.54266C1.25441 9.73956 1.52158 9.85017 1.79999 9.85017Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n <path\n d=\"M21.1496 18.7498H17.1996C16.8245 18.7498 16.4778 18.95 16.2903 19.2748C16.1028 19.5997 16.1028 19.9999 16.2903 20.3248C16.4778 20.6497 16.8244 20.8498 17.1996 20.8498H21.5963L21.596 20.85H22.1996C22.478 20.85 22.7452 20.7394 22.9421 20.5425C23.139 20.3456 23.2496 20.0785 23.2496 19.8V14.7999C23.2496 14.4247 23.0494 14.078 22.7246 13.8905C22.3997 13.703 21.9995 13.703 21.6746 13.8905C21.3497 14.078 21.1496 14.4247 21.1496 14.7999V18.7498Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n <path\n d=\"M2.85003 18.7498H6.79999C7.17518 18.7498 7.52183 18.95 7.70935 19.2748C7.89685 19.5997 7.89685 19.9999 7.70935 20.3248C7.52183 20.6497 7.17519 20.8498 6.79999 20.8498H2.40337L2.40359 20.85H1.80004C1.52163 20.85 1.25446 20.7394 1.05756 20.5425C0.860653 20.3456 0.750049 20.0785 0.750049 19.8V14.7999C0.750049 14.4247 0.950194 14.078 1.27507 13.8905C1.5999 13.703 2.00018 13.703 2.32501 13.8905C2.64989 14.078 2.85003 14.4247 2.85003 14.7999V18.7498Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.5\"/>\n</svg>\n";
51972
+
51973
+ const fullscreenOnIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M15.1568 23.15C15.7408 23.15 16.2142 22.6766 16.2142 22.0926V17.1947C16.2142 16.7253 16.5948 16.3447 17.0642 16.3447H21.9621C22.5461 16.3447 23.0195 15.8713 23.0195 15.2873C23.0195 14.7034 22.5461 14.2299 21.9621 14.2299H16.0642C14.9832 14.2299 14.0995 15.1137 14.0995 16.1947V22.0926C14.0995 22.6766 14.5729 23.15 15.1568 23.15Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n <path\n d=\"M1.90739 10.7701H7.80528C8.88627 10.7701 9.77006 9.88627 9.77006 8.80528V2.90739C9.77006 2.32341 9.29665 1.85 8.71267 1.85C8.12869 1.85 7.65528 2.32341 7.65528 2.90739V7.80528C7.65528 8.27472 7.27472 8.65528 6.80528 8.65528H1.90739C1.32341 8.65528 0.85 9.12869 0.85 9.71267C0.85 10.2966 1.32341 10.7701 1.90739 10.7701Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n <path\n d=\"M8.71261 23.15C9.29659 23.15 9.77 22.6766 9.77 22.0926V16.1947C9.77 15.1137 8.88621 14.2299 7.80521 14.2299H1.90733C1.32335 14.2299 0.849939 14.7034 0.849939 15.2873C0.849939 15.8713 1.32335 16.3447 1.90733 16.3447H6.80521C7.27466 16.3447 7.65521 16.7253 7.65521 17.1947V22.0926C7.65521 22.6766 8.12862 23.15 8.71261 23.15Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n <path\n d=\"M21.9621 10.7701C22.5461 10.7701 23.0195 10.2966 23.0195 9.71267C23.0195 9.12869 22.5461 8.65528 21.9621 8.65528H17.0642C16.5948 8.65528 16.2142 8.27472 16.2142 7.80528V2.90739C16.2142 2.32341 15.7408 1.85 15.1568 1.85C14.5729 1.85 14.0995 2.32341 14.0995 2.90739V8.80528C14.0995 9.88627 14.9832 10.7701 16.0642 10.7701H21.9621Z\"\n fill=\"#C9C9C9\" stroke=\"#C9C9C9\" stroke-width=\"0.3\"/>\n</svg>\n";
51974
+
51971
51975
  // This is a derived work from the {@link https://github.com/clappr/clappr-plugins/tree/ffaa9d27005fa5a8a7c243ffc47eb5655b84b371/src/plugins/media_control | Clappr MediaControl plugin}
51972
51976
  // It is redistributed under the terms of the {@link ../../../../../LICENSE | Apache 2.0} license.
51973
51977
  // Copyright 2014 Globo.com Player authors. All rights reserved.
@@ -52002,7 +52006,7 @@ const INITIAL_SETTINGS = {
52002
52006
  default: [],
52003
52007
  seekEnabled: false,
52004
52008
  };
52005
- const T$b = 'plugins.media_control';
52009
+ const T$a = 'plugins.media_control';
52006
52010
  /**
52007
52011
  * Extended events for the {@link MediaControl} plugin
52008
52012
  * @public
@@ -52183,8 +52187,6 @@ class MediaControl extends UICorePlugin {
52183
52187
  'touchmove .bar-container[data-seekbar]': 'mousemoveOnSeekBar',
52184
52188
  'mouseleave .bar-container[data-seekbar]': 'mouseleaveOnSeekBar',
52185
52189
  'touchend .bar-container[data-seekbar]': 'mouseleaveOnSeekBar',
52186
- 'mouseenter .media-control-layer[data-controls]': 'setUserKeepVisible',
52187
- 'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible',
52188
52190
  };
52189
52191
  }
52190
52192
  get currentSeekPos() {
@@ -52266,7 +52268,6 @@ class MediaControl extends UICorePlugin {
52266
52268
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PAUSE, this.changeTogglePlay);
52267
52269
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_STOP, this.changeTogglePlay);
52268
52270
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_DBLCLICK, this.toggleFullscreen);
52269
- this.listenTo(this.core.activeContainer, Events$1.CONTAINER_CLICK, () => this.clickaway(this.core.activeContainer.$el[0]));
52270
52271
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
52271
52272
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PROGRESS, this.updateProgressBar);
52272
52273
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_SETTINGSUPDATE, this.updateSettings);
@@ -52280,12 +52281,10 @@ class MediaControl extends UICorePlugin {
52280
52281
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onLoadedMetadata);
52281
52282
  this.listenTo(this.core, Events$1.CONTAINER_DESTROYED, () => {
52282
52283
  this.cancelRenderTimer();
52284
+ this.setKeepVisible(false);
52283
52285
  });
52284
52286
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_MOUSE_ENTER, this.show);
52285
52287
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_MOUSE_LEAVE, this.delayHide);
52286
- this.listenTo(this.core.activeContainer, Events$1.CONTAINER_DESTROYED, () => {
52287
- this.clickaway(null);
52288
- });
52289
52288
  }
52290
52289
  /**
52291
52290
  * Hides the media control UI
@@ -52300,7 +52299,7 @@ class MediaControl extends UICorePlugin {
52300
52299
  * Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
52301
52300
  */
52302
52301
  enable() {
52303
- trace(`${T$b} enable`, {
52302
+ trace(`${T$a} enable`, {
52304
52303
  chromeless: this.options.chromeless,
52305
52304
  userDisabled: this.userDisabled,
52306
52305
  });
@@ -52416,7 +52415,7 @@ class MediaControl extends UICorePlugin {
52416
52415
  this.$playPauseToggle?.append(playIcon);
52417
52416
  this.$playStopToggle?.append(playIcon);
52418
52417
  this.trigger(Events$1.MEDIACONTROL_NOTPLAYING);
52419
- if (Browser.isMobile) {
52418
+ if (isMobile()) {
52420
52419
  this.show();
52421
52420
  }
52422
52421
  }
@@ -52457,19 +52456,19 @@ class MediaControl extends UICorePlugin {
52457
52456
  this.$el.removeClass('w370');
52458
52457
  this.$el.removeClass('w270');
52459
52458
  this.verticalVolume = false;
52460
- trace(`${T$b} playerResize`, {
52459
+ trace(`${T$a} playerResize`, {
52461
52460
  size,
52462
52461
  width: this.container.$el.width(),
52463
52462
  height: this.container.$el.height(),
52464
52463
  hideVolumeBar: this.options.hideVolumeBar,
52465
- isMobile: Browser.isMobile,
52464
+ isMobile: isMobile(),
52466
52465
  });
52467
52466
  try {
52468
52467
  const skinWidth = this.container.$el.width() || size.width;
52469
52468
  if (skinWidth <= 370 || this.options.hideVolumeBar) {
52470
52469
  this.$el.addClass('w370');
52471
52470
  }
52472
- if (skinWidth <= 270 && !Browser.isMobile) {
52471
+ if (skinWidth <= 270 && !isMobile()) {
52473
52472
  this.verticalVolume = true;
52474
52473
  this.$el.addClass('w270');
52475
52474
  }
@@ -52482,6 +52481,15 @@ class MediaControl extends UICorePlugin {
52482
52481
  this.container.isPlaying() ? this.container.pause() : this.container.play();
52483
52482
  return false;
52484
52483
  }
52484
+ play() {
52485
+ this.container && this.container.play();
52486
+ }
52487
+ pause() {
52488
+ this.container && this.container.pause();
52489
+ }
52490
+ stop() {
52491
+ this.container && this.container.stop();
52492
+ }
52485
52493
  togglePlayStop() {
52486
52494
  this.container.isPlaying()
52487
52495
  ? this.container.stop({ ui: true })
@@ -52582,11 +52590,11 @@ class MediaControl extends UICorePlugin {
52582
52590
  }
52583
52591
  }
52584
52592
  toggleFullscreen() {
52585
- if (!Browser.isMobile) {
52593
+ if (!isMobile()) {
52586
52594
  this.trigger(Events$1.MEDIACONTROL_FULLSCREEN, this.name);
52587
52595
  this.core.activeContainer.fullscreen();
52588
52596
  this.core.toggleFullscreen();
52589
- this.resetUserKeepVisible();
52597
+ // this.resetUserKeepVisible()
52590
52598
  }
52591
52599
  }
52592
52600
  onActiveContainerChanged() {
@@ -52707,13 +52715,6 @@ class MediaControl extends UICorePlugin {
52707
52715
  this.core.activeContainer && this.core.activeContainer.seekPercentage(pos);
52708
52716
  this.setSeekPercentage(pos);
52709
52717
  }
52710
- setUserKeepVisible(e) {
52711
- this.userKeepVisible = true;
52712
- this.clickaway(this.core.activeContainer.$el[0]);
52713
- }
52714
- resetUserKeepVisible = (e) => {
52715
- this.userKeepVisible = false;
52716
- };
52717
52718
  isVisible() {
52718
52719
  return !this.$el.hasClass('media-control-hide');
52719
52720
  }
@@ -52721,7 +52722,6 @@ class MediaControl extends UICorePlugin {
52721
52722
  if (this.disabled || this.options.disableControlPanel) {
52722
52723
  return;
52723
52724
  }
52724
- const timeout = DEFAULT_HIDE_DELAY;
52725
52725
  const mousePointerMoved = event &&
52726
52726
  event.clientX !== this.lastMouseX &&
52727
52727
  event.clientY !== this.lastMouseY;
@@ -52730,26 +52730,25 @@ class MediaControl extends UICorePlugin {
52730
52730
  clearTimeout(this.hideId);
52731
52731
  this.hideId = null;
52732
52732
  }
52733
+ this.hideId = setTimeout(() => this.hide(), DEFAULT_HIDE_DELAY);
52733
52734
  this.$el.show();
52734
52735
  this.trigger(Events$1.MEDIACONTROL_SHOW, this.name);
52735
52736
  this.core.activeContainer?.trigger(Events$1.CONTAINER_MEDIACONTROL_SHOW, this.name);
52736
52737
  this.$el.removeClass('media-control-hide');
52737
- this.hideId = setTimeout(() => this.hide(), timeout);
52738
52738
  if (event) {
52739
52739
  this.lastMouseX = event.clientX;
52740
52740
  this.lastMouseY = event.clientY;
52741
52741
  }
52742
52742
  }
52743
- const showing = true;
52744
- this.updateCursorStyle(showing);
52743
+ this.updateCursorStyle(true);
52745
52744
  }
52746
52745
  hide(delay = 0) {
52747
52746
  if (!this.isVisible()) {
52748
52747
  return;
52749
52748
  }
52750
- const timeout = delay || 2000;
52751
52749
  if (this.hideId !== null) {
52752
52750
  clearTimeout(this.hideId);
52751
+ this.hideId = null;
52753
52752
  }
52754
52753
  if (!this.disabled && this.options.hideMediaControl === false) {
52755
52754
  return;
@@ -52758,7 +52757,7 @@ class MediaControl extends UICorePlugin {
52758
52757
  const hasDraggingAction = this.draggingSeekBar || this.draggingVolumeBar;
52759
52758
  if (!this.disabled &&
52760
52759
  (delay || hasKeepVisibleRequested || hasDraggingAction)) {
52761
- this.hideId = setTimeout(() => this.hide(), timeout);
52760
+ this.hideId = setTimeout(() => this.hide(), delay || 2000);
52762
52761
  }
52763
52762
  else {
52764
52763
  if (!this.options.controlsDontHide || isFullscreen(this.container.el)) {
@@ -52893,19 +52892,13 @@ class MediaControl extends UICorePlugin {
52893
52892
  /**
52894
52893
  * Set or reset the keep visibility state
52895
52894
  *
52896
- * Keep visibility state controls whether the media control is hidden automatically after a delay.
52897
- * Keep visibility prevents the the auto-hide behaviour
52895
+ * Keep visibility state controls whether the media control is hidden automatically after a delay, which is a default behaviour.
52898
52896
  *
52899
52897
  * @param keepVisible - The state
52900
52898
  */
52901
52899
  setKeepVisible(keepVisible) {
52902
52900
  this.keepVisible = keepVisible;
52903
- if (keepVisible) {
52904
- this.clickaway(this.core.activeContainer.$el[0]);
52905
- }
52906
- else {
52907
- this.clickaway(null);
52908
- }
52901
+ this.clickaway(keepVisible ? this.core.activeContainer.$el[0] : null);
52909
52902
  }
52910
52903
  getMountParent(name) {
52911
52904
  switch (name) {
@@ -52986,7 +52979,7 @@ class MediaControl extends UICorePlugin {
52986
52979
  });
52987
52980
  }
52988
52981
  bindKeyEvents() {
52989
- if (Browser.isMobile || this.options.disableKeyboardShortcuts) {
52982
+ if (isMobile() || this.options.disableKeyboardShortcuts) {
52990
52983
  return;
52991
52984
  }
52992
52985
  this.unbindKeyEvents();
@@ -53073,6 +53066,7 @@ class MediaControl extends UICorePlugin {
53073
53066
  * @internal
53074
53067
  */
53075
53068
  destroy() {
53069
+ this.cancelTimers();
53076
53070
  this.cancelRenderTimer();
53077
53071
  $(document).unbind('mouseup', this.stopDrag);
53078
53072
  $(document).unbind('mousemove', this.updateDrag);
@@ -53081,6 +53075,17 @@ class MediaControl extends UICorePlugin {
53081
53075
  this.unbindKeyEvents();
53082
53076
  return super.destroy();
53083
53077
  }
53078
+ cancelTimers() {
53079
+ if (this.hideId !== null) {
53080
+ clearTimeout(this.hideId);
53081
+ this.hideId = null;
53082
+ }
53083
+ if (this.hideVolumeId !== null) {
53084
+ clearTimeout(this.hideVolumeId);
53085
+ this.hideVolumeId = null;
53086
+ }
53087
+ this.cancelRenderTimer();
53088
+ }
53084
53089
  cancelRenderTimer() {
53085
53090
  if (this.renderTimerId) {
53086
53091
  clearTimeout(this.renderTimerId);
@@ -53110,7 +53115,7 @@ class MediaControl extends UICorePlugin {
53110
53115
  }
53111
53116
  // Video volume cannot be changed with Safari on mobile devices
53112
53117
  // Display mute/unmute icon only if Safari version >= 10
53113
- if (Browser.isSafari && Browser.isMobile) {
53118
+ if (Browser.isSafari && isMobile()) {
53114
53119
  if (Browser.version < 10) {
53115
53120
  this.$volumeContainer?.css({ display: 'none' });
53116
53121
  }
@@ -53127,7 +53132,7 @@ class MediaControl extends UICorePlugin {
53127
53132
  setTimeout(() => {
53128
53133
  !this.settings.seekEnabled &&
53129
53134
  this.$seekBarContainer?.addClass('seek-disabled');
53130
- !Browser.isMobile &&
53135
+ !isMobile() &&
53131
53136
  !this.options.disableKeyboardShortcuts &&
53132
53137
  this.bindKeyEvents();
53133
53138
  this.playerResize({
@@ -53151,6 +53156,7 @@ class MediaControl extends UICorePlugin {
53151
53156
  this.container.fullscreen();
53152
53157
  // TODO: fix after it full screen will be fixed on iOS
53153
53158
  if (Browser.isiOS) {
53159
+ // TODO use isFullscreen utility function
53154
53160
  if (this.core.isFullscreen()) {
53155
53161
  Fullscreen.cancelFullscreen(this.core.el);
53156
53162
  }
@@ -53161,7 +53167,6 @@ class MediaControl extends UICorePlugin {
53161
53167
  else {
53162
53168
  this.core.toggleFullscreen();
53163
53169
  }
53164
- this.resetUserKeepVisible();
53165
53170
  }
53166
53171
  static getPageX(event) {
53167
53172
  return getPageX(event);
@@ -53206,7 +53211,7 @@ class MediaControl extends UICorePlugin {
53206
53211
  delayHide() {
53207
53212
  this.hide(this.options.hideMediaControlDelay || DEFAULT_HIDE_DELAY);
53208
53213
  }
53209
- clickaway = mediaControlClickaway(() => this.resetUserKeepVisible());
53214
+ clickaway = mediaControlClickaway(() => this.setKeepVisible(false));
53210
53215
  }
53211
53216
  MediaControl.extend = function (properties) {
53212
53217
  return extend(MediaControl, properties);
@@ -53453,7 +53458,7 @@ class AudioTracks extends UICorePlugin {
53453
53458
 
53454
53459
  const templateHtml$2 = "<div class=\"big-mute-icon-wrapper\" data-big-mute id=\"gplayer-big-mute-button\">\n <div class=\"big-mute-icon gcore-skin-border-color\" data-big-mute-icon id=\"gplayer-big-mute-icon\"></div>\n</div>\n";
53455
53460
 
53456
- const T$a = 'plugins.big_mute_button';
53461
+ const T$9 = 'plugins.big_mute_button';
53457
53462
  // TODO rewrite as a container plugin
53458
53463
  /**
53459
53464
  * `PLUGIN` that displays a big mute button over the video when it's being played muted.
@@ -53516,7 +53521,7 @@ class BigMuteButton extends UICorePlugin {
53516
53521
  if (autoPlay) {
53517
53522
  this.autoPlay = true;
53518
53523
  }
53519
- trace(`${T$a} onPlay`, {
53524
+ trace(`${T$9} onPlay`, {
53520
53525
  autoPlay: this.autoPlay,
53521
53526
  wasMuted,
53522
53527
  volume,
@@ -53530,7 +53535,7 @@ class BigMuteButton extends UICorePlugin {
53530
53535
  }
53531
53536
  onStop(_, metadata) {
53532
53537
  const ui = metadata?.ui;
53533
- trace(`${T$a} onStop`, { ui });
53538
+ trace(`${T$9} onStop`, { ui });
53534
53539
  if (ui) {
53535
53540
  this.destroy();
53536
53541
  }
@@ -56494,7 +56499,7 @@ const PLAYBACK_NAMES = {
56494
56499
  hls: 'HLS.js',
56495
56500
  html5_video: 'Native',
56496
56501
  };
56497
- const T$9 = 'plugins.nerd_stats';
56502
+ const T$8 = 'plugins.nerd_stats';
56498
56503
  /**
56499
56504
  * `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
56500
56505
  * @public
@@ -56631,7 +56636,7 @@ class NerdStats extends UICorePlugin {
56631
56636
  return super.destroy();
56632
56637
  }
56633
56638
  toggle = () => {
56634
- trace(`${T$9} toggle`, {
56639
+ trace(`${T$8} toggle`, {
56635
56640
  open: this.open,
56636
56641
  });
56637
56642
  if (this.open) {
@@ -56651,14 +56656,14 @@ class NerdStats extends UICorePlugin {
56651
56656
  })
56652
56657
  .catch((e) => {
56653
56658
  reportError(e);
56654
- trace(`${T$9} speedtest error`, {
56659
+ trace(`${T$8} speedtest error`, {
56655
56660
  error: e,
56656
56661
  });
56657
56662
  this.disable();
56658
56663
  });
56659
56664
  }
56660
56665
  hide() {
56661
- trace(`${T$9} hide`);
56666
+ trace(`${T$8} hide`);
56662
56667
  this.$el.hide();
56663
56668
  this.open = false;
56664
56669
  stopSpeedtest();
@@ -57391,7 +57396,7 @@ const reloadIcon = "<svg fill=\"#FFFFFF\" height=\"24\" viewBox=\"0 0 24 24\" wi
57391
57396
 
57392
57397
  const templateHtml = "<div class=\"player-error-screen__content\" data-error-screen>\n <% if (icon) { %>\n <div class=\"player-error-screen__icon\" data-error-screen><%= icon %></div>\n <% } %>\n <div class=\"player-error-screen__title\" data-error-screen><%= title %></div>\n <% if (message) { %>\n <div class=\"player-error-screen__message\" data-error-screen><%= message %></div>\n <% } %>\n <% if (code) { %>\n <div class=\"player-error-screen__code\" data-error-screen><%= i18n.t('error_code') %>: <%= code %></div>\n <% } %>\n <% if (reloadIcon) { %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n <% } %>\n</div>\n";
57393
57398
 
57394
- const T$8 = 'plugins.error_screen';
57399
+ const T$7 = 'plugins.error_screen';
57395
57400
  /**
57396
57401
  * `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
57397
57402
  * @public
@@ -57443,11 +57448,11 @@ class ErrorScreen extends UICorePlugin {
57443
57448
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
57444
57449
  }
57445
57450
  onPlay() {
57446
- trace(`${T$8} onPlay`);
57451
+ trace(`${T$7} onPlay`);
57447
57452
  this.unmount();
57448
57453
  }
57449
57454
  unmount() {
57450
- trace(`${T$8} unmount`);
57455
+ trace(`${T$7} unmount`);
57451
57456
  this.err = null;
57452
57457
  this.$el.remove();
57453
57458
  }
@@ -57460,7 +57465,7 @@ class ErrorScreen extends UICorePlugin {
57460
57465
  };
57461
57466
  }
57462
57467
  reload() {
57463
- trace(`${T$8} reload`);
57468
+ trace(`${T$7} reload`);
57464
57469
  setTimeout(() => {
57465
57470
  this.core.configure({
57466
57471
  reloading: true,
@@ -57483,7 +57488,7 @@ class ErrorScreen extends UICorePlugin {
57483
57488
  }
57484
57489
  }
57485
57490
  onError(err) {
57486
- trace(`${T$8} onError`, { err });
57491
+ trace(`${T$7} onError`, { err });
57487
57492
  if (err.UI) {
57488
57493
  if (this.err) {
57489
57494
  this.unmount();
@@ -57968,7 +57973,7 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
57968
57973
  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";
57969
57974
 
57970
57975
  const VERSION$4 = '0.0.1';
57971
- const T$7 = 'plugins.multicamera';
57976
+ const T$6 = 'plugins.multicamera';
57972
57977
  /**
57973
57978
  * `PLUGIN` that adds support for loading multiple streams and switching between them using the media control UI.
57974
57979
  * @beta
@@ -58125,7 +58130,7 @@ class MultiCamera extends UICorePlugin {
58125
58130
  onCameraSelect(event) {
58126
58131
  const value = event.currentTarget.dataset
58127
58132
  .multicameraSelectorSelect;
58128
- trace(`${T$7} onCameraSelect`, { value });
58133
+ trace(`${T$6} onCameraSelect`, { value });
58129
58134
  if (value !== undefined) {
58130
58135
  this.changeById(parseInt(value, 10));
58131
58136
  }
@@ -58251,13 +58256,13 @@ class MultiCamera extends UICorePlugin {
58251
58256
  }
58252
58257
  }
58253
58258
  changeById(id) {
58254
- trace(`${T$7} changeById`, { id });
58259
+ trace(`${T$6} changeById`, { id });
58255
58260
  queueMicrotask(() => {
58256
58261
  const playbackOptions = this.core.options.playback || {};
58257
58262
  // TODO figure out what this does
58258
58263
  playbackOptions.recycleVideo = Browser.isMobile;
58259
58264
  this.currentCamera = this.findElementById(id) ?? null;
58260
- trace(`${T$7} changeById`, {
58265
+ trace(`${T$6} changeById`, {
58261
58266
  id,
58262
58267
  currentCamera: this.currentCamera,
58263
58268
  multicamera: this.multicamera,
@@ -58278,7 +58283,7 @@ class MultiCamera extends UICorePlugin {
58278
58283
  // TODO remove?
58279
58284
  // for html5 playback:
58280
58285
  this.options.dvrEnabled = this.currentCamera.dvr;
58281
- trace(`${T$7} changeById`, { currentCamera: this.currentCamera });
58286
+ trace(`${T$6} changeById`, { currentCamera: this.currentCamera });
58282
58287
  // TODO
58283
58288
  this.core.configure({
58284
58289
  playback: playbackOptions,
@@ -58341,7 +58346,7 @@ const pipIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"no
58341
58346
  const buttonHtml$2 = "<button class=\"gplayer-lite-btn gcore-skin-button-color\">\n <%= pipIcon %>\n</button>\n";
58342
58347
 
58343
58348
  const VERSION$3 = '0.0.1';
58344
- const T$6 = `plugins.pip`;
58349
+ const T$5 = `plugins.pip`;
58345
58350
  /**
58346
58351
  * `PLUGIN` that enables picture-in-picture mode.
58347
58352
  * @public
@@ -58399,7 +58404,7 @@ class PictureInPicture extends UICorePlugin {
58399
58404
  });
58400
58405
  }
58401
58406
  isPiPSupported() {
58402
- trace(`${T$6} isPiPSupported`, {
58407
+ trace(`${T$5} isPiPSupported`, {
58403
58408
  pictureInPictureEnabled: !!document.pictureInPictureEnabled,
58404
58409
  requestPictureInPicture: !!HTMLVideoElement.prototype.requestPictureInPicture,
58405
58410
  });
@@ -58421,7 +58426,7 @@ class PictureInPicture extends UICorePlugin {
58421
58426
  return this;
58422
58427
  }
58423
58428
  togglePictureInPicture() {
58424
- trace(`${T$6} togglePictureInPicture`);
58429
+ trace(`${T$5} togglePictureInPicture`);
58425
58430
  if (this.videoElement !== document.pictureInPictureElement) {
58426
58431
  this.requestPictureInPicture();
58427
58432
  }
@@ -58430,13 +58435,13 @@ class PictureInPicture extends UICorePlugin {
58430
58435
  }
58431
58436
  }
58432
58437
  requestPictureInPicture() {
58433
- trace(`${T$6} requestPictureInPicture`, {
58438
+ trace(`${T$5} requestPictureInPicture`, {
58434
58439
  videoElement: !!this.videoElement,
58435
58440
  });
58436
58441
  this.videoElement.requestPictureInPicture();
58437
58442
  }
58438
58443
  exitPictureInPicture() {
58439
- trace(`${T$6} exitPictureInPicture`);
58444
+ trace(`${T$5} exitPictureInPicture`);
58440
58445
  document.exitPictureInPicture();
58441
58446
  }
58442
58447
  }
@@ -58463,7 +58468,7 @@ const DEFAULT_PLAYBACK_RATES = [
58463
58468
  { value: 2.0, label: '2x' },
58464
58469
  ];
58465
58470
  const DEFAULT_PLAYBACK_RATE = 1;
58466
- const T$5 = 'plugins.playback_rate';
58471
+ const T$4 = 'plugins.playback_rate';
58467
58472
  /**
58468
58473
  * `PLUGIN` that allows changing the playback speed of the video.
58469
58474
  * @public
@@ -58549,7 +58554,7 @@ class PlaybackRate extends UICorePlugin {
58549
58554
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
58550
58555
  }
58551
58556
  onCoreReady() {
58552
- trace(`${T$5} onCoreReady`);
58557
+ trace(`${T$4} onCoreReady`);
58553
58558
  const mediaControl = this.core.getPlugin('media_control');
58554
58559
  assert(mediaControl, 'media_control plugin is required');
58555
58560
  const gear = this.core.getPlugin('bottom_gear');
@@ -58558,7 +58563,7 @@ class PlaybackRate extends UICorePlugin {
58558
58563
  this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
58559
58564
  }
58560
58565
  onActiveContainerChange() {
58561
- trace(`${T$5} onActiveContainerChange`);
58566
+ trace(`${T$4} onActiveContainerChange`);
58562
58567
  this.metadataLoaded = false;
58563
58568
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_STOP, this.onStop);
58564
58569
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
@@ -58566,15 +58571,15 @@ class PlaybackRate extends UICorePlugin {
58566
58571
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetaDataLoaded);
58567
58572
  }
58568
58573
  onMediaControlRendered() {
58569
- trace(`${T$5} onMediaControlRendered`);
58574
+ trace(`${T$4} onMediaControlRendered`);
58570
58575
  this.render();
58571
58576
  }
58572
58577
  onGearRendered() {
58573
- trace(`${T$5} onGearRendered`);
58578
+ trace(`${T$4} onGearRendered`);
58574
58579
  this.mount();
58575
58580
  }
58576
58581
  mount() {
58577
- trace(`${T$5} mount`, {
58582
+ trace(`${T$4} mount`, {
58578
58583
  shouldMount: this.shouldMount(),
58579
58584
  });
58580
58585
  if (!this.shouldMount()) {
@@ -58591,7 +58596,7 @@ class PlaybackRate extends UICorePlugin {
58591
58596
  })));
58592
58597
  }
58593
58598
  onMetaDataLoaded() {
58594
- trace(`${T$5} onMetaDataLoaded`, {
58599
+ trace(`${T$4} onMetaDataLoaded`, {
58595
58600
  playbackType: this.core.activePlayback.getPlaybackType(),
58596
58601
  dvrEnabled: this.core.activePlayback.dvrEnabled,
58597
58602
  });
@@ -58613,7 +58618,7 @@ class PlaybackRate extends UICorePlugin {
58613
58618
  this.core.activePlayback?.setPlaybackRate(this.selectedRate);
58614
58619
  }
58615
58620
  else {
58616
- trace(`${T$5} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
58621
+ trace(`${T$4} onPlaybackRateChange not steering to the selected rate, it is seemingly a catchup algorithm working`, {
58617
58622
  playbackRate,
58618
58623
  selectedRate: this.selectedRate,
58619
58624
  });
@@ -58676,13 +58681,13 @@ class PlaybackRate extends UICorePlugin {
58676
58681
  }
58677
58682
  }
58678
58683
  syncRate() {
58679
- trace(`${T$5} syncRate`, {
58684
+ trace(`${T$4} syncRate`, {
58680
58685
  selectedRate: this.selectedRate,
58681
58686
  });
58682
58687
  this.core.activePlayback?.setPlaybackRate(this.selectedRate);
58683
58688
  }
58684
58689
  resetPlaybackRate() {
58685
- trace(`${T$5} resetPlaybackRate`, {
58690
+ trace(`${T$4} resetPlaybackRate`, {
58686
58691
  selectedRate: this.selectedRate,
58687
58692
  });
58688
58693
  this.core.activePlayback?.setPlaybackRate(DEFAULT_PLAYBACK_RATE);
@@ -58717,7 +58722,7 @@ class PlaybackRate extends UICorePlugin {
58717
58722
  ?.label || `x${rate}`);
58718
58723
  }
58719
58724
  highlightCurrentRate() {
58720
- trace(`${T$5} highlightCurrentRate`, {
58725
+ trace(`${T$4} highlightCurrentRate`, {
58721
58726
  selectedRate: this.selectedRate,
58722
58727
  });
58723
58728
  this.allRateElements().removeClass('current');
@@ -59753,7 +59758,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
59753
59758
  }
59754
59759
  }
59755
59760
 
59756
- const T$4 = 'plugins.source_controller';
59761
+ const T$3 = 'plugins.source_controller';
59757
59762
  const INITIAL_RETRY_DELAY = 1000;
59758
59763
  const MAX_RETRY_DELAY = 5000;
59759
59764
  const RETRY_DELAY_BLUR = 500;
@@ -59929,7 +59934,7 @@ class SourceController extends CorePlugin {
59929
59934
  }
59930
59935
  bindContainerEventListeners() {
59931
59936
  this.core.activePlayback.on(Events$1.PLAYBACK_ERROR, (error) => {
59932
- trace(`${T$4} on PLAYBACK_ERROR`, {
59937
+ trace(`${T$3} on PLAYBACK_ERROR`, {
59933
59938
  error: {
59934
59939
  code: error?.code,
59935
59940
  description: error?.description,
@@ -59953,7 +59958,7 @@ class SourceController extends CorePlugin {
59953
59958
  }
59954
59959
  });
59955
59960
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAY, (_, { autoPlay }) => {
59956
- trace(`${T$4} onContainerPlay`, {
59961
+ trace(`${T$3} onContainerPlay`, {
59957
59962
  autoPlay,
59958
59963
  currentSource: this.sourcesList[this.currentSourceIndex],
59959
59964
  retrying: this.active,
@@ -59971,7 +59976,7 @@ class SourceController extends CorePlugin {
59971
59976
  this.sourcesDelay = {};
59972
59977
  }
59973
59978
  retryPlayback() {
59974
- trace(`${T$4} retryPlayback enter`, {
59979
+ trace(`${T$3} retryPlayback enter`, {
59975
59980
  currentSourceIndex: this.currentSourceIndex,
59976
59981
  currentSource: this.sourcesList[this.currentSourceIndex],
59977
59982
  });
@@ -59979,18 +59984,18 @@ class SourceController extends CorePlugin {
59979
59984
  this.switching = true;
59980
59985
  this.core.activeContainer?.getPlugin('spinner')?.show(0);
59981
59986
  this.getNextMediaSource().then((nextSource) => {
59982
- trace(`${T$4} retryPlayback syncing...`, {
59987
+ trace(`${T$3} retryPlayback syncing...`, {
59983
59988
  nextSource,
59984
59989
  });
59985
59990
  const rnd = Math.round(RETRY_DELAY_BLUR * Math.random());
59986
59991
  this.sync(() => {
59987
59992
  this.switching = false;
59988
59993
  this.core.load(nextSource.source, nextSource.mimeType);
59989
- trace(`${T$4} retryPlayback loaded`, {
59994
+ trace(`${T$3} retryPlayback loaded`, {
59990
59995
  nextSource,
59991
59996
  });
59992
59997
  setTimeout(() => {
59993
- trace(`${T$4} retryPlayback playing`, {
59998
+ trace(`${T$3} retryPlayback playing`, {
59994
59999
  autoPlay: this.autoPlay,
59995
60000
  nextSource,
59996
60001
  });
@@ -60028,8 +60033,6 @@ const comboboxHTML = "<button\n class='media-control-button media-control-ico
60028
60033
  const stringHTML = "<div class=\"gplayer-cc-line\" id=\"gplayer-cc-line\">\n <p></p>\n</div>\n";
60029
60034
 
60030
60035
  const VERSION = '2.19.14';
60031
- const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
60032
- const T$3 = 'plugins.cc';
60033
60036
  /**
60034
60037
  * `PLUGIN` that provides a UI to select the subtitles when available.
60035
60038
  * @public
@@ -60066,9 +60069,10 @@ const T$3 = 'plugins.cc';
60066
60069
  * ```
60067
60070
  */
60068
60071
  class ClosedCaptions extends UICorePlugin {
60069
- isPreselectedApplied = false;
60072
+ isSelectedApplied = false;
60070
60073
  active = false;
60071
60074
  open = false;
60075
+ userSelectedItemId = -1;
60072
60076
  track = null;
60073
60077
  tracks = [];
60074
60078
  $line = null;
@@ -60166,10 +60170,9 @@ class ClosedCaptions extends UICorePlugin {
60166
60170
  video.classList.remove('ios-fullscreen');
60167
60171
  }
60168
60172
  });
60169
- this.isPreselectedApplied = false;
60173
+ this.isSelectedApplied = false;
60170
60174
  }
60171
60175
  onPlaybackReady() {
60172
- trace(`${T$3} onPlaybackReady`);
60173
60176
  this.core.activePlayback.oncueenter = (e) => {
60174
60177
  this.setSubtitleText(e.text);
60175
60178
  };
@@ -60190,7 +60193,7 @@ class ClosedCaptions extends UICorePlugin {
60190
60193
  this.activateTrack(id);
60191
60194
  }
60192
60195
  activateTrack(id) {
60193
- if (['dash', 'hls'].includes(this.core.activePlayback?.name)) {
60196
+ if (this.core.activePlayback && ['dash', 'hls'].includes(this.core.activePlayback.name)) {
60194
60197
  this.core.activePlayback.setTextTrack(id);
60195
60198
  return;
60196
60199
  }
@@ -60228,7 +60231,7 @@ class ClosedCaptions extends UICorePlugin {
60228
60231
  try {
60229
60232
  // TODO ensure to apply only once
60230
60233
  this.currentTracks = this.core.activePlayback.closedCaptionsTracks;
60231
- this.applyPreselectedSubtitles();
60234
+ this.applySelectedSubtitles();
60232
60235
  this.render();
60233
60236
  }
60234
60237
  catch (error) {
@@ -60335,22 +60338,36 @@ class ClosedCaptions extends UICorePlugin {
60335
60338
  }
60336
60339
  onItemSelect(event) {
60337
60340
  // event.target does not exist for some reason in tests
60338
- const id = (event.target ?? event.currentTarget).dataset?.item ??
60339
- '-1';
60340
- localStorage.setItem(LOCAL_STORAGE_CC_ID, id); // TODO store language instead?
60341
- this.selectItem(this.findById(Number(id)));
60341
+ const id = Number((event.target ?? event.currentTarget).dataset?.item ??
60342
+ '-1');
60343
+ // TODO review, make configurable, and emit event in addition
60344
+ // localStorage.setItem(LOCAL_STORAGE_CC_ID, id) // TODO store language instead?
60345
+ this.userSelectedItemId = id;
60346
+ this.selectItem(this.findById(id));
60342
60347
  this.hideMenu();
60343
60348
  return false;
60344
60349
  }
60345
- applyPreselectedSubtitles() {
60346
- if (!this.isPreselectedApplied) {
60347
- this.isPreselectedApplied = true;
60348
- // if the language is undefined, then let the engine decide
60349
- // to hide the subtitles forcefully, set the language to 'none'
60350
- setTimeout(() => {
60351
- this.selectItem(this.tracks.find((t) => this.isPreselectedLanguage(t.track.language)) ?? null);
60352
- }, 0);
60350
+ applySelectedSubtitles() {
60351
+ if (this.isSelectedApplied) {
60352
+ return;
60353
+ }
60354
+ this.isSelectedApplied = true;
60355
+ // If user selected a language, activate that
60356
+ // Otherwise, if there is no configured language, then let the engine decide
60357
+ // To hide the subtitles initially forcefully, set the language to 'none'
60358
+ let matcher;
60359
+ if (this.userSelectedItemId !== -1) {
60360
+ matcher = (track) => track.id === this.userSelectedItemId;
60361
+ }
60362
+ else if (this.preselectedLanguage) {
60363
+ matcher = (track) => this.isPreselectedLanguage(track.track.language);
60353
60364
  }
60365
+ else {
60366
+ return;
60367
+ }
60368
+ setTimeout(() => {
60369
+ this.selectItem(this.tracks.find(matcher) ?? null);
60370
+ }, 0);
60354
60371
  }
60355
60372
  hideMenu() {
60356
60373
  this.open = false;
@@ -60384,10 +60401,9 @@ class ClosedCaptions extends UICorePlugin {
60384
60401
  return this.$el.find('#gplayer-cc-menu li'); // TODO fix semantically
60385
60402
  }
60386
60403
  selectSubtitles() {
60387
- const trackId = this.currentTrack?.id ?? -1;
60388
- // TODO find out if this is needed
60389
- this.core.activePlayback.closedCaptionsTrackId = trackId;
60390
- // this.core.activePlayback.closedCaptionsTrackId = -1
60404
+ if (this.currentTrack) {
60405
+ this.core.activePlayback.closedCaptionsTrackId = this.currentTrack.id;
60406
+ }
60391
60407
  }
60392
60408
  getSubtitleText(track) {
60393
60409
  const currentTime = this.core.activePlayback?.getCurrentTime() ?? 0;