Code example for MediaController

Methods: setEnabled

0
		 
 
		videoPlayer.setOnCompletionListener(new OnCompletionListener() {
			@Override 
			public void onCompletion(MediaPlayer mp) {
				mediaCtrl.setEnabled(false); // needed to avoid Froyo hang bug?
				finish();
			} 
		}); 
		 
		videoPlayer.setOnPreparedListener(new OnPreparedListener() {
			@Override 
			public void onPrepared(MediaPlayer mp) {
				mp.start();  // also need to wait before starting to avoid hanging bug...
			} 
		}); 
		 
		// maybe needed to avoid hanging?  (according to one forum post) 
		videoPlayer.setFocusable(false);
		videoPlayer.setClickable(false);