-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Media Picker: Choose From Device: Fix Video thumbnails do not load #15411
Media Picker: Choose From Device: Fix Video thumbnails do not load #15411
Conversation
This is done to allow previewing files with content URI prototocol which are not detected as videos in MediaPreviewFragment using MediaUtils.isVideo method.
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can test the changes on this Pull Request by downloading the APKs: |
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.
@ashiagr - The code looks fine; however not all of my thumbnails load in the list. I see "Failed to load resource" glide errors.
I've attached a copy of my logcat + a video of what I am seeing in the app. I thought perhaps it was just large videos, but scrolling down and then PTR doesn't fix it.
screen-20211004-134523.mp4
@zwarm, I checked it briefly. I have smaller videos on my test device so wasn't able to notice it. For one of the failing videos , I noticed length of the file was While restricting previews based on video size is not an ideal solution, this PR only adds additional support for local videos with content URIs otherwise none of the local videos can be previewed in the media grid. Regarding the
I wasn't able to fix it + failing test today. I'll ping you again as soon as I'm able to work on it. Thank you so much, for testing it out! 🙏 |
@ashiagr - Since this PR only addresses the URI issue, should we create a new issue for files over 10MB concentrating on choosing between not showing thumbnails at or or showing a message that they are too large? I don't have the answer, but would love to open it for discussion. I'll retest when you are ready. Thanks. :) |
…ide resource not found issue
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.
Thank you @ashiagr . All is working as expected - no more glide error. Thanks for pulling together a new issue for the thumbnail.
Fixes #14618 & #15306
This PR displays thumbnails for local videos having URLs with content URI protocol, detects them as videos, and plays them on the media preview screen.
VideoLoader
did not take into consideration local videos with content URI protocol when checking for media size, and when such URLs were passed to it, it failed withMalformedURLException
. To address this, file size for such files is checked according to the suggested approach in 258f726.Real path for local URI is passed in 983b21b so that they get detected as videos in
MediaPreviewFragment
viaMediaUtils.isVideo
otherwise they were displayed as images.Once detected as local videos, they're played using
ExoPlayer
adjustments for local videos in 46e6aeb.To test:
Regression Notes
Potential unintended areas of impact
VideoLoader
is used for both remote and local videosWhat I did to test those areas of impact (or what existing automated tests I relied on)
Tested manually that thumbnails for local as well remote videos are loaded properly and videos gets played as well
What automated tests I added (or what prevented me from doing so)
None
PR submission checklist:
RELEASE-NOTES.txt
if necessary.