mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Only return null if there is no endpoint available.
This commit is contained in:
@@ -72,14 +72,22 @@ export async function findRemotePublishLivekitTransport({
|
|||||||
roomId,
|
roomId,
|
||||||
slotId,
|
slotId,
|
||||||
});
|
});
|
||||||
// The SFU treats an absent canPublish grant as publishing allowed.
|
try {
|
||||||
if (decodeSFUJWTPayload(jwt).video.canPublish !== false) {
|
// The SFU treats an absent canPublish grant as publishing allowed.
|
||||||
logger.info(`Publishing on remote SFU ${url} of ${serverName}`);
|
if (decodeSFUJWTPayload(jwt).video.canPublish !== false) {
|
||||||
return { type: "livekit", url, server_name: serverName };
|
logger.info(`Publishing on remote SFU ${url} of ${serverName}`);
|
||||||
|
return { type: "livekit", url, server_name: serverName };
|
||||||
|
}
|
||||||
|
logger.info(
|
||||||
|
`${serverName} does not let us publish on ${url}, skipping`,
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
} catch (e) {
|
||||||
|
logger.info(
|
||||||
|
`${serverName}: failed to decode SFUJWT payload: ${e}, skipping`,
|
||||||
|
);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
logger.info(
|
|
||||||
`${serverName} does not let us publish on ${url}, skipping`,
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (isCsApiUnavailable(e)) {
|
if (isCsApiUnavailable(e)) {
|
||||||
// Without the endpoint no further candidate can work
|
// Without the endpoint no further candidate can work
|
||||||
@@ -89,6 +97,7 @@ export async function findRemotePublishLivekitTransport({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
logger.warn(`Failed to get a token for ${url} of ${serverName}:`, e);
|
logger.warn(`Failed to get a token for ${url} of ${serverName}:`, e);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user