Connection
Connection represents a single Connection to create a ProCONF Room.
Kind: global class
- Connection
- instance
- .init(domain, [proconfToken]) ⇒
Promise - .createRoom([roomOptions]) ⇒
Promise - .getRoom() ⇒
Room|null - .disconnect() ⇒
void
- .init(domain, [proconfToken]) ⇒
- static
- instance
connection.init(domain, [proconfToken]) ⇒ Promise
Initializes the Call libraries connection with the provided connection options.
Kind: instance method of Connection
Returns: Promise - A promise that resolves to the backend connection object.
Throws:
ProConfErrorIf the connection to backend server fails.
Fulfil: Connection connection object
Reject: ProconfError On connection error
| Param | Type | Default | Description |
|---|---|---|---|
| domain | string | The domain of the backend server to connect to. | |
| [proconfToken] | string | null | The ProCONF token to be used for authentication. |
connection.createRoom([roomOptions]) ⇒ Promise
Creates a new room with the specified room name and room options. If room name is not provided, a random room name will be generated.
Kind: instance method of Connection
Returns: Promise - A Promise that resolves to the created Room object.
Throws:
- ProConfError if the room could not be initialized.
Fulfil: Room object
Reject: ProconfError On room creation error
| Param | Type | Description |
|---|---|---|
| [roomOptions] | RoomOptions | The options for the room. |
connection.getRoom() ⇒ Room | null
Gets a Room instance of the connection
Kind: instance method of Connection
Returns: Room | null - Associated Room instance or null if no room has been joined
connection.disconnect() ⇒ void
Disconnects the connection.
Kind: instance method of Connection
Connection.Events
Kind: static Event of Connection
Properties
| Name | Type | Description |
|---|---|---|
| connectionEstablished | ConnectionEstablishedEvent | Connection joined event |
| connectionDisconneced | ConnectionDisconnectedEvent | Connection disconnected disconnected event |
| connectionFailed | ConnectionFailedEvent | indicating that a connection has failed |
| connectionRedirected | ConnectionRedirectedEvent | indicating that a connection has been redirected |