I am going to explain the problem i have exactly, in an app i am developing for android i have an activity where i am showing a video that comes from youtube, to show that video i am using a VideoView . Also i have a progressSeekBar to be able to change the current position of the video and to be able to see what is left.
To do that i have done the next:
new Thread(new Runnable() {
public void run() {
try {
Log.d("Voizee", "Vengo al runnable.");
vSeekBarProgress.setProgress(getMediaPlayer()
.getCurrentPosition());
if (getMediaPlayer().getCurrentPosition() < getMediaPlayer()
.getDuration()) {
vSeekBarProgress.postDelayed(this, 1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
This code it is working and it is moving perfectly the seekbar when the video plays, but the performance of the video is quite bad and it is shown slowly and jumping through the diferent scenes.
So please could you help me with this problem i have. One more thing to add, it is that if i remove this thread the video it is working well without any performance issue so it is something to do with the thread.
Thank you very much in advance for the help.