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