Fix camera getting muted when disconnecting from a video room (#21958)
This commit is contained in:
parent
2c7680bd87
commit
b5336c9a4d
1 changed files with 16 additions and 5 deletions
|
@ -378,12 +378,14 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
|
||||||
if (isVideoChannel) meetApi.executeCommand("setTileView", true);
|
if (isVideoChannel) meetApi.executeCommand("setTileView", true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
meetApi.on("videoConferenceLeft", () => {
|
||||||
|
notifyHangup();
|
||||||
|
meetApi = null;
|
||||||
|
});
|
||||||
|
|
||||||
meetApi.on("readyToClose", () => {
|
meetApi.on("readyToClose", () => {
|
||||||
switchVisibleContainers();
|
switchVisibleContainers();
|
||||||
notifyHangup();
|
|
||||||
|
|
||||||
document.getElementById("jitsiContainer").innerHTML = "";
|
document.getElementById("jitsiContainer").innerHTML = "";
|
||||||
meetApi = null;
|
|
||||||
|
|
||||||
if (skipOurWelcomeScreen) {
|
if (skipOurWelcomeScreen) {
|
||||||
skipToJitsiSplashScreen();
|
skipToJitsiSplashScreen();
|
||||||
|
@ -404,8 +406,17 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
|
||||||
});
|
});
|
||||||
|
|
||||||
meetApi.on("videoMuteStatusChanged", ({ muted }) => {
|
meetApi.on("videoMuteStatusChanged", ({ muted }) => {
|
||||||
const action = muted ? ElementWidgetActions.MuteVideo : ElementWidgetActions.UnmuteVideo;
|
if (muted) {
|
||||||
widgetApi.transport.send(action, {});
|
// Jitsi Meet always sends a "video muted" event directly before
|
||||||
|
// hanging up, which we need to ignore by padding the timeout here,
|
||||||
|
// otherwise the React SDK will mistakenly think the user turned off
|
||||||
|
// their video by hand
|
||||||
|
setTimeout(() => {
|
||||||
|
if (meetApi) widgetApi.transport.send(ElementWidgetActions.MuteVideo, {});
|
||||||
|
}, 200);
|
||||||
|
} else {
|
||||||
|
widgetApi.transport.send(ElementWidgetActions.UnmuteVideo, {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
["videoConferenceJoined", "participantJoined", "participantLeft"].forEach(event => {
|
["videoConferenceJoined", "participantJoined", "participantLeft"].forEach(event => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue