attempt to fix broken scrub on android (not working)
This commit is contained in:
committed by
Eric Bailey
parent
3b800d626d
commit
1f9a327c26
@@ -570,7 +570,11 @@ function Overlay({
|
|||||||
</Animated.View>
|
</Animated.View>
|
||||||
|
|
||||||
{player && active ? (
|
{player && active ? (
|
||||||
<Scrubber player={player} seekingAnimationSV={seekingAnimationSV} />
|
<Scrubber
|
||||||
|
player={player}
|
||||||
|
seekingAnimationSV={seekingAnimationSV}
|
||||||
|
scrollGesture={scrollGesture}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ScrubberPlaceholder />
|
<ScrubberPlaceholder />
|
||||||
)}
|
)}
|
||||||
@@ -616,9 +620,11 @@ function ScrubberPlaceholder() {
|
|||||||
function Scrubber({
|
function Scrubber({
|
||||||
player,
|
player,
|
||||||
seekingAnimationSV,
|
seekingAnimationSV,
|
||||||
|
scrollGesture,
|
||||||
}: {
|
}: {
|
||||||
player: VideoPlayer
|
player: VideoPlayer
|
||||||
seekingAnimationSV: SharedValue<number>
|
seekingAnimationSV: SharedValue<number>
|
||||||
|
scrollGesture: NativeGesture
|
||||||
}) {
|
}) {
|
||||||
const {width: screenWidth} = useSafeAreaFrame()
|
const {width: screenWidth} = useSafeAreaFrame()
|
||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
@@ -667,9 +673,15 @@ function Scrubber({
|
|||||||
|
|
||||||
const gesture = useMemo(() => {
|
const gesture = useMemo(() => {
|
||||||
return Gesture.Pan()
|
return Gesture.Pan()
|
||||||
|
.blocksExternalGesture(scrollGesture)
|
||||||
.failOffsetY([-10, 10])
|
.failOffsetY([-10, 10])
|
||||||
|
.onBegin(() => {
|
||||||
|
'worklet'
|
||||||
|
console.log('begin')
|
||||||
|
})
|
||||||
.onStart(() => {
|
.onStart(() => {
|
||||||
'worklet'
|
'worklet'
|
||||||
|
console.log('start')
|
||||||
seekProgressSV.set(currentTimeSV.get())
|
seekProgressSV.set(currentTimeSV.get())
|
||||||
isSeekingSV.set(true)
|
isSeekingSV.set(true)
|
||||||
seekingAnimationSV.set(withTiming(1, {duration: 500}))
|
seekingAnimationSV.set(withTiming(1, {duration: 500}))
|
||||||
@@ -695,6 +707,7 @@ function Scrubber({
|
|||||||
seekingAnimationSV.set(withTiming(0, {duration: 500}))
|
seekingAnimationSV.set(withTiming(0, {duration: 500}))
|
||||||
})
|
})
|
||||||
}, [
|
}, [
|
||||||
|
scrollGesture,
|
||||||
seekingAnimationSV,
|
seekingAnimationSV,
|
||||||
seekBy,
|
seekBy,
|
||||||
screenWidth,
|
screenWidth,
|
||||||
|
|||||||
Reference in New Issue
Block a user