Skip to content

Commit

Permalink
Merge branch 'release/0.2.39'
Browse files Browse the repository at this point in the history
  • Loading branch information
chaimPaneth committed Aug 3, 2023
2 parents bd3aad4 + 958cf7f commit a60d6a1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RNJWPlayer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.platform = :ios, "12.0"
s.source = { :git => "https://github.com/chaimPaneth/react-native-jw-media-player.git", :tag => "v#{s.version}" }
s.source_files = "ios/RNJWPlayer/*.{h,m}"
s.dependency 'JWPlayerKit', '~> 4.13.0'
s.dependency 'JWPlayerKit', '~> 4.14.0'
s.dependency 'google-cast-sdk', '~> 4.7.0'
s.dependency 'React'
# s.static_framework = true
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ allprojects {
}
}

def jwPlayerVersion = "4.12.0"
def jwPlayerVersion = "4.13.0"
def exoplayerVersion = "2.18.7"

dependencies {
Expand Down
2 changes: 2 additions & 0 deletions ios/RNJWPlayer/RNJWPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ -(void)setupPlayerViewController:config :(JWPlayerConfiguration*)playerConfig
});
_playerViewController.view.frame = self.frame;
[self addSubview:_playerViewController.view];
[_playerViewController setDelegates];
}

id interfaceBehavior = config[@"interfaceBehavior"];
Expand Down Expand Up @@ -791,6 +792,7 @@ -(void)dismissPlayerViewController
[_playerViewController.view removeFromSuperview];
[_playerViewController removeFromParentViewController];
[_playerViewController willMoveToParentViewController:nil];
[_playerViewController removeDelegates];
_playerViewController = nil;
}
}
Expand Down
6 changes: 5 additions & 1 deletion ios/RNJWPlayer/RNJWPlayerViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@

@class RNJWPlayerView;

@interface RNJWPlayerViewController : JWPlayerObjCViewController <JWPlayerDelegate, JWPlayerStateDelegate, JWAdDelegate, JWCastDelegate, JWAVDelegate, JWPlayerViewDelegate, JWPlayerViewControllerDelegate, JWDRMContentKeyDataSource, JWTimeEventListener, AVPictureInPictureControllerDelegate>
@interface RNJWPlayerViewController : JWPlayerObjCViewController <JWPlayerViewControllerDelegate, JWDRMContentKeyDataSource>

@property(nonatomic, weak)RNJWPlayerView *parentView;

-(void)setDelegates;

-(void)removeDelegates;

@end
23 changes: 22 additions & 1 deletion ios/RNJWPlayer/RNJWPlayerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@

@implementation RNJWPlayerViewController

-(void)setDelegates
{
self.delegate = self;
self.playerView.delegate = self;
self.player.delegate = self;
self.player.playbackStateDelegate = self;
self.player.adDelegate = self;
self.player.avDelegate = self;
self.player.contentKeyDataSource = self;
}

-(void)removeDelegates
{
self.delegate = nil;
self.playerView.delegate = nil;
self.player.delegate = nil;
self.player.playbackStateDelegate = nil;
self.player.adDelegate = nil;
self.player.avDelegate = nil;
self.player.contentKeyDataSource = nil;
}

#pragma mark - JWPlayer Delegate

- (void)jwplayerIsReady:(id<JWPlayer>)player
Expand All @@ -21,7 +43,6 @@ - (void)jwplayerIsReady:(id<JWPlayer>)player
_parentView.onPlayerReady(@{});
}


if (_parentView.pendingConfig && _parentView.currentConfig) {
[_parentView setConfig:_parentView.currentConfig];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-jw-media-player",
"version": "0.2.38",
"version": "0.2.39",
"description": "React-native Android/iOS plugin for JWPlayer SDK (https://www.jwplayer.com/)",
"main": "index.js",
"types": "./index.d.ts",
Expand Down

0 comments on commit a60d6a1

Please sign in to comment.