Video
The Video namespace contains the classes and functions that you need to create a video conferencing application.
Classes
- RoomDevice
- RoomScreenShare
- RoomSession
- RoomSessionDevice
- RoomSessionPlayback
- RoomSessionRecording
- RoomSessionScreenShare
Functions
Deprecated
Functions directly on the Video namespace have been deprecated. Please use the RoomSession object to access constructors, properties, methods, and events.
createRoomObject
▸ Const
createRoomObject(roomOptions
): Promise<Room>
⚠️ Deprecated
Use RoomSession instead.
Using Video.createRoomObject() you can create a RoomObject
to join a room.
Parameters
Name | Type | Description |
---|---|---|
applyLocalVideoOverlay? | boolean | Whether to apply the local-overlay on top of your video. Default: true . |
audio? | boolean | MediaTrackConstraints | Audio constraints to use when joining the room. Default: true . |
autoJoin? | boolean | Whether to automatically join the room session. |
iceServers? | RTCIceServer[] | List of ICE servers. |
logLevel? | "trace" | "debug" | "info" | "warn" | "error" | "silent" | Logging level. |
project | string | SignalWire project id, e.g. a10d8a9f-2166-4e82-56ff-118bc3a4840f . |
rootElementId? | string | Id of the HTML element in which to display the video stream. |
speakerId? | string | Id of the speaker device to use for audio output. If undefined, picks a default speaker. |
stopCameraWhileMuted? | boolean | Whether to stop the camera when the member is muted. Default: true . |
stopMicrophoneWhileMuted? | boolean | Whether to stop the microphone when the member is muted. Default: true . |
token | string | SignalWire project token, e.g. PT9e5660c101cd140a1c93a0197640a369cf5f16975a0079c9 . |
video? | boolean | MediaTrackConstraints | Video constraints to use when joining the room. Default: true . |
Returns
Promise<Room>
Example
With an HTMLDivElement with id="root" in the DOM.
// <div id="root"></div>
try {
const roomObj = await Video.createRoomObject({
token: "<YourJWT>",
rootElementId: "root"
});
roomObj.join();
} catch (error) {
console.error("Error", error);
}
joinRoom
▸ Const
joinRoom(roomOptions
): Promise<Room>
⚠️ Deprecated.
Use RoomSession instead.
Using Video.joinRoom() you can automatically join a room.
Parameters
Name | Type | Description |
---|---|---|
applyLocalVideoOverlay? | boolean | Whether to apply the local-overlay on top of your video. Default: true . |
audio? | boolean | MediaTrackConstraints | Audio constraints to use when joining the room. Default: true . |
autoJoin? | boolean | Whether to automatically join the room session. |
iceServers? | RTCIceServer[] | List of ICE servers. |
logLevel? | "trace" | "debug" | "info" | "warn" | "error" | "silent" | Logging level. |
project | string | SignalWire project id, e.g. a10d8a9f-2166-4e82-56ff-118bc3a4840f . |
rootElementId? | string | Id of the HTML element in which to display the video stream. |
speakerId? | string | Id of the speaker device to use for audio output. If undefined, picks a default speaker. |
stopCameraWhileMuted? | boolean | Whether to stop the camera when the member is muted. Default: true . |
stopMicrophoneWhileMuted? | boolean | Whether to stop the microphone when the member is muted. Default: true . |
token | string | SignalWire project token, e.g. PT9e5660c101cd140a1c93a0197640a369cf5f16975a0079c9 . |
video? | boolean | MediaTrackConstraints | Video constraints to use when joining the room. Default: true . |
Returns
Promise<Room>
Example
With an HTMLDivElement with id="root" in the DOM.
// <div id="root"></div>
try {
const roomObj = await Video.joinRoom({
token: "<YourJWT>",
rootElementId: "root",
});
// You have joined the room..
} catch (error) {
console.error("Error", error);
}