Support » Plugin: Cue by » Disable auto playing next track

  • Resolved CloudedDottedMind


    We love Cue, however, I’m looking to disable the next track auto-playing on a playlist as it is proving very disruptive for our listeners. When looking for how to do this, the solution previously used by others no longer works.

    I found this code bit in the plugin files that appears to dictate that the next track should autoplay after one ends, but I do not understand how to prevent it / what to add to my theme’s js file to prevent it.

    On line 577 of the file jquery.cue.js :

    // Play the next track when one ends.
                                $media.on( 'ended.cue', function() {
                                        var index = player.cueCurrentTrack + 1 >= player.options.cuePlaylistTracks.length ? 0 : player.cueCurrentTrack + 1;
                                        // Determine if the playlist shouldn't loop.
                                        if ( ! player.options.cuePlaylistLoop && 0 === index ) {
                                        // Give other 'end' events a chance to grab the current track.
                                        setTimeout(function() {
                                            $( player.node ).trigger( 'nextTrack.cue', player );
                                        }, 250 );

    This is the file:

    This is the previous solution:

    Do you know what code I could add to my jquery theme file to do this?

    Thank you

Viewing 1 replies (of 1 total)
  • Thread Starter CloudedDottedMind



    if anyone is looking for an answer, this is what I’ve ended up with that works:

    If you have a js file inside your child theme:

           var endedHandler = function () {
        		var playHandler = function () {
        			$(".cue-audio").unbind("play", playHandler);
        			$(".cue-audio").unbind("play", endedHandler);			
        		$(this).on("play", playHandler);
        	$(".cue-audio").on("ended", endedHandler);

    If you don’t and need to add it somewhere else:

        jQuery(".cue-audio").on("ended", function () {
        var playHandler = function () {
        jQuery(".cue-audio").unbind("play", playHandler);
        jQuery(this).on("play", playHandler);
Viewing 1 replies (of 1 total)
  • The topic ‘Disable auto playing next track’ is closed to new replies.