Is it possible to take screen shot of the WeemoVideoInFrame ? I have tried the following code and it gives me this. I think I need to acquire a reference of the underlying Surface to be able to take screenshots but is there really no way of achieving this? Can some one recommend a workaround this?
view.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
Unfortunately, the internal View used to render the video frames is a TextureView, and therefore you can't request the drawing cache (TextureView is HardwareAccelerated).
Moreover, the documentation specifies that:
So, your
draw()
call will have no effect on the TextureView.Maybe you could try to use the
getBitmap()
method on the internal TextureView but I can't guarantee you this will work.At this time, there is no such feature on the Weemo SDK, but we're investigating to provide a more convenient way of capturing these frames.
Also, it would be interesting for us to better understand your use case. Maybe you could share a bit more on what you are trying to achieve. This could help us design anew SDK feature that will best fit your needs.
Edit: To get a reference to this
TextureView
, simply browse the view hierarchy. You could for example do this:But keep in mind that this behavior is not guaranteed.