Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3e7aee3

Browse files
authored
Merge pull request #5992 from SimonBrandner/fix/12652/screen-share
Add support for screen sharing in 1:1 calls
2 parents 93f4218 + b9e305d commit 3e7aee3

17 files changed

+750
-343
lines changed

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@
269269
@import "./views/voip/_CallPreview.scss";
270270
@import "./views/voip/_CallView.scss";
271271
@import "./views/voip/_CallViewForRoom.scss";
272+
@import "./views/voip/_CallViewSidebar.scss";
272273
@import "./views/voip/_DialPad.scss";
273274
@import "./views/voip/_DialPadContextMenu.scss";
274275
@import "./views/voip/_DialPadModal.scss";

res/css/views/elements/_DesktopCapturerSourcePicker.scss

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,43 @@ limitations under the License.
1616

1717
.mx_desktopCapturerSourcePicker {
1818
overflow: hidden;
19-
}
20-
21-
.mx_desktopCapturerSourcePicker_tabLabels {
22-
display: flex;
23-
padding: 0 0 8px 0;
24-
}
25-
26-
.mx_desktopCapturerSourcePicker_tabLabel,
27-
.mx_desktopCapturerSourcePicker_tabLabel_selected {
28-
width: 100%;
29-
text-align: center;
30-
border-radius: 8px;
31-
padding: 8px 0;
32-
font-size: $font-13px;
33-
}
34-
35-
.mx_desktopCapturerSourcePicker_tabLabel_selected {
36-
background-color: $tab-label-active-bg-color;
37-
color: $tab-label-active-fg-color;
38-
}
39-
40-
.mx_desktopCapturerSourcePicker_panel {
41-
display: flex;
42-
flex-wrap: wrap;
43-
justify-content: center;
44-
align-items: flex-start;
45-
height: 500px;
46-
overflow: overlay;
47-
}
48-
49-
.mx_desktopCapturerSourcePicker_stream_button {
50-
display: flex;
51-
flex-direction: column;
52-
margin: 8px;
53-
border-radius: 4px;
54-
}
55-
56-
.mx_desktopCapturerSourcePicker_stream_button:hover,
57-
.mx_desktopCapturerSourcePicker_stream_button:focus {
58-
background: $roomtile-selected-bg-color;
59-
}
60-
61-
.mx_desktopCapturerSourcePicker_stream_thumbnail {
62-
margin: 4px;
63-
width: 312px;
64-
}
6519

66-
.mx_desktopCapturerSourcePicker_stream_name {
67-
margin: 0 4px;
68-
white-space: nowrap;
69-
text-overflow: ellipsis;
70-
overflow: hidden;
71-
width: 312px;
20+
.mx_desktopCapturerSourcePicker_tab {
21+
display: flex;
22+
flex-wrap: wrap;
23+
justify-content: center;
24+
align-items: flex-start;
25+
height: 500px;
26+
overflow: overlay;
27+
}
28+
29+
.mx_desktopCapturerSourcePicker_source {
30+
display: flex;
31+
flex-direction: column;
32+
margin: 8px;
33+
}
34+
35+
.mx_desktopCapturerSourcePicker_source_thumbnail {
36+
margin: 4px;
37+
padding: 4px;
38+
width: 312px;
39+
border-width: 2px;
40+
border-radius: 8px;
41+
border-style: solid;
42+
border-color: transparent;
43+
44+
&.mx_desktopCapturerSourcePicker_source_thumbnail_selected,
45+
&:hover,
46+
&:focus {
47+
border-color: $accent-color;
48+
}
49+
}
50+
51+
.mx_desktopCapturerSourcePicker_source_name {
52+
margin: 0 4px;
53+
white-space: nowrap;
54+
text-overflow: ellipsis;
55+
overflow: hidden;
56+
width: 312px;
57+
}
7258
}

res/css/views/voip/_CallView.scss

Lines changed: 65 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,26 @@ limitations under the License.
6767
.mx_CallView_content {
6868
position: relative;
6969
display: flex;
70+
justify-content: center;
7071
border-radius: 8px;
72+
73+
> .mx_VideoFeed {
74+
width: 100%;
75+
height: 100%;
76+
77+
&.mx_VideoFeed_voice {
78+
// We don't want to collide with the call controls that have 52px of height
79+
padding-bottom: 52px;
80+
background-color: $inverted-bg-color;
81+
display: flex;
82+
justify-content: center;
83+
align-items: center;
84+
}
85+
86+
&.mx_VideoFeed_video {
87+
background-color: #000;
88+
}
89+
}
7190
}
7291

7392
.mx_CallView_voice {
@@ -290,17 +309,37 @@ limitations under the License.
290309
width: 100%;
291310
opacity: 1;
292311
transition: opacity 0.5s;
312+
z-index: 200; // To be above _all_ feeds
293313
}
294314

295315
.mx_CallView_callControls_hidden {
296316
opacity: 0.001; // opacity 0 can cause a re-layout
297317
pointer-events: none;
298318
}
299319

320+
.mx_CallView_presenting {
321+
opacity: 1;
322+
transition: opacity 0.5s;
323+
324+
position: absolute;
325+
margin-top: 18px;
326+
padding: 4px 8px;
327+
border-radius: 4px;
328+
329+
// Same on both themes
330+
color: white;
331+
background-color: #17191c;
332+
}
333+
334+
.mx_CallView_presenting_hidden {
335+
opacity: 0.001; // opacity 0 can cause a re-layout
336+
pointer-events: none;
337+
}
338+
300339
.mx_CallView_callControls_button {
301340
cursor: pointer;
302-
margin-left: 8px;
303-
margin-right: 8px;
341+
margin-left: 2px;
342+
margin-right: 2px;
304343

305344

306345
&::before {
@@ -317,17 +356,11 @@ limitations under the License.
317356
}
318357

319358
.mx_CallView_callControls_dialpad {
320-
margin-right: auto;
321359
&::before {
322360
background-image: url('$(res)/img/voip/dialpad.svg');
323361
}
324362
}
325363

326-
.mx_CallView_callControls_button_dialpad_hidden {
327-
margin-right: auto;
328-
cursor: initial;
329-
}
330-
331364
.mx_CallView_callControls_button_micOn {
332365
&::before {
333366
background-image: url('$(res)/img/voip/mic-on.svg');
@@ -352,24 +385,42 @@ limitations under the License.
352385
}
353386
}
354387

388+
.mx_CallView_callControls_button_screensharingOn {
389+
&::before {
390+
background-image: url('$(res)/img/voip/screensharing-on.svg');
391+
}
392+
}
393+
394+
.mx_CallView_callControls_button_screensharingOff {
395+
&::before {
396+
background-image: url('$(res)/img/voip/screensharing-off.svg');
397+
}
398+
}
399+
400+
.mx_CallView_callControls_button_sidebarOn {
401+
&::before {
402+
background-image: url('$(res)/img/voip/sidebar-on.svg');
403+
}
404+
}
405+
406+
.mx_CallView_callControls_button_sidebarOff {
407+
&::before {
408+
background-image: url('$(res)/img/voip/sidebar-off.svg');
409+
}
410+
}
411+
355412
.mx_CallView_callControls_button_hangup {
356413
&::before {
357414
background-image: url('$(res)/img/voip/hangup.svg');
358415
}
359416
}
360417

361418
.mx_CallView_callControls_button_more {
362-
margin-left: auto;
363419
&::before {
364420
background-image: url('$(res)/img/voip/more.svg');
365421
}
366422
}
367423

368-
.mx_CallView_callControls_button_more_hidden {
369-
margin-left: auto;
370-
cursor: initial;
371-
}
372-
373424
.mx_CallView_callControls_button_invisible {
374425
visibility: hidden;
375426
pointer-events: none;
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
Copyright 2021 Šimon Brandner <[email protected]>
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_CallViewSidebar {
18+
position: absolute;
19+
right: 16px;
20+
bottom: 16px;
21+
z-index: 100; // To be above the primary feed
22+
23+
overflow: auto;
24+
25+
height: calc(100% - 32px); // Subtract the top and bottom padding
26+
width: 20%;
27+
28+
display: flex;
29+
flex-direction: column-reverse;
30+
justify-content: flex-start;
31+
align-items: flex-end;
32+
gap: 12px;
33+
34+
> .mx_VideoFeed {
35+
width: 100%;
36+
37+
&.mx_VideoFeed_voice {
38+
display: flex;
39+
align-items: center;
40+
justify-content: center;
41+
42+
aspect-ratio: 16 / 9;
43+
}
44+
}
45+
46+
&.mx_CallViewSidebar_pipMode {
47+
top: 16px;
48+
bottom: unset;
49+
justify-content: flex-end;
50+
gap: 4px;
51+
}
52+
}

res/css/views/voip/_VideoFeed.scss

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,13 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
.mx_VideoFeed_voice {
18-
background-color: $inverted-bg-color;
19-
}
20-
17+
.mx_VideoFeed {
18+
border-radius: 4px;
2119

22-
.mx_VideoFeed_remote {
23-
width: 100%;
24-
height: 100%;
25-
display: flex;
26-
justify-content: center;
27-
align-items: center;
2820

29-
&.mx_VideoFeed_video {
30-
background-color: #000;
21+
&.mx_VideoFeed_voice {
22+
background-color: $inverted-bg-color;
3123
}
32-
}
33-
34-
.mx_VideoFeed_local {
35-
max-width: 25%;
36-
max-height: 25%;
37-
position: absolute;
38-
right: 10px;
39-
top: 10px;
40-
z-index: 100;
41-
border-radius: 4px;
4224

4325
&.mx_VideoFeed_video {
4426
background-color: transparent;

res/img/voip/screensharing-off.svg

Lines changed: 18 additions & 0 deletions
Loading

res/img/voip/screensharing-on.svg

Lines changed: 18 additions & 0 deletions
Loading

res/img/voip/sidebar-off.svg

Lines changed: 20 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)