bfirsh / jsnes-web

A browser UI for JSNES, a JavaScript NES emulator

Home Page:https://jsnes.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Audio does not work in Mobile Safari, iOS WKWebView, and Android Browser

JoeMeeks opened this issue · comments

@bfirsh, sound emulation via Web Audio API does not work in iOS 10 Mobile Safari, iOS WKWebViews, or Android browsers. Unlocking the audio context on a touchend event before loading a ROM from the list might resolve the issue. Sound is working fine in my Chrome and Firefox desktop browsers, though.

https://jsnes.fir.sh/ (open web ui in mobile browser)

Originally reported here:
bfirsh/jsnes#52

Thanks for the report!

With iOS 14.5 I am able to get sound in Mobile Safari as long as this.Emulator.speakers.start(); is called in a button handler for a client touch or click event (thus unlocking the AudioContext via direct interaction)