调整UIImagePickerController视频采集界面大小
我正在为我的 ipad 应用程序使用 splitviewcontroller,其中我需要在 detailViewController
中以 530 px 宽和 360 px 高的尺寸捕获视频。我尝试使用 UIImagePickerController 来捕获视频,但我无法更改视频捕获界面的大小。我无法在应用程序中进行全屏视频捕获。有没有办法调整UIImagePickerController
视频采集界面的大小。非常感谢您的回答。抱歉没有在这里添加屏幕截图。我的声誉不允许这样做。
I am using splitviewcontroller
for my ipad application in which I need to capture video in the detailViewController
in a dimension of 530 px width and 360 px height. I tried using UIImagePickerController
for capturing video but i am unable to change the size of the video capture interface. I cannot afford a full screen video capture in the app. Is there a way to resize the video capture interface of UIImagePickerController
. Thanks a lot for your answers. Sorry for not adding up an screenshot here. My reputation count doesn't permit it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,您无法使用 UIImagePickerController 来执行此操作。但是您可以使用 AVCamCaptureManager 和 AVCamRecorder 类轻松完成此操作。 Apple 在其开发人员网站上构建了一个演示程序 这里。它被命名为AVCam。简单来说,它的作用是当您单击打开相机时,它会调用负责打开 iPhone 相机并录制视频或捕获音频的类和方法。它调用与 UIImagePickerController 调用的相同的类。
您将在该演示代码中找到一个小的 UIView 对象,它显示相机的源。您可以根据需要调整该视图的大小,相机的输入将显示在该区域中。当我想要调整相机输入源的大小并拍摄照片时,它对我有用。我希望它也适合你。
You won't be able to do so using UIImagePickerController as far as I know. But you can do it easily using AVCamCaptureManager and AVCamRecorder classes. Apple has a demo program build on its developer site here. It is named AVCam. In simple words what it does is when you click to open the camera, it calls the classes and methods which are responsible for opening the iPhone's camera and record video or capture audio. It calls the same classes which are called by UIImagePickerController.
You'll find a small UIView object in that demo code which displays the camera's feed. You can resize that view as per the size you want and the camera's input will be displayed in that much area. It worked for me when I wanted to resize the camera's input feed and capture photos. I hope it works for you as well.
我刚刚找到了一种在 iPad 上调整 UIImagPickerController 视频捕获界面大小的可能方法。基本思想是使用 UIPopoerController 的维度来调整 UIImagPickerController 视图的大小,然后将其添加到您的自定义视图。
详细代码和说明如下:
注意:当您完成视频捕获或取消视频捕获时,您需要关闭弹出窗口并从自定义视图中删除容器的视图。
I just found a possible way to resize UIImagPickerController video capture interface on iPad. The basic idea is to use UIPopoerController's dimension to resize the UIImagPickerController's view and then add it to your custom view.
The detailed code and description are listed below:
Note : when you finish video capture or cancel it, you need to dismiss the popover and remove the container's view from your custom view.