mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-05-26 16:10:26 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user