diff --git a/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php b/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php index 0f8f5131f1..1760910b45 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php @@ -43,6 +43,7 @@ class TooltipController extends Controller { return $this->render('prod/Tooltip/Preview.html.twig', [ 'record' => new \record_adapter($this->app, $sbas_id, $record_id), + 'autoplay' => true, 'not_wrapped' => true ]); } diff --git a/templates/web/common/preview.html.twig b/templates/web/common/preview.html.twig index 208cd8daa5..b607d6d017 100644 --- a/templates/web/common/preview.html.twig +++ b/templates/web/common/preview.html.twig @@ -7,6 +7,12 @@ {% set wrap = true %} {% endif %} +{% if autoplay is defined and autoplay %} + {% set autoplay = true %} +{% else %} + {% set autoplay = false %} +{% endif %} + {% set previewHtml5 = null %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') %} @@ -18,4 +24,4 @@ {% 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) }} +{{ thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', wrap, false, autoplay) }} diff --git a/templates/web/common/thumbnail.html.twig b/templates/web/common/thumbnail.html.twig index 4b8fcb0011..923205e8a5 100644 --- a/templates/web/common/thumbnail.html.twig +++ b/templates/web/common/thumbnail.html.twig @@ -1,4 +1,4 @@ -{% macro format(thumbnail, box_w, box_h, extra_class, wrap, lazyload) %} +{% macro format(thumbnail, box_w, box_h, extra_class, wrap, lazyload, autoplay) %} {% set record_type = thumbnail.get_type() %} {% set box_w = box_w|round %} {% set box_h = box_h|default(box_w)|round %} @@ -10,15 +10,15 @@ {% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} {% elseif record_type == 'FLEXPAPER' %} {% elseif record_type == 'AUDIO_MP3' %} {% else %} {#