Join to conference
To join a room or conference, call the join method. This should be called before invoking any other methods in the SDK. Pass the room name, user ID, and user name. The response of this method will include the details of participants and remote streams. The join method also accepts some custom attributes that can be used for your business logic.
How to use join method
const response = await twyng.join(ConferenceJoinInfo)
ConferenceJoinInfo(Object)
| Field | type | Description |
|---|---|---|
| roomId | string or number | The roomId is used to create namespaces where only certain user groups can gather. Each room is identified by a unique room ID.. Each room is identified by a unique room ID |
| userId | string or number | The userId is used to uniquely identify each user. |
| name | string | The name is used for displaying |
| attributes (optional) | string or number or object | The attributes are available in the remote streams object of that particular user. These can be used for building custom logic. |
| record | boolean | To see more details in Record conference |
| recordUrl | string | To see more details in Record conference |
Response of the join method
| Field | type |
|---|---|
| status (optional) | boolean |
| result (optional) | JoinResult |
| error (optional) | object |
JoinResult
| Field | type |
|---|---|
| streams | Array |
| participants | Array |
Detailed exmaple
const conferenceJoinInfo = {
roomId: 'global-education',
userId: 'student-01',
name: "Jhon Thomas",
attributes: {
rollNo: 21,
division: '12 B',
subject: 'Computer science'
},
record: true,
recordUrl: `https://twyng.com/record/global-education`
}
const response = await twyng.join(conferenceJoinInfo)