Developers

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

Fires when a track is loaded, before it plays.

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

Parameters

detailObject
What changed.
  • trackObject
    The track now loaded.
  • indexnumber
    Its position in the play order.
  • queueObject[]
    The queue in play order.
apiObject
window.riff.

More Information

Usage

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

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

Source

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

Changelog

VersionDescription
4.0.0Introduced.