Get flv file from PHP for inline swf control

I would like to: get an FLV file from a protected directory and pass it to the built-in SWF player as a parameter using PHP.

Is it possible?

Sending file content to the built-in player does not work.

0


a source to share


3 answers


Well, since the player requires the client to fetch both the player and the FLV from the server, I suspect this would require a temporary location from which the FLV is made available to the user via a URL. The most obvious solution is to create an expiring URL that expires after a reasonable amount of time, preventing users from communicating directly with the FLV. I'm not sure if there is a way to protect it from this without having a flash built into the file dynamically - basically, you cannot use a general purpose player that takes a URL for FLV as a parameter if additional protection is needed.

Edit: Here is a potential solution using JW player: Code URL in V4 to protect against leechers



And here is another possible solution as per my original comment: Flashcomguru.com: "Stream" flv video via PHP, take two

+1


a source


Flashcomguru's link looks promising, but I don't know what I understand. I'm not a flash guy, but I know someone who can help.



I am also not sure how to create "create expiring url"

0


a source


Not sure what you mean, "feed it to the embedded SWF player as a parameter using PHP", but looks like what you want:

  • Save the flv file somewhere outside the DocumentRoot on your server.
  • Create a PHP script that reads an FLV file based on some parameter and serves it. I assume you are planning to have some authentication in this PHP script so that nobody can just call your PHP script and get the flv as if it were in the DocumentRoot
  • Create a swf clip that will call a PHP script to get the flv for the client.

If that's what you want, the script part in 2 that reads and serves flv should be pretty straight forward, using the standard file access functions from the PHP API and setting the appropriate content-type header before echoing this.

0


a source







All Articles