public final class

MediaStoreOutputOptions.Builder

extends java.lang.Object

implements androidx.camera.video.OutputOptions.Builder<MediaStoreOutputOptions, MediaStoreOutputOptions.Builder>

 java.lang.Object

↳androidx.camera.video.MediaStoreOutputOptions.Builder

Overview

The builder of the MediaStoreOutputOptions object.

Summary

Constructors
publicBuilder(ContentResolver contentResolver, Uri collectionUri)

Creates a builder of the MediaStoreOutputOptions with media store options.

Methods
public MediaStoreOutputOptionsbuild()

Builds the MediaStoreOutputOptions instance.

public MediaStoreOutputOptions.BuildersetContentValues(ContentValues contentValues)

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

public MediaStoreOutputOptions.BuildersetFileSizeLimit(long fileSizeLimitBytes)

Sets the limit for the file length in bytes.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(ContentResolver contentResolver, Uri collectionUri)

Creates a builder of the MediaStoreOutputOptions with media store options.

The ContentResolver can be obtained by app and is used to access to MediaStore.

class provides APIs to obtain the collection URI. A collection URI corresponds to a storage volume on the device shared storage. A common collection URI used to access the primary external storage is . can also be used to query different storage volumes. For more information, read Access media files from shared storage developer guide.

When recording a video, a corresponding video row will be created in the input collection, and the content values set by MediaStoreOutputOptions.Builder.setContentValues(ContentValues) will also be written to this row.

Parameters:

contentResolver: the ContentResolver instance.
collectionUri: the URI of the collection to insert into.

Methods

public MediaStoreOutputOptions.Builder setContentValues(ContentValues contentValues)

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

The content values is a set of key/value paris used to store the metadata of a video item. The keys are defined in and . When recording a video, a corresponding video row will be created in the input collection, and this content values will also be written to this row. If a key is not defined in the MediaStore, the corresponding value will be ignored.

If not set, defaults to MediaStoreOutputOptions.EMPTY_CONTENT_VALUES.

Parameters:

contentValues: the content values to be inserted.

public MediaStoreOutputOptions.Builder setFileSizeLimit(long fileSizeLimitBytes)

Sets the limit for the file length in bytes.

When used to generate recording, if the specified file size limit is reached while the recording is being recorded, the recording will be finalized with VideoRecordEvent.Finalize.ERROR_FILE_SIZE_LIMIT_REACHED.

If not set, defaults to OutputOptions.FILE_SIZE_UNLIMITED.

Builds the MediaStoreOutputOptions instance.