Merge pull request #1086 from robintown/ice-fallback
Add a URL parameter for allowing fallback ICE servers
This commit is contained in:
commit
166b9fede5
2 changed files with 15 additions and 1 deletions
|
@ -79,6 +79,11 @@ export interface UrlParams {
|
||||||
* The Posthog analytics ID. It is only available if the user has given consent for sharing telemetry in element web.
|
* The Posthog analytics ID. It is only available if the user has given consent for sharing telemetry in element web.
|
||||||
*/
|
*/
|
||||||
analyticsID: string | null;
|
analyticsID: string | null;
|
||||||
|
/**
|
||||||
|
* Whether the app is allowed to use fallback STUN servers for ICE in case the
|
||||||
|
* user's homeserver doesn't provide any.
|
||||||
|
*/
|
||||||
|
allowIceFallback: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -135,6 +140,7 @@ export const getUrlParams = (
|
||||||
fonts: getAllParams("font"),
|
fonts: getAllParams("font"),
|
||||||
fontScale: Number.isNaN(fontScale) ? null : fontScale,
|
fontScale: Number.isNaN(fontScale) ? null : fontScale,
|
||||||
analyticsID: getParam("analyticsID"),
|
analyticsID: getParam("analyticsID"),
|
||||||
|
allowIceFallback: hasParam("allowIceFallback"),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,14 @@ export const widget: WidgetHelpers | null = (() => {
|
||||||
// We need to do this now rather than later because it has capabilities to
|
// We need to do this now rather than later because it has capabilities to
|
||||||
// request, and is responsible for starting the transport (should it be?)
|
// request, and is responsible for starting the transport (should it be?)
|
||||||
|
|
||||||
const { roomId, userId, deviceId, baseUrl, e2eEnabled } = getUrlParams();
|
const {
|
||||||
|
roomId,
|
||||||
|
userId,
|
||||||
|
deviceId,
|
||||||
|
baseUrl,
|
||||||
|
e2eEnabled,
|
||||||
|
allowIceFallback,
|
||||||
|
} = getUrlParams();
|
||||||
if (!roomId) throw new Error("Room ID must be supplied");
|
if (!roomId) throw new Error("Room ID must be supplied");
|
||||||
if (!userId) throw new Error("User ID must be supplied");
|
if (!userId) throw new Error("User ID must be supplied");
|
||||||
if (!deviceId) throw new Error("Device ID must be supplied");
|
if (!deviceId) throw new Error("Device ID must be supplied");
|
||||||
|
@ -148,6 +155,7 @@ export const widget: WidgetHelpers | null = (() => {
|
||||||
deviceId,
|
deviceId,
|
||||||
timelineSupport: true,
|
timelineSupport: true,
|
||||||
useE2eForGroupCall: e2eEnabled,
|
useE2eForGroupCall: e2eEnabled,
|
||||||
|
fallbackICEServerAllowed: allowIceFallback,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const clientPromise = client.startClient().then(() => client);
|
const clientPromise = client.startClient().then(() => client);
|
||||||
|
|
Loading…
Add table
Reference in a new issue