video index

This commit is contained in:
Adrien Beudin 2016-05-06 09:37:24 +02:00
parent d2f1fc8212
commit feed72fa26
5 changed files with 9 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class Video(object):
def __init__(self, options):
# assuming string
if not isinstance(options, dict):
options = {"video": options}
options = {"name": options}
# used for caching, if it's modified -> regenerate
self.options = SETTINGS["ffmpeg"].copy()
self.options.update(options)

View File

@ -252,3 +252,8 @@ nav ul li > a.item-menu::before {
letter-spacing: 3px;
font-style: normal;
}
.gallery-cover video.fillWidth,
.gallery-cover img.fillWidth {
height: 100%;
}

View File

@ -32,11 +32,11 @@
{% endif %}
{% if video %}
<div class="gallery-cover">
<img src="{{ video.generate_thumbnail("900") }}">
<video autoplay loop muted class="fillWidth">
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video>
</div>
{% set video = "" %}
{% else %}
<div class="gallery-cover" style="background-image: url('{{ cover.generate_thumbnail("x900") }}');"></div>
{% endif %}

View File

@ -25,7 +25,7 @@
<video autoplay loop muted class="fillWidth">
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video>
<img class="lazy" src="{{ video.generate_thumbnail("2000") }}">
<img class="lazy full-picture" src="{{ video.generate_thumbnail("2000") }}">
</div>
</section>
{% else %}

View File

@ -19,6 +19,7 @@
<video class="lazy" id="video" poster="{{ video.generate_thumbnail("600") }}" alt="" autoplay="autoplay" loop="loop" preload="auto" muted>
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video>
{% set video = "" %}
{% else %}
<a href="{{ image }}" {% if caption %}data-caption="{{ caption }}"{% endif %}>
<img class="lazy" src="" data-original="{{ image.generate_thumbnail("x600") }}" alt="">