设为首页 加入收藏

TOP

机试题:地图定位、拍照并显示、录制视频并播放(二)
2017-10-13 10:33:06 】 浏览:2652
Tags:试题 地图 定位 拍照 显示 录制 视频 播放
er:self.picker animated:YES completion:nil]; }
#pragma mark - 代理方法 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ NSString *mediaType=[info objectForKey:UIImagePickerControllerMediaType]; if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {//当是拍照时 UIImage *image; //如果允许编辑则获得编辑后的照片,否则获取原始照片 if (self.picker.allowsEditing) { image = [info objectForKey:UIImagePickerControllerEditedImage];//获取编辑后的照片 }else{ image = [info objectForKey:UIImagePickerControllerOriginalImage];//获取原始照片 } [self.imgView setImage:image];//显示照片 //UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);//保存相片到相簿 } else if([mediaType isEqualToString:(NSString *)kUTTypeMovie]){//当是录制视频时 NSURL *url=[info objectForKey:UIImagePickerControllerMediaURL];//视频路径 NSString *urlStr=[url path]; // //保存视频到相簿 // if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(urlStr)) { // UISaveVideoAtPathToSavedPhotosAlbum(urlStr, self, nil, nil);//保存视频到相簿 // } self.movieUrl =[NSURL fileURLWithPath:urlStr]; [self.moviePlayer play]; } // 关闭照片选择器 [self dismissViewControllerAnimated:YES completion:nil]; } View Code

 

DEMO下载:

github地址:https://github.com/xiaotanit/Tan_LocationPhotoVideo

 

原文链接:http://www.cnblogs.com/tandaxia/p/5507154.html

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇iOS面试题总结 (三) 下一篇面向对象(OOP)和面向过程(POP)

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目