如何捕获流视频显示并将其保存到Flex Builder 3中的磁盘上?
一段时间以来,我一直在寻找解决问题的方法,但没有得到答案. 我有一个带有 VideoDisplay 对象和获取屏幕截图"按钮的页面.我想从流视频中获取屏幕截图并保存,但出现错误:
I've been looking for a solution to my problem for a while and didn't get the answer. I have a page with a VideoDisplay object and a "Take screenshot" button. I would like to get the screenshot from the streaming video and save it but I'm getting an error:
违反安全沙箱:BitmapData.draw: http://xxx/xxx.swf 无法访问rtmp://xxx/xx/xx/.没有策略文件被授予访问权限.
Security sandbox violation: BitmapData.draw: http://xxx/xxx.swf cannot access rtmp://xxx/xx/xx/. No policy files granted access.
我从中捕获图像的网站的域名与rtmp相同.
The domain of the website from which I'm capturing the image and the rtmp is the same.
我正在使用 ImageSnapshot 类来捕获屏幕截图.这是负责截取屏幕截图的功能:
I'm using ImageSnapshot class to capture the screenshot. This is the function responsible for taking the screenshot:
function takeSnapshot()
{
var imageSnap:ImageSnapshot=ImageSnapshot.captureImage(mainPlayer);
var imageByteArray:ByteArray=imageSnap.data as ByteArray;
var fileRef:FileReference=new FileReference();
fileRef.save(imageByteArray, "screenshot.png");
}
我还有一个带有lin的跨域策略文件:
I've got also a cross-domain policy file with a lin:
<allow-access-from domain="*" />
感谢您的帮助.