Playing a flv through a php script using readfile function
I'm sorry to come to this forum again with this kind of question.
I've checked all the posts that seem to be related to this problem as well as the tutorials/help pages of this site, but I still do not understand why it does not work.
Here is the situation :
I would like to play a .flv through a php file (BroadcastScript.php), using the readfile() function.
I give through the URL to my php script the "id number" of the .flv file I want to play (for instance : BroadcastScript?id=26354), and the php script do its job to find where is the file, and so on.
Finally, something that is pretty classical and that works fine with Quicktime, FlexPaper (and open source document viewer), and other players.
But I could not make it work with JWPlayer ;-(
Here is my code :
$file_code = $_GET["id"];
(mySQL query to find the path with the id provided, which give :)
$path = $array['path'];
$extension = $array['extension'];
$fileName = $array['nom_presentation'];
$dirFile = $path.$fileName.'.'.$extension;
case "flv": $ctype="application/x-shockwave-flash"; break;
case "mp4": $ctype="video/mpeg"; break;
case "wmv": $ctype="video/mpeg"; break;
case "mov": $ctype="video/quicktime"; break;
header("Cache-Control: no-cache, no-store, max-age=0, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Expires: Mon, 20 Dec 1980 00:00:00 GMT"); // Date dans le pass
header("Content-Description: File Transfer");
@readfile($dirFile) or die("File not found.");
I know that this php script works well because :
1. it works with other players
2. I have a log file at the end that says that everything is ok
Now here is my setup for JWplayer :
<div id='mediaspace'>This text will be replaced</div>
var so = new SWFObject('Medias/flv_player/player.swf','flashContent','800','600','9');
Unfortunately it does not work. Of course, I tried many things to make this work (with advices found on the former posts of this forum), but unsuccessfully.
That would be so great if you could help me.
Thank you by advance for the time you will spend on this.
(I repost this note because I think I did not put it initially in the right topic.