Music
Music player, playlist and volume.
Options
| Option | Default | Description |
|---|---|---|
Config.UI.music.enabled | true | false hides the player |
Config.UI.music.volume | 30 | Start volume from 0 to 100 |
Config.UI.music.shuffle | false | Random order |
Config.UI.music.useVideoAudio | false | Plays the sound of the background video instead of the playlist. Mode video only |
Config.UI.music.tracks | 1 example song | List of songs |
Adding songs
Put mp3 or ogg files into html/media/music/. Every song is one entry in tracks:
config.lua
tracks = {
{ file = 'media/music/song1.ogg', title = 'Song 1', artist = 'Artist' },
{ file = 'media/music/song2.mp3', title = 'Song 2', artist = 'Artist' },
},fileis required,titleandartistare optional- With more than one song the skip buttons show up, after the last song it starts again
- A song that fails to load is skipped
Volume
Players can change the volume. Their value is saved for the next connect. If you change volume in the config, everyone starts with the new value again.
Click for music
The browser in FiveM sometimes blocks sound until the first click. The player then shows "Click for music" and starts on the first click anywhere on the screen.
Rights
Only use music you have the rights to.
Was this page helpful?
