Topic: Cache Free Playback with Nifty Audio Player (auto.php)
I've modified auto.php to include headers for cache free playback on a client-side machine. This is useful if you don't want people to rip your music files or expose the directory in which they are stored. The cache free playback has been tested on IE 5+, FF 1.5+, Safari 2+ and Opera 8.02+. Chrome was not tested as it is in beta.
There is also a $file variable on line 126 you can uncomment if your mp3 file names are artist_-_title.mp3. This will allow auto.php to read your file names correctly for playback but display them in the play list without the unsightly _underscores_.
Download cache free auto.php here. Save as auto.php or similar. It's inconsequential really.
1. Open auto.php in your favorite text editor and edit the $file_dir value to point to your music files directory. No slashes! Script will traverse your dir to find all mp3 files nested inside
$file_dir = "music"; //change this to a folder name
2. If your file names are artist_-_title.mp3, uncomment line 126. Change this:
//$file = str_replace(" ", "_", $file);
to look like this:
$file = str_replace(" ", "_", $file);
If your file names are artist - title.mp3, skip this step.
3. Save auto.php and upload.
4. Open player.html and add this variable to your script tag
5. Save player.html
music/artist - title.mp3
music/music2/blah - blah.mp3
Load your player.html. Done!
Enjoy cache free playback.
Last edited by davediamondprovo (2014-07-15 22:17:23)