I am trying to control media player with seekbar, but whenever i do tap on seekbar its reached at the end of seekbar, see my code below:
seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if(mediaPlayer != null && fromUser){
mediaPlayer.seekTo(progress * 1000);
}
}
});
what i am missing ? where i am doing mistake ? where i have to make changes in my code ?
Progress bar returns correct position already. You don't need to multiply it by 1000. This should solve the issue.