In the absence of the user video is included. When active, it turns off. The first video is played, the user clicks and the video is turned off, the user is not active again and the SECOND video is already activated. If the second is reproduced, then the THIRD turns on and so on in a circle. How to make such a sequence? You also need to make an interval between playbacks. Whatever the first, for example, ends and passes some time before the second is turned on. Thank.
<video id="video" autoplay=""> <source class="vidActive" src=""> <source src=""> <source src=""> </video> Js:
idleTimer = null; $("#video").prop("muted", true); $(document).bind('mousemove keydown scroll', function() { clearTimeout(idleTimer); if(idleState == true){ $(".video-container").css("display", "none"); $("#video").prop("muted", true); } idleState = true; idleTimer = setTimeout(function() { $(".video-container").css("display", "block"); $("#video").prop("muted", false); idleState = true; return false; }, idleWait); });