running Video Recorder in background in iOS 4 iphone?
i am developing an application which requires recording a video in the background while the user 开发者_StackOverflow中文版is listening to music player in the application?? is it possible to run video recorder of iphone in the background mode automatically without prompting the user to press the record button??
No, that is not possible. Apple provides very few APIs for background services only, such as location services and audio playback. Recording video is not amongst the approved tasks.
Have a look at the new AV Foundation framework in iOS 4.0, this framework provides (low-level) access to capturing video from the camera(s).
The main class you'll need to uses is AVCaptureSession
and you'll have set the output to either to AVCaptureMovieFileOutput
or AVCaptureVideoDataOutput
.
More info: AV Foundation Programming Guide
I haven't been able to find a background recorder ios 4 yet, although there are a few close possibilities: 1. turn the screen black with minimum brightness which effectively shows nothing if there's enough light out 2. turn off your screen with screendimmer, it will turn back on if you touch it 3. get Camcorder which has a "secret" recording option which fakes the unlock screen while it records, when you swipe it to unlock it goes back to camera mode.
As far as I understand it's not possible to record video on background due to ios restrictions
- Get the 'NO Video' app. http://itunes.apple.com/my/app/no-video/id430204140?mt=8
- Download iPhone Explorer. http://www.macroplant.com/iphoneexplorer/
- With the 'NO Video' app installed, connect your iPhone to your computer with the USB port, and launch iPhone Explorer.
- Go to Apps/NO Video/NO Video.app/images and copy 1.jpg to your desktop.
- With an image-editing software such as Photoshop, change the 1.jpg to a plain black image without changing the size and save it.
- Now copy the plain black image back to the Apps/NO Video/NO Video.app/images folder and replace the 1.jpg in the folder.
- Restart your iPhone.
Launch the 'NO Video' app, click the red icon at the bottom to start recording, then flick to the left to reveal a plain black image while still recording video.
精彩评论