u r lucky m,an that i saw this script.. i have spend 2 months trying to do the same but found no help.. netjuke does not do realtime streaming.. it actually downloads the song and then does streaming (care to see the cookies).. this script below is working for me but for mp3 streaming, not for playlist streaming.. i m developing script for playlist streaming.. u can contact me if u require one at
visheshonly@hotmail.com
and i won't mind a thanks either if it works for u.
if ($_GET["mp3file"] !="" || $_GET["stream"] !="" )
{
$BASE_URL = "$ServerIP$PHP_SELF";
$CONFIG["base_dir"] = "/var/www/html/songs/";
if(isset($_GET["mp3file"])) play_single($user);
elseif(isset($_GET["stream"])) stream();
}
function play_single($user) {
global $BASE_URL;
$file_name_dec = $_GET["mp3file"].".m3u";
header("Content-Type: audio/x-mpegurl");
header("Content-Disposition: filename=\"$file_name_dec\"");
echo "http://$BASE_URL?stream=".$_GET["mp3file"]."&user=$user";
}
function stream() {
global $CONFIG;
$extension = trim(substr(strrchr($file_list[$_GET["stream"]], "."),1));
$file_name_dec=$_GET["stream"];
$fp=fopen($CONFIG["base_dir"]."$file_name_dec", "r");
header("Content-Disposition: filename=$file_name_dec");
header("Content-Length $file_size");
fpassthru($fp);
fclose($fp);
}