livekit / client-sdk-android

LiveKit SDK for Android
https://docs.livekit.io
Apache License 2.0
174 stars 69 forks source link

Enable Music playback while user is in Room. #252

Closed wissa-b closed 1 year ago

wissa-b commented 1 year ago

Is your feature request related to a problem? Please describe. When the user has an audio app playing music, and joins a room, the music app stops playing.

Describe the solution you'd like I would like to have an option that when the user joins a room and there's another app playing audio, the music/audio is not stopped.

Ideally If I join an audio room, my music is not stopped, it's fine If I unmuted myself then the music quality goes bad because bluetooth sco is activated, but when I unmute myself I would like to be able to listen to music and also other people in the room.

Describe alternatives you've considered I would suggest that the Audio Focus that is activated by default when joining the room should be optional, so that the app should be able to decide whether they want the call to gain focus or not. Also If a bluetooth device is the selected device, when the users mutes themselves we would expect the communication and sco mode to be stopped, so that if they have music in the background it can be enjoyed still.

Additional context by default the AudioSwitchHandler start method calls switch.start which sets Audio Focus. I would suggest that there would be a flag to make this optional, or that the audio request should be exposed so that audioManager.abandonAudioFocusRequest can be called, but better to have this a a flag.

davidliu commented 1 year ago

AudioSwitchHandler now has a manageAudioFocus flag in 1.3.0.

naziur604 commented 12 months ago

AudioSwitchHandler now has a manageAudioFocus flag in 1.3.0.

is it also work on v1.4.0 version ?

sandeep9094 commented 11 months ago

@wissa-b, how did you able to pass music in room, when ever i join room with music playing, it didn't get pass in room audio stream. can you help with this

wissa-b commented 11 months ago

@wissa-b, how did you able to pass music in room, when ever i join room with music playing, it didn't get pass in room audio stream. can you help with this

@sandeep9094 I didn't try that really, it was about letting the user's own muslic playback continue when joining a room instead of the app taking focus and stopping the music playback.

sandeep9094 commented 11 months ago

@wissa-b, how did you able to pass music in room, when ever i join room with music playing, it didn't get pass in room audio stream. can you help with this

@sandeep9094 I didn't try that really, it was about letting the user's own muslic playback continue when joining a room instead of the app taking focus and stopping the music playback.

okay