【发布时间】:2016-12-08 15:42:25
【问题描述】:
我有一个带有图像的CollectionView,在下一个ViewController 我正在使用 Av 捕获的会话录制视频,并将其保存到移动文档目录中,然后我将返回集合,我是现在重新加载集合视图我想要在集合视图单元格中录制的视频而不使用任何 api。
我使用下面的代码将录制的视频保存在目录中
'- (void)saveRecordedFile:(NSURL *)recordedFile {
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
ALAssetsLibrary *assetLibrary = [[ALAssetsLibrary alloc] init];
[assetLibrary writeVideoAtPathToSavedPhotosAlbum:recordedFile
completionBlock:
^(NSURL *assetURL, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
NSString *title;
NSString *message;
if (error != nil) {
title = @"Failed to save video";
message = [error localizedDescription];
}
else {
title = @"Saved!";
message = nil;
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
UIStoryboard *storybord=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
shareViewController *shareview=[storybord instantiateViewControllerWithIdentifier:@"share"];
[self presentViewController:shareview animated:YES completion:nil];
});
}];
});
任何机构都可以帮助解决这个问题。解决方案视图代码表示赞赏。我通过引用此https://github.com/shu223/SlowMotionVideoRecorder 录制视频
【问题讨论】:
-
@Suraj sukale 你能给出任何解决方案吗
-
您在“cellForItemsAtIndex”方法中执行此操作。为视频解析项出列视频单元。
-
你能给我一些链接或代码吗
标签: ios objective-c xcode uicollectionview avcapturesession