@@ -69,14 +69,19 @@ -(BOOL)shouldAutorotate {
69
69
70
70
#pragma mark - RNJWPlayer props
71
71
72
- -(void )setConfig : ( NSDictionary *) config
72
+ -(void )setLicense : ( id ) license
73
73
{
74
- id license = config[@" license" ];
75
74
if ((license != nil ) && (license != (id )[NSNull null ])) {
76
75
[JWPlayerKitLicense setLicenseKey: license];
77
76
} else {
78
77
NSLog (@" JW SDK License key not set." );
79
78
}
79
+ }
80
+
81
+ -(void )setConfig : (NSDictionary *)config
82
+ {
83
+ id license = config[@" license" ];
84
+ [self setLicense: license];
80
85
81
86
_backgroundAudioEnabled = config[@" backgroundAudioEnabled" ];
82
87
_pipEnabled = config[@" pipEnabled" ];
@@ -664,9 +669,10 @@ -(void)setupPlayerViewController:config :(JWPlayerConfiguration*)playerConfig
664
669
-(void )dismissPlayerViewController
665
670
{
666
671
if (_playerViewController != nil ) {
667
- [_playerViewController willMoveToParentViewController: nil ];
672
+ [_playerViewController.player stop ];
668
673
[_playerViewController.view removeFromSuperview ];
669
674
[_playerViewController removeFromParentViewController ];
675
+ [_playerViewController willMoveToParentViewController: nil ];
670
676
_playerViewController = nil ;
671
677
}
672
678
}
@@ -689,14 +695,6 @@ -(void)presentPlayerViewController:(JWPlayerConfiguration*)configuration
689
695
}
690
696
691
697
[_playerViewController setDelegates ];
692
-
693
- // _playerViewController.delegate = self;
694
- // _playerViewController.playerView.delegate = self;
695
- // _playerViewController.player.delegate = self;
696
- // _playerViewController.player.playbackStateDelegate = self;
697
- // _playerViewController.player.adDelegate = self;
698
- // _playerViewController.player.avDelegate = self;
699
- // _playerViewController.player.contentKeyDataSource = self;
700
698
}
701
699
702
700
#pragma mark - JWPlayer View helpers
@@ -727,6 +725,7 @@ -(void)setupPlayerView:config :(JWPlayerConfiguration*)playerConfig
727
725
-(void )removePlayerView
728
726
{
729
727
if (_playerView != nil ) {
728
+ [_playerView.player stop ];
730
729
[_playerView removeFromSuperview ];
731
730
_playerView = nil ;
732
731
}
0 commit comments