|
@@ -1,4 +1,5 @@
|
1
|
1
|
/* global $, JitsiMeetJS, APP */
|
|
2
|
+const logger = require("jitsi-meet-logger").getLogger(__filename);
|
2
|
3
|
import * as KeyCodes from "../keycode/keycode";
|
3
|
4
|
import {EVENT_TYPES, REMOTE_CONTROL_EVENT_TYPE, PERMISSIONS_ACTIONS}
|
4
|
5
|
from "../../service/remotecontrol/Constants";
|
|
@@ -76,6 +77,7 @@ export default class Controller extends RemoteControlParticipant {
|
76
|
77
|
if(!this.enabled) {
|
77
|
78
|
return Promise.reject(new Error("Remote control is disabled!"));
|
78
|
79
|
}
|
|
80
|
+ logger.debug("Requsting remote control permissions from: " + userId);
|
79
|
81
|
return new Promise((resolve, reject) => {
|
80
|
82
|
const clearRequest = () => {
|
81
|
83
|
this.requestedParticipant = null;
|
|
@@ -135,6 +137,8 @@ export default class Controller extends RemoteControlParticipant {
|
135
|
137
|
switch(remoteControlEvent.action) {
|
136
|
138
|
case PERMISSIONS_ACTIONS.grant: {
|
137
|
139
|
this.controlledParticipant = userId;
|
|
140
|
+ logger.debug("Remote control permissions granted to: "
|
|
141
|
+ + userId);
|
138
|
142
|
this._start();
|
139
|
143
|
return true;
|
140
|
144
|
}
|
|
@@ -170,6 +174,7 @@ export default class Controller extends RemoteControlParticipant {
|
170
|
174
|
* listeners. Disables keyboard events.
|
171
|
175
|
*/
|
172
|
176
|
_start() {
|
|
177
|
+ logger.log("Starting remote control controller.");
|
173
|
178
|
APP.UI.addListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
|
174
|
179
|
this._largeVideoChangedListener);
|
175
|
180
|
APP.conference.addConferenceListener(
|
|
@@ -191,6 +196,7 @@ export default class Controller extends RemoteControlParticipant {
|
191
|
196
|
if(!this.enabled || this.isCollectingEvents) {
|
192
|
197
|
return;
|
193
|
198
|
}
|
|
199
|
+ logger.log("Resuming remote control controller.");
|
194
|
200
|
this.isCollectingEvents = true;
|
195
|
201
|
APP.keyboardshortcut.enable(false);
|
196
|
202
|
this.area = $("#largeVideoWrapper");
|
|
@@ -230,6 +236,7 @@ export default class Controller extends RemoteControlParticipant {
|
230
|
236
|
if(!this.controlledParticipant) {
|
231
|
237
|
return;
|
232
|
238
|
}
|
|
239
|
+ logger.log("Stopping remote control controller.");
|
233
|
240
|
APP.UI.removeListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
|
234
|
241
|
this._largeVideoChangedListener);
|
235
|
242
|
APP.conference.removeConferenceListener(
|
|
@@ -276,6 +283,7 @@ export default class Controller extends RemoteControlParticipant {
|
276
|
283
|
if(!this.controlledParticipant) {
|
277
|
284
|
return;
|
278
|
285
|
}
|
|
286
|
+ logger.log("Pausing remote control controller.");
|
279
|
287
|
this.isCollectingEvents = false;
|
280
|
288
|
APP.keyboardshortcut.enable(true);
|
281
|
289
|
this.area.off( "mousemove" );
|