Photo != Movie
There’s more annoying than when Apple does something with their software that you can’t do. They legitimize it by telling you that they want to get the functionality near-perfect before releasing it for general use. I get that. But when they do something that I really need to be able to do and can’t it’s very frustrating.
Case in point: video. The way you get video from the 3GS is really quite odd. You use a class called UIImagePickerController. You have to set a non-obvious property to get it to run in video mode. Then the OS brings up a modal view that allows you to take/get the video.
So what? They’re forcing video to fit into a class it wasn’t meant for. Big deal, right? If there’s anyone guilty of abusing classes it’s me.
But there’s a real problem here. Photos and movies are inherently different. In image mode, the UIImagePickerController delegate gives you back UIImage objects (as the name of the class leads you to believe that it would). UIImages contain all kinds of data about themselves that are critical to have when manipulating images. They contain orientation data. You can do things like save the image to the camera roll. Find out color space info. Etc. When UIImagePickerController is run in video mode all you get back is an NSURL. A location on disk.
There’s no pertinent information I can glean from that. Generally, if you know what kind of file you’re going to be dealing with you can pull that data into a Cocoa Touch object that has all these extra attributes accessors on it (like, say, UIImage). But these video files are different. There’s no UIMovie object in Cocoa Touch. No UIVideo, either. Apple doesn’t want you mucking about with video files on the iPhone so all they give you is the location. And in most cases the location is fine. You can kick off an MPMediaPlayer instance and pass in that NSURL. Boom! Full screen video. It even knows which way is up.
But what if the video was taken upside down or sideways? The iPhone knows which way is up and should tags movies correctly, right? Look at the video uploading functionality in the Camera app. You can go straight to MobileMe or Youtube. You can even run compression on the videos before they’re uploaded (!).
It’s because there’s a private class that Apple wraps around video objects, and me and you aren’t cool enough to use it. And it’s really starting to piss me off.
