waveformSeekBar
waveformSeekBar copied to clipboard
Coordination with mediaplayer
Hi there, looks like a great product. I have it running but there's a little problem with coordination with the media player. Probably just my lack of knowledge about how to set the values. Depending on the values I use the seekbar ends before the mediaplayer is done playing the song or vice versa. My code:
WFSB.setSampleFrom(holder.lblUri.getText().toString()); float Max = Float.parseFloat(duration); WFSB.setMaxProgress(Max); WFSB.setProgress(0f);
and
int currentPosition = myMediaPlayer.getCurrentPosition(); WFSB.setProgress((float) currentPosition);
Is this the right approach or do I need to do something different? Thanks
@dwf2008 same issues is there any way to sync waves progress with seekbar ?
@dwf2008 @Jeel7584 I made a fork that includes a new view that incorporates a mediaPlayer and is synced. It not perfect yet, but it works
can anyone help regarding this also i want to synch with my media player in recyclerview adapter
My method is to just spawn a thread that runs until the media player is stopped and constantly updates the WFSB progress (with a small sleep in between updates, to not flood the processor). It seems to be pretty synced up that way, and the Progress Changed callback listener can differentiate between a user interacted change and a code change using the fromUser
callback variable.