diff --git a/src/RTCConnectionStats.module.css b/src/RTCConnectionStats.module.css index d663577c..0e29eaa9 100644 --- a/src/RTCConnectionStats.module.css +++ b/src/RTCConnectionStats.module.css @@ -9,6 +9,12 @@ Please see LICENSE in the repository root for full details. font-size: var(--font-size-micro); } -.icon { - color: var(--cpd-color-text-primary); +.statsPill { + border-radius: var(--media-view-border-radius); + grid-area: none; + position: absolute; + top: 0; + left: 0; + flex-direction: column; + align-items: flex-start; } diff --git a/src/RTCConnectionStats.tsx b/src/RTCConnectionStats.tsx index eedce04d..d092b677 100644 --- a/src/RTCConnectionStats.tsx +++ b/src/RTCConnectionStats.tsx @@ -6,15 +6,16 @@ Please see LICENSE in the repository root for full details. */ import { useState, type FC } from "react"; -import { IconButton, Text } from "@vector-im/compound-web"; +import { Button, Text } from "@vector-im/compound-web"; import { MicOnSolidIcon, VideoCallSolidIcon, } from "@vector-im/compound-design-tokens/assets/web/icons"; +import classNames from "classnames"; import { Modal } from "./Modal"; import styles from "./RTCConnectionStats.module.css"; - +import mediaViewStyles from "../src/tile/MediaView.module.css"; interface Props { audio?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats; video?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats; @@ -37,7 +38,7 @@ export const RTCConnectionStats: FC = ({ audio, video, ...rest }) => { setModalContents("none"); }; return ( -
+
= ({ audio, video, ...rest }) => { {audio && (
- showFullModal("audio")} size="sm"> - - - {"jitter" in audio && typeof audio.jitter === "number" && ( - -  {(audio.jitter * 1000).toFixed(0)}ms - - )} +
)} {video && (
- showFullModal("video")} size="sm"> - - - {video?.framesPerSecond && ( - -  {video.framesPerSecond.toFixed(0)}fps - - )} - {"jitter" in video && typeof video.jitter === "number" && ( - -  {(video.jitter * 1000).toFixed(0)}ms - - )} - {"frameHeight" in video && - typeof video.frameHeight === "number" && - "frameWidth" in video && - typeof video.frameWidth === "number" && ( - -  {video.frameWidth}x{video.frameHeight} +
)}