Radio-dodsorfas/web/playlist.php

26 lines
388 B
PHP
Raw Normal View History

2018-10-20 23:58:40 +02:00
<?
include 'common.php';
2018-10-21 12:53:10 +02:00
header('Content-type: audio/x-mpegurl');
2018-10-20 23:58:40 +02:00
$files = scanDir::scan('/playlists/normal', false, true);
echo "#EXTM3U\n";
foreach($files as $file) {
$filename = $file;
$file = file($file);
$file = array_slice($file, 1);
2018-10-21 12:53:10 +02:00
echo "\n#$filename\n";
2018-10-20 23:58:40 +02:00
foreach($file as $line) {
2018-10-21 12:53:10 +02:00
echo "$line";
if (substr($line, -1) !== "\n")
echo "\n";
2018-10-20 23:58:40 +02:00
}
}
?>