Over-The-Shoulder Quick Tip
Accessing VideoSurface in OSMF is useful if you want to capture a snapshot of the playing video, but it can be difficult to locate the video display object. I found a tip in the comments section of a post by Nils Thingvall that helped:
1 2 3
var tVideoSurface : VideoSurface = ( view.mediaPlayerCore.media.getTrait( MediaTraitType.DISPLAY_OBJECT ) as DisplayObjectTrait ).displayObject as VideoSurface; var tBitmapData : BitmapData = new BitmapData( tVideoSurface.width, tVideoSurface.height, true, 0 ); tBitmapData.draw( tVideoSurface );
[UPDATE 03/09/2015] Several readers have reported difficulty capturing BitmapData using this technique despite being able to see the video. If you can play a video but not capture BitmapData from it, chances are you have a problem with security permissions. Check out another post regarding security limitations for help solving that issue: http://www.roguish.com/blog/?p=667.