In Amazon CloudFront, your content is organized as "
". A distribution is a link between an
Amazon S3 bucket
(the origin server) and a domain name (assigned by
), and it tells you what are the locations of the original versions of your files. You can use this new domain name in place of the standard Amazon S3 references. You can serve your streaming media content to the client through a special kind of distribution known as
To stream media files, you will need to provide two things to your users- Media Files and Media Players. Streaming distributions are designed specifically to serve streaming media files over RTMP (Real Time Message Protocol). You can use a
to serve the Media Player. Using Bucket Explorer, you can also create distribution with HTTPS support which delivers the content over an HTTPS connection.
How does it work?
Note: The Media Player bucket and the Streaming bucket can be the same bucket, or different ones.
Put your Media Player file in the Media Player bucket, and make the Media player file (not the bucket) publicly readable. Then create a public distribution for your client.
Put your streaming content in the streaming bucket, and make the content (not the bucket) publicly readable and create a streaming distribution for your media containing bucket.
Create a crossdomain.xml file and place it in the root of the bucket holding the streaming content (not the bucket holding the client, if it's a different bucket). Make the file publicly readable. CloudFront supplies a default file that allows all domains to access the media files in your streaming distribution. If you implement a more restrictive crossdomain.xml file, CloudFront ignores the default file.
Create URLs for your streaming content files.
Create Public Streaming Distribution:
Once you've stored your objects in your origin server (Amazon S3 Bucket),you need to create a distribution, which is a link between an Amazon S3 bucket (the origin server) and a domain name (which Amazon CloudFront automatically assigns) in order to make Amazon CloudFront recognize your objects. To stream content, you need to deliver two types of files to your end users: your streaming media files and the client that will play them.
You can create a new Public Streaming Distribution by sending Http POST Request to Amazon Cloudfront, in one of the two ways explained below:
Create Public Streaming Distribution using REST API- POST Streaming Distribution:
If you are a programmer, you can write your own code to create Public Streaming Distribution using POST Streaming Distribution REST API. In this documentation, we will talk about the REST APIs only, you can refer to SOAP APIs. You will need to write code to create a Create Public Streaming Distribution with the POST Streaming Distribution API.
Create Public Streaming Distribution using Bucket Explorer:
If you do not want to write code, you can easily create Public Streaming Distribution with Bucket Explorer using mouse clicks.
Create Public Streaming Distribution using REST API
To create a new public streaming distribution, you can do a POST on the 2013-05-12/streaming-distribution resource. The request body must include an XML document with a StreamingDistributionConfig element.
POST /2013-05-12/streaming-distribution HTTP/1.1
AWS authentication string
Other required headers
<?xml version="1.0" encoding="UTF-8"?>
unique description for this distribution
CloudFront domain name assigned to the distribution
number of CNAME aliases
comment about the distribution
<Enabled>true | false</Enabled>
Amazon S3 bucket for logs
prefix for log file names
number of trusted signers
AWS account that can create
maximum price class for the distribution
<Enabled>true | false</Enabled>
Create Public Streaming Distribution using Bucket Explorer
Follow the given steps to Create Public Streaming Distribution:
Run Bucket Explorer.
Select "Distribution" icon in Bucket table toolbar and choose
or right click on any bucket and select "
It will open a new wizard to create distribution. Select
and click on
To set configuration, you need to give the following information:
Select the bucket name from the drop down list.
Select distribution type as "STREAMING".
to lower the prices you pay to deliver content out of Amazon CloudFront.
To create disabled distribution, deselect the check box "Enable Distribution", By default it is enabled.
If you want to give comments for distribution, then write comment in the comment text field.
Add CNAME(s) to list box by clicking on "+" button and you can remove CNAME(s) by clicking on "-" button. You can give a maximum of upto 10 CNAME(s).
To enable logging, select the check box
Select the bucket where you want to create the distribution logs. You can also give the
After setting the entire values for Streaming Distribution click on "
" button. It will create Streaming distribution for the specific bucket.