about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-09-02 09:32:51 +0100
committerGitHub <noreply@github.com>2024-09-02 09:32:51 +0100
commit17d82a64a6a73a74ee176ab560189e8b94254a4f (patch)
treeb5d5f587cd7f39aa2700d187f6e7db317dc60a5e /src
parentbf15fad240f601d3e0331c2012d2921441f51485 (diff)
downloadvoidsky-17d82a64a6a73a74ee176ab560189e8b94254a4f.tar.zst
[Video] Remove hack from scrubber (#5063)
* remove mouseleave, add pointer cancel

* don't show time indicator if duration is 0
Diffstat (limited to 'src')
-rw-r--r--src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx
index f2f2f7194..2ff2f6516 100644
--- a/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx
+++ b/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx
@@ -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
@@ -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])
@@ -548,7 +535,8 @@ function Scrubber({
         }}
         onPointerDown={onPointerDown}
         onPointerMove={onPointerMove}
-        onPointerUp={onPointerUp}>
+        onPointerUp={onPointerUp}
+        onPointerCancel={onPointerUp}>
         <View
           style={[
             a.w_full,