$page->video($filename = false)

Returns a specific video $file object by filename. If no filename is given, the first available video will be returned.

  • since: Kirby 2.3.0
  • $filename (string)
    Optional, a filename
  • return ($file)

Example

Fetching the first video

<?php if($video = $page->video()): ?>
<img src="<?= $video->url() ?>" alt="">
<?php endif ?>

Fetching a specific video

<?php if($video = $page->video('myimage.m4v')): ?>
<?= $video->url() ?>
<?php endif ?>