svgmx5 Posted March 21, 2013 Share Posted March 21, 2013 Hey everyone - Here's the issue that i'm having.... I have set up a player that streams the mp3 file via a php file so the url looks something like this "domain.com/stream.php?file=11222.mp3 The issue is that on chrome and on some other browsers (not all) the player cannot be replayed once the audio file is done nor can the user fast forward or back while the file is playing. Below is the code: $file = 'path to file'; if(file_exists($file)){ header('Content-type: audio/mpeg'); header('Content-Length: '.filesize($file)); header("Expires: -1"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); readfile($file); }else{ header("HTTP/1.0 404 Not Found"); } My question what is that i'm doing wrong that is causing this issue? i know it somewhere in there i just can't pin point it, any help is greatly appreciated Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/275978-cant-replay-audio-file-streamed-via-php/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.