Open raouldandresy opened 6 years ago
Hi :) i'm trying to do a progress bar that use the percentage, so i need the duration and the currenti time. But i'm using a while loop that is not working, anyone can help?
_statusChanged(status) { console.log(status); RNAudioStreamer.duration((err, duration)=>{ if(!err){ console.log(duration); this.setState({duration: duration}); } //seconds }) while(status === 'PLAYING'){ RNAudioStreamer.currentTime((err, currentTime)=>{ if(!err){ console.log(currentTime); this.setState({currentTime: currentTime}); }//seconds }) } }
Hi :) i'm trying to do a progress bar that use the percentage, so i need the duration and the currenti time. But i'm using a while loop that is not working, anyone can help?
_statusChanged(status) { console.log(status); RNAudioStreamer.duration((err, duration)=>{ if(!err){ console.log(duration); this.setState({duration: duration}); } //seconds }) while(status === 'PLAYING'){ RNAudioStreamer.currentTime((err, currentTime)=>{ if(!err){ console.log(currentTime); this.setState({currentTime: currentTime}); }//seconds }) } }