0
I would like to know a way to put music running in the background when the site page is loaded automatically without the user having to use a player to start the music, I searched in the documentation of the W3school and the example quoted there is the code below:
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
I would like it to be an automatic way when I load the page the music starts playing.
So Isac, when I put this code it appears a player, and also the music does not even play by clicking on the player play
– Vinnicius Gomes
@Vinniciusgomes View my edit. You have the audio file listed in
src
?horse.ogg
orhorse.mp3
?– Isac
Has yes <source src=".. /Assets/media/quiz.ogg" type="audio/ogg"> <source src=".. /Assets/media/quiz.mp3" type="audio/mpeg">
– Vinnicius Gomes
@Vinniciusgomes See how the example in the answer works. Confirm that you really have the files, and that they are in the correct folder
– Isac
I realized that it was some error in my file because what you put there worked. Thank you Isac, good night.
– Vinnicius Gomes
@No problem, good night too.
– Isac