mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
update to sdk api change: audioLevel stats$()
This commit is contained in:
@@ -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 } =
|
||||
|
||||
Reference in New Issue
Block a user