Home › Forums › General Issues › Render Video from a wordpress shortcode › Reply To: Render Video from a wordpress shortcode
And here with dynamic poster loaded in an image field (return format URL):
<?php
$link_data = get_field('video_featured');
$link_poster = get_field('poster_image');
if(!empty($link_data))
{
$link = $link_data['url'];
?>
<video width="200" height="300" playsinline autoplay muted loop disableremoteplayback poster="<?php echo $link_poster; ?>" >
<source src="<?php echo $link; ?>" type="video/mp4">
Your browser does not support the video tag.
</video>
<?php } ?>
I’m not a developer, just an enthusiast, so if this can be improved please feel free todo so. Meanwhile I’m so happy it works! 😀
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.