update some code for video support.