Reputation: 51
I'm trying to find a way to record the screen of the application and more specifically the WebView activity inside the app.
I've done some researches and people suggested using MediaProjectionManager or MediaRecorder APIs for that but I'm not very sure which one and how to implement it.
I looked at some examples and the MediaProjection only record what's in a SurfaceView.. but mine is a Webview, would it still works? Any suggestion would be appreciated.
Thanks!
Upvotes: 0
Views: 2624
Reputation: 1006574
I looked at some examples and the MediaProjection only record what's in a SurfaceView
No. An app using the media projection APIs does not have to have a SurfaceView
at all. For example, this sample app captures a screencast, and it does not have a SurfaceView
. The media projection APIs capture what is on the screen. This could be your app or other apps that are on the screen at the time that you are recording.
but mine is a Webview, would it still works?
In general, yes, bearing in mind that you are recording what is on the screen, so if another application appears (e.g., an incoming phone call), you will be recording that other application. The media projection APIs do not record a View
, they record the screen.
One possible limitation with the media projection APIs would be DRM. It is possible that you will not be able to record everything, because some views are showing DRM-protected content (e.g., playing back a movie), and that might not get captured. I have not played with the media projection APIs in this situation to see how they behave.
Upvotes: 1