• Resolved heydayhemmo

    (@heydayhemmo)


    Hi,

    there’s an issue with the Tap to Unmute feature when using shortcodes to create the video.

    <script src="/wp-content/plugins/video-background/js/vidbg.min.js?ver=2.7.0"></script>
    <script type="text/javascript">
          jQuery(function($){
            // Source: Shortcode
            $( ".page-header" ).vidbg( {
              mp4: "https://kalevatravel.fi.seravo.com/wp-content/uploads/2018/06/frontpage_hero_720p.mp4",
              webm: "#",
              poster: "468",
              repeat: true,
              overlay: false,
              overlayColor: "#000",
              overlayAlpha: "0.3",
              tapToUnmute: false,
              tapToUnmuteText: "<img src="/wp-content/plugins/video-background/img/volume-icon.svg" width="20" height="20" /><span>Tap to Unmute</span>",
            });
          });
        
    </script>

    The main issue is this generated line:
    tapToUnmuteText: "<img src="/wp-content/plugins/video-background/img/volume-icon.svg" width="20" height="20" /><span>Tap to Unmute</span>",

    As you can see it is using ” to start the string and then the contents are also using ” to refer to srcs etc. This of course breaks the string syntax.

    It should be :
    tapToUnmuteText: '<img src="/wp-content/plugins/video-background/img/volume-icon.svg" width="20" height="20" /><span>Tap to Unmute</span>',

    I was able to temporarily fix this by making $tap_to_unmute_button = “”; on line 484 of candide-vidbg.php

    The feature is unnecessary for me as I am simply using a non-audio video.

    • This topic was modified 7 years, 11 months ago by heydayhemmo.

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

Viewing 1 replies (of 1 total)
  • Plugin Author pushlabs

    (@pushlabs)

    Hey heydayhemmo,

    Thanks for using Video Background!

    This is quite weird because I am not experiencing the same issues on my dev instance. The plugin uses single quotes to enqueue the JS plugin init. You can see so here:
    https://plugins.trac.wordpress.org/browser/video-background/trunk/candide-vidbg.php#L498

    However, the code that you posted shows that the entire JS init is using double spaces. This leads me to believe that you may be possibly using a plugin/3rd party code that is rendering those single quotes as double quotes.

    Regardless, I am glad you found a solution. Have a great day 🙂

    Blake

Viewing 1 replies (of 1 total)

The topic ‘Tap to Unmute causing javascript errors’ is closed to new replies.