Skip to content

Commit

Permalink
Add demo URL option to confirm meeting end
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Burnson committed Dec 16, 2019
1 parent 5a13fcd commit 5e960fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion demos/browser/app/meeting/meeting.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ <h1 class="h3 mb-3 font-weight-normal text-center">Select devices</h1>
</button>
</div>
<div class="col-2 text-right">
<button id="button-meeting-leave" type="button" class="btn btn-outline-danger m-2 px-4" title="Leave meeting">
<button id="button-meeting-leave" type="button" class="btn btn-outline-success m-2 px-4" title="Leave meeting">
${require('../../node_modules/open-iconic/svg/account-logout.svg').default}
</button>
<button id="button-meeting-end" type="button" class="btn btn-outline-danger m-2 px-4" title="End meeting">
Expand Down
5 changes: 5 additions & 0 deletions demos/browser/app/meeting/meeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ export class DemoMeetingApp implements AudioVideoObserver, DeviceChangeObserver

const buttonMeetingEnd = document.getElementById('button-meeting-end');
buttonMeetingEnd.addEventListener('click', _e => {
const confirmEnd = (new URL(window.location.href).searchParams.get('confirm-end')) === 'true';
const prompt = 'Are you sure you want to end the meeting for everyone? The meeting cannot be used after ending it.';
if (confirmEnd && !window.confirm(prompt)) {
return;
}
new AsyncScheduler().start(async () => {
(buttonMeetingEnd as HTMLButtonElement).disabled = true;
await this.endMeeting();
Expand Down

0 comments on commit 5e960fb

Please sign in to comment.