Is there any way to use setOnSeekCompleteListener with VideoView. It is possible through MediaPlayer but I am using videoview in my application and need to use onSeekCompleteListener. Thanks
Asked
Active
Viewed 445 times
1
-
Hi Farhan, I had the same problem and ended up copying and modifying the VideoView source, see http://stackoverflow.com/a/11938019/783051 – Peter Tran Nov 25 '12 at 19:16
2 Answers
2
VideoView does not have a OnSeekCompleteListener() but you can access the MediaPlayer from the onPrepared method of the VideoView and then set the OnSeekCompleteListener, like this :
mVideoView.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.setOnSeekCompleteListener(new OnSeekCompleteListener() {
@Override
public void onSeekComplete(MediaPlayer mp) {
//TODO: Your code here
}
});
}
});
Matthieu Coisne
- 624
- 1
- 13
- 25
0
You might be able to get same functionality using the following method in VideoView
public void setOnCompletionListener (MediaPlayer.OnCompletionListener l)
Rajdeep Dua
- 11,190
- 2
- 32
- 22