Fix dismissal code not running by creating subclass of view controller and notifying view

This commit is contained in:
Stanisław Chmiela
2016-03-31 23:10:25 +02:00
parent 4bbce5e378
commit d073847ce0
5 changed files with 47 additions and 1 deletions

View File

@@ -71,7 +71,8 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty";
}
- (AVPlayerViewController*)createPlayerViewController:(AVPlayer*)player withPlayerItem:(AVPlayerItem*)playerItem {
AVPlayerViewController* playerLayer= [[AVPlayerViewController alloc] init];
RCTVideoPlayerViewController* playerLayer= [[RCTVideoPlayerViewController alloc] init];
playerLayer.rctDelegate = self;
playerLayer.view.frame = self.bounds;
playerLayer.player = _player;
playerLayer.view.frame = self.bounds;
@@ -472,6 +473,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty";
[_presentingViewController dismissViewControllerAnimated:true completion:^{
_fullScreenPlayerPresented = fullscreen;
_presentingViewController = nil;
[self setControls:_controls];
[_eventDispatcher sendInputEventWithName:@"onVideoFullscreenPlayerDidDismiss" body:@{@"target": self.reactTag}];
}];
}