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
89589ee3
Commit
89589ee3
authored
Nov 09, 2020
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix enable/disabled video control button and video swtich
parent
e1be8f96
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
12 deletions
+33
-12
static/sfu.css
static/sfu.css
+6
-1
static/sfu.html
static/sfu.html
+2
-2
static/sfu.js
static/sfu.js
+25
-9
No files found.
static/sfu.css
View file @
89589ee3
...
...
@@ -442,6 +442,10 @@ textarea.form-reply {
color
:
#c8c8c8
}
.video-controls
.fa-video-slash
{
color
:
#cc0f21
;
}
.mobile-container
{
display
:
block
!important
;
}
...
...
@@ -838,6 +842,7 @@ legend {
.nav-menu
li
{
float
:
left
;
margin
:
0
1px
;
max-height
:
70px
;
list-style
:
none
;
}
...
...
@@ -1054,7 +1059,7 @@ header .collapse {
.collapse-video
{
left
:
inherit
;
right
:
6
0px
;
right
:
1
0px
;
}
.close-chat
{
...
...
static/sfu.html
View file @
89589ee3
...
...
@@ -109,7 +109,7 @@
</div>
<div
id=
"resizer"
></div>
<div
class=
"coln-right"
id=
"right"
>
<span
class=
"show-video blink"
id=
"switch-video"
><i
class=
"fas fa-exchange"
aria-hidden=
"true"
></i></span>
<span
class=
"show-video blink"
id=
"switch-video"
><i
class=
"fas fa-exchange
-alt
"
aria-hidden=
"true"
></i></span>
<div
class=
"collapse-video"
id=
"collapse-video"
>
<i
class=
"far fa-comment-alt open-chat"
title=
"Open chat"
></i>
</div>
...
...
@@ -199,7 +199,7 @@
<i
class=
"fas fa-volume-up"
data-type=
"bt-volume"
aria-hidden=
"true"
></i>
</span>
<span
class=
"camera"
title=
"Camera"
>
<i
class=
"fas fa-video
"
data-type=
"bt-camera
"
aria-hidden=
"true"
></i>
<i
class=
"fas fa-video
-slash"
data-type=
"bt-camera-off
"
aria-hidden=
"true"
></i>
</span>
<span
class=
"pip"
title=
"Picture In Picture"
>
<i
class=
"fas fa-clone"
data-type=
"bt-pip"
aria-hidden=
"true"
></i>
...
...
static/sfu.js
View file @
89589ee3
...
...
@@ -1037,7 +1037,7 @@ function setMedia(c, isUp) {
if
(
local_media
&&
local_media
.
kind
===
"
local
"
)
{
if
(
!
settings
.
video
)
{
if
(
camera
)
c
amera
.
classList
.
add
(
"
camera-off
"
);
c
hangeVideoIconState
(
camera
.
querySelector
(
"
i
"
)
);
}
volume
.
parentElement
.
remove
();
}
else
...
...
@@ -1081,6 +1081,23 @@ function getParentVideo(target) {
return
media
;
}
/**
* @param {HTMLElement} element
* @param {boolean} state
*/
function
changeVideoIconState
(
element
,
state
)
{
let
video_state
=
element
.
getAttribute
(
"
data-type
"
);
if
(
state
||
video_state
===
"
bt-camera-off
"
)
{
element
.
setAttribute
(
"
data-type
"
,
"
bt-camera
"
);
element
.
classList
.
add
(
"
fa-video
"
);
element
.
classList
.
remove
(
"
fa-video-slash
"
);
}
else
if
(
!
state
||
video_state
===
"
bt-camera
"
)
{
element
.
setAttribute
(
"
data-type
"
,
"
bt-camera-off
"
);
element
.
classList
.
add
(
"
fa-video-slash
"
);
element
.
classList
.
remove
(
"
fa-video
"
);
}
}
/**
* @param {string} peerid
*/
...
...
@@ -1134,16 +1151,15 @@ function registerControlEvent(peerid) {
event
.
preventDefault
();
let
video
=
getParentVideo
(
event
.
target
);
let
id
=
video
.
id
.
split
(
"
-
"
)[
1
];
if
(
!
settings
.
video
)
if
(
!
settings
.
video
)
{
displayMessage
(
"
Camera is disabled in your settings.
"
);
return
;
if
(
event
.
target
.
getAttribute
(
"
data-type
"
)
===
"
bt-camera
"
)
{
addLocalMedia
(
id
,
true
);
event
.
target
.
setAttribute
(
"
data-type
"
,
"
bt-camera-off
"
);
event
.
target
.
parentElement
.
classList
.
add
(
"
disabled
"
);
}
else
{
event
.
target
.
setAttribute
(
"
data-type
"
,
"
bt-camera
"
);
event
.
target
.
parentElement
.
classList
.
remove
(
"
disabled
"
);
}
changeVideoIconState
(
event
.
target
);
if
(
event
.
target
.
getAttribute
(
"
data-type
"
)
===
"
bt-camera-off
"
)
{
addLocalMedia
(
id
);
}
else
{
addLocalMedia
(
id
,
true
);
}
};
}
...
...
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