M3U Playlists

 

M3U playlists are plain text files, which were originally implemented by Winamp and allow you to include total seconds and track title info.

An M3u playlist must have #EXTM3U as the first line of the file. And each playlist item requires 2 lines of code, the first line begins with #EXTINF: to indicate that a new item is beginning.

Following the #EXTINF: "item header" we have a comma-delimited list, where the first field represents the total track duration in seconds, and the second field the track title. Both of these "fields" are optional.

Here is an example of an M3U playlist.

#EXTM3U
#EXTINF:342,My Cool Song One
http://www.yoursite.com/path/to/track1.mp3
#EXTINF:301,Another Track Title
http://www.yoursite.com/path/to/track2.mp3

Header
The exact string of #EXTM3U is used to define the text file as an M3U playlist

Item
The exact string of #EXTINF: indicates that new track information follows.

Seconds
Following the colon is a number representing the total number of seconds for the track

Track Title
Following the comma (after the seconds) is the title of the track

URL to file
This can be either a relative or absolute URL. We highly recommend using absolute URLs. See "File Paths" for more info.

To use an M3U playlist

Set the "media" option to the URL to the M3U file.

Example

<div data-wimpyplayer data-media="path/to/file.m3u"></div>

 

 

File URLs should only contain alpha-numeric characters. Using anything other than alpha-numeric characters poses potential problems that may prevent files from loading.

 

See Also

- File Paths
- media player option