From a2a7cf14525ffbad428398c26235960ab997aa9b Mon Sep 17 00:00:00 2001 From: Ahmed Barakat Date: Sat, 2 Jun 2018 14:55:55 +0200 Subject: [PATCH] Fix partial swiping on video shows black screen In iOS 11, Apple added a feature to close the Video Player via a swipe gesture. Partial swiping cases viewWillDisappear to be called without viewDidDisappear which cases a black screen. --- ios/RCTVideoPlayerViewController.m | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ios/RCTVideoPlayerViewController.m b/ios/RCTVideoPlayerViewController.m index 1b7606fd..7809221a 100644 --- a/ios/RCTVideoPlayerViewController.m +++ b/ios/RCTVideoPlayerViewController.m @@ -8,13 +8,9 @@ - (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; - [_rctDelegate videoPlayerViewControllerDidDismiss:self]; -} - -- (void)viewWillDisappear:(BOOL)animated { - [_rctDelegate videoPlayerViewControllerWillDismiss:self]; - [super viewWillDisappear:animated]; + [super viewDidDisappear:animated]; + [_rctDelegate videoPlayerViewControllerWillDismiss:self]; + [_rctDelegate videoPlayerViewControllerDidDismiss:self]; } @end