-
Notifications
You must be signed in to change notification settings - Fork 166
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
context.resume() behavior when not allowed to start? #1759
Comments
Closely related, this issue over on |
Current state of things for Web Audio, and problem statement: whatwg/html#3617 (comment) tl; dr: For the Web Audio API, there is a single gap to fill: knowing that the transition to There are a number of things to consider:
On a different note, some of the things that UAs are currently exploring:
The current things that I don't know and that are important to go forward confidently:
I see two possible solutions right now:
Some implications of those two directions:
[0]: Link to Firefox's telemetry: a measurement of the time it takes, in seconds, to have non-silent output reaching the |
cc-ing the usual suspects: @mounirlamouri @cpearce @alastor0325 @foolip |
Would you mind expanding on this? The logical result of a promise is to either resolve or reject. What is the point of We are trying to get this working in howler.js (goldfire/howler.js#939), and so far we've found no workable solution that works in a general use-case (which means thousands of sites/web apps are going to break when Chrome 70 is released). Maybe there is another solution that we are overlooking? |
My sentence explicitly says that the promise is resolved when the |
@padenot My point is that it can't switch to |
The second sentence of my post says that the current setup does not work, and the rest of the post explains in details various bits of context, current solutions, and makes two different proposals to solve the issue. |
I read every word of your post and think these could be workable solutions. I (and many others) are simply frustrated because these changes are being rolled out to Chrome in a matter of weeks and who knows how long it will take to get an actual solution introduced into the spec and then implemented by the browsers. It just makes no sense why this wasn't addressed first. |
The launch of the auto-play policy for WebAudio in Chrome was done without knowledge of the Chrome WebAudio team. (We actually found out from people on the WebAudio slack channel). If we had known, we would have tried to do something. Which is not to say that the final outcome would have been any different, but we could have at least started discussions in the spec, at least before launch. |
This was worked on during the TPAC 2018 in Lyon. Here is a summary: No API change on the Starting an I'm closing this, in light of the above. |
@padenot Great news, thanks for the update! |
It seems like this is still an issue in Chrome. Calling The only resource I could find on detecting "allowed to start" is https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getAutoplayPolicy but it's not implemented in any Chrome version. Are there any updates to this, or potential solutions? |
Justin, Maybe @hoch can comment on whether this is planned or if there is a ticket to follow on https://bugs.chromium.org/p/chromium/issues/list. I'm not sure about WebKit, maybe @jyavenard or @Youenn have an idea. In any case, Chrome is correct to not reject those promises, per spec, I expect that other implementation behave similarly (please let us know if this is not the case!). |
https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-resume describes how resume() should behave and step 3 says
Since the following steps are aborted, no control message is queued, so what happens to the pendingResumePromises? As currently written I think nothing happens; we neither resolve nor reject the promise.
It's seems useful for the promise to be rejected if the context is not allowed to start.
The text was updated successfully, but these errors were encountered: