Firstly, just wanted to feedback that this package is absolutely amazing! We have been using the Amazon provider and it works beautifully.
However, we encountered problem and thought it would be worth sharing in case anyone else has the same issue.
The problem was that the Universal Media picker could upload to Amazon S3 no problem, but the permissions on the uploaded files in S3 prevented the content from being publically viewable so the files would not show on the website using Cloudfront.
After some digging around in Amazon documentation we found that we needed a “Bucket Policy”, so the solution was to edit “Bucket Policy” on the bucket used by Cloudfront and use the following snippet (replacing {bucketName} with your own bucket name):
I'm planning updates to some of the providers this week, and the thing with public files is one of the changes as its been reported by others as well. Don't know how have missed it before :-S
If time allows it I will also try and add folder support, so its a little more like the AWS Console.
The only other thing that might be incorporated into a provider update (although I'm not sure how) was that we have two Cloudfront distributions on the same S3 bucket, one for standard download and one for RTMP streaming. We added a additional subdomain rtmp in front of the standard distribution CNAME and did some simple XLST string manipulation to get the correct URL for RTMP but it might be useful if it was possible to set an optional streamer CNAME in the data type so it can easily be output.
file for streamer: <xsl:value-of select="substring-after($movieURL,'/')"/>
We use JWPlayer which in it's newest version 5.5 natively supports Flash RTMP to HTML5 Download failover, so the best of all worlds in standard browsers and iOS devices when showing video from Amazon Cloudfront.
I'm not sure if I understand your request correct, but couldn't you achieve this by simply creating two datatypes, which both use the S3 provider but are configured to use a CNAME each - one for streaming and one for files. I imagine that you probably don't use the same property for serving up files and streaming content, but please correct me if im wrong.
So you use one property for files and another property for streaming - each with a S3 Provider as DataType.
Yes, we could use 2 Datatypes but that would mean the user would have to select the same file for both (not the end of the world). However with Amazon streaming the required output URL is also slightly different as it has the /cfx/st between the CNAME and the filename e.g. rtmp.cdn.yourdomain.tv/cfx/st/Video.mp4
In an ideal world, there might an option in the data type settings called something like "Addtional CNAME for Streaming", which allows the entry of the optional, secondary streaming distribution, then it would be possible to access XML like this? (you want that in the current provider for a steaming distribution anyway?)
Amazon S3 Permissions for Cloudfront
Firstly, just wanted to feedback that this package is absolutely amazing! We have been using the Amazon provider and it works beautifully.
However, we encountered problem and thought it would be worth sharing in case anyone else has the same issue.
The problem was that the Universal Media picker could upload to Amazon S3 no problem, but the permissions on the uploaded files in S3 prevented the content from being publically viewable so the files would not show on the website using Cloudfront.
After some digging around in Amazon documentation we found that we needed a “Bucket Policy”, so the solution was to edit “Bucket Policy” on the bucket used by Cloudfront and use the following snippet (replacing {bucketName} with your own bucket name):
{
"Version": "2008-10-17",
"Id": "271e7e33-e39f-474f-a554-6517c9565038",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::{bucketName}/*"
}
]
}
Hi Jeavon.
Thanks for sharing, I'm sure this could come in really usefull for others implementing the Amazon provider.
All the best
Matt
Hi Jeavon,
Thanks for sharing.
I'm planning updates to some of the providers this week, and the thing with public files is one of the changes as its been reported by others as well. Don't know how have missed it before :-S
If time allows it I will also try and add folder support, so its a little more like the AWS Console.
- Morten
Hi Matt & Morten,
The only other thing that might be incorporated into a provider update (although I'm not sure how) was that we have two Cloudfront distributions on the same S3 bucket, one for standard download and one for RTMP streaming. We added a additional subdomain rtmp in front of the standard distribution CNAME and did some simple XLST string manipulation to get the correct URL for RTMP but it might be useful if it was possible to set an optional streamer CNAME in the data type so it can easily be output.
This is the type of logic we used:
<xsl:variable name="movieURL" select="$currentPage/*[name()=$properyNameMacro]/value"/>
standard download file: http://<xsl:value-of select="$movieURL"/>
streamer: rtmp://rtmp.<xsl:value-of select="substring-before($movieURL,'/')"/>/cfx/st
file for streamer: <xsl:value-of select="substring-after($movieURL,'/')"/>
We use JWPlayer which in it's newest version 5.5 natively supports Flash RTMP to HTML5 Download failover, so the best of all worlds in standard browsers and iOS devices when showing video from Amazon Cloudfront.
LongTail have a good list of CDN's and their different streamer URL's at http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/17674/configuring-the-jw-player-for-your-cdn
Jeavon
Hi Jeavon,
I'm not sure if I understand your request correct, but couldn't you achieve this by simply creating two datatypes, which both use the S3 provider but are configured to use a CNAME each - one for streaming and one for files. I imagine that you probably don't use the same property for serving up files and streaming content, but please correct me if im wrong.
So you use one property for files and another property for streaming - each with a S3 Provider as DataType.
- Morten
Hi Morten,
Yes, we could use 2 Datatypes but that would mean the user would have to select the same file for both (not the end of the world). However with Amazon streaming the required output URL is also slightly different as it has the /cfx/st between the CNAME and the filename e.g. rtmp.cdn.yourdomain.tv/cfx/st/Video.mp4
In an ideal world, there might an option in the data type settings called something like "Addtional CNAME for Streaming", which allows the entry of the optional, secondary streaming distribution, then it would be possible to access XML like this? (you want that in the current provider for a steaming distribution anyway?)
<productMovie>
<value dataTypeId="1370">cdn.yourdomain.tv/Video.mp4</value>
<streamerUrl dataTypeId="1370">rtmp.cdn.yourdomain.tv/cfx/st</streamerUrl>
<mediaFileName dataTypeId="1370">Video.mp4</mediaFileName>
</productMovie>
Maybe this is not possible within the UMP?
What this allows using JWPlayer for example is for it to use the RTMP steaming media for Flash capable browsers and HTML5 download for iOS devices.
Below is an example of how this data would be used with JWPlayer 5.5:
<script type="text/javascript">
jwplayer('mediaplayer').setup({
'id': 'playerID',
'width': '480',
'height': '270',
'provider': 'rtmp',
'streamer': 'rtmp://rtmp.cdn.yourdomain.tv/cfx/st',
'file': 'Video.mp4',
'image': 'video.jpg',
'modes': [
{type: 'flash', src: 'player.swf'},
{
type: 'html5',
config: {
'file': 'http://cdn.yourdomain.tv/Video.mp4',
'provider': 'video'
}
},
{
type: 'download',
config: {
'file': 'http://cdn.yourdomain.tv/Video.mp4',
'provider': 'video'
}
}
]
});
</script>
Regards,
Jeavon
is working on a reply...