editor

Docs › Images and media

Videos

Embed YouTube, Vimeo, Naver TV and Kakao TV by address, 16:9 on any screen.

Paste a video site address and the player goes in. Nothing is uploaded; the site's own player is embedded.

Try it

Code for this demo

createEditor('#editor', {
  toolbar: 'video embed | undo redo',
  height: 380,
});

Adding a video

  • Click Video (video) and paste the address. Addresses it can't read show "This video link is not supported".
  • Paste a video address alone into the text: it goes in as a link and a message offers "Embed video", which turns the link into a player.
  • Type / on an empty line and look for "video" or "youtube".
  • A video address or iframe code in the Map / embed code dialog (embed) also goes in as a video.

Supported addresses

SiteExamples
YouTubeyoutube.com/watch?v=…, youtu.be/…, /shorts/…, /live/…, /embed/…, music.youtube.com. t=90 or t=1m30s sets the start time.
Vimeovimeo.com/123456789, player.vimeo.com/video/…
Naver TVtv.naver.com/v/…, /embed/…
Kakao TVtv.kakao.com/v/…, …/cliplink/…
Dailymotiondailymotion.com/video/…, dai.ly/…

Saved HTML

<div data-video="youtube" style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%">
  <iframe src="https://www.youtube.com/embed/VIDEO_ID" title="youtube video"
    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0"
    allowfullscreen allow="…" loading="lazy"></iframe>
</div>

The 16:9 box is inline CSS, so on the view page it shrinks to phone width too. In the editor a video is one piece: it can be deleted or moved, not edited inside.

Allowed iframes

Only iframes from allowed sites stay. By default that is the video sites above (www.youtube.com, www.youtube-nocookie.com, player.vimeo.com, tv.naver.com, play-tv.kakao.com, www.dailymotion.com) and Google Maps. Other iframes coming in through setHTML or paste are dropped with a message. Allow more with allowedIframeHosts (Maps and embeds), and match your server allow-list (Security).

Where it is

video is on the first row of the board and full presets.

To insert from code: editor.exec('insertVideo', 'https://youtu.be/…'). An address it can't read does nothing.

Options

NameTypeDefaultDescription
videotoolbar itemOpens the video address dialog.
insertVideocommandInserts the video for an address at the caret.
allowedIframeHostsstring[][]iframe addresses allowed besides the video sites and Google Maps.