mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 15:30:27 +03:00
remove unneeded for standalone? Not even sure element-web uses the embedded atp
This commit is contained in:
parent
fd1ccc7281
commit
5a5f144e20
1 changed files with 18 additions and 9 deletions
|
|
@ -30,16 +30,19 @@ import { SmallWidgetDriver } from './SmallWidgetDriver';
|
||||||
*/
|
*/
|
||||||
export const getWidgetUrl = (mx: MatrixClient, roomId: string, elementCallUrl: string): URL => {
|
export const getWidgetUrl = (mx: MatrixClient, roomId: string, elementCallUrl: string): URL => {
|
||||||
const baseUrl = window.location.origin;
|
const baseUrl = window.location.origin;
|
||||||
const url = new URL(elementCallUrl) ?? new URL('./dist/element-call/dist/index.html', baseUrl);
|
const url =
|
||||||
|
new URL(`${elementCallUrl}/room`) ?? new URL('./dist/element-call/dist/index.html', baseUrl);
|
||||||
|
|
||||||
|
logger.error(url);
|
||||||
|
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
embed: 'true',
|
//embed: 'true',
|
||||||
widgetId: `element-call-${roomId}`,
|
widgetId: `element-call-${roomId}`,
|
||||||
appPrompt: 'false',
|
appPrompt: 'false',
|
||||||
preload: 'true',
|
preload: 'false',
|
||||||
skipLobby: 'true',
|
skipLobby: 'true',
|
||||||
intent: 'join_existing',
|
//intent: 'join_existing',
|
||||||
returnToLobby: 'true',
|
//returnToLobby: 'true',
|
||||||
perParticipantE2EE: 'true',
|
perParticipantE2EE: 'true',
|
||||||
hideHeader: 'true',
|
hideHeader: 'true',
|
||||||
userId: mx.getUserId()!,
|
userId: mx.getUserId()!,
|
||||||
|
|
@ -149,6 +152,15 @@ export class SmallWidget extends EventEmitter {
|
||||||
return this.messaging?.transport.reply(ev.detail, { events });
|
return this.messaging?.transport.reply(ev.detail, { events });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
this.messaging?.on('action:content_loaded', () => {
|
||||||
|
this.messaging?.transport?.send('io.element.join', {
|
||||||
|
audioInput: 'true',
|
||||||
|
videoInput: 'true',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
this.client.on(ClientEvent.Event, this.onEvent);
|
this.client.on(ClientEvent.Event, this.onEvent);
|
||||||
this.client.on(MatrixEventEvent.Decrypted, this.onEventDecrypted);
|
this.client.on(MatrixEventEvent.Decrypted, this.onEventDecrypted);
|
||||||
//this.client.on(RoomStateEvent.Events, this.onStateUpdate);
|
//this.client.on(RoomStateEvent.Events, this.onStateUpdate);
|
||||||
|
|
@ -313,14 +325,11 @@ export class SmallWidget extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
stopMessaging() {
|
stopMessaging() {
|
||||||
if (this.messaging) {
|
if (this.messaging) {
|
||||||
// Potentially call stop() or remove listeners if the API provides such methods
|
this.messaging.stop(); // Example if a stop method exists
|
||||||
// this.messaging.stop(); // Example if a stop method exists
|
|
||||||
this.messaging.removeAllListeners(); // Remove listeners attached by SmallWidget
|
this.messaging.removeAllListeners(); // Remove listeners attached by SmallWidget
|
||||||
logger.info(`Widget messaging stopped for widgetId: ${this.mockWidget.id}`);
|
logger.info(`Widget messaging stopped for widgetId: ${this.mockWidget.id}`);
|
||||||
this.messaging = null;
|
this.messaging = null;
|
||||||
}
|
}
|
||||||
// Clean up driver resources if necessary
|
|
||||||
// driver.stop(); // Example
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue