Skip to main content

MKMoviPlayer Notification


Some Notifications that generates MKMoviePlayer:
MPMoviePlayerPlaybackStateDidChangeNotification
MPMoviePlayerLoadStateDidChangeNotification 

[[NSNotificationCenter defaultCenter] addObserver: self 
                                             selector: @selector(playBackStateChanged:) 
                                                 name: MPMoviePlayerLoadStateDidChangeNotification 
                                               object: moviePlayerViewController.moviePlayer];

-(void)playBackStateChanged:(id)sender{
    MPMoviePlaybackState playbackState = [moviePlayerViewController.moviePlayer playbackState];

    switch (playbackState) {

        case MPMoviePlaybackStateStopped :


            break;

        case MPMoviePlaybackStatePlaying :
            [yourActivityIndicatorView stopAnimating];
            break;

        case MPMoviePlaybackStateInterrupted :
            [yourActivityIndicatorView startAnimating];
            break;
    }
}

Comments

Post a Comment