How to add or embed a video within your website


Videos can be embedded into the body area of content.


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.

  1. 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:

    share icon  or  share link example
     
  2. Copy the link that is shown, which may look like this:

    share link example
     
  3. 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"

Example: [embed]https://youtu.be/uLG5Coswx1Q[/embed]


Notes:

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:

Example: [​embed height="450" width="800"]https://vimeo.com/175592015[​/embed]


Media Central

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:

  1. Click on the Share tab
  2. Click oEmbed
  3. 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).
  4. Paste the oEmbed URL into the body of your Drupal web page.
  5. Surround the URL with the embed shortcode: hyperlink
  6. 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.

Example: [​embed]http://mediacentral.princeton.edu/id/1_b024qge9[​/embed]

Example: [​embed]http://mediacentral.princeton.edu/id/1_b024qge9?width=608&height=402&playerId=14292322[​/embed]

 


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