How to insert auto play audio background while website opens?
Author: Mandar V.
Visited 1632,
Followers 1,
Shared 0
How to insert auto play audio background while website opens?
I have a .mp3 file send by client & client want this audio to play while home page of website opens.
Please guide.
Mandar
Posted on the
Hello Mandar
Into an HTML object add a code like that
<audio id="player" autoplay loop> <source src="audio/source.mp3" type="audio/mp3"> </audio>
Check parameters here:
https://www.w3schools.com/tags/tag_audio.asp
Enjoy!
Axel
Hi Mandar,
You can also use the Audio / Video object by putting the music file in a folder on the server, then calling it by a link.
Otherwise, there is the risk that this file is systematically exported to the server with each update, even if it was deleted from the page.
Note (from the help file of WX5): The automatic Video and Audio playback modalities don't work on mobile devices: to avoid excessive tape consumption, in this case, the User must always manually initiate reproduction.
Hope I helped a little ...
J.P.
Take care autoplay has been blocked by Chrome
https://developer.chrome.com/blog/autoplay/
(It > En) ...!... audio in autoplay is not possible, and should be avoided...!...
... as is known, and as indicated in all the program guides, the autoplay audio and the autoplay videos with audio track have always been inhibited in "mobile" devices...
... currently, due to compliance with the convention, autoplay has also been inhibited in some recent PC browsers...
... audio autoplay was never a good idea...
... ultimately the audio must always have the PLAY+STOP button visible...
.
ciao
.