0

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?

Community
  • 1
  • 1
Nerrolken
  • 1,975
  • 3
  • 24
  • 53
  • What happens with: `initWithMediaTypes:MPMediaTypeMovie | MPMediaTypeTVShow | ...`? – Wain Aug 02 '13 at 22:39
  • Same error with a different code: `Unsupported media types (256)` for Movies, `Unsupported media types (512)` for TV shows, etc. – Nerrolken Aug 02 '13 at 22:45

1 Answers1

1

Based on the response to this question, you might be out of luck in terms of using MPMediaPickerController. You might consider rolling your own, most likely accessing the media library directly. If you do, be sure to release your code on Github! :)

Let me know if you have any other questions.

Community
  • 1
  • 1
Dany Joumaa
  • 2,030
  • 6
  • 30
  • 45
  • The accepted answer to that question says no, but it's from 2010, and there's an answer from 2012 that makes it sound like it's possible. I'm holding out hope that the second answer is more current, but yeah, I may just need to suck it up and reinvent the wheel. Thanks! – Nerrolken Aug 03 '13 at 00:11
  • Hm, I just looked at that code. The "correct" answer simply employs a regular media query; I don't think it alone implies that Apple has added support for video browsing to MPMediaPickerController. If you find out otherwise definitely let me know. – Dany Joumaa Aug 03 '13 at 00:16