Reputation: 735
We have a video player application that using ExoPlayer2. And its needs to be protected from the screen recorder.
We integrated the 'WindowManager.LayoutParams.FLAG_SECURE' but some of the device is not supporting this feature ( Lenovo , Samsung etc ..) in ExoPlayer2 activity screen ,user can capture full video through 'DU Recorder'.
This is happening only ExoPlayer2 activity all other screens are working fine
Upvotes: 3
Views: 1818
Reputation: 8038
If you're using a SurfaceView
with ExopPlayer2, you can use SurfaceView.setSecure(true)
which will prevent the player from being recorded.
If you're not already using a SurfaceView
, you can set one on the SimpleExoPlayer
- you can see how that works by checking out this SO post. Or if you're interacting with Exo through something other than SimpleExoPlayer
, then I'd bet there's a way to get access to the SurfaceView
to call setSecure
on it.
Let me know if that works or if you need any further clarification.
Upvotes: 3