0
        return isRecordingRightNow;
    } 
 
    public boolean prepare() { 
        camera.unlock();
        mediaRecorder.setCamera(camera);
        mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
        mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
 
        // For android 2.3 devices video quality = low 
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)
            mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));
        else { 
            // For >= Android 3.0 devices select 720p, 480p or low quality of video 
            if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_720P))
                mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_720P));
            else if (CamcorderProfile.hasProfile(cameraId, CamcorderProfile.QUALITY_480P))
                mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_480P));
            else 
                mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));
        } 
 
        mediaRecorder.setOutputFile(outputFilePath);
        mediaRecorder.setOrientationHint(orientationHint);
        mediaRecorder.setPreviewDisplay(cameraPreviewHandler.getCameraPreviewHolder().getSurface());
 
        try { 
            mediaRecorder.prepare();
        } catch (Exception ignored) {
            mediaRecorder.release();
            return false; 
        } 
 
        return true; 
    }