Ejemplo n.º 1
0
  private void launchVideoCameraIntent() {
    // TODO - Create a new intent to launch the MediaStore, Image capture function
    // Hint: use standard Intent from MediaStore class
    // See: http://developer.android.com/reference/android/provider/MediaStore.html
    Intent videoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);

    // TODO - Set the fileUri for this video file using the pre-made function
    // getOutputMediaFile to create a new filename for this specific video;

    fragment.fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);

    // TODO - Add the filename to the Intent as an extra. Use the Intent-extra name
    // from the MediaStore class, EXTRA_OUTPUT
    videoIntent.putExtra(MediaStore.EXTRA_OUTPUT, fragment.fileUri);

    // TODO - Specify as an extra that the video quality should be HIGH. Use the
    // Intent-extra name, EXTRA_VIDEO_QUALITY, from the MediaStore class
    // set the video image quality to high
    videoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);

    // TODO - Start a new activity for result, using the new intent and the request
    // code CAMERA_VIDEO_REQUEST
    startActivityForResult(videoIntent, CAMERA_VIDEO_REQUEST);
  }