android - Problem with device recording in the background
学习ing
学习ing 2017-07-06 10:36:46
0
1
1928

In the project, the device needs to be able to record in the background, but once the app enters the background, the surfaceview will be destroyed. Open the app again and the surfaceview will be re-created. You must execute camera.stopPreview and camera.starPreview in the surfaceCreated() method, otherwise it will The screen will go black. The problem is that if you do this, the recorded video file cannot be played because the camera performs a stopPreview operation in the middle.
Can someone give me some ideas to solve this problem?

学习ing
学习ing

reply all(1)
过去多啦不再A梦

Well, it is recommended to use FloatingWindow to achieve the goal of "background recording". Try to hang this surfaceView on the floating window, maximize the floating window when previewing the interface, and once the user exits the application and enters background mode, set the floating window to the size It is a 1-pixel window, and the recording is still running at this time. There is no need to switch the camera state. Naturally, the recorded files will not be sliced.
I don’t know whether this application runs on the phone or on the car device?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!