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

Issue 716411 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: ----



Sign in to add a comment

WebAudio API does not allow playing audio from inside iframe

Reported by velo...@gmail.com, Apr 28 2017

Issue description

Device name: Samsung Galaxy S7

From "Settings > About Chrome"
Application version: Chrome 57.0.2987.132
Operating system: Android 7.0.0; SM-G930F Build/NRD90M

URLs (if applicable): https://achievemusic.com/good-times-bad-times-for-guitar/

Steps to reproduce:
(1) Go to URL and wait for both page and IFrame to load
(2) Press "Play" in the iframe

Expected result:
Audio should start playing

Actual result:
Nothing happens

This used to work at least a week ago, and works if you go to the iframe URL directly (https://mms.achievemusic.com/embed.html#?ass_id=122524)

Somehow, somewhere, playing audio from inside iframe via WebAudio has been disabled. And I understand how it might make sense (annoying ads) - but in this case it is heavily interfering with our legitimate business.

There should be at least a way to tell the browser it is ok. An extra iframe attribute maybe?
 
Components: Blink>WebAudio
Labels: Needs-Feedback
Hello

Thanks for reporting the issue. Issue is reproducible on both chrome versions: 57.0.2987.132 & 56.0.2924.87, no audio plays. Can you please let us know what was the last working chrome version? 

Comment 2 by velo...@gmail.com, Apr 28 2017

Sadly i cannot help. We do not test android iframes as part of our regular
schedule. It could actually be a while.

We only discovered this because we were asked about android integration for
an upcoming product
Project Member

Comment 3 by sheriffbot@chromium.org, Apr 28 2017

Cc: ppolise...@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "ppolisetty@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by rtoy@chromium.org, May 16 2017

Cc: mlamouri@chromium.org
Labels: Needs-Feedback
Tried https://achievemusic.com/good-times-bad-times-for-guitar/ with Chrome 58 (stable).  I hear a guitar.  It would be great if you could try with 58 instead of 57.

Comment 5 by velo...@gmail.com, May 16 2017

Still persists with 58.0.3029.83.

Do note that this error is Android-specific. Desktop versions have all worked just fine so far and hopefully continue to do so.
Project Member

Comment 6 by sheriffbot@chromium.org, May 16 2017

Cc: rtoy@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "rtoy@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by rtoy@chromium.org, Sep 5 2017

Owner: mlamouri@chromium.org
Status: Available (was: Unconfirmed)
From the developer console, I see

ac0b5603.JSController.js:3 An AudioContext in a cross origin iframe must be created or resumed from a user gesture to enable audio output.

I would think pressing the play button would enable audio output.

Assigning to mlamouri who implemented the gesture requirements.

Comment 8 by velo...@gmail.com, May 9 2018

This issue has re-surfaced in Chrome 66 (66.0.3359.126), presumably with the changes to the new autoplay policy.

https://staging.matchmysound.com/iframe_test.html

We do initialize AudioContext at page load, but after the policy change, I added a state check and .resume call before every play command. This seemed to fix the issue for the desktop browsers.

On Android, however, the problem still persists.

There are three related issues:

a) Playback does not work even without the iframe: https://staging.matchmysound.com/embed.html#?ass_id=39937

b) Similarly, pressing play inside the iframe does not start audio playback, despite calling AudioContext.resume directly related to a user gesture (click)

c) Pressing "Play/pause" button outside the iframe, that sends a postMessage  into the iframe to start playback in direct response to a user gesture also fails. This use case is used in one of our products where the UI is provided externally and we just handle displaying notation and audio playback/recording

All three things work in Desktop versions of Chrome 66,  (linux and windows 66.0.3359.139).

This is urgent, as we have ~100 000 paying users for whom the service (which centers around audio playback and recording) is now broken on one platform through no fault of our own.

Comment 9 by rtoy@chromium.org, May 9 2018

Components: Blink>Media>Autoplay

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

See also issue 840866

Comment 11 by velo...@gmail.com, May 9 2018

thank you for the link to main issue. this is separate, however as it arressee behavior specific to android that does not happen in desktop browsers and genuinely seems to be a bug as opposed to a designed feature.

is there any way i can help get this issue resolved?
Status: Fixed (was: Available)
You can use `allow=autoplay` on iframes to delegate autoplay privileges to a cross-origin iframe, such as `<iframe allow=autoplay>`. For more info: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe

Comment 13 by velo...@gmail.com, May 15 2018

Unfortunately, allow="autoplay" does not seem to fix this issue.

As of Android Crhome 66.0.3359.158
(a) now works, but neither (b) or (c) do, even after adding allow="autoplay" to the iframe. The AudioContext now shows as running, but the audio still does not play.

Sign in to add a comment