Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Fix video player bugs (#652)

Ameer Al Ashhab1d07a891748d
diff --git a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
index c14ef2fd4..1f5c261e5 100644
--- a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
@@ -367,7 +367,6 @@ export const ShareVideo = forwardRef<
setTimeout(() => {
video.removeEventListener("seeked", handleSeeked);
- setCurrentTime(validTime);
}, 1000);
} catch (error) {
console.error("Error setting video currentTime:", error);
@@ -384,9 +383,14 @@ export const ShareVideo = forwardRef<
};
videoElement.addEventListener("timeupdate", handleTimeUpdate);
+ const handleEnded = () => {
+ setIsPlaying(false);
+ };
+ videoElement.addEventListener("ended", handleEnded);
return () => {
videoElement.removeEventListener("timeupdate", handleTimeUpdate);
+ videoElement.removeEventListener("ended", handleEnded);
};
}, [videoReadyToPlay]);