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
58ba37d8
Commit
58ba37d8
authored
Nov 24, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement stopping of videos.
parent
2c9ee2f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
static/sfu.html
static/sfu.html
+6
-0
static/sfu.js
static/sfu.js
+16
-0
No files found.
static/sfu.html
View file @
58ba37d8
...
...
@@ -65,6 +65,12 @@
<label>
Unshare Screen
</label>
</div>
</li>
<li>
<div
id=
"stopvideobutton"
class=
"invisible nav-link nav-button nav-cancel"
>
<span><i
class=
"fas fa-window-close"
aria-hidden=
"true"
></i></span>
<label>
Stop Video
</label>
</div>
</li>
<li>
<div
class=
"nav-button nav-link invisible"
id=
"user"
>
<span><i
class=
"fas fa-user dropbtn"
aria-hidden=
"true"
></i></span>
...
...
static/sfu.js
View file @
58ba37d8
...
...
@@ -393,6 +393,7 @@ function setButtonsVisibility() {
let
permissions
=
serverConnection
.
permissions
;
let
local
=
!!
findUpMedia
(
'
local
'
);
let
share
=
!!
findUpMedia
(
'
screenshare
'
);
let
video
=
!!
findUpMedia
(
'
video
'
);
// don't allow multiple presentations
setVisibility
(
'
presentbutton
'
,
permissions
.
present
&&
!
local
);
...
...
@@ -403,6 +404,8 @@ function setButtonsVisibility() {
(
'
getDisplayMedia
'
in
navigator
.
mediaDevices
));
setVisibility
(
'
unsharebutton
'
,
share
);
setVisibility
(
'
stopvideobutton
'
,
video
);
setVisibility
(
'
mediaoptions
'
,
permissions
.
present
);
}
...
...
@@ -467,6 +470,12 @@ document.getElementById('unsharebutton').onclick = function(e) {
resizePeers
();
}
document
.
getElementById
(
'
stopvideobutton
'
).
onclick
=
function
(
e
)
{
e
.
preventDefault
();
delUpMediaKind
(
'
video
'
);
resizePeers
();
}
/** @returns {number} */
function
getMaxVideoThroughput
()
{
let
v
=
getSettings
().
send
;
...
...
@@ -528,6 +537,7 @@ getInputElement('fileinput').onchange = function(e) {
let
files
=
input
.
files
;
for
(
let
i
=
0
;
i
<
files
.
length
;
i
++
)
addFileMedia
(
files
[
i
]);
input
.
value
=
''
;
}
/**
...
...
@@ -900,6 +910,7 @@ async function addFileMedia(file) {
};
setMedia
(
c
,
true
,
video
);
video
.
play
();
setButtonsVisibility
()
}
/**
...
...
@@ -1190,6 +1201,11 @@ function delMedia(id) {
let
media
=
/** @type{HTMLVideoElement} */
(
document
.
getElementById
(
'
media-
'
+
id
));
if
(
media
.
src
)
{
URL
.
revokeObjectURL
(
media
.
src
);
media
.
src
=
null
;
}
media
.
srcObject
=
null
;
mediadiv
.
removeChild
(
peer
);
...
...
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