-
Notifications
You must be signed in to change notification settings - Fork 57
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
Audio not working on Safari iOS/iPad OS when mute is switched on #177
Comments
This is basically a Safari bug (Web Audio plays on the ringer category for some reason, while HTML5 will play on the media category). It appears like there is a workaround, but it's so horrid looking I'm not sure it's a good idea: https://stackoverflow.com/a/46839941 |
We do actually have a workaround in place for this: https://github.com/ruffle-rs/ruffle/blob/master/web/packages/core/src/ruffle-player.ts#L1735 |
iPhone / iPad, version 17.1.1 (latest). Sound works if I keep another tab open with a paused HTML video. Yeah, I’m not joking. Also works if other tab is playing sound but then you hear both.
|
That workaround does seem to have a catch: "console.warn( |
I would need to attach it to Safari on a Mac, which I do not have on hand now. Perhaps I could host a modified version of the site that prints console messages to the screen (if you tell me what to change)? |
@orazioedoardo You can use Eruda or the iSource Browser from the app store to see console messages without attaching to a Mac. To use Eruda, you need to create a shortcut in the Shortcuts app that can be used in Safari:
|
Thanks, the shortcut works but the console does not display any message. Actually, it doesn’t seem to show messages on any site. |
I experienced the same thing but I thought it was because of my outdated iOS version 😦 |
I managed to load Eruda “properly” by pasting the javascript uri in the address bar. After I load a game and press play there are some warnings about fonts and unimplemented functions, depending on the file. The following warnings appear no matter the SWF file, not sure if relevant.
|
Sounds like there's nothing relevant unfortunately |
This is extremely poorly documented, but we may be able to use https://caniuse.com/mdn-api_navigator_audiosession in Safari 17+ (https://bugs.webkit.org/show_bug.cgi?id=237322#c6). It would need testing by someone who has Safari 17+. |
I can. |
@orazioedoardo Does this work: https://danielhjacobs.github.io/ruffle-unmute-ios/? |
I am assuming yes as two people, one with iOS 16.6 and one with iOS 18, have confirmed the fix is working. |
For some odd reason, when the mute switch is on, Safari does not play sound when reproduced through Web Audio, though it does when reproduced through HTML. Looks like there are workarounds to enable audio playback even when muted, if you can consider this something worth addressing.
The text was updated successfully, but these errors were encountered: