diff --git a/package.json b/package.json index 571fe9e7..e02952a6 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-rxjs": "^5.0.3", "eslint-plugin-unicorn": "^56.0.0", + "fetch-mock": "11.1.5", "global-jsdom": "^26.0.0", "i18next": "^24.0.0", "i18next-browser-languagedetector": "^8.0.0", @@ -108,7 +109,7 @@ "livekit-client": "^2.13.0", "lodash-es": "^4.17.21", "loglevel": "^1.9.1", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#head=toger5/use-relation-based-CallMembership-create-ts", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#head=develop", "matrix-widget-api": "^1.13.0", "normalize.css": "^8.0.1", "observable-hooks": "^4.2.3", diff --git a/src/MediaDevicesContext.ts b/src/MediaDevicesContext.ts index 3cf54c2a..801219b0 100644 --- a/src/MediaDevicesContext.ts +++ b/src/MediaDevicesContext.ts @@ -23,14 +23,6 @@ export function useMediaDevices(): MediaDevices { return mediaDevices; } -export const useIsEarpiece = (): boolean => { - const devices = useMediaDevices(); - const audioOutput = useObservableEagerState(devices.audioOutput.selected$); - const available = useObservableEagerState(devices.audioOutput.available$); - if (!audioOutput?.id) return false; - return available.get(audioOutput.id)?.type === "earpiece"; -}; - /** * A convenience hook to get the audio node configuration for the earpiece. * It will check the `useAsEarpiece` of the `audioOutput` device and return 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 && (