Commit 6c2e98e
authored
fix: audio recordings fixes and performance improvements (#3514)
## 🎯 Goal
This PR fixes several SDK side audio bugs and interaction issues around
voice recordings and audio attachments.
The main change is a (long overdue) rewrite of our audio playing
management so that it no longer relies on `react-native-video` for
`stream-chat-react-native`. The main rationale' was the fact that it
would appear the specific format we use was not seekable at all (and no
way to force `react-native-video` to seek with
`AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS`, at least
that I know of). In addition to that, using `react-native-nitro-sound`
is much more stable and performant.
Additionally, this PR also includes:
- a complete rewrite of how our waveform component works
(`WaveProgressBar`)
- smoother waveform playback/drag behavior in `WaveProgressBar`
- fixed drag crash caused by incorrect `worklet` usage
- fixed seek release oscillation in audio attachments
- improved drag hit area
- fixed thumb tail overshoot
- reduced idle waveform rendering cost
- stabilized duration label width to avoid layout churn
- fixed Android native speed change while paused starting playback
- fixed Expo iOS seek by converting ms to seconds in the Expo audio
adapter
## 🛠 Implementation details
<!-- Provide a description of the implementation -->
## 🎨 UI Changes
<!-- Add relevant screenshots -->
<details>
<summary>iOS</summary>
<table>
<thead>
<tr>
<td>Before</td>
<td>After</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<!--<img src="" /> -->
</td>
<td>
<!--<img src="" /> -->
</td>
</tr>
</tbody>
</table>
</details>
<details>
<summary>Android</summary>
<table>
<thead>
<tr>
<td>Before</td>
<td>After</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<!--<img src="" /> -->
</td>
<td>
<!--<img src="" /> -->
</td>
</tr>
</tbody>
</table>
</details>
## 🧪 Testing
<!-- Explain how this change can be tested (or why it can't be tested)
-->
## ☑️ Checklist
- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required)
- [ ] PR targets the `develop` branch
- [ ] Documentation is updated
- [ ] New code is tested in main example apps, including all possible
scenarios
- [ ] SampleApp iOS and Android
- [ ] Expo iOS and Android1 parent efb686c commit 6c2e98e
File tree
11 files changed
+928
-185
lines changed- examples/ExpoMessaging/plugins
- package
- expo-package/src/optionalDependencies
- native-package/src/optionalDependencies
- src
- components
- Attachment/Audio
- MessageInput/components/AudioRecorder
- ProgressControl
- middlewares
- state-store
- __tests__
11 files changed
+928
-185
lines changedLines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 25 | + | |
22 | 26 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | | - | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
| 141 | + | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
0 commit comments