mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Add initial version of music mode
This commit is contained in:
@@ -57,6 +57,9 @@ struct VideoContextMenuView: View {
|
||||
#if os(iOS)
|
||||
playNowInPictureInPictureButton
|
||||
#endif
|
||||
#if !os(tvOS)
|
||||
playNowInMusicMode
|
||||
#endif
|
||||
}
|
||||
|
||||
Section {
|
||||
@@ -131,6 +134,10 @@ struct VideoContextMenuView: View {
|
||||
|
||||
private var playNowButton: some View {
|
||||
Button {
|
||||
if player.musicMode {
|
||||
player.toggleMusicMode()
|
||||
}
|
||||
|
||||
player.play(video)
|
||||
} label: {
|
||||
Label("Play Now", systemImage: "play")
|
||||
@@ -149,6 +156,18 @@ struct VideoContextMenuView: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var playNowInMusicMode: some View {
|
||||
Button {
|
||||
if !player.musicMode {
|
||||
player.toggleMusicMode()
|
||||
}
|
||||
|
||||
player.play(video, at: watch?.timeToRestart, showingPlayer: false)
|
||||
} label: {
|
||||
Label("Play Music", systemImage: "music.note")
|
||||
}
|
||||
}
|
||||
|
||||
private var playNextButton: some View {
|
||||
Button {
|
||||
player.playNext(video)
|
||||
|
Reference in New Issue
Block a user