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
ad034036
Commit
ad034036
authored
Nov 27, 2020
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup and make code compliant with ts
parent
4270cd0e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
static/sfu.js
static/sfu.js
+18
-13
No files found.
static/sfu.js
View file @
ad034036
...
@@ -1194,7 +1194,6 @@ function updateControlStatus(id, isLocal, shared, audioMode, muted) {
...
@@ -1194,7 +1194,6 @@ function updateControlStatus(id, isLocal, shared, audioMode, muted) {
* @param {string} peerid
* @param {string} peerid
*/
*/
function
registerControlEvent
(
peerid
)
{
function
registerControlEvent
(
peerid
)
{
let
settings
=
getSettings
();
let
peer
=
document
.
getElementById
(
peerid
);
let
peer
=
document
.
getElementById
(
peerid
);
//Add event listener when a video component is added to the DOM
//Add event listener when a video component is added to the DOM
let
volume
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.volume
"
));
let
volume
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
span.volume
"
));
...
@@ -1245,24 +1244,30 @@ function registerControlEvent(peerid) {
...
@@ -1245,24 +1244,30 @@ function registerControlEvent(peerid) {
};
};
}
}
let
media
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
video.media
"
));
let
media
=
/** @type {HTMLVideoElement} */
(
peer
.
querySelector
(
"
video.media
"
));
/** @ts-ignore */
if
(
media
.
onenterpictureinpicture
&&
media
.
onleavepictureinpicture
)
{
/** @ts-ignore */
media
.
onenterpictureinpicture
=
function
(
event
)
{
media
.
onenterpictureinpicture
=
function
(
event
)
{
if
(
event
.
target
.
classList
.
contains
(
'
media-static
'
))
if
(
event
.
target
.
classList
.
contains
(
'
media-static
'
))
return
;
return
;
event
.
target
.
classList
.
remove
(
'
media-mirror
'
);
event
.
target
.
classList
.
remove
(
'
media-mirror
'
);
};
};
/** @ts-ignore */
media
.
onleavepictureinpicture
=
function
(
event
)
{
media
.
onleavepictureinpicture
=
function
(
event
)
{
if
(
event
.
target
.
classList
.
contains
(
'
media-static
'
))
if
(
event
.
target
.
classList
.
contains
(
'
media-static
'
))
return
;
return
;
event
.
target
.
classList
.
add
(
'
media-mirror
'
);
event
.
target
.
classList
.
add
(
'
media-mirror
'
);
};
};
}
let
stop
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
.stopsharing
"
));
let
stop
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
.stopsharing
"
));
if
(
stop
)
{
if
(
stop
)
{
stop
.
onclick
=
function
(
event
)
{
stop
.
onclick
=
function
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
let
video
=
getParentVideo
(
event
.
target
);
let
element
=
/** @type {HTMLElement} */
(
event
.
target
);
let
video
=
getParentVideo
(
element
);
let
video_id
=
video
.
id
.
split
(
"
-
"
)[
1
];
let
video_id
=
video
.
id
.
split
(
"
-
"
)[
1
];
for
(
let
id
in
serverConnection
.
up
)
{
for
(
let
id
in
serverConnection
.
up
)
{
if
(
video_id
===
id
)
{
if
(
video_id
===
id
)
{
...
...
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