如何使用 RTMP 和 Flowplayer 从 Cloudfront 运行私有内容视频

发布于 2024-09-07 09:01:32 字数 1578 浏览 3 评论 0原文

重现步骤:

  1. 设置 S3 存储桶
  2. 设置流分发
  3. 生成 cloudfront 密钥对
  4. 下载带有 RSA 私钥的 .PEM 文件
  5. 使用 http://www.jensign.com/opensslkey/opensslkey.cs
  6. 上传文件“testUnsecure.flv”,设置ACL属性,以便每个人都可以查看。
  7. 使用以下 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' } });

  8. 这有效!

然后执行以下操作:

  1. 上传 testSecure.flv,设置 ACL 以使其私有
  2. 生成签名 URL 并构建字符串。 javascript 中的 url 如下所示:

url:'flv:testSecure%3fExpires%3d1277469187%26Signature%3dE5OleaO26fwLi6jIKTa4inc8I4P86AgTg5x8SmleTSTyf5C5AfnQyqaFXLDjiF0kiqdplhauA8Kw%7eS37EpRBAN-aJrJScVlw7aZ- SAL24MTLMZ9foSkCd2ai9KjS8AuuweJRwPWmf4eLDpI4X4f3k3H7UUVcq8SX92ed5fCB91w_%26密钥对 ID%3dAPKAJUIBASIKTLFDSDFA'

此失败。视频就挂在那里......

有谁知道如何

  1. 使用 C# 为私人视频生成签名 URL?
  2. 在 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:

  1. set up S3 bucket
  2. set up streaming disrtibution
  3. generate cloudfront key pair
  4. download .PEM file with RSA Private key
  5. generate XML from RSA key using http://www.jensign.com/opensslkey/opensslkey.cs
  6. upload file "testUnsecure.flv", set ACL properties so that everyone can view it.
  7. 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'
    }
    });

  8. This works!

Then did this:

  1. Upload testSecure.flv, set ACL to make it private
  2. 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

  1. Generate a signed URL for a private video using C#?
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

送你一个梦 2024-09-14 09:01:32

是的 - 以防万一有人偶然发现这个问题并遇到同样的问题,这就是我修复它的方法:

  1. 创建云源访问身份(我通过 C# 完成此操作,但可以使用 cloudberry 完成)
  2. 下载适用于 S3 的 cloudberry - the社区版
  3. 在cloudberry 的发行版(即流媒体发行版)上找到FLV 文件,右键单击,并在属性中确保源访问身份具有读取访问权限——这是关键位。

否则上面的代码实际上是正确的。

Right - just in case anyone stumbles across this and has the same problem, this is what I did to fix it:

  1. Create a cloud origin access identity (I did this through C# but could have done it with cloudberry)
  2. Download cloudberry for S3 - the community edition
  3. 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文