I\'m developing a local server that will stream a user\'s audio files so they can access them via web browsers using the HTML5 audio object. Since these files are on the user\'s
You can use the load()
method. This basically forces preload="auto"
. But it probably won't buffer the whole thing.
I had the issue that audio wasn't preloaded on mobile devices (even with preload=auto
), but this method worked.
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dfnReturnLink-2
Another option is to load the data via an XMLHttpRequest as a binary blob and set the element's
src
attribute to the blob URI.
(I personally don't really like the play/pause hack.)