Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

change drag state to seeking instead

ameer2468c89048d1bdad
diff --git a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
index 25d60a326..f0e1b4534 100644
--- a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
@@ -59,10 +59,8 @@ export const ShareVideo = forwardRef<
useImperativeHandle(ref, () => videoRef.current as HTMLVideoElement);
const videoRef = useRef<HTMLVideoElement>(null);
- const previewVideoRef = useRef<HTMLVideoElement>(null);
const previewCanvasRef = useRef<HTMLCanvasElement>(null);
const [isPlaying, setIsPlaying] = useState(false);
- const [buttonDrag, setButtonDrag] = useState(false);
const [currentTime, setCurrentTime] = useState(0);
const [isLoading, setIsLoading] = useState(true);
const [longestDuration, setLongestDuration] = useState(0);
@@ -1251,12 +1249,8 @@ export const ShareVideo = forwardRef<
style={{ width: `${watchedPercentage}%` }}
/>
<div
- onMouseDown={() => setButtonDrag(true)}
- onTouchStart={() => setButtonDrag(true) }
- onMouseUp={() => setButtonDrag(false)}
- onTouchEnd={() => setButtonDrag(false)}
className={clsx("drag-button absolute top-2.5 z-20 -mt-1.5 -ml-2 w-4 h-4 bg-white rounded-full cursor-pointer focus:outline-none",
- buttonDrag ? "scale-125 transition-transform ring-blue-300 ring-offset-2 ring-2" : ""
+ seeking ? "scale-125 transition-transform ring-blue-300 ring-offset-2 ring-2" : ""
)}
tabIndex={0}
style={{ left: `${watchedPercentage}%` }}