Commit 5a213d2
authored
feat: adaptive floating video dimensions (#1969)
### 💡 Overview
Currently our floating video dimensions are hardcoded. This looks fine
in a iPhone Xs phone. Anything taller or wider, it looks small.
Our dogfood app had a custom implementation based on window dimensions
so we didnt use it. But this is also flawed, as this didnt adapt to
portrait to landscape change.
### 📝 Implementation notes
I implemented the Android AOSP PiP mode algorithm. Which is based on the
video dimensions.
Now it works well on larger devices like iPad too. Looks similar to
Facetime behaviour now. If the video changes to landscape, will adapt to
that as well now.
<img width="820" height="1180" alt="IMG_0016"
src="https://github.com/user-attachments/assets/fa104fc6-e04c-42ef-b071-fd8ef7178818"
/>
<img width="1180" height="820" alt="IMG_0017"
src="https://github.com/user-attachments/assets/5879e7c4-3c86-4fbd-9671-e705cc4035fa"
/>1 parent 9b7ff31 commit 5a213d2
File tree
5 files changed
+58
-25
lines changed- packages/react-native-sdk/src
- components/Participant/FloatingParticipantView
- constants
- hooks
- sample-apps/react-native/dogfood/src
5 files changed
+58
-25
lines changedLines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
107 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
125 | 136 | | |
126 | 137 | | |
127 | 138 | | |
| |||
158 | 169 | | |
159 | 170 | | |
160 | 171 | | |
161 | | - | |
| 172 | + | |
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
| |||
171 | 182 | | |
172 | 183 | | |
173 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
| |||
197 | 214 | | |
198 | 215 | | |
199 | 216 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 217 | | |
204 | 218 | | |
205 | 219 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 3 | | |
10 | 4 | | |
11 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
82 | 72 | | |
83 | 73 | | |
84 | 74 | | |
85 | | - | |
86 | 75 | | |
87 | 76 | | |
88 | 77 | | |
| |||
0 commit comments