QDLivePhotoKit
从 mp4 文件生成 Live Photo
安装
CocoaPods
首选的安装方法是用 CocoaPods. 将以下内容添加到你的 Podfile 中:
pod 'QDLivePhotoKit', '~> 0.1.0'
使用方法
获取文件作为 AVURLAsset
[[QDLivePhotoManager sharedManager] saveLivePhotoWithAsset:urlAsset completionHandler:^(BOOL success) {
if (success) {
NSLog(@"success");
} else {
NSLog(@"fail");
}
}];
获取文件路径
你必须有权访问路径下的文件
[[QDLivePhotoManager sharedManager] saveLivePhotoWithPath:path completionHandler:^(BOOL success) {
if (success) {
NSLog(@"success");
} else {
NSLog(@"fail");
}
}];
需求
iOS9.1或更高版本。需要ARC
许可
QDLivePhotoKit是在MIT许可下发布的。详情请见LICENSE。