快速捕捉实时照片

时间:2018-09-04 18:36:03

标签: ios swift avcapturesession phlivephoto

我正在尝试捕获实时照片。我关注了有关如何执行此操作的Apple文章。

Capturing and Saving Live Photos

但是我遇到了一个有关..

的问题
photoOutput?.isLivePhotoCaptureEnabled = photoOutput!.isLivePhotoCaptureSupported

它不断返回False

我正在运行的iPhone 7上运行实时照片。

有人知道为什么这个布尔不是真的吗?

谢谢。

1 个答案:

答案 0 :(得分:1)

在获得isLivePhotoCaptureSupported的值之前,必须设置captureSession.sessionPreset = .photo。如下:

captureSession.beginConfiguration()
captureSession.sessionPreset = .photo
// add Input
// add Output
photoOutput.isLivePhotoCaptureEnabled = photoOutput.isLivePhotoCaptureSupported
// ......
captureSession.commitConfiguration()
// ......
相关问题