sample code for video control