Commit f2f4928
committed
fix(call): fullscreen video layout — auto-fit, centre last row, self-view toggle, camera + screenshare coexist
Four related issues with the in-call video grid landed in one PR because
each one was a slice of the same per-participant layout pipeline:
1. **Tiles overflowed in fullscreen.** The grid used
`grid-auto-rows: min-content` and capped each tile via `max-height:
100%`, but `100%` of an overflowing parent is itself the overflowing
height, so the trailing rows scrolled off-screen. Added a
`fullscreen` class on `.video-grid` that switches to
`grid-template-rows: repeat(var(--number-of-rows), 1fr)` with
`overflow: hidden` and per-tile `align/justify-self: center`, so every
tile fits the available space while preserving the 16/9 aspect
ratio.
2. **Odd-numbered trailing rows were left-aligned.** Added a computed
`lastRowTiles` count and emit a `grid-column-start: <offset+1>` style
on the first tile of an incomplete trailing row. Subsequent tiles
flow naturally; no per-row wrapper or `:has(...)` selector required.
3. **Self-view couldn't be hidden.** Added `selfViewVisible` /
`toggleSelfViewVisible` on the UI store (persisted across sessions)
and a desktop-only "Hide my video / Show my video" button in
`MainCallControls.vue`. When off, the local camera tile is dropped
from `allParticipants` — the user remains in the call and is still
heard, the local screenshare tile (when present) is still shown so
the user can verify what they're broadcasting.
4. **Screenshare overrode the user's camera tile on both sides of the
call.** Three connected changes:
- `mediaDevicesStore.turnOnScreenShare` no longer removes the camera
track from `stream`. The screenshare is captured into its own
`screenShareStream` ref and sent to peers via a new
`webrtcStore.addScreenShareTrack` (a `peer.addTrack(track,
dedicatedStream)` instead of a `replaceTrack` swap), so the
receiving side fires a fresh `peer.on('track')` event with a
distinct stream id.
- `webrtcStore.ts` peer.on('track') handler used to wipe the per-peer
`streams` array on every new stream (`streams = [stream]`), which
silently dropped the camera tile the moment a screenshare track
arrived. Now appends a new stream entry and updates in place when
extra tracks land on an existing stream. Tracks that end clear
their stream from the array.
- `useVideoLayout.allParticipants` splits both the local user and
each remote peer into separate camera-tile / screenshare-tile
entries (`streamKind: 'camera' | 'screenshare'`). Remote
screenshares are identified as streams with video tracks but no
audio tracks — the camera stream always carries the mic track.
- Cleaned up the old `savedVideoTrack` swap-back bookkeeping in
`toggleVideo` / `resetMediaDevices` — superfluous now that camera
and screenshare run on independent streams.
Composite `did:streamKind` participant keys replace bare DIDs in
`focusOnVideo` / focused-layout, so the focus model handles the
camera-vs-screenshare split too. Bare DIDs from older persisted state
still match (first tile for that user, which is the camera tile).1 parent bc3bae2 commit f2f4928
6 files changed
Lines changed: 355 additions & 108 deletions
File tree
- app/src
- components/call
- composables
- controls
- window
- stores
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
13 | 29 | | |
14 | 30 | | |
15 | 31 | | |
16 | 32 | | |
17 | 33 | | |
18 | 34 | | |
19 | 35 | | |
20 | | - | |
21 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
22 | 39 | | |
23 | 40 | | |
24 | 41 | | |
| |||
37 | 54 | | |
38 | 55 | | |
39 | 56 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
65 | 140 | | |
66 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
67 | 155 | | |
68 | 156 | | |
69 | | - | |
| 157 | + | |
70 | 158 | | |
71 | 159 | | |
72 | 160 | | |
73 | 161 | | |
74 | | - | |
| 162 | + | |
75 | 163 | | |
76 | 164 | | |
77 | 165 | | |
| |||
88 | 176 | | |
89 | 177 | | |
90 | 178 | | |
91 | | - | |
| 179 | + | |
92 | 180 | | |
93 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
94 | 184 | | |
95 | 185 | | |
96 | 186 | | |
| |||
133 | 223 | | |
134 | 224 | | |
135 | 225 | | |
| 226 | + | |
136 | 227 | | |
137 | 228 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
74 | 90 | | |
75 | 91 | | |
76 | 92 | | |
| |||
153 | 169 | | |
154 | 170 | | |
155 | 171 | | |
156 | | - | |
| 172 | + | |
157 | 173 | | |
158 | 174 | | |
159 | 175 | | |
| |||
0 commit comments