pasiphilo
07-25-2007, 04:07 PM
Gang,
I've been unable to find any solution - or even a solid explanation - for this problem anywhere.
I've built a custom FLV player that needs to rely on a PHP script to serve it FLV files in order to control access to those files. My player uses the FLVPlayback component.
My actionscript makes a call like this to the PHP script:
my_player.contentPath = "http://testserver/resource.php?id=12345"
I've also tried...
my_player.load("http://testserver/resource.php?id=12345");
The resource.php code in question looks something like this:
header('Content-Type: video/x-flv');
readfile("my_video.flv");
When tested, the FLVPlayback component simply won't accept the FLV served up to it in this way. It will load if targeted directly from Flash, so I know my actionscript works.
(I did find that the far less robust Video object - in conjunction with NetStream class - does load the FLV from my PHP script, but using this player creates a whole whack of other problems for me, including a usability issue due to an apparent inability to let me measure loading progress by comparing bytesLoaded to bytesTotal - again, seemingly the fault of the PHP script, since loading directly from the file system works properly.)
So here's the question: How can I get my PHP script to serve the FLV to my FLVPlayback-based player?
Whoever can help me solve this will have my eternal respect and admiration.
Thanks,
J
I've been unable to find any solution - or even a solid explanation - for this problem anywhere.
I've built a custom FLV player that needs to rely on a PHP script to serve it FLV files in order to control access to those files. My player uses the FLVPlayback component.
My actionscript makes a call like this to the PHP script:
my_player.contentPath = "http://testserver/resource.php?id=12345"
I've also tried...
my_player.load("http://testserver/resource.php?id=12345");
The resource.php code in question looks something like this:
header('Content-Type: video/x-flv');
readfile("my_video.flv");
When tested, the FLVPlayback component simply won't accept the FLV served up to it in this way. It will load if targeted directly from Flash, so I know my actionscript works.
(I did find that the far less robust Video object - in conjunction with NetStream class - does load the FLV from my PHP script, but using this player creates a whole whack of other problems for me, including a usability issue due to an apparent inability to let me measure loading progress by comparing bytesLoaded to bytesTotal - again, seemingly the fault of the PHP script, since loading directly from the file system works properly.)
So here's the question: How can I get my PHP script to serve the FLV to my FLVPlayback-based player?
Whoever can help me solve this will have my eternal respect and admiration.
Thanks,
J