Hello,
Been working on this for a couple days now, read through various topics here as well as on the web. I can;t seem to get what I want done and wondered if others had a clue how to implement it.
I'm using Shadowbox with JW Player and trying to serve up the FLV files dynamically because they are located above the web root.
Right now, my code is using what I posted below. I've tried difference variations of things with no luck:
Javascript:
var options = {
players: ["img","flv", "swf"],
};
Shadowbox.init(options);
HTML link:
<a href="http://mysite.com/video.php?cat=1&id=1" rel="shadowbox;player=flv;width=320;height=240;options={flashVars:{type: \'video\'}}">video.php:
// There is a query to get info based off the passed category and id I'm not showing
$video = $mediaDir . '/' . $res['video'];
if(file_exists($video)){
$fileSize = filesize($video);
$fileName = $res['video'];
$fh = fopen($file, 'rb');
session_cache_limiter("nocache");
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");
header("Content-Type: video/x-flv");
header("Content-Disposition: attachment; filename=\"" . $fileName . "\"");
header("Content-Length: " . $fileSize);
while(!feof($fh)) {
print(fread($fh, filesize($file)));
}
}
===============
When going to the full url:
http://mysite.com/video.php?cat=1&id=1
I am prompted to download the flv file. I've saved it to my comp at it works fine.
When JW Player opens in Shadowbox, I receive the warning: "Video not found or permission denied"
Anyone serving flv files using php in this manner? Any ideas?
Thank you