[jPlayer] How to play m3u lists?

1,477 views
Skip to first unread message

Yuriy

unread,
May 25, 2010, 10:55:25 AM5/25/10
to jPlayer: the CSS styleable jQuery audio player plugin
Hello. I'm sorry for my poor English.
I have such problem: I want to play not "mp3" file by jPlayer but file
with ".m3u" extention. I think I have to use a m3u parser to get the
link with audio stream. Can somebody help me to learn jPlayer play
theese files?
Thanks a lot.

--
You received this message because you are subscribed to the Google Groups "jPlayer: the CSS styleable jQuery audio player plugin" group.
To post to this group, send email to jpl...@googlegroups.com.
To unsubscribe from this group, send email to jplayer+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jplayer?hl=en.

Jonathan2

unread,
May 26, 2010, 2:19:08 AM5/26/10
to jPlayer: the CSS styleable jQuery audio player plugin
Bear in mind that I'm a coding newbie, try something like this:
http://www.phpclasses.org/package/5046-PHP-Parse-M3U-playlist-files.html#download

Now, I assume that m3u parser puts out an array.

I have a bit of code that lists all the mp3 files in a directory to an
array called $allresults, then this next bit of code reads through the
array and generates the jplayer playlist.

Was that the sort of thing you meant?

if (isset($allresults))
{
foreach ($allresults as $key => $val) {
$tracknumber = $key+1;
echo ",{name:\"Track $tracknumber " . trim($buffer[$key]) .
"\",mp3:\"$TNMusicWebdir$mp3filename[$key]\",ogg:\"$TNMusicWebdir
$mp3filename[$key]\"}";

Yuriy

unread,
May 26, 2010, 3:05:33 AM5/26/10
to jPlayer: the CSS styleable jQuery audio player plugin
Oh! This is an idea! To parse m3u files not by javascript, but by php.
Thanks a lot.

On May 26, 9:19 am, Jonathan2 <digitalto...@gmail.com> wrote:
> Bear in mind that I'm a coding newbie, try something like this:http://www.phpclasses.org/package/5046-PHP-Parse-M3U-playlist-files.h...

Jonathan2

unread,
May 26, 2010, 3:08:08 AM5/26/10
to jPlayer: the CSS styleable jQuery audio player plugin
I just noticed something in my bit of code - it starts the playlist
with a comma ,

which is because my playlist has an intro file.

So you just need to ensure that the start looks like
echo "{name:\"Track $tracknumber " . trim($buffer[$key]) .
etc
but that it also has commas between playlist items, except for the
last one.

On May 26, 7:19 am, Jonathan2 <digitalto...@gmail.com> wrote:
> Bear in mind that I'm a coding newbie, try something like this:http://www.phpclasses.org/package/5046-PHP-Parse-M3U-playlist-files.h...

Reply all
Reply to author
Forward
0 new messages