diff --git a/RCTVideoPlayerViewController.h b/RCTVideoPlayerViewController.h index aac5e026..fc2675fc 100644 --- a/RCTVideoPlayerViewController.h +++ b/RCTVideoPlayerViewController.h @@ -8,7 +8,8 @@ #import #import "RCTVideo.h" +#import "RCTVideoPlayerViewControllerDelegate.h" @interface RCTVideoPlayerViewController : AVPlayerViewController -@property (nonatomic, weak) id rctVideoView; +@property (nonatomic, weak) id rctDelegate; @end diff --git a/RCTVideoPlayerViewController.m b/RCTVideoPlayerViewController.m index 118180a7..b1b768d7 100644 --- a/RCTVideoPlayerViewController.m +++ b/RCTVideoPlayerViewController.m @@ -14,9 +14,15 @@ @implementation RCTVideoPlayerViewController -- (IBAction)close:(id)sender +- (void)viewDidDisappear:(BOOL)animated { - [self.rctVideoView setFullscreen:false]; + [super viewDidDisappear:animated]; + [_rctDelegate videoPlayerViewControllerDidDismiss:self]; +} + +- (void)viewWillDisappear:(BOOL)animated { + [_rctDelegate videoPlayerViewControllerWillDismiss:self]; + [super viewWillDisappear:animated]; } @end