This method is working in Chrome, IE etc. , but in Safari doesn't work. I was reading a lot of on this topic, but nothing helped me... I know that with QuickTime it works. This is a simple code for idea:
HTML
<div id="but"></div>
<audio id="first">
<source src="song.mp3" type="audio/mpeg"/>
</audio>
JS
$("#but").mousedown(function(){
songPlay();
});
function songPlay()
{
var audio = document.getElementById("first");
audio.play();
}
Much would help me some simple example with solution.