Features

Complete overview of all oxide-carplay features

Music Playback

The core music system lets players paste YouTube URLs to play audio inside their vehicle.

URL Handling

Paste a YouTube video URL into the input field and press Play. The system extracts the video ID and fetches metadata (title, thumbnail) from the server.

Metadata Fetching

The server uses a multi-provider fallback chain for YouTube metadata:

ProviderPurposeFallback Order
noembed.comSingle video title and thumbnailPrimary
Piped APIPlaylist track listing and metadataPrimary (playlists)
InvidiousPlaylist track listing and metadataFallback (playlists)

If a provider is unreachable, the system automatically tries the next one. Single video playback only requires noembed.com.

Playback Controls

ControlDescription
PlayStart playback of a pasted URL
PausePause the current track
ResumeResume paused playback
NextSkip to the next track in the queue
VolumeAdjust playback volume (0-100)

3D Positional Audio

All music plays through xsound as 3D positional audio, making it audible to nearby players with realistic spatial effects.

Vehicle Openness Detection

The system calculates a vehicle "openness" value (0.0 to 1.0) based on door and window states. This affects how sound propagates:

StateEffect
All doors/windows closedVolume reduced by VolumeMultClosed (default 0.15x)
Doors or windows openVolume scales with openness (0.0-1.0)

Audio Range

SettingDefaultDescription
AudioRange12.0Hearing distance in meters (doors/windows open)
AudioRangeClosed2.0Hearing distance in meters (fully closed vehicle)
SpeedRangeBonus0.25Extra range per unit of vehicle speed

The effective hearing range increases with vehicle speed, simulating the doppler-like effect of a passing car with music.

Distance Falloff

Volume decreases linearly with distance from the vehicle. At the edge of the audio range, volume reaches zero. The PositionUpdateInterval (default 150ms) controls how frequently the 3D audio position is updated to track vehicle movement.

Queue System

The queue holds upcoming tracks that play automatically after the current song ends.

Queue Limits

SettingDefaultDescription
MaxQueueSize20Maximum tracks in the queue

Queue Operations

ActionDescription
Add to QueueAdds a track to the end of the queue
Remove from QueueRemoves a specific track by index
Play from QueueJumps to and plays a specific track, removing it from the queue
NextSkips the current track and plays the next queued track

Auto-Advance

When the current track ends, xsound's onPlayEnd callback automatically triggers the next track in the queue. If the queue is empty, playback stops.

Playlist System

Playlists provide persistent storage for track collections that survive server restarts.

Playlist Limits

SettingDefaultDescription
MaxPlaylists10Maximum saved playlists per character
MaxPlaylistTracks50Maximum tracks per playlist

Playlist Operations

ActionDescription
Save as PlaylistSaves the current queue as a new playlist
LoadReplaces the current queue with the playlist's tracks
Add AllAppends the playlist's tracks to the current queue
RenameChanges the playlist name
DeletePermanently removes the playlist

YouTube Playlist Import

Paste a YouTube playlist URL into the input field to import all tracks at once. The server fetches track metadata via the Piped API (with Invidious as a fallback) and presents the tracks for saving as a local playlist.

Persistence

Playlists are stored per-character using FiveM's KVP system with the key format carplay:char:{charId}. Data persists across server restarts without any database. Each character has their own independent playlist library.

Multi-Passenger Sync

Music state is synchronized across all vehicle occupants using FiveM statebags.

How It Works

  1. The controlling player's client sets the vehicle's oxide:carplay statebag with the current playback state
  2. The server relays state changes to all clients
  3. Passengers detect the statebag and start/stop xsound playback to match

Synced State

The statebag contains:

FieldDescription
urlCurrently playing YouTube URL
titleTrack title
thumbnailTrack thumbnail URL
playingWhether playback is active
volumeCurrent volume level
queueFull queue contents
jailbrokenWhether the vehicle has been jailbroken

Desync Recovery

A proximity scan runs every ProximityScanInterval (default 2000ms) to discover nearby vehicles playing music. If a passenger's local state doesn't match the vehicle statebag, the system reconciles automatically by restarting playback with the correct state.

The Map tab displays a tiled map of San Andreas with real-time player tracking.

Map Display

FeatureDescription
Tiled background20 JPG tiles covering the full GTA V map
Player markerShows current position and heading direction
Street labelDisplays the current street name
Zone labelDisplays the current area/neighborhood name
WeatherShows current weather condition
TimeDisplays current in-game time

The map updates at MapUpdateInterval (default 500ms) to track player movement.

Quick Nav

Quick Nav buttons let players set a GPS waypoint to the nearest location in each category:

CategoryDescription
Gas27 gas station locations across the map
StoreConfigurable store locations (empty by default)
Garage5 garage locations
POIHidden locations unlocked via jailbreak

Tapping a Quick Nav button calculates the closest location and sets it as the GPS waypoint.

Jailbreak System

The jailbreak system is an optional progression mechanic that unlocks hidden POI locations on the navigation map.

Requirements

SettingDefaultDescription
RequiredItem'carplayjb_usb'Item needed in inventory
RemoveItemtrueWhether the item is consumed on success

Jailbreak Flow

  1. Item Use — Player uses the carplayjb_usb item while in a vehicle
  2. Animation — A progress bar plays for Duration (default 8 seconds) with a configurable animation. The player can cancel during this phase
  3. Circuit Trace Minigame — On progress bar completion, a wire-tracing minigame appears in the NUI
  4. Result — Success unlocks POI locations on the map and sets the vehicle's jailbroken flag. Failure consumes the animation time but does not consume the item

Circuit Trace Minigame

The minigame presents procedurally generated wire paths that the player must trace:

SettingDefaultDescription
Difficulty'medium'Difficulty level affecting wire complexity

The difficulty setting controls the number of wires, path complexity, and time pressure. Available levels: easy, medium, hard.

Hidden POIs

On successful jailbreak, 8 POI locations become visible on the navigation map:

LocationArea
Vinewood areaCentral LS
LSIA warehouseAirport
Sandy ShoresDesert
GrapeseedNorth county
Paleto BayFar north
Underground bunkerBelow ground
Airport hangarLSIA
Port of LS dockSouth docks

POI locations are configured in Config.Jailbreak.POIs and can be customized by server owners.

Vehicle State

The jailbreak flag is per-vehicle (stored on the vehicle's statebag). Jailbreaking one vehicle does not unlock others. The flag persists as long as the vehicle entity exists.

Keybind

SettingDefaultDescription
Config.CarPlay.Keybind'M'Key to open/close CarPlay

CarPlay only opens when the player is inside a vehicle. Pressing the keybind outside a vehicle has no effect. The keybind is registered via FiveM's RegisterKeyMapping and can be rebound by players in their FiveM key settings.