# 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> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.sceenic.co/watch-together-sdk/sscale-confluence-api-references/ios-objective-c-adapter-reference-new/sessionadapter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
