New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 841905 link

Starred by 3 users

Issue metadata

Status: Closed
Owner:
Last visit > 30 days ago
Closed: Oct 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

AudioContext not allowed to start when "Page back" button is hit

Reported by jo...@noteflight.com, May 10 2018

Issue description

UserAgent: 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:
 
AudioContext.txt
550 bytes View Download

Comment 1 by rtoy@chromium.org, May 10 2018

First, the autoplay restriction for AudioContext landed in Chrome 66, so it's not just restricted to an iframe anymore.

Second, I navigated to the noteflight link.  I opened the dev console and the warning is shown as expected.  The rest of the steps work as you say.

Also, even though there's a warning, you can press the play button and it does play.
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

Comment 3 by rtoy@chromium.org, May 10 2018

Components: Blink>Media>Autoplay
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.

Comment 4 by rtoy@chromium.org, 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.
Labels: Needs-Triage-M68 Needs-Bisect
Cc: vamshi.kommuri@chromium.org johnpallett@chromium.org
Labels: -Needs-Bisect Triaged-ET OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
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!

Comment 7 by rtoy@chromium.org, May 29 2018

Cc: -johnpallett@chromium.org
Owner: johnpallett@chromium.org
Status: Assigned (was: Untriaged)
Assign to johnpallet@ for further triage
Status: Closed (was: Assigned)
This is working as intended as the autoplay policy is blocking playback.

Sign in to add a comment