Page 1 of 1

m3u streams

Posted: Sun Oct 08, 2006 10:27 am
by cool4cools
Weirdan | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

<?php
header("Content-Type: Application/m3u");
header("Content-Disposition: inline; filename=\"playlist.m3u\"");

echo "#EXTM3U\n
#EXTINF:317,BassHunter - Boten Anna\n
http://www.example.com/song1.mp3\n
#EXTINF:226,BassHunter - Du gamla du fria\n
http://www.example.com/song2.mp3\n";
break;
?>
or

Code: Select all

<?php
header("Content-Type: Application/m3u");
header("Content-Disposition: inline; filename=\"naampje.m3u\"");

echo "http://www.example.com/song1.mp3\n"; echo "http://www.example.com/song2.mp3\n";
break;
?>
why does windows media player show playlist and not the 2 songs?
and oly plays the first song with both scripts


or is there another way to generate an playlist


Weirdan | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Oct 08, 2006 12:06 pm
by Ambush Commander
The break you've placed at the end of your scripts is causing PHP to barf: it only works in functions. Try removing it.

Code: Select all

<?php
header("Content-Type: Application/m3u");
header("Content-Disposition: inline; filename=\"playlist.m3u\"");

echo "#EXTM3U\n
#EXTINF:317,BassHunter - Boten Anna\n
http://www.example.com/song1.mp3\n
#EXTINF:226,BassHunter - Du gamla du fria\n
http://www.example.com/song2.mp3\n";

?>

Posted: Sun Oct 08, 2006 12:40 pm
by cool4cools
the code works only in th windows media player he doesn't show an index

like

+ playlist
song1
song2

he only shows

playlist

i know it's possible because http://www.streamload.com have it

iets als
http://www.mediamax.com/slbabyfile/85ff ... COVHES.m3u

the headers are wrong

Posted: Mon Oct 09, 2006 1:02 am
by timvw
Use \r\n instead of \n