Fehler: Nach Update auf Contao 4.13 Probleme Mit Video in Customs Element

Silvia's Avatar

Silvia

14 Jul, 2023 10:06 AM

Produkt: Custom Elements Contao
Contao-Version: 4.13

Ich gebe ein Video als Hintergrund aus, bis Contao 4.9 hat das gut funktioniert:

rsce_video_config.php:

'backgroundVideo' => array(
    'label' => array(
            'en' => array('Background video', ''),
        'de' => array('Hintergrundvideo', ''),
    ),
    'inputType' => 'fileTree',
    'eval' => array(
        'tl_class' => 'clr',
        'fieldType' => 'radio',
        'filesOnly' => true,
        'extensions' => \Config::get('validImageTypes') . ',mp4,webm,ogv,ogg',
    ),
),

rsce_video.html:

<?php if ($video = $this->getImageObject($this->arrData['backgroundVideo'])): ?>
    <video class="video-background" src="<?php echo $video->src ?>" autoplay loop playsinline muted></video>
<?php endif ?>

Die if-Abfrage gibt NULL zurück.
Was hat sich hier geändert? Ich finde einfach den Fehler nicht.
Danke.

  1. Support Staff 1 Posted by RockSolid Theme... on 14 Jul, 2023 02:23 PM

    RockSolid Themes's Avatar

    Vielen Dank für Ihre Frage.

    Mit folgendem Code im Template sollte sich der Pfad zur Video-Datei ausgeben lassen:

    <?php if ($video = Contao\FilesModel::findByUuid($this->backgroundVideo)): ?>
        <video class="video-background" src="<?php echo $video->path ?>" autoplay loop playsinline muted></video>
    <?php endif ?>
    

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac