mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
32 lines
1.0 KiB
Twig
32 lines
1.0 KiB
Twig
|
|
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
|
|
|
{% if not_wrapped is defined and not_wrapped %}
|
|
{% set wrap = false %}
|
|
{% else %}
|
|
{% set wrap = true %}
|
|
{% endif %}
|
|
|
|
{% if autoplay is defined and autoplay %}
|
|
{% set autoplay = true %}
|
|
{% else %}
|
|
{% set autoplay = false %}
|
|
{% endif %}
|
|
|
|
{% set previewHtml5 = null %}
|
|
|
|
{# first check if type audio and there is no preview , fallback to thumbnail #}
|
|
|
|
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') and record.getType == 'audio' and record.has_preview == false %}
|
|
{% set preview_obj = record.get_thumbnail() %}
|
|
{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') %}
|
|
{% set preview_obj = record.get_preview() %}
|
|
{% else %}
|
|
{% set preview_obj = record.get_thumbnail() %}
|
|
{% endif %}
|
|
|
|
{% set width = preview_obj.get_width() %}
|
|
{% set height = preview_obj.get_height() %}
|
|
|
|
{{ thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', wrap, false, autoplay) }}
|