-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: Audio Message not being send with correct mimeType (WPB-3534) #2029
fix: Audio Message not being send with correct mimeType (WPB-3534) #2029
Conversation
val mimeType = if (audioPath != null) AUDIO_MIME_TYPE else attachmentUri | ||
.getMimeType(context) | ||
.orDefault(DEFAULT_FILE_MIME_TYPE) |
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.
This part specifically, if we go by getMimeType(..)..
it would render as a VIDEO
file due to its current mimeType
being video/mp4
despite having only audio and no video data due to the way MediaRecorder
creates the file.
Build 777 failed. |
Build 778 failed. |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 779 succeeded. The build produced the following APK's: |
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.
Nicely done 👍 Just one comment about adding one more test
app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelTest.kt
Show resolved
Hide resolved
app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModel.kt
Outdated
Show resolved
Hide resolved
Build 788 failed. |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 789 failed. |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 794 succeeded. The build produced the following APK's: |
Build 799 succeeded. The build produced the following APK's: |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Audio messages sent from Android would play on another Android device or Web, but not on iOS devices.
Causes (Optional)
We have 3 ways to send audio messages:
When sending from the recording feature, due to using
MediaRecorder
the end file mimeType resolves intovideo/mp4
and notaudio/mp4
, this doesn't occur when sending an audio message from other flows.Solutions
Unify sending/handling asset (normal asset and audio asset) with its respective Bundle classes and if it is an Audio asset, then we force its mimeType to
audio/mp4
with extension as.m4a
so its playable in all platforms.Testing
Test Coverage (Optional)
How to Test