Adding support for videos

It took some work, but, at last, here's a version with video support! You're welcome to add any test that comes to your mind, and to let me know what you think of the whole patch.

Cheers!