PHP and JavaScript for DVR