Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggfan/5ad9c6f07b8ea0c5fc6dde196a55c220 to your computer and use it in GitHub Desktop.
Save ggfan/5ad9c6f07b8ea0c5fc6dde196a55c220 to your computer and use it in GitHub Desktop.
if(event == VideoRecordEvent.Finalize) {
if (!event.hasError()) {
val playback = Intent(Intent.ACTION_VIEW).apply {
setDataAndType(event.outputResults.outputUri, "video/*")
}
startActivity(playback);
} else {
// update app state when the capture failed.
recording?.close()
recording = null
// indicate error condition to user
Toast.makeText(activity,
Video capture ends with error: ${event.error}”,
Toast.LENGTH_SHORT)
.show()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment