Videos can be embedded into the body area of content.
Warning: Do not cut and paste the examples below. We had to insert an invisible character called a “zero-width space” so that the [/embed] tags would show up as code and not render the video.
YouTube and more
If you are using Media Central, YouTube, or Vimeo, you can wrap the URL or "share" the URL with the embed tags. Other platforms may work, but we do not support them. To do this, you need to get the URL of the video you want to embed.
- When viewing the video directly from the provider (like YouTube), Find the Share link on the video. It may have different icons, such as one of these examples:
- Copy the link that is shown, which may look like this:
- Paste the link to the video into the body of your Drupal page with the Embed tags in square brackets, as in the example below.
Example of embed code inserted of YouTube video "Time-lapse of fall colors at Princeton"
If you do not want related videos to pop up at the end of the video, add ?rel=0 to the end of the URL (before the closing [/embed] tag)
You can also manually change the size of the player. To adjust the size of the player, change the size pulled in with the embed code. For example, for a video with a base size of 608x402 you can manually edit the size to 275x155 in pages with a left panel and two body columns. When in doubt use an aspect ratio calculator to help. Example:
[embed height="450" width="800"]https://vimeo.com/175592015[/embed]
Publish the videos to Media Central. The video must be public or unlisted; private videos will not display when embedded.
From Media Central, copy the embed code for the video and paste it into the body of your Drupal web page. Note that an oEmbed URL in Media Central is the same as its video page URL, but with "id" replacing "media" in the URL.
To copy the embed code:
- Click on the Share tab
- Click oEmbed
- Copy the code in the oEmbed field. The code should be a URL with some optional URL parameters (everything after the question mark is optional).
- Paste the oEmbed URL into the body of your Drupal web page.
- Surround the URL with the embed shortcode:
- Make sure you are using square brackets, and that the oEmbed code is on its own line.
The following example is source code to a video on Media Central, which explains how to get the embed code for the video.
Media Central - Playlists
The Media Central oEmbed works for individual videos, but not playlists. If you wish to embed a playlist, then use an iframe.