How can I make the sequence video start blend with the end when looping?

I’m using a sequence video as fog, but when the sequence plays and reaches the end it resets to the start and so resets the fog, how can I make so that, when it reaches the end, it goes back to the start while mantaining how the fog looked at the end.