# SessionAdapter

## SessionAdapter <a href="#sessionadapter" id="sessionadapter"></a>

| Method                                              | Description                   | Params                                                               |
| --------------------------------------------------- | ----------------------------- | -------------------------------------------------------------------- |
| init(with username: String)                         | Specify the username          | <ul><li><strong>username</strong> - a display name<br><br></li></ul> |
| changeVideoCodec(codec: VideoCodecAdapter)          | Specify a video codec type    | <ul><li><strong>codec</strong> - a video codec type</li></ul>        |
| changeVideoRenderer(renderer: VideoRendererAdapter) | Specify a video renderer type | <ul><li><strong>renderer</strong> - a video renderer type</li></ul>  |
| build()                                             | Construct a session instance  |                                                                      |

## Field Summary <a href="#field-summary" id="field-summary"></a>

| Type                    | Field            | Description                                                                              |
| ----------------------- | ---------------- | ---------------------------------------------------------------------------------------- |
| LocalParticipantAdapter | localParticipant | Represents a local user                                                                  |
| SessionAdapterDelegate? | delegate         | An optional delegate registered for receiving callbacks                                  |
| DispatchQueue           | callbackQueue    | A dispatch queue registered for receiving callbacks. The default queue is the main queue |
| SessionStateAdapter     | sessionState     | Enum with current session state                                                          |

## Method Summary <a href="#method-summary" id="method-summary"></a>

| Return type      | Methods                                                  | Description                                  | Parameters                                                                                                                                                      |
| ---------------- | -------------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void             | connect(with token: String)                              | Connect a session                            | <ul><li><strong>token</strong> - Authentication token </li></ul>                                                                                                |
| void             | disconnect()                                             | Leave a room and teardown WebRTC session     |                                                                                                                                                                 |
| UIViewController | createLogsViewController()                               | Return view controller with all Session logs |                                                                                                                                                                 |
| void             | sendMessage(message: String)                             | sends message to all conference participants | **message** - text to send                                                                                                                                      |
| void             | forceDisconnect(participantId: String, message: String?) | kick partitipant by id from session          | <p></p><ul><li><strong>participantId</strong> -selected participant id</li><li> <strong>message -</strong> optional supplemental message(kick reason)</li></ul> |

## Static Method Summary <a href="#static-method-summary" id="static-method-summary"></a>

| Return type | Methods                                  | Description         | Parameters                                                              |
| ----------- | ---------------------------------------- | ------------------- | ----------------------------------------------------------------------- |
| void        | setMinLogLevel(\_ logLevel: WTALogLevel) | Specify a log level | <ul><li><strong>logLevel</strong> - a level for logs produced</li></ul> |
