Skip to content

fix(audio): an interrupted play() is not blocked autoplay - #104

Merged
akirilyuk merged 2 commits into
mainfrom
fix/playback-abort-not-blocked
Nov 9, 2026
Merged

akirilyuk merged 2 commits into
mainfrom
fix/playback-abort-not-blocked

Conversation

@akirilyuk

Copy link
Copy Markdown
Contributor

Summary

  • When the agent's audio track arrives, the session points the audio element at it, calls play(), then calls onAgentAudioTrack. A host that sets the element's srcObject in that hook reloads it, so the pending play() rejects with AbortError. The session reported that as blocked, and the embed widget showed the "Enable sound" notice although the browser had not blocked anything (the element autoplays the new source).
  • Now only NotAllowedError (and other real failures) mean blocked. An AbortError retries play() once; success reports playing, a second abort leaves the state unchanged and logs audio_playback_interrupted.
  • unlockAudioPlayback keeps its signature; the Enable sound button works as before.

Test plan

Verified locally and in CI; no extra manual steps.

@akirilyuk
akirilyuk merged commit 7896f1a into main Nov 9, 2026
8 checks passed
@akirilyuk
akirilyuk deleted the fix/playback-abort-not-blocked branch November 9, 2026 07:10
@akirilyuk akirilyuk mentioned this pull request Nov 9, 2026
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.

1 participant