You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.0 KiB
26 lines
1.0 KiB
{# SPDX-License-Identifier: EUPL-1.2 #}
|
|
|
|
{% set known_video_types = {
|
|
"3gp":"video/3gpp",
|
|
"3g2":"video/3gpp2",
|
|
"avi":"video/x-msvideo",
|
|
"mpg":"video/mpeg",
|
|
"mpeg":"video/mpeg",
|
|
"mp4":"video/mp4",
|
|
"mov":"video/quicktime",
|
|
"ogv":"video/ogg",
|
|
"ts":"video/mp2t",
|
|
"qt":"video/quicktime",
|
|
"webm":"video/webm",
|
|
"wmv":"video/x-ms-wmv",
|
|
} %}
|
|
<video
|
|
class="img-fluid rounded d-block mx-auto{% if mode == "content" %} mb-5{% endif %}"
|
|
{% if image %} poster="{{ image|url }}" {% endif %}
|
|
{% if mode == "portfolio" %} autoplay muted loop {% else %} controls {% endif %}>
|
|
{% for source in (video is iterable and (not (video[1] starts with "video/") or ("." in video[1])) ? video : [video]) %}
|
|
{% set mime = (source is iterable) ? source[1] : known_video_types[source|split(".")|last] %}
|
|
<source src="{{ source is iterable ? source[0]|url : source|url }}" {% if mime %} type="{{ mime }}" {% endif %}>
|
|
{% endfor %}
|
|
Your browser does not support this video!
|
|
</video>
|
|
|