I have used MediaController in my activity its working fine but when I play video for first time then there should b pause button visible but instead there is play and when I press that button then the video is paused correctly and state remains the same and after that its working properly. And same thing happens when Video Completed. Is this a bug or I am doing any thing wrong?
videoView.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mediaController = new MediaController(VideoPlayerActivity.this){
public void hide(){
}
public void show(){
if(isPlayingAd){
super.hide();
}else{
super.show();
}
}
};
videoView.setMediaController(mediaController);
mediaController.setMediaPlayer(videoView);
mediaController.show();
}
});
mVideoView.start()
beforemMediaController.show()
. Both calls are inonPrepared(MediaPlayer pMp)
in my case. That was the only way to get it working on a Samsung device with Android 4.2.2 – Mckinney