views:

889

answers:

4

I have a MPMoviePlayerController and it plays fine when I play .mov from a server. I can play multiple movies in a row and I am not encountering any issues.

However, I also need to be able to play back some YouTube videos, and have embedded a UIWebView with that allows me to play YouTube videos. Playing several YouTube videos in a row is no problem. The problem occurs if I play a .mov video, and then try to play a YouTube video. The screen shows up with a landscape status bar, but all the controls are still in portrait mode. Sound works, but no video; just a black screen.

A: 

Really sounds like a bug to me... you should consider reporting it to Apple, if you haven't already.

It sounds vaguely related to another bug I've run into (the player sometimes keeps playing the audio after the movie is closed, and acts up next time it's launched). The workaround I found was to set

player.initialPlaybackTime = -1.0;

when I unload the player. It's a long shot, but you can give it a try.

alex_c
A: 

The movie player on the simulator has several known bugs, see also: http://stackoverflow.com/questions/1383925/video-playback-problems-in-iphone/1396975#1396975

Have you tried it on the actual device? I don't bother testing playback on the simulator at all these days.

Justicle
Yes. I have tested on my 3G S, because I have tested YouTube playback. The issue seems to be worse for those with a 3G. I have looked at Apple's example code, and even tried to use the exact same code, but with the same issues
Canada Dev
A: 

I've seen this too and it's definitely an Apple bug. Another one you might run into is that tapping on the status bar to scroll to the top of a table after playing a YouTube video doesn't seem to work.

Ben Lachman
A: 

I've seen this happening in one of my apps. The bottom line, is you need to make sure you only have one instance of the MPMoviePlayerController object in your app. If you have more than one all hell breaks loose in OS 3.x, including the symptoms you mention.

megastep