diff --git a/packages/hms-video-store/src/diagnostics/DiagnosticsStatsCollector.ts b/packages/hms-video-store/src/diagnostics/DiagnosticsStatsCollector.ts index bec0e46874..af12183fae 100644 --- a/packages/hms-video-store/src/diagnostics/DiagnosticsStatsCollector.ts +++ b/packages/hms-video-store/src/diagnostics/DiagnosticsStatsCollector.ts @@ -67,7 +67,9 @@ export class DiagnosticsStatsCollector { const ridAveragedVideoBitrateList = this.localVideoTrackStatsList.map(trackStatsMap => trackStatsMap ? calculateAverage(Object.values(trackStatsMap), curr => curr.bitrate) : 0, ); - + const audioJitter = getLastElement(this.remoteAudioTrackStatsList)?.jitter || 0; + const videoJitter = getLastElement(this.remoteVideoTrackStatsList)?.jitter || 0; + const jitter = Math.max(audioJitter, videoJitter); const lastLocalAudioTrackStats = getLastElement(this.localAudioTrackStatsList); const lastLocalVideoTrackStats = getLastElement(this.localVideoTrackStatsList); @@ -80,6 +82,7 @@ export class DiagnosticsStatsCollector { bytesReceived: lastSubscribeStats?.bytesReceived || 0, bitrateSent: calculateAverage(this.peerStatsList, curr => curr.publish?.bitrate), bitrateReceived: calculateAverage(this.peerStatsList, curr => curr.subscribe?.bitrate), + jitter: jitter, }, audio: { roundTripTime, @@ -91,6 +94,7 @@ export class DiagnosticsStatsCollector { bytesSent: lastLocalAudioTrackStats ? Object.values(lastLocalAudioTrackStats).reduce((acc, curr) => acc + (curr.bytesSent || 0), 0) : 0, + jitter: audioJitter, }, video: { roundTripTime, @@ -102,6 +106,7 @@ export class DiagnosticsStatsCollector { bytesSent: lastLocalVideoTrackStats ? Object.values(lastLocalVideoTrackStats).reduce((acc, curr) => acc + (curr.bytesSent || 0), 0) : 0, + jitter: videoJitter, }, }; } diff --git a/packages/hms-video-store/src/diagnostics/interfaces.ts b/packages/hms-video-store/src/diagnostics/interfaces.ts index 3a5b1f8dd2..8be0202847 100644 --- a/packages/hms-video-store/src/diagnostics/interfaces.ts +++ b/packages/hms-video-store/src/diagnostics/interfaces.ts @@ -88,4 +88,5 @@ export interface DiagnosticsRTCStats { bitrateSent: number; bitrateReceived: number; roundTripTime: number; + jitter: number; } diff --git a/packages/roomkit-react/package.json b/packages/roomkit-react/package.json index 851029877e..f9b84818ae 100644 --- a/packages/roomkit-react/package.json +++ b/packages/roomkit-react/package.json @@ -76,7 +76,7 @@ }, "dependencies": { "@100mslive/hls-player": "0.3.25", - "@100mslive/hms-noise-cancellation": "0.0.1", + "@100mslive/hms-noise-cancellation": "0.0.2-alpha.8", "@100mslive/hms-virtual-background": "1.13.25", "@100mslive/hms-whiteboard": "0.0.15", "@100mslive/react-icons": "0.10.25", diff --git a/packages/roomkit-react/src/Diagnostics/ConnectivityTest.tsx b/packages/roomkit-react/src/Diagnostics/ConnectivityTest.tsx index 4ea61570a0..008d06505f 100644 --- a/packages/roomkit-react/src/Diagnostics/ConnectivityTest.tsx +++ b/packages/roomkit-react/src/Diagnostics/ConnectivityTest.tsx @@ -164,6 +164,7 @@ const AudioStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => { + )} @@ -182,6 +183,7 @@ const VideoStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => { + )} diff --git a/yarn.lock b/yarn.lock index dca0b2a3a2..3a8173989b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@100mslive/hms-noise-cancellation@0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.1.tgz#037c8bdfb6b2d7bf12f9d257422150fe6ca43acb" - integrity sha512-DGnzcXRDJREWypIjGX70er+f2k/XLLRF41lrXPs1+PtB1imdEkECPPS0Fg4BA0BCWKDNAGTZBHZPrBDgUmr9Lw== +"@100mslive/hms-noise-cancellation@0.0.2-alpha.8": + version "0.0.2-alpha.8" + resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.2-alpha.8.tgz#0cdd4801ad0a85e7c09ad7fe760840d897619ba3" + integrity sha512-1NKK3P+8Mb/lQMuDu3+VOEwFjMhGD5yiz94C6c2yVpv7/q3n6XDbkdTycnmWNpoOqW5AfMPr8DtxD/dYQkhUOA== "@100mslive/types-prebuilt@0.12.12": version "0.12.12"