Fires as the track plays, a few times a second, and again after a seek.
Also dispatched as the riff:time event on #riff, with the same detail. The event bubbles.
Parameters
detailObject- Where the track is.
trackObjectThe track.timenumberSeconds from its start.durationnumberIts length in seconds, or 0 until known.
apiObjectwindow.riff.
More Information
Usage
wp.hooks.addAction( 'riff.time', 'my-plugin', ( detail, api ) => {
} );
// Or, without wp-hooks:
window.riff.on( 'time', ( detail ) => {} );Source
emit( 'time', {
track: P.track(),
time: m.currentTime,
duration: Number.isFinite( m.duration ) ? m.duration : 0,
} );plugins/riff/assets/player/media.jsView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.32.0 | Introduced. |