I built a mp3 playing website.
I use a flash mp3 player to play the mp3 file.It can play, but it can not load the correct time and not stream and buffer the mp3 file located on my server.
It can play the mp3 file correctly if the url is from other site, like Google music.
I think the important problem is the header output of the mp3 file.
this is the code of my php file to output the mp3 file.
<?php
$filename='music/'.$_GET['id'].'.mp3';
$fileSize=filesize($filename);
header('Accept-Ranges: bytes');
header('Cache-Control: max-age=604800');
header('Content-Length: ' . $fileSize);
header('Content-type: audio/mpeg');
readfile($filename);
?>
can anyone tell me what`s the problem is?
PS: You can test on Chrome. Just use Chrome to open the file or page, it will display a player to play mp3 file.