Playback modes

This commit is contained in:
Arkadiusz Fal
2022-07-11 00:24:56 +02:00
parent f0b8e7f655
commit ebe3ba9ed5
13 changed files with 150 additions and 105 deletions

View File

@@ -80,12 +80,8 @@ struct PlaylistsView: View {
Spacer()
if currentPlaylist != nil {
HStack(spacing: 0) {
playButton
shuffleButton
}
.offset(x: 10)
playButton
.offset(x: 10)
}
}
.padding(.horizontal)
@@ -180,7 +176,6 @@ struct PlaylistsView: View {
.labelStyle(.iconOnly)
playButton
shuffleButton
}
Spacer()
@@ -293,6 +288,7 @@ struct PlaylistsView: View {
private var playButton: some View {
Button {
player.playbackMode = .queue
player.play(items.compactMap(\.video))
} label: {
Image(systemName: "play")
@@ -301,16 +297,6 @@ struct PlaylistsView: View {
}
}
private var shuffleButton: some View {
Button {
player.play(items.compactMap(\.video), shuffling: true)
} label: {
Image(systemName: "shuffle")
.padding(8)
.contentShape(Rectangle())
}
}
private var currentPlaylist: Playlist? {
model.find(id: selectedPlaylistID) ?? model.all.first
}