templates/Includes/video-area.html.twig line 1

Open in your IDE?
  1. <section class="content-block container container-sm js-fade-in {{ styleModifier | default(null) }} {{ anchorNavItem | default(null) ? 'js-anchor-nav__item' : '' }}"
  2.     {% if anchorNavItem | default(null) and anchorNavTitle | default(null) %}
  3.     data-anchor-nav-title="{{ anchorNavTitle }}"
  4.     {% endif %}>
  5.     {{ include('Includes/title-block.html.twig', {
  6.         title: title|default(''),
  7.         subtitle: subtitle|default(''),
  8.         isCentered: true,
  9.     }) }}
  10.     {% set videoStyleModifier = 'embed-responsive-item' %}
  11.     {% set video = getVideoEditable(video) %}
  12.     {% if video %}
  13.         {% if video.videoType|default('') != 'asset' %}
  14.             
  15.             {% set src = '' %}
  16.             {% if video.videoType == 'youtube' %}
  17.                 {% set src = 'https://www.youtube.com/embed/' %}
  18.             {% elseif video.videoType == 'vimeo' %}
  19.                 {% set src = 'https://player.vimeo.com/video/' %}
  20.             {% elseif video.videoType == 'dailymotion' %}
  21.                 {% set src = 'https://www.dailymotion.com/embed/video/' %}
  22.             {% endif %}
  23.             {% set src = src ~ video.id %}
  24.             <div class="video-area__video embed-responsive embed-responsive-16by9 js-consent-overlay" data-consent-type="marketing">
  25.                 <div class="js-consent-overlay__overlay consent-overlay embed-responsive-item bg-light-bg d-flex justify-content-center flex-column align-items-center">
  26.                     {{ 'cookies.accept-cookies-to-show-video' |trans }}
  27.                     <button type="button" class="btn btn-primary-light mt-4 js-consent-overlay__btn">
  28.                         {{ 'cookies.accept-marketing-cookies' |trans }}
  29.                     </button>
  30.                 </div>
  31.                 
  32.                 <iframe class="embed-responsive-item js-consent-overlay__iframe"
  33.                         src=""
  34.                         frameborder="0"
  35.                         data-iframe-src="{{ src }}"
  36.                         allowfullscreen>
  37.                 </iframe>
  38.             </div>
  39.         {% else %}
  40.             <div class="video-overlay__wrapper js-play-video">
  41.                 <div class="video-overlay embed-responsive embed-responsive-16by9 js-play-video__overlay">
  42.                     <span class="icon icon-play video-overlay__icon" title="play" aria-label="play"></span>
  43.                     <img src="{{ video.getImageThumbnail('video-overlay') }}" class="js-lazy-img embed-responsive-item" >
  44.                 </div>
  45.                 <div class="video-overlay__video embed-responsive embed-responsive-16by9">
  46.                     {{ video|raw }}
  47.                     {% do jsConfig().add('videoJs', true) %}
  48.                 </div>
  49.             </div>
  50.         
  51.         {% endif %}
  52.     {% endif %}
  53. </section>