added video preview, fixed bugs in the example