fix(ios): fixed audio focus change on iOS (#4811)

* fix: fixed audio focus change on ios

* Fix formatting for audio session category options

---------

Co-authored-by: Kamil Moskała <91079590+moskalakamil@users.noreply.github.com>
This commit is contained in:
robertert
2026-03-09 13:54:44 +01:00
committed by GitHub
parent e96d9565bd
commit ddcb9e6dd9
@@ -155,7 +155,7 @@ class VideoManager {
configureAudioSession()
}
private func configureAudioSession() {
let audioSession = AVAudioSession.sharedInstance()
var audioSessionCategoryOptions: AVAudioSession.CategoryOptions = audioSession.categoryOptions
@@ -194,17 +194,19 @@ class VideoManager {
)
let audioMixingMode = determineAudioMixingMode()
audioSessionCategoryOptions.remove(.duckOthers)
audioSessionCategoryOptions.remove(.mixWithOthers)
switch audioMixingMode {
case .mixwithothers:
audioSessionCategoryOptions.insert(.mixWithOthers)
case .donotmix:
audioSessionCategoryOptions.remove(.mixWithOthers)
case .duckothers:
audioSessionCategoryOptions.insert(.duckOthers)
case .auto:
audioSessionCategoryOptions.remove(.mixWithOthers)
audioSessionCategoryOptions.remove(.duckOthers)
case .auto, .donotmix:
// Do nothing as we already cleared the options
break
}
do {