Last active
February 23, 2022 00:55
-
-
Save ggfan/e65e54320911fcd55443ef904dd05165 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
val recordingListener = Consumer<VideoRecordEvent> { event -> | |
when(event) { | |
is VideoRecordEvent.Start -> { | |
val msg = “Capture Started” | |
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT) | |
.show() | |
// update app internal recording state | |
… | |
} | |
is VideoRecordEvent.Finalize -> { | |
val msg = if (!event.hasError()) { | |
// update app internal state | |
… | |
"Video capture succeeded: ${event.outputResults.outputUri}" | |
} else { | |
// update app state when the capture failed. | |
recording?.close() | |
recording = null | |
"Video capture ends with error: ${event.error}" | |
} | |
Toast.makeText(activity, msg, Toast.LENGTH_SHORT) | |
.show() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment