Wednesday, June 15, 2016

How to add autoplay background music to WordPress website?

Welcome to this post. You are looking for How to add auto play background music to WordPress website? If yes  then in this post I want to give you a detail description about adding background music to WordPress website. There are different plugins used to add background music to WordPress.  Most of the WordPress users will have this complaint that why background music auto play is not working on mobile, because auto play is not desirable on mobile devices. The reason is that the auto play event on mobile trigger extra cost for the mobile device owner. For that sake most of the popular plugins are fail to fulfill this demand. According to my research the good and most widely used plugin is Soundy Background Music plugin, which will be discuss in this post. I will also show you the most easy custom way to add background music which will work both on desktop computer as well as on mobile.

Popular plugins used to add background music

1. Soundy Background Music

This plugin allows any page or post to play a background sound on that can be play auto but only work on desktop computer.
Click on here to access this plugin.
If the background much is not auto play on your mobile, after using this plugin the easy solution is to add the background music by custom why.

How to add background music by custom method?

Yes it is possible. You need to add the following JavaScript code in the dead tag of your website. If you are using WordPress, go to header.php and in between <head></head> past the following code.
<script type="text/javascript">
function autoPlay() {
 document.getElementById('my-audio').play();
}
window.addEventListener('load', autoPlay);
</script> 
<audio id="my-audio" src="http://www.w3schools.com/html/horse.mp3" autoplay></audio>
In the last line of code you can see the horse.mp3, replace this with your audio file.
you can easily upload your audio file, to WordPress site via Media/upload option and then copy url of your file and replace with http://www.w3schools.com/html/horse.mp3 link.

HTML/PHP website

If you want to add this to HTML/PHP website the add this code in the head section of index.html/index.php. I hope this will help you and you will enjoy it.
If you need more help please contact me via contact page, I will help you to solve your issue. I hope that now you will have no issue about How to add autoplay background music to WordPress website?
Share:

12 comments:

  1. There is a small spelling mistake in the article "If you want to add this to HTML/PHP website the add this code in the head section of index.html/index.phg." should be index.php

    Feel free to visit my website: https://www.shoutmecrunch.com

    ReplyDelete
  2. Firstly we need to install your own personal web server to run Wordpress. Wordpress requires a web server, a MySQL database and the PHP scripting language to run.https://edkentmedia.com/website-design-toronto

    ReplyDelete
  3. I tried to input the custom method in head, but it still doesn't autoplay in mobile.

    ReplyDelete
  4. Make sure that people have incentive to both be a fan of your music AND purchase your music.reggae music

    ReplyDelete
  5. It is critical that American Acme Corporation's business missions are upheld by qualified representatives, with a protected and secure condition for all American Acme Corporation constituents, including contractual workers, guests and representatives.GlobeNewsWire

    ReplyDelete
  6. This is extremely fascinating substance! I have completely delighted in perusing your focuses and have reached the conclusion that you are right about a hefty portion of them. You are extraordinary.  meer informatie

    ReplyDelete
  7. You have a genuine capacity for composing one of a kind substance. I like how you think and the way you speak to your perspectives in this article. I concur with your mindset. Much obliged to you for sharing. https://webceed.co.uk/

    ReplyDelete
  8. Majority each company has their own after sales support center. Customer service is the backbone of any online or offline enterprise. The majority of the companies consider their contracted and temporary workers, their customers as their internal team members, and most.
    https://servicecenterguru.com

    ReplyDelete
  9. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. realizzazioni siti web

    ReplyDelete

  10. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.
    ecommerce website development in chennai

    ReplyDelete
  11. In almost every case so there is likely a solution already developed for any thing you need - the possibilities are literally limitless!https://medijo.lt/etiketes/

    ReplyDelete

Contact Form

Name

Email *

Message *