Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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:
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.
This fix isn't working, I am unable to save the file after making the change. See attached. Any thoughts?
This worked like a charm! Thank you so much!
I'm having the same problem.
return videos[evt.target.a.id];
I check the js file and cant even find
return videos[evt.target.a.id];
Video not loading up for me
@Ababusa @digitalmirrors share your store's URL so I can take a look, it might not be related.
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
@Visely-Team wrote:@Ababusa @digitalmirrors share your store's URL so I can take a look, it might not be related.
Can you take a look at mine too ?
Hi Visley,
This is my link : agail-air.myshopify.com
Please help
@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]; }
I am having the same problem many people are having. My video is not playing and tried changing the one letter to "l" and still not working. My defaultis..
function getVideoOptions(evt) {
return videos[evt.target.a.id];
Can you help?
Are you able to adjust mine as well? My stores URL is TwentySomethingsCloset.com
Thank you very much, works like a charm now
It works now! Thanks!
Hi, I had this issue about a year ago and your initial solution of changing the "H" to "A" worked. The problem returned except changing the "A" to "L" results in a playback error. Any ideas?
Thank you for your prompt response.
Someone helped me solve the problem.
Changed [evt.target.a.id] to [evt.target.g.g.id] and it worked for anyone else having the issue
"g.g." Thanks!
Thank you for taking the time to write this down. It helps alot.
This works on my end. Thanks!
This worked for me too. Thanks SankarN.
Yay thank you, I used the [evt.target.g.g.id] and it worked amazingly.
I was using a link from youtube that was on public and it wasn't working until i tried this code.
Much appreciated!
return videos[evt.target.h.id];
return videos[evt.target.a.id];
return videos[evt.target.l.id];
return videos[evt.target.g.g.id];
The very last one worked for me. Thank you!!!!
hi my stores doing the same i found the section and ive changed the code from .a to .l and still no fix for me
Changing the code from "l" to "g.g" (see red text below) worked for me:
function getVideoOptions(evt) {
return videos[evt.target.l.id];
to
function getVideoOptions(evt) {
return videos[evt.target.g.g.id];
Though I had changed the code from "a" to "l" a few weeks ago, and that worked then... A bit frustrating that the video was broken again and that there was another fix that had to be made so soon after.
@sublimajewelry true, it is frustrating. I am providing this simple fix so it can be easily done by anybody, no matter the skillset and familiarity with coding.
Here is a better fix for Brooklyn theme that shouldn't break with updates to the theme:
function getVideoOptions(evt) { var id = evt.target.getIframe().id; return videos[id]; }
Hi @Visely-Team - Thank you for responding! I use the Debut theme - is it the same code for that, too? Thank you!
My url is www.royaltyHolistics.com I’ve tried changing to .a, .l, and g.g neither works
Visely helped me with this and it worked
Looks like the theme got updated. Change it to:
var $target=evt.target.h;
Hi! Could you look at my website and see if you can identify why my homepage video is not loading? Much appreciated! https://bluequail.com/
var $target = evt.target.h;
https://vitalvybz.com this is my url can you please help me with the same problem. can you please help me out.
linea 2215
This worked for me too - thank you for posting!
@Visely-Team wrote:@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]; }
Hey Visely,
I tried this fix and changed it to L, and now the video is loading but still no audio.
This is my preview link:
I'd appreciate your help.
TOTALLY worked for me. Thank you!
Hey there,
Im using debut as well and the youtube videos that were playing initially are not now. Just a continuous load. Ive read along where there you say there is a coding issue, but where do i find that? Im a novice with Shopify...here is my URL. Any help is appreciated!
https://tanningclub.myshopify.com/
Tyler
Hi! Watch this video it will show you where to find the code
My code has the same: "return videos[evt.target.f.id];"
Would you be able to fix mine as well? My store url is https://arteisch.com/?key=71b3b3662c062601396fd1bd1d9fb84ad1dcac7ea2f24e34f429b07631d22221
Youtube link - https://www.youtube.com/watch?v=RvP3g2I67kw
Hi we are having the same problem with two of our videos . Can you help me wtih this ? https://mangrovebayporlacasa.com/ is store front.
Worked for me too!!! Thanks!
Hi,
when i add video it is not loading
my code is
function getVideoOptions(evt) {
return videos[evt.target.a.id];
}
what you have said to add is already present in my code.can you please tell how to fix it
We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024