Room
Room information
Member Summary
Public Members | ||
public |
Additional room informations |
|
public |
The local stream of the room |
|
public |
The room name |
|
public |
The room owner uid |
|
public |
The room status:
|
|
public |
The room unique id |
Method Summary
Public Methods | ||
public |
Leaves & close the Room. |
|
public |
getLocalVideo(type: string, localStreamContainer: Element, constraints: MediaStreamConstraints): Promise<Local, Error> get a local stream in video tag |
|
public |
invite(users: User[], role: string, message: string): Promise<{room: Room, invites: Invite[]}, Error>{room:> Invite users to the room. |
|
public |
Join the room. |
|
public |
Leave the room. |
|
public |
localStreams(): Promise<Local[], Error> Get the list of locally published streams. |
|
public |
Get the list of messages. |
|
public |
on(event: string, callback: function, cancelCallback: Webcom/api.Query~cancelCallback) Register a callback for a specific event |
|
public |
participants(): Promise<Participant[], Error> Get the list of participants. |
|
public |
publish a local stream |
|
public |
remoteStreams(): Promise<Remote[], Error> Get the list of remotely published streams. |
|
public |
sendMessage(message: string): Promise<Message> Send an instant message |
|
public |
share(type: string, localStreamContainer: Element, constraints: MediaStreamConstraints): Promise<Local, Error> Publish a local stream |
Public Members
Public Methods
public getLocalVideo(type: string, localStreamContainer: Element, constraints: MediaStreamConstraints): Promise<Local, Error> source
get a local stream in video tag
Params:
Name | Type | Attribute | Description |
type | string | The stream type, see StreamTypes for possible values |
|
localStreamContainer | Element |
|
The element the stream is attached to. Can be null if already specified in Config. |
constraints | MediaStreamConstraints |
|
The stream constraints. If not defined, the constraints defined in Config will be used. |
public invite(users: User[], role: string, message: string): Promise<{room: Room, invites: Invite[]}, Error>{room:> source
Invite users to the room. This will only work if the current User is the owner or a moderator of this Room. This will create the invitation and add the user to the participants list.
public join(): Promise source
Join the room. Sets the connected status of the current participant to CONNECTED.
public leave(): Promise source
Leave the room. Sets the connected status of the current participant to WAS_CONNECTED, deletes medias and callbacks, closes WebRTC stacks in use.
public localStreams(): Promise<Local[], Error> source
Get the list of locally published streams. The streams published with another device won't be visible here This will only work if the user is either a participant or the owner of the room.
public messages(): Promise<Message[], Error> source
Get the list of messages. This will only work if the user is either a participant or the owner of the room.
public on(event: string, callback: function, cancelCallback: Webcom/api.Query~cancelCallback) source
Register a callback for a specific event
Params:
Name | Type | Attribute | Description |
event | string | The event name (Events/Room):
|
|
callback | function | The callback for the event, the arguments depends on the type of event:
|
|
cancelCallback | Webcom/api.Query~cancelCallback | The error callback for the event, takes an Error as only argument |
public participants(): Promise<Participant[], Error> source
Get the list of participants. This will only work if the user is either a participant or the owner of the room.
public remoteStreams(): Promise<Remote[], Error> source
Get the list of remotely published streams. This will only work if the user is either a participant or the owner of the room.
public sendMessage(message: string): Promise<Message> source
Send an instant message
Params:
Name | Type | Attribute | Description |
message | string | The message to send |
public share(type: string, localStreamContainer: Element, constraints: MediaStreamConstraints): Promise<Local, Error> source
Publish a local stream
Params:
Name | Type | Attribute | Description |
type | string | The stream type, see StreamTypes for possible values |
|
localStreamContainer | Element |
|
The element the stream is attached to. Can be null if already specified in Config. |
constraints | MediaStreamConstraints |
|
The stream constraints. If not defined, the constraints defined in Config will be used. |