# Video

The HTML `video` tag, implemented in Ruby.

## Parameters

The video component takes mandatory path and type arguments and can take a number of optional configuration params.

#### autoplay (optional)

Expects a boolean and specifies whether the video should start playing as soon as it is ready.

#### controls (optional)

Expects a boolean and specifies whether the video controls (play/pause button etc) should be displayed.

#### height (optional)

Expects an integer with the height of the video in px.

#### loop (optional)

Expects a boolean and specifies whether the video will start over again every time it is finished.

#### muted (optional)

Expects a boolean and specifies whether the audio output of the video should be muted.

#### path

Expects a string with the source to the video. It looks for the video in the `assets/videos` folder and uses the standard Rails asset pipeline.

#### type

Expects a string with the type to the video.

#### playsinline (optional)

Expects a boolean and specifies whether the video should be played inline on iOS Safari.

#### preload (optional)

Expects a string (`auto`, `metadata` or `none`) and specifies whether the whole video/only metadata/nothing should be loaded on pageload. Default (if not specified) depends on the client's browser.

#### width (optional)

Expects an integer with the width of the video in px.

## Examples

### Example 1: Basic usage

```ruby
video path: 'corgi.mp4', type: "mp4", width: 500, height: 300
```

returns

```markup
<video height='300' width='500'>
  <source src='/assets/corgi-[...].mp4' type='video/mp4'>
  Your browser does not support the video tag.
</video>
```


---

# 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.matestack.io/matestack-ui-core/1.5.0/components-api/core-components/video.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.
