Commit c2e0f21
authored
feat: hi-fi audio (#2305)
### 💡 Overview
**Hi-fi audio**
* Public api for stereo output enabling is simplified.
`callManager.start({ audioRole: 'listener' })` enables stereo output for
both platforms. Should be invoked on pre-join stage.
* Wired stereo input enable/disable flag for Android. For now it is
omitted.
**Presented media engine**
* Media engine is a layer responsible for creating/disposing WebRTC peer
connection factory in runtime during call join/leave stages. Peer
connection factory and audio device module instances are defined on
per-call basis. Only one factory instance can be created at a time. Web
resolves to a no-op engine.
* Guarded join/leave race. There are several implicit factory creators
during join flow: `getGenericSdp` and `initPublisherAndSubscriber`
(RTCPeerConnection constructor). The guard prevents creating new
instance if the join flow was interrupted by leave invocation.
**Made RN lobby independent from webrtc**
* Presented new video preview component, which uses video capturer
directly without creating local tracks. That video capturer instance is
passed later to a local track as a source of media
* Made device managers mute/unmute on pre-join stage update
corresponding state in an optimistic manner. That state is applied
during tracks publishing.
**Hardened call manager and audio wiring pipeline**
* Public call manager now won't invoke audio session configuration
explicitly. Instead it stores configuration params, which are applied
during join flow. Those params may override default call settings (e.g.
deviceEndpointType). Params are disposed during leave stage.
* Audio engine interruptions subscription for callingx is now managed
during join/leave, instead of single global subscription.
🎫 Ticket: https://linear.app/stream/issue/RN-402/hi-fi-audio
📑 Docs: GetStream/docs-content#1444
Corresponding WebRTC PR:
GetStream/react-native-webrtc#50
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added per-call WebRTC media engine support with configurable
providers.
* Added React Native lobby camera previews with on-demand permissions
and optimistic camera state.
* Added iOS controls for microphone mute mode and recording preparation.
* Added audio-engine subscription management for CallingX and in-call
behavior.
* **Bug Fixes**
* Prevented join/leave race conditions from continuing setup after
leaving.
* Improved React Native media capture, camera controls, and device-state
handling.
* Improved iOS audio stability when no active audio device is available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 425b5c7 commit c2e0f21
41 files changed
Lines changed: 1312 additions & 722 deletions
File tree
- packages
- client
- src
- devices
- __tests__
- rtc
- noise-cancellation-react-native
- react-native-callingx
- android/src/newarch/java/io/getstream/rn/callingx
- ios
- src
- spec
- react-native-sdk
- __tests__/call-manager
- ios
- src
- components/Call/Lobby
- modules/call-manager
- utils/internal
- callingx
- video-filters-react-native
- sample-apps/react-native
- dogfood
- ios
- src/screens/LiveStream
- expo-video-sample
- ringing-tutorial
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| 337 | + | |
| 338 | + | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
| |||
355 | 359 | | |
356 | 360 | | |
357 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
358 | 370 | | |
359 | 371 | | |
360 | 372 | | |
| |||
703 | 715 | | |
704 | 716 | | |
705 | 717 | | |
| 718 | + | |
| 719 | + | |
706 | 720 | | |
707 | 721 | | |
708 | 722 | | |
| |||
803 | 817 | | |
804 | 818 | | |
805 | 819 | | |
| 820 | + | |
806 | 821 | | |
807 | 822 | | |
808 | 823 | | |
809 | 824 | | |
810 | 825 | | |
811 | 826 | | |
812 | 827 | | |
| 828 | + | |
813 | 829 | | |
814 | 830 | | |
815 | 831 | | |
| |||
822 | 838 | | |
823 | 839 | | |
824 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
825 | 858 | | |
826 | 859 | | |
827 | 860 | | |
| |||
941 | 974 | | |
942 | 975 | | |
943 | 976 | | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
| 977 | + | |
949 | 978 | | |
950 | 979 | | |
951 | 980 | | |
| |||
982 | 1011 | | |
983 | 1012 | | |
984 | 1013 | | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
| 1014 | + | |
990 | 1015 | | |
991 | 1016 | | |
992 | 1017 | | |
| |||
1194 | 1219 | | |
1195 | 1220 | | |
1196 | 1221 | | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1197 | 1225 | | |
1198 | 1226 | | |
1199 | 1227 | | |
1200 | 1228 | | |
1201 | 1229 | | |
1202 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
1203 | 1242 | | |
1204 | 1243 | | |
1205 | 1244 | | |
| |||
1270 | 1309 | | |
1271 | 1310 | | |
1272 | 1311 | | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1273 | 1317 | | |
1274 | 1318 | | |
1275 | 1319 | | |
| |||
1329 | 1373 | | |
1330 | 1374 | | |
1331 | 1375 | | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1332 | 1383 | | |
1333 | 1384 | | |
1334 | 1385 | | |
| |||
1375 | 1426 | | |
1376 | 1427 | | |
1377 | 1428 | | |
1378 | | - | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
1379 | 1434 | | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
1380 | 1439 | | |
1381 | 1440 | | |
| 1441 | + | |
1382 | 1442 | | |
1383 | | - | |
| 1443 | + | |
1384 | 1444 | | |
1385 | 1445 | | |
1386 | 1446 | | |
| |||
1669 | 1729 | | |
1670 | 1730 | | |
1671 | 1731 | | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
1672 | 1765 | | |
1673 | 1766 | | |
1674 | 1767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
127 | 175 | | |
128 | 176 | | |
129 | 177 | | |
| |||
166 | 214 | | |
167 | 215 | | |
168 | 216 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
172 | 226 | | |
173 | 227 | | |
174 | 228 | | |
| |||
196 | 250 | | |
197 | 251 | | |
198 | 252 | | |
199 | | - | |
| 253 | + | |
200 | 254 | | |
201 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
202 | 259 | | |
203 | 260 | | |
204 | 261 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
512 | 529 | | |
513 | 530 | | |
514 | 531 | | |
| |||
0 commit comments