美文网首页
UIImagePickerController录制视频的坑

UIImagePickerController录制视频的坑

作者: Sanchain | 来源:发表于2016-09-19 14:49 被阅读170次

    需求:要求横屏拍摄视频。

    拍摄视频有两种方式:

    方式1:UIImagePickerController

    使用UIImagePickerController调用系统的相机来录制视频,进去后默认是竖屏的拍摄;查看了下苹果官方文档:
    Important
    The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified, with one exception. You can assign a custom view to the cameraOverlayView property and use that view to present additional information or manage the interactions between the camera interface and your code.

    说的是UIImagePickerController只支持竖屏拍摄模式。
    so, 只能使用AVFoundation来定制一个只有横屏的拍摄模式。

    方式2:AVFoundation

    相关文章

      网友评论

          本文标题:UIImagePickerController录制视频的坑

          本文链接:https://www.haomeiwen.com/subject/ryhnettx.html