Skip to content

Kirby 6.0.0

Html::video()

Creates a video embed via <iframe> for YouTube or Vimeo videos or a <video> tag for self-hosted video files; the embed URLs are automatically detected from the given URL

Html::video(string $url, array $options = [], array $attr = []): string|null

Parameters

Name Type Default Description
$urlrequired string no default value Video URL
$options array [] Additional vimeo and youtube options (will be used as query params in the embed URL)
$attr array [] Additional attributes for the <iframe> or <video> tag

Return types

stringornull

Parent class

Kirby\Cms\Html inherited from Kirby\Toolkit\Html