Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/match-swift-play-and-record-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@livekit/react-native': minor
---

iOS: align the default `playAndRecord` presets with the LiveKit Swift SDK.

The duplex (recording) presets now request `mixWithOthers`, `allowBluetooth`,
`allowBluetoothA2DP` and `allowAirPlay`, matching `playAndRecordOptions` in the
Swift SDK. Previously only `allowBluetooth` and `mixWithOthers` were requested,
so A2DP output devices and AirPlay routes were unavailable during a call on this
platform but available on others.

When `preferSpeakerOutput` is set, `defaultToSpeaker` is now requested as well.
The `videoChat` mode implies a speaker route, but iOS may rewrite the mode when
Voice Processing I/O is instantiated - the Swift SDK observed it switching to
`voiceChat`, which routes to the receiver. Requesting the option explicitly
keeps the speaker route across that rewrite.

This affects the defaults used by `setupIOSAudioManagement` and the deprecated
`getDefaultAppleAudioConfigurationForMode`. A custom `IOSAudioSessionPolicy` or
`AppleAudioConfiguration` is unaffected - those supply their own options.
13 changes: 13 additions & 0 deletions .changeset/prefixed-webrtc-symbols.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@livekit/react-native': major
---

Move to the LiveKit prefixed WebRTC builds: `io.github.webrtc-sdk:android-prefixed` on Android and the `LiveKitWebRTC` pod on iOS. This prevents collisions against any other WebRTC implementations.

Apps that only use the JavaScript API need no changes.

Native integrations must migrate to the prefixed symbols:

* Android: `org.webrtc.*` becomes `livekit.org.webrtc.*`.
Custom `-keep class org.webrtc.**` ProGuard rules must be updated to `livekit.org.webrtc.**`.
* iOS: types gain an `LK` prefix (`RTCAudioRenderer` becomes `LKRTCAudioRenderer`, `RTCAudioBuffer` becomes `LKRTCAudioBuffer`, and so on).
30 changes: 30 additions & 0 deletions .changeset/voice-processing-aware-session-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
'@livekit/react-native': minor
---

iOS: pick the audio session mode based on Apple Voice Processing I/O state.

iOS applies a reduced, call-tuned speaker gain while capture is active under the
`voiceChat`/`videoChat` session modes. Apple Voice Processing I/O compensates
with its own loudness stage, so with VPIO off remote audio played back
noticeably quieter.

`LiveKitWebRTC` 144.7559.15 reports the resolved VPIO state to the audio device
module's `willEnableEngine` hook. The default recording configuration now uses
that: with VPIO running it keeps `voiceChat`/`videoChat` as before, and with VPIO
off (for example after `AudioDeviceModule.setVoiceProcessingEnabled(false)`) it
switches to the `default` mode, which keeps media gain. That mode routes to the
receiver, so `preferSpeakerOutput` is expressed through the `defaultToSpeaker`
category option instead of the implicit routing the chat modes provide. This
matches what the LiveKit Swift SDK already does.

`IOSAudioSessionPolicy` gains an optional `recordingWithoutVoiceProcessing`
configuration for the VPIO-off case. Policies that omit it keep using their
`recording` configuration for both, so existing setups are unaffected.
`AudioEngineConfigurationState`, passed to the deprecated
`setupIOSAudioManagement` callback form, gains a matching
`isVoiceProcessingEnabled` field.

Requires `@livekit/react-native-webrtc` with the five-argument `willEnableEngine`
delegate method. Older versions crash with an unrecognized selector when the
audio engine first enables.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ dependencies {
api 'com.facebook.react:react-native:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
api 'com.github.davidliu:audioswitch:89582c47c9a04c62f90aa5e57251af4800a62c9a'
api 'io.github.webrtc-sdk:android:144.7559.04'
api 'io.github.webrtc-sdk:android-prefixed:144.7559.15'
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
implementation "io.livekit:noise:2.0.0"
implementation project(':livekit_react-native-webrtc')
implementation "androidx.annotation:annotation:1.9.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.livekit.reactnative.audio.processing.CustomAudioProcessingController
import com.livekit.reactnative.video.CustomVideoDecoderFactory
import com.livekit.reactnative.video.CustomVideoEncoderFactory
import com.oney.WebRTCModule.WebRTCModuleOptions
import org.webrtc.audio.JavaAudioDeviceModule
import livekit.org.webrtc.audio.JavaAudioDeviceModule
import java.util.concurrent.Callable

object LiveKitReactNative {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.livekit.reactnative.audio.processing.AudioSinkProcessor
import com.livekit.reactnative.audio.processing.MultibandVolumeProcessor
import com.livekit.reactnative.audio.processing.VolumeProcessor
import com.oney.WebRTCModule.WebRTCModuleOptions
import org.webrtc.audio.WebRtcAudioTrackHelper
import livekit.org.webrtc.audio.WebRtcAudioTrackHelper
import java.lang.Thread.sleep
import kotlin.concurrent.thread
import kotlin.time.Duration.Companion.milliseconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package com.livekit.reactnative.audio.processing

import android.media.AudioFormat
import android.os.SystemClock
import org.webrtc.AudioTrackSink
import org.webrtc.audio.JavaAudioDeviceModule
import livekit.org.webrtc.AudioTrackSink
import livekit.org.webrtc.audio.JavaAudioDeviceModule
import java.nio.ByteBuffer
import java.util.Collections

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.livekit.reactnative.audio.processing
import com.facebook.react.bridge.ReactContext
import com.livekit.reactnative.LiveKitReactNative
import com.oney.WebRTCModule.WebRTCModule
import org.webrtc.AudioTrack
import org.webrtc.AudioTrackSink
import livekit.org.webrtc.AudioTrack
import livekit.org.webrtc.AudioTrackSink
import java.util.Collections
import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.ReactContext
import com.facebook.react.modules.core.DeviceEventManagerModule
import com.livekit.reactnative.audio.events.Events
import org.webrtc.AudioTrackSink
import livekit.org.webrtc.AudioTrackSink
import java.nio.ByteBuffer
import java.util.Arrays
import kotlin.io.encoding.Base64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.livekit.reactnative.audio.processing

import org.webrtc.ExternalAudioProcessingFactory
import livekit.org.webrtc.ExternalAudioProcessingFactory
import java.nio.ByteBuffer

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.conflate
import kotlinx.coroutines.flow.transform
import kotlinx.coroutines.launch
import org.webrtc.AudioTrackSink
import livekit.org.webrtc.AudioTrackSink
import java.nio.ByteBuffer
import kotlin.math.pow
import kotlin.math.round
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.ReactContext
import com.facebook.react.modules.core.DeviceEventManagerModule
import com.livekit.reactnative.audio.events.Events
import org.webrtc.AudioTrackSink
import livekit.org.webrtc.AudioTrackSink
import java.nio.ByteBuffer
import kotlin.math.round
import kotlin.math.sqrt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package com.livekit.reactnative.video

import com.oney.WebRTCModule.webrtcutils.SoftwareVideoDecoderFactoryProxy
import org.webrtc.EglBase
import org.webrtc.SoftwareVideoDecoderFactory
import org.webrtc.VideoCodecInfo
import org.webrtc.VideoDecoder
import org.webrtc.VideoDecoderFactory
import org.webrtc.WrappedVideoDecoderFactory
import livekit.org.webrtc.EglBase
import livekit.org.webrtc.SoftwareVideoDecoderFactory
import livekit.org.webrtc.VideoCodecInfo
import livekit.org.webrtc.VideoDecoder
import livekit.org.webrtc.VideoDecoderFactory
import livekit.org.webrtc.WrappedVideoDecoderFactory

open class CustomVideoDecoderFactory(
private var forceSWCodec: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package com.livekit.reactnative.video

import com.oney.WebRTCModule.webrtcutils.SoftwareVideoEncoderFactoryProxy
import org.webrtc.EglBase
import org.webrtc.SoftwareVideoEncoderFactory
import org.webrtc.VideoCodecInfo
import org.webrtc.VideoEncoder
import org.webrtc.VideoEncoderFactory
import livekit.org.webrtc.EglBase
import livekit.org.webrtc.SoftwareVideoEncoderFactory
import livekit.org.webrtc.VideoCodecInfo
import livekit.org.webrtc.VideoEncoder
import livekit.org.webrtc.VideoEncoderFactory

open class CustomVideoEncoderFactory(
sharedContext: EglBase.Context?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ package com.livekit.reactnative.video

import android.util.Log
import com.oney.WebRTCModule.webrtcutils.SoftwareVideoEncoderFactoryProxy
import org.webrtc.EglBase
import org.webrtc.HardwareVideoEncoderFactory
import org.webrtc.SimulcastVideoEncoderFactory
import org.webrtc.SoftwareVideoEncoderFactory
import org.webrtc.VideoCodecInfo
import org.webrtc.VideoCodecStatus
import org.webrtc.VideoEncoder
import org.webrtc.VideoEncoderFactory
import org.webrtc.VideoEncoderFallback
import org.webrtc.VideoFrame
import org.webrtc.WrappedNativeVideoEncoder
import livekit.org.webrtc.EglBase
import livekit.org.webrtc.HardwareVideoEncoderFactory
import livekit.org.webrtc.SimulcastVideoEncoderFactory
import livekit.org.webrtc.SoftwareVideoEncoderFactory
import livekit.org.webrtc.VideoCodecInfo
import livekit.org.webrtc.VideoCodecStatus
import livekit.org.webrtc.VideoEncoder
import livekit.org.webrtc.VideoEncoderFactory
import livekit.org.webrtc.VideoEncoderFallback
import livekit.org.webrtc.VideoFrame
import livekit.org.webrtc.WrappedNativeVideoEncoder
import java.util.concurrent.Callable
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.livekit.reactnative.video

import com.oney.WebRTCModule.EglUtils
import org.webrtc.VideoCodecInfo
import org.webrtc.VideoDecoder
import org.webrtc.VideoDecoderFactory
import org.webrtc.WrappedVideoDecoderFactory
import livekit.org.webrtc.VideoCodecInfo
import livekit.org.webrtc.VideoDecoder
import livekit.org.webrtc.VideoDecoderFactory
import livekit.org.webrtc.WrappedVideoDecoderFactory

class WrappedVideoDecoderFactoryProxy : VideoDecoderFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.webrtc.audio
package livekit.org.webrtc.audio

import android.media.AudioAttributes

Expand Down
16 changes: 8 additions & 8 deletions ci/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PODS:
- hermes-engine (0.82.1):
- hermes-engine/Pre-built (= 0.82.1)
- hermes-engine/Pre-built (0.82.1)
- livekit-react-native (2.11.0):
- livekit-react-native (2.12.0):
- boost
- DoubleConversion
- fast_float
Expand Down Expand Up @@ -37,9 +37,10 @@ PODS:
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- livekit-react-native-webrtc (144.1.1):
- livekit-react-native-webrtc (144.2.0):
- LiveKitWebRTC (= 144.7559.15)
- React-Core
- WebRTC-SDK (= 144.7559.10)
- LiveKitWebRTC (144.7559.15)
- RCT-Folly (2024.11.18.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -2441,7 +2442,6 @@ PODS:
- React-utils (= 0.82.1)
- SocketRocket
- SocketRocket (0.7.1)
- WebRTC-SDK (144.7559.10)
- Yoga (0.0.0)

DEPENDENCIES:
Expand Down Expand Up @@ -2526,8 +2526,8 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- LiveKitWebRTC
- SocketRocket
- WebRTC-SDK

EXTERNAL SOURCES:
boost:
Expand Down Expand Up @@ -2692,8 +2692,9 @@ SPEC CHECKSUMS:
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
hermes-engine: 273e30e7fb618279934b0b95ffab60ecedb7acf5
livekit-react-native: b8a86fb1c57270437f8a010437c0570585a13625
livekit-react-native-webrtc: 9f52dbcc5edee327cdc8c9b458b6d6fd8ece1561
livekit-react-native: 27001a5d9454cc8d27894317425aa511801154e2
livekit-react-native-webrtc: 3cd501a18d7ee8b95c21764dd8502201a0bc4cb3
LiveKitWebRTC: 6abc86e190722e223fc870284547b6f229288c46
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
RCTDeprecation: f17e2ebc07876ca9ab8eb6e4b0a4e4647497ae3a
RCTRequired: e2c574c1b45231f7efb0834936bd609d75072b63
Expand Down Expand Up @@ -2761,7 +2762,6 @@ SPEC CHECKSUMS:
ReactCodegen: 878add6c7d8ff8cea87697c44d29c03b79b6f2d9
ReactCommon: 804dc80944fa90b86800b43c871742ec005ca424
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
WebRTC-SDK: 1d7fc2ae91da6edd63e25f3882ff24f86a8d9d8b
Yoga: 689c8e04277f3ad631e60fe2a08e41d411daf8eb

PODFILE CHECKSUM: a7f2ec66657cfb895ebb19b63b9033e6419495f9
Expand Down
2 changes: 1 addition & 1 deletion ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@livekit/react-native": "*",
"@livekit/react-native-webrtc": "^144.1.2",
"@livekit/react-native-webrtc": "^144.2.0",
"@react-native/new-app-screen": "0.82.1",
"livekit-client": "^2.19.0",
"react": "19.1.1",
Expand Down
10 changes: 5 additions & 5 deletions ci/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1952,15 +1952,15 @@ __metadata:
languageName: node
linkType: hard

"@livekit/react-native-webrtc@npm:^144.1.2":
version: 144.1.2
resolution: "@livekit/react-native-webrtc@npm:144.1.2"
"@livekit/react-native-webrtc@npm:^144.2.0":
version: 144.2.0
resolution: "@livekit/react-native-webrtc@npm:144.2.0"
dependencies:
base64-js: "npm:1.5.1"
debug: "npm:4.3.4"
peerDependencies:
react-native: ">=0.60.0"
checksum: 10/ed4a3594c060404c89020568f0602ad48c51d9738b5479ef9fdecd330ba49349b98afa5b4db7c9faea394cc62edea993a4e8b39cde1181e79966a1c1da65a97a
checksum: 10/fb2db76db47d976cd1ebfff16eef7ba49123a6b0c7af76c6cde671889276c7a5c8c6ed43d4402cf7412ff9905dbf4d986eaf029dd0190cd1bb6fb1897075dd72
languageName: node
linkType: hard

Expand Down Expand Up @@ -3550,7 +3550,7 @@ __metadata:
"@babel/preset-env": "npm:^7.25.3"
"@babel/runtime": "npm:^7.25.0"
"@livekit/react-native": "npm:*"
"@livekit/react-native-webrtc": "npm:^144.1.2"
"@livekit/react-native-webrtc": "npm:^144.2.0"
"@react-native-community/cli": "npm:20.0.0"
"@react-native-community/cli-platform-android": "npm:20.0.0"
"@react-native-community/cli-platform-ios": "npm:20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ export default defineConfig([
},
},
{
ignores: ['node_modules/', 'lib/', 'docs/', 'src/polyfills/'],
ignores: ['node_modules/', 'lib/', 'docs/', 'src/polyfills/', '**/.yalc/'],
},
]);
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LivekitReactNativeExample/Pods-LivekitReactNativeExample-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/WebRTC-SDK/WebRTC.framework/WebRTC",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/LiveKitWebRTC/LiveKitWebRTC.framework/LiveKitWebRTC",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermesvm.framework/hermesvm",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LiveKitWebRTC.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermesvm.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Loading
Loading