mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 05:04:57 +08:00
Jitsi widget wrapper updates for hangup button
See https://github.com/matrix-org/matrix-react-sdk/pull/5223
This commit is contained in:
parent
8c31911677
commit
737fa7dca5
@ -40,6 +40,7 @@ let jitsiAuth: string;
|
||||
let roomId: string;
|
||||
|
||||
let widgetApi: WidgetApi;
|
||||
let meetApi: any; // JitsiMeetExternalAPI
|
||||
|
||||
(async function() {
|
||||
try {
|
||||
@ -88,7 +89,13 @@ let widgetApi: WidgetApi;
|
||||
} else {
|
||||
enableJoinButton();
|
||||
}
|
||||
|
||||
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
|
||||
|
||||
widgetApi.on('hangup', () => {
|
||||
console.log("@@ HANGUP");
|
||||
if (meetApi) meetApi.executeCommand('hangup');
|
||||
});
|
||||
} else {
|
||||
enableJoinButton();
|
||||
}
|
||||
@ -199,7 +206,7 @@ function joinConference() { // event handler bound in HTML
|
||||
jwt: jwt,
|
||||
};
|
||||
|
||||
const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options);
|
||||
meetApi = new JitsiMeetExternalAPI(jitsiDomain, options);
|
||||
if (displayName) meetApi.executeCommand("displayName", displayName);
|
||||
if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl);
|
||||
if (userId) meetApi.executeCommand("email", userId);
|
||||
@ -214,5 +221,6 @@ function joinConference() { // event handler bound in HTML
|
||||
}
|
||||
|
||||
document.getElementById("jitsiContainer").innerHTML = "";
|
||||
meetApi = null;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user