Features

Music (fx-musicapp)

The bundled music streaming app that plays out loud in the world, how it installs into the phone and its main settings.

#What it is

fx-musicapp is a music streaming app with search, playlists and a queue.

  • Sources. Search YouTube by name, paste a link, import a Spotify or YouTube playlist, add a direct audio URL, or play from a library and radio stations the server defines.
  • The phone is a speaker. Music comes out of the phone, positioned in the world. Nearby players hear it, it falls off with distance, and it is muffled through a closed car or a wall.
  • CarPlay. Connect the phone to the car you are in and the music moves to the car. Windows down carries it further. Walk too far and the link drops.
  • Background playback. Music keeps playing with the phone closed. On FX Phone the controls also appear in the lock-screen music tray and the Dynamic Island.
  • Per player. Playlists, favourites, history, volume, theme, language and crossfade are saved per player.
  • Playlist sharing with a nearby player, who approves and receives a copy.

#Requirements

Resource Required
fx-phone Yes (the app also installs into lb-phone or cylex_phone)
oxmysql Yes
fx-sound or xsound Yes, pick one
MySQL 8.0+ or MariaDB 10.4+ Yes

Works with ESX, QBCore, Qbox or standalone, detected automatically. For anything else, fill in bridge/custom.lua.

#Installation

cfgensure oxmysql
ensure fx-phone
ensure fx-sound
ensure fx-musicapp

fx-musicapp must come last. Then run setup/sql/install.sql against your database. It is safe to run twice.

Set the audio backend in config.lua:

Config.Audio.Backend Needs What you get
'fxsound' fx-sound 3D audio, low-pass muffle through car bodywork and walls, bass boost
'xsound' xsound Volume and distance only, no filters

If the chosen backend is missing, the app still opens and browses but nothing plays, and the server console says what to install. See Sound (fx-sound).

#How it registers into the phone

The phone is not a manifest dependency. With Config.Phone.Resource = 'auto' the app looks for a running phone at startup and installs itself; the console names the one it picked.

The FX Phone adapter (client/phone/fxphone.lua) calls exports['fx-phone']:AddCustomApp with Config.Phone.AppIdentifier (default fx_music), AppName, Developer, Icon, DefaultApp and Size. Notifications use SendNotification with the track cover as thumbnail, and messages to the page go through SendCustomAppMessage.

To keep the app from starting at all, set ['fx-musicapp'] = false in Config.BundledApps. See Apps.

#Config highlights

config.lua:

Setting Meaning
Config.Framework auto or a fixed framework
Config.Locale, Config.Locales Default language and the languages players may choose
Config.Audio.Backend fxsound or xsound
Config.Audio.DefaultVolume, DefaultQuality Starting app volume and bass-boost strength
Config.Audio.Crossfade Default for players who never saved a setting; the crossfade length is set in the same block and 0 disables crossfading server-wide
Config.Phone Phone choice, AppIdentifier, AppName, Icon, DefaultApp
Config.Theme Default theme
Config.Notifications Which events send a phone notification
Config.MaxHistory, Config.HomeShelfSize Recently played entries kept per player and tracks per home shelf
Config.Search, Config.Playlists, Config.Share, Config.Stats Limits for search, playlists, sharing and play counts
Config.Providers Which sources are enabled
Config.YouTube.SearchMode direct (default, no setup) or apikey (official API with a daily quota and no autoplay mix)
Config.Spotify Spotify playlist import
Config.Autoplay The mix that continues after the queue ends
Config.RadioStations Server-defined radio streams
Config.RateLimits, Config.Http, Config.Cache Rate limits, outbound request settings and cache lifetimes

config_server.lua is server only. It holds the Discord webhook and the YouTube and Spotify API credentials. Spotify playlists longer than about 100 tracks need Spotify API credentials; without them only the first part of the playlist is imported.

#Performance and security

From the resource's README:

  • No Wait(0) loops. The speaker tick paces itself from distance and speed, so an idle world costs one iteration a second.
  • Search, settings, metadata, trending and resolved stream URLs are cached on the server.
  • Play counts are batched in memory and written on a schedule.
  • Every client request is rate limited, then validated. Playlist ownership is checked on the server on every change.
  • Player-supplied URLs pass an allow-list (https only, private ranges blocked) before any request is made.

#Exports

Export Side Purpose
GetVersionStatus() Server Result of the update check: { state, current, latest, behind }

The app has no other exports.