Room
Room object corresponding to a ProCONF room.
Kind: global class
Properties
| Name | Type | Description |
|---|---|---|
| localParticipant | LocalParticipant | null | The local participant's instance. |
| participants | Map.<Participant.ID, RemoteParticipant> | A map of IDs to remote participants. |
| sid | SID | The session ID. |
| name | string | The name of the room. |
| dominantSpeaker | LocalParticipant | RemoteParticipant | null | The dominant speaker last detected in the room. |
| isRecording | boolean | Whether the room is being recorded, always false in this version of SDK. |
| currentDatatrackId | DataTrack.ID | The current datatrack id. |
- Room
- instance
- .getRoomName ⇒
string - .init(roomOptions) ⇒
Promise|Room - .disconnect() ⇒
void - .getStats() ⇒
Promise.<Array.<PeerConnectionStats>> - .refreshInactiveMedia() ⇒
void - .join(password, [replaceParticipant]) ⇒
void - .end() ⇒
void - .getLocalUserId() ⇒
string - .addLocalTrack(track) ⇒
Promise - .addLocalDataTrack(track) ⇒
Promise
- .getRoomName ⇒
- static
- instance
room.getRoomName ⇒ string
Get the room name.
Kind: instance method of Room
Returns: string - The room name.
Throws:
- ProConfError.ROOM_NOT_EXISTS_ERROR if the Room does not exist.
room.init(roomOptions) ⇒ Promise | Room
Initializes the room.
Kind: instance method of Room
Returns: Promise - A promise that resolves to the object representing the initialized room.Room - The room object.
Throws:
ProConfError.EVENT_ERRORif the room cannot be initialized.ProConfError.ROOM_INITIALIZING_ERRORif the room cannot be initialized.
Fulfil: Room object
Reject: ProConfError - Error if room not initialized
| Param | Type | Description |
|---|---|---|
| roomOptions | RoomOptions | The room options. |
room.disconnect() ⇒ void
Disconnect from the Room.
Kind: instance method of Room
Throws:
ProConfError.ROOM_NOT_EXISTS_ERRORif the Room not exists.
room.getStats() ⇒ Promise.<Array.<PeerConnectionStats>>
Get the Room's media statistics
Kind: instance method of Room
room.refreshInactiveMedia() ⇒ void
Restart the muted local media Tracks and play inadvertently paused HTMLMediaElements that are attached to local and remote media Tracks. This method is useful mainly on mobile browsers (Safari and Chrome on iOS), where there is a possibility that the muted local media Tracks are never unmuted and inadvertently paused HTMLMediaElements are never played again, especially after handling an incoming phone call.
Kind: instance method of Room
Throws:
- ProConfError - Function not Supported.
room.join(password, [replaceParticipant]) ⇒ void
Joins the Room.
Kind: instance method of Room
Throws:
- ProConfError if fail to join the Room.
| Param | Type | Default | Description |
|---|---|---|---|
| password | string | The password to join the room. | |
| [replaceParticipant] | boolean | false | Whether to replace the participant. |
room.end() ⇒ void
Ends the room.
Kind: instance method of Room
Throws:
- ProConfError if the Room not exists.
room.getLocalUserId() ⇒ string
Fetches the user ID of the local participant.
Kind: instance method of Room
Returns: string - The user ID of the local participant or null if the Room is not initialized.
Throws:
- ProConfError if the Room not exists.
room.addLocalTrack(track) ⇒ Promise
Adds a local track to the room.
Kind: instance method of Room
Returns: Promise - A promise that resolves when the track is added successfully.
Throws:
- ProConfError if the participant does not exist or administrator has disabled videoCall config from backend.
Fulfil: void
Reject: ProConfError On error
| Param | Type | Description |
|---|---|---|
| track | LocalTrack | MediaStreamTrack | The LocalTrack or media stream track to be added. |
room.addLocalDataTrack(track) ⇒ Promise
Adds a local data track to the room.
Kind: instance method of Room
Fulfil: void - The local datatrack.
| Param | Type |
|---|---|
| track | DataTrack |
Room.SID : string
Type of room.sid
Kind: static typedef of Room
Room.State : string
State of room; any of - 'connected' | 'disconnected' | 'reconnecting'
Kind: static typedef of Room
Room.Events
Kind: static typedef of Room
Properties
| Name | Type | Description |
|---|---|---|
| roomJoined | RoomJoinedEvent | Room joined event |
| disconnected | DisconnectedEvent | Room disconnected event |
| participantConnected | ParticipantConnectedEvent | Participant connected event |
| participantDisconnected | ParticipantDisconnectedEvent | Participant disconnected event |
| trackSubscribed | TrackSubscribedEvent | Track subscribed event |
| trackUnsubscribed | TrackUnsubscribedEvent | Track unsubscribed event |
| dominantSpeakerChanged | DominantSpeakerChangedEvent | Dominant speaker changed event |
| mediaSessionStarted | MediaSessionStartedEvent | Media session started event |
| mediaActiveSessionChanged | MediaActiveSessionChangedEvent | Media active session changed event |
| audioInputStateChange | AudioInputStateChangeEvent | Audio input state change event |
| audioUnmutePermissionsChanged | AudioUnmutePermissionsChangedEvent | Audio unmute permissions changed event |
| noAudioInput | NoAudioInputEvent | No audio input event |
| nonParticipantMessageReceived | NonParticipantMessageRecivedEvent | Non participant message received event |
| privateMessageReceived | PrivateMessageReceivedEvent | Private message received event |
| visitorsMessage | VisitorsMessageEvent | Visitors message event |
| visitorsRejection | VisitorsRejectionEvent | Visitors rejection event |
| roomError | RoomErrorEvent | Room error event |
| roomJoinInProgress | RoomJoinInProgressEvent | Room join in progress event |
| roomLeft | RoomLeftEvent | Room left event |
| roomUniqueIdSet | RoomUniqueIdSetEvent | Room unique ID set event |
| roomCreatedTimestamp | RoomCreatedTimestampEvent | Room created timestamp event |
| connectionRestored | ConnectionRestoredEvent | Connection restored event |
| connectionInterrupted | ConnectionInterruptedEvent | Connection interrupted event |
| connectionRedirected | ConnectionRedirectedEvent | Connection redirected event |
| lobbyUserJoined | LobbyUserJoinedEvent | Lobby user joined event |
| lobbyUserLeft | LobbyUserLeftEvent | Lobby user left event |
| lobbyUserUpdated | LobbyUserUpdatedEvent | Lobby user updated event |
| membersOnlyChanged | MembersOnlyChangedEvent | Members only changed event |
| userStatusChanged | UserStatusChangedEvent | User status changed event |
| messageReceived | MessageReceivedEvent | Message received event |
| trackAdded | TrackAddedEvent | Track added event |
| trackRemoved | TrackRemovedEvent | Track removed event |
| trackAudioLevelChanged | TrackAudioLevelChangedEvent | Track audio level changed event |
| trackUnmuteRejected | TrackUnmuteRejectedEvent | Track unmute rejected event |
| breakoutRoomsMoveToRoom | BreakoutRoomsMoveToRoomEvent | Breakout rooms move to room event |
| dataChannelClosed | DataChannelClosedEvent | Data channel closed event |
| dataChannelOpened | DataChannelOpenedEvent | Data channel opened event |
| participantKicked | ParticipantKickedEvent | Participant kicked event |