Skip to content

Commit

Permalink
ar(fix) [DPCP-45]: Audio Player live stream buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Aug 6, 2024
1 parent 4e178ae commit 0c920da
Showing 1 changed file with 6 additions and 3 deletions.
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 @@ export const HAudioPlayer = function ({
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;
audioElement.current.load();
audioElement.current.play();
setStatus('playing');
}
};
Expand Down

0 comments on commit 0c920da

Please sign in to comment.