# Controls API

You can use the following functions to manage user controls of Fluid Player after initialisation.

### Play

To play the Fluid Player use the **play()** function on our *player* object

```javascript
player.play();
```

### Pause

To pause the Fluid Player use the **pause()** function on our *player* object

```javascript
player.pause();
```

### SkipTo

The **skipTo(seconds)** function takes in a parameter of the time (in seconds) to move the video to. In our below example we'll skip to 30 seconds into the video.

```javascript
player.skipTo(30);
```

### SetPlaybackSpeed

The **setPlaybackSpeed(speed)** function takes in a speed parameter. The default speed is **1**, and the speeds are relative to this.

If we wanted to double the speed we'd use **2**, and half speed would be **0.5**. The below example will double the speed of the video.

```javascript
player.setPlaybackSpeed(2);
```

### SetVolume

The **setVolume(volume)** function takes in a volume parameter. The max volume is **1**, and the volumes to set are relative to this.

To half the volume we would use **setVolume(0.5)**, and to mute the player we would use **setVolume(0)**. The below example will mute the video.

```javascript
player.setVolume(0);
```

### toggleControlBar

We can show and hide the control bar when necessary. This function takes in a **true** or **false** value.

If we pass **true** the control bar will show and remain showing at all times.

If we pass **false** we hide the control bar and it returns to it's standard behaviour, showing on hover or pause.

```javascript
player.toggleControlBar(true);
```

### toggleFullScreen

Using **toggleFullScreen(boolean)** we can set the video to fullscreen. **true** will set the player to fullscreen, and **false** will set the player back to normal.

```javascript
player.toggleFullScreen(true);
```

### toggleMiniPlayer

Using **toggleMiniPlayer(boolean)** we can toggle the player to Mini Player mode. **true** will set the player to Mini Player, and **false** will set the player back to normal.

```javascript
player.toggleMiniPlayer(true);
```


---

# 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://docs.fluidplayer.com/api/controls-api.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.
