diff options
author | Hailey <me@haileyok.com> | 2024-08-09 03:05:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 11:05:12 +0100 |
commit | cb574b7be3757c25063957ff561bae6f1be7577f (patch) | |
tree | 5a351be0e58bf36be131af489d83903e7e65e142 /modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift | |
parent | a4f0c9c753ec8844eda094080d81fbba566de7df (diff) | |
download | voidsky-cb574b7be3757c25063957ff561bae6f1be7577f.tar.zst |
[Videos] Add iOS function to set `AVAudioSession.CategoryOptions` to `.mixWithOthers` (#4905)
* audio mixing pref * lint
Diffstat (limited to 'modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift')
-rw-r--r-- | modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift b/modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift index 4a1e6d7e7..ff1148a0b 100644 --- a/modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift +++ b/modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift @@ -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) + } } } |