2016-01-04 4 views
1

J'utilise MPMovieplayer comme sous-vue tout fonctionne bien, mais mon problème est quand je clique sur la vidéo plein écran puis de revenir à la petite image vidéo puis la barre d'état chevauche la barre de navigationBarre d'état chevauche la barre de navigation: MPMoviePlayerController

Voici mon Code

// Setup player 
MPMoviePlayerController* mp = 
[[MPMoviePlayerController alloc] initWithContentURL:videoURL]; 
mpc = mp; 
mpc.shouldAutoplay = YES; 
[mpc prepareToPlay]; 
mpc.view.frame = CGRectMake(0, 0, 320, 320); 

mpc.backgroundView.backgroundColor = [UIColor redColor]; 
[self.view addSubview:mpc.view]; 

enter image description here

Répondre

1

Je résolu en faisant ajoutant la clé dans le fichier .plist

'View controller-based status bar appearance' and set to NO. 

puis définissez la barre d'état caché à NO

0
/* Create a new movie player object. */ 
    MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; 

    if (player) 
    { 
     /* Save the movie object. */ 
     [self setMoviePlrController:player]; 

     /* Register the current object as an observer for the movie 
     notifications. */ 
     [self installMovieNotificationObservers]; 

     /* Specify the URL that points to the movie file. */ 
     [player setContentURL:movieURL]; 

     /* If you specify the movie type before playing the movie it can result 
     in faster load times. */ 
     [player setMovieSourceType:sourceType]; 
     [player setRepeatMode:MPMovieRepeatModeNone]; 
     player.scalingMode = MPMovieScalingModeAspectFit; 

     // Apply the user movie preference settings to the movie player 
     [self.moviePlrController.view setAutoresizingMask:(UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth)]; 
     [self.playerView addSubview:[self moviePlrController].view]; 
     CGRect frame = self.playerView.frame; 
     int width = frame.size.width; 
     int height = frame.size.height; 



     [[self moviePlrController].view setFrame:CGRectMake(0, 0, width, height)]; 
    } 
+0

Merci pour votre replay, mais mon problème est lié barre d'état ti –