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
668fae29
Commit
668fae29
authored
Aug 13, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more typing assertions to sfu.js.
parent
0067edc6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
static/sfu.js
static/sfu.js
+32
-0
No files found.
static/sfu.js
View file @
668fae29
...
@@ -74,6 +74,9 @@ function gotClose(code, reason) {
...
@@ -74,6 +74,9 @@ function gotClose(code, reason) {
console
.
warn
(
'
Socket close
'
,
code
,
reason
);
console
.
warn
(
'
Socket close
'
,
code
,
reason
);
}
}
/**
* @param {Stream} c
*/
function
gotDownStream
(
c
)
{
function
gotDownStream
(
c
)
{
c
.
onclose
=
function
()
{
c
.
onclose
=
function
()
{
delMedia
(
c
.
id
);
delMedia
(
c
.
id
);
...
@@ -110,6 +113,10 @@ function changePresentation() {
...
@@ -110,6 +113,10 @@ function changePresentation() {
}
}
}
}
/**
* @param {string} id
* @param {boolean} visible
*/
function
setVisibility
(
id
,
visible
)
{
function
setVisibility
(
id
,
visible
)
{
let
elt
=
document
.
getElementById
(
id
);
let
elt
=
document
.
getElementById
(
id
);
if
(
visible
)
if
(
visible
)
...
@@ -262,6 +269,9 @@ async function setMediaChoices() {
...
@@ -262,6 +269,9 @@ async function setMediaChoices() {
mediaChoicesDone
=
true
;
mediaChoicesDone
=
true
;
}
}
/**
* @param {string} id
*/
function
newUpStream
(
id
)
{
function
newUpStream
(
id
)
{
let
c
=
serverConnection
.
newUpStream
(
id
);
let
c
=
serverConnection
.
newUpStream
(
id
);
c
.
onstatus
=
function
(
status
)
{
c
.
onstatus
=
function
(
status
)
{
...
@@ -278,6 +288,9 @@ function newUpStream(id) {
...
@@ -278,6 +288,9 @@ function newUpStream(id) {
return
c
;
return
c
;
}
}
/**
* @param {string} [id]
*/
async
function
addLocalMedia
(
id
)
{
async
function
addLocalMedia
(
id
)
{
if
(
!
getUserPass
())
if
(
!
getUserPass
())
return
;
return
;
...
@@ -353,6 +366,9 @@ async function addShareMedia(setup) {
...
@@ -353,6 +366,9 @@ async function addShareMedia(setup) {
setButtonsVisibility
()
setButtonsVisibility
()
}
}
/**
* @param {Stream} c
*/
function
stopUpMedia
(
c
)
{
function
stopUpMedia
(
c
)
{
if
(
!
c
.
stream
)
if
(
!
c
.
stream
)
return
;
return
;
...
@@ -364,6 +380,9 @@ function stopUpMedia(c) {
...
@@ -364,6 +380,9 @@ function stopUpMedia(c) {
});
});
}
}
/**
* @param {Stream} c
*/
function
delUpMedia
(
c
)
{
function
delUpMedia
(
c
)
{
stopUpMedia
(
c
);
stopUpMedia
(
c
);
delMedia
(
c
.
id
);
delMedia
(
c
.
id
);
...
@@ -514,6 +533,10 @@ function resizePeers() {
...
@@ -514,6 +533,10 @@ function resizePeers() {
let
users
=
{};
let
users
=
{};
/**
* @param {string} id
* @param {string} name
*/
function
addUser
(
id
,
name
)
{
function
addUser
(
id
,
name
)
{
if
(
!
name
)
if
(
!
name
)
name
=
null
;
name
=
null
;
...
@@ -528,6 +551,10 @@ function addUser(id, name) {
...
@@ -528,6 +551,10 @@ function addUser(id, name) {
div
.
appendChild
(
user
);
div
.
appendChild
(
user
);
}
}
/**
* @param {string} id
* @param {string} name
*/
function
delUser
(
id
,
name
)
{
function
delUser
(
id
,
name
)
{
if
(
!
name
)
if
(
!
name
)
name
=
null
;
name
=
null
;
...
@@ -546,6 +573,11 @@ function resetUsers() {
...
@@ -546,6 +573,11 @@ function resetUsers() {
delUser
(
id
,
users
[
id
]);
delUser
(
id
,
users
[
id
]);
}
}
/**
* @param {string} id
* @param {string} kind
* @param {string} name
*/
function
gotUser
(
id
,
kind
,
name
)
{
function
gotUser
(
id
,
kind
,
name
)
{
switch
(
kind
)
{
switch
(
kind
)
{
case
'
add
'
:
case
'
add
'
:
...
...
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