I would like to remove the audio and the subtitle settings button from the player (iOS8, iOS9):
Player's controller initialization:
- (void) configureMoviePlayer {
if(self.moviePlayerController == nil) {
self.moviePlayerController = [[AVPlayerViewController alloc] init];
[self.view setTranslatesAutoresizingMaskIntoConstraints:NO];
[self.moviePlayerController.view setTranslatesAutoresizingMaskIntoConstraints:NO];
[self.view addSubview: [self.moviePlayerController view]];
NSDictionary *views = @{ @"selfview" : self.view, @"movieControllerView" : [self moviePlayerController].view};
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[movieControllerView]|"
options:0
metrics:nil
views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[movieControllerView]|"
options:0
metrics:nil
views:views]];
}
}
When the stream URL is received, it is passed to a new player instance:
self.moviePlayerController.player = [AVPlayer playerWithURL:self.contentUrl];
//self.moviePlayerController.showsPlaybackControls = YES;
if([self.moviePlayerController respondsToSelector:@selector(allowsPictureInPicturePlayback)]) {
self.moviePlayerController.allowsPictureInPicturePlayback = YES;
}
The example in the WWDC video does not contain the button. Is there a way to disable just the single button, or get the array of the default toolbar buttons and disable a specific one.