Skip to content

fix(player-core): show hotspot after seeking back to a video step - #5

Merged
AbianS merged 3 commits into
mainfrom
fix/hotspot-after-seek-back
Sep 25, 2026
Merged

AbianS merged 3 commits into
mainfrom
fix/hotspot-after-seek-back

Conversation

@AbianS

@AbianS AbianS commented Sep 25, 2026

Copy link
Copy Markdown
Member

Closes #2

Problem

PhotoLayer fired onReady only when src changed. When playback went video → photo, the user seeked back to the video step, and it played into the same photo again, photo.src was unchanged. The decode effect never re-ran, so handlePhotoReady never swapped the layers or revealed the hotspot.

Fix

  • PhotoLayer takes a renderId prop. Its decode effect re-runs when src or renderId changes, and still cancels superseded decodes.
  • Player bumps photo.renderId on every photo step render.

Tests

  • New integration test in Player.test.ts for a demo with a video step and a photo step that has a hotspot: advance, seek back, advance again. The hotspot has to show both times. It fails without the fix.
  • Full player-core suite passes (111 tests, run headless), along with check-types, Biome and size (29.07 KB / 35 KB).

@AbianS
AbianS merged commit 96b0029 into main Sep 25, 2026
1 check passed
@AbianS
AbianS deleted the fix/hotspot-after-seek-back branch September 25, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hotspot missing after seeking back from a video step to a photo step

1 participant