Welcome to WebmasterWorld Guest from 54.198.100.141

Forum Moderators: phranque

Message Too Old, No Replies

Stream FLV files using Php

     
4:19 pm on Jun 7, 2008 (gmt 0)

Full Member

10+ Year Member

joined:May 4, 2005
posts:306
votes: 0



Do you know of a code that uses a PHP code to load the FLV file for the swf flash player? I mean, something like this;

<div class="player">
<script>
var VideoID = '1';
var Width = 664;
var Height = 462;
var Background = "#ffffff";
</script>
<script src="http://www.mydomain.com/interface.php" language="javascript"></script></div>

where einterface.php processes the flv files.

This is important because it can protect your flv files from unauthorized download.

5:06 pm on June 9, 2008 (gmt 0)

Full Member

5+ Year Member

joined:July 13, 2007
posts:235
votes: 0


Your best bet is probably something like the following:

<?php
include( 'security.php' );

if ( user_is_authorized() )
{
echo file_get_contents( "my_flv_file.flv" );
die();
}
else
{
die();
}

?>

Obviously, your security functions will be named and processed differently, so you'll have to replace the include at the top and the user_is_authorized() function with your own security implementations.

5:29 pm on June 9, 2008 (gmt 0)

Full Member from US 

10+ Year Member

joined:Jan 25, 2005
posts: 222
votes: 0


Great Tip Thx