Embedded Video on my web site?

gibbons

En-Route
Joined
Feb 12, 2005
Messages
3,385
Location
Rogers, Arkansas
Display Name

Display name:
iRide
I want to host videos on my web site that can be viewed using the most popular browsers, but I don't want anyone to be able to download the videos or even see where they are located.

I can make this work with IE using embedded media player and a redirect, but it doesn't work with FireFox and probably doesn't work with Safari either.

In essence, I want to do what YouTube has done but on my own site. In fact, is it possible to upload a video to youtube and protect it somehow so it can only be viewed by the embedded viewer in a web page?
 
If you're using Apache...

You could convert the videos to Flash format, host the files on your server, and restrict access by placing the following in the .htaccess file in the directory where the files are stored:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]

Then just embed the Flash movie on your pages.

This isn't perfect: using HTTP_REFERER and .htaccess to restrict access to a file is not bulletproof. Nor will this prevent someone who really wants to from stealing the FLV file. But then again, nothing, to my knowledge, can absolutely prevent an FLV file from being stolen. If it can be viewed, it can be stolen. But it will at least prevent casual hotlinking; and Flash is about as cross-browser compatible as it gets.

Rich

EDIT: Sorry... forgot the RewriteRule.. duh...

Should be something like this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule \.(flv|swf)$ - [F]

EDIT EDIT

Or if you want to redirect hotlinkers to a particular page or image...
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule \.(swf|flv)$ http://www.yourdomain.com/nolink.jpg [R,L]

where nolink.jpg is an image that says "No Hotlinking" or something like that. I sometimes use this one...
 

Attachments

  • nolink.jpg
    nolink.jpg
    13.9 KB · Views: 19
Last edited:
A lot of people have similar questions about their photos.

You can NOT stop someone from downloading the video.... or any picture.. period.

You can make it a pain-in-the-ass for them, but you can't stop them. My advice is to not waste effort in trying to do so and just watermark your video.
 
While we're asking...does anybody know of a good cheap/FOSS way to convert video (.avi, etc.) to FLV and a player to play them?
 
There are scads of them....

http://flowplayer.org/
http://megafonts.free.fr/flv/index2.html
http://www.download.com/FLV-Player/3000-2139_4-10467081.html

Check Sourceforge. There are probably a dozen or more. Most use FFMPEG.

Rich

You are making me consider ditching all the Youtube code I've written. I tested some videos (quicktime, wmv, etc) with ffmpeg and they converted to flv without problem. Flowplayer worked nicely. Time to step back and decide which direction I want to go.
 
You are making me consider ditching all the Youtube code I've written. I tested some videos (quicktime, wmv, etc) with ffmpeg and they converted to flv without problem. Flowplayer worked nicely. Time to step back and decide which direction I want to go.

This may be the ticket for me too. Thanks.
 
If you use Youtube, why would you worry about the vids being copied? The quality is (usually) so wretched anyway, it is not worth copying.
 
You are making me consider ditching all the Youtube code I've written. I tested some videos (quicktime, wmv, etc) with ffmpeg and they converted to flv without problem. Flowplayer worked nicely. Time to step back and decide which direction I want to go.

It's a nice player, for sure. Lotsa good stuff out there.

Rich
 
Great.. Here I was completely content (for the moment) with simply using YouTube plugs on my site. Now you've all got me thinking of actually doing things 'correctly'. I'll tell my wife to forward her complaints about her geeky husband to you guys. ;)
 
Great.. Here I was completely content (for the moment) with simply using YouTube plugs on my site. Now you've all got me thinking of actually doing things 'correctly'. I'll tell my wife to forward her complaints about her geeky husband to you guys. ;)

Or she can call my wife and they can start a support group. :D
 
After getting the GoogleMaps API working on my site, I thought I would get to work on changing my video setup (currently embedding YouTube). I wanted to use ffmpeg, but my host doesn't provide it due to high resource usage. OK.

Is there a consensus #2 choice for converting .mpg to .flv?
 
Actually, there is ffmpeg for Windows,too. You could just convert locally and upload, although you'll also have to embed the player (not very hard).

Or you can put up a gallery site, like Gallery 2, on a host that does have ffmpeg installed.

Or you can just send me the files and I'll convert them and send them back to you.

Rich
 
Actually, there is ffmpeg for Windows,too. You could just convert locally and upload, although you'll also have to embed the player (not very hard).

Or you can put up a gallery site, like Gallery 2, on a host that does have ffmpeg installed.

Or you can just send me the files and I'll convert them and send them back to you.

Rich

Ahh.. I'll try to get the 'local' version of ffmpeg running. I assumed it needed to be on Unix/Linux. I appreciate the offer, but I'd like to find something that I can tinker with off-and-on and not have to bother anybody else. :)
 
Back
Top