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
a8ca2e85
Commit
a8ca2e85
authored
Jun 12, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make stats reporting independent of the number of tracks.
parent
23cceba7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
25 deletions
+22
-25
static/sfu.js
static/sfu.js
+22
-25
No files found.
static/sfu.js
View file @
a8ca2e85
...
...
@@ -44,8 +44,7 @@ function Connection(id, pc) {
this
.
labelsByMid
=
{};
this
.
iceCandidates
=
[];
this
.
timers
=
[];
this
.
audioStats
=
{};
this
.
videoStats
=
{};
this
.
stats
=
{};
}
Connection
.
prototype
.
setInterval
=
function
(
f
,
t
)
{
...
...
@@ -214,22 +213,21 @@ document.getElementById('requestselect').onchange = function(e) {
};
async
function
updateStats
(
conn
,
sender
)
{
let
stats
;
if
(
!
sender
.
track
)
let
tid
=
sender
.
track
&&
sender
.
track
.
id
;
if
(
!
tid
)
return
;
if
(
sender
.
track
.
kind
===
'
audio
'
)
stats
=
conn
.
audioStats
;
else
if
(
sender
.
track
.
kind
===
'
video
'
)
stats
=
conn
.
videoStats
;
else
return
;
let
stats
=
conn
.
stats
[
tid
];
if
(
!
stats
)
{
conn
.
stats
[
tid
]
=
{};
stats
=
conn
.
stats
[
tid
];
}
let
report
;
try
{
report
=
await
sender
.
getStats
();
}
catch
(
e
)
{
delete
(
stats
.
rate
);
delete
(
stats
[
id
]
.
rate
);
delete
(
stats
.
timestamp
);
delete
(
stats
.
bytesSent
);
return
;
...
...
@@ -254,25 +252,24 @@ async function updateStats(conn, sender) {
function
displayStats
(
id
)
{
let
conn
=
up
[
id
];
if
(
!
conn
.
audioStats
.
rate
&&
!
conn
.
videoStats
.
rate
)
{
if
(
!
conn
)
{
setLabel
(
id
);
return
;
}
let
a
=
conn
.
audioStats
.
rate
;
let
v
=
conn
.
videoStats
.
rate
;
let
text
=
''
;
if
(
a
)
text
=
text
+
Math
.
round
(
a
/
1000
)
+
'
kbps
'
;
if
(
a
&&
v
)
text
=
text
+
'
+
'
;
if
(
v
)
text
=
text
+
Math
.
round
(
v
/
1000
)
+
'
kbps
'
;
if
(
text
)
setLabel
(
id
,
text
);
else
setLabel
(
id
);
conn
.
pc
.
getSenders
().
forEach
(
s
=>
{
let
tid
=
s
.
track
&&
s
.
track
.
id
;
let
stats
=
tid
&&
conn
.
stats
[
tid
];
if
(
stats
&&
stats
.
rate
>
0
)
{
if
(
text
)
text
=
text
+
'
+
'
;
text
=
text
+
Math
.
round
(
stats
.
rate
/
1000
)
+
'
kbps
'
;
}
});
setLabel
(
id
,
text
);
}
function
mapMediaOption
(
value
)
{
...
...
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