Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairmeeting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
fairmeeting
Commits
26a6d2bb
Commit
26a6d2bb
authored
8 years ago
by
hristoterezov
Browse files
Options
Downloads
Patches
Plain Diff
fix(): Issues related to requesting permissions
parent
ded36507
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/remotecontrol/index.js
+14
-3
14 additions, 3 deletions
modules/remotecontrol/index.js
windows/jitsi-meet/render.js
+20
-13
20 additions, 13 deletions
windows/jitsi-meet/render.js
with
34 additions
and
16 deletions
modules/remotecontrol/index.js
+
14
−
3
View file @
26a6d2bb
...
...
@@ -67,7 +67,6 @@ class RemoteControl {
init
(
channel
,
windowManager
)
{
this
.
windowManager
=
windowManager
;
this
.
channel
=
channel
;
this
.
start
();
this
.
channel
.
ready
(()
=>
{
this
.
channel
.
listen
(
REMOTE_CONTROL_EVENT_TYPE
,
event
=>
this
.
onRemoteControlEvent
(
event
));
...
...
@@ -75,6 +74,15 @@ class RemoteControl {
});
}
/**
* Disposes the remote control functionality.
*/
dispose
()
{
this
.
windowManager
=
null
;
this
.
channel
=
null
;
this
.
stop
();
}
/**
* Handles permission requests from Jitsi Meet.
* @param {object} userInfo - information about the user that has requested
...
...
@@ -82,6 +90,8 @@ class RemoteControl {
* @param {string} userInfo.displayName - display name
* @param {string} userInfo.userJID - the JID of the user.
* @param {string} userInfo.userId - the user id (the resource of the JID)
* @param {boolean} userInfo.screenSharing - true if the screen sharing
* is started.
*/
handlePermissionRequest
(
userInfo
)
{
this
.
windowManager
.
requestRemoteControlPermissions
(
userInfo
)
...
...
@@ -119,7 +129,6 @@ class RemoteControl {
* @param {Object} event the remote-control-event.
*/
onRemoteControlEvent
(
event
)
{
if
(
!
this
.
started
&&
event
.
type
!==
EVENT_TYPES
.
permissions
)
{
return
;
}
...
...
@@ -171,7 +180,9 @@ class RemoteControl {
this
.
handlePermissionRequest
({
userId
:
event
.
userId
,
userJID
:
event
.
userJID
,
displayName
:
event
.
displayName
});
displayName
:
event
.
displayName
,
screenSharing
:
event
.
screenSharing
});
break
;
}
case
EVENT_TYPES
.
stop
:
{
...
...
This diff is collapsed.
Click to expand it.
windows/jitsi-meet/render.js
+
20
−
13
View file @
26a6d2bb
...
...
@@ -34,16 +34,24 @@ class DialogFactory {
* request:
* @param {string} userInfo.displayName - display name
* @param {string} userInfo.userJID - the JID of the user.
* @param {boolean} userInfo.screenSharing - true if the screen sharing
* is started.
*/
requestRemoteControlPermissions
(
userInfo
)
{
return
new
Promise
(
resolve
=>
dialog
.
showMessageBox
({
type
:
"
question
"
,
buttons
:
[
"
Yes
"
,
"
No
"
],
buttons
:
[
"
Yes
"
,
"
No
"
],
defaultId
:
0
,
title
:
"
Request for permission for remote control
"
,
message
:
"
Would you like to allow
"
+
userInfo
.
displayName
+
"
to remotely control your desktop.
"
,
+
"
to remotely control your desktop?
"
+
(
userInfo
.
screenSharing
?
""
:
"
\n
Note: If you press
\"
Yes
\"
the screen sharing
"
+
"
will start!
"
),
detail
:
"
userId:
"
+
userInfo
.
userJID
,
cancelId
:
1
},
response
=>
resolve
(
response
===
0
?
true
:
false
))
...
...
@@ -56,13 +64,6 @@ class DialogFactory {
*/
const
dialogFactory
=
new
DialogFactory
();
/**
* Boolean variable that indicates whether the onloaded function was already
* called.
* NOTE: Used to not initialize more thean once some objects.
*/
let
loaded
=
false
;
/**
* Handles loaded event for iframe:
* Enables screen sharing functionality to the iframe webpage.
...
...
@@ -70,14 +71,20 @@ let loaded = false;
* Initializes remote control.
*/
function
onload
()
{
loaded
=
true
;
setupScreenSharingForWindow
(
iframe
.
contentWindow
);
if
(
loaded
)
{
return
;
}
iframe
.
contentWindow
.
onunload
=
onunload
;
channel
=
postis
({
window
:
iframe
.
contentWindow
,
windowForEventListening
:
window
});
remoteControl
.
init
(
channel
,
dialogFactory
);
}
/**
* Clears the postis objects and remoteControl.
*/
function
onunload
()
{
channel
.
destroy
();
channel
=
null
;
remoteControl
.
dispose
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment