Video Shortcode & Video Poster Question

There’s no straight forward way of doing this but we can achieve this with a small JS snippet. You can add the following JS snippet in your footer to make it work with all videos in your content.

var videos = document.getElementsByTagName('video');
for (var i = 0; i < videos.length; i++) {
    videos[i].addEventListener('ended', function(e) {
        e.target.load();
    });
}

What does this code do?

The above snippet register ended event on all videos it can find and just loads the video when it ends.

To make it more seamless, we can filter the_content if any shortcode is used, if so, then include this code, otherwise not.

Add the following code to your functions.php or in a custom plugin:

function ja_video_shortcode_check( $content ) {

    if ( has_shortcode( $content, 'video' ) ) {
        add_action( 'wp_footer', function(){
            echo "<script>
                    var videos = document.getElementsByTagName('video');
                    for (var i = 0; i < videos.length; i++) {
                        videos[i].addEventListener('ended', function(e) {
                            e.target.load();
                        });
                    }
                </script>";
        } );
    }

    return $content;
}
add_filter( 'the_content', 'ja_video_shortcode_check' );

Tested in fresh WP instance using TwentySeventeen theme with no plugins activated.

To add this code in a widget, add a Text widget, toggle to the Text view and paste the following code:

<script>
   var videos = document.getElementsByTagName('video');
    for (var i = 0; i < videos.length; i++) {
        videos[i].addEventListener('ended', function(e) {
            e.target.load();
        });
    }
</script>