0

audio file from mac

when I try to play sounds from my music files, it doesn't work. can someone tell me what's wrong with these codes <audio controls> <source src="file:///Users/MArie/Downloads/U2%20-%20One.mp3" type="audio/mpeg"> </audio> <audio src="file:///Users/MArie/Downloads/U2%20-%20One.mp3" controls> Audio element not supported by your browser </audio> Thanks :)

30th Nov 2018, 11:27 AM
MArie
1 Resposta
+ 7
So there's a number of things here - first, are you trying to run this code on SoloLearn, or from an HTML file on your desktop? If so, then SoloLearn can't access your computer, so the audio will not be available, which can generate an error in Safari, and probably other browsers too. You need to upload your audio to a publicly accessible place (Dropbox, Google Drive) make sure sharing permissions are public, and then use that link. Secondly, if you've done all that and it's still not working, perhaps your browser or OS needs updating. Cheers.
30th Nov 2018, 12:19 PM
Tony
Tony - avatar