Shoutcast服務器不生成有效的HTTP資源。我們的移動播放器鏈接(Android)需要有效的HTTP資源。我如何使用PHP腳本shoutcast流?這個腳本提供了有效的http資源?有誰知道?現場音頻流有效HTTP資源
<?php
$track = "shoutcaststream.mp3";
if (file_exists($track)) {
header("Content-Type: audio/mpeg");
header('Content-Length: ' . filesize($track));
header('Content-Disposition: inline; filename="shoutcaststream.mp3"');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
readfile($track);
exit;
} else {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
echo "no file";
}
更新2
現在一切罰款蝮 「布拉德」 的說明。我們使用set_time_limit(0)但是我的流仍然在3分鐘到5分鐘後關閉?怎麼修?請幫助我.. :)
我的意思是shoutcast mp3輸出沒有「Content-Type」 – Joshua
你問是否它是一個有效的** HTTP資源**,然後你說它意味着它有'Content-Type',而在你的代碼中你有'header(「Content-Type:audio/mpeg」);'。太模糊... – HamZa
嘿,夥計們,他的問題沒有錯。他在使用SHOUTcast流時遇到的問題是一個衆所周知的問題。 – Brad