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
8a4b2f5d
Commit
8a4b2f5d
authored
Sep 18, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement studio and blackboard mode.
parent
b8011371
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
static/sfu.html
static/sfu.html
+8
-0
static/sfu.js
static/sfu.js
+44
-3
No files found.
static/sfu.html
View file @
8a4b2f5d
...
...
@@ -154,6 +154,14 @@
<option
value=
""
>
off
</option>
</select>
<form>
<input
id=
"blackboardbox"
type=
"checkbox"
>
Blackboard mode
</input>
</form>
<form>
<input
id=
"studiobox"
type=
"checkbox"
>
Studio mode
</input>
</form>
</div>
<label
for=
"sendselect"
>
Send:
</label>
...
...
static/sfu.js
View file @
8a4b2f5d
...
...
@@ -78,6 +78,8 @@ function getUsername() {
* @property {string} [send]
* @property {string} [request]
* @property {boolean} [activityDetection]
* @property {boolean} [blackboardMode]
* @property {boolean} [studioMode]
*/
/** @type{settings} */
...
...
@@ -163,6 +165,10 @@ function reflectSettings() {
document
.
getElementById
(
'
activitybox
'
).
checked
=
settings
.
activityDetection
;
document
.
getElementById
(
'
blackboardbox
'
).
checked
=
settings
.
blackboardMode
;
document
.
getElementById
(
'
studiobox
'
).
checked
=
settings
.
studioMode
;
if
(
store
)
storeSettings
(
settings
);
...
...
@@ -359,6 +365,18 @@ document.getElementById('audioselect').onchange = function(e) {
changePresentation
();
};
document
.
getElementById
(
'
blackboardbox
'
).
onchange
=
function
(
e
)
{
e
.
preventDefault
();
updateSettings
({
blackboardMode
:
this
.
checked
});
changePresentation
();
}
document
.
getElementById
(
'
studiobox
'
).
onchange
=
function
(
e
)
{
e
.
preventDefault
();
updateSettings
({
studioMode
:
this
.
checked
});
changePresentation
();
}
document
.
getElementById
(
'
mutebutton
'
).
onclick
=
function
(
e
)
{
e
.
preventDefault
();
let
localMute
=
getSettings
().
localMute
;
...
...
@@ -646,6 +664,23 @@ async function addLocalMedia(id) {
let
audio
=
settings
.
audio
?
{
deviceId
:
settings
.
audio
}
:
false
;
let
video
=
settings
.
video
?
{
deviceId
:
settings
.
video
}
:
false
;
if
(
audio
)
{
if
(
settings
.
studioMode
)
{
audio
.
echoCancellation
=
false
;
audio
.
noiseSuppression
=
false
;
audio
.
channelCount
=
2
;
audio
.
latency
=
0.01
;
audio
.
autoGainControl
=
false
;
}
}
if
(
video
)
{
if
(
settings
.
blackboardMode
)
{
video
.
width
=
{
min
:
640
,
ideal
:
1920
};
video
.
height
=
{
min
:
400
,
ideal
:
1080
};
}
}
let
old
=
id
&&
serverConnection
.
up
[
id
];
if
(
!
audio
&&
!
video
)
{
...
...
@@ -662,7 +697,6 @@ async function addLocalMedia(id) {
try
{
stream
=
await
navigator
.
mediaDevices
.
getUserMedia
(
constraints
);
}
catch
(
e
)
{
console
.
error
(
e
);
displayError
(
e
);
if
(
old
)
delUpMedia
(
old
);
...
...
@@ -678,8 +712,15 @@ async function addLocalMedia(id) {
let
mute
=
getSettings
().
localMute
;
stream
.
getTracks
().
forEach
(
t
=>
{
c
.
labels
[
t
.
id
]
=
t
.
kind
if
(
t
.
kind
==
'
audio
'
&&
mute
)
t
.
enabled
=
false
;
if
(
t
.
kind
==
'
audio
'
)
{
if
(
mute
)
t
.
enabled
=
false
;
}
else
if
(
t
.
kind
==
'
video
'
)
{
if
(
settings
.
blackboardMode
)
{
if
(
'
contentHint
'
in
t
)
t
.
contentHint
=
'
detail
'
;
}
}
let
sender
=
c
.
pc
.
addTrack
(
t
,
stream
);
});
...
...
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