mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix issue with AVPlayer rate
This commit is contained in:
parent
71b25afa28
commit
c36dc67a72
@ -160,7 +160,7 @@ final class AVPlayerBackend: PlayerBackend {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
avPlayer.play()
|
avPlayer.playImmediately(atRate: Float(model.currentRate))
|
||||||
model.objectWillChange.send()
|
model.objectWillChange.send()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,8 +642,13 @@ final class AVPlayerBackend: PlayerBackend {
|
|||||||
|
|
||||||
if player.timeControlStatus == .playing {
|
if player.timeControlStatus == .playing {
|
||||||
self.model.objectWillChange.send()
|
self.model.objectWillChange.send()
|
||||||
|
|
||||||
if player.rate != Float(self.model.currentRate) {
|
if player.rate != Float(self.model.currentRate) {
|
||||||
player.rate = Float(self.model.currentRate)
|
if model.avPlayerUsesSystemControls {
|
||||||
|
self.model.currentRate = Double(player.rate)
|
||||||
|
} else {
|
||||||
|
player.rate = Float(self.model.currentRate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,21 +69,24 @@ struct PlaybackSettings: View {
|
|||||||
}
|
}
|
||||||
.padding(.vertical, 10)
|
.padding(.vertical, 10)
|
||||||
|
|
||||||
HStack {
|
if player.activeBackend == .mpv || !player.avPlayerUsesSystemControls {
|
||||||
controlsHeader("Rate".localized())
|
HStack {
|
||||||
Spacer()
|
controlsHeader("Rate".localized())
|
||||||
HStack(spacing: rateButtonsSpacing) {
|
Spacer()
|
||||||
decreaseRateButton
|
HStack(spacing: rateButtonsSpacing) {
|
||||||
#if os(tvOS)
|
decreaseRateButton
|
||||||
.focused($focusedField, equals: .decreaseRate)
|
#if os(tvOS)
|
||||||
#endif
|
.focused($focusedField, equals: .decreaseRate)
|
||||||
rateButton
|
#endif
|
||||||
increaseRateButton
|
rateButton
|
||||||
#if os(tvOS)
|
increaseRateButton
|
||||||
.focused($focusedField, equals: .increaseRate)
|
#if os(tvOS)
|
||||||
#endif
|
.focused($focusedField, equals: .increaseRate)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if player.activeBackend == .mpv {
|
if player.activeBackend == .mpv {
|
||||||
HStack {
|
HStack {
|
||||||
controlsHeader("Captions".localized())
|
controlsHeader("Captions".localized())
|
||||||
|
Loading…
Reference in New Issue
Block a user