momo407
09-21-2008, 07:31 PM
Hello this is my first post and I am sorry if it is the wrong section.
Currently I have been working all day to integrate the FW flv player on a website where the administrator can upload an flv file into a longblob in a database and then play it from that database in the future. The uploading is not a problem...
I actually am able to type in the url to the php file i have that gets the file from the blob and assigns the correct headers. And when i do so i am able to save the flv file and paly it on my computer. So it uplaods and reads the file great!
The problem is i cant get the flv player to be able to read the file correctly and its killing me!!
Also as a side note i am hosting this on my local server right now through WAMPSERVER.
here is the code for the flv player page...
<?php getvid(3); ?>
Here is the get vid function..
function getvid($id){
$body =
"<div id=\"player\">This text will be replaced</div>
<script type=\"text/javascript\"> var justcheck = getfileid(1);
'movie/movie.flv'; var so = new SWFObject('embed/player.swf','mpl','470','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('type', 'flv');
so.addParam('flashvars','&file=".
"movie/videocreate.php?id=3"
."&title=HELP ME&frontcolor=000000&lightcolor=FFFF99&screencolor=FFFFFF&controlbar=none&autostart=true');
so.write('player'); </script>";
echo $body;
}
Here is my videocreate.php file....
include("database.php");
$sql = "SELECT vid_type,vid_data,size FROM vid_info WHERE id=". $_GET["id"];
$result = mysql_query($sql) or die(mysql_error());
$contenttype = mysql_result($result,0,"vid_type");
$video = mysql_result($result,0,"vid_data");
$size = mysql_result($result,0,"size");
header ("Content-transfer-encoding: binary");
header ("Content-Type: video/flv");
header ("Content-Disposition: attachment; filename=movie.flv");
header ("Content-Length: " . $size);
header ("Pragma: public");
print $video;
Thanks to everyone in advance!
Currently I have been working all day to integrate the FW flv player on a website where the administrator can upload an flv file into a longblob in a database and then play it from that database in the future. The uploading is not a problem...
I actually am able to type in the url to the php file i have that gets the file from the blob and assigns the correct headers. And when i do so i am able to save the flv file and paly it on my computer. So it uplaods and reads the file great!
The problem is i cant get the flv player to be able to read the file correctly and its killing me!!
Also as a side note i am hosting this on my local server right now through WAMPSERVER.
here is the code for the flv player page...
<?php getvid(3); ?>
Here is the get vid function..
function getvid($id){
$body =
"<div id=\"player\">This text will be replaced</div>
<script type=\"text/javascript\"> var justcheck = getfileid(1);
'movie/movie.flv'; var so = new SWFObject('embed/player.swf','mpl','470','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('type', 'flv');
so.addParam('flashvars','&file=".
"movie/videocreate.php?id=3"
."&title=HELP ME&frontcolor=000000&lightcolor=FFFF99&screencolor=FFFFFF&controlbar=none&autostart=true');
so.write('player'); </script>";
echo $body;
}
Here is my videocreate.php file....
include("database.php");
$sql = "SELECT vid_type,vid_data,size FROM vid_info WHERE id=". $_GET["id"];
$result = mysql_query($sql) or die(mysql_error());
$contenttype = mysql_result($result,0,"vid_type");
$video = mysql_result($result,0,"vid_data");
$size = mysql_result($result,0,"size");
header ("Content-transfer-encoding: binary");
header ("Content-Type: video/flv");
header ("Content-Disposition: attachment; filename=movie.flv");
header ("Content-Length: " . $size);
header ("Pragma: public");
print $video;
Thanks to everyone in advance!