A
A
anton_trofimov952020-06-15 12:43:38
WordPress
anton_trofimov95, 2020-06-15 12:43:38

How can I display videos in the "Gallery" field in ACF that I myself can upload to media files?

How can I display videos in the "Gallery" field in ACF that I can upload to media files myself? So far google hasn't answered

<?php

                $images = get_field('slider');
                $size = 'full'; // (thumbnail, medium, large, full или произвольный размер)
                if ($images) : ?>
                    <div class="sixth-flex">
                        <?php foreach ($images as $image) : ?>
                            <video controls="controls" poster="<?php echo $image['url']; ?>">
                                <source src="<?php echo $image['url']; ?>" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
                                Тег video не поддерживается вашим браузером.
                                <a href="<?php echo $image['url']; ?>">Скачайте видео</a>.
                            </video>
                            <!-- <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> -->
                        <?php endforeach; ?>
                    </div>
                <?php endif; ?>


This is how I output the video, but how do I put the poster in there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
anton_trofimov95, 2020-06-15
@anton_trofimov95

In short, while writing, it turned out, it's in the poster, and I insert a link to the poster in the description of the video <?php echo $image['description']; ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question