Adding an MP3 playlist to your site

Many times, you may want to have a listener stream MP3s from your site, but you don’t have any streaming software set up. One solution is to create an M3U file which acts as a playlist that opens up with many mainstream MP3 players such as iTunes and Winamp. Following is an example of an M3U playlist:

#EXTINF:199,Radiohead - Creep

#EXTINF:217,Pink Floyd - Money

The .m3u file can be placed on any web server, and linked to a web page with the standard a href tag. For instance, to link to a file named “playlist.m3u” from a web page in the same directory with the file, the link could be:

Play my playlist

Note: For .m3u files to work correctly, your web server must be configured to deliver the correct mime type for .m3u files. To do this with Apache (one of the most common web server applications), you can do one of the following:

  1. In apache’s conf/ directory, open the file titled “mime.types” and add the following line: audio/x-mpegurl .m3u, and then you will now have to restart apache
  2. In your web site’s root directory, create a file (if it doesn’t already exist) called “.htaccess”, and add the following line: audio/x-mpegurl .m3u

M3U playlists are compatible with all of GravityLab’s Audio Hosting accounts.