Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1072740

    Hello,

    I have been having this issue using the Enfold theme and I would appreciate if someone can help me address this. Either by editing the shortcode to automute videos or another solution.

    The videos on my homepage are not autoplaying due to Google’s new policy on video sound. When I go edit the website settings on Chrome browser and “allow” sound the videos play fine. I would like to have an option or a resolution to edit the code so the videos are automuted on my website so It will allow them to autoplay for all users.

    This is only an issue for Google Chrome as it works fine in Firefox and IE.

    Please do not reccomend cache issues as I have already ruled this issue out.

    I have included a link to the website, login url, and login credentials.

    Thanks for your support.

    #1074848

    Hey mlangereis,

    Thank you for using Enfold.

    Are you using the theme’s video element? This script should mute the video on load and play it afterwards.

    add_action('wp_footer', 'ava_video_mute_autoplay');
    function ava_video_mute_autoplay(){
    ?>
    <script type="text/javascript">
    (function($) {  
        $('.avia_video').on('av-mediajs-loaded', function() { 
            var video = $(this).mediaelementplayer();
            video[0].setMuted(true);
            video[0].play();
        });
    })(jQuery);
    </script>
    <?php
    }

    Add the snippet in the functions.php file.

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.