# media.action

Source: https://docs.lightair.app/developers/remote-api/media.action

> Plays, pauses, restarts, stops or seeks a video source.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Objects and sources. Script plugins need the `project.write` permission.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `source` | `string` | yes | The source's id or name. |
| `action` | `string` | yes | `play`, `pause`, `restart`, `stop` or `seek`. |
| `ms` | `number` | no | Where to seek to, in milliseconds. Needed for `seek`. |

## Errors

Not found (-32004) for an unknown source. Invalid params (-32602) for an unknown action, or `seek` without `ms`.

## From an AI agent

The MCP server's `media (action: play, pause, restart, stop or seek)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "media.action", "params": { "source": "Intro video", "action": "restart" } }
```

Result:

```json
{}
```

## Related

- [media.status](https://docs.lightair.app/developers/remote-api/media.status.md)
