allow edit jump forward and backward during playback

This commit is contained in:
Ethan Pippin 2021-12-30 14:03:29 -07:00
parent d5e225dce1
commit c4466c2cb9
2 changed files with 42 additions and 0 deletions

View File

@ -176,6 +176,44 @@ struct VLCPlayerCompactOverlayView: View, VideoPlayerOverlay {
Text("Playback Speed")
}
}
Menu {
ForEach(VideoPlayerJumpLength.allCases, id: \.self) { forwardLength in
Button {
jumpForwardLength = forwardLength
} label: {
if forwardLength == jumpForwardLength {
Label(forwardLength.shortLabel, systemImage: "checkmark")
} else {
Text(forwardLength.shortLabel)
}
}
}
} label: {
HStack {
Image(systemName: "goforward")
Text("Jump Forward Length")
}
}
Menu {
ForEach(VideoPlayerJumpLength.allCases, id: \.self) { backwardLength in
Button {
jumpBackwardLength = backwardLength
} label: {
if backwardLength == jumpBackwardLength {
Label(backwardLength.shortLabel, systemImage: "checkmark")
} else {
Text(backwardLength.shortLabel)
}
}
}
} label: {
HStack {
Image(systemName: "gobackward")
Text("Jump Backward Length")
}
}
} label: {
Image(systemName: "ellipsis.circle")

View File

@ -20,6 +20,10 @@ enum VideoPlayerJumpLength: Int32, CaseIterable, Defaults.Serializable {
return "\(self.rawValue) seconds"
}
var shortLabel: String {
return "\(self.rawValue)s"
}
var forwardImageLabel: String {
switch self {
case .thirty: