내 응용 프로그램에서 시뮬레이터에서 비디오를 가져와야하고 server.can에 업로드해야합니다. 가능한 한 빨리 모든 솔루션을 제공하십시오.갤러리에서 영상을 가져 오는 방법
답변
먼저
감사 & 감사 T.swathi, 클래스에서 [UIImagePickerController를
을 작성, 당신은 선택 도구에 위임 속성에 UIImagePickerControllerDelegate 프로토콜 및 와이어 그것을 구현해야합니다. 사용자가 무언가를 선택하면 didFinishPickingMediaWithInfo에서 선택한 미디어의 위치를 가져올 수 있어야합니다.
//
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// this is the file system url of the media
NSURL* videoUrl = [info objectForKey:UIImagePickerControllerMediaURL];
// TODO: read in data at videoUrl and write upload it to your server
}
imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = 자기; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagePicker.mediaTypes = [[NSArray alloc] initWithObjects : (NSString *) kUTTypeMovie, nil]; 는 방법은 다음 따르고 – user3092286
내가 UIImagepicker을 만드는 오전 방법을 호출되지 않습니다 위임 당신은 .H 파일에 위임을 선언
예 내가 .H 파일에 decalred – user3092286
사용이 기능은 전체
-(void)selectVideoButtonClicked:(id)sender{
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
[self presentViewController:imagePicker animated:YES completion:nil];
}
도움이 위임 기능 선택을 사용하여 "UIImagePickerControllerDelegate"& 및 가져 오기 프레임 워크의 delege을 할 수 없습니다 시뮬레이터의 iOS 장치에서 확인 라이브러리의 비디오
MobileCoreServices.framework 프로젝트에서 첫 번째 가져 오기 및 파일에서 가져 오기 이후 CoreServ 빙과/CoreServices.h
- (void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info {
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
// Handle a movie capture
if (CFStringCompare ((CFStringRef) mediaType, kUTTypeMovie, 0)
== kCFCompareEqualTo) {
NSString *moviePath = [[info objectForKey: UIImagePickerControllerMediaURL] path];
NSLog(@" Video Path %@",moviePath);
NSString *fileName = [[NSString alloc]init];
//If you wants get File Name Then you can use this
if ([moviePath rangeOfString:@"//"].location != NSNotFound) {
NSString *separatorString = @"//";
NSArray *disSplit = [moviePath componentsSeparatedByString:separatorString];
fileName = disSplit[1] ;
// [self videoUploadingDirect:moviePath];
}
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) {
UISaveVideoAtPathToSavedPhotosAlbum (moviePath, nil, nil, nil);
}
}
[self dismissViewControllerAnimated:YES completion:nil];
}
감사
- 1. 갤러리에서 이미지 만 가져 오는 방법
- 2. 갤러리에서 갤러리 이미지를 가져 오는 방법은 무엇입니까?
- 3. 갤러리에서 모든 이미지를 가져 오는 방법은 무엇입니까?
- 4. 갤러리에서 이미지를 가져 오는 동안 이미지를 압축하는 방법
- 5. android에서 갤러리에서 가져 오는 중복 이미지를 찾는 방법
- 6. 갤러리에서 이미지를 가져 오는 동안 이미지 이름을 가져 오는 방법은 무엇입니까?
- 7. 나는 영상을 변경할 수있는 방법
- 8. 갤러리에서 corona sdk로 이미지를 가져 오는 방법은 무엇입니까?
- 9. 블랙 베리 갤러리에서 이미지를 가져 오는 방법은 무엇입니까?
- 10. 갤러리에서 .jpg 파일 형식으로 이미지를 가져 오는 방법은 무엇입니까?
- 11. android에서 찍은 사진을 가져 오는 방법
- 12. 갤러리에서 여러 이미지 선택
- 13. 게시물의 갤러리에서 이미지 가져 오기 WordPress 3.5
- 14. iOS : 갤러리에서 이미지 가져 오기
- 15. HTML5 캔버스에서 getImageData를 사용하여 하위 이미지의 부 영상을 얻는 방법
- 16. wordpress 갤러리에서 사진 배열 가져 오기
- 17. OutputStream 가져 오는 방법
- 18. 파일을 가져 오는 방법
- 19. 별칭을 가져 오는 방법
- 20. 데이터를 가져 오는 방법
- 21. Enum을 가져 오는 방법
- 22. Facebook - 가져 오는 방법
- 23. mysqldb 가져 오는 방법
- 24. com.google.android.maps.GestureDetector를 가져 오는 방법
- 25. jms를 가져 오는 방법
- 26. 결과를보기로 가져 오는 방법
- 27. 파일을 가져 오는 방법
- 28. Python에서 가져 오는 방법
- 29. csv로 가져 오는 방법
- 30. com.mysql.jdbc.Driver를 가져 오는 방법
[UIImagePickerController를 (http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html :)) –