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 %}
{#
- Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
- This software is released under the MIT License
-*/
-var audioplayer_swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("