Developers

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

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.
  • trackObject
    The track.
  • timenumber
    Seconds from its start.
  • durationnumber
    Its length in seconds, or 0 until known.
apiObject
window.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,
} );

Changelog

VersionDescription
4.32.0Introduced.