Don't see how that's possible without the OS exposing some kind of API, or if the browser latches on to that API. Either way, there is no portability here. Your best bet is Java, not JavaScript, or maybe just plain ol' Flash.
The question is speed.
Given how awesome it would be for music sites on the iphone and other flashless mobile browsers, I'd love to see sometime try.
http://dev.w3.org/html5/html-author/#the-video-element http://dev.w3.org/html5/html-author/#the-audio-element
... but with the exception of IE (unless someone write some kind of activex to support it)