31 lines
673 B
Swift
31 lines
673 B
Swift
import AVKit
|
|
import ExpoModulesCore
|
|
|
|
public class AudioOutputModule: Module {
|
|
public func definition() -> ModuleDefinition {
|
|
Name("AudioOutput")
|
|
|
|
View(AudioOutputView.self) {
|
|
Prop("tint") { (view: AudioOutputView, color: UIColor) in
|
|
view.picker.tintColor = color
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
final class AudioOutputView: ExpoView {
|
|
let picker = AVRoutePickerView()
|
|
|
|
required init(appContext: AppContext? = nil) {
|
|
super.init(appContext: appContext)
|
|
picker.prioritizesVideoDevices = false
|
|
picker.backgroundColor = .clear
|
|
addSubview(picker)
|
|
}
|
|
|
|
override func layoutSubviews() {
|
|
super.layoutSubviews()
|
|
picker.frame = bounds
|
|
}
|
|
}
|