I recently found this question about MPMediaPickerController
not recognizing videos, which is exactly what I'm trying to do: let the user select videos from their iPod/Video library. (Not user-filmed videos, I mean iTunes TV shows and such). That link seems to confirm that this is a known problem, but the accepted answer doesn't actually provide a solution.
I used the code provided in John Goodstadt's answer to confirm that I HAVE videos on the device, but I'd prefer not to have to generate my own UI for a "video picker" when the MPMediaPickerController
should do it automatically, using the Apple-provided Media Item Type Flags
:
// audio media types
MPMediaTypeMusic = 1 << 0,
MPMediaTypePodcast = 1 << 1,
MPMediaTypeAudioBook = 1 << 2,
MPMediaTypeAudioITunesU = 1 << 3, // available in iOS 5.0
MPMediaTypeAnyAudio = 0x00ff,
// video media types
MPMediaTypeMovie = 1 << 8,
MPMediaTypeTVShow = 1 << 9,
MPMediaTypeVideoPodcast = 1 << 10,
MPMediaTypeMusicVideo = 1 << 11,
MPMediaTypeVideoITunesU = 1 << 12,
MPMediaTypeAnyVideo = 0xff00,
// generic media type
MPMediaTypeAny = ~0
Thing is, whenever I try to do this:
MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAny];
(which works) and then I change MPMediaTypeAny
to MPMediaTypeAnyVideo
, I get:
Warning: Unsupported media types (65280), using MPMediaTypeAny.
Am I missing something? Is there some quick-and-easy fix to this, or am I really going to have to create my own VideoPicker from scratch? And if that is the case, can anyone satisfy my curiosity and explain why MPMediaPickerController
doesn't seem to like videos anymore?