代码之家  ›  专栏  ›  技术社区  ›  collumbo

如何使用带有Flowplayer的RTMP从CloudFront运行私有内容视频

  •  3
  • collumbo  · 技术社区  · 15 年前

    复制步骤:

    1. 设置S3桶
    2. 设置流式分发
    3. 生成CloudFront密钥对
    4. 使用RSA私钥下载.pem文件
    5. 使用从RSA密钥生成XML 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并生成字符串。 url in the javascript looks like this:

    url:'flv:testSecure%3fExpires%3d1277469187%26Signature%3dE5OleaO26fwLi6jIKTa4inc8I4P86AgTg5x8SmleTSTyf5C5AfnQyqaFXLDjiF0kiqdplhauA8Kw%7eS37EpRBAn-aJrJScVlw7aZ-SAL24MTLMZ9foSkCd2ai9KjS8AuuweJRwPWmf4eLDpI4X4f3k3H7UUVcq8SX92ed5fCB91w_%26Key-Pair-Id%3dAPKAJUIBASIKTLFDSDFA'

    这失败了。视频就挂在那里……

    有人知道怎么做吗

    1. Generate a signed URL for a private video using C#?
    2. 在Flowplayer或JWplayer中播放视频(我将使用我能使用的任何一个!)

    还有几点-- 我使用与此相同的代码生成签名的URL: http://beckelman.net/post/2010/03/30/Policy-Signing-in-C-for-Streaming-Private-Content-From-Amazon-CloudFront.aspx

    如果你们能解决这个问题,我会为住在我100英里以内的人买一轮饮料。

    1 回复  |  直到 14 年前
        1
  •  5
  •   collumbo    15 年前

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

    1. 创建云源访问标识(我通过C完成了这项工作,但可以使用Cloudberry完成)
    2. 下载Cloudberry for S3-社区版
    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.

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