How do you hide the FLV file URL from the SWF player?

I want to hide the FLV file’s location, so that if you View Source you cannot see the URL of the Flash file and people cannot hotlink it.

Does anyone know a good way to do this?

Re: How do you hide the FLV file URL from the SWF player?

You can’t hide it unless you hardcode it into a player. Even then people can see the URL if they really want to.

Re: How do you hide the FLV file URL from the SWF player?

I know you can stop hotlinking via .htaccess, of course this doesn’t hide the URL, it only stops hotlinking.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?yourwebsite\.com [NC]
RewriteRule \.(wmv|flv)$ - [F,NC,L]

or you could try this too

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?yourwebsite\.com(/.*)?)?$ [NC]
RewriteRule .\.flv$ - [NC,F,L]

You can also do an action script to call a php file that will serve the flv URL to the player.

Re: How do you hide the FLV file URL from the SWF player?

You can’t stop hotlinking FLV. Flash Players don’t do HTTP requests. All you’re stopping is people downloading them through a browser window but it won’t stop people from using your files in players on their own sites.

Re: How do you hide the FLV file URL from the SWF player?

So tube owners get hotlinked and can’t do anything about it?

Re: How do you hide the FLV file URL from the SWF player?

Ummm… Flash players do do HTTP requests. Well, they do either an HTTP or RTSP request…

Re: How do you hide the FLV file URL from the SWF player?

yeah flash players do http requests, that’s how we have it set on gaytube. we also have a url secret thing in place so everytime it generates a random url for the file, thus making it extremely hard to download because on each load (be it from the player, copying and pasting into a browser window, etc) it changes everytime.

Re: How do you hide the FLV file URL from the SWF player?

Really? When I researched hot linking Flash files it seemed as there was no way to stop it. Good to know then!

Two different issues are going on here. Other than constantly changing the URL as Drew describes, hotlinking of any video file is difficult to prevent. The issue is that the video players often don’t send a referer which forces you to allow requests with no referer. The request is still an HTTP request though.

Re: How do you hide the FLV file URL from the SWF player?

Correct. And that is the problem with simple .htaccess files. The examples that Squirt gave I don’t think will work. Or if they do will act very strange, especially with wmv files. With some action scripting it gets interesting however. :slight_smile:

Re: How do you hide the FLV file URL from the SWF player?

Correct. Squirt’s .htaccess rules will prevent MANY legitimate users from seeing the videos. Here’s a modified version of mine. The first line is critical - it allows blank referrers.

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www\.rawtop\.com [NC]
RewriteRule \.(gif|jpe?g|png|swf|flv|m4v|wmv|mpe?g)$ /resources/logo.gif [L,NC]

Re: How do you hide the FLV file URL from the SWF player?

http://www.limelightnetworks.com/2009/07/media-vault/

Re: How do you hide the FLV file URL from the SWF player?

Ah ok, so I just got the HTTP / wording wrong? I’ve solved it at my end by using Wowza Streaming Server + Hard Coding half the URL into my players, i.e. hiding part of the URL. Still I expect it’s not stopping everyone. But at least Wowza does offer Hot Linking plugins.