please help me to add background music in my blog..the music will play when we open the blog... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

please help me to add background music in my blog..the music will play when we open the blog...

background music

31st Oct 2016, 4:58 AM
unais
unais - avatar
5 Answers
+ 4
Use this code:- <audio controls autoplay> <source src="http://www.sololearn.com/uploads/audio.mp3" type="audio/mpeg"> <source src="http://www.sololearn.com/uploads/audio.ogg" type="audio/ogg"> Audio element not supported by your browser. </audio>
31st Oct 2016, 5:32 AM
Ashutosh Tripathy
Ashutosh Tripathy - avatar
+ 2
This is a text, which will display if audio formats is not supported by your browser, mean if your browser unable to play songs of these formats.
31st Oct 2016, 2:28 PM
shantanu singh jhala
shantanu singh jhala - avatar
+ 1
yeah it does auto play play as soon it loads without asking permission. As it is a part of html5 you must start your code with <!DOCTYPE HTML> 😉
1st Nov 2016, 6:05 AM
Mashrafe
Mashrafe - avatar
0
"audio element not supported by your browser"..means??is this also include in the code?
31st Oct 2016, 5:45 AM
unais
unais - avatar
0
@tripathy. Does it play automatically??
1st Nov 2016, 6:00 AM
unais
unais - avatar