Skip to content

Commit

Permalink
Fixing crash while trying to play local file other than resource file…
Browse files Browse the repository at this point in the history
… and updating version
  • Loading branch information
gauravmnit07 committed May 16, 2017
1 parent 125d961 commit fe0ad3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ios/react-native-media-kit/RCTMediaPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ - (void)initPlayerIfNeeded {
NSString *resource = [[self.src lastPathComponent] stringByDeletingPathExtension];
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *file = [mainBundle pathForResource:resource ofType:resourceType];
if (!file) {
file = _src; // might be local file path other than resources
}
url = [NSURL fileURLWithPath:file];
player = [AVPlayer playerWithURL:url];
}
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-media-kit",
"version": "0.0.17",
"version": "0.0.18",
"description": "Video and Audio component for react-native apps, supporting both iOS and Android.",
"main": "library/index.js",
"scripts": {
Expand Down

0 comments on commit fe0ad3e

Please sign in to comment.