@gcorevideo/player 2.22.10 → 2.22.11

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
@@ -42846,7 +42846,7 @@ const DEFAULT_OPTIONS = {
42846
42846
  debug: 'none',
42847
42847
  loop: false,
42848
42848
  mute: false,
42849
- // playbackType: 'vod',
42849
+ playbackType: 'vod',
42850
42850
  priorityTransport: 'dash',
42851
42851
  sources: [],
42852
42852
  strings: {},
@@ -43304,7 +43304,7 @@ class Player {
43304
43304
  }
43305
43305
  }
43306
43306
 
43307
- var version$1 = "2.22.10";
43307
+ var version$1 = "2.22.11";
43308
43308
 
43309
43309
  var packages = {
43310
43310
  "node_modules/@clappr/core": {
@@ -49600,6 +49600,8 @@ class PlaybackRate extends UICorePlugin {
49600
49600
  // private prevSelectedRate: string | undefined
49601
49601
  selectedRate = DEFAULT_PLAYBACK_RATE;
49602
49602
  metadataLoaded = false;
49603
+ playbackSettingsUpdateReceived = false;
49604
+ mountTimerId = null;
49603
49605
  /**
49604
49606
  * @internal
49605
49607
  */
@@ -49659,6 +49661,7 @@ class PlaybackRate extends UICorePlugin {
49659
49661
  onActiveContainerChange() {
49660
49662
  trace(`${T$7} onActiveContainerChange`);
49661
49663
  this.metadataLoaded = false;
49664
+ this.playbackSettingsUpdateReceived = false;
49662
49665
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_STOP, this.onStop);
49663
49666
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
49664
49667
  this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SETTINGSUPDATE, this.onSettingsUpdate);
@@ -49695,17 +49698,30 @@ class PlaybackRate extends UICorePlugin {
49695
49698
  playbackType: this.core.activePlayback.getPlaybackType(),
49696
49699
  dvrEnabled: this.core.activePlayback.dvrEnabled,
49697
49700
  });
49698
- // this.metadataLoaded = false
49701
+ this.playbackSettingsUpdateReceived = true;
49702
+ if (this.metadataLoaded) {
49703
+ if (this.mountTimerId) {
49704
+ clearTimeout(this.mountTimerId);
49705
+ this.mountTimerId = null;
49706
+ }
49707
+ this.mount();
49708
+ }
49699
49709
  }
49700
49710
  onMetaDataLoaded() {
49701
49711
  trace(`${T$7} onMetaDataLoaded`, {
49702
49712
  playbackType: this.core.activePlayback.getPlaybackType(),
49703
49713
  dvrEnabled: this.core.activePlayback.dvrEnabled,
49704
49714
  });
49705
- setTimeout(() => {
49706
- this.metadataLoaded = true;
49707
- this.render();
49708
- }, 0);
49715
+ this.metadataLoaded = true;
49716
+ if (this.playbackSettingsUpdateReceived) {
49717
+ this.mount();
49718
+ }
49719
+ else {
49720
+ this.mountTimerId = setTimeout(() => {
49721
+ this.mountTimerId = null;
49722
+ this.mount();
49723
+ }, 25);
49724
+ }
49709
49725
  }
49710
49726
  allRateElements() {
49711
49727
  return this.$el.find('#playback-rate-menu li');
@@ -49756,6 +49772,16 @@ class PlaybackRate extends UICorePlugin {
49756
49772
  this.mount();
49757
49773
  return this;
49758
49774
  }
49775
+ /**
49776
+ * @internal
49777
+ */
49778
+ destroy() {
49779
+ if (this.mountTimerId) {
49780
+ clearTimeout(this.mountTimerId);
49781
+ this.mountTimerId = null;
49782
+ }
49783
+ return super.destroy();
49784
+ }
49759
49785
  // private onStartAd() {
49760
49786
  // this.prevSelectedRate = this.selectedRate
49761
49787
  // this.resetPlaybackRate()
@@ -49817,8 +49843,8 @@ class PlaybackRate extends UICorePlugin {
49817
49843
  }
49818
49844
  getTitle() {
49819
49845
  const rate = this.selectedRate;
49820
- return (this.playbackRates.find((r) => r.value === rate)?.label ||
49821
- `x${rate}`);
49846
+ return (this.playbackRates.find((r) => r.value === rate)
49847
+ ?.label || `x${rate}`);
49822
49848
  }
49823
49849
  highlightCurrentRate() {
49824
49850
  trace(`${T$7} highlightCurrentRate`, {