问题
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:
Security sandbox violation: BitmapData.draw: http://xxx/xxx.swf cannot access rtmp://xxx/xx/xx/. No policy files granted access.
The domain of the website from which I'm capturing the image and the rtmp is the same.
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");
}
I've got also a cross-domain policy file with a lin:
<allow-access-from domain="*" />
I'd be grateful for your help.
回答1:
It seems someone has figured it out.
He was having an issue with not connecting to the stream correctly
Have a look
回答2:
Flash Player cannot access bitmap data or sound spectrum data for media loaded from RTMP sources, although it can display and play bitmaps and sounds loaded from these servers.
来源:https://stackoverflow.com/questions/6017259/how-to-capture-a-streaming-video-display-and-save-it-to-disk-in-flex-builder-3