From 93d763f58f6f76889c097e5464fef616779f76ea Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 14 Oct 2025 14:06:54 +0200 Subject: [PATCH] devtool: quick display of focus URL in stats tile --- src/RTCConnectionStats.tsx | 25 ++++++++++++++++++++++++- src/state/CallViewModel.ts | 8 +++++++- src/state/MediaViewModel.ts | 9 +++++++++ src/state/ScreenShare.ts | 2 ++ src/state/UserMedia.ts | 3 +++ src/tile/GridTile.tsx | 1 + src/tile/MediaView.tsx | 4 ++++ src/tile/SpotlightTile.tsx | 2 +- src/utils/test.ts | 2 ++ 9 files changed, 53 insertions(+), 3 deletions(-) diff --git a/src/RTCConnectionStats.tsx b/src/RTCConnectionStats.tsx index dcd8d019..d51089cf 100644 --- a/src/RTCConnectionStats.tsx +++ b/src/RTCConnectionStats.tsx @@ -19,10 +19,26 @@ import mediaViewStyles from "../src/tile/MediaView.module.css"; interface Props { audio?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats; video?: RTCInboundRtpStreamStats | RTCOutboundRtpStreamStats; + focusUrl?: string; } +const extractDomain = (url: string): string => { + try { + const parsedUrl = new URL(url); + return parsedUrl.hostname; // Returns "kdk.cpm" + } catch (error) { + console.error("Invalid URL:", error); + return url; + } +}; + // This is only used in developer mode for debugging purposes, so we don't need full localization -export const RTCConnectionStats: FC = ({ audio, video, ...rest }) => { +export const RTCConnectionStats: FC = ({ + audio, + video, + focusUrl, + ...rest +}) => { const [showModal, setShowModal] = useState(false); const [modalContents, setModalContents] = useState< "video" | "audio" | "none" @@ -55,6 +71,13 @@ export const RTCConnectionStats: FC = ({ audio, video, ...rest }) => { + {focusUrl && ( +
+ +  {extractDomain(focusUrl)} + +
+ )} {audio && (