I use looped videos in webpages not just as part of content, but as part of the design/branding chrome: done carefully, they can add subtle polish and visual interest, and if carefully encoded they can be extremely efficient bandwidth-wise. Only trouble is, if you just drop a video into a webpage, looped, you’re likely to get a glitch or brief pause at the loop point.
Managed (eventually) to track down what was causing it: if your video file contains an audio stream, even if it’s silent — and even if the player component is set to mute — browsers struggle with the loop point, presumably because they’re forcing the video to stop and restart completely each time it loops to make sure audio/video sync is correct.
So the answer is to remove the audio stream completely from the file. This is quick to do with ffmpeg, and doesn’t affect the encoding of the video stream, so it won’t affect video quality:
ffmpeg -i input_file.mp4 -c copy -an output_file.mp4
The “-c copy” means “copy the media streams without re-encoding”, and the “-an” means “omit any audio streams”.
Test:
(the original glitchy version – same video but with silent audio stream – is here)