FileLoader Presentation - FLX, is a text format, and can be easily generated by a server-side script. The Presentation itself (FLX), and its slides (HTML) can be both generated on the fly, creating fully interactive and impressive experience!
A PHP script creating an FLX Presentation out of all video clips (*.mpg) in a directory:
<?
$bitrate = 300; //Bitrate of clips in Kbps
$dir_name = "."; //current directory
$dir = opendir($dir_name);
$num_files = 0;
while (false !== ($file_name = readdir($dir)))
{
if (eregi("\.mpg$", $file_name))
{
$files[] = $file_name;
$num_files++;
}
}
closedir($dir);
if ($num_files > 0)
{
$prefix = dirname("http://$SERVER_NAME$SCRIPT_NAME");
$str_flx = "<FLX>\r\n";
$str_flx .= "\r\n";
natsort($files);
$alias = 0;
foreach ($files as $file)
{
$str_flx .= "<DOWNLOAD>\r\n";
$str_flx .= "<FILE SRC=\"$prefix/$file\" ALIAS=\"$alias\">\r\n";
$str_flx .= "</DOWNLOAD>\r\n";
$str_flx .= "<PLAY>\r\n";
$str_flx .= "<TIME=\"00:00.000\">\r\n";
$str_flx .= "<SHOW ALIAS=\"$alias\">\r\n";
$str_flx .= "</TIME>\r\n";
$duration = (filesize($file)/128)/$bitrate;
$min = floor($duration/60);
$sec = floor($duration - ($min * 60));
$ms = round($duration - ($min * 60) - $sec, 3) * 1000;
if ($min < 10) {$str_min = "0".strval($min);}else{$str_min = strval($min);}
if ($sec < 10) {$str_sec = "0".strval($sec);}else{$str_sec = strval($sec);}
if ($ms < 100 && $ms >= 10) {$str_ms = "0".strval($ms);}
else if ($ms < 10) {$str_ms = "00".strval($ms);}
else {$str_ms = strval($ms);}
$str_flx .= "<TIME=\"$str_min:$str_sec.$str_ms\">\r\n";
$str_flx .= "<SHOW ACTION=\"stop\">\r\n";
$str_flx .= "</TIME>\r\n";
$str_flx .= "</PLAY>\r\n";
$str_flx .= "\r\n";
$alias++;
}
$str_flx .= "</FLX>\r\n";
header("Content-Type: text/flx");
print "$str_flx";
}
else
{
print "No files found";
}
?>
A PHP script creating an FLX slide-show out of all images (*.jpg) in a directory:
<?
$dir_name = "."; //current directory
$dir = opendir($dir_name);
$num_files = 0;
while (false !== ($file_name = readdir($dir)))
{
if (eregi("\.jpg$", $file_name))
{
$files[] = $file_name;
$num_files++;
}
}
closedir($dir);
if ($num_files > 0)
{
$prefix = dirname("http://$SERVER_NAME$SCRIPT_NAME");
$str_flx = "<FLX>\r\n";
$str_flx .= "\r\n";
natsort($files);
$alias = 0;
foreach ($files as $file)
{
$str_flx .= "<DOWNLOAD>\r\n";
$str_flx .= "<FILE SRC=\"$prefix/$file\" ALIAS=\"$alias\">\r\n";
$str_flx .= "</DOWNLOAD>\r\n";
$str_flx .= "<PLAY>\r\n";
$str_flx .= "<TIME=\"00:00.000\"><SHOW ALIAS=\"$alias\"></TIME>\r\n";
$str_flx .= "<TIME=\"00:05.000\"><SHOW ACTION=\"stop\"></TIME>\r\n";
$str_flx .= "</PLAY>\r\n";
$str_flx .= "\r\n";
$alias++;
}
$str_flx .= "</FLX>\r\n";
header("Content-Type: text/flx");
print "$str_flx";
}
else
{
print "No files found";
}
?>
A PHP script creating an FLX Presentation out of all audio clips (*.mp3) in a directory:
<?
$bitrate = 128; //Bitrate of clips in Kbps
$dir_name = "."; //current directory
$dir = opendir($dir_name);
$num_files = 0;
while (false !== ($file_name = readdir($dir)))
{
if (eregi("\.mp3$", $file_name))
{
$files[] = $file_name;
$num_files++;
}
}
closedir($dir);
if ($num_files > 0)
{
$prefix = dirname("http://$SERVER_NAME$SCRIPT_NAME");
$str_flx = "<FLX>\r\n";
$str_flx .= "\r\n";
natsort($files);
$alias = 0;
foreach ($files as $file)
{
$str_flx .= "<DOWNLOAD>\r\n";
$str_flx .= "<FILE SRC=\"$prefix/$file\" ALIAS=\"$alias\">\r\n";
$str_flx .= "</DOWNLOAD>\r\n";
$str_flx .= "<PLAY>\r\n";
$str_flx .= "<TIME=\"00:00.000\">\r\n";
$str_flx .= "<SOUND ALIAS=\"$alias\">\r\n";
$str_flx .= "</TIME>\r\n";
$duration = (filesize($file)/128)/$bitrate;
$min = floor($duration/60);
$sec = floor($duration - ($min * 60));
$ms = round($duration - ($min * 60) - $sec, 3) * 1000;
if ($min < 10) {$str_min = "0".strval($min);}else{$str_min = strval($min);}
if ($sec < 10) {$str_sec = "0".strval($sec);}else{$str_sec = strval($sec);}
if ($ms < 100 && $ms >= 10) {$str_ms = "0".strval($ms);}
else if ($ms < 10) {$str_ms = "00".strval($ms);}
else {$str_ms = strval($ms);}
$str_flx .= "<TIME=\"$str_min:$str_sec.$str_ms\">\r\n";
$str_flx .= "<SOUND ACTION=\"stop\">\r\n";
$str_flx .= "</TIME>\r\n";
$str_flx .= "</PLAY>\r\n";
$str_flx .= "\r\n";
$alias++;
}
$str_flx .= "</FLX>\r\n";
header("Content-Type: text/flx");
print "$str_flx";
}
else
{
print "No files found";
}
?>
If you have static FLX Presentations (*.flx files) on your web-site, add text/flx to the list of MIME types of your server. Here is an example of how this is done for Apache server:
mime.types
# MIME type Extension
text/flx flx
An example of a Digital Video Rental Business:
1. Customer loggs in to your web-site, and selects a movie title.
2. The movie is 90 minutes long, and is divided into 18 5-minutes parts.
3. A script on your server generates an FLX video presentation containing
all 18 video clips. A temporary authentication key (like a SessionID)
is added by the script for each video clip:
<DOWNLOAD>
<FILE SRC="http://www.fileloader.com/video.php?file=123_1.mpg&session=SessionID"
ALIAS="1">
</DOWNLOAD>
<PLAY>
<TIME="00:00.000"><SHOW ALIAS="1"></TIME>
<TIME="05:00.000"><SHOW ACTION="stop"></TIME>
</PLAY>
<DOWNLOAD>
<FILE SRC="http://www.fileloader.com/video.php?file=123_2.mpg&session=SessionID"
ALIAS="2">
</DOWNLOAD>
<PLAY>
<TIME="00:00.000"><SHOW ALIAS="2"></TIME>
<TIME="05:00.000"><SHOW ACTION="stop"></TIME>
</PLAY>
An example of a Digital Music Business:
1. Customer loggs in to your web-site, and selects individual songs.
2. A script on your server generates an FLX audio presentation containing
all audio clips. A temporary authentication key (like a SessionID)
is added by the script for each audio clip:
<DOWNLOAD>
<FILE SRC="http://www.fileloader.com/audio.php?file=123.mp3&session=SessionID"
ALIAS="1">
</DOWNLOAD>
<PLAY>
<TIME="00:00.000"><SOUND ALIAS="1"></TIME>
<TIME="03:30.000"><SOUND ACTION="stop"></TIME>
</PLAY>
<DOWNLOAD>
<FILE SRC="http://www.fileloader.com/audio.php?file=124.mp3&session=SessionID"
ALIAS="2">
</DOWNLOAD>
<PLAY>
<TIME="00:00.000"><SOUND ALIAS="2"></TIME>
<TIME="05:00.000"><SOUND ACTION="stop"></TIME>
</PLAY>
An example of a News/Data Business:
1. Business provides real-time market data, news, etc.
2. The amount of data is very large and is divided into multiple pages.
3. All pages are frequently updated.
4. Customer loggs in to your web-site, and selects individual pages.
5. A script on your server generates an FLX presentation containing
selected pages. A temporary authentication key (like a SessionID)
is added by the script for each page:
<DOWNLOAD>
<FILE SRC="http://www.fileloader.com/markets.php?session=SessionID"
ALIAS="1">
</DOWNLOAD>
<PLAY>
<TIME="00:00.000"><SHOW ALIAS="1"></TIME>
<TIME="00:05.000"><SHOW ACTION="stop"></TIME>
</PLAY>
<DOWNLOAD>
<FILE SRC="http://www.fileloader.com/news.php?session=SessionID"
ALIAS="2">
</DOWNLOAD>
<PLAY>
<TIME="00:00.000"><SHOW ALIAS="2"></TIME>
<TIME="00:05.000"><SHOW ACTION="stop"></TIME>
</PLAY>
If you need help setting up your Digital Video Rental Business, Digital Music Business or News/Data Business, please contact bizdev@fileloader.com. We have all the tools you need, and can develop a customized solution for your business.
|