{ console.error('Error playing music:'," /> { console.error('Error playing music:'," /> { console.error('Error playing music:',"/>

DOMException: "Failed to load because no supported source was found (404)"

103 views Asked by At
const playMusic = (track) => {
         currentSong.src = "/songs/" + track + ".mp3";
         currentSong.play().catch(error => {
             console.error('Error playing music:', error);
    });
};

So I was trying to play the audio that is accessing from this link(http://127.0.0.1:3000/songs/) but keeps showing me a404 error:

DOM Exception: Failed to load because no supported source was found.

Also I try to play others songs but it keeps showing me the same error. When i try to acess it directly by the url, same problem occurred. I am a beginner so it is getting difficult for me to correct this error..

0

There are 0 answers