@playkit-js/hotspots 3.2.30 → 3.2.31-canary.0-ea3a7ac

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/hotspots",
3
- "version": "3.2.30",
3
+ "version": "3.2.31-canary.0-ea3a7ac",
4
4
  "private": false,
5
5
  "bugs": {
6
6
  "url": "https://github.com/kaltura/playkit-js-hotspots/issues"
@@ -39,6 +39,7 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
39
39
 
40
40
  private _player: KalturaPlayerTypes.Player;
41
41
  private _hotspots: LayoutHotspot[] = [];
42
+ private _pendingRawHotspots: RawLayoutHotspot[] = [];
42
43
  private _floatingItem: FloatingItem | null = null;
43
44
  private _canvas: Canvas | null = null;
44
45
 
@@ -151,8 +152,8 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
151
152
  const hotspotCues = this._filterHotspotCues(payload.cues);
152
153
  // update HotspotsContainer to add or remove visible hotspots
153
154
  if (hotspotCues.length || this._hotspots.length) {
154
- const rawLayoutHotspots = this._prepareHotspots(hotspotCues);
155
- this._hotspots = this._recalculateCuepointLayout(rawLayoutHotspots);
155
+ this._pendingRawHotspots = this._prepareHotspots(hotspotCues);
156
+ this._hotspots = this._recalculateCuepointLayout(this._pendingRawHotspots);
156
157
  this._updateHotspotsContainer();
157
158
  }
158
159
  };
@@ -203,7 +204,8 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
203
204
 
204
205
  private _renderRoot = (floatingItemProps: FloatingItemProps): ComponentChildren => {
205
206
  if (this._checkIfResizeHappened(floatingItemProps.canvas)) {
206
- this._hotspots = this._recalculateCuepointLayout(this._hotspots);
207
+ const source = this._pendingRawHotspots.length ? this._pendingRawHotspots : this._hotspots;
208
+ this._hotspots = this._recalculateCuepointLayout(source);
207
209
  }
208
210
  return (
209
211
  <HotspotWrapper dispatcher={(eventType, payload) => this.dispatchEvent(eventType, payload)} key={'hotspotWrapper'} hotspots={this._hotspots} pauseVideo={this._pauseVideo} seekTo={this._seekTo} sendAnalytics={() => {}} />
@@ -213,6 +215,7 @@ export class HotspotsPlugin extends KalturaPlayer.core.BasePlugin {
213
215
  reset(): void {
214
216
  this.eventManager.removeAll();
215
217
  this._hotspots = [];
218
+ this._pendingRawHotspots = [];
216
219
  this._canvas = null;
217
220
  if (this._floatingItem) {
218
221
  this.floatingManager.remove(this._floatingItem);