如何使用RTMP与Flowplayer从运行的Cloudfront私人内容的视频 [英] How to run a Private Content Video from Cloudfront using RTMP with Flowplayer
问题描述
重现步骤:
- 设置了S3存储
- 设置了流disrtibution
- 在生成CloudFront的密钥对
- 在与RSA私钥下载.PEM文件
- 生成使用 http://www.jensign.com/opensslkey/opensslkey RSA密钥的XML。 CS
- 在上传文件testUnsecure.flv,设置ACL属性,这样每个人都可以查看它。
-
建立一个网页有以下Java脚本:
变种p = flowplayer(rtmpPlayer {SRC:flowplayer-3.1.5.swf,高度:480px}, { 插件:{ RTMP:{ 网址:flowplayer.rtmp-3.1.3.swf, netConnectionUrl:RTMP://s3py83uop6xa8x.cloudfront.net/cfx/st, 的objectEncoding:'0' } }, 夹: { 将autoPlay:假的, 网址:'FLV:testUnsecure ,提供者:RTMP } });
-
这个作品!
那么这样做:
- 上传testSecure.flv,设置ACL,使之私人
- 生成签名的网址,并建立字符串。 URL中的JavaScript是这样的:
url:'flv:testSecure%3fExpires%3d1277469187%26Signature%3dE5OleaO26fwLi6jIKTa4inc8I4P86AgTg5x8SmleTSTyf5C5AfnQyqaFXLDjiF0kiqdplhauA8Kw%7eS37EpRBAn-aJrJScVlw7aZ-SAL24MTLMZ9foSkCd2ai9KjS8AuuweJRwPWmf4eLDpI4X4f3k3H7UUVcq8SX92ed5fCB91w_%26Key-Pair-Id%3dAPKAJUIBASIKTLFDSDFA'
这将失败。视频只是挂在那儿......
有谁知道如何
- 生成签名的网址使用C#的私人视频?
- 播放视频在任Flowplayer或JWPLayer(我将使用哪一个我可以得到它一起工作!)
这几个点 - 我用code等同于这个生成签名网址:<一href="http://beckelman.net/post/2010/03/30/Policy-Signing-in-C-for-Streaming-Private-Content-From-Amazon-CloudFront.aspx" rel="nofollow">http://beckelman.net/post/2010/03/30/Policy-Signing-in-C-for-Streaming-Private-Content-From-Amazon-CloudFront.aspx
我会买一个圆形的饮料供大家谁住百英里我内的,如果你们能解决这个问题。
右键 - 以防万一有人跌倒过这个和有同样的问题,这是我做过什么来解决这个问题:
- 创建一个云计算的起源访问身份(我这样做是通过C#,但可能与黄莓做了它)
- 下载云莓为S3 - 社区版
- 找到在云莓的分布(即流分布)的FLV文件,单击鼠标右键,并在属性请确保该原产地访问身份读取访问 - 这是关键位。
否则上述code其实是正确的。
Steps to reproduce:
- set up S3 bucket
- set up streaming disrtibution
- generate cloudfront key pair
- download .PEM file with RSA Private key
- generate XML from RSA key using http://www.jensign.com/opensslkey/opensslkey.cs
- upload file "testUnsecure.flv", set ACL properties so that everyone can view it.
Set up a webpage with following java script:
var p = flowplayer("rtmpPlayer", { src: "flowplayer-3.1.5.swf", height: "480px" }, { plugins: { rtmp: { url: 'flowplayer.rtmp-3.1.3.swf', netConnectionUrl: 'rtmp://s3py83uop6xa8x.cloudfront.net/cfx/st', objectEncoding: '0' } }, clip: { autoPlay: false, url: 'flv:testUnsecure' , provider: 'rtmp' } });
This works!
Then did this:
- Upload testSecure.flv, set ACL to make it private
- Generate Signed URL and build the string. url in the javascript looks like this:
url:'flv:testSecure%3fExpires%3d1277469187%26Signature%3dE5OleaO26fwLi6jIKTa4inc8I4P86AgTg5x8SmleTSTyf5C5AfnQyqaFXLDjiF0kiqdplhauA8Kw%7eS37EpRBAn-aJrJScVlw7aZ-SAL24MTLMZ9foSkCd2ai9KjS8AuuweJRwPWmf4eLDpI4X4f3k3H7UUVcq8SX92ed5fCB91w_%26Key-Pair-Id%3dAPKAJUIBASIKTLFDSDFA'
This fails. The video just hangs there....
Does anyone know how to
- Generate a signed URL for a private video using C#?
- Play the video in either Flowplayer or JWPLayer (i'll use whichever one I can get it to work with!)
A few more points -- I use code identical to this to generate the Signed URL: http://beckelman.net/post/2010/03/30/Policy-Signing-in-C-for-Streaming-Private-Content-From-Amazon-CloudFront.aspx
I will buy a round of drinks for everyone who lives within 100 miles of me if you guys can solve this.
Right - just in case anyone stumbles across this and has the same problem, this is what I did to fix it:
- Create a cloud origin access identity (I did this through C# but could have done it with cloudberry)
- Download cloudberry for S3 - the community edition
- Find the FLV file on the distribution in cloudberry (i.e. the streaming distribution), right click, and in the properties make sure that the origin access identity has Read access -- this was the key bit.
Otherwise the above code was actually correct.
这篇关于如何使用RTMP与Flowplayer从运行的Cloudfront私人内容的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!