Преглед изворни кода

fix(remotecontrol): Fixing issues after peer review.

j8
hristoterezov пре 8 година
родитељ
комит
0efca9a9a8

+ 3
- 3
conference.js Прегледај датотеку

1838
 
1838
 
1839
     /**
1839
     /**
1840
      * Sends a message via the data channel.
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
      * @throws NetworkError or InvalidStateError or Error if the operation
1844
      * @throws NetworkError or InvalidStateError or Error if the operation
1845
      * fails.
1845
      * fails.
1846
      */
1846
      */

+ 12
- 1
modules/API/API.js Прегледај датотеку

218
 
218
 
219
     /**
219
     /**
220
      * Sends remote control event.
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
     sendRemoteControlEvent(event) {
234
     sendRemoteControlEvent(event) {
224
         sendMessage({method: "remote-control-event", params: event});
235
         sendMessage({method: "remote-control-event", params: event});

+ 1
- 0
modules/keycode/keycode.js Прегледај датотеку

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

+ 0
- 3
modules/remotecontrol/Controller.js Прегледај датотеку

170
      * listeners. Disables keyboard events.
170
      * listeners. Disables keyboard events.
171
      */
171
      */
172
     _start() {
172
     _start() {
173
-        if(!this.enabled) {
174
-            return;
175
-        }
176
         APP.UI.addListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
173
         APP.UI.addListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
177
             this._largeVideoChangedListener);
174
             this._largeVideoChangedListener);
178
         APP.conference.addConferenceListener(
175
         APP.conference.addConferenceListener(

+ 7
- 2
modules/remotecontrol/Receiver.js Прегледај датотеку

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
      * @param {JitsiParticipant} participant the controller participant
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
     _onRemoteControlEvent(participant, event) {
98
     _onRemoteControlEvent(participant, event) {
94
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {
99
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {

+ 10
- 2
modules/remotecontrol/RemoteControl.js Прегледај датотеку

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
     onRemoteControlAPIEvent(event) {
53
     onRemoteControlAPIEvent(event) {
46
         switch(event.type) {
54
         switch(event.type) {

+ 5
- 1
react/features/app/functions.web.js Прегледај датотеку

23
 
23
 
24
     APP.keyboardshortcut = KeyboardShortcut;
24
     APP.keyboardshortcut = KeyboardShortcut;
25
     APP.tokenData = getTokenData();
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
     APP.translation.init(settings.getLanguage());
32
     APP.translation.init(settings.getLanguage());
29
 }
33
 }

Loading…
Откажи
Сачувај