;

PDA

Click to See Complete Forum and Search --> : v6 Mediaplayer fd display


Chipal
04-23-2007, 10:10 PM
I must be confused...

How do you tell the mediaplayer component to include the fd graphic created with Mr. Brandt's FD creator? I have them in the same directory as the mp3s, and the selector box asks if I want to include the fd files...

What am I missing?

Chipal

w.brants
04-24-2007, 01:13 AM
If you have chosen a skin that supports fd display and selected the box you mention, it should work :confused:

Just like the mp3 files the fd files stay external so you have to upload them to your server into the same directory the mp3 files are in. They are not integrated into the generated swf file.

Chipal
04-29-2007, 11:57 AM
Just to follow up on this aspect for any others experiencing this situation:

My solution was to move ALL the files to the main directory of the site. Koolmoves (or Flash) will read the MP3 files from a subdirectory but (seemingly) not the FD files, even if they're in the same subdirectory.

It's working now. Is this a bug or a limitation of Flash? It does tend to clutter up the main directory...

Thanks, Chipal

Bob Hartzell
04-30-2007, 09:28 AM
The next version wil allow you to specify a subdirectory for the swf and loaded files.

If you want to do this on your own, see this link
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_04157. This does not explain how to use a relative subdirectory; I have a working example if you want.

bobgodwin
05-06-2007, 01:44 AM
I'd like to take a look at that. Some of my sites have a lot of .mp3 files, and I'd like to keep them in a separate directory.

w.brants
05-06-2007, 01:52 AM
If your site supports php, it's also possible to let a php file scan a directory with all its subdirectories and generate an external playlist dynamicly. That way you can maintain the subdirectory structure. If you wish, I can post such a php file.

bobgodwin
05-06-2007, 02:20 AM
Wow. That was quick. Post it!

w.brants
05-06-2007, 03:20 AM
It's a php5 file so I hope your server supports that.<?

$dir = "./";

function mp_scan ($dir){
$dh = opendir($dir);
while (false !== ($fn = readdir($dh))) if ($fn != '.' && $fn != '..'){
$fn = $dir.'/'.$fn;
if (is_dir($fn)){
foreach (mp_scan($fn) as $fn) $files[] = $fn;
} else {
$ext = substr($fn,-4);
$ext_lc = strtolower($ext);
$label = substr($fn,0,-4);
if ($ext_lc == '.mp3'){
$fd = $label.'.fd';
if ($ext == $ext_lc && file_exists($fd)) $fn = $fd;
}
if ($ext_lc == '.mp3' || $ext_lc == '.flv'){
$files[] = array('label'=>str_replace('_',' ',basename($label)), 'file'=>$fn);
}
}
}
return $files;
}

if (substr($dir,-1)=='/') $dir = substr($dir,0,-1);
$files = mp_scan($dir);
sort($files);

foreach ($files as $f) echo $f['label'].' | '.$f['file']."\r\n";

?>Make sure the php file is in the same directory as the swf file. Don't set any media content using the gui but add a line of actionscript
mediaplayer1.setExternalPlaylist('myPHPfile.php',0 );
to the first frame the media player is in.

In it's current form, it scans for flv and mp3 (+fd) files starting in the directory the script is in. If all your files are stored in a subdirectory named media, you can change $dir = "./"; into the directory name to start there. It will recursively search through all underlying directories.

bobgodwin
05-06-2007, 04:07 PM
Can't get it to work. All I get is the text of the .php file where the song list should be. I Have .mp3 files in a directory called "media", I changed $dir = "./"; to $dir = "./media"; with no luck. Is that the only place the directory needs to be changed?

Also, I got the media player working from a media directory using the method Bob posted, but only if the media player is in main timeline. It won't load into the main movie nor will any other .swf files that don't access the media directory.