Shares the player docked at the bottom of every page with the whole app. The cards and previews that start playback read and drive it, and GlobalPlayer draws it. It is two contexts, one for the queue and the controls and one for the playhead alone, which changes several times a second. PlayerProvider provides both around the whole app.

Functions

f
playerItemKey(item: PlayerItem): string

Returns a key that identifies item whatever its stream URL, so that a re-resolved track is still the same track. GlobalPlayer keys its tracklist on it and tells a new item by it; PlayerProvider tells repeated failures of one track by it.

Interfaces

I
PlayerContextValue

Provided by PlayerProvider through PlayerContext. Cards and previews read what plays and call the controls; GlobalPlayer and MediaPlayer use the internal fields to report the media's state back.

I
PlayerItemBase

The fields of every PlayerItem, which GlobalPlayer's header shows.

I
PlayerTimeValue

Provided by PlayerProvider through PlayerTimeContext, apart from the rest because it changes several times a second while something plays. Only what draws a position, like the dump page's audio preview, reads it, so the cards that read PlayerContext don't re-render with it.

Type Aliases

Variables

v
defaultPlayerValue: PlayerContextValue

Given by PlayerContext outside PlayerProvider: nothing plays and no control does anything. The tests' render helper starts from it.

v
PlayerContext: React.Context<PlayerContextValue>

The player's state and controls, from PlayerProvider.

v
PlayerTimeContext: React.Context<PlayerTimeValue>

The playhead of the current file or stream, from PlayerProvider.