You have to use the movie node, not a texture node. Then you have to enable the Use Frame Extension on the movie node and animate the Frame Extension for example by keying it.