M
M
Mikhail Gilmutdinov2017-02-09 22:13:34
YouTube
Mikhail Gilmutdinov, 2017-02-09 22:13:34

How to make the slider stop when watching a video?

How to make the slider stop when watching a video?
3rd slide.

I found this piece of code! How to connect it with owlCarousel and send an event to stop when the video is clicked?

<script>
function onYouTubePlayerReady(playerId) {
  ytplayer = document.getElementById("myytplayer");
  ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}
  function onytplayerStateChange(newState) {
   alert("Player's new state: " + newState);
}
</script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Shcherbokov, 2017-02-09
@drogwur

Use the YouTube API. + API owl carousel

owl.trigger('play.owl.autoplay',[1000]); //Запуск
owl.trigger('stop.owl.autoplay');//Остановка

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question