five-on-it / apps/client/src/audio/radio
apps/client/src/audio/radio
The radio, as in GTA: a car's radio plays one of the stations (radio-stations.ts), each live on its own clock (radio-timeline.ts), so tuning in lands in the middle of whatever is on. It is the player's alone (nothing of it goes to the server). Getting into a car plays what that car played last, or, when the settings turn the radio on in cars, a station of the car's own for a car never sat in (a stolen car has something on already); getting out silences it, unless the settings keep the radio on foot, through earbuds, when it plays on and tunes on foot too. A two-wheeler or a bicycle has no radio: on one, it is as on foot. A station's items play one after another, an item that will not play skipped ("no signal" when none will). Held while the game is, and back to the station's live moment after. What plays an item is a RadioDeck (an <audio> element: radio-deck.ts; the tests give a fake).