prevent其他应用程序的形式拍摄/录制画面 [英] Prevent other applications form capturing/recording screen
问题描述
基本上我想要视频反盗版
我的应用程序具有视频流媒体,我要保护我的视频从其他应用程序流。其他应用程序不应该能够捕获屏幕,而我的视频播放。任何建议,我怎么能做到这一点..在此先感谢。
My application has video streaming and I want to protect my video streaming from other applications. Other applications should not be able to capture screen while my video is playing. Any suggestions how can i achieve this.. Thanks in advance.
推荐答案
您可以通过添加FLAG_SECURE到你的活动如下保证屏幕捕获功能
You can secure screen capturing functionality by adding FLAG_SECURE into your Activity as follows
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
检查这的链接,说:
屏幕捕捉和分享
安卓5.0,您可以添加屏幕捕捉和屏幕共享 功能与新android.media.projection的API您的应用程序。 如果要启用此功能很有用,例如, 屏幕共享的视频会议应用程序。
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.
新createVirtualDisplay()方法可以让你的应用程序来捕捉 主屏幕(默认显示)的内容到一个曲面 对象,你的应用程序就可以通过网络发送。唯一的API 允许拍摄的非安全的屏幕内容,而不是系统的音频。至 开始屏幕捕获,你的应用程序必须首先请求用户的 通过使用一个Intent启动屏幕捕获对话框许可 通过createScreenCaptureIntent()方法获得。
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.
此外,在文件<一个href="http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE"相对=nofollow>这个链接说,
窗口标志:把窗口作为安全,内容的 preventing它 出现在屏幕或从上观看非安全 显示器。
Window flag: treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays.
以上的解决方案必将起价捕捉你的应用程序的视频p $ pvent应用
Above solution will surely prevent applications from capturing Video of your app
这篇关于prevent其他应用程序的形式拍摄/录制画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!