Repository navigation
feat(chat): rework playback of voice messages and audio files - #6840
minichhenoch-sir wants to merge 1 commit into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
2117395 to
595960c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
77b41721-d573-4d30-9e5d-f90fb74fb575
📒 Files selected for processing (5)
app/src/main/java/com/nextcloud/talk/chat/ChatActivity.ktapp/src/main/java/com/nextcloud/talk/chat/ui/model/ChatMessageUi.ktapp/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.ktapp/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.ktapp/src/main/java/com/nextcloud/talk/ui/chat/ChatView.kt
💤 Files with no reviewable changes (1)
- app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
595960c to
a49f1f9
Compare
|
Thank you @minichhenoch-sir , this looks pretty solid 👍 I wonder if we really want to have a shuffle feature. I dont see a usecase for a chat app that audiofiles are shuffled? @rapterjet2004 Can you also have a look? Esp as you did a lot of things regarding voice messages @minichhenoch-sir could you please let us know if it's okay that we take over e.g. for rebasing (and maybe fixing) or if you would like to do this? |
|
Thank you for testing and for the fix! Yes, you are welcome to take over the PR, for rebasing and any fixes. About shuffle: it is meant for people who are looking for an alternative to Telegram, where you can listen to music shared in chats. |
|
@rapterjet2004 Thanks for the review! Since you are welcome to take over, it would be great if you could include the change for account removal. |
Could you do this @rapterjet2004 ? |
|
@rapterjet2004 will take over. |
Audio messages were downloaded completely before playback, their state was mirrored into the chat messages and reset by list updates, taps on another message were ignored while one was playing, the speed button had no effect, and playback ignored audio focus and unplugged headphones. VoiceMessageMediaService now streams audio messages through the app's HTTP client into a size-limited disk cache and is the single source of truth for chat audio. It handles audio focus, becoming noisy, wake locks and retries after network errors, and exposes playback to the notification, the lock screen and headsets. Voice messages continue with the newer voice messages; audio files are played among the audio files of the conversation and can be shuffled and repeated. The service only accepts media items from Talk itself, and account credentials are only sent to the WebDAV files of that account. The chat and the conversation list observe the playback through ChatAudioPlayer, a MediaController that is connected while the screen is started. Tapping another message switches playback, seeking happens once a drag ends, and a player bar shows what is playing, also for another conversation. Tapping the bar opens a full player with seeking, previous and next, speed, shuffle, repeat and the list of queued items, scrolled to the current one. Speeds are kept per account and separately for voice messages and audio files, and are shared between screens. Opening the playing message, from the notification, the player bar or another chat, switches to its account and opens the thread it was played in. ChatAudioStore keeps durations, waveforms and the position of long recordings. Waveforms are computed from the cached file once the player has loaded it, so the file is not downloaded twice. Playback starts from the persisted position once the metadata is loaded. When an account is removed, by the user or by a remote wipe, playback of its audio is stopped and unloaded, and its metadata is deleted from memory and from the metadata cache. Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Marcel Hibbe <dev@mhibbe.de> Co-authored-by: rapterjet2004 <juliuslinus1@gmail.com> Signed-off-by: Henoch Minich <301610408+minichhenoch-sir@users.noreply.github.com> Signed-off-by: Marcel Hibbe <dev@mhibbe.de> Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
facd907 to
76f1d47
Compare
Problem:
It was not possible to keep listening to audio in the background, and the playback speed of voice messages could not be changed.
What changes:
Tested:
Xiaomi Pad 7 Pro – Android 16
M301 MP3 Player – Android 9
Issues: #6093, #6408
AI:
Code and tests were created with Claude Code (Claude Opus 5.5).
I tested it myself on Nextcloud Hub 26 Spring (35.0.1). I defined the behavior of the points above and tested it on several devices.
🖼️ Screenshots
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)