Bikash
Bikash

Reputation: 11

seekTo(milisecs); in android MediaPlayer giving improper value for getCurrentPosition()

I am using MediaPlayer in my application. And one Timer running for getting current playing position. When I am trying to call seekTo(0);, it's giving the current position 0 then giving old current position, after that it's giving proper value.

Upvotes: 1

Views: 313

Answers (1)

Vadim Guzev
Vadim Guzev

Reputation: 320

This is because seekTo is asynchronous operation. I.e. the call seekTo() completes immediately, but the actual seek operation can be executed after several seconds (the delay depends on video, seekTo position, internet bandwidth and etc.).

Upvotes: 1

Related Questions