OutputFileOptions
abstract class OutputFileOptions
kotlin.Any | |
↳ | androidx.camera.view.video.OutputFileOptions |
Options for saving newly captured video.
this class is used to configure save location and metadata. Save location can be either a File
, MediaStore
. The metadata will be stored with the saved video.
Summary
Nested classes | |
---|---|
abstract |
Builder class for |
Public methods | |
---|---|
open static OutputFileOptions.Builder |
Creates options to write captured video to a |
open static OutputFileOptions.Builder |
builder(@NonNull fileDescriptor: ParcelFileDescriptor) Creates options to write captured video to a |
open static OutputFileOptions.Builder |
builder(@NonNull contentResolver: ContentResolver, @NonNull saveCollection: Uri, @NonNull contentValues: ContentValues) Creates options to write captured video to |
abstract Metadata |
Returns the metadata which is set by the |
Public methods
builder
@NonNull open static fun builder(@NonNull file: File): OutputFileOptions.Builder
Creates options to write captured video to a File
.
Parameters | |
---|---|
file |
File: save location of the video. |
builder
@NonNull open static fun builder(@NonNull fileDescriptor: ParcelFileDescriptor): OutputFileOptions.Builder
Creates options to write captured video to a ParcelFileDescriptor
.
Using a ParcelFileDescriptor to record a video is only supported for Android 8.0 or above.
Parameters | |
---|---|
fileDescriptor |
ParcelFileDescriptor: to save the video. |
Exceptions | |
---|---|
IllegalArgumentException |
when the device is not running Android 8.0 or above. |
builder
@NonNull open static fun builder(
@NonNull contentResolver: ContentResolver,
@NonNull saveCollection: Uri,
@NonNull contentValues: ContentValues
): OutputFileOptions.Builder
Creates options to write captured video to MediaStore
. Example:
<code>ContentValues contentValues = new ContentValues(); contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, "NEW_VIDEO"); contentValues.put(MediaStore.MediaColumns.MIME_TYPE, "video/mp4"); OutputFileOptions options = OutputFileOptions.builder( getContentResolver(), MediaStore.Video.Media.EXTERNAL_CONTENT_URI, contentValues).build(); </code>
Parameters | |
---|---|
contentResolver |
ContentResolver: to access MediaStore |
saveCollection |
Uri: The URI of the table to insert into. |
contentValues |
ContentValues: to be included in the created video file. |
getMetadata
@NonNull abstract fun getMetadata(): Metadata
Returns the metadata which is set by the OutputFileOptions.Builder
.