Stream loop stalls for 2-3 seconds of the initial loop

I attached the code here in this codepen but it’s just pretty straight forward. Doesn’t matter if it’s code or not but what I have found is the entire video plays. Then it loops, on the first loop it just freezes, it’s still playing int he background but freezes. Then about 2-4 seconds into the video it picks back up. Only on the first loop through. This looks really bad in my opinion.

How can I prevent it from doing so? That’s a really bad loop transition.