attempt to fix broken scrub on android (not working)

This commit is contained in:
Samuel Newman
2025-01-17 23:14:05 +00:00
parent 641cd9acef
commit 49d2da172c
+14 -1
View File
@@ -570,7 +570,11 @@ function Overlay({
</Animated.View>
{player && active ? (
<Scrubber player={player} seekingAnimationSV={seekingAnimationSV} />
<Scrubber
player={player}
seekingAnimationSV={seekingAnimationSV}
scrollGesture={scrollGesture}
/>
) : (
<ScrubberPlaceholder />
)}
@@ -616,9 +620,11 @@ function ScrubberPlaceholder() {
function Scrubber({
player,
seekingAnimationSV,
scrollGesture,
}: {
player: VideoPlayer
seekingAnimationSV: SharedValue<number>
scrollGesture: NativeGesture
}) {
const {width: screenWidth} = useSafeAreaFrame()
const insets = useSafeAreaInsets()
@@ -667,9 +673,15 @@ function Scrubber({
const gesture = useMemo(() => {
return Gesture.Pan()
.blocksExternalGesture(scrollGesture)
.failOffsetY([-10, 10])
.onBegin(() => {
'worklet'
console.log('begin')
})
.onStart(() => {
'worklet'
console.log('start')
seekProgressSV.set(currentTimeSV.get())
isSeekingSV.set(true)
seekingAnimationSV.set(withTiming(1, {duration: 500}))
@@ -695,6 +707,7 @@ function Scrubber({
seekingAnimationSV.set(withTiming(0, {duration: 500}))
})
}, [
scrollGesture,
seekingAnimationSV,
seekBy,
screenWidth,