Skip to content

Commit

Permalink
Add API params to mute audio and/or video in Jitsi calls by default (#…
Browse files Browse the repository at this point in the history
…24820)

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
  • Loading branch information
dhenneke authored Mar 15, 2023
1 parent 4a18ab6 commit afe2ac2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/vector/jitsi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ let roomId: string;
let openIdToken: IOpenIDCredentials;
let roomName: string;
let startAudioOnly: boolean;
let startWithAudioMuted: boolean | undefined;
let startWithVideoMuted: boolean | undefined;
let isVideoChannel: boolean;
let supportsScreensharing: boolean;
let language: string;
Expand All @@ -80,6 +82,13 @@ const setupCompleted = (async (): Promise<string | void> => {
}
return vals[0];
};
const parseBooleanOrUndefined = (value: string | undefined): boolean | undefined => {
if (value === undefined) {
return undefined;
}

return value === "true";
};

// If we have these params, expect a widget API to be available (ie. to be in an iframe
// inside a matrix client). Otherwise, assume we're on our own, eg. have been popped
Expand Down Expand Up @@ -197,6 +206,8 @@ const setupCompleted = (async (): Promise<string | void> => {
roomId = qsParam("roomId", true);
roomName = qsParam("roomName", true);
startAudioOnly = qsParam("isAudioOnly", true) === "true";
startWithAudioMuted = parseBooleanOrUndefined(qsParam("startWithAudioMuted", true));
startWithVideoMuted = parseBooleanOrUndefined(qsParam("startWithVideoMuted", true));
isVideoChannel = qsParam("isVideoChannel", true) === "true";
supportsScreensharing = qsParam("supportsScreensharing", true) === "true";

Expand Down Expand Up @@ -388,8 +399,8 @@ function joinConference(audioInput?: string | null, videoInput?: string | null):
configOverwrite: {
subject: roomName,
startAudioOnly,
startWithAudioMuted: audioInput === null,
startWithVideoMuted: videoInput === null,
startWithAudioMuted: audioInput === null ? true : startWithAudioMuted,
startWithVideoMuted: videoInput === null ? true : startWithVideoMuted,
// Request some log levels for inclusion in rageshakes
// Ideally we would capture all possible log levels, but this can
// cause Jitsi Meet to try to post various circular data structures
Expand Down

0 comments on commit afe2ac2

Please sign in to comment.