quickblox-android-sdk icon indicating copy to clipboard operation
quickblox-android-sdk copied to clipboard

How to take screenshot of video call in quickblox android sdk ?

Open nitin-appinventiv opened this issue 6 years ago • 2 comments

I want frame or bitmap of the remote user on video call.

I have used below method but it is not working.

remoteFullScreenVideoView.addFrameListener(new EglRenderer.FrameListener() { @Override public void onFrame(Bitmap bitmap) { Log.d(TAG, "onFrame bitmap= " + bitmap); showPictureURL(bitmap); } }, 1f);

nitin-appinventiv avatar Apr 23 '20 07:04 nitin-appinventiv

You should add button e.g. "Take Screen Frame" and press it when you need to take frame during the video call. Pressing this button calls example method below:

    private void forExampleTakeScreenShot(QBConferenceSurfaceView remoteVideoView) {
        if (remoteVideoView != null) {
            remoteVideoView.addFrameListener(new EglRenderer.FrameListener() {
                @Override
                public void onFrame(Bitmap bitmap) {
                    runOnUiThread(() -> {
                        //
                        // there you can do whatever you want to save bitmap or place it into imageView
                        //
                        remoteVideoView.removeFrameListener(this); // <- this is important 
                    });
                }
            },1);
        }
    }

Please note, that after taking a bitmap of the video frame you should call remoteVideoView.removeFrameListener(this);

alexparvus1 avatar Apr 28 '20 07:04 alexparvus1

Hello @nitin-appinventiv

This is Nikolay from QuickBlox support.

Please let me know if you had a chance to check the previous reply and try the provided solution.

ghost avatar Oct 04 '21 14:10 ghost