Preventing Downloading of Source Video in Rails
Posted August 20th, 2009 @ 05:05pm by Erik J. Barzeski
Question for the Rails developers out there…
Suppose you have a video file (a .mov or .mp4 or .m4v or whatever) and you're going to use JWPlayer or another flash-based application to "play" the video on a user's browser, but you want to obfuscate and hide the actual location of the video so that the user cannot download the source video.
How would you go about doing this in a simple way that's relatively safe?
In PHP, I'd create a "middle man" script that first verifies that the movie is being used in a proper web page (perhaps with an encrypted password if you wanted to keep things simple) and then would pass through the data from the movie file to the flash application. The movie filename and path would never be revealed and attempts to access the "middle man" script directly wouldn't work as the secret password wouldn't within the variable namespace.
If you could, please speak in very general terms as I'm not a Rails developer. Thanks.
Posted 24 Aug 2009 at 5:36pm #
You could do something similar with Rails by having the player request a URL say:
http://www.mycoolvideosite.com/video?refid=123123123123
or whatever and "video" could be mapped to a Rails controller. That controller can then perform the logic you described for your PHP page.
Shouldn't be too hard I wouldn't think. I did something similar to stream out PDFs.
Posted 25 Aug 2009 at 1:45am #
No.
If you can watch it, you can download it, period.
Posted 25 Aug 2009 at 11:37pm #
I wouldn't handle this in Rails, I'd handle it in your Flash player using something like Wowza.