WordPress 4.7 – Custom Video Header – Stop Autoplay

I don’t think there is a need to override any core files. You can just use javascript to stop autoplaying the video.

I tested the following code on Twenty Seventeen theme and it works fine.
For example:

$( document ).ready( function() {
    $( document ).on( 'wp-custom-header-video-loaded', function() {
        $("#wp-custom-header-video").attr('autoplay',false);
    });
});

This does the trick.

Leave a Comment