Use the delegate in controller

This commit is contained in:
Stanisław Chmiela 2016-04-01 10:51:31 +02:00
parent c3b5a1b4cf
commit 9fefa996f2
2 changed files with 10 additions and 3 deletions

View File

@ -8,7 +8,8 @@
#import <AVKit/AVKit.h>
#import "RCTVideo.h"
#import "RCTVideoPlayerViewControllerDelegate.h"
@interface RCTVideoPlayerViewController : AVPlayerViewController
@property (nonatomic, weak) id<RCTVideo> rctVideoView;
@property (nonatomic, weak) id<RCTVideoPlayerViewControllerDelegate *> rctDelegate;
@end

View File

@ -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