$page->hasVideos()

Checks if there are any video files in the page directory

  • return (integer)

Example

<?php
echo $page->hasVideos(); //returns the number of videos in the folder

if($page->hasImages()) {
  $videos = $page->videos();
}
?>

What is a video file?

Kirby considers the following file types as video:

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

Is something missing or incorrect? Edit this page on Github…