I want to autoplay a MP3 audio file and I don\'t want the player to be visible.
<div id="music">
<audio autoplay>
<source src="kooche.mp3" type="audio/mpeg">
<p>If you can read this, your browser does not support the audio element.</p>
</audio>
</div>
And the css:
#music {
display:none;
}
Like suggested above, you probably should have the controls available in some form. Maybe use a toggle link/checkbox that slides the controls in via jquery.
Source: HTML5 Audio Autoplay
Alternatively you can try the basic thing to get your need,
<audio autoplay loop>
<source src="johann_sebastian_bach_air.mp3">
</audio>
For further reference click here
You Could use this code, It's Works with me
<div style="visibility:hidden">
<audio autoplay loop>
<source src="../audio/audio.mp3">
</audio>
</div>