mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
992d3a7003
~ add media queries + handle responsiveness on folder header
17 lines
308 B
TypeScript
17 lines
308 B
TypeScript
export function handlePlayPause(
|
|
currentIndex: number,
|
|
audio: HTMLAudioElement,
|
|
state: boolean,
|
|
play: (index: number) => void
|
|
) {
|
|
if (audio.src === "") {
|
|
play(currentIndex);
|
|
} else if (audio.paused) {
|
|
audio.play();
|
|
state = true;
|
|
} else {
|
|
audio.pause();
|
|
state = false;
|
|
}
|
|
}
|