> For the complete documentation index, see [llms.txt](https://play.docs.nexx.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://play.docs.nexx.cloud/other-integration-options/webcomponent.md).

# WebComponent

The nexxPLAY SDK also supports Integration via WebComponents.

After the initialization of the SDK, a WebComponent Class can be registered globally, if the Browser supports these APIs.

The nexxPLAY WebComponent will be integrated into HTML like this:

```markup
<nexx-play 
    id="player" 
    data-mediaid="12345" 
    data-streamtype="video" 
    data-config='{"disableAds":1}'
></nexx-play>
```

{% hint style="info" %}
The HTML Tag supports the Attributes **data-mediaid** (necessary), **data-streamtype** (optional, will be set to "video", if omitted) and an optional **data-config** Attribute.

The Config Attribute must be a JSON encoded String of an Object, that would serve as Source for a **`_play.PlayerConfiguration`** Object.
{% endhint %}

After the nexxPLAY SDK has been loaded, the Instance can be started as a WebComponent:

```javascript
_play.config.enableWebComponents().then(function(){
    window.customElements.define("nexx-play",nexxPLAY);
}catch(function(){
    // provider a Fallback
});
```

In this Moment, the custom HTML Tag has been registered and will start the nexxPLAY Instance in the given Container. For registering for Events or further Control, the WebComponent Container offers a method to get the **`_play.PlayerInstance`** Instance, which runs inside the HTML Container and exposes the regular SDK Methods:

```javascript
let instance = document.getElementById("player").getInstance();
let mediaData = instance.getMediaData();
```


---

# 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://play.docs.nexx.cloud/other-integration-options/webcomponent.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.
