---
title: "prepareLivePhotoForPlayback(withTargetSize:options:completionHandler:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phlivephotoeditingcontext/preparelivephotoforplayback(withtargetsize:options:completionhandler:)"
---

# prepareLivePhotoForPlayback(withTargetSize:options:completionHandler:)

Processes a Live Photo with your edits for viewing.

## Declaration

```swift
func prepareLivePhotoForPlayback(withTargetSize targetSize: CGSize, options: [String : Any]? = nil, completionHandler handler: @escaping @Sendable (PHLivePhoto?, (any Error)?) -> Void)
```

```swift
func livePhotoForPlayback(targetSize: CGSize, options: [String : Any]? = nil) async throws -> PHLivePhoto
```

## Parameters

- `targetSize`: The size of the view in which you plan to preview the edited Live Photo output.
- `options`: Options that affect Live Photo rendering. See Live Photo Processing Options.
- `handler`: A block that Photos calls on the main queue after processing is complete. The block takes the following parameters:

## Discussion

Discussion Use this method to generate preview versions of the edited Live Photo—for example, to display in your editing UI. note: This method does not guarantee performance appropriate for interactive editing. Instead, you might preview edits interactively using a still image (see the fullSizeImage property), and use this method to produce animated reviews upon the user’s request.

## See Also

### Processing an Editing Context’s Live Photo

- [saveLivePhoto(to:options:completionHandler:)](photos/phlivephotoeditingcontext/savelivephoto(to:options:completionhandler:).md)
- [PHLivePhotoEditingOption](photos/phlivephotoeditingoption.md)
- [cancel()](photos/phlivephotoeditingcontext/cancel().md)
