ruffle-rs.github.io
                                
                                 ruffle-rs.github.io copied to clipboard
                                
                                    ruffle-rs.github.io copied to clipboard
                            
                            
                            
                        Audio not working on Safari iOS/iPad OS when mute is switched on
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.
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
What device is this not working for? And what is the value of navigator.maxTouchPoints?
What device is this not working for?
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.
And what is the value of navigator.maxTouchPoints?
That workaround does seem to have a catch: "console.warn(Failed to play dummy sound: ${err});". Are you able to access the console on your iPad to see if that logs?
Are you able to access the console on your iPad to see if that logs?
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:
import("https://cdn.jsdelivr.net/npm/eruda").then(() => eruda.init());
completion();
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 😦 Can you try iSource Browser?
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.
WARN core/src/stub.rs:126 Encountered stub: AVM2 flash.display.MovieClip.goto() with SWF 9 movie
WARN  mpa: invalid main_data_begin, underflow by 91 bytes log.target = "symphonia_bundle_mp3::layer3";
log.module_path = "symphonia_bundle_mp3::layer3";
log.file = "/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/symphonia-bundle-mp3-0.5.3/src/layer3/mod.rs";
log.line = 86;
Sounds like there's nothing relevant unfortunately