MediaStoreOutputOptions


class MediaStoreOutputOptions : 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.

Public functions

Boolean
equals(o: Any?)
Uri

Gets the URI of the collection to insert into.

ContentResolver

Gets the ContentResolver instance.

ContentValues

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

Int
String

Inherited Constants

From androidx.camera.video.OutputOptions
const Int

Represents an unlimited duration.

const Int

Represents an unbound file size.

Inherited functions

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.

Location?

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

Constants

EMPTY_CONTENT_VALUES

Added in 1.1.0
const val EMPTY_CONTENT_VALUESContentValues

An empty ContentValues.

Public functions

equals

fun equals(o: Any?): Boolean

getCollectionUri

Added in 1.1.0
fun getCollectionUri(): Uri

Gets the URI of the collection to insert into.

See also
Builder

getContentResolver

Added in 1.1.0
fun getContentResolver(): ContentResolver

Gets the ContentResolver instance.

See also
Builder

getContentValues

Added in 1.1.0
fun getContentValues(): ContentValues

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

See also
setContentValues

hashCode

fun hashCode(): Int

toString

fun toString(): String