feat(#11): Add spinner audio and mute button

This commit is contained in:
Josh Creek
2022-10-24 12:27:32 +01:00
parent ff58967c8c
commit b9a40bb8a5
4 changed files with 48 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
export default {
pauseAudio(audio: HTMLAudioElement) {
audio.pause();
},
playAudio(audio: HTMLAudioElement) {
audio.play();
},
stopAudio(audio: HTMLAudioElement) {
audio.pause();
// eslint-disable-next-line no-param-reassign
audio.currentTime = 0;
},
toggleMute(audio: HTMLAudioElement) {
// eslint-disable-next-line no-param-reassign
audio.muted = !audio.muted;
},
};