Best ways to embed third-party videos on your Squarespace site
Web developers commonly need to embed third-party videos from platforms like YouTube and Vimeo into their websites. Here's a comprehensive guide on how to do it effectively.
Basic Video Embedding
For YouTube or Vimeo videos, you have two main options:
- Video URL (simplest method)
- Embed code (advanced features)
Using Video URLs
Copy the video URL directly from your browser's address bar. For YouTube, the URL must contain:
- youtube.com/watch
- youtube.com/playlist
- youtu.be
For YouTube playlists, ensure the URL includes youtube.com/playlist.
Illustration of blue curves
Using Embed Codes
Use embed codes when you need:
- Advanced playback options
- Videos from other services (Wistia, Animoto)
- YouTube shorts or clips
- Custom display settings
To implement embed codes:
- Customize video settings on the hosting platform
- Copy the embed code
- Paste into your site's video display options
Video embedded on a web page
Important Considerations
- Unlisted/private videos work if accessible via link
- Live broadcast videos require specific URL formats
- Premiered videos won't display until published
- 360-degree videos may impact site performance
- Video URLs should be used when possible for simplicity
- Embed codes offer more customization options but require more setup
Placement Options
Videos can be embedded in:
- Standard content blocks
- Gallery blocks
- Background sections
- Course pages
- Dedicated video pages
- Cover layouts
Remember to test your embedded videos across different devices and screen sizes to ensure proper display and playback.