aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/archivalook
diff options
context:
space:
mode:
authorMichael McMahon <michael@fsf.org>2021-09-20 14:09:59 +1000
committerBen Sturmfels <ben@sturm.com.au>2021-09-20 14:23:06 +1000
commitbc2990c2794e625842fd1c54c40ae2b0cdb4be3d (patch)
tree57b0400d2dbb5079fee3149d7595c7c03806e060 /mediagoblin/plugins/archivalook
parentde60546e349cad5829c5bd86b0bdce33bde54d86 (diff)
downloadmediagoblin-bc2990c2794e625842fd1c54c40ae2b0cdb4be3d.tar.lz
mediagoblin-bc2990c2794e625842fd1c54c40ae2b0cdb4be3d.tar.xz
mediagoblin-bc2990c2794e625842fd1c54c40ae2b0cdb4be3d.zip
Set videos to preload="metadata" to prevent upfront download [trac#5625].
Setting was previously preload="auto". While preload="auto" *does not* cause a full upfront download on Firefox, Abrowser, IceCat or Chromium, a user reported on the LibrePlanet mailing list that it was causing a full download on their browser. The specifications leave it up to the browser do decide whether to download, but it makes sense to do what we can to avoid surprising people on low bandwidth/quota internet connections. https://html.spec.whatwg.org/multipage/media.html#attr-media-preload Further, media.libreplanet.org (one of MediaGoblin's biggest users) has implement this change locally, so it makes sense for us to stay in sync. Signed-off-by: Ben Sturmfels <ben@sturm.com.au>
Diffstat (limited to 'mediagoblin/plugins/archivalook')
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html8
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html6
2 files changed, 7 insertions, 7 deletions
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html
index 64976257..58d8c549 100644
--- a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html
@@ -32,7 +32,7 @@
{%- set display_type, display_path = media.get_display_media() %}
<video controls
{% if global_config['plugins']['mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
- preload="auto" class="video-js vjs-default-skin">
+ preload="metadata" class="video-js vjs-default-skin">
<source src="{{ request.app.public_store.file_url(display_path) }}"
{% if media.media_data %}
type="{{ media.media_data.source_type() }}"
@@ -41,13 +41,13 @@
{% endif %} />
<div class="no_html5">
{%- trans -%}Sorry, this video will not work because
- your web browser does not support HTML5
+ your web browser does not support HTML5
video.{%- endtrans -%}<br/>
- {%- trans -%}You can get a modern web browser that
+ {%- trans -%}You can get a modern web browser that
can play this video at <a href="http://getfirefox.com">
http://getfirefox.com</a>!{%- endtrans -%}
</div>
</video>
- </div>
+ </div>
{{ possibly_shortened_description(request, feature.media_entry) }}
</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html
index 92a44d49..0d3a1adc 100644
--- a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html
@@ -32,7 +32,7 @@
{%- set display_type, display_path = media.get_display_media() %}
<video controls
{% if global_config['plugins']['mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
- preload="auto" class="video-js vjs-default-skin">
+ preload="metadata" class="video-js vjs-default-skin">
<source src="{{ request.app.public_store.file_url(display_path) }}"
{% if media.media_data %}
type="{{ media.media_data.source_type() }}"
@@ -41,9 +41,9 @@
{% endif %} />
<div class="no_html5">
{%- trans -%}Sorry, this video will not work because
- your web browser does not support HTML5
+ your web browser does not support HTML5
video.{%- endtrans -%}<br/>
- {%- trans -%}You can get a modern web browser that
+ {%- trans -%}You can get a modern web browser that
can play this video at <a href="http://getfirefox.com">
http://getfirefox.com</a>!{%- endtrans -%}
</div>