Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try it on Real iPhone Device</p> <p>here is the code for picking video from iPhone library which i have used in my project</p> <p>Just add video method from selector to your desired button</p> <pre><code> -(void)video { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil]; [self presentModalViewController:imagePicker animated:YES]; } -(void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info { NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType]; if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) { NSString *moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path]; NSURL *videoUrl=(NSURL*)[info objectForKey:UIImagePickerControllerMediaURL]; // NSLog(@"%@",moviePath); if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) { UISaveVideoAtPathToSavedPhotosAlbum (moviePath, nil, nil, nil); } } [self dismissModalViewControllerAnimated:YES]; [picker release]; } </code></pre> <p>Do not forget to add mobile core services framework</p> <p>and to import</p> <pre><code> #import &lt;MobileCoreServices/UTCoreTypes.h&gt; </code></pre> <p>the string "moviepath" give you the path of the video in that iPhone then perform any desired thing with that video. You will get video path after compressing is done in string movie path and "videourl" is url for that video To play that video</p> <pre><code> MPMoviePlayerController *player =[[MPMoviePlayerController alloc] initWithContentURL: url]; // give here the "videourl" [[player view] setFrame: [self.view bounds]]; [self.view addSubview: [player view]]; [player play]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload