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

Code Block: How can I autoplay a video?

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

Share this post


Link to post

18 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.

Share this post


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 ..

Share this post


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.

Share this post


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.

Share this post


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.

Share this post


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.

Share this post


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

Share this post


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.

Share this post


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

Share this post


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.

Share this post


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...