experiment(PodcastPlayerView): add skip ±15s buttons to full player controls

This commit is contained in:
Krishna Kumar
2026-05-23 00:48:46 -05:00
parent ea8a425c21
commit fc0f98f45a

View File

@@ -144,6 +144,14 @@ final class PodcastPlayerViewModel {
updateNowPlaying() updateNowPlaying()
} }
func skipForward15() {
seek(to: min(currentTime + 15, duration))
}
func skipBackward15() {
seek(to: max(currentTime - 15, 0))
}
private func setupPlayer(url: URL, title: String) { private func setupPlayer(url: URL, title: String) {
currentPodcastTitle = title currentPodcastTitle = title
@@ -347,10 +355,22 @@ struct PodcastPlayerView: View {
.foregroundStyle(.tertiary) .foregroundStyle(.tertiary)
} }
Button { vm.togglePlayPause() } label: { HStack(spacing: 36) {
Image(systemName: vm.isPlaying ? "pause.circle.fill" : "play.circle.fill") Button { vm.skipBackward15() } label: {
.font(.system(size: 72)) Image(systemName: "gobackward.15")
.foregroundStyle(.primary) .font(.system(size: 32))
.foregroundStyle(.primary)
}
Button { vm.togglePlayPause() } label: {
Image(systemName: vm.isPlaying ? "pause.circle.fill" : "play.circle.fill")
.font(.system(size: 72))
.foregroundStyle(.primary)
}
Button { vm.skipForward15() } label: {
Image(systemName: "goforward.15")
.font(.system(size: 32))
.foregroundStyle(.primary)
}
} }
} }
} }