I have an HTML5 video element on my page, it scales to fill the whole background with the idea that it will loop in playback. This works fine in Chrome, but Safari and Firefox stutter in a loop. This is a good half second in Firefox. Any ideas?
Here is my markup for the video player:
<video id="vid" preload="auto" autoplay loop onended="this.play();">
<source src="vid.mp4" type="video/mp4"/>
<source src="vid.webm" type="video/webm"/>
</video>
I tried several things, for example, to fully control JS playback instead of relying on the browser to figure this out. But she always stutters. I don’t think that this is a problem with preloading, because if I do it all locally, the video loads instantly (obviously), but the same loop is there. Is this just a problem with these browsers?
I am tempted to create two instances of the video and just switch them using JS after each completion. That would be really dirty, but I'm not sure what other options I have.
source
share