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.         <div class="video-area__video embed-responsive embed-responsive-16by9">
  56.             <div class="cookieconsent-optout-marketing embed-responsive-item bg-light-bg d-flex justify-content-center flex-column align-items-center">
  57.                 {{ 'cookies.accept-cookies-to-show-video' |trans }}
  58.                 <a class="btn btn-primary-light mt-4" href="javascript:Cookiebot.renew()">
  59.                     {{ 'cookies.accept-marketing-cookies' |trans }}
  60.                 </a>
  61.             </div>
  62.             {{ video|raw }}
  63.         </div>
  64.     {% endif %}
  65. </section>