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

[Voice Broadcast] Update buffering display and improve playback #7655

Merged
merged 9 commits into from
Nov 29, 2022

Conversation

Florian14
Copy link
Contributor

@Florian14 Florian14 commented Nov 29, 2022

Type of change

  • WIP Feature
  • Bugfix
  • Technical
  • Other :

Content

  • Move the buffering view to the timeline header
  • Display the pause button when the voice broadcast is buffering to let the user stop the buffering
  • Some UI adjustments (padding, colors)
  • Fixed playback issues

Motivation and context

Design changes:

image

Screenshots / GIFs

Tests

  1. Start recording a VB from device A
  2. Start listening to the VB from device B
  3. Observe that the buffering is displayed as expected while waiting for a new chunk
  4. Verify that the pause button work as expected during the buffering

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

Base automatically changed from bugfix/fre/fix_playback_stuck_in_buffering to develop November 29, 2022 08:59
@Florian14 Florian14 marked this pull request as draft November 29, 2022 10:23
@Florian14 Florian14 added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Nov 29, 2022
@Florian14 Florian14 marked this pull request as ready for review November 29, 2022 13:13
@Florian14 Florian14 force-pushed the feature/fre/voice_broadcast_buffering branch from 067f72e to 42b3ecc Compare November 29, 2022 13:14
@Florian14 Florian14 requested review from a team and ganfra and removed request for a team November 29, 2022 13:14
@Florian14 Florian14 changed the title [Voice Broadcast] Update buffering display [Voice Broadcast] Update buffering display and improve playback Nov 29, 2022
@sonarcloud
Copy link

sonarcloud bot commented Nov 29, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Some small questions, otherwise LGTM

@@ -110,21 +111,23 @@ class AudioMessagePlaybackTracker @Inject constructor() {

fun getPlaybackState(id: String) = states[id]

fun getPlaybackTime(id: String): Int {
fun getPlaybackTime(id: String): Int? {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why those changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For Voice Broadcast, I need to distinguish a paused playback at 0sec from another which has no saved position, so I decided to return null in that case. The first time we play a voice broadcast which is live, the user should automatically jump to the last chunk, if he decided to manually scroll in the seekBar, the playback will start from that position (eg. 0 sec)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, maybe a sealed class would have been cleaner, but ok!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reused this object, I agree there are several things to improve: having the recording in the states list is a bit weird, same about having a percentage but not the duration, and like you said we don't really need this method and could have it in the sealed class (which already exists)

import android.widget.LinearLayout
import im.vector.app.databinding.ViewVoiceBroadcastBufferingBinding

class VoiceBroadcastBufferingView @JvmOverloads constructor(
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no binding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, I don't really need to manipulate this custom view from code, it's just for consistency with the other metadata which are icon+text and not progress+text

@Florian14 Florian14 merged commit 5560694 into develop Nov 29, 2022
@Florian14 Florian14 deleted the feature/fre/voice_broadcast_buffering branch November 29, 2022 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants