0
	} 
 
	private boolean prepareVideoRecorder() { 
		Log.i(TAG, "Preparing video recorder!");
 
		mMediaRecorder = new MediaRecorder();
 
		// Step 1: Unlock and set camera to MediaRecorder 
		mCamera.unlock();
		mMediaRecorder.setCamera(mCamera);
 
		// Step 2: Set sources 
		mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
		mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
 
		// Step 3: Set a CamcorderProfile (requires API Level 8 or higher) 
		mMediaRecorder.setProfile(CamcorderProfile.get(mCameraId, CamcorderProfile.QUALITY_HIGH));
 
		mMediaRecorder.setOrientationHint(270); // we're in portrait mode, so make sure that our videos record that way!
 
		// Step 4: Set output file 
		mMediaRecorder.setOutputFile(getOutputMediaFile(MEDIA_TYPE_VIDEO).toString());
 
		// Step 5: Set the preview output 
		mMediaRecorder.setPreviewDisplay(surfaceView.getHolder().getSurface());
 
		// Step 6: Prepare configured MediaRecorder 
		try { 
			mMediaRecorder.prepare();
			Log.i(TAG, "mMediaRecorder prepared!!");
		} catch (IllegalStateException e) {
			Log.e(TAG, "IllegalStateException preparing MediaRecorder: " + e.getMessage());
			releaseMediaRecorder(); 
			return false; 
		} catch (IOException e) {
			Log.e(TAG, "IOException preparing MediaRecorder: " + e.getMessage());
			releaseMediaRecorder(); 
			return false; 
		} 
		return true; 
	} 
 
	@Override 
	protected void onPause() { 
		super.onPause(); 
		releaseMediaRecorder();       // if you are using MediaRecorder, release it first 
		releaseCamera();              // release the camera immediately on pause event 
	} 
 
	private void releaseMediaRecorder(){ 
		if (mMediaRecorder != null) {
			mMediaRecorder.reset();   // clear recorder configuration
			mMediaRecorder.release(); // release the recorder object
			mMediaRecorder = null;
			mCamera.lock();           // lock camera for later use
		} 
	}