breezy-horse-36075
12/12/2025, 5:56 PMtall-airline-16756
12/12/2025, 5:56 PMtall-airline-16756
12/12/2025, 5:56 PMbypassVoiceProcessing) or other audio plugins (background audio, audio_focus, etc.)?
4. A short code snippet showing how you initialize LiveKit audio and how you create/play the youtube_player_flutter player would help.
Quick tips while you gather that:
• Conflicts often come from audio session/focus settings. LiveKit typically needs an audio session that supports playAndRecord (microphone + playback).
• Check other plugins that may override audio focus/session (they can interrupt LiveKit).
• On iOS, voice-processing or session category choices can prevent simultaneous playback; bypassVoiceProcessing can help in some cases.
Send the platform, error behavior, and a minimal code snippet and I’ll suggest next steps.
Sources: client-sdk-flutter | livekit/livekit_composite | DeepWiki | [Flutter iOS] SoundWaveformWidget / AudioVisualizerWidget Not Working (Miss...breezy-horse-36075
12/12/2025, 5:58 PMtall-airline-16756
12/12/2025, 5:58 PMAVAudioSessionCategoryOptionMixWithOthers or AVAudioSessionCategoryOptions equivalent).
• Disable or bypass iOS voice processing in LiveKit if enabled: enable LiveKit’s bypassVoiceProcessing option so the audio session is less likely to be reconfigured in an exclusive mode.
• Confirm the YouTube player isn’t explicitly setting the AVAudioSession to an exclusive playback category (some players do). If it is, adjust it to allow mixing.
Android
• Use AudioAttributes/AudioFocus that allow simultaneous playback and capture. For playback, use AudioAttributes with usage USAGE_MEDIA and content type CONTENT_TYPE_MUSIC. For recording, ensure LiveKit initializes with an audio mode that permits capture while playback is active (analogous to MODE_IN_COMMUNICATION / MODE_NORMAL depending on behavior).
• Make sure the YouTube player doesn’t request exclusive audio focus that abandons the microphone. If it calls for exclusive focus, change the focus request to allow ducking or shared focus.
• Check for other plugins that may call requestAudioFocus with exclusive options.
Other practical checks
• Test toggling bypassVoiceProcessing in LiveKit to see if behavior changes.
• Try playing a local audio file with the same player APIs to confirm it’s specific to the YouTube plugin.
• Capture Android logcat and iOS console when starting YouTube playback to see audio-session/focus changes — those logs will point to which component requests exclusive focus.
If you share the two snippets I asked for plus any logs, I’ll provide exact code you can drop into your app for both platforms.breezy-horse-36075
12/12/2025, 5:59 PMtall-airline-16756
12/12/2025, 5:59 PMimport 'package:livekit_client/livekit_client.dart';
await LiveKitClient.initialize(
bypassVoiceProcessing: true,
);
• This reduces LiveKit’s aggressive voice/audio session reconfiguration so playback and mic can coexist.
Other helpful checks and options
• Confirm you aren’t using other plugins that request exclusive audio focus (background audio, audio_focus, etc.). Those can still override LiveKit.
• Test with a simple local audio file using the same player APIs to verify the issue is specific to the YouTube plugin.
• Test on real devices (not simulator) for both iOS and Android.
If enabling bypassVoiceProcessing doesn’t fix it, please share:
1. Which platform(s) (iOS/Android) and device models.
2. The LiveKit init code and the youtube_player_flutter player creation code (minimal snippets).
3. Any Android logcat or iOS console messages captured when YouTube playback starts.
I’ll provide the exact platform-specific code changes next.
Sources: client-sdk-flutter | livekit/livekit_composite | DeepWikibreezy-horse-36075
12/12/2025, 6:01 PMlkc.RoomContexttall-airline-16756
12/12/2025, 6:01 PMbypassVoiceProcessing on LiveKitClient during initialization — it’s not a per-RoomContext setting. Initialize the client with that flag before creating or using any RoomContext (or connecting to a room).
Example:
import 'package:livekit_client/livekit_client.dart';
// initialize once at app startup
await LiveKitClient.initialize(bypassVoiceProcessing: true);
// later, create/use RoomContext
final lkc = LiveKitClient();
final room = await lkc.connect(url, token, ConnectOptions());
// or if you use RoomContext wrapper, create it after initialize
final roomContext = lkc.RoomContext(...);
If you need to tweak connection-time options, use ConnectOptions when calling connect, but bypassVoiceProcessing must be set via LiveKitClient.initialize before any audio session is established.