diff --git a/examples/react-client/fishjam-chat/src/components/CallToolbar.tsx b/examples/react-client/fishjam-chat/src/components/CallToolbar.tsx index 43ecb14d..433b2e0f 100644 --- a/examples/react-client/fishjam-chat/src/components/CallToolbar.tsx +++ b/examples/react-client/fishjam-chat/src/components/CallToolbar.tsx @@ -36,6 +36,16 @@ export const CallToolbar = () => { const CameraIcon = cameraStream ? Video : VideoOff; const ScreenshareIcon = screenStream ? MonitorOff : MonitorUp; + const toggleScreenShare = async () => { + if (screenStream) return stopStreaming(); + try { + await startStreaming(); + } catch (error) { + if (error instanceof Error && error.name === "NotAllowedError") return; + console.error(error); + } + }; + return (