Fires when a view opens or closes, Riff's own included, and again for an open view when the track changes. A view's script fills it here, or in the render it was given.
Also dispatched as the riff:view event on #riff, with the same detail. The event bubbles.
Parameters
detailObject- What changed.
idstringThe view's id.openbooleanWhether it is open now.viewHTMLElementIts region:[data-riff-view="<id>"]for a screen of its own,[data-riff-panel="<id>"]for a panel, and Now Playing itself for the album or the turntable.trackObject|nullThe track playing.
apiObjectwindow.riff.
More Information
Usage
wp.hooks.addAction( 'riff.view', 'my-plugin', ( detail, api ) => {
} );
// Or, without wp-hooks:
window.riff.on( 'view', ( detail ) => {} );Source
emit( 'view', {
id,
open: isNowOpen,
view: v?.el || P.np,
track: P.track() || null,
} );plugins/riff/assets/player/registry.jsView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |