本文介绍了如何使用RTMP与Flowplayer从运行的Cloudfront私人内容的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重现步骤:

  1. 设置了S3存储
  2. 设置了流disrtibution
  3. 在生成CloudFront的密钥对
  4. 在与RSA私钥下载.PEM文件
  5. 生成使用 http://www.jensign.com/opensslkey/opensslkey RSA密钥的XML。 CS
  6. 在上传文件testUnsecure.flv,设置ACL属性,这样每个人都可以查看它。
  7. 建立一个网页有以下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}});

  8. 这个作品!

那么这样做:

  1. 上传testSecure.flv,设置ACL,使之私人
  2. 生成签名的网址,并建立字符串。URL中的JavaScript是这样的:

这将失败。视频只是挂在那儿......

有谁知道如何

  1. 生成签名的网址使用C#的私人视频?
  2. 播放视频在任Flowplayer或JWPLayer(我将使用哪一个我可以得到它一起工作!)

这几个点 - 我用code等同于这个生成签名网址:http://beckelman.net/post/2010/03/30/Policy-Signing-in-C-for-Streaming-Private-Content-From-Amazon-CloudFront.aspx

我会买一个圆形的饮料供大家谁住百英里我内的,如果你们能解决这个问题。

解决方案

右键 - 以防万一有人跌倒过这个和有同样的问题,这是我做过什么来解决这个问题:

  1. 创建一个云计算的起源访问身份(我这样做是通过C#,但可能与黄莓做了它)
  2. 下载云莓为S3 - 社区版
  3. 找到在云莓的分布(即流分布)的FLV文件,单击鼠标右键,并在属性请确保该原产地访问身份读取访问 - 这是关键位。

否则上述code其实是正确的。

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:

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.

解决方案

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.

这篇关于如何使用RTMP与Flowplayer从运行的Cloudfront私人内容的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 13:31