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

Auto play consecutive audio messages, prefetch audio messages, show fetched audio durations, temporarily mark as listened audio messages, fixed a bug to listen last second of audio message #4549

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Ruggero1912
Copy link
Contributor

@Ruggero1912 Ruggero1912 commented Dec 16, 2024

🖼️ Screenshots

🏚️ Before 🏡 After
B A
YT demo before changes YT demo after changes

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

Changes

  • prefetch audio messages, show fetched audio durations: when an audio is played, the former and latter 5 messages are fetched from the server if are not present locally, and their duration is computed and shown.
  • temporarily mark as listened audio messages: when the mediaplayer position is after the 5% of the voice message duration, set a boolean in ChatMessage class wasPlayedVoiceMessage, the background color of the voice message bubble is updated.
  • fixed a bug to listen last second of audio message: pos = mediaPlayer!!.currentPosition / VOICE_MESSAGE_SEEKBAR_BASE in the runnable of the mediaPlayerHandler defined in startPlayback method of ChatActivity was an integer before, and the check pos < (mediaPlayer!!.duration / VOICE_MESSAGE_SEEKBAR_BASE) returned false in cases such as currentPosition was 9.1 seconds and mediaPlayer.duration was 9.9 seconds. This led to not playing the last part of voice messages.
  • Auto play consecutive audio messages: if the played voice message has a consecutive voice message, it will be played after the current one

@Ruggero1912 Ruggero1912 marked this pull request as ready for review December 16, 2024 00:17
…udio message whose duration is 5.9 seconds was played for 5 seconds

Signed-off-by: Giacomo Pacini <[email protected]>
…if any, computes their durations and starts playing the next one at the end of the current. Plays a doodle between them

Signed-off-by: Giacomo Pacini <[email protected]>
Signed-off-by: Giacomo Pacini <[email protected]>
@AndyScherzinger AndyScherzinger added enhancement New feature or request 3. to review Waiting for reviews labels Dec 16, 2024
@AndyScherzinger AndyScherzinger added this to the 21.0.0 milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants