Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 1

Code Block: How can I autoplay a video?


Mike T
Go to solution Solved by foleyatwork,

Question

Hi. I have tried to embed code from both Vimeo and Youtube using their automatic startup code option (under share options) but when I run it it stills requires me to click the play button. Any ideas on how to do this would be appreciated, either Youtube or Vimeo is fine.

Edited by llogan
Link to post
  • Answers 22
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Popular Posts

Just thought I'd add a comment to share my recent experience. I had an iframe tag for embedding a video that is a countdown time to an upcoming event, and thus having the video play automatically is d

Has anyone been able to solve this yet for 7.0? I have tried many things and always get some videos that will play and some that won't randomly

Hi know this is an old post, but I thought I'd chime in.  I've manage to do this, and it pretty easy really.   I'm using Vimeo, and I have used the below iframe inside Squarespace's video block,

Posted Images

22 answers to this question

Recommended Posts

  • 2

Disclaimer: I almost always think autostarting videos is a terrible idea. Just my personal opinion. Please do good, not evil, with this answer.

With YouTube you can just add ?autoplay=1 to the end of the iframe URL. For instance:


<iframe width="420" height="315" src="http://www.youtube.com/embed/4KRZQQ_eICo?autoplay=1" frameborder="0" allowfullscreen></iframe>

Edited by foleyatwork

Developer Evangelist at Squarespace.

Link to post
  • 2

Hi know this is an old post, but I thought I'd chime in.  I've manage to do this, and it pretty easy really.  

I'm using Vimeo, and I have used the below iframe inside Squarespace's video block, not a code block.  But instead of adding the link, you can click <>  and insert this code.  

I am using it on our new SquareKicker website for our learn page here:  https://squarekicker.com/learn

Just swap out the vimeo number for yours.  See screenshot below for example.

<iframe src="https://player.vimeo.com/video/466007910?autoplay=1&loop=1&autopause=0&background=1&color=ffffff&controls=0&portrait=0" width="800" height= "500"  frameborder="0" allow="autoplay; fullscreen"  allowfullscreen></iframe>

It also will auto play on mobile.  You can adjust the settings for controls back to 1 instead 0.  And muted is background=1, so if you want sound change that, switch it to 0.  

 

Autoplay Video Block.png

SquareKickerHi, I'm Nick Ippolito, founder at squarekicker.com.  SquareKicker is a No-Code Design & Animation Extension for Squarespace.  With SquareKicker say goodbye to copy & paste Squarespace plugins. Customize your Squarespace website with this full control design and animation extension. 

Link to post
  • 0

I know what you mean about auto starting. I tried inserting the code and it does not seem to work; I even tried copy and pasting the entire line of code above no luck there either (it plays ok, but not automatically). I'll keep trying ..

Link to post
  • 0

I go to the video on Youtube, click on share, go to the embed option, cut and then in the Squarespace editing screen paste it into embed code (gear icon), then save. Maybe the Squarespace theme I have does not support that? I also tried just copying the code above and pasting it into the embed code window. The video works, just not automated. The link above autoplays for me when I go to it directly outside of Squarespace.

Link to post
  • 0

Just thought I'd add a comment to share my recent experience. I had an iframe tag for embedding a video that is a countdown time to an upcoming event, and thus having the video play automatically is desirable.

Dropping the tag into a code block was not ideal, as the code block was not responsive to browser window changes. I was placing two videos side-by-side, so having them resize was important. One would resize, and the other would not.

I ended up discovering that I could use a video block while also dropping in the iframe tag I had been given. I clicked the gear icon to the right of the URL box. That opened an Edit Embedded Data dialog. I took a shot and pasted the iframe tag into that box, and that did the trick. Despite the iframe tag including a width and a height, the video resizes along with the browser screen, and I'm able to have my two videos side-by-side. One is a countdown timer that auto starts. The other is a video that the user must click to play.

Link to post
  • 0

Using a video block on a page in Squarespace 7, I was able to have a Vimeo video auto-play by adding ?autoplay=1 to the end of the URL for the video. It will also work in an iframe.

Link to post
  • 0

Using a video block on a page in Squarespace 7, I was able to have a Vimeo video auto-play by adding ?autoplay=1 to the end of the URL for the video. It will also work in an iframe.

Link to post
  • 0

@foleyatwork

I'm embedding code from our companies wire drive - so it's not on Youtube or Vimeo. Here is the embedded code. Could you show me where to add the auto play within this block?

Thanks for your help - i'm not a coder...but trying my best to figure it out.

Cheers

Link to post
  • 0

Hey I was wondering if you would could post this code. I am also trying to get multiple videos to autoplay and would love if they were responsive. Any help would be appreciated.

Link to post
  • 0

Actually, you will have to use the "?" instead of "&" for your first parameter only. If you use more than one parameter, you will then have to add "&" to the chain. Many movie apps like Cinema apk on firestick are using this code to play movies automatically.

For instance, if you want to add autoplay and closed captioning, you will have to add this portion to your embedded video URL: ?autoplay=1&ccloadpolicy=1.It would look like this:

Blockquote

Link to post
  • 0

Hi @Mike T, I made a video tutorial for you on can autoplay a video. Hope this helps! https://www.askquesty.com/squarespace-answers/code-block-squarespace-tutorial

Have Squarespace questions/task and need help today? **You can hire us here.** Our answers are on-demand, video recorded, and only cost between $5 to $25. Estimates are free, 100% satisfaction guarantee, and trusted by hundreds of small businesses.

Link to post
  • 0

Hello. I had the same problem. I uploaded a video to Vimeo, I stopped using Youtube, Vimeo is just way easier to use for embedding video and has better quality playback.

I used a "video block" and entered the following code using the "embed data" feature in the video player settings:

<iframe src="https://player.vimeo.com/video/REPLACE WITH YOUR VIMEO CODE HERE?autoplay=1&loop=1&autopause=0&background=1&color=ffffff&controls=0&portrait=0" width="800" height= "500"  frameborder="0" allow="autoplay; fullscreen"  allowfullscreen></iframe>

I did change the width and height to what I needed, I recommend you do the same also.

This was posted by NickIppolito above. I can tell you it works on the Brine Template for 7.0 as thats what my site is built on. My video auto-plays and keeps looping which is what I needed. My video doesn't have any sound so I can't comment on that.

 

Edited by Skylab
Link to post
  • 0

Vimeo has the code here: https://vimeo.zendesk.com/hc/en-us/articles/115004485728-Autoplaying-and-looping-embedded-videos

Here's the code they provide:

<iframe src="https://player.vimeo.com/video/76979871?autoplay=1&loop=1&autopause=0" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>

I used a video block and opened up the brackets. Then dropped the code in and changed the video player link to my video (the numbers before the "?".

 

Link to post
  • 0

Hi All, 

i have a intro video that i want displaying full bleed, with audio, autoplay and play on mobile. 

I have been speaking to support and they say 'This isnt possible on squarespace, you need custom code' i have no idea how to do this. 

currently i have added my video as a background video on my home page. This auto plays but no audio and it doesn't play on mobile. I have iphone 10 and fast internet. 

Please can someone help me, 99% of the website traffic will be mobile so i want the video to play. 

Thanks Adam

Link to post

Create an account or sign in to comment

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


×
×
  • Create New...