[Videos] Add iOS function to set AVAudioSession.CategoryOptions
to .mixWithOthers
(#4905)
* audio mixing pref * lint
This commit is contained in:
parent
a4f0c9c753
commit
cb574b7be3
4 changed files with 26 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue