gpt4 book ai didi

iphone - 如何从 UISaveVideoAtPathToSavedPhotosAlbum 检索视频

转载 作者:搜寻专家 更新时间:2023-10-30 20:22:23 25 4
gpt4 key购买 nike

在我的应用程序中,我使用 UISaveVideoAtPathToSavedPhotosAlbum 将视频保存到照片库。我正在获取视频的路径,但无法播放该视频。任何人都可以帮助我解决如何检索保存的视频的问题。提前致谢。我使用了下面显示的代码。

-(IBAction) getPhoto:(id) sender {
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;

if((UIButton *) sender == choosePhotoBtn) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
picker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie, (NSString *)kUTTypeImage, nil];

} else {
picker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie, (NSString *)kUTTypeImage, nil];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
}

[self presentModalViewController:picker animated:YES];
}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

NSString *tempFilePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
UISaveVideoAtPathToSavedPhotosAlbum(tempFilePath, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);
NSLog(@"temp path %@",tempFilePath);
[picker dismissModalViewControllerAnimated:YES];

}

最佳答案

NSURL *url = [NSURL fileURLWithPath:tempFilePath];并使用以下网址播放网址:“MPMoviePlayerController”

关于iphone - 如何从 UISaveVideoAtPathToSavedPhotosAlbum 检索视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7090290/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com