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 && (