Android MediaProjection captures blank spaces instead of video areas

325 Views Asked by At

When I try to capture screen on Android device using MediaProjection, in general, it's ok. But I see a blank space instead of video (I mean, in in the area which I wanted to capture included some adv videos on FaceBook or some movie on Netflix).

BTW, Android P

projection = projectionManager?.getMediaProjection(resultCode, data)

virtualDisplay = projection?.createVirtualDisplay(captorDisplayName,
                            width!!,
                            height!!,
                            density!!,
                            DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
                            imageReader?.surface,
                            null,
                            null)`
0

There are 0 best solutions below