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.
trackObjectThe track now loaded.indexnumberIts position in the play order.queueObject[]The queue in play order.
apiObjectwindow.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() } );plugins/riff/assets/riff.jsView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.0.0 | Introduced. |