MPMoviePlayerController switching movies causes white flash

Posted by bennythemink on Stack Overflow See other posts from Stack Overflow or by bennythemink
Published on 2010-12-30T04:43:37Z Indexed on 2010/12/30 4:54 UTC
Read the original article Hit count: 260

Filed under:
|

Hi guys,

I have a small UIView that displays a repeated movie. When the user taps a button another movie is loaded and displayed in the same UIView.

The problem is that there is a half second "flash" between the removing of the first movie and the displaying of the second. Is there any to remove this?

<code>
- (void) setUpMovie:(NSString*)title {
NSString *url = [[NSBundle mainBundle] pathForResource:title ofType:@"mp4"];

MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];
[[player view] setFrame:self.movieView.bounds];
[self.movieView addSubview:player.view];
if ([title isEqualToString:@"Bo_idle_02"]) {
    [player setRepeatMode:MPMovieRepeatModeOne];
} else {
    [player setRepeatMode:MPMovieRepeatModeNone];
}
[player setControlStyle:MPMovieControlStyleNone];
[player play];
}

- (void) startDanceAnimation { [self setUpMovie:@"Bo_dance_02"]; return; }
</code>

© Stack Overflow or respective owner

Related posts about iphone

Related posts about movie