mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Fix issue with AVPlayer rate
This commit is contained in:
@@ -160,7 +160,7 @@ final class AVPlayerBackend: PlayerBackend {
|
||||
return
|
||||
}
|
||||
|
||||
avPlayer.play()
|
||||
avPlayer.playImmediately(atRate: Float(model.currentRate))
|
||||
model.objectWillChange.send()
|
||||
}
|
||||
|
||||
@@ -642,10 +642,15 @@ final class AVPlayerBackend: PlayerBackend {
|
||||
|
||||
if player.timeControlStatus == .playing {
|
||||
self.model.objectWillChange.send()
|
||||
|
||||
if player.rate != Float(self.model.currentRate) {
|
||||
if model.avPlayerUsesSystemControls {
|
||||
self.model.currentRate = Double(player.rate)
|
||||
} else {
|
||||
player.rate = Float(self.model.currentRate)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
if player.timeControlStatus == .playing {
|
||||
|
@@ -69,6 +69,7 @@ struct PlaybackSettings: View {
|
||||
}
|
||||
.padding(.vertical, 10)
|
||||
|
||||
if player.activeBackend == .mpv || !player.avPlayerUsesSystemControls {
|
||||
HStack {
|
||||
controlsHeader("Rate".localized())
|
||||
Spacer()
|
||||
@@ -84,6 +85,8 @@ struct PlaybackSettings: View {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if player.activeBackend == .mpv {
|
||||
HStack {
|
||||
controlsHeader("Captions".localized())
|
||||
|
Reference in New Issue
Block a user