Code example for MediaController

Methods: hide, isShowing, show

0
				&& mMediaController != null) {
			if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK
					|| keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
				if (mMediaPlayer.isPlaying()) {
					pause(); 
					mMediaController.show();
				} else { 
					start(); 
					mMediaController.hide();
				} 
				return true; 
			} else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP
					&& mMediaPlayer.isPlaying()) {
				pause(); 
				mMediaController.show();
			} else { 
				toggleMediaControlsVisiblity(); 
			} 
		} 
 
		return super.onKeyDown(keyCode, event);
	} 
 
	private void toggleMediaControlsVisiblity() { 
		if (mMediaController.isShowing()) {
			mMediaController.hide();
		} else { 
			mMediaController.show();
		} 
	} 
 
	public void start() { 
		if (mMediaPlayer != null && mIsPrepared) {