Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
e04193f7
Commit
e04193f7
authored
Feb 14, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display user message when browser doesn't do WebRTC.
Thanks to mscherer for the report.
parent
183ab4fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
7 deletions
+39
-7
static/galene.js
static/galene.js
+16
-4
static/protocol.js
static/protocol.js
+23
-3
No files found.
static/galene.js
View file @
e04193f7
...
...
@@ -429,6 +429,7 @@ function setButtonsVisibility() {
let
local
=
!!
findUpMedia
(
'
local
'
);
let
share
=
!!
findUpMedia
(
'
screenshare
'
);
let
video
=
!!
findUpMedia
(
'
video
'
);
let
canWebrtc
=
!
(
typeof
RTCPeerConnection
===
'
undefined
'
);
let
canFile
=
/** @ts-ignore */
!!
HTMLVideoElement
.
prototype
.
captureStream
||
...
...
@@ -436,13 +437,13 @@ function setButtonsVisibility() {
!!
HTMLVideoElement
.
prototype
.
mozCaptureStream
;
// don't allow multiple presentations
setVisibility
(
'
presentbutton
'
,
permissions
.
present
&&
!
local
);
setVisibility
(
'
presentbutton
'
,
canWebrtc
&&
permissions
.
present
&&
!
local
);
setVisibility
(
'
unpresentbutton
'
,
local
);
setVisibility
(
'
mutebutton
'
,
!
connected
||
permissions
.
present
);
// allow multiple shared documents
setVisibility
(
'
sharebutton
'
,
permissions
.
present
&&
setVisibility
(
'
sharebutton
'
,
canWebrtc
&&
permissions
.
present
&&
(
'
getDisplayMedia
'
in
navigator
.
mediaDevices
));
setVisibility
(
'
unsharebutton
'
,
share
);
...
...
@@ -1069,7 +1070,15 @@ async function addLocalMedia(localId) {
setMediaChoices
(
true
);
let
c
=
newUpStream
(
localId
);
let
c
;
try
{
c
=
newUpStream
(
localId
);
}
catch
(
e
)
{
console
.
log
(
e
);
displayError
(
e
);
return
;
}
c
.
kind
=
'
local
'
;
c
.
stream
=
stream
;
...
...
@@ -1797,7 +1806,10 @@ async function gotJoined(kind, group, perms, message) {
input
.
placeholder
=
'
Type /help for help
'
;
setTimeout
(()
=>
{
input
.
placeholder
=
''
;},
8000
);
this
.
request
(
getSettings
().
request
);
if
(
typeof
RTCPeerConnection
===
'
undefined
'
)
displayWarning
(
"
This browser doesn't support WebRTC
"
);
else
this
.
request
(
getSettings
().
request
);
if
(
serverConnection
.
permissions
.
present
&&
!
findUpMedia
(
'
local
'
))
{
if
(
present
)
{
...
...
static/protocol.js
View file @
e04193f7
...
...
@@ -437,6 +437,9 @@ ServerConnection.prototype.newUpStream = function(localId) {
if
(
sc
.
up
[
id
])
throw
new
Error
(
'
Eek!
'
);
if
(
typeof
RTCPeerConnection
===
'
undefined
'
)
throw
new
Error
(
"
This browser doesn't support WebRTC
"
);
let
pc
=
new
RTCPeerConnection
(
sc
.
rtcConfiguration
);
if
(
!
pc
)
throw
new
Error
(
"
Couldn't create peer connection
"
);
...
...
@@ -565,8 +568,15 @@ ServerConnection.prototype.groupAction = function(kind, message) {
*/
ServerConnection
.
prototype
.
gotOffer
=
async
function
(
id
,
labels
,
source
,
username
,
sdp
,
replace
)
{
let
sc
=
this
;
if
(
sc
.
up
[
id
])
throw
new
Error
(
'
Duplicate connection id
'
);
if
(
sc
.
up
[
id
])
{
console
.
error
(
"
Duplicate connection id
"
);
sc
.
send
({
type
:
'
abort
'
,
id
:
id
,
});
return
;
}
let
oldLocalId
=
null
;
...
...
@@ -584,7 +594,17 @@ ServerConnection.prototype.gotOffer = async function(id, labels, source, usernam
console
.
error
(
"
Replacing duplicate stream
"
);
if
(
!
c
)
{
let
pc
=
new
RTCPeerConnection
(
sc
.
rtcConfiguration
);
let
pc
;
try
{
pc
=
new
RTCPeerConnection
(
sc
.
rtcConfiguration
);
}
catch
(
e
)
{
console
.
error
(
e
);
sc
.
send
({
type
:
'
abort
'
,
id
:
id
,
});
return
;
}
c
=
new
Stream
(
this
,
id
,
oldLocalId
||
newLocalId
(),
pc
,
false
);
sc
.
down
[
id
]
=
c
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment