Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent my app from capturing screen recording in android?

I am working on video player app and I want no other app can record my video and audio as well. I am using simple VideoView to run videos in my app.

I have tried this code, this code prevents from taking the screenshot only.

getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);

Problem

But when I downloaded a screen recording app i.e. DU Recorder and check by recording, it's recording my video's screen and audio as well, this i don't want.

Could anyone help me from this? Thanks in advance

like image 238
Sunil Avatar asked Apr 24 '18 07:04

Sunil


People also ask

Can apps prevent screen recording?

Screen Capture protection is possible in Android App, IOS App or IOs browser, but desktop and android browsers can not prevent screen capture.

How do I change screen record settings on Android?

The screen recording app is located in the notification panel. Swipe this panel downwards to bring up the “Quick Settings” menu. Swipe the top notifications bar down twice (the first time reveals the menu, the second time opens it up) to access the “Quick Settings.” Next, select the “Screen Record” icon.


1 Answers

If you are using SurefaceView with media player then use SurfaceView.setSecure(true) , then your video will be secured from any other apps.

like image 157
Nupur Verma Avatar answered Oct 05 '22 23:10

Nupur Verma