ios - [iOS]如何将视频转换为实时照片?

标签 ios objective-c phlivephoto

如何将video转换为LivePhoto

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {

}

谢谢。

最佳答案

/// Requests a Live Photo from the given resource URLs. The result handler will be called multiple times to deliver new PHLivePhoto instances with increasingly more content. If a placeholder image is provided, the result handler will first be invoked synchronously to deliver a live photo containing only the placeholder image. Subsequent invocations of the result handler will occur on the main queue.
//  The targetSize and contentMode parameters are used to resize the live photo content if needed. If targetSize is equal to CGRectZero, content will not be resized.
//  When using this method to provide content for a PHLivePhotoView, each live photo instance delivered via the result handler should be passed to -[PHLivePhotoView setLivePhoto:].
+ (PHLivePhotoRequestID)requestLivePhotoWithResourceFileURLs:(NSArray<NSURL *> *)fileURLs placeholderImage:(UIImage *__nullable)image targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode resultHandler:(void(^)(PHLivePhoto *__nullable livePhoto, NSDictionary *info))resultHandler;

关于ios - [iOS]如何将视频转换为实时照片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34785802/

相关文章:

ios - iOS-后退按钮IOS6 vs IOS7

ios - 如何使用SDWebImage在iOS中设置渐进式图像?

ios - 尝试使用 PHLivePhotoView objective-c 显示实时照片时图像元数据无效

ios - 使用 UIActivityViewController 分享实时照片

ios - 如何从 SkView 中放松

ios - 每部分一个复选标记

ios - 将设备 token 存储在 AppDelegate 中,然后在 ViewController 中使用它

swift - 为什么 iOS 实时照片的视频尺寸比照片小

ios - 在iOS的按需资源中,有什么方法可以阻止清除/清除 Assets 吗?

ios - AIR for iOS StageVideo 音量控制