Android Music Seekbar is not working (Idle)

后端 未结 2 1843
自闭症患者
自闭症患者 2020-11-27 08:50

I am playing mp3 file from url, but SeekBar is not updating while playing song.

When i am trying to move forcefully then song playing from start.

Below code

相关标签:
2条回答
  • 2020-11-27 09:11

    Try

    SeekBar.setProgress(0);
    SeekBar.setMax(100);
    

    after the mediaPlayer.start();

    0 讨论(0)
  • 2020-11-27 09:30

    try this

    mediaFileLength = mediaPlayer.getDuration();
    realtimeLength = mediaFileLength;
    mediaPlayer.start();
    finalTime = mediaPlayer.getDuration();
    startTime = mediaPlayer.getCurrentPosition();
    updateSeekBar();
    
    0 讨论(0)
提交回复
热议问题