views:

34

answers:

1

Hi there,

I have a simple view that creates a MPMoviePlayerViewController when the user presses a button, using the presentMoviePlayerViewControllerAnimated: method. The new view controller slides in and shows the movie player, so far so good.

However, when the button is pushed, the current view controller slides out the bottom, showing a ugly (probably default) white view, that sticks around anywhere from half a second to a few seconds, until the movie view controller is shown. It seems like it's dependent on my network connection, as if the movie view controller is downloading parts of the movie before showing the player.

Am I doing something wrong, or how can I work around this? I'd really prefer to just show the movie view controller directly, maybe even without sliding out the previous view controller that holds the play button, but still animated like a modal view controller.

Thanks!

Christoph

A: 

The solution was to init the player view controller when the parent view is created, and then call prepareToPlay on the moviePlayer inside it. That removes the latency when the play button is pushed and (I guess) moves it to when the user gets to the parent view from which he can play the movie.

EDIT: This removes the delay, but for some reason, initializing the movie view controller also autoplays it when it's loaded, so that's not a good solution.

Christoph