Splidejs / splide

Splide is a lightweight, flexible and accessible slider/carousel written in TypeScript. No dependencies, no Lighthouse errors.
https://splidejs.com
MIT License
4.83k stars 418 forks source link

Every other loop video won't play #1172

Open teunhompe opened 1 year ago

teunhompe commented 1 year ago

Checks

Version

v4

Description

I'm using splide to loop a mix of textslides and videoslides on narrowcasting. I'm using htmlVideo, set to

Complete splide options:

var splide = new Splide( '.splide', {
                type: 'fade',
                autoplay: true,
                interval: 15000,
                rewind: true,
                arrows: false,
                pagination: false,
                pauseOnHover: false,
                video: {
                    autoplay: true,
                    loop: false,
                    mute: true,
                    playerOptions: {
                        htmlVideo: {
                            autoplay: true,
                            loop: false,
                            mute: true,
                        },
                    },
                },

            });

Videos are hosted on a CDN. Slides with a video get an data-splide-interval set to the exact duration of the video. Somehow, every other run videos won't play. So, on first run a video plays till its end, we move on to the next slide(s) and all is well. On the second run however, the video is displayed in it's end state. On the third run, the video plays again. On the fourth... etcetera, etcetera. Obviously the expected/desirec behaviour is for it to run every single time.

Maybe (hopefully) I'm making a mistake somewhere. If not, this might be a bug.

Reproduction Link

No response

Steps to Reproduce

Expected Behaviour

Videos always play

teunhompe commented 1 year ago

Managed to work around the issue by using .load() and .play() when video elements become 'active'.