android – Media Projection Service with WebRTC does not show playing video

I use the Media Projection Service to get the full screen on my device

private fun startScreenCapture(){
    val mediaProjectionManager = getSystemService(Context.MEDIA_PROJECTION_SERVICE) as MediaProjectionManager
    ActivityCompat.startActivityForResult(this, mediaProjectionManager.createScreenCaptureIntent(), 1, null)
}

and send that via WebRTC to a local webpage that displays the device’s screen.

The device’s screen displays fine on the local webpage but I noticed that if a video is playing in an android VideoView


the video does not get captured. All other UI elements on the screen are visible just not what is playing in the video view. I dont know if this is a limitation of the Media Projection Service or WebRTC or maybe I need to do something extra to have the video show?

Read more here: Source link