25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
1.3 KiB

  1. <?php $this->extend('block_unsearchable'); ?>
  2. <?php $this->block('content'); ?>
  3. <figure class="video_container">
  4. <?php if ($this->aspect): ?>
  5. <div class="responsive ratio-<?= $this->aspect ?>">
  6. <?php endif; ?>
  7. <?php if ($this->splashImage): ?>
  8. <a id="splashImage_<?= $this->id ?>" href="<?= $this->src ?>">
  9. <?php $this->insert('picture_default', $this->splashImage->picture); ?>
  10. </a>
  11. <script>
  12. document.getElementById('splashImage_<?= $this->id ?>').addEventListener('click', function(e) {
  13. e.preventDefault();
  14. var iframe = document.createElement('iframe');
  15. iframe.src = this.href;
  16. iframe.width = '<?= $this->width ?>';
  17. iframe.height = '<?= $this->height ?>';
  18. iframe.setAttribute('allowfullscreen', '');
  19. this.parentNode.replaceChild(iframe, this);
  20. });
  21. </script>
  22. <?php else: ?>
  23. <iframe<?= $this->size ?> src="<?= $this->src ?>" allowfullscreen></iframe>
  24. <?php endif; ?>
  25. <?php if ($this->aspect): ?>
  26. </div>
  27. <?php endif; ?>
  28. <?php if ($this->caption): ?>
  29. <figcaption class="caption"><?= $this->caption ?></figcaption>
  30. <?php endif; ?>
  31. </figure>
  32. <?php $this->endblock(); ?>