hyperlink - How do I /actually/ link mp3 into html? -
i've started learning how use this; unsure on how linking audio files script works. i'm trying have small audio player.
<audio controls width="100" height="100"> <source src="somethin.mp3" type="audio/mp3"> <!-- fallback older browsers --> browser doesn't support html5 audio </audio>
it depends on file location. script above put somethin.mp3 in same location html file. if want put in sub folder (say folder containing .mp3 called audio) <source src="audio/somethin.mp3" type="audio/mp3">
. if in second sub folder (say second called html_sound) <source src="audio/html_sound/somethin.mp3" type="audio/mp3">
. if want go 1 dictionary use <source src="../somethin.mp3" type="audio/mp3">
. 2 dictionaries <source src="../../somethin.mp3" type="audio/mp3">
, on.
just copy dictionary name go folder , use ../
go 1 folder.
also code not end </audio>
tag (it must) , it's type="audio/mpeg"
not type="audio/mp3"
.
best test script in chrome, edge or internet explorer (if have windows) ok not test in firefox or opera supports .ogg files (i know w3schools says need outdated browser , not work).
if have done links or images same.
Comments
Post a Comment