views:

795

answers:

5

i have post this question before but cannot get a answer so i post it again.is about the MoviePlayer sample download from iphone developer site, when i press the Done button come with the movie player control mode, the movie was finish and exit to main view,at the same time the moviePlayBackDidFinish function have been called, however when i play the movie again, the player screen keep blinking,how to prevent this?

the code i didnt make any change is completly build from the sample code downloaded from apple site, have anybody met this problem before,and solve it?

A: 

I have the same problem, any answer yet?

zanikalache
A: 

I don't have any problem replaying the movie, but I wonder if I'm looking at the same version you are. I pulled up the sample in the /Developer... directory, with a link from xCode documentation. It's named MoviePlayer, the readme.txt says version 1.3, and it has two tabs, "streaming" and "local". I start the local movie, "done" it, then restart with no trouble. I'm on Leopard with xCode 3.1.4, and it works in both simulator and device. I'm running v3.1.1 on an iPod Touch.

so are you guys looking at a different version of the sample than I am, or what's different with your setup?
[I would have made this a comment but not enough rep yet...]

wkw
A: 

I also have this problem, no solution so far :(

Prody
+1  A: 

This problem is occurs only in the simulator not on the actual device. If you want to get rid of this you need to release the MoviePlayer and allocate a new one each time you play a movie. E.g.:

- (void) moviePlayBackDidFinish:(NSNotification*)notification
{
    // remove observer
    [[NSNotificationCenter defaultCenter] 
     removeObserver:self
     name:MPMoviePlayerPlaybackDidFinishNotification
     object:thePlayer];

    [thePlayer release];
}

and

thePlayer = [[MPMoviePlayerController alloc] initWithContentURL:theMovie];

[[NSNotificationCenter defaultCenter] 
     addObserver:self 
     selector:@selector(moviePlayBackDidFinish:) 
     name:MPMoviePlayerPlaybackDidFinishNotification 
     object:thePlayer];

[thePlayer play];

elsewhere.

Captain Fim
A: 

Also there is one more bug with this sample code.

After you have tried the streaming tab and played a movie via http stream, without quitting the app, try to play the local video..IT WILL POP AN ALERT SAYING THE FILE COULD NOT BE FOUND!

Anybody else come across this!

Rakshak Kalwani