How to record web browsing activity screen using Android MediaCodec?

I have a task to record user activity in webview, in other words, I need to create a mp4 video file when the user goes to webview. Pretty complicated :) I, who introduced MediaCodec in Android 4.3: was expanded to include a way to provide input via Surface (via the createInputSurface method). This allows you to enter data from a camera preview or OpenGL ES rendering. I even find an example where you can write a game written in opengl: http://bigflake.com/mediacodec/

My question is: how can I register web browsing activity? I suppose that if I could draw the contents of a webview to create a texture, than everything would be fine. But I do not know how to do this.

Can someone help me with this?

+4
source share
2 answers

Why not try WebView.onDrawfirst instead of using OpenGL? The latter approach may be more complex and not supported by all devices.

Once you can get the screenshots, you can create a video ( to create a video from a sequence of images on an android ), a separate task in which mediacodec should help.

0
source

" , - opengl".

.

SurfaceTexture - , , OpenGL. OpenGL .

opengl:

1. OpenGL

2. OpenGL SurfaceTexture . SurfaceTexture.setDefaultBufferSize(int width, int height), , .

3. , SurfaceTexture.

4. onDraw Canvas, Surface.lockCanvas, . , , WebView. Plus Canvas , , .

: https://github.com/ArtemBogush/AndroidViewToGLRendering : http://www.felixjones.co.uk/neo%20website/Android_View/

0

All Articles