如何使用 RTMP 和 Flowplayer 从 Cloudfront 运行私有内容视频
重现步骤:
- 设置 S3 存储桶
- 设置流分发
- 生成 cloudfront 密钥对
- 下载带有 RSA 私钥的 .PEM 文件
- 使用 http://www.jensign.com/opensslkey/opensslkey.cs
- 上传文件“testUnsecure.flv”,设置ACL属性,以便每个人都可以查看。
使用以下 java 脚本设置网页:
var p = flowplayer("rtmpPlayer", { src: "flowplayer-3.1.5.swf", 高度: "480px" }, { 插件:{ rtmp:{ url: 'flowplayer.rtmp-3.1.3.swf', netConnectionUrl: 'rtmp://s3py83uop6xa8x.cloudfront.net/cfx/st', 对象编码:'0' } }, 夹子: { 自动播放:假, url: 'flv:testUnsecure' ,提供者:'rtmp' } });
这有效!
然后执行以下操作:
- 上传 testSecure.flv,设置 ACL 以使其私有
- 生成签名 URL 并构建字符串。 javascript 中的 url 如下所示:
url:'flv:testSecure%3fExpires%3d1277469187%26Signature%3dE5OleaO26fwLi6jIKTa4inc8I4P86AgTg5x8SmleTSTyf5C5AfnQyqaFXLDjiF0kiqdplhauA8Kw%7eS37EpRBAN-aJrJScVlw7aZ- SAL24MTLMZ9foSkCd2ai9KjS8AuuweJRwPWmf4eLDpI4X4f3k3H7UUVcq8SX92ed5fCB91w_%26密钥对 ID%3dAPKAJUIBASIKTLFDSDFA'
此失败。视频就挂在那里......
有谁知道如何
- 使用 C# 为私人视频生成签名 URL?
- 在 Flowplayer 或 JWPLayer 中播放视频(我将使用我可以使用的任何一个!)
还有几点 - 我使用与此相同的代码来生成签名 URL: http://beckelman.net/post/2010/03/30/Policy-Signing-in-C-for-Streaming-Private-Content-From-Amazon- CloudFront.aspx
如果你们能解决这个问题,我将为住在我 100 英里范围内的每个人买一杯饮料。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的 - 以防万一有人偶然发现这个问题并遇到同样的问题,这就是我修复它的方法:
否则上面的代码实际上是正确的。
Right - just in case anyone stumbles across this and has the same problem, this is what I did to fix it:
Otherwise the above code was actually correct.