Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Live Photo loading from network #2302

Merged
merged 26 commits into from
Oct 11, 2024
Merged

Conversation

onevcat
Copy link
Owner

@onevcat onevcat commented Oct 11, 2024

This PR implements the requirement of #2297

It mainly adds a high level extension method to PHLivePhoto to load a live photo (with two URLs, one for still image, one for video). That means, you can now use this code to load a live photo easily:

let urls = [
  URL(string: "https://example.com/image.heic")!, // imageURL
  URL(string: "https://example.com/video.mov")!   // videoURL
]
let livePhotoView = PHLivePhotoView()
livePhotoView.kf.setImage(with: urls)

The still image and video data can be retrieved by PHAssetResourceManager.requestData and uploaded to the server by a user. Then in another client, these files can be loaded and it finally generates a PHLivePhoto object.

It is supported on all platforms where PHLivePhotoView is available (iOS, macOS, tvOS, etc).

For more detail, a following PR of documentation will be added soon.

@onevcat onevcat merged commit 608bfdb into master Oct 11, 2024
24 checks passed
@onevcat onevcat deleted the feature/live-photo branch October 11, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant