# Boombox

> Place a mobile boombox, configure inventory use, share YouTube playback and open the separate personal Spotify player.

Sky DJ includes four mobile boombox models: **Classic**, **Retro**, **Field** and **Ivory**. Each owner can have one deployed or stored device. Boomboxes use their own controls and online links; the club MP3 library remains separate.

## Place first, then open the controls

The default `/boombox` command enters placement directly when you have no active device. Using the configured inventory item follows the same flow. The music panel opens only after placement succeeds.

1. Run `/boombox`, or use the boombox item when item mode is enabled.
2. Choose a ground position with the actual 3D ghost. The placement HUD shows the controls below.
3. Press **Enter** at a valid position to place the device and open its panel. **Backspace** cancels without consuming an item.
4. Reopen a nearby device through its Sky interaction. The command also opens your existing active device when you are close enough; it does not create a second one.

<table>
<thead>
  <tr>
    <th>
      Placement control
    </th>
    
    <th>
      Action
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Page Up / Page Down
    </td>
    
    <td>
      Cycle the four models when placing a new device
    </td>
  </tr>
  
  <tr>
    <td>
      Up / Down arrows
    </td>
    
    <td>
      Adjust placement distance
    </td>
  </tr>
  
  <tr>
    <td>
      Left / Right arrows
    </td>
    
    <td>
      Rotate
    </td>
  </tr>
  
  <tr>
    <td>
      Enter
    </td>
    
    <td>
      Confirm a valid ground position
    </td>
  </tr>
  
  <tr>
    <td>
      Backspace
    </td>
    
    <td>
      Cancel
    </td>
  </tr>
</tbody>
</table>

Moving an existing device keeps its model. Interaction uses the configured Sky target provider when enabled; otherwise it uses Sky's TextUI/help adapter and the interaction key.

## Shared YouTube and personal Spotify

The drawer has separate **YouTube**, **Spotify**, **Queue** and **Settings** pages. The shared player bar contains the current track, play/pause, next and progress controls.

<table>
<thead>
  <tr>
    <th>
      Source
    </th>
    
    <th>
      How to use it
    </th>
    
    <th>
      Who hears it
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      YouTube
    </td>
    
    <td>
      Paste a supported video link, then choose <strong>
        Play link
      </strong>
      
       or <strong>
        Add to queue
      </strong>
    </td>
    
    <td>
      Nearby listeners in the same routing bucket, with distance attenuation and shared playback timing
    </td>
  </tr>
  
  <tr>
    <td>
      Spotify
    </td>
    
    <td>
      Paste a supported <code>
        https://open.spotify.com/
      </code>
      
       link, then choose <strong>
        Open Spotify player
      </strong>
    </td>
    
    <td>
      Only the user of that visible Spotify Embed
    </td>
  </tr>
</tbody>
</table>

Spotify does **not** require a matching YouTube link. Its player is personal: it does not enter the shared queue, use the boombox's spatial range or synchronize nearby listeners. Spotify decides whether full playback or a preview is available. **Stop player**, changing pages, closing or reopening the panel, entering placement and storing the device remove the Embed and stop its playback.

Existing saved tracks with Spotify metadata and an explicit YouTube mapping remain compatible; their shared sound still comes from YouTube. New Spotify selections do not create those mappings. No Spotify token or stream extraction is part of this player.

YouTube playback can continue while the panel is closed. Video availability, provider restrictions, autoplay and advertisements can affect playback. Test shared playback with two actual FiveM clients before relying on a particular video or provider setup.

These embedded players do not feed the club **Music Sync** analyzer. A YouTube or Spotify page URL is not a direct livestream URL. For music-reactive club lights, use the local MP3 library or a supported assigned source from [Livestreams and radio](/docs/scripts/sky-dj/features/livestreams-and-radio).

## Volume, fixed range and access

Players can change volume and repeat. The audible radius is fixed by the server for every boombox: **25 metres by default**. There is no per-device range slider. Administrators change the shared radius under **Settings → Boombox**; `BoomboxMaxRange` is the equivalent Lua setting in file mode and accepts 3–50 metres.

<table>
<thead>
  <tr>
    <th>
      Action
    </th>
    
    <th>
      Access
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      View a nearby active device
    </td>
    
    <td>
      Nearby players
    </td>
  </tr>
  
  <tr>
    <td>
      Shared playback controls
    </td>
    
    <td>
      Owner, an administrator, or nearby players when shared control is enabled
    </td>
  </tr>
  
  <tr>
    <td>
      Change shared control, move, carry or pack
    </td>
    
    <td>
      Owner only; carrying must also be enabled globally
    </td>
  </tr>
  
  <tr>
    <td>
      Store another player's device
    </td>
    
    <td>
      Administrator; the owner's claim is preserved
    </td>
  </tr>
</tbody>
</table>

An administrator storing another player's device does not receive its item. Packing returns an item only if that device consumed one during placement, including its recorded metadata. A device placed in command-only mode cannot produce an item if the server later enables item mode.

New devices start with their world display off. The player panel does not expose the retired floating-display/DUI controls.

### Carry by hand or on the shoulder

In the device's **Settings → Carry style**, the owner can choose **By the handle** or **On the shoulder** when carrying is enabled globally. Music continues while carrying. The shoulder option uses a compact matching model and a side-arm pose; the hand and placed versions keep their normal size. Walking remains available while the right arm holds the device.

After installing an update with new shoulder models, fully exit and relaunch FiveM. Keep the matching models, animation and manifest from the same download. Test carrying, walking and putting the device down with your server's character models.

### Use inventory placement without a chat command

Under `/djadmin` → **Settings → Boombox**, clear **Boombox command** to disable that command and keep inventory-item placement. Enable **Require inventory item** and configure the item before relying on this route. Previously registered command entries disappear after the next resource restart; saved access checks stop their old action immediately.

The optional world display uses native prop text and rectangles rather than a second browser or a streamed video screen. The legacy global names `BoomboxDui` and `BoomboxDuiDistance` remain for saved-setting compatibility. Enabling that global setting permits the display; it does not turn every new device's display on. The player panel and this small world display are separate surfaces.

## Enable inventory placement

Command-only placement is the default:

```lua [config/config.lua — file mode]
BoomboxEnabled = true,
BoomboxRequireItem = false,
BoomboxItem = 'sky_boombox',
BoomboxCommand = 'boombox',
```

Edit these entries inside the existing `Config` table only in file mode. In SQL mode, use `/djadmin` → **Settings → Boombox**. See [Configuration](/docs/scripts/sky-dj/setup/configuration) before changing modes.

To require an item, enable **Require inventory item** and make the configured item available in your inventory catalogue. Sky DJ registers the definition and usable action through `Sky.FW.RegisterItem` and `Sky.FW.RegisterUsableItem`; the selected Sky Base inventory integration handles delivery. Existing definitions are preserved. This uses the inventory provider selected in Base on ESX, QBCore or Qbox and adds no separate required inventory resource.

For `ox_inventory`, add the item to `data/items.lua` if it is not already defined:

```lua [ox_inventory — data/items.lua]
['sky_boombox'] = {
    label = 'Boombox',
    weight = 2500,
    stack = false,
    close = true,
    consume = 0,
},
```

Do not add a client export, event or consuming action to this entry. Sky Base supplies the usable-item callback; Sky DJ removes the item only after successful placement. Restart the inventory after catalogue changes during your normal maintenance window. Supply items through your existing inventory or administration tools; Sky DJ does not add a shop or item-grant command.

## Limits and restart recovery

The default server cap is **32 deployed or stored devices**, adjustable from 1 to 64. The volume ceiling is 70%, and each client plays the nearest two audible devices by default. Global settings also control carrying and the number of simultaneous audible boomboxes.

Devices and outstanding item claims are journaled in SQL. Disconnecting stores the device; after a resource or server restart, devices are stored and paused. The owner can use `/boombox` to reclaim the recorded item and place again. Command-only devices can be cleared and placed again without an inventory return. Disabling new boombox use still allows owners to reclaim existing claims.

Changing the global item name does not rewrite outstanding claims: they keep their original item and metadata. Keep the boombox journal when updating. If an interrupted inventory operation requires administrator recovery, audit the inventory and journal first; see [Troubleshooting](/docs/scripts/sky-dj/reference/troubleshooting). Deleting the journal can lose legitimate claims.

### Recover an interrupted inventory operation

An inventory change and its SQL journal entry cannot be one transaction across arbitrary inventory providers. An ambiguous `taking` or `returning` record stays locked for administrator review instead of automatically creating another item.

After checking the owner's inventory audit and backed-up journal, use the **server console**:

```text
skyboomboxrecover <id> return_item
skyboomboxrecover <id> item_kept
```

Use `return_item` only when the owner is owed the recorded item. It creates an owner claim redeemed with `/boombox`; the command itself grants nothing. Use `item_kept` only when the owner already has the item; it removes the journal record. Neither action changes the original item name or metadata. Do not use journal deletion as a shortcut for deciding whether an item is owed.
