One shape for a track: the REST field and routes, the block markup and the player script all use it, and WPGraphQL carries all of it.
Properties
It is Riff\Tracks::schema(), version 1, and a track still matches it after the riff_track filter.
| Property | Type | Description |
|---|---|---|
id | string | The attachment ID, or "url:" and a hash for a file outside the Media Library. |
src | string | |
type | string | One of audio, video. |
title | string | |
artist | string | |
album | string | |
year | integer | The year from the file's tags, or 0. |
disc | integer | Which disc of a set the track is on, from the file's disc number tag (1 for "1/2"), or 0 when the tags do not say. |
duration | number | Seconds, 0 when unknown. |
lang | string | The language of the title and artist, as a lang attribute takes it, from the file's tags; empty when the file does not say. |
format | string | The container, lower case, as WordPress read it from the file: mp3, flac, m4a. Empty when unknown. |
bitrate | integer | Kilobits per second, 0 when unknown. |
lossless | boolean | Whether the encoding is lossless. |
bits | integer | Bits per sample, as WordPress read it from the file; 0 when the format does not say, as MP3 does not. |
rate | integer | Samples per second, 0 when unknown. |
levels | string | The track's loudness over time as digits 0 to 9, one per sample, when something has measured it; the drawn cover puts it in the groove. Empty otherwise. |
art | array | Artwork, smallest first. |
art[]. | string | |
art[]. | string | |
art[]. | string | What the picture shows, for a screen reader: the image's alt text, or the album and artist a drawn cover names. |
captions | array | Text tracks for a video: the WebVTT file its Captions field names, or the tracks its video block carries. |
captions[]. | string | |
captions[]. | string | |
captions[]. | string | |
captions[]. | string | One of captions, subtitles, descriptions. |
video | object | null | |
video. | string | |
video. | string | |
video. | array | |
video. | string | |
video. | string | |
video. | string | |
video. | string | One of captions, subtitles, descriptions. |
post | object | null | |
post. | integer | |
post. | string | |
post. | string | |
locked | boolean | Whether the current visitor may not play the track, as riff_can_play decided. A locked track has no src. |
unlock | string | Where a locked track sends the visitor to unlock it, from riff_unlock_url. Empty otherwise. |