开发者

recored video using UIImagePickerController

I'm developing an iPhone app that records video. I create a UIImagePickerController, limit it to video recording then programatically ask the camera to startVideoCapture. Unfortunatly when I run the app I get the following in the console;

"UIImagePickerController: ignoring request to start video capture; camera is not yet ready."

how can i 开发者_StackOverflow社区handle this?


There is no delegate callback that tells you when the camera is ready. I tried this but no luck, still your error:

if ([UIImagePickerController isCameraDeviceAvailable:[picker cameraDevice]]) {
                [picker takePicture];
}
else {
     NSLog(@"Camera not ready");
}

I called take picture after delay of 1.0, 1.5, 2.0 seconds. My observations:

At 1.0 secs: takes the picture but the full shutter closing is not seen on the screen At 1.5 secs: shutter closing is seen but very little At 2.0 secs: loads the camera, shows whats on the screen and then takes the picture.

So you might wanna use something between 1.75 to 2.25. Code i used:

[picker performSelector:@selector(takePicture) withObject:nil afterDelay:2.0];


The most probable reason seems to be the absence of the required key in your info.plist file. You will need to configure UIRequiredDeviceCapabilities. Also, you must implement the delegate object. For details, have a look at http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/TakingPicturesAndMovies.html#//apple_ref/doc/uid/TP40010406.

HTH,

Akshay

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜