Add channel avatar to tvOS player controls

Matches the iOS controls by showing the channel avatar next to the
video title and channel name, reusing ChannelAvatarView and the
Yattee Server fallback.
This commit is contained in:
Arkadiusz Fal
2026-04-15 04:53:12 +02:00
parent 4837fc6548
commit c3de87a12e

View File

@@ -117,7 +117,17 @@ struct TVPlayerControlsView: View {
// MARK: - Top Bar
private var topBar: some View {
HStack(alignment: .top) {
HStack(alignment: .center, spacing: 20) {
// Channel avatar
if let video = playerState?.currentVideo {
ChannelAvatarView(
author: video.author,
size: 110,
yatteeServerURL: yatteeServerURL,
source: video.id.source
)
}
VStack(alignment: .leading, spacing: 8) {
// Video title
Text(playerState?.currentVideo?.title ?? "")
@@ -145,6 +155,10 @@ struct TVPlayerControlsView: View {
}
}
private var yatteeServerURL: URL? {
appEnvironment?.instancesManager.yatteeServerInstances.first { $0.isEnabled }?.url
}
// MARK: - Action Buttons
private var actionButtons: some View {