Bluesky app fork with some witchin' additions 💫

[Video] Audio duck off main thread (#4926)

authored by hailey.at and committed by

GitHub 1fce7a79 3c04d9bd

+15 -8
+15 -8
modules/expo-bluesky-swiss-army/ios/PlatformInfo/ExpoPlatformInfoModule.swift
··· 10 10 11 11 Function("setAudioCategory") { (audioCategoryString: String) in 12 12 let audioCategory = AVAudioSession.Category(rawValue: audioCategoryString) 13 - try? AVAudioSession.sharedInstance().setCategory(audioCategory) 13 + 14 + DispatchQueue.global(qos: .background).async { 15 + try? AVAudioSession.sharedInstance().setCategory(audioCategory) 16 + } 14 17 } 15 18 16 19 Function("setAudioActive") { (active: Bool) in 17 20 if active { 18 - try? AVAudioSession.sharedInstance().setActive(true) 21 + DispatchQueue.global(qos: .background).async { 22 + try? AVAudioSession.sharedInstance().setActive(true) 23 + } 19 24 } else { 20 - try? AVAudioSession 21 - .sharedInstance() 22 - .setActive( 23 - false, 24 - options: [.notifyOthersOnDeactivation] 25 - ) 25 + DispatchQueue.global(qos: .background).async { 26 + try? AVAudioSession 27 + .sharedInstance() 28 + .setActive( 29 + false, 30 + options: [.notifyOthersOnDeactivation] 31 + ) 32 + } 26 33 } 27 34 } 28 35 }