Solved

How to restrict video from playing on different sites?

Posted on 2014-03-12
3
188 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

707 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