added if to control if video is rendered