Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. cAROUSEL HOVER ON AUTOPLAY DOESN'T STOP AUTOPLAY IF CAROUSEL CONTAINS VIDEOS

cAROUSEL HOVER ON AUTOPLAY DOESN'T STOP AUTOPLAY IF CAROUSEL CONTAINS VIDEOS

Scheduled Pinned Locked Moved Bug Reports
9 Posts 3 Posters 70 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jayrusselldotco
    wrote on last edited by
    #1

    Hey,

    A small thing but I am trying to have my carousel autoplay as it is the homepage of my site. I have decided to include some videos inside this autoplay carousel. With the thinking if you want to watch more of the video you hover over to click play and it pauses the autoplay feature. However in practice clicking play on any video causes the autoplay to initialise and takes you straight out of the video.

    site is www.jayrussell.co.uk

    any help appreciated !

    Thanks,

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      oh yea u have youtube and vimeo videos in your carousel
      since these are iframes its not possible to check if they have a mouseover

      this wont work

      only way is if you would have html5 videos in your carousel instead of youtube or vimeo videos

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jayrusselldotco
        wrote on last edited by
        #3

        Got it. I have now replaced these with HTML5 videos. Only annoyance is the carousel seems to fix the videos to being 16:9. Two of mine are closer to 4:3. I have tried alot of ways to change this. This html worked but would effect all videos styling. I tried more simpler approaches with simple CSS but couldn't get that to work.

        <script>
        function fixVideoSlides() {
        document.querySelectorAll('.lay-carousel-slide-html5video video').forEach(video => {
        video.removeAttribute('data-w');
        video.removeAttribute('data-h');
        video.removeAttribute('data-ar');
        video.style.removeProperty('aspect-ratio');
        });

        document.querySelectorAll('.lay-carousel-slide-html5video .ph').forEach(ph => {
          ph.style.paddingBottom = '0';
        });
        

        }

        window.addEventListener('DOMContentLoaded', fixVideoSlides);
        window.laytheme?.on('newpageshown', () => {
        setTimeout(fixVideoSlides, 200);
        });
        </script>

        Any tips?

        1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote on last edited by arminunruh
          #4

          sometimes wordpress does not recognize the aspect ratio of a video correctly. i coded a way into lay theme to set the size by hand.

          pls go to your media library
          click on a video, then click on "edit more details":
          image.png

          then enter the correct dimensions of the video here and click save
          ee8cc168-300e-487d-9e90-bdb2eeada79a-image.png

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jayrusselldotco
            wrote on last edited by
            #5

            Hey Armin,

            I had a look at this but the dimension in the media library are correct.

            It doesn't seem to recognize this inside the carousel for some reason

            Screenshot 2025-06-06 at 12.35.16.png
            Screenshot 2025-06-06 at 12.34.32.png

            A 1 Reply Last reply
            0
            • J jayrusselldotco

              Hey Armin,

              I had a look at this but the dimension in the media library are correct.

              It doesn't seem to recognize this inside the carousel for some reason

              Screenshot 2025-06-06 at 12.35.16.png
              Screenshot 2025-06-06 at 12.34.32.png

              A Offline
              A Offline
              alasdair17
              wrote on last edited by
              #6

              @jayrusselldotco hey, this might not be right for you but try adding this into css and see how it looks:

              video {
              object-fit: contain;
              }

              1 Reply Last reply
              0
              • arminunruhA Offline
                arminunruhA Offline
                arminunruh
                Global Moderator
                wrote on last edited by arminunruh
                #7

                great idea @alasdair17

                ok @jayrusselldotco
                i changed something in the code that could resolve the issue.
                could you update lay theme now please and then check again?
                ( this fix needed a lay theme update, not a carousel update)

                if you use a caching plugin can you temporarily disable it just to check it then

                1 Reply Last reply
                1
                • J Offline
                  J Offline
                  jayrusselldotco
                  wrote on last edited by
                  #8

                  This solved it. Thankyou Armin !!

                  1 Reply Last reply
                  0
                  • arminunruhA Offline
                    arminunruhA Offline
                    arminunruh
                    Global Moderator
                    wrote on last edited by
                    #9

                    sure! amazing videos!

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    I also code custom websites or custom Lay features.
                    šŸ’æ Email me here: šŸ’æ
                    info@laytheme.com

                    Before you post:
                    1. When using a WordPress Cache plugin, disable it or clear your cache.
                    2. Update Lay Theme and all Lay Theme Addons
                    3. Disable all Plugins
                    4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                    This often solves issues you might run into

                    When you post:
                    1. Post a link to where the problem is
                    2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                    3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                    Online Users
                    R
                    renno
                    Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                    laytheme.com
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Search