Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jitsi widget wrapper updates for hangup button #15219

Merged
merged 2 commits into from
Sep 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/vector/jitsi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ let jitsiAuth: string;
let roomId: string;

let widgetApi: WidgetApi;
let meetApi: any; // JitsiMeetExternalAPI

(async function() {
try {
Expand Down Expand Up @@ -88,7 +89,12 @@ let widgetApi: WidgetApi;
} else {
enableJoinButton();
}

// 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 {
enableJoinButton();
}
Expand Down Expand Up @@ -199,7 +205,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);
Expand All @@ -214,5 +220,6 @@ function joinConference() { // event handler bound in HTML
}

document.getElementById("jitsiContainer").innerHTML = "";
meetApi = null;
});
}