advertisement

Search


Sponsored Developer Resources

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed


Webloggers
Login
Home




Build a Streaming MP3 Player

   Print.Print
Email.Email weblog link
Discuss.Discuss
Blog this.Blog this
David Battino

David Battino
Mar. 16, 2005 12:35 PM
Permalink

Atom feed for this author. RSS 1.0 feed for this author. RSS 2.0 feed for this author.

URL: http://digitalmedia.oreilly.com/2005/02/23/mp3_embed.html...

After reading my article “Build a Simple MP3 Player for Your Site,” a visitor asked if it were possible to use the technique to create a streaming media player on the fly.

It is. The technique in the article simply pops open a window with an embedded media player when someone clicks a special JavaScript link. You can embed whatever you want in the window. To play formats like RealAudio, you may need to change the embedding code in the external JavaScript file. There’s some sample code here that may be useful.

But I just tried the current code, using an m3u file instead of an MP3, and it worked fine. (An m3u file is simply a text file containing the URL of the MP3 and the extension .m3u.) In fact, using an m3u link even cleared up the stuttering problem I had experienced with some MP3 files on the Mac.

If you do decide to stream MP3s, though, you should probably provide low-bandwidth versions for dial-up visitors. In “The Real Secret of Streaming MP3s,” Emmy-nominated sound editor Skip Adams recommends using 16kbps, 11kHz mono files.

David Battino is the audio editor for O’Reilly’s Digital Media site, the co-author of The Art of Digital Music, and on the steering committee for the Interactive Audio Special Interest Group (IASIG). He also writes, publishes, and performs Japanese kamishibai storycards.

Return to weblogs.oreilly.com.



Weblog authors are solely responsible for the content and accuracy of their weblogs, including opinions they express, and O'Reilly Media, Inc., disclaims any and all liabililty for that content, its accuracy, and opinions it may contain.

Creative Commons License This work is licensed under a Creative Commons License.



Sponsored by:



Weblog authors are solely responsible for the content and accuracy of their weblogs, including opinions they express, and O'Reilly Media, Inc. disclaims any and all liability for that content, its accuracy, and opinions it may contain.

For problems or assistance with this site, email