1

I want to Prevent Video screen capture (screen graving) in my PlayerActivity, I use VideoView.

I already tried this

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

But it works only on some activity.

borchvm
  • 3,533
  • 16
  • 44
  • 45
Samiu Salihu
  • 11
  • 2
  • 4
  • what do you mean by some activity? If you need to protect other activities then you need to put the same to those activities too. – Dipankar Baghel Feb 06 '20 at 09:41
  • Ya, ex. I have MainActivity and PayerActivity main activity is already protected, and this code doesn't work in PlayerActivity because it contains VideoView – Samiu Salihu Feb 06 '20 at 10:06

1 Answers1

0

If you're using VideoView with SurfaceView, you can use SurfaceView.setSecure(true) it will prevent screen capture.

hope this will help you.

Dipankar Baghel
  • 1,932
  • 2
  • 12
  • 24