• Please see this post because Iam trying to figure out how to do the second part. I have completed the first part but i do not know where to edit the body tag in the second part. Please see this link.

    https://www.ads-software.com/support/topic/remove-wordpress-audio-player-download-button-added-by-chrome`

    Iam not sure where to put this code or how to do it. Could someone instruct me on how to disable right click downloads or just right clicking at all on the audio player.

    <script>
    (function($){
    $(document).on(‘contextmenu’, ‘audio’, function() {
    return false;
    })
    })(jQuery);
    </script>`

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

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m not sure what a “body scripts” section is, but a script block somewhere in a page’s body element should do the job. The problem is placing script in page content makes it vulnerable to corruption by things like wpautop(). To get around that problem, make a custom shortcode that returns the script block you need.

    A generic shortcode example is here. It can be placed in your theme’s functions.php, or better yet, that of a child theme.

    If your shortcode will not use attributes or content, you don’t need the bulk of the example code within wporg_shortcode(). Just assign the script block you need to $o as a string literal. Then do return $o; as shown. Add the shortcode [wporg] or whatever you name it to the page content where the video player in embedded. Anywhere in content is fine.

    Your script example assumes that jQuery is already loaded on the page. If it’s not, you’ll also need to enqueue jQuery.

Viewing 1 replies (of 1 total)
  • The topic ‘Coding audio player for google chrome users’ is closed to new replies.