Hey folks,
iam trying to figure out how to add attributes like “autoplay”, “muted” and “loop” to a video.
The framework is a customized Kirby 3.9 Starter Kit.
The video was uploaded in panel. blueprints/pages/project.yml here:
…
images:
label: Medien
type: files
template: image
info: "{{ file.dimensions }}"
image:
cover: true
…
blueprints/files/image.hml here:
…
accept:
type:
- image
- video
…
Building it via Layout/Blocks. blueprints/pages/project.yml here:
content_media:
label: Layout
fields:
layout:
label: Layout
type: layout
fieldsets:
- image
- heading
- text
- video
- code
…
snippet/blocks/video here:
<?php if ($block->url()->isNotEmpty()): ?>
<figure>
<span class="video">
<?= video($block->url()) ?>
</span>
<?php if ($block->caption()->isNotEmpty()): ?>
<figcaption class="video-caption"><?= $block->caption() ?></figcaption>
<?php endif ?>
</figure>
<?php endif ?>
I think this is the place where the magic should happens
<?= video($block->url()) ?>
Goal…
<video autoplay muted loop>
…
</video>
Hope there is anybody who can give help or a little hint.
Thank you in advance!
Regards