Browser SDK
Build voice, video and chat applications for the browser
v3
Deprecated
stream
void
Replaces the current local media stream with the one specified as a parameter.
The media stream to use.
Drawing and streaming the picture of a face:
1const canvas = document.createElement("canvas");2const ctx = canvas.getContext("2d");34// Set canvas size5canvas.width = 400;6canvas.height = 400;78// Draw circle9ctx.beginPath();10ctx.arc(200, 200, 150, 0, 2 * Math.PI);11ctx.fillStyle = "lightblue";12ctx.fill();1314// Draw eyes15ctx.beginPath();16ctx.arc(150, 150, 30, 0, 2 * Math.PI);17ctx.arc(250, 150, 30, 0, 2 * Math.PI);18ctx.fillStyle = "black";19ctx.fill();2021// Get the media stream22const stream = canvas.captureStream(25); // 25 FPS2324// Stream the canvas25await roomSession.setLocalStream(stream);