searxng/searx/templates/simple/result_templates/videos.html
Markus Heiser 464d1756f0 [mod] video result: replace HTML <iframe> by <video> tag
The HTML <video> tag reduces the bandwidth massively compared to the <iframe>.

When a video is embedded in a <iframe>, control over that video transfers to the
<iframe>.  The <iframe> downloads the entire video.  With the <video> tag,
control stays in the main frame and only the passages that the user chooses are
downloaded.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-02-19 14:24:37 +01:00

26 lines
1,006 B
HTML

{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
{{ result_header(result, favicons, image_proxify) }}
{{ result_sub_header(result) }}
{% if result.iframe_src -%}
<p class="altlink"> <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p>
{%- endif %}
{%- if result.content %}
<p class="content">
{{ result.content|safe }}
</p>
{%- else %}
<p class="content empty_element">
{{ _('This site did not provide any description.')|safe }}
</p>
{% endif -%}
</p>
{{- result_sub_footer(result, proxify) -}}
{% if result.iframe_src -%}
<div id="result-video-{{ index }}" class="embedded-video invisible">
<video controls>
<source src="{{result.iframe_src}}">
</video>
</div>
{%- endif %}
{{ result_footer(result) }}