FCC 25+5 project, audio doesn't work

I’m not sure why but the audio doesn’t work when it reached 00:00,
I have inserted audio.play() in the function but no audio is play,
while the decrement of time is still working so I did link it properly for function and button.

Any mistake I have done there in the code?

My project link

1 Like

When I run your code, and look in the browser console (not codepen’s “fake” console, but the browser one), I see this error:

pen.js?key=pen.js-4fbafc17-e1cb-4010-8c25-58d05680ffe9:77 Uncaught (in promise) DOMException: The element has no supported sources.

Line 77 of course is your audio.play(); line.

So, I think that resource (the sound file) isn’t being loaded properly. You might need another sound file.

2 Likes

Thanks Mr Kevin, after changing audio source now it works.
I guess I should check with browser console next time…

2 Likes

As you grow as a web developer, the browser console will become one of your most important tools.

2 Likes

Hi @kevinSmith I am a huge fan of you :star_struck:

1 Like

Thanks, but I think you should set your sights a little higher. :wink:

We’ll all on the same path, just that some of us are a little further down the path. Pretty soon you’ll be helping people out, too. That’s what we’re all about here - paying it forward. People further down the path help me from time to time and I try to do the same.

2 Likes

Thank you very much sir :clap: :clap:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.