views:

491

answers:

3

Anybody is seeing this behavior on iPhone 3.0?

On my app, touching on the video link/button will take about 4-5 seconds before the movie player will show up on the screen. This doesn't look right.

Anybody have any suggestion to decrease this "wait time"?

A: 

I'm seeing this as well - anyone here or otherwise find a workaround or solution? video works beautifully on 2.2.1 and below, but has a delay before playing on 3.0 and above.

tiki
This problem is fixed with the latest 3.1.2 patch.
Seymour Cakes
+1  A: 

I saw that behavior too. I wonder if the wait time might be the time to find the appropriate decoder for the video format (because I saw some logs in the console at that moment indicating that some codec was not found).

Anyway, I set a waiting screen in my app, and wait for the MPMoviePlayerContentPreloadDidFinishNotification notification. Then I launch [myMoviePlayerController play].

Hope that will help.

Unfalkster
+1  A: 

In order to get the MPMoviePlayerController to display immediately, you have to call the [myPlayer play] method right away. It is the play method that actually establishes the view on the screen and you probably don't want to wait until loading completes to call this.

You still may want to use your own waiting screen as mentioned by Unfalkster. There are a few intermittent pauses depending on the video source and having a waiting screen helps tighten up the presentation.

If you call [myPlayer setBackgroundColor: [UIColor clearColor]] then the video control will be transparent when it does appear so that your waiting screen and any logos or messages displayed on it will show all the way up until the video starts playing.

This is by far the cleanest approach and is consistent with what the YouTube application is doing.

Barney

Barney Mattox