如何指定跨域策略文件以允许 Flash 从 RTMP (Wowza) 视频流中抓取位图? [英] How do I specify a crossdomain policy file to allow Flash to grab a bitmap from an RTMP (Wowza) video stream?

查看:94
本文介绍了如何指定跨域策略文件以允许 Flash 从 RTMP (Wowza) 视频流中抓取位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取在我的客户端上播放的 Wowza 视频流的位图​​/快照,如下所示:

I'm trying to get a bitmap/snapshot of a Wowza video stream playing on my client, like so:

var bitmapData:BitmapData = new BitmapData(view.videoPlayerComponent.width, view.videoPlayerComponent.height);
bitmapData.draw(view.videoPlayerComponent);

执行此操作时,我收到此错误消息:

When I do this, I get this error message:

SecurityError:错误 #2123:安全沙箱违规:BitmapData.draw:http://localhost:51150/Resources/WRemoteWebCam.swf 无法访问 rtmp://localhost/videochat/smithkl42._default/.没有授予访问权限的策略文件.

SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://localhost:51150/Resources/WRemoteWebCam.swf cannot access rtmp://localhost/videochat/smithkl42._default/. No policy files granted access.

我认为错误是因为无法找到合适的 crossdomain.xml 文件.我不太确定它在哪里寻找它,并且wireshark嗅探是不确定的,所以我尝试在以下每个位置放置一个:

I presume the error comes from not being able to locate the appropriate crossdomain.xml file. I'm not quite sure where it's looking for it, and a wireshark sniff was inconclusive, so I've tried placing one in each of the following places:

http://localhost/crossdomain.xml
http://localhost:1935/crossdomain.xml
http://localhost:51150/crossdomain.xml

我可以从这三个位置中的每一个位置成功检索文件.(我很确定最后一个不会有任何影响,因为它只是承载 .swf 文件的页面的网站的位置,但在偶然的情况下......)

I can retrieve the file successfully from each of those three locations. (I'm pretty sure that the last one wouldn't have any effect, since it's just the location of the web site which hosts the page that hosts the .swf file, but on the off chance...)

这些是它在每个实例中抓取的文件内容:

These are the contents of the file that it's grabbing in each instance:

<cross-domain-policy> 
    <allow-access-from domain="*" to-ports="*" /> 
</cross-domain-policy>

它仍然抛出同样的错误信息.

And it's still throwing that same error message.

我还遵循了 Wowza 论坛上的说明, 在 [install]\conf[appname]\Application.xml 中打开 StreamVideoSampleAccess,没有任何乐趣:

I've also followed the instructions on the Wowza forums, to turn on StreamVideoSampleAccess in the [install]\conf[appname]\Application.xml, with no joy:

<Client>
    <IdleFrequency>-1</IdleFrequency>
    <Access>
        <StreamReadAccess>*</StreamReadAccess>
        <StreamWriteAccess>*</StreamWriteAccess>
        <StreamAudioSampleAccess>*</StreamAudioSampleAccess>
        <StreamVideoSampleAccess>*</StreamVideoSampleAccess>
        <SharedObjectReadAccess>*</SharedObjectReadAccess>
        <SharedObjectWriteAccess>*</SharedObjectWriteAccess>
    </Access>
</Client>

有什么想法吗?

推荐答案

这不是 crossdomain.xml 问题:这里是 相关的 Adob​​e 文档.我认为这篇文章也可能有帮助.

It's not a crossdomain.xml issue: Here's the relevant Adobe documentation. I think this post may also be of help.

这篇关于如何指定跨域策略文件以允许 Flash 从 RTMP (Wowza) 视频流中抓取位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆