Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

3.5 setting up Cloudfront

bbbo edited this page Apr 26, 2014 · 2 revisions

[not complete yet]

You need two Cloudfront distributions, a web and a streaming distribution. html5 video is always delivered as http download, it does not understand the streaming protocols known from Flash and VLC like rtmp, rtsp, Adobe HDS). On the other hand Flash cannot deal with seeking when using progressive http download (to utilize byte-range requests it needs addons for pseduostreaming on the server and client side)

So start with http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GettingStarted.html and then continue with the next chapters (Working with web/streaming distributions). You can assign a CNAME to the download distribution and integrate in your DNS.

For example: all videos on flowplayer.org are at stream.flowplayer.org which is a CNAME pointing to d3htxg1fw9tzfr.cloudfront.net , which ins turn is the download distribution for the S3 bucket flowplayer-video.s3.amazonaws.com . The streaming distribution s3b78u0kbtx79q.cloudfront.net points to the same S3 bucket, but delivers the MP4 videos (you cannot stream webm or ogv with rtmp) via the rtmp protocol for older browsers. For an example setup, please check the source of http://demos.flowplayer.org/basics/rtmp.html . Here we use the CNAME streamflowplayer.org but you can replace this with your download distribution urls.

The rtmp example is important because unless you plan to add webm versions right away, you need rtmp to enable seeking in the timeline for non-Windows Firefox, Safari without Quicktime and the IE versions which ship without html5 video codecs (see http://goo.gl/RykV05 for background info). And you'll aways need it in older browsers like IE8.

Additional tutorials can for example be found here:

http://www.hongkiat.com/blog/amazon-cloudfront-how-to-setup-cloudfront-to-work-with-s3/ https://www.youtube.com/watch?v=_oTj_3o1ceE

Clone this wiki locally