Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export const FACE_LIVENESS_DETECTOR_PARAMETERS = [
'Optional parameter that allows you to configure options for a given liveness challenge.',
type: `ChallengeOptions`,
},
{
name: 'videoOptions',
description:
'Optional parameter that allows you to configure options for the video stream in the liveness session.',
type: 'VideoOptions',
},
{
name: `onComplete`,
description:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { Alert } from '@aws-amplify/ui-react';
import ReactPropsTable from '@/components/propsTable/ReactPropsTable';

export const VIDEO_OPTIONS = [
{
name: `videoCodec`,
description: 'The codec to use for encoding the video stream. Options are VP8, VP9, and H264. The default is VP8.',
type: `VideoCodec`,
},
];

## Challenge Options

Expand All @@ -23,3 +32,23 @@ FaceLivenessDetector(
<Alert variation="info" role="none">
When the FaceLivenessDetector is rendered, Rekognition will mark the session ID as used and any future usages of the FaceLivenessDector will require a new session ID. So if you want to change which camera is used for the FaceMovement challenge at runtime, you will need to create a new liveness session and pass the new session ID into the FaceLivenessDetector with the new Camera option.
</Alert>

## Video Options

Video options allow you to configure the video stream used during a liveness session. The following options are available:

<ReactPropsTable props={VIDEO_OPTIONS} />

```kotlin
FaceLivenessDetector(
sessionId = <session ID>,
region = <region>,
videoOptions = VideoOptions(videoCodec = VideoCodec.H264),
onComplete = {
Log.i("MyApp", "Face Liveness flow is complete")
},
onError = { error ->
Log.e("MyApp", "Error during Face Liveness flow", error)
}
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Add the following dependencies to your **app**'s `build.gradle` file and click "
```groovy
dependencies {
// FaceLivenessDetector dependency
implementation 'com.amplifyframework.ui:liveness:1.5.0'
implementation 'com.amplifyframework.ui:liveness:1.9.0'

// Amplify Auth dependency (unnecessary if using your own credentials provider)
implementation 'com.amplifyframework:aws-auth-cognito:2.29.0'
Expand Down
Loading