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
1e977213
Commit
1e977213
authored
Jun 12, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check media status in setMediaStatus.
parent
a4d07417
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
static/sfu.js
static/sfu.js
+8
-8
No files found.
static/sfu.js
View file @
1e977213
...
@@ -527,7 +527,7 @@ function setMedia(id) {
...
@@ -527,7 +527,7 @@ function setMedia(id) {
media
.
srcObject
=
c
.
stream
;
media
.
srcObject
=
c
.
stream
;
setLabel
(
id
);
setLabel
(
id
);
setMediaStatus
(
id
,
false
);
setMediaStatus
(
id
);
resizePeers
();
resizePeers
();
}
}
...
@@ -543,7 +543,11 @@ function delMedia(id) {
...
@@ -543,7 +543,11 @@ function delMedia(id) {
resizePeers
();
resizePeers
();
}
}
function
setMediaStatus
(
id
,
good
)
{
function
setMediaStatus
(
id
)
{
let
c
=
up
[
id
]
||
down
[
id
];
let
state
=
c
&&
c
.
pc
&&
c
.
pc
.
iceConnectionState
;
let
good
=
state
===
'
connected
'
||
state
===
'
completed
'
;
let
media
=
document
.
getElementById
(
'
media-
'
+
id
);
let
media
=
document
.
getElementById
(
'
media-
'
+
id
);
if
(
!
media
)
{
if
(
!
media
)
{
console
.
warn
(
'
Setting status of unknown media.
'
);
console
.
warn
(
'
Setting status of unknown media.
'
);
...
@@ -737,9 +741,7 @@ async function gotOffer(id, labels, offer) {
...
@@ -737,9 +741,7 @@ async function gotOffer(id, labels, offer) {
};
};
pc
.
oniceconnectionstatechange
=
e
=>
{
pc
.
oniceconnectionstatechange
=
e
=>
{
setMediaStatus
(
id
,
setMediaStatus
(
id
);
pc
.
iceConnectionState
===
'
connected
'
||
pc
.
iceConnectionState
===
'
completed
'
);
}
}
c
.
pc
.
ontrack
=
function
(
e
)
{
c
.
pc
.
ontrack
=
function
(
e
)
{
...
@@ -1195,9 +1197,7 @@ async function newUpStream(id) {
...
@@ -1195,9 +1197,7 @@ async function newUpStream(id) {
};
};
pc
.
oniceconnectionstatechange
=
e
=>
{
pc
.
oniceconnectionstatechange
=
e
=>
{
setMediaStatus
(
id
,
setMediaStatus
(
id
);
pc
.
iceConnectionState
===
'
connected
'
||
pc
.
iceConnectionState
===
'
completed
'
);
if
(
pc
.
iceConnectionState
===
'
failed
'
)
{
if
(
pc
.
iceConnectionState
===
'
failed
'
)
{
try
{
try
{
pc
.
restartIce
();
pc
.
restartIce
();
...
...
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