|
@@ -68,15 +68,18 @@ export default class Controller extends RemoteControlParticipant {
|
68
|
68
|
* Requests permissions from the remote control receiver side.
|
69
|
69
|
* @param {string} userId the user id of the participant that will be
|
70
|
70
|
* requested.
|
|
71
|
+ * @param {JQuerySelector} eventCaptureArea the area that is going to be
|
|
72
|
+ * used mouse and keyboard event capture.
|
71
|
73
|
* @returns {Promise<boolean>} - resolve values:
|
72
|
74
|
* true - accept
|
73
|
75
|
* false - deny
|
74
|
76
|
* null - the participant has left.
|
75
|
77
|
*/
|
76
|
|
- requestPermissions(userId) {
|
|
78
|
+ requestPermissions(userId, eventCaptureArea) {
|
77
|
79
|
if(!this.enabled) {
|
78
|
80
|
return Promise.reject(new Error("Remote control is disabled!"));
|
79
|
81
|
}
|
|
82
|
+ this.area = eventCaptureArea;// $("#largeVideoWrapper")
|
80
|
83
|
logger.debug("Requsting remote control permissions from: " + userId);
|
81
|
84
|
return new Promise((resolve, reject) => {
|
82
|
85
|
const clearRequest = () => {
|
|
@@ -134,6 +137,9 @@ export default class Controller extends RemoteControlParticipant {
|
134
|
137
|
if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE
|
135
|
138
|
&& remoteControlEvent.type === EVENT_TYPES.permissions
|
136
|
139
|
&& userId === this.requestedParticipant) {
|
|
140
|
+ if(remoteControlEvent.action !== PERMISSIONS_ACTIONS.grant) {
|
|
141
|
+ this.area = null;
|
|
142
|
+ }
|
137
|
143
|
switch(remoteControlEvent.action) {
|
138
|
144
|
case PERMISSIONS_ACTIONS.grant: {
|
139
|
145
|
this.controlledParticipant = userId;
|
|
@@ -202,7 +208,6 @@ export default class Controller extends RemoteControlParticipant {
|
202
|
208
|
logger.log("Resuming remote control controller.");
|
203
|
209
|
this.isCollectingEvents = true;
|
204
|
210
|
APP.keyboardshortcut.enable(false);
|
205
|
|
- this.area = $("#largeVideoWrapper");
|
206
|
211
|
this.area.mousemove(event => {
|
207
|
212
|
const position = this.area.position();
|
208
|
213
|
this._sendRemoteControlEvent(this.controlledParticipant, {
|
|
@@ -249,6 +254,7 @@ export default class Controller extends RemoteControlParticipant {
|
249
|
254
|
this._userLeftListener);
|
250
|
255
|
this.controlledParticipant = null;
|
251
|
256
|
this.pause();
|
|
257
|
+ this.area = null;
|
252
|
258
|
APP.UI.messageHandler.openMessageDialog(
|
253
|
259
|
"dialog.remoteControlTitle",
|
254
|
260
|
"dialog.remoteControlStopMessage"
|