Fix makeFocus

This commit is contained in:
Robin
2025-08-27 15:07:55 +02:00
committed by Timo K
parent 376a4b4e4a
commit c6e8c94fd6

View File

@@ -6,11 +6,10 @@ Please see LICENSE in the repository root for full details.
*/ */
import { import {
isLivekitFocus,
isLivekitFocusConfig, isLivekitFocusConfig,
LivekitFocusConfig, type LivekitFocusConfig,
type LivekitFocus, type LivekitFocus,
type LivekitFocusActive, type LivekitFocusSelection,
type MatrixRTCSession, type MatrixRTCSession,
} from "matrix-js-sdk/lib/matrixrtc"; } from "matrix-js-sdk/lib/matrixrtc";
import { logger } from "matrix-js-sdk/lib/logger"; import { logger } from "matrix-js-sdk/lib/logger";
@@ -25,7 +24,7 @@ import { getSFUConfigWithOpenID } from "./livekit/openIDSFU.ts";
const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci"; const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci";
export function makeActiveFocus(): LivekitFocusActive { export function makeActiveFocus(): LivekitFocusSelection {
return { return {
type: "livekit", type: "livekit",
focus_selection: "oldest_membership", focus_selection: "oldest_membership",
@@ -81,7 +80,11 @@ export async function makeFocus(
): Promise<LivekitFocus> { ): Promise<LivekitFocus> {
const focus = await makeFocusInternal(rtcSession); const focus = await makeFocusInternal(rtcSession);
// this will call the jwt/sfu/get endpoint to pre create the livekit room. // this will call the jwt/sfu/get endpoint to pre create the livekit room.
await getSFUConfigWithOpenID(rtcSession.room.client, focus); await getSFUConfigWithOpenID(
rtcSession.room.client,
focus.livekit_service_url,
focus.livekit_alias,
);
return focus; return focus;
} }