Commit 145b9f4d authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Explicitly call load() on video elements when generating thumbnails.

The image loader used by the Files App relies on setting the preload
attribute on a video element to trigger it loading some content to use
as a thumbnail. In some circumstances (e.g. data saver), preload is
ignored for video elements.

Invoke load() on the video element explicitly to ensure it loads the
video.

Bug: 888962
Change-Id: I2114bbb36feac3eafbb90cae2babd67d93247a25
Reviewed-on: https://chromium-review.googlesource.com/c/1301053Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603012}
parent d9dcfa78
...@@ -330,6 +330,7 @@ ImageRequest.prototype.createVideoThumbnailUrl_ = function(url) { ...@@ -330,6 +330,7 @@ ImageRequest.prototype.createVideoThumbnailUrl_ = function(url) {
video.currentTime = ImageRequest.VIDEO_THUMBNAIL_POSITION; video.currentTime = ImageRequest.VIDEO_THUMBNAIL_POSITION;
video.preload = 'auto'; video.preload = 'auto';
video.src = url; video.src = url;
video.load();
}), }),
new Promise((resolve) => { new Promise((resolve) => {
setTimeout(resolve, ImageRequest.MAX_MILLISECONDS_TO_LOAD_VIDEO); setTimeout(resolve, ImageRequest.MAX_MILLISECONDS_TO_LOAD_VIDEO);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment