-
Notifications
You must be signed in to change notification settings - Fork 1.3k
issue/6572-local-video-thumb #6577
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
Conversation
} | ||
} | ||
|
||
private void loadLocalVideoThumbnail(final String filePath, final WPNetworkImageView imageView) { |
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.
Would you mind to investigate if ImageUtils.getVideoFrameFromVideo
can be used in this case?
We're using it in Aztec and it seems to work very fine for both remote and local videos.
if (isLocalFile) { | ||
loadLocalVideoThumbnail(media.getFilePath(), holder.imageView); | ||
} else { | ||
holder.imageView.setImageUrl(media.getThumbnailUrl(), WPNetworkImageView.ImageType.VIDEO); |
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.
media.getThumbnailUrl()
seems to return null
for self hosted sites. ImageUtils.getVideoFrameFromVideo
should load the frame from the network instead. Note that's a blocking routine.
@daniloercoli Good call on using |
I noticed a wrong thumb picture is shown on the screen as soon as the video is uploaded.
|
I wasn't able to repro that, but I suspect it was due to me not clearing the existing bitmap before retrieving it (which can cause incorrect images to appear from recycled views). Fixed in 56f538c |
Setting the bitmap to |
Fixes #6572 - the media browser now shows a thumbnail for local videos (ie: videos that are still uploading).
Note that this fix uncovers a separate issue: after the video is uploaded, we don't immediately have the thumbnail URL from the backend, so it shows as blank in the media browser after the upload completes.
cc: @daniloercoli