update to sdk api change: audioLevel stats$()

This commit is contained in:
Timo K.
2026-10-14 10:23:29 +02:00
committed by Timo
parent 79c1f82448
commit b0659279ee
4 changed files with 12 additions and 12 deletions
+4 -1
View File
@@ -35,6 +35,9 @@ import { type UserMediaViewModel } from "./UserMediaViewModel";
import { type ScreenShareViewModel } from "./ScreenShareViewModel";
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
/** How often a view model reads a track's RTP statistics while it needs them. */
export const statsIntervalMs = 1000;
// TODO: Encryption status is kinda broken and thus unused right now. Remove?
export enum EncryptionStatus {
Connecting,
@@ -157,7 +160,7 @@ function receivingOkay$(
): Observable<boolean | undefined> {
let last: { framesDecoded?: number; framesReceived?: number } = {};
return track$.pipe(
switchMap((track) => track?.stats$ ?? of(undefined)),
switchMap((track) => track?.stats$(statsIntervalMs) ?? of(undefined)),
map((stats): boolean | undefined => {
if (stats === undefined || stats.type !== "inbound-rtp") return undefined;
const { framesDecoded, framesReceived } =