我已经搜索了很多,但是找不到一个基本的UIImagepicker
视频保存代码。我已经设置好了一切,但只得到一个空白的界面。
- (void)imagePickerController:(UIImagePickerController *)
picker didFinishPickingMediaWithInfo:(NSDictionary *)
info{
}
我知道这与字典有关,但之后我就迷失了,需要帮助吗?
我已经搜索了很多,但是找不到一个基本的UIImagepicker
视频保存代码。我已经设置好了一切,但只得到一个空白的界面。
- (void)imagePickerController:(UIImagePickerController *)
picker didFinishPickingMediaWithInfo:(NSDictionary *)
info{
}
尝试使用以下代码将视频保存到相册。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissModalViewControllerAnimated:YES];
//get the videoURL
NSString *tempFilePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
if ( UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(tempFilePath))
{
// Copy it to the camera roll.
UISaveVideoAtPathToSavedPhotosAlbum(tempFilePath, self, @selector(video:didFinishSavingWithError:contextInfo:), tempFilePath);
}
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self dismissModalViewControllerAnimated:YES];
}
- (void) video: (NSString *) videoPath
didFinishSavingWithError: (NSError *) error
contextInfo: (void *) contextInfo {
NSLog(@"Finished saving video with error: %@", error);
}
UISaveVideoAtPathToSavedPhotosAlbum(tempFilePath, self, @selector(video:didFinishSavingWithError:contextInfo:), (__bridge void *) tempFilePath);
- elliotrock