I use a code to play background music on my website..
>
Try jPlayer. It's an html5 media player that will fallback on flash. Here's an example from one of the demos:
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
m4a:"http://www.jplayer.org/audio/m4a/TSP-01-Cro_magnon_man.m4a",
oga:"http://www.jplayer.org/audio/ogg/TSP-01-Cro_magnon_man.ogg"
});
},
swfPath: "../js",
solution: "flash, html",
supplied: "m4a, oga",
wmode: "window"
});
http://jplayer.org/latest/demo-01-solution-flash-html/