lukemcd
lukemcd

Reputation: 1501

Autoplay Start/Stop with GlideJS carousel

I have a GlideJS carousel and need to pause autoplay when video is playing in a slide. The autoplay component has start and stop methods but I can't tell from the documentation how to access component methods.

How do I access these methods?

var glide = new Glide('.glide', {
    type: 'carousel',
    gap: 0,
    autoplay: 6000
}).mount();

function onVideoPlay() {
    // doesn't work
    glide.stop();
    // doesn't work
    glide.autoplay.stop();
}

function onVideoStop() {
    // doesn't work
    glide.start();
    // doesn't work
    glide.autoplay.start();
}

Upvotes: 1

Views: 4112

Answers (1)

lukemcd
lukemcd

Reputation: 1501

Okay, I needed to read documentation more carefully. These will work: glide.pause(); glide.play();

Upvotes: 2

Related Questions