RadioPlayerMount
Client bridge between the imperative mountRadioPlayer widget engine and the React RadioPlayerBar UI. Props: optional autoplay (default false).
Context
Reads useRadioPlayer() for registerPlayer, unregisterPlayer, stationDefinitions, and stationAvailabilityByName.
Mount lifecycle (useEffect)
- Adds
has-radio-playerondocument.bodywhile mounted. - Builds stations via
buildRadioStationCatalog(stationDefinitions). - Calls
mountRadioPlayer(host, { autoplay, stations, stationDefinitions, headless: true })into a hidden hostdiv(engineHost,aria-hidden,data-testid="radio-player-host"). - Registers handle with context via
registerPlayer. - Cleanup:
unregisterPlayer(),destroy()on widget handle, removes body class, clears--irp-bar-heightand--irp-dock-heightondocument.documentElement.
Re-runs when autoplay, stationDefinitions, or register/unregister callbacks change.
Availability diagnostics
Separate effect waits until every station has left pending availability state. If zero stations are available, logs unreachable streams through logRadioPlayerUnavailable with name, url, and reason (for support consoles).
Render tree
Hidden engine host + visible RadioPlayerBar. Audio playback and analyser wiring live in the widget; bar components consume the registered handle from context.
Sources: src/app/components/radio-player/RadioPlayerMount.tsx, @lib/context/RadioPlayerContext, @widgets/radio-player/radio-player, @widgets/radio-player/radioStationCatalog, @widgets/radio-player/radioStationBrowse, @widgets/radio-player/probeRadioStations