From 3f789d32c1f94c24f78176f0b89e7c0e6b7c04d2 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 4 Feb 2022 14:02:56 +0000 Subject: [PATCH] Add logging to diagnose no-video bug (#7721) Log in/outbound RTP stats so we can see ifn we're sending & receiving video, and log when we successfully play the video element. --- src/CallHandler.tsx | 10 ++++++++++ src/components/views/voip/VideoFeed.tsx | 1 + 2 files changed, 11 insertions(+) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index 0af6dedcd2..d7f3ea8fcf 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -643,6 +643,16 @@ export default class CallHandler extends EventEmitter { `bytes received: ${pair.bytesReceived}, bytes sent: ${pair.bytesSent}, `, ); } + + logger.debug("Outbound RTP:"); + for (const s of stats.filter(item => item.type === 'outbound-rtp')) { + logger.debug(s); + } + + logger.debug("Inbound RTP:"); + for (const s of stats.filter(item => item.type === 'inbound-rtp')) { + logger.debug(s); + } } private setCallState(call: MatrixCall, status: CallState): void { diff --git a/src/components/views/voip/VideoFeed.tsx b/src/components/views/voip/VideoFeed.tsx index 532a863272..c000b3e08d 100644 --- a/src/components/views/voip/VideoFeed.tsx +++ b/src/components/views/voip/VideoFeed.tsx @@ -137,6 +137,7 @@ export default class VideoFeed extends React.PureComponent { // them with another load() which will cancel the pending one, but since we don't call // load() explicitly, it shouldn't be a problem. - Dave await element.play(); + logger.debug((this.props.feed.isLocal ? "Local" : "Remote") + " video feed play() completed"); } catch (e) { logger.info("Failed to play media element with feed", this.props.feed, e); }