Skip to content

Audio Refactor#1890

Open
ThomasSession wants to merge 45 commits intodevfrom
experiment/audio-playback
Open

Audio Refactor#1890
ThomasSession wants to merge 45 commits intodevfrom
experiment/audio-playback

Conversation

@ThomasSession
Copy link
Collaborator

Refactored the audio playback and included missing functionalities:

  • Can continue to listen to audio outside a conversation or outside the app
  • Can scrub/seek in the audio message bubble
  • Can cycle through playback speed: 1x, 1.5x, 2x, .5x
  • Updated UI audio message bubble
  • New Media notification
  • New mini player in conversation and home screen
Screenshot 2026-02-04 at 11 25 58 am

.distinctUntilChanged()
}

private fun ensureController(onReady: (MediaController) -> Unit) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method doesn't look async safe: is it possible to hit it twice quickly and you'll end up with two controller created?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep you're right I need to update this...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rewrite this method in coroutine? I think ListenableFuture and the main executor look like the thing we desperately wanted to get rid of before...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Media3 does return a ListenableFuture but I could build a wrapper, though I can't avoid the MediaController.Builder(context, token).buildAsync() return type

Copy link
Collaborator

Choose a reason for hiding this comment

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

I seem to remember ListenableFuture has a already had a coroutine extension but I could be wrong

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