| context | AudioBrowser |
|---|
Domain glossary for the library. Audience: contributors working across the TypeScript, Kotlin, and Swift layers, plus library users integrating it into an app.
This file is a glossary, not a spec. For architectural decisions see docs/adr/. For implementation details see the per-platform CLAUDE.md and ARCHITECTURE.md files (ios/CLAUDE.md, android/CLAUDE.md, ios/ARCHITECTURE.md, android/ARCHITECTURE.md); the docs site's conventions are in website/CLAUDE.md.
yarn vocab-check holds its format: every entry a ### Term heading, bold only for a link to an entry, _Avoid_: a terse list whose first sentence is the list.
The library, and the JS namespace through which its public API is reached. Owns the Browser and the Player.
Avoid: Module, SDK, AudioModule.
The navigation subsystem within AudioBrowser, exposing a single tree that powers both in-app browsing and the browse views of External Surfaces (Android Auto, CarPlay). Owns the BrowseTree, Routes, Tabs, and Search.
Avoid: Navigation, MediaBrowser (the Android platform class).
The playback subsystem within AudioBrowser. Receives Playable Tracks and streams them.
Avoid: Engine, AudioEngine.
The media stack under the Player on iOS: the AVPlayer and its items, media loading, now playing, the remote commands and the audio session's activation and release. It carries out what the Player decides and reports what it observes; it holds no playback policy.
Not a name for the Player itself. See ADR 0012.
Avoid: backend, driver, effect handler.
A position in the BrowseTree, expressed as a slash-delimited string (e.g. /albums/abbey-road). Passed to navigate(path); Routes match against Paths to resolve content. See "Flagged ambiguities" — distinct from the HTTP RequestConfig.path.
Avoid: URL, route, address (when referring to the tree position).
A binding from a path pattern to a BrowserSource. Patterns support {param}, *, and **; the most specific match wins.
Avoid: Endpoint, handler, mapping.
A top-level navigation entry shown in the tab bar of the browser UI. A Tab is not a Section — Sections live inside pages.
Avoid: Section, category.
The voice- and text-driven query subsystem. Receives structured SearchParams — one cross-platform shape normalized from both iOS (SiriKit INMediaSearch) and Android (MEDIA_PLAY_FROM_SEARCH) voice/text intents — and returns a Track[]. The per-platform parsers absorb the wire differences; the SearchParams they emit is identical.
Within it, mode is the container vertical (what kind of result: station / podcast / song / …), orthogonal to the filter props (genre / artist / album / title / playlist). reference is the media-reference axis ('my' = the user's own collection, routed to Search; "currently playing" is resolved natively and never reaches Search).
Avoid: Query, lookup. For mode, avoid conflating the vertical with the filter props.
Anything that can produce children for a path: the value of a routes entry, or of a route config's browse.
It comes in three shapes, each producing a ResolvedTrack: a static one with inline children, a callback that returns one, or a TransformableRequestConfig that points at a JSON ResolvedTrack-shaped endpoint.
tabs: and search: take their own source types (TabsSource, SearchSource), which produce a Track[]; the top-level browse: is a Request-Config Layer, not a BrowserSource.
Avoid: Provider, handler.
The navigable tree of Tracks exposed by the Browser. Browsable Tracks have children; Playable-only Tracks do not.
Avoid: Content tree, media tree, hierarchy.
The universal content type in the BrowseTree. A single Track is Browsable or Playable, depending on which fields are set; one with both is treated as Playable (see Playable). The name is a misnomer carried for platform-alignment reasons — see "Flagged ambiguities".
Avoid: Item, Node, MediaItem (those names belong to the platform SDKs). In public prose, lowercase “entry” is acceptable as a loose UI noun when the concrete content kind is unknown, but Entry is not a domain type.
A Track that has a path and resolves to children when navigated into. A shape of Track, not a separate type.
Avoid: Folder, Container, Directory.
In guides, use Browsable for the abstract shape: a Track with a path that opens a Path and resolves to children. Do not replace it with a universal noun such as Folder, Container, Directory, Node, or Item.
When referring to a concrete thing in the BrowseTree, prefer the domain noun the integrator or listener would recognize: tab, album, playlist, category, show, station or collection. Use lowercase “entry” only as a loose prose fallback when the concrete kind is unknown; do not promote Entry to a glossary term.
Keep the layers distinct:
- A Tab is a top-level navigation entry.
- A Path is the slash-delimited address navigated to.
- A Route is the binding that resolves a Path.
- A Browsable Track is the Track shape with a
path. - The resolved children for a Path are its content, not the tab or route itself.
Example:
- Prefer: “A child with a
pathis browsable and opens another Path.” - Prefer: “Re-fetch the
/favoritescontent.” - Avoid: “A child with a
pathis a folder.” - Avoid: “Re-fetch the Favorites tab.”
A Track that has a src and can be streamed by the player. A shape of Track, not a separate type.
A Track may carry both path and src, but current surfaces treat such a track as playable. src wins the rendering (CarPlay row style, Android Auto's mutually-exclusive isPlayable/isBrowsable flags), and the browse pipeline replaces a playable track's path with its contextual path anyway.
Genuinely combined items — tap to play or drill in — are a future item (see FUTURE.md, "Browsable + Playable Combined Items").
Avoid: Leaf, Song, Media.
What makes two Tracks the same item: the Track's id when set (non-empty), falling back to its src. Android also treats a whitespace-only id as unset, while JS and iOS don't, so never send one.
The single comparison rule everywhere Tracks are compared — favorites matching, the CarPlay / Android Auto now-playing row indicator, section scoping and skip-in-place, and contextual queue re-expansion. Compared whole: never a substring, never parsed out of a URL. A Browsable-only Track has no Identity — it is addressed by its Path.
Avoid: key, uid (a consumer-side concept).
The path the browse pipeline stamps onto a Playable Track: {parentPath}?__trackId={identity}&__index={position}. Carries the page the track was rendered on so a later tap or resumption can re-expand its queue (ADR 0006).
__trackId is the Identity check; __index — the flat page position at stamp time (children concatenated in Section order) — is only a tie-breaker between surfaces carrying the same Identity, so a stale index can never select a different track (ADR 0009).
Avoid: contextual URL in new prose (legacy alias in code comments), deep link.
A titled, styled group of Tracks within a resolved page — the unit of queue scope, declared, not derived and never rendering-dependent (ADR 0010).
A page's canonical shape is sections; a plain children list is authoring sugar for one untitled Section. Its Style block declares the requested presentation; each surface renders its nearest supported form.
Avoid: group, category; Section for a Tab (Tabs are top-level navigation, Sections live inside pages).
The type of the browser's resolved content (getContent(), useContent(), onContentChanged) — a Track that has gone through the browse pipeline. Media URLs are not part of resolution; they're transformed at playback time.
Compared to the declared Track form an app/API supplies, a ResolvedTrack carries the transformed artworkSource (ready for <Image>) and an optionally hydrated favorited flag. A Browsable ResolvedTrack also carries populated sections (a page authored with plain children resolves to one untitled Section).
Avoid: ExpandedTrack, LoadedTrack.
The resolved form of a Browsable Track — what the browser's content becomes once it is navigated to (a ResolvedTrack). A Page is the Track, now open, acting as the container of its Sections: its Style block is a container's block, declaring for everything on the page.
Not a separate kind of thing — a Track in its container role, which begins at resolution; before that, the Track is a handle whose block styles only the handle.
Avoid: screen, folder, level, "defaults tier" (a Page is a container, not special styling machinery).
The declaration block of presentation properties carried by a Track, a Section, or a Page (style). Declarations are aspirational: each surface renders the properties it understands and ignores the rest — inert, never an error.
Presentation-only: no style property affects queue scope, playback, or navigation. Facts with behavioral weight (Disabled, Favorited) are Track fields, not style.
Avoid: hint (the retired platform-prefix era), flag, option.
A style property whose value flows to the items within a Page — track ?? section ?? page — unless a closer block declares its own (artworkRendering, imageShape, accessorySymbol, cardTint, cardImage).
Admission test for any future one: "if set on a browsable parent, should its resolved descendants inherit it unless overridden?" Inheritance never crosses resolution.
Avoid: cascading (CSS's cascade resolves competing declarations for one element — this model has no competing declarations, only inheritance and scope).
A style property stating a fact about a container rather than its items (gridWrap, gridTile). Resolved by scope override, not inheritance: the Page declares for its whole scope, a Section overrides for its own children — two declarations about the same rendering decision at different widths, the narrower winning.
The positional display is its own third category — each holder describes its own children, never its descendants — but resolves between containers by the same scope override.
Avoid: fallback (the section isn't missing anything), inherited (container properties never flow to items).
A content fact on a Track: the item is unavailable. A Disabled Track never plays through anything the library builds or refuses on its behalf — tap and voice selection are refused, queue expansion and search-built queues exclude it, resumption refuses it.
A queue the consumer builds themselves (setQueue) is the consumer's own list — the library does not filter it. Where a surface can draw unavailability it renders grayed and inert; where it can't, the Track is hidden — never a normal-looking dead control.
(App UIs render from the raw page and must honor the fact themselves.) A fact, not a Style: it travels on the Track.
Avoid: grayed-out, hidden (renderings of the fact, not the fact), isEnabled (the platform knob it maps onto).
An optional per-Track callback that produces a RequestConfig from a Track's metadata. Used by the media and artwork request pipelines when the request needs Track fields (artist, album, src) to be built.
Avoid: Build, generate.
The last step of a browse, search or artwork request, applied to the merged RequestConfig just before it goes out. For media, the per-Track Resolve runs after it and wins, so a media Transform cannot sign a URL that Resolve produced.
Used to sign URLs, attach auth tokens, or fold in size hints. Optional.
Avoid: Finalize, sign, decorate.
One config in the outbound-request stack, applied base-up: request (shared) → kind (browse / search / media) → route (per-Route). A Request-Config Layer with a Transform replaces the running config entirely (transform-wins); otherwise its static fields merge over it — except path, which is carried from the base (only a Transform may change it).
buildApiRequest / applyLayers are the canonical application of the stack. Artwork configs are not applied as Request-Config Layers: their static fields merge override-wins, so a nowPlayingArtwork like { path: "/artwork/{id}" } can supply the path.
Avoid: Layer (unqualified — too generic), stage, level.
The Player's working list of Tracks. Has a current index (the Active Track), a repeat mode, and a shuffle order.
Avoid: Playlist (a playlist is a Browser concept — user-curated content), playback list.
The Track at the Queue's current index. The Track that is (or would be) playing. Distinct from Now Playing — Active Track is queue state, Now Playing is display metadata.
Avoid: Current Track, Playing Track.
The display metadata surfaced on lockscreen / notification / CarPlay / Android Auto. Mirrors the Active Track's metadata by default. The live-stream use case: the station stays as the Active Track while Now Playing reflects the current song.
On iOS and Android, three layers sit above it, highest first: a transient flash (flashNowPlaying()), the nowPlaying formatter set in setupPlayer(), and an override (updateNowPlaying()). Each sets only the lines it returns. On web there is only the override; a flash replaces it for its duration and clears it on revert.
Avoid: Lockscreen info, Notification info, Media metadata.
A device other than the phone that plays the Active Track on Android: a Cast receiver or a Sonos room, chosen in the system's output switcher. It plays one item at a time; the Player keeps the Queue and sends it the next item when one ends. See ADR 0013.
Avoid: Cast device (Sonos is one too), route (the system's word for any output, the phone's included), renderer.
The player of the Remote Output that plays: what the Player sends an item to, and what reports that item playing, ended or failed. Unrelated to the OutputType value 'receiver', the phone's earpiece; see "Flagged ambiguities".
Avoid: remote player, target.
Three closely-named concepts that sound interchangeable but are not.
The player's state machine label. One of nine values: none, ready, loading, buffering, playing, paused, stopped, ended, error. Low-level — UI code should usually consume PlayingState instead.
Avoid: PlayerState, EngineState.
Whether the user wants playback to start automatically when the Active Track has loaded and buffered. Calling play() sets it to true, pause() to false. Independent of PlaybackState.
Avoid: AutoPlay, ShouldPlay.
The UX-level state: a struct of two booleans { playing, buffering }. Derived from PlaybackState + playWhenReady. What a play/pause button and loading spinner should bind to.
Avoid: PlaybackStatus, PlayingFlags, UIState.
The normalized, cross-platform classification of why playback failed. Each platform maps its own native failure onto this set (AVFoundation on iOS, ExoPlayer on Android, Shaka on web), so an app can branch on it without knowing which engine produced it.
The only part of a PlaybackError that may drive user-facing copy. The parallel of NavigationErrorType on the browsing side.
Avoid: error type, error category, error reason.
A failure carrying no evidence of a cause takes the catch-all Kind rather than being guessed into a more specific one. A wrong classification both misleads the listener and corrupts the telemetry aggregates the Kind exists to make possible.
The raw native failure identifier carried alongside the Kind, for diagnostics and telemetry only. Not a contract: its values are the underlying engine's own, so they differ per platform and change with it. Never branch on it, never show it.
Avoid: treating it as an enum.
One track's playback session: created when a track becomes current (selection, queue advance, skip) or restarted from a terminal error (retry(), or play while in error), surviving every automatic retry reload of that track.
The unit that retry budgets, the hasPlayed flag, and advisory-error deduplication are scoped to. A new load starts fresh; retries within one don't.
Avoid: request, attempt (an attempt is one try within a load).
A classified PlaybackError surfaced while automatic retry is still working on it — retrying: true, attached via onPlaybackChanged to a non-terminal playback state, so UIs can show the cause over a spinner.
Provisional by definition: it clears when playback recovers, or hardens into a terminal error (state error, retrying absent) when the retry budget runs out. Terminal errors alone fire onPlaybackError.
Avoid: warning, soft error, pending error.
On iOS, the Player's one record of what is wrong with the current Load: none, an Advisory (Retrying) Error, or a terminal error.
Retrying and terminal are states of one value rather than a flag beside an error, so an error can't be cleared or hardened without the change being published.
Avoid: isRetrying, error flag.
The two duration bounds on automatic retry. The recovery budget gives up after two minutes of silence: the listener wants audio and hears none, and only 5 s of audio in a row ends it. A load that has never rendered audio (hasPlayed) also gives up 12 s after its first failure within one online stretch: the first-connect budget. The defaults are on RetryConfig.
Durations bound the give-up promise; maxRetries counts only connections in a row that delivered nothing. See ADRs 0004 and 0014.
Avoid: retry limit, timeout (both suggest a single number).
Static metadata about the playing track, delivered by onTrackMetadata. On iOS it is extracted from the media file's container or tag frames (ID3, MP4 atoms) at load time. That is what the file says about itself, distinct from a Track's own app-provided fields, which share names like title and artist.
On Android it is Media3's merged metadata: the Track's fields and the Now Playing lines win over the file's tags, and it fires again whenever they change.
Avoid: TrackInfo, MediaMetadata.
Metadata streamed mid-playback — ICY frames from Shoutcast/Icecast or in-band ID3 frames from HLS. On iOS, a file without chapters also emits its own tags on load, as one TimedMetadata per metadata format.
The library does not auto-apply it to Now Playing. Usually the nowPlaying formatter in setupPlayer() picks the fields to show, since the library re-runs it on each TimedMetadata update; without a formatter, the app forwards them via updateNowPlaying(). This is the live-radio data flow.
Avoid: StreamMetadata, ID3Event.
The image that represents a Track or Section — album art, a station logo, a tab's symbol standing in for the tab's content. Iconography that annotates an item rather than represents it (accessory badges, button glyphs, playing indicators) is a symbol (an SF Symbol name).
"Image" is the generic word, not a banned one: an Artwork is an image, and layers that handle any picture (ImageSource, a platform UIImage) rightly say so.
Library-defined names prefer the most specific applicable role (artwork, artworkSource, artworkRendering). Passthrough properties that mirror a platform knob keep that platform's own term (imageShape is CarPlay's word): the property's meaning is the platform's rendering contract, so the platform's word is the honest one.
Avoid: icon (say Artwork or symbol, by role), thumbnail, cover.
Any non-app integration that the library drives or receives input from. Includes: iOS lockscreen / Control Center, Android notification, CarPlay, Android Auto, Wear OS, AAOS (Android Automotive), and Bluetooth / car head units. Surfaces vary in capability — some browse the tree, some only show Now Playing, some only send Remote Commands.
Avoid: External controller, media controller (both are used in the codebase but conflate display-only, browse-capable, and input-only surfaces).
An input event from an External Surface — play, pause, next, previous, seek, favorite, etc. Surfaced via onRemote* callbacks; optional handleRemote* callbacks let the app override default Player behaviour. The favorite heart is the exception: it surfaces through onFavoriteChanged, after the library has already applied it, and has no handleRemote* override.
Avoid: Remote event, remote action.
A flag controlling whether a specific control is available on External Surfaces. Disabling a Capability hides the corresponding control and prevents the matching Remote Command from firing. Distinct from Remote Command: a Capability is what's configured, a Remote Command is the event fired when an available Capability is invoked.
Avoid: Permission, Feature flag, Control.
A button an External Surface draws, which emits a Remote Command when tapped — skip, jump, favorite. Distinct from a Capability: a Capability decides whether the button may exist at all, a Remote Button is the thing rendered. Android only; CarPlay's now-playing buttons are configured separately.
Avoid: Notification button, player button, control button.
The arrangement of Remote Buttons on Android, published once and honoured by every Android External Surface — notification, Android Auto, and the Android 13+ system media controls.
Has exactly three positions: back and forward either side of play/pause, and overflow for the rest. A layout describes the whole arrangement; omitting it derives one from the Capability flags.
Avoid: Notification buttons, slots (a Media3 implementation term — back/forward/overflow are the domain names).
A boolean on a Track marking it as a user favorite. Toggled programmatically or via the heart button on an External Surface. The library's domain vocabulary has no Rating concept.
A favorites collection is app-owned/user-owned content. The library tracks Favorited state on Tracks and keeps surfaces in sync; the app owns where the favorites collection is stored, how it is persisted, and how a favorites Path resolves to Tracks.
Hydration matches the app's declared identifiers against each Track's Identity; a caller-set favorited on a Track wins over hydration for display but never fills the cache.
Avoid: Rating, hearted, liked, starred.
An app-imposed block on browsing and Search from External Surfaces, set with setGate and cleared with clearGate at runtime. Generic by design: subscription, login, and region blocks are all Gates.
While a Gate is up, Tabs stay visible, but a gated browse level shows a single message in place of its content: a full-page view on CarPlay, a list tile on Android Auto. A gated search on Android Auto shows the same tile as its only result; a gated voice play-from-search (Siri, Google Assistant, including from the phone) is refused.
An optional resolver decides per request, by browse path or search query, whether that request is gated. If the resolver throws, the request is gated. The Player, the Queue, and Now Playing are unaffected: a Gate blocks finding content, never hearing it.
Avoid: Browse Gate (its former name, still on the internal iOS type BrowseGate), Paywall (one app's reason for a gate, not the concept), error page (a gate is deliberate app state, not a NavigationError), lock screen (that's an External Surface).
- A Browser holds zero or more Routes, any number of Tabs, and optionally one Search. Car surfaces show only as many Tabs as they allow: see Tabs and the initial path.
- The Browser produces ResolvedTracks; the Player consumes their Playable Tracks via the Queue.
- A Queue holds zero or more Tracks and has at most one Active Track.
- A live stream emits TimedMetadata; the app may pass fields to Now Playing through the formatter or the override.
- The
mediaandartworkrequest pipelines accept a per-Track Resolve; every request accepts a Transform, the last step for browse, search and artwork; formedia, Resolve runs after it. - External Surfaces display Now Playing, may browse the BrowseTree, and emit Remote Commands.
- A Capability controls whether a matching Remote Command can be invoked from an External Surface.
- A Gate blocks the BrowseTree and Search on External Surfaces, but never the Player, the Queue, or Now Playing.
- A Track is Favorited independently of being the Active Track — favoriting is set on the Track, not on the Queue.
- A favorites collection belongs to the app/user; Favorited is the per-Track state the library keeps synchronized across surfaces.
- A Page is a Browsable Track in its container role; its Style declares for the whole page, a Section's overrides it for that section's children, and a Track's styles the Track itself.
Contributor: "My radio integration calls
updateNowPlaying({ title })when stream metadata arrives, but the notification keeps flickering back to the station name."Maintainer: "Now Playing snaps back to the Active Track's metadata whenever the Active Track changes. For a stream, the Active Track is the station: leave it, and keep calling
updateNowPlaying. The two diverge by design: the Active Track is what's in the Queue, Now Playing is what's currently being heard."Contributor: "Can the override swap the artwork for the current song's cover?"
Maintainer: "No —
updateNowPlayingchanges only the text lines: title, artist and album. The artwork still comes from the Active Track: throughnowPlayingArtworkwhen you set it (iOS and Android only), otherwise throughartworkor the track's own artwork."
-
srcvspathon a Track. Both are string fields and easy to mix up.pathis the navigation address in the BrowseTree — its presence makes the Track Browsable.srcis a media identifier (usually an audio URL) — its presence makes the Track Playable.A Track may carry both, but surfaces currently treat that as playable —
srcwins; see Playable. When in doubt: ask "do I navigate into this or stream this?" -
idis the Playable Track's Identity when present. A Track's Identity is itsidwhen set (non-empty), falling back to itssrc— one rule, applied at every comparison site (favorites, the now-playing row indicator, section scoping, skip-in-place, contextual queue re-expansion).The fallback is per-Track, not per-comparison: a Track carrying an
idcompares by that id alone, so a row with anidnever matches a track that only has asrc— mixed id-presence never matches. Assign ids consistently, everywhere or nowhere. -
"path" has two senses, and both are fields named
path. A tree address (/albums/abbey-road, the navigation primitive,Track.path) and an HTTP request path (/api/v2/albums/123/tracks,RequestConfig.path).The two never co-occur on the same object — a Track is not a RequestConfig — but the same string can appear in both roles when a Route forwards a tree path into an HTTP request.
Sharing the name is deliberate: the tree-address field was previously called
url, which this glossary itself flags as the word to avoid for a tree position. Disambiguate by the owning type, not by renaming. -
bufferingnames both aPlaybackStatevalue and aPlayingStateflag. ThePlaybackStatevalue means the player is fetching more data after the initialloading. ThePlayingStateboolean is derived: true inloadingorbufferingwhile the player intends to play (on Android, not during a transient audio-focus loss, thoughplayWhenReadystays true). UI should bind to thePlayingStateflag. -
"Rating" is a platform concept, not a library concept. Android (
MediaSession.setRatingType) and iOS (MPFeedbackCommand) expose generalised Rating APIs supporting thumbs / stars / percentages / hearts. This library uses only the heart variant and surfaces it as Favorited.Rating survives only inside the Android layer (
RatingFavorites.kt), which maps the heart rating onto Favorited. It has no public API. -
Tabs and Search look like Routes internally. At the native layer,
tabs:andsearch:(and aroutes['*']default) are flattened into the same route table as user-declared routes, using magic paths__tabs__,__search__, and__default__.This is an implementation detail — domain-wise a Tab is not a Route; it's a top-bar navigation entry, and Search is a voice/text query handler. Don't promote the magic paths to the public vocabulary.
-
'receiver'as anOutputTypeis the earpiece, not a Receiver.getOutput()anduseOutput()reporttype: 'receiver'when audio plays through the phone's built-in earpiece, on iOS and Android. The name is iOS's for that route (builtInReceiver); Android calls it the earpiece.A Receiver is the player of a Remote Output, which reports as
'cast','sonos'or'remote', never'receiver'. -
"Track" is overloaded. It names the universal content type in the BrowseTree, but in everyday English a track is a song. A Track called "Jazz" with no
srcand 12 children does not behave like a track.This is intentional — Android Auto's
MediaItemand CarPlay'sCPListItemboth model the browse tree with a single polymorphic type, and aligning with that shape is cheaper than fighting it. Tracked in #39.