Your Secure Stream: S3 and Cloudfront
This guide will explain how to apply and use CloudFront with Your Members Your Secure Stream.
Currently YM supports JWplayer and Flowplayer thru the additional install of two free plugins.
We also support the creation of a custom player so you can create your own embed code for your video files.
Note: Flowplayer does not support CloudFront streaming distributions for non FLV files.
First you need to install and activate Your Secure Stream.
This will then direct you to the settings page. Where you will need to input your Amazon Access Keys.
If you haven’t already you will need to have signed up for both Amazon S3 and Cloudfront, if you wish to use both. YSS will work perfectly well with only S3.
Access Keys
All the access keys that are needed can be created/found on the Amazon Web Services page.
First you will need your user key and secret key. You can either use and existing set, or generate a new one.

If you only want to use Amazon S3, that is all you need to do.
If you wish to use CloudFront, read on.
CloudFront
CloudFront comes in two forms.
A Download Distribution, which is somewhat equivalent to Amazon S3, but improves on performance, scalability and reliability.
A Streaming Distribution, which thru the use of a Flash Media Server, allows the creation of a player and user flow/access similar to YouTube. With the ability to skip forward/backward. And only stream/download the viewed components, saving money in the long run.
Individual files in YSS can be made available on different distribution types as you see fit.
YSS will look for the highest/quickest/cheapest method and fall back as needed. So Streaming Distribution, then download and finally S3.
But first access keys. Setting up file access is somewhat more complicated than Amazon S3, as there are parts that can only be done with calls to the Amazon API. YSS will handle this all for you.
The first thing that needs to be done, is the generation of a CloudFront Key Pair.
When you create a new Key Pair. Amazon will automatically download to you the Private Key Pair. This is the only time you will be able to get your Private Key, if you do not download and keep the file in a safe place you will need to create a new Key
Which is a .pem file. You will need to open this in a standard text editor (Notepad or TextEdit for example) and copy and paste its contents into the Key Pair Private Key area. Make sure you do a CTRL+A/Apple+A.
The Key Pair ID, will need to go in the box above that.
We don’t use the Public Key, so you won’t need to download that.

Once you have inserted all these keys. You can hit save. Its probably best to do this before activating/installing Player Plugins.
Then you can install/activate/select your player and whether or not you wish to use a custom player.
Content
In order to make content available to the end user thru YM YSS, you need to add it, in much the same way as the YM Download manager. But you will need to use the Amazon Web Services manager to upload your files to S3.

In additional you will need to upload a CrossDomain.xml file, you can find a sample file here, this needs to go into the root of your bucket, and is only needed for Download Distribution and S3, additionally, it should be made Public. (Right click the file in AWS Manager and select make public.
Then you can use YSS to expose the files to CloudFront. Having uploaded your files, you can then add them to YSS. First trip is to the Content Tab.
And add a new Video, this will automatically connect to Amazon S3 and find all the files in your Bucket.
You need to make sure that Bucket names are all in lower case and files names do not contain spaces, use a hyphen (-) or underscore (_) instead. Additionally the standard JWplayer and Flowplayer cannot handle WMV. Ideally use MP4/Mov/H.264 for full cross browser/HTML5/device coverage. As the players should be capable of making content available correctly for the device trying to access it.
Once you have added the video you are given its ID, which is the ID number you use for the yss_player shortcode ( for example).
Once you have added a file in this way it is available as a S3 File.
Under the distribution column you can choose to make the file available to a Download or Streaming Distribution. First you will need to have created one or both of these.
So to the CloudFront tab.
CloudFront Distributions
In tandem with the Access Key we created earlier, Amazon CloudFront works with a Origin Access Identity to secure Amazon S3 content with CloudFront content, allowing the creation of Time Restricted URL’s.
YSS can do everything it needs for a Protected Download and Protected Streaming distribution. (Even if you only want to use a streaming distribution, its generally a good idea to have both, Amazon will only make content appear on these after the first request for a item).
So for one click creation under New Distribution,

select Both for the Distribution Type,
select create new Origin Access Identity,
and in most cases there will only be one bucket so select that from the Amazon S3 Bucket to deploy.
Then click Create Distribution(s). YM YSS will then go off and create the distributions and secure them using the Keys and Origin Access Identity.
The top area will then list both Distributions and should indicate they are in process. Amazon takes about 15 minutes to setup/modify Deployments.
Should look something like this (after deployments have finished):

Now back to the Content tab.
Each file has a distribution column, you can select the DL: No or S: No and choose the distribution to make the file available on. DL being short for Download and S being short for Streaming.
As mentioned earlier YM YSS will attempt to use a Streaming Distribution first, then Download and Finally S3. In the end the choice is up to you.