diff --git a/apps/client/src/widgets/type_widgets/file/Video.tsx b/apps/client/src/widgets/type_widgets/file/Video.tsx index 2ab4c76e50..ce45f059d6 100644 --- a/apps/client/src/widgets/type_widgets/file/Video.tsx +++ b/apps/client/src/widgets/type_widgets/file/Video.tsx @@ -283,7 +283,17 @@ function PlaybackSpeed({ videoRef }: { videoRef: RefObject }) } function LoopButton({ videoRef }: { videoRef: RefObject }) { - const [loop, setLoop] = useState(false); + const [loop, setLoop] = useState(() => videoRef.current?.loop ?? false); + + useEffect(() => { + const video = videoRef.current; + if (!video) return; + setLoop(video.loop); + + const observer = new MutationObserver(() => setLoop(video.loop)); + observer.observe(video, { attributes: true, attributeFilter: ["loop"] }); + return () => observer.disconnect(); + }, []); const toggle = () => { const video = videoRef.current;