I am implemented VideoView with Mediacontroller like below.
MediaController mediacontroller = new MediaController(VideoViewActivity.this);
mediacontroller.setAnchorView(mVideoView);
mVideoView.setMediaController(mediacontroller);
Now I want to show an Alert When user clicks on seekbar.
I have tried with following code by adding onclickListener
to seekbar, but not working.
int topContainerId = getResources().getIdentifier("mediacontroller_progress", "id", "android");
SeekBar seekbar = (SeekBar) mediacontroller.findViewById(topContainerId);
seekbar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG, "WE HAVE LIFT OFF");
showAlertMesage();
}
});
But the event is not firing hence alert message with 'Ok' and 'Cancel' options not showing.
Also implementation should be showing an alert when user clicks/touches the seekbar.The seekbar need not to be seekable till user clicks 'OK'.
If user clicks 'Cancel' Video playing and seeking position should not be change. if clicks on 'Ok' it should be seekable to that postion.
So kindly please share or suggest How to implement this behaviour, Thank you all in advance.