Skip to content

Kirby 5.6.4

(video: …)

Embeds a video from YouTube, Vimeo or a local file by URL or filename

Attributes

In addition to the main video, option, the tag supports the following attributes: autoplay caption controls class disablepictureinpicture height loop muted playsinline poster preload style width

Attribute Description Default
autoplay Whether the video starts playing automatically (only for local and remote videos) false
caption The caption null
controls Whether the browser shows its video controls (only for local and remote videos) true
class The class which is added to the figure element video
disablepictureinpicture Whether the picture-in-picture feature is disabled for the video element (only for local and remote videos) false
height The height that is added to iframe and video elements null
loop Whether the video starts over again when it reaches the end (only for local and remote videos) false
muted Whether the audio of the video is muted (only for local and remote videos) value of autoplay
playsinline Mobile browsers will play the video right where it is instead of opening it in fullscreen (only for local and remote videos) value of autoplay
poster An image to be shown while the video is downloading, as filename or URL (only for local and remote videos) null
preload The option that the video should be loaded when the page loads (only for local and remote videos) null
style The style that is added to the figure element null
width The width that is added to iframe and video elements null

The autoplay, controls, disablepictureinpicture, loop, muted, playsinline, poster and preload attributes are not supported by video providers such as YouTube and Vimeo.

Attribute defaults from config

You can customize the defaults of this tag's attributes via the kirbytext.video config option.

Supported video sources

YouTube

Embedded YouTube video by video URL:

(video: http://www.youtube.com/watch?v=lLuc6rtWkrM)

The following link YouTube link formats are recognized:

Basic video URLs:

URLs with additional query parameters:

Playlists:

Vimeo

Embedded Vimeo video by video URL:

(video: http://vimeo.com/3432886)

Local and remote videos

You can also embed video files of your site or from remote servers.

# local
(video: local-video.mp4)

# remote
(video: https://example.com/sample-video.mp4)

If autoplay is enabled, the video is muted and plays inline unless you set muted or playsinline yourself. To start autoplay with sound, use it as in the following example:

(video: local-video.mp4 autoplay: true muted: false)

Examples

Caption

(video: http://youtu.be/lLuc6rtWkrM caption: This is a really nice video)

<iframe> size

(video: http://vimeo.com/3432886 width: 300 height: 200)

Custom CSS class

The class is added to the <figure> element that wraps the video. Use it to style single videos in your CSS. Your class replaces the default video class, so add video as well if your styles rely on it:

(video: http://youtu.be/lLuc6rtWkrM class: video video-narrow)
/assets/css/site.css
.video-narrow {
  max-width: 30rem;
}

Video attributes

For local and remote videos, the video tag supports some attributes of the HTML <video> element: autoplay, controls, disablepictureinpicture, loop, muted, playsinline, poster, preload

(video: local-video.mp4 autoplay: true)
(video: local-video.mp4 controls: false autoplay: true loop: true)
(video: local-video.mp4 poster: cover.jpg)
(video: local-video.mp4 preload: auto)
(video: https://example.com/sample-video.mp4 muted: true controls: false autoplay: true)
(video: local-video.mp4 poster: https://example.com/sample-cover.jpg)