基本上我想要视频盗版保护
我的应用程序有视频流,我想保护我的视频流免受其他应用程序的影响.其他应用程序不应该在播放视频时捕获屏幕.任何建议我怎么能实现这一点..在此先感谢.
解决方法:
您可以通过在Activity中添加FLAG_SECURE来保护屏幕捕获功能,如下所示
getwindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
Screen capturing and sharing
Android 5.0 lets you add screen capturing and screen sharing
capabilities to your app with the new android.media.projection APIs.
This functionality is useful, for example, if you want to enable
screen sharing in a video conferencing app.The new createVirtualdisplay() method allows your app to capture the
contents of the main screen (the default display) into a Surface
object, which your app can then send across the network. The API only
allows capturing non-secure screen content, and not system audio. To
begin screen capturing, your app must first request the user’s
permission by launching a screen capture dialog using an Intent
obtained through the createScreenCaptureIntent() method.
Window flag: treat the content of the window as secure, preventing it
from appearing in screenshots or from being viewed on non-secure
displays.
以上解决方案肯定会阻止应用程序捕获您的应用程序的视频