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
96288a11
Commit
96288a11
authored
Nov 27, 2020
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Video mirrored rotation
Gives to video the same appearance as being mirrored.
parent
3f10b89b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
static/sfu.css
static/sfu.css
+4
-0
static/sfu.js
static/sfu.js
+26
-1
No files found.
static/sfu.css
View file @
96288a11
...
...
@@ -755,6 +755,10 @@ h1 {
object-fit
:
contain
;
}
.media-mirror
{
transform
:
scaleX
(
-1
);
}
.media-failed
{
opacity
:
0.7
;
}
...
...
static/sfu.js
View file @
96288a11
...
...
@@ -1010,6 +1010,7 @@ function setMedia(c, isUp, video) {
let
local_media
;
let
down_media
;
let
audioMode
=
false
;
let
rotate
;
for
(
let
id
in
serverConnection
.
up
)
{
if
(
id
===
c
.
id
)
{
...
...
@@ -1019,8 +1020,15 @@ function setMedia(c, isUp, video) {
}
if
(
!
isUp
)
{
down_media
=
serverConnection
.
down
[
c
.
id
];
if
(
down_media
)
if
(
down_media
)
{
audioMode
=
!
down_media
.
stream
.
getVideoTracks
().
length
;
rotate
=
true
;
for
(
let
mid
in
down_media
.
labelsByMid
)
{
// we do not rotate if video is a screenshare
if
(
down_media
.
labelsByMid
[
mid
]
===
"
screenshare
"
)
rotate
=
false
;
}
}
}
let
div
=
document
.
getElementById
(
'
peer-
'
+
c
.
id
);
...
...
@@ -1059,6 +1067,10 @@ function setMedia(c, isUp, video) {
}
if
(
!
video
)
{
if
((
local_media
&&
local_media
.
kind
!==
"
screenshare
"
)
||
rotate
)
media
.
classList
.
add
(
'
media-mirror
'
);
else
media
.
classList
.
add
(
'
media-static
'
);
let
template
=
document
.
getElementById
(
'
videocontrols-template
'
)
.
firstElementChild
;
let
top_template
=
document
.
getElementById
(
'
top-videocontrols-template
'
)
...
...
@@ -1240,6 +1252,19 @@ function registerControlEvent(peerid) {
};
}
let
media
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
video.media
"
));
media
.
onenterpictureinpicture
=
function
(
event
)
{
if
(
event
.
target
.
classList
.
contains
(
'
media-static
'
))
return
;
event
.
target
.
classList
.
remove
(
'
media-mirror
'
);
};
media
.
onleavepictureinpicture
=
function
(
event
)
{
if
(
event
.
target
.
classList
.
contains
(
'
media-static
'
))
return
;
event
.
target
.
classList
.
add
(
'
media-mirror
'
);
};
let
stop
=
/** @type {HTMLElement} */
(
peer
.
querySelector
(
"
.stopsharing
"
));
if
(
stop
)
{
stop
.
onclick
=
function
(
event
)
{
...
...
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