Home Forums WoodMart support forum Product Video – Can’t turn off Youtube loop

Product Video – Can’t turn off Youtube loop

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #603117

    gisli
    Participant

    Hey there,

    I’m trying to get the Product Video feature to work but I’m running into two issues:

    1. 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.
    2. 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?
    #603135

    Luke Nielsen
    Keymaster

    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

    #603170

    gisli
    Participant

    Here’s the requested access and url.

    #603484

    Luke Nielsen
    Keymaster

    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

    #604093

    gisli
    Participant

    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!

    #604094

    Luke Nielsen
    Keymaster

    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

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Product Video – Can’t turn off Youtube loop’ is closed to new replies.