I have a CollectionView
with images and in the next ViewController
I am recording a video using Av captured sessions and i am saving it in to the mobile document directory,Then i am coming back to the collection and i am reloading the collection view now i want the recored video in the collection view cell with out using any api.
I used the below code to save the recored video in the directory
'- (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];
});
}];
});
can any body help out to solve this problem.solution view code is appreciated. i recored video by referring this https://github.com/shu223/SlowMotionVideoRecorder