> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/embed-a-url.md).

# 嵌入 URL

使用 URL 将视频、音乐等直接嵌入到你的页面中

要添加嵌入式 URL，请粘贴要嵌入内容的链接，然后按 `Enter`.

### 视频

{% embed url="<https://www.youtube.com/watch?v=D_uLM5i0Z4c>" %}

{% hint style="info" %}
**注意：** 添加以下参数，即可让 YouTube 和 Vimeo 嵌入内容自动播放并循环播放： `?autoplay=1&loop=1` 将其添加到视频 URL 的末尾。
{% endhint %}

#### 视频文件

上传的视频文件（例如 MP4）不会直接播放，而是显示为链接，访客可以点击打开或下载。若要在页面上显示可播放的视频，请将视频上传到 YouTube 或 Google Drive 等可公开访问的平台，然后将链接粘贴到嵌入块中。私有 URL 不会显示在页面上。

### Codepen

{% embed url="<https://codepen.io/davidkpiano/pen/wMqXea>" %}

### Spotify

{% embed url="<https://open.spotify.com/track/4FmiciU3ZmfgABlbCSXcWw?si=65zMAhStT2ivTit-kZISWg>" %}

### Markdown 表示

```markdown
{% embed url="URL_HERE" %}
```

### 常见问题

<details>

<summary>为什么我的 URL 无法使用？</summary>

你的内容必须公开访问。对于 Google 文档，请选择 *知道链接的任何人* 共享设置。

GitBook 通过 [Iframely](https://iframely.com/domains)嵌入 URL。请确认 Iframely 支持你的内容提供方，然后 [使用 Iframely 测试你的 URL](https://iframely.com/try).

由于内容安全策略的限制，GitBook 无法嵌入外部 HTML `<iframe>` 标签。请改用嵌入块。

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/embed-a-url.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
