WonderPlugin Audio Player JavaScript API

This post will show you how to use JavaScript to control the WonderPlugin Audio Player.

The following JavaScript will play the audio:


In the above code, 1 is the id of the audio player. wonderpluginaudio-1 is the id of the created player DIV.

If the id of your player is 2, you need to change the id value accordingly:


To pause the player:


The function audioRun(index, autoplay) will jump to the specified audio. The index starts from 0. For example, the following function will jump to the second audio and play it:

jQuery("#wonderpluginaudio-1").data("object").audioRun(1, true);

To goto the previous audio:

jQuery("#wonderpluginaudio-1").data("object").audioRun(-2, true);

To goto the next audio:

jQuery("#wonderpluginaudio-1").data("object").audioRun(-1, true);

The following four text links will play, pause, jump to the second audio and jump to the fifth audio in the following player:

<a href='javascript:jQuery("#wonderpluginaudio-1").data("object").playAudio();'>Click to Play</a>

<a href='javascript:jQuery("#wonderpluginaudio-1").data("object").pauseAudio();'>Click to Pause</a>

<a href='javascript:jQuery("#wonderpluginaudio-1").data("object").audioRun(1, true);'>Jump to Second Audio and Play</a>

<a href='javascript:jQuery("#wonderpluginaudio-1").data("object").audioRun(4, true);'>Jump to Fifth Audio and Play</a>

The demo is as following:

Click to Play
Click to Pause
Jump to Second Audio and Play
Jump to Fifth Audio and Play

Remove track numbers in audio player playlist


Is there a way to get rid of the track numbers in the audio player playlist?


In step 3, Options tab, click Advanced Options button, enter the following code to the Advanced Options field:

data-tracklistitemformat="%TITLE% <span style='position:absolute;top:0;right:0;'>%DURATION%</span>"

The demo is as following:

Multiple jQuery loaded in WordPress


I have a website in progress, I used Wonderplugin for WordPress and as I came across on the development, I cannot get it working.

I already uploaded images and configured everything on WordPress.

I also copied the shortcode to the php page that I am working on. But the carousel does not show up.


Normally this problem is because there are multiple jQuery files added to your WordPress.

You can view the HTML source code of your webpage, and check how many jQuery are added in your website.

In Google Chrome, you can view the HTML source code with menu View -> Developer -> View Source, then search text "jquery" in the source code.

There should be only one jQuery in the webpage, which is added by the WordPress system.

Some plugins add their own jQuery to the website, and this is not correct.

A plugin should always use the system installed jQuery, and the js files added from a plugin will be added after the system jQuery.

A jQuery will destroy all other jQuery functions that are added before it. So if a plugin adds its own jQuery, it may destroy other jQuery functions.

To fix the issue:

In the plugin, Setting menu, you can try to check the option "Add slider js scripts to the footer". This option will place the plugin js file to the footer and will fix the problem in most cases.

If the above option is not working, you can try to disable all other plugins and see whether the WonderPlugin works. If it works, you can then enable the plugins one by one, and find the plugin that causes the problem.

If WonderPlugin is still not working after you have disabled all other plugins, then the extra jQuery may have been added manually to the theme or the page, you need to find the code and remove it.

Add mp3 download link to audio player


WonderPlugin Audio Player


How can I add download links to the player so my visitor can download the mp3 file?


You can add download link of each audio file to the tracklist.

In step 3, Options tab, click the Advanced Options button, then enter the following text to the Advanced Options field:

data-tracklistitemformat="%ID%. %TITLE% <span style='position:absolute;top:0;right:0;'><a href='%AUDIOURL%' class='wpaudiodownloadlink' download='%TITLE%.mp3' target='_blank'>Right Click to Save</a></span>"

In the above code, %ID%, %TITLE% and %AUDIOURL% are predefined macro variables. They will be replaced by each audio id, title and audio URL dynamically.

Please note. The download attribute only works for Chrome 14.0 and above, Firefox 20.0 and above, Opera 15.0 and above. On other web browsers, if you directly click the link, instead of downloading the mp3 file, these web browsers will open and play the mp3.

This is the default behaviour of these web browsers, and there is no way to change that, unless you use some server side script to dynamically modify the HTTP header.

To download the mp3 file, you need to ask your users to right click on the link, and select Save Link As from the context menu.

Audio Player with Download Link

On web browsers other than Chrome, Firefox and Opera, left clicking the link will play the mp3 file. To avoid confusing the visitors, you can add the following JavaScript to the header.php of your WordPress theme, just before the head closing tag </head>. The script will disable left click on the link except for Chrome, Firefox and Opera.

jQuery(document).ready(function() {
  jQuery(".wpaudiodownloadlink").click(function() {
    var isChrome = (navigator.userAgent.match(/Chrome/i) != null);
    var isFirefox = (navigator.userAgent.match(/Firefox/i) != null);
    var isOpera = (navigator.userAgent.match(/Opera/i) != null);
    if (isChrome || isFirefox || isOpera)
      return true;
      return false;

How to upgrade to a new version without losing existing work

This is a tutorial for how to upgrade the plugin to a new version manually. You can use this tutorial to upgrade a free or commercial version to its latest version.

There are two methods to upgrade the plugin to its latest version manually:

The First Method:

To upgrade to the latest version without losing your existing work, you can take the following steps:

  1. In your WordPress backend, goto the plugin menu Settings, make sure there is an option "Keep data when deleting the plugin" and the option is checked. The option is checked by default. This option is only available after certain versions. Do not use this method if there is not this option in your plugin. Please use the following second method instead.
  2. In your WordPress backend, goto the menu Plugins -> Installed Plugins, deactivate the plugin and delete it. When deleting the plugin, ignore the warning "Are you sure you wish to delete these files and data" and click the button "Yes, Delete these files and data". This is a standard warning from WordPress.
  3. Install the new version plugin zip file and activate it.
  4. Clear all possible caches:

    • If you have installed a WordPress js/css minify plugin or WordPress cache plugin for example, W3 Total Cache or WP Super Cache, empty all caches from the plugin.
    • Some of the web hosts, for example, GoDaddy, DreamHost, will also cache web files. You need to clear caches of the web hosting before testing. Please contact your web hosting provider and ask about how to clear caches.
    • Clear caches of your web browser before testing.

The Second Method:

If the first method does not work for you, you can use the following method:

  1. Unzip the new version .zip file at local hard disk.
  2. FTP/upload the unzipped folder to your WordPress web server, inside the folder wp-content/plugins/, and overwrite the existing folder with the same name. Please make sure you have overwritten the existing folder. When there is a folder name conflict, some ftp software or file manager will create a duplicated folder rather than overwriting the existing one. In this case, you can delete the existing folder first then upload the new version folder.
  3. Clear all possible caches:

    • If you have installed a WordPress js/css minify plugin or WordPress cache plugin for example, W3 Total Cache or WP Super Cache, empty all caches from the plugin.
    • Some of the web hosts, for example, GoDaddy, DreamHost, will also cache web files. You need to clear caches of the web hosting before testing. Please contact your web hosting provider and ask about how to clear caches.
    • Clear caches of your web browser before testing.

Not all audio files loading in Google Chrome


I purchased the commercial version of your audio plugin this morning and installed it on a client’s site who uses quite a few audio files. One page in particular contains 10 different audio files. I’m having a problem “loading” the last three audio files in Google Chrome on both a mac and pc. All the audio files work great in IE, Safari, and Firefox. They actually work fine on the chrome mobile application too.

Is there a setting that I need to change to get all the files to load when the page loads in Chrome?


The problem is because Chrome has a maximum connection limit of html5 audios.

To fix the problem, in step 3, Options tab, Advanced Options, enter the following text to the Advanced Options tab:


With this change, the player will only load the mp3 file when required, and it will fix the problem.

Add extra information to the player tracklist


I like the WonderPlugin Audio very much and I uses it on our site. However I have the following question:

I use the skin: Jukebox version but I am missing one column at the end of each inserted Audio line.

The missing element is to be able to add a document (doc. or PDF file) to that audio line. In that document could be the music (notes), or the words of the song or additional information like the writer and some background information.

The new audio line will look like: sequential number, song title, minutes:seconds, a symbol like open book or name.

In order to define the document file name we need an additional line to add the URL when defining the new Audio file.

My Question: Is that possible now or in the future, Please?


Firstly, please upgrade to the latest version if your version number is less than 1.4.

Then you can take the following steps:

1. In the plugin, Step 1, MP3 tab, enter your link to the Information text field, for example:

<a href="https://www.wonderplugin.com/" target="_blank">WonderPlugin</a>

You can add different link text for each of your audios.

2. In Step 3, Options tab, Advanced Options, enter the following text to the Advanced options field:

data-infoformat="%ARTIST% %ALBUM%"
data-tracklistitemformat="%ID%. %TITLE% <span style='position:absolute;top:0;right:0;'>%INFO% - %DURATION%</span>"

In above code, the %INFO% will be dynamically replaced by the information you entered.

A demo is as following:

Audio Player with Larger Image


I've downloaded the free version for testing, and I want to upgrade to the commercial version. However, before I buy, I want to know if

1. Can I change the size of the thumbnail in the Box player skin from 100x100 to something larger? I don't find this specified in your Skin CSS file, so not sure what the custom css would be.

2. If not, can the Lightbox skin show a playlist?

Thanks for your help. If I can use a larger image, I will purchase the plugin.


All of the skins are fine tuned. If you change the size of the thumbnail in the player, you need to adjust CSS of other parts accordingly, which may be difficult.

But you can add a playlist to the Lightbox skin.

1. In the Step 3, Options tab, click Skin Options button, change the Height to Auto.
2. In the Step 3, Options tab, click Advanced Options button, then enter following text to the Advanced options:


A demo is as following:

Open Audio Player in Fancybox


Im a new WordPress developer and developing a website for my client where client provided me "WonderPlugin Audio Player"

The requirement is that the player need to be play inside the fancy-box ,I implemented it but it generating few error and not playing the file.

TypeError: this.flashObject is null


What I do in such a case please need help on this matter

Does the plugin support inside fancybox?


You can try the following way to do it:

1. Download Amazing Audio Player application: http://amazingaudioplayer.com/. It has the same JavaScript core as WonderPlugin Audio Player and can create same players. But it's a Windows/Mac application.

2. Create your player in the application, in Publish dialog, choose "Publish to folder". This will create all files for the audio player.

3. Upload all of the files, including all of the subfolders, to your web server.

4. Use fancybox to open the file "audioplayer.html".

If you are an experienced WordPress developer, you can also do it with WonderPlugin Audio Player:

1. Create a special WordPress page template, which does not have the normal header and footer.

2. Create a WordPress page with the above template, then paste the audio player shortcode to this page. This will create a page with only the player inside.

3. Open the above page with fancybox, or with WonderPlugin Lightbox Plugin https://www.wonderplugin.com/wordpress-lightbox/.

Thumbnail Image for WordPress Audio Player


I've just installed this plugin for WordPress.

I'm having an issue with adding an image for an album of songs. For some reason, all I'm seeing is part of the background colour of the image. Does the image need to be a particular size?

The size of the actual image is 1024 by 1024. All I get is part of the white background and NOT the actual CD image.


The plugin does not resize your image, so it just displays the top-left corner of your image, which is a white background.

Please resize your image to 100*100 with photoshop or any image resizing software, then add it to the plugin.