Adjust for new widget messaging APIs

As part of changing to the `events` package, the API surface changed slightly.

Related to https://github.com/vector-im/element-web/issues/15493
This commit is contained in:
J. Ryan Stinnett 2020-10-19 16:43:55 +01:00
parent b8662b43d8
commit dfb1579625

View file

@ -76,7 +76,7 @@ let meetApi: any; // JitsiMeetExternalAPI
widgetApi.requestCapabilities(VideoConferenceCapabilities); widgetApi.requestCapabilities(VideoConferenceCapabilities);
readyPromise = Promise.all([ readyPromise = Promise.all([
new Promise<void>(resolve => { new Promise<void>(resolve => {
widgetApi.once<CustomEvent<IWidgetApiRequest>>(`action:${ElementWidgetActions.ClientReady}`, ev => { widgetApi.once(`action:${ElementWidgetActions.ClientReady}`, ev => {
ev.preventDefault(); ev.preventDefault();
widgetApi.transport.reply(ev.detail, {}); widgetApi.transport.reply(ev.detail, {});
resolve(); resolve();
@ -113,7 +113,7 @@ let meetApi: any; // JitsiMeetExternalAPI
// 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.addEventListener(`action:${ElementWidgetActions.HangupCall}`, widgetApi.on(`action:${ElementWidgetActions.HangupCall}`,
(ev: CustomEvent<IWidgetApiRequest>) => { (ev: CustomEvent<IWidgetApiRequest>) => {
if (meetApi) meetApi.executeCommand('hangup'); if (meetApi) meetApi.executeCommand('hangup');
widgetApi.transport.reply(ev.detail, {}); // ack widgetApi.transport.reply(ev.detail, {}); // ack