mirror of
https://github.com/vector-im/element-call.git
synced 2026-01-30 03:15:55 +00:00
Don't mirror rear-facing cameras in the lobby
This commit is contained in:
@@ -19,10 +19,13 @@ Please see LICENSE in the repository root for full details.
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
background-color: black;
|
||||
transform: scaleX(-1);
|
||||
background-color: var(--cpd-color-bg-subtle-primary);
|
||||
}
|
||||
|
||||
video.mirror {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
.avatarContainer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
||||
@@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
import { useEffect, useRef, FC, ReactNode } from "react";
|
||||
import useMeasure from "react-use-measure";
|
||||
import { LocalVideoTrack } from "livekit-client";
|
||||
import { facingModeFromLocalTrack, LocalVideoTrack } from "livekit-client";
|
||||
import classNames from "classnames";
|
||||
|
||||
import { Avatar } from "../Avatar";
|
||||
@@ -56,6 +56,12 @@ export const VideoPreview: FC<Props> = ({
|
||||
return (
|
||||
<div className={classNames(styles.preview)} ref={previewRef}>
|
||||
<video
|
||||
className={
|
||||
videoTrack &&
|
||||
facingModeFromLocalTrack(videoTrack).facingMode === "user"
|
||||
? styles.mirror
|
||||
: undefined
|
||||
}
|
||||
ref={videoEl}
|
||||
muted
|
||||
playsInline
|
||||
|
||||
Reference in New Issue
Block a user