Merge pull request #1123 from robintown/connection-indicators
Hide connection quality indicators behind a developer setting
This commit is contained in:
commit
4fd1264d12
5 changed files with 31 additions and 2 deletions
|
@ -86,6 +86,7 @@
|
|||
"Settings": "Settings",
|
||||
"Share screen": "Share screen",
|
||||
"Show call inspector": "Show call inspector",
|
||||
"Show connection stats": "Show connection stats",
|
||||
"Sign in": "Sign in",
|
||||
"Sign out": "Sign out",
|
||||
"Speaker": "Speaker",
|
||||
|
|
|
@ -53,7 +53,10 @@ import {
|
|||
useVideoGridLayout,
|
||||
TileDescriptor,
|
||||
} from "../video-grid/VideoGrid";
|
||||
import { useShowInspector } from "../settings/useSetting";
|
||||
import {
|
||||
useShowInspector,
|
||||
useShowConnectionStats,
|
||||
} from "../settings/useSetting";
|
||||
import { useModalTriggerState } from "../Modal";
|
||||
import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
|
||||
import { useUrlParams } from "../UrlParams";
|
||||
|
@ -152,6 +155,7 @@ export function InCallView({
|
|||
);
|
||||
|
||||
const [showInspector] = useShowInspector();
|
||||
const [showConnectionStats] = useShowConnectionStats();
|
||||
|
||||
const { hideScreensharing } = useUrlParams();
|
||||
|
||||
|
@ -255,6 +259,7 @@ export function InCallView({
|
|||
key={maximisedParticipant.id}
|
||||
data={maximisedParticipant.data}
|
||||
showSpeakingIndicator={false}
|
||||
showConnectionStats={showConnectionStats}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -268,6 +273,7 @@ export function InCallView({
|
|||
{(props) => (
|
||||
<VideoTile
|
||||
showSpeakingIndicator={items.length > 2}
|
||||
showConnectionStats={showConnectionStats}
|
||||
{...props}
|
||||
ref={props.ref as Ref<HTMLDivElement>}
|
||||
/>
|
||||
|
|
|
@ -33,6 +33,7 @@ import {
|
|||
useShowInspector,
|
||||
useOptInAnalytics,
|
||||
useDeveloperSettingsTab,
|
||||
useShowConnectionStats,
|
||||
} from "./useSetting";
|
||||
import { FieldRow, InputField } from "../input/Input";
|
||||
import { Button } from "../button";
|
||||
|
@ -59,6 +60,8 @@ export const SettingsModal = (props: Props) => {
|
|||
const [optInAnalytics, setOptInAnalytics] = useOptInAnalytics();
|
||||
const [developerSettingsTab, setDeveloperSettingsTab] =
|
||||
useDeveloperSettingsTab();
|
||||
const [showConnectionStats, setShowConnectionStats] =
|
||||
useShowConnectionStats();
|
||||
|
||||
const downloadDebugLog = useDownloadDebugLog();
|
||||
|
||||
|
@ -232,6 +235,18 @@ export const SettingsModal = (props: Props) => {
|
|||
}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<InputField
|
||||
id="showConnectionStats"
|
||||
name="connection-stats"
|
||||
label={t("Show connection stats")}
|
||||
type="checkbox"
|
||||
checked={showConnectionStats}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||
setShowConnectionStats(e.target.checked)
|
||||
}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<Button onPress={downloadDebugLog}>
|
||||
{t("Download debug logs")}
|
||||
|
|
|
@ -101,6 +101,9 @@ export const useOptInAnalytics = (): DisableableSetting<boolean | null> => {
|
|||
export const useDeveloperSettingsTab = () =>
|
||||
useSetting("developer-settings-tab", false);
|
||||
|
||||
export const useShowConnectionStats = () =>
|
||||
useSetting("show-connection-stats", false);
|
||||
|
||||
export const useDefaultDevices = () =>
|
||||
useSetting("defaultDevices", {
|
||||
audioinput: "",
|
||||
|
|
|
@ -54,6 +54,7 @@ interface Props {
|
|||
className?: string;
|
||||
style?: React.ComponentProps<typeof animated.div>["style"];
|
||||
showSpeakingIndicator: boolean;
|
||||
showConnectionStats: boolean;
|
||||
}
|
||||
|
||||
export const VideoTile = React.forwardRef<HTMLDivElement, Props>(
|
||||
|
@ -65,6 +66,7 @@ export const VideoTile = React.forwardRef<HTMLDivElement, Props>(
|
|||
targetWidth,
|
||||
targetHeight,
|
||||
showSpeakingIndicator,
|
||||
showConnectionStats,
|
||||
},
|
||||
tileRef
|
||||
) => {
|
||||
|
@ -138,7 +140,9 @@ export const VideoTile = React.forwardRef<HTMLDivElement, Props>(
|
|||
<div className={classNames(styles.infoBubble, styles.memberName)}>
|
||||
{microphoneMuted ? <MicMutedIcon /> : <MicIcon />}
|
||||
<span title={displayName}>{displayName}</span>
|
||||
<ConnectionQualityIndicator participant={sfuParticipant} />
|
||||
{showConnectionStats && (
|
||||
<ConnectionQualityIndicator participant={sfuParticipant} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<VideoTrack
|
||||
|
|
Loading…
Add table
Reference in a new issue