I have a one .MOV file and one .JPG file. When I'm trying to make a Live Photo:
func makeLivePhotoFromItems(imageURL: NSURL, videoURL: NSURL, previewImage: UIImage, completion: (livePhoto: PHLivePhoto) -> Void) {
PHLivePhoto.requestLivePhotoWithResourceFileURLs([imageURL, videoURL], placeholderImage: previewImage, targetSize: CGSizeZero, contentMode: PHImageContentMode.AspectFit) {
(livePhoto, infoDict) -> Void in
print("info: \(livePhoto)")
if let lp = livePhoto {
completion(livePhoto: lp)
}
}
}
And making like this:
makeLivePhotoFromItems(url, videoURL: movURL, previewImage: UIImage(named: "preview")!) { (livePhoto) in
}
its not working. Live photo not creating and console writes:
info: Optional(<PHLivePhoto: 0x10077f660>)
complete
info: Optional(<PHLivePhoto: 0x10143ef30>)
complete
2016-05-03 13:23:18.191 LivePhoto[2170:982987] Error: Invalid video metadata
info: nil
I am really hopes, that you can help me.