Skip to content

Add auto-play consecutive voice messages in timeline#6454

Open
kalix127 wants to merge 4 commits intoelement-hq:developfrom
kalix127:feat/autoplay-consecutive-voice-messages
Open

Add auto-play consecutive voice messages in timeline#6454
kalix127 wants to merge 4 commits intoelement-hq:developfrom
kalix127:feat/autoplay-consecutive-voice-messages

Conversation

@kalix127
Copy link
Copy Markdown
Contributor

@kalix127 kalix127 commented Mar 24, 2026

Content

Add auto-play for consecutive voice messages in the timeline. When a voice message finishes playing, if the next chronological message is also a voice message, it automatically starts playing. The chain continues until a non-voice message is encountered or the end of the timeline is reached.

Key changes:

  • New VoiceMessageAutoplayManager interface (voiceplayer API) and DefaultVoiceMessageAutoplayManager implementation (voiceplayer impl, RoomScope singleton)
  • Manager observes MediaPlayer.state for isEnded transitions and triggers playback of the next consecutive voice message
  • VoiceMessagePresenter listens for reset requests and cancels autoplay on manual pause
  • TimelinePresenter feeds current timeline items to the autoplay manager on each update
  • Virtual items (day separators, read markers) are skipped when checking adjacency

Motivation and context

Closes #4618

This is a standard feature in almost every modern messaging app.

Screenshots / GIFs

Tests

    1. Send 2+ voice messages in a row in a test room
    1. Play the first one, when it ends, the next should auto-start
    1. Insert a text message between voice messages, autoplay should stop at the boundary
    1. During autoplay, manually tap pause, chain should stop
    1. During autoplay, tap a different voice message, chain should cancel and play the tapped one
    1. Replay the first voice message after a completed chain, autoplay should work again
    1. Scroll voice messages off-screen during autoplay, playback should continue unaffected

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 15

Checklist


Open questions

@jmartinesp

  1. Transition sound: Currently there is no sound effect played between consecutive voice messages during autoplay. Open to suggestions on whether we should add one (e.g. a short tick/beep) and if so, what would fit best.
  2. User setting: Autoplay is always enabled for now. Open to feedback on whether we should add an on/off toggle in user settings.

@kalix127 kalix127 requested a review from a team as a code owner March 24, 2026 10:41
@kalix127 kalix127 requested review from ganfra and removed request for a team March 24, 2026 10:41
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Mar 24, 2026
Copy link
Copy Markdown
Contributor

@bxdxnn bxdxnn left a comment

Choose a reason for hiding this comment

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

LGTM, but the common behavior is to also play a sound between messages before playing them.

@kalix127
Copy link
Copy Markdown
Contributor Author

LGTM, but the common behavior is to also play a sound between messages before playing them.

I know, in fact I asked for feedback and suggestions on which sound to use. Honestly, the options are endless.

@kalix127
Copy link
Copy Markdown
Contributor Author

In the meantime, I've added code to play a sound when it moves on to the next audio recording. Right now, it uses the same default notification sound, but all you have to do is replace it with a different sound, and then it's all set.

@americanrefugee , do you have any suggestions for a sound to use?
I've tried changing the notification sound in a few different ways, but with little success.

@americanrefugee
Copy link
Copy Markdown

@americanrefugee , do you have any suggestions for a sound to use?

Actually I think @amshakal would be a better person to ask since she reviewed the notification sounds in general recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-play voice messages, if there are multiple of them

3 participants