Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ggfan/d4e9fb0471a8ca700982f83b7360329f to your computer and use it in GitHub Desktop.
Save ggfan/d4e9fb0471a8ca700982f83b7360329f to your computer and use it in GitHub Desktop.
val contentValues = ContentValues().apply {
put(MediaStore.MediaColumns.DISPLAY_NAME, “CameraX-VideoCapture”)
put(MediaStore.MediaColumns.MIME_TYPE, "video/mp4")
}
val mediaStoreOutputOptions = MediaStoreOutputOptions
.Builder(contentResolver, MediaStore.Video.Media.EXTERNAL_CONTENT_URI)
.setContentValues(contentValues)
.build()
recording = videoCapture.output
.prepareRecording(this, mediaStoreOutputOptions)
.withAudioEnabled()
.start(ContextCompat.getMainExecutor(this), recordingListener)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment