diff options
| author | Teddy Wing | 2012-04-17 00:42:28 -0400 |
|---|---|---|
| committer | Teddy Wing | 2012-04-17 00:42:28 -0400 |
| commit | 33f1899fcb0619418d15da2009e6d2ffbf2a5688 (patch) | |
| tree | 72372c42c7bdc53112d1ddb5d86174a7460def96 | |
| parent | c24b41c69846727f0c4907949a60df77dcd33596 (diff) | |
| download | Video-Tuneup-33f1899fcb0619418d15da2009e6d2ffbf2a5688.tar.bz2 | |
Implemented UIImagePickerController Delegate method. Trying to get chosen video's NSURL, but having issues.
* BUG: after clicking the 'Use' button, a progress bar appears saying "Compressing video...", but then the app seems to stall. What happens on an actual device?
| -rw-r--r-- | Video Tuneup/ViewController.h | 3 | ||||
| -rw-r--r-- | Video Tuneup/ViewController.m | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/Video Tuneup/ViewController.h b/Video Tuneup/ViewController.h index fb2f19a..b045b91 100644 --- a/Video Tuneup/ViewController.h +++ b/Video Tuneup/ViewController.h @@ -13,7 +13,8 @@ @class PlayerView; -@interface ViewController : UIViewController { +// UIImagePickerControllerDelegate requires that we conform to UINavigationControllerDelegate +@interface ViewController : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate> { AVURLAsset *asset; AVURLAsset *songAsset; diff --git a/Video Tuneup/ViewController.m b/Video Tuneup/ViewController.m index e26af47..972bcce 100644 --- a/Video Tuneup/ViewController.m +++ b/Video Tuneup/ViewController.m @@ -405,7 +405,7 @@ mScrubber, mediaLibraryButton, mediaLibraryPopover; UIButton *theButton = (UIButton *)sender; UIImagePickerController* picker = [[UIImagePickerController alloc] init]; - //picker.delegate = self; + picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; mediaLibraryPopover = [[UIPopoverController alloc] initWithContentViewController:picker]; @@ -413,6 +413,15 @@ mScrubber, mediaLibraryButton, mediaLibraryPopover; } +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + [mediaLibraryPopover dismissPopoverAnimated:YES]; + + NSLog(@"MEDIA URL:"); + NSLog(@"%@", [info objectForKey:UIImagePickerControllerMediaURL]); + NSLog(@"MEDIA REFERENCE URL:"); + NSLog(@"%@", [info objectForKey:UIImagePickerControllerReferenceURL]); +} + #pragma mark - View controller boilerplate - (void)didReceiveMemoryWarning { |
