MiniPlayer/Sources/AirPlayButton.swift

26 lines
709 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import SwiftUI
import AVKit
#if os(iOS)
/// AirPlay AVRoutePickerView
/// AirPlay
struct AirPlayButton: UIViewRepresentable {
///
var tintColor: UIColor = .white
func makeUIView(context: Context) -> AVRoutePickerView {
let picker = AVRoutePickerView()
picker.tintColor = tintColor
picker.activeTintColor = UIColor.systemBlue
// 使
picker.backgroundColor = .clear
return picker
}
func updateUIView(_ uiView: AVRoutePickerView, context: Context) {
uiView.tintColor = tintColor
}
}
#endif