Jump to content

<Audio> Tag Source Not Working


The_Unkown675

Recommended Posts

Ok, so I've been trying to implement audio into my website, but when I put in the source, the source can not be found. Please help.

 

Thanks in advance!

 

Here is my current code :

<!DOCTPYE html>
<html>
<body>

<audio src="https://youtu.be/ZsMKqVv0SBo" controls>

</audio>

</body>
</html>
Edited by The_Unkown675
Link to comment
Share on other sites

The audio element requires you to point to an audio file. A youtube link won't work. You need a file such as MP3, WAV or OGG. Different browsers are compatible with different formats, you can see the compatibility here: http://www.w3schools.com/html/html5_audio.asp

Link to comment
Share on other sites

The audio element requires you to point to an audio file. A youtube link won't work. You need a file such as MP3, WAV or OGG. Different browsers are compatible with different formats, you can see the compatibility here: http://www.w3schools.com/html/html5_audio.asp

 

It said somewhere in the thread that you could use a link. I tried a OGG file and MP3 file, but neither worked. Where would I need to put this file?

Link to comment
Share on other sites

In most cases mp3 should work, try this

<audio controls>

<source src="http://w3schools.com/html/horse.ogg" type="audio/ogg">

<source src="http://w3schools.com/html/horse.mp3" type="audio/mpeg">

</audio>

 

This should work because it has full path from w3schools website. If it does not? Have you saved your page as utf8 encoded if using notepad or mac text editor, and are you sure the path to the audio file is correct.

Edited by dsonesuk
Link to comment
Share on other sites

In most cases mp3 should work, try this

<audio controls>

<source src="http://w3schools.com/html/horse.ogg" type="audio/ogg">

<source src="http://w3schools.com/html/horse.mp3" type="audio/mpeg">

</audio>

 

This should work because it has full path from w3schools website. If it does not? Have you saved your page as utf8 encoded if using notepad or mac text editor, and are you sure the path to the audio file is correct.

Ok, so I'm using weebly (because it's cheap). What do I do, just put the file in the page and then find that url then post it there. Weebly fuly supports UTF 8

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...