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
ae782f5d
Commit
ae782f5d
authored
Sep 16, 2022
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove isUp parameter from setMedia.
It's redundant, the data is already in the stream.
parent
1f3328b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
static/galene.js
static/galene.js
+10
-12
No files found.
static/galene.js
View file @
ae782f5d
...
@@ -367,7 +367,7 @@ function gotDownStream(c) {
...
@@ -367,7 +367,7 @@ function gotDownStream(c) {
displayError
(
e
);
displayError
(
e
);
};
};
c
.
ondowntrack
=
function
(
track
,
transceiver
,
label
,
stream
)
{
c
.
ondowntrack
=
function
(
track
,
transceiver
,
label
,
stream
)
{
setMedia
(
c
,
false
);
setMedia
(
c
);
};
};
c
.
onnegotiationcompleted
=
function
()
{
c
.
onnegotiationcompleted
=
function
()
{
resetMedia
(
c
);
resetMedia
(
c
);
...
@@ -379,7 +379,7 @@ function gotDownStream(c) {
...
@@ -379,7 +379,7 @@ function gotDownStream(c) {
if
(
getSettings
().
activityDetection
)
if
(
getSettings
().
activityDetection
)
c
.
setStatsInterval
(
activityDetectionInterval
);
c
.
setStatsInterval
(
activityDetectionInterval
);
setMedia
(
c
,
false
);
setMedia
(
c
);
}
}
// Store current browser viewport height in css variable
// Store current browser viewport height in css variable
...
@@ -1311,7 +1311,7 @@ async function replaceUpStream(c) {
...
@@ -1311,7 +1311,7 @@ async function replaceUpStream(c) {
let
media
=
/** @type{HTMLVideoElement} */
let
media
=
/** @type{HTMLVideoElement} */
(
document
.
getElementById
(
'
media-
'
+
c
.
localId
));
(
document
.
getElementById
(
'
media-
'
+
c
.
localId
));
setUpStream
(
cn
,
c
.
stream
);
setUpStream
(
cn
,
c
.
stream
);
await
setMedia
(
cn
,
true
,
await
setMedia
(
cn
,
cn
.
label
==
'
camera
'
&&
getSettings
().
mirrorView
,
cn
.
label
==
'
camera
'
&&
getSettings
().
mirrorView
,
cn
.
label
==
'
video
'
&&
media
);
cn
.
label
==
'
video
'
&&
media
);
return
cn
;
return
cn
;
...
@@ -1411,7 +1411,7 @@ async function addLocalMedia(localId) {
...
@@ -1411,7 +1411,7 @@ async function addLocalMedia(localId) {
}
}
setUpStream
(
c
,
stream
);
setUpStream
(
c
,
stream
);
await
setMedia
(
c
,
true
,
settings
.
mirrorView
);
await
setMedia
(
c
,
settings
.
mirrorView
);
setButtonsVisibility
();
setButtonsVisibility
();
}
}
...
@@ -1450,7 +1450,7 @@ async function addShareMedia() {
...
@@ -1450,7 +1450,7 @@ async function addShareMedia() {
let
c
=
newUpStream
();
let
c
=
newUpStream
();
c
.
label
=
'
screenshare
'
;
c
.
label
=
'
screenshare
'
;
setUpStream
(
c
,
stream
);
setUpStream
(
c
,
stream
);
await
setMedia
(
c
,
true
);
await
setMedia
(
c
);
setButtonsVisibility
();
setButtonsVisibility
();
}
}
...
@@ -1495,7 +1495,7 @@ async function addFileMedia(file) {
...
@@ -1495,7 +1495,7 @@ async function addFileMedia(file) {
displayWarning
(
'
You have been muted
'
);
displayWarning
(
'
You have been muted
'
);
}
}
await
setMedia
(
c
,
true
,
false
,
video
);
await
setMedia
(
c
,
false
,
video
);
c
.
userdata
.
play
=
true
;
c
.
userdata
.
play
=
true
;
setButtonsVisibility
();
setButtonsVisibility
();
}
}
...
@@ -1671,15 +1671,13 @@ function scheduleReconsiderDownRate() {
...
@@ -1671,15 +1671,13 @@ function scheduleReconsiderDownRate() {
* setMedia adds a new media element corresponding to stream c.
* setMedia adds a new media element corresponding to stream c.
*
*
* @param {Stream} c
* @param {Stream} c
* @param {boolean} isUp
* - indicates whether the stream goes in the up direction
* @param {boolean} [mirror]
* @param {boolean} [mirror]
* - whether to mirror the video
* - whether to mirror the video
* @param {HTMLVideoElement} [video]
* @param {HTMLVideoElement} [video]
* - the video element to add. If null, a new element with custom
* - the video element to add. If null, a new element with custom
* controls will be created.
* controls will be created.
*/
*/
async
function
setMedia
(
c
,
isUp
,
mirror
,
video
)
{
async
function
setMedia
(
c
,
mirror
,
video
)
{
let
peersdiv
=
document
.
getElementById
(
'
peers
'
);
let
peersdiv
=
document
.
getElementById
(
'
peers
'
);
let
div
=
document
.
getElementById
(
'
peer-
'
+
c
.
localId
);
let
div
=
document
.
getElementById
(
'
peer-
'
+
c
.
localId
);
...
@@ -1697,7 +1695,7 @@ async function setMedia(c, isUp, mirror, video) {
...
@@ -1697,7 +1695,7 @@ async function setMedia(c, isUp, mirror, video) {
media
=
video
;
media
=
video
;
}
else
{
}
else
{
media
=
document
.
createElement
(
'
video
'
);
media
=
document
.
createElement
(
'
video
'
);
if
(
isU
p
)
if
(
c
.
u
p
)
media
.
muted
=
true
;
media
.
muted
=
true
;
}
}
...
@@ -1717,7 +1715,7 @@ async function setMedia(c, isUp, mirror, video) {
...
@@ -1717,7 +1715,7 @@ async function setMedia(c, isUp, mirror, video) {
if
(
!
video
&&
media
.
srcObject
!==
c
.
stream
)
if
(
!
video
&&
media
.
srcObject
!==
c
.
stream
)
media
.
srcObject
=
c
.
stream
;
media
.
srcObject
=
c
.
stream
;
if
(
!
isU
p
)
{
if
(
!
c
.
u
p
)
{
media
.
onfullscreenchange
=
function
(
e
)
{
media
.
onfullscreenchange
=
function
(
e
)
{
forceDownRate
(
c
.
id
,
document
.
fullscreenElement
===
media
,
false
);
forceDownRate
(
c
.
id
,
document
.
fullscreenElement
===
media
,
false
);
}
}
...
@@ -1737,7 +1735,7 @@ async function setMedia(c, isUp, mirror, video) {
...
@@ -1737,7 +1735,7 @@ async function setMedia(c, isUp, mirror, video) {
showVideo
();
showVideo
();
resizePeers
();
resizePeers
();
if
(
!
isU
p
&&
isSafari
()
&&
!
findUpMedia
(
'
camera
'
))
{
if
(
!
c
.
u
p
&&
isSafari
()
&&
!
findUpMedia
(
'
camera
'
))
{
// Safari doesn't allow autoplay unless the user has granted media access
// Safari doesn't allow autoplay unless the user has granted media access
try
{
try
{
let
stream
=
await
navigator
.
mediaDevices
.
getUserMedia
({
audio
:
true
});
let
stream
=
await
navigator
.
mediaDevices
.
getUserMedia
({
audio
:
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