Fix duplicate audio issue

This commit is contained in:
Jarrod Norwell 2024-11-07 22:03:22 +08:00
parent f32f2c1a0c
commit d683b92130

View File

@ -10,8 +10,11 @@ import { theme } from '../theme';
export default function NextCore() { export default function NextCore() {
const date = new Date(); const date = new Date();
const audio = new Audio("https://quicksounds.com/uploads/tracks/528054973_948104858_1761723949.mp3")
function play() { function play() {
new Audio("https://quicksounds.com/uploads/tracks/528054973_948104858_1761723949.mp3").play() if (audio.duration <= 0 && audio.paused) {
audio.play()
}
} }
return ( return (