0

I'm developing app for IPhones where users clicks button, gets the list of all videos from his IPhone and uploads chosen video to server. I know how to upload video to server, but I don't know how to implement video searching. How can I get pathes to all videos (in users IPhone) in Array? (Currently my IPhone is unavailable for use, so I'd like to know also how to test video search in IPhone Simulator?)

Kind Regards

2 Answers2

0

This link shows how to access only videos from the photoroll since all videos of the device should be stored there, you should be able to access them from there: Picking video from PhotoLibrary with UIImagePickerController in OS 3.1

Community
  • 1
  • 1
Yo_Its_Az
  • 2,043
  • 2
  • 18
  • 25
0

You need to use the UIImagePickerController component, configuring it to show only videos when browsing the library.

You can do that by setting the mediaTypes property of the picker in this way:

myImagePickerController.mediaTypes =
   [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];

Then if you want to test it in the simulator, you need to save some videos on it and you can use the UISaveVideoAtPathToSavedPhotosAlbum function to achieve that. Check out this great answer for more detailed instructions.

Community
  • 1
  • 1
Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
  • Thanks for this answer, however I'd like to clarify some details. So first I add UIImagePickerController.h to my project, then create function and write there: `UIImagePickerController *myImagePickerController;` Then I paste your code and set a button for this function and this must work right? If yes thanks a lot. – Игорь Дудник Dec 25 '12 at 07:38
  • In order to understand how to use properly that component, I suggest you to check out the example you can find in the documentation I linked. My line of code is only to limit the browsing to videos. Of course there's more to set :) – Gabriele Petronella Dec 25 '12 at 08:59