I have a system that accepts MP3 uploads to the BlobStore, and now I would like to embed them in an HTML5 player. The trouble is: I can’t seem to get a link directly to the MP3 file. I’ve used images.get_serving_url(blob_key) to great effect, but there doesn’t seem to be an equivalent for audio files.
The documentation explains how to create a handler that serves any file from the blobstore, with two slightly different approaches: BlobstoreDownloadHandler and Sample App
Both had the same result for me, which you can see here: http://testgroovebug.appspot.com/v1/audioserve?resource=AMIfv96sdSSVnSIVZXGyeeGDs3ZjbH7dy4mZmeuU_bUPYxxPu9KHrgO-VC4cVxAAYE-MsZmyuBfVRmFHAnlxLxQxhLMpvfBbCRNPjuriSIBCwO5dLTVpo3ncOL7uQI8VBo8KddW19gtUUU_IUr2AN_Er6BZxTwnmvg
This is supposed to be a 3+ minute song, but usually only the first few seconds come through. Refreshing the page will randomly change the amount that is streamed (sometimes you get lucky and 10 seconds play!).
The HTTP header (gotten via curl) looks like this:
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Expires: Fri, 01 Jan 1990 00:00:00 GMT
< Content-Type: audio/mpeg
< Date: Wed, 19 Oct 2011 18:48:52 GMT
< Server: Google Frontend
< Transfer-Encoding: chunked
Ultimately, I want to be able to use an embedded player of some kind. However, the following code yields a big X in firefox.
<audio src="..." controls="controls">
</audio>
1 Answer