If you need good compatibility, I advise you to use ready-made solutions, for example one of the best: http://jplayer.org/ knows a lot,
- in fact, one JS file, takes about 8kb if the browser is shameful, connects Flash? and the default is HTML5
quote where supported:
- Windows: Firefox, Chrome, Opera, Safari, IE6, IE7, IE8, IE9 OSX: Safari, Firefox, Chrome, Opera iOS: Mobile Safari: iPad, iPhone, iPod Touch Android: Android 2.3 Browser Blackberry: OS 7 Phone Browser, PlayBook Browser
Pro sounds supports both Mp3 and
- HTML5: mp3, mp4 (AAC / H.264), ogg (Vorbis / Theora), webm (Vorbis / VP8), wav Flash: mp3, mp4 (AAC / H.264), flv
sin not to use, and not reinvent the wheel. Substitute random as you wish. The only thing - you have to figure out how to connect it, but this is a one-time work, but then you can connect anywhere and please the visitors.
And yes, I am also not a supporter of music by default, but all sorts of sites are in fact.