[Videos] Add iOS function to set AVAudioSession.CategoryOptions to .mixWithOthers (#4905)
* audio mixing pref * lint
This commit is contained in:
@@ -7,5 +7,15 @@ public class ExpoPlatformInfoModule: Module {
|
||||
Function("getIsReducedMotionEnabled") {
|
||||
return UIAccessibility.isReduceMotionEnabled
|
||||
}
|
||||
|
||||
Function("setAudioMixWithOthers") { (mixWithOthers: Bool) in
|
||||
var options: AVAudioSession.CategoryOptions
|
||||
if mixWithOthers {
|
||||
options = [.mixWithOthers]
|
||||
} else {
|
||||
options = []
|
||||
}
|
||||
try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: options)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user