Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live audio delayed when autoplay enabled and no user gesture performed in Chrome #238

Open
dumbmoron opened this issue Jul 6, 2023 · 1 comment

Comments

@dumbmoron
Copy link

Describe the bug
When streaming live video+audio to the browser via a WebSocket connection, the audio is delayed unless a user clicked on some element before the stream started playing. This is an issue that also affects the original phoboslab/jsmpeg script.

To Reproduce
Steps to reproduce the behavior:

  1. Stream video+audio stream over WebSocket (I can provide example code that generates this stream if needed)
  2. Set autoplay to true, load page in browser, but don't click on anything
  3. Wait ~5 seconds, then click on some element
  4. Audio starts playing, but is delayed

I was also able to reproduce this with just streaming audio separately.

Expected behavior
The audio should be in sync with the video.

Desktop (please complete the following information):

  • OS: macOS Ventura
  • Browser: Google Chrome
  • Version: latest (114)

Additional context
Warning message in console logs:

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
@nguyenduy2392
Copy link

+1

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

No branches or pull requests

2 participants