-
Notifications
You must be signed in to change notification settings - Fork 171
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
Enable seeking a recorded voice message #1758
Conversation
@@ -323,6 +340,7 @@ class VoiceMessageComposerPresenterTest { | |||
awaitItem().eventSink(VoiceMessageComposerEvents.PlayerEvent(VoiceMessagePlayerEvent.Play)) | |||
awaitItem().eventSink(VoiceMessageComposerEvents.SendVoiceMessage) | |||
assertThat(awaitItem().voiceMessageState).isEqualTo(aPlayingState().toSendingState()) | |||
skipItems(1) // Duplicate sending state |
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 needed to add this after this change but couldn't get to the bottom of why. The state
flow still emits the exact same values in this test.
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
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.
Sorry if I'm being pedantic with changes to MediaPlayer
.
The intent is to try to keep it as slim and simple as possible because that's the part which interfaces with the ExoPlayer beast which is missing tests.
So the more stuff we add here the more undetected issues we might have in the future.
We should probably think of building some tests so we can more freely enhance MediaPlayer but it is potentially cumbersome (currently in the tech debt list).
...diaplayer/impl/src/main/kotlin/io/element/android/libraries/mediaplayer/impl/SimplePlayer.kt
Outdated
Show resolved
Hide resolved
...diaplayer/impl/src/main/kotlin/io/element/android/libraries/mediaplayer/impl/SimplePlayer.kt
Outdated
Show resolved
Hide resolved
...player/impl/src/main/kotlin/io/element/android/libraries/mediaplayer/impl/MediaPlayerImpl.kt
Outdated
Show resolved
Hide resolved
...player/impl/src/main/kotlin/io/element/android/libraries/mediaplayer/impl/MediaPlayerImpl.kt
Outdated
Show resolved
Hide resolved
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #1758 +/- ##
===========================================
+ Coverage 63.36% 63.40% +0.03%
===========================================
Files 1292 1292
Lines 33502 33568 +66
Branches 6971 6981 +10
===========================================
+ Hits 21230 21284 +54
- Misses 9086 9088 +2
- Partials 3186 3196 +10
☔ View full report in Codecov by Sentry. |
1120862
to
5a41a4e
Compare
94a9efa
to
93cb444
Compare
Kudos, SonarCloud Quality Gate passed! |
import java.io.File | ||
import kotlin.time.Duration | ||
|
||
@Immutable |
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.
Just for my info: What does this do? I mean, what wasn't working well before that prompted you to add this?
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.
|
||
private suspend fun MediaPlayer.ensureMediaReady(mediaPath: String): MediaPlayer.State { | ||
val state = state.value | ||
if (state.mediaId == mediaPath && state.isReady) { |
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.
Sorry about not checking for this properly in the MediaPlayer. I've opened this: #1783
Type of change
Content
Enable seeking the voice message player after recording a voice message.
Motivation and context
Screenshots / GIFs
Screen_recording_20231107_162647.webm
Tests
Tested devices
Checklist