Skip to content

Commit

Permalink
[Video] Remove hack from scrubber (#5063)
Browse files Browse the repository at this point in the history
* remove mouseleave, add pointer cancel

* don't show time indicator if duration is 0
  • Loading branch information
mozzius authored Sep 2, 2024
1 parent bf15fad commit 17d82a6
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export function Controls({
style={a.flex_1}
onPress={onPressEmptySpace}
/>
{active && !showControls && !focused && (
{active && !showControls && !focused && duration > 0 && (
<TimeIndicator time={Math.floor(duration - currentTime)} />
)}
<View
Expand Down Expand Up @@ -475,21 +475,8 @@ function Scrubber({
if (isFirefox && scrubberActive) {
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 () => {
document.body.classList.remove('force-no-clicks')
abortController.abort()
}
}
}, [scrubberActive, onSeekEnd])
Expand Down Expand Up @@ -548,7 +535,8 @@ function Scrubber({
}}
onPointerDown={onPointerDown}
onPointerMove={onPointerMove}
onPointerUp={onPointerUp}>
onPointerUp={onPointerUp}
onPointerCancel={onPointerUp}>
<View
style={[
a.w_full,
Expand Down

0 comments on commit 17d82a6

Please sign in to comment.