亚马逊S3标识的URL不工作flowplayer亚马逊、标识、工作、flowplayer

2023-09-11 09:37:20 作者:我是妳無奈的選擇﹌

我到处找,但找不到答案。我使用flowplayer和Amazon S3的使用PHP。链接在浏览器中工作,如果我复制和粘贴,但似乎flowplayer不喜欢的查询字符串。我试图取代HTML实体然后URL编码它。我只是想URL编码它。我只是试图消除和放大器;并与功放代替;等所有这些工作。

I've searched everywhere but cannot find an answer. I am using flowplayer and amazon s3 with PHP. The link works in the browser if I copy and paste but it appears flowplayer doesn't like query strings. I tried replacing the html entities then url encoding it. I just tried url encoding it. I just tried removing the & and replace with & etc. None of these worked.

我的目标是从亚马逊打一个url签署的视频S3采用流球员。

My goal is to play a url signed video from amazon s3 using flow player.

我知道我没有code显示,因为它没有一个是正确的,但没有任何人有什么建议吗?他们将是非常美联社preciated。

I know I have no code to display because none of it is 'right' but does anybody have any suggestions? They would be much appreciated.

推荐答案

我有同样的问题,并通过读取ActionScript源$ C ​​$ C为Flowplayer cloudfrontsignedurl插件发现了答案:

I had this same problem, and discovered the answer by reading the ActionScript source code for the Flowplayer cloudfrontsignedurl plugin:

的http://flash.flowplayer.org/documentation/developer/development-environment.html

private function _getUrl(clip:Clip):String {

    var url:String = clip.getPreviousResolvedUrl(this);

    var isRTMPStream:Boolean = url.toLowerCase().indexOf('mp4:') == 0;
    if ( isRTMPStream )
        //gets the url, minus the "mp4:" at the beginning
        url = url.substr(4);

    //gets the expires time in seconds
    var expires:Number = Math.round((new Date()).getTime() / 1000 + _config.timeToLive);

    //generate the signed url
    var signedUrl:String = _signedUrlGenerator.signUrl(url, expires);

        //put the 'mp4:' back on the front
    if ( isRTMPStream )
        signedUrl = 'mp4:'+ signedUrl;

    return signedUrl;

}

注意它是如何消除了MP4:preFIX签订的URL,然后,然后将其重新打开之后。

Notice how it removes the "mp4:" prefix before signing the url, then adds it back on afterward.

我跟亚马逊的例子,此处的http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreateURL_PHP.html

I followed Amazon's example, here: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreateURL_PHP.html

然后我的JavaScript配置的相关部分是这样的:

Then the relevant parts of my JavaScript config look like this:

var netConnectionUrl = "rtmpte://amazon_distribution_domain_name.cloudfront.net/cfx/st";
var clipUrl          = "folder/folder/videofile.mp4";

$.post('/path/getSignedUrl.php', {clipUrl:clipUrl}, function(signedUrl){
  clipUrl = 'mp4:'+signedUrl;

  ...then add netConnectionUrl and clipUrl to Flowplayer config...
});

我preferred使用,而不是Flowplayer插件PHP,这样我也可以检查,以确保用户已登录并拥有该产品,等,签署URL之前,且能够做我的域名和IP地址的检查与PHP也无需大惊小怪周围使用Ant或Flash Builder中进行编译。而这样的私钥保持关闭客户端。使用该插件将意味着盗版者可能偷窃的SWF文件,但通过使用AJAX和签署的网址在服务器上,意味着它是不可能被窃取。

I preferred to use PHP instead of the Flowplayer plugin so that I could also check to make sure the user is logged in and owns the product, etc., before signing the URL, and was able to do my domain and IP address checks with PHP also without needing to fuss around with compiling with Ant or Flash Builder. And this way the private key stays off of the client. Using the plugin would mean that pirates could possibly steal the SWF file, but by using AJAX and signing the url on the server, means it's impossible to steal.