Open jeremy-habit opened 3 years ago
Iam unable to stop multiple audios,please help me out.
const onStartPlay = (uri) => { if (!soundPlayer) { const player = new Sound(uri, '', (error) => { if (error) { console.log('Error loading audio:', error); } else { player.play(() => { setIsPlaying(false); setPlayLottie(false) setSoundPlayer(null); }); } }); setIsPlaying(true); setPlayLottie(true); setSoundPlayer(player); } else { soundPlayer.pause() setIsPlaying(false); setPlayLottie(false) setSoundPlayer(null);
}
};
:beetle: Description
I want to stop the current playing sound when i start playing an other one
:beetle: What have you tried?
:beetle: Please post your code:
:bulb: Possible solution
Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?