Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
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
Alain Takoudjou
sfu
Commits
f595da8f
Commit
f595da8f
authored
May 10, 2020
by
Antonin Décimo
Committed by
Juliusz Chroboczek
May 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing semicolons.
parent
89695c37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
static/sfu.js
static/sfu.js
+23
-23
No files found.
static/sfu.js
View file @
f595da8f
...
...
@@ -48,7 +48,7 @@ function Connection(id, pc) {
Connection
.
prototype
.
setInterval
=
function
(
f
,
t
)
{
this
.
timers
.
push
(
setInterval
(
f
,
t
));
}
}
;
Connection
.
prototype
.
close
=
function
(
sendit
)
{
while
(
this
.
timers
.
length
>
0
)
...
...
@@ -68,7 +68,7 @@ Connection.prototype.close = function(sendit) {
id
:
this
.
id
,
});
}
}
}
;
function
setUserPass
(
username
,
password
)
{
window
.
sessionStorage
.
setItem
(
...
...
@@ -124,27 +124,27 @@ function setConnected(connected) {
document
.
getElementById
(
'
presenterbox
'
).
onchange
=
function
(
e
)
{
e
.
preventDefault
();
setLocalMedia
(
this
.
checked
);
}
}
;
document
.
getElementById
(
'
audioselect
'
).
onchange
=
function
(
e
)
{
e
.
preventDefault
();
setLocalMedia
(
document
.
getElementById
(
'
presenterbox
'
).
checked
);
}
}
;
document
.
getElementById
(
'
videoselect
'
).
onchange
=
function
(
e
)
{
e
.
preventDefault
();
setLocalMedia
(
document
.
getElementById
(
'
presenterbox
'
).
checked
);
}
}
;
document
.
getElementById
(
'
sharebox
'
).
onchange
=
function
(
e
)
{
e
.
preventDefault
();
setShareMedia
(
this
.
checked
);
}
}
;
document
.
getElementById
(
'
requestbox
'
).
onchange
=
function
(
e
)
{
e
.
preventDefault
();
sendRequest
(
this
.
checked
);
}
}
;
async
function
updateStats
(
conn
,
sender
)
{
let
stats
;
...
...
@@ -165,7 +165,7 @@ async function updateStats(conn, sender) {
delete
(
stats
.
rate
);
delete
(
stats
.
timestamp
);
delete
(
stats
.
bytesSent
);
return
return
;
}
for
(
let
r
of
report
.
values
())
{
...
...
@@ -283,7 +283,7 @@ async function setLocalMedia(setup) {
if
(
localMediaId
)
{
up
[
localMediaId
].
close
(
true
);
delete
(
up
[
localMediaId
]);
delMedia
(
localMediaId
)
delMedia
(
localMediaId
)
;
localMediaId
=
null
;
}
return
;
...
...
@@ -358,7 +358,7 @@ async function setShareMedia(setup) {
t
.
onended
=
e
=>
{
document
.
getElementById
(
'
sharebox
'
).
checked
=
false
;
setShareMedia
(
false
);
}
}
;
c
.
setInterval
(()
=>
{
updateStats
(
c
,
sender
);
},
2000
);
...
...
@@ -408,7 +408,7 @@ function setMedia(id) {
label
=
document
.
createElement
(
'
div
'
);
label
.
id
=
'
label-
'
+
id
;
label
.
classList
.
add
(
'
label
'
);
div
.
appendChild
(
label
)
div
.
appendChild
(
label
)
;
}
media
.
srcObject
=
c
.
stream
;
...
...
@@ -580,19 +580,19 @@ async function gotOffer(id, offer) {
id
:
id
,
candidate
:
e
.
candidate
,
});
}
}
;
c
.
pc
.
ontrack
=
function
(
e
)
{
c
.
stream
=
e
.
streams
[
0
];
setMedia
(
id
);
}
}
;
}
await
c
.
pc
.
setRemoteDescription
(
offer
);
await
addIceCandidates
(
c
);
let
answer
=
await
c
.
pc
.
createAnswer
();
if
(
!
answer
)
throw
new
Error
(
"
Didn't create answer
"
)
throw
new
Error
(
"
Didn't create answer
"
)
;
await
c
.
pc
.
setLocalDescription
(
answer
);
send
({
type
:
'
answer
'
,
...
...
@@ -654,11 +654,11 @@ async function gotICE(id, candidate) {
if
(
conn
.
pc
.
remoteDescription
)
await
conn
.
pc
.
addIceCandidate
(
candidate
).
catch
(
console
.
warn
);
else
conn
.
iceCandidates
.
push
(
candidate
)
conn
.
iceCandidates
.
push
(
candidate
)
;
}
async
function
addIceCandidates
(
conn
)
{
let
promises
=
[]
let
promises
=
[]
;
conn
.
iceCandidates
.
forEach
(
c
=>
{
promises
.
push
(
conn
.
pc
.
addIceCandidate
(
c
).
catch
(
console
.
warn
));
});
...
...
@@ -669,7 +669,7 @@ async function addIceCandidates(conn) {
function
send
(
m
)
{
if
(
!
m
)
throw
(
new
Error
(
'
Sending null message
'
));
return
socket
.
send
(
JSON
.
stringify
(
m
))
return
socket
.
send
(
JSON
.
stringify
(
m
))
;
}
let
users
=
{};
...
...
@@ -933,7 +933,7 @@ document.getElementById('input').onkeypress = function(e) {
e
.
preventDefault
();
handleInput
();
}
}
}
;
function
chatResizer
(
e
)
{
e
.
preventDefault
();
...
...
@@ -978,7 +978,7 @@ async function newUpStream() {
iceServers
:
iceServers
,
});
if
(
!
pc
)
throw
new
Error
(
"
Couldn't create peer connection
"
)
throw
new
Error
(
"
Couldn't create peer connection
"
)
;
up
[
id
]
=
new
Connection
(
id
,
pc
);
pc
.
onnegotiationneeded
=
e
=>
negotiate
(
id
);
...
...
@@ -990,7 +990,7 @@ async function newUpStream() {
id
:
id
,
candidate
:
e
.
candidate
,
});
}
}
;
pc
.
ontrack
=
console
.
error
;
...
...
@@ -1069,18 +1069,18 @@ document.getElementById('userform').onsubmit = async function(e) {
let
password
=
document
.
getElementById
(
'
password
'
).
value
;
setUserPass
(
username
,
password
);
await
doConnect
();
}
}
;
document
.
getElementById
(
'
disconnectbutton
'
).
onclick
=
function
(
e
)
{
socket
.
close
();
}
}
;
function
start
()
{
group
=
decodeURIComponent
(
location
.
pathname
.
replace
(
/^
\/[
a-z
]
*
\/
/
,
''
));
let
title
=
group
.
charAt
(
0
).
toUpperCase
()
+
group
.
slice
(
1
);
if
(
group
!==
''
)
{
document
.
title
=
title
;
document
.
getElementById
(
'
title
'
).
textContent
=
title
document
.
getElementById
(
'
title
'
).
textContent
=
title
;
}
myid
=
randomid
();
...
...
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