@gcorevideo/player 2.22.9 → 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
@@ -43304,7 +43304,7 @@ class Player {
43304
43304
  }
43305
43305
  }
43306
43306
 
43307
- var version$1 = "2.22.9";
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,8 +49661,10 @@ 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);
49667
+ this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_SETTINGSUPDATE, this.onSettingsUpdate);
49664
49668
  this.listenTo(this.core.activePlayback, PlaybackEvents.PLAYBACK_RATE_CHANGED, this.onPlaybackRateChange);
49665
49669
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_LOADEDMETADATA, this.onMetaDataLoaded);
49666
49670
  }
@@ -49689,10 +49693,35 @@ class PlaybackRate extends UICorePlugin {
49689
49693
  i18n: this.core.i18n,
49690
49694
  })));
49691
49695
  }
49696
+ onSettingsUpdate() {
49697
+ trace(`${T$7} onSettingsUpdate`, {
49698
+ playbackType: this.core.activePlayback.getPlaybackType(),
49699
+ dvrEnabled: this.core.activePlayback.dvrEnabled,
49700
+ });
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
+ }
49709
+ }
49692
49710
  onMetaDataLoaded() {
49693
- trace(`${T$7} onMetaDataLoaded`);
49711
+ trace(`${T$7} onMetaDataLoaded`, {
49712
+ playbackType: this.core.activePlayback.getPlaybackType(),
49713
+ dvrEnabled: this.core.activePlayback.dvrEnabled,
49714
+ });
49694
49715
  this.metadataLoaded = true;
49695
- this.render();
49716
+ if (this.playbackSettingsUpdateReceived) {
49717
+ this.mount();
49718
+ }
49719
+ else {
49720
+ this.mountTimerId = setTimeout(() => {
49721
+ this.mountTimerId = null;
49722
+ this.mount();
49723
+ }, 25);
49724
+ }
49696
49725
  }
49697
49726
  allRateElements() {
49698
49727
  return this.$el.find('#playback-rate-menu li');
@@ -49713,13 +49742,13 @@ class PlaybackRate extends UICorePlugin {
49713
49742
  }
49714
49743
  }
49715
49744
  shouldMount() {
49745
+ trace(`${T$7} shouldMount`, {
49746
+ playbackType: this.core.activePlayback?.getPlaybackType(),
49747
+ dvrEnabled: this.core.activePlayback?.dvrEnabled,
49748
+ });
49716
49749
  if (!this.core.activePlayback || !this.metadataLoaded) {
49717
49750
  return false;
49718
49751
  }
49719
- trace(`${T$7} shouldMount`, {
49720
- playbackType: this.core.activePlayback.getPlaybackType(),
49721
- dvrEnabled: this.core.activePlayback.dvrEnabled,
49722
- });
49723
49752
  if (this.core.activePlayback.getPlaybackType() === Playback.LIVE &&
49724
49753
  !this.core.activePlayback.dvrEnabled) {
49725
49754
  return false;
@@ -49743,6 +49772,16 @@ class PlaybackRate extends UICorePlugin {
49743
49772
  this.mount();
49744
49773
  return this;
49745
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
+ }
49746
49785
  // private onStartAd() {
49747
49786
  // this.prevSelectedRate = this.selectedRate
49748
49787
  // this.resetPlaybackRate()
@@ -49804,8 +49843,8 @@ class PlaybackRate extends UICorePlugin {
49804
49843
  }
49805
49844
  getTitle() {
49806
49845
  const rate = this.selectedRate;
49807
- return (this.playbackRates.find((r) => r.value === rate)?.label ||
49808
- `x${rate}`);
49846
+ return (this.playbackRates.find((r) => r.value === rate)
49847
+ ?.label || `x${rate}`);
49809
49848
  }
49810
49849
  highlightCurrentRate() {
49811
49850
  trace(`${T$7} highlightCurrentRate`, {