The_Unkown675 Posted February 28, 2016 Share Posted February 28, 2016 (edited) 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 February 28, 2016 by The_Unkown675 Link to comment Share on other sites More sharing options...
Ingolme Posted February 28, 2016 Share Posted February 28, 2016 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 More sharing options...
The_Unkown675 Posted February 28, 2016 Author Share Posted February 28, 2016 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 More sharing options...
The_Unkown675 Posted February 28, 2016 Author Share Posted February 28, 2016 BUMP Link to comment Share on other sites More sharing options...
dsonesuk Posted February 28, 2016 Share Posted February 28, 2016 (edited) 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 February 28, 2016 by dsonesuk Link to comment Share on other sites More sharing options...
The_Unkown675 Posted February 28, 2016 Author Share Posted February 28, 2016 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 More sharing options...
The_Unkown675 Posted February 28, 2016 Author Share Posted February 28, 2016 EDIT : I have done it, thank you for all your help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now