我有一个 .MOV 文件和一个 .JPG 文件。当我尝试制作实时照片时:
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)
}
}
}
像这样制作:
makeLivePhotoFromItems(url, videoURL: movURL, previewImage: UIImage(named: "preview")!) { (livePhoto) in
}
它不工作。未创建实时照片和控制台写道:
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
我真的很希望,你能帮助我。