Why is my homepage video constantly loading on debut theme?

I’m trying to insert this video into the homepage of the debut theme.The video is forever loading and the play button doesn’t work. How can I fix this?

https://www.youtube.com/watch?v=p7DjwxFcUdA

Heres the link to my store:

https://simplywooden.myshopify.com/

1 Like

Hey there,

The reasons is a javascript error that happens during video loading. Make a copy of your currently live theme, locate your theme.js.liquid file and find a snippet similar to this one:

  function getVideoOptions(evt) {
    return videos[evt.target.h.id];
  }

adjust it to read:

  function getVideoOptions(evt) {
    return videos[evt.target.a.id];
  }

notice the exchange of .h. with .a.

4 Likes

This fix isn’t working, I am unable to save the file after making the change. See attached. Any thoughts?

1 Like

This worked like a charm! Thank you so much!

I’m having the same problem.

I checked theme.js, but it already has

return videos[evt.target.a.id];

Any idea on how to fix this?

1 Like

I check the js file and cant even find

return videos[evt.target.a.id];

Video not loading up for me

1 Like

@Ababusa @digitalmirrors share your store’s URL so I can take a look, it might not be related.

1 Like

I’m terribly sorry, I should have returned once I figured out my fix, kind of simple and actually embarrassed I didn’t pick up on it

For anyone else having this issue please do firstly check the video you’re using is at least accessible by using a shareable link

Rookie mistake I know

1 Like

My video Theme.js has the same code you recommand, but my video still not working, what should I do ?

1 Like

Can you take a look at mine too ?

1 Like

@Agail please share a preview URL.

1 Like

Hi Visley,

This is my link : agail-air.myshopify.com

Please help

Hi Visley

The following is the preview link

https://2dqybtl1wm4rzsij-36715790381.shopifypreview.com

My code has the same: “return videos[evt.target.a.id];”

Would you be able to fix mine as well? My store url is www.exlnce.store

@Agail in your theme.js find the following snippet:

  function getVideoOptions(evt) {
    return videos[evt.target.a.id];
  }

and adjust it to read:

  function getVideoOptions(evt) {
    return videos[evt.target.l.id];
  }
8 Likes

@EXLNCE please see my reply to @Agail above. You should do the same.

1 Like

Thank you very much, works like a charm now

1 Like

I have checked the code- and it is correct - but the videos are still not loading (they did load previously?)

can you help?

@mariekedegoeij what’s your preview URL?

1 Like

It works now! Thanks!