I am new to React-Native. And am trying to develop an Audio App, where the user should be able to click on any Audio from a list, and that Audio should Play onPress()
Here is my code
sound = new Sound('http://example.com/xyz.mp3');
playSound () {
this.sound.play();
};
pauseSound () {
this.sound.pause();
};
playFile (x1) {
sound = new Sound(x1);
this.playSound();
}
When I call playFile(x1) with a new file name x1, it gives error:
Attempted to assign to readonly property.
Is there a wayto reassign a new value to the sound variable onPress? Or any other simple solution to this issue of reassignment?