Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new implementation is missing from the Xcode target and is not guarded against macOS compilation.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Improves iOS call-audio resilience after external audio-session changes.
Changes:
- Adds an
AVAudioSessiondeactivation guard. - Activates the guard during WebRTC initialization.
- Updates
FishjamWebRTCfor CallKit recovery.
| File | Description |
|---|---|
AudioSessionGuard.h |
Declares the guard API. |
AudioSessionGuard.m |
Implements deactivation interception. |
WebRTCModule.m |
Enables the guard on iOS. |
FishjamReactNativeWebrtc.podspec |
Bumps the WebRTC dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| #pragma mark - AVAudioSession (AudioSessionGuard) | ||
|
|
||
| @implementation AVAudioSession (AudioSessionGuard) |
| RTCInitFieldTrialDictionary(fieldTrials); | ||
|
|
||
| #if TARGET_OS_IOS | ||
| [AudioSessionGuard activate]; |
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.

Problem
On iOS, a call's microphone and playout can go silent mid-call while video keeps working; only rejoining helps. Two triggers:
AVAudioSession, e.g. expo-audio after playing a sound.In both cases WebRTC's audio unit stops, but WebRTC keeps it marked as started and never restarts it.
Change
Bumps
FishjamWebRTCto124.0.2.4, which restarts the audio unit when it is stopped by anything other than WebRTC: right away if the session is still active (other code deactivated it), or when CallKit activates the session again (hold → resume). See fishjam-cloud/webrtc#3. No changes in this repo's native code.Apps can avoid even the short gap after a sound by creating expo-audio players with
keepAudioSessionActive: true.Testing
Tested on an iPhone 16 with fishjam-chat and a browser peer (this branch + a local
124.0.2.4build):setIsAudioActiveAsync(false)during a call: audio returns after ~0.5 s, also with the app in the background.Draft until
FishjamWebRTC 124.0.2.4is released; the pod doesn't resolve before that.