rm from swift (#4923)
parent
db7a744433
commit
ae883e2df7
|
@ -14,14 +14,9 @@ public class ExpoPlatformInfoModule: Module {
|
|||
}
|
||||
|
||||
Function("setAudioActive") { (active: Bool) in
|
||||
var categoryOptions: AVAudioSession.CategoryOptions
|
||||
let currentCategory = AVAudioSession.sharedInstance().category
|
||||
|
||||
if active {
|
||||
categoryOptions = [.mixWithOthers]
|
||||
try? AVAudioSession.sharedInstance().setActive(true)
|
||||
} else {
|
||||
categoryOptions = [.duckOthers]
|
||||
try? AVAudioSession
|
||||
.sharedInstance()
|
||||
.setActive(
|
||||
|
@ -29,14 +24,6 @@ public class ExpoPlatformInfoModule: Module {
|
|||
options: [.notifyOthersOnDeactivation]
|
||||
)
|
||||
}
|
||||
|
||||
try? AVAudioSession
|
||||
.sharedInstance()
|
||||
.setCategory(
|
||||
currentCategory,
|
||||
mode: .default,
|
||||
options: categoryOptions
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue