I believe there is a bug in jPlayer audio player that prevents a user from navigating through a song using the seek bar if the song file is being outputted by a PHP file. In my htaccess file I have this line:
RewriteRule ^stream/(.*)/([0-9+]).mp3?$ modules/stream.php?a1=$1&a2=$2
And then in my stream.php file, here is the header data I set:
$fsize = filesize($path);
$shortlen = $fsize-1;
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false); // required for certain browsers
header("Content-Type: audio/mpeg");
header("Content-Disposition: inline; filename=" . $file . ";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $fsize);
header('Content-Range: bytes 0-'.$shortlen.'/'.$fsize);
header('X-Pad: avoid browser bug');
header("Content-Length: " . filesize($path));
readfile("$path");
exit();
A link to an mp3 generally looks like this:
www.website.com/stream/song/100/
Everything seems to work in jPlayer, except for navigating the song with the seek bar. When I change the URLs to the direct paths to the mp3s, the seek bar begins working again. Does anyone know how I can fix this problem?
EDIT: The problem does not occur in Safari v6 on Mac OSX 10.8. It does occur on Chrome v27