views:

2125

answers:

5

I need help finding resources that would help me or at least point me in the right direction in building a Flash media server/PHP application. I basically want to improve my current application by instead of progressive download using flash media server so that the videos will not only stream well but they can't be downloaded by the end user.

What the current application does is show a login form on the homepage and then when logged in the user can then navigate the site by choosing videos from a particular video category or video uploaded by a specific user. All this is done with PHP. The video page uses progressive download to display the video after the video ID has been passed using PHP.

I need to know how PHP and flash media server work together. Are there any resources out there where I can find a good application example (really simple) that demonstrates how PHP and flash media server can be used to stream videos dynamically such that PHP checks for the login, video ID, video channels, and video category information while the flash media server streams the video.

+1  A: 

You may want to try Red5 instead of Flash Media Server. I've use Flash Media Server in the past and it can be a pain to take care of. With Red5 you at least have more flexibility and it is free. If you go down the Red5 path you will find more people customizing it like this one time ticket for Red5 post. I believe that is very close to what you are looking for.

carson
+1  A: 

The biggest problem with PHP and Flash (mediaserver) is the different "flow" of code. PHP is straightforward:

Start request, do something, send response. Done.

Flashmedia only loads (compiles) your code when a client connects, and then only events are triggered. Most operations do not return, but need a callback.

Load application.. wait for something.. Event launched: do something, fire off another request together with a response handler object.. etc.

I have build an extensive chatservice with FlashMedia server and PHP as front and back-end.

The front-end is simple: just plain PHP/HTML-pages which will eventually create an <OBJECT>-tag loading some Flash applet. That flash applet should connect to the Flash media server using information/credentials passed to it with the FlashVars-option or loaded (generated) XML-data from a separate URL.

From that point, the Flash applet (client) does it's thing with the Flashmedia server. For this example, you want to verify credentials from the Mediaserver. You should use the AMFPHP framework for that.

AMFPHP is a replacement for Macromedia's "Flash Remoting" system where Flash [applets/servlets] can do asynchronious communications over HTTP.

For the AMFPHP-framework you write an interface class wrapping your credential-validation code. There is a test-page which validated the response of your wrapper.

(The AMFPHP Framework can also generate AS2 sample code so you have an idea how the Flashmedia server should send an request and handle responses.)

  • A warning: AMFPHP uses POSTs to send and retrieve data. In the past, there were problems when more than 2k of data was truncated. I now only use it for relative short messages.
  • AMFPHP is very reliable. You can use it to do external logging for example.
Wimmer
+1  A: 

Really, PHP and FMS shouldn't be talking at all. It can be done within FMS, but a much easier approach is to let your Flash Player (which you'll have to have anyway) do the talking to FMS. Flash to FMS communication is well documented and very easy. Just have the PHP call forth a Flash video player with whatever info you need. It would probably be eaiser to have PHP authenticate and give the Flash some sort of authentication token if you're really worried about security.

Just so you know though, just because your media is streaming doesn't mean someone can't download it. There's several tools to rip streamed media out there. It is of course more secure, but it's not full-proof.

UltimateBrent
A: 

Using flash media server so that the videos will not only stream well but they can't be downloaded by the end user

This won't really work. It make make it "harder" for some people in the same way that not putting a big, huge "download here" button makes it "harder", but the content is still being downloaded to their computer, just in a different way. Anything that's downloaded can be saved to the disk.

singpolyma
A: 

I am doing similar thing. First, for authentication, you can use FMS's authentication plug-in. Of course, you can make your own stuff in PHP. Instead of adding PHP into FMS's original Apache, I decided to run XAMPP in parallel, with different port of course.

To start and stop the encoder, you can make use of FMLEcmd command.

My environment:

  1. Flash Media Development Server 3.5
  2. Flash Media Live Encoder 3.1
  3. XAMPP (at port 8080)
Shivan Raptor