src/Elements/Bundle/DemiFrontendBundle/Resources/views/Infrastructure/detail/videos.html.twig line 1

Open in your IDE?
  1. {#
  2. /**
  3.  * @var \Pimcore\Templating\PhpEngine $this
  4.  * @var \Pimcore\Templating\PhpEngine $view
  5.  * @var \Pimcore\Templating\GlobalVariables $app
  6.  * #
  7.  * @var $videos
  8.  */
  9. #}
  10. <section class="content-block demi-infrastructure-detail-content-block demi-infrastructure-detail-content-block--video">
  11.     <div class="container">
  12.         {% if videos is not empty and videos | length > 0 %}
  13.             {% for item in videos %}
  14.                 {% set video = demi_pregmatch('/(?:(?:http(?:s?):\/\/)|(?:www\.)|(?:http(?:s?):\/\/www\.))(?:youtu\.?be(?:\.com)?\/(?!oembed))(?:(?:watch\?v(?:=|%3D))|(?:v\/))?([a-z0-9_-]+)/im', item.getUrl()) %}
  15.                 {% if video is iterable %}
  16.                     <div class="embed-responsive embed-responsive-16by9">
  17.                         <iframe class="embed-responsive-item"
  18.                                 src="https://www.youtube.com/embed/{{ video[1] }}?rel=0&showinfo=0" frameborder="0"
  19.                                 allowfullscreen></iframe>
  20.                     </div>
  21.                 {% endif %}
  22.             {% endfor %}
  23.         {% endif %}
  24.     </div>
  25. </section>