[Video] Remove hack from scrubber (#5063)
* remove mouseleave, add pointer cancel * don't show time indicator if duration is 0zio/stable
parent
bf15fad240
commit
17d82a64a6
|
@ -253,7 +253,7 @@ export function Controls({
|
||||||
style={a.flex_1}
|
style={a.flex_1}
|
||||||
onPress={onPressEmptySpace}
|
onPress={onPressEmptySpace}
|
||||||
/>
|
/>
|
||||||
{active && !showControls && !focused && (
|
{active && !showControls && !focused && duration > 0 && (
|
||||||
<TimeIndicator time={Math.floor(duration - currentTime)} />
|
<TimeIndicator time={Math.floor(duration - currentTime)} />
|
||||||
)}
|
)}
|
||||||
<View
|
<View
|
||||||
|
@ -475,21 +475,8 @@ function Scrubber({
|
||||||
if (isFirefox && scrubberActive) {
|
if (isFirefox && scrubberActive) {
|
||||||
document.body.classList.add('force-no-clicks')
|
document.body.classList.add('force-no-clicks')
|
||||||
|
|
||||||
const abortController = new AbortController()
|
|
||||||
const {signal} = abortController
|
|
||||||
document.documentElement.addEventListener(
|
|
||||||
'mouseleave',
|
|
||||||
() => {
|
|
||||||
isSeekingRef.current = false
|
|
||||||
onSeekEnd()
|
|
||||||
setScrubberActive(false)
|
|
||||||
},
|
|
||||||
{signal},
|
|
||||||
)
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.body.classList.remove('force-no-clicks')
|
document.body.classList.remove('force-no-clicks')
|
||||||
abortController.abort()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [scrubberActive, onSeekEnd])
|
}, [scrubberActive, onSeekEnd])
|
||||||
|
@ -548,7 +535,8 @@ function Scrubber({
|
||||||
}}
|
}}
|
||||||
onPointerDown={onPointerDown}
|
onPointerDown={onPointerDown}
|
||||||
onPointerMove={onPointerMove}
|
onPointerMove={onPointerMove}
|
||||||
onPointerUp={onPointerUp}>
|
onPointerUp={onPointerUp}
|
||||||
|
onPointerCancel={onPointerUp}>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.w_full,
|
a.w_full,
|
||||||
|
|
Loading…
Reference in New Issue