diff --git a/package.json b/package.json index 39f930a..2fed945 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "i18next-http-backend": "^1.4.4", "livekit-client": "^1.9.7", "lodash": "^4.17.21", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#af10b0c44b4a427c8d2224bfd6feb03a12cfd27e", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#426d29d6b9a9d71a3c0d7fe6f7bac3473cd10832", "matrix-widget-api": "^1.3.1", "mermaid": "^8.13.8", "normalize.css": "^8.0.1", diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index c69dd44..ba1b217 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -138,6 +138,15 @@ export const ClientProvider: FC = ({ children }) => { const { user_id, device_id, access_token, passwordlessUser } = session; + const livekit = Config.get().livekit; + const foci = livekit + ? [ + { + livekitServiceUrl: livekit.livekit_service_url, + }, + ] + : undefined; + try { return { client: await initClient( @@ -147,6 +156,7 @@ export const ClientProvider: FC = ({ children }) => { userId: user_id, deviceId: device_id, fallbackICEServerAllowed: fallbackICEServerAllowed, + foci, }, true ), @@ -163,6 +173,7 @@ export const ClientProvider: FC = ({ children }) => { userId: user_id, deviceId: device_id, fallbackICEServerAllowed: fallbackICEServerAllowed, + foci, }, false // Don't need the crypto store just to log out ); diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 3532d73..1b23fcf 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -36,7 +36,6 @@ import { UserChoices } from "../livekit/useLiveKit"; import { findDeviceByName } from "../media-utils"; import { OpenIDLoader } from "../livekit/OpenIDLoader"; import { ActiveCall } from "./InCallView"; -import { Config } from "../config/Config"; declare global { interface Window { @@ -220,9 +219,15 @@ export function GroupCallView({ undefined ); - const lkServiceURL = Config.get().livekit?.livekit_service_url; + const [livekitServiceURL, setLivekitServiceURL] = useState< + string | undefined + >(groupCall.foci[0]?.livekitServiceUrl); - if (!lkServiceURL) { + useEffect(() => { + setLivekitServiceURL(groupCall.foci[0]?.livekitServiceUrl); + }, [setLivekitServiceURL, groupCall]); + + if (!livekitServiceURL) { return ; } @@ -232,7 +237,7 @@ export function GroupCallView({ return (