Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(remotecontrol): Fixing issues after peer review.

hristoterezov0efca9a9a89f
diff --git a/conference.js b/conference.js
index d198b354e9..eb3472dd1f 100644
--- a/conference.js
+++ b/conference.js
@@ -1838,9 +1838,9 @@ export default {
/**
* Sends a message via the data channel.
- * @param to {string} the id of the endpoint that should receive the
- * message. If "" the message will be sent to all participants.
- * @param payload {object} the payload of the message.
+ * @param {string} to the id of the endpoint that should receive the
+ * message. If "" - the message will be sent to all participants.
+ * @param {object} payload the payload of the message.
* @throws NetworkError or InvalidStateError or Error if the operation
* fails.
*/
diff --git a/modules/API/API.js b/modules/API/API.js
index 471ccfe483..fd53ed6950 100644
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -218,7 +218,18 @@ class API {
/**
* Sends remote control event.
- * @param {object} event the event.
+ * @param {object} event the remote control event. The remote control event
+ * has one mandatory property - type which is string from EVENT_TYPES enum
+ * defined in /service/remotecontrol/constants. Depending on the event type
+ * the event can have other properties or not.
+ * mousemove - will also have {int} properties x and y
+ * mousedown, mouseup and mousedblclick - will have {int} property button
+ * with values - 1(left), 2(middle) or 3 (right)
+ * mousescroll - will have {int} property y
+ * keydown and keyup - will have {string} property key and array of strings
+ * property modifiers.
+ * stop - won't have any other properties
+ * permissions - will have {PERMISSIONS_ACTIONS} property action.
*/
sendRemoteControlEvent(event) {
sendMessage({method: "remote-control-event", params: event});
diff --git a/modules/keycode/keycode.js b/modules/keycode/keycode.js
index 94a81ba4b6..b6f5c8d711 100644
--- a/modules/keycode/keycode.js
+++ b/modules/keycode/keycode.js
@@ -1,5 +1,6 @@
/**
* Enumerates the supported keys.
+ * NOTE: The maps represents actual keys on the keyboard not chars.
*/
export const KEYS = {
BACKSPACE: "backspace" ,
diff --git a/modules/remotecontrol/Controller.js b/modules/remotecontrol/Controller.js
index aadcc0cbc4..e5e885c686 100644
--- a/modules/remotecontrol/Controller.js
+++ b/modules/remotecontrol/Controller.js
@@ -170,9 +170,6 @@ export default class Controller extends RemoteControlParticipant {
* listeners. Disables keyboard events.
*/
_start() {
- if(!this.enabled) {
- return;
- }
APP.UI.addListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
this._largeVideoChangedListener);
APP.conference.addConferenceListener(
diff --git a/modules/remotecontrol/Receiver.js b/modules/remotecontrol/Receiver.js
index eeb1f17637..c1ccef848f 100644
--- a/modules/remotecontrol/Receiver.js
+++ b/modules/remotecontrol/Receiver.js
@@ -86,9 +86,14 @@ export default class Receiver extends RemoteControlParticipant {
}
/**
- * Sends "remote-control-event" events to to the API module.
+ * Listens for data channel EndpointMessage events. Handles only events of
+ * type remote control. Sends "remote-control-event" events to the API
+ * module.
* @param {JitsiParticipant} participant the controller participant
- * @param {Object} event the remote control event.
+ * @param {Object} event EndpointMessage event from the data channels. It
+ * has {string} type property. The function process only events of type
+ * REMOTE_CONTROL_EVENT_TYPE which will have event property(the remote
+ * control event)
*/
_onRemoteControlEvent(participant, event) {
if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {
diff --git a/modules/remotecontrol/RemoteControl.js b/modules/remotecontrol/RemoteControl.js
index e00f8f1afd..ed906a465f 100644
--- a/modules/remotecontrol/RemoteControl.js
+++ b/modules/remotecontrol/RemoteControl.js
@@ -39,8 +39,16 @@ class RemoteControl {
}
/**
- * Handles remote control events from the API module.
- * @param {object} event the remote control event
+ * Handles remote control events from the API module. Currently only events
+ * with type = EVENT_TYPES.supported or EVENT_TYPES.permissions
+ * @param {object} event the remote control event. The remote control event
+ * has one mandatory property - type which is string from EVENT_TYPES enum
+ * defined in /service/remotecontrol/constants. If the event type is
+ * "supported" it won't have any other properties. If the event type is
+ * "permissions" the method will expect also the following properties:
+ * {string} userId - the user id of the participant that made the request
+ * for permissions
+ * {PERMISSIONS_ACTIONS} action the action related to the event.
*/
onRemoteControlAPIEvent(event) {
switch(event.type) {
diff --git a/react/features/app/functions.web.js b/react/features/app/functions.web.js
index 77319fde89..22d1618432 100644
--- a/react/features/app/functions.web.js
+++ b/react/features/app/functions.web.js
@@ -23,7 +23,11 @@ export function init() {
APP.keyboardshortcut = KeyboardShortcut;
APP.tokenData = getTokenData();
- APP.API.init(APP.tokenData.jwt ? {forceEnable: true} : undefined);
+
+ // Force enable the API if jwt token is passed because most probably
+ // jitsi meet is displayed inside of wrapper that will need to communicate
+ // with jitsi meet.
+ APP.API.init(APP.tokenData.jwt ? { forceEnable: true } : undefined);
APP.translation.init(settings.getLanguage());
}