tags:

views:

323

answers:

1

Hi Friends,

I already hide the status bar in my application using [[UIApplication sharedApplication] setStatusBarHidden:YES];. But when i play movie then automatically it display the status bar on the top.

Does anyone knows that how to hide the status bar while playing movie.

Thanks.

A: 

You could subscribe to the MPMoviePlayerPlaybackStateDidChangeNotification notification and make sure the status bar is hidden as soon as playback starts.

Your handler would look something like that :

- (void)playbackStateDidChange:(NSNotification *)notification {
    MPMoviePlayerController *mpv = (MPMoviePlayerController *)notification.object;
    if (mpv.playbackState == MPMoviePlaybackStatePlaying) {
        [[UIApplication sharedApplication] setStatusBarHidden:YES];
    }
}
megastep