Yeah, sorry, you are right, the site is going to load only 2 videos.
The one that actually plays during scroll stays as passive, that’s why I was considering that one, but since that video is already loaded I shouldn’t worry about that one.
Anyway, as far as I can tell, I think I finally managed to fix it:
(Reverse is temporally disabled until I complete cleaning up the messy code I have right now)
Is only disabled in this test site, the one in my main post have reverse scrolling enabled.
Having only two videos loaded, each one in 2 different divs:
one with z index -1
The other with -2
Dynamically I am alternating the current video to play on the top div while sending the inactive video to the bottom div, so when the video swap occurs, there is no blank space since the inactive video stills in the background.
Using $("#" + dinamycwrapperPLAYING).bind("ended", function()
I only load the next video as soon the one currently playing stops, THAT is what seems that got rid of that strange glitching.
The whole code that fixed the glitching is this:
// PLAY VIDEO BLOCK ▼
hypeDocument.getElementById(dinamycwrapperPLAYING).play();
$("#" + dinamycwrapperPLAYING).bind("ended", function() {
hypeDocument.functions().scroll_ON(hypeDocument, element, event); //-------- ACTIVATE SCROLL
// PREPARE NEXT VIDEO
$("#" + dinamycwrapperNEXT).attr('src', '${resourcesFolderName}/' + dynamicNext);
$("#" + dinamycwrapperNEXT)[0].load();
});
// PLAY VIDEO BLOCK ▲