-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
38 lines (33 loc) · 1.33 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function ds(target, currentSlide, nextSlide){
let youtubeCloneCount = 0;
postMessageToPlayer(playerTrigger, {
"event": "command",
"func": "stopVideo"
})
if(video != undefined){
video.get(0).pause();
video.get(0).currentTime = 0;
video = undefined;
}
var videoFun = target.find('[data-slick-index="'+nextSlide+'"] video').length;
if(videoFun === 1){
video = target.find('[data-slick-index="'+nextSlide+'"] video');
if (video != null) {
videoLogic(target, video)
}
}
// YouTube FUnction Starts
var youTube = target.find('[data-slick-index="'+nextSlide+'"] iframe').length;
if(youTube === 1){
var cloneVar = "clone-"+youtubeCloneCount;
target.find('[data-slick-index="'+nextSlide+'"] iframe').attr("id", cloneVar);
var frameId = target.find('[data-slick-index="'+nextSlide+'"] iframe').attr("id");
var videoId = target.find('[data-slick-index="'+nextSlide+'"] iframe').attr("data-id");
youtubeFunction(target, frameId, videoId);
youtubeCloneCount++;
}
// console.log(videoFun +" - "+ youTube)
// if(videoFun !=1 && youTube != 1){
// target.slick("slickPlay")
// }
}