Jump to content

Custom code not working on live site

Recommended Posts

Posted

Hey guys, could really do with some help! 

I'm trying to figure out an issue with a basic piece of custom code not working with Squarespace. 

The code in question is below:

<center>
  <video autoplay="autoplay" loop="true" width="300">
    <source src="https://static1.squarespace.com/static/63c42a40636ad73a40b61949/t/63c45734cd040609661b246c/1673811785159/NO+MUSIC+-+Website+Home+Screen+.mp4" type="video/mp4"/>
  </video>
</center>

It works fine in design mode both for mobile and desktop but on the live site it's static and doesn't move at all. Attached is a video of how it should appear on the live site and a screenshot of what is currently happening. 

Any recommendations would be much appreciated. 

KC :) 

 

Screenshot 2023-01-23 at 10.29.43.png

  • Replies 1
  • Views 236
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Posted (edited)
1 hour ago, KCYourEdit said:

I'm trying to figure out an issue with a basic piece of custom code not working with Squarespace. The code in question is below:

<center>
  <video autoplay="autoplay" loop="true" width="300">
    <source src="https://static1.squarespace.com/static/63c42a40636ad73a40b61949/t/63c45734cd040609661b246c/1673811785159/NO+MUSIC+-+Website+Home+Screen+.mp4" type="video/mp4"/>
  </video>
</center>

Some notes about the format of your HTML:

  • autoplay="autoplay" is deprecated. You can include the attribute autoplay instead.
  • In some browsers, autoplay doesn't work if no muted attribute is present
  • loop="true" is also deprecated. As above, just include the attribute loop
  • the center element is deprecated and should be avoided. CSS should be used instead.

When I add this instead, it plays for me on a live test site:

<video autoplay loop muted width="300">
  <source src="//static1.squarespace.com/static/63c42a40636ad73a40b61949/t/63c45734cd040609661b246c/1673811785159/NO+MUSIC+-+Website+Home+Screen+.mp4" type="video/mp4">
</video>

Did this help? Please give feedback by clicking an icon below  ⬇️

 

Edited by paul2009

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.