Last active
August 7, 2022 11:39
-
-
Save ggfan/5ad9c6f07b8ea0c5fc6dde196a55c220 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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