MediaPlayer and TextureView
michael-mohemian opened this issue · 3 comments
I am using https://github.com/yqritc/Android-ScalableVideoView to render a video stream in a TextureView.
I tried FalconSpoon, but the stream is not included in the screenshot.
Is it related to the fact that ScalableVideoView is using MediaPlayer? Any help/workaround is much appreciated.
Hi, thank you for using Falcon.
I am sorry, but Falcon cannot take screenshot from TextureView or any other View based on drawing content stream or OpenGL(SurfaceView, maps) coming from native APIs.
These Views unfortunately draw nothing when you call draw(Canvas)
on them and I don't have access to the frames provided by MediaPlayer.
There could be a workaround with TextureView.getBitmap()
method. When I will have some spare time, I will look into it. Leaving open.
Hi, I found some time to look into it and I think I cannot fix it in reasonable amount of time and code.
The problem is when I will handle particular view of view hierarchy, I need to handle its coordinates on canvas, which is easy, but bigger problem is I need to handle visibility with other views is the TextureView is upfront, behind or partially behind some view.
Once I start to do this for any view in layout, I need to do that for all of them which means I could basically copy the code handling drawing children from View.draw(Canvas)
, which is overridden in many child Views, which unfortunately makes it almost impossible for me to implement properly.
It will maybe work in case when the TextureView is at the top of the hierarchy, but I simply cannot assume that for all cases.
Fix may be to draw the texture view on loaded Bitmap from File taken by Falcon by yourself. It is unfortunate you would have to do it by yourself, but I now believe there is no better solution and Falcon cannot do that for you.