From 002b5f7c2c4d8df2d6888ac0d5f227456a456cb4 Mon Sep 17 00:00:00 2001 From: Mikayla Dobson Date: Mon, 7 Feb 2022 20:01:08 -0600 Subject: [PATCH] passed play function to audio tag --- src/features/video/VideoPlayer.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/features/video/VideoPlayer.js b/src/features/video/VideoPlayer.js index 7309127..ef7649b 100644 --- a/src/features/video/VideoPlayer.js +++ b/src/features/video/VideoPlayer.js @@ -4,30 +4,26 @@ export default function VideoPlayer({data}) { const vid = useRef(); const aud = useRef(); - const vidPosition = useRef(0); - const audPosition = useRef(0); - let url = data.url ? data.url : null; const [playing, setPlaying] = useState(false); useEffect(() => { if (playing) { - aud.current.play(); + vid.current.play(); vid.current.currentTime = aud.current.currentTime; } else if (!playing) { - aud.current.pause(); + vid.current.pause(); } }, [playing, aud, vid]); return (
-
); } \ No newline at end of file