Video
Name | Type | Description |
---|---|---|
fetchVideoStream(deviceId?: string) | Function | Enables video stream from user’s device cam(lobby) |
stopVideoStream() | Function | Disables video stream from user’s device cam(lobby) |
produceVideo(camStream: MediaStream, peerIds?: string[]) | Function | Starts sharing user’s webcam stream with other peers in the room |
stopProducingVideo() | Function | Stops sharing user’s webcam stream with other peers in the room |
enumerateDevices() | Function | Returns the list of video devices |
createSingleConsumer(peerId: string, "cam") | Function | Starts consuming video stream for given peerId |
closeSingleConsumer(peerId: string, "cam") | Function | Stops consuming video stream for given peerId |
Example
<script src="https://unpkg.com/@huddle01/web-core@latest/dist/index.js"></script>
<body>
<button id="fetchVideoStream">Fetch Video Stream</button>
</body>
<script>
document.getElementById("fetchVideoStream").addEventListener("click", async () => {
await huddleClient.fetchVideoStream();
});
</script>