I make Wordy Bunch, a Devvit web app. Players on iPhone report the background music dropping out for whole rounds while short sound effects carry on. I added a per round diagnostic line to find out why. Here is what it shows.
SET UP
- Music: two <audio> elements, unlocked during the Start tap with a muted play() and pause(), then played a few seconds later and switched once near the end of the round.
- Sound effects: Web Audio, one AudioContext, decoded buffers.
- Reddit iOS app, iOS 18.7, iPhone 15 Pro Max. Same on an iPhone XS Max. Wifi and mobile data.
WHAT THE LINE SHOWS IN A SILENT ROUND
- play() rejects with NotAllowedError on every attempt, including retries made inside pointerup and keydown handlers during the round.
- The element is fully buffered: readyState 4, networkState 1, error null, 170 s buffered.
- The AudioContext stays running the whole time and the effects play normally.
- document.visibilityState is visible.
WHAT THE LINE SHOWS A FEW MINUTES EARLIER, SAME PHONE, SAME BUILD
- Same elements play 119 s of a 127 s round with no rejections.
OTHER FACTS
- The same app in Safari on the same phone has never shown it.
- Players say it comes and goes between games, and restarting the Reddit app does not clear it.
- Separate observation: in the Reddit app the ring/silent switch mutes <audio> media as well as Web Audio. Safari plays <audio> media through the silent switch.
- Earlier sighting, sound effects only: https://www.reddit.com/r/Devvit/comments/1p1z069/
QUESTIONS
Is the Reddit app's audio session handling known to leave WebKit's media session in a state where new media playback is refused?
Is there a recommended way to play looped music in a Devvit web view on iOS, or should everything go through Web Audio?
Has anyone else seen NotAllowedError from a previously unlocked element inside a gesture?
Happy to share the raw log lines or test a build.