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.

Configuration:

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

so.addVariable("xmlPath", "auto.php");

5. Save player.html

Directory Structure:

/player.html
/auto.php
audio_player_files/audioPlayer.swf
audio_player_files/flashdetect.js
music/artist - title.mp3
music/music2/blah - blah.mp3

Load your player.html. Done!

Enjoy cache free playback.

Dave

Last edited by davediamondprovo (2014-07-15 22:17:23)

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Works beautifully!  By the way, I especially love the added benefit of protecting the audio files from being downloaded.  This is great for independent artists.  My wife and I will be using this on our artist website for sure.

Thanks Dave!

Jeremy

Re: Cache Free Playback with Nifty Audio Player (auto.php)

My original post has been updated and auto.php for Nifty Audio Player is now v.02

Features include:

* Auto-generation of play list
* Cache free playback on client-side
* Directory recursion
* Alphabetical listing of mp3 files

Soy ain't that bad.

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Well, I actually only need the cache free playback - but I

Re: Cache Free Playback with Nifty Audio Player (auto.php)

It would help if you can post the URL of your player. What is your mp3 filename syntax?

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Well, it

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Your auto.php should be in the same directory as your html page in order to output correct file paths.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Alex, the original file works just fine, original version included like this:

<script type="text/javascript">
var so = new SWFObject("/flash/audioPlayer.swf", "player", "300", "270", "6", "#F9F9F7");
so.addVariable("xmlPath", "/flash/data.xml");
so.write("flashcontent");
</script>

The tracks in the data.xml are included with this path:

/flash/music/1.mp3

Works just fine, but the auto.php doesn

Re: Cache Free Playback with Nifty Audio Player (auto.php)

I think davediamondprovo will need to reply to this.  It's his script above.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Ok, and thanks again Alex for a great script - as you know, I have purchase them all, been using them for years now.

Re: Cache Free Playback with Nifty Audio Player (auto.php)

alpha,

Sorry for the delay. I've been very ill today.

My auto.php script works by looking for the songs in a directory spawned from the directory auto.php sits in. Take a look at the first post in this topic and notice the Directory Structure: segment.

Since I don't know precisely what your $file_dir is set to, I'll guess it's /flash/music. The $file_dir path cannot begin or end with a / on the Unix platform.

My script is told to look for music below the current directory in all directories in the $file_dir path. You are asking it to look for music above the current directory.

Translation: place the music folder in the same directory as the .html and auto.php files.

Last edited by davediamondprovo (2008-11-26 18:44:24)

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Dave, hope you are ok.

My $file_dir is set to music, but should be /flash/music, but as you know I can

Re: Cache Free Playback with Nifty Audio Player (auto.php)

I just took a look at my other site with flashnifties scripts, I always use Textpattern as CMS, and I have another site where I use XML Gallery with an auto.php with the same structure, but it has a variable like this:

addParam("base", "/flash");

Which works perfectly for the XML Gallery, but I just tested this for the Audio Player, and it still doesn

Re: Cache Free Playback with Nifty Audio Player (auto.php)

YEAH, I got it: added: so.addParam("base", "/flash"); to the player, now it works perfectly !!!

Thanks

Re: Cache Free Playback with Nifty Audio Player (auto.php)

alpha,

Good work. It's clear to me now I misunderstood your first post about this. I wasn't a 100% yesterday (ill). You can also use the following:

$file_dir = "../flash/music";

NO forward slash on the end.

Re: Cache Free Playback with Nifty Audio Player (auto.php)

No worries, it works and I

Last edited by alpha (2008-11-27 14:05:32)

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Dave or Alex,
I've just installed the audio player and have the auto.php functioning.

The playlist is set in alphabetical order, as you mentioned.  I would like to have the most recently added file to show up on the top of the playlist but still be able to name it what it is.  The titles change and are not in alphabetical order.

Is there a way to make that happen?

Re: Cache Free Playback with Nifty Audio Player (auto.php)

I don't understand this last sentence, "The titles change and are not in alphabetical order." Please explain.

Re: Cache Free Playback with Nifty Audio Player (auto.php)

its ok  dear bundle of thanks for guiding me in this situtation.

Re: Cache Free Playback with Nifty Audio Player (auto.php)

ok congratulations for your new one

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Question:

Were does the $_GET['param'] come from in the no-cache routine? What is posting that parameter to the script?

Last edited by Joeh (2010-01-21 16:39:26)

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Joeh wrote:

Question:

Were does the $_GET['param'] come from in the no-cache routine? What is posting that parameter to the script?

I haven't visited this thread in a while. A quick check of the auto.txt file I linked would have revealed the answer for you. Check the auto.txt code below the heading // Search for mp3 files and you'll see it.

Re: Cache Free Playback with Nifty Audio Player (auto.php)

Resurrecting this thread to let everyone know I updated the link to download auto.php from Pastebin where it will live forever now. See original post or click here.

Last edited by davediamondprovo (2014-07-15 22:17:41)