Fix possibility of trying to open multiple fullscreen video players

This commit is contained in:
Stanisław Chmiela 2016-04-01 14:56:03 +02:00
parent 4120a2a3b2
commit d304bfecbe

View File

@ -436,7 +436,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty";
- (void)setFullscreen:(BOOL)fullscreen - (void)setFullscreen:(BOOL)fullscreen
{ {
if( fullscreen ) if( fullscreen && !_fullscreenPlayerPresented )
{ {
// Ensure player view controller is not null // Ensure player view controller is not null
if( !_playerViewController ) if( !_playerViewController )
@ -468,7 +468,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty";
}]; }];
} }
} }
else else if ( !fullscreen && _fullscreenPlayerPresented )
{ {
[self videoPlayerViewControllerWillDismiss:_playerViewController]; [self videoPlayerViewControllerWillDismiss:_playerViewController];
[_presentingViewController dismissViewControllerAnimated:true completion:^{ [_presentingViewController dismissViewControllerAnimated:true completion:^{