tags:

views:

156

answers:

4

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??

+1  A: 

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.

Toastor
I think he means the user is listening to music from within his application, so it would not be a background service.
Yannick Compernol
yes the music is within the application only but wont the video recording from front camera start as a background service??
hemant
@hermant: Should the recording of video occur while your app is **not** in the foreground, meaning the user is looking at the homescreen or another app? Then my answer is the one you need. If the app should continue recording while the user is looking at some other view **within** your app, then look at yannicks answer.
Toastor
If i play the sound from an url which opens QuickTime player on iPhone my app will go in the background mode and then i wont be able to record video from front camera as i think the code wont execute...is that right??
hemant
as this is my first multi-tasking app so having difficulty to understand how it works..
hemant
A: 

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 AVCaptureMovieFileOutputor AVCaptureVideoDataOutput.

More info: AV Foundation Programming Guide

Yannick Compernol
A: 

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.

Secruoser
A: 

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

abanibi