mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 08:32:00 +00:00
fixed playback speed
This commit is contained in:
parent
3e86d37555
commit
e22fc93337
2 changed files with 10 additions and 64 deletions
Binary file not shown.
|
|
@ -165,69 +165,15 @@ struct CustomMediaPlayer: View {
|
||||||
if showControls {
|
if showControls {
|
||||||
Menu {
|
Menu {
|
||||||
Menu("Playback Speed") {
|
Menu("Playback Speed") {
|
||||||
Button(action: {
|
ForEach([0.5, 1.0, 1.25, 1.5, 1.75, 2.0], id: \.self) { speed in
|
||||||
player.rate = 0.25
|
Button(action: {
|
||||||
if player.timeControlStatus != .playing {
|
player.rate = Float(speed)
|
||||||
player.pause()
|
if player.timeControlStatus != .playing {
|
||||||
|
player.pause()
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
Text("\(speed, specifier: "%.2f")")
|
||||||
}
|
}
|
||||||
}) {
|
|
||||||
Label("0.25", systemImage: "tortoise")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
player.rate = 0.5
|
|
||||||
if player.timeControlStatus != .playing {
|
|
||||||
player.pause()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Label("0.5", systemImage: "tortoise.fill")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
player.rate = 0.75
|
|
||||||
if player.timeControlStatus != .playing {
|
|
||||||
player.pause()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Label("0.75", systemImage: "hare")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
player.rate = 1.0
|
|
||||||
if player.timeControlStatus != .playing {
|
|
||||||
player.pause()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Label("1.0", systemImage: "hare.fill")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
player.rate = 1.25
|
|
||||||
if player.timeControlStatus != .playing {
|
|
||||||
player.pause()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Label("1.25", systemImage: "speedometer")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
player.rate = 1.5
|
|
||||||
if player.timeControlStatus != .playing {
|
|
||||||
player.pause()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Label("1.5", systemImage: "speedometer")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
player.rate = 1.75
|
|
||||||
if player.timeControlStatus != .playing {
|
|
||||||
player.pause()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Label("1.75", systemImage: "speedometer")
|
|
||||||
}
|
|
||||||
Button(action: {
|
|
||||||
player.rate = 2.0
|
|
||||||
if player.timeControlStatus != .playing {
|
|
||||||
player.pause()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Label("2.0", systemImage: "speedometer")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
|
|
@ -253,8 +199,8 @@ struct CustomMediaPlayer: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.padding(.horizontal, 32)
|
.padding(.horizontal, 32)
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue