Dan
Dan

Reputation: 663

Swift capture Live Photo

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

Answers (2)

Chocoford
Chocoford

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

WalkerYm
WalkerYm

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

Related Questions