Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coordination with mediaplayer #65

Open
dwf2008 opened this issue Aug 8, 2023 · 4 comments
Open

Coordination with mediaplayer #65

dwf2008 opened this issue Aug 8, 2023 · 4 comments

Comments

@dwf2008
Copy link

dwf2008 commented Aug 8, 2023

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

@Jeel7584
Copy link

@dwf2008 same issues is there any way to sync waves progress with seekbar ?

@mirco0
Copy link

mirco0 commented Aug 11, 2023

@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

@SaaifKhan
Copy link

can anyone help regarding this also i want to synch with my media player in recyclerview adapter

@ghost
Copy link

ghost commented Oct 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants