<!--Библиотеки для слайдера -->
<link rel="stylesheet" href="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/assets/owl.carousel.min.css">
<link rel="stylesheet" href="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/assets/owl.theme.default.min.css">
<script src="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/owl.carousel.js"></script>
<script src="https://owlcarousel2.github.io/OwlCarousel2/assets/vendors/jquery.mousewheel.min.js"></script>
<style>
/*Стили кнопок слайдеров*/
.prev , .next {
cursor:pointer;
padding: 4px;
}
img.sliderarrowowl {
width: 35px;
margin-top: 15px;
border-radius: 17px;
transition: all 0.2s ease-in-out;
}
img.sliderarrowowl:hover {
transform: scale(1.2);
}
.owl-theme .owl-dots .owl-dot.active span, .owl-theme .owl-dots .owl-dot:hover span {
background: #c399ff;
}
.owl-theme .owl-dots .owl-dot span {
background: #e8f7ff;
}
img.sliderarrowowl:active {
transform: scale(0.9);
}
.owl-prev , .owl-next{
display: none !important
}
</style>
<style>
/*Стили для слайдера*/
.videoowl .owl-carousel .video {
height: 200px;
}
.videoowl .owl-carousel .owl-video-tn {
background-size: auto;
}
</style>
<!--Основа слайдера -->
<div class="owl-carousel owl-theme">
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/watch?v=uCNWuSbPnt4?enablejsapi=1&?rel=0&fmt=18&html5=1&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/watch?v=uCNWuSbPnt4?enablejsapi=1&?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/watch?v=uCNWuSbPnt4?enablejsapi=1&?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/_ghb2zYCbbM?enablejsapi=1&?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/dSYu8FLVr_Y?enablejsapi=1&?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/pk_fUhOo0nc?enablejsapi=1&?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/dlO8aANekSM?enablejsapi=1&?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="item video" data-merge="1"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/6aP7bun6KPw?enablejsapi=1&?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
</div>
<!--Кнопки слайдера -->
<span class="prev"><img src="https://clck.ru/F3kr9" imgfield="img" class="sliderarrowowl"></span>
<span class="next"><img src="https://clck.ru/F3kqp" imgfield="img" class="sliderarrowowl"></span>
<script>
$(document).ready(function() {
//Добавляем класс к нашему блоку
$('#rec224864468').addClass('videoowl');
setTimeout(function() {
$('.owl-carousel').owlCarousel({
items:1,
merge:false,
loop:true,
margin:10,
video:true,
center:true,
//Адаптация слайдера
responsive:{
0:{
items:1
},
960:{
items:3
}
}
});
//Кнопки для слайдера работа
$('.videoowl .prev').click(function() {
$(".videoowl .owl-prev")[0].click();
});
$('.videoowl .next').click(function() {
$(".videoowl .owl-next")[0].click();
});
}, 500);
});
//При пролистывании или закрытии галереи останавливаем видео
$(document).on('click', '.videoowl .owl-carousel', function() {
$(".videoowl iframe").each(function() { $(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*') });
});
</script>