Android 4.0中的后台视频录制 [英] Background video recording in Android 4.0

查看:53
本文介绍了Android 4.0中的后台视频录制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 Android 4.0 中组织后台视频录制.但是因为这些问题我做不到:

  1. 虚拟表面在 MediaRecorder 中不起作用(错误:无效表面)

  1. Dummy Surface does not work in MediaRecorder (error: invalid surface)

如果你在 Activity 上使用 Surface 1 x 1 px,Surface 在 Activity 暂停时被销毁(记录停止)

If you use Surface 1 x 1 px on Activity, Surface is destroyed on Activity pause (recording is stopped)

如果您在 WindowsManager 上使用 Surface 1 x 1 px,Surface 在应用程序暂停时被破坏(录制停止)

If you use Surface 1 x 1 px on WindowsManager, Surface is destroyed on Application pause (recording is stopped)

SurfaceTexture 在 MediaRecorder.setPreviewDisplay(new Surface(SurfaceTexture)) 中不起作用

SurfaceTexture does not work in MediaRecorder.setPreviewDisplay(new Surface(SurfaceTexture))

Widget 不允许处理 Surface 1 x 1 px

Widget does not allow to handle Surface 1 x 1 px

状态栏不允许处理表面 1 x 1 像素

Status Bar does not allow to handle Surface 1 x 1 px

请帮我找到正确的方法.

推荐答案

我找到了答案:必须使用 WindowManager 并从 Service 中调用它.

I found the answer: it is necessary to use WindowManager and call it from Service.

这篇关于Android 4.0中的后台视频录制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆