Jump to content
The_Unkown675

<Audio> Tag Source Not Working

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

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...