How to add a YouTube or Vimeo video
In TeleportHQ, you show a YouTube or Vimeo video with the Iframe element. Add Iframe from Elements → Primitives → Media to your page, then paste the video's embed address into the src field in the Attributes section of the right panel. The video plays on your live site from YouTube or Vimeo, so it doesn't use your storage.
Before you start
- You need the video's embed address, not the normal page address. The steps below show where to find it.
- The video's owner must allow embedding. Most public YouTube and Vimeo videos do.
1. Copy the embed address
From YouTube:
- Open the video on YouTube.
- Below the video, click Share.
- Click Embed.
- In the code that appears, copy the address inside
src="...". It looks likehttps://www.youtube.com/embed/abc123XYZ.
From Vimeo:
- Open the video on Vimeo.
- Click Share.
- Copy the embed code, then copy the address inside
src="...". It looks likehttps://player.vimeo.com/video/123456789.
2. Add the video to your page
- In the TeleportHQ editor, select the container where the video should go.
- In the left sidebar, click Elements.
- On the Primitives tab, find the Media group.
- Click Iframe, or drag it onto the canvas. It starts with a sample YouTube video and is selected.
- In the right panel, find the Attributes section.
- Click in the src field and paste your embed address.
- Press Enter. The canvas shows your video.
3. Size the video
A new iframe is 320 pixels wide and 200 pixels tall. To make it fill its section:
- With the iframe selected, in the right panel, open Size.
- Set the width to
100%. - Set a height, for example
450px.
See How to set an element's width and height.
Check that it worked
The video's thumbnail shows on the canvas. On the canvas, clicks select the iframe instead of playing the video. To play it inside the editor, go to the Iframe Settings section and click Preview. A banner says "You are in live preview mode."; click Exit Preview when you're done. To check the whole page, preview your site.
Troubleshooting
The iframe shows "refused to connect" or a blank box You pasted the normal video page address (for example youtube.com/watch?v=...). Paste the embed address from step 1 instead.
"Video unavailable" shows inside the iframe The video is private, deleted or the owner turned off embedding. Use a different video, or ask the owner to allow embedding.
The video can't go full screen In the Attributes section, turn on full screen.
Good to know
- Autoplay and looping are set in the address, not in TeleportHQ. For YouTube, add
?autoplay=1&mute=1at the end of the embed address. Browsers only autoplay muted videos. - The allow field in Attributes gives the video extra browser permissions, for example
autoplay; fullscreen. - Your own video files (MP4, MOV) use the Video element instead. See How to add a video from your computer.
- Other embeds such as a booking calendar or a map work the same way. See How to embed another web page with an iframe.