# usage

## Opening the player

While **seated in any vehicle**, run the command in chat:

```
/music
```

The CarPlay UI will open. The command name is configurable via `Config.Command` in `config.lua`.

{% hint style="info" %}
The command does nothing if you are on foot. You will receive an error notification instead.
{% endhint %}

## Playing a song

1. Open the UI with `/music`.
2. Paste a **direct audio URL** into the input field (see supported formats below).
3. Press **Play**.
4. All passengers currently in the vehicle will hear the audio in sync.

## Supported URLs

The URL must point directly to an audio file, not a webpage or playlist. Examples of valid formats:

```
https://example.com/audio/track.mp3
https://example.com/audio/track.ogg
https://example.com/audio/track.wav
```

Streaming service links (Spotify, YouTube, SoundCloud pages) are **not** supported. You need a raw audio file URL.

## Song name format

If you provide a song name through the interface using the separator defined in `Config.SongSeparator`, the UI will automatically split it into a title and an artist:

```
Blinding Lights by The Weeknd
→ Title:  Blinding Lights
→ Artist: The Weeknd
```

If no separator is found, the full string is shown as the title.

## Playback controls

| Control           | Description                              |
| ----------------- | ---------------------------------------- |
| **Play**          | Start streaming the URL                  |
| **Pause**         | Pause playback for all passengers        |
| **Resume**        | Resume paused playback                   |
| **Seek bar**      | Click or drag to jump to any position    |
| **Restart**       | Jump back to the beginning               |
| **Volume slider** | Adjust volume (persisted on the vehicle) |
| **Stop**          | End playback and clear the current song  |

All controls are synced — any passenger can control the player, not just the one who started it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mohssins.gitbook.io/mohscriptsdocs/moh-carplay/usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
