mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Playback modes
This commit is contained in:
@@ -86,8 +86,6 @@ struct ChannelPlaylistView: View {
|
||||
|
||||
playButton
|
||||
.labelStyle(.iconOnly)
|
||||
shuffleButton
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
#endif
|
||||
VerticalCells(items: items)
|
||||
@@ -119,7 +117,6 @@ struct ChannelPlaylistView: View {
|
||||
}
|
||||
|
||||
playButton
|
||||
shuffleButton
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,20 +134,13 @@ struct ChannelPlaylistView: View {
|
||||
|
||||
private var playButton: some View {
|
||||
Button {
|
||||
player.playbackMode = .queue
|
||||
player.play(videos)
|
||||
} label: {
|
||||
Label("Play All", systemImage: "play")
|
||||
}
|
||||
}
|
||||
|
||||
private var shuffleButton: some View {
|
||||
Button {
|
||||
player.play(videos, shuffling: true)
|
||||
} label: {
|
||||
Label("Shuffle", systemImage: "shuffle")
|
||||
}
|
||||
}
|
||||
|
||||
private var videos: [Video] {
|
||||
items.compactMap(\.video)
|
||||
}
|
||||
|
@@ -109,7 +109,7 @@ struct ControlsBar: View {
|
||||
.frame(maxWidth: .infinity)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.disabled(model.queue.isEmpty)
|
||||
.disabled(!model.isAdvanceToNextItemAvailable)
|
||||
|
||||
Button {
|
||||
model.closeCurrentItem()
|
||||
|
@@ -65,16 +65,11 @@ struct PlaylistVideosView: View {
|
||||
FavoriteButton(item: FavoriteItem(section: .channelPlaylist(playlist.id, playlist.title)))
|
||||
|
||||
Button {
|
||||
player.playbackMode = .queue
|
||||
player.play(videos)
|
||||
} label: {
|
||||
Label("Play All", systemImage: "play")
|
||||
}
|
||||
|
||||
Button {
|
||||
player.play(videos, shuffling: true)
|
||||
} label: {
|
||||
Label("Shuffle", systemImage: "shuffle")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user