-
Notifications
You must be signed in to change notification settings - Fork 290
feat: introduce centralized audio playback #2880
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
Open
MartinCupela
wants to merge
7
commits into
master
Choose a base branch
from
feat/central-audio-reproduction-control
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…h the same asset url
|
Size Change: +11.6 kB (+0.98%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
…hen no player is available
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2880 +/- ##
==========================================
- Coverage 81.55% 81.05% -0.50%
==========================================
Files 499 506 +7
Lines 10105 10352 +247
Branches 2310 2366 +56
==========================================
+ Hits 8241 8391 +150
- Misses 1744 1838 +94
- Partials 120 123 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
Closes REACT-597
This PR is introducing
useAudioPlayerhook to SDK components that replacesuseAudioControllerhook. All the audio playback is centralized when usinguseAudioPlayer. The originaluseAudioControllerhook has been deprecated but still exported. Should be removed with the next major release.For proper cleanup component
WithAudioPlaybackhas been introduced. It removes all the subscriptions and audio elements when unmounted. It is rendered within theChannelcomponent. That means that upon navigation to another channel, the audio is stopped, event listeners removed, state subscriptions unsubscribed and audio elements are removed from the pool to allow them to be garbage collected.The integrators have available the following utilities:
useAudioPlayerWithAudioPlayback🛠 Implementation details
I had to introduce message context dependency to attachment widgets
Audio,Card,VoiceRecordingPlayerin order to be able to provide separate audio resource to each widget even though the widget request playback of the same asset URL.The component props have not been changed.
Out of scope
Support for a single audio provider that would expose API to share the audio element among any number of audio widgets.
🎨 UI Changes
No changes