> 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/creating-content/blocks/embed-a-url.md).

# 嵌入的 URL

要添加嵌入式 URL，只需粘贴要嵌入内容的链接并按下 `回车`.

{% hint style="info" %}
**注意：** 你要嵌入的内容必须是公开可访问的，这样 GitBook 才能访问该文件。例如，在嵌入 Google 文档时，共享设置必须设为 *拥有链接的任何人*.
{% endhint %}

{% hint style="info" %}
GitBook 不支持使用 HTML 嵌入外部内容 `<iframe>`，这是由于其内容安全策略所限。如果内容可公开访问，请改用嵌入块。
{% endhint %}

### 视频

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

{% hint style="info" %}
**注意：** 你可以通过添加 `?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" %}
```


---

# 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://gitbook.com/docs/documentation/zh/creating-content/blocks/embed-a-url.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.
