(
ref={ref}
{...rest}
>
+ {showCallFeedDebugInfo && (
+
+ {JSON.stringify(debugInfo)}
+
+ )}
{toolbarButtons.length > 0 && !maximised && (
{toolbarButtons}
)}
diff --git a/src/video-grid/VideoTileContainer.tsx b/src/video-grid/VideoTileContainer.tsx
index 14d346a..7c0a12e 100644
--- a/src/video-grid/VideoTileContainer.tsx
+++ b/src/video-grid/VideoTileContainer.tsx
@@ -66,6 +66,7 @@ export function VideoTileContainer({
speaking,
stream,
purpose,
+ debugInfo,
} = useCallFeed(item.callFeed);
const { rawDisplayName } = useRoomMemberName(item.member);
const [tileRef, mediaRef] = useSpatialMediaStream(
@@ -122,6 +123,7 @@ export function VideoTileContainer({
maximised={maximised}
fullscreen={fullscreen}
onFullscreen={onFullscreenCallback}
+ debugInfo={debugInfo}
{...rest}
/>
{videoTileSettingsModalState.isOpen && !maximised && item.callFeed && (
diff --git a/src/video-grid/useCallFeed.ts b/src/video-grid/useCallFeed.ts
index e29bfac..48657a7 100644
--- a/src/video-grid/useCallFeed.ts
+++ b/src/video-grid/useCallFeed.ts
@@ -18,6 +18,13 @@ import { useState, useEffect } from "react";
import { CallFeed, CallFeedEvent } from "matrix-js-sdk/src/webrtc/callFeed";
import { SDPStreamMetadataPurpose } from "matrix-js-sdk/src/webrtc/callEventTypes";
+const DEBUG_INFO_INTERVAL = 1000; // ms
+
+export interface CallFeedDebugInfo {
+ width: number | undefined;
+ height: number | undefined;
+}
+
interface CallFeedState {
callFeed: CallFeed | undefined;
isLocal: boolean;
@@ -29,6 +36,14 @@ interface CallFeedState {
disposed: boolean | undefined;
stream: MediaStream | undefined;
purpose: SDPStreamMetadataPurpose | undefined;
+ debugInfo: CallFeedDebugInfo;
+}
+
+function getDebugInfo(callFeed: CallFeed | undefined): CallFeedDebugInfo {
+ return {
+ width: callFeed?.stream?.getVideoTracks()?.[0]?.getSettings()?.width,
+ height: callFeed?.stream?.getVideoTracks()?.[0]?.getSettings()?.height,
+ };
}
function getCallFeedState(callFeed: CallFeed | undefined): CallFeedState {
@@ -46,6 +61,7 @@ function getCallFeedState(callFeed: CallFeed | undefined): CallFeedState {
disposed: callFeed ? callFeed.disposed : undefined,
stream: callFeed ? callFeed.stream : undefined,
purpose: callFeed ? callFeed.purpose : undefined,
+ debugInfo: getDebugInfo(callFeed),
};
}
@@ -81,7 +97,16 @@ export function useCallFeed(callFeed: CallFeed | undefined): CallFeedState {
onUpdateCallFeed();
+ const debugInfoInterval = setInterval(() => {
+ setState((prevState) => ({
+ ...prevState,
+ debugInfo: getDebugInfo(callFeed),
+ }));
+ }, DEBUG_INFO_INTERVAL);
+
return () => {
+ clearInterval(debugInfoInterval);
+
if (callFeed) {
callFeed.removeListener(CallFeedEvent.Speaking, onSpeaking);
callFeed.removeListener(