# Conference (Assisted Video)

The Conference (Assisted Video) module connects the user with a live agent over video and audio to conduct an identity verification interview. The agent can request that documents be shown on camera and complete any verifications needed to meet regulatory or business requirements.

For an overview of this module and how it works, see [Video Conference](https://developer.incode.com/docs/video-conference).

How you use this module depends on your [integration pattern](https://developer.incode.com/docs/android-common-implementation-patterns#integration-patterns). In Patterns 1 and 2, you add the module to a `FlowConfig` in code as shown on this page. In Pattern 3, you define your modules and configuration in Dashboard as a Flow or Workflow and reference it by ID with `startFlow()` or `startWorkflow()` as shown on [Run Flows Configured in Dashboard](https://developer.incode.com/docs/android-run-flows-configured-online).

Conference is not available in [Capture-Only mode](https://developer.incode.com/docs/android-capture-only-sdk); adding it there throws `ModuleNotAvailableException`.

## Add Conference

1. Ensure you've [declared](https://developer.incode.com/docs/android-installation#declare-dependencies) the `com.incode.sdk:video-streaming` dependency in your `[module]/build.gradle`.
2. Before Conference, add the following:
   - A [Selfie Scan](https://developer.incode.com/docs/android-selfie-scan) module
   - Either of the following, with its matching validation:
     - An [ID Scan](https://developer.incode.com/docs/android-id-scan) module, validated with [Face Match](https://developer.incode.com/docs/android-face-match)
     - A [QR Scan](https://developer.incode.com/docs/android-qr-scan) module, validated with [Government Validation](https://developer.incode.com/docs/android-government-validation)
       Ordering is validated, so configuration verification fails if Conference doesn't come after these steps.
3. Add the module with one of the `addConference` overloads:

   ```kotlin
   // Default configuration
   flowConfigBuilder.addConference()

   // Disable the microphone when the user enters the conference
   flowConfigBuilder.addConference(disableMicOnCallStart = true)
   ```
   ```java
   // Default configuration
   flowConfigBuilder.addConference();

   // Disable the microphone when the user enters the conference
   flowConfigBuilder.addConference(true);
   ```

### Example

The example below adds Conference after the prerequisite capture and validation modules, disables the microphone on call start, and listens for queue position, estimated wait time, and conference completion.

```kotlin
val flowConfig = FlowConfig.Builder()
    // ... add the prerequisite capture and validation modules first
    .addConference(disableMicOnCallStart = true)
    .build()

IncodeWelcome.getInstance().startOnboarding(
    activityContext,
    sessionConfig,
    flowConfig,
    object : OnboardingListener() {
        override fun onEstimatedWaitingTime(waitingTimeInSeconds: Int) {
            // Show the estimated wait before the agent connects
        }

        override fun onQueuePositionChanged(newQueuePosition: Int) {
            // 0 means it is the user's turn
        }

        override fun onConferenceEnded() {
            // The video conference has finished
        }

        override fun onError(error: Throwable) {}

        override fun onUserCancelled() {}
    }
)
```
```java
FlowConfig flowConfig = new FlowConfig.Builder()
    // ... add the prerequisite capture and validation modules first
    .addConference(true)
    .build();

IncodeWelcome.getInstance().startOnboarding(
    activityContext,
    sessionConfig,
    flowConfig,
    new IncodeWelcome.OnboardingListener() {
        @Override
        public void onEstimatedWaitingTime(int waitingTimeInSeconds) {
            // Show the estimated wait before the agent connects
        }

        @Override
        public void onQueuePositionChanged(int newQueuePosition) {
            // 0 means it is the user's turn
        }

        @Override
        public void onConferenceEnded() {
            // The video conference has finished
        }

        @Override
        public void onError(@NonNull Throwable error) {}

        @Override
        public void onUserCancelled() {}
    }
);
```

## Configuration Options

Build the module with `Conference.Builder`. The module exposes a single option.

| Setting                             | Description                                                     |
| ----------------------------------- | --------------------------------------------------------------- |
| `setDisableMicOnCallStart(Boolean)` | Mutes the microphone when the user first enters the conference. |

For the complete option set, see `Conference.Builder` in [API Reference](https://developer.incode.com/docs/android-api-reference).

## Result

Conference does not deliver a result payload to your listener. Completion is signaled by `onConferenceEnded()` on the `OnboardingListener`. While the user waits for an agent, the listener also receives:

- `onQueuePositionChanged(Int)`: The user's position in the queue, where `0` means it is their turn.
- `onEstimatedWaitingTime(Int)`: The estimated wait in seconds. Called once.

Errors surface through `OnboardingListener.onError(Throwable)`. This module does not deliver a module-specific exception subtype.

For the listener callbacks, see `IncodeWelcome.OnboardingListener` in [API Reference](https://developer.incode.com/docs/android-api-reference). The callbacks above are also declared by `VideoConferenceListener`, `QueuePositionChangeListener`, and `EstimatedWaitingTimeListener`.
