Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ar(fix) [DPCP-45]: Audio Player live stream buffer #14

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/molecules/02_AudioPlayer/AudioPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@
const isPlaying = status === 'playing';

if (isPlaying) {
audioElement.current?.pause();
audioElement.current.currentTime = 0;
audioElement.current.pause();
audioElement.current.src = 'about:blank';
audioElement.current.load();
setStatus('stopped');
} else {
audioElement.current?.play();
audioElement.current.src = tracks[0].url || 'about:blank';
audioElement.current.load();
audioElement.current.play();
setStatus('playing');
}
};
Expand All @@ -119,7 +122,7 @@
};
}
return () => {};
}, [status]);

Check warning on line 125 in src/molecules/02_AudioPlayer/AudioPlayer.tsx

View workflow job for this annotation

GitHub Actions / oneiros::pr_checks::build

React Hook useEffect has missing dependencies: 'handleStatus' and 'prompt'. Either include them or remove the dependency array

Check warning on line 125 in src/molecules/02_AudioPlayer/AudioPlayer.tsx

View workflow job for this annotation

GitHub Actions / oneiros::pr_checks::lint

React Hook useEffect has missing dependencies: 'handleStatus' and 'prompt'. Either include them or remove the dependency array

return (
<div id={id} className={gridStyles}>
Expand Down
Loading