Support

Account

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! 😀