Everything here describes itself: send OPTIONS to a route for its arguments and schema. The tables below come from the same registration code.
The track on media
Every audio and video item in wp/v2/media carries riff_track: The file as a track the player reads; null for files that are not audio or video. It is read only, and null for any other file. Its shape is the track schema.
GET /wp-json/wp/v2/media/123?_fields=id,riff_trackRoutes
GET /riff/v1/library
riff-library
Arguments
| Name | Type | Description |
|---|---|---|
page | integer | Page of the library. Default 1. |
Response
| Property | Type | Description |
|---|---|---|
items | array | |
items[].id | integer | Post ID. |
items[].title | string | Post title. |
items[].url | string | Permalink. |
items[].artist | string | The artist every track shares, or empty. |
items[].art | array | Artwork, smallest first. |
items[].art[].src | string | |
items[].art[].sizes | string | |
items[].count | integer | Number of tracks. |
items[].meta | string | A one-line byline for the post, written by a feature that knows how to say it in the language. |
items[].duration | number | Total length in seconds, 0 when unknown. |
page | integer | |
pages | integer | |
total | integer |
GET /riff/v1/library/{id}
riff-library-post
Arguments
| Name | Type | Description |
|---|---|---|
id | integer Required | Post ID. |
Response
| Property | Type | Description |
|---|---|---|
id | integer | Post ID. |
title | string | Post title. |
url | string | Permalink. |
artist | string | The artist every track shares, or empty. |
art | array | Artwork, smallest first. |
art[].src | string | |
art[].sizes | string | |
count | integer | Number of tracks. |
meta | string | A one-line byline for the post, written by a feature that knows how to say it in the language. |
duration | number | Total length in seconds, 0 when unknown. |
tracks | array | The tracks, in order, as the player reads them. |
html | string | The media blocks rendered as the post renders them. |
WPGraphQL
When WPGraphQL is active, Riff adds these fields and types.
| Field | Description |
|---|---|
MediaItem.riffTrackRiffTrack | The file as a track, for audio and video. |
Post.riffTracks[RiffTrack] | The tracks in the post, in order. |
RiffArt
One size of a track's artwork.
| Field | Type |
|---|---|
src | String |
sizes | String |
RiffVideo
The video version of an audio track.
| Field | Type |
|---|---|
src | String |
poster | String |
RiffPost
The post a track appears in.
| Field | Type |
|---|---|
id | Int |
title | String |
url | String |
RiffTrack
A file as a track the Riff player reads.
| Field | Type |
|---|---|
id | String |
src | String |
type | String |
title | String |
artist | String |
album | String |
duration | Float |
format | String |
bitrate | Int |
lossless | Boolean |
bits | Int |
rate | Int |
levels | String |
art | [RiffArt] |
video | RiffVideo |
post | RiffPost |