Website Building » Squarespace » How Do I Embed a Video in Squarespace Autoplay?

How Do I Embed a Video in Squarespace Autoplay?

Last updated on December 13, 2022 @ 1:25 am

There are multiple ways to autoplay a video on Squarespace. The most common and easiest method is to use an HTML5 video tag with the autoplay attribute. This can be done in two ways:

The first way is to add the autoplay attribute to the video tag itself. For example:

< video autoplay >
< source src="myvideo.mp4" type="video/mp4" >
< source src="myvideo.webm" type="video/webm" >
Your browser does not support the video tag.
< /video >

PRO TIP: If you are thinking about embedding a video in Squarespace that will autoplay, think again! Autoplay videos can be extremely annoying and intrusive, and will likely result in people leaving your site very quickly.

This will work on most modern browsers, including Safari, Chrome, and Firefox. However, it will not work on Internet Explorer 11 and below.

The second way is to use the JavaScript API. This can be done by adding the following code to your page:

< script >
var v = document.getElementById("myVideo");
v.autoplay = true;
v.load();
< /script >

This will work on all browsers, including Internet Explorer 11 and below. However, it requires that the page have a video element with an ID of “myVideo”.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.