Skip to content

Conversation

@khushal87
Copy link
Member

No description provided.

This pull request refactors and modernizes the audio attachment
components, improving state management, playback control, and code
clarity. The most significant changes are the migration to a centralized
audio player state store, deprecation of legacy callback props, and
improved handling for both audio and voice recording attachments. These
updates enhance maintainability and user experience across both Expo and
native platforms.

Starting this PR, integrators can choose to have only a single player
instance at a time which can be controlled using the
`allowConcurrentAudioPlayback` prop of the Channel component where
`false` is the new default. This behaviour is done in parity with React
SDK and as per decision.

### **Audio Attachment Component Refactor and State Management
Improvements**

* Migrated audio playback state (play/pause, progress, duration,
playback rate) from local props and callbacks to a centralized state
store via `useAudioPlayerControl` and `useStateStore`, removing the need
for deprecated callback props like `onLoad`, `onPlayPause`, and
`onProgress`.
[[1]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL1-R176)
[[2]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL273-R205)
* Updated UI and logic to use new state values (`isPlaying`, `progress`,
`duration`, `currentPlaybackRate`) for rendering controls, progress
bars, and playback speed, replacing legacy props and local state.
[[1]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL311-R231)
[[2]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL347-R277)
[[3]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL370-R291)
[[4]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL380-R300)
[[5]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL393-R313)

### **Voice Recording and Audio Attachment Handling**

* Improved detection and handling of voice recordings using the new
`isVoiceRecordingAttachment` helper, ensuring correct duration and title
display, and simplifying logic for both audio and voice recording types.
[[1]](diffhunk://#diff-d9e0483e9e85e351477d959f53b229e12d576be2e9bfa5bbff4dc04b70c5de0bL331-R251)
[[2]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L4-R4)

### **File Attachment Group Updates**

* Deprecated legacy callback props (`onLoad`, `onProgress`) in
`FileAttachmentGroup`, updating documentation and usage to encourage
migration to the new state management approach. Also added `message`
prop for better context handling.
[[1]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L20-R23)
[[2]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L52-R59)
[[3]](diffhunk://#diff-689763e88588fba421d39abbb74f3ca6853eac3cf45f74f1dc95855bbea86f99L62-R76)

### **Native and Expo Audio Player Integration**

* Improved Expo audio player integration by subscribing to status events
earlier and fixing seek logic to use seconds instead of milliseconds,
ensuring more accurate playback control.
[[1]](diffhunk://#diff-236979f75b937086a72522395304eefdd19108179da9b8a76fa32ed31032da12R102-R103)
[[2]](diffhunk://#diff-236979f75b937086a72522395304eefdd19108179da9b8a76fa32ed31032da12L139-R141)
[[3]](diffhunk://#diff-037ceecf6320e1a12857962f434b303715602833cd0f4209d1dd090fdc99d55eR134-R136)

### **Progress and Wavefrom progress control performance**

Improved the progress and waveform progress bar performance by **10x**
as previously the animations were slow and not adhereing to the pattern
that could make it fast.

These changes collectively modernize the audio attachment experience,
making it more robust and easier to maintain.
@Stream-SDK-Bot
Copy link
Contributor

Stream-SDK-Bot commented Dec 10, 2025

SDK Size

title develop branch diff status
js_bundle_size 302 KB 302 KB 0 B 🟢

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

frankcalise and others added 8 commits December 12, 2025 10:42
## 🎯 Goal

- Closes #3324

## 🛠 Implementation details

Applies the translated message text to the clipboard if available.
Otherwise, falls back to the original message text (which is the current
implementation).

## 🧪 Testing

While running a React Native app in development with the Metro Server,
make the same edits to
`node_modules/stream-chat-react-native-core/src/components/Message/hooks/useMessageActionHandlers.ts`
and follow the reproduction steps in the issue. You will see that after
the applied changes, the copied text matches expectations (the string
the user is reading), rather than the original untranslated text.

## ☑️ Checklist

- [x] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required)
- [x] 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 Android
## 🎯 Goal

<!-- Describe why we are making this change -->

## 🛠 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 Android
@isekovanic isekovanic closed this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants