Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

How to Hide the mp4 file

4 replies [Last post]

Dear all, I am new to the forum. I have some videos that I don't like to expose the true media url. Can you please give me some suggestions on how to build a php file that can handle this problem?

For example: if the real file is: http://mydomain.com/media/123.mp4, and I would like to use something like: http://mydomain.com/media.php?file=123.mp4 that will be identical to the original mp4 file and can be used by player. But I couldn't figure out how to write the media.php file. I searched the forum, and all talks are about flv files.

Thanks in advance!

<?php

// get-file.php
//         call with: http://www.mydomain.com/path/get-file.php?mid=1
// player calls with: 'file': encodeURIComponent('http://www.mydomain.com/path/get-file.php?mid=1'),

$mid = (isset($_GET['mid'])) ? intval($_GET['mid']) : '1';

$url[1] = 'http://www.mydomain.com/path/video1.mp4';
$url[2] = 'http://www.mydomain.com/path/video2.mp4';
$url[3] = 'http://www.mydomain.com/path/video3.mp4';
$url[4] = 'http://www.mydomain.com/path/video3.mp4';
$url[5] = 'http://www.mydomain.com/path/video3.mp4';
$url[6] = 'http://www.mydomain.com/path/video3.mp4';

header("Location: " . $url[$mid[0]]);
exit;

?>

Thanks lefTy,

Actually I've tried to use the header( "Location:") before, but the problem is still there.

If people put http://www.mydomain.com/path/get-file.php?mid=1 in browser's address bar, they will be able to see http://www.mydomain.com/path/video1.mp4 directly.

Any ideas how to handle that?

You can't ever hide the true URI because the player still has to download the file to play it.

So anyone can just use an addon like Live HTTP Headers or one of the many downloaders like Orbit to see the true URI and get the file.

If you are dealing with the common user, the script is enough, if you are dealing with a knowledgeable person, nothing can stop them. You will have to implement an authentication system in the JW FLV Media Player (it has a token system built in) to slow them down a bit.

See: http://www.longtailvideo.com/support/forum/General-Chat/14634/Adding-Custom-Security

And search for "token" and look at the flashvars and the API in the Wiki. (Linked from Support in the menu bar at the top of the page.)

I made a script for this
http://ubo-network.com/ubodevs/antihotlink/
thats the demo.
it makes a embed that doesnt give the url of the file..
(can still be found if use page cache, but just make the video not use cache!)