
                }

                videoCanvas.width = video.videoWidth;
                videoCanvas.height = video.videoHeight;
                videoCtx.drawImage(video, 0, 0);
                var encodedImage = videoCanvas.toDataURL('image/jpeg').split(';base64,')[1];

                if (ws && ws.readyState === WebSocket.OPEN) {
                    ws.send(createImageContent(encodedImage));
                }
            }

            async function startScreenSharing() {
                try {
         