Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
b427d4ba
Commit
b427d4ba
authored
7 years ago
by
Martin Schoeler
Browse files
Options
Downloads
Patches
Plain Diff
fix reviews
parent
559e535e
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
packages/rocketchat-webrtc/client/WebRTCClass.js
+9
-34
9 additions, 34 deletions
packages/rocketchat-webrtc/client/WebRTCClass.js
packages/rocketchat-webrtc/client/screenShare.js
+2
-4
2 additions, 4 deletions
packages/rocketchat-webrtc/client/screenShare.js
with
11 additions
and
38 deletions
packages/rocketchat-webrtc/client/WebRTCClass.js
+
9
−
34
View file @
b427d4ba
...
...
@@ -164,7 +164,6 @@ class WebRTCClass {
this
.
TransportClass
=
WebRTCTransportClass
;
this
.
selfId
=
selfId
;
this
.
room
=
room
;
this
.
config
.
iceServers
=
[];
let
servers
=
RocketChat
.
settings
.
get
(
'
WebRTC_Servers
'
);
if
(
servers
&&
servers
.
trim
()
!==
''
)
{
servers
=
servers
.
replace
(
/
\s
/g
,
''
);
...
...
@@ -259,7 +258,6 @@ class WebRTCClass {
url
:
URL
.
createObjectURL
(
remoteStream
),
state
:
peerConnection
.
iceConnectionState
};
console
.
log
(
item
);
switch
(
peerConnection
.
iceConnectionState
)
{
case
'
checking
'
:
item
.
stateText
=
'
Connecting...
'
;
...
...
@@ -421,10 +419,7 @@ class WebRTCClass {
return
navigator
.
getUserMedia
(
media
,
onSuccessLocal
,
onError
);
}
getUserMedia
(
media
,
onSuccess
,
onError
)
{
if
(
onError
==
null
)
{
onError
=
this
.
onError
;
}
getUserMedia
(
media
,
onSuccess
,
onError
=
this
.
onError
)
{
if
(
media
.
desktop
!==
true
)
{
this
.
_getUserMedia
(
media
,
onSuccess
,
onError
);
return
;
...
...
@@ -571,10 +566,7 @@ class WebRTCClass {
window
.
audioContext
&&
window
.
audioContext
.
close
();
}
setAudioEnabled
(
enabled
)
{
if
(
enabled
==
null
)
{
enabled
=
true
;
}
setAudioEnabled
(
enabled
=
true
)
{
if
(
this
.
localStream
!=
null
)
{
if
(
enabled
===
true
&&
this
.
media
.
audio
!==
true
)
{
delete
this
.
localStream
;
...
...
@@ -600,10 +592,7 @@ class WebRTCClass {
return
this
.
setAudioEnabled
(
true
);
}
setVideoEnabled
(
enabled
)
{
if
(
enabled
==
null
)
{
enabled
=
true
;
}
setVideoEnabled
(
enabled
=
true
)
{
if
(
this
.
localStream
!=
null
)
{
if
(
enabled
===
true
&&
this
.
media
.
video
!==
true
)
{
delete
this
.
localStream
;
...
...
@@ -629,10 +618,7 @@ class WebRTCClass {
return
this
.
setScreenShareEnabled
(
true
);
}
setScreenShareEnabled
(
enabled
)
{
if
(
enabled
==
null
)
{
enabled
=
true
;
}
setScreenShareEnabled
(
enabled
=
true
)
{
if
(
this
.
localStream
!=
null
)
{
this
.
media
.
desktop
=
enabled
;
delete
this
.
localStream
;
...
...
@@ -659,10 +645,8 @@ class WebRTCClass {
this
.
active
=
false
;
this
.
monitor
=
false
;
this
.
remoteMonitoring
=
false
;
if
((
this
.
localStream
!=
null
)
&&
typeof
this
.
localStream
!==
'
undefined
'
)
{
this
.
localStream
.
getTracks
().
forEach
(
function
(
track
)
{
return
track
.
stop
();
});
if
(
this
.
localStream
!=
null
&&
typeof
this
.
localStream
!==
'
undefined
'
)
{
this
.
localStream
.
getTracks
().
forEach
(
track
=>
track
.
stop
());
}
this
.
localUrl
.
set
(
undefined
);
delete
this
.
localStream
;
...
...
@@ -676,10 +660,7 @@ class WebRTCClass {
video {Boolean}
*/
startCall
(
media
)
{
if
(
media
==
null
)
{
media
=
{};
}
startCall
(
media
=
{})
{
this
.
log
(
'
startCall
'
,
arguments
);
this
.
media
=
media
;
return
this
.
getLocalUserMedia
(()
=>
{
...
...
@@ -690,10 +671,7 @@ class WebRTCClass {
});
}
startCallAsMonitor
(
media
)
{
if
(
media
==
null
)
{
media
=
{};
}
startCallAsMonitor
(
media
=
{})
{
this
.
log
(
'
startCallAsMonitor
'
,
arguments
);
this
.
media
=
media
;
this
.
active
=
true
;
...
...
@@ -790,10 +768,7 @@ class WebRTCClass {
desktop {Boolean}
*/
joinCall
(
data
)
{
if
(
data
==
null
)
{
data
=
{};
}
joinCall
(
data
=
{})
{
if
(
data
.
media
&&
data
.
media
.
audio
)
{
this
.
media
.
audio
=
data
.
media
.
audio
;
}
...
...
This diff is collapsed.
Click to expand it.
packages/rocketchat-webrtc/client/screenShare.js
+
2
−
4
View file @
b427d4ba
...
...
@@ -8,9 +8,8 @@ this.ChromeScreenShare = {
ChromeScreenShare
.
screenCallback
=
callback
;
if
(
navigator
===
'
electron
'
)
{
return
fireGlobalEvent
(
'
get-sourceId
'
,
'
*
'
);
}
else
{
return
window
.
postMessage
(
'
get-sourceId
'
,
'
*
'
);
}
return
window
.
postMessage
(
'
get-sourceId
'
,
'
*
'
);
}
};
...
...
@@ -21,9 +20,8 @@ window.addEventListener('message', function(e) {
if
(
e
.
data
===
'
PermissionDeniedError
'
)
{
if
(
ChromeScreenShare
.
screenCallback
!=
null
)
{
return
ChromeScreenShare
.
screenCallback
(
'
PermissionDeniedError
'
);
}
else
{
throw
new
Error
(
'
PermissionDeniedError
'
);
}
throw
new
Error
(
'
PermissionDeniedError
'
);
}
if
(
e
.
data
.
sourceId
!=
null
)
{
return
typeof
ChromeScreenShare
.
screenCallback
===
'
function
'
&&
ChromeScreenShare
.
screenCallback
(
e
.
data
.
sourceId
);
...
...
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