Jump to content

CAN YOU SOLVE THIS? | Custom Video Autoplay On Hover Problem

Recommended Posts

Hi all, having a weird issue...

Here is my site

I have some custom html and javascript code injected into code blocks that autoplay a small looping video upon hover. 

You can see the problem happening for the first time when you visit the site and click on the “Film” link at the top.

Hovering over the images loads the video, but it does not play. When you refresh the browser, the autoplay works perfectly.  And from that point on, navigating to another page on the website and back does not break the code, it still works.

It seems to only be first time visits that the videos do not function correctly...

Some more info:

  • The videos are uploaded via the Link Editor. That's the only way I've found to obtain a solid URL. I haven't been able to find URL's for the asset library videos for some reason.
  • The code is reading those URL's.
  • MP4 Files are relatively small and short (under 3-4 mb each)
Edited by steve11
adding link to site
Link to comment
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...
On 6/24/2023 at 1:42 AM, steve11 said:

Hi all, having a weird issue...

Here is my site

I have some custom html and javascript code injected into code blocks that autoplay a small looping video upon hover. 

You can see the problem happening for the first time when you visit the site and click on the “Film” link at the top.

Hovering over the images loads the video, but it does not play. When you refresh the browser, the autoplay works perfectly.  And from that point on, navigating to another page on the website and back does not break the code, it still works.

It seems to only be first time visits that the videos do not function correctly...

Some more info:

  • The videos are uploaded via the Link Editor. That's the only way I've found to obtain a solid URL. I haven't been able to find URL's for the asset library videos for some reason.
  • The code is reading those URL's.
  • MP4 Files are relatively small and short (under 3-4 mb each)

Hello can you share your code that when I hover my mouse the video will autoplay?

Link to comment

I suspect that there is no custom code involved in this particular case. The hover video effect is a feature of that particular template (v7.0, York template family).

I know of no solution for the desired effect. That doesn't mean that one couldn't be created with some effort.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

I saw someone have site like when I hover my mouse the video plays this is his site https://www.henaofx.com/

3 minutes ago, creedon said:

I suspect that there is no custom code involved in this particular case.The hover video effect is a feature of that particular template (v7.0, York template family).

I know of no solution for the desired effect. That doesn't mean that one couldn't be created with some effort.

 

Link to comment

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.