HTML5 game sounds don't work when running inside an iframe

332 views
Skip to first unread message

Yashash Agarwal

unread,
Jan 14, 2017, 12:36:11 AM1/14/17
to Chromium-dev
Hello

I've been trying to run an HTML5 game within an iframe. Everything works, but on Chrome (specifically, on Chrome mobile only - works on desktop), sounds don't seem to work. I'm using Chrome 55.0.2883.91

The page with the game in the iframe can be found here: games.gamezop.com/g/H1be5Ef0Qp/?id=peSLSV

The direct link to the game is: play.gamezop.com/H1be5Ef0Qp/index.html?id=peSLSV

I've tried this with multiple games and multiple websites, but none of them seem to work. Would be grateful for assistance here!

Best
Yashash

PhistucK

unread,
Jan 14, 2017, 7:20:15 AM1/14/17
to yashash...@gmail.com, Chromium-dev
I think cross origin iFrames (which is your case, since games.gamezop.com is a different origin than play.gamezop.com) need a user gesture (a click or a tap) in order to be activated for Web Audio playback.
I believe it was changed recently to be this way.



PhistucK

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Yashash Agarwal

unread,
Jan 15, 2017, 2:09:42 AM1/15/17
to Chromium-dev, yashash...@gmail.com
I am not sure if it's cross origin iframes. I tried putting up an iframe on play.gamezop.com and referenced a link from the same subdomain. I'm still unable to get any sounds.

The link can be tried here: https://play.gamezop.com/testgame.html


Any other thoughts on what the issue could be?


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

PhistucK

unread,
Jan 15, 2017, 2:15:44 AM1/15/17
to Yashash Agarwal, Chromium-dev
I am not sure.
Anyway, I forgot to mention that this is the wrong group for such bug reports or web development issues.
You can search crbug.com for an existing issue and star it. If you cannot find one, file a new issue using the "New issue" link on the same page.
Please, do not add a "+1" or "Me too" or "Confirmed" (or similar) comment. It just wastes the time of Chrome engineers and sends unnecessary e-mails to all of the people who starred the issue.

You can reply with a link to the found or created issue and might get triaged (and fixed) faster.

Thank you.



PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Abderrahmane CHAREF

unread,
Jun 22, 2018, 5:55:56 PM6/22/18
to Chromium-dev, yashash...@gmail.com
Hello Yashash

I am facing the same problem, I see now that your game's audio works fine on chrome mobile, please how did you solve this problem,

Thank you
Reply all
Reply to author
Forward
0 new messages