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): def __init__(self, options):
# assuming string # assuming string
if not isinstance(options, dict): if not isinstance(options, dict):
options = {"video": options} options = {"name": options}
# used for caching, if it's modified -> regenerate # used for caching, if it's modified -> regenerate
self.options = SETTINGS["ffmpeg"].copy() self.options = SETTINGS["ffmpeg"].copy()
self.options.update(options) self.options.update(options)

View File

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

View File

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

View File

@ -25,7 +25,7 @@
<video autoplay loop muted class="fillWidth"> <video autoplay loop muted class="fillWidth">
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm"> <source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video> </video>
<img class="lazy" src="{{ video.generate_thumbnail("2000") }}"> <img class="lazy full-picture" src="{{ video.generate_thumbnail("2000") }}">
</div> </div>
</section> </section>
{% else %} {% 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> <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"> <source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video> </video>
{% set video = "" %}
{% else %} {% else %}
<a href="{{ image }}" {% if caption %}data-caption="{{ caption }}"{% endif %}> <a href="{{ image }}" {% if caption %}data-caption="{{ caption }}"{% endif %}>
<img class="lazy" src="" data-original="{{ image.generate_thumbnail("x600") }}" alt=""> <img class="lazy" src="" data-original="{{ image.generate_thumbnail("x600") }}" alt="">