Streaming MP3s With PHP
I am working on a program to stream MP3s from a website to someone's Media Player. The function that is doing the work is as this...
if ( ( $this->mp3_streaming ) & ( $ibforums->input['index'] ) )
{
header("Mime-version: 1.0");
header("Content-type: audio/x-scpls");
header("Content-Transfer-Encoding: 7bit");
echo '[playlist]'."\n";
$index=$this->decodeindex($ibforums->input['index']);
if ($index) {
foreach ($index as $key=>$val) {
$count++;
unset ($pathbits);
$workpath=str_replace($this->websiteroot,"",$mp3path[$val]);
$pathbits=explode("/",$workpath);
unset ($workpath);
foreach ($pathbits as $k=>$v) {
if ($v!="") {
$encodepath=$encodepath.'/'.rawurlencode($v);
}
}
$encodepath=$encodepath.'/'.rawurlencode($mp3name[$val]);
echo 'File'.$count.'='.$this->host.$encodepath."\n";
unset($encodepath);
}
echo 'NumberOfEntries='.$count;
}
}
OK, now basically I think everything is correct, only it won't work with Windows Media Player. It works fine with Real Player, Quicktime, Music Match Juke box, and WinAmp, but Windows Media Player is giving me fits. :mad:
If someone could please tell me what the trick to make this work on Windows Media Player is, I would be most appreciative.
If you'd like to try the code out, please have a look here:
Cannibal Corpse And Other Death Metal MP3s (http://www.tombofthemutilated.net/index.php?act=mp3)
I know there is a couple of bugs on the page, but the main problem I need to solve right now is the streaming mp3s to Windows Media Player.
Thanks!

