Functions – Site Launch Animation GIF Loading Adaptation

When I started my website, I put a GIF animation that fades to the current website and with different WiFi speeds, the fade point of the video is different.
Now, I will not explain how I implemented the video because it will take too much time.
So the real question is how to set up a gif on the start of the website that would adapt to the speed of WiFi, without loop or premature fade.
Ideas?