I want to show user some ProgressDialog while he waits for VideoView to start play HLS. I try to use OnPreparedListener for this, but he triggers to early (after player download
Thanks to all. I solved my problem with next hack:
videoView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
final Handler handler = new Handler();
videoPositionThread = new Runnable() {
public void run() {
try {
int duration = videoView.getCurrentPosition();
if (!(videoPosition == duration && videoView.isPlaying())) {
progress.dismiss();
}
videoPosition = duration;
handler.postDelayed(videoPositionThread, 1000);
} catch (IllegalArgumentException e) {
Log.d(TAG, e.getMessage(), e);
}
}
};
handler.postDelayed(videoPositionThread, 0);
}
});