Force to allow calls without video and audio in embedded mode (#1134)
* force to allow calls without video and audio in embedded mode
This commit is contained in:
@@ -84,6 +84,10 @@ export interface UrlParams {
|
|||||||
* user's homeserver doesn't provide any.
|
* user's homeserver doesn't provide any.
|
||||||
*/
|
*/
|
||||||
allowIceFallback: boolean;
|
allowIceFallback: boolean;
|
||||||
|
/**
|
||||||
|
* Whether the app is allowed screen share only mode
|
||||||
|
*/
|
||||||
|
allowVoipWithNoMedia: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -141,6 +145,7 @@ export const getUrlParams = (
|
|||||||
fontScale: Number.isNaN(fontScale) ? null : fontScale,
|
fontScale: Number.isNaN(fontScale) ? null : fontScale,
|
||||||
analyticsID: getParam("analyticsID"),
|
analyticsID: getParam("analyticsID"),
|
||||||
allowIceFallback: hasParam("allowIceFallback"),
|
allowIceFallback: hasParam("allowIceFallback"),
|
||||||
|
allowVoipWithNoMedia: hasParam("allowVoipWithNoMedia"),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -102,12 +102,17 @@ export function GroupCallView({
|
|||||||
// Get the available devices so we can match the selected device
|
// Get the available devices so we can match the selected device
|
||||||
// to its ID. This involves getting a media stream (see docs on
|
// to its ID. This involves getting a media stream (see docs on
|
||||||
// the function) so we only do it once and re-use the result.
|
// the function) so we only do it once and re-use the result.
|
||||||
const devices = await getNamedDevices();
|
//
|
||||||
|
// But we only want to preload the devices if we get audio or video devices included in the widget request!
|
||||||
|
// By default, the device list is null!
|
||||||
|
let devices: MediaDeviceInfo[] | null = null;
|
||||||
|
|
||||||
const { audioInput, videoInput } = ev.detail
|
const { audioInput, videoInput } = ev.detail
|
||||||
.data as unknown as JoinCallData;
|
.data as unknown as JoinCallData;
|
||||||
|
|
||||||
if (audioInput !== null) {
|
if (audioInput !== null) {
|
||||||
|
// we load the devices because w have an audio device in the widget request
|
||||||
|
devices = await getNamedDevices();
|
||||||
const deviceId = await findDeviceByName(
|
const deviceId = await findDeviceByName(
|
||||||
audioInput,
|
audioInput,
|
||||||
"audioinput",
|
"audioinput",
|
||||||
@@ -124,6 +129,11 @@ export function GroupCallView({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (videoInput !== null) {
|
if (videoInput !== null) {
|
||||||
|
// we only need to load the devices once time
|
||||||
|
if (devices === null) {
|
||||||
|
// we load the devices because w have a video device in the widget request
|
||||||
|
devices = await getNamedDevices();
|
||||||
|
}
|
||||||
const deviceId = await findDeviceByName(
|
const deviceId = await findDeviceByName(
|
||||||
videoInput,
|
videoInput,
|
||||||
"videoinput",
|
"videoinput",
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ export const widget: WidgetHelpers | null = (() => {
|
|||||||
baseUrl,
|
baseUrl,
|
||||||
e2eEnabled,
|
e2eEnabled,
|
||||||
allowIceFallback,
|
allowIceFallback,
|
||||||
|
allowVoipWithNoMedia,
|
||||||
} = getUrlParams();
|
} = 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");
|
||||||
@@ -156,6 +157,7 @@ export const widget: WidgetHelpers | null = (() => {
|
|||||||
timelineSupport: true,
|
timelineSupport: true,
|
||||||
useE2eForGroupCall: e2eEnabled,
|
useE2eForGroupCall: e2eEnabled,
|
||||||
fallbackICEServerAllowed: allowIceFallback,
|
fallbackICEServerAllowed: allowIceFallback,
|
||||||
|
isVoipWithNoMediaAllowed: allowVoipWithNoMedia,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const clientPromise = client.startClient().then(() => client);
|
const clientPromise = client.startClient().then(() => client);
|
||||||
|
|||||||
Reference in New Issue
Block a user