- Issue created by @xax
- 🇬🇧United Kingdom xax London, UK
Additional info: after I added playsinline in the twig, I discovered that now my phone etc worked great, but lap- and desktops now didn't autoplay anymore.. I have solved this leveraging bootstrap in the twig (see below) - but I assume there may be a more elegant javascript way adding 'playsilne' only when mobile/tablet detected -
{# mobile / ipad #} <div class="d-block d-md-none"> <video preload="{{ player_attributes.preload }}" {{ player_attributes.controls ? 'controls' : '' }} style="width:{{ player_attributes.width }}px;height:{{ player_attributes.height }}px;" {{ player_attributes.autoplay ? 'autoplay' : '' }} {{ player_attributes.loop ? 'loop' : '' }} {{ player_attributes.muted ? 'muted' : '' }} playsinline> {% for user in items %} <source src="{{ user }}"/> {% endfor %} </video> </div> {# larger than mobile #} <div class="d-none d-md-block"> <video preload="{{ player_attributes.preload }}" {{ player_attributes.controls ? 'controls' : '' }} style="width:{{ player_attributes.width }}px;height:{{ player_attributes.height }}px;" {{ player_attributes.autoplay ? 'autoplay' : '' }} {{ player_attributes.loop ? 'loop' : '' }} {{ player_attributes.muted ? 'muted' : '' }} > {% for user in items %} <source src="{{ user }}"/> {% endfor %} </video> </div>