Getting this error - undefined - not an object (RNSound.IsAndroid rating)
I have already used this-responsive-native reaction-native-sound channel
my index.android.js code is- import React from 'react'; import { TouchableWithoutFeedback, Text } from 'react-native'; import Sound from 'react-native-sound'; class MyComponent extends Component { playSound() { const mySound = new Sound('x.mp3', Sound.MAIN_BUNDLE, (e) => { if (e) { console.log('error', e); } else { console.log('duration', mySound.getDuration()); mySound.play(); } }); } render() { return ( <TouchableWithoutFeedback onPress={this.playSound.bind(this)}> <Text>Play Sound!</Text> </TouchableWithoutFeedback> ); } }
source share