> For the complete documentation index, see [llms.txt](https://docs.arcware.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arcware.cloud/web-integration/webrtc-plugin/sizecontainer-container-and-videoref.md).

# SizeContainer, container and videoRef

```jsx
<SizeContainer>
    <Container>
        <Video />
    </Container>
</SizeContainer>
```

#### \<SizeContainer>

<mark style="color:orange;">`<SizeContainer>`</mark> defines the boundary for inner containers. By default (C), the video will try to fit the space of <mark style="color:orange;">`<SizeContainer>`</mark>.&#x20;

<figure><img src="/files/tJSTPVNcdRpscU7ZNPBR" alt=""><figcaption><p>Example of <mark style="color:orange;"><code>&#x3C;SizeContainer></code></mark> with default configuration.</p></figcaption></figure>

However, if setting the <mark style="color:blue;">`forceVideoToFitContainer`</mark> option to <mark style="color:blue;">`false`</mark>, then the video will be limited by the stream size. For example, if the stream provides only 800x800 pixels and <mark style="color:orange;">`<SizeContainer>`</mark> is 1920x1920, the video and container will be centered in the middle.

<figure><img src="/files/zh9P3YF8CnyCaFdjGZBc" alt=""><figcaption><p>If the <code>forceVideoToFitContainer</code> parameter is set to <code>false</code>, then the <code>&#x3C;Container></code> element will match the size of the video stream, regardless of the actual size of the container.</p></figcaption></figure>

#### \<Container>

The <mark style="color:orange;">`<Container>`</mark> and <mark style="color:orange;">`<Video>`</mark> (or its reference videoRef) have the same size. The <mark style="color:orange;">`<Container>`</mark> is necessary to contain the UI elements, which should be limited by the <mark style="color:orange;">`<Video>`</mark> element's boundaries. The container will always adjust to the video's size.

{% hint style="info" %}
If <mark style="color:blue;">`forceVideoToFitContainer`</mark> is set to <mark style="color:blue;">`true`</mark>, then the video will try to fit the <mark style="color:orange;">`<SizeContainer>`</mark> by width and height. If the video resolution is dynamic, then it should perfectly fit the <mark style="color:orange;">`<SizeContainer>`</mark>. If the video resolution is fixed, such as 1920x1080, then the smaller side will fit the <mark style="color:orange;">`<SizeContainer>`</mark> , and the larger side will be aligned with the aspect ratio. You can see an example below.
{% endhint %}

<figure><img src="/files/5yY0vTxgchSHRps568pY" alt=""><figcaption><p>If the <code>forceVideoToFitContainer</code> parameter is set to <code>true</code>, then the smaller side will fit the <mark style="color:orange;"><code>&#x3C;SizeContainer></code></mark></p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.arcware.cloud/web-integration/webrtc-plugin/sizecontainer-container-and-videoref.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
