Skip to content

Fix native player state when playback is blocked - #273

Open
happykawayigt wants to merge 1 commit into
hyperaudio:mainfrom
happykawayigt:fix/native-play-rejection
Open

Fix native player state when playback is blocked#273
happykawayigt wants to merge 1 commit into
hyperaudio:mainfrom
happykawayigt:fix/native-play-rejection

Conversation

@happykawayigt

Copy link
Copy Markdown

Summary

  • keep NativePlayer paused until the native play event confirms playback
  • handle rejected HTMLMediaElement.play() promises without leaving stale state
  • add a regression test for autoplay-policy rejection

Root cause

NativePlayer.play() set its internal paused flag to false immediately, even when the browser rejected the underlying playback promise. No native pause event follows a rejected play attempt, so transcript polling could continue indefinitely against a player that never started.

Validation

  • npm run build
  • npm test -- --runInBand (75 tests passed)
  • git diff --check

Fixes #268

@happykawayigt
happykawayigt marked this pull request as ready for review July 28, 2026 18:35
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.

NativePlayer.play() ignores the play() promise — autoplay-blocked leaves paused=false and a zombie polling loop

1 participant