Solved

How to restrict video from playing on different sites?

Posted on 2014-03-12
3
186 Views
Last Modified: 2014-03-14
We are going to be using HTML5 video to be playing some members only content. The problem is, the Rackspace CDN allows videos to be played from anywhere on any website.

So, my thought is: there must be a way to use Javascript to prevent people from being able to scrape the content.

Obfuscation?
IP Address validation?

What's the best way to ensure that our videos are ONLY played on OUR sites?

PS. If need be, we could always host the videos on our own servers if an Apache directive would accomplish the task...
0
Comment
Question by:DrDamnit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39924576
Go to Adobe or Real Networks, they propose solutions doing this.
Not sure you can found a free Helix anymore : http://en.wikipedia.org/wiki/Helix_(multimedia_project)
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39924783
I have an article here that goes in a similar direction - it watermarks any image that is "hotlinked" from a foreign web site.  You might be able to use a similar design strategy.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_10065-Adding-a-Watermark-to-an-Image.html
0
 
LVL 32

Accepted Solution

by:
DrDamnit earned 0 total points
ID: 39930612
I figured it out. It was pretty simple really:

On the HTML side:
<!--DOCTYPE htmli-->
<html>
<head>
</head>
<body>
<video controls width="720" height="306">
  <source type="video/mp4" src="http://www.highpoweredhelp.com/videotest/videos/
</video>
</body>
</html>

Open in new window


Then, there is a PHP script that serves videos from videotest/videos/index.php.

Then I wrote a class called "coldlinker" that handles all the permissions, but the code is pretty easy: build logic that discovers if the link is from an allowed domain, and if it is, serve the correct video. If not, serve something else or a broken one.

if(isset($_SERVER['HTTP_REFERER']))
{
        if($cl->refererAllowed($_SERVER['HTTP_REFERER']))
        {
                $cl->logger->log("Referer allowed: " . $_SERVER['HTTP_REFERER']);
                $path = 'http://1fe0653317283bdcaf77-9b1608f07c89c6f698961f2c1f14233d.r49.cf1.rackcdn.com/goodvideo.mp4';
        } else {
                $cl->logger->log("Referer : DISALLOWED " . $_SERVER['HTTP_REFERER']);
                $path = 'http://1fe0653317283bdcaf77-9b1608f07c89c6f698961f2c1f14233d.r49.cf1.rackcdn.com/youareathief.mp4';
        }
} else {
        $cl->logger->log("No referer present.");
        $path = 'http://1fe0653317283bdcaf77-9b1608f07c89c6f698961f2c1f14233d.r49.cf1.rackcdn.com/goodvideo.mp4';
}
header("location: $path");

Open in new window


The logger class referenced is our open source logger class:
http://svn.highpoweredhelp.com/logger/logger.class.php
0

Featured Post

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Web Development 6 21
How do use '  ' within this code? 4 25
restriction of entering a a page 5 31
Boolean 13 19
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question