Swift capture Live Photo

801 views Asked by At

I'm trying to capture a Live Photo. I have followed Apples article on how to do this..

Capturing and Saving Live Photos

However I am running into an issue regarding..

photoOutput?.isLivePhotoCaptureEnabled = photoOutput!.isLivePhotoCaptureSupported

It keeps returning False

I am running on an iPhone 7 that I can see is capable of taking Live Photos.

Anybody know why this Bool is not True?

Thanks.

1

There are 1 answers

0
WalkerYm On

Before getting value of isLivePhotoCaptureSupported, you must setting captureSession.sessionPreset = .photo. As follow:

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