removed then() after submit

This commit is contained in:
Oleh Polisan 2024-04-17 23:17:39 +03:00
parent 1d5000e619
commit 6c523503b6

View file

@ -466,32 +466,32 @@ function ModalComponent({
submit({ submit({
id: selected!, id: selected!,
...settings ...settings
}).then(() => {
setTimeout(() => {
conn = [...MediaEngineStore.getMediaEngine().connections].find(
connection => connection.streamUserId === UserStore.getCurrentUser().id
);
if (conn) {
const track = conn.input.stream.getVideoTracks()[0];
var constraints = track.getConstraints();
const newConstraints = {
...constraints,
frameRate,
width: { min: 640, ideal: width, max: width },
height: { min: 480, ideal: height, max: height },
advanced: [{ width: width, height: height }],
resizeMode: "none"
};
track.applyConstraints(newConstraints).then(() => {
logger.log(
"Applied constraints successfully. New constraints: ",
track.getConstraints()
);
});
}
}, 100);
}); });
setTimeout(() => {
conn = [...MediaEngineStore.getMediaEngine().connections].find(
connection => connection.streamUserId === UserStore.getCurrentUser().id
);
if (conn) {
const track = conn.input.stream.getVideoTracks()[0];
var constraints = track.getConstraints();
const newConstraints = {
...constraints,
frameRate,
width: { min: 640, ideal: width, max: width },
height: { min: 480, ideal: height, max: height },
advanced: [{ width: width, height: height }],
resizeMode: "none"
};
track.applyConstraints(newConstraints).then(() => {
logger.log(
"Applied constraints successfully. New constraints: ",
track.getConstraints()
);
});
}
}, 100);
} catch (error) { } catch (error) {
logger.error("Error while submitting stream.", error); logger.error("Error while submitting stream.", error);
} }