Get LK info from the js-sdk

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2023-06-27 17:25:35 +02:00
parent 56df302458
commit 3a2cee581e
No known key found for this signature in database
GPG key ID: D1D45825D60C24D2
2 changed files with 14 additions and 3 deletions

View file

@ -138,6 +138,16 @@ export const ClientProvider: FC<Props> = ({ children }) => {
const { user_id, device_id, access_token, passwordlessUser } =
session;
const livekit = Config.get().livekit;
const foci = livekit
? [
{
url: livekit.server_url,
jwtServiceUrl: livekit.jwt_service_url,
},
]
: undefined;
try {
return {
client: await initClient(
@ -147,6 +157,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
userId: user_id,
deviceId: device_id,
fallbackICEServerAllowed: fallbackICEServerAllowed,
foci,
},
true
),
@ -163,6 +174,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
userId: user_id,
deviceId: device_id,
fallbackICEServerAllowed: fallbackICEServerAllowed,
foci,
},
false // Don't need the crypto store just to log out
);

View file

@ -72,7 +72,6 @@ import { MatrixInfo } from "./VideoPreview";
import { useJoinRule } from "./useJoinRule";
import { ParticipantInfo } from "./useGroupCall";
import { ItemData, TileContent } from "../video-grid/VideoTile";
import { Config } from "../config/Config";
import { NewVideoGrid } from "../video-grid/NewVideoGrid";
import { OTelGroupCallMembership } from "../otel/OTelGroupCallMembership";
import { SettingsModal } from "../settings/SettingsModal";
@ -96,8 +95,8 @@ interface ActiveCallProps extends Omit<Props, "livekitRoom"> {
export function ActiveCall(props: ActiveCallProps) {
const livekitRoom = useLiveKit(props.userChoices, {
sfuUrl: Config.get().livekit!.server_url,
jwtUrl: `${Config.get().livekit!.jwt_service_url}/token`,
sfuUrl: props.groupCall.foci[0]!.url,
jwtUrl: `${props.groupCall.foci[0]!.jwtServiceUrl}/token`,
roomName: props.matrixInfo.roomName,
userDisplayName: props.matrixInfo.displayName,
userIdentity: `${props.client.getUserId()}:${props.client.getDeviceId()}`,