Reputation: 663
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.
Upvotes: 2
Views: 990
Reputation: 311
I encountered the same issue as you, but the solution turned out to be surprisingly simple.😅
You should call captureSession.addOutput(photoOutput)
before you request its isLivePhotoCaptureSupported
.
Upvotes: 0
Reputation: 21
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()
// ......
Upvotes: 2