UX: Enable WebRTC calls and background audio in the iOS webview - #297
Open
Grubba27 wants to merge 1 commit into
Open
UX: Enable WebRTC calls and background audio in the iOS webview#297Grubba27 wants to merge 1 commit into
Grubba27 wants to merge 1 commit into
Conversation
- add 'audio' to UIBackgroundModes so webview audio (incl. WebRTC remote audio) keeps playing when the app is backgrounded or the screen locks, and PiP video can continue outside the app - update mic/camera usage descriptions to cover voice/video calls - allow media playback without a user gesture so remote call audio can start on joins/reconnects - grant in-webview capture permission for the site's own host to avoid repeated per-session prompts (OS-level prompts unaffected) - explicitly enable PiP and AirPlay for media playback
Grubba27
added a commit
that referenced
this pull request
Aug 13, 2026
Protocol v1 spec plus a step-by-step plan for the resenha plugin side (bridge detection service, join-flow branching, presence-driven roster, error handling, reconciliation after navigation, rollout gate, test matrix). The header links back to PR #297 and js/livekit/bridge.js so the plugin implementer has the full app-side context.
ZogStriP
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Configuration to let WebRTC/LiveKit-based plugins (e.g. resenha) run voice and video calls inside the iOS in-app webview, and keep call/media audio playing when the app is backgrounded or the screen is locked.
ios/Discourse/Info.plistaudiotoUIBackgroundModes— webview audio (including WebRTC remote audio) keeps playing in the background, and Picture-in-Picture video can continue outside the app.js/screens/WebViewScreenComponents/WebViewComponent.jsmediaPlaybackRequiresUserAction={false}— remote WebRTC audio can start without a fresh user gesture (needed for joins, reconnects, and new participants attaching audio tracks). Side effect: embeds that explicitly request autoplay-with-sound are no longer blocked.mediaCapturePermissionGrantType="grantIfSameHostElsePrompt"— stops WKWebView re-showing its own "Allow site to use your microphone?" dialog every session for the site itself. The one-time OS-level permission prompts are unaffected, and embedded third-party origins still prompt.allowsPictureInPictureMediaPlayback/allowsAirPlayForMediaPlayback.Android needs no changes: sites open in Chrome Custom Tabs, where calls, permissions, background audio, and media notifications already behave like regular Chrome.
Known platform limits (not addressable by configuration)
getUserMediacapture shortly after the app backgrounds — WebKit bug 233419, open since 2021 and still reproducing on iOS 18.3 (Apple forums). Backgrounded users keep hearing the call but go mic-silent until they return. The fix is a native LiveKit bridge — see thelivekit-native-bridgebranch.getDisplayMediais unavailable in all mobile browsers/webviews. Viewing someone else's screen share works (it is just an incoming video track); starting one from a phone requires native ReplayKit/MediaProjection work.How to test
On a physical device (simulators have no camera and unreliable WebRTC):