R
R
rafaelSalihov2020-01-19 15:56:15
Java
rafaelSalihov, 2020-01-19 15:56:15

How to fix late mediaplayer file when calling seekTo?

When playing a small (mp3 file about 1 minute long) mp3 file with a 30 second advance from the beginning of the mp3 file

MediaPlayer = MediaPlayer.create(Book_Activity_detal.this, R.raw.urok1); 
MediaPlayer.seekTo(MediaPlayer.getCurrentPosition() + 30000);

for example all chorus works.
If you take a 30-minute file, then it does not have time to process the campaign, so if you ask, for example
MediaPlayer.seekTo(MediaPlayer.getCurrentPosition() + 30000);

also 30 seconds then it reproduces somewhere from 32 seconds. How to fix it?
I read something about onPrepared and did not understand whether it is suitable or not, how it works, I also did not understand.
How to fix this I sit for a long time, waiting for any suggestions.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question