Youtube video won't play on homepage

tim1123
New Member
2 0 1

Hi. We are brand new to Shopify and don't have any experience with writing code at all.  I added a YouTube video to my home page 2 days ago and it worked fine.  Now, the play button is spinning and the video won't play.  Any ideas as to why?  Thanks!

Replies 22 (22)
danstoj
Excursionist
17 0 17

If you are using the Debut theme, it is a known issue. Contact Shopify support and they will help you out. I just did and they fixed it for me. 

EmilioDev
Tourist
3 0 0

Any idea what they did to make it work. They said they couldn't help me because im in the partner program

danstoj
Excursionist
17 0 17

No sorry, I asked but they could only fix it for me. It was something to do with the YouTube API. It is a known issue. 

tim1123
New Member
2 0 1

Thank you.  I am having difficulty even contacting Shopify support.  When I click on the 24/7 support, nothing happens.  Any suggestions?

danstoj
Excursionist
17 0 17

They showed me what they did. Hope it helps!

 

In theme.js

 

Add:

function getVideoOptions(evt) {
    var $target = evt.target.a ? evt.target.a : evt.target.f;
    return videos[$target.id];
  }

Remove (or comment out using "//"):

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

You are saint! This worked perfectly thanks for your help

danstoj
Excursionist
17 0 17

No problem. Glad it worked!

natalia7
New Member
1 0 0

Hi, my video used to play fine, but all over sudden stopped (not loading). I tried finding theme.js to implement your suggestion, but can't find it. Can you please let me know how to find theme.js

Thanks!

EmilioDev
Tourist
3 0 0
in your dashboard click customize theme. To the left of the customize
button there is a dropdown menu thats says action. click action and select
edit code
RioMobility
New Member
1 0 0

Worked for me thanks, it was hidden around line 2245 in the "theme.js" file (under "assets"). The first time it didn't save but I did it again, hit save and it worked!

JohnRC
New Member
1 0 0

Thank you! That worked for me as well.

Sobia
New Member
2 0 0

@danstoj wrote:

They showed me what they did. Hope it helps!

 

In theme.js

 

Add:

function getVideoOptions(evt) {
    var $target = evt.target.a ? evt.target.a : evt.target.f;
    return videos[$target.id];
  }

Remove (or comment out using "//"):

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

WOW you are a star... I've lost two nights of sleep trying to fix this issue (no previous any sort of experience, contacted shopify but no reply). This simple thing fixed it. Thank you

victoriaMT
New Member
1 0 0

This helped out a lot and my video works perfect ! thanks heaps for this ! 

AntBerz
New Member
1 0 0

Awesome- thanks!

trillionaire369
New Member
1 0 0

Can someone do a video showing this process.... Thank you

ChaseWorthen
New Member
1 0 0

I requested a callback from Shopify and they were able to transfer my store over to the Debut.2 theme. The issue was fixed and I assume this will allow me to add future videos without editing the code. 

Tlrobinson
New Member
2 0 0

Does it matter where I add this?

Jsanta
New Member
9 0 0

Hi! I'm having the same problem, can anyone help me please?

MyCritterCatche
New Member
1 0 0

I replaced the code but still the video won’t play? Any idea why?