> For the complete documentation index, see [llms.txt](https://developer.capsule.video/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.capsule.video/displaying-videos/embed-a-single-video.md).

# Embed a single video

You can copy the embed code for any video in your Capsule Dashboard like this:

![](/files/pEARlVaKqdYk7RsDXdJ1)

Here's an example of an embed code:

```markup
<div>
  <script>
    (function(c,a,p,s,u,l,e){c["_capsulePlayerIdent"]=p;c[p]=c[p]||function(){
    (c[p].q=c[p].q||[]).push(arguments);e=a.querySelector("script[data-capsule='"+p+"']");
    if(!e){u=a.createElement("script");u.async=1;u.src=s;u.dataset["capsule"]=p;
    l=a.currentScript?.parentElement||a.body;l.appendChild(u);}}})
    (window,document,"capsulePlayer","https://embed.capsule.video/player.js");
    capsulePlayer({
      slug: 'your-capsule-slug',
      id: 'nxOsT1t1vsdk',
      el: document.currentScript.parentElement
    })
  </script>
 </div>
```

The follow parameters can be used to customize the embedded player:

| **Parameter** | **Description**                                                                                                                                                    | **Default** |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| slug          | Your subdomain (e.g. **your-capsule-slug**.capsule.video) or, in the case of a custom domain, the full domain replacing "." with "-" (e.g. **www-yourdomain-com**) |             |
| id            | The ID of the video you're embedding. This is the unique ID at the end of the URL when viewing a video in a public-facing Capsule.                                 |             |
| el            | Optionally specify an #id or .class to append Capsule content within an existing div rather than inline below this script tag                                      |             |
| width         | Width of the video player, in pixels                                                                                                                               | 450         |
| height        | Height of the video player, in pixels                                                                                                                              | 600         |
| animated      | Whether to animate the thumbnail                                                                                                                                   | true        |


---

# 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://developer.capsule.video/displaying-videos/embed-a-single-video.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.
