Unmute video header

i am trying to unmute the video header however the code i try entering give me an error.

    jQuery(function($) {
        $('.wp-custom-header video').prop('muted', false);
    });

error

The snippet has been deactivated due to an error on line 1:

syntax error, unexpected ‘$’, expecting variable (T_VARIABLE)

Plugin

SNIPPETS

Hello there,

Try replacing it with this code:

    ;(function($) {

      $(window).on('load', function() {
        $('.wp-custom-header video').prop('muted', false);
      });

    })(jQuery); 

Before reloading your site, ensure any applied cache in your site is cleared. You might want to clear your web browser’s cache as well. We need to do this procedure as cache sometimes avoid new code changes/additions to take effect.

https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens

Regards,
Kharis

i am getting the same error.

Hello there,

I tried the code again in my test site and it’s working as expected.

Do you have other code priors it? Please clear them all. Maybe the error is in there. If this doesn’t change anything, please share a link to your site to allow me inspecting it.

Regards,
Kharis

i have audio when i am logged into wordpress admin and previewing the page but not when i test it on my mobile or another browser.

Thanks,

Hello there,

Please share me a link to your site, so I can inspect it directly. If you want it to remain private, email it to kharisblank@gmail.com and mention the link to this thread to signal it’s a followup from this thread.

Regards,
Kharis