1
0
mirror of https://github.com/yattee/yattee.git synced 2025-04-27 23:40:35 +05:30

Fix gesture state

This commit is contained in:
Arkadiusz Fal 2022-08-29 17:58:40 +02:00
parent ba07c410f5
commit e9df94256c
2 changed files with 5 additions and 1 deletions

View File

@ -74,7 +74,7 @@ extension VideoPlayerView {
} }
} }
private func onPlayerDragGestureEnded() { func onPlayerDragGestureEnded() {
if horizontalPlayerGestureEnabled, isHorizontalDrag { if horizontalPlayerGestureEnabled, isHorizontalDrag {
isHorizontalDrag = false isHorizontalDrag = false
player.seek.onSeekGestureEnd() player.seek.onSeekGestureEnd()

View File

@ -166,6 +166,10 @@ struct VideoPlayerView: View {
#endif #endif
} }
#if os(iOS) #if os(iOS)
.onChange(of: dragGestureState) { newValue in
guard !newValue else { return }
onPlayerDragGestureEnded()
}
.offset(y: playerOffset) .offset(y: playerOffset)
.animation(dragGestureState ? .interactiveSpring(response: 0.05) : .easeOut(duration: 0.2), value: playerOffset) .animation(dragGestureState ? .interactiveSpring(response: 0.05) : .easeOut(duration: 0.2), value: playerOffset)
.backport .backport