Product Video – Can’t turn off Youtube loop
-
Hey there,
I’m trying to get the Product Video feature to work but I’m running into two issues:
- The get_video_content function always forces the &loop=1 attribute to all embedded Youtube links. How do I stop product videos from looping? Ideally I would only want the product video to play once.
- I’m having the same issue this user was having: https://xtemos.com/forums/topic/set-video-to-not-repeat/
The video continues playing in the background after clicking the next arrow. Inserting the script provided in the other post seems to stop the video from playing entirely. How do I stop the video from playing in the background after pressing the next arrow?
Hello,
Send me access to the admin panel so I can investigate those issues. Also, send me the URL link where you have that youtube video.
Thank you in advance.
Kind Regards
Here’s the requested access and url.
Hello,
1. You can enable the Native player to avoid looping the video – https://take.ms/lZIDs. Let me know if that solution suits you.
2. Add the code below into the “On document ready” area:
setTimeout(function() {
const swiperElement = document.querySelector('.woocommerce-product-gallery__wrapper:not(.quick-view-gallery)');
if (swiperElement && swiperElement.swiper) {
swiperElement.swiper.on('slideChange', function() {
jQuery('.woocommerce-product-gallery__wrapper:not(.quick-view-gallery)')
.find('.wd-carousel-item.wd-video-playing .wd-play-video')
.trigger('click');
});
}
}, 5000)
Kind Regards
Hey Luke and thanks for the quick reply. The code you provided seems to stop the video from loading. Funnily enough though, switching to the native player solves both issues. The video no longer loops and switching to the next slide stops the video.
You can consider this topic solved, thanks!
Hello,
Thank you for confirming the solution! I’m glad switching to the native player resolved both issues with looping and background play when switching slides. If you have any more questions or need further assistance, feel free to reach out.
Kind Regards
The topic ‘Product Video – Can’t turn off Youtube loop’ is closed to new replies.