While muted execute room.toggleMute() after the App switches to background phase.
@main
struct MyApp: App {
@Injected(\.roomManager) private var room
@Environment(\.scenePhase) private var scenePhase
var body: some Scene {
WindowGroup {
ContentView()
.onChange(of: scenePhase) { newScenePhase in
if (newScenePhase == .background) {
room.toggleMute()
}
}
}
}
}
Expected behavior
if Mute
unpublish track
unduck music (if no one else is publishing)
If Bluetooth: A2DP
if Unmute
publish track
duck music
If Bluetooth: HFP
if Someone else published a track
duck music
If Bluetooth: A2DP
if Someone else unpublished a track
unduck music
If Bluetooth: A2DP
Logs
Always
If someone else published a track (foreground or background)
2023-08-03 12:41:50.823120+0200 ๐ Aleck[1285:140689] [as] ATAudioSessionPropertyManager.mm:363 FAILED to set property 1684431725 on AVAudioSession with error Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
without bluetooth device connected
If I switch to foreground while in a call without anyone publishing a track
Describe the bug I need a solution that
Configuration
and this is my customConfigureAudioSessionFunc.
SDK Version LiveKit 1.0.13 WebRTC 104.5112.17
iOS/macOS Version 16.5.1
Steps to Reproduce
Expected behavior
if Mute
if Unmute
if Someone else published a track
if Someone else unpublished a track
Logs
Always
If someone else published a track (foreground or background)
without bluetooth device connected
If I switch to foreground while in a call without anyone publishing a track
If I unmute in the background
Music does not duck and others can't hear me. After switching to foreground
with bluetooth device connected
If I unmute in the background
After switching to foreground
if I than unmute myself in the foreground
If I mute and than unmute in the background