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
1 change: 1 addition & 0 deletions .changes/bump-libwebrtc-to-m150
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
minor type="changed" "Bump libwebrtc to m150(flutter-webrtc 1.6.2), added `enableWARP` and `zeroPlayoutDelay` options to LiveKitClient.initialize"
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ android {
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.mockito:mockito-core:5.0.0")
implementation 'io.github.webrtc-sdk:android:144.7559.09'
implementation 'io.github.webrtc-sdk:android:150.7871.01'
implementation 'io.livekit:noise:2.0.0'
// Audio device/focus/mode routing. Pinned to the same revision used by
// the LiveKit Android SDK (AudioSwitchHandler).
Expand Down
2 changes: 1 addition & 1 deletion ios/livekit_client.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Pod::Spec.new do |s|
s.static_framework = true

s.dependency 'Flutter'
s.dependency 'WebRTC-SDK', '144.7559.09'
s.dependency 'WebRTC-SDK', '150.7871.01'
s.dependency 'flutter_webrtc'
end
16 changes: 15 additions & 1 deletion lib/src/livekit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
import 'audio/audio_manager.dart';
import 'audio/audio_session.dart';
import 'support/native.dart';
import 'support/platform.dart' show PlatformType, lkPlatformIs, lkPlatformIsMobile;
import 'support/platform.dart' show PlatformType, lkPlatformIs, lkPlatformIsMobile, lkPlatformIsDesktop;
import 'support/webrtc_initialize_options.dart';

/// Main entry point to connect to a room.
Expand Down Expand Up @@ -51,6 +51,8 @@ class LiveKitClient {
static Future<void> initialize({
bool bypassVoiceProcessing = false,
AudioSessionOptions? initialAudioSessionOptions,
bool enableWARP = false,
bool zeroPlayoutDelay = false,
}) async {
if (lkPlatformIsMobile()) {
// bypassVoiceProcessing controls only WebRTC voice processing. Android
Expand All @@ -62,11 +64,23 @@ class LiveKitClient {
bypassVoiceProcessing: bypassVoiceProcessing,
initialAudioSessionOptions: initialAudioSessionOptions,
includeAndroidAudioConfiguration: lkPlatformIs(PlatformType.android),
enableWARP: enableWARP,
zeroPlayoutDelay: zeroPlayoutDelay,
Comment thread
cloudwebrtc marked this conversation as resolved.
),
);
if (lkPlatformIs(PlatformType.android) && initialAudioSessionOptions != null) {
AudioManager.instance.setInitialAudioSessionOptions(initialAudioSessionOptions);
}
} else if (lkPlatformIsDesktop()) {
await rtc.WebRTC.initialize(
options: liveKitWebRTCInitializeOptions(
bypassVoiceProcessing: false,
initialAudioSessionOptions: null,
includeAndroidAudioConfiguration: false,
enableWARP: enableWARP,
zeroPlayoutDelay: zeroPlayoutDelay,
),
);
}
}
}
4 changes: 4 additions & 0 deletions lib/src/support/webrtc_initialize_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ Map<String, dynamic> liveKitWebRTCInitializeOptions({
required bool bypassVoiceProcessing,
required AudioSessionOptions? initialAudioSessionOptions,
required bool includeAndroidAudioConfiguration,
bool enableWARP = false,
bool zeroPlayoutDelay = false,
}) => {
if (bypassVoiceProcessing) 'bypassVoiceProcessing': bypassVoiceProcessing,
if (includeAndroidAudioConfiguration && initialAudioSessionOptions != null)
'androidAudioConfiguration': androidAudioSessionConfigurationToMap(initialAudioSessionOptions.android),
if (enableWARP) 'enableWARP': enableWARP,
if (zeroPlayoutDelay) 'zeroPlayoutDelay': zeroPlayoutDelay,
};
2 changes: 1 addition & 1 deletion macos/livekit_client.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Pod::Spec.new do |s|
s.static_framework = true

s.dependency 'FlutterMacOS'
s.dependency 'WebRTC-SDK', '144.7559.09'
s.dependency 'WebRTC-SDK', '150.7871.01'
s.dependency 'flutter_webrtc'
end
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
json_annotation: ^4.12.0

# Fix version to avoid version conflicts between WebRTC-SDK pods, which both this package and flutter_webrtc depend on.
flutter_webrtc: 1.6.0
flutter_webrtc: 1.6.2
dart_webrtc: ^1.8.0

dev_dependencies:
Expand Down
Loading