Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing the Movies and iTunes U videos on the iPad

In my app, I want to reproduce a view which looks exactly like the "Videos" native iPad app (it displays Movies and iTunes U videos located on the iPad).

I don't know how to access those elements on the iPad (Movies and iTunes U).

I've played with everything mentionned in the Apple documentation "IPod Library Access Programming Guide":

  • MPMediaItem
  • MPMediaPickerController
  • MPMediaQuery
  • MPMoviePlayerController …etc…

I thought I was close with MPMediaItem and MPMediaQuery, as two of the Flags seemed promising:

MPMediaTypeMovie = 1 << 8 MPMediaTypeVideoITunesU = 1 << 12

However, all the results I get only include songs.

Am I using the right classes to access those items? Considering the results I get, it seems like those classes can only access media items which are part of the iPod library, which I am not sure is the case for Movies and iTunes U videos.

I know that this is possible, because I've seen another app which accesses it (It's called "VideoPix"). It presents the "Video Library" in a Popover view, so at first I suspected it was using the MPMediaPickerController, because on the iPad, you can only use it in a Popover, but again, when I tried it, all I saw was songs, no Movies or iTunes U items :(

Thank you in advance!

Fred

like image 357
fredericouimet Avatar asked Nov 14 '22 07:11

fredericouimet


1 Answers

Check out the AVMovieExporter sample code, it is doing what you are talking about. I'm not sure about playback yet, but it is definitely listing them, although the DRM ones are not cooperating as nicely.

It is supposed to show an icon for each movie and when I ran it the one purchased (DRM) movie I have comes back with no thumbnail and in the console I get:

AVMovieExporter[642:5b17] couldn't generate thumbnail, error:Error Domain=AVFoundationErrorDomain Code=-11836 "Cannot Open" UserInfo=0x1cd9d550 {NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x1e09b5b0 "The operation couldn\342\200\231t be completed. (OSStatus error -12161.)", NSLocalizedFailureReason=This app is not authorized to play this file.}
like image 103
garafajon Avatar answered Jan 02 '23 08:01

garafajon