AudioContext not allowed to start when "Page back" button is hit
Reported by
jo...@noteflight.com,
May 10 2018
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3426.0 Safari/537.36 Steps to reproduce the problem: - Go to any page that creates an AudioContext on page load, like https://www.noteflight.com/scores/view/606eccc74d109309be101117ea80a88fbf517fc8 - (no warnings shown in the console, good) - Then, change the URL to google.com (or click somewhere else that redirects to a new page) - Now, hit the back button. It shows `The AudioContext was not allowed to start. It must be resume (or created) after a user gesture on the page. https://goo.gl/7K7WLu` when it's not supposed to, since there are no iframes and the page loaded correctly the first time. What is the expected behavior? It shouldn't show this message. And it should let us start the AudioContext What went wrong? It didn't create the AudioContext and didn't let me play sound. Did this work before? Yes Before applying this new AudioContext - user gesture restriction. Does this work in other browsers? Yes Chrome version: 68.0.3426.0 Channel: stable OS Version: OS X 10.13.4 Flash Version:
,
May 10 2018
But, if you initiate the AudioContext with user interaction, that shouldn't happen, right? Anyway, what I was trying to say is that when you load the page for the first time, it works fine. When you go somewhere else and then hit back, audio doesn't work, although it works in the link I sent you. I'll send you an email with a link to a place where it doesn't, with a user and password that unfortunately I cannot make public here. Thanks for looking into this! Best, Jordi
,
May 10 2018
The console message happens because you created an AudioContext but not from a user gesture. If you had, there would be no message. But that's a very uncommon way of using WebAudio (because it wasn't required before). Thus, you'll always get the warning. (We should fix this warning, but aren't really sure the best way. It's not really bad just creating an AudioContext. And we certainly want to minimize spamming the console with warnings about this for something that is very, very common and a valid use case.) I don't know why you don't get the message the first time but do when going back. I get the message on the first visit.
,
May 10 2018
Ok. jordi@noteflight.com provided me a test account to work with. Using chromium ToT and setting the autoplay policy flag to require user activation, the console warning is displayed and clicking the play button produces no audio. This is expected with the autoplay policy, unless noteflight updated their code to call context.resume() when pressing the play button. (Didn't check that). This is basically a duplicate of issue 840866. Not sure about the issue with the "page back" button. I'm not able to reproduce that.
,
May 11 2018
,
May 11 2018
Able to reproduce the issue on reported chrome version 68.0.3426.0 using Mac 10.13.1, Ubuntu 14.04 and Windows 10. Observed similar behaviour as mentioned in comment#1. As the root cause for the issue has been identified (i.e., autoplay restriction for AudioContext), hence marking it as Untriaged. From comment#4 CC'ing the owner of issue 840866 for further inputs on it. Removing label Needs-Bisect, Please feel free to add the label back if required. Thanks!
,
May 29 2018
Assign to johnpallet@ for further triage
,
Oct 5
This is working as intended as the autoplay policy is blocking playback. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by rtoy@chromium.org
, May 10 2018