Yattee v2 rewrite

This commit is contained in:
Arkadiusz Fal
2026-02-08 18:31:16 +01:00
parent d94a50f8c3
commit 100df744d9
1043 changed files with 163886 additions and 68471 deletions

View File

@@ -0,0 +1,41 @@
//
// AirPlayButton.swift
// Yattee
//
// SwiftUI wrapper for AVRoutePickerView to show AirPlay device selection.
//
import AVKit
import SwiftUI
#if os(iOS)
import UIKit
struct AirPlayButton: UIViewRepresentable {
var tintColor: UIColor = .white
func makeUIView(context: Context) -> AVRoutePickerView {
let routePicker = AVRoutePickerView()
routePicker.tintColor = tintColor
routePicker.activeTintColor = .systemBlue
return routePicker
}
func updateUIView(_ uiView: AVRoutePickerView, context: Context) {
uiView.tintColor = tintColor
}
}
#elseif os(macOS)
import AppKit
struct AirPlayButton: NSViewRepresentable {
func makeNSView(context: Context) -> AVRoutePickerView {
let routePicker = AVRoutePickerView()
routePicker.isRoutePickerButtonBordered = false
return routePicker
}
func updateNSView(_ nsView: AVRoutePickerView, context: Context) {}
}
#endif