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 e6272ca..ed96b97 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -59,6 +59,7 @@ import { AudioContainer } from "../video-grid/AudioContainer"; import { useAudioOutputDevice } from "../video-grid/useAudioOutputDevice"; import { widget, ElementWidgetActions } from "../widget"; import { useJoinRule } from "./useJoinRule"; +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 @@ -145,6 +146,8 @@ export function InCallView({ useAudioOutputDevice(audioRef, audioOutput); + const { hideScreensharing } = useUrlParams(); + useEffect(() => { widget?.api.transport.send( layout === "freedom" @@ -333,12 +336,15 @@ export function InCallView({