Moved the video and popup display code to a single file