Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I couldn't find any decent pay per view video solutions for low budget clients. So I'm considering using a membership extension with Joomla and hosting the video with amazon S3.

The only issue is that once someone has signed up to view or download the video if they have any web development experience they will be able to get the url of the video and freely publish it on the web.

How can this be prevented? It looks like it can be done using IAM User Temporary Credentials - AWS SDK for PHP but the client would prefer not to have to pay someone to spend hours writing custom php code to get this to work.

With Amazon s3 I could at least check the log files I guess to manually monitor the url but is there a way to track the url with Google Analytics? or is there a more elegant solution?

share|improve this question

3 Answers 3

up vote 0 down vote accepted

Amazon S3 can be configured to use "referrer check", in which case only the specified domain(s) can access the file. This can be done from within the AWS web console by adding a Bucket Policy. Details here https://forums.aws.amazon.com/thread.jspa?messageID=340757 . It is also explained in docs somewhere. Navigate to Policy of a bucket and look for help/guide. In case of Flash embedding and referrer issues, you can add CORS rules (new feature and allows flash to be embed video from s3 etc by making cross domain policies). It sounds complicated but is not. All of it can be done from AWS Console.

You can enable logging of S3 requests, but with the above there is no such of someone hotlinking your content. Note that they could still download and save videos and there is no way around it as it is done on the client side. But they can't steal your bandwidth.

For really tough content control: There is no way around this without coding and extensive setup. The solution involves using Cloudfront for Streaming and you have to setup your Streaming server. Cloudfront just takes the load off of your streaming server.

share|improve this answer

It seems there are two sides of your problem: first is access control (only registered users should be able to download your video), and second is access tracking (with Google Analytics).

I don't think there is a solution for both needs. I think you will have to get some programming for access control first. One possible solution would be to use a S3-feature called "expiring URLs" that only allow access for a limited time:

http://www.ioncannon.net/programming/21/creating-s3-urls-that-expire-using-php/

When you are using the official Amazon AWS PHP SDK, this will probably be the method you are looking for:

http://docs.amazonwebservices.com/AWSSDKforPHP/latest/index.html#m=AmazonS3/get_object_url

In Analytics, you can set up event tracking and add custom events on your download links, for example:

<a href="#" onclick="_gaq.push(['_trackEvent', 'MySite', 'Video', 'Download']);"

The documentation for this feature is available here: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

share|improve this answer
    
Thanks for your answers they are very helpful, there are plenty of access control extensions for Joomla so that is not a problem. The Analytics event tracking looks like it would definitely be useful though. –  morktron May 16 '12 at 23:02

I Tweeted this question and thankfully Renegade Empire posted a link to a solution -

http://www.labnol.org/internet/prevent-image-hotlinking-in-amazon-s3/13156/

It's a clever and elegant bit of trickery :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.