This is the code that sends a playlist to the browser.
sub send_playlist {
my $r = shift;
my $files = shift;
my ($path) = $r->uri =~ m!^(.*)/[^/]*$!;
$path =~ s!([^a-zA-Z0-9/])!uc sprintf("%%%02x",ord($1))!eg;
$r->send_http_header('audio/mpegurl');
for my $f (@$files) {
my $url = 'http://' . $r->hostname . ":"
. $r->get_server_port
. "$path/" . escape($f);
$r->print ("$url?stream=1\r\n");
}
}
|
|
| Contents | Next |