android – 防止其他应用程序形成捕获/记录屏幕

基本上我想要视频盗版保护

我的应用程序有视频流,我想保护我的视频流免受其他应用程序的影响.其他应用程序不应该在播放视频时捕获屏幕.任何建议我怎么能实现这一点..在此先感谢.

解决方法:

您可以通过在Activity中添加FLAG_SECURE来保护屏幕捕获功能,如下所示

  getwindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE); 

检查this链接

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.

this link文件也说明了这一点

Window flag: treat the content of the window as secure, preventing it
from appearing in screenshots or from being viewed on non-secure
displays.

以上解决方案肯定会阻止应用程序捕获您的应用程序的视频

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...