-
Notifications
You must be signed in to change notification settings - Fork 731
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
Conversation
067f72e
to
42b3ecc
Compare
SonarCloud Quality Gate failed. |
There was a problem hiding this 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? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why those changes?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no binding?
There was a problem hiding this comment.
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
Type of change
Content
pause
button when the voice broadcast is buffering to let the user stop the bufferingMotivation and context
Design changes:
Screenshots / GIFs
Tests
Tested devices
Checklist