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
78cf9d0d
Commit
78cf9d0d
authored
May 01, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resize videos automatically.
parent
b818d189
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
static/sfu.css
static/sfu.css
+6
-14
static/sfu.js
static/sfu.js
+11
-0
No files found.
static/sfu.css
View file @
78cf9d0d
...
@@ -144,26 +144,18 @@ h1 {
...
@@ -144,26 +144,18 @@ h1 {
#peers
{
#peers
{
margin-left
:
1%
;
margin-left
:
1%
;
margin-right
:
1%
;
display
:
grid
;
white-space
:
nowrap
;
grid-template-columns
:
1
fr
;
display
:
flex
;
column-gap
:
0.5%
;
flex-wrap
:
wrap
;
align-content
:
start
;
margin-bottom
:
4px
;
}
}
.peer
{
.peer
{
display
:
flex
;
margin-top
:
auto
;
flex-direction
:
column
;
margin-right
:
5px
;
margin-left
:
5px
;
margin-bottom
:
10px
;
max-height
:
50%
;
}
}
.media
{
.media
{
height
:
400px
;
width
:
100%
;
margin
:
auto
;
min-width
:
4em
;
}
}
.label
{
.label
{
...
...
static/sfu.js
View file @
78cf9d0d
...
@@ -325,6 +325,8 @@ function setMedia(id) {
...
@@ -325,6 +325,8 @@ function setMedia(id) {
media
.
srcObject
=
c
.
stream
;
media
.
srcObject
=
c
.
stream
;
setLabel
(
id
);
setLabel
(
id
);
resizePeers
();
}
}
function
delMedia
(
id
)
{
function
delMedia
(
id
)
{
...
@@ -334,6 +336,8 @@ function delMedia(id) {
...
@@ -334,6 +336,8 @@ function delMedia(id) {
media
.
srcObject
=
null
;
media
.
srcObject
=
null
;
mediadiv
.
removeChild
(
peer
);
mediadiv
.
removeChild
(
peer
);
resizePeers
();
}
}
function
setLabel
(
id
,
fallback
)
{
function
setLabel
(
id
,
fallback
)
{
...
@@ -353,6 +357,13 @@ function setLabel(id, fallback) {
...
@@ -353,6 +357,13 @@ function setLabel(id, fallback) {
}
}
}
}
function
resizePeers
()
{
let
count
=
Object
.
keys
(
up
).
length
+
Object
.
keys
(
down
).
length
;
let
columns
=
Math
.
ceil
(
Math
.
sqrt
(
count
));
document
.
getElementById
(
'
peers
'
).
style
[
'
grid-template-columns
'
]
=
`repeat(
${
columns
}
, 1fr)`
;
}
function
serverConnect
()
{
function
serverConnect
()
{
if
(
socket
)
{
if
(
socket
)
{
socket
.
close
(
1000
,
'
Reconnecting
'
);
socket
.
close
(
1000
,
'
Reconnecting
'
);
...
...
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