# mod\_video\_embed

Source: https://zotonic.com/docs/1901/mod_video_embed

URI: https://zotonic.com/id/1901

Language: en



This module, if activated, checks the pasted URLs in the *create media / page* dialog of the admin. It will show an embed option for Youtube and Vimeo URLs. It will also cleanup pasted embed code for these and other services.

When used in the Zotonic site, the \{% media %\} tag then displays the embed code.

This module accompanies <a href="/id/doc_module_mod_oembed" class="doc-reference doc-reference-module"><code>module#mod_oembed</code></a> and can be used for integrating with services that do not have oEmbed support but do provide HTML embed-code functionality. Video embed helper module for normalizing and rendering embeddable media URLs/code.

Accepted Events
---------------

This module handles the following notifier callbacks:

- `observe_media_import`: Recognize youtube and vimeo URLs, generate the correct embed code using `z_url_metadata:p`.
- `observe_media_import_medium`: Import a embedded medium for a rsc\_import using `z_sanitize:html`.
- `observe_media_stillimage`: Return the still image filename used for embedded-media previews.
- `observe_media_viewer`: Return the media viewer for the embedded video (that is, when it is an embedded media) using `z_template:render_to_iolist`.
- `observe_rsc_update`: Check if the update contains video embed information using `z_acl:is_allowed`.

Delegate callbacks:

- `event/2` with `submit` messages: `add_video_embed`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1901?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1901?language=en>)
