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

Some videos are muted until you pause-unpause them #152

Open
WofWca opened this issue May 3, 2023 · 1 comment
Open

Some videos are muted until you pause-unpause them #152

WofWca opened this issue May 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@WofWca
Copy link
Owner

WofWca commented May 3, 2023

Reproduction

  1. Open a Chromium browser
  2. Go to a website with an embedded YouTube video (e.g. https://jumpcutter.com/)
  3. Start an embedded video

Actual result: there's no sound. If you pause and unpause the video, the sound starts.

AudioContext.mp4

This warning is printed in the console, I believe it's related:

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

There's this code that's supposed to handle this, but looks like it doesnt?

const resumeAudioContext = () => {
clearTimeout(suspendAudioContextTimeoutId);
audioContext.resume();
};
if (element.paused) {
suspendAudioContext();
}
element.addEventListener('pause', scheduleSuspendAudioContext, { passive: true });
element.addEventListener('play', resumeAudioContext, { passive: true });

Related: #80

@WofWca WofWca added the bug Something isn't working label May 3, 2023
@WofWca
Copy link
Owner Author

WofWca commented Jun 16, 2023

I've just seen it also happen on YouTube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant