问题描述
我有一个用于录制视频的UIImagePickerController。现在我想检测用户点击记录按钮的时间。代表不提供任何此类回调。
I have a UIImagePickerController which I use to record video. now i want to detect when the user taps on record button. the delegate doesn't provide any such callback.
有没有什么好方法可以找出录制视频的时间?
Is there any good way to find out when the video is being recorded?
推荐答案
你是对的:代表没有收到有关视频捕获何时发生的任何信息。简单的解决方案是简单地滚动您自己的相机控件 - 将 showsCameraControls
属性设置为否
并提供您自己的控件使用 cameraOverlayView
属性的自定义视图 - 并让捕获按钮调用图像选取器控制器的 -startVideoCapture
和 -stopVideoCapture
方法,同时向应用的其他部分提供您需要的任何通知。
You’re right: the delegate doesn’t receive any information on when video capture is happening. The easy solution is to simply roll your own camera controls—setting the showsCameraControls
property to NO
and providing your own controls in a custom view with the cameraOverlayView
property—and have your "capture" button call the image picker controller’s -startVideoCapture
and -stopVideoCapture
methods, along with providing whatever notification you need to other parts of the app.
这篇关于检测用户何时开始录像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!