@kentos

Как сделать, чтобы на каждое видео срабатывало?

Здравствуйте, как сделать, чтобы на каждое видео сработал метод
вот код

// Connected Vimeo API

let iframe = document.getElementById("myVideo");
let player = new Vimeo.Player(iframe);

player.ready().then(function() {
 console.log("ready the video!");
 swiper.autoplay.start();
});

player.on("play", function() {
  console.log("played the video!");
  swiper.autoplay.stop();
});

player.on("pause", function() {
  console.log("pause the video!");
  swiper.autoplay.start();
});

// init. slider

let swiper = new Swiper(".swiper-container", {
  slidesPerView: 1,
  spaceBetween: 30,
  loop: true,
  pagination: {
    el: ".swiper-pagination",
    clickable: true
  },
  navigation: {
    nextEl: ".swiper-button-next",
    prevEl: ".swiper-button-prev"
  },
});


и ещё не срабатывает вот это
player.ready().then(function() {
 console.log("ready the video!");
 swiper.autoplay.start();
});

в консоле ошибка TypeError: Cannot read property 'start' of undefined
at slider.js:8

слайдер Swiper, видео vimeo
  • Вопрос задан
  • 78 просмотров
Пригласить эксперта
Ответы на вопрос 1
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы