Code example for MediaController

Methods: setAnchorView, setEnabled, setMediaPlayer

0
		attachMediaController(); 
	} 
 
	private void attachMediaController() { 
		if (mMediaPlayer != null && mMediaController != null) {
			mMediaController.setMediaPlayer(this);
			View anchorView = this.getParent() instanceof View ? (View)this
					.getParent() : this;
			mMediaController.setAnchorView(anchorView);
			mMediaController.setEnabled(mIsPrepared);
		} 
	} 
 
	MediaPlayer.OnVideoSizeChangedListener mSizeChangedListener = new MediaPlayer.OnVideoSizeChangedListener() {
		public void onVideoSizeChanged(MediaPlayer mp, int width, int height) { 
			// mVideoWidth = mp.getVideoWidth(); 
			// mVideoHeight = mp.getVideoHeight(); 
			if (width != 0 && height != 0) { 
				getHolder().setFixedSize(width, height); 
			} 
		}