MediaStoreOutputOptions


public final class MediaStoreOutputOptions extends OutputOptions


A class providing options for storing output to MediaStore.

Example:


ContentValues contentValues = new ContentValues();
contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, "NEW_VIDEO");
contentValues.put(MediaStore.MediaColumns.MIME_TYPE, "video/mp4");

MediaStoreOutputOptions options =
        new MediaStoreOutputOptions.Builder(
            contentResolver, MediaStore.Video.Media.EXTERNAL_CONTENT_URI)
        .setContentValues(contentValues)
        .build();

The output Uri can be obtained via getOutputUri from getOutputResults.

For more information about setting collections Uri and ContentValues, read the Access media files from shared storage and MediaStore developer guide.

Summary

Nested types

The builder of the MediaStoreOutputOptions object.

Constants

static final @NonNull ContentValues

An empty ContentValues.

Public methods

boolean
@NonNull Uri

Gets the URI of the collection to insert into.

@NonNull ContentResolver

Gets the ContentResolver instance.

@NonNull ContentValues

Gets the content values to be included in the created video row.

int
@NonNull String

Inherited Constants

From androidx.camera.video.OutputOptions
static final int

Represents an unlimited duration.

static final int

Represents an unbound file size.

Inherited methods

From androidx.camera.video.OutputOptions
@IntRange(from = 0) long

Gets the limit for the video duration in milliseconds.

@IntRange(from = 0) long

Gets the limit for the file size in bytes.

@Nullable Location

Returns a Location object representing the geographic location where the video was recorded.

Constants

EMPTY_CONTENT_VALUES

Added in 1.1.0
public static final @NonNull ContentValues EMPTY_CONTENT_VALUES

An empty ContentValues.

Public methods

equals

public boolean equals(@Nullable Object o)

getCollectionUri

Added in 1.1.0
public @NonNull Uri getCollectionUri()

Gets the URI of the collection to insert into.

See also
Builder

getContentResolver

Added in 1.1.0
public @NonNull ContentResolver getContentResolver()

Gets the ContentResolver instance.

See also
Builder

getContentValues

Added in 1.1.0
public @NonNull ContentValues getContentValues()

Gets the content values to be included in the created video row.

See also
setContentValues

hashCode

public int hashCode()

toString

public @NonNull String toString()