diff --git a/templates/web/common/preview.html.twig b/templates/web/common/preview.html.twig index 0dba1f0cfd..90898e454c 100644 --- a/templates/web/common/preview.html.twig +++ b/templates/web/common/preview.html.twig @@ -15,7 +15,11 @@ {% set previewHtml5 = null %} -{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') and record.has_preview == true %} +{# 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() %}