diff --git a/web/app/shared/services/scalar/scalar-widget.api.ts b/web/app/shared/services/scalar/scalar-widget.api.ts index 70fdf7c..b4f90f4 100644 --- a/web/app/shared/services/scalar/scalar-widget.api.ts +++ b/web/app/shared/services/scalar/scalar-widget.api.ts @@ -66,6 +66,7 @@ export class ScalarWidgetApi { public static sendSetAlwaysOnScreen(alwaysVisible: boolean): void { ScalarWidgetApi.callAction("set_always_on_screen", { + // Send the value here and in data due to a Riot bug. data: { value: alwaysVisible, }, @@ -92,6 +93,7 @@ export class ScalarWidgetApi { request["action"] = action; request["requestId"] = randomString({length: 160}); + console.log("[Dimension] Sending fromWidget: ", request); window.opener.postMessage(request, "*"); } @@ -102,6 +104,8 @@ export class ScalarWidgetApi { let requestClone = JSON.parse(JSON.stringify(request)); requestClone["response"] = payload; + + console.log("[Dimension] Sending postMessage response: ", request); window.opener.postMessage(requestClone, "*"); } } diff --git a/web/app/widget-wrappers/capable-widget.ts b/web/app/widget-wrappers/capable-widget.ts index cb86980..cfff829 100644 --- a/web/app/widget-wrappers/capable-widget.ts +++ b/web/app/widget-wrappers/capable-widget.ts @@ -31,6 +31,6 @@ export abstract class CapableWidget implements OnInit, OnDestroy { } protected onCapabilitiesSent(): void { - if (this.supportsAlwaysOnScreen) ScalarWidgetApi.sendSetAlwaysOnScreen(true); + // Nothing to do here. } } \ No newline at end of file diff --git a/web/app/widget-wrappers/jitsi/jitsi.component.ts b/web/app/widget-wrappers/jitsi/jitsi.component.ts index c78e45d..9642bb9 100644 --- a/web/app/widget-wrappers/jitsi/jitsi.component.ts +++ b/web/app/widget-wrappers/jitsi/jitsi.component.ts @@ -37,6 +37,9 @@ export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit this.displayName = params.displayName; this.avatarUrl = params.avatarUrl; this.userId = params.userId || params.email; // Riot uses `email` when placing a conference call + + // Set the widget ID if we have it + ScalarWidgetApi.widgetId = params.widgetId; } public ngOnInit() { @@ -88,6 +91,8 @@ export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit $(".join-conference-wrapper").hide(); $("#jitsiContainer").show(); + ScalarWidgetApi.sendSetAlwaysOnScreen(true); + this.jitsiApiObj = new JitsiMeetExternalAPI(this.domain, { width: "100%", height: "100%", @@ -106,6 +111,7 @@ export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit this.jitsiApiObj.on("readyToClose", () => { this.isJoined = false; + ScalarWidgetApi.sendSetAlwaysOnScreen(false); $(".join-conference-wrapper").show(); $("#jitsiContainer").hide().html(""); }); @@ -117,4 +123,9 @@ export class JitsiWidgetWrapperComponent extends CapableWidget implements OnInit if (this.jitsiApiSubscription) this.jitsiApiSubscription.unsubscribe(); } + protected onCapabilitiesSent(): void { + super.onCapabilitiesSent(); + ScalarWidgetApi.sendSetAlwaysOnScreen(false); + } + }