diff --git a/src/UrlParams.ts b/src/UrlParams.ts index 84e2312..7090019 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -29,6 +29,8 @@ export interface UrlParams { preload: boolean; // Whether to hide the room header when in a call hideHeader: boolean; + // Whether to hide the screen-sharing button + hideScreensharing: boolean; // Whether to start a walkie-talkie call instead of a video call isPtt: boolean; // Whether to use end-to-end encryption @@ -84,6 +86,7 @@ export const getUrlParams = ( isEmbedded: hasParam("embed"), preload: hasParam("preload"), hideHeader: hasParam("hideHeader"), + hideScreensharing: hasParam("hideScreensharing"), isPtt: hasParam("ptt"), e2eEnabled: getParam("enableE2e") !== "false", // Defaults to true userId: getParam("userId"), diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 03c95fd..c1710e2 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -57,6 +57,7 @@ import { useFullscreen } from "../video-grid/useFullscreen"; import { AudioContainer } from "../video-grid/AudioContainer"; import { useAudioOutputDevice } from "../video-grid/useAudioOutputDevice"; import { widget, ElementWidgetActions } from "../widget"; +import { useUrlParams } from "../UrlParams"; const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {}); // There is currently a bug in Safari our our code with cloning and sending MediaStreams @@ -141,6 +142,8 @@ export function InCallView({ useAudioOutputDevice(audioRef, audioOutput); + const { hideScreensharing } = useUrlParams(); + useEffect(() => { widget?.api.transport.send( layout === "freedom" @@ -329,12 +332,15 @@ export function InCallView({