Added Video Support

Added video support and tidied up the code a little bit.