开发者

iPhone:Photo booth count down feature in iPhone video recording feature?

I am doing video recording from my iPhone 4 application program. I want to do an enhancement same like photo b开发者_如何学编程ooth's 3 .. 2 .. 1 count down prior to taking video recording. Is it possible to do that on my iPhone program programmatically? If YES, how and if NO why? Please advise.

Thank you in advance.


Yes.

All you really need to do is draw the 3,2 and 1 on the screen on top of your AVCapturePreviewLayer.

Here's is Apple's code from documentation:

AVCaptureSession *captureSession = <#Get a capture session#>;
AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:captureSession];
UIView *aView = <#The view in which to present the layer#>;
previewLayer.frame = aView.bounds; // Assume you want the preview layer to fill the view.
[aView.layer addSublayer:previewLayer];

so your part is simple:

[[aView superview] addSubview:countdownView];

Inside countdown view, you can have a custom draw method or just add UILabels. Lots of options on actually doing the countdown. You can use NSTimers to change the labels or even UIView animations with callbacks.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜