sample code for taking video