Hello everyone,
I am building a 1-on-1 educational platform using LiveKit Cloud, React (@livekit/components-react), and Next.js. The application runs perfectly for most users, but we are hitting severe audio roadblocks specifically with students using iOS Safari on iPads and iPhones.
Despite having excellent network connections (0% packet loss, low jitter), our iOS users frequently report that they cannot hear the teacher, or the teacher cannot hear them.
Looking at our telemetry, I have isolated this down to two specific iOS Safari sandbox behaviors:
1. The Autoplay Blockade
We are seeing frequent autoplay_blocked events. When a token refreshes or a component remounts, Safari flags the new incoming audio track and mutes it. The audio only resumes when the student physically touches the screen (speaker_button_tapped).
2. Background Microphone Suspension
We are seeing mic_silent_while_desired_on events whenever a student swipes to another app (like WhatsApp) or minimizes the Safari tab. The iOS kernel instantly cuts microphone access in the background, making it seem like their internet dropped.
The Ask:
I know we cannot override the iOS kernel, but I am looking for the best-practice React patterns within the LiveKit ecosystem to gracefully handle these UX constraints.
- What is the recommended way to use
RoomEvent.AudioPlaybackStatusChanged(or a specific React hook) to trigger a global “Audio Paused: Tap to Unmute” UI overlay when Safari blocks autoplay? - Are there established patterns using the Page Visibility API (
document.visibilityState) combined with LiveKit hooks to manage themic_silent_while_desired_onstate, or to proactively pause tracks before iOS aggressively suspends them?
Any guidance on how other production web apps handle this “Ghost Network Issue” on iOS would be greatly appreciated!