Video
Enable Video
The enableVideo method enables the local microphone and starts producing the video stream with the label video.
enableVideo method calls both fetchStream and produce method internally.It also return MediaStream which can be used to render the screen share stream in the UI.
Example
// Enable Video stream
const stream = await huddleClient.localPeer.enableVideo();The disableVideo method stops the local video stream and also stops producing the video stream with remote peers.
Example
// Disable video stream
await huddleClient.localPeer.disableVideo();replaceVideoStream
The replacevideoStream method replaces the current video stream with the new stream.
Parameters
| Params | Type | Description | Return Type |
|---|---|---|---|
| mediastream | MediaStream | This function replaces the video stream | Promise<void> |
Example
// Usage
await huddleClient.localPeer.replaceVideoStream({MediaStream});changeVideoSource
The changeVideoSource changes the Video source to the given deviceId, sets the preferred cam device as the given deviceId
Parameters
| Params | Type | Description | Return Type |
|---|---|---|---|
| deviceId | string | This function changes the video stream | Promise<void> |
Example
// Usage
await huddleClient.localPeer.changeVideoSource({deviceId});