OSMF如何获取截图

时间:2014-07-02 02:35:56

标签: flex screenshot osmf

在这样的正常屏幕截图中: bitmapData.draw(video,new Matrix()); 但是如何在osmf播放器中获取视频对象?我尝试在一个空白图像中绘制mediaPlayerSprite结果

var pictureData:BitmapData = new BitmapData(width, height); 
var x:DisplayObjectTrait = _mediaPlayer.media.getTrait(org.osmf.traits.MediaTraitType.DISPLAY_OBJECT) as DisplayObjectTrait; 
var y:Video = x.displayObject as Video; 
pictureData.draw(m_container, new Matrix());  
var byteArray:ByteArray = new JPEGEncoder(80).encode(pictureData);  
var file:FileReference = new FileReference();  
file.save(byteArray, "pic.jpeg");

1 个答案:

答案 0 :(得分:0)

从视频中获取Bitmapdata:

var videoDisplay:VideoDisplay = video.videoDisplay;
var videoObject:Video = videoDisplay.videoObject;
var bitmapData:BitmapData = new BitmapData(videoObject.videoWidth, videoObject.videoHeight, true, 0x000000);