-
Notifications
You must be signed in to change notification settings - Fork 360
feat: manage audio centrally in the SDK #3288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ve into feat/manage-audio-centrally
SDK Size
|
|
Hey @oliverlaz @isekovanic, this has been open since last 3 weeks. Can we merge it if it looks good? Thanks 😄 |
isekovanic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ! This looks good to me, apart from the couple of remarks I have.
Please make sure that everything is backwards compatible as well since we don't want to break things, but other than that I think it's a step in the right direction. It seems easy to use by both us and integrators.
Indeed its backward compatible. I have added deprecated label for the once that are gonna be removed in next version but for now they still exist in code. |
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
allowConcurrentAudioPlaybackprop of the Channel component wherefalseis the new default. This behaviour is done in parity with React SDK and as per decision.Audio Attachment Component Refactor and State Management Improvements
useAudioPlayerControlanduseStateStore, removing the need for deprecated callback props likeonLoad,onPlayPause, andonProgress. [1] [2]isPlaying,progress,duration,currentPlaybackRate) for rendering controls, progress bars, and playback speed, replacing legacy props and local state. [1] [2] [3] [4] [5]Voice Recording and Audio Attachment Handling
isVoiceRecordingAttachmenthelper, ensuring correct duration and title display, and simplifying logic for both audio and voice recording types. [1] [2]File Attachment Group Updates
onLoad,onProgress) inFileAttachmentGroup, updating documentation and usage to encourage migration to the new state management approach. Also addedmessageprop for better context handling. [1] [2] [3]Native and Expo Audio Player Integration
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.