templates/Magazine/DetailBlocks/BlogArticleVideo.html.twig line 1

Open in your IDE?
  1. {% set video = block.video %}
  2. <section class="container container-sm content-block js-fade-in {{ styleModifier | default(null) }}">
  3.     {{ include('Includes/title-block.html.twig', {
  4.         title: block.headline,
  5.         subtitle: block.subtitle,
  6.         isCentered: true
  7.     }) }}
  8.     {% if video.type == 'asset' %}
  9.         {% set options = {
  10.             'imagethumbnail': 'video-overlay',
  11.             'width': '100%',
  12.             'height': '100%',
  13.             'attributes': {
  14.                 'muted' :'true',
  15.                 'controls': 'controls',
  16.                 'preload': 'none',
  17.                 'class': 'video-js js-video-js js-lazy-iframe js-play-video__video embed-responsive-item'
  18.             }
  19.         } %}
  20.         {% set video =  elements_videoHelper().getVideoTag(video, options) %}
  21.         <div class="video-overlay__wrapper js-play-video">
  22.             <div class="video-overlay embed-responsive embed-responsive-16by9 js-play-video__overlay">
  23.                 <span class="icon icon-play video-overlay__icon" title="play" aria-label="play"></span>
  24.                 {% if video.posterAsset is instanceof('\\Pimcore\\Model\\Asset\\Image') %}
  25.                     {{ video.posterAsset.thumbnail('video-overlay').html({
  26.                         imgAttributes: {
  27.                             class: 'js-lazy-img embed-responsive-item'
  28.                         },
  29.                         lowQualityPlaceholder: true
  30.                     })|raw }}
  31.                 {% else %}
  32.                     <img src="{{ video.imageThumbnail('video-overlay') }}" class="js-lazy-img embed-responsive-item">
  33.                 {% endif %}
  34.             </div>
  35.             <div class="video-overlay__video embed-responsive embed-responsive-16by9">
  36.                 {{ video|raw }}
  37.                 {% do jsConfig().add('videoJs', true) %}
  38.             </div>
  39.         </div>
  40.     {% else %}
  41.         {% set options = {
  42.             'imagethumbnail': 'video-overlay',
  43.             'width': '100%',
  44.             'height': '100%',
  45.             'youtube': {
  46.                 'rel': 0,
  47.                 'showinfo': 0,
  48.                 'frameborder' : 0,
  49.                 'allow' : "autoplay; encrypted-media",
  50.                 'allowfullscreen' : true
  51.             },
  52.             'class': 'video-js js-video-js embed-responsive-item'
  53.         } %}
  54.         {% set video =  elements_videoHelper().getVideoTag(video, options) %}
  55.         {% if not editmode %}
  56.         <div class="">
  57.             {% embed('Layout/includes/consent-overlay.html.twig') with {
  58.                 'service': 'marketing',
  59.                 'buttonText': 'cookies.accept-marketing-cookies' |trans,
  60.                 'overlayText': 'cookies.accept-cookies-to-show-video'|trans,
  61.                 'classNames': {
  62.                     'wrapper': 'embed-responsive embed-responsive-16by9',
  63.                     'overlay': 'bg-light-bg d-flex justify-content-center flex-column align-items-center embed-responsive-item',
  64.                     'button': 'btn btn-primary-light mt-4 button-test',
  65.                     'template': '',
  66.                 },
  67.                 'jsClassNames': {
  68.                     'wrapper': 'js-consent',
  69.                     'overlay': 'js-consent__overlay',
  70.                     'button': 'js-consent__accept-btn',
  71.                     'template': 'js-consent__template',
  72.                 }
  73.             } %}
  74.                 {% block consentIframe %}
  75.                 <div class="video-area__video embed-responsive embed-responsive-16by9">
  76.                     {# add iframe or script to be wrapped here! #}
  77.                     {{ video|raw }}
  78.                 </div>
  79.                 {% endblock %}
  80.             {% endembed %}
  81.         </div>
  82.         {% endif %}
  83.     {% endif %}
  84. </section>