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:

jQuery("#wonderpluginaudio-1").data("object").playAudio();

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:

jQuery("#wonderpluginaudio-2").data("object").playAudio();

To pause the player:

jQuery("#wonderpluginaudio-1").data("object").pauseAudio();

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 onclick='jQuery("#wonderpluginaudio-1").data("object").playAudio();'>Click to Play</a>

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

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

<a onclick='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

Display title at all times for WordPress Carousel Stylish skin

Question:

We are using your Stylish skin on one of our pages and we would like the titles to appear at all times.

Currently the titles of the slides only appear when you hover your mouse upon them.

Is there a code to make this happen?

Answer:
In step 3, Options tab, Skin CSS, find the following code:

#amazingcarousel-CAROUSELID .amazingcarousel-text {
	position:absolute;
	left: 0px;
	bottom: 0px;
	text-align:center;
	width: 100%;
	display: none;
}

And change the code display: none; to display: block;

#amazingcarousel-CAROUSELID .amazingcarousel-text {
	position:absolute;
	left: 0px;
	bottom: 0px;
	text-align:center;
	width: 100%;
	display: block;
}

The demo is as following:

Remove track numbers in audio player playlist

Question:

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

Answer:

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

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

The demo is as following:

Scroll image one by one in responsive WordPress Carousel Slider

Question:

In Responsive wordpress carousel slider , the three image scroll at a time. I want to scroll image one by one. https://www.wonderplugin.com/wordpress-carousel/

Answer:

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

data-scrollmode="item"

The demo is as following:

Callback from WonderPlugin Gallery when a video is changed

Question:

* This question is for WonderPlugin Gallery Plugin.

I’d like to know if there is a way to get a call back from WonderPlugin when a video is changed in the gallery, this is to show related content to that specific video within the playlist.

Answer:

There are two events you can use:

onchange: The event will be be fired on changing the slide.
onvideoend: The event will be be fired when the video playing ends.

To use the events, firstly, you need to define a JavaScript function in your webpage, for example:

<script language="JavaScript">
    function onSlideChange(data) {
        try {
           console.log(data);
        } catch (error)   {}
    }
    function onVideoEnd(data) {
        try {
           console.log(data);
        } catch (error)   {}
    }
</script>

In the above code, data is the data array of current slide object, the definition is [index, Thumbnail address, File address, File address for video ogg file, Fire address for video webm file, Link address, Link target, Title, Description, Media type, Width, Height, Address for video poster image, Address for HD video, Address for HD Ogg file, Address for HD webm file].

Then in the plugin, Step 3, Options tab, Advanced Options, enter:

data-onchange="onSlideChange"
data-onvideoend="onVideoEnd"

Customize the WonderPlugin Slider Text Navigation Skin

Product:

WonderPlugin Slider

Question:

I just purchased the wonder plugin slider. It's great but I just have one question.

I am using the 'wordpress slider with text navigation' option. I was wondering if there was a way of changing that background red colour and the dark grey to my custom colours?

https://www.wonderplugin.com/wordpress-slider/examples/wordpress-slider-with-text-navigation-id33/

I have inspected the code and there doesn't seem to be a class I can associate a colour with.

Would really appreciate your help!

Answer:

In the plugin, step 3, Options tab, Advanced Options, you can enter the following text to the Data Options field:

data-navbordercolor="#dfdfdf"
data-navborderhighlightcolor="#a8162b"
data-navthumbtitlecss="display:block;position:relative;padding:14px;text-align:center;font-size:12px; text-transform:uppercase;color:#231f20;"
data-navthumbtitlehovercss="color:#fff;"
data-navshowfeaturedarrow="false"
data-timercolor="#dfdfdf"

The 1st line data-navbordercolor will change the background color of the thumbnail navigations.
The 2nd line data-navborderhighlightcolor will change the highlight color.
The 3rd line data-navthumbtitlecss can be used to change text size and format.
The 4th line data-navthumbtitlehovercss is to change to the text color of highlighted tabs
The 5th line data-navshowfeaturedarrow is to hide the red arrow.
The 6th line data-timercolor is to change the color of the bottom progress line.

The demo is as following:

Centring WordPress jQuery slider

Question:

I have uploaded one of your sliders on to my WordPress website that I am building for my company and I can't seem to work out how to centre it on the page.

I hope you can help me out.

Answer:

WonderPlugin Slider sets its margin-left and margin-right properties to auto, so it will center itself to its container by default.

If for some reason it does not center on your webpage, you can try to place the slider inside another div, then center the div, for example, you can use code as following:

<div style="width:100%;text-align:center;">
<div style="width:400px;margin:0 auto;">
[[wonderplugin_slider id="37"]]
</div>
</div>

In the above code, the outer div has a width property 100%, it will have the same width as your webpage.

The inner div should have the same width as your slider. The width value can be pixels, for example "400px", or in percent, for example "80%". Its margin property "0 auto" will place the inner div to the center of the outer div.

Macro for link target in WordPress Carousel plugin

Question:

We are following the tutorial: https://www.wonderplugin.com/wordpress-carousel/add-weblink-in-wordpress-carousel-content-template/

Is there a macro for the link target field? There are somethings we want _self and there are somethings we want _blank.

Answer:

Please upgrade the plugin to Version 3.0. The version 3.0 adds a macro __TARGET__.

Then in step 3, Options tab, Content template, you can use the __TARGET__ for the link target value you defined for each slide in step 1.

<div class="amazingcarousel-image">__IMAGE__</div>
<div class="amazingcarousel-title">__TITLE__</div>
<p class="amazingcarousel-readmore"><a href="__HREF__" target="__TARGET__">Read More</a></p>

A demo is as following: