Pārlūkot izejas kodu

fix(remotecontrol): Fixing issues after peer review.

j8
hristoterezov 8 gadus atpakaļ
vecāks
revīzija
0efca9a9a8

+ 3
- 3
conference.js Parādīt failu

@@ -1838,9 +1838,9 @@ export default {
1838 1838
 
1839 1839
     /**
1840 1840
      * Sends a message via the data channel.
1841
-     * @param to {string} the id of the endpoint that should receive the
1842
-     * message. If "" the message will be sent to all participants.
1843
-     * @param payload {object} the payload of the message.
1841
+     * @param {string} to the id of the endpoint that should receive the
1842
+     * message. If "" - the message will be sent to all participants.
1843
+     * @param {object} payload the payload of the message.
1844 1844
      * @throws NetworkError or InvalidStateError or Error if the operation
1845 1845
      * fails.
1846 1846
      */

+ 12
- 1
modules/API/API.js Parādīt failu

@@ -218,7 +218,18 @@ class API {
218 218
 
219 219
     /**
220 220
      * Sends remote control event.
221
-     * @param {object} event the event.
221
+     * @param {object} event the remote control event. The remote control event
222
+     * has one mandatory property - type which is string from EVENT_TYPES enum
223
+     * defined in /service/remotecontrol/constants. Depending on the event type
224
+     * the event can have other properties or not.
225
+     * mousemove - will also have {int} properties x and y
226
+     * mousedown, mouseup and mousedblclick - will have {int} property button
227
+     * with values - 1(left), 2(middle) or 3 (right)
228
+     * mousescroll - will have {int} property y
229
+     * keydown and keyup - will have {string} property key and array of strings
230
+     * property modifiers.
231
+     * stop - won't have any other properties
232
+     * permissions - will have {PERMISSIONS_ACTIONS} property action.
222 233
      */
223 234
     sendRemoteControlEvent(event) {
224 235
         sendMessage({method: "remote-control-event", params: event});

+ 1
- 0
modules/keycode/keycode.js Parādīt failu

@@ -1,5 +1,6 @@
1 1
 /**
2 2
  * Enumerates the supported keys.
3
+ * NOTE: The maps represents actual keys on the keyboard not chars. 
3 4
  */
4 5
 export const KEYS = {
5 6
     BACKSPACE: "backspace" ,

+ 0
- 3
modules/remotecontrol/Controller.js Parādīt failu

@@ -170,9 +170,6 @@ export default class Controller extends RemoteControlParticipant {
170 170
      * listeners. Disables keyboard events.
171 171
      */
172 172
     _start() {
173
-        if(!this.enabled) {
174
-            return;
175
-        }
176 173
         APP.UI.addListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
177 174
             this._largeVideoChangedListener);
178 175
         APP.conference.addConferenceListener(

+ 7
- 2
modules/remotecontrol/Receiver.js Parādīt failu

@@ -86,9 +86,14 @@ export default class Receiver extends RemoteControlParticipant {
86 86
     }
87 87
 
88 88
     /**
89
-     * Sends "remote-control-event" events to to the API module.
89
+     * Listens for data channel EndpointMessage events. Handles only events of
90
+     * type remote control. Sends "remote-control-event" events to the API
91
+     * module.
90 92
      * @param {JitsiParticipant} participant the controller participant
91
-     * @param {Object} event the remote control event.
93
+     * @param {Object} event EndpointMessage event from the data channels. It
94
+     * has {string} type property. The function process only events of type
95
+     * REMOTE_CONTROL_EVENT_TYPE which will have event property(the remote
96
+     * control event)
92 97
      */
93 98
     _onRemoteControlEvent(participant, event) {
94 99
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {

+ 10
- 2
modules/remotecontrol/RemoteControl.js Parādīt failu

@@ -39,8 +39,16 @@ class RemoteControl {
39 39
     }
40 40
 
41 41
     /**
42
-     * Handles remote control events from the API module.
43
-     * @param {object} event the remote control event
42
+     * Handles remote control events from the API module. Currently only events
43
+     * with type = EVENT_TYPES.supported or EVENT_TYPES.permissions
44
+     * @param {object} event the remote control event. The remote control event
45
+     * has one mandatory property - type which is string from EVENT_TYPES enum
46
+     * defined in /service/remotecontrol/constants. If the event type is
47
+     * "supported" it won't have any other properties. If the event type is
48
+     * "permissions" the method will expect also the following properties:
49
+     * {string} userId - the user id of the participant that made the request
50
+     * for permissions
51
+     * {PERMISSIONS_ACTIONS} action the action related to the event.
44 52
      */
45 53
     onRemoteControlAPIEvent(event) {
46 54
         switch(event.type) {

+ 5
- 1
react/features/app/functions.web.js Parādīt failu

@@ -23,7 +23,11 @@ export function init() {
23 23
 
24 24
     APP.keyboardshortcut = KeyboardShortcut;
25 25
     APP.tokenData = getTokenData();
26
-    APP.API.init(APP.tokenData.jwt ? {forceEnable: true} : undefined);
26
+
27
+    // Force enable the API if jwt token is passed because most probably
28
+    // jitsi meet is displayed inside of wrapper that will need to communicate
29
+    // with jitsi meet.
30
+    APP.API.init(APP.tokenData.jwt ? { forceEnable: true } : undefined);
27 31
 
28 32
     APP.translation.init(settings.getLanguage());
29 33
 }

Notiek ielāde…
Atcelt
Saglabāt