Monday, March 28, 2011

Are there Best Practices for Pubmedia Embedded Audio Players?

Lately, I have been testing different embedded audio players for requests from the NPR API.

I wanted to play the audio when someone clicks on a pin representing a story from at a particular place on a map. When this information bubble displays, I wanted the audio to play automatically, like this here:

You can view and try this for yourself at

(Also, if you want to see/hear something a little more interesting, drag and drop the icon of the person in the top left corner onto the pin on the map. If you click on the pin in street view, you should be able to listen to the story as you are looking around at the landscape).

I was interested in using a flash as a fallback player while also using the html5 audio tag (which I understand will only support mp3 (and wav and ogg... for a full description of the issue of html5 support for audio, see: (thanks to my friend Barrett for the heads up)).

I was leaning towards using the flash-based JW Player (because this is already available as a plugin for the framework that I am using and can be cleanly and easily implemented). However, I found that while the JW Player does support a wide variety of playlist formats , it does not support m3u files.

( For the moment, I've opted for using the Open Source Media Framework's Flash Media Playback player which has a handy configuration page here: )

So I asked the folks at @nprdigitalsvcs if it was possible to specify mp3 as an output format, as opposed to m3u. They swiftly and graciously replied by saying that at present, you can't request just mp3 audio. You can walk through all audio elements and find type=mp3. These mp3 files are specified within an m3u file.

So, my question is, what solutions have you arrived at when placing an embedded audio player on your site? Looking ahead to html5, is there an additional output format that we can suggest that NPR implement which would help people to best build pubmedia audio applications for the next generation of browsers and devices?

Would it be valuable for pubmedia coders to suggest some best practices for embedded audio players when presenting audio by way of the NPR API?


Samuel said...

I've used flash based players, but often I just leave the stream there and leave it to the end client browser.

For instanced, Opera can use any codec installed to play video and audio, and Chrome can play the most common formats, as can Firefox (although it oftens falls back to what you have installed, i.e.: QuickTime)

I think I've also seen a Java implementation somewhere... of a music player.

HTML5 Player said...

Thank you for the link.:)html5 video player .Interesting to read. The topic is presented nicely and informative.