# Video Element

The video element is created and managed by the <mark style="color:orange;">`ArcwareApplication`</mark> instance, which is responsible for playing the video stream.

#### Initialization

Initialize your <mark style="color:orange;">`ArcwarePixelStreaming`</mark> instance and create an <mark style="color:orange;">`ArcwareApplication`</mark> instance as follows, or use the <mark style="color:orange;">`ArcwareInit`</mark> method to initialize all you need in a single call.

```javascript
const config = new ArcwareConfig({ /** ... */ });
const pixelStreaming = new ArcwarePixelStreaming(config);
const application = new ArcwareApplication({ stream: pixelStreaming });
// or
const { Application } = ArcwareInit(/** ... */);
```

#### Embedding the Video

After creating the <mark style="color:orange;">`ArcwareApplication`</mark> instance, append the video element to the stream container:

```javascript
const container = document.querySelector(`#${containerId}`);
if (!container) throw new Error("Container is undefined.");

// Append the root element of the application to the container
container.appendChild(application.rootElement);
```


---

# 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.arcware.cloud/web-integration/interacting-with-the-stream/video-element.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.
