Media integrated with the game world
Playback needed to combine an external catalog, persistent library and spatial audio without trusting the NUI to control shared sessions.
I developed a music player integrated with FiveM, combining a React interface with a Lua backend and MariaDB persistence. It brings together playback, library, playlists, lyrics and spatial audio, with critical actions validated on the server.
Playback needed to combine an external catalog, persistent library and spatial audio without trusting the NUI to control shared sessions.
Bring search, player, queue, favorites, playlists and lyrics into an interface connected to the world state and nearby players.
I developed the React NUI, Lua session and proximity engine, MariaDB persistence, and catalog and lyrics adapters.
The server validates owner, entity, model, distance, routing bucket and revision before creating or changing a session.
A spatial index distributes only relevant upserts and removals to each player, avoiding global session broadcasts.
Catalog and lyrics use isolated contracts, caching, request coalescing, timeouts, negative caching and backoff.
The NUI brings together search, playback, queue, lyrics, favorites and playlists. Each action connects to the resource’s client and server.
The demo shows the original interface in Brazilian Portuguese.
The experience is divided into layers with clear responsibilities across interface, client, server, data and integrations. Select a layer to explore the details.
The NUI handles catalog, library, queue, lyrics and playback. Named callbacks connect the interface to the game, while the audio engine selects YouTube or SoundCloud and discards outdated session revisions.