Add hideControls url param for screen recordings.

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2023-10-21 01:07:02 +02:00
parent caaf99b25a
commit f74b982568
3 changed files with 28 additions and 5 deletions

View File

@@ -62,6 +62,10 @@ interface UrlParams {
* Whether to hide the room header when in a call.
*/
hideHeader: boolean;
/**
* Whether the controls should be shown. For screen recording no controls can be desired.
*/
hideControls:boolean;
/**
* Whether to hide the screen-sharing button.
*/
@@ -195,6 +199,7 @@ export const getUrlParams = (
appPrompt: parser.getFlagParam("appPrompt", true),
preload: parser.getFlagParam("preload"),
hideHeader: parser.getFlagParam("hideHeader"),
hideControls: parser.getFlagParam("hideControls"),
hideScreensharing: parser.getFlagParam("hideScreensharing"),
e2eEnabled: parser.getFlagParam("enableE2e", true),
userId: parser.getParam("userId"),

View File

@@ -98,3 +98,12 @@ limitations under the License.
gap: var(--cpd-space-4x);
}
}
.footerThin {
padding-top: var(--cpd-space-3x);
padding-bottom: var(--cpd-space-5x);
}
.footerHidden {
display: none;
}

View File

@@ -41,6 +41,7 @@ import { useTranslation } from "react-i18next";
import useMeasure from "react-use-measure";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
import classNames from "classnames";
import LogoMark from "../icons/LogoMark.svg?react";
import LogoType from "../icons/LogoType.svg?react";
@@ -177,7 +178,7 @@ export const InCallView: FC<InCallViewProps> = ({
const [showConnectionStats] = useShowConnectionStats();
const { hideScreensharing } = useUrlParams();
const { hideScreensharing, hideControls } = useUrlParams();
const { isScreenShareEnabled, localParticipant } = useLocalParticipant({
room: livekitRoom,
@@ -387,7 +388,15 @@ export const InCallView: FC<InCallViewProps> = ({
/>,
);
footer = (
<div className={styles.footer}>
<div
className={classNames(
hideControls
? hideHeader
? [styles.footer, styles.footerHidden]
: [styles.footer, styles.footerThin]
: styles.footer,
)}
>
{!mobile && !hideHeader && (
<div className={styles.logo}>
<LogoMark width={24} height={24} aria-hidden />
@@ -398,8 +407,8 @@ export const InCallView: FC<InCallViewProps> = ({
/>
</div>
)}
<div className={styles.buttons}>{buttons}</div>
{!mobile && !hideHeader && (
{!hideControls && <div className={styles.buttons}>{buttons}</div>}
{!mobile && !hideHeader && !hideControls && (
<LayoutToggle
className={styles.layout}
layout={layout}
@@ -424,7 +433,7 @@ export const InCallView: FC<InCallViewProps> = ({
/>
</LeftNav>
<RightNav>
{!reducedControls && onShareClick !== null && (
{!reducedControls && !hideControls && onShareClick !== null && (
<InviteButton onClick={onShareClick} />
)}
</RightNav>