Track schema

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.

PropertyTypeDescription
idstringThe attachment ID, or "url:" and a hash for a file outside the Media Library.
srcstring
typestring One of audio, video.
titlestring
artiststring
albumstring
yearintegerThe year from the file's tags, or 0.
discintegerWhich 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.
durationnumberSeconds, 0 when unknown.
langstringThe language of the title and artist, as a lang attribute takes it, from the file's tags; empty when the file does not say.
formatstringThe container, lower case, as WordPress read it from the file: mp3, flac, m4a. Empty when unknown.
bitrateintegerKilobits per second, 0 when unknown.
losslessbooleanWhether the encoding is lossless.
bitsintegerBits per sample, as WordPress read it from the file; 0 when the format does not say, as MP3 does not.
rateintegerSamples per second, 0 when unknown.
levelsstringThe 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.
artarrayArtwork, smallest first.
art[].srcstring
art[].sizesstring
art[].altstringWhat the picture shows, for a screen reader: the image's alt text, or the album and artist a drawn cover names.
captionsarrayText tracks for a video: the WebVTT file its Captions field names, or the tracks its video block carries.
captions[].srcstring
captions[].labelstring
captions[].srclangstring
captions[].kindstring One of captions, subtitles, descriptions.
videoobject | null
video.srcstring
video.posterstring
video.captionsarray
video.captions[].srcstring
video.captions[].labelstring
video.captions[].srclangstring
video.captions[].kindstring One of captions, subtitles, descriptions.
postobject | null
post.idinteger
post.titlestring
post.urlstring
lockedbooleanWhether the current visitor may not play the track, as riff_can_play decided. A locked track has no src.
unlockstringWhere a locked track sends the visitor to unlock it, from riff_unlock_url. Empty otherwise.