Android record screen but only specific 'layers'/views

我的未来我决定 提交于 2020-01-01 17:00:29

问题


I use the MediaProjection API to record a screen in Android. Now I want to know whether it's possible to create a let's say "hidden" view which you actually can see but not in the video thus the view shouldn't be recorded. Furthermore is it possible to disable the recording of notifications or even the notification-center?

So is it possible to configure like a 'surface-layer-system', thus you can decide which layer you want to record?


回答1:


Preventing a layer from appearing in recordings can be done by setting the "secure" flag. See for example the "multi-surface test" in Grafika, which sets the flag on one of its SurfaceViews.

You will configure a virtual display to only show your app's own windows if you use createVirtualDisplay() directly, rather than going through MediaProjectionManager. Because you're creating a display for your own content, the user permission dialog is not shown. See for example the tests for DisplayManager#createVirtualDisplay().




回答2:


You can use EZ filter to record particular layout.



来源:https://stackoverflow.com/questions/35986349/android-record-screen-but-only-specific-layers-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!