
#HTML5 AUDIO AUTOPLAY NOT WORKING HOW TO#
Only in Chrome the autoplay option is not working because this is a policy of Chrome (only muted autoplays are allowed). How to enable HTML audio and video autoplay with sound, in Chrome and other browsers, in 2019 Sad trombone update: this ‘hack’ has been ‘fixed’ by most if not all browsers now A visitor must interact with the site before audio can play. The audio start playing after the design for the audio player is loaded. I just tested the audio shortcode on my local theme installation in different browsers but could not find the issue you have. To fix this we add the muted attribute, this will disable the audio, making the video less intrusive.

To provide a consistent design in all major browsers some extra files are needed to do this, but the downside of this is that the default WordPress audio shortcode is very slow ( )

The reason for this is that each browser render the HTML audio tag differently. The un-styled to styled "blink" is caused because WordPress is loading files to change the design of this audio player. This rule applies to any audio or video element for which all the following are true: (autoplay) the element has an autoplay attribute value of true and (not. I want the audio to play when a person clicks onto the site but I want it to be hidden. Yes I have added a 'muted' tag aswell and it still will not play. The problem that I am having is that if I put the 'autoplay' tag, it still doesnt play. I attach a video so you can see what is the problem. I am working on a website and I have tried adding background music.
After some seconds there is some javascript (I guess it's /wp-includes/js/mediaelement/?ver=4.2.6-78496d1) that loads and restyles the audio player making it to reload and re-play the song from the beginning. Is there any solution to this problem? I don't know if it's a problem of Wordpress itself or a problem of the theme.Īnother option is to add a raw HTML5 audio tag, but its design looks a bit ugly.