• Hi, I’m having trouble with my video background sometimes not autoplaying. I linked a youtube video in the video header section of “customize”

    I followed this tutorial and the video does display, just doesn’t always autoplay.
    https://howto-wordpress-tips.com/video-header-wordpress-tutorial/

    If I refresh it enough it does autoplay and continues to autoplay each time until I clear the cache (I believe anyway).

    This is in my functions.php (as a note I added autoplay and mute from a support forum question I found but it didn’t help).

    add_theme_support( ‘custom-header’, array(
    ‘video’ => true
    ));

    add_filter( ‘header_video_settings’, ‘header_video_resolution’);
    function header_video_resolution( $settings ) {
    $settings[‘minWidth’] = 0;
    $settings[‘minHeight’] = 100;
    $settings[‘autoplay’] = 1;
    $settings[‘mute’]= 1;
    return $settings;

    My header.php – I added this right after <head> I’ve also tried it in other spots including right before <header class=
    <?php the_custom_header_markup() ?>

    As a note I’m using the basic child theme of the free version of Hestia

    Thank you so much!!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    Intermittent problems are very difficult to troubleshoot unless you can find a way to reliably induce the problem. The video always auto-plays for me when I checked through Chrome and Firefox, hence I can see nothing wrong.

    Thread Starter calimer

    (@calimer)

    @bcworkz thank you so much. I ended up downloading the youtube video version of the video and putting that on instead of linking to YouTube. It seems to work fine except an ugly grey above and below it.

    I’ll put back the YouTube version for testing. I am curious why it messed up. One weird thing is if I “reload” the site it is maybe around a 50% chance for it to work or not work. However if I click the site title at the top the video works every time.

    So right now I have it back to the YouTube version if you’d be willing to check it again. Thank you so much!

    Moderator bcworkz

    (@bcworkz)

    It auto-plays very consistently when I visit. That’s curious about it always working when the site link is followed. How do you normally access the site when it misbehaves? Bookmark? Auto-complete? Search results?

    Thread Starter calimer

    (@calimer)

    @bcworkz I put it back to having it play a video hosted on the site vs YouTube which works though I’m still curious about the YouTube issue.

    What I was doing was clearing my cache and then opening up Google Chrome and then typing in the address. I think it consistently wouldn’t play the first time.

    So hitting F5 or highlighting the link and hitting enter to reload it’d work about 50% of the time.

    Currently now I just have to figure out how to get rid of that ugly grey and/or move the video “up” to fill that space.

    I can always put the site back to the “YouTube video version” if you are curious to test.

    Thank you!
    – Mike

    Moderator bcworkz

    (@bcworkz)

    Thanks for the offer but I don’t think we’ll be any more enlightened by further testing.

    Ideally you’d want the video to always be flush to the top so that it runs under the nav bar and the text “floats” over it? Because of the way your theme positions the video, there will invariably be a dark margin at some screen widths. Redoing the positioning appears to be pretty involved. You might try asking in your theme’s dedicated support channel how this might be accomplished. The theme devs and expert users there might know of a way that’s not apparent to me.

    Or cover up the problem by assigning a non-transparent color to the nav bar background. While a significant deviation from your design goal, it does obscure the video edge from appearing at an odd place at certain screen widths.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Video Header not always autoplaying’ is closed to new replies.