Skip to content

Commit

Permalink
ar(fix) [DPCP-45]: Audio Player live stream buffer (#14)
Browse files Browse the repository at this point in the history
* ar(fix) [DPCP-45]: Audio Player live stream buffer

* ar(fix) [DPCP-45]: Audio Player live stream buffer
  • Loading branch information
angeloreale authored Aug 6, 2024
1 parent 4e178ae commit 056da3c
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 || 'about:blank';
audioElement.current.load();
audioElement.current.play();
setStatus('playing');
}
};
Expand Down

0 comments on commit 056da3c

Please sign in to comment.