i am developing an application which requires recording a video in the background while the user 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
If running the video recording in background is not possible, how about turning the screen black while video recording is active? It's like I'm using a video recording app, but my screen isn't showing anything, although it's still recording. I hope this is possible.
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