@gcorevideo/player 2.28.16 → 2.28.18

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/core.js CHANGED
@@ -51319,7 +51319,7 @@ class Player {
51319
51319
  }
51320
51320
  }
51321
51321
 
51322
- var version$1 = "2.28.16";
51322
+ var version$1 = "2.28.18";
51323
51323
 
51324
51324
  var packages = {
51325
51325
  "node_modules/@clappr/core": {
package/dist/index.css CHANGED
@@ -122,6 +122,100 @@
122
122
  .gplayer-lite-btn::-moz-focus-inner {
123
123
  border: 0;
124
124
  padding: 0;
125
+ }.big-mute-icon-wrapper[data-big-mute] {
126
+ position: absolute;
127
+ z-index: 9998;
128
+ background-color: transparent;
129
+ display: flex;
130
+ justify-content: center;
131
+ width: 100%;
132
+ height: calc(100% - 50px);
133
+ margin: 0 auto;
134
+ opacity: 0.75;
135
+ transition: opacity 0.1s ease;
136
+ pointer-events: auto;
137
+ }
138
+ .big-mute-icon-wrapper[data-big-mute].hide {
139
+ display: none;
140
+ }
141
+ .big-mute-icon-wrapper[data-big-mute]:hover {
142
+ cursor: pointer;
143
+ }
144
+
145
+ .big-mute-icon[data-big-mute-icon] {
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ align-self: center;
150
+ width: 120px;
151
+ height: 120px;
152
+ border: 2px solid white;
153
+ border-radius: 50%;
154
+ filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
155
+ filter: alpha(opacity=60);
156
+ opacity: 1;
157
+ box-shadow: 0 0 1px 0 white;
158
+ background: rgba(240, 243, 247, 0.9411764706);
159
+ z-index: 10000;
160
+ }
161
+ .big-mute-icon[data-big-mute-icon] svg {
162
+ margin-left: 5px;
163
+ width: 80px;
164
+ height: 80px;
165
+ }
166
+ .big-mute-icon[data-big-mute-icon] svg path {
167
+ fill: #1f1e1e !important;
168
+ }
169
+ .big-mute-icon[data-big-mute-icon]:hover {
170
+ background: rgba(240, 243, 247, 0.8784313725);
171
+ }
172
+ .big-mute-icon[data-big-mute-icon]:hover svg path {
173
+ fill: #151515 !important;
174
+ }.media-control-skin-1 .media-control-item.media-control-gear {
175
+ order: 99;
176
+ }
177
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-wrapper {
178
+ position: absolute;
179
+ right: 16px;
180
+ bottom: 52px;
181
+ width: 250px;
182
+ min-height: 48px;
183
+ z-index: 9999;
184
+ border-radius: 4px;
185
+ box-shadow: 0 0 1px 1px var(--gplayer-mc-popup-border-color);
186
+ }
187
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-options-list {
188
+ padding: 8px 0;
189
+ }
190
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-option {
191
+ margin: 0;
192
+ text-align: left;
193
+ line-height: 22px;
194
+ padding: 5px 14px;
195
+ width: 250px;
196
+ font-size: 12px;
197
+ display: flex;
198
+ align-items: center;
199
+ justify-content: flex-start;
200
+ gap: 8px;
201
+ }
202
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-option_icon {
203
+ flex: 24px 0 0;
204
+ height: 24px;
205
+ }
206
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-option_icon.hidden {
207
+ visibility: hidden;
208
+ display: inline-block;
209
+ }
210
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-option_label {
211
+ flex: 0 1 100%;
212
+ }
213
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-option_arrow-right-icon {
214
+ flex: 0 0 14px;
215
+ height: 24px;
216
+ }
217
+ .media-control-skin-1 .media-control-item.media-control-gear .gear-option_value {
218
+ flex: 1 0 auto;
125
219
  }*,
126
220
  :focus,
127
221
  :visited {
@@ -185,100 +279,6 @@
185
279
  }
186
280
  .gear-wrapper ul.gear-sub-menu li.current a .check-icon svg {
187
281
  display: inline;
188
- }.media-control-skin-1 .media-control-item.media-control-gear {
189
- order: 99;
190
- }
191
- .media-control-skin-1 .media-control-item.media-control-gear .gear-wrapper {
192
- position: absolute;
193
- right: 16px;
194
- bottom: 52px;
195
- width: 250px;
196
- min-height: 48px;
197
- z-index: 9999;
198
- border-radius: 4px;
199
- box-shadow: 0 0 1px 1px var(--gplayer-mc-popup-border-color);
200
- }
201
- .media-control-skin-1 .media-control-item.media-control-gear .gear-options-list {
202
- padding: 8px 0;
203
- }
204
- .media-control-skin-1 .media-control-item.media-control-gear .gear-option {
205
- margin: 0;
206
- text-align: left;
207
- line-height: 22px;
208
- padding: 5px 14px;
209
- width: 250px;
210
- font-size: 12px;
211
- display: flex;
212
- align-items: center;
213
- justify-content: flex-start;
214
- gap: 8px;
215
- }
216
- .media-control-skin-1 .media-control-item.media-control-gear .gear-option_icon {
217
- flex: 24px 0 0;
218
- height: 24px;
219
- }
220
- .media-control-skin-1 .media-control-item.media-control-gear .gear-option_icon.hidden {
221
- visibility: hidden;
222
- display: inline-block;
223
- }
224
- .media-control-skin-1 .media-control-item.media-control-gear .gear-option_label {
225
- flex: 0 1 100%;
226
- }
227
- .media-control-skin-1 .media-control-item.media-control-gear .gear-option_arrow-right-icon {
228
- flex: 0 0 14px;
229
- height: 24px;
230
- }
231
- .media-control-skin-1 .media-control-item.media-control-gear .gear-option_value {
232
- flex: 1 0 auto;
233
- }.big-mute-icon-wrapper[data-big-mute] {
234
- position: absolute;
235
- z-index: 9998;
236
- background-color: transparent;
237
- display: flex;
238
- justify-content: center;
239
- width: 100%;
240
- height: calc(100% - 50px);
241
- margin: 0 auto;
242
- opacity: 0.75;
243
- transition: opacity 0.1s ease;
244
- pointer-events: auto;
245
- }
246
- .big-mute-icon-wrapper[data-big-mute].hide {
247
- display: none;
248
- }
249
- .big-mute-icon-wrapper[data-big-mute]:hover {
250
- cursor: pointer;
251
- }
252
-
253
- .big-mute-icon[data-big-mute-icon] {
254
- display: flex;
255
- align-items: center;
256
- justify-content: center;
257
- align-self: center;
258
- width: 120px;
259
- height: 120px;
260
- border: 2px solid white;
261
- border-radius: 50%;
262
- filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
263
- filter: alpha(opacity=60);
264
- opacity: 1;
265
- box-shadow: 0 0 1px 0 white;
266
- background: rgba(240, 243, 247, 0.9411764706);
267
- z-index: 10000;
268
- }
269
- .big-mute-icon[data-big-mute-icon] svg {
270
- margin-left: 5px;
271
- width: 80px;
272
- height: 80px;
273
- }
274
- .big-mute-icon[data-big-mute-icon] svg path {
275
- fill: #1f1e1e !important;
276
- }
277
- .big-mute-icon[data-big-mute-icon]:hover {
278
- background: rgba(240, 243, 247, 0.8784313725);
279
- }
280
- .big-mute-icon[data-big-mute-icon]:hover svg path {
281
- fill: #151515 !important;
282
282
  }:root {
283
283
  --primary-background-color: #000;
284
284
  --secondary-background-color: #262626;
@@ -1557,6 +1557,39 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
1557
1557
  100% {
1558
1558
  color: #B80000;
1559
1559
  }
1560
+ }.seek-time {
1561
+ position: absolute;
1562
+ white-space: nowrap;
1563
+ height: 20px;
1564
+ line-height: 20px;
1565
+ font-size: 0;
1566
+ left: -100%;
1567
+ bottom: 55px;
1568
+ background-color: rgba(2, 2, 2, 0.5);
1569
+ z-index: 9999;
1570
+ transition: opacity 0.1s ease;
1571
+ }
1572
+ .seek-time.hidden {
1573
+ opacity: 0;
1574
+ }
1575
+ .seek-time .seek-time__pos {
1576
+ display: inline-block;
1577
+ color: white;
1578
+ font-size: 10px;
1579
+ padding-left: 7px;
1580
+ padding-right: 7px;
1581
+ vertical-align: top;
1582
+ }
1583
+ .seek-time .seek-time__duration {
1584
+ display: inline-block;
1585
+ color: rgba(255, 255, 255, 0.5);
1586
+ font-size: 10px;
1587
+ padding-right: 7px;
1588
+ vertical-align: top;
1589
+ }
1590
+ .seek-time .seek-time__duration::before {
1591
+ content: "|";
1592
+ margin-right: 7px;
1560
1593
  }.player-poster {
1561
1594
  display: flex;
1562
1595
  justify-content: center;
@@ -1591,66 +1624,6 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
1591
1624
  }
1592
1625
  .player-poster .play-wrapper svg path {
1593
1626
  fill: #fff;
1594
- }.quality-levels li.disabled {
1595
- opacity: 0.5;
1596
- pointer-events: none;
1597
- }
1598
- .quality-levels li.current {
1599
- background-color: #000;
1600
- }.container-with-poster-clickable .mc-skip-time {
1601
- height: 0;
1602
- }
1603
-
1604
- .mc-skip-time {
1605
- position: absolute;
1606
- width: 100%;
1607
- height: calc(100% - 50px);
1608
- z-index: 9998;
1609
- background-color: transparent;
1610
- font-family: Roboto, "Open Sans", Arial, sans-serif;
1611
- }
1612
- .mc-skip-time .skip-container {
1613
- width: 100%;
1614
- height: 100%;
1615
- display: flex;
1616
- justify-content: space-between;
1617
- }
1618
- .mc-skip-time .skip-container .skip-item {
1619
- flex: 1 0 0px;
1620
- height: 100%;
1621
- }.seek-time {
1622
- position: absolute;
1623
- white-space: nowrap;
1624
- height: 20px;
1625
- line-height: 20px;
1626
- font-size: 0;
1627
- left: -100%;
1628
- bottom: 55px;
1629
- background-color: rgba(2, 2, 2, 0.5);
1630
- z-index: 9999;
1631
- transition: opacity 0.1s ease;
1632
- }
1633
- .seek-time.hidden {
1634
- opacity: 0;
1635
- }
1636
- .seek-time .seek-time__pos {
1637
- display: inline-block;
1638
- color: white;
1639
- font-size: 10px;
1640
- padding-left: 7px;
1641
- padding-right: 7px;
1642
- vertical-align: top;
1643
- }
1644
- .seek-time .seek-time__duration {
1645
- display: inline-block;
1646
- color: rgba(255, 255, 255, 0.5);
1647
- font-size: 10px;
1648
- padding-right: 7px;
1649
- vertical-align: top;
1650
- }
1651
- .seek-time .seek-time__duration::before {
1652
- content: "|";
1653
- margin-right: 7px;
1654
1627
  }.share_plugin[data-share] {
1655
1628
  pointer-events: auto;
1656
1629
  z-index: 5;
@@ -1734,6 +1707,12 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
1734
1707
  display: inline-block;
1735
1708
  margin-right: 5px;
1736
1709
  cursor: pointer;
1710
+ }.quality-levels li.disabled {
1711
+ opacity: 0.5;
1712
+ pointer-events: none;
1713
+ }
1714
+ .quality-levels li.current {
1715
+ background-color: #000;
1737
1716
  }.spinner-three-bounce[data-spinner] {
1738
1717
  position: absolute;
1739
1718
  width: 70px;
@@ -1882,6 +1861,27 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
1882
1861
  }
1883
1862
  .scrub-thumbnails .backdrop .carousel img {
1884
1863
  width: auto;
1864
+ }.container-with-poster-clickable .mc-skip-time {
1865
+ height: 0;
1866
+ }
1867
+
1868
+ .mc-skip-time {
1869
+ position: absolute;
1870
+ width: 100%;
1871
+ height: calc(100% - 50px);
1872
+ z-index: 9998;
1873
+ background-color: transparent;
1874
+ font-family: Roboto, "Open Sans", Arial, sans-serif;
1875
+ }
1876
+ .mc-skip-time .skip-container {
1877
+ width: 100%;
1878
+ height: 100%;
1879
+ display: flex;
1880
+ justify-content: space-between;
1881
+ }
1882
+ .mc-skip-time .skip-container .skip-item {
1883
+ flex: 1 0 0px;
1884
+ height: 100%;
1885
1885
  }.player-logo[data-logo] {
1886
1886
  position: absolute;
1887
1887
  z-index: 2;
@@ -49802,7 +49802,7 @@ const AUTO = -1;
49802
49802
  const DEFAULT_RECOVER_ATTEMPTS = 16;
49803
49803
  Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
49804
49804
  Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
49805
- const T$7 = 'playback.hls';
49805
+ const T$8 = 'playback.hls';
49806
49806
  class HlsPlayback extends BasePlayback {
49807
49807
  _ccIsSetup = false;
49808
49808
  _ccTracksUpdated = false;
@@ -50126,7 +50126,7 @@ class HlsPlayback extends BasePlayback {
50126
50126
  }
50127
50127
  else {
50128
50128
  Log.error('hlsjs: failed to recover', { evt, data });
50129
- trace(`${T$7} _recover failed to recover`, {
50129
+ trace(`${T$8} _recover failed to recover`, {
50130
50130
  type: data.type,
50131
50131
  details: data.details,
50132
50132
  });
@@ -50212,7 +50212,7 @@ class HlsPlayback extends BasePlayback {
50212
50212
  this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
50213
50213
  }
50214
50214
  _onHLSJSError(evt, data) {
50215
- trace(`${T$7} _onHLSJSError`, {
50215
+ trace(`${T$8} _onHLSJSError`, {
50216
50216
  fatal: data.fatal,
50217
50217
  type: data.type,
50218
50218
  details: data.details,
@@ -50260,7 +50260,7 @@ class HlsPlayback extends BasePlayback {
50260
50260
  evt,
50261
50261
  data,
50262
50262
  });
50263
- trace(`${T$7} _onHLSJSError trying to recover from network error`, {
50263
+ trace(`${T$8} _onHLSJSError trying to recover from network error`, {
50264
50264
  details: data.details,
50265
50265
  });
50266
50266
  error.level = PlayerError.Levels.WARN;
@@ -50273,7 +50273,7 @@ class HlsPlayback extends BasePlayback {
50273
50273
  evt,
50274
50274
  data,
50275
50275
  });
50276
- trace(`${T$7} _onHLSJSError trying to recover from media error`, {
50276
+ trace(`${T$8} _onHLSJSError trying to recover from media error`, {
50277
50277
  details: data.details,
50278
50278
  });
50279
50279
  error.level = PlayerError.Levels.WARN;
@@ -50303,7 +50303,7 @@ class HlsPlayback extends BasePlayback {
50303
50303
  return;
50304
50304
  }
50305
50305
  Log.warn('hlsjs: non-fatal error occurred', { evt, data });
50306
- trace(`${T$7} _onHLSJSError non-fatal error occurred`, {
50306
+ trace(`${T$8} _onHLSJSError non-fatal error occurred`, {
50307
50307
  type: data.type,
50308
50308
  details: data.details,
50309
50309
  });
@@ -50780,7 +50780,7 @@ function registerPlaybacks() {
50780
50780
  Loader.registerPlayback(DashPlayback);
50781
50781
  }
50782
50782
 
50783
- const T$6 = 'gplayer';
50783
+ const T$7 = 'gplayer';
50784
50784
  const DEFAULT_OPTIONS = {
50785
50785
  autoPlay: false,
50786
50786
  debug: 'none',
@@ -51130,7 +51130,7 @@ class Player {
51130
51130
  // TODO test
51131
51131
  events = {
51132
51132
  onReady: () => {
51133
- trace(`${T$6} onReady`, {
51133
+ trace(`${T$7} onReady`, {
51134
51134
  ready: this.ready,
51135
51135
  });
51136
51136
  if (this.ready) {
@@ -51562,7 +51562,7 @@ const INITIAL_SETTINGS = {
51562
51562
  default: [],
51563
51563
  seekEnabled: false,
51564
51564
  };
51565
- const T$5 = 'plugins.media_control';
51565
+ const T$6 = 'plugins.media_control';
51566
51566
  /**
51567
51567
  * Extended events for the {@link MediaControl} plugin
51568
51568
  * @public
@@ -51798,8 +51798,8 @@ class MediaControl extends UICorePlugin {
51798
51798
  this.listenTo(this.core, Events$1.CORE_FULLSCREEN, this.show);
51799
51799
  this.listenTo(this.core, Events$1.CORE_OPTIONS_CHANGE, this.configure);
51800
51800
  this.listenTo(this.core, Events$1.CORE_RESIZE, this.playerResize);
51801
- this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
51802
- this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
51801
+ // this.listenTo(this.core, 'core:advertisement:start', this.onStartAd)
51802
+ // this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd)
51803
51803
  // const has360 = this.core?.getPlugin('video_360');
51804
51804
  // if (Browser.isiOS && has360) {
51805
51805
  // this.container?.el.addEventListener('click', e => {
@@ -51825,6 +51825,9 @@ class MediaControl extends UICorePlugin {
51825
51825
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PAUSE, this.changeTogglePlay);
51826
51826
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_STOP, this.changeTogglePlay);
51827
51827
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_DBLCLICK, this.toggleFullscreen);
51828
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_CLICK, () => {
51829
+ this.clickaway(this.core.activeContainer.$el[0]);
51830
+ });
51828
51831
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
51829
51832
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PROGRESS, this.updateProgressBar);
51830
51833
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_SETTINGSUPDATE, this.updateSettings);
@@ -51841,6 +51844,9 @@ class MediaControl extends UICorePlugin {
51841
51844
  });
51842
51845
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_MOUSE_ENTER, this.show);
51843
51846
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_MOUSE_LEAVE, this.delayHide);
51847
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_DESTROYED, () => {
51848
+ this.clickaway(null);
51849
+ });
51844
51850
  }
51845
51851
  /**
51846
51852
  * Hides the media control UI
@@ -51849,12 +51855,16 @@ class MediaControl extends UICorePlugin {
51849
51855
  this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
51850
51856
  this.hide();
51851
51857
  this.unbindKeyEvents();
51852
- this.$el.hide(); // TODO why?
51858
+ this.$el.hide();
51853
51859
  }
51854
51860
  /**
51855
51861
  * Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
51856
51862
  */
51857
51863
  enable() {
51864
+ trace(`${T$6} enable`, {
51865
+ chromeless: this.options.chromeless,
51866
+ userDisabled: this.userDisabled,
51867
+ });
51858
51868
  if (this.options.chromeless) {
51859
51869
  return;
51860
51870
  }
@@ -52008,7 +52018,7 @@ class MediaControl extends UICorePlugin {
52008
52018
  this.$el.removeClass('w370');
52009
52019
  this.$el.removeClass('w270');
52010
52020
  this.verticalVolume = false;
52011
- trace(`${T$5} playerResize`, {
52021
+ trace(`${T$6} playerResize`, {
52012
52022
  width: this.container.$el.width(),
52013
52023
  height: this.container.$el.height(),
52014
52024
  hideVolumeBar: this.options.hideVolumeBar});
@@ -52186,7 +52196,7 @@ class MediaControl extends UICorePlugin {
52186
52196
  else {
52187
52197
  this.hideVolumeId = setTimeout(() => {
52188
52198
  this.hideVolumeId = null;
52189
- trace(`${T$5} hideVolumeBar`, {
52199
+ trace(`${T$6} hideVolumeBar`, {
52190
52200
  volumeBarContainer: !!this.$volumeBarContainer,
52191
52201
  });
52192
52202
  this.$volumeBarContainer?.addClass('volume-bar-hide');
@@ -52258,15 +52268,24 @@ class MediaControl extends UICorePlugin {
52258
52268
  this.setSeekPercentage(pos);
52259
52269
  }
52260
52270
  setUserKeepVisible() {
52271
+ trace(`${T$6} setUserKeepVisible`, {
52272
+ userKeepVisible: this.userKeepVisible,
52273
+ });
52261
52274
  this.userKeepVisible = true;
52262
52275
  }
52263
- resetUserKeepVisible() {
52276
+ resetUserKeepVisible = () => {
52277
+ trace(`${T$6} resetUserKeepVisible`, {
52278
+ userKeepVisible: this.userKeepVisible,
52279
+ });
52264
52280
  this.userKeepVisible = false;
52265
- }
52281
+ };
52266
52282
  isVisible() {
52267
52283
  return !this.$el.hasClass('media-control-hide');
52268
52284
  }
52269
52285
  show(event) {
52286
+ trace(`${T$6} show`, {
52287
+ disabled: this.disabled,
52288
+ disableControlPanel: this.options.disableControlPanel});
52270
52289
  if (this.disabled || this.options.disableControlPanel) {
52271
52290
  return;
52272
52291
  }
@@ -52293,7 +52312,7 @@ class MediaControl extends UICorePlugin {
52293
52312
  this.updateCursorStyle(showing);
52294
52313
  }
52295
52314
  hide(delay = 0) {
52296
- trace(`${T$5} hide`, {
52315
+ trace(`${T$6} hide`, {
52297
52316
  visible: this.isVisible(),
52298
52317
  disabled: this.disabled,
52299
52318
  hideMediaControl: this.options.hideMediaControl,
@@ -52704,23 +52723,6 @@ class MediaControl extends UICorePlugin {
52704
52723
  }
52705
52724
  this.resetUserKeepVisible();
52706
52725
  }
52707
- // TODO manage by the ads plugin
52708
- onStartAd() {
52709
- // this.advertisementPlaying = true
52710
- this.disable();
52711
- }
52712
- // TODO manage by the ads plugin
52713
- onFinishAd() {
52714
- // this.advertisementPlaying = false
52715
- this.enable();
52716
- }
52717
- // TODO remove
52718
- hideControllAds() {
52719
- if (this.container.advertisement &&
52720
- this.container.advertisement.type !== 'idle') {
52721
- this.hide();
52722
- }
52723
- }
52724
52726
  static getPageX(event) {
52725
52727
  return getPageX(event);
52726
52728
  }
@@ -52764,6 +52766,7 @@ class MediaControl extends UICorePlugin {
52764
52766
  delayHide(e) {
52765
52767
  this.hide(this.options.hideMediaControlDelay || DEFAULT_HIDE_DELAY);
52766
52768
  }
52769
+ clickaway = clickaway(this.resetUserKeepVisible);
52767
52770
  }
52768
52771
  MediaControl.extend = function (properties) {
52769
52772
  return extend(MediaControl, properties);
@@ -52804,6 +52807,22 @@ function mergeElements(a, b) {
52804
52807
  return acc;
52805
52808
  }, a);
52806
52809
  }
52810
+ function clickaway(callback) {
52811
+ let handler = (event) => { };
52812
+ return (node) => {
52813
+ window.removeEventListener('click', handler);
52814
+ if (!node) {
52815
+ return;
52816
+ }
52817
+ handler = (event) => {
52818
+ if (!node.contains(event.target)) {
52819
+ callback();
52820
+ window.removeEventListener('click', handler);
52821
+ }
52822
+ };
52823
+ window.addEventListener('click', handler);
52824
+ };
52825
+ }
52807
52826
 
52808
52827
  const VERSION$6 = '2.22.4';
52809
52828
  // const T = 'plugins.audiotracks'
@@ -53002,7 +53021,7 @@ const templateHtml$2 = "<div class=\"big-mute-icon-wrapper\" data-big-mute id=\"
53002
53021
 
53003
53022
  insertStyle(".big-mute-icon-wrapper[data-big-mute] {\n position: absolute;\n z-index: 9998;\n background-color: transparent;\n display: flex;\n justify-content: center;\n width: 100%;\n height: calc(100% - 50px);\n margin: 0 auto;\n opacity: 0.75;\n transition: opacity 0.1s ease;\n pointer-events: auto;\n}\n.big-mute-icon-wrapper[data-big-mute].hide {\n display: none;\n}\n.big-mute-icon-wrapper[data-big-mute]:hover {\n cursor: pointer;\n}\n\n.big-mute-icon[data-big-mute-icon] {\n display: flex;\n align-items: center;\n justify-content: center;\n align-self: center;\n width: 120px;\n height: 120px;\n border: 2px solid white;\n border-radius: 50%;\n filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)\";\n filter: alpha(opacity=60);\n opacity: 1;\n box-shadow: 0 0 1px 0 white;\n background: rgba(240, 243, 247, 0.9411764706);\n z-index: 10000;\n}\n.big-mute-icon[data-big-mute-icon] svg {\n margin-left: 5px;\n width: 80px;\n height: 80px;\n}\n.big-mute-icon[data-big-mute-icon] svg path {\n fill: #1f1e1e !important;\n}\n.big-mute-icon[data-big-mute-icon]:hover {\n background: rgba(240, 243, 247, 0.8784313725);\n}\n.big-mute-icon[data-big-mute-icon]:hover svg path {\n fill: #151515 !important;\n}");
53004
53023
 
53005
- const T$4 = 'plugins.big_mute_button';
53024
+ const T$5 = 'plugins.big_mute_button';
53006
53025
  // TODO rewrite as a container plugin
53007
53026
  /**
53008
53027
  * `PLUGIN` that displays a big mute button over the video when it's being played muted.
@@ -53065,7 +53084,7 @@ class BigMuteButton extends UICorePlugin {
53065
53084
  if (autoPlay) {
53066
53085
  this.autoPlay = true;
53067
53086
  }
53068
- trace(`${T$4} onPlay`, {
53087
+ trace(`${T$5} onPlay`, {
53069
53088
  autoPlay: this.autoPlay});
53070
53089
  if (this.autoPlay && !wasMuted && volume === 0) {
53071
53090
  this.mount();
@@ -55623,11 +55642,13 @@ const initSpeedTest = (customMetrics) => {
55623
55642
  }
55624
55643
  }
55625
55644
  };
55626
- // getElementById('dlText').textContent = DEFAULT_DOWNLOAD_SPEED;
55627
- await fetch('https://iam.gcdn.co/info/json')
55645
+ const myinfoUrl = 'https://gcore.com/.well-known/cdn-debug/json';
55646
+ // await fetch('https://iam.gcdn.co/info/json')
55647
+ await fetch(myinfoUrl)
55628
55648
  .then(r => r.json())
55629
55649
  .then(data => {
55630
- const country = data['Server Country code'].toLowerCase();
55650
+ // const country = data['Server Country code'].toLowerCase();
55651
+ const country = getCountryCodeFromClientHeaders(data.client_headers);
55631
55652
  const server = serversList.find(s => s.country === country) || serversList[0];
55632
55653
  if (!server) {
55633
55654
  throw new Error('Failed to select a server');
@@ -55673,6 +55694,15 @@ function rankConnectionSpeed(dlSpeed) {
55673
55694
  }
55674
55695
  return 0;
55675
55696
  }
55697
+ function getCountryCodeFromClientHeaders(clientHeaders) {
55698
+ if (clientHeaders && clientHeaders['country']) {
55699
+ const m = clientHeaders['country'].match(/'code':\s*'([A-Za-z]{2})'/);
55700
+ if (m) {
55701
+ return m[1].toLowerCase();
55702
+ }
55703
+ }
55704
+ return 'lu';
55705
+ }
55676
55706
 
55677
55707
  insertStyle(":root {\n --primary-background-color: #000;\n --secondary-background-color: #262626;\n --primary-text-color: #fff;\n --secondary-text-color: #fff4f2;\n --hover-text-color: #f9b090;\n --speedtest-red: #df564d;\n --speedtest-orange: #df934d;\n --speedtest-yellow: #dfd04d;\n --speedtest-light-green: #c2df4d;\n --speedtest-green: #73df4d;\n}\n\n.clappr-nerd-stats {\n cursor: default;\n}\n.clappr-nerd-stats .stats-box {\n position: absolute;\n display: inline-block;\n bottom: 52px;\n right: 0;\n top: 0;\n left: 0;\n bottom: 0;\n padding: 0 10px 12px;\n margin: 0;\n line-height: 20px;\n font-size: 12px;\n font-weight: 500;\n background: var(--primary-background-color);\n color: #fff;\n z-index: 20000;\n overflow: auto;\n max-width: 100%;\n}\n.clappr-nerd-stats .stats-box-top {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 9999;\n width: 100%;\n height: 32px;\n background: var(--primary-background-color);\n}\n.clappr-nerd-stats .stats-box-top .close-button {\n position: absolute;\n right: 12px;\n top: 10px;\n display: block;\n width: 12px;\n height: 12px;\n}\n.clappr-nerd-stats .stats-box-top .close-button svg path {\n fill: var(--primary-text-color);\n}\n.clappr-nerd-stats .stats-box-top .close-button:hover svg path {\n fill: var(--hover-text-color);\n}\n.clappr-nerd-stats .stats-box-main {\n overflow: hidden;\n margin-top: 44px;\n display: flex;\n flex-wrap: wrap;\n}\n.clappr-nerd-stats .stats-box-main ul {\n flex: 0 1 1fr;\n min-width: 200px;\n}\n.clappr-nerd-stats .stats-box.wide {\n width: 820px;\n}\n.clappr-nerd-stats .stats-box ul, .clappr-nerd-stats .stats-box li {\n list-style-type: none;\n}\n.clappr-nerd-stats .stats-box ul div, .clappr-nerd-stats .stats-box li div {\n padding-left: 2px;\n padding-right: 2px;\n background: var(--primary-background-color);\n gap: 10px;\n}\n.clappr-nerd-stats .stats-box ul {\n padding: 5px;\n width: 200px;\n flex: 0 1 50%;\n}\n.clappr-nerd-stats .stats-box ul li {\n position: relative;\n padding: 0 5px;\n text-align: left;\n}\n.clappr-nerd-stats .stats-box ul li.canvas-wrapper {\n padding: 0;\n}\n.clappr-nerd-stats .stats-box ul li.canvas-wrapper canvas {\n width: 100%;\n}\n.clappr-nerd-stats .stats-box ul li:nth-child(2n) {\n background: var(--secondary-background-color);\n}\n.clappr-nerd-stats .stats-box ul li:nth-child(2n) div {\n background: var(--secondary-background-color);\n}\n.clappr-nerd-stats .stats-box ul li.title {\n text-align: center;\n font-weight: bold;\n padding-bottom: 4px;\n font-size: 14px;\n}\n.clappr-nerd-stats .stats-box ul li div {\n margin: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.desktop .clappr-nerd-stats .stats-box.narrow {\n width: 250px;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow ul {\n width: 100%;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-summary {\n padding: 0 5px;\n height: auto;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-summary-block {\n width: 100%;\n flex-direction: column;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-summary-block .speedtest-summary-subblock {\n width: 100%;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-summary-block .speedtest-summary-subblock-content {\n width: 100%;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-summary-header {\n padding-top: 12px;\n height: 38px;\n text-align: center;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-quality-header {\n text-align: center;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-footer {\n height: 80px;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-footer-about-link {\n bottom: 0;\n left: 0;\n}\n.desktop .clappr-nerd-stats .stats-box.narrow .speedtest-footer .speedtest-footer-refresh {\n inset: 50% auto auto 50%;\n transform: translate(-50%, -50%);\n}\n\n.speed-test-button {\n margin: 10px 0 0;\n color: #000;\n}\n\n.speed-test {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999;\n}\n.speed-test .speed-test-header {\n width: 100%;\n height: 32px;\n}\n.speed-test .speed-test-header .close-speed-test {\n float: right;\n margin-right: 5px;\n line-height: 32px;\n cursor: pointer;\n color: var(--primary-text-color);\n}\n.speed-test .speed-test-header .close-speed-test:hover {\n color: var(--hover-text-color);\n}\n\n.settings-button {\n float: right;\n margin: 0 12px 0 0;\n height: 40px;\n width: 24px;\n border: none;\n padding: 0;\n}\n\n.speedtest-summary {\n width: 100%;\n border-top: 1px solid var(--secondary-background-color) !important;\n border-bottom: 1px solid var(--secondary-background-color) !important;\n display: flex !important;\n flex-direction: column;\n align-items: stretch;\n justify-content: space-between;\n}\n.speedtest-summary .speedtest-summary-header {\n width: 100%;\n padding-top: 4px;\n text-align: left;\n height: 32px;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n}\n.speedtest-summary .speedtest-summary-block {\n position: relative;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.speedtest-summary .speedtest-summary-block .speedtest-summary-subblock {\n width: 50%;\n margin-top: 4px;\n margin-bottom: 12px;\n}\n.speedtest-summary .speedtest-summary-block .speedtest-summary-subblock-content {\n padding: 2px;\n width: 248px;\n max-width: 100%;\n}\n\n.speedtest-quality {\n width: 100%;\n height: 36px;\n display: flex !important;\n flex-direction: column !important;\n justify-content: space-between !important;\n}\n.speedtest-quality .speedtest-quality-header {\n font-size: 12px;\n height: 20px;\n border-left: 2px solid var(--secondary-background-color) !important;\n background-color: var(--secondary-background-color);\n text-align: left;\n}\n.speedtest-quality-content {\n width: 100%;\n margin-top: 8px;\n height: 8px;\n display: flex !important;\n flex-direction: row !important;\n align-items: stretch !important;\n justify-content: space-between;\n}\n.speedtest-quality-content-item {\n width: 18.8%;\n background-color: #fff;\n}\n.speedtest-quality-content-item.speedtest-quality-value-1 {\n background-color: var(--speedtest-red);\n}\n.speedtest-quality-content-item.speedtest-quality-value-2 {\n background-color: var(--speedtest-orange);\n}\n.speedtest-quality-content-item.speedtest-quality-value-3 {\n background-color: var(--speedtest-yellow);\n}\n.speedtest-quality-content-item.speedtest-quality-value-4 {\n background-color: var(--speedtest-light-green);\n}\n.speedtest-quality-content-item.speedtest-quality-value-5 {\n background-color: var(--speedtest-green);\n}\n\n.speedtest-footer {\n position: relative;\n float: left;\n width: 100%;\n height: 30px;\n line-height: 16px;\n}\n.speedtest-footer-about-link {\n position: absolute;\n bottom: 0;\n left: 0;\n color: var(--secondary-text-color);\n text-decoration: underline !important;\n}\n.speedtest-footer-about-link:hover {\n color: var(--hover-text-color);\n}\n.speedtest-footer .speedtest-footer-refresh {\n position: absolute;\n bottom: 0;\n right: 0;\n color: var(--secondary-text-color);\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.speedtest-footer .speedtest-footer-refresh svg path {\n fill: var(--secondary-text-color);\n}\n.speedtest-footer .speedtest-footer-refresh:hover {\n color: var(--hover-text-color);\n}\n.speedtest-footer .speedtest-footer-refresh:hover svg path {\n fill: var(--hover-text-color);\n}\n\n.mobile .clappr-nerd-stats .stats-box {\n position: fixed;\n height: auto;\n width: auto;\n inset: 0;\n min-width: 100vw;\n padding-bottom: 4px;\n padding-left: 4px;\n padding-right: 4px;\n}\n.mobile .clappr-nerd-stats .stats-box-top {\n position: fixed;\n}\n.mobile .clappr-nerd-stats .stats-box-main ul {\n flex: 0 1 50%;\n}\n\n@media only screen and (orientation: portrait) {\n .mobile .speedtest-summary {\n padding: 0 5px;\n height: auto;\n }\n .mobile .speedtest-summary-block {\n width: 100%;\n flex-direction: column;\n }\n .mobile .speedtest-summary-block .speedtest-summary-subblock {\n width: 100%;\n }\n .mobile .speedtest-summary-block .speedtest-summary-subblock-content {\n width: 100%;\n }\n .mobile .speedtest-summary-header {\n padding-top: 12px;\n height: 38px;\n text-align: center;\n }\n .mobile .speedtest-quality-header {\n text-align: center;\n }\n .mobile .speedtest-footer .speedtest-footer-refresh {\n inset: 50% auto auto 50%;\n transform: translate(-50%, -50%);\n }\n}\n@media only screen and (orientation: landscape) {\n .mobile .clappr-nerd-stats .stats-box-main ul {\n flex-basis: 1fr;\n }\n}\n@media only screen and (min-width: 1100px) {\n .fullscreen .clappr-nerd-stats .stats-box {\n top: unset;\n }\n}");
55678
55708
 
@@ -55754,7 +55784,7 @@ const PLAYBACK_NAMES = {
55754
55784
  hls: 'HLS.js',
55755
55785
  html5_video: 'Native',
55756
55786
  };
55757
- // const T = 'plugins.nerd_stats'
55787
+ const T$4 = 'plugins.nerd_stats';
55758
55788
  /**
55759
55789
  * `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
55760
55790
  * @public
@@ -55891,6 +55921,9 @@ class NerdStats extends UICorePlugin {
55891
55921
  return super.destroy();
55892
55922
  }
55893
55923
  toggle = () => {
55924
+ trace(`${T$4} toggle`, {
55925
+ open: this.open,
55926
+ });
55894
55927
  if (this.open) {
55895
55928
  this.hide();
55896
55929
  }
@@ -55900,7 +55933,7 @@ class NerdStats extends UICorePlugin {
55900
55933
  };
55901
55934
  show() {
55902
55935
  this.$el.show();
55903
- this.statsBoxElem.scrollTop(this.statsBoxElem.scrollTop());
55936
+ this.statsBoxElem.scrollTop(this.statsBoxElem?.scrollTop());
55904
55937
  this.open = true;
55905
55938
  initSpeedTest(this.speedtestMetrics)
55906
55939
  .then(() => {