From 1c628fba4caff23419b8ee1e9f373dc14139b4f7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 11 Mar 2026 20:49:57 +0200 Subject: [PATCH] fix(video): playing button not working --- .../src/widgets/type_widgets/file/Audio.tsx | 2 +- .../widgets/type_widgets/file/MediaPlayer.tsx | 16 ++++------------ .../src/widgets/type_widgets/file/Video.tsx | 4 ++-- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/file/Audio.tsx b/apps/client/src/widgets/type_widgets/file/Audio.tsx index 9dac014074..08b831a498 100644 --- a/apps/client/src/widgets/type_widgets/file/Audio.tsx +++ b/apps/client/src/widgets/type_widgets/file/Audio.tsx @@ -54,7 +54,7 @@ export default function AudioPreview({ note }: { note: FNote }) {
- +
diff --git a/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx b/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx index 6d368d6270..e0fb57c265 100644 --- a/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx +++ b/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx @@ -56,18 +56,10 @@ function formatTime(seconds: number): string { return `${mins}:${secs.toString().padStart(2, "0")}`; } -export function PlayPauseButton({ mediaRef, playing }: { mediaRef: RefObject, playing: boolean }) { - const togglePlayback = () => { - const media = mediaRef.current; - if (!media) return; - - if (media.paused) { - media.play(); - } else { - media.pause(); - } - }; - +export function PlayPauseButton({ playing, togglePlayback }: { + playing: boolean, + togglePlayback: () => void +}) { return ( { - if ((e.target as HTMLElement).closest(".video-preview-controls")) return; + if ((e.target as HTMLElement).closest(".media-preview-controls")) return; togglePlayback(); }, [togglePlayback]); @@ -65,7 +65,7 @@ export default function VideoPreview({ note }: { note: FNote }) {
- +