|
| 1 | +--- |
| 2 | +title: Initial call configuration |
| 3 | +slug: /initial-call-configuration |
| 4 | +description: How to configure the initial call setup |
| 5 | +--- |
| 6 | + |
| 7 | +There are two ways to configure the initial call setup: |
| 8 | +* Using the Stream Dashboard to setup the initial configuration per call type |
| 9 | +* Passing the initial configuration in by `CallConnectOptions` parameter |
| 10 | + |
| 11 | +### Stream Dashboard |
| 12 | + |
| 13 | +You can configure the initial call setup using the Stream Dashboard. This is useful when you want to set up the initial configuration for a specific call type. |
| 14 | +Find the call type you want to configure on the list of call types: https://dashboard.getstream.io/app/{YOUR-APP-ID}/video/call-types. Then under Video, Audio and Advanced settings sections you can set things like: |
| 15 | + |
| 16 | +* Turn camera on/off by default |
| 17 | +* Turn microphone on/off by default |
| 18 | +* Set default camera facing |
| 19 | +* Set default audio output device |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +### CallConnectOptions parameter |
| 24 | + |
| 25 | +Using the `CallConnectOptions` class you can configure the initial call setup programmatically. It provides the following options: |
| 26 | + |
| 27 | +* Enabling or disabling the camera |
| 28 | +* Enabling or disabling the microphone |
| 29 | +* Enabling or disabling the screen sharing |
| 30 | +* Setting the camera facing mode |
| 31 | +* Setting the audio output device |
| 32 | +* Setting the audio input device |
| 33 | + |
| 34 | +You can provide this class as a parameter when joining a call: |
| 35 | + |
| 36 | +```dart |
| 37 | + final call = client.makeCall(callType: StreamCallType(), id: '345'); |
| 38 | + await call.join(connectOptions: connectOptions); |
| 39 | +``` |
| 40 | + |
| 41 | +Or by passing it to the `StreamCallContainer` widget |
| 42 | + |
| 43 | +```dart |
| 44 | +StreamCallContainer( |
| 45 | + call: widget.call, |
| 46 | + callConnectOptions: connectOptions, |
| 47 | + ... |
| 48 | +); |
| 49 | +``` |
| 50 | + |
| 51 | +You can access current options by calling `call.connectOptions` on the `Call` object. |
| 52 | + |
| 53 | +```dart |
| 54 | + final call = client.makeCall(callType: StreamCallType(), id: '345'); |
| 55 | + await call.getOrCreate(connectOptions: connectOptions); |
| 56 | + final callOptions = call.connectOptions; |
| 57 | +``` |
| 58 | + |
| 59 | +:::info |
| 60 | + When `getOrCreate` method is called, the default options will be created based on the Stream Dashboard settings. |
| 61 | + You can then leverage the `call.connectOptions` to modify the default settings and pass them to the `join` method at the end. |
| 62 | +::: |
| 63 | + |
| 64 | +:::note |
| 65 | + `call.connectOptions` also has a setter but it should be used carefully. Depending on the moment in the call lifecycle, it might be overwritten by default configuration or it might be too late to apply the changes. |
| 66 | +::: |
0 commit comments