Skip to content

Kirby 5.0.1

$page->videos()

Filters the Files collection by type videos

$page->videos(): Kirby\Cms\Files

Return type

Kirby\Cms\Files

Parent class

Kirby\Cms\Page

What is a video file?

Kirby considers the following file types as video:

  • avi
  • flv
  • m4v
  • mov
  • movie
  • mpe
  • mpg
  • mp4
  • ogg
  • ogv
  • swf
  • webm

Examples

<h2>Videos</h2>
<?php foreach($page->videos() as $video): ?>
<video width="300" height="200" controls>
  <source src="<?= $video->url() ?>" type="<?= $video->mime() ?>">
</video>
<?php endforeach ?>