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

Chrome 71 will require user gesture for AudioContext to work #40

Open
aszmyd opened this issue Oct 4, 2018 · 3 comments
Open

Chrome 71 will require user gesture for AudioContext to work #40

aszmyd opened this issue Oct 4, 2018 · 3 comments

Comments

@aszmyd
Copy link

aszmyd commented Oct 4, 2018

We've been using AudioContext object to analyze media stream. Chrome plans to change audio policies December 2018 and they'll require user gesture for AudioContext to work:

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio

Key Point: If an AudioContext is created prior to the document receiving a user gesture, it will be created in the "suspended" state, and you will need to call resume() after a user gesture is received.

It means, that even if user granted access to mic for given website, audio analysis wont work if i.e. user fired the page and mic is being captured.

Do you have an alternative way to detect current mic level indication?

@xdumaine
Copy link
Contributor

xdumaine commented Oct 4, 2018

User gesture is required to capture the mic anyway, right? So we should be fine there, unless I'm missing something.

@fippo
Copy link
Member

fippo commented Oct 4, 2018

yeah, I think that is mostly a usage thing since hark doesn't instantiate the audiocontext before the constructor is called. It will suck when that is done before a button click thought but that is chrome...

@aszmyd
Copy link
Author

aszmyd commented Oct 5, 2018

It might not be the only case. We use in our app identical approach (with AudioContext to calculate user mic volume level) and if we allow users to join conversation just by going to some link. If they have mic permission (chrome remembers it so its not always required to ask for user click) then we can have active speaking user.

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

3 participants