brian79 Posted March 21, 2007 Share Posted March 21, 2007 Hi gang, I'm using Flowplayer to embed FLV files to users on my website. The problem is that I'd like to store the videos above the document web root in the file system. I understand how to do this with images, but I haven't quite gotten it to work for videos yet. Say I have a page called view_video.php that requires a variable called vid. This page has HTML code to embed the Flowplayer SWF that looks something like: <object type="application/x-shockwave-flash" data="/FlowPlayer.swf" width="400" height="323" id="FlowPlayer"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="FlowPlayer.swf" /> <param name="quality" value="high" /> <param name="scale" value="noScale" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="config={videoFile: '/video.php?vid=<?php echo $_GET['vid']; ?>'}" /> </object> Please note that this is a much, much simplified version of my code, so please don't give me crap about directly passing the vid variable to the video.php script. Anyway, this embed code makes a call to the video.php script, which is supposed to find the video file above the doc root, check for permissions, set the headers, etc. I'm using the readfile_chunked function from the comments here http://us3.php.net/readfile. The rest of the video.php script looks something like: //simplified code $vfile = "/some/path/" . $_GET['vid'] . ".flv"; if(file_exists($vfile)) { header("Content-Type: video/x-flv"); readfile_chunked($vfile, false); } I've checked to make sure that the $vfile variable contains a real path and that the function readfile_chunked is indeed being called; however, no video is displayed on the view_video.php page. Any ideas? Link to comment https://forums.phpfreaks.com/topic/43736-help-with-anti-leeching-video-script/ Share on other sites More sharing options...
per1os Posted March 21, 2007 Share Posted March 21, 2007 I would check to see if you have a syntax error. What happens when you browse to http://www.yoursite.com/video.php?vid=someid ?? Link to comment https://forums.phpfreaks.com/topic/43736-help-with-anti-leeching-video-script/#findComment-212346 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.