Skip to content

Audio session conflicts when mixing LiveKit mic/camera with YouTube background music (React Native SDK v2.9.x) #284

@gregoryalary

Description

@gregoryalary

I’m building a React Native app (Android/iOS) and running into audio session conflicts when trying to combine WebRTC voice/video with YouTube background music playback.

Use case

  • Join a LiveKit room with camera + microphone enabled
  • Play YouTube iframe/webview for synchronized background music
  • Users can toggle music and microphone audio on/off independently
  • Both audio sources should play simultaneously on both Android and iOS devices

Current issues

  • Random audio interruptions and crashes
  • YouTube music pauses unpredictably when LiveKit connects
  • Microphone audio cuts out intermittently
  • Inconsistent behavior between Android and iOS

What I’ve tried

  • Android: AudioType.MediaAudioType() with manageAudioFocus: false
  • iOS: useIOSAudioManagement with mixWithOthers option
  • Various AudioSession.configureAudio() combinations

Questions

  • Is this use case (WebRTC voice + background music playback) officially supported?
  • Should audio mixing be handled at the WebRTC level, or at the app-level audio session?
  • Are there any examples/docs for concurrent audio scenarios?
  • Is server-side mixing the recommended approach here?

Environment

  • Platform: React Native SDK v2.9.x
  • Devices: Testing on physical Android + iOS devices

Thanks for any guidance! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions