Merge pull request #15219 from vector-im/travis/ft-sep1620/04-jitsi-hangup
Jitsi widget wrapper updates for hangup button
This commit is contained in:
commit
7d3ccb6242
1 changed files with 8 additions and 1 deletions
|
@ -40,6 +40,7 @@ let jitsiAuth: string;
|
||||||
let roomId: string;
|
let roomId: string;
|
||||||
|
|
||||||
let widgetApi: WidgetApi;
|
let widgetApi: WidgetApi;
|
||||||
|
let meetApi: any; // JitsiMeetExternalAPI
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
try {
|
try {
|
||||||
|
@ -88,7 +89,12 @@ let widgetApi: WidgetApi;
|
||||||
} else {
|
} else {
|
||||||
enableJoinButton();
|
enableJoinButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
|
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
|
||||||
|
|
||||||
|
widgetApi.on('hangup', () => {
|
||||||
|
if (meetApi) meetApi.executeCommand('hangup');
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
enableJoinButton();
|
enableJoinButton();
|
||||||
}
|
}
|
||||||
|
@ -199,7 +205,7 @@ function joinConference() { // event handler bound in HTML
|
||||||
jwt: jwt,
|
jwt: jwt,
|
||||||
};
|
};
|
||||||
|
|
||||||
const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options);
|
meetApi = new JitsiMeetExternalAPI(jitsiDomain, options);
|
||||||
if (displayName) meetApi.executeCommand("displayName", displayName);
|
if (displayName) meetApi.executeCommand("displayName", displayName);
|
||||||
if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl);
|
if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl);
|
||||||
if (userId) meetApi.executeCommand("email", userId);
|
if (userId) meetApi.executeCommand("email", userId);
|
||||||
|
@ -214,5 +220,6 @@ function joinConference() { // event handler bound in HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("jitsiContainer").innerHTML = "";
|
document.getElementById("jitsiContainer").innerHTML = "";
|
||||||
|
meetApi = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue