--- a/src/pyams_media/zmi/templates/video-thumbnail.pt Tue Sep 08 16:21:33 2015 +0200
+++ b/src/pyams_media/zmi/templates/video-thumbnail.pt Tue Sep 08 16:22:46 2015 +0200
@@ -10,9 +10,17 @@
<video
tal:define="href extension:absolute_url(context);
thumbnails extension:thumbnails(context);
+ conversions extension:conversions(context);
size thumbnails.get_image_size();"
- tal:attributes="poster string:${href}/++thumb++${size[0]}x${size[1]}">
- <source type="video/mp4"
- tal:attributes="src href" />
+ tal:attributes="poster string:${href}/++thumb++${size[0]}x${size[1]}.png">
+ <tal:loop repeat="conversion conversions.get_conversions(order=('video/webm','video/mp4','video/x-flv'))">
+ <source type="video/mp4"
+ tal:define="media_width conversions.get_conversion_width(conversion.__name__);
+ video_type extension:video_type(conversion);"
+ tal:condition="video_type"
+ tal:attributes="type video_type;
+ src extension:absolute_url(conversion);
+ media 'all and (max-width: {0[0]}px)'.format(media_width) if media_width else None;" />
+ </tal:loop>
</video>
</div>