WordPress-Android
WordPress-Android copied to clipboard
[MediaPreview] Calculate media type of content URI by omitting query params
I noticed that if URLs passed to MediaViewFragment contain query parameters, it doesn't calculate properly the media type (i.e. if it's an image, a video, or an audio file). This is caused because the isVideo and isAudio don't expect a URL with query parameters. In order to solve this, I updated the logic to extract only the last segment of the URL's path (similar to what we do here).
To test: [TBD]
Regression Notes
-
Potential unintended areas of impact [TBD]
-
What I did to test those areas of impact (or what existing automated tests I relied on) [TBD]
-
What automated tests I added (or what prevented me from doing so) [TBD]
PR submission checklist:
- [ ] I have completed the Regression Notes.
- [ ] I have considered adding accessibility improvements for my changes.
- [ ] I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txtif necessary.
UI Changes testing checklist:
- [ ] Portrait and landscape orientations.
- [ ] Light and dark modes.
- [ ] Fonts: Larger, smaller and bold text.
- [ ] High contrast.
- [ ] Talkback.
- [ ] Languages with large words or with letters/accents not frequently used in English.
- [ ] Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
- [ ] Large and small screen sizes. (Tablet and smaller phones)
- [ ] Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
| App Name | WordPress |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr18408-2c1ba2d | |
| Commit | 2c1ba2dc47ec41dcf816f39a34a11a5e6620dd70 | |
| Direct Download | wordpress-prototype-build-pr18408-2c1ba2d.apk |
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
| App Name | Jetpack |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr18408-2c1ba2d | |
| Commit | 2c1ba2dc47ec41dcf816f39a34a11a5e6620dd70 | |
| Direct Download | jetpack-prototype-build-pr18408-2c1ba2d.apk |
@fluiddot, is this PR still necessary?
@fluiddot, is this PR still necessary?
This fix is mainly needed in case we pass query parameters in the video URL, as I explored doing in https://github.com/Automattic/jetpack/pull/30630. However, since we took a different approach I think we can close it.