Skip to content
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

Add voice message playback from the timeline #1844

Merged
merged 19 commits into from
Oct 4, 2023

Conversation

nimau
Copy link
Contributor

@nimau nimau commented Oct 2, 2023

This PR adds the ability to listen to voice messages from a timeline item ( (part of the Voice Messages feature)

Here is a brief explanation of this implementation:

  • When a playback action is sent to the RoomTimelineController, an AudioPlayer is attached (if necessary) to the corresponding timeline item via its AudioPlayerState
  • There is only one AudioPlayer instantiated, and its state is restored when it is attached.
  • A basic cache AudioCacheManager has been implemented, which is currently cleared when the MediaPlayerProvider instance is deinitialised (.i.e when we exit the room screen). This will probably change when the recording feature is implemented.
  • This cache can contain the ogg file and its converted version (m4a), and these temporary files use the media source url as identifier.

In order not to affect performance when rendering the timeline, voice messages are not pre-loaded (and no conversion to m4a is performed until we need it).
For a 5-minute voice message, the time taken to convert it the first time is around 1 second.

@nimau nimau requested a review from a team as a code owner October 2, 2023 07:51
@nimau nimau requested review from stefanceriu and removed request for a team October 2, 2023 07:51
@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Warnings
⚠️ This pull request seems relatively large. Please consider splitting it into multiple smaller ones.
⚠️ Please add a changelog.
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against 970769c

@nimau nimau marked this pull request as draft October 2, 2023 07:54
@nimau nimau removed the request for review from stefanceriu October 2, 2023 07:54
@nimau nimau marked this pull request as ready for review October 2, 2023 08:01
@stefanceriu stefanceriu self-requested a review October 2, 2023 10:32
@nimau nimau requested a review from stefanceriu October 4, 2023 11:12
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks and works great, nicely done! 👏👏👏

@nimau nimau force-pushed the nicolas/voice-messages-timeline-playback branch from 163e2df to 970769c Compare October 4, 2023 16:07
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.3% 0.3% Duplication

@nimau nimau enabled auto-merge (squash) October 4, 2023 16:14
@nimau nimau merged commit 82abd0a into develop Oct 4, 2023
@nimau nimau deleted the nicolas/voice-messages-timeline-playback branch October 4, 2023 16:32
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.

2 participants