微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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.

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐