views:

783

answers:

4

Hello,

I would like to push a video into iPhone simulator to test video picking in UIImagePickerController. Is it possible to do that? And if it possible, could you please provide me with some advices?

Thanks.

A: 

what do you mean push video? get video from an image picker controller? If so the video source is not available in the simulator so you like the previous answer said you can load the video on to your simulator and pick it like that, you wont be able to record video however, (on the simulator)

Daniel
+3  A: 

You can subclass UIImagePickerController to override its behaviour and provide your own view. If you do this, you can then call imagePickerController:didFinishPickingMediaWithInfo: and supply your own pre-recorded video. If you include a video actually recorded from an iPhone 3GS, the behaviour you get will be pretty damn similar to that of the actual device.

Of course, always always always test on a real device before shipping!

We use a subclass of CLLocationManager in a very similar fashion to give a better location simulation.

iKenndac
+4  A: 

I made it easier: first, I recorded a sample screencast with QuickTime X and saved it for iPhone. then, I copied it to '~/Library/Application Support/iPhone Simulator/User/Media/DCIM/100APPLE/VID_0001.m4v' (maybe you'll need to create 100APPLE directory). relaunched iPhone simulator and saw my video under 'Saved Photos' in Photos.app. when I use UIImagePickerController, that video is there and I'm able to choose it.

If that helps, I use SDK 3.2.1 on 10.6.2.

sgosha