# Embedding media files

## Inserting Media into body - The Media Widget

You can insert images and videos directly into the *body field* of a *Content form* via the Media widget. Click on the *Media Library* button from the WYSIWYG editor.

This will open the **Media widget**.

<figure><img src="https://1079433754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyh9JMywljz0CN8oT8o%2Fuploads%2F2MqE6hVAAkdTlFoDPZDe%2Fimage.png?alt=media&#x26;token=daa8767d-3ab8-48a8-9a7e-8216dd784d3d" alt=""><figcaption><p>Media entity button</p></figcaption></figure>

<figure><img src="https://1079433754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyh9JMywljz0CN8oT8o%2Fuploads%2F8G6ybn7QTsLZX1fvcZkH%2Fimage.png?alt=media&#x26;token=77b9ab3c-e33a-43fa-93ae-659e05e4f83b" alt=""><figcaption><p>Media entity embed widget</p></figcaption></figure>

You can upload *images* or *files* from your computer by selecting "Select files"

Browse for and select a file on your local machine, then click **Open**.

## Embedding code - videos and URLs

Using the Media widget you can also use the Remote video form to embed videos in content (e.g. YouTube or Vimeo videos).

Click on the *Media Library* button on the *Body* content section. Click on the Remote video tab, then enter the following information:

* A url for the video you wish to embed.

<figure><img src="https://1079433754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyh9JMywljz0CN8oT8o%2Fuploads%2FqrB9bQVwPuVAIkfKVEVa%2Fimage.png?alt=media&#x26;token=8910fa7e-7a2f-4a4e-9edd-733cd6eac0b6" alt=""><figcaption></figcaption></figure>

Click on the **Add** button.

## Media Library

All files uploaded to a website (or already included) are found in the **Media Library**. Media assets are displayed with the most recently added first.

<figure><img src="https://1079433754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyh9JMywljz0CN8oT8o%2Fuploads%2FQWmtsVgaYaPKUwKTXSiG%2Fimage.png?alt=media&#x26;token=11ccefef-28f0-4d54-bb63-415023bab76b" alt=""><figcaption><p>The media library</p></figcaption></figure>

Use the following to refine the media presented:

* Enter text in the *Name* field.
* Select from the dropdown to narrow the search to media items of type:
  * Audio
  * File
  * Image
  * Remote video
  * Video

Click the **Filter** button to perform the search.

In the screenshot below, the search word 'Govcms' has been entered into the *Name* field and for **Type** "Remote video" is selected.

<figure><img src="https://1079433754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyh9JMywljz0CN8oT8o%2Fuploads%2FP2yKEnMUk6LikUrll1No%2Fimage.png?alt=media&#x26;token=037f03c0-9083-4922-8172-06df69970a2c" alt=""><figcaption><p>Showing filter fields for media library</p></figcaption></figure>

**Note:** *When you use a file from the Media Library or Files area, you are linking to a copy of the file, including its metadata. If you make changes to the file or its metadata, these changes will take effect for every use of the file on the site.*


---

# 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://salsa-digital.gitbook.io/govcms-content-administration/unit-2-more-about-govcms/inserting-media-files.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.
