Skip to content

Commit

Permalink
Fix #23
Browse files Browse the repository at this point in the history
  • Loading branch information
zmxv committed Apr 6, 2016
1 parent 193f4c8 commit ee0125b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion RNSound/RNSound.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ -(void) audioPlayerDidFinishPlaying:(AVAudioPlayer*)player
RCT_EXPORT_MODULE();

-(NSDictionary *)constantsToExport {
return @{@"MainBundlePath": [[NSBundle mainBundle] bundlePath],
return @{@"IsAndroid": [NSNumber numberWithBool:NO],
@"MainBundlePath": [[NSBundle mainBundle] bundlePath],
@"NSDocumentDirectory": [self getDirectory:NSDocumentDirectory],
@"NSLibraryDirectory": [self getDirectory:NSLibraryDirectory],
@"NSCachesDirectory": [self getDirectory:NSCachesDirectory],
Expand Down
12 changes: 12 additions & 0 deletions android/src/main/java/com/zmxv/RNSound/RNSoundModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,16 @@ public void getCurrentTime(final Integer key, final Callback callback) {
}
callback.invoke(player.getCurrentPosition() * .001, player.isPlaying());
}

@ReactMethod
public void enable(final Boolean enabled) {
// no op
}

@Override
public Map<String, Object> getConstants() {
final Map<String, Object> constants = new HashMap<>();
constants.put("IsAndroid", true);
return constants;
}
}
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-sound",
"version": "0.7.3",
"version": "0.8.0",
"description": "React Native module for playing sound clips on iOS and Android",
"main": "sound.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion sound.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var RNSound = require('react-native').NativeModules.RNSound;
var IsAndroid = (typeof RNSound.setLooping) !== 'undefined';
var IsAndroid = RNSound.IsAndroid;

var nextKey = 0;

Expand Down

0 comments on commit ee0125b

Please sign in to comment.