mirror of
https://github.com/netzbegruenung/jitsi-meet-electron.git
synced 2024-05-11 04:56:11 +02:00
feat(remotecontrol): Implements config option that removes the auth window by default
Use the auth dialog provided by Jitsi Meet instead.
This commit is contained in:
parent
26727cf8d8
commit
a94732fff5
12
config.js
12
config.js
|
@ -1,3 +1,13 @@
|
|||
module.exports = {
|
||||
jitsiMeetURL: "https://meet.jit.si/"
|
||||
/**
|
||||
* The URL of the Jitsi Meet deployment that will be used.
|
||||
*/
|
||||
jitsiMeetURL: "https://meet.jit.si/",
|
||||
|
||||
/**
|
||||
* If true, the authorization of remote control will be handled by jitsi
|
||||
* meet electron app. Otherwise the authorization will be handled in Jitsi
|
||||
* Meet.
|
||||
*/
|
||||
handleRemoteControlAuthorization: false
|
||||
};
|
||||
|
|
|
@ -25,7 +25,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
/**
|
||||
* The type of remote control events sent trough the API module.
|
||||
* The name of remote control events sent trough the API module.
|
||||
*/
|
||||
REMOTE_CONTROL_EVENT_TYPE: "remote-control-event"
|
||||
REMOTE_CONTROL_EVENT_NAME: "remote-control-event"
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let robot = require("robotjs");
|
||||
const constants = require("../../modules/remotecontrol/constants");
|
||||
const {EVENT_TYPES, PERMISSIONS_ACTIONS, REMOTE_CONTROL_EVENT_TYPE} = constants;
|
||||
const {EVENT_TYPES, PERMISSIONS_ACTIONS, REMOTE_CONTROL_EVENT_NAME} = constants;
|
||||
|
||||
/**
|
||||
* Attaching to the window for debug purposes.
|
||||
|
@ -64,17 +64,21 @@ class RemoteControl {
|
|||
/**
|
||||
* Initializes the remote control functionality.
|
||||
*/
|
||||
init(channel, windowManager) {
|
||||
init(channel, windowManager, handleAuthorization) {
|
||||
this.handleAuthorization = handleAuthorization;
|
||||
this.windowManager = windowManager;
|
||||
this.channel = channel;
|
||||
this.channel.ready(() => {
|
||||
this.channel.listen('message', message => {
|
||||
const event = message.data;
|
||||
if(event.name === REMOTE_CONTROL_EVENT_TYPE) {
|
||||
if(event.name === REMOTE_CONTROL_EVENT_NAME) {
|
||||
this.onRemoteControlEvent(event);
|
||||
}
|
||||
});
|
||||
this.sendEvent({type: EVENT_TYPES.supported});
|
||||
if (!handleAuthorization) {
|
||||
this.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -177,9 +181,8 @@ class RemoteControl {
|
|||
break;
|
||||
}
|
||||
case EVENT_TYPES.permissions: {
|
||||
if(event.action !== PERMISSIONS_ACTIONS.request)
|
||||
break;
|
||||
|
||||
if(event.action === PERMISSIONS_ACTIONS.request
|
||||
&& this.handleAuthorization) {
|
||||
// Open Dialog and answer
|
||||
this.handlePermissionRequest({
|
||||
userId: event.userId,
|
||||
|
@ -187,6 +190,7 @@ class RemoteControl {
|
|||
displayName: event.displayName,
|
||||
screenSharing: event.screenSharing
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EVENT_TYPES.stop: {
|
||||
|
@ -204,7 +208,7 @@ class RemoteControl {
|
|||
*/
|
||||
sendEvent(event) {
|
||||
const remoteControlEvent = Object.assign(
|
||||
{ name: REMOTE_CONTROL_EVENT_TYPE },
|
||||
{ name: REMOTE_CONTROL_EVENT_NAME },
|
||||
event
|
||||
);
|
||||
this.channel.send({
|
||||
|
|
|
@ -78,7 +78,10 @@ function onload() {
|
|||
window: iframe.contentWindow,
|
||||
windowForEventListening: window
|
||||
});
|
||||
remoteControl.init(channel, dialogFactory);
|
||||
remoteControl.init(
|
||||
channel,
|
||||
dialogFactory,
|
||||
config.handleRemoteControlAuthorization);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue