7

I'm creating a screen recorder app using the MediaProjection API. In my app, I'm showing the stop button as a small overlay window. I've kept this view as secure so that it doesn't come up in the final recorded video.

This view doesn't come up in the final video, but the final output is itself a black area in place of the original view.

Is it any way possible to get the final video output without this black area?

omerjerk
  • 4,090
  • 5
  • 40
  • 57

2 Answers2

2

No way to do that currently unless you have System permission.

reker
  • 2,063
  • 13
  • 12
1

I found a link related to hiding the overlay when requesting mediaProjection but the problem is app needs to be a system app and require a system permission android.permission.ACCESS_SURFACE_FLINGER and flag PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS not seems to be available to application developers. Have a look on this page to see if you can get anywhere. https://review.lineageos.org/c/LineageOS/android_frameworks_base/+/239014/2

  • Or [**PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY**](https://blog.xzr.moe/archives/136/). [Eg](https://gerrit.pixelexperience.org/plugins/gitiles/frameworks_base/+/017adb2dfb0f0147a5f7bf746a62f66f1d290fc3/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java#239) – FLASHCODER Jan 11 '23 at 18:10