Developers

wp.hooks.doAction( 'riff.queue', detail, api )

Fires when the queue changes while it plays: tracks added to play next or at the end, one moved or removed, or the queue cleared.

Also dispatched as the riff:queue event on #riff, with the same detail. The event bubbles.

Parameters

detailObject
What changed.
  • changestring
    next, add, move, remove or clear.
  • queueObject[]
    The queue in play order.
  • indexnumber
    The playing track's place in it.
apiObject
window.riff.

More Information

Usage

wp.hooks.addAction( 'riff.queue', 'my-plugin', ( detail, api ) => {
} );

// Or, without wp-hooks:
window.riff.on( 'queue', ( detail ) => {} );

Source

emit( 'queue', { change, queue: api.queue(), index: pos } );

Changelog

VersionDescription
4.19.0Introduced.